« first day (573 days earlier)      last day (3742 days later) » 
00:00 - 11:0011:00 - 00:00

00:45
0
Q: What is the best practice for multiple for loops in the same function?

HanneshConsider the following piece of code: for(var i = 0; i < a.length; i += 1) { //Some code } for(var i = 0; i < b.length; i += 1) { //some code } JsHint complains because i is redefined in the second loop, fair enough. So how do I improve it? Do I use i and j, as I would if I were nesting ...

01:19
@Mat'sMug Hi there Mat
I got a question in mind
thought you might be able to help
1
Q: Usage of MVVM in iOS

IsuruI'm an iOS developer and I'm guilty of having Massive View Controllers in my projects so I've been searching for a better way to structure my projects and came across the MVVM (Model-View-ViewModel) architecture. I've been reading a lot of MVVM with iOS and I have a couple of questions. I'll expl...

This seems not entirely on-topic.
It's almost more appropriate for Programmers. He's asking for a design review, right?
nah
Question 1 is design review but I'm okay with that here
Question 2, 3 and 4 are SO
but not even there
4 is too broad anyway
can I write myListOfTypeInterface.ConvertAll(my => (ConcreteType)my) as
myListOfTypeInterface.ConvertAll<ConcreteType>() ?
2 and 3 might be programmers but again: broad subjects
probably a close on every site
But it doesn't really go here either way. I mean, it's not actual implemented code.
01:23
yeah I agree
I VC'd it
@Mehrad Is ConvertAll a method in .NET?
or selfdefined?
.NET
spot on
No :D
That explains
It's more of an understading question
01:28
well you can't really just choose a way to call the method
you have to follow the signature
public List<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
never used any casting on front of LINQ statement such as select<...> , Any<> and all
It expects an argument of type Converter
You'll have to implement that yourself
But
meanwhile I was reading about it as well
the more I read, it makes more sense that I am totally in the wrong path :D
Try this
myListOfTypeInterface.Cast<ConcreteType>()
That is an actual extension method
Yep... that's one.
Thank you @JeroenVannevel for the help
Now it all makes sense
cheers
No problem
this counts as my good deed for the week
haaahahaha
You must be up for a whole lot of mischief that you count this as your weekly +
it's all appreciated
That's me. Causing trouble and fixing code
sniff
01:45
0
Q: How can I optimize the speed on my prime check function

Paul. KI have written a program in python 3x to determine all the prime, palindrome string integers in the range of two given numbers. from math import sqrt def check_prime(n): if n<2: return False for i in range(2,int(sqrt(n))+1): if n%i == 0: return False else...

@Mehrad it's not a cast, it's a generic type parameter ;)
That's what I'm actually look at right now... generics and casting...
The evolution from Objective-C to Swift will be a painful one.
Fixed a ticket on Trello. Had to remove a [Required] attribute. It feels like it's time for a break..
@JeroenVannevel you work @FogCreek?
lol
No, I use it
Not actually working on Trello
01:58
* on Trello lol
Well yeah, it's on Trello
I find it's a shame the software doesn't let you delete boards
Maybe it's a language distortion
you can't delete boards?
ever
you can "close" them
but they remain there in limbo forever
02:00
Yeah, and hence, I don't use Trello.
^^ same
Is it really such a bad thing?
why is that negative?
Very annoying.
becaauuuusee?
there's a ton of test boards languishing in my account
and then there's two from a job I had 2 years ago
@JeroenVannevel because I know what is and isn't good for me.
02:02
eh, you still have to go through two clicks to get to them
so it's not like it really pops up in your face
so what
GitHub lets you wipe out an entire repository from the face of the Earth
it's a lie
They store it for 90 days in the back
GitHub?
I once deleted one and only realized it a few months later
yeah, well at least I feel like I'm the one taking the decision
02:04
They looked for it but couldn't find it
but yeah okay, I get what you mean
@JeroenVannevel Yes, they store it for 90 days in the back, sure. But a) I can't possibly see it, and b) no one else could possibly see it, and c) it is eventually completely deleted.
And b has the caveat of meaning "no one else outside of Github"
Ideas on Trello Development
# Current Functionality Right now, you can only close a board, which sends it to the archive, not delete it permanently and remove all access. # More Info Please see Deleting a Board on our suppor...
☝ 2502 votes✍ 399 comments
wut?! there's one-boxing for Trello boards!
boards or individual cards?
oh shit, cards too!
oh wait, you had a card
> HOW DUMB. They give you a Welcome Board that you can never delete.
Mine just looks way more boring
lol
I changed a class's property from a complex type to int
rebuild
no errors
THAT WAS SUPPOSED TO DO SOMETHING
02:12
lol
oh wow
> Added Jul 19, 2012 at 12:11 pm
2.5 years in "Ideas". Board delete just isn't going to happen.
3
0
Q: How to increase data download speed in android

