« first day (79 days earlier)      last day (4876 days later) » 

1:46 AM
So, how long do you think before jsfiddle supports multiple source files?
I'm almost up to 1000 lines in one :(
 
2:16 AM
@david Probably when they add tabs at the top.
 
3:01 AM
@david Then you should probably move the code to somewhere else :) Really, working with complex files in jsfiddle isn't very fun
Of course, in a way, jsfiddle already supports multiple source files - just drop them in your Dropbox or something, then link it with the resource tab
 
 
1 hour later…
4:29 AM
but then I can't edit them in the pretty editor :P
I was hoping to be able to link to the source of other fiddles, like how you can link to the results frame with /embedded/result/
but I can't seem to get that working :(
 
4:43 AM
But the source is inline in that page. ):
 
 
6 hours later…
11:12 AM
@david you do realise there are better editors then jsfiddle right? :)
 
11:23 AM
Hoy.
 
@ClemDesm hey.
 
wa
:kitten quote
 
> "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook
 
Stop quoting !
 
@IvoWetzel how does one deal with networked gaming?
 
11:26 AM
@Raynos The server should always have the authority, but the clients should do interpolation and only correct them selfs when the server says so
 
@IvoWetzel is the Bible of network gaming.
 
@IvoWetzel how does one hide latency. I.e. press forward at frame xx1 server receives at frame xx3 gets back to client at frame xx5
 
there are some articles on the UT/Quake networking
what you could do is
client does stuff and sends the commands to the server, but also keeps track of them locally
server validates the commands
when he doesn't like one of them he tells the client
which then reverts back to that state
 
@IvoWetzel one of the things im puzzling with is client 1 commits action at frame y. Server receives message but is looping on frame y+4. does server rollback incorporate action at frame y then roll forward again?
 
well, valves source engine for example, keeps track of the last XXX states for other players
then it calculates a clients shot command against the frame that command was sent at
 
11:30 AM
@IvoWetzel thats only for critical real time things like shooting. They don't do that for movement
 
well for moving it self it doesn't really matter (unless you have a ton of moving platforms or the like)
make it move smoothly on the client side, and make sure there's no lag when doing critical stuff, the rest, well lag is lag...
 
aaah finished with this url shortener.
 
@IvoWetzel But I predict issues :(. Should I tell the server input action & client side frame it happened. or jsut send an input action and it happens when the server gets it?
 
@Raynos Well that depends... if the action is critical (e.g. results in HP loss, death), go with valves approach
 
Is movement non critical?
 
11:41 AM
I highly doubt that WoW is saving the world state for movement commands
iirc, lag always killed you
 
What about object collision
like in WAR
 
when movement critical stuff was going on
if the object moves, then save its X last positions, if not who cares
 
Imagine your playing football and trying to intercept the ball. The clientside prediction will lie to you and the server will tell you actaully you missed the ball.
 
0
Q: download a file asynchronously using FTP

Poonam BhattWhich function to you use to download a file asynchronously using FTP and save it locally?

I laughed @ comments.
 
@Raynos lag, you can't do anything against that, if the ball is gone, you can't hit it, especially not if someone else has already hit it afterwards
 
11:45 AM
@IvoWetzel Let me rephrase it. How do I fix latency? Alternatively if someone fixes latency what kind of awesome prize do they get for making a ground breaking discovery?
 
@Raynos Get a better connection
You can compensate it
But you can't fix it
that's why networking is hard
@Raynos Most likely no price at all, since games are EVIL!
 
You mean HL3 comes up behind you. stabs you. steals your code and claims the discovery as its own?
 
HL3... haha, they should finish Episode 3 first :P
is sad that he can't make any DNF jokes anymore
 
Whats the next ground breaking engine were expecting in the near future?
 
Google Future®
 
11:50 AM
@IvoWetzel did you do any compensating in the nodegameshooter?
 
@Raynos Nope, that's why it sucks at times
Orbit on the other hand doesn't need it, since the lag doesn't have any real impact on the gameplay
 
@IvoWetzel the movement style of nodegame kind of hides the lag.
 
@Raynos Still with enough lag it gets pretty unresponsive
 
@IvoWetzel I'll mess around with networking solutions for node at some point. I'll ignore it completely for now and get everything else working :P
@IvoWetzel Can I trick websockets into setting up a UDP connection?
 
@Raynos Nope
http based
and UDP networking is yet another story...
 
12:00 PM
@IvoWetzel Can't I open up a direct UDP sockets to someones browser :(
I guess even if we have UDP connections I dont want to write a wrapper around it and ill leave it to someone who knows what he's doing
 
Mac
12:19 PM
Hey I know this is off topic, but does anyone know if there is an XML,XSL chat room?
 
@Mac freenode irc
 
Mac
@Greg Thank You! :)
 
