« first day (304 days earlier)      last day (3722 days later) » 

4:00 PM
it's actually just the normal - operator
however netbeans called it ---
 
why? to completely fuck up anything like debugging??
 
perhaps
 
unary operator?
 
@SimonAndréForsberg: For this question:
2
Q: How does this code refactor make my code better

ComputernerdAccording to my lecture notes , there are benefits to refactoring the code from original code to refactor code Reasons for refactoring Replace Temp with Query You are using many temporary variables to hold the result of an expression This can result in long methods, since the (...

Does it not matter that it doesn't have a language tag associated with it? It makes it seem borderline here.
 
it does look like to me
 
4:05 PM
@SimonAndréForsberg its psedou-code from my lecture slies — Computernerd 47 mins ago
Bingo
 
psedou-code?
 
wee my code does what I think it does!
In System.out.println this creates a box:
    List<Primitive> primitives = new ArrayList<>();
    primitives.add(new PlaneXZ(-halfWidth, halfWidth, -halfDepth, halfDepth, halfHeight, Vector3f.Y));              //top face
    primitives.add(new PlaneXZ(-halfWidth, halfWidth, -halfDepth, halfDepth, -halfHeight, Vector3f.Y.negated()));   //bottom face
    primitives.add(new PlaneXY(-halfWidth, halfWidth, -halfHeight, halfHeight, -halfDepth, Vector3f.Z));            //front face
    primitives.add(new PlaneYZ(-halfHeight, halfHeight, -halfDepth, halfDepth, -halfWidth, Vector3f.X.negated()));  //left face
 
"wee" as in "oui" => "yes"?
 
wee as in... wee!
 
skiwee
2
 
4:08 PM
like, happiiiiiness
 
hello @monkey!
@SimonAndréForsberg so, it's on-topic or not? (got put on hold)
 
Hey @rolfl, my little bug got fixed today or yesterday
 
Ah, that's good.
Will there be another beta?
 
No clue
it's only the hotspot that got updated from b69 to b70
but not sure if it's released
Still only b129 on the website
 
Well, it will be in the final, for sure.
 
4:12 PM
and then? ... Happweeness! :)
 
Well, look at the 'fix':
+ // Disable CHA for default methods for now
+ if (root_m->get_Method()->is_default_method()) {
+ return NULL;
+ }
+
 
yea...
I was unsure if I did not read something correctly or not
or did they really do that? :D
 
It seems that they really did.
From what I can tell, all it means is that default methods will never be inlined.
 
So they're like... Well we have a massive critical bug that needs to be fixed before 18 march... Let's disable that feature.
 
pretty much
 
4:14 PM
pretty ugly
 
it also means that Java 1.8.1 will be advertised as having 'new optimizations enabled'
 
but better as disabling it for everything :D
hehe
ooh lol, so Netbeans is complaining about code it auto-generated itself... Can't it just fix it itself then?
4
 
BTW - (Back To Work)
 
