« first day (567 days earlier)      last day (3452 days later) » 

12:07 AM
Yeah. Kind of. Turns out I can only keep up with one chat room.
 
12:37 AM
0
Q: Octree code performance

joe63074I'm using a simple Octree in my program, wanted to know if my implementation could be faster. struct node_t { float value; struct node_t *child[8]; }; struct node_t *root; void Octree::write(const int &r, const int &g, const int &b, const float &value) { struct node_t ...

 
12:50 AM
0
Q: file input and sorting averages

spyr03So far I have java code that will: 1) take in two .csv files 2) store each line as a string in a string array 3) split it into a 2d string array where a comma would act as the separator 4) sum the number found in a column with all the other numbers that share the same number in the column next to...

 
1:11 AM
0
Q: Determining coefficient in geometric progression

Nikolai NaidenovFor an assignment at Uni we had to code a program that takes numbers as input and determines the coefficient if they form a geometric progression once you declare EOF (ctrl+z). If the user inputs a number that doesn't belong to an already established progression the program breaks, telling us the...

 
Let it be known to all: writing VBA on a Mac == sucks.
The IDE is crap. What with all those floating windows... come on.
in VBA, 36 secs ago, by RubberDuck
We're vba devs, we like pain.
 
2:10 AM
0
Q: Tic Tac Toe CMD

Joshua RitchieIm making a command line version of Tick tack Toe for my class yet I keep running into the same problem it keeps stoping after player one take his first turn no player 2 no call back to player one nothing. So I was wondering if you could point me in the right direction. This is the code my class ...

 
 
1 hour later…
3:35 AM
0
Q: C compiler macro error when used multiple times

DougMy C compiler gives me a warning when using the following "squaring" macro: float arg; #define SQR(a) ((arg=(a)) == 0.0 ? 0.0 : arg*arg) This code works: c = SQR(a); c += SQR(b); , but this code gives me an "operation on 'arg' may be undefined" compiler warning: c = SQR(a) + SQR(b...

 
4:03 AM
0
Q: Java score validation

user2999980This was originally posted in SO but I was not aware of this website at the time so I figured I could re-post it. Was just wondering if I was using nested if statements to much. I've been looking around and it seems that people try to not use them. Also does the code look messy in any way? Anywa...

 
4:31 AM
If there happen to be any C people lurking......
Oh, you don't want the VBA guy reviewing your C code. But I will recommend that you remove the commented out code. If you're afraid to remove it, it just means you need to start using source control. Hang tight. It's kind of slow on the weekends, and it takes a little while to get an answer here anyway. Good reviews take time to write. — RubberDuck 46 secs ago
 
0
Q: Passing data from doamin to UI in Java

