« first day (307 days earlier)      last day (3713 days later) » 

12:33 AM
Thanks, Santa! Also, new assembly answer:
0
A: RC4 in 8051 assembly optimization

JamalI'm not familiar with 8051 assembly in particular, but there are some readability things I want to point out. Commenting This should really be stressed: well-commented is not the same as excessive-commented. You have comments after pretty much every line, which just makes your code hard to rea...

 
@Jamal What do you think of the new tag
Accorfing to wikipedia, this is the same as .
 
And it's a synonym of JS on SO. :-)
I can synonymize them, then.
 
Just one question, and it is edited 5 min ago/
to add the tag.
I am unsure of why he created it, but, the question seem to sugges tthere is a difference that is significant to him...
@Jamal, before you do....
@konijn you have an opinion?
 
I haven't done it yet.
 
@syb0rg and @JeffVanzella both approved the pending suggested edit... ;-)
(on the wiki text)
Did not do their homework :(
 
12:40 AM
ah
so, some development ( like Flex ) uses ECMA script
so I am not sure whether you should delete the tag
 
@rolfl I saw this conversation going on. I thought if they were going to be synonymized anyways, the wiki revisor should get some rep for trying.
 
It's a synonym of JS on SO.
 
really
that is funny
 
ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known implementations such as JavaScript, JScript and ActionScript. History JavaScript was originally developed by Brendan Eich of Netscape under the name Mocha, later LiveScript, and finally renamed to JavaScript. In December 1995, Sun Microsystems and Netscape announced JavaScript in a press release. In March 1996, Netscape Navigator 2.0 was released, featuring support fo...
I guess they will have to use the Implementation name for the tags
I still think it is wrong to synonimize ecmascript -> JavaScript
 
12:43 AM
You are saying that ecmascript is now distinct fom Javascript though?
 
it seems an over-simplificaton to me
 
So, then leave it standing as it's own tag.... and assume that people use it wisely?
 
yes, aggresively retag if needed
and if it turns out to be too much work, we can synonimize
 
People who 'favourite' the javascript tag will not see ecmascript questions
cough cough JS programmers probably don't know they are ecmascript programmers anyway ... cough cough
 
True
@rolfl :P
brb
 
12:47 AM
@rolfl You misspelled "eczemascript".
 
Wow, just earned [badge:enthusiast] on meta.CR... how the heck did I not already have that one??!!
 
so
that particular question with ECMAscript is really interesting
I was even tempted to create an ECMAscript6 tag for it
because the syntax is so different
 
Is it just me that's like, WTH? What's the difference, isn't it JS anyway?
I agree with @rolfl on that one..
Should ExtJS have its own tag?
Nevermind, there's already a tag for ext...
 
1:03 AM
@Mat'sMug Not really, the syntax is quite different
too me, it's a new language, and I am not sure that I like the new ECMAscript 6
not that anybody cares in the JS world ;)
 
@konijn oh well, napalm'd ;)
 
Why thank you Santa ;)
 
On CR, it's always Christmas. :-)
 
1:22 AM
0
Q: malloc implementation

Geraldplease give me some feedback to my malloc implementation. i implemented this design to understand the basic concept... #include <stdio.h> #include <stdbool.h> #include <string.h> #define HEAP_MEM_SIZE 150 #define MEMORY_AVAILABLE 1 #define MEMORY_USED 0 struct chunk_header { struct chunk_h...

 
1:57 AM
0
A: malloc implementation

syb0rgThings you did well: Some use of comments. Use of typedef. Things you could improve: Syntax/Styling: Never use goto. Yes, there are some rare situations where you may find it necessary to use it. This is not one of them. err: printf("could not allocate mem\n"); return 0...

I added a picture, my first use! ^^
 
2:24 AM
0
Q: Quicksort implementation

krystahI put together this implementation after playing around with various partitioning- and pivot-strategies, and it runs fine. I wrote this off a version which seemed a bit different from the majority of implementations, so I'm curious on what you guys think. It works and handles duplicates. def qui...

 
2:51 AM
I didn't had time sooner but thanks for the answer @konijn
 
3:36 AM
@Jamal I use the third option: const Class& :)
 
Hipster. :-)
 
4:16 AM
0
Q: My prime number generator exercise

user3310769I apologize in advance if this is the wrong venue. So I have been trying to create a class that would list prime numbers forever. I know it has already been done but I think I learned some valuable principles during my trials. This project helped me understand(to a better extent) return values, a...

 
-35 1 hour ago reversal Serial upvoting reversed
 
