« first day (743 days earlier)      last day (3271 days later) » 
00:00 - 22:0022:00 - 00:00

12:00 AM
RELOAD!
 
@CaptainObvious Holy mother of regex!
 
in Duga's Playground, 1 min ago, by Duga
com.gistlabs.mechanize.exceptions.MechanizeException: com.gistlabs.mechanize.exceptions.MechanizeIOException: org.apache.http.NoHttpResponseException: chat.stackexchange.com failed to respond
No information about unanswered questions today
 
12:49 AM
RELOAD!
There are 1364 unanswered questions.
@SimonAndréForsberg ^
 
@EthanBierlein Are you pretending to be @Duga?
TTGTB
 
@SimonAndréForsberg I'm simply filling in until technical difficulties are resolved.
 
Hello, @EthanBierlein.
 
Hello @SirPython
 
I'm less than an hour away from [Fanatic] badge.
 
12:56 AM
Woot!
 
This question really belongs in a site where opinion-based questions are welcome, such as codereview.stackexchange.com. In My Opinion you are right to question the use of current_dict - assigning it to the result of its own setdefault() method is silly. — GreenAsJade 8 secs ago
@GreenAsJade: Opinion-based questions aren't welcome on any SE site. Moreover, questions regarding someone else's code are off-topic on Code Review. — Jamal 55 secs ago
 
@Duga I really wish we could downvote comments.
3
 
And I wish I could find a decent simulator or FPGA before I go insane.
 
1:13 AM
@SirPython Good, it's gone now. Hopefully the OP wasn't prepared to follow that advice.
 
I deleted my apparently-doubly-wrong comment. However, I don't see how answers to questions at CodeReview can be anything but opinion based, and I haven't yet been able to find something that tells me I can't ask for a review of some code that I found and am interested in, at CodeReview. If the OP were maintaining this code, it would seem to be a perfect CodeReview question. — GreenAsJade 23 secs ago
 
1:54 AM
Hmm, when I said I was less than an hour away... actually, I'm a full day away from [Fanatic] looks like.
 
That's still a though.
 
2:46 AM
Hello.
 
@200_success: We now have . Is that similar enough to , or not really? I do remember seeing burned in favor of the latter.
 
I suggest posting code to codereview.stackexchange.com for in-depth advises — Dmitri Zaitsev 16 secs ago
 
3:25 AM
0
Q: Storing markup for web plugin

jcoc611So I'm developing a web plugin that contains a color picking tool that has around 350 lines of HTML. I want to store the actual markup (HTML) in a separate file and load it dynamically, injecting it into the user's DOM. My initial wish was to keep the file as GUI.html, but loading it is a pain w...

 
3:40 AM
0
Q: Creating SOLID immutable and mutable Location types

