« first day (478 days earlier)      last day (3521 days later) » 

12:08 AM
I'm afraid this question does not match what this site is about. Code Review is about improving the cleanliness of existing, working code. Code Review is not the site to ask for help in fixing or changing what your code does. Once the code does what you want, we would love to help you do the same thing in a cleaner way! — Simon André Forsberg 56 secs ago
My comments are back!!
I've missed you, auto-comments! <3
 
12:22 AM
Welcome to Code Review! This is a nice first answer! Excellent point that the reversing-twice approach can be used to minimize storage. — Simon André Forsberg 1 min ago
^^ Answer needs lovin'
And TTGTB
 
Welp, now I'm annoyed with Swift again.
In Objective-C, you could throw exceptions and you could use try-catch blocks, but both were heavily, heavily discouraged.
In Swift, you plain can't use try-catch blocks.
 
How are errors handled then? On Error GoTo? ;)
@sim napalm'd - and good night!
 
In Swift?
 
just kidding. but yeah, in Swift
 
enum ServerResponse {
    case Result(String, String)
    case Error(String)
}

let success = ServerResponse.Result("6:00 am", "8:09 pm")
let failure = ServerResponse.Error("Out of cheese.")

switch success {
case let .Result(sunrise, sunset):
    let serverResponse = "Sunrise is at \(sunrise) and sunset is at \(sunset)."
case let .Error(error):
    let serverResponse = "Failure...  \(error)"
}
 
12:36 AM
ok, so return values.
 
that looks like f#
 
> From Apple news books, "Using Swift with Cocoa and Objective-C". Runtime exceptions not occur using swift languages, so that's why you don't have try-catch.
 
what happens when there's, say, a division by zero?
 
39
Q: Error-Handling in Swift-Language

pekoI haven't read too much into Swift but one thing that i noticed is there are no exceptions. So how do they do error handling in swift? Has anyone found anything to error-handling?

Division by 0 isn't an exception in Swift or Objective-C. It's undefined behavior (tends to return 0).
 
> However, as documentation suggests it is running on the same runtime as ObjC, and therefore you are still able to throw NSExceptions
 
12:38 AM
Yeah, I don't know.
I'm sure you could throw an NSException. You certainly can't catch one.
 
0
Q: Increase the speed of this Caesar Cipher?

Sir ChimiHere's my attempt at a Caesar Cipher encoder/decoder. If given a key, it will encrypt the given string. However, if you do not specify a key, it checks each of the 26 possible keys and returns the one with the highest percentage of words that appear in this file of English words (with a couple a...

 
Welp, Swift playgrounds are certainly not the place to do Project Euler stuff.
 
12:57 AM
0
Q: what approach should be used i am so lost

