« first day (379 days earlier)      last day (3643 days later) » 
00:00 - 22:0022:00 - 00:00

12:52 AM
0
Q: Optimization of Matrix determinant calculation in C

AndreaFI have this algorithm that calculates matrix determinant using recursive divide and conquer approach int determ(int a[max][max],int max) { int det=0, p, h, k, i, j, temp[max][max]; //base case omitted for(p=0;p<max;p++) { h = 0; k = 0; for(i=1;i<max;i++) { fo...

 
1:24 AM
0
Q: How to avoid making the call to the servers whenever it is down?

WebbyI am working on a project in which I am constructing the url with right and valid hostnames (not the block hostnames) and then execute that URL using RestTemplate from my main thread. And also I have a single background thread in my application which is parsing the data from the url and extractin...

 
1:43 AM
0
Q: Caesar Cipher in Haskell

Kevin MeredithLearn You a Haskell presents the Caesar Cipher: The Caesar cipher is a primitive method of encoding messages by shifting each character in them by a fixed number of positions in the alphabet Here's my implementation: import Data.Char (ord, chr) encode :: Int -> String -> String encode...

 
2:01 AM
0
Q: Function Composition: $ versus `.`

Kevin MeredithLearn You a Haskell offers the findKey function: Here's the book's implementation: findKey :: (Eq k) => k -> [(k,v)] -> v findKey key xs = snd . head . filter (\(k,v) -> key == k) $ xs I implemented it with $: findKey' :: (Eq k) => k -> [(k,v)] -> v findKey' k xs = snd $ head $ filter ...

 
2:32 AM
0
Q: Scheme: Counting types of structures

Hassan(count-by-type (list (make-animal "Slytherin" "snake" (make-date 2013 8 23)) (make-animal "Toby" "dog" (make-date 2014 3 20)) (make-animal "Curly" "dog" (make-date 2014 1 18)) (make-animal "Maximus" "cat" (make-date 2013 10 7)) (make-animal "Mia" "cat" (make-date 2013 10 7)))) => (list (list 2 "c...

 
3:29 AM
@skiwi that looks like fun....
 
0
Q: memory allocation on stack

uptonHere is a sample start of function reversed from a easy program. My question is that why memory are not allocated consecutively and some parts of the memory are not used? In sub esp, 70h, the number 70h seems a random number in different program and it is often larger than we needs. Why not t...

 
vnp
3:52 AM
Good time of day!
 
 
1 hour later…
5:20 AM
0
Q: Validating C++ Time class objects

Deepak SinghI created a Time class. Now I want to modify the code to perform input validation. Hour should be between 0-24, minutes and seconds between 0-59. If class need improvements, please offer suggestions. Time.h Header File #ifndef TIME_H #define TIME_H class Time { private : int hour; ...

0
Q: GameBoy Advance objects not being displayed in correct place when player is moving

user3573439This might take a while to explain - go grab a snack while you're reading this. I am developing a 2D puzzle platforming game for the Gameboy Advance in C++ (I'm a fairly new programmer). Up until last night, I have been making a phyics engine (just some axis aligned bounding box stuff) which I w...

0
Q: ruby code gets syntax error, unexpected keyword_end, expecting end-of-input

user3648577When I run the ruby sftp file sync code bellow, I get: box_lin.ru:46: syntax error, unexpected keyword_end, expecting end-of-input I've added end's in various places, and cannot find the syntax problem with quotes or parentheses. Help is greatly appreciated! require 'net/ssh' require 'net...

 
 
1 hour later…
6:30 AM
0
Q: Next Steps in building Java Pacman game?

user2279952I'm the 10th grader who posted the first version of Pacman on here a month ago. I have gotten this far in building Pacman. However, I am now stuck on building the dots. I'm not quite sure how I would do that. The current code I have isn't using Java swing, it's using awt, which is swing's more ba...

 
 
1 hour later…
7:58 AM
0
Q: Test whether a type T is among the types of a tuple

Nikos AthanasiouIn SO I asked for a way to do it without variadics. I also provided a typical "normal" implementation with variadics : template <typename V, typename T> struct Is_in_tuple; template <typename V, typename T0, typename... T> struct Is_in_tuple <V, tuple<T0, T...> > { static const bool value = ...

0
Q: is the this the correct way of using oop?

user3649186in this code i tried use use html tags as my own way in php using objects the question i want to ask is that , that is it the correct method of writing or implementing oop if no so what is the best way to write such type of codes any of the answer will be appreciated <?php class HTMLCoding...

 
8:39 AM
0
Q: How should routes be used in PHP structures

jakeI started using Aura.Router, the library is aweeome allowing me to match anyrequest. Nowhow i made it work Is, i use front controllers so each request should lead to a controller. So i decided to make a php file which will return an array of my possible routes, basjcally it will return all route...

0
Q: Huge Form Object

user42696Im currently working on a form object implementation and Im about to take a step back and refactor the whole thing. My preference is to break this thing out into a number of files rather than having this one big one. Im wondering about the most sensible approach to doing this. Heres my working co...

 
 
2 hours later…
10:51 AM
No activity here fore 6 hours? That's gotta be some kind of record.
 
@SimonAndréForsberg Lucky you, I just got here :)
 
@Morwenn I haven't been here that much the past two days. Have I missed anything?
 
@SimonAndréForsberg There are three stars on a messages saying that I showered, so I guess that you didn't miss anything meaningful.
 
0
Q: Get the value of the highest Key in JavaScript object

user40171Given a hashmap (or a "Dictionary") as a JavaScript object, I'd like to get the value who has the maximum Key - assuming the Keys are integers. In case there's more than one, I don't care which one of them. Considering var b = { '1': 9, '2': 7, '3': 7, '4': 9, '5': 3 }; I can extract the des...

 
@Morwenn lol, I guess not :)
 
11:08 AM
Monking to all....
 
Monking monkey :)
 