4:31 PM
holy, I might have abused Java 8's functionality
public static void calculateNormals(final List<Primitive> primitives) {
    primitives.stream()
            .flatMap(primitive -> primitive.getVertexData().stream())
            .collect(Collectors.groupingBy(VertexData::getVertex))  //Map<Vector3f, List<VertexData>>
            .entrySet().stream()
            .map(Map.Entry::getValue)   //List<VertexData>
            .forEach(list -> {
                list.stream().forEach(vertexDatum -> {
                    vertexDatum.setNormal(
                        list.stream()
Would this get hammered by code review? :(
 
Spotted inline comments!; OPEN FIRE
 
you prefer them outline? :D
 
um... why the heck is there no asterisk formatting on my message?
and yes I definitely do.
 
because it's multiline ;)
works
***doesn't***
because it's multiline
 
@Mat'sMug aaaah learned something new again
 
4:35 PM
hmm a bummer, this does not do exactly what I want
now I need to debug it :P
 
split it up... maybe you get a meaningful stacktrace then...
you can always obfuscate by inlining variables.
 
I know where the split needs to be :)
hmm please god no, not another JVM bug
ah no
of course type info gets erased, so need to take care when naming my methods
 
5:15 PM
Hello everyone. :)
 
Hello @kleinfreund!
 
Hey, catching up....
 
0
Q: std::function implementation review

JosephI decided to make an implementation of the C++11 class function. I was checking that I have done everything correctly and have not missed anything: template < typename > class function; template < typename _Ret, typename... _Args > class function<_Ret(_Args...)> { public: typedef _Ret resul...

 
How does one flag a username for lack of civility?
DondeEstaMiCulo, Idaho Falls, ID
131 1
 
5:31 PM
You would have to flag one of their posts. If they have none, flag a post of your own.
 
Thanks. Flagged his question.
 
Is it just for the username, you mean? If so, you should use custom and explain the situation, otherwise another flag would be directed to the post itself.
 
Yes, the username is mildly offensive. Anyway, do whatever you feel is appropriate.
 
Alright, I'll look into it whenever I can.
 
5:46 PM
@kleinfreund You're just an html et css guy right ?
 
Yep.
 
hey @kleinfreund
 
Good, if you have a bit of time, I've posted a question here and there is a part of html. If you want something to review! I would be glad if you can say something :D
There is not much css since I use bootstrap
 
I see what I can do, but I have work on my table. Give me a link and if there is no answer on Thursday I see how I can help you. ;)
 
@konijn is in trouble .... innerText is IE Only?
 
5:51 PM
@kleinfreund Thanks a lot ! And really if you don't habe time or don't want to review it feel free! there it is codereview.stackexchange.com/questions/43255/…
 
It's really a time issue. Don't worry. ;)
 
hehe.. typo works in German ^^^^
@Marc-Andre hitting 1K this week?
 
@Mat'sMug I hope so!
 
100pts today and you make it to page 3! codereview.stackexchange.com/…
 
Ehehehe yeah I'll need time to answer! I was hoping that my question would bring me a bit more visiblity, but nothing much so far!
 
5:58 PM
I'm still wondering if I should start with answering on CR or not... I might get... addicted
 
0
Q: How do I create a function that takes one type parameter ( DataGrid ) or the second type ( DataGridComboBoxColumn )?

user231605How do I create a function that takes one type parameter ( DataGrid ) or the second type ( DataGridComboBoxColumn ) ? public void dyscyplina_pobierz(DataGridComboBoxColumn dg) public void dyscyplina_pobierz(DataGrid dg) = public void dyscyplina_pobierz(DataGrid or DataGridComboBoxColumn dg)

 
0
Q: How do I create a function that takes one type parameter ( DataGrid ) or the second type ( DataGridComboBoxColumn )?

user231605How do I create a function that takes one type parameter ( DataGrid ) or the second type ( DataGridComboBoxColumn ) ? public void dyscyplina_pobierz(DataGridComboBoxColumn dg) public void dyscyplina_pobierz(DataGrid dg) = public void dyscyplina_pobierz(DataGrid or DataGridComboBoxColumn dg)

 
asking for code to be written
 
@skiwee that can't be a bad thing :)
 
I only notice that my answers on SO usually end up being quite long posts
 
5:59 PM
@Mat'sMug beat me by 5 sec :P
 
:)
 
And considering I skip all the questions were I facepalm very hard with my Java experience...
 
@konijn Thanks, and updated.... spent some time getting it to work for me ;-)
1
A: Counting the words in a textarea

rolflA few comments on this... What is a character? In your code, you are only counting non-spaces as characters. But, if the user enters a a that counts as 10 characters to me..... From my perspective, Characters can just be text.length. Still your definition appears to be 'non-space charac...

 
Answewing CR questions bwings happweeness to everyone!
 
Hehe, you're right. habe = have
/* Delay post powered by disconnect */
 
6:03 PM
Is a week-old question a Zombie?
 
a young one, I guess
 
The original definition of a "zombie" was for the 1,010 unanswered... which did include then-recent ones, too..
 
So a zombie can also be 1 second old?
 
In my queries I have been defining a zombie at 72 hours.
 
6:05 PM
nah, anything that brings our "time to answer" metric down can't be a zombie ;)
 
but, for what it's worth, the numbers don't change much between 24hr and 72hr zombies.
24hr zombie: http://data.stackexchange.com/codereview/query/170999/answer-delay?Weeks=60&Zombie=24#graph
72hr zombie: http://data.stackexchange.com/codereview/query/170999/answer-delay?Weeks=60&Zombie=72#graph
 
1
Q: My php oop exercise is can it be done better

PhpJuniorI started to learn php oop recently and searched the web for some practical exercises and I found one that said to build a select input that is generated and populated with options by the object, i just want to ask for some opinions on code quality, could it be done better and what is the biggest...

 
6:22 PM
and another post got Jamalized
 
@rolfl Sorry about that, 'it worked on my machine' :)
 
No problem... took me a while to find the problem (including blaming it on jsbin)
I learned a few things on the way, so time not wasted.... really
 
@rolfl so the average age of our zombie population sits at 42 weeks? ...and it ain't decreasing, should we aim for fossilized zombies first and foremost?
 
everage age is OK, not a big deal... I expect it to get even older over time
The hardest zombies will skew the results as we clear out the young ones
 
As long as the red line keeps going up, then :)
Interesting spike in Oct.2012 for Std.Dev/Zombie Age/Weeks (the purple line)
 
