« first day (820 days earlier)      last day (4137 days later) » 

user34537
8:00 PM
so you cant think of one where we would need it if we programmed the site stackoverflow?
 
it is a big system with lots of code, and it is very hard to run any one small part in isolation
well - what are some dependencies SO might have?
 
user34537
i'll let you choose ;P
 
you're kinda making my life hard here
let's take open id
I'm guessing they have an api
but I'd like to be able to code against that api without actually having to call a live instance of it
and without having to build my own fake open id provider
so all my logic that works against the results of calls to the api, instead works of dependency injected instances.
 
user34537
hmm.. what are you testing in this scenario?
 
so now in testing I can just pass in a fake or mock and focus on the logic that I care about in that momeny.
all the logic that relies upon the response for the api
 
user34537
8:06 PM
hmm. Ok so here are my thoughts and options. 1) Have a dev instance 2) Not test it <-- don't really need to test 3rd party implementation 3) hmmm uhhh
 
but you aren't testing the 3rd party implementation
 
user34537
i'm guessing you dont like these options. But ...
 
user34537
oh i know
 
you are testing your code that uses the results
 
user34537
In my user class i
 
8:07 PM
and having a dev instance can be a really pain sometimes
why set that up when I can just work against a canned class that does exactly what I need?
 
@DavidHall & @acidzombie24 you should come here more often imo
 
user34537
In my user class i'd* have a login function that uses openid. I'd instead have a bypass option which calls another function that returns structure i expect from openid. Because i only need to test my login logic this is completely fine and will actually test MY logic
 
user34537
sure i'd have two version or a early return becaue i'mcreating a dummy class instead of using the real thing but that really should be one function or very tiny. I also wont have to touch much code
 
user34537
@JohanLarsson haha
 
user34537
We are debating the use of DI on my question stackoverflow.com/questions/14301389/…
 
8:10 PM
@JohanLarsson I'd never get any work done :)
Sure - those approaches work well too. But you are adding logic to you class that doesn't need to be there. In this case the bypass.
the nice thing about DI is that the only change you make is you pass in an instance, instead of having the "new" statement
 
user34537
But if you were to use DI. How would you create the dummy result to use if you're not using a real openid instance?
 
I'd just introduce an interface and mock it out - or create a really simple stub
 
user34537
Would that be more code/complexity then what i'd do? -evil grin-
 
I would say yes it would
I'd much rather isolate that to a single bootstrapper, IOC call, that have lots of conditionals in my code base that are only supporting testing/isolation
 
user34537
AFAIK it would really only be in one method and one conditional
 
8:16 PM
but then you have similar conditionals for every method in your codebase that has any sort of dependency
 
user34537
You mean one conditional per dependency?
 
yes, potentially
it is a fine run thing
but I find the ability to inject dependencies personally very convenient
if nothing else, I personally find code that has been written that way (by me) is better focused on the task at hand
 
user34537
hmm, i get it now. How would i DI a fake openid implementation for the unit test we're talking about?
 
the examples on the original question show it pretty well
you have an interface that describes what the openid api does
then you have a ctor parameter of that interface
 
acidzombie2, have a look at some articles on "Coding to interfaces", for example: stackoverflow.com/a/4456450/383710
 
8:20 PM
now - back to integration testing vs unit testing
your class that uses the results of openid calls is one part of the story
 
As with all things, you'll find places where people take it too far or misuse it, but when dealing with external dependencies, it can be very handy.
 
you still will need a class that actually calls the api
 
user34537
ok but lets say the code doesnt use DI or my implementation
 
user34537
I explained i'd just modify one function + add what i need to create a dummy return struct/class. What woudl need to be changed/added for DI to be used?
 
and that class should be integration tested, calling something physical - potentially the open id provider has a testing api
sorry - not 100% sure I follow the question
are you asking how to change a method to use DI, within an application that has now been architected to allow DI>
 
user34537
8:22 PM
Lets say SO doesnt use DI for openID and you want to unit test it with DI. What code do you need to write in
 
you need to replace the line:
var openIdProvider = new OpenIdProvider();
 
