« first day (724 days earlier)      last day (3292 days later) » 

8:00 PM
0
Q: Implementing pthread barrier for Mac OS/X

Aleksey DemakovI have written this little thingie to fix a problem of missing pthread_barrier_t in Mac OS/X pthreads. Are there any issues with this code? The header: #ifndef PTHREAD_BARRIER_H #define PTHREAD_BARRIER_H #include <pthread.h> #ifdef __APPLE__ #ifdef __cplusplus extern "C" { #endif #if !defin...

 
Which you can do in Xcode, but no
Not in VS.
 
0
Q: Verify that a point is inside a triangle

Tomás PaixãoSo I to create a method that checks if the point " ponto " is inside the triangle given by the points A,B,C as vertices. So far I have this : final double PRECISION = 0.1; public boolean dentroDoTriangulo (Point A, Point B, Point C, Point ponto){ //total double ABC = Math.abs ((A.x*(B.y-C.y)+B...

 
Also, I will show a screenshot of some other very very powerful/cool things Xcode does when I get home
 
Yay for cool screenshots
 
@JeroenVannevel I must say that the Go language seems to look funky
What aws your experience programming in it?
 
8:20 PM
the 20 different ways to declare a variable is a little puzzling sometimes but I think I got the hang of it now
overall it feels.. okay
There's some behind the scenes magic I haven't uncovered yet
but I didn't follow a proper introduction either
 
Hmm okay, that tells me like close to nothing, but you are at least not bashing it into the ground
 
give it a shot, you can get something working really quickly
 
No real interest right now as I'm busy learning Python as well :P
Perhaps... some day
That magical day on which you will do all your planned work
 
Go is not magic. You must be thinking of Swift.
"Great Answer" badge on SOMeta.
 
Swift is arcane.
 
8:32 PM
Arcane?
 
Yea, like Perl, but worse
 
Do you know what Swift is?
 
iOS language
the .NET of Apple, right?
 
Never mind ... I just looked up definition of arcane... Wasn't quite what I thought.
It's not the .NET of Apple.
Foundation is the .NET of Apple.
 
Oh
Never heard of Foundation
 
8:36 PM
That's because before Swift, it was only one language... Objective-C
 
So, they split it up?
 
8:52 PM
No.
They just created a new language (like 10 months ago it was announced).
 
Thanks for the heads up :)
 
But the new language (Swift) uses Foundation (and all the other base frameworks that Objective-C uses for iOS/OS X applications).
So, Foundation/Cocoa/Cocoa Touch/etc, are the frameworks (.NET is the framework). Objective-C & Swift are the languages. (VB, C# are the languages)
So also, in the Xcode vs Visual Studio.... Visual Studio has lots of source control plugins, but they're just that, plugins. Xcode comes with built-in git support.
 
doesn't VS have git support nowadays as well?
you can either throw your code on Teamfounndation (or whatever it's called), or make a git repo
Automagically
 
I'm not certain. I haven't used the newest full version of Visual Studio. Visual Studio... have to pay for the full versions.
Xcode completely free (as long as you have a Mac)
 
Latest I used was 2012
Oh, 2013
 
8:59 PM
@nhgrif you can use VS Community (== Pro edition) for free if you're a freelancer or if you're writing code for open-source projects.
Rubberduck is written with VSC2013
 
Yes, but is that the fullest full version?
 
There's usually an Express, Professional and Ultimate
Express is free, Pro is considered full and Ultimate has bonus
But I'm not up to date with their terminology
 
It's kind of the pain about VS though. At work we haven't upgraded lately because we'd have to buy a whole new set of licenses (we're not writing open-source code).
 
Express is gone
Community is the free version now which is equal to Professional
 
...
Microsoft and it's terminological nightmares
 
9:03 PM
@nhgrif I don't know Python that much, actually.
 
This is all built into Xcode.
 
Wow. That's pretty fancy.
 
So, top with graphics?
 
It looks great, good tools to convince a manager
 
9:11 PM
It's not just graphics. It's live graphs demonstrating your application's active CPU usage, RAM usage, Disk IO usage, Network IO usage.
And mapping it over time.
And showing where all this stuff is coming from.
 
that's neat
 
These remind me of some features like this I saw in a video about Swift Playground
 
Swift playground is way cooler than all of this.
 
Isn't Swift Playground an add-on of XCode?
 
Swift Playground is built in to Xcode. It's not an add-on. It's just a different project type.
You don't download anything extra. You just update to Xcode 6.0 or later.
 
9:13 PM
If I ever get my hands on a Mac, I'll try it
 
Playground is a little buggy still, but it's magic, so yeah..
2
 
@nhgrif No. Not the fullest version. They still offer ultimate. Not quite sure what the difference is though. I think the Test Explorer and Code Analysis have some additional features.
 
Oh well
Night all
 
9:19 PM
 
@RubberDuck I know Ultimate has additional database tooling. I don't remember about the rest.. and that was VS2010 so, it's been a while since I used an Ultimate edition.
and I just reviewed a question
 
I'm working on turning the current wall into my own personal star-fest.
I have more than half of the current starred-posts.
You guys are no fun.
 
:p
 
I have starred nothing so far....
2
 
But........ magic
2
 
9:25 PM
 
@Lyle'sMug WHAT??? WHO ARE YOU?! WHAT HAVE YOU DONE TO OUR MALACHI!!??
5
 
Did I miss the magic-fest?
3
 
I think I might have starred some stuff earlier.... maybe
2
 
Okay hang on...
I feel like something is going on...
 
3 hours ago, by Mat's Mug
^^ code is heuristically unreacheable
last thing I starred....
 
9:27 PM
Did I miss the star-fest?
4
 
and I starred this as well ▼▼▼
3 hours ago, by Mat's Mug
11    GoTo 10
 
That should be a permalink to 10...
 
@nhgrif I thought you started it....
 
3 hours ago, by nhgrif
10) am I missing some sort of number-fest?
 
