« first day (495 days earlier)      last day (3525 days later) » 

1:00 PM
@Pimgd, its a collaborative project, most of us got lazy with code style by the end, you could spend a year ripping it to pieces
 
@dcorking well... even procedureal code, shouldn't really have 8.5k LoC in a single method.
 
@wnnmaw phew, that sounds better :) well, try it. Or you could post it here in chat so that we can have a quick look at it to determine what the quality of your question would be.
 
@Vogel612 right.
 
@SimonAndréForsberg, its a tad long for chat probably, so I'll post and if it looks bad I can just nix it
 
@dcorking I hope the meta link I sent answers your question. Although it is very hard to specify "how much" you can strip down. There are so many grey lines we haven't determined the exact location of.
 
1:01 PM
Greetings, Programs.
 
@wnnmaw OK, go ahead!
 
@Donald.McLean Greetings, User
 
@Donald.McLean Greetings, Scala programmer.
 
@SimonAndréForsberg yes - I guess the corollary is not to post the entire project. So we strip it down to somewhere in the middle, with just enough scaffolding to make it runnable.
 
sidequestion, someone by chance knows about jboss standalone configurations?
@dcorking It doesn't actually have to be fully runnable...
but it should must be bug-free (as possible) and compilable when you mock the references.
 
1:04 PM
@dcorking yes, ideally your project should already be structured into separate more or less stand-alone modules. It doesn't need to be runnable though, but it helps a lot if it is runnable.
@Vogel612 I'm afraid I've never used jboss. I've used Spring, Tomcat and some other stuff though... don't know how similar it is.
 
I didn't know that. Seems easier for me to review if I know what the client call looks like. Also seems a burden on the reviewer to write the mocks/stubs if the asker can provide them.
 
We can fairly easily mock a database connection object in our minds. Supplying a list of 15 integers is really hard though. So some code is better off with scaffolding and some code is not.
 
@SimonAndréForsberg well I am not sure on how exactly to go about making the jboss running on our test-env run properly.
 
@dcorking If the code is not compilable/runnable, there is nothing forcing the reviewer to write stocks/mubs mocks/stubs to run it.
 
aka. be up and reachable by hostname && IP.
 
1:08 PM
Heck, even if the code is runnable, there's still nothing forcing the reviewer to actually run it. But it's more likely that the reviewer might do so.
@Vogel612 Never used jboss but... does it work when run locally? Up and reachable by hostname + IP is another problem, more networking-related and should be easy.
 
@rolfl ugh! thank you
 
@SimonAndréForsberg It's up and running locally...
but I have no clue how I can make it publicly available for connections
 
@Malachi did you get your box yesterday?
 
currently it just refuses connection by IP and hostname
 
@Vogel612 Hack somewhere in the router! (Enjoy in a company network...)
 
1:10 PM
read: I get a response, but he says, You ain't comin here.
 
@Mat'sMug no not yet. perhaps today?!!!
@rolfl was that on Facebook, Twitter or Blogger?
 
Hope so!
 
@skiwi you're missing the point... the connection stands, but the server does refuse it
 
@Vogel612 make sure it's not blocked by a firewall, if it should be open externally (i.e. not only in your intranet) then the router needs to forward a port...
 
Monkey got a mod-hat yesterday
 
1:11 PM
@SimonAndréForsberg oh..
I was unclear, sorrry
 
@Vogel612 "You ain't comin here."? Never heard of that HTTP status code.
 
I can access the server, the system's in the same network
@SimonAndréForsberg because it isn't a HTTP status code.
 
Anyway TTGTW, later fellow reviewers (& reviewees... & lurkers)
 
@Vogel612 then what is it exactly?
 
it's something like a general 403 access denied
but without the http.
 
1:12 PM
@SimonAndréForsberg Shameless self promotion
 
So... what kind of connection do you make to it @Vogel612?
 