channel #xml
 
Mac
arr ok got it, thanks
 
hello can i put text on image with jquery?
So on mouseover/hover there would be a "Change avatar"
 
12:33 PM
@Karem use the title html property ?
<img title="Change avatar"/>
 
@Raynos yes thats a option
 
@Karem whats wrong with it? Alternatively overlay an absolutely position div on mouseover
 
@Raynos it isn't very good if it isn't jquery
 
@Raynos nothing is wrong with it, thanks for reminding me the property..used it now
 
@Greg one day I'll write the jquery.turingComplete plugin.
C++ templates are turing complete. jQuery will have to become turing complete too
 
12:48 PM
I wish people could read the source...
} else if (process._eval) {
  // -e, --eval
  var indirectEval= eval; // so the eval happens in global scope.
  if (process._eval) console.log(indirectEval(process._eval));
node.js code is stupid
 
1:38 PM
Good Morning... (or afternoon, depending on your tz)
 
2:29 PM
morning
 
@ircmaxell Evening :P
 
@ircmaxell hoy
 
How goes it?
Looks like the Col is at it again (this time I will fight tooth and nail, sine I believe he is wrong):
1
A: Please Critique this PHP Login Script

ircmaxellOk, here's a few: You shouldn't be using md5 anymore. You can, but there are better methods (Such as sha512 used with the hash() function). I would use a MUCH longer static salt as well. I suggest at least 64 characters (after all, it's minimal overhead to compute on write, but much more diff...

 
3:00 PM
geee, some ppl doesn't have a good sense of humour on SO...
 
-1
A: How would i output a message that says "values inserted to table" ?

ClemDesmShortest answer : echo 'values inserted to table';

 
+1 to cancel
(I wouldn't upvote it normally, but I wouldn't downvote either (especially looking at the question)...
 
I wasn't expecting an upvote nor a downvote for this, seriously.
 
@ClemDesm Should've CW'd it, really.
 
3:05 PM
The question was dumb, answer must be dumberer IMO =)
CW?
 
@ClemDesm Community Wiki. Sometimes people do that when they post answers like that. Not that it's what CW is really meant for, but...
 
It at least shields you from rep hits...
 
Well, anyway, I don't think I have enough rep to do that already
@ircmaxell Thanks for that btw ;)
 
for what?
 
the +1 to cancel
 
3:18 PM
Ahhh
no problem...
 
3:42 PM
(I'm experiencing this with EBooks right now... Sigh...)
 
4:01 PM
0
Q: print hierarchy data(adjacency list model) in a list(ul/ol/li)

adiI have an adjacency list model like here. I have made a full table containing all data ordered by level using this: SELECT t1.name AS lev1, t2.name as lev2, t3.name as lev3, t4.name as lev4 FROM category AS t1 LEFT JOIN category AS t2 ON t2.parent = t1.category_id LEFT JOIN category AS t3 ON t3....

^^ I'm always tempted to answer those questions (how can I do this) with the answer: By writing the code to do it! Duh!...
 
lol
So do I :|
 
4:17 PM
I can't stand blanket answers like this. Multiple data types exist for a reason...
1
A: Best way to store date and time with MySQL PHP + AJAX

Rahul MehtaStore as timestamp.timestamp contain both date and time. and it will be best way to store date and time .

 
4:29 PM
I see more and more tutorials with timestamp... That's what I hate with PHP/MySQL. Lots of crap on the internet and each noob that sees them uses it. If it works, he tells everyone to use it w/o knowing the consequences.
 
yeah
There is no magic bullet. If there was, we'd all use it. Instead, alternatives exist because there are always tradeoffs...
 
 
3 hours later…
7:03 PM
17 more till silver in MySQL... And 18 more till bronze in Regex...
ircmaxell, New Jersey, USA
14.7k 2 9 29
 
oh nice they added the badges to the tags
 
Yeah...
 
haven't noticed, been busy with the house though
 
what are badges for tags for?
 
(100 bronze, 400 silver, 1000 gold)
upvotes that is
 
7:13 PM
oh whow :) nice
 
Ok, so that blew my goal. Since it's 400, I'm 217 away from silver in MySQL.... :-(
 
you are much close to your goal than me ;)
anyways i 'm rather new
 
@Nick: That was done quite a while ago. Several months at least...
@sjngm: The best way to learn is to teach...
 
@ircmaxell I don't think so, I was referring to the user preview in chat
It's always shown the top tags, but not the badge icons in them, or I just missed it
 
Oh, that has been there for a while too... As long as I can remember (then again, that's only like 3 or 4 weeks as far as the chat)
 
7:18 PM
that's certainly possible, new house, moving, job changes, etc...I haven't kept up to date on everything :)
 
hehehe
how's the new house?
 
loving it, lots of work done since we both took a week off
some progress from the past few days: flickr.com/photos/nickcraver
HVAC coming today, we'll insulate/drywall that room soon as that's done, so should take under 4-5 days of work from framing to moving furniture in that room, not too shabby
 
Wow!
nice, looks like it's coming together nicely
 
thanks!, helps growing up with a carpenter for a dad :)
 
