« first day (219 days earlier)      last day (4720 days later) » 
00:00 - 21:0021:00 - 23:00

12:19 AM
i want to excesss coding for these algorithm from this link ..
Can i get codding of these algorithm by this web link?
 
12:52 AM
I need a SHA1 function. Problem: boost doesn't have one :(
 
 
7 hours later…
7:30 AM
@CatPlusPlus s/mentioning/recommending/
 
hi all
Can I have a variable in a method which has the same name as an instance variable of the concerning class? What about arguments in the constructor?
 
7:49 AM
yes
use "this->" when necessary
but it's not necessary with: struct A { int n; A(int n) : n(n) {} };
 
8:02 AM
but this doesn't work with initialization lists, right?
 
avoid "initialization list" for that, as the term gets a new meaning in 0x
you can't use "this" when naming members and bases in the ctor initializer
": a(a)", or ": n(n)" as in my example, works fine
 
ah let me try..
cool
 
8:36 AM
how can I dereference a pointer instance variable
this->*blah doesn't seem to work
neither with brackets
 
Do you mean *blah? Alternatively, *this->blah (->* is a different operator btw)
 
humm I think the problem is my class doesn't have a default copy constructor, since it cannot be constructed w/o arguments
 
sbi
@Nils There is no such beast as a "default copy ctor", although there are default ctors and copy ctors.
Also, while intellectually interesting, I would strongly discourage shadowing variables. Knowing that : n(n) works is a nice thing to boast with at a geek party, but a bad thing to use in real code.
 
As far as I understand it there is a default copy constructor unless you have reference members which need to be initialized at construction time. Then it's no longer possible to have a constructor with no args.
@Sbi Why? Couldn't find a meaningful name for the variable used in the constructor arguments
 
sbi
@Nils Ah, that's the compiler-generated/provided copy ctor. Yes, such a beast exists.
@Nils What's the name of the data member?
 
8:51 AM
a
:)
@sbi but not if one cannot construct the class w/o arguments, right?
 
sbi
@Nils Arguments have nothing to do with copying. A copy ctor/assignment operator will be generated unless A) you declare your own or B) the compiler-generated won't compile. A default ctor is generated unless you declare any ctor yourself. A dtor is generated unless you declare it yourself.
 
So if you cannot have a constructor w/o arguments the compiler-generated won't compile and so you don't get one.. right?
Is this explained somewhere?
 
sbi
@Nils What do you mean "cannot have a constructor w/o arguments"?
 
@sbi I almost added that caveat, but it's useful with small, simple classes that have public data members
 
sbi
@FredNurk Why would such a class benefit from shadowed variable names in its ctor??
 
9:01 AM
because you can name the ctor's parameters naturally without obfuscation
the vast majority of the classes which I'm thinking about that I write have a ctor of the form T(A a, B b) : a(a), b(b) {/*empty body*/}
 
@sbi Simply because this codepad.org/ZPk3EJ8x does not work.
 
sbi
@FredNurk If you want to name the ctor's parameters the same as (public) data members, then use those names in the documented ctor declaration and use something else in the ctor definition.
 
@sbi practically all of the time these ctors are defined in the class body
 
sbi
@Nils Yes, if you have a reference in a class, copying won't work. Which copy semantics would you want?
 
