Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

04-02-2011 , 03:19 AM
lol, worst captchas of all time

http://www.docstoc.com/docs/1048763/...as-of-All-Time

some of these are ridiculously funny
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 04:29 PM
Some of those are terrible.

But I think the idea of using symbols and having those symbols correspond with letters is clever.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 04:34 PM
yeah I like that one and don't see why it's getting hate
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 07:26 PM
Quote:
Originally Posted by diebitter
both imo. I think the ms sql server one would be particularly good for me, I know quite a few tricks about writing ****-off-a-shovel-fast sprocs.
That's my bread and butter.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 07:39 PM
So yeah, I absolutely loathe MS Windows, and avoided having anything to do with that literally(!) headache-inducing platform for over a decade. But then I had a client willing to pay me a good, steady income, but needed me to have access to it.

I'll say one good thing for it: the platform desperately needed the addition it got of Windows Script Host. Don't know why it took 'em forever to add it, but there you go.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 07:48 PM
Windows Script Host has been around for a looong time, certainly Win98, maybe 95. Or do you mean PowerShell?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 07:57 PM
Quote:
Originally Posted by _dave_
Windows Script Host has been around for a looong time, certainly Win98, maybe 95. Or do you mean PowerShell?
Don't recall it in 95 or NT 4, and that was when I escaped.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-02-2011 , 09:21 PM
Thinking back it was probably default from 98SE onwards, I think before that it came as part of the IE4 bundle that was well known for trashing systems with the lovely "Active Desktop".

I remember it being awesome, one time I had a job to collate daily sales figures going back years stored in Excel documents (one per day, all in random folders under "c:\accounts") lol. So I could either open up ~900 xls and find the numbers as was the plan, or... WSH wscript.exe to the rescue! did it in about 20 minutes (not counting the day it took me to learn / write the program). And I could be sure all the generated weekly/monthly/yearly totals were all accurate too easily scanning the generated big sheet that was a satisfying job imo!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 12:09 PM
Nice article.

Quote:
When optimizing for speed, 1% of the work gets you 99% of the bang.
I'm skeptical about this statement though. Thoughts?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 02:34 PM
It's an exaggeration - but not a very big one (if you accept "work" to mean code changed).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 04:50 PM
Quick design question:
I have a class for objects that I build by reading from a database i.e. I get all the attributes like name, width etc. from the database. Now the class will be extended to have an image attribute i.e. a .png file. Should I
1) save the image in the database as a BLOB and get it from the DB like all other properties
2) store it on the filesystem in say an images folder and store a reference to the location in the database i.e. image_path or something in the db is set to a string pointing to the location of the file
3) store it on the filesystem in say an images folder and get the location via code

I'm currently doing 3) i.e. if I had an object with a name attribute of 'hot_babe' I'd just store hot_babe.png in images and follow the convention of image = getImage('images/'+self.name+'.png') .. this is pseudocode, I use an operating system neutral way of actually finding the image

I feel like 1) would probably be better but BLOBs aren't the hottest stuff in the world either :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 04:57 PM
Quote:
Originally Posted by clowntable
Quick design question:
I have a class for objects that I build by reading from a database i.e. I get all the attributes like name, width etc. from the database. Now the class will be extended to have an image attribute i.e. a .png file. Should I
1) save the image in the database as a BLOB and get it from the DB like all other properties
2) store it on the filesystem in say an images folder and store a reference to the location in the database i.e. image_path or something in the db is set to a string pointing to the location of the file
3) store it on the filesystem in say an images folder and get the location via code

I'm currently doing 3) i.e. if I had an object with a name attribute of 'hot_babe' I'd just store hot_babe.png in images and follow the convention of image = getImage('images/'+self.name+'.png') .. this is pseudocode, I use an operating system neutral way of actually finding the image

I feel like 1) would probably be better but BLOBs aren't the hottest stuff in the world either :P
Absolutely #2. #2 and #3 are really the same thing. However, storing the relative location AND filename in the DB is going to provide more flexibility in the future without any addition cost right now.

Theres no point in storing the image in a blob column unless you need to run some db specific operation on the contents of the image file. #1 is also going to make reading those images quite costly.

Last edited by rt1; 04-03-2011 at 05:03 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 06:46 PM
Quote:
Originally Posted by greg nice
I never liked this article. Joel's a smart guy, but I tend to find more use out of his posts about business models and strategy than his software engineering posts.

There are plenty of good reasons to rewrite code. Also to rewrite history, which is what he was going in this post anyway. Netscape was already on the way out by the time the Mozilla Project decided to start on Gecko and other rewritten components. To pretend they failed because of that is to ignore the fact that they were already doing so badly they had to run to the government to try to slap down the competitor that was just killing them, Microsoft, by offering a comparable product for free.

Who charges for a web browser these days? Only Opera, and even they give away free browsers where they're competitive (mobile).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 07:15 PM
Not a fan of the article either. I mean the overall point has its place, but there are plenty of good exceptions to the rule.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 08:20 PM
Quote:
1) save the image in the database as a BLOB and get it from the DB like all other properties
This is the wrong solution to the problem 99.9% of the time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-03-2011 , 08:39 PM
Yeah I've left it the way it was, not even going to store a reference to the location of the image in the DB. Maybe I'll add the path eventually because it feels a little odd to have all the info about the objects in one place except for media

I'll probably end up creating a config file in which you can specify where images belonging to certain domains should be stored and a project creation script that moves the stuff to the right places. The entire database with the attributes for the objects is already created from a script anyways

