Open Side Menu Go to the Top

05-26-2013 , 01:06 PM
Re: "hiding extensions"

At least with apache it's done via mod_rewrite. There's probably something equivalent for other web servers

In a lot of cases, the URL rewriting is part of a scheme that implements a model-view-controller pattern for the server side code. For example, if you're using PHP, you might look at a framework called CodeIgniter. You can setup an .htaccess for codeigniter that will map all (perhaps excluding some specific requests, like to an images directory) requests to the codeigniter index.php, which is it's "front controller", and then it maps requests like /controller/method/arg1/arg2 to Controller::method(arg1, arg2), contained conveniently in a php file that defines the class for the controller.

url rewriting + MVC is a fairly nice way of laying out server side code, and I think it's fairly standard among web frameworks in most languages
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
05-26-2013 , 01:11 PM
great talk on the hardware of our brains and how it affects design:

http://www.youtube.com/watch?v=z2exx...ayer_embedded#!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-26-2013 , 01:17 PM
Quote:
Originally Posted by Ryanb9
Php question ...
Can I make a variable read-only / const everywhere except for within the script i define it in. Or within the php tags its defined in (but it can still be modified within those php tags where it was defined. I would bet its 1:50 that this functionality is supported but I had to ask b/c if it is my final project will go much easier.
The usual way to accomplish that kind of encapsulation is with private members of a class.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 01:28 AM
Yeah but it was for $_SESSION[] data and didnt want to make a class xD
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 02:11 AM
Does anyone here know of a computer programming forum that is as active and helpful as 2+2?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 02:55 AM
u could try stackoverflow.com
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 09:18 AM
After seeing one of the thoughtbot guys be a total ninja with vim, I've decided to take it up. vim-adventures.com is pretty cool, and has helped a bit with the really odd jklh or whatever the keys are, it's all muscle memory at this point.

It's really powerful, and I can see how valuable it might be when you get good with it. The reality is of the ~10 people I've seen work with it, maybe 2 were faster than I'd be with sublime, and 8 were just fumbling around way more slowly. The 2 that were faster were both thoughtbot and were crazy fast.

Also, I just tried to edit this post using vim commands.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 09:28 AM
The goal with Vim is to take your hands off of home row as little as possible. That's why you see people go as far as to design whole window managers that can be controlled with the keyboard.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 11:30 AM
Quote:
Originally Posted by Nchabazam
After seeing one of the thoughtbot guys be a total ninja with vim, I've decided to take it up. vim-adventures.com is pretty cool, and has helped a bit with the really odd jklh or whatever the keys are, it's all muscle memory at this point.

It's really powerful, and I can see how valuable it might be when you get good with it. The reality is of the ~10 people I've seen work with it, maybe 2 were faster than I'd be with sublime, and 8 were just fumbling around way more slowly. The 2 that were faster were both thoughtbot and were crazy fast.

Also, I just tried to edit this post using vim commands.
I'd definitely look into learning Eclipse or Visual Studio. Your paragraph would have been effortless to write:

Quote:
A [tab] s [tab] o [tab] o [tab] t [tab] t [tab] g [tab] b [tab] a [tab] n [tab] w [tab] v [tab], [tab]'v [tab] d [tab] t [tab] t [tab] i [tab] u [tab] . [tab] - [tab] . [tab] i [tab] p [tab] c [tab], [tab] h [tab] h [tab] a [tab] w [tab] t [tab] r [tab] o [tab] j [tab] o [tab] w [tab] t [tab] k [tab] a [tab], [tab]'s [tab] m [tab] m [tab] a [tab] t [tab] p [tab] . [tab]'s [tab] p [tab], [tab] I [tab] s [tab] h [tab] v [tab] i [tab] m [tab] b [tab] w [tab] y [tab] g [tab] g [tab] w [tab] i [tab] . [tab] r [tab] i [tab] o [tab] t [tab] ~ [tab] p [tab] I [tab] s [tab] w [tab] w [tab] i [tab], [tab] 2 [tab] f [tab] t [tab] I [tab] b [tab] w [tab] s [tab], [tab] 8 [tab] j [tab] f [tab] a [tab] w [tab] m [tab] s [tab] . [tab] 2 [tab] w [tab] f [tab] w [tab] b [tab] t [tab] a [tab] w [tab] c [tab] f [tab] . [tab], [tab] j [tab] t [tab] t [tab] e [tab] t [tab] p [tab] u [tab] v [tab] c [tab] .
Anyone up for Editor / IDE Golf? (doesn't have to precisely what is shown above)

Editor: Emacs

Commands: F3 C-f C-d [ t a b C-f C-f F4 C-u 9 9 F4

Score: 14

Had I just held down the F4 the first time is shows up, I would have had 10, but I think that's cheating, although I am in paredit mode, so the [ auto-completes, so if that is cheating, the final score is 15.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 12:14 PM
Put this in your vimrc if you want tab completion.

Code:
" Insert tab character in whitespace-only lines, complete otherwise
inoremap <Tab> <C-R>=SmartTab()<CR>

function! SmartTab()
	if strpart( getline( '.' ), 0, col( '.' ) - 1 ) =~ '^\s*$'
		return "\<Tab>"
	else
		return "\<C-P>"
	endif
endfunction
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 12:27 PM
Quote:
Originally Posted by gaming_mouse
great talk on the hardware of our brains and how it affects design:

http://www.youtube.com/watch?v=z2exx...ayer_embedded#!
Nice talk. Thanks for sharing.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 01:03 PM
I'm building a clone of a sports betting website using python/django and I'm trying to define my models. I'm pretty sure I will need a separate model for each sport I want to feature on the site because different sports have different fields, ie baseball would need pitcher, runline.

So I have 3 models right now: Bet, MLB, and NBA. Within the Bet model, I want to specify which sport the bet is for and have access to all the fields within either MLB or NBA. However, I'm not sure if it's possible to have Bet.sport = either MLB or NBA. Does anyone have any suggestions for how to do this? Do I need a separate Sport model? Is it better to just not link the models in this way?

Code:
class Bet(models.Model):
    user = models.Foreignkey(User, related_name="bets")
    sport = 
    bet_type = 
    bet_desc = 
    risk = 
    to_win = 
    result = 


class MLB(models.Model):
    eventtime = 
    vteam = 
    vpitcher = 
    vrot = 
    hteam = 
    hpitcher = 
    hrot = 
    periodnum = 
    perioddesc = 
    vml = 
    hml = 
    vspread = 
    vodds = 
    hspread = 
    hodds = 
    total = 
    overodds = 
    underodds = 
    lastupdated = 

class NBA(models.Model):
    eventtime = 
    vteam = 
    vrot = 
    hteam = 
    hrot = 
    periodnum = 
    perioddesc = 
    vml = 
    hml = 
    vspread = 
    vodds = 
    hspread = 
    hodds = 
    total = 
    overodds = 
    underodds = 
    lastupdated =
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 01:30 PM
Quote:
Originally Posted by Ryanb9
u could try stackoverflow.com
Thank you I really appreciate the recommendation. I am hoping the site is as useful as this one but I guess we are a bunch of degenerates so I could totally see why if it is not.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 01:39 PM
Quote:
Originally Posted by gaming_mouse
great talk on the hardware of our brains and how it affects design:

http://www.youtube.com/watch?v=z2exx...ayer_embedded#!
Interesting video. I hope someone shows the part about color to google's graphic designers so they can stop the current trend of everything being tiny monochromatic icons. I actually stopped using gmail's webclient, after about a decade of use, because I can't tell what buttons do without looking directly at them anymore.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:06 PM
Quote:
Originally Posted by Neil S
Put this in your vimrc if you want tab completion.

Code:
" Insert tab character in whitespace-only lines, complete otherwise
inoremap <Tab> <C-R>=SmartTab()<CR>

function! SmartTab()
	if strpart( getline( '.' ), 0, col( '.' ) - 1 ) =~ '^\s*$'
		return "\<Tab>"
	else
		return "\<C-P>"
	endif
endfunction
I guess I could ask Google this, but what does Tab normally do in Vim? In emacs, tab is generally insignificant, so no matter where I hit tab, it simply formats the line I am working on, even if I am in the middle of the line. Very convenient.

A recent discovery is C-/, which is sort of like tab-completion where it predicts the word I'd like to use. I probably should start learning about the snippet modes, but I've been pretty lazy in that regard.

Quote:
Originally Posted by Hustle247
Thank you I really appreciate the recommendation. I am hoping the site is as useful as this one but I guess we are a bunch of degenerates so I could totally see why if it is not.
SO is definitely a great resource, except that there is no community feel to it. Apparently, maintaining the general quality of a forum is extremely difficult. Have to tip the hats to the management and moderation of 2+2 for doing a pretty good job. Seems like they managed to mostly filter the nutcases to areas where they can be in their own echo chambers and not muck up the rest of the forum, although the quality of the forums definitely had its ups and downs over the years.

Quote:
Originally Posted by Xhad
Interesting video. I hope someone shows the part about color to google's graphic designers so they can stop the current trend of everything being tiny monochromatic icons. I actually stopped using gmail's webclient, after about a decade of use, because I can't tell what buttons do without looking directly at them anymore.
When he talking about explaining why something is better in a new version, I was hoping he'd explain the new youtube. I think they made it nearly impossible to browse to drop the bandwidth and server costs or something. Prediction software isn't that good yet and the new format takes away the fun of youtube, IMO.

I know its probably a pita, but gmail does have different themes. Not sure what all of them look like, but I changed mine to that all-black theme and the icons to words a long time ago.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:14 PM
Irt to gmail, I just use thunderbird. Nice to have all my accounts in one place.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:18 PM
Thunderbird is just crazy slow if you have any kind of volume in your mail box. Or it has always been for me on Macs.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:24 PM
how much do you consider volume? or you just talking about mails in the actual inbox? I use thunderbird (windows tho) on one gmail with 1.5gb in it over imap and it seems very fast, only slow thing is searches on "body" for obvious reasons.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:29 PM
splashpot,

If you wanted to go all out you could probably have a base "sports" class that has all of the common things across all sports types. Then you could just extend that base class with MLB, NHL, etc..

It would be similar to the "students" section in 6.00x. A grad student, MIT student, and standard student are all "students".

That would get rid of the some duplicate fields between each sports type.

It might be handy to have some type of result page that shows bets only for baseball and for that I guess the bets class needs to know which sport the bet belongs to. I don't like coupling them together but it seems you would have to if you wanted that functionality.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:32 PM
Quote:
Originally Posted by _dave_
how much do you consider volume? or you just talking about mails in the actual inbox? I use thunderbird (windows tho) on one gmail with 1.5gb in it over imap and it seems very fast, only slow thing is searches on "body" for obvious reasons.
I think the problem is that I've only tried to use it when I needed to use it for GPG email and it would try to suck in 4 years of email. I may have patience issues.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 07:44 PM
yeah it was def slow to do the initial sync, and that was with a considerably smaller amount of mail than the current 1.5 gig
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 08:39 PM
Quote:
Originally Posted by daveT
I know its probably a pita, but gmail does have different themes. Not sure what all of them look like, but I changed mine to that all-black theme and the icons to words a long time ago.
omg I swear I must have looked for something like this 5+ times a week for a month and never found it

Even just changing the icons to words might be a deal un-breaker. The icons are the part that pisses me off the most; I get the impression that somebody thinks those are the basic shapes that guy was talking about in the video, but when they're in my peripheral vision they all look like identical blobs to me

Re Thunderbird: I'm fine with it on my old-ass Linux Mint machine, but the windows version slows my Win7 laptop to a crawl
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-27-2013 , 09:23 PM
Quote:
Originally Posted by splashpot
I'm building a clone of a sports betting website using python/django and I'm trying to define my models. I'm pretty sure I will need a separate model for each sport I want to feature on the site because different sports have different fields, ie baseball would need pitcher, runline.

So I have 3 models right now: Bet, MLB, and NBA. Within the Bet model, I want to specify which sport the bet is for and have access to all the fields within either MLB or NBA. However, I'm not sure if it's possible to have Bet.sport = either MLB or NBA. Does anyone have any suggestions for how to do this? Do I need a separate Sport model? Is it better to just not link the models in this way?

Code:
class Bet(models.Model):
    user = models.Foreignkey(User, related_name="bets")
    sport = 
    bet_type = 
    bet_desc = 
    risk = 
    to_win = 
    result = 


class MLB(models.Model):
    eventtime = 
    vteam = 
    vpitcher = 
    vrot = 
    hteam = 
    hpitcher = 
    hrot = 
    periodnum = 
    perioddesc = 
    vml = 
    hml = 
    vspread = 
    vodds = 
    hspread = 
    hodds = 
    total = 
    overodds = 
    underodds = 
    lastupdated = 

class NBA(models.Model):
    eventtime = 
    vteam = 
    vrot = 
    hteam = 
    hrot = 
    periodnum = 
    perioddesc = 
    vml = 
    hml = 
    vspread = 
    vodds = 
    hspread = 
    hodds = 
    total = 
    overodds = 
    underodds = 
    lastupdated =
[disclaimer i know nothing about django]. But for database design you should have a Sport table/model with records for NBA, MLB, etc. Then you reference that table from Bet . What happens when you want to add Hockey? Keep refactoring and normalizing the design.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-28-2013 , 05:45 AM
Quote:
Originally Posted by daveT
I guess I could ask Google this, but what does Tab normally do in Vim? In emacs, tab is generally insignificant, so no matter where I hit tab, it simply formats the line I am working on, even if I am in the middle of the line. Very convenient.

A recent discovery is C-/, which is sort of like tab-completion where it predicts the word I'd like to use. I probably should start learning about the snippet modes, but I've been pretty lazy in that regard.
Tab normally just inserts a tab or some spaces depending on what indentation modes you have set. The code above (I got from KDE many moons ago) preserves that if the line is empty or has only whitespace in it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-28-2013 , 02:27 PM
Quote:
Originally Posted by jjshabado
Look at a drug example:

Copying the idea of a pill that cures cancer is worthless since its figuring out how to build that pill that takes all of the work.

Copying a physical pill that cures cancer is almost trivial and would have a ton of value since the company copying could avoid billions in research costs.
Last time I checked Bayer was still raking in decent units of moneyz on Aspirin despite no patent protection and easy copy pills.

Quote:
Originally Posted by kerowo
Perhaps a better way of saying it is a right to sell the product without unfair competition. Without some legal protection anything new would be instantly copied and produced cheaper by a larger corporation with more resources. How do you prevent that in your business model?
What is this unfair competition you're talking about? Why would I want to prevent this anyways? I want more competition not less, free markets are markets that are maximally free to enter. You gain competitive advantages by locking up the right resources and gaining customer trust.

---

At the end of the day I'm just an ideologist though. The human way of learning things is by copying and modifying. This should not be prevented but rather accelerated.

Quote:
Originally Posted by Burnss
Got to start picking my dissertation for next year. The only thing im passionate about and know ill be interested in doing is something related to poker. Anybody got any suggestions or things they wish they done for it?

Obvious ones are: poker bot (although haven't done too many AI modules so may struggle with this?), tableninja or the dreaded seating script. Any recommendations?
All of these sound like MA thesis projects at best but not like dissertation projects. What is the significant scientific value you aim at providing with any of these projects? What gaps in our current knowledge are you trying to close?
Poker bot could yield some interesting stuff depending on how you go about it but the dissertation is not "ima write a bot and see what happens". You have to outline what knowledge gap you're trying to close and why.

Basically when you're done with a dissertation you should be the world expert on that topic. Building a better mousetrap is usually a meh idea unless said mousetrap uses interesting new approaches etc.

Quote:
Originally Posted by muttiah
Math and stats is incredibly useful. I write software in the supply chain industry where big data is a huge obstacle. Think a pharmaceutical company with 300 distribution sites and 300,000 products, and trying to optimize their inventory placement. Stuff I use regularly at work:

Statistical forecasting methods
Stochastic processes theory
Dynamic programming
Linear/mixed integer programming

And proficiency with algorithms and data structures is really important.

Also useful to learn some good prototyping langues like R, Matlab, python, C#.
Machine Learning (anything AI really), Operations Research and Constraint Programming + statistics of all sorts (Bayesian Nets) are the big ticket items.
It's really fun and fascinating stuff and as a poker player you pretty much have access to some interesting data samples to test your stuff on for some of these.

Last edited by clowntable; 05-28-2013 at 02:46 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m