6:44 PM
Yes, interesting, but I guess a couple of 1-year-old zombies answered at that point would have made a big difference
I have updated the zombie aging chart to include an 'all' column
(but I had to scale it back to a 1/10th scale
 
0
Q: AngularJS- Could this be improved?

ShawnI'm writing a pretty complicated piece of UI with angularjs. I've been using angular for about 2 weeks. I'm going to post the controllers I feel are the most confusing to read, and am wondering the following: Could these be more "angular" (done in a more angular way?) Is it normal to have this ...

 
7:11 PM
everyone's busy programming :)
For me it's time to change my program from normal drawing to indexed drawing
 
@reta-damn-it-why-didn't-you-change-back? @Mat'sMug yeah technically it is off-topic as it's pseudo-code and not written by the OP.
 
@SimonAndréForsberg wut? which one?
 
@Vogel612 Wow, someone has been paying attention! (or stalking me). You know I take the train. +1
 
wow, I missed that train ;)
 
@SimonAndréForsberg Now everybody knows you take the train
 
7:25 PM
knowing this has just changed my life forever!
 
exactly
 
headshot?
0
A: Collect and calculate average times from log, then display top 10 longest durations

Jerry CoffinIt seems to me that the main thing you need to do is sort out your logic. The way I'd expect things to work would be that for any given site, a DOWN entry indicates that site has gone down, and it's counted as remaining down until you see an UP entry for the same site. If you see a number of DOW...

 
@skiwi Actually, I haven't been doing any programming for 3 and a half hours!
 
(playing ultimate tic-tac-toe in the train doesn't count)
 
I'm not playing in the train!
 
7:33 PM
@Mat'sMug It may not be the best answer ever, but at least give me time to run before you try to shoot me in the head.
 
3 and whole and a half hours @SimonAndréForsberg?! How dare you
 
@JerryCoffin hehe.. I'm out of ammo, ..perhaps "Assist" would be more appropriate - your answer got the Unanswered count down, but it's missing an upvote to get the Questions with no upvoted answers count down as well ;)
 
I'm trying to figure out why glDrawArraysInstanced and glDrawElementsInstanced do not have the same signature zz
 
Because one draws arrays and one draws elements?
 
actually, that was the answer
as simple as it sounds :D
 
7:38 PM
@Mat'sMug Call me crazy if you will, but I'm less concerned with the stats than with whether it actually helps the OP. From his comments, it sounds to me like (even though he's already written code) he doesn't really understand what he's doing. It really is misplaced though--should be on SO, with "how do I implement the following logic?" Only when he's figured out what he really needs to do (and written code to implement that) should it be posted here.
2
 
Perhaps my answer (still breweing) will be more helpful then ;p
 
"Call me crazy if you will, but I'm less concerned with the stats than with whether it actually helps the OP." <-- Starring that part
 
0
Q: This code converts temperatures between fahrenheit and celsius. Am I doing this right?

feed_me_codeI'm learning ruby and working through some exercises. I completed the following exercise without truly understanding why and how it works. I know that's an embarrassing thing to say but I feel like my subconscious mind wrote the code and conscious me (or maybe unconscious me you could say) is hav...

 
^^ the code? haven't looked. the title? could definitely be better...
 
This is darn counter intuitive
public Program drawArrays(final int mode, final int offset, final int count) {
assertCompiled();
assertUsing();
GL11.glDrawArrays(mode, offset, count);
return this;
}

public Program drawElements(final int mode, final int count, final int offset) {
assertCompiled();
assertUsing();
GL11.glDrawElements(mode, count, GL11.GL_UNSIGNED_SHORT, offset);
return this;
}
one method accepts in order of offset, count, the other of count, offset
 
7:44 PM
return this; ...wtf!
 
but if I change my own methods to align up perfectly, then they are counter intuitive in the implementing code >.<
dilemma
what's wrong with return this? :D
 
@skiwi - I have something that may make you feel better.... ;-)
 
