Open Side Menu Go to the Top

03-12-2013 , 10:56 PM
Quote:
Originally Posted by gaming_mouse
Ha, I did not expect that, pretty cool tho.
What were you expecting? Poker Coach?
** 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 **
03-12-2013 , 11:04 PM
Quote:
Originally Posted by daveT
In my past life, I did massage.



Right. That's version 0.12

I thought about it for a second and I think I agree w/ Neil. Waiting for 1.x makes it feel like a not-yet-ready project and now that people are getting acclimated to 0.x, it'll be devastating if they break backwards compatibility at v1 after they sit on it for nearly 5 years. I'm thinking of the current fracture in the Python and Perl communities here. You would have to trust that Node JS is a highly-tuned and masterfully planned language to trust that the jump to 1.x won't create serious issues to those who want to upgrade. Not only that, but Dahl already stepped away from the project. Most of the popular languages have a BDFL.
Yeah and 0.12 is on the way to 1.0. For 1.0 to hit they want to get the http changes in and test it rather than delay 0.10 any longer.

Dahl stepped down a long time ago. It's not like he was like "omg node sucks, I'm done". All he did was get away from the day to day things. He still works at the company who backs Node. Isaacs and the rest of the core team have done a great job to keep things together and moving forward.

I'm not concerned with compatibility issues. They openly said a million times they will do their best to keep things compatible between releases but will break compatibility on things that no longer make sense.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-12-2013 , 11:14 PM
Hey dave, been out of town, thanks for reply.

I like school for what I believe are similar reasons. Teachers aren't teaching magic, they are teaching how the world works.

And I like learning how the world works. Not just how to solve the problems that will be on the test, but understanding the concepts behind them. They don't just "work", but there is a how and a why behind the working.

I might just feel a bit out of place in the CS world because it is foreign to me. I'm used to knowing the general mechanics behind things in school, but in CS I feel like I'm exploring a new planet. What's cool is that it is a way to describe the planet we know and love, but the why's and how's behind it are all new.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 09:54 AM
I have a bunch of Hand Histories that have a slight formatting issue. They HH are able to be imported to HM2 just fine, but NoteCaddy is unable to read them and create notes. I have contacted NC support and they are unable/ unwilling to help. Basically the issue is that in one line the HH's I have will say "--- Dealing flop [AD,QD,3c]" while I need it to say "--- Dealing flop [AD, QD, 3c]". The only difference is that I need to add a space after the commas. Once it does that NoteCaddy is able to read the HH and take notes on it.

I'm wondering what language I would need to do something like this and if anyone can lead me to someone who can write something like this. Also how much would it cost me to hire someone to write this for me?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 10:31 AM
Quote:
Originally Posted by Urinal Mint
Hey dave, been out of town, thanks for reply.

I like school for what I believe are similar reasons. Teachers aren't teaching magic, they are teaching how the world works.

And I like learning how the world works. Not just how to solve the problems that will be on the test, but understanding the concepts behind them. They don't just "work", but there is a how and a why behind the working.

I might just feel a bit out of place in the CS world because it is foreign to me. I'm used to knowing the general mechanics behind things in school, but in CS I feel like I'm exploring a new planet. What's cool is that it is a way to describe the planet we know and love, but the why's and how's behind it are all new.
The nice thing about this subforum is that there is a wide variety of programmers here, with sometimes wildly divergent viewpoints. The takeaway is that the world is plenty large enough that you can run install scripts all day, crunch data, or push bits and in all of these cases you are a programmer. Its up to you if you want to dig to the core or just stay in the stratosphere. There's enough room for everyone.

As for the 'why' and 'how,' those ideas become more fluid as you go along. I wish there was more I could say about it, but nearing on 2 years of study, I still have a long way to go before I have a satisfactory definition of why and how, ie, assembly + mastery of algorithms.

For others, the why and how is simply "I use [blank] and do [x] at the command line and now [y] happens." That is a high level approach. In either low or high level, you are looking at a lifetime of learning and interesting situations. Without sounding too offensive, I would never want to work along side this person.

