[small]But yes, there is definitely a bit of "the grass is greener" going on in my brain.
No, no, you don't want to be here.
The more equipment that a setup takes to replicate, the harder it is to track down. After a whole lot of debugging and verification on Friday, I've come to the conclusion that it's very likely that the LabView app that was running on the production machine was somehow faulty.
I have a god class here that I'm breaking apart into smaller chunks, but everything's such a spaghetti mess that it's not trivial. In particular, one method is a hundred lines of
if (arg == foo):
Something
If (arg2 == bar):
Another thing
...
If (arg10 [key5] == 'oh god why'):
self.shoot()
The class also has about 20 member variables, which I want to split up, but with methods like that it's not easy to see all the places they're used.
Is there any way to trace where a variable is read or changed? I tried replacing all members with properties, thinking I could put loggers in their getters and setters, but I got swamped in errors like 'property' object is not callable/iterable
Anyone have any suggestions?
After a few weeks of work, I've now refactored every module, and written unit tests for everything. Line coverage is at 99.6%, which our system rounds up to 100%! Branch coverage is something like 96%! And after all the extra methods I extracted, and all the classes I took out of the god class, there's probably less code overall now because of all the code I was able to delete. Whole objects, gone! Gone!
I kinda wish I wasn't done because I was starting to really enjoy the way I was working. Even though a strange new problem seemed to rear up with every new module.
+9
mightyjongyoSour CrrmEast Bay, CaliforniaRegistered Userregular
[small]But yes, there is definitely a bit of "the grass is greener" going on in my brain.
No, no, you don't want to be here.
The more equipment that a setup takes to replicate, the harder it is to track down. After a whole lot of debugging and verification on Friday, I've come to the conclusion that it's very likely that the LabView app that was running on the production machine was somehow faulty.
LabView. We meet again.
Fuck LabView. I wrote one "program" in it for a contract and felt a need to cleanse myself somehow.
Something I ran into recently reminded me that this exists: https://www.thc.org/root/phun/unmaintain.html
I figured I'd share it with you guys, if any of you happen to be unlucky enough to have never read this. It's starting to get a bit out of date, but it's still worth the read.
I am working with java.awt.Choice. Right now it's empty until the user selects a folder. When this folder is selected then I want the contents of that folder (just the names) to populate this choice and then update on the screen.
The problem is I can't get this fucker to update at all. I have tried repainting/revalidating literally everything on the screen. Am I missing something?
The oscilloscope and the test computer have been shifted away, but imagine it placed behind the cleverly blacked out piece of electronics in this panorama:
And as an apology for the eye damage that I've just caused you, here's a fuzzy picture of a kitten:
I can't run the [firebug, a firefox addon] app for some reason so I can't inspect it.
Note that chrome has it's own builtin, firebug like debugger, called javascript console, under the tools menu, if firebug is causing you problems.
However, the problem is most likely solvable by starting the firebug console first, in a separate window, before loading your flex page.
It is a hundred times harder to fix css problems without either chrome or firebug.
stab stab stab stab stab. Damn it, amazon. I'm fighting with the stupid mws api... xml validation errors on the live service because I didn't include elements which the xsd says minOccurs="0". Different validation errors on the scratchpad with the exact same xml because I didn't include an element with minOccurs="0" but looks like it may be enforced separately server side. Their list of all of the xsds is really just a list of some of the xsds, so I can't download the xsds and validate myself... not that validating for myself does a whole lot of good if their servers still won't accept the xml.
Man, I wanted to do ruby dev on Windows for the convenience of not switching OSs, but installing the mysql gem on Windows is ridiculously unintuitive.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
It probably doesn't like spaces in the path. Many linux sourced things don't
Too true. I learned that the hard way with the Ruby devkit.
The weird thing about this is that it didn't work when I had it in a path with no whitespace (C:\Users\templewulf\Downloads\). But then when I installed the full MySQL suite to "Program Files", and pointed paths there, it was totally fine.
Okay, I'm not super well acquainted with git's merge model.
Pushing didn't work, because I have removed a file that still exists on the remote. So obviously I need to pull first to merge, right? But pulling gives the error message "error: The following untracked working tree files would be overwritten by merge: config/database.yml"
Technically, pull is a merge operation (it's basically git fetch + git merge on the branch with its tracking remote)
If config/database.yml is a file you actually want to keep around locally but not in git, just move it out of the way, perform the pull, then move it back.
End on
I wish that someway, somehow, that I could save every one of us
I forgot to add it to .gitignore before I put login info in it. I have since changed the password just in case, but I removed it from git with git rm --cached and then added it to .gitignore.
I'll try copying it out of the project, pulling and moving it back in. Is there a more elegant way to do that?
Man, I wanted to do ruby dev on Windows for the convenience of not switching OSs, but installing the mysql gem on Windows is ridiculously unintuitive.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
Dual boot? Run a linux VM? VirtualBox works on Windows 8 if you create a boot profile that turns off/frees HyperV. That's how I do my work: VB with Mint 15.
PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948 Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
0
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Man, I wanted to do ruby dev on Windows for the convenience of not switching OSs, but installing the mysql gem on Windows is ridiculously unintuitive.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
Ruby 2.0?
If so, that's likely the problem. A lot of gems that used to build very easily using the devkit in Ruby 1.9 now just blow up when building under Ruby 2.0. The Ruby community is pretty agnostic to Windows, so it'll probably be a year before they are all fixed.
SQLite, for instance, despite being one of the most popular gems around still won't build on Windows for Ruby 2.0 without knowing how to make it build. I ended up writing a 'wbundle' PowerShell script to wrap around using bundle that would automatically do the magic necessary to install the SQLite gem correctly.
I develop locally on SQLite and only switch to Postgres when pushing to 'prod', which is on my DigitalOcean Debian 7.0 droplet.
Man, I wanted to do ruby dev on Windows for the convenience of not switching OSs, but installing the mysql gem on Windows is ridiculously unintuitive.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
Dual boot? Run a linux VM? VirtualBox works on Windows 8 if you create a boot profile that turns off/frees HyperV. That's how I do my work: VB with Mint 15.
I would if I could. Unfortunately, my machine situation is a little inconvenient.
The tl;dr is that my desktop is on the mantle so my girlfriend and I can play PC games together from the couch. My interim development machine is already excruciatingly slow, and I have 0 faith in it running a VM effectively.
(Long version is that I'm running Windows on a MacBook, because OSX takes forever to boot or launch anything. I suspect a bad disk sector where the swap file is, but disk scans don't turn up anything. I plan on assembling a hot little mini-ITX number for the HTPC once I get the cash together or find adequately affordable parts. I can then reclaim my old desktop for development and run any number of VMs again.)
Man, I wanted to do ruby dev on Windows for the convenience of not switching OSs, but installing the mysql gem on Windows is ridiculously unintuitive.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
Ruby 2.0?
If so, that's likely the problem. A lot of gems that used to build very easily using the devkit in Ruby 1.9 now just blow up when building under Ruby 2.0. The Ruby community is pretty agnostic to Windows, so it'll probably be a year before they are all fixed.
SQLite, for instance, despite being one of the most popular gems around still won't build on Windows for Ruby 2.0 without knowing how to make it build. I ended up writing a 'wbundle' PowerShell script to wrap around using bundle that would automatically do the magic necessary to install the SQLite gem correctly.
I develop locally on SQLite and only switch to Postgres when pushing to 'prod', which is on my DigitalOcean Debian 7.0 droplet.
Hmm, that actually helps me quite a bit. I got the gem built successfully, but "rails s" fails when trying to load it. I'll definitely look into that.
PS: How do you like digitalocean? I have a shared account with limited gem options, and a vps starts at 20USD/month. I was thinking of hopping on the Linode train, but I might end up using enough storage that it would interfere with our PA shared server. Linode's monthly plans also start at 20. Is it production-worthy for a small indie site?
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited February 2014
I love DigitalOcean, but I think you're going to basically pay the same amount (20'ish a month) for a small site as you would on Linode. That said, I think DigialOcean is a nicer service than Linode in terms of how it all works. It has a really slick control panel where you can resize your droplet, create a new one, take snapshots and images, and several other interesting tasks. It has a reasonable selection of Linux variants as well (Ubuntu, Debian, Arch, CentOS and Redhat I believe, 32/64 bit variants).
I have the basic 5 dollar level and I use it for my own personal stuff and it works great. It was also fun/informative to learn how to setup the various things you need for a reasonably secure server, like ipchains, nginx, SSH, etc. It was also nice that once I had all that setup, with appropriate permissions, users, groups etc, I could take a snapshot of it in the DigitalOcean control panel and restore to it any time I needed to.
All in all, I can't recommend DigitalOcean enough. I like that I can do development at 5 bucks a month, but if someday I decide I really want to upsize the site and I'm willing to spend the money for more resources, I can easily resize my droplet, even growing and shrinking it as required as my site traffic ebbs and flows. Obviously you have to do your own administration of the server, but I find that to be quite interesting and a great learning process.
It's pretty easy to find a coupon code for $10-15 in DigitalOcean credit. Find one and sign up, then you've got a couple months to try it out. Only reason I don't still have a droplet is because I do all my Linux development on a shared Linode, and there's no reason for me to pay for two VPS services.
I feel like I'm Homer holding a monkey paw at the moment.
I just inherited a mid-2012 Macbook Air to develop on from a leaving team member, yay
It hasn't been updated in a year and a half and the updates are causing kernel panics, boo
Mavericks seemed to install just fine though, yay
I have to set up an Apple account to even download xcode, boo
This thing is amazing, 8gb ram / i7, yay
The SVN that comes pre-installed doesn't support Cyrus SASL, boo
And that's where I'm stuck. I can't check out any of my repos because 'SVN cannot negotiate the authentication mechanism' because this version of SVN wasn't compiled with the correct stuff.
I can't even fall back and install Homebrew because the raw.github install location is timing out! If I lose another day to this I'll be so sad.
Edit: Finally managed to get it all working. Installed Homebrew by taking out the SSL requirement as this was causing the timeout, used brew to install wget which told me the default OpenSSL implementation as installed by Apple is way out of date and awful and finally managed to get a version of SVN compiled with the correct auth.
Then it was just a case of getting bash to default to /usr/local/bin instead of /usr/bin and I finally have access to my repos. 8 hours later.
SporkAndrew on
The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
Damn. I still need to update my work Macbook to Mavericks. I keep putting it off because it causes some sort of hassle with Python which I don't feel like dealing with.
mightyjongyoSour CrrmEast Bay, CaliforniaRegistered Userregular
Finally, finally figured out why we were getting bad data from one of the devices on our systems - it's a firmware problem, which means it's not my problem*.
*(actually, it would have been discovered a month ago if I had updated to the new firmware file like I thought I did)
Damn it. Just got assigned to a project doing medical stuff.
We need the "bro?" button back. It had many different meanings depending on context, but here it would clearly indicate a grimace, shake of the head, and hand on the shoulder.
I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
Xbox - PearlBlueS0ul, Steam
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
Posts
I'll see if I can get one when I get back into work on Monday.
No, no, you don't want to be here.
The more equipment that a setup takes to replicate, the harder it is to track down. After a whole lot of debugging and verification on Friday, I've come to the conclusion that it's very likely that the LabView app that was running on the production machine was somehow faulty.
LabView. We meet again.
After a few weeks of work, I've now refactored every module, and written unit tests for everything. Line coverage is at 99.6%, which our system rounds up to 100%! Branch coverage is something like 96%! And after all the extra methods I extracted, and all the classes I took out of the god class, there's probably less code overall now because of all the code I was able to delete. Whole objects, gone! Gone!
I kinda wish I wasn't done because I was starting to really enjoy the way I was working. Even though a strange new problem seemed to rear up with every new module.
Fuck LabView. I wrote one "program" in it for a contract and felt a need to cleanse myself somehow.
I figured I'd share it with you guys, if any of you happen to be unlucky enough to have never read this. It's starting to get a bit out of date, but it's still worth the read.
I am working with java.awt.Choice. Right now it's empty until the user selects a folder. When this folder is selected then I want the contents of that folder (just the names) to populate this choice and then update on the screen.
The problem is I can't get this fucker to update at all. I have tried repainting/revalidating literally everything on the screen. Am I missing something?
Fucking Java GUIs man.
The oscilloscope and the test computer have been shifted away, but imagine it placed behind the cleverly blacked out piece of electronics in this panorama:
And as an apology for the eye damage that I've just caused you, here's a fuzzy picture of a kitten:
Nintendo Network ID: AzraelRose
DropBox invite link - get 500MB extra free.
Haha, reduce stress or increase poop cleanup duties? =P
Nah, that's my kitten from home. I just found it on the SD card when I was flicking through the pictures.
AWT did have a whole bunch of special mentions in the unmaintainable code essay for a reason...
However, the problem is most likely solvable by starting the firebug console first, in a separate window, before loading your flex page.
It is a hundred times harder to fix css problems without either chrome or firebug.
The thing I was expected to do, apparently, is install the developer version of MySQL (not just the archive of connector libs), then gem install mysql --platform=ruby -- '--with-mysql-dir="C:\Program Files\MySQL\MySQL Connector C 6.1.3" --with-mysql-lib="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"'
The second parameter is especially confusing, because --with-mysql-dir is supposed to also figure out with the lib directory is. But contrary to the success I've seen on SO, I haven't been able to get it to work without specifying that dir as well.
I miss how things just work from the (Linux) command line!
If you quote and use unix paths it should be able to handle it.
"C:/Program\ Files/MySQL/MySQL\ Connector\ C\ 6.1.3/lib"'
Too true. I learned that the hard way with the Ruby devkit.
The weird thing about this is that it didn't work when I had it in a path with no whitespace (C:\Users\templewulf\Downloads\). But then when I installed the full MySQL suite to "Program Files", and pointed paths there, it was totally fine.
Pushing didn't work, because I have removed a file that still exists on the remote. So obviously I need to pull first to merge, right? But pulling gives the error message "error: The following untracked working tree files would be overwritten by merge: config/database.yml"
What do I do with this?
If config/database.yml is a file you actually want to keep around locally but not in git, just move it out of the way, perform the pull, then move it back.
I'll try copying it out of the project, pulling and moving it back in. Is there a more elegant way to do that?
Dual boot? Run a linux VM? VirtualBox works on Windows 8 if you create a boot profile that turns off/frees HyperV. That's how I do my work: VB with Mint 15.
Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
Ruby 2.0?
If so, that's likely the problem. A lot of gems that used to build very easily using the devkit in Ruby 1.9 now just blow up when building under Ruby 2.0. The Ruby community is pretty agnostic to Windows, so it'll probably be a year before they are all fixed.
SQLite, for instance, despite being one of the most popular gems around still won't build on Windows for Ruby 2.0 without knowing how to make it build. I ended up writing a 'wbundle' PowerShell script to wrap around using bundle that would automatically do the magic necessary to install the SQLite gem correctly.
I develop locally on SQLite and only switch to Postgres when pushing to 'prod', which is on my DigitalOcean Debian 7.0 droplet.
I would if I could. Unfortunately, my machine situation is a little inconvenient.
The tl;dr is that my desktop is on the mantle so my girlfriend and I can play PC games together from the couch. My interim development machine is already excruciatingly slow, and I have 0 faith in it running a VM effectively.
(Long version is that I'm running Windows on a MacBook, because OSX takes forever to boot or launch anything. I suspect a bad disk sector where the swap file is, but disk scans don't turn up anything. I plan on assembling a hot little mini-ITX number for the HTPC once I get the cash together or find adequately affordable parts. I can then reclaim my old desktop for development and run any number of VMs again.)
Hmm, that actually helps me quite a bit. I got the gem built successfully, but "rails s" fails when trying to load it. I'll definitely look into that.
PS: How do you like digitalocean? I have a shared account with limited gem options, and a vps starts at 20USD/month. I was thinking of hopping on the Linode train, but I might end up using enough storage that it would interfere with our PA shared server. Linode's monthly plans also start at 20. Is it production-worthy for a small indie site?
I have the basic 5 dollar level and I use it for my own personal stuff and it works great. It was also fun/informative to learn how to setup the various things you need for a reasonably secure server, like ipchains, nginx, SSH, etc. It was also nice that once I had all that setup, with appropriate permissions, users, groups etc, I could take a snapshot of it in the DigitalOcean control panel and restore to it any time I needed to.
All in all, I can't recommend DigitalOcean enough. I like that I can do development at 5 bucks a month, but if someday I decide I really want to upsize the site and I'm willing to spend the money for more resources, I can easily resize my droplet, even growing and shrinking it as required as my site traffic ebbs and flows. Obviously you have to do your own administration of the server, but I find that to be quite interesting and a great learning process.
I just inherited a mid-2012 Macbook Air to develop on from a leaving team member, yay
It hasn't been updated in a year and a half and the updates are causing kernel panics, boo
Mavericks seemed to install just fine though, yay
I have to set up an Apple account to even download xcode, boo
This thing is amazing, 8gb ram / i7, yay
The SVN that comes pre-installed doesn't support Cyrus SASL, boo
And that's where I'm stuck. I can't check out any of my repos because 'SVN cannot negotiate the authentication mechanism' because this version of SVN wasn't compiled with the correct stuff.
I can't even fall back and install Homebrew because the raw.github install location is timing out! If I lose another day to this I'll be so sad.
Edit: Finally managed to get it all working. Installed Homebrew by taking out the SSL requirement as this was causing the timeout, used brew to install wget which told me the default OpenSSL implementation as installed by Apple is way out of date and awful and finally managed to get a version of SVN compiled with the correct auth.
Then it was just a case of getting bash to default to /usr/local/bin instead of /usr/bin and I finally have access to my repos. 8 hours later.
*(actually, it would have been discovered a month ago if I had updated to the new firmware file like I thought I did)
We need the "bro?" button back. It had many different meanings depending on context, but here it would clearly indicate a grimace, shake of the head, and hand on the shoulder.
I'm so sorry, bro.
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
..And now the laptop is missing from my desk and I'm back on the old C2D iMac.
That was a good use of a day.
Oh gosh is that actually ready now? I was looking at that some time ago.
Apparently it became open source in January. Just saw it for the first time today, and it looks pretty slick.