Yes well just noticed that my design is broken :(
@Sbi but what does the compiler do?
- Trying to create a copy constructor, but remove it because it does not compile?
- Creating a constructor with arguments?!
 
sbi
9:04 AM
@FredNurk If that's the case, then everyone looking at the class definition will see which ctor argument goes into which member even if relationships aren't immediately clear (such as with idx ==> index).
 
@sbi I dislike obfuscation for these reasons, just name it index
@sbi: it's no harder to make the idx => index connection that it is to know about name hiding
in fact, you have to know about name hiding and how it all applies in order to know you should name them differently in the first place!
 
sbi
@Nils The compiler won't provide a copy ctor, because there is no semantics to reset a reference. Whether it tries first, or how else it's implemented, is implementation-defined.
 
ok
 
sbi
@FredNurk idx ==> index is an association my mother would be able to do, while A(int n) : n(n) {} will baffle 8 out of 10 C++ developers I have worked with.
 
9:08 AM
What if I have an auto_ptr to a class with references as members?
 
sbi
@FredNurk You don't need to know about name hiding to want to avoid that. In fact, that you don't know the semantics is the strongest possible incentive to avoid that situation.
 
@sbi I think you both have a very smart mother (really: this index example is much too trivial) and work with very poor programmers 80% of the time
 
sbi
@Nils Then you get the semantics of a reference member wrapped in the semantics of an std::auto_ptr. (What do you actually want to know?)
 
Why the example I posted above doesn't work
 
@Nils it's still UB though
 
sbi
9:13 AM
@FredNurk Well, my mother was (in this case, anyway) more figuratively (she doesn't know English and probably hasn't knowingly encountered the term "index" in decades), but, yes, I'm used to work with people who know less C++ than I would prefer them to. (In fact, 80% is a very euphemistic assumption for that.)
 
@FredNurk Thx! What's still UB?
 
@StackedCrooked Interesting, a list of premature obituaries... does Wikipedia also have a list of premature optimizations? ;-)
 
you pass references to local a and b, then use them after a and b have died
 
sbi
@Nils Because you're storing references to objects that are gone out of scope when those references can still be accessed.
 
that the references can be accessed doesn't make it UB; accessing them is UB
 
9:15 AM
ah sure, because a and b are on the stack
 
@FredOverflow Now that would be a good list to have :P
 
A good software design where memory is properly managed manually seems to be quite hard :(
 
sbi
Actually, storing references to external objects in classes often is a problem, because users of the class need to be informed to keep the original objects around long enough, and need to implement that without bugs. That's a brittle design to say the least.
 
@Nils good software design is hard!
 
@FredOverflow we already have that list: stackoverflow.com/questions?sort=newest
 
9:16 AM
@Nils std::shared_ptr?
 
@TonyTheTiger Yes but I feel like in Java/C# it's easier..
 
@Nils depends on what program and the required object model etc
 
@Nils It is, as long as you're only dealing with memory.
 
@FredOverflow Boost again? :) What does share_ptr do differently?
 
And if there are no severe memory constraints.
 
9:17 AM
it's all 1's and 0's after all
 
@Nils shared_ptr keeps track of how many pointers exist, and if that number reaches 0, the pointee is released.
 
sbi
@TonyTheTiger Why would that need a list? Any optimization that isn't backed up by measurements and proven to have noticeable effect on the software's speed is premature.
 
So no more dangling pointers, if used consistently.
 
@FredOverflow pointers, but not C++ references..
I thought using references would be preferable..
 
sbi
@Nils It is.
 
9:19 AM
@Nils C++ references were introduced to support pass by reference. They were never intended to be used as data members to store them for later access.
 
sbi
Why do you think you need to store references to external objects in a class?
 
(The obvious exception are lambdas who capture by reference.)
 
Ah.. so having instance variables as references is probably not a good idea..
 
@Nils It's rarely a good idea.
 
So it's basically used to replace double indirection in arguments
 
9:21 AM
Again, their primary purpose is pass by reference.
I'm not sure what you mean by double indirection here.
 
Well in ANSI C you cannot pass by reference, so if you pass a pointer (to a method which constructs a struct or something) the pointer will be copied and the original will not be modified, if you want to have some mechanism which acts like pass by ref you need to pass a pointer to a pointer.
 
sbi
@FredOverflow int**?
 
Since this is a pain C++ introduced references..
 
It's not just for convenience; the killer feature is operator overloading
 
@sbi so it would have to just say that then and leave a blank list... lol
 
9:34 AM
@Nils AFAIK, the major use case was operator overloading, not simply a relative convenience (relative for a bunch of people knowing very well the C rules, remember C++ and C comes from the same lab).
 
ic it would be almost impossible to have operator overloading w/o references
 
Great. SO's CDN is blocked by corporate firewall. SO is ugly without CSS.
No to mention unusable.
 
@MartinhoFernandes I think most modern sites are.
 
Yeah, but most modern sites don't have their CSS and JS blocked. Somehow the chat still works fine.
I see. Chat is not using the CDN yet.
 