@SimonAndréForsberg well I try to make the webserver running on my server allow HTTP connections,.
 
@wnnmaw Looks dumbed down...
 
I can access it from the local system, where the server runs.
I can access the system where it runs via SSH & putty.
 
When possible, include real variable names, real filenames and such. You'll get feedback on those as well. EVERYTHING about the code is up for review, not just your problem statement.
 
1:14 PM
but I can't HTTP request the webserver, because it refuses connections from outside.
 
In your code, I don't see a method A and a method B.
 
I can ping the underlying server though.
 
@rolfl what is the first thing you are trying to tell me about with the "s/your/you're/ in"
 
@Malachi you need an apostrophy..
 
0
Q: Access data from python file

wnnmawI have a large script which uses wxpython to create a gui to perform a large number of tasks. The script needs to be used by the entire office and most people don't have python installed locally, so I installed it on the company server. This is workable, but is slow and buggy. I would package ...

 
1:15 PM
@Pimgd, thanks for the tip, everything except [list, of, properties] is the actual variable name and sample data. That one was excluded since it contains proprietary/personal data
 
because your != you're
 
@Vogel612 I fixed that
this is the new blog post about that. I don't like reposting the same stuff twice.
 
@wnnmaw I made a little edit to your question to make it more clearer.
 
Hang on, it's import versus eval?
Wow.
 
@wnnmaw I don't know cr*p about python, but your question is missing context IMO..
 
1:16 PM
@wnnmaw Although I wonder: What exactly is 'buggy' about it?
 
@Pimgd, exec, not eval
 
it's precompiled, then?
<-- has little clue about python
 
@Vogel612 Make sure that the server's firewall isn't blocking the webserver application.
 
@SimonAndréForsberg, updated to clarify "buggy"
 
@wnnmaw if it's data then why exactly is it stored in a py file?
 
1:19 PM
@Pimgd, not sure what you mean by "precompiled"
 
55 pageviews last month! I already have 19 today!
Canada Germany and Poland, who do I know in Poland?
 
oh hang on
 
@SimonAndréForsberg, because that's what I arbitrarily decided a few years ago. Where else would it be?
 
You have a bit of python code that acts like JSON would
it creates some objects/constants used by the application
I would answer your question with "second option is better"
 
@Pimgd, yeah, sounds right
 
1:20 PM
@Malachi no clue, but germany would be me...
 
@wnnmaw Does your code works the way you want it to? At the moment this sentence is a bit.... grey...
> This is workable, but is slow and buggy (write operations get dropped depending on connection speed). I would package it into an executable, but a particular method of getting input data prevents me from doing this.
 
but I'm not sure whether it's a good fit for code review.
 
@Vogel612 that is what I thought.
 
Particularily the part where you don't have code that needs reviewing.
 
0
Q: How to make it simpler and clearer without using a large amount of `fprintf`?

Kevin Dong Nai JiaI am writing an X application with Xlib in C, and this code is for error handling and error printing. How to make it simpler and clearer without using a large amount of fprintf? int XB3DS_Warn_Code (int Warn_Code) { switch(Warn_Code) { case WARN_Failed_To_Connect_To_Display: fprin...

 
1:21 PM
@Pimgd @wnnmaw If the python code is acting like JSON, then why not read it as json and not as a python script?
 
I have more friends from out of the country than I do from in the country at the moment.....lol because I count all my coding friends from here, even if they code in JAVA
 
@SimonAndréForsberg Oh snap. ... wait, hang on, could it?
 
there is actually 2 views from Germany, wonder how Blogger figures those.....
 
@SimonAndréForsberg, doesn't json read java objects?
 
ouch.
 
1:23 PM
@Pimgd I don't know, but I know Python has a tool for readon JSON...
 
JavaScript Object Notation
{"blah":{"x":10}}
 
@wnnmaw JSON is a data format. It reads and write data. It can be used in Java, JavaScript, Python, Ruby, C++, you name it!
@Pimgd Ugh... JS in JSON stands for JavaScript? Now I don't like JSON as much anymore...
 
JSON (/ˈdʒeɪsən/ JAY-sən), or JavaScript Object Notation, is an open standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML. Although originally derived from the JavaScript scripting language, JSON is a language-independent data format. Code for parsing and generating JSON data is readily available in a large variety of programming languages. The JSON format was originally specified by Douglas Crockford. It is currently described by two competing...
 
@Malachi that's both me....
 
@SimonAndréForsberg, list of things I wish I knew a year ago: that
3
 
1:24 PM
{
  "firstName": "John",
  "lastName": "Smith",
  "isAlive": true,
  "age": 25,
  "height_cm": 167.6,
  "address": {
    "streetAddress": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021-3100"
  },
  "phoneNumbers": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "office",
      "number": "646 555-4567"
    }
  ],
  "children": [],
  "spouse": null
}
It's just a format.
 
