« first day (354 days earlier)      last day (3666 days later) » 

12:02 AM
I am not certain whether you have the wrong site, or whether you just forgot to copy in your code..... Did you miss a step when you put together this question? Code Review is for reviewing working code, not for helping to write it from scratch.... — rolfl ♦ 14 secs ago
 
0
Q: Is it better to create a class instance, or create an instance each time a method is called?

TrispedI am creating a converter for use in a Windows 8 XAML app (MVVM). As you can see in the code below, the converter is used to convert a bool into one of two strings from a language resource file. My question is, is it better to create one instance of ResourceLoader for the converter class or sho...

 
......
 
@Doorknob s bot is cooler
 
12:18 AM
the funny thing, is that, AFAIK, this is @Doorknob's bot ;-)
 
@rolfl SSSHHHH, it's been modified!!! ;)
 
1:16 AM
Heh, yeah, I wrote and open-sourced it
But I made a bettar version with websockets
Which now supersedes the old one
 
@Doorknob Yeah, I could really get that to work. I need to rewrite it in the superior language of C
 
1:28 AM
Or python
 
@syb0rg "...the superior language of C"? Do you mean C++ or D?
 
@JerryCoffin - long time .... and, I think he meant the one with the GC.
 
@rolfl Yeah--contrary the claims, the hotel I stayed at did not have a functioning internet connection.
@rolfl As far as "the one with the GC" goes, I guess between the two that would be D more often than C++ (though GC is available for both).
 
Well, welcome back to civilization
 
1:48 AM
If you have any votes, this answer could use some more votes (IMO):
2
A: Recording audio in C 2.0

user58697Few notes. First, you don't want to copy data in the loop. Call memset()/memcpy() instead. You need some very serious reason to not use standard library. Here is some example code: dataSize = sizeof(*wptr) * data->numberOfChannels * framesToCalc; if (!inputBuffer) memset(wptr, dataSize, 0)...

 
BTDT
 
@rolfl Thanks. In fairness, I should probably add that I believe this was a temporary problem--the hotel did have access points and such, they just didn't connect to much of anything for the duration (but just before we left Monday morning, it was all working fine).
 
Of course ... it probably meant you were able to have a good holiday? and not be too distracted by real life.... or was it a working trip?
I went to my in-laws for the weekend, was planning on working for some of it. Instead I ended up making maple syrup, playing monopoly, and having fun.
Of course, I am behind schedule at work now ....
 
@rolfl It was a good holiday. If we'd had an Internet connection, I probably wouldn't have used it a lot, but I'd have heard a lot fewer complaints from the kids.
 
See, even the crabby moderator is full of surprises:
I did not know that, wow! — bazang 12 mins ago
We had a miscommunication with my wife's brother.... our kids brought their tablets so they could play minecraft and other things with their cousins... their cousins were told "you can't take electronics, you have to play with your cousins!"
It was all solved easily by giving them some chocolate, and putting on a movie
 
2:59 AM
You can play multiplayer Minecraft on a tablet? That's kind of cool.
 
 
2 hours later…
4:35 AM
0
Q: Abusive use of long database query?

JakeI somehow acquired the idea that I should reduce the number of trips to the database as much as possible and so I use a lot of very long queries. For example, I had a function that does this: $shelf = get_shelves($shop_id) foreach($shelf) { $weight = get_weight($shelf); } Everytime a use...

 
 
1 hour later…
5:57 AM
monking
 
6:39 AM
all alone here
 
nope I'm here
 
moring @chillworld then ^^
 
@skiwi morning ;)
 
I see my answer from yesterday is attracting votes
 
hehe nice
 
6:42 AM
7
A: Printing the most used words from phrases

skiwiAs others have pointed out the most obvious improvements already, I would like to talk about Java 8. Maybe you cannot use it yet, but I would recommend looking into it and this answer should proivde useful for anyone reading this. My main focus point here will be designing the code such that it ...

 
skiwi, isn't that answer java 8?
lol your saying it :D
mine vote you got to
 
It got a bit longer as expected..
 
is was also a weird and complex code
 
0
Q: Optimizing Sudoku solver in C++

user3483899Recently, I wrote a Sudoku solver in C++. My program is very hard and was solved in a few seconds. In my opinion, this is slow. #include <iostream> #include <conio.h> #include <stdlib.h> #include <time.h> using namespace std; int tab_in[9][9] = {{0,0,0,0,0,0,0,1,0}, {4,0,0...

 
is = it
 