Kip Bodeypublic static int getMenuOption() public static double getOperand(String prompt) public static double add(double operand1, double operand2) public static double subtract(double operand1, double operand2) public static double multiply(double operand1, double operand2) public static double divide(d...

 
Man, someone at Apple really hates exceptions.
An OO language without exceptions is just strange.
 
It's just a different design philosophy. Although, I much prefer the Objective-C approach rather than the Swift approach.
 
It's just odd that their driving motivation was to get rid of the C in Objective C, but they're still apparently sticking with C style error checking (though with slightly prettier syntax).
 
So, in Objective-C, things that are rare but not completely unexpected in a properly coded program are errors.
Generally speaking, things that could be prevented by the programmer (like out of bounds exceptions) are exceptions.
 
0
Q: Project Euler #4 in Swift

nhgrif A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. What I've so far learned about Swift is that while the Playground is very cool ...

 
1:11 AM
So try-catches are shunned because you shouldn't be writing code that throws exceptions.
But consider this block of Swift code:
extension Int {
    func reversed() -> Int {
        var original: Int = self
        var reversed: Int = 0

        while original > 0 {
            reversed *= 10
            reversed += original % 10
            original /= 10
        }

        return reversed
    }
}

let bigInt: Int = Int.max - 8

let overflow = bigInt.reversed()
 
Makes sense (if you're into C error handling), but it's still strange to not have exceptions at all. There's still asserts and return codes, of course, but... meh.
I don't know. I think it's just as an ObjC/swift outsider, it's a little weird.
Though I did ObjC for 6 months, and the error handling never quite felt pleasant.
But then again, exceptions can be just as unpleasant
 
So, Int.max - 8 is: 9,223,372,036,854,775,799
If you reverse that, it's > Int.max, so it overflows
I think in Objective-C, it'd just be undefined behavior (integer overflow)
Guess what happens in Swift?
Playground execution failed: error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
* thread #1: tid = 0x13299, 0x000000010f61d82c, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
  * frame #0: 0x000000010f61d82c
 
EXC_BAD_INSTRUCTION sounds like an exception to me... no?
 
That's.... hrmmm.... If static analysis can pick up the possibility of that, it's great, but otherwise, damn, you just crashed a program.
@Mat'sMug I think it's an interrupt from the processor
 
"EXC"
 
1:17 AM
Hrmm, yeah after a google, it definitely seems to be a runtime-level exception.
 
By the way, that's the description I get in the playground.
Which is more helpful than what I get if I actually compile the code and run it in a real project
Thread 1: EXC_BAC_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
Actually nevermind, I think I have all the information I got in the playground, it's just presented differently.
 
Every error doesn't necessarily need to be an exception, but they're a very nice facility to have. I think it just comes down to Apple clearly has a different philosophy than I do.
 
Yeah. Like I said, it's a different philosophy.
I started exception handling in Java actually, and never really liked it.
 
I just never feel quite safe with C style error handling. what if i forgot to check an error code? suddenly I have a program with some rather odd, sporadic behavior, and I'm going to have a hell of a time tracking that down. Uncaught exceptions leave a much better debugging trail, and they give me a peace of mind that my code is reasonably robust.
Then again, I guess typical code really doesn't have that much error handling. It's just low level or library type things.
 
Right, that's the thing...
Your low level stuff, write your exceptions and try catches if need be
 
1:24 AM
And unit testing could theoretically give relatively high confidence of error handling...
 
But higher level stuff, you shouldn't have try-catches in a view controller.
 
Well, you shouldn't have ObjC style exceptions in a VC
In other languages, people would say you shouldn't typically be checking error codes in high level code
But, meh. I suppose it really is just different worlds. And we've each chosen a side, haha
 
Objective-C style error handling though gives me the option to check for the error.
If it doesn't matter whether or not the method errors out, I don't have to bother writing error handling code.
 
I'd much rather the program terminate in the case of an unhandled error than continue chugging along on invalid data/resources.
 
But it's not necessarily invalid data
 
1:28 AM
Well, if that's the case, I'll just ignore the exception. But that's typically not the case.
There are very few times when I truly, really do not care if something fails.
99.9% of the time, if I'm not checking for an error, I'm just being lazy.
 
"just ignore the exception", but you still have to write your try-catch block or crash.
 
Correct. I prefer to have to say "hey, ignore this error," than to have to say, "I do care about this error."
I'd rather opt out than opt in with regards to error handling.
 
I think this is the Apple philosophy...
If the app crashes, dumb users might potentially wrongly blame the operating system or the hardware.
If the app has bad/wrong data, dumb users will correctly blame the app.
That matches their approach to how they handle iOS apps doing background tasks.
 
Hrmmm, I think users tend to blame apps crashing on the app.
But maybe I overestimate the average person's understanding of programs :/
 
I do, for sure, but the average user is a raly dum moran.
And when you're Apple, both the device AND the OS are your product.
There are millions of apps on the app store, and Apple gets a piece of all of their profits. But what's ultimately most important to them is that the user not be led to believe that the operating system or the device are bad.
 
1:34 AM
Eh, I think we're overestimating users' stupidity and Apple's paranoia. I surely hope this wasn't the driving motivation of their decision.
Difference in philosophy I'll accept, but this is almost malicious :/
Well, malicious is far too strong of word
But rather priorities in the wrong place
 
I don't know that that's the driving motivation for the error handling, but it's absolutely the driving motivation for a lot of other things.
The best example being what I already mentioned--how iOS handles allowing apps to do things in the background. Are you familiar with it?
 
not particularly
 
@nhgrif in that question, do you need these lines? var left: Int = 999 var right: Int = 999
 
Nope. Good catch.
Anyway, Corbin, unless your app is in one of a very few specific categories, to do stuff in the background, you register with the OS as an app that wants to do background stuff.
As well, you set a minimum time between updates. You can't set a maximum, but you can set a minimum (so you only do a background task once per hour at most, for example)
Whenever the OS deems it convenient, it wakes your app up with a method to the app delegate. It passes in a function pointer.
You have 30 seconds to execute code, and then call the function that was passed in with one of three arguments, which indicates "No new data," "new data," or "error".
Using your apps returns from this function, as well as a ton of other metrics such as current device battery life, how busy the processor currently is, how frequently the user uses your app, etc., the device decides when you get to do background updates.
 
1:55 AM
Are you teaching yourself Swift via reviewing my Project Eulers? ;) — nhgrif 16 secs ago
@rolfl "The print in the function is.... ugly." For the record... it originally wasn't, but I wanted to move it into the printTimeElapsedWhenRunningCode
But for the future Project Euler solutions, I'm going to take this approach:
func solution() {
    let firstTwentyInts: [Int] = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
    let answer: Int = leastCommonMultiple(firstTwentyInts)

    println(String(answer))
}

printTimeElapsedWhenRunningCode("Least Common Multiple", solution)
 
Yes @Simon. I was challenged to do the ice bucket thing. It annoys me too, but I've never been one to turn down a dare.
 
I figure I should at least be able to recognize the code.
 
Hmm?
Do you work for IBM?
 
yup
 
Ah, I see.
I did not know that.
I've already got PE#5 worked out. I'm trying to space out my questions at least 12ish hours though.
 
2:11 AM
@nhgrif - I believe a novice reviewing an expert's code is often a good thing.... it makes the expert stop and think about how people see them think, and how they express things.
I know nothing about swift, but I can see algorithm and other issues in your code.
 
Well, I don't consider myself an expert, but you are right.
 
I can read the manual pages enough to know what should be possible.
 
I'm focusing on other things and forgetting about some of the things you point out, which would be obvious to me if I were writing Objective-C actually
 
Put it together, I will get enough of an ability to read swift to know when people are doing the right thng, and when people are trying to BS me ;-)
Youa re doing the right thing, but I can see those 'lazy' decisions too. I use the word lazy like a true programmer would. Normally lazy is good. but on code review, we strive for better uses of lazy
Also, about your questions, Apart from the two swift ones I did (one last night, and one today), I have not answered any main-site questions for almost a week.
Meta has taken up most of my allotment of CR time.
 