@Pimgd, that is almost exactly the format I'm using
 
Well, I guess that solves your problem then
Find out the differences between JSON and what you're using
 
@wnnmaw I've been there :) You always learn new things, and always wonder: Why on earth have I not done this different before?
 
then use JSON if you can.
And that will most likely lead to method #2: you'll have to open the file and read it.
 
@Pimgd Shall you or I write an answer for this one?
 
1:26 PM
Close it. It's not on-topic for Code Review.
 
@SimonAndréForsberg, the absolute worst was when I discovered map(), had to write so much code again
 
This sort of thing belongs on StackOverflow...
 
@Pimgd, I agree, its off-topic, I'll just delete
 
@Pimgd What is off-topic about it?
 
@SimonAndréForsberg, the code example probably isn't complete enough
 
1:27 PM
The part where it goes "I don't like what this does."
Not how it does but what it does.
 
@wnnmaw I remember when I first learned the concept of arrays ;) (15 years ago, but still!) You don't want to know how horrible my code was before that...
Agreed. Simply deleting the question is probably best for now
 
@SimonAndréForsberg thanks for the mental images T.T
 
And then use JSON!
 
@Vogel612 I have 6k lines for sorting an array with 8 values in it somewhere.
 
@SimonAndréForsberg, yeah, I'll have to look into the feasibility of switching everything over, but its definitely a great idea!
 
1:29 PM
Feb 25 at 19:52, by Simon André Forsberg
var
  LabForm1: TLabForm1;
  Path    : String;
  Running : Boolean;
  Cash    : TWArr;
  X1, X2, Y1, Y2, X3, Y3, Fu1, Fu2, Fu3, Fu1Pris,
  Fu2Pris, Fu3Pris, Bo1, Bo2, Bo3, Bo1Pris, Bo2Pris,
  Bo3Pris, He1Pris, He2Pris, He3Pris, O1, O2, O3,
  Oka, Okb, Okc, Ok1, Ok2, Ok3, Load1, Load2, Load3,
  R1Dir, R2Dir, R3Dir, Ls1Pris, Ls2Pris, Ls3Pris,
  Ro1, Ro2, Ro3, Ro1Pris, Ro2Pris, Ro3Pris, Mb1,
  Mb2, Mb3, L1Dir, L2Dir, L3Dir: Byte;
  Xa, Ya, Xb, Yb, Xc, Yc, Ls1, Ls2, Ls3, E1Pris, E2Pris,
  E3Pris, Score1, Score2, Score3,
 
@SimonAndréForsberg it's not as bad as I imagined...
thank you..
[status-requesting-mind-bleach]
 
(Actually, is my brother who wrote this originally...)
 
@Malachi You tweeted a link.
Monking
 
hmm.. so this only works for chat.meta.se??
 
@Vogel612 You're saying that it could be worse? How? These are just the variable declarations!
 
1:31 PM
@SimonAndréForsberg it could be 5 elements...
 
