« first day (551 days earlier)      last day (3468 days later) » 
00:00 - 16:0016:00 - 00:00

12:05 AM
0
Q: Import data from a file

iameHow do we import data from a given file and use it in the program? I want to merge sort some numbers from a file(say suppose there are 100 numbers in the file)

 
I'm ot pimping very often, but when I do it's for the wrong stackexchange site when I'm really close to a silver badge ;)
24
A: Where can I find a list of OpenID Provider URLs?

tomdemuytI would propose to use the http://code.google.com/p/openid-selector/ library. It has the most used urls + graphics for each site. It is what stackoverflow uses.

 
@mjolka that is funny.
 
the whole phabricator front page is great. "Review Code or just stare at it"
 
@mjolka Nothing strikes me as not working... but it's definitely not the right way to make it work.
I was disappointed today to find out that you cannot, in SQL Server, replace this:
(at)SomeVariable / (at)SomePotentialZero
with this:
(at)SomeVariable / POWER((at)SomePotentialZero, -1)
You still give a division by zero error.
 
12:21 AM
@nhgrif could you plug a CASE statement in there perhaps, to do something different if it's zero?
 
CASE also has division by zero. Just because the first case is actually returned doesn't mean the second isn't executed, etc.
 
I see
I'm sure someone on SO knows a workaround, if all else fails :)
 
It's not actually my problem. The guy who sits next to me was having the problem, and I recommended multiplying by the reciprocal... but doesn't work.
My next recommendation was to just create a function in the database to handle this... I think he opted for something far more complicated.
 
1
A: Creating view rects in loop

nhgrifWe should be using auto-layout. Not being as comfortable with auto-layout is not an excuse to not use it. Manually setting rects is not very good at all. Manually set rects don't play well with rotation. Manually set rects mean we probably need a special set of code for iPad versus iPhone. M...

 
1:15 AM
@nhgrif so this gives a divide by zero error, like you said:
declare @numerator as int = 1
declare @denominator as int = 0
select case when @denominator = 0 then -1 else min(@numerator / @denominator) end
but this works
declare @numerator as int = 1
declare @denominator as int = 0
declare @quotient as decimal
if @denominator = 0 begin set @quotient = -1 end else set @quotient = min(@numerator / @denominator)
select @quotient
 
1:49 AM
0
Q: How to make this algorithm faster? Ruby