krishNow i am using Ksoap2 to fetch data from server.Is there any other method to increase the data download speed in android

02:35
@Captain 4 more like that in the close queue and I finally get that [badge:reviewer]..
oh come on!
> depending how anal you want to be about the outcome
141
Q: How do I draw a pair of buttocks?

Simpleton JackI'm trying to develop a function which 3D plot would have a buttocks like shape. Several days of searching the web and a dozen my of own attempts to solve the issue have brought nothing but two pitiful formulas below. They have some resemblance to the shape I want, though not quite. Could you...

0
Q: Some simple Perl and Regex

gloomy.penguinReads from a flat file of three columns, delimited by at least one tab character. Filters the three columns based on input; returns list of corresponding emails. Arguments passed like key=value or key= for blank. #!/bin/perl use warnings; use strict; sub get_list { my $cols = {'li...

02:50
CollectionAssert has no IsEmpty (or IsNotEmpty) method
what a missed opportunity
not exactly an exotic usage of collections, checking if they have items
3
0
Q: strategy pattern - design hash table

KKPMy programming skill has gotten rusty, so I would like to elicit constructive criticism that can make me write code better. I know the standard design is to use templates, and even obtain the hash function, allocator, etc through it, but I wanted to experiment with patterns, so I'm pretty sure my...

> but I wanted to experiment with patterns, so I'm pretty sure my design here blows.
lol'd
hmm
I have a method defined as bool TryRemovePerson(out User user, int personId);
When I call it like this:
User user;
if (_userRepository.TryRemovePerson(out user, personId))
Will it pass that user object to it as well?
or is it really only an out?
out param first looks weird imo
yeah, first I didn't add it. But I changed it since first I need to pass that user object to work with and afterwards I want to return the changed object
03:04
it's passed, uninitialized
no, it's initialized before. I just left it out
assume user has a value
that's fine for an out param
Can I work with the existing ùser object inside the method that it's passed to?
it seems rather counterintuitive
@JeroenVannevel what do you mean with that?
I don't understand
Eh, I'll write up a quick sample and see how it works. I'll show you then
03:07
out parameter gets initialized in TryRemovePerson (by compiler constraint), and returns a valid object reference to the caller
Ah, it's as I suspected
consider this example
void Main()
{
	var o = new MyObject();
	o.Test = 5;
	DoSomething(out o);
	Console.WriteLine (o.Test);
}

private void DoSomething(out MyObject obj)
{
	Console.WriteLine (obj.Test);
	obj.Test = 10;
}


class MyObject
{
	public int Test { get; set; }
}
it's not initialized when you first use it - boom
It won't compile because you have to assign a value to obj inside DoSomething
Yeah but I wasn't sure - since I do pass it initialized to the method
but apparently it doesn't take that into account
03:10
but the caller is allowed to pass it uninitialized because out guarantees it will be initialized when it comes back
makes sense
but it would've been nice if it detected that it was already initialized
and then allows you to just use that
yeah... but then why not use a ref parameter?
lol
I totally forgot about that
I was trying to mimic ref yeah
problem solved
0
Q: Optimizing insertion sort for small amounts of data

LemonPiI'm building a hybrid sort, and for that I need a fast and adaptive sort ideal for small sizes (< 65 elements). Insertion sort immediately comes to mind, and I've been tinkering with different implementations of it. My requirement is that it takes in iterators as per C++ standard. Linear insert...

0
Q: Efficient Django model for blog post

zanI'm currently trying to create a travel blog using Django whereby users will be able to create a travel plan with the following features: Each user can create a travel event based on the start date and end date for specific locations, with some meaningful description He/She can also upload imag...

0
Q: Improving names in a Bem list

Caster TroyI am having some trouble naming lists and list items using the Bem methodology. I want to emit a list of tags for a given blog post and I came up with the following names : <ul class="tags"> <li class="tags__tag">@tag</li> <li class="tags__tag">@tag</li> </ul> Names like post__title m...