lol, yeah, that is true ^^
 
I don't have the code in accessible form anymore, it's stuck in a .fla file
but it boils down to an in-place insert sort without loops.
And actually it's not an array with 8 values
it's value1, value2, value3, value4, value5, value6, value7, value8
 
0
Q: Dataset Copy, Change then Write new Rows back

DarkPh03n1XI Have this code.but i think it is too clumsy, It feels like a 12 point turn, is their a way to optimize it? Please Note That This generates new rows from existing rows. //Create New Dataset DataSet myDataSet = new DataSet(); DataTable ...

 
@wnnmaw You can post the code that uses the JSON on code review once you're done though.
 
56 lines down to 29. I'm gonna go ahead and pat myself on the back. =)
 
1:39 PM
Now you need to go an put carriage returns after all the semi-colons again ....
 
It's still arrow code though. Time to extract a few mehtods.
Thanks @Mug.
 
> I Have this code, but i think it is too clumsy. It feels like a 12 point turn
^^^ that, is a perfect description sometimes of what we do.
 
"mehtod" (noun; plural "mehtods"; pronunciation "meh-tod", "meh-tods") - Used to describe a method in computer programming (see method) that is not quite satisfactory.
2
 
"mehtod" 2. Typo. See "method".
 
1:43 PM
Awww you're spoiling the fun
 
lol I'm starring the fun ;)
 
mehtods make for good code review material =D
2
 
monking
 
Monking also!
 
@rolfl I found it. I tweeted the old post. I fixed that, and also posted a new post about Christmas Letters
 
1:46 PM
monking!
 
@Malachi No problem, just thought I would point it out ;-) So I did.
You guys got your prizes yet? (@Ma* ...)
 
@rolfl thank you I appreciate it!
@rolfl not yet
 
@rolfl nope
 
50 point bounty up in three days. No answers yet.
 
we will see at lunch
 
1:48 PM
9
Q: Draggable Resizeable Box

ElfayerThis is my first angular code. I've been working with jQuery for a while, so I don't have the same approach. I'm looking for advice and code improvement. The following code has 3 directives: ceBoxCreator: Will create a div that will be draggable and resizable on a click. ceDrag: The element ...

 
@Malachi ping me if you see a FedEx box :)
4
 
@RubberDuck I have that open in another tab
@Mat'sMug you bet!
 
hm, maybe it's time to learn angular....
 
anyone going to compete with me for this one?
10
Q: Making loop in CSS Stylus more efficient

user43251I'm not sure if this could be more efficient because I don't think I should need 2 keyframe loops in addition to the for loop? for i in (1..19) .l:nth-child({i}) n = (20 - i) height 0 if i >= 10 margin-left ((n * n) * (1.25/n)) + 17 px box-shadow 0px 0px (n+4)px 0 rgba(40,70,200, 0.5),0px...

 
I got awarded the C# bounty for random values.... I put a lot of time in on that one, but so did others.
Now I am looking for something suitable to pay-it-forward on.
5
 
1:50 PM
@rolfl that's the spirit!
3
 
So much starfood, so few (read: none) left stars
 
@rolfl Excellent idea! If we all take turns posting a +200 bounty on existing answers, we'll all get Legendary badge in no-time! (or, well... 150 days...)
2
 
I have an idea for that +50
 
OK someone tell me I'm not crazy... I got an email from my Systems Data Analyst saying that the reason my data UPDATE ticket did not go through, even though it was marked completed by our data services team... was that some of the columns to be updated were being updated to the same information that was already present. This is SQL Server.
That sounds completely crazy
 
someone tell me how to set a variable in document scope in javascript...
just $document.something = value?
 
1:57 PM
should be just document.something = value
 
@SimonAndréForsberg cheater ;)
 
0
Q: Compare the index of each char in a string in an alphabet array to a range of numbers