AsicsHow do you pass data to paintComponent(Graphcs g) without using a direct reference to your domain in your view logic? public class MyCustomGrid extends JPanel{ private final DomainReference iDoNotWantThisHere; //Constructor @Override public void paintComponent(Graphics g){ ...

 
5:06 AM
1
Q: Custom Task List

RubberDuckI've been working on a COM Add-in for the VBA IDE with a friend. The idea is to search the active VBA Project for "magic" comments and create a task list much like any sane IDE would have. This is my first "real" project in C#, so I'm feeling like this code could be better. The code below is al...

 
5:33 AM
0
Q: Keeping attribute names simple when using getters and setters

canyon289Is the use of _pn in init pythonic? It seems that most examples change the actual attribute to self._pn to indicate it's private, but I would like to be able to call self.pn but have the advantage of checks with setters. The following code will cause a recursive loop class part: 'Holds various ...

 
monking
wow, the attack of the questions. so many of them
 
0
Q: improving the Zuul game

dushmanI am currently doing an assignment to improve the Zuul game. Zuul is text based game I am stuck about the following questions: The rooms should be able to contain a single item. An item has a description and a weight. Create an item at the same time as creating the room where it resides. Include ...

 
 
1 hour later…
6:54 AM
@RubberDuck Answered
and now back to drinking
 
7:31 AM
I wonder if Python folks would have an idea about this one on SO:
0
Q: Reusing validation logic in setter and constructor the right way

janosI have a class with a property with a custom setter to perform validation. I would like to be able to pass the property as a constructor parameter too, and call the setter from the constructor to reuse the validation logic: class Part(object): def __init__(self, pn): # self._pn = Non...

the current answers are very far from even grasping the situation, let alone being any good at all
 
8:10 AM
time to get breakfast
 
 
3 hours later…
11:23 AM
hey
lol.. Steam is unaccessible for some reason for a few hours and whole steam reddit explodes thinking the world goes down
 
11:38 AM
0
Q: background image render on retina display

naioI made a splash screen with a background image and I don't understand why it renders bad on an iPad air with retina display. This one works well on the desktop but not on the iPad: splash home page I've made a test page with the same elements and this one works well in both, desktop and iPad: t...

 
12:26 PM
How on earth could this edit have been unseen for so long?
@Phrancis s/on a Mac//
 
how on earth did you notice it now?
 
It was just recently edited again, so it was on the active page
yesterday, by Phrancis
To me @SimonAndréForsberg has been a great example of how to nicely downvote for a good reason.
thank you very much for those words, @Phrancis ^^
 
ah, I see
 
2 days ago, by JaDogg
@SimonAndréForsberg Well I'm an intern still, there are lot of stuff going on there, It's interesting. Hopefully I'll become permanent.
@JaDogg well, an intern is at least a start :) (I think, I haven't quite figured out the entire Intern system of the U.S.)
2 days ago, by Jamal
> You've earned the "Constable" badge (Served as a pro-tem moderator for at least 1 year or through site graduation).
@Jamal Holy crap, it's been one year already?
 
12:49 PM
Thanks for the review @janos. I had meant to clean up that cast and had forgotten.
 
sure thing
 
@SimonAndréForsberg Intern system in the US == "Why pay somebody for their work."
 
1:14 PM
Hi, @rolfl Do you know some library of a generic tree in Java?
 
1:26 PM
Lol. "Is it for a legitimate business?" No. No. No. No. MAKE IT RAIN!
 
1:37 PM
0
Q: Unwanted paddind in layout (Android)

MonstercrunchI'm new in the android programmation world and I'm facing some layout design problems. There is a padding in the layout containing the two images, see the red arrow: As you can see I'm using the wrap_content attribute for both heigh and width, so I don't really understand why this is happening...

 
 
1 hour later…
2:44 PM
0
Q: String split and tables

user3204810I have a table structured like this UnitScanDB = { ["profiles"] = { ["Goblin"] = { ["Bars"] = { { { ["track"] = "Cloak of Shadows#Anti-Magic Shell#Hand of Freedom#Spell Reflection", }, -- [1] ...

 
3:39 PM
@RubberDuck Depends, often times interns in the U.S. actually get paid... just not at the rate a non-intern doing the same thing would get.
@SimonAndréForsberg The problem isn't that it's on a Mac. The problem is that it's developed by Microsoft for an Apple OS. All of Microsoft's products on OS X and iOS are basically terrible.
 
3:58 PM
Yes. Sometimes they do get paid, but not often enough given we're a country built on top of the entrepreneurial spirit. But I'll leave my politics out of the 2nd Monitor. =;)-
 
What's entrepreneurial about working as an intern?
 
4:09 PM
@PaulVargas Nope.
(other than perhaps one of my answers here on CR).
 
0
Q: how to fix game logic in my tictactoe game

MORTALi have found tictactoe source code in this link: Tic Tac Toe in C++ i have rewrite source code in C++11 as shown below: #include <iostream> #include <cctype> #include <algorithm> #include <functional> #include <array> class TicTacToe { public: bool isFull() const; void draw() const; ...

 
4:27 PM
@rolfl I found jc-tree :)
 
JvR
4:38 PM
@janos Never written Python, but could it be that it warns you of calling a possibly overridable instance function before all fields are assigned?
As in: don't rely on this being set here, because it can be modified/thrown away by a subclass?
 
0
Q: Ruby: using .send within a method behaves differently than calling it outside

DaniG2kI'm trying to write a little snippet for my Rails app that checks if any tags are present for an object. I have the following code: def any_tags_present?(obj,*tags) tags ||= %w(person city country other) tags.any? { |tag| obj.send("#{tag}_list").present? } end running tags.any? { |tag| ob...

 
4:55 PM
0
Q: PHP secure random number generator

Nicolas BouvretteI just wrote this function and I was curious if anyone could find any flaws in it? It look pretty secure to me but I just want to make sure since I'm no cryptography expert. function urandom_rand($min, $max) { if ($max <= $min) { trigger_error('Minimum value must be greater than ma...

 
5:10 PM
Thanks @JvR, in this case, I think the warning means exactly what it says (and I agree with its legitimacy), but what you say is also a reasonable concern
now that I think about it, it's a refactoring problem. If I reword it that way it can be a better fit here instead
 
Because it is much more in a grey area now than your original question was. I will not respond to any more comments here. This is not the place for this kind of discussion. Please take it up on meta. — RubberDuck 1 min ago
 
5:24 PM
So, I don't really care for using Terminal and running command line programs. And I particularly don't like asking other people to do this stuff. So yesterday I figured how to run command line programs from within a program I write. Which means I can write GUIs for command line operations. But... not being a fan of command line operations, I'm not sure where to start (besides the project I did yesterday for pulling UDIDs off iOS devices plugged into your Mac)...
Anyone have some good Mac terminal stuff you think is quite good and might could use a GUI for it to make it even more useful? I want to practice.
 
@RubberDuck I think you were right there, and yes, it's possible to judge it off-topic without being able to review it. He should ask on meta to discuss the details and how to fix it
 
5:47 PM
I needed to disengage. I was as nice as possible.
The comment about helping the beta flourish was both funny and infuriating.
@RubberDuck This isn't pseudocode. Calling a property someVal doesn't make it non-functional. Rather than sarcasm and a link that really isn't all that helpful, why not offer specifically what needs to change so this question won't be put on hold. Help improve this beta exchange's chances to flourish! — thomas 1 hour ago
Dude, we are flourishing and, at least in part, it's because we close questions like that.
 
0
Q: Is this the right way to use std::unique_ptr and std::move?

Goswin von BrederlowI'm trying out new things (on class Inproc), specifically using std::unique_ptr and std::move, and I'm wondering if I'm doing it right. The code compiles so that gives me hope. Still, what do you think? Note: I'm working without exceptions for reasons I won't get into. That means the factory fun...

 
Did he create a meta question?
Can this be migrated to CR? stackoverflow.com/questions/27080395/… @rolfl @200_success
 
@RubberDuck right on that!
 
Assuming this is working code and it's not broken, this seems like it's much better suited for Code Reviewnhgrif 1 min ago
 
you're just dying to review some swift, aren't ya ;)
 
6:00 PM
Been a few days since any Apple questions posted. And this one would make a quite good question here.
 
@SimonAndréForsberg Where the hell is the start?!
 
Not that the last time I looked @nhgrif.
 
@skiwi the middle?
 
Why put my sound notifications back on?!
@janos Oh... I think I see clearly now
 
Mine were back on too @skiwi - But my OSX just suffered a seemingly significant crash...
 
6:04 PM
My Windows didn't
If my Windows would crash, then it would get pretty cold in here
 
lol
Maybe they rolled out something new, seems like they do that on Saturdays
@CaptainObvious PHP and secure in the same title?
2
 
0
Q: Simple Deck Of Card

MrAI had recently completed one Programming challenge where i had to design the deck of card, the time was limited but I tried my best.I designed the basic operations. Wondering if I can improve the current structure of class and objects. Also looking for pros and cons of my design. import java.uti...

 
6:21 PM
I do
I'm not the best guy to ask for terminal (or mostly any programming) things
 
Terminal isn't quite a programming thing.
It's an advanced user thing.
 
@nhgrif One way or another, IMO the best way to improve Terminal would be to... make a UI that eliminates the need for it :)
 
I agree.
Well sort of.
I mean, I can make a UI that just accepts terminal commands and executes them and perhaps makes it easier to link them together. But to actually make a single program that is capable of everything Terminal does? That's not going to be any different than just using Terminal
That's why I'm asking about common tasks.
For example, Friday, I figured out a terminal command for getting an iOS device plugged into USB to tell me its UDID so I can use that to register it as a testing device.
 
Something that would facilitate Git stuff would definitely be handy (for newbies like myself)
 
6:36 PM
So I developed that into a program that will build a list of iOS devices plugged in to all of your USB ports and build the .deviceids file you can upload to Apple and register multiple devices all at once.
There's already a lot out there for Git though, like SourceTree.
Plus Xcode has built in Git stuff.
 
That seems like a good thing for iOS devices
 
I'm about 5+ years too late though. Now you can add iTunes accounts as testers rather than just devices, by ID.
But that also requires having TestFlight app installed as far as I know. And you can't build directly to a device that's been set up this way
 
I know what would be good: Something that makes it so iPhoto doesn't start every time you plug in an iPhone to your computer :D
 
user image
7
 
LMAO.
 
6:41 PM
 
Hm. PICNIC.
 
picnic?
 
Problem In Chair, Not In Computer.
 
I must remember that one.
 
Always good to see fellow Dutch cars around... (not my pic)
 
6:43 PM
That almost spells
 
@Jamal I picked that option because I thought it was something that should have been mentioned in a comment or a review
I didn't see that it had been addressed in a review already however
 
@skiwi good one!
 
7:00 PM
@CaptainObvious I gave this one a review, and I suspect it's pretty good as a starter (the review I mean).
 
Anyone have advice on where to get started with mocking objects for test?
It seems like a lot of work to implement mock objects by hand.
 
@RubberDuck use a library. what language we talking about?
 
@RubberDuck Then use a C# library
 
That's not real helpful guys. Talk to me like I'm 5 please.
I'm a good 10 years behind the times.
 
7:10 PM
I was just mocking around... sorry
2
 
Which makes me like, 15..... God I wish I was 15 again.
 
I'm not familiar with mocking
 
lol. thanks @skiwi. =)
 
I'm a bit familiar with mocking, but not in C#.
In Java, there's Mockito.
I think @janos knows a bit about mocking.
I think the idea is that the mocking library gives you a proxy object, which implements the required interface, but instead of performing some methods it stores logic to check if it has been called, how many times it has been called, and sends back the mock data that you have told it to send back.
 
Seems to make sense.
I think I found one I want to try. Thanks @SimonAndréForsberg.
 
7:37 PM
0
Q: 2048 game implementation

demasI am not often use javascript so I will be thankful if you improve my code. It is my implementation of 2048 game. Just to give the idea how to use this code here is a part of angular controller: $scope.grid = new Grid(4); $scope.key_pressed = function(e) { if (e.keyCode == 37) { $...

 
8:03 PM
0
Q: When alternately mapping over value/key and key/value, should i abstract into a function?

ScimonsterI have two functions that replace letters. In one function, i'm replacing a regular Hebrew letter with its final form, and the other function undoes this operation. (Consider it like lowercase/uppercase, except only a few letters have both forms.) I created an object where the keys are the regul...

 
@RubberDuck no problem
@Phrancis You complain about snow? It could have been worse. wimp.com/commonsnowstorms
 
god
"I'm going to spend the entire day researching how I can put a timeout on this http request which is by default a little too long."
Who cares it will very rarely happen, isn't part of our specification we built and there are so many more things to do still
 
8:25 PM
@nhgrif Yes, but I can't initiate the migration, other than by flagging it like anyone else would.
 
Well, I flagged it.
We'll see what happens.
 
@RubberDuck Don't mock
Or at least: avoid it as much as possible
1. It indicates tight coupling, making your code less flexible
2. It makes your code brittle (if your mock is setup to return null but suddenly your implementation returns -1, your tests are still working but the code has changed)
4
3. It's dirty
 
8:41 PM
^^^ I disagree on all counts
But I would say one thing: don't mock if there's a better alternative
 
How can you disagree with 1 and 2?
 
It may indicate tight coupling
 
Okay fine, I may have rounded it to the nearest absolute
But if someone's reaction is to grab a mock to test something, it's an indication that that dependency is not properly abstracted
 
I'm not a big fan of mocks. But there are many situations when they are an excellent solution, so I cannot just say "don't mock". It depends on the situation, really
 
whatever stupid chat
 
8:48 PM
2 is a problem of sorts..
@JeroenVannevel just the link..
and nothing more.
 
No I refuse
I will not comply with its terrorist demands
 
okaaaay alright..
then don't. I don*t care
 
I care!
17 mins ago, by Jeroen Vannevel
Or at least: avoid it as much as possible
 
I do not negotiate with terroristic chatrooms!
You set a bad example for future quoting victims
 
It's not really something that is up for negotiation...
 
8:51 PM
ohhh dear..
anyways I have to agree with point 2..
 
This is how computers will take over the world
2
They just forced you into doing something they didn't feel like doing
 
-.-
no comment
 
but at least it's got swag
 
9:12 PM
@JeroenVannevel Looks like a smug
 
a smug mug top hat
 
9:57 PM
Those are really good points@JeroenVannevel, but I'm working on a com add-in. Mocking is the only way to properly test in this case. Otherwise, I'm stuck launching the external app and manually stepping through the code.
 
10:23 PM
If anyone knows which language this is in, please add the tag.
 
0
Q: Removing duplicates from unsorted LinkedList

maniac87/** * Remove duplicates without using a buffer. * * @param head */ public static void removeUnsortedDuplicatesWithoutBuffer(final LinkedListNode head) { //if the linked list is empty if(head == null) { throw new RuntimeException("linked list is empty"); //return; ...

 
@Jamal C# and ASP.NET
or just classic ASP?
 
It doesn't quite look like C#.
 
no it is C#
it's a view
you have ASP controls with some additional logic in C#to display certain controls in certain scenarios
The C# aspect is minor of course
for example this
 (string)HttpContext.Current.Session["managementButtonValue"]
undoubtedly C#
In ASP.NET MVC X you can use Razor though: weblogs.asp.net/scottgu/introducing-razor
much more expressive and no ugly tags
 
10:48 PM
How come I got this question in "first post" review now?
7
Q: Building multi-source Repositories and Units of Work

Keith BarrowsI am working in a shop where we tie into multiple different vendors to share data. I am also tasked with "bringing the code base up to the 4.x framework". To start, I understand that Entity Framework is a Repository/UoW pattern and really does not gain anything by wrapping it in home-spun Repos...

asked Oct 29 at 17:16
today is Nov 22...
for once I actually clicked "No action needed"
 
Was it one of those "This was just a test" questions?
 
0
A: Swift complexities with Dictionary

nhgrifWe're really doing two different things here. First, we're building a dictionary of character counts, and second, we're building a string representation of that dictionary. As such, this should be two separate functions. The first takes a string and returns a [Character:Int] dictionary, and th...

 
it has 7 upvotes already and one answer, what more action could possibly be needed?
@RubberDuck we're still in beta (technically), we don't have that.
 
Never came across one, but I wasn't sure.
Kinda weird though.
 
I want to re-ask this for anyone who did see it earlier, because I'm very interested...
So, I don't really care for using Terminal and running command line programs. And I particularly don't like asking other people to do this stuff. So yesterday I figured how to run command line programs from within a program I write. Which means I can write GUIs for command line operations. But... not being a fan of command line operations, I'm not sure where to start (besides the project I did yesterday for pulling UDIDs off iOS devices plugged into your Mac)...
Anyone have some good Mac terminal stuff you think is quite good and might could use a GUI for it to make it even more useful? I want to practice.
 
11:00 PM
@nhgrif I think often making a GUI for something that is command line based isn't very helpful, it has to be a very common command for it to be useful to make a GUI for it.
For git it is useful for some people, as there are so many git commands and they are used very often
 
Perhaps. I just try to avoid Terminal. I find it annoying.
 
What do you consider annoying about it?
I find it very useful.
 
It's so easy to build GUI apps these days. And they're considerably easier to use. I don't have to memorize any commands.
 
I mostly use it for git commands, Maven, and for pinging stuff to see if DNSes are working correctly
 
Yesterday I figured out a set of command line arguments that will pull the UDIDs off iOS devices plugged in to the USB ports.
 
11:03 PM
But if you use GUI apps you have to memorize what the GUI app's name is (perhaps a bad example)
 
I don't want to memorize the commands. So I built a GUI app to do this.
 
I find sourcetree to be much more useful than git commands
 
I have to remember which GUI app, but in this example, my GUI does a series of commands in a row.
 
I would just make a bat file / shell script / python script.
 
Moreover, the GUI is set up to continuously poll the USB ports so it automatically detects when a new device has been plugged in, etc.
I could write a script to do that, but in the Terminal, it's just not nearly as clean or nice looking.
 
11:05 PM
@JeroenVannevel SourceTree is especially useful for commiting individual lines / hunks. Excellent feature, really. I still use some git commands every now and then though.
 
Moreover, I actually don't need the app I developed which pulls the device IDs.
What I need is for other people who aren't quite as advanced users to get the device IDs.
I don't want to explain to them how to find the terminal, or say "Trust me, run this script"
They like it better if all they have to do is double click my app, then click the button that generates the .deviceids file we need.
 
@nhgrif it sounds like for you it's more about the feeling of it. It sounds like you feel that the Terminal isn't "pretty" enough. For me, I'm happy with anything that gets the job done.
@nhgrif but if there's only one button, then why not just have the app generate the file directly? (i.e. make a script of it)
 
That's part of it, especially when I need to distribute to other users
Because the app continuously polls, so as they plug devices in and out it builds a big list of them.
Then they type into the GUI the name for each device (so the name on our developer account matches the device name). Then they tap the button.
 
I think that there are often reasons that commands are run in a terminal. Although it is possible to make a GUI for each and every command, that's very often overkill.
 
And the button actually gives them a save file prompt so they can choose where to save it and what name to give it so they can find it to email to me.
 
11:09 PM
For your purpose of getting device IDs, a GUI for that sounds useful.
I can't come up with any other examples of commands for which I'd like to have a GUI.
 
Right. I'm not looking to do trivial stuff.
I just don't have a lot of experience with the terminal, so I don't really know what all is possible.
 
then get some experience with the terminal.
> So yesterday I figured how to run command line programs from within a program I write. Which means I can write GUIs for command line operations.
 
Yeah.
 
to me, making such a program that executes command line operations sounds very trivial.
 
There's a lot of stuff in system_profiler, and I'll probably make more use of that if/when I start writing more OS X apps, as a way to pull system information to send with bug/crash reports.
 
11:12 PM
Install Archlinux, then you have to use the terminal :)
Or install DOS :)
 
I've used DOS.
There's been a computer in my household for 20+ years.
 
then you must have some terminal experience :)
 
I know how to use the Terminal. I'm just not familiar with what is in it that's useful and not available through GUI already.
And when I can, I avoid using the Terminal. And I'm not the only one.
 
what's in it of course all depends on what commands are available on your system.
 
Well, I'm interested in stuff that would be relatively universal.
 
11:15 PM
If you had a GUI for pinging another computer, would you use the GUI or the terminal?
 
Depends. I don't know much about what network admins actually do. If it were simply pinging a single computer to see if it replied, I'd just open the terminal.
But I don't have use for this... ever.
And I'm not sure what someone who does have use for this then does with that information.
 
networks admins do... often.
even some users ping computers to debug why something does not work.
So why would you just open the terminal instead of using a GUI for pinging a computer?
 
Because it's a simple "ping 192.168.1.1" and you see the reply and then "Oh, okay... why did I do that?" and close the terminal.
I don't know why people ping things other than to see if they reply.
 
sometimes to see how fast they reply, but definitely mostly to see if.
so, ignoring your "why did I do that?", the key here is that it's a very simple thing to do. It's faster to open a terminal to do it than to find the correct GUI application, enter the IP in a textfield and press a button.
The terminal contains so many commands that are available at once. It is easy to switch from one command to another.
Sometimes it is easier and faster to remember a command than to find the right GUI application.
 
11:31 PM
I know you guys aren't talking about Windows vs Linux development, but it sure sounds like it. =;)-
Linux: Build a GUI around the command prompt.
Windows: Build a command prompt around the GUI
 
11:53 PM
0
Q: Feedback on small command-line tool

glampertI've coded a small command line helper tool for this library I'm working on. The library provides tools for the use of Virtual Texturing on iOS devices (mainly games). This little command line helper is still pretty much a prototype that I coded as quick as I could, for testing a new file format...

 

« first day (567 days earlier)      last day (3452 days later) »