03:18
@janos has a goldie now! :O
3
Congrats @janos!!
@CaptainObvious @Mat'sMug Looks like this can help you towards Reviewer.
Has to be from the review queue! (that's why I don't have it yet!)
I have 606 close votes cast.. but only 246 in the close queue
It's good that the out-of-queue CV's don't count toward the badge though. Makes an "incentive" to pay to review queues a visit once in a while
0
Q: Improving names in a Bem list

Caster TroyI am having some trouble naming lists and list items using the Bem methodology. I want to emit a list of tags for a given blog post and I came up with the following names : <ul class="tags"> <li class="tags__tag">@tag</li> <li class="tags__tag">@tag</li> </ul> Names like post__title m...

I'm sort of almost to Steward for SO's First Posts queue. I don't try to review every single post, which is why it's taking me a while.
03:47
0
Q: Generation of all numbers of arbitrary length and base

nponeccopquux (['0'..9'] ++ ['A'..F']) 2 generates hexademical numbers of length 2 (with leading zeros), but it's obviously possible to generate any base and any length. quux digits length = iterate foo return !! length $ [] where foo bb aa = map (: aa) digits >>= bb Can this code be simplified, ...

0
Q: Opening files using fopen only if user enters correct password

SupermanI wrote this program to just get some practice in C...but I had two questions. Do you see anything that I am doing that will create bad habits in my future programming. My program requires the user to enter a password to be able to view the file but is there a way to create a file that once it ...

On SO? I'm pretty sure they have poison-tipped explosive bear traps. :P
lol
make him want to come back for more @Jamal
I can take a look at it. — Jamal ♦ 2 mins ago
hi @RubberDuck!
At least I got most of my JUnit stuff done today, and I can continue my MPI/CUDA stuff tomorrow.
Who's setting bear traps?
03:59
lol no one
Other than me you mean? I've been pissing off people lately.
There I fixed it. It's actually C#. I marked pseudo-code in the sense that it's not actually the code I wrote, it's simplified (the actual code involves a crappy database structure). Seriously, downvoters, look at it. How can you not know. — thomasbtv 9 hours ago
Ohhhh check it out.
nice!
> 9009
0
A: Opening files using fopen only if user enters correct password

Jamal Try to keep your indentation consistent everywhere. You indent by different number of spaces in different places, making it hard for others to read. The number of spaces is up to you, but in C, it's most common to indent by four spaces. Your use of whitespace (except for indentation) is okay, ...

Don't ask me why I've written an essay on global variables, because I have no idea.
2
I may add more later. I'm not the best with IO stuff, especially in C.
04:15
0
Q: Join strings from a List<string> while also formating them

Matt GulickOriginally posted as a question until I was advised of this part of stackoverflow The code I have wrote works fine, this inquiry is purely for educational purposes. I want to know how others would do this better, cleaner. I especially hate the way I add the list items to another list before they...

Hi folks
I wanna understand this syntax
var list = new List<IAnimal> { new Cat(), new Dog() };
the part in the curly brackets
I wanna understand Jason's answer for this question stackoverflow.com/questions/6019765/…
same as var list = new List<IAnimal>(); list.Add(new Cat()); list.Add(new Dog());
Now I need to figure out how to mute sounds from apps. I got notified about a comment on my answer, and it scared the crap out of me.
I wanna know what happens if I do
list.Add(instanceOfCat);
msdn.microsoft.com/en-au/library/bb384062.aspx scroll down to collection initializers
04:23
Oh...
that's interesting
that's all I wanted to know and even more... Thanks @mjolka
np :)
04:37
what's a "Bem list"?
> Rename tag to banana and tags to monkey.
@Jamal chose less scary ringtones ;)
Maybe I should just log out each time.
0
Q: Tic-Tac-Toe in C++11 - follow-up 3

MORTALPrevious question: Tic-Tac-Toe in C++11 - follow-up 2 Is there any way to improve this code? #include <iostream> #include <cctype> #include <algorithm> #include <functional> #include <array> enum struct Player : char { none = '-', first = 'X', second = 'O' }; std::ostream& ...