3 mins ago, by nhgrif
I'm working on turning the current wall into my own personal star-fest.
 
9:28 PM
@Lyle'sMug I can make an even shorter infinite loop.
1 GoTo 1
 
while (true){}
 
How can I start my own star-fest? I can't star my own posts.
#define if while
#define false true
 
I have been so distracted today, I really hate documentation...lol
 
Hmm... The VBA is shorter than the C#...
 
I did get a bunch of it done though, I think...
 
9:30 PM
@RubberDuck goto is a valid C# keyword..
 
for(;;) // <-- 7 characters
 
for (int i = 0; i > 0; i++) {}
 
Beats me by 1 ^^
 
jmp $ ; <-- 5 characters
 
what is that?
 
9:31 PM
@Mat'sMug Why?
 
x86 assembler
 
oh...lol
 
@RubberDuck nobody knows
 
Where's Lippert?! This must be explained!!!
 
yes, that was me.
 
9:33 PM
29
A: Does anyone still use [goto] in C# and if so why?

HeinziThere are some (rare) cases where goto can actually improve readability. In fact, the documentation you linked to lists two examples: A common use of goto is to transfer control to a specific switch-case label or the default label in a switch statement. The goto statement is also useful ...

Normally I'd try to refactor this to put the loops in a separate method which I could just return from... — Jon Skeet Jul 1 '11 at 9:00
 
@ericlippert some of us over at http://codereview.stackexchange.com/ were wondering if you've written anything regarding why `goto` still exists in C#.
Yup. Just did that...
 
you didn't... </facepalm>
 
On Error GoTo Hell
4
 
oh actually it's fine, you're not implying he has anything to do with the existence of the keyword
*Error
TTQW
 
I'm losing my mind over something that appears should be so simple... anyone care to look?
 
9:40 PM
That's useful... I'll try doing that. As for braces style, that's how my professor likes them (though he's not originally a Java programmer either) — baum 5 mins ago
 
@nhgrif do you think they going to make an iPod touch 6?
 
Maybe. I wouldn't be surprised.
 
If you would like code review type suggestions for your code, please see codereview.stackexchange.com/tour. Otherwise, this question is not specific enough for Stack Overflow. — Greg Hewgill 1 min ago
 
I'm just sick of waiting, but if i break down and buy an iPhone i will only use the thing on wifi, so i hate to spend the money
 
Get an iPad?
 
9:48 PM
its not the same aspect ratio though
 
In its current form this question would fare very poorly on Code Review as well. The question would need at least some form of description of what the code does, and that it does it as intended. — Phrancis just now
 
what has the world come tooo?
JK
I should have done that a long time ago. maybe I should actually install the Twitter app on my phone. I never actually thought about it before just now....
 
You didn't!
 