@nhgrif eh that's just basic resource sharing though. All OS's do that, just not to such a great extent, since windowing gives you a more visible control over background processes typically. It is interesting though that there's no guaranteed minimal period to be called again. It makes sense though.
 
2:16 AM
My recent ratio is 5 to 1, 5 meta answers for each swift answer int he past 7 days.
 
I'm kinda falling behind on Meta answers, though I feel others already have good answers.
 
@rolfl I think that makes it pretty much all my questions though. ;)
@Corbin It's my understand though that the OS builds a usage pattern from each individual user's usage of your app.
 
2:33 AM
0
Q: Pokemon Type Evaluator

LegatoThought I would apply what I learned to make something fun. Its purpose is to type check pokemon for anyone familiar with the series. It mostly works but I have two concerns. First, Sometimes you write code and you get the pervading feeling you're not using some method, some API or the best appr...

 
If you only use my app once a day and you always use it around 7am, then no matter what I set my background stuff up for, it's very likely that the OS will eventually optimize it so that my app only gets opportunity to check for updates once between 6am and 6:59am and then at no other part of the day.
I've only just started using this stuff though, so I'm not certain exactly how good it is, but supposedly it's extraordinarily good at doing no more than absolutely necessary.
 
2:46 AM
that's pretty cool then. makes me feel a lot better about having like 500 apps open at any time haha
 