05:45
monking
thanks @Jamal and @Mat'sMug
monking @janos
Monking @mjolka
Monking @janos
hey @mjolka
Monking @all
hey @Heslacher
hey @all :)
happy Friday
05:52
woo friday!
hey @Heslacher :)
@mjolka, would you be able to point me to an example which uses Generic Type Parameters in the LINQ?
? i'm not sure i follow
like something which actually uses that T in it's example for say list.Select<apple>(p => p *2)
all the examples in the LINQ section of msdn explain how linq work without using that <T>
hahaha... I guess I started describing really badly. sorry
exactly
as you see Select(x => x * x)
I want to see how a C# example would use that select<T>(x => x*x) capability of the linq
I mean please. if possible :)
06:04
sure i'm just not totally sure what you're looking for :)
how about something like this
int[] xs = new int[] { 1, 2, 3 };
string[] ys = xs.Select(x => (2 * x).ToString()).ToArray();
as you can see the in page you sent me the select syntax is describes as Select<TSource, TResult>(...
right, in this example TSource = int, TResult = string, we just don't need to explicitly say that
we can if we want, but why would we
int[] xs = new int[] { 1, 2, 3 };
string[] ys = xs.Select<int, string>(x => (2 * x).ToString()).ToArray();
would it be possible to explicitly mention it?
very nice
I use linqs most of the time, but I just wanted to understand how I would use the generic parameter
Now it makes sense
note we can't do this
int[] xs = new int[] { 1, 2, 3 };
var ys = xs.Select(x => null).ToArray();
as the compiler can't infer the right types, so there we have to make them explicit
int[] xs = new int[] { 1, 2, 3 };
var ys = xs.Select<int, string>(x => null).ToArray();
thats even more interesting
since we have left the <..., this section> for the compiler to decide
and null won't imply any type
something like
var test = null;
am I understanding it right?
06:11
i think so, yes
I really appreciate it
np :)
you might enjoy this article ericlippert.com/2012/10/02/…
ttqw, have a good weekend all :)
my name is Mehrad as my ID says. Nice talking to you again :)
for you too
and this article already sounds interesting after the first paragraph. thanks
0
Q: Optimize the memory use for a rails script

bl0bSo, I have to run a script against 40millions object in my database: I wrote the script and I want 10 instance of it so I process my objects faster. The goal is to find all the neighborhood for each property. A little bit of context: Multiple properties can have the same lat/lon. A Location is a...

@hosch250 I was stationed in Berlin.
06:18
@Donald.McLean Were you?
That sounds interesting.
@hosch250 1983-1985 and 3 months in 1987.
Maybe you knew my father (last name of Hosch?)
I don't know when he was there.
He was a sergeant when he got out, but that is all I know.
@hosch250 Do you know what kind of work he did?
Guard duty.
He stood on the wall with orders to shoot if the other side did anything "funny".
Or next to the wall, or something.
monking @all
06:21
He was on the Autobahn once, and ran in a marathon once.
Ahhh, you meant your earlier comment literally then. No, I didn't know any of the guards in Berlin. I worked in a military intelligence unit.
OK.
The only other thing I know is that the irons got hot faster there because they used a higher wattage or voltage or something.
Monking @chillworld
Higher voltage. Germany uses 220v current, which in the US you mostly only see with electric clothes driers.
OK, I wasn't sure.
I know that computers have to have adapter cords for different countries.
06:25
And they also use 50Hz current, which doesn't matter for many things, but it used to really confuse some older clocks.
Many modern companies ship products all over the world, so they design then to adapt to whatever current is available. Very helpful for travelers.
Yes.
What programming language do you use?
06:42
@hosch250 I use Scala.
Oh, I've only heard of that.
I use C#, C++, and Python 3.
Right now, I am working on a chess game in Python.
I've used C++, but I'm not a fan of either Microsoft tech or loosely typed languages.
C++ is strongly-typed, isn't it?
Oh, you mean Python.
No, I don't like that either.
My favorite is C#.
I used to like C++ best, but C# is easier.
06:46
Though with pointers, you can do all sorts of things that are both useful and dangerous.
I don't use pointers.
I haven't needed to yet.
I don't even know how to use them yet.
I need to finish my C++ book.
I take it you haven't been programming all that long?
No, since last fall.
I mean, spring.
Spring of 2013.
I took a class in Fall of 2013 as part of my IT major.
I wrote an XAML/C# app for Windows Store this summer.
I can't code much during college time.
@hosch250 Ahh. I took my first programming class in 1976, but didn't get serious about it until the time I was in Berlin - 1984. I got my first programming job in 1988 and have been a full time programmer ever since.
Nice.
I am an IT Management major, but I absolutely love programming.
06:57
I currently work on software used to manage the data archive for the Hubble Space Telescope.
I don't get to do it near as much as I would like.
Oh, that sounds really interesting!
It's one of the best jobs I've ever had.
Do government programmers still have to use Ada for security critical jobs?
From what I've heard, they mostly use Lua for hacking.
I don't know, but I've never actually known anyone who used Ada.
Neither have I.
I need to go now, sorry.
Maybe we can talk some other time.
07:00
NP. Take care. I'm usually on during work M-F, 9-5 EST
OK, happy thanksgiving!
You too.
0
Q: Loop control, control the timing of repetition