So, I have a JSON object like this and I'm trying to search for a specific firstName value like so:
 
Lyle, Lyle, Lyle....
 
9:54 PM
function search(name) {
    for (name in friends) {
        if (friends.firstName === name) {
            console.log(friends[key]);
        } else {
            console.log("No match found for " + name);
        }
    }
}

search("Steve");
> No match found for bill
No match found for steve
Tried a few other ways, and either I get invalid references, or it just prints out all data for each index
Anyone got a clue what this beginner is missing?
 
name name name name
You're hiding your parameter by re-declaring (using?) it again in your for
that's bound to blow something up
and your friends thing doesn't look right either
if friends is a collection of friend objects, then friends.firstName can't work
use for(friend in friends) and if(friend.firstName === 'blaat')
I've got no clue where key suddenly comes from either
Javascript should be forbidden by law
4
 
@RubberDuck the Crocodile
is there something happening to SSIS that I should know about?
 
@Lyle'sMug Not that I've heard. Why?
 
someone at work here was saying something about it not being available or something with the newer SQL Server versions or something, then they said something about BIDS
 
for (name in friends) is not re-declaring, if I did for (var name in friends) then it would re-declare... I think
@JeroenVannevel OK I'll try that when I get home, because it's TTQW!
 
10:08 PM
@sᴉɔuɐɹɥԀ if do use for(name in friends) then you create a loop where each iteration i taken element i from that collection and stores it in a temporary variable called name
 
You are redeclaring
 
Try to log name in your loop and you'll notice it gets the values of the names in the collection -- not the value you passed as argument
 
@JeroenVannevel I disagree.
 
@Lyle'sMug AFAIK they just changed the name..... again.
 
PHP is like PCP - a recreational drug that is intrinsicly dangerous, and yes, should be outlawed....
JavaScript, though, is like Marijuana.... a relatively harmless high with no letha side effects
 
10:12 PM
What about my stress levels?
I'm losing years of my life from just looking at JS code
 
Well, like other things, you can choose to consume it, or not
Note that the highs people get from these things are short-lived....
 
This probably belongs on Code Review. — Kerrek SB 31 secs ago
 
If you actually want to get rid of the headaches, and so on, then use "the real deal" things like Java, and so on.... which are like headache pills - Asprin - make you feel better, reduce pain and inflammation and reduce the onset of heart disease.
 
@JeroenVannevel I believe that should be var friend, as not to create or modify (a) global variable(s).
 
@SirPython That was my instinct as well but decided to just go with the existing usage
I'm not an experienced JS dev
 
10:20 PM
@RubberDuck so it's not SSIS anymore?
anyway TTQW
 
10:54 PM
It's still SSIS, it's just BIDS has become SSDT
 
Monking
 
Monking, @Quill
 
Hi!
 
'night
 
11:10 PM
I just realized something: if someone from another code review site were to enter this chatroom, the would probably get a headache at seeing some of the things we say and how we say them: "Monking! I just killed a jamalized zombie. Now I'm just waiting for Santa to come. TWPTEZTIHEKIMEL."
6
 
So OK, I didn't realize the var in the for.. in loop was actually to hold the index of the sub-objects, good to know, thx Jeroen and @all
Still doesn't work, but I think at least it's a different problem now lol.
 
@JeroenVannevel @ferada @Jamal Explain closure rationale?
-2
Q: Please test this code

user71481Also please give suggestions. If it's not working, please tell me. I'm not sure if it works well since I'm the only person who has ever used it. Also can I copy paste this into Android Studio to make it an app? One last question is that I want to know how to add a timer to this so people know how...

 
This code does work. — user71481 37 mins ago
 
@200_success It's also asking how to implement a new feature.
> I want to know how to add a timer to this so people know how long it took them
 
I see now, and have commented.
 
11:20 PM
I see that. You beat me to it.
 
It's hard to tell what goes where, since the code indentation is so poor
class ActionClass implements ActionListener {{
button1Pressed=0;
button2Pressed=0;}
 
Such a small feature, but so very helpful
Is killing a zombie defined as answering an unanswered question, or receiving an accepted answer?
 
@Quill Generally, as answering an old, unanswered question. Accept is just icing on the cake :)
 
Thanks for clarification
 
Unanswered as in no answers with votes > 1, or no answers at all?
 
11:27 PM
0
Q: HTML Tree Parsing in Perl