7:03 AM
0
Q: select_best: yet another partitioning algorithm

user58697The title is somewhat a misnomer; my apologies. The goal of the procedure is to partition a range of first, last by mid for the postcondition max(first, mid) < min(mid, last) The actual code (best_n.h): #include <algorithm> #include <iterator> #if !defined(BidirectionalIterator) #define Bidi...

 
7:14 AM
How. the. fuck.
 
What's up @Vogel612?
 
well, currently unit tests and internship babysitting.
but the WTF-Moment was more of.
I upvoted your answer already..
and I though i hadn't been on cr after 2am this morning..
and now I understand..
you already posted that link in chat before, right?
 
Yesteday evening before I went off I think
 
yep.
I remember I was surprised, you'd go to bed before me ;)
 
hehe
 
7:24 AM
bbiab, meeting
 
Hi all
 
hey
 
Yet another answer to a question that seems to be attracting quite a few:
0
A: Convert sequence of number into display string

Jerry CoffinI'll start by reviewing the code as it stands, then add some commentary about how I think I'd do this job instead. I'd say your code is quite readable--while I personally prefer snake_case variable names over the camelCase you've used, it's at least a decent convention and you've followed it fai...

 
Might need some refactoring...
.forEach(path -> executor.execute(() -> handleException(() -> fileConsumer.accept(path.getPath()))));
 
@skiwi Looks like pretty typical Java 8 to me.
 
7:33 AM
The () -> ... hurt a bit though
Luckily it's just at the very core of the internals of the program, so should never need to modify it again...
And if they need to, then they'll need to hire me back if I'm not here anymore then
 
@skiwi Combining the worst of C with the worst of Lisp to produce a new syntactical nadir.
 
@JerryCoffin I take it you don't like Java 8, or just the mess I produced up there ^^?
I hope there's a way to add custom buttons to Netbeans without fiddling around too much... To run a project
Oh great, this program I call on the command line uses the error output for it's standard output.
 
