Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Elder Postsman
Aug 30, 2000


i used hot bot to search for "teens"

MALE SHOEGAZE posted:

What in the heck is liquibase

i've heard people talk about liquibase at my job. i don't know what it is.

Adbot
ADBOT LOVES YOU

Elder Postsman
Aug 30, 2000


i used hot bot to search for "teens"

it might have something to do with databases though???

Bloody
Mar 3, 2013

if i wanted to version control my database i would check the sqlite.db into svn

Valeyard
Mar 30, 2012


Grimey Drawer

Bloody posted:

if i wanted to version control my database i would check the sqlite.db into svn

lol

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i dont understand why you would want to version control a data base. code is meant to be versioned and static, databases are dynamic. have some code that you want to be able to change on the fly in production? stick it in a database field and eval it. now you can write code, dynamically, without having to restart your web app

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

St Evan Echoes posted:

i still have my course notes and materials from the db course i took a while back if you give me an email address

that'd be great, my email is listed in my profile

Valeyard
Mar 30, 2012


Grimey Drawer
the 3rd year database class is the only class i have failed :negative:

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

What in the heck is liquibase

it's a migrations library for java

it helps you track schema changes and generate deployment/rollback plans to migrate the data among schema versions

MALE SHOEGAZE posted:

i dont understand why you would want to version control a data base. code is meant to be versioned and static, databases are dynamic. have some code that you want to be able to change on the fly in production? stick it in a database field and eval it. now you can write code, dynamically, without having to restart your web app

the data is highly dynamic

the schema is not

Valeyard
Mar 30, 2012


Grimey Drawer

Notorious b.s.d. posted:

it's a migrations library for java
it helps you track schema changes and generate deployment/rollback plans to migrate the data among schema versions

ah so its like "south" in python then?

Notorious b.s.d.
Jan 25, 2003

by Reene

Snapchat A Titty posted:

if it interfaces with the db, it is db code. put the entire application in the database

this was something people actually did in the 80s and 90s. dbase, oracle forms, etc

when you read old Byte articles from the 90s and they're talking about the "client-server" revolution they're talking about running the application in a separate process from the database

this was a rly big deal at the time

Notorious b.s.d.
Jan 25, 2003

by Reene

Valeyard posted:

ah so its like "south" in python then?

yeah it's exactly like south except that the people who wrote it accounted for corner cases and actually knew what the gently caress they were doing

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
south is a piece of poo poo, I'll give you that

Valeyard
Mar 30, 2012


Grimey Drawer

Notorious b.s.d. posted:

yeah it's exactly like south except that the people who wrote it accounted for corner cases and actually knew what the gently caress they were doing


Symbolic Butt posted:

south is a piece of poo poo, I'll give you that

the first time i used south it managed to get the database into such a state that it was easier to delete (in a dev enviroment on a stupid uni project) the database than try to figure out why south was complaining about it being unrecoverable

Valeyard fucked around with this message at 01:02 on Nov 22, 2014

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Notorious b.s.d. posted:

it's a migrations library for java

it helps you track schema changes and generate deployment/rollback plans to migrate the data among schema versions


the data is highly dynamic

the schema is not

not if you have code that generates new tables on the fly!

Space Whale
Nov 6, 2014

Space Whale posted:

Through CTCI, brain teasers, code rust, being good at selling myself, and being acceptable at code monkey things, I managed to get myself a mid level job. Woo hoo!

As such I'm now exposed to stuff like the actual ISS server and the messaging queue and other things that are beyond just "poke around project, mash F12, and do what BA says, and make sure stylecop is happy." I actually feel that "oh poo poo I'm a faker" feeling again, which means I'm learning.

What do you DO to really get all this stuff besides ask questions, stay late and buddy up to the IT guys?

Why did I post this?

So the messaging queue goes from "hey let's just back up and stop and need to be restarted" to "let's look like everything is fine with no pending messages... and fail silently as poo poo." Me and the other FNG keep going "wtf?" at this. Still don't know what's up. I still don't know what the messages are or what is actually going on yet, but I only today got everything set up to even get into code and get on the dev/QA/UAT/production servers.