user34537
yeah thats what i was asking -is quiet now-
 
with an IOpenIdProvider that is passed in from outside
generally that is best/tidiest through the constructor
but you can (i guess)
pass it in as a function parameter too.
 
user34537
ah
 
@DaveShaw yeah, agreed on the taking it too far :)
Though I've had more situations where I've wished the application I was working on had thought of DI as a part of the design
I'm quite firmly that the D in SOLID is the key enabler for all the other principles
 
user34537
8:25 PM
I still would prefer my class to short circuit and return a class with all the info it needs rather then create a dummy implementation but I see what you mean. I also left in the comments how i'd replace the Logger in that answer/example.
 
Open Closed in particular becomes much easier to achieve when you have a DI architecture
 
@DavidHall That's true of "idea" in programming :). Everytime I see Programmers question on "Should I always X idea?", the answer is always either "sometimes/depends/etc".
 
user34537
I have a question for you both
 
user34537
Should singletons EVER be used?
 
DI helps with a lot of the SOLID principals.
 
8:27 PM
lol
maybe
sometimes
 
"sometimes/depends" :)
 
or never
 
user34537
NEVER
 
:)
static variable / classes are very similar to singltons
and they 100% have their uses
 
user34537
Lukily I know someone who agrees with me. Otherwise i'd think i'm slightly crazy. But singletons should NEVER be used
 
user34537
8:27 PM
it is the setjmp of the OOPS world
 
but I'd say from my experience that 99% of the time there is a better option
 
user34537
100% ;P
 
(that singltons, not than static)
lol, yeah probably
 
user34537
I know people who also dislike using static variables
 
Can I add a java openGL application INSIDE a JFrame?
 
user34537
8:28 PM
singletons REQUIRE static variables....
 
I try and avoid static variables/classes
was thinking about that just yesterday actually
 
I know people who dislike using variables at all ;)
 
user34537
haha
 
trying to work out why I feel that way
:)
 
user34537
David: cause it makes unit testing harder
 
user34537
8:29 PM
you have to worry about state
 
lol, yeah!
 
user34537
something you didnt know could accidently set/change it
 
that is what I ended up realising
 
user34537
its liek global variables except not obvious
 
The more you look at FP, the less fond you become of any state
 
user34537
8:30 PM
wait... am i talking about singletons or static vars?
 
user34537
;)
 
*mutable state
 
user34537
FP is cool but i wouldnt use it
 
user34537
i'm not into it
 
I like FP as something to fiddle with - and find that when I'm using a language like Python with better support for it, that I will use a more functional style
 
8:32 PM
Do you use Linq? If so, you're already using Functional concepts ;)
 
but I'm still learning OOP for crying out loud!
I'm a recovering Fortran programmer - it is baby steps for me :)
 
user34537
I do but mostly .First/Take/Skip/Where/Select/ToArray/ToList
 
@acidzombie24, you've made it onto the "Hot Questions", just off the bottom of the initial view. 36 points.
 
user34537
oh and contains
 
user34537
i knew for a while. It had 40 an hour or two ago
 
user34537
8:34 PM
I wrote the question last night. I was surprised this morning
 
yeah - it was how I found the question. hopefully you at least why someone might consider DI ;)
if you haven't I can firmly recommend the SOLID principals from Bob Martin, and anything on the subject from Martin Fowler
(if you haven't read them already) I'm learning german at the moment - totally broken my english.
SOLID in particular solidified a lot of my reasons and liking for DI
I'd already started doing it before reading about the principles, but they gave me a lot of lightbulb moments
 
user34537
I still dont like DI but at least i understand it.
 
user34537
It STILL sounds like a solution to a problem that doesn't actually exist
 
cool :)
 
user34537
;P
 
8:39 PM
it is very "enterprisey"
so the examples you were asking for using SO, probably not the best
 
user34537
eyah
 
user34537
yeah*
 
but I find for really big involved applications it can carry its weight
 
user34537
ah
 
user34537
I have a question for you guys
 