As long as you've got an iOS device.
Android, of course is less limiting, which has its advantages. And if the user knows what they're doing, they can potentially get more out of their Android device than they can their iOS device.
But if the user doesn't really know what they're doing, and they download some nefarious app that's doing stuff in the background, well now their app is massively draining the device's battery, or using up RAM, or competing for processor time.
And to you or I or anyone who knows what they're doing, we start looking at what's going on with the device, and try to find out why we're getting poor performance.
But to the average, less tech-savvy user, there's a huge optics problem.
Because the actual problem is in the background... where a less tech savvy user won't notice it.
They are more likely to associate the poor performance with the active app or the poor battery life with the device.
 
3:04 AM
android seems to trust applications more while simultaneously having very few checks in place to actually make sure that trust is warranted
it's kind of scary sometimes :/
 
3:15 AM
hmm
 
3:35 AM
0
Q: Clean design for the MVC pattern with view latency

Tony Suffolk 66It isn't clear if this question has already been answered, so apologies in advance if this is a duplicate : I am implementing a game and trying to design around a clean MVC pattern - so my Control plane will implement the rules of the game (but not how the game is displayed), and the View plane...

 
 
2 hours later…
5:56 AM
Monking
 
@skiwi monking :)
 
Still asleep... will change in a bit when I go to work in 10 degrees outside :| in August
 
6:12 AM
10 C I hope?
 
-2
Q: Find the index of the element

user3796187can somebody give me a java program which will find the index of the element whose value is the sum of the remaining elements. I have to tried to write the code but I couldnt write a simplified code. Iam myself writing a cumbersome logic but couldnt simplify it. can anybody help me in resolving...

 
6:37 AM
Yes, cycling in 6 degrees definitely woke me up.
 
6:52 AM
Is there no way in chat to post a multi-line message with formatting?
 
@skiwi huh??
what kind of
formatting did you want?
> Something like
this?
 
Like this:
**[skiwi2/GithubHookSEChatService]** **skiwi2** pushed commit **5331db63** to **master**
> The chat throttle amount can now be set via the properties file.
I know it works if I use single lines, but then I need to fix my chat throttling
 
why do you want the second as a quote in the first place?
 
Because it's the commit message
 
maybe inline-code?
 
6:55 AM
Seems like I need to roll out some "fixes" to my throttling then
posting 2 messages directly after eachother is always fine, right?
 
or try <div class="full-quote">html</div>
 
0
Q: Modular exponentiation

AwesomeThere are \$0\$ cells on day \$0\$. Each day, cells multiply by \$x\$ times and \$y\$ humans die. Find number of humans on day \$n\$(after they multiply and die). Closed form of cells on day \$n=x^n-y^n\frac{x^n-1}{x-1}\$ \$−1<x<101\$ \$−1<y<x−1\$ \$0<n<10^6+1\$ As answer can be very large, ...

 
I think the fourth is a problem, so two directly following commits might be problematic.
 
Well I for now have a 5 second delay between posted messages
I should be able to have a counter that forces throttling every 2nd message
Now I need to use my brain for a moment
@Vogel612 It now counts from 1 to 2 to 3 to 6, it looks like I need to learn how to count again
 
@skiwi wut?? why not from 2 to 4 to 6??
 
7:02 AM
it skipped 4 and 5
 