IIS doesn't want to work on my windows 8 machine. I am the first dev using windows 8. The guys using windows 7 had to beat it into working. I now just went "ok gently caress it IIS Express I'll make sure I remember to not check in the web.config changes." Let's see if I do.

Our entire team and for that matter our office and equipment is new as poo poo, 5 months at the oldest, and still growing. We still don't have deployment or provisioning automated for setting up a new dev machine. OTOH I'm already helping other devs with stuff so I'm not useless :3:

What can I do besides bring up "hey X is a good idea" while things are still so new?

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

St Evan Echoes posted:

i still have my course notes and materials from the db course i took a while back if you give me an email address

hell yeah, got it and thanks

BONGHITZ
Jan 1, 1970

Space Whale posted:

Why did I post this?

So the messaging queue goes from "hey let's just back up and stop and need to be restarted" to "let's look like everything is fine with no pending messages... and fail silently as poo poo." Me and the other FNG keep going "wtf?" at this. Still don't know what's up. I still don't know what the messages are or what is actually going on yet, but I only today got everything set up to even get into code and get on the dev/QA/UAT/production servers.

IIS doesn't want to work on my windows 8 machine. I am the first dev using windows 8. The guys using windows 7 had to beat it into working. I now just went "ok gently caress it IIS Express I'll make sure I remember to not check in the web.config changes." Let's see if I do.

Our entire team and for that matter our office and equipment is new as poo poo, 5 months at the oldest, and still growing. We still don't have deployment or provisioning automated for setting up a new dev machine. OTOH I'm already helping other devs with stuff so I'm not useless :3:

What can I do besides bring up "hey X is a good idea" while things are still so new?

are you on drugs?

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

fst(valeyard.mom)

gonadic io
Feb 16, 2011

>>=

Captain Foo posted:

fst(valeyard.mom)

fst (mom valeyard)

:sperg:

Valeyard
Mar 30, 2012


Grimey Drawer
almsot done with this thing

curious why this doesnt work:

code:
bool = "!$acc bufdecls" =~ "!$acc bufdecls" :: Bool
i know it would work if I changed =~ to ==, but the above SHOULD still work, right?

by "doesnt work" i mean it returns False instead of True

edit1: I realised I had to escape the $ symbol, doh