Monking monkey
 
Sore all over ... reassembled furnarure, and installed 21 handles on drawers... 42 holes, but had to countersink from back too.
Got more family commitments today... like breakfast. Back again later.
 
11:32 AM
Morning
 
Well, it's almost the same
How are you?
 
0
Q: Drill through and down the object properties with RTTI

Marko PaunovicI am in process of making debugging output better for client-side application. We have lots of auto-generated Protocol Buffers classes which are used for communication by our protocol. I am trying to make an function that would enumerate properties in any TObject passed to it, and return JSON-al...

 
11:50 AM
I feel a bit tired for some reason, otherwise good ^^ You @skiwi?
 
Tired... but recovering, some stuff hapened over last days so wasn't really feeling energetic, but I'll be back, stronger than ever ^^ Now hoping I got some time for the TCG today, I really want some kind of playable version
Also, you might be interested to read this: mail.openjdk.java.net/pipermail/jdk9-dev/2014-May/000720.html
 
0
Q: Is it better to use ARGV than gets?

user42702I'm learning ruby here: http://ruby.learncodethehardway.com: Use only STDIN.gets and try the script that way. Think of why one way of getting the filename would be better than another. According to this site: http://www.mkltesthead.com/2011/11/exercise-15-reading-files-learn-ruby.html W...

 
@skiwi Thanks. Quite interesting
 
Hmmmmmm
 
Are we going down??
 
Very much so
 
Too many exploding bear traps, perhaps
 
12:36 PM
0
Q: Implementing an advanced real-time particle system in python for video games

user3002473I've been working on a game for a little while in python and whilst doing some research on particle systems I came across this video, which certainly struck my fancy. Would it be feasible to implement something like this in video game, in python? It seems like a stretch, and I have my doubts that...

 
My rep is 13,337
almost 1337
 
S0cul!
And, I have one vote left for today.
 
12:55 PM
@CaptainObvious That question is actually off-topic.
 
Agreed.
 
Yet another incoming off-topic Python question.
 
0
Q: My code is supposed to triple all values listed, but it can only take one at a time, how can I fix this?

AustinMy code def tripleAll(nums): for trip in [nums]: new = trip * 3 print(new) Then I would call the function with multiple numbers, like so. tripleAll(3, 6, 7) But, when I do this, it says it can only take one positional argument. How can I make it so it takes multiple?

 
0
Q: My code is supposed to triple all values listed, but it can only take one at a time, how can I fix this?

AustinMy code def tripleAll(nums): for trip in [nums]: new = trip * 3 print(new) Then I would call the function with multiple numbers, like so. tripleAll(3, 6, 7) But, when I do this, it says it can only take one positional argument. How can I make it so it takes multiple?

 
Monking everyong
 
1:01 PM
I can't believe it, @CaptainObvious beat me to it o__o
4
@Vogel612 Monking :)
 
awww @Morwenn are you getting old?
 
@Vogel612 I feel unlucky :(
Guess that I will simply resume coding my semisymbolic math lib then.
 
Huh, take a look at who's a CR member:
 
Oohhh .... close to archeologist.
 
1:20 PM
0
Q: manage a collection of settings in memory with global scope

BalanikasI have a wpf app and a bunch of read/write settings that need to be accessible from various viewmodels. a setting can be any type (string, bool, etc) and all are settable, but only from a 'Settings' view. I also need the viewmodels to be notified when any setting has been updated and which one th...

 
Refactoring time! 24 errors all of a sudden :)
 