RogUEI am a beginner in C++. I want to make a loop(either for or while loop), but I want to control the repetition of the loop(like 5 repetition in one second), I don't know how to do it, please help me!!!!!!!!!!!

07:16
^^^ nuke it from orbit
08:14
0
Q: C++ Pointer and address code lookup

Luis First, I want to thank you for looking at my post and making a comment. I'm trying to display the values in the array by changing the address in a pointer called dispPt. Unfortunately, the compiler its not able to display the values in the array because technically values in the array are know...

0
Q: Java background server class that might be called from ui thread

matcauthonI have a server communicating over network interface. This server should run on a background thread, so that it does not block the ui thread. The ui thread starts and stops the server. Even starting and stopping should be done from a background thread. Currently I wrap all public methods of the ...

Monking
Monking @Vogel612
yaaay final proofread before printing and binding 40 pages * 4 ...
40 pages of what
IHK dokumentation...
"graduation" project for my Ausbildung
urk german-english mix.
08:22
BA, FH or Uni ?
Ausbildung -> neither
good old Azubi
I would like Azubine more ;-)
from 9 Azubis over 3 Years and 2 Professions, we got 1 Azubine...
They are rare ;-(
well when we had 3 professions for Ausbildung the Bürofachangestellte(r) elevated the ratio... but alas,
08:31
hey
Please, more alarms next to my ear in th emorning while I'm not awake... earrape
@janos Maybe you ask @Donald.McLean to fit a nuke on the next telescope?
And reading through the logs would casually fire a nuke... yeah right
08:48
@skiwi why just one??
@Vogel612 Maybe more is better :)
more is almost always better..
Say you don't contribute to open-source, then how do headhunters find you?
They are lurking in chat ;-)
3
09:06
@Heslacher I didn't get called yet though!
Sometimes I imagine @rolfl being an IBM headhunter ;-)
@skiwi Then you need to change your username to your phonenumber.
@Heslacher and get a promt suspension for spam? meh
09:35
Does anyone have a large source of PHP code written to the zend coding standard?
have a link to*
I have found some examples, but they are very small cases and I am still a little unsure of readability in larger functions etc
@myol Maybe try to find an opensource project on Github that uses PHP with Zend?
09:54
0
Q: Reading and writing files and resources

maaartinusDoing IO in Java is a big pain. It got better with Guava and Java 7 and now about everything is there, but I never know exactly where. Most of the time I need to slurp a file. Nearly as often I need to write a file, while making sure, I don't end up with some garbage in case of an IO error (atom...

@skiwi I'v been looking, just wondering if anyone knew of any off hand
10:42
0
Q: zipWith function in Scala

BasilTomatoMy implementation works, but it looks very ugly. Curious to see how it's better implemented. def zipWith[A, B](lists: List[List[A]])(f: List[A] => B): List[B] = { @tailrec def loop(acc: List[B], input: List[List[A]]): List[B] = { val init = (Nil: List[List[A]], Nil: List[A]) ...

0
Q: AudioMetaTagger: recursively read files and gather metadata

ScavenceSo the idea is to read metadata recursively in a chosen directory, load their metadata and display it into a table. Here is the simplified example of what I am doing. public class AudioMetadataExtractorTest { public static void main(String[] args) { String audioFiles = "C:\\Music";...

0
Q: Using method returnin Strinmg or creating wrapper for String

KirkoRI have a question witch approach is better First (inner class for wrapping): public class OOP { private SomeService someService; private final class OrganizationPrimaryKeyString implements Serializable { private static final long serialVersionUID = -256615521081939636L; ...

When did JavaScript popularity rise?
Does this even say anything?
^^ People now seem to know what a linker error is.
@Morwenn South Korea disagrees.
10:57
^ WTF 2008?
@Morwenn Some people noped out at that time.
"C++ template metaprogramming" seems to be mostly popular in Africa.
check for p.rn
small country big need
00:00 - 11:0011:00 - 00:00

« first day (573 days earlier)      last day (3742 days later) »