0010 --> 0100 --> 0110 --> 1000 -> 1010 --> 1100 --> 1110
why that?
 
because it couldn't post them to chat
Probably I messed up things...
@Override
protected void beforeExecute(final Thread thread, final Runnable runnable) {
    currentBurst++;
    if (System.currentTimeMillis() < lastExecutedTime + throttleTiming) {
        if (currentBurst == maxBurst) {
            try {
                TimeUnit.MILLISECONDS.sleep(lastExecutedTime + throttleTiming - System.currentTimeMillis());
                currentBurst = 0;
            } catch (InterruptedException ex) {
                thread.interrupt();
            }
        }
    }
    else {
More complicated logic...
 
I don't understand the purpose of throttleTiming in that if-condition....
 
And I do spot logic errors there
throttleTiming is the minimum time needed between a new message, say 5000ms
The idea is that it ignores the throttling one time
 
so you're making a busy wait before posting it, in case your throttle interval hasn't been fulfilled??
why not just make a blocking queue, and pop two messages at a time??
and manage timing there and not before execution?
 
7:09 AM
Well... sleep isn't exactly a busy wait and it is on it's own thread after all, but not claiming it is a good solution
@Vogel612 Something like that could work as well indeed
 
7:24 AM
@skiwi you're overly complicating it ain't ya?
 
@Vogel612 Perhaps
 
7:38 AM
Great, I'm not able to move away chat messages as room owner... Selecting chat messages shouldn't be that hard, right?
 
8:13 AM
0
Q: Restructuring small program to contain multiple methods

iamaSCRUBamaThe code review section of stack exchange was recommended to me in my original thread, so I'm going to copy my original post. Basically I could use some tips on adding every step (as explained below) into its own methods. Thanks again. I'm new to c# so be ready for some dumb questions. My cu...

 
8:48 AM
0
Q: Any tips on our China tour?

user83011We'll be traveling to China,what are the best places to see IN Beijing ?China is a vast and interesting country.The language barrier should be the number one hurdle to overcome for a foreigner when traveling to beijing. Beijing: China’s capital city of Beijing has numerous world-class sites. Ther...

 
@CaptainObvious Spam flags please.
 
9:20 AM
@skiwi Bogie DOWN!
 
9:38 AM
0
Q: QSqlDatabase - correct way to handle connection

SimplusWhat is correct way to handle connections for QSqlDatabase? In my program I am doing it this way: DatabaseConnector *databaseConnector = 0; try { databaseConnector = new DatabaseConnector(); //Do stuff... delete databaseConnector; } catch(QString e) { delete databaseConnector; ...

 
9:59 AM
@rolfl IBM and Apple creates a partnership? Now I'm not so sure if I want to work for IBM...
@CaptainObvious If you're going to spam, then you could at least have tagged it properly?
 
@SimonAndréForsberg suggestions??
 
@Vogel612 of course. is crap, that question was crap. So that question should be tagged with
 
@SimonAndréForsberg is crap, literally
 
Monking @all
 
Monking @Nobody
@skiwi but it's often easily reviewable..
probably most of my points come from the 2-3 questions I answered.
*food*
 
10:38 AM
@SimonAndréForsberg IBM has a partnership with almost everyone.
 
@rolfl That is true. Didn't think about that.
 
I am heavily impacted by this 'partnership': en.wikipedia.org/wiki/OpenPOWER_Foundation
That puts some big industry names in one place, IBM, Google, Mellanox, NVidia, Tyan, Altera, and, dum dum dum, Samsung
 
0
Q: Splitting an array in 2 parts such that one part sums to a multiple of 10 and other sums to an odd number

AnirudhGiven an array of ints, is it possible to divide the ints into two groups, so that the sum of one group is a multiple of 10, and the sum of the other group is odd. Every int must be in one group or the other. Write a recursive helper method that takes whatever arguments you like, and make the ini...

 
10:53 AM
\o @DanPantry
 
11:07 AM
0
Q: UISegmentedControl with views animation

shay tei am new to iOS/swift, i have create a UISegmentedControl and a view under it , the view under contains all a view for each segment i am doing animation when the segment is changing. a couple of questions : 1) dose a center view that contain all subview is the right approch ? 2) is the animati...

0
Q: C++ program that turn numbers into text

Amessionagain! Here is my program that turns numbers into text, it can be extended to Millions, Billions, Trillions and so on. Please review my code and here is what I expect from the users: Is there any better variable names, function names, you can give me? Or my given names are okay? If you've bette...

 
Welcome to Chat @MartinR
 
11:38 AM
oh wow, that latest C++ question...
 
0
Q: Is this the most efficient way my jQuery can be done?

SaiyanToasterI have a navigation bar without a tags, here's my code: $('div.nav ul li').on('click', function() { if($(this).is(':first-child')) { $("html, body").animate({ scrollTop: "0" }, 'slow'); } else if($(this).is(':nth-child(2)')) { ...

 
1
Q: Attribution and Copyright of Problems

timHow should it be handled if a User asks a question where the original problem is from some website and under copyright? For example this question quotes a problem from a website which says at the bottom Copyright [person] 2006-11. I basically have three question: is this a legal problem or i...

 
12:10 PM
@Yuushi what do you mean?
 
@Nobody There's a lot of things to fix there...
 
Yep, the OP marked my answer as accepted 2mins after posting :( There need to be more C++ reviewers around
I was overwhelmed by the things I wanted to say and needed to stop
 
12:36 PM
Monking @all.
 
Hey Ducky
 
How are ya on this fine Monday morning rofl?
 
Mostly good. Working on a challenging predicament at work (mostly challenging because of the human, not technical component).
Othrwise, my parents have been staying with me for the past two weeks and will be around for the next 1.5 weeks too. This is..... hard.... for me.
 
Greetings, Programs.
 
Bitwise Overlord Wannabe! Hi!
 
12:43 PM
@Donald.McLean Greetings, User
I kinda love how the inverted link-color for mod-names matches your picture's main color @rolfl
 
Ah, that inverted... ;-)
@Donald.McLean I keep thinking that you want someone to respond:
> Greetings Professor Falken
> Would you like to play a nice game of Global Thermo Nuclear Warfare?
 
@rolfl Joshua never wanted to play that. He tried to talk the kid into a nice game of chess.
 
> SHALL WE PLAY A GAME?
3
 
@rolfl lol
 
> You will have to chose.
 
12:48 PM
But that was waaaaaaayyyy before Tron.
 
Tron was a cool movie
 
I'm just glad that the second movie was actually good. So many sequels are lame.
 
@rolfl Try living with your in-laws......
2
@Donald.McLean Legacy was really good IMO.
I too was happy to see it done well.
 
In case anyone hasn't read it before
(warning: PDF)
 
1:05 PM
@SimonAndréForsberg Why are we talking about CR closing?
 
> A systems programmer will know what to do when
society breaks down, because the systems programmer already lives in a
world without law
5
 
2edgy5me
 
> As a systems hacker, you must be prepared to do savage things, unspeakable things, to kill runaway
threads with your bare hands, to write directly to network
ports using telnet and an old copy of an RFC that you found in
the Vatican.
and then:
> HCI people discover bugs
by receiving a concerned email from their therapist. Systems
people discover bugs by waking up and discovering that their
first-born children are missing and “ETIMEDOUT ” has been
written in blood on the wall.
 
yeah, there's many, many things in there that make good quotes
 
I noticed :) I will stop pasting the whole document here ^^
 