1:34 PM
I broke C++. I am comparing types with operator==.
 
@Morwenn - I believe you are taking more responsibility than you are permitted to take.
C++ was broken before you got to it.
2
 
couldn't have said it better myself ^^
 
They improved brokenship with std::integral_constant and user-defined literals in C++11.
I created a Constant<typename Int, Int N> type.
When I write 24_c, it creates an instance of Constant<int, 24>.
And I can write 2_c + 3_c == 5_c and it works.
2_c + 3_c creates an instance of Constant<int, 5>.
And the comparison expression returns a Constant<bool, true>.
 
Ahh, so that is what the ++ means on C++ .... the brokenness is incremented!
 
And that Constant class is only the beginning. The next step is to create expression templates.
 
1:41 PM
Is the constant instances created at runtime, or "during" compilation?
 
The last step will be to create specializations of unreadable expression templates to perform symbolic mathematics and simplify expressions whenever possible..
 
I sure hope you know what you're doing, @Morwenn :)
 
@SimonAndréForsberg I belive that the compiler does it maximum at compilation.
 
Because I have absolutely no idea what you're doing.
Cool. I guess.
 
^^^I'm with 'stupid'.
 
1:43 PM
The idea of the library is that:
 
you can dynamically add two constants to make a third....
 
a * b + c actually calls std::fma(a, b, c) for example.
 
Fused multiply add.
 
Oh, I thought it was F**k my algorithm.
4
 
1:44 PM
An operation that performs a * b + c but without intermediate value, and therefore reduces rouding errors with floating point values.
 
So why call std::fma instead of a * b + c? Is it some kind of atomic operation? ... I believe I just got the answer.
 
I figured the real value was the performance, and SIMD friendly nature.
 
The Constant class is useful to replace at compile time std::exp(x-1_c) by std::expm1(x) for example.
std::fma is not guaranteed to be faster, but it is often faster.
But since my library probably does additional copies, unless the compiler is really good at optimizing expression templates, I will lose speed anyway.
So the overall aim is not to provide faster implicit operations but safer implicit operations.
Though the main reason for this lib to exist is that I wanted to try using expression templates in a project.
Now, I'll be taking my leave. There is some coffee and fresh madeleines waiting for me :p
See you later :)
 
Bye Bye.
 
Sounds like I should stick to Java :)
3
See you Morwenn
 
1:52 PM
@SimonAndréForsberg definitely easier to stick with Java ;)
 
Not just easier.
 
0
Q: SIngleTon PDO Wrapper problem, showing 2 PDO

GAURAV MAHALEplease someone tell me is there any wrong with SingleTon, because when i do this example: $calll = CONN::Instance(); var_dump($calll); it shows PDO 2 and CONN 1 what it means, is there is something wrong with it. class error_reporting(E_ALL); trait SingleTon{ private static $instance = ...

 
2:53 PM
@SimonAndréForsberg I am pretty sure that it is possible to do things even more horrible with Java runtime reflection :p
 
0
Q: C++11 std::tuple objects or rvalue references?

tower120I have some small "plugin system" (not sure this is right name). It allow you to store objects (plugins), and then call some methods from each of them. With this approach we have absolutely no overhead on iterating/object pass/callback call. // Need this SET, because in C++11 auto can only be s...

 
3:17 PM
0
Q: CPP Problem with load items and equip

Jerry95Hi all i have a problem with my code: //main.cpp #include "main.hpp" #include "Character.hpp" int main() { CCharacter Player; CItem Items("",0,0,0); Items.loadItems(); Player.equipItems(); cout<<Player.p_rightHand->name; return 0; } //main.hpp #include <iostream> #include <...

 
afternoon
 
@Morwenn I'm sure it's possible, but there's a big difference between being possible and being done.
Afternoon @kiwi
 
@skiwi Welcome!
@SimonAndréForsberg I'm pretty that some obscure guy created some obscure library that would make you cry with runtime reflection :)
 
@Morwenn Oh yes. That I'm sure of :)
 
@rolfl What is the fun in making that SEDE query...
 
3:30 PM
0
Q: Optimizing this SVG animation for size

jb.I'd like to code review generated svg animation, while this might stretch definition of this site, I really hope this is interesting and revelant topic, as this SVG file is really like any other programming language. I'd like to display certain physical phenomenon, here is example of generated ...

 
@Morwenn You have no clue what horrendous things I can do with Java.
 
@skiwi I have plenty of clues: you spend a considerable amount of your time sharing bits of your code here :)
Therefore, you're an obscure guy :D
* your
** just wanted to see some people cry
2
 