@skiwi At the risk of sounding condescending, arrogant and downright nasty (a particular risk for me, since they're all probably accurate) Java 8 strikes me as being very similar to MS-DOS 6. Something that started out fairly mediocre, and kept falling behind the rest of the world from there, but added just enough new features that worked just well enough to keep its fans from realizing that it was horribly primitive and obsolete compared to nearly everything else available.
 
@grovesNL I have to disagree there. You are asking about the concept of throwing exceptions as a method of flow control. And that means, you should have headed for Programmers in the first place... The scopes for Programmers and Codereview are a little difficult to distingush here, though. But as you provided abstracted code, this question is definitely off-topic for CR. And thus migration to Programmers.SE was the right step to take. — Vogel612 16 secs ago
 
Well, it's your opinion, but I disagree from it :p
Language evolution is neccessary to survive.
 
7:49 AM
@skiwi Quite a few people obviously do (much like MS-DOS 6).
 
Though I sincerely hope that one day they will throw out all old junk from the past 20 years, however it does mean sacrificing backwards compatability.
And that doesn't seem to be happening unfortunately
 
0
Q: Logging the caller ip in a asmx web service using NLog

Siddharth private void log(MethodExecutionArgs args, string message, LogLevel level) { var calling_ip = ((System.Web.Services.WebService)args.Instance).Context.Request.UserHostAddress; string method = args.Method.Name; LogEventInfo logInfo = new LogEventInfo(leve...

 
@skiwi Microsoft has done quite a bit in the way of new development in .NET, but even they're stuck with maintaining backward compatibility with most of .NET 1.0 (which mostly means the mistakes of early Java).
 
I maybe would be able to understand your concerns about Java 8 if you could show some concrete examples
 
0
Q: What is the best way to conditionally add to an immutable collection in Scala?

ghodssI find myself frequently trying to build up Seq's based on some conditionals, but the code I end up with feels verbose and clunky. An example: def generateSeq(foo: Option[String]) = { Map("bar" -> "baz") ++ ( if (foo.isDefined) { Map("foo" -> foo.get) } else { Nil } ) } I...

 
8:22 AM
@skiwi would you want to give me a free downvote?
-2
A: Find the value nearest to k in the sorted array

Vogel612Approach: Your algorithm is way too complicated for the task. Consider following pseudocode: foreach element in array difference is Abs(element - k) if difference less or equal to currentSmallestDifference currentSmallestDifference = difference keep index return array[index]...

 
@Vogel612 Why? :o
 
need one more downvote, before I can [badge:peer-pressure]
 
Someone else did it :o
 
@skiwi You just posted one. Although the others I see on CR may not be quite as bad as that, I've yet to see even one that gave me even the slightest desire to use it.
 
@Vogel612 Here you go :)
 
8:24 AM
yaaay
 
@JerryCoffin I agree that thing I showed is not nice at all and possibly an abuse
But every language can be, and will be, abused.
 
0
Q: Is this secure from a Google bot's attack?

user3545382Please verify security from SQL injection attacks. homepage.php <html> <head> </head> <body> <ul id="list"> <li><h3><a href="search.php?name=women-top">tops</a></h3></li> <li><h3><a href="#">suits</a></h3></li> <li><h3><a href="#">jeans</a></h3></li> ...

 
@skiwi We should suggest the anti abuse hotline for these languages
 
@skiwi Sure--seeing one poor example (especially when the author starts by pointing out that it's a poor example) isn't good reason to condemn the language as a whole.
OTOH, when I look at your question (for one example) and see Rolfl saying that the code is well written, it seems at least a little more indicative of the language as a whole.
 
Hehe ok
I just noticed that Tesseract OCR 3.03 is in release candidate
I'using 3.02 for work here, and am really in the middle of building the proof of concept system to a real live version
It's like 2 years of development on the OCR that now became available, so gotta be good
 
8:46 AM
0
Q: Defining a DataTemplateBase

ZiggyI have defined some DataTemplates are similar. The templates are like that: <DataTemplate x:Key="DefaultCellTemplate"> <TextBlock Text="{Binding Value}"> <i:Interaction.Behaviors> <beh:AddErrorButtonAdornerToControlsBehavior DoOnButtonClick="{Binding ...

 
CR questions are doing good in the hot tracker, just spotted another two.
 
what's the link of hot tracker?
 
9:03 AM
Monking @SimonAndréForsberg
 
Hiallandeverybody!:D
 
9:15 AM
Monking @SimonAndréForsberg
and @Morwenn
 
0
Q: Excessive number casting & conversion?

ChuckI’m trying to improve my code’s "signal to noise ratio", hence would appreciate any tips on improving this, what appears to be smelly code. Perhaps there could also be potential performance improvements to be made here: public class PricingInfoDto { [DataMember] public decimal ListPrice ...

 
Community♦ felt that it needed to update 91 questions of meta to screw the "active questions" page...
2
 
@Morwenn Why would it do that?
 
Also, Community♦ has 5 rep on Meta CR, which is obviously strange.
I think that it became evil.
 
Seems it also messed up things with the tags update
 
9:21 AM
How so?
 
Because the got replaced by some-tag tag
For no real obvious reasons, it claims to be "fixing" things.
 
Which tag?
 
On literally all other sites it has 1 rep :D
8
Q: Appropriateness of [teaching] tag

200_successThe teaching tag was recently created. There are now three questions carrying the tag. Its intended purpose is described in its tag wiki: Much like the [beginner] tag, this tag should call out that extra care should be taken reviewing the code. Your code review might impact how students...

The question si allowed to use , but the answers are not, they must use teaching tag
 
0
Q: Community♦ has gone crazy on Code Review meta

MorwennThe Community♦ user on Code Review meta has had a strange behaviour recently: First of all, it has 5 reputation instead of 1. Thirty minutes ago, it felt that it was a good idea to update 91 questions at once. Right now, the "active questions" page is totally meaningless since there are only ol...

 
@Morwenn suggest you include a screenshot.
 
9:30 AM
@Morwenn, quick, before it edits your question.
 
@Vogel612 Could you edit it for me? I have to leave for a while ^^"
 
Now tell me, how on earth am I going to see if my program gives an error when it outputs both errors and output on the error stream :(
I'm probably confused as the error stream is even an input sream, sense, it makes none.
 
@skiwi wat?
 
@Vogel612 Well, I might want to switch Process out for ProcessBuilder, appereantly it is some legacy
 
@Vogel612 Thank you :)
I am back sooner than I thought.
 
9:45 AM
getInputStream()
Returns the input stream connected to the normal output of the subprocess.
So the output stream of a process is called an input stream when operating on it in java?
 
i like it... not
 
Ok, this is even worse...
11
Q: Community ♦ bot doesn't like markdown?

AdityaRecently the Community ♦ bot was ran on Ask Ubuntu Meta to migrate all the MSO links to MSE links. But in the process, the bot converted all the posts written in markdown to HTML. An example preview: This bot doesn't like markdown and I want it to be handed a time-bound suspension. It has vand...

 
Fuck you, and fuck your markdown too.
 
hmpf really, the standard output shows nothing and it shows all output on the standard error, thanks stupid program for messing up my workflow.
Or maybe it isn't too bad, the next stage will be expecting an HTML file, if it is not there, then well things are wrong ^^
 
I bet that StackExchange hired an intern to work on Community♦.
 
9:53 AM
and no dev or test surrounding
that guy must be shipped :D
whipped lols
 
"I thought that it was the test server! :o"
 
Lol I remember how I broke the whole testing env on my 3rd day in the project...
3
 
I did that also with dev within a month
@Vogel612 as long its the test that should ot be a problem
 
well... I broke the database for our "multilanguage".
and had to use the one from... about 1.5 years before to "fix" it.
 
but 1 thing strange here, I'm paid the lowest, but they come to me if they have questions :s
2
 
9:57 AM
@chillworld Seems like a fine moment to step up to your manager, no?
 
@skiwi let's say nobody can do a thing about it, I fell under the governement
but I'm open to new challenges elsewhere :)
 
Strange, like no way to change it?
 
@Vogel612 don't tey do db backups?
 
What are backups?
 
@chillworld dev-env...
look what I found in our integration tests...
   customerEditManager.getCurrentCustomer().setName(CUSTOMER_NAME);
   customerEditManager.getCurrentCustomer().setPhone(CUSTOMER_PHONE);
   customerEditManager.getCurrentCustomer().setEmail(CUSTOMER_EMAIL);
 
10:00 AM
Aything bad about it? It depends on how expensive the getCurrentCustomer() is though
 
@skiwi no, I'm in a certain category and it goes with years you work here
 
@skiwi the problem is more, that it clutters the code with needless noise..
 
@skiwi its strange that you want to change the currentuser
 
Ah well yeah... then you have tough luck
 
for tests setting a user oke, but changing it?
 
10:02 AM
@chillworld who's talking about user...
 
damned.... mine dyslexy is coming up again
forget what I just braggled
 
		directly below..
                assertEquals(CUSTOMER_NAME, customerEditManager.getCurrentCustomer().getName());
                assertEquals(CUSTOMER_PHONE, customerEditManager.getCurrentCustomer().getPhone());
               assertEquals(CUSTOMER_EMAIL, customerEditManager.getCurrentCustomer().getEmail());
               assertNotSame(customerEditManager.getCurrentCustomer().getName(),			before.getName());
 
I'm sad, I can't use two big screens in front of me... Because then accessing chat or SO would be very obvious, with a laptop it's not
 
I always thought that simple setter you don't have to test
 
Oh great, I might need to look into serialization now, don't know if I like it
 
10:04 AM
@chillworld oh well... It's probably more because the original writer wanted to verify, that the instance field was correctly updated..
 
@Vogel612 and then be proud of how many tests he has ^^
 
meh... it was a single test-case...
and that is just prep for the real test...
 
no test for equals and hashcode?
 
I really need to number the folders here to have any overview leftover
 
@chillworld that's more the category of pseudo-unit-testing..
 
10:11 AM
Huh
 
@Vogel612 I don't want to be in your place
 
I look out of the window, see a mini van mid air
Then realised I work near a car-selling company and it was on a trailer
 
@chillworld oh well there's always worse..
 
@Vogel612 I know, min emanager can't stop messing in poms
and then crap happens and I can clean it up
 
sheeesh..
we wanted to start GUI-testing..
and a colleague of mine added the selenium-dependencies to the pom.
 
10:14 AM
today also, spring jpa and querydsl where causing problems with sort
as long they are under scope test no problem no?
of lol, unit
selenium is integration
 
and it seems they "didn't work", so he decided "I just have that thing added manually.."
 
our hudson fails atm with the seleniums
 
@chillworld corrected ;) gui-testing..
 
failed to load ...js
 
meh our hudson doesn't even pull from the repo..
 
10:16 AM
updated already the ff driver
at mine work the seleniums are under integration, depends on what they want ;
;)
 
Should I be happy I don't work with EE technologies?
3
 
lols
 
't is not that bad.
 
@skiwi, I don't complain but atm waiting to do a db adaptation on the accept database. (adaptation dev database took 2 weeks for ascript of 5 lines)
I wrote while I was waiting already the gui with a "mocked" service
poll : I did get an email from the ZK framework that I would get free cool stuff (its legit and with a reason) What do you guys think the package will contain?
I gues a cap and tshirt ^^
 
a mug
 
10:25 AM
@Vogel612 mhh never thought of that, that's a thing I actually can use :)
 
0
Q: Quick sort implementation in JavaScript in prototype style

Gelo VolroI have implemented quickly the quick sort algorithm in JavaScript using prototype based style. The code is rather little ( http://jsfiddle.net/b8mfY/ ): <script> "use strict"; var Sort = function( inputArray ) { this.arrayTest = undefined; this.init( inputArray ); }; Sort.prototype.in...

0
Q: Write a small script to extract ms-exchange audit logs in csv format?

asadzBackground I'm using ms-exchange 2013 in my environment, and have a separate siem box which analyze logs produced by different systems (i.e exchange). The logs for exchange are internally stored and can however be extracted such as Get-MailboxAuditLog -Identity test-mailbox-1 -LogonTypes ...

 
both not for me
 
crQuestion -> crQuestion.hasTags(Tags.Java) ? exclusiveLock(crQuestion) : crQuestion
 
0
A: Community♦ has gone crazy on Code Review meta

rolflCommunity has been doing mass-updates of posts changing links that used to point to meta.stackoverflow.com, and replacing them with links to meta.stackexchange.com The effect, for example, can be seen in Community's activity: Migration of MSO links to MSE links

 
@rolfl I added the JDOM dependency on my project :o
 
10:32 AM
Monking all ;-)
 
Monking
 
@skiwi - I am about to release JDOM 2.0.6 .... any day now, with the full Java8 support
 
And monking to you
@rolfl Oh...
Can I start coding against 2.0.5 and replace, or would that not be good?
 
absolutely ;-)
The problem is really only a compile-the-JDOM Code-on-Java8 ... runtime is fine.... I believe
 
btw, I decided to post a Java 8 answer to a non-Java 8 question yesterday
10
A: Printing the most used words from phrases

skiwiAs others have pointed out the most obvious improvements already, I would like to talk about Java 8. Maybe you cannot use it yet, but I would recommend looking into it and this answer should proivde useful for anyone reading this. My main focus point here will be designing the code such that it ...

Lunch now, back in 30
 
10:37 AM
smokey time
 
0
Q: JS Promises and chained calls

DarkNeoI've realized JS callback hell and I started looking into Promises libraries. After reading some articles I decided to start with BluebirdJS. I didn't realise how to properly use them yet, because documentation written with API examples, not real usage. So I have two files (NodeJS environment): ...

 
Man student finance in the UK sucks so much
They have a website that doesn't even work
 
what do you want student finance is not student programming ^^
Telenet from belgium (1 of the 2 biggest internet providers) has a big flaw in there webmail
pw : max 8 chars
when I enter pw of 8 chars
 
I need the moneys to do my programming course :P
 
+ what the hell I want when I log in I'm still getting in webmail
@NiallSzalkai that sucks, maybe phone contact?
 
10:52 AM
@chillworld I tried, they are pretty useless. I'll sort it somehow, its just annoying me at the moment :)
 
@NiallSzalkai I can understand that, everybody needs money
 
@chillworld Its not the money yet, they have an online form for me to fill in my passport details and it just doesn't work. I've manually sent a photocopy in so hopefully that solves my problem
 
I'm imagining how the shit hit the fan at @StackExchange right now ;)
they are probably running in circles there..
 
@NiallSzalkai mine experiance : 20-30% of all the contact forms has problems.
Had one time email regex so bad that he doesn't take a underscore
or onather where I get a failure delivery in mine inbox^, the email adress what the contact form should sent it to doesn't exist
onather = another
 
And back
I was in the sun, now I odn't want to work anymore
 
11:05 AM
wb @skiwi
 
Just a question for you guys, how long have you all been progrogramming for?
 
I can't work atm, waiting for db update. Even a bug I (think) solved I can't test yet :)
@NiallSzalkai professional?
 