Ivo CoumansI saw this codegolf challenge and I set out to try and solve the problem. I'm nowhere near an expert codegolfer or programmer, but it was an interesting exercise. Now I'm wondering how to improve my code, as it feels really bulky (especially compared to some of the answers to the challenge). Not...

 
@SimonAndréForsberg 68 days
 
=/ I have an idea but not enough knowledge to explain it in code
 
Mat tells Mug: look who's talking
 
2:04 PM
@skiwi Ouch. That's gonna make for a long day.
 
@RubberDuck On the plus side, I can now sleep the rest of the day
 
There ya go buddy. =)
 
@rolfl for you, maybe!
 
I have a view that's using the same data source as my own data; I re-created that view in my relational schema, it's flawless. I compare it to the original view's results, it's off. There's a bug in the original view, and yet the joins all look right, and the underlying data is the same. #killmenow
 
2:11 PM
@Phrancis huh?
 
^^^^^^^^
 
@Phrancis huh?
 
Welp so much for answering this question
10
Q: Draggable Resizeable Box

ElfayerThis is my first angular code. I've been working with jQuery for a while, so I don't have the same approach. I'm looking for advice and code improvement. The following code has 3 directives: ceBoxCreator: Will create a div that will be draggable and resizable on a click. ceDrag: The element ...

 
@Phrancis let me guess... SELECT Concat(value1, value2) FROM test WHERE id = 1?
 
17 mins ago, by Phrancis
OK someone tell me I'm not crazy... I got an email from my Systems Data Analyst saying that the reason my data UPDATE ticket did not go through, even though it was marked completed by our data services team... was that some of the columns to be updated were being updated to the same information that was already present. This is SQL Server.
I should have used "value" instead of "information" though.
 
2:14 PM
Is there anything in this that's still salvageable?
 
The Fiddle updated the right columns
 
But if that were true, value2 should not have been updated to baz but rather remain bar
 
Does anyone know a replacement name for package? It is functionality that takes a single input file (like 100.pdf) and puts it in a directory (like 100/100.pdf)
I cannot use package since it's a reserved keyword in package names
 
@Pimgd why the ... did you "rewrite" it in AS3 ??
 
No, I have a solution that I use for GUI elements in AS3.
Because this EXACT problem plagues me to no end.
 
2:15 PM
@skiwi subDirectory?
 
You have 15 buttons and they all do the same thing but ever so slightly.
 
@Vogel612 In the sense of an action I mean, like convert
 
All they need is a different set of parameters... so why not hook the function call directly to the button?
 
@skiwi well it's in fact just a moveTo, isn't it?
 
@Konijn must be spying on us....lol
 
2:17 PM
@Vogel612 Kind of, but it doesn't sound catchy
 
@SimonAndréForsberg stats.minesweeperflags.net there is some graphical glitch for me. Is it normal ?
 
@Marc-Andre what graphical glitch?
 
@skiwi well....
 
Usage would be $document.on("mousemove", new FunctionObject($document, resizeDocument, [<directions>])... similar to what @konijn posted
 
@SimonAndréForsberg minute ill post a screenshot
 
2:21 PM
that happens for me too (Chrome 37.0.2062.120 m)
 
@Marc-Andre it's not intentional, but I don't know how to solve it :)
 
@Pimgd tested on Mozilla too
 
0
Q: Simple Dal for Accessing procedures C#