But I'm sure I could way more horrible things in C++
 
*ahem* *segfault* *ahem*
 
I'm still figuring if I should make a console GUI or a dumb-GUI as first interface ot my TCG
 
3:41 PM
@rolfl Oh yeah? Well, Java is coffee! And... coffee rocks. Dammit.
 
@Vogel612 I you segfault, you're not doing horrible things. Actually, you're not even doing proper C++ :p
Off-topic:
0
Q: Overloading increment for class timer. Some errors while debugging

DNillaI wrote a code for overloading prefix and postfix increment for class timer. When I debug, it says about some problems. #include <iostream> #include <conio.h> using namespace std; class Timer { private: int minutes; // 0 to 59 int seconds; // 0 to 59 public: // requ...

 
@skiwi Stop figuring. Start making!
 
@SimonAndréForsberg Well tell me! Because I usually start with simply console UI, but that is rather hard for a TCG
 
@skiwi What's the problem of making a console UI? After each action/turn, you print the state of the current game (cards in your hand, cards on battlefield, number of cards opponent has, etc.), and you can just use some pick-a-number to play a card, or to fuse cards or whatever features you have
 
0
Q: Designing simple state machine in C++

vBxI have designed a simple state machine for the following diagram: I am seeking improvements from the community. I don't like especially two things: 1. When calling performAction I wan't to send only the action without the callback. 2. And maybe remove the Action enum from the Engine class. ...

 
3:47 PM
@SimonAndréForsberg But don't you already want to know it after you draw your card? As further actions of that turn are based upon that... And do I show both players info, or just the one that is currently playing?
That is where my brain is currently stuck at.
 
@skiwi You show the info that the current player is able to "see". And of course, you can show the info when a card is drawn. I assume you will write a method specially for showing the current state, and then you can just call that method from anywhere you want
 
I guess I should just do that
 
@skiwi Something like that ^^ From zomis.net/cards/ZonesCardsGWT.html
 
You have a GUI at least
 
Making it into a console UI wouldn't be much different
 
3:51 PM
I like when I click on something, and then it says "Unclickable" :D
 
Yeah, I know :)
At first I used real Buttons but then I had to change into <div> elements because I wanted a more flexible layout
 
Btw, you know you can make functional interfaces with more than one abstract method?
@FunctionalInterface
interface Test {
    void test();

    boolean equals(Object other);
}
 
Ah, but boolean equals(Object other); is technically not an abstract method.
That's just an @Override of the method inherited from Object
 
You are smart
 
And it's not possible to remove the default implementation
 
3:55 PM
I hope not :p
 
So the interface you have there is the same as:
@FunctionalInterface
interface Test {
    void test();
}
 
Except that I can override the javadoc ;)
Which is exactly why Comparator does it this way
 
0
Q: Java software design

user2405469Sorry if the title of the question isn't very accurate, I feel it is. I was thinking about something today and coded up a quick example. I created this abstract class: public abstract class MeasurementType { protected String name; protected String[] units; public MeasurementType() {} ...

 
I suppose I should add the ability to place cards on the field ;)
 
@SimonAndréForsberg I have a crude draft of some rules, if you're interested.
 
4:03 PM
@CaptainObvious I'm on it
@Donald.McLean Sure! Start a room with me, I'm just going to review a question and then I can take a look
 
@CaptainObvious Nah, the title could be more accurate.
 