1:11 PM
> This is not the world of the systems hacker. When you debug a
distributed system or an OS kernel, you do it Texas-style. You
gather some mean, stoic people, people who have seen things
die, and you get some primitive tools, like a compass and a
rucksack and a stick that’s pointed on one end, and you walk
into the wilderness and you look for trouble,
I had to share one more.
 
this thing is a gold mine
 
Me too, this answer has been waiting so long:
 
yaaaaaay
 
> Why not use
a modern language with garbage collection and functional
programming and free massages after lunch?” Here’s the
answer: Pointers are real. They’re what the hardware understands. Somebody has to deal with them. You can’t just place
a LISP book on top of an x86 chip and hope that the hardware
learns about lambda calculus by osmosis.
 
it's @BenVlodgi!!!
welcome back! ;)
 
1:12 PM
:)
howdy @Vogel612!
 
@DanPantry okay I accept that you aren't Ben now ;)
 
if you enjoyed that, he's written others, you can probably find them somewhere on here
 
@Yuushi Is there a room owner around, this needs pinned so everyone can enjoy at their leisure.
 
Probably @rolfl
 
Or any mod
 
1:17 PM
@Vogel612 how so?
 
3
A: If a program terminates and there is no one to see it, does it halt?

Beta DecayPython 3 - 74 Although it's not the shortest, it does do something useful: calculates Pi to unprecedented accuracy. Just in case you were wondering, this program loops 1E2000 times. That should outlive the universe by far. p=0 for i in range(1000**1000): if i%2==0:p+=4/(i*2+1) else:p-=4/(i*2...

 
I've been traveling for work for the last month
And at some point during that time I got 3k rep w00t!
 