a more pressing issue is how to have a string tabbed :(

if I have "blah" i need something like " blah"

edit2: i realised i could just put literally 8 spaces or whatever, that should do for now anyway

Valeyard fucked around with this message at 05:14 on Nov 22, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

not if you have code that generates new tables on the fly!

temp tables are not part of the schema

if you are actually creating schema changes on the fly, you need to stop doing that. either move to a non-sql database w/ an explicitly additive schema, or fix your g-d app

ignoring the clarity issue, it's just a bad idea. creating a table is an expensive operation on most SQL DBs. global locks and poo poo

Lord Of Texas
Dec 26, 2006

Notorious b.s.d. posted:

yeah it's exactly like south except that the people who wrote it accounted for corner cases and actually knew what the gently caress they were doing

yeah, given the fuckload of different relational databases they have to account for, they've done a pretty drat good job.

Liquibase is awesome for version control of course, but it also lets you do sweet stuff like spin up a local H2 database just-in-time to run database integration tests or your local server against. It also keeps track of your schema in a way that is database impl-agnostic (mostly) so you can be sure your poo poo isn't coupled to a particular vendor (or at least you know what part of it is coupled)

(not a rep for LB I promise)

(LB is not quite SVN or Git, so if you implement it don't let any dumbfuck dev mess with it, they will drop all of your tables I guarantee)

Notorious b.s.d.
Jan 25, 2003

by Reene
liquibase is still really bad, it's just shitloads better than south or activerecord migrations. a low bar to clear.

i don't know of any better way to do what liquibase does. versioning schemas and migrating data just sucks

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Notorious b.s.d. posted:

liquibase is still really bad, it's just shitloads better than south or activerecord migrations. a low bar to clear.

i don't know of any better way to do what liquibase does. versioning schemas and migrating data just sucks

Like what are you complaints about it?

Lord Of Texas
Dec 26, 2006

Janitor Prime posted:

Like what are you complaints about it?

Most of my complaints are more tied to the reality of versioning database objects than with Liquibase itself.

E.g. if you want to replace a method in typical code, you remove that method, update references to whatever new method you're using, and commit. It's merged to trunk immediately and at worst you have to do a quick manual merge if your VC can't figure it out. If you want to replace a table in your Liquibase changelog, you're dropping all constraints against that table, making sure the table's data is cleared or migrated, recreating the table, recreating the constraints, and repopulating data if you need to. And all of that, what a traditional VC would manage behind the scenes (all of the little actions that it takes to version code) lives explicitly in your gigantic Liquibase changelog.

If everything goes happy path you might never have to look at all those changesets again, but good luck with that.

I do have some complaints with the tool itself, it doesn't handle cross-schema dependencies well (although you could argue cross-schema dependencies are often not a great design choice anyway) and the diff is just useful enough to tempt people to use it to manage changes (via a "canonical" non-used schema) but sucks just enough to cause major fuckups when you rely on it (it sees renames as drop+add, misses some types of database objects entirely). But really those also just come down to the suckiness of database object versioning.

Lord Of Texas fucked around with this message at 18:40 on Nov 22, 2014

Seaside Loafer
Feb 7, 2012

Waiting for a train, I needed a shit. You won't bee-lieve what happened next

looks like a loving nightmare

Lord Of Texas
Dec 26, 2006

Seaside Loafer posted:

looks like a loving nightmare

It's a "best of lovely options" situation. If your database is frequently changing Liquibase is a much better option than versioning DDL through text files on Sharepoint or a notepad on some guy's desk.

Seaside Loafer
Feb 7, 2012

Waiting for a train, I needed a shit. You won't bee-lieve what happened next

well i suppose but i really would have thought that a good system design would pretty much nail down the db structure before even starting work, is this is for these opensource projects where every arsehole is changing things to their hearts content without bothering to ask anyone else?

Notorious b.s.d.
Jan 25, 2003

by Reene

Seaside Loafer posted:

well i suppose but i really would have thought that a good system design would pretty much nail down the db structure before even starting work

the first design, yes. there will be many iterations of that design

sometimes those changes are simple (e.g. add a new table, add a new column to an existing table). sometimes they are hard (make a 1:1 into a many:many by breaking a column into a pair of new tables).

sometimes they're nightmarish (anything with versioning sprocs)

Notorious b.s.d.
Jan 25, 2003

by Reene
i hate it when people want to move poo poo into sprocs. it's the hardest code to version, test, or debug, but it's also likely to be the most performance sensitive and widely-used

it's 2014. embrace soa and n-tier. a set of sprocs and views in oracle is not a satisfactory API endpoint.

Lord Of Texas
Dec 26, 2006

Seaside Loafer posted:

well i suppose but i really would have thought that a good system design would pretty much nail down the db structure before even starting work, is this is for these opensource projects where every arsehole is changing things to their hearts content without bothering to ask anyone else?

The overall architecture? Yes that's "nailed down" (are we using ORM, are we using stored procs, views, naming conventions, DB vendor, etc.) individual database objects? Sometimes you get it "right" the first time, but frequently you don't and frequently you couldn't have even hoped to because you didn't identify a requirement until you released to prod and got user feedback

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



something++; idk

Valeyard
Mar 30, 2012


Grimey Drawer
another haskell question

i have a list of strings. i need to search through each string, check if it contains a certain substring. and then ideally i need to modify that string

i came accross the function findIndex, and also the function isInfixOf. I feel like if I could combine these somehow then it would let me find which strings have the subtring im looking for (using isInfixOf) and then return the index of it using the findIndex function. but i cant really figure out how/if thats the best way

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Valeyard posted:

another haskell question

i have a list of strings. i need to search through each string, check if it contains a certain substring. and then ideally i need to modify that string

i came accross the function findIndex, and also the function isInfixOf. I feel like if I could combine these somehow then it would let me find which strings have the subtring im looking for (using isInfixOf) and then return the index of it using the findIndex function. but i cant really figure out how/if thats the best way

everything is immutable in haskell so you cant change those strings even if you want to you're stuck with them forever.

now if you want to apply a tranformation to set of string data maybe we can do something

DONT THREAD ON ME fucked around with this message at 20:05 on Nov 23, 2014

Valeyard
Mar 30, 2012


Grimey Drawer

MALE SHOEGAZE posted:

everything is immutable in haskell so you cant change those strings even if you want to you're stuck with them forever

well i know that, but i recreate the string and then recreate the list

i am thinking i can take my list of strings, zip it with a list of numbers from 0 to size of list - 1. then use list comprehension to go through each string in the list, check if it contains the substring using isInfixOf, and then return a list of indices that has that substring

once i have that, i can create a function that takes those indices and does all the lovely work of trying to trim them

to get very specific, i am talking about a list of source code like

[...
"blah",
" real(kind=4), dimension(kp+2) :: z2 !$acc argmode read",
"blah"
...]

where I am looking for that "!$acc argmode read" flag at the end, and then I would like to drop it to become just " real(kind=4), dimension(kp+2) :: z2"

Valeyard fucked around with this message at 20:08 on Nov 23, 2014

MeruFM
Jul 27, 2010

Valeyard posted:

another haskell question

i have a list of strings. i need to search through each string, check if it contains a certain substring. and then ideally i need to modify that string

i came accross the function findIndex, and also the function isInfixOf. I feel like if I could combine these somehow then it would let me find which strings have the subtring im looking for (using isInfixOf) and then return the index of it using the findIndex function. but i cant really figure out how/if thats the best way

wouldn't you just want to use a map function with the isInfixOf function?

I'm not a haskell programmer though so whatever

gonadic io
Feb 16, 2011

>>=

Valeyard posted:

another haskell question

i have a list of strings. i need to search through each string, check if it contains a certain substring. and then ideally i need to modify that string

i came accross the function findIndex, and also the function isInfixOf. I feel like if I could combine these somehow then it would let me find which strings have the subtring im looking for (using isInfixOf) and then return the index of it using the findIndex function. but i cant really figure out how/if thats the best way

these are where strings really start to be bad. i think the easiest (and least terrible) way is to use Data.Text's replace to turn the target string into the empty string, with pack and unpack to turn a string into a text and back. the language extension OverloadedStrings will let you use string literals for text values instead of having to pack them yourself

gonadic io
Feb 16, 2011

>>=
since it's a cw i'm not going to write it for you though (it's 1 line if you use function composition instead of naming everything)

e: then as MeruFM said, just map your new dropFlag function across your list of strings

gonadic io fucked around with this message at 20:22 on Nov 23, 2014

Valeyard
Mar 30, 2012


Grimey Drawer

AlsoD posted:

e: then as MeruFM said, just map your new dropFlag function across your list of strings

its not as simple as that though, i only want to drop the flag on lines where it actually exists

i know how to get a list of indices of lines it exists

code:
len = take (length remAcc) [0,1..]
		indicesOf = zip len remAcc
		--lines = indicesOf

		readMatches = [ind | (ind, x) <- indicesOf, isInfixOf "!$acc argmode read" x]
and i have a function to remove the flag

code:
stripRead original = stripped
	where
		s1trim = rstrip original
		stripped = reverse (drop 19 (reverse s1trim))
i also know how to only apply stripRead to lines that are in list of indices. BUT, this doesnt help :(

e: since this exercise wont be marked on elegance or efficiency of code i am not concerned at all with doing this kind of thing in one liners. i feel like the exercise isnt well suited to haskell anyway, so any which way its done is kind of..bad

Valeyard fucked around with this message at 21:46 on Nov 23, 2014

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
can we all jsut take a moment to appreciate the irony of valeyard posting in the safezone

  • Locked thread