My whole design doesn't make much sense here in this part I'm working on :(
I guess I need to hardcore more and perhaps refactor later to avoid brainoverflow.
 
@skiwi What design?
 
@SimonAndréForsberg I had made it such that players had a fixed list of actions in every turn... but that's just broken
 
@skiwi Yes, make it work first, refactor later. That's a good idea. I'm doing some refactoring myself today.
@skiwi Yeah, that doesn't sound optimal... But, that depends on the game I guess..
 
4:16 PM
hey... my players don't have names
 
Has Anonymous been to this room yet? He's pretty good. At this rate, he may become one of our top users.
 
I feel like a Java noob working with System.in
 
4:32 PM
@Jamal I suppose he wants to stay... well, anonymous.
 
Touche
 
hahahahahaha
 
lol
 
^^ starring monkey's "real" lol
 
Yay, my game is somewhat playable... though I can't attack yet
 
4:38 PM
@skiwi At least it was a step in the right enum Direction { FORWARD, BACKWARD; }
 
Now I've worked enough to get some food
 
5:12 PM
Subtypes propagation with expression templates... that's horrible.
 
@Morwenn Subwhat what with expression what?
 
@SimonAndréForsberg subtypes = class scope types.
 
(Although I understand the words one by one, I absolutely have no idea what they mean together)
 
@SimonAndréForsberg Expression templates = unless you do C++, you'll probably never understand :p
 
5:16 PM
Good ^^
 
Expression templates are a way to create compile-time expression trees directly with templates.
Of course, templates were never designed with that in mind.
 
"Algebraic data types. Data types like Optional<T> or Choice<T,U> should not need an Object box. Many such types (especially product types like tuples) have natural representations in terms of small identityless aggregates. Unit types (both void-like and metric) are sometimes useful, but only if their footprint overhead can be driven to zero."
 
@skiwi Seems that they are going in the right direction. That's great :)
 
Their ideas are really interesting... It will practically mean that Integer <==> int in terms of performance, etc.
 
And then I saw the pantheon
 
5:22 PM
I have to go - once again, seems that I can't stay in front of a screen too long -, see you later :)
 
tatata
 
"(This implies that interfaces may sometimes claim subtypes which are not also subtypes of Object.)" This paper is really in the correct direction.
 
0
Q: Using RequireJS correctly

RichardI'm a beginner in Javascript and lately I've been trying things with RequireJS, I'd like to get some feedback on how good/poor my code is and in what ways it can be improved. My example below is just loading up social plugins - Facebook Like/Share, Twitter Tweet & Google +1. The code is function...

 
5:40 PM
0
Q: The timer() method is working faster every time

tabrizI am trying to draw an arch according to time changing that is after every second the arc will be drawing and for that I have used timer.schedule() but it is not working as expected. The speed of drawing the arc is getting faster every time. And i have written the code inside onDraw() method. I h...

 
Hello, @tabrez.
 
5:55 PM
@tabrez only has 1 rep so he can't say anything
 
Oh yeah
 
0
Q: Pretty print with unit and physical suffix II

Torsten2001Follow up of Pretty print with unit and physical suffix My first code didn't process negative numbers correctly. Additionally I tried to use all of the helpful input to come up with this solution. I considered: precision testing spacing tips P.S.: I use the 'u' instead of U+03BC because I h...

0
Q: Social Media Hashtag Splitting

Alex LSo I decided to try out Python (3.x) two or so weeks ago, and this is my first real script using it. The program I've written below is slow, clunky, inefficient, inaccurate, and probably poorly coded! But it produces what I want most of the time, and it was really just a project to become accusto...

 
6:34 PM
@SimonAndréForsberg You think an eventbus-ish way to represent input requests is good?
 
@skiwi Doesn't sound very good to me, but I'm not sure how you're thinking there exactly...
 
I've got the following very basic method:
String command = scanner.next();
switch (command) {
    case "end":
        break;
    case "put":
        System.out.print("Index of card in hand: ");
        int handCardIndex = scanner.nextInt();
        System.out.print("Index of monster on field: ");
        int fieldCardIndex = scanner.nextInt();
        new PutMonsterOnFieldAction(handCardIndex, fieldCardIndex).performAction(this);
        break;
    default:
        System.out.println("Unrecognized command");
        break;
}
(part of Player class)
And I suppose those requests for integers could be replaced by something like bus.askForRequest(new PutMonsterOnFieldRequest()) (very bad names atm)
 
why is command not an ENUM??
shame on you @skiwi ;)
 
@Vogel612 It's called prototyping!
 
lolz...
btw. how is that with the tests now?
 
6:46 PM
I found that my example (the Hand integration tests) were not complete yet... and I would want to finish those before putting them on github
So I'm stuck on that atm, which is something I'll need to just do at some point soon ;)
 
so I gotta wait before I may rewrite them for the other classes??
 
I think that would be better yes, I'll look if I can do it later today, when I'm done reading this thign about future value types in Java
 
well I will be busy every friggin day next week, so it may be better that I can't start yet ;)
 
hehe
 
the play where I am in is going to go on-stage this saturday...
 
6:50 PM
Also once the project has some more shape, I figure that you can build as many custom UI's and players (new AI, networked players, etc.) as you want, and of course you can add custom cards
What "play" you mean? Might be a bit of broken translation I'm afraid
 
theater
just like Shakespeare
 
Ah... lots of rehearsals?
 
yes.
helluva lot.
every day from 18:30 to ~ 0000
 
And that's besides your normal school
 
well I'm trainee..
so It's not always school..
but, yeah..
<-- has to show up at 0900 at work
well if I want to shower, I have to get up at 0800 for that, so It's fine ;)
 
6:54 PM
So the amount of sleep is still regular ;)
 
round about, yeah..
given the case, rehearsal is really just until midniht..
 
I really need to read up on the JVM bytecode as next big learning experience... Though I suppose there aren't any tutorials out there for programming in bytecode :D
 