sbi
10:00 AM
Scott Meyers is now on twitter: scottmeyers.blogspot.com/2011/05/…
@Scott__Meyers
13 tweets, 67 followers, following 0 users
 
:(
 
cpx
hmm
 
10:22 AM
Hi every one ...!!
@tonythetiger/: i have a question if you gvie me permission thenn i can ask here/..
 
10:51 AM
Think twice what you ask. :)
 
sbi
So has @Tony, our resident conservative, been appointed as the deity in charge here, handing out permissions to post? I surely missed that election. Or did he just usurp the throne last night while I was asleep? :)
 
@sbi what are you on about?
No one here needs my permission to talk, how silly is that!
 
sbi
32 mins ago, by Miss
@tonythetiger/: i have a question if you gvie me permission thenn i can ask here/..
 
@sbi since when does she think I am even remotely in charge here or she needs my permission to do anything, @Miss, if you have a question, then ask it, I won't stop you, neither do you need my permission. :)
 
sbi
11:06 AM
@TonyTheTiger At least since ~35mins. :)
 
@sbi that's rather silly :P I never claimed the throne... I'll leave that to someone else, if they fancy.
 
@All hi guys
 
cpx
hi
 
sbi
@TonyTheTiger You know what's even worse than usurping a throne? To afterwards deny that you had anything to do with the coup! :b
hi & lo!
 
11:09 AM
@sbi oh, lol
my motto: deny everything! :P
 
If Tony needs to hand out permission to post, how does one ask for it?
2
(I hope I don't get beheaded for asking that without permission.)
 
@MartinhoFernandes good point!
@MartinhoFernandes you should bow for me! :P
 
sbi
@Ammu That won't be enough for the Talkative badge.
 
cpx
lol
 
@sbi I didnt get u
 
sbi
11:13 AM
@TonyTheTiger Wow, what a development! In 3mins from "I never claimed the throne" to "you should bow for me!" Power surely corrupts.
 
@sbi hahah :P
 
sbi
@Ammu Many come here, drop ten useless lines, and disappear again. Those are badge hunters, going for the Talkative badge. You, however, seemed to be short nine messages when I posted this, which is what I pointed out.
 
what is make file in VC++..........any one know? please
 
In software development, make is a utility that automatically builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Make can decide where to start through topological sorting. Though integrated development environments and language-specific compiler features can also be used to manage the build process in modern systems, make remains widely used, especially in Unix. Origin There are now a number of dependency-tracking build utilities, but make is one of the most widespread, primarily due to its inclusio...
 
means make file will compile project?
we don't need visual studio IDE if we have make file?
 
11:26 AM
Two methods are:
- Cygwin + Visual Studio compiler
- Mingw
 
speaking of make, has anyone heard of e-make ?
I've not seen it online anywhere
 
@Reno Never heard of it.
 
It's used to compile files over the network
 
means "make file" using for compiling file over network?
 
It's a part of a distributed build system by some professor
 
11:31 AM
BTW, how to run make file? i have make file then how can i build project?
any one please?
 
ok no problem.......BTW, i am looking for some short cut if available? Thanks
 
shortcuts ruin your fundamentals
 
ok thank you so much for kind reply..........
 
@Reno o hi now u r happy!!!
 
11:42 AM
@sbi but i am not talkative
 
sbi
@Ammu Yeah, I know. I was pointing this out, after all. :)
 
@sbi yep itz ok
 
@Reno, are you of just 16?
means just 16 year old?
its looks strang
 
How is being 16 strange?
 
@Pritesh nope but umm I just to program in c++ at 16 If thats what you wanted to know
 
11:50 AM
ok thanks......but i have shocked when i have seen your profile with age 16.....
@martinh, Being 16 is not strange but being 16 and do programming is strange...is'n it?
 
I'm quite amused that it'd be shocking
@Pritesh not at all
 
I know 14 year olds on SO, also I used to program when I was young so its not really surprising.
 
@Pritesh I started programming at age 12.
Damn programmable calculators got me into this mess ;)
 
ok very good .........BTW.........i don't know how to start PC till 19......
 