My only advice is to not worry about it. The answers will come to you as you go along. It sounds like you and I share the common "no goal" approach. Just trust the teaching you are getting and you'll advance and discover interesting stuff far quicker than you realize.

Looking back, had I concentrated on high-level programming, I'd probably be gainfully employed at a RoR or Drupal house by now. Regardless, I am wildly in debt to this forum for showing me that I am a total idiot and I should start from absolute scratch and learn the foundations of programming before trying to get into anything "useful" and I wouldn't trade that for a job that I am sort of not so good at. It also opened up an entire world that I could have never imagined existed.

The nice thing is that the posters here are as open as they can be. I wish I knew much more about what they do in their day-to-day but I understand that they have implied or specific NDAs. Regardless, with well-measured questions, you can gain deep insight about philosophical issues and specific programming problems.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 10:33 AM
Quote:
Originally Posted by DDLJ
I have a bunch of Hand Histories that have a slight formatting issue. They HH are able to be imported to HM2 just fine, but NoteCaddy is unable to read them and create notes. I have contacted NC support and they are unable/ unwilling to help. Basically the issue is that in one line the HH's I have will say "--- Dealing flop [AD,QD,3c]" while I need it to say "--- Dealing flop [AD, QD, 3c]". The only difference is that I need to add a space after the commas. Once it does that NoteCaddy is able to read the HH and take notes on it.

I'm wondering what language I would need to do something like this and if anyone can lead me to someone who can write something like this. Also how much would it cost me to hire someone to write this for me?
I hate to pee all over someone getting a paid gig, but can't you open this file up in word pad and do find-and-replace?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 12:08 PM
$ cat file | sed 's/\[([AKQJT2-9]{1}[HDSChdsc]{1}),([AKQJT2-9]{1}[HDSChdsc]{1}),([AKQJT2-9]{1}[HDSChdsc]{1})\]/\[\1, \2, \3\]/g' > newfile

something like that?

edit: added lower case heart/spade/diamond/club since you had both, but probably it's consistent and you only need one or the other

Last edited by well named; 03-13-2013 at 12:15 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 12:15 PM
Quote:
Originally Posted by DDLJ
I have a bunch of Hand Histories that have a slight formatting issue. They HH are able to be imported to HM2 just fine, but NoteCaddy is unable to read them and create notes. I have contacted NC support and they are unable/ unwilling to help. Basically the issue is that in one line the HH's I have will say "--- Dealing flop [AD,QD,3c]" while I need it to say "--- Dealing flop [AD, QD, 3c]". The only difference is that I need to add a space after the commas. Once it does that NoteCaddy is able to read the HH and take notes on it.

I'm wondering what language I would need to do something like this and if anyone can lead me to someone who can write something like this. Also how much would it cost me to hire someone to write this for me?
Quote:
Originally Posted by daveT
I hate to pee all over someone getting a paid gig, but can't you open this file up in word pad and do find-and-replace?
Yup, or if it is so many hand histories that manual find and replace is not feasible, then you could use something like sed (Unix tool) to do it (or some other tool for doing find and replace over multiple files)

For sed something like:
Code:
 find . -name *.hh -exec sed -i "s/Dealing flop \[??,??,??\]/Dealing flop \[??, ??, ??\]/g" '{}' \;
would work I think

(assumes that all hand history files have the extension ".hh" and that all ".hh" files in the current directory and all subdirectories are hand histories. should make a backup directory first in case this command is slightly wrong)

If you're on Windows looks like there are some options:
http://stackoverflow.com/questions/1...ty-for-cmd-exe
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 12:16 PM
mine is harder to read, and therefore is better
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 12:28 PM
Quote:
Originally Posted by daveT
I hate to pee all over someone getting a paid gig, but can't you open this file up in word pad and do find-and-replace?
It's over 100k hands over a few hundred files, so rather unfeasible. Thanks for the responses well named & ballin4life, but I was able to find someone who wrote a script and fixed it pretty fast.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 12:32 PM
there are scripters lurking everywhere, hiding between the threads, just waiting to pounce on any opportunity to process some files
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 09:13 PM
Code:
int myFuction(int int){
...
}
Why would anyone want to use unnamed parameters? I haven't bothered to explore this further since it offends my taste, but is there any reason I should not shudder at the thought of this?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 09:49 PM
I can't think of any reason. We lose points on assignments for using poor names that aren't descriptive.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 10:25 PM
because it's less typing and has no impact on readability if you're doing it right. in fact, i think this:

Code:
def get_balance(account_number):
is clearer than this:

Code:
def get_balance(account_number=account_number):
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 10:29 PM
Quote:
Originally Posted by daveT
Code:
int myFuction(int int){
...
}
Why would anyone want to use unnamed parameters? I haven't bothered to explore this further since it offends my taste, but is there any reason I should not shudder at the thought of this?
Can you give an example of a working function that does this? I don't even understand how that would work.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 11:16 PM
Ya, how do you reference them in the function?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 11:21 PM
Here's one working example: http://stackoverflow.com/a/2490720

Might want to look at the conversation to get a better clue of what is happening here. One person says "stack" another says "register" and another says "don't post that!"

Code:
#include<stdio.h>
void f(double)
{
    double dummy;
    printf("%lf\n",*(&dummy-2)); //offset of -2 works for *my* compiler
}

int main()
{
    f(3.0);
}

Apparently this practice is not exactly illegal in C++ land and you can find quite a few examples, but it shouldn't be possible in plain C.

Turns out I sort of misunderstood the issue. The book wasn't suggesting that C "allows" you to use anon arguments in functions, but you can do it in function prototypes. See line 3 of this amazingly stupid program:

Code:
#include <stdio.h>

int mutliply(int, int);

// I think the correct way should be:
// int multiply(int x, int y);

int main(void){
  int x, y, ans;
  
  printf("What would you like to multiply today? ");
  scanf("%d%d", &x, &y);
  
  ans = multiply(x, y);
  
  printf("The answer is: %d", ans);

  return 0;
}

int multiply(int x, int y){
  int ans;
  
  ans = x * y;
  
  return ans;
}
So, what's the verdict? Go for not naming parameters in function prototypes or not?

Last edited by daveT; 03-13-2013 at 11:27 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 11:25 PM
Quote:
Originally Posted by tyler_cracker
because it's less typing and has no impact on readability if you're doing it right. in fact, i think this:

Code:
def get_balance(account_number):
is clearer than this:

Code:
def get_balance(account_number=account_number):
Slightly off-topic, but I sort of remember that Python runs quite a bit faster when I use default parameters. This could have been a function (pun?) of using IDLE but I never bothered to time it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-13-2013 , 11:41 PM
you are correct that positional args are theoretically faster since they don't incur the penalty of a dictionary lookup, but even ignoring possible compiler optimizations i would be stunned if the difference in execution time were noticeable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 12:34 AM
Now I had to sanity-check myself:

Code:
from timeit import Timer

def insertionSort(ul = [23, 65, 1, 2, 3, 4, 5, 6 , 4, 109, 43, 9]):
    for j in range(len(ul)):
        key = ul[j]
        i = j - 1
        while i >= 0 and ul[i] > key:
            ul[i + 1] = ul[i]
            i -= 1
        ul[i + 1] = key
    return ul


if __name__=='__main__':
    from timeit import Timer
    t = Timer(lambda: insertionSort())
    print(t.timeit(number=1000000))
IDLE:
result: 5.96516042903

Emacs:
result: 6.125282796722575



Code:
from timeit import Timer

def insertionSort(ul):
    for j in range(len(ul)):
        key = ul[j]
        i = j - 1
        while i >= 0 and ul[i] > key:
            ul[i + 1] = ul[i]
            i -= 1
        ul[i + 1] = key
    return ul

if __name__=='__main__':
    from timeit import Timer
    t = Timer(lambda: insertionSort([23, 65, 1, 2, 3, 4, 5, 6 , 4, 109, 43, 9]))
    print(t.timeit(number=1000000))
IDLE:
result: 12.2955807149
result two: 12.5789123446

Emacs:
result: 13.8992716149884