What would that be?
 
Have a look at that class, and the 'instance()' and 'newInstance()' methods
 
@Mat'sMug Apparently you-know-who thought so too and edited it
@Mat'sMug What's wrong with returning this?
 
7:46 PM
@skiwi - I mean newFactory and newInstance() methods
 
@rolfl I love that example :)
 
is there a difference between them? :D
 
Yeah, it is a real hall-of-shamer.
No... no difference.
 
wow ok
 
So, you have to ask yourself 'Why?'
Let me show you:
 
7:48 PM
It's always good to have some choice cough
 
^^^ that is the mirror class.... have a look at the newInstance and newFactory methods
 
@skiwi @SimonAndréForsberg well if drawArrays and drawElements both live in the Program class, I don't see a need to return this. I just don't see the need for a method that draws something, to return anything.
 
example usage @Mat'sMug (though not with drawArrays):
bufferPositions = new DynamicDrawArrayBuffer().create().bind().fillData(Drawable.putAllData(drawables)‌​);
 
depends where the client code is, and what it does with the returned Program
 
Chaining FTW!
 
7:49 PM
@skiwi did you look at the second link I sent there .... (I have not heard your jaw hit the floor yet).
 
the mirror also has itttt
 
No, not quite ... look more carefully
 
wait
but
 
(bang) <--- jaw hitting the floor
 
I'm hearing it starting to fall!
 
7:50 PM
one newInstance is deprecated, the other newFactory, which does the same, is not?!
and why
on earth would you return XMLInputFactory
and then deprecate instead of fix it?!
WAT.
 
That's exactly why!
The only way to fix something that public and wide-spread is to deprecate the old method
otherwise a whole bunch of code wouldn't even compile
 
so you mean that the ducttape on ducttape would not compile... I don't see that being too bad :D
 
So, about that small out-of-order situation you have with those methods.
 
I mean all companies test before going to the new Java version... right?
right?
 
@skiwi it is apparent that noone ever, ever, needed to create a custom XMLOutputFactory.
 
7:54 PM
0
Q: C# Class seperation vs polymorphism

Gabriel WI'm interested in optimizing my code. Can someone help me understand the best way to trim this code down with DRY methodology? So I've got these two classes here preforming WMI queries on two separate Win32 classes. My questions are: Should I keep them separated in different classes based on th...

 
The method was added, and never tested.
until, one day, someone actually did want to do it, and found out it was impossible.
Oops, embarrassing.
That is YAGTNI
in action
 
how did that code even go into production...
 
Money and rush jobs.
That javax.xml.stream API is perhaps the worst piece of 'real' code I have ever worked with.
It was written by an intern or someone equivalent in BEA.
It does a realtively fast job of making XML streams event-driven, and, in limited use-cases is really good at parsing XML in fragments.
 
YAGTNI = You Ain't Gonna T*** Need It ?
 
Going To
^^ real words
I can't bring my self to say gonna
The API is used under-the-covers for POJO serialization and other things.... but, essentially no-one else uses it for anything serious.
 
7:58 PM
I think that one is one of the abbreviations that have the most spelling versions...
 
It is called the 'StAX' API
 
@rolfl Not a new phenomenon. Vic Vyssotsky used to tell a story about a Fortran (I think it was Fortran) compiler that they spent a fair amount of time optimizing one routine--and something like 6 years later got the first bug report on it. Eventually figured out that they'd utterly broken that routine, and it had never been used (even once) for the first 6 years in production.
 
@rolfl The JDOM library that you're maintaining, can that be used for POJO serialization?
 
Streaming API for XML (StAX) is an application programming interface (API) to read and write XML documents, originating from the Java programming language community. Traditionally, XML APIs are either: * DOM based - the entire document is read into memory as a tree structure for random access by the calling application * event based - the application registers to receive events as entities are encountered within the source document. Both have advantages: DOM, for example, allows for random access to the document, and SAX requires a small memory footprint and is typically much faster. T...
can it, or should it?
 