sarathkumarpublic class DALUser { SqlConnection conn; SqlCommand cmd; public void ExecuteSp(string Spname, Dictionary<dynamic, dynamic> Params) { try { initialize(); cmd = new SqlCommand(); cmd.Conn...

 
@Marc-Andre Wait a minute... the fact that you checked this... Does that mean that someone's actually reading my tweets!?
6
 
@SimonAndréForsberg Sure!
I like Bootstrap so I've checked what you've done with it !
 
2:29 PM
@SimonAndréForsberg I think I retweeted your Minesweeper one - my first tweet ever actually!
 
@Mat'sMug yeah, I noticed :)
@Marc-Andre I just can't believe why I haven't used that before :)
I think the name "Twitter Bootstrap" has confused me a lot. I thought it had something to do about connecting a webapp to Twitter!
 
In hindsight, then, I think I over-simplified my code, which led to at least one unexpected answer. Of course, I won't change it now since it has several great answers. I will learn as I get used to the site.
 
@Mat'sMug nice first tweet, then!
 
@SimonAndréForsberg Yeah it save me a lot of times since I have 0 patience/talents in design
 
help
0
Q: oNode being Set to Nothing, but why, and how do I fix it?

MalachiI am trying to develop a token (in this case a piece of code that runs inside a bigger VBScript) that returns information from an XML that is supplied by the 3rd-party software to a word plugin using bookmarks to provide parameters to the tokens. So here is what is going on, XmlDoc.SetPropert...

 
2:41 PM
@Marc-Andre @SimonAndréForsberg has admitted having no talent in design either..
 
Wow. I was just making a shared library function to feed in a fraction string that I would encounter in AutoCAD drawings and text files and to give me back a decimal. This is far more robust and is the kind of type that I could use for years. Since I do in-house software for a manufacturing company, I suspect your fraction type will find its way into numerous different projects. — Mike 26 mins ago
and I've been wow'd :)
AFK
 
0
Q: Python small brute-forcer

user3404070I have 20+ key set. Keyset is like: Key[0] = { "PossibleKey0", "PossibleKey0Another", "AnotherPossibleKey0" } Key[1] = { .... There is an encryption which needs to be broken, it will receive 20+ keys, one after another. So it applies decryption one-by-one. So key[0] have 3 different possible k...

 
Hang on, OP wows you, but you don't get accepted?
wat
 
3:02 PM
I think I got in over my head. A simple clean up has turned into 8+ hours of refactoring......
 
@RubberDuck haha
 
@skiwi I measure my productivity is LoC removed. =)
2
 
@RubberDuck I would star if I could!
 
RSA
 
I'm still not even halfway through converting Ant to Maven setup after 3 hours
But it's working
 
3:05 PM
... you could have strung it together with Ant in the first place, you'd be done real quick
 
Well, the part which I've done is working*
@Pimgd But Ant is meh
 
@Pimgd yeeeaaaa... not
 
Don't forget the time you spend finding the chart to look up what you save. And the time spent reading this reminder about the time spent. And the time trying to figure out if either of those actually make sense. Remember, every second counts toward your life total, including these right now.
3
 
Heading home now :)
 
It looks like you have about 2-3 days if you'll save 5 minutes
and require it daily
I don't think you'll be able to keep it for longer than 2.5 years, things always change
 
3:08 PM
Maintainable code can not be measured in that way.
 
@RubberDuck Automated build servers can.
It's a bit of a shame the boxes for weekly (save 1 day) and daily (save 6 hours) are black, because those would contain some good numbers
 
@Pimgd well it'd be 260 days, aka 9 months for weekly..
 
0
Q: C++ primer Exercise 1.5.1

Himagra ChawlaExercise 1.20: http://www.informit.com/title/032174113 contains a copy ofSales_item.h in the Chapter 1 code directory. Copy that file to your working directory. Use it to write a program that reads a set of book sales transactions, writing each transaction to the standard output. The link it pro...

 
to @all java people in this room...
what is the difference between type() and annotationType() and getClass() on an annotation?
or rather, how would they ever return different things?
shooops..
nevermind.. type() was my own method..
 
3:25 PM
got my answer, please up vote accordingly
1
A: oNode being Set to Nothing, but why, and how do I fix it?

GratzyIf you do dim mostRecentHearingDate mostRecentHearingDate = CDate("08/05/2014") mostRecentHearingDate = CStr(mostRecentHearingDate) mostRecentHearingDate = "8/5/2014" not "08/05/2014" it drops the leading "0" try mostRecentHearingDate = Right("0"&DatePart("m",mostRecentHearingDate),2) & "/"