@NiallSzalkai well... depends on what you call programming, but it's probably these 2 years I am a trainee now.
 
not proffestional just from the point when you started learning
 
@NiallSzalkai at age of 13 qwbasic and qbasic
 
11:09 AM
In total, about 9 years I think, very briefly mIRC scripting language, then PHP for a good 6 years on a very amateuristic basis, and since 3 years since I went to university Java, whihc has gotten more professional over the time
 
18 : c++(school) 19 vb/net(evening course) and 30-33 graduate programming
between nothing
 
With PHP also comes all of HTML/CSS/javascript/ec
 
and professional 8 months :)
 
@NiallSzalkai - if you count university/school, then almost 25 years.
 
Nice, I did wonder how you all know so much! I was getting worried about not enough after 2-3 months
not knowing enough*
 
11:12 AM
2-3 months is peanuts ^^
I still wonder what is better though, starting with a strongly or with a weekly typed language
 
I'm starting with java
Some of its easy for me like the basics If, While, Do While, Switch. But getting my head around OOP is killing me at the moment :P
 
Simple OOP is still simple...
The others can be a real hell.
 
I can call on methods and stuff, but thats about it for now. More reading required :)
 
@Niall well that's a good start for OOP...
the next thing probably is inheritance..
 
I've read a little about inheritance, it seems hard
Is calling on methods actually OOP or am I being dumb?
 
