|
|
| Programming Discussions about computer programming |
02-23-2012, 07:02 PM
|
#2551
|
|
Carpal \'Tunnel
Join Date: Dec 2006
Location: London
Posts: 13,043
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by Zurvan
So, my boss was heard to say "I'm Steve Jobs" yesterday. I'm fairly sure he wasn't entirely kidding.
|
Does he look like this?
|
|
|
02-23-2012, 07:08 PM
|
#2552
|
|
Pooh-Bah
Join Date: Jul 2005
Posts: 4,001
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
haha
|
|
|
02-23-2012, 11:58 PM
|
#2553
|
|
S.A.G.E. Master
Join Date: Jun 2005
Location: Why didn't I use Clojure instead?
Posts: 16,995
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by Xhad
It was a CLISP session. I don't "really" use LISP, though I have some familiarity with it.
|
I'll attempt to explain what I think is happening here, and see if it melds well with Practical Common Lisp (great book, btw).
Data is objects, and I think what you ended up asking is "Does 0 exist?" and the answer is, in a purely computational way, "Yes, there is some pointer to some object called '0' thus this is true."
Common Lisp also does this:
Code:
CL-USER> 10/5
2
CL-USER> 10/3
10/3
CL-USER> (+ 10/3 10/5)
16/3
CL-USER> (+ 1/10 1/10)
1/5
CL-USER> (/ 10 3)
10/3
CL-USER> (+ (/ 10 3)
(/ 10 5))
16/3
CL-USER> (floor (/ 10 3))
3
1/3
CL-USER> (ceiling (/ 10 3))
4
-2/3
CL-USER> (defvar x (floor (/ 10 3)))
X
CL-USER> x
3
I think all of the above is really cool.
|
|
|
02-24-2012, 12:50 AM
|
#2554
|
|
Pooh-Bah
Join Date: Jan 2006
Location: London
Posts: 5,295
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by Gullanian
Who here is from London again? I just went to the London HN meetup was very cool, hundreds of people, free beer, some good talks and Joel Spolsky gave an interesting talk as well about how in communities it's important to naturally repel people you don't want as well as attract those you do which I thought was interesting.
If anyone is around for the next one let me know can go for a pint after!
|
I'm in. Where on HN do they post about the meetups?
On an unrelated note, I have a refactoring problem I don't know what to do about. I have a performance sensitive depth first recursive (iterative version with a custom stack showed lower performance and was far more complex) function that traverses a tree structure. I need to do pre and post processing and among the algorithms that traverse the tree. I have more than a few different algorithms that traverse the tree and do various calculations, but the only thing they share in common (for the most part) is the actual traversal code, but it feels like an incredibly bad idea to copy and paste that among the functions. What's twisting me up is that these functions use different numbers of variables and often have different local variables that they work with. Here is a simplified representation of how the algorithms might look:
Code:
void recurse(Node &node, .....) {
//possibly calculate some local variables to be use,
// or maybe not
for (c=0;c<node.numChildren;++c) {
//various code, possibly more temporary variables
//and either dealing with a leaf node or recursing further
}
//post processing, possibly using some of the
// temporary variables that have been modified
//while walking the children
}
I'll also add that my traversing code is far more complex than this as I exploit some properties of my tree to place certain types of nodes/leave in certain positions in the child array.
Is there anything I can do to not repeat myself without performance penalties?
|
|
|
02-24-2012, 01:25 AM
|
#2555
|
|
journeyman
Join Date: Jul 2007
Posts: 223
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by skier_5
I have more than a few different algorithms that traverse the tree and do various calculations, but the only thing they share in common (for the most part) is the actual traversal code, but it feels like an incredibly bad idea to copy and paste that among the functions. ...
Is there anything I can do to not repeat myself without performance penalties?
|
You can have one traversal function and you can put each "calculation functionality" into a dedicated object (one method or several for pre post processing) let those objects all implement the same interface and you call the specific interface method(s) on this object. IOW one traversal function which always calls the same methods but the objects it gets will be different. (With that you might have to pass some references that are not really needed by the specific object.)
There are a lot of other possibilities but from a design standpoint that's one of the more cleaner solutions, but dependent on what specific performance needs you have you might actually want to go a different route, but that's very dependent on your exact situation.
|
|
|
02-24-2012, 02:12 AM
|
#2556
|
|
old hand
Join Date: Dec 2010
Location: Somewhere over the rainbow
Posts: 1,483
|
Quote:
Originally Posted by pablito_21
I am not a programmer but I love solving the problems from things like the spotify and ACM challenges: thinking about possible solutions, creating algorithms in text or pseudo-code, finding ways to optimize a solution, ...
I can actually write the programs as well, as I have some background in java/C/C++ from college, but as I said, I am not an experienced programmer.
I know that my forte, and also my personal preference, is towards the 'problem solving' part, and the actual programming is something where I'm at a significant disadvantage compared to 'real' programmers.
Hence my question: are there actually jobs geared towards this skillset? How would I go about finding them? For example, what kind of jobs would you be able to get into if you impress the spotify people with your solutions for their problems?
Basically, what are my options if I am a worse 'programmer' than most but a better 'thinker' than most.
|
Easy, just code more and improve your programming. You can teach people to program, but it's very difficult to teach people to think.
Are you able to look at a large working program and understand it? If you can, then maybe consider optimization and tuning. Although this type of work is more niche and may not provide many choices in jobs
|
|
|
02-24-2012, 02:57 AM
|
#2557
|
|
Carpal \'Tunnel
Join Date: Apr 2005
Location: Shallow End OTKP
Posts: 13,969
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by wull
You can have one traversal function and you can put each "calculation functionality" into a dedicated object (one method or several for pre post processing) let those objects all implement the same interface and you call the specific interface method(s) on this object. IOW one traversal function which always calls the same methods but the objects it gets will be different. (With that you might have to pass some references that are not really needed by the specific object.)
|
this sounds about right. the keywords your query triggered for me, skier, were "visitor pattern" and "polymorphism" -- you might start there.
|
|
|
02-24-2012, 09:06 AM
|
#2558
|
|
help me help you
Join Date: Apr 2007
Location: up-at-dawn, pride-swallowing siege
Posts: 21,490
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Of related interest: boost bind and boost lambda.
boost bind adapts <almost anything> to fit a particular callback pattern. Useful when working with libraries.
boost lambda lets you write your callbacks inline.
|
|
|
02-24-2012, 11:51 AM
|
#2559
|
|
veteran
Join Date: Mar 2007
Location: Shoving AK
Posts: 2,839
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Moved over to my new domain last night. Decided to purchase guy.ht (first name + initials) and move my existing pages / blog over.
It was actually a lot easier than I expected. I just copied my old virtual hosts file and changed ServerName to guy.ht, saved it as a new file, then edited my old virtual hosts file and setup a mod_rerwite redirect. Any pages that are accessed on the old domain are automatically forwarded.
Slightly annoying that for some reason, .ht domains are about 5 times the price of most over tlds, but been wanting to have a branded domain for a while so pretty happy with it.
Now I just need to update the home page which is a bit meh.
|
|
|
02-24-2012, 11:58 AM
|
#2560
|
|
Carpal \'Tunnel
Join Date: Dec 2006
Location: London
Posts: 13,043
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
I'm moving my site over now and it's going slow lol, have to get SSL certs reissued which will be slow probably! Wish I could just copy+paste like you lol  Got like 100k files as well took friggin ages to move, as well as it being hard to debug server errors when it's only 50% propogated (on RDP its propogated here in UK it's not)
|
|
|
02-24-2012, 12:53 PM
|
#2561
|
|
veteran
Join Date: Mar 2007
Location: Shoving AK
Posts: 2,839
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Ye, moving domain is a lot easier than moving server.... and my SSL certificates are self signed.
|
|
|
02-24-2012, 02:05 PM
|
#2562
|
|
Ivan Drago's homeslice
Join Date: Dec 2006
Location: Zinatula fan club
Posts: 16,901
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
does anyone remember a link posted here (or maybe somewhere else) a couple of months ago about a statistical package that does multi-variate correlation on a dataset?
i can't find it.
|
|
|
02-24-2012, 02:10 PM
|
#2563
|
|
Pooh-Bah
Join Date: Mar 2008
Posts: 3,707
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
I've been working a lot on my Ruby on Rails the last few weeks. God I felt like an idiot at the start (haven't done ANY programming in years/my brain is an atrophied mush), but I think I'm finally getting a handle on it. Just started building a simple 2+2esque forum just for learning.
Anyone have any good ideas of features to add that might be good for improving my knowledge of the language?
|
|
|
02-24-2012, 02:27 PM
|
#2564
|
|
_Pooh_Bah_
Join Date: Feb 2005
Location: UK
Posts: 9,190
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by sylar
does anyone remember a link posted here (or maybe somewhere else) a couple of months ago about a statistical package that does multi-variate correlation on a dataset?
i can't find it.
|
R?
|
|
|
02-24-2012, 02:50 PM
|
#2565
|
|
Ivan Drago's homeslice
Join Date: Dec 2006
Location: Zinatula fan club
Posts: 16,901
|
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
Quote:
Originally Posted by _dave_
R?
|
no i don't think it was R.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 04:38 AM.
|