Yeah...
0
Q: Is there any script that can make full remote backup?

xunIs there any php script that can do file system backup and database backup (preferably zip them together) and send the backup to a remote server?

^^ Yet another I want to comment: "Yes there is" post
 
7:34 PM
Various parts in my code I'm using deep clones of javascript objects. Deep copying feels nasty to me and I presume there are alternative methods that don't rely on them but I'm not quite sure what they are.
 
Why do you need to clone them at all (Yet alone deep-clone)?
 
For example I store game state for current tick and the last tick.
I do that by cloning the game state. (So I have a copy of the current & previous state and can send deltas to clients)
 
Ahh, so you're trying to do a memento pattern...?
 
I agree that cloning object is poor and that there should be alternatives. But I cant think of them
Give me a second to read about the memento pattern :)
 
7:37 PM
Thats slightly more readable then wikipedia
 
I like the SourceMaking design patterns section...
 
That reminds me I need to finish reading my design patterns book
 
Which one?
 
the good one I think
 
7:39 PM
Design Patterns: Elements of Reusable Object-Oriented Software (ISBN 0-201-63361-2) is a software engineering book describing recurring solutions to common problems in software design. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch. They are often referred to as the Gang of Four, or GoF. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples ...
I went for the one with examples in smalltalk :) Is smalltalk still used?
 
I haven't read that one...
Part of me wants to read it, but the other part doesn't (I'm over the design-pattern phase). They are good to know, but tend to be over-used
 
im still an adhoc programmer
I also use cloning in some inheritance wrapper so that objects dont share a parent object
 
Fair enough. I feel that the whole premise of design patterns is a fine line. On one side of the coin, they are great a providing you with pre-thought solutions to common problems. But on the other side, no problem is truely common, so how can you apply cookie-cutter solutions to dynamic and fluid problems...
 
I see your point. But I learn a lot about them for different ways of doing things
 
I'm absolutely for learning them...
After all, they are a tool and there are many valid uses for them
 
7:45 PM
but yes how can I have a memento save it self without cloning itself?
 
Just don't get caught up in the "every problem can be solved with a pattern" trap. Too often you'll wind up twisting the pattern (bad) or the problem (worse) to try to get them to mate. And that's when you spend a lot of time trying to figure out what you did wrong.
Well, you don't make a memento save itself. What you do, is add a obj.getState() method. That will export the relevent state information and return a memento.
The memento shouldn't be the entire object, just the minimum state information necessary to reconstruct the object...
So rather than copying the whole object and diffing it, just create the memento object and send that. That way, you don't need to worry about clients missing a diff (dropped connection, etc), or other problems that can crop up.
 