user34537
8:41 PM
Is it me or do all the new languages seem to be... hippies?
 
user34537
(or very theoretical)
 
define new
not sure I'd call ruby theoretical - thought maybe hippy I'd accept
thought I'm written may three lines of ruby in my life
 
user34537
ruby isnt new
 
I thought it was late nineties or even later?
feels new to me :)
 
user34537
new is anything in the last 5years or perhaps after C# (.NET2)
 
user34537
8:43 PM
nah after a decade it cant be new xD
 
user34537
like D isnt new
 
some examples?
I can't think of any off the top of my head
 
user34537
oh shit, D is 2001, just over a decade wow
 
user34537
Actually coffeescript is cool and new
 
yeah - javascript frameworks are the closest I can think of
 
user34537
8:45 PM
uhhh i cant rememebr the names. I seen many on reddit. Theres a stackbased one. There was a kind of cool one based on markdown.
 
I understand coffeescript to compile to javascrpt... or something
out of touch with it
 
user34537
code.google.com/p/epoch-language is another. haxe.org is the other one (besides coffee script) that seemed decent
 
user34537
go and dart i don't like ;P
 
I need some on-the-fly market research. What's the smallest denomination of an amazon gift card you'd be willing to buy?
 
Uhh uhh uhh
 
user34537
8:47 PM
but those are less hippy and could be useful. I dont know what i think of grovy
 
I don't buy amazon cards, but likely $25
 
CC, you're always my sole data point.
 
I'm a null point on this one, probably because I'm European, Amazon just sounds like pita
 
I'm out of the loop with new languages I think :) on my last job I was back writing c++ with Python as the new shiny thing to use
 
user34537
jobs exist for C++ programmers!?!?!?!?!?!
 
user34537
8:50 PM
I like C++
 
user34537
Actually i only like my C++
 
The symbol you're looking for is "#"
 
LOL
 
hi folks
 
{C, C++, C#} (ordered)
 
user34537
8:51 PM
I see plenty of C# jobs
 
@ActionHank ! I bought a bike yesterday. I rode it in the snow last night and this morning. Am I Dutch now?
 
user34537
I have a question
 
user34537
Why is Java popular?
 
maybe I was lucky? It was a funny one actually - got the job as a c# dev, then after discussion the boss asked if I could do it in c++ (needed as few library dependencies as possible so even .net was out)
 
@Billdr Oh. So. Dutch.
 
8:51 PM
I've always thought it was the name.
 
@acidzombie24 Java is not popular anywhere I know
 
People like coffee, java is sort of a name for coffee
 
user34537
When I first learned it, enums didnt exist. So I thought it cant be a real language if it doesnt have enums. So... why did it get popular and used for enterpise stuff?
 
hence...
 
@DavidHall my best guess is the learning curve
 
user34537
8:52 PM
maybe its the first language that had decent bytecode and didnt crash when you made a mistake?
 
Write once, run ...some places.
 
my only experience with Java was helping a friend with uni homework - when I went through uni it was all c++/fortran. With java I was able to instantly understand the code and start helping with the problems, so @ActionHank you may be right - a slightly more forgiving language which is still familiar to c++ devs perhaps
 
@JohanLarsson Where can I find some english help?
 
I think I'm going to have to wait a few months to get enough capital to start on this gift card thing. That is a bummer.
 
@Billdr What was it?
 
8:54 PM
In Java you have a sense of choice too
 
@CCInc I speak English. I do a damn fine job of it.
 
IDE, frameworks, db, you can be free to choose
 
@CCInc English chat? what is the question?
 
@acidzombie24 was nice talking - gotta go do things like eat :)
 
@CCInc A bitcoin to gift card store.
 
8:55 PM
@Billdr gift card thing?
ah
 
OK, what's the object of the preposition in this sentance? "Skis are made from plastics and other materials." "plastics and otehr materials", right?
 
user34537
@DavidHall cool, same. I want to actually do stuff today
 
user34537
lets java comments die out
 
@Billdr are they physical cards?
 
I figure I can do the 'instant turnaround' implementation with about $3,000 in startup money.
 