@Pimgd this confuses me a little bit
 
@Malachi (or whatever the SO equivalent is)
 
@Pimgd So I can, by my own judging, work for a few weeks on this
or am I reading it wrongly
Ah no, I read it correct
I was confused by the most bottom left tile... But if you are able to shave off 1 day for every task you do 50 times a day, then ... ;)
 
0
Q: Java - How to increase the performance of Hashmap based class

Fisher ManSorry for my poor english and one more sorry for I can't create a suitable title for my question. Unfortunately, I can't use the Tomcat session for storing the key/value pairs for every individual users (Restricted because its a IVR domain based project development). But I need the same functi...

 
@Phrancis thank you
 
3:43 PM
@StackExchange Who is was that?
 
seen: yesterday.
 
Someone who has answered for sure, in the early stages of CR? 4472 rep on 142 answers means not much was voted
 
@skiwi There is a system in SE chat that automatically re-assigns ownership of a room if none of the owners come in to chat for a (long) period of time, but other people are regularly in.
A long time ago, ownership was automatically assigned to Quentin....
I'm just undoing that ;-) He was owner before I joined CR.
 
Okay :)
 
I'm surprised fishy is not owner since he is mod
 
3:48 PM
Mods automatically are owners of all chat rooms on chat.stackexchange.com
there was never a need.
 
0
Q: PHP mySQLi database wrapper

ruifni am developing an mysqli database wrapper. I've made an effort to make this as fast as possible and easy to use. However, now I want to start adding callbacks (for fecth), and make this mysqli-only dependent (still using get_result). trait dbExtras // connection-independent tools { public f...

0
Q: Which method of fixing double arithmetic errors should I use?

Keith RI am trying to account for the errors in double arithmetic in a c# program I am writing and came up with this first solution that seems to work well for most cases double errorMargins = returnDouble * Double.Parse(Unit_Class_Library.Properties.Resources.AcceptedDeviationConstant); double...

 
@CaptainObvious another one of those D:
 
hmm.. should we compile a canonical database wrapper question?
 
That sure would save me some time ;-)
 
oh and suggesting to hit users tagging into the face with "Functions of the mysql family are deprecated", use mysqli / pdo instead
 
4:03 PM
^^ that.
His PHP actually looks pretty clean, to me
 
4:18 PM
/**
 * @file rock.cpp
 * @brief Determines the height that a rock falls (in feet) after a given time
 * @author syb0rg
 * @date 9/8/14
 */

#include <iostream>
#include <cmath>

int main(void)
{
	// initialize variables on declaration
	double time = 0;
	double acceleration = 32.174;

	std::cout << "Enter the time in seconds that a rock will fall: ";
	std::cin >> time;

	double feetFallen = (acceleration * pow(time, 2)) / 2;

	std::cout << "The rock fell " << feetFallen << " feet." << std::endl;
So I just turned in that for my first CS1 project
And the TA said I needed to comment every line
IS IT NOT SELF-DOCUMENTING?!?!
4
 
Keep in mind that I'm already doing "advanced" stuff, such as using doubles...
 
@syb0rg You're doing CS1? :/
 
@Yuushi I would be in CS2, but I don't want to overstress myself with all my mechanical engineering homework
Plus, I figure I can help raise up some better programmers
 
@syb0rg I always thought you were older :)
 
4:23 PM
@Yuushi Nah, just a freshy in college :P
 