last one was til 0030, the one before to 0130...
you are crazy...
 
perhaps I am
 
we all are a bit, #amirite?
 
6:57 PM
Every is crazy in some way or another
 
@skiwi Those who leave words out of sentences are the craziest of all.
 
That is a nice observation. How about recommending a consistent behaviour, or showing the benefits and drawbacks of the respective approaches? That would make an even better answer ;) — Vogel612 14 secs ago
damn I should stop listening to good music with these
 
That is an interesting t you have there ;)
 
lolwat..
ŧ ubuntu OP..
instant random characters:
i → →
u → ↓
 
@Vogel612 I recommend 801s
 
7:07 PM
â•©â•©â•©
 
µy µy µy, ŧħæŧſ ni¢â‚¬
 
∀x ∈ People : Crazy(x)
 
@JerryCoffin I think these are unaffordable for me..
 
@Vogel612 Me too. Makes them easy to recommend--never any backlash or fallout from it, because essentially nobody can (or at least will) afford them.
 
you evil genius..
 
7:15 PM
And now my brain knows even more
 
Almost 500 rep on SO. :D I just need a few more edits.
 
@skiwi - I am working with marcel on a few things.
related to packed objects.
 
@rolfl Sounds very interesting
 
and packed-objects are available as a 'feature' on IBM's Java7 JDK.....
There are a number of specific technologies that are suddenly much more accessible with Packed Objects.....
And the path-length for low-level communication is significantly shorter.
 
@skiwi Problem is that an EventBus is normally used for when something has happened, I've never seen it used for requesting for input
 
7:28 PM
@SimonAndréForsberg That's why an EventBus might not be the best analogy... But else I would resort to using an interface like PlayerRRequests for input... Which leads to the same method explosion as there was with listeners, hence why the eventbus solution came up
 
@skiwi Wikipedia has an excellent article somewhere about the JVM bytecode.
 
@skiwi "appropriately concise", "robust performance"? I'm gonna have to vote that reading this actually reduced my intelligence.
 
@JerryCoffin Well... your brain is more experienced, and mine is still under-experienced, hence almost all I read will increase its experience I bet :p
 
@skiwi In my mind, requests aren't being sent for input, the input just happens. Think of a regular Swing frame: Do you call a method to request a button click input?
 
@SimonAndréForsberg That's a good point that I may have erred. How would I solve that in a both console and GUI unified way?
There's still som eof my arguments leftover though... Suppose you initiate an attack on another card, the first input just happens (clicking on your monster on field), the second input though is asked for (the enemy monster on field), the latter is more what the qustion was about
 
7:34 PM
Ah, that's what you mean...
There's two main approaches there that I can think of: a) You let the GUI remember the "attacker" card and when the second card is selected, you pass the complete attack request to the game. b) The game itself remembers that you clicked on the first card, so when you click on the second card the game performs the attack.
@skiwi GUI: As usual, addEventListener and stuff. Console: You probably need a loop somewhere that asks for input. I don't see any way to make these things "unified" though.
 
My actions themselves need full input in order to operate, so that would mean option a) there... game (model) and GUI should be seperated
 
JvR
Door (A) seems like the one to take, yeah.
 
0
Q: Does my controller code look good?

Sharikov VladislavI read many times about controller code mustn't be too complicated and so on. I was developing new features in my simple project. I added a function, which allow users to get access to news only in one specified category. Now, if a user writes some of this URL: /news/common /news/sport /news/fi...

0
Q: Generic callback object , but I need the type parameter inside methods

nPnInside my android app, I currently have methods that look like this. Since they all need a callback object that basically does the same thing, I would like to try to eliminated the duplicated code seen below. The object that gets posted via the mBus.post(response); statement needs to be the spec...

 
@SimonAndréForsberg So onto point a), that means that the current way I'm doing it in the console is actually correct? Apart from that it is pushed inside the Player class, and not the console or GUI...
 
@skiwi I would say so, yes.
 
7:49 PM
Though I still want to get the input-related code out of the Player class
 
Yes, you should.
 
So I still got no progress on that :(
 
Feeds are taing over your room!
 
JvR
8:05 PM
We must fight back aggressively.
 
1) We usually are not interested in your delivery dates. 2) If you do not have a real question, maybe you should move the issue to codereview.stackexchange.com — SJuan76 48 mins ago
Here we go again.
 
Hello! For the fourth time today :)
 
@Jamal sigh The user self-deleted the SO post.
 
0
Q: Calculating the number of boxes that can fit into the back of a truck