0
Q: Programming GPA calculator

user3272236I made a GPA calculator using switch statements one time. However, I want to make it better by including all of these grades: A, A-, B+, B, B-, C+, C, C-, D+, D, D-, F. The GPA calculator I did was very simple and only included A, B, C, D, F. I was wondering what I would have to do in order to g...

 
8:00 PM
Yes it can, no, you should not.
 
Why not? (I can think of some reasons myself perhaps, but I would like to hear what you're thinking)
 
JDOM is an XML model.... serialization requires smarts outsode of the model.
JDOM can help you move the data around, and make sure it's valid, etc.
But, you will need to implement all the smarts for using the right XML structures, etc. to make it work.
By the time you have built a whole infrastructure like that it makes sense to use SAX processes rather than pulling the whole XML in to memory
 
outsode?
oh, outside :)
SAX processes?
Remind me to some day explain to you how the serialization in the project at my job works... (Thankfully, I wasn't the one who decided to use it!)
 
SAX is a protocol that most XML parsers have that tiggers events in handling code as data in the XML document is processed.
though callbacks, essentially.
It is the fastest way to get XML data out of the document (at the moment).
 
8:04 PM
But the callback infrastructure requires state-machines to process.
For most people it is complicated and buggy to keep track of where you are.
It is also only a forward-only process.... you cannot go back to something you have already processed.
This is OK if you have a well-designed XML format that can be processed easily in one direction, but it takes some very careful planning to make your XML work that way.
 
@rolfl Fastest under the right circumstances. Actual speed depends (heavily) on the speed of the callbacks in the client code. That can and does vary widely--to the point that in my experience, a DOM-based parser sometimes ends up faster.
 
^^^ goes without saying^^^ and it is one of the reasons that JDOM is successful
 
Don't get me wrong--DOM-based isn't faster anywhere close to all the time (or even a majority) but development is easier, and speed can be reasonably competitive.
 
It has always been my assertion, that for any specific use-case, that well-crafted SAX will always outperform JDOM (and DOM), but the effor required to get there is far in excess of what it takes in JDOM
To get all span elements in an XHTML document in JDOM:
XPathExpression<Element> xpath = XPathFactory.newInstance().compile("//span", Filters.element());
Document doc = new SAXBuilder().build("http://host/path");
List<Element> spans = xpath.evaluate(doc);
Do that in SAX....
baah.... I need a Namespace in there,but you get the idea.
Put everyone to sleep?
 
@rolfl Yup, if you put enough work into it, SAX should always be at least as fast as DOM (and at least usually, can be at least a little faster). Question is whether the effort is justified--and more often than not, I think the answer is no. If you're parsing gargantuan amounts of XML all the time, sure--but for a lot of common cases, DOM gives entirely adequate performance for a fraction of the effort.
 
8:19 PM
Exactly... and not just the effort of writing the code, but all future maintenance as well. Adding items in to a SAX state-machine is a real PITA
 
<troll>Of course, if you really care about performance, you don't use Java in the first place.</troll> :-)
 
@JerryCoffin - let me quote you quickly on something.... with a little bit of search/replace
 
If you really care about performance, you write in Assembly.
In Java you just do not make the Garbage Collector happy, and everything's still fine :)
 
> Yup, if you put enough work into it, C should always be at least as fast as Java (and at least usually, can be at least a little faster). Question is whether the effort is justified--and more often than not, I think the answer is no. If you're doing high-performance-computing all the time, sure--but for a lot of common cases, Java gives entirely adequate performance for a fraction of the effort.
 
@skiwi If you really care about performance, you lay out your circuits by hand instead of using VHDL or Verilog.
 
8:21 PM
FPGA's
 
@rolfl C is almost always a poor choice. C++ gives better performance than C for less effort than Java.
 
> Yup, if you put enough work into it, C++ should always be at least as fast as Java (and at least usually, can be at least a little faster). Question is whether the effort is justified--and more often than not, I think the answer is no. If you're doing high-performance-computing all the time, sure--but for a lot of common cases, Java gives entirely adequate performance for a fraction of the effort.
 
does this answer make sense?
0
A: Class seperation vs polymorphism

Mat's MugHow about leveraging Enum.ToString()? Given these two enums: public enum Win32OperatingSystem { FreePhysicalMemory, TotalVirtualMemorySize, FreeVirtualMemory } public enum Win32ComputerSystem { Name, Manufacturer, Model } Now you can have a simple method: public ...

 
@rolfl At least in my experience, that's just not true. Java takes less effort to learn, but using it is a whole different story. The sheer verbosity ends up creating massive work all by itself.
 
I'm with the monkey on this one :)
(Perhaps not a big surprise though, considering my tag scores on Code Review...)
By the way, I see that I've got +130 reputation today and two badges yesterday. Thanks, Santa!
 
8:30 PM
0
Q: Better implementation of checking function in Python

user38072I have a checking function that checks the correct type for a class Check_Annotation, I was wondering if there is a better way to implement this, my current code right now is: def _check_list_or_tuple (self, param, annot, value, check_history): assert isinstance(value, type(annot)), "Assert...

0
Q: Writing a function to add or modify an existing object inside an array

Jumbalaya WantonI have an array of objects. Each object has two properties, id and quantity. I wrote a function to add an object to the array. But the function must check if the object already exists within the array. If it does exist, the function must increment the quantity property. Otherwise it must add the...

 
@JerryCoffin it is the illusion of the expert (both ways). An expert in either language makes it look easy.
 
I'm fine with being alone in this, but I do speak from experience. For example, spent most of last summer working on a system that started out as ~2.5 million lines of Java. Duplicated the functionality (and added some new) in about 200K lines of C++ (and yes, the result is measurably faster, though that wasn't the primary intent of the rewrite).
 