11:20 AM
As long as you can them methods and not functions, you're halfway there already
Decided to post some of my code-in-progress:
0
Q: Methods creating transform functionality on Collections

skiwiI have written a few simple-to-be-used methods in Java 8, and am wondering what could be improved upon those: public static <E, R, C extends Collection<? extends R>> C transform(final Collection<E> collection, final Function<? super E, ? extends R> mapper) { try { Objects.requireNonN...

 
0
Q: Methods creating transform functionality on Collections

skiwiI have written a few simple-to-be-used methods in Java 8, and am wondering what could be improved upon those: public static <E, R, C extends Collection<? extends R>> C transform(final Collection<E> collection, final Function<? super E, ? extends R> mapper) { try { Objects.requireNonN...

 
@NiallSzalkai each person is also different, one take a lot easier info then another
 
This email conversation with teachers on my university....
I registered for a course, but I did not meet a (small) pre-requirement. Registration as accepted, because the site does not check for pre-requirements.
I send an email to the teacher of that course, he tells me he doesn't think I can take the course, because I am missing a pre-requirement, I need to ask the higher-up.
I ask the higher-up, he tells me that if the registration succeeded, that I then can join the course.
 
so you can join :)
long live the bugs :D
2
 
appereantly, yes..
 
11:37 AM
pfffft, I'm bored and it's sunny out there. Why am I still @work?
2
 
The Money????
 
You're right there in your answer @rolfl, fyi that was not something I'd ever put in production just like that :)
 
@SimonAndréForsberg Community is a mod.. the edits don't move into the review-queue.. also Community owns all edits by anonymous users, and still has 1 rep with multiple 100k edit-suggestions approved... — Vogel612 35 mins ago
@Vogel612 I Know that, just tried to be funny.
 
I was digging through the mod-side of community, and I cannot find anything.
but community is a broken user for so many reasons.
 
@rolfl not paid by the hour @work :)
 
11:42 AM
0
Q: How to simplify this promise-driven animation code?

KosInspired by this question on StackOverflow I've attempted to code such animation, mostly to get some more practice with async, promises and Q.js. Here's what I got: (Live demo) function addOutput(s) { $('<div>').text(s).appendTo(wnd); //return Q.defer().promise; return Q.delay(100).then(f...

 
monking
 
indeed
 
0
Q: Class/Object with different sets of configurations, singletons etc (PHP)

JodesI want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a Paypal class/object that handles API calls to Paypal, using different settings depending on some sort of global switch set t...

 
=\ salary
is not that bad
=)
 
<subliminal-pimping-message>http://codereview.stackexchange.com/q/36547/31503</s‌​ubliminal-pimping-message>
 
11:54 AM
@rolfl what do you expect when someone ent you free cool stuff?
mine gues cap and tshirt and @Vogel612 thinks a mug
 
12:10 PM
@rolfl Allowing SAXBuilder.build() to take in a Path as argument was not trivial, correct?
While maintaining compabilility etc
 
Corr4ct... but path.toString() works great
 
path.toFile() I'd do, but yeah it does
Only other way would be to create a JDOM-2.8 wrapper that injects some functionality? Not a very nice solution though, because you do not want to split the codebase.
 
12:29 PM
someone downvoted my question... I guess they didn't like my cowboy approach
8
Q: Increment up the build number in AssemblyInfo.cs on every build

BenVlodgiI just wrote this short little program to increment up the build number for my projects every time I build them. After compiling this exe, I just call it in the pre-build command line. I did take out the filename string because I used it twice, and I figured I'd get some flack for that. static...

For this post... it is unfortunate that his code is so well organized
6
Q: Sprite drawing class

BenI have written a very XNA spritebatch like interface for drawing sprites in OpenGL. When begin is called the vertex data buffer is mapped to a float*. The index buffer and vertex buffer are bound in begin, and it's assumed no other drawing is done in this OpenGL context between begin and end. In ...

review cant be about that, and as far as the drawing and stuff, im not sure what he's doing wrong
 
@skiwi I am collecting some ideas for JDOM 2.1 which I will consider making fully Java8 specific/required.
But the forward-compatibility must remain (i.e. the existing API must exist unchanged in the 2.1).
i.e. code written against JDOM 2.0.x must work without a re-compile against JDOM 2.1
oh, and I am now at work, and what a pleasant notification:
> You've earned the "Guru" badge for Searching in an array in less than O(n) time.
Thanks santa!
 
@rolfl I see, I'd like to also put some input in it if time allows
 
I have to pay more attention to JDOM ... it has been stable for a while, but it is time for a new 'sprint' with it... ;-)
 