JohnsonI'm doing a challenge on TalentBuddy that requires you to find the powers of multiple array pairs. Since, I got the solution right, but not fast enough, I decided I'd ask for help here. def fast_power(a, b) pairs = a.zip(b) pairs.each {|p| puts (p[0] ** p[1]) % 4211} end a1 = [long array w...

0
Q: Nav Bar difficulties, help would be appreciated

Jordan Hall<!doctype html> <html> <head> <meta charset="utf-8" /> <title>Enderville 10.0.0.1</title> <link type="text/css" rel="stylesheet" href="styles/css.css" /> <style> body { width:1240px; text-align:center; margin:0px auto; height:1000px; } #header { width:1240px; height:100px...

 
2:03 AM
0
Q: C# Writing a code

Larissa RikerWrite a console application that requests 10 numbers from the user as individual inputs. Each number must be between 10 and 100, inclusive. Compare each number to the last one entered to determine if it is its duplicate. If it is, ask the user for a different number. Output each number to the scr...

 
2:20 AM
I am going to be online a lot from now on, making a game and all you know
 
0
Q: Implementation of Arbitrary-precision integer addition

Rezo MegrelidzeImplementation: string Add(string a,string b) { int maxLen = Math.Max(a.Length,b.Length); a = a.PadLeft(maxLen+1,'0'); b = b.PadLeft(maxLen+1,'0'); int[] arr1 = a.Select(x => int.Parse(x.ToString())).ToArray(); int[] arr2 = b.Select(x => int.Parse(x.ToString())).ToArray(); ...

0
Q: Approximate integral in one line of code

John SmithThis is what I came up with: Version 1: static double Integrate(Func<double, double> f, double low, double high, double delta) { return Enumerable.Sum(Enumerable.Select(Enumerable.Range((int)(low / delta), (int)((high / delta) - (low / delta))), c => f(c * delta) * delta)); } If I'm allow...

 
2:43 AM
 
2:53 AM
time to create the first Database for my Game!
 
-1
Q: can you help me?

Aunihye im auni from malaysia. im a computer student and i need help with c programming. can you build a complete c code of car rental system? the system should include : rent a car, list the due date car, print bill of rental etc . The system also must use recursion, structure, nested structure, l...

 
3:08 AM
@CaptainObvious can you close me?
 
3:34 AM
0
Q: Elegant way to handle errors with JSP and Servlets (Model 2)

ohtphI have a form that submits to a registration Servlet, which inserts a new user to the database when they sign up to the web application. Depending on the erroneous user input, the Servlet will sendRedirect() to a result page, telling the user what went wrong. Servlet: doPost() protected void d...

 
ding me if you need me. I will be trying to expand my website game as much as I can.
 
3:59 AM
0
Q: Design to avoid changing class of instances

Phrogztl;dr: How should I rework my DSL so that it does not require mutating an instance to suddenly be another class? I am writing a Ruby framework/DSL. In it there are a couple specific classes that inherit from a common base: class MaterialBase; end class Material < MaterialBase; end c...

0
Q: Stylistic Perl advice

bananaHow could I improve this working Perl script? (it changes my desktop background to the next available one, without opening a terminal) Specifically, how could I iterate over my .fehbg and walls/ lazily, without reading them into arrays? I couldn't find a way to do that, I need the for loops. ...

 
4:12 AM
^^ look, bananas!
2
 
Bananaphone!
 
Looks pretty thorough @Mat'sMug - Wish SO answers were always like that :)
 
thanks :) looks like CR rubbed off on my SO-fu
2
 
4:29 AM
I came across an odd issue @Mat'sMug you may find it funny. I created this large stored function that drops a schema, creates the same schema and a bunch of tables, and inserts stuff into them. It worked when I called it, but only once. Took me a couple hours to figure out the issue
 
it dropped itself? lol
 
It's only odd in that I did not expect it... the function was stored on the same schema as the tables, so when I called it, it deleted itself :D
 
call sp_redbutton;
2
 
Wouldn't that be handy
 
4:45 AM
Are you looking to have your code reviewed? There is not much code to review, and your question sound like you are looking for advice on which interface to use. This would not be on-topic for Code Review; would you please clarify? — Phrancis 32 secs ago
 
4:57 AM
so many off-topic questions lately
 
I got the log in working!!!!
Just need to make the login page look pretty and then make the Main Master page and figure out how to create a chat
 
-1
Q: Java Fraction Calculator: Problem getting correct numbers

EmilyI am making a program that is to add, subtract, multiply and divide fraction and whole numbers. An example of a few numbers would be: Note: (The underscores are included!) 3_1/2 + 2_3/4 2 + 1/4 -5_5/6 + 1/2 45/3 + 1/8 ext. I have my code, but for some reason I am not getting correct answers...

 
5:22 AM
TTGTB
 
good night! I should get to bed, too.
 
lol right
 
6:15 AM
Monking @all
 
6:45 AM
0
Q: is it good to have lot of small function to remove redundancy

Tabraiz AliI have lot of repeatation in my code for instance lot of repeatation like variable z. var updatealldata = function(data){ var z = data.totalvalue?data.x:data.y; $(k).append(z); } var updatesingledate = function(data){ var z = data.totalvalue?data.x:data.y; $(k[x-id=' + newId + '...

 
7:15 AM
0
Q: Minimal C++ Unit Test Framework?

Code ClownI've written a minimal unit test framework. The goal was to allow assertions of booleans, for equality and catched exceptions. Two things are bugging the most. That assertions have to rely on macros and using a function pointer type instead of one of the more modern C++ ways. Are there ways to fu...

 
8:05 AM
Monking @all..
 
Hi, You might want to keep either c++11 or c++14 and not both, asking to convert c++11 to c++14 would be off topic. Only keep the version you are using. — JaDogg 8 secs ago
 
Monking @Vogel612
 
18
Q: How do weekly topic challenges work?

Jon EricsonA handful of sites have conducted a variation of the "weekly topic challenge" idea. I, myself, have become quite fond of them since they do seem to be effective at increasing asking rate and can be a lot of fun. I've personally initiated challenges on several sites (most recently on History and P...

 
Monking @JaDogg
 
does fit in that "weekly topic challenges" schema?
 
8:10 AM
Monking :p
I learned more in the time I participated in this site(100 days) than what I've learned during a 3 year degree.
2
@Vogel612 thanks for helping with my interview, I got that job :P
3
 
um...
you're welcome ;)
That said I am back to slapping someone in the face for his jsp / java abomination
 
ohhh that one ...
now I do ;)
 
8:25 AM
:p
@janos Perl Vs Python problem is being discussed in the my current work place as well, (well the seniors are discussing it), I wrote some python code too.
 
9:01 AM
the java code is still up for shredding though.
 
-1
Q: Avoid construction of new objects if the class can operate stateless

dierreLet's say I have a factory like this (it's from an interview): public class ControllersFactoryImpl implements ControllersFactory { private final SessionKeeper sessionKeeper; private final ScoreKeeper scoreKeeper; public ControllersFactoryImpl(final SessionKeeper sessionKeeper, fina...

-1
Q: Javascript doesn't work on IE6. What am I doing wrong?

francaismy script works on IE7, 8 ,9 etc. chrome firefox, safari, etc. But when I run this on IE6, it doesn't work. Its a calculate function like a bet vs cash on bank = transfer. What am I doing wrong? Please help. :( Here's a working sample: http://jsfiddle.net/francais/c23vzkyn/

0
Q: Computing the square root of a 64-bit integer

DarthGizkaWhen sieving primes up to some 64-bit number n I need to determine an upper bound for the greatest potential factor of n, which is the greatest integer that is not greater than the (true) square root of n. Computing this as std::sqrt(double(n)) is fraught with pitfalls. The standard IEEE double...

 
10:08 AM
@CaptainObvious Of course it doesn't work on IE, IE stands for immediate error after all :p
 
10:30 AM
The universe was shaken, not stirred -- seriously: neither the Earth nor much of anything in the universe is perfectly homogenized. BTW, as a matter of form, you should (1) provide a reference for your data, (2) specify whether that's ppm by atom count or mass or volume, etc. — Carl Witthoft yesterday
 
10:49 AM
Hello CR!
 
Hello @Unihedron
 
11:04 AM
hiya
 
11:28 AM
@mjolka that works, yes. But you can't inline if-else into a select.
Hence my suggestion of writing a function.
 
@Unihedron message posted using mechanize agent: chat.stackexchange.com/transcript/message/18493553#18493553
@RubberDuck feel free to post on meta or cast some reopen votes ;)
 
@Vogel612 great
I can't pull from your remote branch on your remote fork properly...
I really should properly learn how Git works one day.
 
T.T yes you should ;)
 
@Vogel612 I think I should add to that.
Thanks for the link
Monking all!
 
Monking!
 
11:41 AM
@rolfl I just stumbled upon it in the tavern. Monking to you, too ;)
 
Eh, I'm just going to clone the entire thing.
 
@Unihedron gimme a sec, I should rebase my changes onto current master anyways..
need to setup git on my usb-drive though..
school's really a PITA..
 
No don't, I've already done it :D
 
ehh?? how did you do thatß?ß
#6?
 
git clone https://github.com/Vogel612/JavaBot.git
But it won't compile because BotConfig is missing.
 
11:44 AM
makes.. sense..
 
0
Q: The best way to place callback definition

hellboyIn JavaScript we can write callback definition in many different ways: Definition after usage: var fs = require('fs') fs.readFile('movie.mp4', finishedReading) function finishedReading(error, movieData) { if (error) return console.error(error) // do something with the movieData } Defini...

0
Q: Default Administrator Account Creation ASP.NET

KillercamI have a very simple ASP.NET MVC5 application. I am using this to create a very simple site that will allow users to download our applications once they have logged in to the website (they will need a code, provided by us in order to log in). Now, I want to add a default Administrator account, w...

 
yea I took that out, because I initially moved it in a different folder and the gitignore wouldn't let me censor my credentials
 
oh
I'll flesh it out, thanks for the help so far!
 
Monking
 
Monking
 
11:46 AM
Monking @TheKittyKat
 
What's everyone up to?
 
Procrastinating about going to eat dinner
 
@Vogel612 I did cast a reopen vote. The comment was really just to leave a signpost with some reasoning.
 
@Unihedron Drat, dinner.... but I am not allowed to eat breakfast (yet)....
got to get some bloodwork done.
feeling hungry..... so hungry.... fading away!
 
12:17 PM
rolfl.opacity = 1.0f?
 
I prefer doubles.
0
A: How do weekly topic challenges work?

rolflCode Review has had a number of challenges. The frequency was initially intended to be somewhat 'weekly', but the regularity has diminished to what has become more of a once-a-month-ish. Rock Paper Scissors Lizard Spock Poker Hand Evaluation Sudoku Solver Pokemon - Catch em all! Simple Text Adv...

 
0
Q: Convert impute2 files to mach format in java

qedHere is a program for converting Impute2 files into MaCH format (related to genetics). Source files include one xxx_haps file and one xxx_samples file, for example: // chromosome21.gen_haps --- rs62224609 16051249 T C 0 0 0 0 0 0 --- rs62224610 16051347 G C 0 1 0 1 1 0 --- rs143503259 16051453 ...

 
Auto layout is the right way to do it. There's no reason not to use auto layout besides being uncomfortable with it, and that is an absurdly poor excuse if you ask me. — nhgrif 41 secs ago
 
12:38 PM
0
Q: String not decrypted properly in <opensssl/aes> algo

iDebD_ghI want to write one simple a program that will encrypt one test using and at the same time decrypt it. I wrote below program Adding my whole code here: #include <stdio.h> #include <fstream> #include <iostream> #include <stdio.h> #include <string.h> #include <openssl/aes.h> #include <string.h> ...

0
Q: Chess Code Split

Jamiex304right now I am developing a chess game in java and have been writing the whole game in one java file without doing subclasses and I was hoping I could get some help with that I want to separate the moves of all the pieces into a new file can someone show me how to do that This is the whole ...

 
12:53 PM
@Vog? I did some debugging, it seems that the event fetch works for all chat.SE sites, but not for chat.SO: http://hastebin.com/ijadoluwaf.avrasm
Unless I can get it to work, I'll just use HTMLUnit again.
 
1:14 PM
we murdered the java questions back to 3, and now there's 10 again
this is sad
oh wait, 3 of them have answers
3
Q: Small password generator app with GUI, v2

SingularityFXGUI-based pseudo-random password generator. Modification of this app, improved according to suggestions from Code Review users. Additional feature: calculation of time to crack password on average desktop PC, which is determined as time to go through all possible combinations of characters. Ide...

1
Q: Does RunLengthEncoding class provide abstraction and encapsulation?

overexchangeThis review is in continuation with Part I mentioned in query. As part of the assignment given in Part II from this link, here is the solution: Ocean /* Ocean.java */ package Project1; /** * The Ocean class defines an object that models an ocean full of sharks and * fish. * @author mohet0...

they need votes
0
Q: Java Apache Commons Net SMTP Wrapper Attachment

nLLCan the below code be improved? Are there any major issues with it? Thanks Writer w = client.sendMessageData(); for (File file : myAttachments) { w.append("\r\n").append("--").append(bound).append("\r\n"); w.append("Content-Type: application/octet-stream\r\n"); w.append("Content-Tran...

 
Thanks for the edit @Pimgd and vote
 
Any love for this?
7
Q: Can a non-changing enum method be optimized by the JVM at runtime?

skiwiCan the JVM perform runtime optimization in the following scenario? We've got the following situation, we have this interface: public interface ECSResource { default int getFor(final Entity entity) { return ResourceRetriever.forResource(this).getFor(entity); } } And a concrete...

 
it looks like it had plenty love (+7, 41 views)
but nobody knows the answer
 
Yeah... the answer part is what I care about though ;)
LOL
> Een medewerker van het Isala-ziekenhuis in Zwolle is geschorst, omdat hij in een operatiekamer patat had gebakken.
Translation...
No Google translate this isn't correct
> An employee of the Isala Hospital in Zwolle has been suspended because he had baked in an operating fries.
 
1:34 PM
-1
Q: Please help me with this program in C language using fork wait and exec, is my code correct? I am having trouble making P2 execute after P3

Samuel KhouryQuestion: Write a C program that prompts the user to input an integer n and then forks 2 child processes P2 & P3. P2 should execute before P3 and it should replace its image by the ls command. Process P3 should execute after process P2 and should replace its image by the pwd command. My Answer:...

 
Hey everyone!
 
hey @Marc-Andre
 
translate: Een medewerker van het Isala-ziekenhuis in Zwolle is geschorst, omdat hij in een operatiekamer patat had gebakken
(from Dutch) An employee of the Isala hospital in Zwolle has been suspended, because he was in an operating room had French fries baked
 
Heya @Marc
 
@rolfl Comes closer ;)
 
1:45 PM
in an operating fries
I suppose they're better than nonoperating fries
those are just broken
dammit
stupid website has stupid password restrictions
so I don't know my password
I look up the password restrictions
8-20 chars, min 2 digits
ah okay
> Your account has been blocked. You can try logging in again in 2 hours.
well fk you too
2
(This after I had to look up that usernames are all caps)
this way I will keep forgetting forever to submit my public transit receipts
ohh
But this is useful
Type the correct password: "Your account has been blocked."
 
0
Q: First HTML5/CSS Site

Matt FoglemanMy girlfriend and a friend started a Kiwanis club around here, so I figured it would be a good opportunity to try coding my first web site. Pretty new to coding still and its pretty basic, so just looking for general pointers or any bad practices I may be doing. Thanks! https://gist.github.com/a...

 
Type the wrong password: "Username or password incorrect"
SO ITS ALSO NOT USEFUL FOR STOPPING ANY KIND OF BRUTE FORCE ATTACKS
I need to break something now, vent my anger
 
How about the silence ?
 
bleh
 
wind?
 
1:59 PM
work hasn't been helping either
 
I find this question problematic:
2
Q: Chess Architecture

Jamiex304I am currently developing a chess game but have made the mistake of putting all my Java code in one .java file. I need help cutting up my code into more manageable chucks. Could someone show me how to take out all the piece movements and put them in a separate file which then links back in to th...

 
Ah, the famous JFrame mess
2
Looks like decent starter code, but a hell to debug
 
Is it 10k lines yet?
3
I reached 10k lines before being told to reuse
 
@Pimgd Why did no one tell you before?
 
then again, I didn't know what functions were, so I had while loops and sleep calls.
 
2:02 PM
@skiwi it's not the JFrame mess... it's the implements MouseListener, MouseMotionListener mess.
 
Cause there was no-one around to see the mess =D
 
It's the "I have no idea what MVC is and need a tutorial rather than a Code Review"-mess
 
maybe one day I will post my pascal code
all remaining 3500 lines of it
=D
Actually I don't think it'll fit in 30k chars
 
if you do, I'll post my first Delphi code... what I can fit into a question, that is...
 
I can post my first serious PHP code!
 
2:04 PM
serious PHP code? That's a new one.
Have you seen that chess Java swing question, @rolfl?
 
Maybe if I refactored it a bit, at least make each area use the same random battle generation code
 
That is a shame I don't have my website I did when I was about 11 ! It was about Digimon so much fun! I don't know if it was bad or good! It was a simple html page! nothing much !
 
instead of copy-pasta
 
@SimonAndréForsberg Yes.... it's monolithic
but I have not read it closely.... I went 'eugh' when I read the constructor.
 
aww there's no surviving online version anymore
 
2:06 PM
Does anyone know a good alternatively to Jackson for serializing XML files?
In an object-based way
I'm still fighting with Jackson for XML
oops, I think I meant deserialization
 
JAva!
 
Great... Jackson wiki
Map&lt;String, MyBean> beansByName = objectMapper.readValue(json, new TypeReference&lt;Map&lt;String, MyBean>>() { });
 
&gt;&lt;&gt;
><>
 
Gotta go get drained... back in a while...
 
@skiwi I don't think Jackson is the problem, I think your lack of understanding and experience with Jackson is the problem.
There is not really any more powerful library for XML (de-)serialization for Java that I know of.
 
2:17 PM
@SimonAndréForsberg JSON works perfectly with Jackson... So I think there's an issue
 
0
Q: How to Bind data model to view in MVC 1.0

tanuj shrivastavaI want to know how to bind data from model into a view. I am getting a error

 
@skiwi XML works fine with Jackson as well. If you use it correctly. It's not as easy as it is for pure JSON, but it does work.
 
Especially that if I tell there's an array to be expected, but it finds no element, then it craps out
I get why... As it tries to map the empty string to a Card[] object
But I'm figuring out how to let it then map to an empty array
 
@rolfl I just realized that it's not exactly the question that is the problem, but the questioneer.
can u show me with an example of one of the classes linking to the main one as my problem is trying to right the classes the right way when i split them up — Jamiex304 2 days ago
hello this is really confusing for me but thank you for the help, But I really need someone to show me how to cut up my code into easier chucks can you show me an example of say the piece movements separated into a new file that is linked to the main file, if you can that would be great — Jamiex304 2 hours ago
He apparently does not really know what he's doing...
3
 
um... can we please nuke these comments and have this guy come to chat??
 
2:20 PM
All reports from Google I get is that either som edifferent version magically fixed the issue (which it does not) or they use some real hack-ish way that doesn't seem proper
 
@skiwi Explain me the problem in the TCG room and I might be able to help you out now.
 
I think I found the key...
> ACCEPT_EMPTY_STRING_AS_NULL_OBJECT
Feature that can be enabled to allow JSON empty String value ("") to be bound to POJOs as null.
 
@skiwi null != new Card[0];
 
@Vogel612 It's something I can work around at least
 
hmm..
 
true that
 
Hmmm
> com.cardshifter.core.cardloader.CardLoadingException: com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class com.cardshifter.core.cardloader.XmlCardLoader$Cards] from String value ('
'); no single-String constructor/factory method
Is this not an empty string?
 
@skiwi There's also this page: github.com/FasterXML/jackson-databind/wiki/…
@skiwi don't know, how is your XML?
 
<?xml version="1.0" encoding="UTF-8"?>
<CardInfo>
	<Cards>
	</Cards>
</CardInfo>
 
And how is your POJO with annotations that you deserialize to?
 
2:28 PM
	private static class CardInfo {
		@JacksonXmlProperty(localName = "Cards")
		private Cards cards;

		public Cards getCards() {
			return cards;
		}
	}

	private static class Cards {
		@JacksonXmlProperty(localName = "Card")
		private Card[] cards;

		public List<Card> getCards() {
			if (cards == null) {
				cards = new Card[0];
			}
			return Arrays.asList(cards);
		}
	}
Ah...
It read a single tab
instead of an empty string
Because of the used indentation
Hmm... Who is dealing with what in he wrong way then?
Is what I did less acceptable than putting <Cards></Cards> on a single line?
Or to put <Cards/>
 
Can you produce an SSCCE?
or have you pushed the code to the Cardshifter project on github?
 
@SimonAndréForsberg Not yet, as there are failing tests
 
Well, if I don't have the source, then I can't help you.
 
2:45 PM
I think I'm almost there now
 
@skiwi hey if you are free, would you mind dropping by in the blue cheese monster's home?
 
@SimonAndréForsberg No, he does not, but I am not sure what more I can do beyond 200_Success's current comment.
 
It seems we can't get mechanize to post messages properly.
 
@rolfl Do you know anything about JDOM2? (Rhetorical question)
Is there a way I can make it output XML as compact as possible?
Oh let me try one more thing
 
Yes... Use the Format.getRawFormat()
 
2:48 PM
I might've mixed up Format.getRawFormat() and Format.getCompactFormat()
 
@skiwi Are you using JDOM in Cardshifter?
 
Hope so ;-)
 
@SimonAndréForsberg Now I am
But I'm being a little bit evil
In the way I use it
 
Combining it with Jackson?
 
2:50 PM
No offense to @rolfl or JDOM, but I don't see any need for JDOM when there's Jackson...
 
They solve different things. Jackson is a persistence layer that can store objects in different formats.
JDOM is a model of XML.
JDOM would be a good 'engine' to have been used inside of Jackson.
 
@rolfl Looks like I need to do that yep
 
Jackson is a higher level of 'abstraction' than JDOM.
 
I could implement XML reading fully in JDOM, but that's not really fun and nice and all
 
No, but it would be even worse in DOM ;-)
 
2:53 PM
Something just tells me that @skiwi does something not in the way that it is meant to be done...
 
That sounds about right too ;;;---)))
 
I just need to get it working to get it reviewed!
 
What are you trying to accomplish that needs JDOM (and compact output....)?
 
Jackson cannot deal with tabs in empty elements
    <Cards>
    </Cards>
(Using spaces to illustrate)
However compact output gives:
<?xml version="1.0" encoding="UTF-8"?>
<CardInfo><Cards /></CardInfo>
 
@skiwi I'm sure it can, the question is just how.
 
2:57 PM
Not sure if it likes the <Cards />
 
You can set expandEmptyElements(true).
on the Format.
becomes <cards></cards>
 
Hoping that fixes everything then
Is there syntactically any difference between <Cards /> and <Cards/> or preference though?
 
Greetings, Programs.
 
Greetings, @Donald.McLean
 
that company what was looking to hire me, said that they can't offer me what I am making now, I would take a $6k a year paycut, but could advance quickly. and they could give me more experience in up and coming technologies where my current job can't..
if I wasn't tight on money I would have said yes right away....
 
3:05 PM
> Tests finished succesfully for project: cardshifter-core
5
All I wanted to see ^ !
 
I am just going to create a browser game and try to get some people donating to the game, and then create more, that way I get experience in ASP.NET then when I make another game I am going to do it in MVC so that I have that experience as well.
 
@skiwi no semantic difference
 
@rolfl Okay
 
3:24 PM
0
Q: Wrong Answer for Alphacode qustion Spoj

akhilQustion #include <iostream> #include <string.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { string n ; cin>>n; int i ; while(n[0]-'0' != 0){ long long int dp[n.length()+1] ; dp[0] = dp[1] = 1; // cout<<dp[0]<<" "<<...

 
Welcome to Code Review? Your title states "Wrong answer" are you looking to find a bug in your program? If so, this question is off topic for this site, unfortunately. — Phrancis 33 secs ago
Wrong punctuation lol. Fixed it on the question but not updating here...
 
Do someone know some online resources for Java 8 ? I would like precisely something that would be in the format of: Take this old Java code and transform it in Java 8, here is what you should have.
Bonjour @Phrancis!
 
Well asking for a Java 8 conversion would be off-topic since I'm asking for new code :P And I don't really have Java 7 code to review ! It's for a work presentation! I need to learn how to refactor to Java 8.
 
Idk @SimonAndréForsberg. I'm not sure this is the right place. Isn't that a "How do I do?" type of question?
3
 
3:39 PM
@Marc-Andre No work required. Java has free backwards compatibility.
 
@Unihedron I know... But using features of a language to increase readability is important . Some dev do not use for-each... I would like to change things here a bit
 
Yay! Another simple and quick review of mine is up on CR.
 
@Marc-Andre you could visit the Java room on chat.so
 
1
Q: Loading card data from XML file

skiwiFor our Cardshifter Project we wanted to be able to load card definitions from file. A card is defined as: Having an unique id. Having a set of resources, which are integers identified by a string. Having a set of attributes, which are strings identified by a string. In the implementation ev...

 

 Java

Dedicated to the discussion of the Java programming language a...
@Marc-Andre Yeah, LAMBDA EXPRESSIONs are the new stuff!
 
3:43 PM
@Vogel612 I was hanging in that room before, but there was not much activity (I've come here instead) !
 
@Marc-Andre What do they use then?!
 
@skiwi Good old for(int i = 0; i < list.size(); i++)
 
@Marc-Andre Ouch...
Well
Are they using the i?
The point is that Java 8 requires a whole new way of thinking
 
@Marc-Andre list.forEach(a -> eat(a));
replace eat() with actual method
 
2
Q: Loading card data from XML file

skiwiFor our Cardshifter Project we wanted to be able to load card definitions from file. A card is defined as: Having an unique id. Having a set of resources, which are integers identified by a string. Having a set of attributes, which are strings identified by a string. In the implementation ev...

 
3:45 PM
@Unihedron Exactly and working with stream look like a good thing too! We are using a tons of List and I'm sure it could reduce some fucntion
 
Given a List<Card> and an instance method Card#getId(), how would you return all cards with duplicate ids?
 
@Marc-Andre Well, behind the scenes they're just constructing new streams after streams as you chain the methods, so. shrugs
 
List<Card> cardList = cardInfo.getCards().getCards();
List<String> duplicateIds = cardList.stream()
	.collect(Collectors.groupingBy(Card::getId))
	.entrySet()
	.stream()
	.filter(entry -> entry.getValue().size() > 1)
	.map(Entry::getKey)
	.collect(Collectors.toList());
 
@skiwi You need the i for Object instance = list.get(i)
 
@Marc-Andre Well but if that's the only thing why you need to use it...
I guess they haven't heard about a ListIterator<T> ever?
 
3:46 PM
@Unihedron Well it still more readable in many cases!
 
@skiwi You can forEach that too. :)
 
If you gave them a LinkedList<T> they'd still use that old for-loop
 
@skiwi exactly!
 
@Unihedron Yeah, forEach is cool and optimized
 
@skiwi and uses dat indy instruction
 
3:47 PM
@Unihedron the bot doesn't join the room...
for whatever reason... the account doesn't show up..
 
I post a question mainly involving XML stuff... I don't tag it with , smart.
 
@Vogel612 But I made him a CR account!
 
Well so my point is I need some Java 7 vs Java 8 to train my eyes and brain to recognize the thing and know when to use it!
 
@Unihedron I'm not that advanced that I fully understand indy yet :(
 
@Marc-Andre Good idea! Practice does make perfect!
3
 
3:48 PM
@skiwi how did you make duga join the chatroom?
 
@Vogel612 I told him to join.
 
@Vogel612 He didn't. I did. Duga is mine!
 
Hold on, who's Duga?
 
@RubberDuck @Marc-Andre IMO, if it's a well written question and formulated in the form of "But I am not sure if it's possible to simplify these things now that Java 8 is around", then it's good and on-topic question.
My sock-puppet bot.
@Marc-Andre I can recommend reading the Javadoc for some of the new default methods. In most of them, it explains what exactly it does with Java 7 code.
For example: Iterable.forEach
    The default implementation behaves as if:


         for (T t : this)
             action.accept(t);
As for the new lambda syntax, understand the basic principles of it, understand when you can use it, and you're pretty much good to go.
 
@SimonAndréForsberg Good! I'll check that!
 
3:54 PM
@SimonAndréForsberg That's a good point... I guess it could be on topic.
All about how it's worded....
Which I still don't like by the way.
2
 
@Unihedron list.forEach(this::eat);
 
@SimonAndréForsberg it could also be TypeOfA::eat or this::eat depending on context
 
@SimonAndréForsberg The best way for me to learned it is to see it in action with this is A and here is B with the feature! I'm good a recognizing pattern in code.
 
@Unihedron that's what I said ;)
 
@SimonAndréForsberg My bad :)
 
3:57 PM
@Marc-Andre You could take a look at my Sudoku Solver written with Java 8 on Github. I could easily translate my C# code where I heavily used LINQ to Java 8.
 
@SimonAndréForsberg Did you pass from Java 7 to Java 8 ?
 
@RubberDuck Me neither. Technically I find all such questions on topic, but sometimes it's the asker who we should close, not the question. Some askers do need to learn more from tutorials in some cases IMO.
 
Unfortunately, we can't judge OPs, just their questions.
 
@Marc-Andre I never did a Java 7 Sudoku Solver unfortunately. But if you have a good understanding of C# then you could compare my C# code with the Java 8 code.
@RubberDuck Too bad.
 
I know.
 
3:59 PM
@SimonAndréForsberg Ok thanks! I'll look at it! And thanks all for the help!
 
00:00 - 16:0016:00 - 00:00

« first day (551 days earlier)      last day (3468 days later) »