now I should look a lot different from Ben given that I have a new photo :)
 
@DanPantry we had that "discussion" that you were never "seen" in one place together ;)
 
Ah yes, I remember now
 
1:20 PM
@BenVlodgi good to have you back
 
tnx @Malachi
2
glad to be back!
 
time to vote on all my new answers, in a staggered fashion so as not to trip the auto scripts :)
@BenVlodgi what do you do for a living?
 
lol
I'm a software engineer
 
Hi everyone! I'm back to work, so I'm back here too :D !
 
ho humm
has anyone used Google Guice before?
actually
I'll make it an actual question
 
1:25 PM
@Vogel612 I also have never seen Ben and Jon Skeet together???
 
@BenVlodgi no openings where I want to move to..... :(
@DanPantry and @BenVlodgi together at the same time, he must be on two separate computers.....
 
Or in incognito mode on Chrome
2
 
0
Q: STL Deque Implementation

Kaidul IslamI've implemented a simple C++ STL like deque. It's pretty simple, all the constructors and methods haven't been implemented here, but majors are. #ifndef DEQUE_H #define DEQUE_H #include <iostream> #include <stdexcept> template <typename T> class deque { public: deque <T> & operator = (c...

 
one of my better answers and only 2 upvotes? @Mat'sMug @BenVlodgi and all you other C# experts programmers check it out, make sure I am not a rambling idiot.
2
A: Generic ASP.NET MVC controller that generates many pages

MalachiThis switch should be an if statement instead. if (input == null) // we didn't get an input from GetCustomEditorInput { switch (property.PropertyType.Name) { case "Boolean": input = new ExpressFormsCheckBox() ...

right now I need to install some vbscript to the 3rd party app
 
@Malachi oh well at least there's no mem-pointer with a value of 7 in your code ;)
@Malachi also, don't compare Strings with ==, but with .equals()
 
1:31 PM
bleh. I have a question that isn't a hypothetical btu is kinda discussing a this-or-that. I don't think this belongs in Code Review huh
 
@DanPantry so what is it?
 
I have a choice between decorators or aspects.
Guice doesn't seem to play ball with decorators and wants you to use aspects.
simply put, I need to defer X methods of a class onto a thread. They need to go through this thread. I can either use aspects to do this or I can use a decorator for the entire class
not sure which is the best course of action
 
I heard that before...
 
And the threading is implementation detail so I'd like it as if it wasn't exposed as another interface that the client has to know about
@vogel612 that sounds ominous
 
in The SO Tavern (Free Snacks) on Stack Overflow Chat, Aug 20 at 12:55, by Vogel612
 new MyWorld() { //class MyWorld extends World
      @Override void setBlock(){
          myCoolTrackingMethod™();
          super.setBlock()
      }
 }
here...
in The SO Tavern (Free Snacks) on Stack Overflow Chat, Aug 20 at 12:51, by Unihedron
in Java, 21 mins ago, by Unihedron
Is there a way to track when a method has been invoked without access to modifying the source code of it?
 
1:36 PM
The question of how is not a problem, its' more of a question of which would be better aha
 
hmmm
post samples?
 
sure thing
well, currently I only have the one, derp
 
looks like aspects seems to be the better choice though.
 
	@ExecuteOnDisplayThread public void start() throws DisplayException {
		// Open the Display
		try {
			Display.create();
		} catch (LWJGLException e) {
			throw new DisplayException(e);
		}
	}
The Display.create() call would need to be on X thread
 
d000de that Exception name...
 
1:37 PM
It's an example.
 
so on a new thread??
 
well, initially, yes
any subsequent call to Display would also need to be on the SAME thread
because it creates an opengl context
 
this sounds like a job for SwingUtilities.invokeLater(() -> { Display.create(); });
 
as for the exception name it's just a catch-all because the interface is called DisplayWindow
Yes, I agree there, however, I don't think it is the responsibility of the LwjglDisplayWindow to know where it is executing
 
sure it isn't ;)
why not move the whole calling code into a separate Runnable / Thread?
 
1:40 PM
Well, I suppose I could do that >.>
 
I hear a but there?
 
monking :)
 