@syb0rg like that?
int main(void)
{
	// initialize variables on declaration
	double time = 0; // set time to 0
	double acceleration = 32.174; // set acceleration to 32.174
	std::cout << "Enter the time in seconds that a rock will fall: "; // ask to enter a time value
	std::cin >> time; // receive a time value
	double feetFallen = (acceleration * pow(time, 2)) / 2; // calculate feet fallen
	std::cout << "The rock fell " << feetFallen << " feet." << std::endl; // output result
 
@Phrancis ugh. Ugh. UGH. UUUUUGGGGGHHHHH.
4
 
@Phrancis Yes, like that.
Anyways, lunchtime
 
Sounds like you should be teaching that class.
 
@syb0rg You should post that as a question.
 
4:36 PM
@syb0rg You should be happy that he didn't recommend: "Why are you not using namespace std;?"
4
 
@Phrancis This line should be improved:
std::cin >> time; // receive a time value
 
@syb0rg get your teacher to create a CR account!!
 
to
std::cin >> time; // receive a time value from StdIn
 
// initialize variables on declaration // this line is a comment
5
 
That deserves a lol!
 
4:39 PM
@syb0rg More stars please, TS! Even though I expect that everyon ehere starred it already
In all honesty, I could expect the `double feetFallen = (acceleration * pow(time, 2)) / 2;
` to have a comment or another refactoring
Whether it is reasonable to ask that given the context... I doubt
 
1
Q: A simple version of Conway's Game of Life using ASCII art

CarcigenicateI'd like a general review of my version of Conway's Game of Life. Right now, it's very simple, and doesn't lead to anything interesting yet, as the "seed" generation is randomly generated and small; so it tends to die off rather fast. import Data.Char import Data.List import qualified Display as...

 
@syb0rg something tells me that you could go straight through to CS5...
 
@Vogel612 ?
 
@SimonAndréForsberg CS6 is newer
 
@200_success and synonymize that all into this tag? definitely yes ;)
 
4:44 PM
I love it here! So friendly, cooperative, nice! SO looks aggresive, competitive and overcrowded compared to CR. — firda 7 hours ago
3
 
@Vogel612 I see the most common answer to those as: Don't do it. MySQLi and PDO is already an abstraction themselves. This class you have made here is utterly and completly useless.
 
@SimonAndréForsberg hey, that'd make a good canonical answer...
 
@Mat'sMug I just hope that we will never be aggressive, competitive and overcrowded.
3
 
OK, perhaps we can be competitive...
2
 
4:47 PM
also,
 
Stop saying starrable things! I'm out of stars by long already...
5
 
lol ;-)
3
 
star all the things!
 
quick question... Why is my webserver not Injecting my EntityManager properly??
 
Check the v-sub-bus under the dynamic contraRAM boundary for contaimination of quad-bit inflections.
 
4:56 PM
@Stateless
@RolesAllowed("User")
public class UniqueFieldValidator implements
		ConstraintValidator<Unique, Object> {

	Class<?> entity;

	@Inject
	private EntityManager em;

        //setup
        @Override
        public boolean isValid(final Object value, final ConstraintValidatorContext context) {
              em; //is null here
              return em.createQuery(defensiveSelect).getResultList().isEmpty();
        }
  }
 
@rolfl that sounds like something out of Dilbert cartoon
 
Because it's private ? I believe something has problems injecting private things
 
@SimonAndréForsberg also didn't work when it was package-private..
but usually that's not a problem, it works in my services...
 
Because you're not informing your DI-framework about the UniqueFieldValidator ?
 
@rolfl Wait what
 
4:58 PM
I didn't inform my DI-framework about anything
 
Because there is no possible EntityManager to inject in the current context?
 
Never inject you rprivates.
 
@SimonAndréForsberg that sounds good...
If I now know what the current context was and how I could get it.
 
@Vogel612 Your DI-framework is responsible for creating it then, I assume.
 
Time to see if it came in the mail! @Mat'sMug or FedEx or whatever.
TFL
FTL
 
4:59 PM
FTL?
Faster Than Light
 
@Vogel612 Because it's @Stateless ? Isn't the private EntityManager technically part of it's state?
 
quick thinking..
 
Time for Lunch, Faster Than Light
 

« first day (495 days earlier)      last day (3525 days later) »