11:53 AM
hrmmm wtf
 
now I'm surprised. My mom knew that
 
@Reno When you were young? Are you kidding? You're 16! When was it you were young?
Or maybe you're not really 16, and you slipped.
 
I'm not sixteen :D I just like the number
 
@reno thats nice link
 
well thank you miss xyz
 
11:58 AM
How can It be that I can't access elem 0 in a vector of size 4?
 
you mean index 0?
 
sbi
Haha!
I'm giving a talk at Twitter HQ tomorrow. Do all of my slides have to be less than 140 characters?
:)
 
He should do that :) it'll be kinda funny
 
If I have something like std::vector<gpuScalar> a; as a class member, then it's default constructor is called when I instantiate the class and the object is put on the stack of that object, right?
 
140 characters sounds about right anyway. Nothing worse than people who try to cram a novel into their slides
@Nils yup
 
12:06 PM
Apparently I’m an OOP noob
0
Q: Polymorphic class member variable

Konrad RudolphI have a class messenger which relies on a printer instance. printer is a polymorphic base class and the actual object is passed to the messenger in the constructor. For a non-polymorphic object, I would just do the following: class messenger { public: messenger(printer const& pp) : pp(...

 
well, with the usual pedantic caveats, like "the C++ standard has no notion of a stack"
 
I definitely have to hangout in this room more often :)
@KonradRudolph your question made me weep
 
@Octavian In a good way? Shed manly tears? ;)
anyway, forgive the stupidity, I’ve never actually used OOP in C++ … it’s painful
 
@KonradRudolph in a good way. I don't know when I've seen such a nice formatted and well described problem the last time.
 
oh, nice :)
 
12:12 PM
@OctavianDamiean yes
@KonradRudolph I always wondered: Given an animal such as a cat, what do I need to do to get it's DNA as bit string into my computer? What's a common format to store DNA? How can I reconstruct certain features like eye color from DNA data? ;)
 
@Nils so many questions
storage is easy: the common format is ASCII. I.e. A, C, G, T (and usually N) in a text file
 
and how do you extract it from the cat? ;)
 
In bioinformatics, FASTA format is a text-based format for representing either nucleotide sequences or peptide sequences, in which base pairs or amino acids are represented using single-letter codes. The format also allows for sequence names and comments to precede the sequences. The simplicity of FASTA format makes it easy to manipulate and parse sequences using text-processing tools and scripting languages like Python, Ruby, and Perl. Format The FASTA format may be used to represent either single sequences or many sequences in a single file. A series of single sequences, concatenated, ...
Extraction is f*ing difficult and only a few years ago it cost many million dollars
current prices for a whole human genome (and hence, probably cat) is around 40.000 USD
the technology is called “sequencing” and uses a chemical process to read the DNA strand
and actually there’s a lot of bioinformatics application in getting the raw information into one orderly string of DNA symbols, that’s called “genome assembly”, “mapping” and “sequence alignment”
 
ouh let's hope future iPhone will come with a DNA scanner..
 
fat chance ;)
 
12:17 PM
Bioinformatics sounds quite interesting
 
DNA sequencing includes several methods and technologies that are used for determining the order of the nucleotide bases—adenine, guanine, cytosine, and thymine—in a molecule of DNA. Knowledge of DNA sequences has become indispensable for basic biological research, other research branches utilizing DNA sequencing, and in numerous applied fields such as diagnostic, biotechnology, forensic biology and biological systematics. The advent of DNA sequencing has significantly accelerated biological research and discovery. The rapid speed of sequencing attained with modern DNA sequencing technol...
 
do you also use GPUs?
 
and finally, to extract features such as the eye colour you’d need to know which gene variations (usually there are a lot) are responsible. These are called “SNPs” (= single nucleotide polymorphisms).
in the case of eye colour, I think the feature is quite simple to locate. In most cases, we don’t know what’s exactly causing a feature (yet).
 
is definitely going to be in here more often now
 
sometimes we use GPUs
but clusters are usually better suited for bioinformatics apps than GPUs
since GPUs are notoriously bad at handling large quantities of memory, and genomic data is huge. For instance, the human genome is around 3 GiB in size (uncompressed)
 