Although, that does mean then that any time I want to access the display thread
I need to execute on that thread again
 
monking @Schism
 
somehow, which is what lead me to ExecutorService with a ThreadFactory that only returns a single thread like you mentioned
 
1:41 PM
sounds right to me..
 
Yeah, that's fine.
I get that.
 
it sounds like a good idea to put that up for a
 
I guess I will, haha, after I have more of a sample and a use case to explain
I didn't even know that tag existed.
Monking @Schism
 
@Malachi Because the Mug is worried that we haven't graduated
 
We're fine. I trust Pops when he says they're working on something.
2
Does anyone garden? This beta needs more active members.
 
1:46 PM
@Vogel612 it's actually not looking for a string it's look for null because of the other method that was called
@SimonAndréForsberg @Pops was talking about another review or something last week though
 
@Malachi do it.... michigan
 
@BenVlodgi I live in South Dakota, it's cold here in the winter, I want to move south to somewhere like Tennessee or somewhere close to there, in the smoky mountains...
 
@Malachi michigan is baller... crazy unpredictable weather
no toll roads (that I know of)
 
@BenVlodgi like South Dakota, Minnesota is predictable though cold and snow for the winter
 
monking!
 
1:50 PM
Monking @Mat'sMug.
 
monking indeed
 
@Mat'sMug monking (:
 
@Malachi looks pretty good... could use ternaries
 
@SimonAndréForsberg not worried, rather annoyed. it's different ;)
5
 
but not nessesary
 
1:52 PM
Morning @Mat'sMug
 
hey @Marc-Andre!
@RubberDuck I don't trust anything that says "6-8 weeks". @Malachi is with me on this :)
3
 
lol.... It's an entirely different kind of zen than what I get when I code.
 
@Mat'sMug Where is our SWAG?
 
unicorns ate it I guess
 
@BenVlodgi they would be some complex ternaries. I was trying to wrap my head around what I did there.... :) but I see what you are saying, can you put a block of code inside of a ternary statement?
Kill those Unicorns!
 
1:59 PM
Monking!
 
> You've earned the "Necromancer" badge (Answered a question more than 60 days later with score of 5 or more) for "Logging into WebAPI 2 site from c# desktop application".
4
Thank you Santa(s)
 

« first day (478 days earlier)      last day (3521 days later) »