« first day (411 days earlier)      last day (3607 days later) » 

9:00 PM
@Edward What about if you're from Texas and bring an Armadillo (with only one set of tire marks) instead?
 
2
Q: Should [programming-challenge] questions require a summary of the challenge?

200_successProject Euler has been offline for several days, after the site was hacked. Problem is, a large number of our questions relate to Project Euler, and many of them do not contain any description of the challenge that the code aims to solve. Some link to the page on Project Euler where the chall...

 
@JerryCoffin - I wasn't aware you could kill an armadillo with only one set of tracks.
 
@JohnP For inline code, use the back-tick like ` this `
 
I've seen them put holes in Saturn body panels and walk away.
 
@JohnP If it's short (less than a line) enclose in back-ticks. If it's longer, indent it. If it's very long, consider posting elsewhere, and just post a link here.
 
9:01 PM
Indent?
 
For quoting things, have > followed by a space:
 
@JohnP Depends on the tires. For a proper Texas-sized "truck", one set suffices.
 
> this is quoted.
 
 >       <script type="text/javascript">
            $(document).ready(function(){

            });
            function sendPushNotification(id){
                var data = $('form#'+id).serialize();
                $('form#'+id).unbind('submit');
                $.ajax({
                    url: "send_message.php",
                    type: 'GET',
                    data: data,
                    beforeSend: function() {

                    },
                    success: function(data, textStatus, xhr) {
 
There ya go.
 
9:02 PM
for code text, put it on multi lines...... and hit the format-code
 
So why are we looking at this?
 
or just indent it with 4 spaces.
 
How do I test that? I put outputs in send_message.php but it never shows it.
Somewhere between submit and actually submitting to a GCM server for a push notification the message never gets there.
 
o shit
forget it ill just update there
 
I'm trying to track down where it gets mucked up.
@JerryCoffin - "Texas" sized truck...so start at Hummer and go up. Got it.
 
9:08 PM
@JohnP Or you could just increase velocity. Hitting an armadillo at 120mph really annoys them.
 
@JohnP Hummers are really pretty puny. Really want to start here:
 
Shouldn't that have an Aggies sticker on it?
 
@Edward It probably does (on the other side).
 
@Edward - I hit an armadillo at 45+ mph on my bicycle. Effer just laughed at me as I tumbled around.
 
@JohnP They're vengeful but not without a sense of humor.
Much like the inventors of Java.
 
9:12 PM
ok, I put alert(data); and alert(id); right after the var command and it doesn't show those. Wonder if it's even getting called?
 
updated my code with what i feel is proper formatting, but its way too spacey
 
nm. reloading page helps.
 
@AlexLieberman It does, because all those newlines are unneeded. And in Java, the opening brace goes on the same line as the statement, not on its own line.
 
nmX2. I'm an effing idiot.
 
@Edward thanks so much - howd u do that so fast!
 
9:20 PM
@AlexLieberman I use a real editor. :)
 
Is it free?
 
Yes, free and open source. I use vim.
 
My teacher taught me the way I just posted saying its fairly standard - however he also made the newline exception cause when we submitted programs he never asked for digital copies so he read all code on paper
Zero computers the whole class lol
Thanks Ill get it
 
You're better off without them. Computers will only make your head hurt. :)
 
@Edward Not true. Drop one, and it can also make your toe hurt.
 
9:29 PM
Got it thanks a lot!
 
@AlexLieberman You got Vim? Now your real headaches start!
 
LOL
I cannot wait.
 
Let me start you off with the command you need above all others: :q
3
The quick cure to nearly all problems with Vim.
 
Okay :P
 
And I use Word to turn tabs to spaces. Haters gonna hate.
 
9:36 PM
LOL
 
And coming from the guy with 5900+ edits.
 
Updated (now includes benchmarking results): codereview.stackexchange.com/a/54726/27623
@Jamal Thanks, I was trying to figure out how to do that before I pushed the edit.
 
I got the idea from an MSE post that I bountied. It's around there somewhere...
 
10:02 PM
0
Q: MySQL Structure - Need some feedback

user3465843I am trying to create a movie database (wiki style) and I am stuck on the database structure. I would like some help and suggestions please. Here is my basic idea: movie_table +---------------+--------------+------+-----+--------------------+-------+ | Field | Type | Null | Key ...

0
Q: Class that implements a queue using two stacks

kmauneI am looking for a review of my code that implements a MyQueue class which implements a queue using two stacks. public class MyQueue<T> { Stack<T> stackNewest, stackOldest; public MyQueue() { stackNewest = new Stack<T>(); stackOldest = new Stack<T>(); } public int size() { ...

 
10:15 PM
0
Q: Responsive / CSS fixed and variable widths – Best Practice

BrandrallyCSS and responsiveness in multiple columns with fixed and scaleable elements can be done many ways. I have created a solution that seems to work, though I have no idea whether this is best practice. Really would appreciate the Stack Overflow community looking at it and providing some feedback. ...

 
10:45 PM
13
Q: Creating .cpp, .c, .h. and .java file templates

kmauneThis code builds template .cpp, .c, .h and .java files based on a file name and #include, import lines provided at the command line. The file opens after creation. I am looking for a review of this code and seeing if there is anything that can be more efficient. /* .cpp Example: * template...

One more napalm, and each answerer will get a badge.
 
@syb0rg Sure, but I should warn you that all I know comes from a week long side-track in a information retrieval class. What I know is likely out dated compared to industry, and my memory is terrible. And, I have no experience actually implementing it. Just a vague "oh you would theoretically do this" overview. Wikipedia is probably a safer bet, but I'll gladly pretend to know what I'm talking about :p.
 
@JerryCoffin Heresy!
 
@Yuushi Hardly the first time I've suffered that accusation.
 
And it won't be the last.
 
@Edward Guess it's a good thing I no longer have to worry about the inquisition coming after me.
 
oh wow, python.org got a facelift
 
Oooo wow, it did. I see they also went the live shell route. Pretty nifty.
 
@Corbin Sounds good. So I've gone ahead and implemented my hackish NLP stuff into my project using the O(n) method instead of binary. It works great on stuff like "what is today". But then you get a bit more complicated and it falls apart. I wouldn't even know where to start implementing "what day is it 3 days from now".
That's where I need semantics to come in.
 
@syb0rg Ah... in all honesty, I'm not quite sure how to accomplish that. I think the first few steps would be determining if something is a question or a statement (i.e. "what time is it?" vs "set the time to 18:05"). The good news is that if you're dealing with only questions, and only a small amount of them ,then you don't evne have to worry about this, especially if your commands are relatively logically disjoint.
For example if you have "what day is 3 days from now?" but you also allow the question "what do i have scheduled 3 days from now?" it means you have to actually figure out what's being asked heuristically. If you just have 1 day related question then you can just see the world day and jump all over it
(It's worth noting that I'm highly talking out of my ass right now -- more of a "this is the first thing that comes to mind" more so than a "this is how people actually do it" lol)
 
11:08 PM
lol
 
:p
 
Unfortunately, I'm not dealing with only questions, nor a small amount of them...
 
Well, it doesn't matter if it's a small amount or not, but more so if their interpretations have room for overlap.
And you have to remember that computers aren't magic. There's never anything that is going to be just a simple little algorithm that lets your program answer all kinds of complex questions. Each and every individual capability still has to be programmed.
So if you're aiming for your program to be able to do 5000 things, you have a long, long road ahead of you :/
Although, I imagine the feature recognition and mapping to desired functionality will be much more complicated than actual functionality implementation.
 
Haven't yet gotten it, but it was recommended to me.
 
@Corbin Hmm, it looks like I need to find a half-decent library to use.
@Edward FYI, I did a benchmark which included your function: codereview.stackexchange.com/a/54726/27623
 
11:15 PM
Yeah, that would probably be a huge help. Unfortunately I have no idea where to even start looking for something like that :). I suppose one easy solution would to use a neural network library, and just heuristically map phrases to features, and then use those features to determine what functionality to provide. That's just the first thing that comes to mind again though, so... yeah..... lol
 
Ellogen seems to be the only FOSS C NLP library out there: ellogon.org
 
@syb0rg Interesting with the benchmark. Was that with or without storing the string lengths?
 
@syb0rg Time to use a different language? :)
 
If you're inclined to, you could try this:
 
@Edward Without, I left it as is.
 
11:20 PM
int str_end(const char *s, const char *t)
{
    int diff = strlen(s)-strlen(t);
    return diff > 0 && 0 == strcmp(&s[diff], t);
}
 
@Yuushi I've been thinking to switch to C++ for a bit now. There seems to be a lot more libraries and resources out there geared toward it. Luckily, the switch from C to C++ wouldn't be too hard.
If I decide to go that route, that is.
 
C is fun to use for the sake of using it, but in terms of actually getting things done, I would take C++ any day.
3
 
Search string: this is a longer string and may cause certain functions to take a bit longer to process
End string: a bit longer to process
syb0rg's function average runtime: 3.1573e-08
ao2130's function average runtime: 2.48394e-07
Edward's function average runtime: 3.68303e-08
Edward2's function average runtime: 2.62519e-08
Josay's function average runtime: 3.26991e-07
@Edward Your revised function now beats mine.
@Corbin C still has a small speed boost over C++ though.
 
@syb0rg Not always true...compare qsort vs std::sort for an example of that
 
@syb0rg I seriously doubt that. At least not in the hands of a skilled C++ developer.
There are certain features of C++ that have inherent overheads compared to C, but those features are also features not present in C.
And luckily you have to go fairly far out of your way to get into those features.
 
11:27 PM
@Corbin If anything, it's rather the opposite: you have to write C almost completely insanely to have even a hope of getting it to keep up with even fairly well written C++.
 
@JerryCoffin eh, I don't know if I'd call it insane. But yeah. You have to sacrifice all generality and basically code C with an asm mindset to meaningfully beat C++.
 
@Corbin Just for example, to get inline code generation even close to as good as templates provide quite routinely, essentially your only choice in C is to write nearly everything as a macro. IMO, that qualifies as utterly insane.
 
0
Q: Using RegEx word boundary with IP filter

BlexyI was having issues with a RegEx. Mainly I wanted to create a filter to only find these IP addresses: 216.54.215.0 216.54.215.1 216.54.215.2 216.54.215.3 216.54.215.4 216.54.215.5 216.54.215.6 216.54.215.7 216.54.215.8 216.54.215.9 216.54.215.10 216.54.215.11 216.54.215.12 216.54.215.13 216.54.2...

 
@JerryCoffin Ah, yeah that's definitely deeply into "insane" territory x.x
 
11:31 PM
@syb0rg That's not really comparing C to C++. That's comparing C compiled with a C compiler to (still almost entirely) C compiled with a C++ compiler.
 
@syb0rg I'm not sure if you're arguing that C and C++ have no meaningful performance difference, or what your point is with that link? GCC was written in C, so it's not even fair to compare that. 20 years of C baggage aren't going to magically turn into C++ with a recompile.
 
Well, even in the link C++ was only ~.3% slower than C. So nothing really...
 
0
Q: Everyone loves Fibbonacci

ckuhn203I was bored and burnt out on more serious projects.... until I saw this Computerphile video on YouTube. Now I'm inspired again. Now I feel like spending some time implementing that recursive algorithm in a little console program. Fortunately, recursion is unbearably slow in this case. So, I ended...

 
I think a C++ compiler written in C++ could actually be significantly faster than a C++ compiler written in C. The problem with that article isn't the results, it's the premise. GCC was originally written in C, and they just recently began writing it in C++. This means that it's ~98% C and 2% C++. This just means that--as Jerry said--you're just compiling C with a C++ compiler, and nothing of consequence is really happening.
(Just realized technically it's a C compiler being compiled from 'C++' code, but same sentiment stands.)
 
I'd compare Clang to gcc instead. Although I wouldn't say Clang is the best or cleanest C++ code in the world, at least it really is C++. baptiste-wicht.com/posts/2012/11/gcc-4-7-clang-3-1-eddic.html
 
11:42 PM
Yes, and Clang is significantly faster than gcc. I know which codebase I'd rather work on!
I've been evaluating C++ for embedded systems work and if we avoid RTTI and exceptions, it's actually better than C in most measures.
 
I didn't actually know that clang is faster than gcc for compiling. That's rather interesting. (I would still use clang anyway though -- I love clang compared to gcc :/)
 
Hey all!
 
Hi Alex.
 
Hey Alex.
 
Hello, Alex
 
11:44 PM
0
Q: Search a file system for files that match a given pattern

Ricky WilsonMy concerns with this code: Is there a more efficient way to find files by pattern in Python? Does os.walk() work in Windows? Is this code pythonic? Should search() be broken down into 2 functions? Is it stupid to handle IOError exception by printing the error msg to the console? #!/usr/...

0
Q: Improved minimal webcrawler - why is it so slow?

BjornasmI recently made a webcrawler that i submitted here for a review (Minimal webcrawler - bad structure and error handling?). With that help i've made a much cleaner and better(?) webcrawler. The only problem i have is that this crawler is extremely slow compared to the other one (13.2s for a depth ...

 
And how is everyone doing today!?
 
Pretty well. How about you?
 
Better now.
How are you?
 
@AlexL I'd guess that "everyone here" is doing a lot better (on average) than just "everyone (on earth)", anyway. :-|
 
I just came across the Steam Summer Sale on Reddit, and now I'm trying to stop myself from compulsively buying every game on sale x.x
@JerryCoffin Way to make it depressing. :p
 
11:46 PM
@Corbin I'm sorry.
 
@JerryCoffin You're tricky, however you can't say that without taking a survey of every single person alive and asking them how happy they are! Then compare ;)
I'm pretty good thanks :) Just wrote up a nice answer :)
 
@Corbin why did you have to remind me!
 
:D
 
@AlexL Did you miss the "I'd guess" part?
 
phew, everything on there I'd want I already have
 
11:49 PM
Oh, why yes, that's what fast reading and dyslexia give you
 
@AlexL Hmmm...so you're at least a little like the dyslexic agnostic insomniac who laid awake at night and wondered whether there was really a dog?
 
@Yuushi that's what I thought... Then somehow I found myself buying DMC and Far Cry 3 Blood Dragon, despite having little interest in playing a quick time event game without a controller, and having already played FC3 for days and days until I could barely stand it.
 
don't try and play DMC without a controller
 
Yeah /
 
Good answer from a new user.
1
A: Everyone loves Fibbonacci

Pierre MenardIndentation and formatting are fine, as is the algorithm itself. Your naming is inconsistent, compare n and Value; _value and _FnMinus1. There are a variety of conventions to follow, but consistency is the most important thing. _FnMinus1 and _FnMinus2 are only used in one method, so they can b...

 
11:52 PM
I wish I weren't lazy enough to figure out how to get my PS3 controller to work on my PC. I hear it's possible, but meh... Seems like a bother.
 
I got one working a while back. It was...a pain.
 
I need to just pick up a Xbox 360 controller on the cheap.
 
@JerryCoffin You could say so!
 
likewise
 
@AlexL I could say all kinds of things (but many wouldn't be true). :-)
 
11:54 PM
Wow, apparently 360 controllers are still $30+. That's annoying.
 
@JerryCoffin You're a wise man, aren't ya!?
 
@AlexL Most think of me more as a wise donkey (only they use some other word for "donkey"). The rest just think of me as a donkey (again, using some other word).
 
Haha :D
 
@JerryCoffin They also use some other word for "wise"
 

« first day (411 days earlier)      last day (3607 days later) »