user34537
8:56 PM
cya guys
 
@ActionHank Gross, no.
dead organic matter. Ew. Who'd want to deal in that?
 
@CCInc I would guess from
 
@JohanLarsson That would eb the preposition
where's that english chat?
 
ah sry
 
@Billdr why the capital then
you wanna launch big?
 
8:58 PM
@ActionHank Try to find a place that'll sell you gift cards on the fly.
 
Like eCodes?
 

 English Language & Usage: Multi-Layer

Not for the faint of heart or those easily triggered by Englis...
 
ecodes?
 
Like just the gift card #
 
@Billdr I misread your business I guess :P I thought you meant birthday cards and the like
 
8:59 PM
@ActionHank oh no. Gift cards, like... $25 at amazon.
 
@JohanLarsson your country just went 'first' on my cool country list, thanks to a Koenigsegg video coverage
 
@ActionHank link?
 
I REALLY like this guy's vision. Building high quality products that are 'build to last/be upgraded'
@Billdr so if I have bitcoins, I can trade them for gift cards from selected partners?
 
@ActionHank That's the plan
I'm thinking Riot Points, XBL, PSN and Steam out of the gate.
Since the venn diagram of btc users is almost completely encompassed by the circle for people who play video games.
 
Sounds like a plan!
 
9:09 PM
I could do a really small test launch with $500. Then I'd have an idea of how many of each I'd need.
to visual studio!
 
Yeah, maybe just like a 'probe' test phase
Okay, I'll go to my bed then :P
I'm having a performance review tomorrow
 
You will get a huge raise.
I see it.
 
I will, if I don't mention C# chat of course ;)
See y'all later!
 
CC, destroying chat rooms one javascript at a time.
 
9:14 PM
...
19 mins ago, by CC Inc
OK, what's the object of the preposition in this sentance? "Skis are made from plastics and other materials." "plastics and otehr materials", right?
 
@CCInc I think I got just the website for you, hang on
 
You are right.
sorry, I'm smoking crack.
 
OK, good
thanks
not good
 
Plastics and other materials are the object, skis is the subject
 
ok
 
9:24 PM
@Billdr I hope not!
 
goddamnit, godaddy's squatting on the domain I want.
 
@Billdr That not THEIR fault
 
GoDaddy is always to blame
2
 
I need a clever name for a bitcoin giftcard exchange. Go.
 
GiveAHitman
 
9:32 PM
?
 
giftCoin
warming up
 
giftcoin is already a thing.
giftbit was my initial idea.
 
not bad
 
bitgift, dunn
maybe not something a wide audience will remember
 
bitgift is also taken
...I can point subdomains to different servers, right?
So giftcard.billdlabs.com goes to azure, and billdlabs.com goes to my lamp site?
 
9:47 PM
coinYou
 
 
1 hour later…
10:47 PM
can you beleive this guy expects an answer
0
Q: Create a setup for windows application including DataBase

Kam2012I want to create a setup for my windows application (visual studio 2010) and also want to include Database (MS sql 2008) with the setup. Could anyone tell me how to do that, please.

with 0 acceptance and a LGTFY question
 
LGTFY?
cc/urban lgtfy
 
@CCInc oh
lmgtfy
 
:)
 
@CCInc why isnt your bot working?
cc/Are you there?
 
@JABFreeware Yes.
 
10:54 PM
cc/rep Jabfreeware
 
@JABFreeware Command rep does not exist.
 
cc/listcommands
 
cc/user jabfreeware
 
@JABFreeware help, listen, eval, live, die, refresh, forget, ban, unban, info, jquery, choose, user, listcommands, purgecommands, define, norris, urban, parse, tell, mdn, beautify, convert, get, google, hang, hangs, image, learn, nudge, regexexplain, s, ss, spec, stat, timer, todo, undo, wiki
:7166780 http://stackoverflow.com/users/1739957
 
cc/user jabfreeware
 
cc/stat jabfreeware
 
@JABFreeware JABFreeware has 989 reputation, earned 117 rep today, asked 8 questions, gave 49 answers, for a q:a ratio of 8:49.
 