:-(
 
they were all within the same minute
anyway I am off to bed
 
Goodnight!
 
Bye!
 
4:52 AM
0
Q: RGB to HEX (and vice versa) converter

annnPlease review the code. Thanks. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>RGB to HEX (and vice versa) converter</title> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.0/normalize.min.css"> <style> body{ color: #...

 
 
1 hour later…
6:22 AM
0
Q: Scala: Get lowest integer that is not in set

Julian LettnerIs there a better (functional or more idiomatic) way to get the first positive number that is not included in a set. val set = Set(4, 1, 2, 0, 5) var x = 0; while(set.contains(x)) x +=1 println(x); // Should print 3

 
 
1 hour later…
7:36 AM
0
Q: is this the right way to use TcpListener in the Background

Carter Nolani have a server application using TcpListener in Backgroundworker, where my application is doing some work, and in the background listening to a IP:PORT. The DoWork Of The BackgroundWorker : private void m_oWorker_DoWork(object sender, DoWorkEventArgs e) { while (true) //in...

 
 
2 hours later…
9:21 AM
0
Q: Fix this messy if code?

LukaIs there any better way to write this code: bool success = true; if(x == 0) { if(do_up) run_do_up(); else if(do_a) run_do_a(); else if(do_n) run_do_n(); else success = false; } else if(x == 1) { if(do_n) run_do_n(); else if(do_a) ...

0
Q: StateManager inits, saves and restores state of activity

leonideveloperSorry for my English I tired to write code that inits or restores state in onCreate() (by checking whether or not the savedInstanceState argument is null), and saves state in onSaveInstanceState(). So I wrote these classes: StateManager public abstract class StateManager { public final v...

 
10:16 AM
morning
 
@skiwi morning!
 
Heya.
 
homework day today :(
 
ugh, at this very moment Bob Martin is doing a corporate training seminar for the 10 members of my team,in the room directly below me, a seminar with empty paid seats but my boss said I can't go because I am too busy.

FML
 
whaatt
 
10:25 AM
yup
 
lol... I had to review some question on SO where someone proposed to remove the code from a question
 
10:41 AM
it's not easy to get the correct normals for my box/cube...
 
10:54 AM
I'm sometimes shocked by the way people earn rep on SO.
Take this question for example:
1
Q: #define as unsigned char

VivienGI would like to know how can I tell to compiler that a #define is an unsigned char. #define SET_BITS_LOW 0x80 Here SET_BITS_LOW is, by default, an int but I want an unsigned char

Well, I answered as a comment under 30 seconds.
The other guy answered wrong and edited its answer 3 times to get it right. By the time it was right, it was almost like my comment.
 
ugly ye
This case is really on the edge I'd say, but normally you are out of luck and to be blamed yourself if you post an answer as a comment, and someone steals it
 
I would say it's one of the main problems on SO: the trivial question/answer couples are the ones that get the most points. Typically the answers you can find in any documentation or tutorial.
 
on other hand, if it's really a decent question and you give a long answer, you'll get the points
 
The first answer of that other guy was #define SET_BITS_LOW ((const unsigned char*)"0x80") ^^"
 
Meh, I'm thinking about dropping Algorithms class
My head never feels like doing it
 
11:03 AM
I rather feel like dropping the bass.
 
11:36 AM
0
Q: Transform a MongoDb parent reference tree into a deep nested tree

Daniel KhanGiven a mongodb collection that stores trees as nodes with parent references this methods returns a deep nested tree where every child nodes are stored in def getTree(rootId: BSONObjectID): Future[CategoryTreeNode] = { def collect(parent: CategoryTreeNode): Future[CategoryTreeNode] = { ...

0
Q: How do I refactor this responsive background images code? (WordPress)

thedigitalmonkSo in my latest project I am using fullscreen background images for each page. I decided to write some code to fetch the different thumbnail sizes and then use it as a background for the appropriate viewport size using media queries. I also made sure that in the case of big screens the smallest i...

 
12:01 PM
0
Q: Simplifying JS Functions

TimbyOk so I have this adventure game, where when you click a button, it replaces the div you're currently on with the new div option that you chose. Example: Sample of my HTML: <div id="menu"> <button class="menubutton" onMouseover="mouseoversound.playclip()" onclick="start()">Start</button><br>...

 
@skiwi Why drop out? Algorithms class sounds fun!
 
0
Q: Better way of binding click event and avoid duplicate code in jquery

SivaRajiniPlease refer below code $(".nna-icon-excel").click(function (e) { var $this = $(this); $this.parent().attr("href", "?excel=1") var href = $this.parent().attr("href"); if (activeTab.toLowerCase() == "table") { ac...

 
12:25 PM
0
Q: Splitting a command line into key/value pairs

Paul StathamThe code below will split environment variables from a command line (always appear at the end of the command line). Environment variables are represented by '-E key=value'. I've achieved this like so, but I'm wondering if there's a more elegant way public class TestSplit { public static void ...

 
@SimonAndréForsberg Doesn't sound/feel fun to me
Now figuring out why BFBC2 locks up my pc :(
 
@Morwenn Despite being trivial, if the question isn't answered on SO yet, it needs to be. The goal of SO is to be a one-stop shop for all programming questions. With that said... if the question IS already answered, it should be marked as a duplicate and closed.
What actually bothers me is when I take the time to post a (in my opinion) pretty-well written answer that is composed of a few paragraphs making several different points... but the answer starts with the straight-forward answer to the question. Then, 5 minutes later, someone else posts an answer, and it's basically a copy and paste of my first sentence.
Not only is the answer copied, but it's 5+ minutes after an already-posted answer (the one in which you copied from)
 
12:43 PM
You've gotta go for the upvotes @nhgrif ; gong tor accepted answers is pretty much hopeless
 
In that case, we both have the same upvotes. I was only lucky enough to be marked as the accepted answer.
I did edit my answer to include even more information, but I think all but the last edit happened before the other answer appeared.
anyway, going to work
 
@skiwi I think algorithms is very interesting. :) What kind of algorithms have you been studying in that class?
@Mat'sMug You might want to take a look in the CR Answers feed room: chat.stackexchange.com/rooms/12723/cr-answers
 
@SimonAndréForsberg We're now at something called flow algorithms...
It sounds all quite interesting, but the homework is just not fun
win.tue.nl/~kbuchin/teaching/2IL15/Homework/hw-B2.pdf <- that's the homework, which I should have done by monday >.<
 
@SimonAndréForsberg - you're a star
@skiwi - unles syou have a better alternative, keep the algorithms class.
 
I've ehard that you're allowed to replace it with another subject
 
12:59 PM
For what it's worth, if you are considering a career in software development, there is not much that is better than an algorithms class.
I never did an algorithms class, and I regret it..... I work with people and I say, I have problem X, and I need to do Y, and they say do Z .... if you knwo wha tyou have, and what you want, then knowing the algorithm to get there is, well, just plain useful.
It's the sort of thing that google sucks at
I implement formal algorithms in complicated problems at least once or twice a year... and then in the day-to-day grind you are doing it on a small scale all the time.
 
If you are worried about taking a class, then that should still be possible I think via online universities... for free if you do not want a grade/support, paid if you do want
 
@rolfl Haven't added the feature to the chat room yet, but it seems like the people from AskUbuntu is on it :)
 
1:21 PM
@SimonAndréForsberg if a relay is needed, I can provide one.
 
I can probably also provide one with my zomis.net domain, but you're probably faster in setting one up, @rolfl
 
Probably not faster .... but I do have one... in my basement.
if your zoomis is hosted somewhere it may be better than my basement ;-)
 
it is, but if some coding is needed, which I think it is, I only have the choice of PHP (throws up)
 
1:37 PM
In 2014 I think it would have been closed outright
 
@konijn It's 2014 right now
 
I know ;) The question is from 2012, in those days anything went apparently, I'll admit I could have phrased that better :P
 
0
Q: Remove leading, trailing and repeated dashes from a string

Manuel CalaveraHow do I refactor this? '-hello--world-'.chomp('-').squeeze('-').reverse.chomp('-').reverse # => 'hello-world'

 
1:54 PM
Hi all!
 
Hey all too.
I am running in to Java Array-size limitations ... workaround?

int[][] data = new int[1 + (size >>> 8)][1 << 8];
for (long i = 0; i < maxindex; i++) {
    data[(int)(i >>> 8)][(int)(i & 0xff)] = .....;
};`
Obviously the 8 and the 0xff are constants..... ;-)
It is also nice to be able to do:

     java -Xmx192g .......
 
@rolfl Old school Win3.1 memory approach with offsets, break it up in to multiple arrays managed by a class ?
 
2:10 PM
That's essentially what the above does.... It splits it in to many arrays of size 256.
I am playing with the right size of the shift.
It seems that somethng much larger will be better for memory management....
I am using 16MB memory pages, and I think I should try to align it closer to that...
but I want each array to fit in a single page, so I can't use as much as 16MB per array because there is some overhead, and I don't have too many 16MB pages ;-)
Doing some math
about 2MB per array sounds about right, so it's about a 19-shift... for int.
But a 16 shift (256KB) sounds useful.... I like byte-aligned shifts just like I like round values for rep
 
2:30 PM
0
Q: Review/improve mutex implementation

wizurdI am trying to make a thread test in which 4 threads are all trying to set a bool. Only one should be allowed to set it. After the first thread has set the bool(m_isRunning) to true, no other threads should set it to true because of the check isRunning(). This implementation works, but I wonder ...

 
2:56 PM
0
Q: Hackerrank - Algorithms - Sherlock and The Beast

Mohammad Areeb SiddiquiI have recently written the program for the above mentioned hackerrank challenge. That's working fine but the problem is that it takes too much time if a big number is given as a input so I would like you guys to help me out in optimising my code so that it could run under 16 seconds, yes, that's...

 
TTQW. I'm off to visit a friend. Will be home late today. Bye folks. :)
It's friday, friday
 
Later!
 
3:22 PM
My first python code review :P A bit brutal
He asked for it with Can't you just people answer it rather than editing? :P nevamind.
 
Nice response! :D
 
Thanks Santa!
 
3:44 PM
For once, I did not flood the front page with edits in the morning. :-P
 
We shall be grateful.
 
:P
I've been Jamalizing again ;)
 
I could also merge the separate code challenge tags into this new one. Questions don't need more than one of these tags.
In case someone hasn't napalm-struck this:
7
Q: Prime number generator exercise

user3310769I have been trying to create a class that would list prime numbers forever. I know it has already been done but I think I learned some valuable principles during my trials. This project helped me understand (to a better extent) return values, arguments for methods, simple math arithmetic and wha...

 
ciao all :)
 
bye!
 
3:56 PM
tnx @Jamal for the edit.. i'm italian ;)
 
0
Q: UPDATE SQL with prepared stmt using only 1 variable

geomoHTML form field names must be equal to SQL table field names. Changing only table name and allowed fields can be used in many other update pages. How can I improve this? $allowed = array("name","surname","email","rank"); $items = ''; foreach($_POST as $key => $value) { if (in_array($key ,...

 
wow.. my question :D
 
0
Q: Next Instance of DRY Refactoring

Gabriel WI'd like some additional assistance on refactoring. This is my latest update for this iteration. The previous post can be found here. #region WMI Classes /// <summary> /// The Win32_OperatingSystem WMI class represents a Windows-based OS installed on a computer. Any OS that can be /// install...

 
@konijn -
0
A: Sherlock and The Beast

rolflYour algorithm is way off.... ;-) Let's consider the solution to a decent number. For any decent number, the more 5's we put at the front, the better. So, let's break it down to some maths....: d => number of digits in the decent number f => number of fives in the decent number t => number o...

 
Yes?
 
4:07 PM
^^^ see, my answer uses Java, and what he can't do in 16 seconds, I can do in 0.0006 seconds.
 
Ah, run it with 11
is it correct ?
 
> 55555533333
I believe so?
 
Yep looks good
My answer was a bit trollish I will admit
 
Well, I trolled the python question with a Java answer ;-)
 
while (fives-=3 > 0) {
sb.append("555");
}
For extra speeds ?
 
4:11 PM
I wanted the logic to be explicit.
Let me test though.... ;-)
My results are too volatile anyway to make sense... with that change it is anywhere between 0.12ms and 1.1ms
 
threes = target - fives; ?
for explicit logic?
 
sure ... why not?
 
@rolfl If you want it (more) dependably fast, build it as a number instead of a string which you then convert to a number: for (int i=0; i<fives; i++) total = total * 10 + 5; for (int i=0; i<threes; i++) total = total * 10 + 3;.
 
Also, I am thinking while (digits > 2) {
for extra speeds ;)
 
@rolfl See--I didn't even advise that you use C++ instead of Java. Ain't I just being nice today? :-)
 
4:26 PM
FOR EXTRA SPEEDS!
 
0
Q: Improving working sql query

user35265I have an Olympics database from each Olympic year and I want to find the person that has made the most medals - The main problem is that I'm basically querying the same sub-query twice in SUBSET1 and SUBSET2. How would I go about changing this so that it would be more efficient Select athlete ...

 
hi! what have I missed?
 
@JerryCoffin - the output could be as large as 100,000 digits ... what C++ long long long long long long should I use? Signed, or unsigned ... ? ;-)
@Mat'sMug - see the CR Answers room ;-)
 
@rolfl I'd probably use NTL::ZZ.
But you're basically right: for that large, you're not gaining all that much from using a number instead of a string.
 
@JerryCoffin but-seriously: The intended output is as a string to the console... it never needs to be a number, and it does need to be a String, so using a pre-allocated-size StringBuilder is actually the fastest Java way....
(the code never converts it to a number).
 
4:39 PM
@rolfl But yeah, I hadn't noticed the size requirement.
 
rage BFBC2 keeps freezing my PC... and have some clues, but I'm not running programs afaik that satisfy those clues
 
@skiwi A game that contains crappy code? Couldn't happen!
 
@Jamal napalm'd ;)
 
4:54 PM
0
Q: Automatic C++ enum to string mapping macro

OlivierBI have long been looking for an elegant, one-line solution to map enum to strings automatically, for use with the << and >> stream operators. I know that a lot of macro have been proposed to achieve that, but I never found a really simple scheme, with only one macro call. This is my attempt, an...

 
out of ammo
 
5:13 PM
2 more users @500, and... out of ammo!
 
Bunny, you still killin' zombies? :P
2
@konijn: I've just realized something. It seems that people could confuse with , and they should not be used similarly. I'm not even sure if we need the latter tag.
 
5:28 PM
Out of ammo
 
I still have some. If I have leftovers before reload, I'll look at One Vote Short again.
 
Thanks Santa... ;-)
Someone found my one-more-vote SEDE ... ;-)
 
what's up?
 
My rep?
 
good one
 
5:34 PM
Behold!
2
5
A: Stack Exchange Data Explorer is up. What now, Wonderland?

rolflIt is very exciting to get badges on Stack Exchange, but, how many badges are you one vote away from? Badges can be somewhat complicated to understand, but, sometimes you are just one vote away from that Enlightened.... but, were you the first answer? Are there badges you missed? Is there a vot...

 
That data gets updated late tomorrow .... whoo hoo.
I am sure that konijn will have the largest number of pending badges again
 
5:52 PM
I need to clear my plate at home and have another look at my code. someone has given me a review that has almost twice as many lines as my actual code, and they aren't done.▼▼▼▼
11
Q: RPSLS Game in C#

MalachiI went with what I know and can use well, not what I know and can't figure the syntax out to make it look good. so please enjoy the code and prepare to school me (probably in the basics) in C# public static void Main (string[] args) { /* Here are your rules: "Scissors cuts paper, ...

 
what.
30
Q: Longest code to add two numbers

TheDoctorTask: I know we can all add two numbers the short way, using +. Your task is to create the longest code you can to add two input numbers. Rules: All of the code must be on topic (don't fill it with non-addition code to add length) The count is in characters, but do not count tabs, spaces, or ...

 
@Malachi Wow. Definitely deserves and upvote, if only for effort (though at first glance, his comments seem reasonably intelligent and useful too).
@skiwi The code golfers are really reaching to come up with interesting/relevant new questions.
 
Code-bowling? Interesting. I guess the longest solution is a strike, and the shortest is a gutter ball.
 
@JerryCoffin some of it is probably going to go over my head though. I need to get back to that code and make some changes to it, from the answer with the most votes and such. then re post I think
 
C# allows ==*-comparison?* on Strings?
 
6:01 PM
@user35265 by the sounds of it, you need to be adjusting your expectations, 38 milliseconds is not 'slow', or inefficient... is there a real problem? — rolfl 19 secs ago
 
@skiwi what are you asking?
 
@rolfl For SQL intended to be pulled live from sites, I say 38ms is slow, you generally tend to aim at 2ms max for simple queries.
@Malachi if you can compare Strings directly with == in C#, because in Java you can't
 
@skiwi that isn't a simple query it is two nested selects
 
Well, the query is ranking all olympians in all olympic games....
 
@skiwi yeah you can do that I think.
 
6:04 PM
For a more heavy query 38ms is still acceptable live though
oh really, MS will really DirectX 12...
If everyone can just use OpenGL, then that would be great
@Malachi It's a lot of code there in that answer, but I don't like the way the guy codes at all, or it is just that C# is so sluggish
 
@skiwi what code/question are we talking about now?
 
The one you had linked earlier, the one you made "RPSLS Game in C#"
I just mean at the point you need the following to loop over an Enum, all hairs on my head just want to pull themselves out:
foreach (Gesture gesture in (Gesture[])Enum.GetValues(typeof(Gesture)))
{
    Console.WriteLine((int)gesture + Enum.GetName(typeof(Gesture), gesture));
}
 
6:19 PM
@skiwi that doesn't look right. why would I want the number + the type of Gesture?
I don't have the code here. I am at work, maybe I will work on it tomorrow if I get the time
 
@Malachi I've got no clue, in my eyes that code is so messed up, I don't see any reason to understand something that is most likely incorrect
Well, not today, as I have an issue focusing on anything anyway :P
 
6:34 PM
@skiwi I am going to work in the Upvoted answer first, and see how it works for me, and if it gives me ideas to expand, then I will post a new question. Hopefully!
 
6:51 PM
@SimonAndréForsberg Nathan is here:
Stack2RSS author here - what do you mean by "chat feeds don't work with stack2rss feeds"? — uɐɯsO uɐɥʇɐN 13 mins ago
 
0
Q: insert multiple videos in Markdown

user3236636In Farbox, I am trying to insert videos in Markdown. I can insert 2 videos. But when I am trying to insert 3 videos. It didnot work out. Does anyone know why? works. But: doesn't.It works here. But the second one doesn't work in Farbox.

 
@Mat'sMug - why don't you make nathan an owner of the room?
ask him to play .... ;-)
 
0
A: Java MVC pattern

palacsintIt looks quite good, some, mostly minor notes: class Controller implements ActionListener { Having an actionPerformed method in the controller smells a little bit for me. I'm not sure about that but I'd rename the controller's method to changeModelState() (without any parameter) and use an ...

 
Hm, it was asked yesterday. It is officially a zombie?
 
7:02 PM
Return: I'll be back
 
@palacsint I was just looking that over, looks good, but I'm shooting blanks for the next 4 hours...I'll upvote then
 
1
Q: Resource manager implementation, with resources being organized in a scope-like hierarchy

user1062874The original question where the general concept of this implementation was discussed: Using ID's with a "scope" -like hierarchy I have designed a resource manager as part of a game programming project that I have been working on as a hobby. Implementing as much functionality as possible in the l...

 
@Jamal the problem is that coding challenge is the CodeReview one only
unless you want to to expand the scope of coding-challenge, but then how you do want to keep them distinct (for reporting etc.)
 
To understand what recursion is, you must first understand recursion.
4
 
@skiwi, I use that quote as comment in my code
 
7:15 PM
haha
 
@skiwi: Okay, how have I not known about that post already?
Starred (here and there).
 
in CR Answers, 9 mins ago, by Nathan Osman
It's not working... >:(
 
For Jerry (there's some Java one in there too):
743
A: What is your best programmer joke?

RoadWarriorWhen your hammer is C++, everything begins to look like a thumb.

2
 
lol
 
667
A: What is your best programmer joke?

Brian KellyIf you put a million monkeys at a million keyboards, one of them will eventually write a Java program. The rest of them will write Perl programs.

 
7:30 PM
@rolfl you're that one-in-a-million monkey!!
2
 
How many programmers do you need to change a light bulb ?
None, it's a hardware problem
 
discussing loops
 
I'd call it Holy-Mother-of-Loops
 
0
Q: Resolving directory traversal - is there a better way?

DJDavid98I keep seeing /subsite/../global/css/file.css when I look at my code, and today I decided that I want to get rid of the unnecessary traversal in the path itself, so it becomes /global/css/file.css. I made myself a function which I now use for all paths on my site. Here is the base of my function ...

 
@Mat'sMug and done
 
Apparently, for a fix to a problem in the an answer for a user not seen in weeksss
(an obvious bug, I may add).
Oh .....
it's a question.
How did I miss that?
 
yes
won't hold it against you though ;)
it was promptly rejected before I could finish typing up my own rejection reason!
(guys we're on the ball with suggested edits, that's awesome!)
 
8:10 PM
Just me or has CR been quiet recently in terms of questions being asked?
3
 
0
Q: AJAX, PHP, and SQL interaction. Does the code below represent MVC and REST best practices?

Michael CornnI’ve built a web site that uses AJAX to update a div. Most of the data displayed in the div is drawn from a MySQL database. All the pages are PHP. I’ve tried to follow best practices. I put all the query strings into stored procedures in the database. The PHP files call the stored procedures wi...

 
8:35 PM
@200_success thanks for the information on the Postgres
 
51
Q: How can I make my own Stack Overflow?

fredleyFor some reason, I'm having difficulty remembering. I've got a photo of the ingredients, but some advice on exactly how to combine them would be appreciated.

 
2
Q: Review of PHP prepared statements from security viewpoint

LowerClassOverflowianI received a ton of help from 200_success once again here. Since then, I decided to go with OOP Style and prepared statements, and so far I like it a lot more than the procedural style. Much more understandable in my opinion. For this CodeReview, I've just included my PHP code that interacts wi...

 
@Jamal going to use up all my comment votes on the top answer
 
Is there any way to debug when your PC freezes during playing a game? (It is related to BFBC2 + Punkbuster, but I don't know the exact issue)
 
8:51 PM
@rolfl hence we need a new :)
(and yeah, it's just you... activity graph doesn't show a sign of slowing down... right?)
 
What is the use of that? :o
 
"If a kernel debugger is attached to the crashed machine, the machine will break into the kernel debugger after the crash dump file has been written."
 
but does it work during a hard lockup? It's more like a deadlock I believe
 
I assume it's crashing from the keyboard interrupt service routine
 
9:01 PM
Hmm interesting thought, just to ensure, I'm not talking about a BSOD though
 
"Forcing a system crash from the keyboard does not work if the computer stops responding at a high interrupt request level (IRQL). This limitation exists because the Kbdhid.sys driver, which allows the memory dump process to run, operates at a lower IRQL than the i8042prt.sys driver."
 
I read on the net that it is Punkbuster accessing invalid/unauthorized GPU memory locations, while some other program is doing something with the GPU aswell (MSI afterburner, etc.)
 
No I assumed you meant "freezing", not BSOD.
 
good then we are on one line
 
I've no idea about Punkbuster. I was (uselessly) answering your question theoretically: as in "yes, in theory you can get a crash dump. after you have a crash dump, good luck with analyzing it!"
 
9:04 PM
For how long is the crashdump there? :D
 
0
A: jQuery plugin for easy CSS3 transformation

konijnI like the demo, from a once over: the functionNames make my eyes glaze over, data tables variables should be sorted and tabbed in my mind: var functionNames = [ { name: "matrix", type: functionParamTypes.length}, { name: "matrix3d", type: ...

 
Until you delete it from disk, after you reboot?
 
Reading it may be the painful part
 
Having debug symbols and source for the code that went wrong is just the start of the pain.
 
@Malachi I don't know C# well enough to critique it, but decided to add yet another, even if that weekend is well and thoroughly over by now...
 
9:15 PM
0
A: Java GUI code review

palacsintA few random notes: If I'm right it's not thread safe. progress = auCDtect.getProgress(); output = auCDtect.getOutput(); summary = auCDtect.getSummary(); I guess the calls above runs on an event dispatcher thread while the fields of auCDtect are set by StreamGobbler which is run on another...

Last zombie today
 
0
Q: RPSLS yet again

Jerry CoffinI guess I'm a little late with my entry, but I decided the world must need yet another RPSLS implementation to critique. #include <vector> #include <string> #include <iostream> #include <stdlib.h> #include <algorithm> #include <time.h> /* Here are your rules: "Scissors cuts paper, paper covers ...

0
Q: Improving a number-to-word converter to better match Pythonic standards

BK201I just finished creating a simple Python module that converts a number to words (done to death, I know). It's basically something that I thought of earlier today while teaching my 2-year old daughter how to read numbers and letters. Since the normal progression would be to tackle spelling, I thou...

 
I love it when a year old zombie gets shot , 2 votes and accepted answer under 10 minutes
 
0
Q: Can I Rewrite This With Pattern Matching?

Onorio CatenacciI've got the following Elixir code: defmodule Envvar do def exists?(env) do :os.getenv(env) != false end def get(env) do if exists?(env) do {env, :os.getenv(env)} else {env, nil} end end end Two things: Am I using the ? correctl...

 
accepted?! after a year...
 
@skiwi yeah, it happens sometimes :) It worth checking the OP's SO last seen time.
 
9:27 PM
A momentous moment, all JS zombies are now less than a year old !!
3
 
0
Q: Quad tree for Barnes-Hut (initial stage)

user3058846Here's an attempt I've made of implementing the Barnes-Hut nbody algorithm, or it's initial stage - The quadtree. That there're lots of lengthy doc strings might excuse the lack of detailed explanation here. My primary concerns as a beginner are to- Avoid complexity Avoid library imports Make f...

 
Out of Ammo, Rep Capped
time to Jamalize!
 
@JerryCoffin sounds good to me!
 
A 2nd zombie came back and accepted
visited 269 days, 99 consecutive <- Hells yeah
3
 
0
Q: Updating Grid on Webpage (new version)

sparcmenTask: Draw a grid with a given number of rows and columns. Each cell can be any color. The same grid should also be updated at a predetermined time interval. The grid should cover the entire visible portion of the page in the browser. Add a context menu with which you can change the parameters o...

0
Q: C++ generic event class - am I over-complicating it?

Raphael C.I'd like some advice about any better or cleaner way to implement this class, if there's any. I made it using this answer, posted on stackoverflow, as reference. A lot of problems arose when I switched C function pointers to std::function due to the lack of the equality operator on it, so I end...

2
Q: Coderbyte: String Reduction

konijnFrom Coderbyte: Have the function StringReduction(str) take the str parameter being passed and return the smallest number you can get through the following reduction method. The method is: Only the letters a, b, and c will be given in str and you must take two different adjacent chara...

 
9:48 PM
CR is slowing down for me
 
Oh, good. I thought it was just me.
 
@ChrisW I still don't get why you wouldn't return; when you declared to return void.
 
10:06 PM
Because it useless? Verbose? What else could you imagine happens after the last statement of a void function?
void doSomething()
{
doItNow();
// no need for a 'return' statement here
}
 
@konijn currently at 19,914 visits/day... an all-time high IIRC.
 
To criticize that he "should" add a return statement there is ... something I disagree with.
 
Bye @Mat'sMug
@ChrisW Yes, but it still reduces compile time by a small amount.
 
Surely not. Why on earth?
 
10:11 PM
@ChrisW Because the compiler does not have to analyze what type the function is to test if it is void, find where that function ends, and then manually insert the return itself. Sure, it won't reduce the compilation time by much, but it still reduces it.
 
I'm not persuaded that that's true; nor that it's significant even if it is true.
 
@syb0rg benchmark needed. I don't believe that, and would be surprised if this would be measurable (or even just technically true). Wouldn't the absence of a return make the code faster to parse, because there's less stuff to parse? (No, because other steps are much more expensive than parsing)
 
@amon I'll do some benchmarks later and post them, I'm too busy doing homework right now.
I remember reading this in a book somewhere, but I can't find it now. It could be that it is irrelevant with today's compilers.
 
BTW I'm disappointed that my answer to that question has no upvotes: IMO my answer found several huge bugs in his implementation, and started to explain what a heap-manager must do (which was the point of the OP's exercise).
 
@ChrisW If you're trying to get votes, you should post a link here ;-)
 
10:20 PM
0
A: malloc implementation

ChrisWI'd find it neater without chunk_header_begin and heap_size as global variables: instead, assume that chunk_header_begin is at &buffer[0] and assume that the heap size is defined by the several chunk_header->size values. I'm worried about what happens when you free-and-then-reallocate memory: th...

^ Vote or criticism please.
Thanks, Santa!
 
11:15 PM
[out-of-votes]
Gah..
 
[tag:this-is-a-tag]
 
@ChrisW Thanks!
 
11:52 PM
0
Q: Is there an easier way to find the index of the first letter in a string?

sigilI have a function that returns the index of the first alphabet letter found in a string, or -1 if no letter is found. It seems like there should be a way to do this with extension methods instead of looping, but I can't think of one: int findFirstLetter(string str) { for(int ctr=0;ctr<str.Leng...

 
What's a "extension method" in C#?
 
serious?
 
Yea, I don't know C# at all and it's referenced in that question.
May be what ObjC refers to as a Class Category
If I had to guess.
 
its a static method that you can use to extend a class without modifying the original code
 
Okay, so yeah. It's what ObjC would call a category.
 
4 minutes, and 10 short of @repmax ... ;-)
Just driven 200km ... beat
 
Hmm. KM, so can I assume Europe?
 

« first day (307 days earlier)      last day (3713 days later) »