Vince EmighI have a Location type: public abstract class Location implements Locatable { private int x, y; protected final void setX(int x) { this.x = x; } protected final void setY(int y) { this.y = y; } public final int getX() { return x; } pu...

 
3:56 AM
0
Q: Bubble sort in Ruby

DelvacodeFor practice, I tried implementing Bubble sort in Ruby. I wasn't very sure how nested for loops would look like in Ruby. Is this the 'right way' to do this in Ruby? I found this Bubble sort implementation with tests but it looks much more complicated with stacks. def bubble_sort(list) n = list...

 
4:55 AM
0
Q: Simple syntax highlighter - part 2

Ethan BierleinI've completely revamped my old syntax highlighter, and made it more flexible and easy to use. It works the same way as the previous one, wrapping <span> elements around sections of text in an element with certain styles, but it now allows for string highlighting, and is more extensible by allowi...

 
@Jamal I think that there is a case to be made for all three tags' existence. But I don't have strong feelings either way, since they are rather low-volume subjects.
 
5:45 AM
0
Q: Detecting cycles in a graph without using mutable sets of nodes (Haskell)

John TyreeI recently came across the classic algorithm for detecting cycles in a graph using recursive DFS. This implementation makes use of a stack to track nodes currently being visited and an extra set of nodes which have already been explored. The second set is not strictly required, but it is an optim...

 
 
1 hour later…
7:06 AM
0
Q: Environment-specific code in @Async mail method with Spring

bphilipnycI have a Spring @Service to asynchronously send emails. The part that seems to be a bit off to me is some code that is specific to our QA environment. We want to send and receive all emails through a test email account so that it does not impact live users if we work with real data imported to ...

 
Ah, I mistakenly thought that you meant "the user" by "it", but you're actually referring to "the code". If you just want a code review, try codereview.stackexchange.com. That site is more suitable for asking about potential improvements to working code. — Rob W 53 secs ago
 
7:23 AM
0
Q: Porting Java semaphore to MacOSX

coderoddeI wanted to write some more JNI code and decided to implement a semaphore for MacOSX. In order to assert somehow correctness of my implementation I hereby supply a (multi)consumer/(multi)producer demo. semaphore_impl.h (autogenerated by javah): #include <jni.h> #ifndef MACOSX_SEMAPHORE_IMPL_H...

 
7:38 AM
@Mat'sMug i've been playing around with using RX to share inspection results -- github.com/mjolka/inspectortest
 
0
Q: What is the Best Way to Make a Selection in a Dropdown Based on Several Possible Values

Alex KI'm making a Chrome extension that lets you choose a size of an item and check out quickly. I have a value called "Large" in sizePref array in my chrome.storage. And when it calls that value, it will choose an option in a dropdown based on that. However, possible labels are "Large", "L", "M/L" o...

 
8:13 AM
0
Q: Comparing objects with a tolerance

nJobI have N child classes of the same base class. The base contains abstract methods to convert the class to a byte array and vice versa. It also contains a method to compare that instance to two other instances of the same type. Result shall be true if this instance is within the range of the othe...

 
8:39 AM
hiii!! is there some scala guy hre?
 
9:14 AM
I'm voting to close this question as off-topic because it belongs on CodeReviewYuval Itzchakov 21 secs ago
 
10:07 AM
 
10:25 AM
0
Q: Extracting ZIP, JAR and EPUB files

ambigram_makerI wrote a utility class that is used to extract the contents of a ZIP file to a destination folder. This is a very small class, but it has several practical applications: it can not only be used to extract a ZIP file, it can also be used to extract JAR and EPUB files. Here is the code: UnZipper...

 
11:04 AM
0
Q: dynamic array which contains dynamic array c++

quantusI've stuck in a C++ code with Access Violation Error. Let me explain some of my related code. I have two structures related with each other by "item". And second struct has an dynamic array. struct item { int value; int order; }; struct test_data { item* vector_of_items; int...

 
11:15 AM
Monking
 
11:31 AM
@blackbee @Donald.McLean is a big fan of Scala. He might be around, sooner or later...
Monking
 
Never going to Australia! ibtimes.co.uk/…
 
@skiwi I definitely hope to go to Australia some time! Despite the occasional spiders...
 
Spiders aren't that bad.
I just choose to freakout when they show up near me.
Question: Who's that "Captain Obvious"?
His ID seems.... Negative? o.O
 
Monking.... ;-)
Captain obvious is a "feed".
a system-generated account for posting updates from the RSS feeds from questions added to Code Review.
Today I learned something......
If you use the toString() method often, I would adivse agiainst using String.format(). This is why. — ambigram_maker 1 hour ago
Now, a link to goole search is useless.... but I decided to investigate....
    private static final String intKeyValToStringConcat(int a, int b) {
        return a + " -> " + b;
    }

    private static final String intKeyValToStringSBuild(int a, int b) {
        StringBuilder sb = new StringBuilder(20);
        sb.append(a).append(" -> ").append(b);
        return sb.toString();
    }

    private static final String intKeyValToStringFormat(int a, int b) {
        return String.format("%d -> %d", a, b);
    }
All the same, right?
Task ToStrings -> Concat: (Unit: MICROSECONDS)
  Count    :     10000      Average  :   90.6980
  Fastest  :   77.7620      Slowest  : 3668.2250
  95Pctile :  141.7080      99Pctile :  198.9440
  TimeBlock : 123.814 93.497 86.627 83.399 83.869 87.513 86.016 85.577 87.281 89.392
  Histogram :  9667   310    17     5     0     1

Task ToStrings -> SBuild: (Unit: MICROSECONDS)
  Count    :     10000      Average  :   60.6850
  Fastest  :   50.1300      Slowest  : 1621.5500
  95Pctile :  100.2610      99Pctile :  144.8660