Thx for the input. My main reason for concidering BLOBing the image was that I read seome benchmarks and a (Firebase) database was actually faster than the filesystem for image access (and it makes at least a little sense to have everything related in one DB).
I'm pretty clueless when it comes to finetuning DBs and general DB performance
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 12:03 AM
is it worth starting a TDD thread?

can anyone provide me with some good links/examples of implementing this? my program (StackAndTile) was born from ahk scripts, and my code and the language is sloppy. i would like to get some testing in so that i can be a bit more ambitious (read: wreckless) when fixing bugs and adding features, with the safety knowing that i can just click one button and if all the tests pass, then i can be sure my code works.

how does one add these tests on top of original code? i have started doing some refactoring of splitting large functions into smaller ones that i can test. however, the bulk of the program deals with moving poker tables around the screen, inside a big timer loop. this seems harder to test than simply passing a few parameters to a function. do i mock up fake poker tables and all that mess?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 02:37 AM
look for a unit testing framework for whatever language you are using.

its best to break your program down into simple classes/functions and then isolate each of them for testing. aka unit testing.

and yup, you should have a test that mocks out fake poker windows and moves them around, and then confirms they moved the correct location. but thats later, first thing you need to do is breaking your code into small and testable pieces.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 09:34 AM
You shouldn't store images in databases, it's really slow, difficult to manage etc etc. If it's served a lot as well it's going to bottleneck the database and cause some performance issues. Store the locations to the files in a text field as supposed to binary data, it's a lot better practise.

If you want to protect your images from being served from particular locations you can write an image serving file and store the images in a filesystem location that is non public.

There are a few specialist circumstances when storing the data in the database would be preferential but we need more info on the system to help more.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 09:44 AM
Quote:
Originally Posted by rt1
and yup, you should have a test that mocks out fake poker windows and moves them around, and then confirms they moved the correct location. but thats later, first thing you need to do is breaking your code into small and testable pieces.
If the code is already written as a big mess - you probably don't want to refactor before getting test coverage in place. Or at the very least, you'll want to do it at the same time. So pick a function to refactor, write tests for it, make small changes, run tests, and keep doing that until you get nice code that is also unit tested.

As for the fake poker windows - I wouldn't worry about that. Start by pulling out any logic and writing functions that implement that logic without needing to know about UI concerns. So for example if you have a function that moves some GUI element to some coordinate on the screen break that into two functions - one to calculate the new co-ordinates and one really generic function that just moves the element to those coordinates.

This allows you to easily test the logic without worrying about UI concerns.

Testing the UI itself can be a big pain and I think people often go overboard trying to automate it - which just ends up as a big headache.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 10:40 AM
I have an issue similiar to clowntable in ASP.net / C#

I am trying to playing video from a database in binary format to an embedded windows media player built into my asp.net / c## website.

The issue now is that whenever I retrieve the video from the database it will open a new window for windows media player, and play the video. I've tried a bunch of stuff, with not much luck yet. Any tips?

I think it might have to do with my asp code in how I reference my handler page to pull certain videos from the db..

<param name="filename" value="~/viewVideos.aspx?binId="+<%MyFunction(); %>" />
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 10:48 AM
Quote:
Originally Posted by jjshabado
If the code is already written as a big mess - you probably don't want to refactor before getting test coverage in place. Or at the very least, you'll want to do it at the same time. So pick a function to refactor, write tests for it, make small changes, run tests, and keep doing that until you get nice code that is also unit tested.

As for the fake poker windows - I wouldn't worry about that. Start by pulling out any logic and writing functions that implement that logic without needing to know about UI concerns. So for example if you have a function that moves some GUI element to some coordinate on the screen break that into two functions - one to calculate the new co-ordinates and one really generic function that just moves the element to those coordinates.

This allows you to easily test the logic without worrying about UI concerns.

Testing the UI itself can be a big pain and I think people often go overboard trying to automate it - which just ends up as a big headache.
good post. also, i just realized what your sn is referencing, it might be my favorite 2p2 sn.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 10:57 AM
Quote:
Originally Posted by tercet
I have an issue similiar to clowntable in ASP.net / C#

I am trying to playing video from a database in binary format to an embedded windows media player built into my asp.net / c## website.

The issue now is that whenever I retrieve the video from the database it will open a new window for windows media player, and play the video. I've tried a bunch of stuff, with not much luck yet. Any tips?

I think it might have to do with my asp code in how I reference my handler page to pull certain videos from the db..

<param name="filename" value="~/viewVideos.aspx?binId="+<%MyFunction(); %>" />
I really really wouldn't store the video in the database. Store it in an publicly inaccessible folder, then serve it from another file checking permissions etc. (Or if anyone can view it just stick it in a public location).

If you are having trouble playing the video, you probably will be wanting a flash video player, or an HTML5 one (less supported but future proofed). Browsers will behave very variably if you are directly embedding media onto a page.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
04-04-2011 , 12:14 PM
It looks like I'm going for a job interview on Wednesday (yay)

The job is in Rails, which I have zero experience in. I don't even think I've ever looked at a line of Ruby code. They tracked me down & invited me, so I know they know I have no experience, but I'd like to take some knowledge in to the interview.

What should I read in the next day and a half to at least give me a primer in Ruby & Rails? I'll probably only have about 2 hours to sit down and read before then, most of that on the actual train ride, so let's keep it short
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m