12:21 PM
ah interesting.. I guess the most expensive ones come with ~ 4 GB
@KonradRudolph but are the algorithms well suited for SIMT execution?
 
@Nils Not usually, no. SIMT makes sense when individual operations (i.e. the kernel) are relatively expensive. But in bioinformatics you usually use integers, not floats, and only perform very simple operations (additions, comparisons, bit operations) and the control flow isn’t necessarily uniform
I tried parallelising one particular problem on the GPU and failed miserably because of these factors
 
so it was slower in the end?
 
in brief, the algorithm simply wasn’t well suited for the SIM(D/T) paradigm
yup, much slower
 
ok
 
hi @KonradRudolph
 
12:32 PM
hi @Tony
all went well on the way home?
 
@KonradRudolph yes, all went well...
 
sbi
@TonyTheTiger You're exaggerating.
 
@sbi lulz, yea besides the fact I got off the wrong tram stop
but that's a detail, overall it was fine
 
sbi
16 hours ago, by sbi
@Space_C0wb0y Actually he got off the tram at Bornholmer, rather than Schönhauser, and had to struggle to catch his S-Bahn. :-x
 
@sbi, oh yea, we're C++ programmers, we care about details.. :P
oh gosh, that sounded wrong at first...
 
sbi
12:36 PM
@TonyTheTiger You made me look it up in the history. :)
 
You know that now everyone will check the old version?
 
@sbi hahah :P
 
Point in case.
 
@CatPlusPlus I don't mind, it was funny, somewhat... :)
 
12:57 PM
hi!
i asked a question and i dont understand why but i got so much negative vote. what is wrong with my question?
http://stackoverflow.com/q/6090801/598280
thanks.
 
It's not really clear what you need, or what you're asking, and places seemingly unnecessary constraints on the answer
would be my guess
there seems to be no logical reason why you couldn't use the ruby library you mentioned
 
my head, it killeth me
 
@DeadMG that's pretty bad
 
@jalf thanks. but i donw know why is that bad if i place constraints on the answer
i asked this for a particular problem, and for me these are important.
 
@omnosis People often react negatively when you ignore seemingly valid answers for no good reason
why can't you just use the ruby tool, if it's only going to be used offline?
 
1:09 PM
@jalf but the question still good, and waiting for a better answer.
 
@omnosis No, the question is not good if answerers don't understand the criteria that their answer is supposed to fulfill
 
@jalf ah. i understand.
 
that's just my thought on reading the question
the people who downvoted it may have other reasons
but just explaining why you can't use the tool unless it is written in php might help
 
@jalf but i think will not stop the negative downvoting..
 
Of course, asking in the comments why people are downvoting it would likely give you a better answer
since the people who do the actual downvoting might be the one who answer it then
@omnosis maybe not, but whining about it here won't stop it either.
If you want people to stop downvoting the question then do goddamn everything you can to improve the question
don't waste your time whining that you don't think it'll help
 
1:14 PM
@omnosis Eh, I think the question is valid, the constraints make sense (as evidenced by the existence of solutions like SASS) and I hope you’ll find a PHP solution
 
@jalf i will improve my question and explain why php would be better.
really thanks your help
 
that sounds good
anyway, the most reliable way to find out why it is being downvoted is to ask the people who are downvoting it :)
so ask that question in a comment
 