Time is 77 vs. 50 vs. 1039 microseconds .....
 
11:51 AM
What language is that? Java?
 
Yeah.
 
writing such recursive code looks complicate to write. repeat(square, 2)(5)
 
@rolfl that is quite interesting.
 
def repeat(f, n):
    def identity(x):
        return x
    def apply_n_times(x):
        return repeat(f,n-1)(f(x))
    if n < 0:
        raise ValueError("Cannot apply a function %d times" % (n))
    elif n == 0:
        return identity
    else:
        return apply_n_times
 
but it should be no surprise really that String.format is slow. I mean... it can be used to do complicated formatting
 
11:55 AM
below recursive code looks more comfortable to write. what is the advantage of above approach?
 
It is about degrees though.... 20-times slower?
 
def repeat2(f, n, x):
    if n < 0:
        raise ValueError("Cannot apply a function %d times" % (n))
    elif n == 0:
        return x
    else:
        return repeat2(f, n-1, f(x))
g = repeat2(square, 2, 5)
 
@overexchange - the first code has a method name that makes more sense
 
@rolfl actually I feel I can't write first approach so easily as per my knowledge. That is the concern. If I can't, I can't do relevant homeworks of my course. am not sure, how I overcome this.
inner defined function calling an outer function again, is tough to imagine
 
@overexchange The first one seems to return a function and not a value.
 
12:00 PM
as per the below diagram, that I drew by analysing the code, I understand the mechanics..
 
@overexchange you have me (being sarcastic), and Simon .... not sure what he's doing.... but he's no python expert either.... trying to make sense of code that does not make immediate sense
The answers you will get are ..... snide (from me), or unreliable.....
and really, you should be asking these questions on Stack Overflow, not here.
 
or, alternatively, formulate your code in to a main-site question here.
But, you had better make sure you understand the code before you post it here.
 
I would actually go with the first method
 
questions like: how does this work? are not on topic.
 
12:03 PM
my question has to do with adapting to first approach in writing code, when necessary, how do I break that barrier? neither SO nor CR can answer this..
 
First method takes a function parameter and a n 'times' parameter, and returns a function. The other takes a function, a n 'times' parameter and an input x and calls the function and returns a value. It feels like it does too much.
 
Breakfast... that's the answer.
 
By returning a function you can then later decide to wrap that in a memoization mechanism. You can't choose to do that in the second version.
 
sorry? breakfast?
 
@overexchange Canadians...
 
12:05 PM
sorry am not getting both of you, who is canadian?
 
@rolfl is Canadian..
So for him, the time is approximately 8 a.m.
 
oh ok enjoy. need to go thru UML stuff now, ttl
 
12:23 PM
Are you aware of a bug in the syntax highlighter?
 
12:46 PM
Hrm...
@overexchange You seem to be quite good at formulating questions that aren't quite appropriate for Stack Overflow, Code Review, or Programmers.
5
I'm not sure if that's a good thing or not.
 
1:00 PM
Stack Exchange having some issues? I can't get to Meta Stack Overflow. And while I'm trying to post an answer to Code Review, I don't get the preview, and I have none of the editing options.
 
@IsmaelMiguel Plenty of them. Anything in particular?
 