DatLumberZachThis code calculates the number of boxes that can fit into the back of a truck. All of the dimensions are user defined and the answer is rounded to the nearest whole number. I want to have the program consider the orientation of the boxes in the calculations as that is something that my professor...

 
@CaptainObvious Yes, we know!
 
JvR
8:11 PM
I was waiting for Captain Obvious there. xD
 
@hichris123 And it was after I made that comment, too. I'm not sure I should migrate this one, though.
 
@DatLumberZach Yeah... those people don't know what Code Review actually is. Code Review is for reviewing working code, not fixing problems in the code. — hichris123 8 secs ago
... that's my way of nicely saying they were idiots. :P
 
And this is why CR may will never be a migration path for them.
 
fixed that for you, @Jamal. :P
 
0
Q: Ruby: optimize a zscore algorithm

DaniG2kI wrote a zscore algorithm in Ruby that runs fine, but is incredibly slow when I have 8000+ entries to score. Can anyone help me figure out a way to improve my code please?? module Enumerable def mean reduce(:+).to_f / length end def sample_variance sum = inject(0){ |acc, i| acc...

 
8:18 PM
@hichris123 Just being nice. ;-) But you're right.
 
JvR
Nice is good.
 
Post has been migrated, and perhaps SO will read the leftover comments. This is really getting tiring.
 
@Jamal You know they won't. That's... just the way SO is.
 
Is it just me or is the atmosphere a little bit more violent than some months ago on CR? :/
 
JvR
Violent?
 
8:21 PM
@Morwenn There's a little more hostility toward the parent, so to speak.
 
JvR
<-- is new.
 
@hichris123 I know. :-/
 
@JerryCoffin Hum. You're right.
 
@Morwenn As a site, we've hit the rebellious teenager phase. Should be graduating soon now...
6
 
YOLO
 
8:24 PM
@Jamal Yeah, SO is rough. I still like it, but it can get... downright rude, annoying, etc. I mean, people were complaining about "repwhoring" in SO chat... it's just not very fun if you're participating in such questions, and see people being rude like that.
 
SO is hardly for me, but is my next-active site below CR.
 
JvR
I was on SO for a little while. Felt like the Wild West on 'roid rage. o_O I don't get how people get anything done (or done well) there.
 
Hardly my cup of tea, I mean.
 
Heh, you're user 22222 on CR, @Jamal.
 
@JerryCoffin Do you mean that CR is slowly becoming SWAG?
I thought that PCG was our teenager counterpart.
And that we were on the mature side :p
 
8:26 PM
@hichris123 Having a palindrome as an ID is awesome. :D
@Morwenn We are. ;-) We make code good and they make code bad.
 
@Morwenn They're our evil twin.
 
Nobody would ever graduate with PCG-style code :D
 
wonders if I need to get Doorknob in here
 
JvR
graduating = coming out of Beta?
 
@hichris123 He already comes from time to time :)
 
8:32 PM
@JvR Yes
 
@Morwenn Yeah, but you're doing PCG bashing!
 
@hichris123 That's friendly bashing. We also love them ^^
We are the only two SE sites with "code" in our name.
 
@Morwenn ... sure. :P
 
Knowing too much makes you a slow coder...
 
@DatLumberZach Sorry if I wasn't clear in my post on your old question: Code Review is for working code that needs improvement and CS is for conceptual questions. What you're asking in your current form is not going to be answered on any network because it is essentially asking for someone to do your homework for you, which is not well accepted anywhere. You saw how the Code Review people handled it, but they didn't really read your question because it's asking for an explanation, not saying that the code doesn't work, which is what they likely assumed: it's not on-topic here, either. — AstroCB 13 mins ago
 
JvR
8:38 PM
@skiwi Too many things in your head?
@Jamal Oh, it's on. It's on like Donkey Kong.
 
This question appears to be off-topic because it is about doing the OP's homework. — Ali 28 secs ago
sigh
 
@JvR It just rules out so many possibilities of code you may write, because they are violating some principles, and you don't always know the correct way to solve it... I figure I'm in the early learnign stage where I don't have the experience yet to easily counter all those issues
@hichris123 What, no downvotes? The java community on SO is a little more strict on that I think... Specifically the
What about creating homework.stackexchange.com? One site, no rules. (Apart from spam, insults, etc.)
 
Nah, because here's the key to homework questions: they're either crap, or, if you didn't put the word homework in there I wouldn't know it's a homework question.
A question is not off-topic because it is asking about homework (except on Physics and a few others), but it's off-topic because it's crap.
 
JvR
@skiwi If a principle is what stands between you and working code, then I say go ahead. The only way to write cringe-free code is to write no code. :p
 
There's a difference.
 