@HangBot thats good @CCInc
 
Not a bad Q:A ratio @JABFreeware
cc/stat ccinc
 
@CCInc CC Inc has 1328 reputation, earned 62 rep today, asked 17 questions, gave 47 answers, for a q:a ratio of 17:47.
 
10:56 PM
hmm...
 
@CCInc seems like you get more points per answer
 
yeah
 
@CCInc course, what is that one that has like 80 points
 
@JABFreeware Which one?
 
@CCInc what why there should have been a "?" there
I dont remmeber
 
10:58 PM
7
A: Use String.split() to extract number?

CC IncTry this to remove the first character of a string: string removed = ID.Remove(0, 1);

 
oh well
I wasnt thinking
cc/ban KenallFrey
 
@JABFreeware Registered; need 1 more to execute
 
@CCInc we need one more
 
@JABFreeware you forgot an "l"
 
LOL :)
 
11:00 PM
cc/ban kendall frey
 
@CCInc Cannot find user kendallfrey.
@CCInc Cannot find user kendall. Cannot find user frey.
 
cc/ban KendallFrey
 
@JABFreeware Already registered; still need 1 more
 
cc/ban KendallFrey
 
@CCInc Cannot find user KendallFrey.
 
11:01 PM
...
 
@CCInc grrr
NO
NOT THE TRIPLE DOTS
NO PLEASE
The dreaded triple dots. I HATE THEM!!:O :O
I may pass out!
 
Those were adressed to bot
 
@CCInc :( they are in my presence, darn it!
What does it mean that we need one more @CCInc?
 
Community banning
voting
Somebody ping me if @weiszam shows up
 
@CCInc k, why?
 
11:08 PM
heyy
 
@CCInc He is here!
 
Hello!
 
Thanks very much for helping me.
 
@CCInc who is he?
 
@weiszam Sure! So what would be the issue?
 
11:10 PM
First it said that I should switch to a higher .net framework in properties, I did so, but it still does not understand the id3.info.chartlyrics and lyrdb.
i wrote in using id3.info; and it worked
but not the other two
what other reference should i add?
 
You mean id3.info.chartlyrics was not found?
 
yes
you know the usual thing: The type or namespace name 'ChartLyrics' does not exist in the namespace 'Id3.Info' (are you missing an assembly reference?)
 
Did you download the .4 beta or the .3 stable?
 
i think the stable
 
First you should make sure
OK
 
11:14 PM
okay i download the .3 again and add them as reference
 
I think you need to reference all 3 DLL's
 
i did reference them
 
Same error?
 
yes
okay i removed and added them again, same error
 
I will try it
 
11:17 PM
thank you
if you have this working you could send it to me and then i'll have it
i'm sorry it's getting late i really have to go. could we continue this via email later? contact me please if you have something: weiszam@mail.com
alright?
 
@weiszam @CCInc
^
 
@CCInc
 
@weiszam I'll tell him on skype if he doesnt see it
 
@weiszam OK!
 
thanks @JABFreeware :)
good. thank you very much again!
@CCInc looking forward to hearing from you then. Good Night!
 
11:23 PM
Night!
 
11:35 PM
@CCInc looks like they like your bot in ELU!
 
@JohanLarsson Yay!
 
@JohanLarsson what does that mean?
 
@JABFreeware having a look if I find something I understand & like :)
 
@JohanLarsson fine
 
found++
 
11:43 PM
YAY YAY YAY YAY NOW I AM AN ESTABLISHED USER YAY YAY YAY
See @CCInc????????????
 
Hurumm
cc/user jabfreeware
 
OMG
 
cc/stats jabfreeware
@CCInc
 
@JABFreeware Command stats does not exist. Did you mean: stat
 
11:45 PM
cc/stat jabfreeware
 
@JABFreeware JABFreeware has 1009 reputation, earned 137 rep today, asked 8 questions, gave 50 answers, for a q:a ratio of 4:25.
 

« first day (820 days earlier)      last day (4137 days later) »