@nhgrif Yup. With this: /<span class="comment">((?:#|-- |\/\/)(?:.|<\/span><span class="[^"]+">([^<])<\/span>)*)([\r\n]|$)/g,
And this: /<span class="comment">(\/*(?:[^*]|*[^\/])+(?:*\/(?:<\/span>)?|$))/g,
 
0
A: Comparing IDs in two arrays

nhgrifThe first thing we can do to improve the efficiency of this code is to remember to check for an error and make sure that the returned objects array returns anything before we do anything. Generally, code from Apple libraries would guarantee our objects array to be empty if there were any sort of...

 
It doesn't seem that bad
 
1:10 PM
Everything seems to work now
 
On a question I asked yesterday (ironically, about a syntax highlighter), you can see the regex being all crappedly highlighter: codereview.stackexchange.com/questions/90938/…
 
1:32 PM
Noonking all
@EthanBierlein I've used ModelSim in the past. Is the Sigasi one not working out for you?
 
2:03 PM
1
Q: PHP, BDD with Behat and Mink (Selenium2 driver), testing search in wikipedia

MusaI am trying to learn BDD in PHP with Behat and Mink and I am using Selenium2 driver for the same. The scenario is given on this page and is as follows: Feature: Search In order to see a word definition As a website user I need to be able to search for a word Scenario: Searchin...

2
Q: Shell script that copies configuration and dotfiles to repository

kleinfreundA while ago I had the idea to store all the important configuration and dotfiles from my system in a Git repository. That saved me a few months ago: My harddrive died, but I could get back to work with Ubuntu and that repository quickly. Only problem: I maintained that repo by manually copying t...

1
Q: Project Euler #9 in C: Special Pythagorean triplet

Ahmed Abd El MawgoodI have finished Project Euler #9 on hacker rank but I feet uncomfortable about by code I think it is sort of spaghetti code that is neither well organized nor fast (just a feeling). I want your reviews for my code or remark to keep optimize my code or to make it simpler (there is many nested if(s...

0
Q: A system for fetermination of human language from input text:: robustification

S.Matthew_EnglishThis programme works, but it's pretty klunky and fragile. I want to make it more dynamic / solid. For instance some of the functionality depends on the order I entered things into an ArrayList, that seems to me to be an example of a terribly odious smelly code. here's the code: //These structu...

0
Q: Get time difference and delete file

MerlI have a function which gets the time difference between the time written in the file name and the local time at the moment the function is called. the file name looks like this: test-16-05-2015-17_42_56.gz (name-date-time.gz) As there is the possibility of more then one instance I need to chec...

 
We lost an ISP uplink for return traffic - we’re swapping providers now.
Stack Overflow should be back online for most people now - we are bringing the other properties over to alternate ISPs in a moment.
All major properties should be online. We’re still having trouble with outbound traffic; services like sockets and image upload won’t work.
All services are back online - we’ll be making some additional routing changes are things stabilize later in the day.
 
Whoa
 
0
Q: Not so random tag for dice

RubberDuckI created the dice tag this morning. At over 60 candidate questions, it was time. Here is the list of candidate questions. When adding the tag, please be sure to make all appropriate edits. Of special note, random will probably be appropriate on many of these. Add it too, as necessary. This...

 
2:36 PM
0
A: Handling calculator keypresses

nhgrifPlease note, I've included this section at the top because it is absolutely the most important change you make in your code. First and foremost, we are one-hundred percent absolutely going to get rid of that horrendous ! operator. In almost all cases, the ! is just begging for trouble. UITextF...

 
2:53 PM
0
Q: Super2048 (Google apac Test Problem)

user3467349This is my second try at writing Ruby. Stylistic feedback is very much appreciated. The problem: 2048 is played on a simple 4 x 4 grid with tiles that slide smoothly when a player moves them. For each movement, the player can choose to move all tiles in 4 directions, left, right, up, a...

 
3:09 PM
@Mast I downloaded Sigasi and discovered it was just an editor, not a full fleged simulator.
I am so close.
1 point away from 1k.
 
Damn, the moment when you notice you forgot how to compute Integrals
I had Calculus almost 4 years ago, barely needed it afterwards :|
 
@skiwi At least you know what an Integral is
 
I don't know what any of that stuff is. It's still four 3-4 years until I take calculus.
 
3:25 PM
@IsmaelMiguel Well, but if I need to use it for probability computations it also is nice to know how I calculate it :P
 
Young pup, eh @EthanBierlein?
 
@RubberDuck Yes, go read my profile description.
I do like math though. I find it fun and interesting. It's also very applicable.
 
@skiwi Exactly. And that is something I never did
 
I have a challenge for anyone who knows calculus. Explain something from it using the up-goer five text editor.
 
4:02 PM
Hello.
 
Hello
 
Hello.
 
Very quiet here...
@EthanBierlein What??? I can't even use the word "math"???
 
0
Q: Should this Rails controller be more RESTful?

Rob SobersThe actions I'm wondering about are members, add_student, and remove_student. They work just fine, but they aren't RESTful and it feels like they should be handled (perhaps) by the StudentsController. Note that members and show are the same. The only difference is that the members.html.erb view...

 
@MannyMeng That's the idea...
 
4:13 PM
@EthanBierlein Sigh... I give up.
 
@EthanBierlein That's not what the specs say.
 
4:56 PM
0
Q: I want my if statement to play tic tac toe if the user responds to the prompt box appropriately

user4909432http://jsfiddle.net/g6rgptrg/2/ Below is the function that is supposed to check if the prompt was responded to correctly and play tic tac toe (if true). $('.btn').click(function() { getRandomInt(1, 6); }); if (num>0&&num<3) { return myPrompt(); } if (myPrompt()=true) { $...

 
@EthanBierlein you'll find math applicable until you start doing calculus.
 
@nhgrif Unless I become a rocket scientist or something. Chances of that are still about zero.
 
I mean, some parts of calculus are useful, but I've found that calculus is sort of taught in a way that most of what you learn is kind of only useful if you go on to be a math major.
And every Engineering degree seems to need through Calc 3. The engineers I've talked to say they don't really use calculus. Some do, I'm sure... But I know a lot of engineers and they all claim to not use Calculus.
 
The only other applicable area I can think of might be CS. Even then, I don't see any areas where it would necessarily be needed.
 
I mean, it's definitely need for physics.
 
5:02 PM
Aerospace engineers use calculus heavily - at least their calculations do.
I would suppose a lot of it is built into computer programs now.
 
0
Q: Speed up generic parallel concept in shell script

SHMGOTOTWRPIMAGE() { NUM=0 QUEUE="" MAX_NPROC=$(grep "processor :" < /proc/cpuinfo | wc -l) # default MAX_NPROC=$(($MAX_NPROC+1)) queue() { QUEUE="$QUEUE $1" NUM=$(($NUM+1)) } regeneratequeue() { OLDREQUEUE=$QUEUE QUEUE="" NUM=0 for PID in $OLDREQUEUE; do if [ -d /proc/$PID ]; then QU...

 
We are back in on our original ISPs (which have better routes). All systems are online. http://t.co/pjtBogHR6J
 
@nhgrif We had to learn Calculus, but yes, we never use it.
But for some specific disciplines it's necessary, so we all had to learn.
 
Woot. I just hit 1k.
4
 
@EthanBierlein Gratz!
 
5:08 PM
Thx
 
@EthanBierlein Tried ModelSim yet?
 
I did.
 
No, not yet. I'm still working on a problem that's been bugging me for the past 2 days.
 
I used Quartus and ModelSim for one of my classes.
 
@EthanBierlein Congratulations!
1k. Those were the days...
 
5:10 PM
Well, the previous classes used ModelSim, and I did a small experiment in it, but my class used a device.
 
Nov 21 '13 at 15:08, by retailcoder
@SimonAndréForsberg Congratulations - 1K!!
 
It's a very obnoxious problem too. Either I don't know about something, or I'm just stupid, but I just can't tokenize nested parentheses.
I'm trying to get it into the format [ expr, [ expr, ... ], ... ] as list, but well, it won't work. Ever.
Which means I should probably spend some time reading up on Java and ANTLR if I ever want to implement my own programming language.
 
5:24 PM
@EthanBierlein You want to implement your own language?
 
@IsmaelMiguel Yep, I've actually just downloaded ANTLR4 and I'm going to see what I can do with it in half an hour.
Oh god, I think I screwed up the installation.
 
@EthanBierlein I tried it once too
But in Javascript
Just 100% Javascript
It proved to be a total failure
 
A good starting point for implementing your own language is probably just writing something that essentially translates it into another language.
Like... write a "MyLanguage-to-C" translator.
 
I keep getting the error Could not find or load main class org.antlr.v4.Tool when I run java org.antlr.v4.Tool %*.
I think I must have done something stupid along the way.
 
@nhgrif That's actually a good idea!
 
5:36 PM
Greetings all
 
0
Q: I can't add another data in my database vb 6

Z'Kfirst of all I'm still a student so please bear if I wrote the program in a messy way. So, I was developing a system (that is related to our subject basic accounting) in which the user will add data and will be stored in the FlexiGrid that I used. Before I forgot, I use 4 forms. frmJournal(the m...

 
@nhgrif Like JediScript
 
wonderful, now powershell is giving me more shit.
I'm following every step of the installation, but no, it's not going to work.
Would anyone happen to know what I'm doing wrong?
 
5:56 PM
Anybody?
 
I don't have it installed.
 
I'm following this tutorial
 
What's the problem, Powershell or something else?
 
I keep getting the error Could not find or load main class org.antlr.v4.Tool when I run java org.antlr.v4.Tool %*.
 
You're on Windows, right?
 
5:58 PM
Yes
 
where are you getting that error?
 
Is there a .exe you can install with?
Or maybe a .msi?
 
@Hosch250 No idea. Not sure actually. I will look for one.
 
Open the downloaded file and tell me what you see.
 
0
Q: Localizing an enum in Java

McAdam331I am currently using an enum in my Android application to display time periods: Weekly Bi-Weekly Monthly Quarterly Yearly I created the enum like this, because I wanted to know the description, and (roughly) number of days: public enum SpendingPeriods { WEEKLY("Weekly", 7), BIWEEKLY(...

 
6:00 PM
OK, it is a JAR.
So, what you need to do is follow the procedure for running a JAR.
 
@Hosch250 Isn't it java -jar jar_file.jar?
 
Something like that.
 
Is that how it works from Windows?
 
Alright, I've done that.
 
See if you have ANTLR in your PATH.
Also, your CLASSPATH.
 
6:03 PM
Okay, I've run SET CLASSPATH=.;.\antlr-4.5-complete.jar;.
 
I'm not sure where to go from here, but you might be able to find something on the web.
 
@Hosch250 okay, thanks for trying to help. :)
 
0
Q: Problems Installing Antlr v4.4

Nick BadotI am trying to install Antlr 4.4 on Windows for the purpose of using pyfuzzy, a Python library for fuzzy logic that depends on Antlr's Python runtime to function. I've tried (naively) to get the Antlr runtimes for Python (2.7) without installing Antlr which of course was not successful. So I've ...

To get Research Assistant, do you need to edit 50 unique wiki articles, or edit articles 50 times?
Just curious, not looking to game the system.
 
I give up. I'm just going to try to write this language without any sort of tools.
 
@EthanBierlein Most languages are now based on C or C++.
Don't start from scratch, just write a converter to convert your language to an existing solid language of choice.
 
6:18 PM
Well, this language is more esoteric than practical, but I'll try to write a converter, or something like my JediScript "language".
 
What are you trying to do with the language exactly? Give an example of what some of the code in your language might look like?
 
@nhgrif GATE logic_gate(input1, input2): NOT (input1 AND input2).
 
So, if you were going to do that in say, C, what would that translate to exactly?
or in plain-English pseudo-code?
 
@nhgrif since I'm not a C expert, I'm going to use Python instead. def logic_gate(input1, input2): return ~(input1&input2)
 
So that's a function definition then?
 
6:23 PM
Essentially, yes
The problem I would have though is liberal use of compile, eval and exec.
 
bool logic_gate(bool input1, bool input2) {
    return !(input1 && input2);
}
in C ^^^
Or do you mean a bitwise operation?
byte logic_gate(byte input1, byte input2) {
    return ~(input1 & input2);
}
 
Either are fine. I could just convert the boolean values to a bit value, or vice versa.
 
Well, the processor is going to deal with it as a full byte, and nothing less than that...
As would C or any other language you translate to
 
True, or I could do something like (int)true.
 
@EthanBierlein So, how from this, do you determine the return type? How would you do multiple line functions?
 
6:29 PM
Well, in my language, GATE's or "functions" only return a value based on parameters, so, in reality, the converted functions would only have one line.
 
Even if it took 50 arguments?
I mean, from a readability standpoint... there's no way to multiline the functions?
 
Rejoice, children
I have returned from Frankia
 
You don't want to end up in a situation like VB.NET where any time you want to multiline anything, you stick an _ at the end of the line and move to the next line... and now you have no in-line comments, and you can't put comments in the midst of multiline anything (because it counts as in-line...)
 
6:47 PM
@nhgrif Well, the idea I have is that the tokenizer would remove any un-needed newlines and whitespace, and then based on that, convert it to a Python/C? function.
The converter will also insert newlines where they are needed.
 
Well, this is kind of irrelevant. I'm talking primarily about the actual syntax rules for the language you're designing.
 
Oh, sorry, I misunderstood what you were saying.
 
What the C or Python or whatever base language looks like is actually completely irrelevant, really. The only way it will matter is when you're trying to debug your interpreter.
Because let's say I'm writing a language called and I'm going to use as the base-language, right? will have a set of syntax rules.
 
Okay, I understand now.
Anyways, I gotta leave, see you later.
 
When the user writes they're , first my interpreter checks their for any syntax problems. Then, if it finds none, it translates the to , then compiles the . The programmer never sees the version of the code (unless I provide a specific option on my interpreter to see the version of the language.
Ultimately, the output is the .exe file or whatever we're compiling to.
Eventually, you write a compiler that compiles directly from directly to the .exe or whatever you're compiling into, but until that point, you're doing this by simply interpreting the language into an existing language and compiling it using the existing language's compiler.
@EthanBierlein ^^^
 
7:01 PM
@nhgrif ok
Do you mean my thinking process looks weird?
 
Maybe. I think sometimes you're overthinking things. Sometimes, I think you might benefit from trying to do some actual programming come down to Earth, and worry more about specific implementation details of actual projects you're working on. The best answer to any good question is usually going to be "it depends", and the questions I've seen you asking don't have a specific scenario context to drop it in (to answer the "it depends" part).
 
chat.stackexchange.com/transcript/message/21681991#21681991 second approach in writing code over first approach is not overthinking? it is just not easy for me to take first approach. I just want to break this barrier.
 
What are you trying to write?
 
the same solution, repeating the square function n times over a number.
 
And a simple for loop doesn't work?
 
7:13 PM
am in a context of learning higher order functions course, am not trying to give some deliberate solution to make myself happy.
 
Huh? The simplest and most deliberate code is what you should always strive for and the only time you shouldn't be using that is when some sort of specification makes it not good enough.
It's important that 6 months later, you still understand the code you wrote and why you wrote it that way, and it's also important that whoever is maintaining your code is able to understand what you wrote and why.
And, if we're going to write recursive functions, we should use examples that serve themselves more obviously as being recurisve. Repeating the same action n times does not serve as an obvious example where recursion makes sense (and as such, using that example to learn recursion is probably more detrimental than constructive).
 
7:30 PM
@overexchange Greatest Common Denominator is a good example of something that can make sense recursively.
func greatestCommonDenominator(a: Int, b: Int) -> Int {
    return b == 0 ? a : greatestCommonDenominator(b, a % b)
}
 
Looks fine. But. Right forum → codereview.stackexchange.comSunil B N 1 min ago
 
0
Q: My PHP MySQLi Library

Braydon BatungbacalI wrote this class recently to better structure and handle MySQLi related interactions with PHP. Would love to get some feedback. https://github.com/braydo25/SimpleMySQLi Thank you!

 
@SunilBN 1) Stack Exchange is not a network of forums. 2) This question would be categorically off-topic at Code Review, as there is absolutely no code to review within this question. Please check out the Code Review help center before making more recommendations to that site. — nhgrif 48 secs ago
 
I really have to agree with @SirPython. We really should have the ability to Downvote comments.
 
7:47 PM
@CaptainObvious Off-topic.
 
@EthanBierlein I think comments are a bit too ephemeral where it would not achieve much to be able to downvote
(also, Monking!)
 
Are there comments you'd like to downvote but can't flag for some reason?
 
0
Q: Cakephp Career Database Design

ClementI am new in cakephp, I want to develop a simple career website, I have design the database, but i would like to show it to professionals and know if the structure is ok Jobs Table -id -job_title -job_description -job_location -company_id -closing_date Applied_jobs Table -job_id -candida...

 
@nhgrif Sure, on occasion. More often than not on SO rather than CR. I generally just either ignore them, or comment in response, if it's bad but not flag-worthy
 
@Phrancis Can OSX host a Postgres SQL server? Or is that Postgres SQL Server you were working with hosted elsewhere?
 
7:58 PM
OS X can, I have one on my machine
 
And it can act as a server on the network that other machines could query against?
 
The one I was working on is local, although it will eventually be hosted on Simon's server, which I believe is Ubuntu
Yup
 
Okay, point me in the right direction?
I'm going to start a recipe/ingredient database for us at the house...
 
That's the IDE
Documentation is also all on the website
 
I need the server install, not an IDE quite as much.
 
8:01 PM
Oh. I think this might be what you need then?
(sorry, never done a server install)
 
Neither have I.
 
Ah, here we go. It looks like Postgres.app might do the trick for you to install a server
 
Monking
 
So, what do you connect to then, @Phrancis?
 
pgAdmin IDE sets up a local host server automatically
 
8:10 PM
I can't get Ubuntu 14.04 + Django + Python 3 + PostgreSQL connector + PostgreSQL to work
It's infuriating
We will probably need to run with the default SQlite setup as we cannot waste more time onto it, and we will not brin ganything in production either
(For university project)
 
@Phrancis Not for me.
 
This question is more suitable for codereview.stackexchange.comNew Dev 17 secs ago
 
See if that ^^ works, those are the settings for the server on my machine
 
Yeah, I downloaded the Postgres.app now... I'm going to try figuring this out.
 
OK let me know how it goes :)
 
8:17 PM
It'd be nice if more things included a sort of "Hello World" type tutorial...
When you start Postgres.app, it launches a server...
Oh, hmm... looks like pgAdmin3 was able to connect to that...
 
It belongs on codereview.stackexchange.com — Dom just now
 
It's just confusing because the server name and my login are the same... since, you know, the computer I'm on is the server.
What's a "tablespace"?
Is this different from a table?
wow...
I HAVE NO IDEA WHAT I'M DOING
8
 
8:37 PM
lol
What are you trying to do?
 
I'm creating tables using pgAdmin's interface... there are tons of options in here I'm not used to seeing with MSSQL
I'm sure you can do all of this with MSSQL, I'm just not used to all of this. What's the "Like" tab for when creating a table?
 
Is that in column definition? Never actually used that. The DDL is a lot like MS SQL
 
You'd probably save yourself some time if you just wrote straight SQL code
Here's an example I wrote for Cardshifter: github.com/Cardshifter/cardshifter-database/blob/master/DDL/…
 
Also, how come almost everything in my object explorer is blue?
 
8:43 PM
That, I have no idea. Did you accidentally do a Select All in your IDE?
 
no, selected row shows up differently
 
Hm.. might be a bug, try quitting and starting up again?
 
I agree. Good grief PHP is so ugly. I'm glad you guys talked me out of it.
 
9:01 PM
I wonder if it's because I'm connecting to a server?
 
This is a solution I've found, if you add the Scott Hunter's suggestion in his answer, that solution might have a good behaviour! codereview.stackexchange.com/questions/90492/…Sergio Formiggini 39 secs ago
 
@nhgrif Could be, not sure, never happened to me (even though I always connect to a server)
 
Hmm
Also... I can't recommend TEXT... you've used it everywhere...
 
I'm pretty sure TEXT is pretty common in Postgres. AFAIK it's the "elastic" version of VARCHAR
 
Yes.
Does username not have an upper limit?
 
9:12 PM
Never tested, I'm going to assume No for the time being
 
Is password not going to be stored as some hashed something or other which means every password is actually the exact same length in the database?
 
Probably would be a good idea to add one, as this may cause GUI bugs if it were too long. I'll mention it to Simon
@nhgrif Yeah, eventually. password is just a placeholder now, there's no login functionality ATM
^^ pseudo-login screen
 
Okay, so I'm using serial as an ID column... what should I do to use that as a foreign key elsewhere?
 
game_id INTEGER NOT NULL,
  FOREIGN KEY (game_id) REFERENCES game(id),
SERIAL are always integer, so you reference them as FK by using INTEGER type
 
9:28 PM
0
Q: Is My data access layer design good? Or using and ORM will be better?

Oliour team is developing an educational website using Asp.net webforms. we designed DAL & BAL classes and now i have some Question. are DAL & BAL designed good ? do you suggest using ORM ( like EF ) instead of using our own classes ?(ORM are Slow ( not sure ) ) Should we ignore BAL and o...

 
> (ORM are Slow ( not sure ) )
Then why say it..
Or why write your own ORM system before measuring something..
 
00:00 - 22:0022:00 - 00:00

« first day (743 days earlier)      last day (3271 days later) »