Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 04-02-2011, 03:19 AM   #76
kyleb
Carpal \'Tunnel
 
kyleb's Avatar
 
Join Date: Sep 2004
Location: Seattle
Posts: 39,012
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

lol, worst captchas of all time

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

some of these are ridiculously funny
kyleb is offline   Reply With Quote
Old 04-02-2011, 04:29 PM   #77
Neil S
King of the sidebar
 
Neil S's Avatar
 
Join Date: Sep 2004
Location: Northern Virginia
Posts: 18,041
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Some of those are terrible.

But I think the idea of using symbols and having those symbols correspond with letters is clever.
Neil S is offline   Reply With Quote
Old 04-02-2011, 04:34 PM   #78
Adam27X
veteran
 
Adam27X's Avatar
 
Join Date: Dec 2008
Location: New York/New Jersey border
Posts: 2,083
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

yeah I like that one and don't see why it's getting hate
Adam27X is offline   Reply With Quote
Old 04-02-2011, 07:26 PM   #79
thunderchicken
journeyman
 
thunderchicken's Avatar
 
Join Date: Mar 2009
Posts: 211
Re: ** OFFICIAL CHATTER THREAD **

Quote:
Originally Posted by diebitter View Post
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.
thunderchicken is offline   Reply With Quote
Old 04-02-2011, 07:39 PM   #80
Neil S
King of the sidebar
 
Neil S's Avatar
 
Join Date: Sep 2004
Location: Northern Virginia
Posts: 18,041
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
Neil S is offline   Reply With Quote
Old 04-02-2011, 07:48 PM   #81
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 12,294
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Windows Script Host has been around for a looong time, certainly Win98, maybe 95. Or do you mean PowerShell?
_dave_ is offline   Reply With Quote
Old 04-02-2011, 07:57 PM   #82
Neil S
King of the sidebar
 
Neil S's Avatar
 
Join Date: Sep 2004
Location: Northern Virginia
Posts: 18,041
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by _dave_ View Post
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.
Neil S is offline   Reply With Quote
Old 04-02-2011, 09:21 PM   #83
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 12,294
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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!
_dave_ is offline   Reply With Quote
Old 04-03-2011, 11:39 AM   #84
greg nice
Carpal \'Tunnel
 
greg nice's Avatar
 
Join Date: Aug 2004
Posts: 9,278
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

dont rewrite code

http://www.joelonsoftware.com/articl...000000069.html
greg nice is offline   Reply With Quote
Old 04-03-2011, 12:09 PM   #85
Adam27X
veteran
 
Adam27X's Avatar
 
Join Date: Dec 2008
Location: New York/New Jersey border
Posts: 2,083
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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?
Adam27X is offline   Reply With Quote
Old 04-03-2011, 02:34 PM   #86
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 21,736
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

It's an exaggeration - but not a very big one (if you accept "work" to mean code changed).
jjshabado is offline   Reply With Quote
Old 04-03-2011, 04:50 PM   #87
clowntable
Carpal \'Tunnel
 
clowntable's Avatar
 
Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 45,543
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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
clowntable is offline   Reply With Quote
Old 04-03-2011, 04:57 PM   #88
rt1
adept
 
Join Date: Jun 2004
Location: just one rt
Posts: 1,099
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by clowntable View Post
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.
rt1 is offline   Reply With Quote
Old 04-03-2011, 06:46 PM   #89
Neil S
King of the sidebar
 
Neil S's Avatar
 
Join Date: Sep 2004
Location: Northern Virginia
Posts: 18,041
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by greg nice View Post
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).
Neil S is offline   Reply With Quote
Old 04-03-2011, 07:15 PM   #90
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,731
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
gaming_mouse is offline   Reply With Quote
Old 04-03-2011, 08:20 PM   #91
kyleb
Carpal \'Tunnel
 
kyleb's Avatar
 
Join Date: Sep 2004
Location: Seattle
Posts: 39,012
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
kyleb is offline   Reply With Quote
Old 04-03-2011, 08:39 PM   #92
clowntable
Carpal \'Tunnel
 
clowntable's Avatar
 
Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 45,543
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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
clowntable is offline   Reply With Quote
Old 04-04-2011, 12:03 AM   #93
greg nice
Carpal \'Tunnel
 
greg nice's Avatar
 
Join Date: Aug 2004
Posts: 9,278
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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?
greg nice is offline   Reply With Quote
Old 04-04-2011, 02:37 AM   #94
rt1
adept
 
Join Date: Jun 2004
Location: just one rt
Posts: 1,099
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
rt1 is offline   Reply With Quote
Old 04-04-2011, 09:34 AM   #95
Gullanian
Carpal \'Tunnel
 
Gullanian's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 14,008
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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.
Gullanian is offline   Reply With Quote
Old 04-04-2011, 09:44 AM   #96
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 21,736
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by rt1 View Post
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.
jjshabado is offline   Reply With Quote
Old 04-04-2011, 10:40 AM   #97
tercet
Carpal \'Tunnel
 
tercet's Avatar
 
Join Date: Mar 2006
Location: thall
Posts: 7,170
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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(); %>" />
tercet is offline   Reply With Quote
Old 04-04-2011, 10:48 AM   #98
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,731
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
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.
gaming_mouse is offline   Reply With Quote
Old 04-04-2011, 10:57 AM   #99
Gullanian
Carpal \'Tunnel
 
Gullanian's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 14,008
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by tercet View Post
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.
Gullanian is offline   Reply With Quote
Old 04-04-2011, 12:14 PM   #100
Zurvan
Retired
 
Zurvan's Avatar
 
Join Date: Apr 2005
Location: On the front porch, yelling at kids
Posts: 32,281
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

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
Zurvan is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 08:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2008-2010, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online