which for a data object is the entire object?
 
each update they get all the info they need to reconstruct the object. (And if you want to get fancy, you could build an obj.updateState(memento) method which would "merge" (do the diff internally)
 
I cant send a memento object over a socket :)
 
Is it the entire object?
@Raynos: Sure you can, just encode it in json (or some other binary format)...
 
7:49 PM
I cant encode the functions. Let me look into it some more
 
fair enough
 
Are there other options?
 
There are tons of options. But without know the exact details of what you're doing, I have no idea what you're trying to do...
 
The general question is, if you find yourself using a deep clone anywhere what are the general alternative technique's you try to use to avoid cloning or is it completely situation dependant?
 
One option would be to create a "diff" object. Basically, every change you do to the main object, have it make the same change against the diff object (a member). Then "flush" the diff object to a stack and make a new one every few seconds. Then, clients give back a stack version number and which point you send the sub-section of the stack (so they can replay the diff from their current version up).
Well, the thing is there are more than a few reasons why you might find yourself deep-cloning. Each reason has it's own alternative (or none) and reasons why...
 
7:57 PM
let me kick up a jsfiddle
I'm impressed jsfiddle crashed my computer
 
lol
 
8:31 PM
I forgot that while(true) is great for example code but bad to execute.
 
it's fine to execute, as long as you put a collapsing condition in there ;-)
 
My chrome console stopped working :\
 
That's prob not a good sign... IIRC Chrome has infinite-loop detection...
 
wish you nice happy new year :)
 
jsfiddle.net/Raynos/YqQnw I actaully have a small example of my use of clone
I want to avoid appending to a difference object every time a small part of state changes. Clearly the actaul state object is more complex (and also useful)
 
8:44 PM
doesn't know...
 
A more high level abstraction. State is continously changing what options do I have for sending difference between state at time = n-1 & time = n to some observer.
 
diffs are not trivial. So short of keeping track of changes as they happen, good luck
 
I guess I can pass the user a wrapper object with a get & set method that keeps track immediatly on set.
I keep coming across more uses of getters & setters.
 
yup
there's a reason people use them a lot ;-)
 
I thought it was something to do with pedantic seperation of private fields and public methods :P Something along the lines of the rulebook says we cant have public fields so lets replace them with public methods.
 
8:56 PM
that too, there are tons of reasons
Nah, if you have .setFoo(value) { this.foo = value }, then it is public, isn't it? (with the pedantic note that it's not fully public since the implementation detail can change, so it's slightly encapsulated)...
public properties break encapsulation. Setters expose an interface to the encapsulated data (which can break encapsulation if you're not careful about what you expose). But more-so they can enforce encapsulation (which is why people use them)...
 
most setters i've used just do as above and are simply minor wrappers around public fields
 
Well, it's a fine line, but it's a line...
 
9:14 PM
As long as your technically right, it's all fine.
 
lol
Well, I'm not saying that everyone's use is correct...
I'm just saying that there is a proper reason to use setters over public variables. But that if abused, they are no better than public variables...
I should spend time away from the #php tag on SO. 70% of my rep is from that tag alone... I should deversify
 
I think you should do more #eiffel tag questions
 
9:35 PM
Last comment here:
2
A: Please Critique this PHP Login Script

ircmaxellOk, here's a few: You shouldn't be using md5 anymore. You can, but there are better methods (Such as sha512 used with the hash() function). I would use a MUCH longer static salt as well. I suggest at least 64 characters (after all, it's minimal overhead to compute on write, but much more diff...

Mind if I scan your barcode? Permission needs to be asked now?
 
I like how the other guy has 4 tiny answeres
 
hehhee
Yay! I got a JDBC tag (even though I have no reasonably recent experience with java, it's been at least 10 years)...
 

« first day (79 days earlier)      last day (4876 days later) »