As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

[Programming] djmitchella travelling through snow to rfind duplicate dates for singletons

14344464849100

Posts

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Jimmy King wrote: »
    urahonky wrote: »
    Man I swear I've been having some weird problems with my Django unit tests ever since updating to Pycharm 4.0.

    Do they work if you just go to the command line do a "manage.py test" ? Make sure you're in your virtualenv if using one, etc. when you do that. And does pycharm 4 change the test runner out from under you or anything like that? I've got one project which consistently passes 100% of the tests using the default test runner, but if I swap in django-nose it changes the way imports are handled somehow can creates a couple of circular dependencies which don't really exist, causing the tests to fail.

    It ended up being an embarrassing issue... I didn't make the correct URL when doing my self.client.get() call.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Longest day ever. I want to finish these unit tests so I can go home and play Smash Bros!

  • Options
    Jimmy KingJimmy King Registered User regular
    urahonky wrote: »
    Jimmy King wrote: »
    urahonky wrote: »
    Man I swear I've been having some weird problems with my Django unit tests ever since updating to Pycharm 4.0.

    Do they work if you just go to the command line do a "manage.py test" ? Make sure you're in your virtualenv if using one, etc. when you do that. And does pycharm 4 change the test runner out from under you or anything like that? I've got one project which consistently passes 100% of the tests using the default test runner, but if I swap in django-nose it changes the way imports are handled somehow can creates a couple of circular dependencies which don't really exist, causing the tests to fail.

    It ended up being an embarrassing issue... I didn't make the correct URL when doing my self.client.get() call.

    Eh, test cases are still code. Just like any code, sometimes they have mistakes in them. Just wait until the day you have a mistake in your test case which makes it so that a bug in the code which should have been caught by that test instead passes.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Jimmy King wrote: »
    Eh, test cases are still code. Just like any code, sometimes they have mistakes in them. Just wait until the day you have a mistake in your test case which makes it so that a bug in the code which should have been caught by that test instead passes.

    Having insufficient test data for DB queries is a real classic here. I've had plenty of cases that returned the expected set of data... but for the wrong reasons because I had too little test data.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.

    I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.

  • Options
    bowenbowen How you doin'? Registered User regular
    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    Gilbert0Gilbert0 North of SeattleRegistered User regular
    Can I just say, !@#$% timezones and Daylight Savings? or maybe just !@#$% time.

    That is all.

  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    Yup
    Syncdb will not alter existing tables

    syncdb will only create tables for models which have not yet been installed. It will never issue ALTER TABLE statements to match changes made to a model class after installation. Changes to model classes and database schemas often involve some form of ambiguity and, in those cases, Django would have to guess at the correct changes to make. There is a risk that critical data would be lost in the process.

    If you have made changes to a model and wish to alter the database tables to match, use the sql command to display the new SQL structure and compare that to your existing table schema to work out the changes.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    Though reading more about it, it seems that Django 1.7 has a new migrations setup that can alter database tables. It's apparently heavily based on the South tool that the guy in bowen's link is talking about.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    EndEnd Registered User regular
    yeah, makemigrations sounds like it's from 1.7

    I've only ever used south though, because I'm perpetually stuck on older versions

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpg
  • Options
    Jimmy KingJimmy King Registered User regular
    edited November 2014
    urahonky wrote: »
    Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.

    I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
    There doesn't seem to be much to go wrong here. I've tried a bit to make it go wrong, but it just works short of having not saved the file, etc. Is there any chance PyCharm is doing voodoo and automatically making/running migrations behind your back, so when you go to do it manually it says no changes?

    Jimmy King on
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    makemigrations isn't doing anything for us. I might have to look into django-south.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Jimmy King wrote: »
    urahonky wrote: »
    Damn it. The only thing that's annoying me about Django right now is that I cannot seem to add a new column to my database table without dropping the database and then having Django re-create it.

    I update the model, go to manage.py and use the "makemigrations" command which almost always says "No Changes". I then run migrate and that looks like it's doing something but never does.
    There doesn't seem to be much to go wrong here. I've tried a bit to make it go wrong, but it just works short of having not saved the file, etc. Is there any chance PyCharm is doing voodoo and automatically making/running migrations behind your back, so when you go to do it manually it says no changes?

    Nah with pgAdmin open I see the table but the columns don't exist.

  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    urahonky wrote: »
    makemigrations isn't doing anything for us. I might have to look into django-south.

    @urahonky‌ check this SO question - the first two answers may give you what you want.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    ironsizideironsizide You must whip it Registered User regular
    bowen wrote: »
    I'm reminded of the "I'm the 56%" guy that said he was working 2 jobs and that's how he's able to make ends meet. As if that should be the default assumption and the guy who is disabled and can only work 20 hours a week is somehow bad because he can't.

    As a disabled dude myself (paraplegic and currently working from a hospital bed at home) I totally agree with this. This had been a bad health year for me, and I was in an actual hospital a month or two back for a week and I kept working while in there. The nurses thought I was nuts, but I got docked pay earlier this year for not putting in a fill 40 each week for a pay period. I routinely work a 45-50 hours week, from bed, and I have to constantly make the case I'm a viable worker.

    |_
    Oo\ Ironsizide
    camo_sig2.png
  • Options
    bowenbowen How you doin'? Registered User regular
    ironsizide wrote: »
    bowen wrote: »
    I'm reminded of the "I'm the 56%" guy that said he was working 2 jobs and that's how he's able to make ends meet. As if that should be the default assumption and the guy who is disabled and can only work 20 hours a week is somehow bad because he can't.

    As a disabled dude myself (paraplegic and currently working from a hospital bed at home) I totally agree with this. This had been a bad health year for me, and I was in an actual hospital a month or two back for a week and I kept working while in there. The nurses thought I was nuts, but I got docked pay earlier this year for not putting in a fill 40 each week for a pay period. I routinely work a 45-50 hours week, from bed, and I have to constantly make the case I'm a viable worker.

    I feel for you bro. G/f got removed from nursing school because she got put in the hospital and couldn't get a perfect on a math test. They hid it behind the vale of "well she has to pass out meds and can't make mistakes" all because of her having transplant complications.

    Now they're reviewing her disability and something tells me this is going to be an uphill battle because as it stands she really can't afford to just pick up a part time job and pull in $300 a month at minimum wage, can't even afford to eat on that much.

    This whole passion and work work work mindset needs to die, and everyone who perpetuates it is a bad person. IMO, 20 hour work weeks should be standard for the 50k household average people are pulling in now. If you're pulling in 100k @ 40 hours, good on you.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    I'm doing my part! I really don't work extra hours. Even in the rare crunch period I don't go much above 40. I'm not even productive for all of the regular 40 hours, much less any extra

  • Options
    bowenbowen How you doin'? Registered User regular
    Phyphor wrote: »
    I'm doing my part! I really don't work extra hours. Even in the rare crunch period I don't go much above 40. I'm not even productive for all of the regular 40 hours, much less any extra

    I'm pulling 45 at the moment to get a product finished by new years, but once I'm done that's it for me, shouldn't be another crunch for the next 10 years or so.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    ironsizideironsizide You must whip it Registered User regular
    edited November 2014
    bowen wrote: »
    The best way to keep ahead in the business world is to always keep learning. A new job? Learn. Skills you learn on the side are hardly, if ever, applicable. And when they are, you usually have to relearn them and apply it to business so you've got to fight a curve anyways. It's a use it or somewhat lose it system, similar to riding a bike. Once you got it, you got it, but hopping back on that bike after 10 years of not riding one is going to be a little strange at first.

    I feel that in our line of work (coding) more than most others we have to be constantly learning too. I work in on-line media and that field is changing constantly - if I don't take time to learn and keep abreast of the technology I'm useless. Becaus of this, I feel employers should recognize that part of my job is that learning. I may not be coding, but that doesn't mean I'm not doing my job.

    edit: sometimes the saved drafts bite you on the ass.

    ironsizide on
    |_
    Oo\ Ironsizide
    camo_sig2.png
  • Options
    ASimPersonASimPerson Cold... and hard.Registered User regular
    If you add up all the times I'm productive, it probably comes out to somewhere around 40 hours. But I'm not very productive on a normal schedule. I probably do most of my work between 2 and 6am.

  • Options
    InfidelInfidel Heretic Registered User regular
    I do 38.75 hours a week cause government is weird like that.

    Was doing upwards of 60 leading up to the hospital go-live though, doing that is fine when there's a justified deadline and not just the norm.

    OrokosPA.png
  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Good crunch is for a short period of time with a directed goal, a clear end state, and a refractory period afterwards.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    Gilbert0 wrote: »
    Can I just say, !@#$% timezones and Daylight Savings? or maybe just !@#$% time.

    Correct

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
  • Options
    Jimmy KingJimmy King Registered User regular
    urahonky wrote: »
    makemigrations isn't doing anything for us. I might have to look into django-south.

    Don't mix the two, it'll just cause weird confusion. Plus the built in migrations are a lot better and handle cases where South struggles, like custom user models (particularly in re-usable apps), much more cleanly because they were designed from day 1 with that sort of stuff in mind.

    If makemigrations isn't seeing the changes to models then something isn't configured quite right and you'll be better off in the long run figuring out what is.

    I think @LuvTheMonkey‌ may be onto something there with the SO ideas he found. I didn't even consider those options... I usually forget that unamanaged models even exist and I've only done one 1.6 to 1.7 upgrade.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    urahonky wrote: »
    makemigrations isn't doing anything for us. I might have to look into django-south.

    @urahonky‌ check this SO question - the first two answers may give you what you want.

    I tried that and it did look like it created a migrations folder but when I ran the migrate command it didn't do anything. It's so odd.

  • Options
    EchoEcho ski-bap ba-dapModerator mod
    http://coteditor.com/

    Haven't tried it because I'm happy with Sublime, but it looks like a neat OS X-only option.

  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    urahonky wrote: »
    urahonky wrote: »
    makemigrations isn't doing anything for us. I might have to look into django-south.

    urahonky‌ check this SO question - the first two answers may give you what you want.

    I tried that and it did look like it created a migrations folder but when I ran the migrate command it didn't do anything. It's so odd.

    Did you check the managed setting for the model(s) in question? It'd be in the Meta class in its definition.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    urahonky wrote: »
    urahonky wrote: »
    makemigrations isn't doing anything for us. I might have to look into django-south.

    urahonky‌ check this SO question - the first two answers may give you what you want.

    I tried that and it did look like it created a migrations folder but when I ran the migrate command it didn't do anything. It's so odd.

    Did you check the managed setting for the model(s) in question? It'd be in the Meta class in its definition.

    I would assume that it wasn't a problem since we literally just created this application, but I'll look on Monday! :)

  • Options
    ElaroElaro Apologetic Registered User regular
    Hello fellow coders. I want to hand code a formula parser but I'm not sure how to check the token list for errors.

    This is the order I want to do things in. The FormulaTree constructor accepts a token list, so that's what every function in there returns.
    this.formula= new FormulaTree(MakePostFix(checkFormula(Tokenize(formula))));
    

    I want my checkFormula to throw an exception if it finds something wrong. I guess I could jury-rig something ugly, but I'd like some better opinions. Also I'm feeling lonely.
    public FormulaTokens checkFormula(FormulaTokens formula) throws UnexpectedOperatorException, UnexpectedNumberException, UnevenParenthesesException
    	{
    		int parenthesesLevel=0;
    		for(int i=0;i<formula.size()-1;i++)
    		{
    			Token e=formula.get(i);
    			if(e.element=="(")
    				parenthesesLevel++;
    			else if(e.element==")")
    				parenthesesLevel--;
    			else if(i==0 &&(e.level==1 || e.level==2 || e.level==3 || e.level==4))
    				throw new UnexpectedOperatorException();
    			else 
    			{
    				Token f=formula.get(i+1);
    				if(e.level==f.level)
    				{
    					if(e.level==0)
    						throw new UnexpectedNumberException();
    					else if(e.level<6)
    						throw new UnexpectedOperatorException();
    				}
    			}			
    		}
    		
    		if(formula.get(formula.size()-1).element=="(")
    			parenthesesLevel++;
    		else if(formula.get(formula.size()-1).element==")")
    			parenthesesLevel--;
    		
    		if(parenthesesLevel!=0)
    			throw new UnevenParenthesesException();
    		
    		return formula;
    	};
    

    Children's rights are human rights.
  • Options
    ecco the dolphinecco the dolphin Registered User regular
    Quiet moment of pride:

    Managed to modify a build script that generates our SD card images so that it no longer requires sudo/root. Originally required root because it was mounting images on loopback prior to modifying them, but e2fsprogs has a tool that allows you to add files to ext3 images without root access (provided you already have rw access to the images, of course).

    Penny Arcade Developers at PADev.net.
  • Options
    bowenbowen How you doin'? Registered User regular
    Echo wrote: »
    http://coteditor.com/

    Haven't tried it because I'm happy with Sublime, but it looks like a neat OS X-only option.

    https://atom.io/

    If you want a free sublime, this is it.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    LuvTheMonkeyLuvTheMonkey High Sierra Serenade Registered User regular
    Brackets (Windows/Mac/Linux) and Light Table (Windows/Mac/Linux) are some newer contenders to check out too.

    Molten variables hiss and roar. On my mind-forge, I hammer them into the greatsword Epistemology. Many are my foes this night.
    STEAM | GW2: Thalys
  • Options
    bowenbowen How you doin'? Registered User regular
    Well fuck me, Brackets looks spiffy as hell.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    I have what is probably the dumbest complaint about Atom... it refuses (at least, it did the last time I tried it) to show the list of open files over on the left of the window unless you've opened a folder. I want that darn thing there all the time. Last time I ran into this I even tried plugins to "fix" it, but nothing would work. </the whiniest of whines>

  • Options
    Jimmy KingJimmy King Registered User regular
    My biggest complaint about atom is that tab settings are not language specific. Most of the time I'm working in Python, so I use 4 space soft tabs to be consistent with everyone else. Just about anywhere else I'd like to use real tabs and when editing Makefiles I have to use hard tabs. I hate switching settings just so that I can edit a different type of file. If I had more free time I'd see how much effort it would be to make language specific tab settings.

    I might have to check out Brackets. Maybe Light Table as well now that it seems to be getting more mature... last I heard about it it seemed to be a lot of big dreams, but not much really there yet.

  • Options
    urahonkyurahonky Resident FF7R hater Registered User regular
    Do you guys have any suggestions on some office chairs on Amazon? I need to find one <$200 and I want a good one for my back.

  • Options
    bowenbowen How you doin'? Registered User regular
    Just Amazon? Ikea makes some good office chairs.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    Jimmy KingJimmy King Registered User regular
    @urahonky‌ Take a look at http://www.ikea.com/us/en/catalog/products/00103102/ I have seen it compared to high end Aeron and Steelcase stuff on multiple occasions. I've never used one, but I think that's going to be my next at home office chair. If the comparisons are anything close to accurate, it'll be about the nicest chair you'll ever find in that price range.

  • Options
    bowenbowen How you doin'? Registered User regular
    Yeah Markus was going to be my recommendation.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    Jimmy King wrote: »
    My biggest complaint about atom is that tab settings are not language specific. Most of the time I'm working in Python, so I use 4 space soft tabs to be consistent with everyone else. Just about anywhere else I'd like to use real tabs and when editing Makefiles I have to use hard tabs. I hate switching settings just so that I can edit a different type of file. If I had more free time I'd see how much effort it would be to make language specific tab settings.

    Seems there's an EditorConfig plugin for Atom.

Sign In or Register to comment.