morissetteI finally converted my horrific HTML regex parsing: if ( $info =~ / Platform\sType<\/td>\n\s+<td><b>(.*?)<\/b>(.*?)<\/td>.* Codeset<\/td>\n\s+<td><b><i>(.*?)<\/i>.* Status<\/td>\n\s+<td>\n\s+<div(?:.*?)">(.*?)<\/div><br>.* Instance\sID<\/td>\n\s+<td>(.*?)<\/td>.* Instance...

 
Are you solving the same problem? — 200_success ♦ 23 mins ago
@rolfl Explain why you think the OP is wrong?
 
@SirPython A zombie with an un-upvoted answer is still a walking zombie: it takes teamwork to kill zombies :)
 
Annnndddddd.... Out of stars
 
I didn't kill any today, I'm almost done with school.
 
@Jamal @200_success I tested that question's code looks like it runs fine.
 
11:36 PM
It's not a question of whether it runs, as I've commented.
 
Hey... I think Xcode can do Java.
 
A better closure reason would be "Unclear".
 
With a plugin though, I think.
 
@200_success It's a pretty bad question, I wholly agree
Not sure if that makes it necessarily off-topic though, but that's just my personal opinion
 
Hmm, never mind.
It is off-topic... He is asking fore code to be written and asking about whether a particular IDE can run it.
 
11:41 PM
Ah.
 
114
A: Many question askers seem to only want the code, not to understand how to solve their problem

nhgrifYou shouldn't be writing your answers specifically tailored to the specific scenario asked about in the question or specifically tailored to the specific user asking the question. Your answer should certainly solve their specific problem, but your answer shouldn't be quite so specific. Instead,...

This is getting downvotes...
Interesting. No negative comments explaining anyone's problem with the answer.
 
Some people just wanna gimmetehcodez.
 
If they want to become better programmers, they should be asking for advice, not an immediate solution
 
Hm, after firing it up, it never seems to get past this method: public void actionPerformed(ActionEvent e)
 
@sᴉɔuɐɹɥԀ What's happening/where?
 
11:45 PM
Meh, moving on lol.
 
I'm interested. :D
 
		public void actionPerformed(ActionEvent e) {

			int action = Integer.parseInt(e.getActionCommand());
			switch (action) {
			case 1:
				if (button2Pressed == 1) {
					cl.show(constant, "2");
				} else {
					button1Pressed++;
					ready1.setText("READY!");
				}
				break;
			case 2:
				if (button1Pressed == 1) {
					cl.show(constant, "2");
				} else {
					button2Pressed++;
					ready2.setText("READY!");
				}

				break;

			}

		}
From that ugly question. Swing never goes past and out of this method, AFAICT.
 
Well, if you're saying that it's not running the method, the code surrounding it/calling it should be where the issue lies.
 
Yeah I guess so. Like I said, moving on ;)
 
using integers as booleans
Is this C?
Or Android?
The Paleozoic era?
 
11:49 PM
It's JAVA
 
Oh god JAVA.
I really want to see the rest of this code.
What are you working on, if you don't mind me asking?
 
-2
Q: OpeningScreen for game using Swing

user71481Please give suggestions. I'm not sure if it works well for others, since I'm the only person who has ever used it. If it's not working, please tell me. Also can I copy paste this into Android Studio to make it an app? One last question is that I want to know how to add a timer to this so peop...

 
-2
Q: OpeningScreen for game using Swing

user71481Please give suggestions. I'm not sure if it works well for others, since I'm the only person who has ever used it. If it's not working, please tell me. Also can I copy paste this into Android Studio to make it an app? One last question is that I want to know how to add a timer to this so peop...

0
Q: String permutations

SteephenIt is a code eval challenge question https://www.codeeval.com/open_challenges/14/. My answer was accepted, and I modified my code again to improve it. Please let me know is it possible to improve it more. #include <iostream> #include<fstream> #include<algorithm> #include<string> void create_per...

 
I don't have your image files, but I can run it.
 
Does everyone hate code they wrote 6 months ago? Cuz I certainly do.
 
11:58 PM
@RubberDuck I hate code I wrote yesterday
 
@Legato If you click either (or both) of the "CLICK IF READY" buttons though, it never goes past that. At least for me.
 
They work.
Goes from that to Ready
Don't see why you don't think they would.
 
RELOAD!
 

« first day (724 days earlier)      last day (3292 days later) »