Sounds like horribly written Java ;-)
 
Anonymous
 
Anonymous
@rolfl all java is horrible
 
8:33 PM
@rolfl Rather the contrary--probably the cleanest Java I've ever seen in a large production system.
 
i work closely with the IBM compiler team, and they do both Java, all C/C++
Once the Java is compiled down, it is often faster than equiavelent C/C++ because it has information available that the other code does not have available at compile time
Like the CPU architecture being used, whether some values are constants or not (and what the constant value is), etc.
 
anyone notice this Question? I am not a Java Person but figured I would show everyone there are still Java Questions that could be looked at....▼▼▼
 
The dynamics are different.
 
2
Q: SQL PreparedStatement; Am I doing it right?

Roger F. GayI am building a web app with a single (not pooled) full time (jdbc) connection between static classes and the database. This is expected to be a low traffic site and the static methods are synchronized. In an effort to speed up access to product information, I am trying PreparedStatements for the...

 
@rolfl True--as long as you don't mind defining "often" as "around .05% of the time", or "equivalent" as "Java transliterated into C++ syntax."
 
8:37 PM
Meh, it's all sort of a circular argument.... and very subjective.
 
I posted a New Question as well
gotta go get my Daughter from school soon.
 
@palacsint I'll upvote your answer when ammunitions get reloaded, I love answers that quote Clean Code :)
 
@JerryCoffin here's a big, and measurable difference betwen Java, and C++
it is a lot easier to kill Java zombies than C++ zombies ;-)
 
@rolfl Speed is open to objective measurement. "Equivalent" is more subjective, but virtually every benchmark I've seen that showed Java winning with any consistency at all used C++ that was really obviously not how anybody would ever even consider writing it except to try to prove a point (e.g., needed to allocate some memory, so they used calloc,which zeros the memory, then followed that with a memset to zero it again--in a situation where they didn't need to clear the memory at all).
 
0
Q: Do I have any SQL Leaks?

MalachiThis is a Windows Service that will run on about 600 machines, it is used to track the Job Server that a user is connected to (pushed through some kind of Load Balancer, not my area). I store this information in a SQL Table and want to make sure that I don't have any SQL Leaks try { using ...

0
Q: Javascript/ECMAscript 6 classes organization

David MulderSo I have been trying to wrap my head around all the new options in ECMAscript 6 and to do this I tried to develop a simple setup which would allow me to place absolutely positioned <div>'s on the page. Well, let's just jump right into the code: main.js: import {Screen} from './objects/screen';...

0
Q: simple Windows socket class to use it in simple chat and file transfare