Yeah, just don't go sending emails to random people who happened to comment on the question asking why they downvoted you.
My tortilla fell apart. :( I'm terrible at making food, even if it just involves putting premade stuff together.
 
1:31 PM
@CatPlusPlus oh gosh :(
 
@tonythetiger: i need to discuss a question regarding the concept of coefficient of SE in morphological concept...
how can i do that?
 
sbi
@Miss You find a suitable online forum and ask there.
 
its really important... if i get warning email or warning regarding my asking the questions way style .. then sure i would never like to post any silly question...
 
sbi
@Miss You find a suitable online forum and ask there.
 
@sbi thanks .. i am going to search out another forum..
 
1:49 PM
ugh
 
damn, sometimes I talk right past my interlocutor in the SO comments :(
1
A: Polymorphic class member variable

NimExpanding the comment into a proper answer... The primary concern here is ownership. From you code, it is appears that each instance of messenger owns its own instance of printer - but infact you are passing in a pre-constructed printer (presumably with some additional state), which you need to ...

What the heck does @Nim mean here? (in the comments, not the answer, that is)
 
@tony i am lookling a "ask question tab" in this link ..
pretty difficult to search out..
 
@KonradRudolph, I've not time to look at this in depth. Two ideas which may or not suit you: Passing a reference and having a reference member. Letter/envelop idiom or another kind of proxy which let you have a value class with polymorphic behavior.
 
@AProgrammer Something like this was already proposed by @Jan. But thanks for the suggestion
 
2:04 PM
iced tea?
 
@Miss why do you keep asking me things... I don't know... ask someone else
 
ahh any one can tell me .. its not only for you ..lol
 
 
1 hour later…
3:15 PM
@Konrad: I posted an answer for you
 
@DeadMG Thanks
 
hello @DeadMG
 
@Tony: Hai
 
How are you ?
 
doing OK
my group coursework in ASP.NET is finally finished
just have to demonstrate it to the lecturers and we're good
 
3:18 PM
oh nice :)
so, all coursework done then?
 
yeah, nearly#
then I can get some rest
 
and resume work on my "engine"
 
oh yea, sounds like a plan
:)
 
lol
it would be nice to feel like I had finished at least a single segment of it and was somewhat pleased with the results
 
3:22 PM
oops
 
3:54 PM
lol asp.net
I love Southpark :)
 
4:24 PM
epic silence :)
 
4:37 PM
this one explains it all...
 
4:53 PM
 
5:20 PM
meow
want a new cat
 
5:39 PM
I guess I've found what they do in the army
 
i applied the dialtion using matlab.. but results are too different then my work using MFC c++ ...
so i am confsue aloot
but i think , in matlab function algorithm they applied 5x5 window mask
thats y my result are different
see this : http://imm.io/5QMl using matlab
and this : htthttp://imm.io/5QMq using MFC c++ with 3x3 mask
@nils: ahh why did you leave now from chat roo, ?
imm.io/5QMq using MFC c++
i am confused alot .. with my work...:(
thats just because of matlab results
hy every one , how is my questions now ...?
i hope its silly but i need to learn with usefull results so i need to do discussion
 
Hi everybody
 
oo @emadpres hi
 
hi
 
6:09 PM
where is the tab for registering
in the above site
 
6:42 PM
evening all
 
hi welcome back ....
 
Hmm....
Now it's even more unrelated.
 
7:01 PM
hy i did not get any reply ..:
sad ...:(
how is now my posted questions
i know that is still silly but its good for my learning ..
 
7:24 PM
<enter comment here>
 
Check out the amount of answer on this question without anyone noticing that the benchmark is just plain wrong.
2
Q: Java/C++ performance

OneMoreVladimirHello guys I've started learning Java and I've heard something about it's slowness. For an experiment I wrote two programms in C++ and Java which seem to be equal import java.util.*; class Java { public static void main(String args[]) { long beg = System.currentTimeMillis(); for (int ...

The topic really makes people hot-headed.
 
7:41 PM
ok
I actually found that STL video hideously boring
when you call something "Advanced STL", Boost is not the expected subject matter
 
sbi
@Space_C0wb0y Four answers in 30mins isn't exactly "hot" for such a subject.
 
@sbi: You got a point.
 
sbi
@Space_C0wb0y What's even worse, he's likely benchmarking a debug version. See my comment to the question.
 
@sbi: I just read that as debugging a benchmark version
 
8:04 PM
What's the point of that 'benchmark', anyway?
To know the speed of an empty loop?
I can see how that's useful.
I also like how 'measuring the speed of a language' comes up now and again.
 
sbi
@CatPlusPlus But setting up such silly benchmarks is what newbies do again and again.
 
8:43 PM
anyone still here?
 
I'm always here, unless I'm not.
 
8:58 PM
I'm never here, unless I am.
 
00:00 - 21:0021:00 - 23:00

« first day (219 days earlier)      last day (4720 days later) »