I have a clear recollection of default args going faster than not-default arguments.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 01:29 AM
dave i think you're running into something like this: http://stackoverflow.com/questions/1...fault-argument
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 02:15 AM
Maybe....

Code:
def function(data=[]):
    data.append(1)
    return data

print('the feature')
print(function())
print(function())
print(function())

def insertionSort(ul = [23, 65, 1, 2, 3, 4, 5, 6 , 4, 109, 43, 9]):
    for j in range(len(ul)):
        key = ul[j]
        i = j - 1
        while i >= 0 and ul[i] > key:
            ul[i + 1] = ul[i]
            i -= 1
        ul[i + 1] = key
    return ul


print('the sort')
print(insertionSort())
print(insertionSort())
print(insertionSort())
output:

Code:
>>> 
the feature
[1]
[1, 1]
[1, 1, 1]
the sort
[1, 2, 3, 4, 4, 5, 6, 9, 23, 43, 65, 109]
[1, 2, 3, 4, 4, 5, 6, 9, 23, 43, 65, 109]
[1, 2, 3, 4, 4, 5, 6, 9, 23, 43, 65, 109]
I guess it's possible that it is already saving the sorted function and returning the prefab faster. There's just no way that I'd be able to check for certain though, is there?

And why wouldn't it save the prefab in the case of ul being undeclared? There is no speed increase if I have (ul = []) and that seems to contradict the first case. I also know that .append() is mutating, but I don't think swapping values is mutating + value-saving. That would cause pushing in [1, 3, 4, 5] to return this list plus all the others stuff that was already sorted, so I don't think insertionSort() works the same as the original case.

Last edited by daveT; 03-14-2013 at 02:23 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 03:08 AM
I believe the list is already sorted for all runs of insertionSort() after the first one. So the insertionSort() runs really fast since it doesn't have to do anything.

try

Code:
def insertionSort(ul = [23, 65, 1, 2, 3, 4, 5, 6 , 4, 109, 43, 9]):
   print "ul before sort = %s" % ul
   ...
to check
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 08:50 AM
Quote:
My main concern is portability. I was pretty well burned by developing part of the program in Win 7 and pushing it over to Vista, which is why I'd probably look into Jython or Iron if I did it again. How did you handle portability issues?
Yep you might be right there. The short answer is: we didn't. We just set up the entire box on Linux for all customers (or they did it). There was a half assed Windows port attempt but noone really wanted to do it (OpenSource house and all).

For enterprise stuff this is mostly a nonissue but it's obviously huge in other areas. Enterprise it's basically "you will run X-OS, Y-DB etc with the software or GTFO (or bay a boatload for porting)". Helps that OS and DB come at 0 license cost.

JVM isn't horrible (as long as JAVA isn't the language). As long as you can live with the somewhat lagging Python version number Jython seems like a decent option. I'm planning to play with this in the near future because all the robust/matureish Prolog-connectors seem to be to JAVA (or C) anyways.
JIT compiler is pretty great from my experience and the JVM gets a ton of devtime.
Lots of academics stuff I could use is JAVA based as well which would be a nice plus.

My real question is...if JVM why not just stick with Clojure
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
03-14-2013 , 08:53 AM
Quote:
Originally Posted by daveT
And why wouldn't it save the prefab in the case of ul being undeclared?
Python default arguments are stored in a dictionary when the def is first run. If you haven't set any default, there won't be a list in the dict because python doesn't even know it's going to be a list.

Quote:
There is no speed increase if I have (ul = []) and that seems to contradict the first case.
If you have a default, but pass in something else, the default gets ignored entirely.

Quote:
I also know that .append() is mutating, but I don't think swapping values is mutating + value-saving.
It is if the values being swapped are positions within a mutable

Try this:

Code:
a = [1,2,3]
b = a
b[1] = 0
print a
Quote:
That would cause pushing in [1, 3, 4, 5] to return this list plus all the others stuff that was already sorted, so I don't think insertionSort() works the same as the original case.
Why? You never append or do anything else that would alter the length of the list, and you have only one return value.
** 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