8:42 PM
Well... It could be our litter box
And I'm sure even people would repwhore for their imaginary internet points on homework.SE ^^
 
JvR
Yeah, but if I do it in RL, I get paid for it.
 
That's why none of the sane people here would answer things on homework.SE.
 
JvR
Java would really benefit from an operator like: final String text = input || "default".
 
@skiwi Programmers.SE was originally created primarily for the programming questions (such as these homework ones) that weren't topical on SO. For a while, it had interesting conversations, but fairly poor average quality level. Then they started closing roughly 60% of questions that were asked, including almost all that fit its original intent. It's been stuck in that mode for quite a while now.
 
@JerryCoffin I know what you mean :/
 
8:57 PM
@JerryCoffin Which is a good thing.
Programmers... was crap before that, from what I can tell.
 
Anyway, questions are sometimes closed too fast.
 
@Morwenn Examples of violence?
 
@hichris123 I'm not at all sure I agree. It's true that there were some pretty worthless questions, but I think now they're throwing out the baby with the bathwater. Many of the worst questions are gone, but so are almost all the best ones.
 
@SimonAndréForsberg "Violence" was too strong of a word. But sometimes, it seems "less kind" :)
 
@Morwenn I'd still like to see examples. I really prefer CR as a friendly site, I always try to be friendly in my comments (unless the user pretends to don't understand). I understand if you don't want to point any fingers though
 
9:07 PM
@SimonAndréForsberg I don't have specific examples. It's more of a feeling. Sorry for that :/
 
@Morwenn It's OK :)
 
JvR
+1 CR is a friendly place to be. Thanks to everyone for making it so. :)
11
@skiwi About that getting slower the more you know...
338
Q: Overcoming slow problem solving due to increased knowledge of what might go wrong

ZilkThis has been troubling me for some time, and I'd really appreciate the input of other professionals. Short background: I started programming when my parents bought me my first computer in 1988 (at age 14, I'm 39 now). I followed a couple of other career paths before finally becoming a professio...

 
@JvR I just gotta pin that :)
 
I'm getting lost with my expression templates.
 
@Morwenn ^^^^^<----- You are here
 
9:19 PM
 
It's hard to draw an up-left facing arrow in chat.
 
JvR
@Morwenn Gotta love that big script block in that page.
 
0
Q: Is it a bad habit to align equals signs when assigning values to multiple variables?

NateI have a habit of aligning equal signs when assigning values to variables or indexes in arrays. For example, instead of doing this: $data['foo'] = ''; $data['fooBar'] = ''; $data['reallyFooBar'] = ''; $data['fooVar'] = ''; I'll do this: $data['foo'] = ''; $data['fooBar'] = ''; ...

 
@CaptainObvious It's already dead.
 
Haha, I am surprised everytime I compile template-heavy code and it works.
 
9:35 PM
 
JvR
@DavidHarkness I wonder if he's the top score for jquery...
I'm off for tonight. Cheers, everyone!
 
@JvR good night
 
0
A: In a C++ class and can't figure out whats wrong with my code. Involves functions & if/else if statements

Jamal This is wrong: area = double area (double length, double width); You're returning the value from area(), not declaring it. Just call the function: area = area(double length, double width); Your calculation in area(double radius) is incorrect: area = PI * (radius * 2); That is calculatin...

Even my few SO answers can sometimes seem review-y. :P I also just noticed that the OP invalidated everyone's answers, so I've suggested a rollback.
 
2
Q: Finding the sum of all the multiples of 3 or 5 below 1000

henginyAs a LISP (and FP) newbie, I wrote the following code that finds the sum of all the multiples of 3 or 5 below 1000, and I suspect that it is lousy: (defun multiple-of-3-or-5 (x) (or (eq (mod x 3) 0) (eq (mod x 5) 0)) ) (defun generate-list (min max) (cond ((> min max) nil) ...

 
9:51 PM
1
Q: What is wrong with this solution? (Perm-Missing-Elem codility test)

user2956907I have started playing with codility and came across this problem: A zero-indexed array A consisting of N different integers is given. The array contains integers in the range [1..(N + 1)], which means that exactly one element is missing. Your goal is to find that missing element. ...

Am I slow today, or are none of the answers in PHP?
 
We just lost our favorite monkey :(
 
0
Q: BaseRepository for EF6. Is it well?

Roman public class BaseRepository<T> where T : class { private readonly DbContext _dbContext; public BaseRepository(DbContext dbContext) { _dbContext = dbContext; } public T Get(Func<T, bool> predicate) { return GetAll(predicate).FirstOrDefault(); } ...

 
00:00 - 22:0022:00 - 00:00

« first day (379 days earlier)      last day (3643 days later) »