12:47 PM
I'm trying to create some XML-like structure to save as a serialize file, still wondering how I gotta do it though
It has structure like Root -> Page -> Area -> Paragraph -> Line -> Word
where it always has one parent and multiple children possibly
Using the XML file itself the whole time would be ugly
 
One of the neat things about JDOM is that you can inherit from the actual classes....
So, for example, you can have: public class Page extends Element { ....}
Then you can encapsulate the process for when you have getters/setters on the Page, how it affects the XML.
 
I see what you mean, though the JDOM methods are not interesting to me and I actually need to parse some elements
Small snippet:
  <div class='ocr_page' id='page_1' title='image "D:\DPC2\converted\60\60.tiff"; bbox 0 0 2479 3508; ppageno 0'>
   <div class='ocr_carea' id='block_1_1' title="bbox 1690 267 2165 394">
    <p class='ocr_par' dir='ltr' id='par_1' title="bbox 1690 267 2165 394">
     <span class='ocr_line' id='line_1' title="bbox 1690 267 2165 394"><span class='ocrx_word' id='word_1' title="bbox 1690 267 2165 394"> </span>
     </span>
    </p>
   </div>
I think I'll need covariant overrides
 
You can do that too.
 
Though i cannot use the class name Element anymore :D
 
Also, when you parse the XML, you can supply your own JDOMFactory instance to create special sub-types of the elements, if you want ... ;-) jdom.org/docs/apidocs/org/jdom2/DefaultJDOMFactory.html <--- extend that if you want.
although it may not be quite that easy..... hmmmm.
 
12:53 PM
I don't want to do too difficult things yet:D
Oh, I love Dropbox restore removed files
I'm also still figuring out what the compability means for the code
All code that is written right now, should work on future versions, right?
 
0
Q: Numbers as javascript object property name?

nekomeLets say we have following construct: var something = { 1: "one thing", 2: "second thing", 3: "third thing" }; and we access somewhere in code to these attributes as: var output = something[1] + " " + something[2]; // output wold be: "one thing second thing" I guess this is kind...

 
Java binary compability beween 7 vs 8 goes way further then, because you cannot even add methods to existing classes if I'm not mistaken, you can only 'inject' them with default methods
 
@skiwi Did now ;-)
 

« first day (354 days earlier)      last day (3666 days later) »