NinjaDeveloperI need some advice and some advice to see if my simple Windows socket class is it good to be use in simple chat application. #include <iostream> #include <string> #include <Windows.h> class Socket { private: WSADATA wsaData; SOCKET hSocket; sockaddr_in service;...

 
8:44 PM
I just finished writing a JavaScript answer, and a few seconds before I posted my answer I saw the "1 new answers has been posted, click here to load"-text, and so I thought "Damn, now @konijn has written an awesome review already!". But... seeing that other answer that was posted... I am very happy that I wrote my answer.
2
 
Interesting ... that surprises me. I figured the way most Java benchmarks 'cheat' is by fudging the GC effects.
 
@PatoSáinz All languages are horrible
6
 
(incoming meta-post)
 
Whoa... brace yourself!
Oh, meta, not mega.
 
(come on @StackExchange!)
 
8:48 PM
nevermind
 
@Mat'sMug When you post that and don't link to the question, you waste our time by either a) We're waiting for @StackExchange to post it, or b) We navigate to CR meta to look it up ourselves
 
0
Q: JTextPane with Images

user38052I'm trying to display a JTextPane surrounded by two images using the GridBagLayout as my JFrames layout. But when I run the program the it only displays the JTextPane in the middle.So what is wrong with my code. I'm trying to achieve the following screenshot. And also I want the text to continu...

 
0
Q: Question Titles in the Long Run

Mat's Mugcode-challenge posts are one example of can-get-tricky post titles, since we're a bunch of users posting "Ultimate Tic-Tac-Toe" entries. Lots of other small projects have the same issue: Convert Farenheit to Celsius Rock-Paper-Scissors Fizz-Buzz Simple Calculator Project Euler #XYZ ... Quest...

there
 
@JerryCoffin there are a few things that are significant w/r/t Java at the moment...
1. on large machines, it has a lot of memory to play with, and its memory management is improving.
2. it can dynamically compile code and do things in ways that C/C++ cannot
 
0
Q: Question Titles in the Long Run

Mat's Mugcode-challenge posts are one example of can-get-tricky post titles, since we're a bunch of users posting "Ultimate Tic-Tac-Toe" entries. Lots of other small projects have the same issue: Convert Farenheit to Celsius Rock-Paper-Scissors Fizz-Buzz Simple Calculator Project Euler #XYZ ... Quest...

 
8:52 PM
3. it can have the same code compiled in different ways, and use whichever one is appropriate.
4. In some ways, it is still catching up with C++ compiling... but in other ways, it is ahead.
a) It does compiling based on the actual hardware, not the generic C++ systems
b) it is learning to do things like auto-SIMD for some operations.
c) it is learning about GPU's.
 
@rolfl Some certainly do that as well--certainly (for an obvious example) things on the Computer Languages Bencharmarks Game site aren't intentionally fudging, exactly, but run for short enough times (or just statically allocate everything up-front) that most probably finish without ever running the GC at all. That's not exactly fudging though--it's just the nature of micro-benchmarks.
 
I'm waiting until the day the Garbage Collector won't stall my program :x Hopefully not too long away
 
While things are relatively close now (and C/C++ was much, much farther ahead in the past)... progress in Java work is keeping the same pace, wheras C++ has always been mostly constant.
It is inevitable that for a general purpose system, Java will often end up being the 'better' choice.
You see this again, and again, and again... I'm specifically thinking things like Android here.
which uses some of the same tricks that Java does.
but also, I see it all the time on zOS, POWER, INTEL, AMD, etc/.
 
@skiwi You can have that right now (for the right price). JRockit, for example, provides real-time guarantees (within some limits).
 
The simple fact that Java is close to C++, but is so much more portable, is huge
 
8:57 PM
@skiwi While you wait for that, the Garbage Collector is waiting for you to not make life too hard on it.
I've experienced that setting some circular references to null greatly helped the Garbage Collector to... well... collect garbage. I solved a memory leak because of it.
 
@skiwi use primitives ;-)
 
in really high performance primitives are an answer yes
 
@rolfl One of those claims that never seems to work out in practice either. The "write once, run everywhere' always turned out to be much closer to "write once, debug everywhere". In actual practice, I've spent somewhat (though not much) less effort on portability in C++.
 

« first day (304 days earlier)      last day (3722 days later) »