« first day (222 days earlier)      last day (2705 days later) » 

12:03 AM
What does everyone think of a simple sentiment analyser as a weekend challenge?
Sentiment analysis (also known as opinion mining) refers to the use of natural language processing, text analysis and computational linguistics to identify and extract subjective information in source materials. Generally speaking, sentiment analysis aims to determine the attitude of a speaker or a writer with respect to some topic or the overall contextual polarity of a document. The attitude may be his or her judgment or evaluation (see appraisal theory), affective state (that is to say, the emotional state of the author when writing), or the intended emotional communication (that is to ...
Zombie down:
A: How to tell the NPC what hand it has?

retailcoderYou're creating your cards with a nested For loop; one over suit, another over faceValue - I'd do the same (or quite similar). However I'm not buying the Select Case part: for suit=0 to 3 for faceValue=0 to 12 select case suit Case 0 strSuit = chr(3) ...

^^ killcam
Or do you think that challenge would be too hard for many people to participate in?
@syb0rg Sentiment analysis sounds really interesting, but it would be really hard since I don't know much about it earlier. It should come with a tutorial if it were to be a challenge
@SimonAndréForsberg Define tutorial. Do you mean psudocode, an example of input and output, or actual code?
@syb0rg An example of input and output, and perhaps a suggestion about how to start. I would have no idea where to even begin. (Although I haven't read that much about it yet)
12:17 AM
now I just need to get the mortarboard badge here.
@Malachi That's not so hard :) Just write 3-4 reviews one day and tell everyone in the chat that you've written them and you'll have that rep in no time
I haven't found something ideal for me to review in a while, but sometimes I do get upvotes on random answers.
Probably should have created a tag before issuing this weekly challenge. Something to keep in mind for future challenges.
12:35 AM
@Jamal guilty!
@syb0rg I wonder if it's the human or the robot half that wants to do sentiment analysis..
@retailcoder - I am remineded of the introspections of Data.
well now I am on to something else and won't finish that vbscript that I was telling @retailcoder about. 3rd party vendor said they fixed it, we were going to update prod, I double checked their work, and it still isn't working
@Malachi 3rd parties sell crap (carp?), our bosses buy it. Suits like the smelly stuff I guess.
@retailcoder my boss knows it's crap, but it was better than what we were using before.
12:41 AM
I tell my boss "hey, I can code crap too! - just let me do it!"
I can create this big of an application.
it handles all the runnings of the judicial system pretty much
@Malachi at least it's not Texas. A bad bug won't get someone fried...
(that's not a typo)
@retailcoder their company is based in Texas, I am based in South Dakota.... wait, was that a joke?
Bring it on.
uh.. nevermind
i got another badge on SO archeologist
12:45 AM
diggin' up dirt are you?
@retailcoder oh yeah
back to my script I guess
@retailcoder did you answer my question about the .childNodes?
Hey that last zombie got me my 10th [badge:revival]!
@Malachi where was that?
NM @retailcoder is that how I grab all the childnodes of a node?
12:50 AM
@Malachi sorry I must have missed that..
@retailcoder I am trying to write some VBScript code, I haven't written it yet
oh.. but when you say "is that how I grab all the childnodes of a node?" - what exactly is "that"? I was away for a while :)
(and too lazy to scroll all the way up)
I couldn't find it either.
For Each iNode in oNode.childNodes
@Malachi ok got it - what's the type you're working with? IXMLDOMNode?
@retailcoder this is that fun stuff inside word inside that 3rd party application, so I don't know
12:56 AM
can you print typename(oNode)?
Your IDE is notepad right?
(lovely scripting carp)
I have to do all sorts of stuff to run this code in the environment I need it in.
.childNodes looks like a plan though
@retailcoder I am going to run with it and see where I end up
1:11 AM
It is 8:10. I am going to bed.
(8:11 apparently).
If anyone wants to know, the way to get 4K in 43days is to have a job where you work 14 hrs most days, including weekends, and when you're not working, you 'take a break' by spending time looking at other people's crap code... ;-)
I got 8:12
I got 8:13
if I was better at writing code to begin with that might work for me @rolfl
@rolfl that's why I tagged this room with :)
Yeah, my major accomplishment this week is two-fold - I got a file-reading process (4GB file) containing millions of 'nodes' to read it in 30 seconds in a single thread, and then to map out the node graph in a further 30 seconds.... which is much better than the crap code that did it in 3 hours...
Unfortunately, it was me who wrote the crap code I fixed ... :(
1:16 AM
@Jeffy, are you going to come and join us in CR for a while?
In my defense... the code was only supposed to read about 10K nodes, and the 6Mil was quite a suprise.
Q: Make code more memory efficient, or shorter

vephelp//rename files if(!empty($_FILES[$desktop_fieldname_1280x800]['name'])){ file_exists($desktop_filename_1280x800 = mb_strtolower($desktop_dir_1280x800 . 'wall_desktop_1280x800_' . $_FILES[$desktop_fieldname_1280x800]['name'])); } if(!empty...

@rolfl hey it still worked for all those nodes that is still a good piece of code, granted the re-write was better!
@rolfl It's 2:24 AM(!). I am going to bed.
got 2:25 in your timezone :p
2:26 now.
1:30 AM
Q: Euclid's Algorithm (Greatest Common Divisor)

Bit Fiddling Code MonkeyAccording to Donald Knuth in "The Art Of Computer Programming", the following is how to find the greatest common divisor of two positive numbers, m and n, using Euclid's Algorithm. Divide m by n and let r be the remainder. If r is 0, n is the answer; if r is not 0, continue to step 3. ...

@retailcoder The human side is contemplating on improving the robot side to understand him better.
split personality disorder?
@retailcoder Story of my life.
When you get to 2K, we'll call you Robocop :)
Have you posted the emotion-reader challenge on meta?
Not yet. I have to figure it out myself.
@Corbin knows more in this area than I do.
1:38 AM
just post the idea, postpone the figuring-it-out to Friday night :)
(gotta earn more votes than the sudoku solver)
A: Proposals for Weekly Challenge topics

syb0rgweekend-challenge #3 Sentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about the product made in blog posts, comments, reviews or tweets.

@retailcoder I forgot if I already asked you, do you have a Raspberry Pi?
If I remember right, the answer was no...
got an apple pie :p
@retailcoder Had an apple pie
It gone now.
@Jeffy Hello!
1:55 AM
I don't see "apple pie" on the badges page...
@Jamal he said it's gone now.
@Jamal It doesn't look like you golf often.
Jamal, Austin, TX
101 5
^^ he's too busy editing posts on CR :)
vbZombie down:
A: VBScript for AD account creation

retailcoderNaming: Hungarian Notation is the DEVIL. It makes the reader want to see your code burn in eternal flames. http://simpsonswiki.com/wiki/Flanders_the_Devil objExcel would be better off as xlApp or excelApp objUser is dying to call itself something like adUser intRow wants to be calle...

^^ killcam
2:06 AM
You've earned the "Outspoken" badge. See your profile. YESSSS!!!
Dang it.
I lose.
I really need to step up the funny.
Emotion reader challenge, eh?
@retailcoder Congratulations though!
2:07 AM
5 days after @rolfl!!
@Corbin Yeah, I was inspired by your project :)
I just need some examples and guidelines edited into the meta post though.
Any guidance from you?
@Corbin Is that the question I read earlier today where I commented "my first thought was "lol"?
@retailcoder yup
@syb0rg hrmmm, working at the moment (in theory anyway.... :p), but will look at the post later.
That'd be a fun I think
yeah, it'd be rather interesting
and it gives me a motivator to pay attention to code quality in my project...
since it's what i'm already doing for class haha
2:10 AM
@Corbin If people actually do it.
@retailcoder: On the proposals post, I wonder if it would be worth deleting all the losing entries, at least for cleanliness. That post could become huge and with no practical way to float the recent answers towards the top.
That is the hard part, the presentation of the idea.
well, in all honesty, it's fairly difficult
People have to be willing to create something to do the idea.
well, it's not difficult, but it takes a lot of background knowledge
machine learning, ANNs, SVMs, etc
but i guess a simplified version of it requires basically no background
2:11 AM
@Jamal only < 2K users would be blessed with the "cleanup"...
@Corbin Here you said was a basic one.
Q: C String - new function to detect user's anger - thoughts?

PhilThis was the most humerus coding I've ever done. It's for my string library in C. It detects if the user is angry to various degrees, namely str_isHeated(). Why? Ever play a text-based game and you're swearing at the computer by typing, typing multiple !!!, and the computer responds very dumb?...

that's about as basic as is possible
@retailcoder: That is true...
it would have very, very low recall
and pretty bad precision too
@Jamal that's why my initial thought was 1 question per week ("Weekend Challenge #2", "Weekend Challenge #3", ...) so we could keep stuff neat.
^^ but @SimonAndréForsberg messed it all up.
2:13 AM
1 question per week sounds better
don't have to step on toes with deleting things
(he's not here to defend himself haha)
and accepted answer = chosen challenge is easy to follow
@Corbin was that your first baby unicorn?
......... baby unicorn?
@Jamal That way we don't have to un-accept and root through old challenges to find the new ones.
I agree that this system is inefficient.
2:15 AM
(removed): instead of removing a chat message, why not just say (removed)? Started when Jamal used his vacuum cleaner on a couple of off-topic messages in the chat. Beware though, it is said a baby unicorn dies everytime it is used.
A: Call of Duty - We're on a mission

retailcoderSome "memes"... A few expressions have come up recently, thought I'd share them here (feel free to add, this is CW!) Running out of ammo: when you have exhausted all 40 votes for the day. Head shot: when you're out of ammo and post a target in chat, and then someone puts in a vote for you. Wak...

wait, so.... instead of actually deleting, edit the text to be (removed)? i actually removed it.
@syb0rg: Fine with me. In that case, we might as well make a new tag. No need to cram them all into .
@Jamal hates
2:16 AM
@Jamal Sounds good. What were your ideas for the new tag name?
I'm a mod, so yes. :/
Or does that already exist?
It does on the main site.
2:18 AM
@Jamal so you're going to split that into multiple posts?
@retailcoder That is the best way to do it in my opinion.
And then label the challenges by date.
We can. If possible, I can see if I can merge separate answers to new questions.
And number if necessary.
I edited the proposition for the weekend challenge:
A: Proposals for Weekly Challenge topics

syb0rgweekend-challenge #3 Sentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about some object in blog posts, comments, reviews or tweets. This challenge will have to be watered down a bit to more o...

@syb0rg no need to supply implementation ideas, people can go overboard all they like (or be as minimalistic as they can)
I'm suggesting the minimalism though for the coders sake and the reviewers sake.
2:21 AM
You'd be surprised with what @SimonAndréForsberg and @rolfl can come up with...
all the ideas are good :(
If this is going to snowball, I think we've created a monster - we won't see the end of ! (and that's uber-cool!)
Imagine 5 years from now, 200 people submitting a RPLSL implementation in 1 day!
No, it doesn't look like I can move separate answers to questions. We may just have to start anew. Perhaps we can have a "master" question that contains links to the separate proposals. The "master" question could be closed since it doesn't need to receive answers.
Q: Number aware string sorting with comparator Java

pbibleI have this class for use in sorting strings such that if strings have a number in the same position it will order the numbers in increasing order. Alphabetical gives: file1 file10 file2 What I'm calling "number aware" string sorting should give: file1 file2 file10 Here is what I have using a ...

@Jamal that looks like over-complicating it - let's just edit-copy-and-paste-to-a-new-answer-on-a-new-question, and screw the vote count.
(it's still only midweek, if people really want to code a sudoku solver they'll revote it)
2:26 AM
Whatever the community wants.
(raises hand)
seems like it might be best to just bite the bullet, lock the old one, and create a new one
then people can repost their suggestions
I think it's better if it's @Jamal making the move; that way we can vote on our own proposals :)
Okay, so, what's the plan? Or are we still deciding?
@Jamal I like that suggestion. A master directory to the weekend challenges that people can favorite for updates. Then new meta posts every week for a new weekend challenge (upon where the directory would be updated).
2:30 AM
I think we should keep the current one as "master", with 1 answer per starting week that links to the meta-question that contains the proposals for that week. This way we can have only 1 "featured" post with all the info.
or people could just check on the tag every now and then
could have a weekend-challenge tag for general weekend challenge stuff, and weekend-challenge-survey for ideas
ahhhh, good point about featured
Why not just put the links in the question?
less editing
(I know you don't like that eh)
yeah, i think 1 is better for the sake of featuring it. that way you can have the entire history and show that it's an ongoing thing (eventually). and, that way we centralize the "this is what hte weekend challenge is!" explanation rather than having to maintain it or links to it in like 239482384 posts
2:32 AM
Now I agree with @Corbin
It could still acquire votes, which would be unneeded. Locking isn't best because only a mod would be able to make an edit.
So what? Let people vote!
no nothing
2:33 AM
Wait, do you mean chosen challenges on each answer, or links to the challenges? I assumed the latter.
it might be worth creating a question explaining the premise of weekend challenge, the basic rules, etc. then people could post answers for suggestions or whatever. and then the weekly idea threads could link back to it as an explanation
it wouldnt be good for featuring though :(
but internal to the site it might be more coherent
Or, just a master thread with the chosen challenges, and another where all the proposals are decided?
actually, no... i think i like the index-question option best
actually no
So we have:
- the current featured post that turns into an explanation of what it's all about; each answer is a link to a meta-question...
- Each linked meta-question / answer on the featured post, is a meta-question asking what the next challenge should be; most upvoted wins
Here's a suggestions combining @Jamal and @Corbin ideas.
2:35 AM
^^ that
1 master thread with an explanation and a list of challenges in reverse chronological orer
and then a thread for each week
created by jamal or some other mod requesting ideas for a weekly challenge
We have a meta post explaining what a challenge is, with the answers being links to the new weekly challenges (in a different post).
@Corbin doesn't need to be created by a mod
eh, doesn't need ot be
but might be better
otherwise might get into a "omg it's wednesday! im going to be the first to ask for WC suggestions!!!"
Yes, I'd rather it not be something that needs to be maintained by one. Plus, I'm not sure if the other CR mods know about this. :-P
2:37 AM
@Jamal Their fault for not being on chat :P
If more than 1 post gets created to gather suggestions for a given week, it should be closed as a duplicate on-the-spot!
Well, I've seen another mod being this close to the community. Most are either on MSO or just sitting back and waiting for flags. Which is boring.
@retailcoder true. simple enough solution :)
(and the dupe's author be meta-post-banned!!) /not
On another note, I just reviewed this code:
A: Euclid's Algorithm (Greatest Common Divisor)

syb0rgYour condition statements are good from a readability standpoint, but could be simplified if you desired if((m == 0) || (n == 0)) return 0; if(!m || !n) return 0; Use actual variable names instead of just letters. int greatestCommonDivisor(int m, int n) // confusing in lat...

2:39 AM
Hey it's a question asked by @rolfl's girlfriend! (/boyfriend /monkeyfriend /whatever...)
when i first saw that account, i thought rolfl had changed his name
Q: jQuery and localstorage

Jagst3r15Right now the following code works, but the notification bar I have disappears if you refresh the page. It should only disappear if the user clicks the close button, but I am not sure how to do that. jQuery(document).ready(function($) { var showHowTo = localStorage.getItem("firstvisit"); if(!sho...

@Jamal I would merge meta.codereview.stackexchange.com/questions/1201/… and meta.codereview.stackexchange.com/questions/1218/… into a single featured post; keep @SimonAndréForsberg's accepted nice answer there, too; then I'd create a new meta post for WC#2 and another for WC#3 (we can move our posts there), and post an answer on the featured post that links to the respective challenge's suggestions page.
2:54 AM
@Jamal Then I would feature the most recent weeks challenge proposal.
Since the votes would be lost
And need to be recovered.
Merge which into which? Or merge both into a new question?
Actually there's not much to merge from meta.codereview.stackexchange.com/questions/1218/… - I mean the parts I added in should be moved to the original CR Weekend Challenge post, Simon's parts can be dropped :)
^^ That does sound weird eh?
Yeah, and my brain is dead today anyway. :-P
Ok I'll do it.
@Jamal So can you create a new post and migrate the answers?
3:08 AM
Yes I can.
To be featured:
Q: CR Weekend Challenge

retailcoderThose of you that weren't following what's going on in the chat room might have been taken by surprise by a recent avalanche of Rock Paper Scissors Lizard Spock posts. This is how it started: OK, weekend challenge.... we all solve the Rock Paper Scissors Lizzard Spock problem with our 'favou...

(and wikified)
So, first I merge all the proposal answers into there?
no, we should use answers on that one (except Simon's) to link to each week's proposals page
makes sense?
So, a bunch of link-only answers?
They can have a title identifying the challenge#., and they can be edited when an answer is accepted :)
3:13 AM
Okay, there will be more than just a link.
What I think @retailcoder is trying to say is, there will be a header to every answer that links to the meta post. Once one is selected, then that answer will be edited to include information about that challenge.
A "master directory" idea that I liked.
^^ that
Well, I'm the exception-handler, so you need to tell me exactly what I should do (but flags aren't needed). :-P
A new post needs to be created, for this weeks .
I think.
I'm editing the currently post (oddly, vandalizing seems more appropriate), so while I'm at it you can add on the other one and wikify it :) - I'll remove the featured tag on the one I'm editing
And yes we'll need a new one for #3
3:19 AM
@retailcoder Understand that you can never make a post on the "master directory". Otherwise when you accept an answer it will not rise to the top.
There's already an accepted answer there - it will remain :)
But isn't that going to be the "master directory"? If so, the current weekend-challenge will be accepted.
(it earned @SimonAndréForsberg a [badge:nice-answer] and a [badge:enlightened] - he'd rip my head off if I messed it up!)
Or so I thought.
I'm not saying to delete the answer.
But those badges don't get revoked.
3:20 AM
no, the way I see it there's no need to toggle accepted answers anymore
He should be able to keep the badges
but it's still a great answer
I agree it's a great answer. But what about the "master directory" idea.
True. In a way, it should be "self-sustaining." It shouldn't need frequent mod-only actions nor owner actions.
How will people know what the challenge is for the current week if it's not at the top?
3:22 AM
They're numbered...
But upvotes will skew the order they are in.
And later on weekend-challenge #52
People will have to scroll way down to find it.
you're optimistic! I like that
Well, I think people really like the weekend-challenge thing.
@Jamal I can't touch the , my non-mod hands will melt
It's kinda the thing only this community could offer uniquely.
3:24 AM
Yeah, it's best I handle that.
Q: Bash script to monitor Webserver php script

meewoKBelow is a script I wrote today to use CURL to monitor the length of various HTTP server outputs and output a response if this is different than 103 characters. This is my first bash script, so I had some reading/experimenting to do and it is quite rough. The idea is that if there are no errors, ...

Q: Weekly Challenge #3

retailcoderOne single proposal per answer, most upvoted as of 2013-12-14 (12:00AM UTC) becomes our next challenge! The winning entry shall be marked as the accepted answer.

^^ entries on WC#2 for WC#3 can now be moved here
Q: Weekly Challenge #3

retailcoderOne single proposal per answer, most upvoted as of 2013-12-14 (12:00AM UTC) becomes our next challenge! The winning entry shall be marked as the accepted answer.

@StackExchange grrrr
3:30 AM
A: Weekly Challenge #3

syb0rgSentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about some object in blog posts, comments, reviews or tweets. This challenge will have to be watered down a bit to more of a entry level. This...

should be deleted from #2 :)
@retailcoder You no longer need the and challenge number at the top of your posts.
Delete all #3 answers from question #2?
Already did :)
@syb0rg good point
3:31 AM
@Jamal Port them if you can.
Would they retain their vote count if you can port them?
I cannot move separate answers. It'll have to be all of them.
Then don't.
Port them on these conditions:
1. Votes are retained.
2. @retailcoder and myself undelete our posts to get back our old votes (if condition 1 is met).
3. You delete the #2 challenges from the new post.
the #2 challenges would be lost?
Duplicated them?
I wish I knew the extent of mod powers.
3:38 AM
So .... Whats happening with the Weekend challenges? Sorry I've come late to the pary.
So, I feature and wiki this?
Q: CR Weekend Challenge

retailcoderThose of you that weren't following what's going on in the chat room might have been taken by surprise by a recent avalanche of Rock Paper Scissors Lizard Spock posts. This is how it started: OK, weekend challenge.... we all solve the Rock Paper Scissors Lizzard Spock problem with our 'favou...

@Jamal yup
@JamesKhoury we're reorganizing the thing, refactoring / future-proofing, sort of.
@JamesKhoury We are laying the foundation for the future of this site :)
@Jamal I've flagged @rolfl's post for deletion, I moved copied it to #3
@Corbin I need an upvote again (due to migration):
A: Weekly Challenge #3

syb0rgSentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about some object in blog posts, comments, reviews or tweets. This challenge will have to be watered down a bit to more of a entry level. This...

3:43 AM
Yeah, well, I need two! (doesn't matter really)
@Jamal cleaner now? What do you think? (I still don't see a on the original CRWC post)
@retailcoder Bingo! That's what I was going to ask next. ... Wait can you read my mind?
I'm working on it. I'm also going to edit the deleted answers so that they won't bother the 2Kers and myself.
@jamal nice :)
@JamesKhoury look behind you.
... Why am I being asked if I am a human for each answer I post?
@JamesKhoury happened to me when I posted an answer after leaving it as a draft in the system for a couple hours.
3:50 AM
@JamesKhoury: You don't need that "moved from" text. I'll delete those old answers.
@JamesKhoury Probably because you copied and pasted your entire answer at once with little to no editing. It's a SE spam filter at work.
@syb0rg Ah. Yes that would most likely be it.
@Jamal Too late :P
lol would be funny if tonight's activity raised a couple dozen flags at SE
What about previous comments on an answer?
@JamesKhoury Gone.
3:53 AM
gotta go now, see y'all tomorrow!
@syb0rg Ok :). I hope the sentiment analysis one gets chosen. Might be a bit rough for the 3rd week ever, but could be fun.
@Corbin That would be an interesting one in my opinion!
I'm worried it's a bit too algorithmic/theoretical for a software engineering oriented website, but that's part of why it intrigues me. Academic pursuit and SE interact much less than they should.
@Corbin We need to find ways to "water it down" a bit so more entry level programmers will give it a try.
Done. I have also added a little "post notice" on the master post.
3:59 AM
@Corbin I think it would be good to have a hard version and an easy version? Is that possible to explain it enough to get entry level and still keep an expert level interested?
@syb0rg There are very naive approaches for sentiment analysis that are reasonably (for toy purposes) effective, so we could just encourage one of those. For example, one easy method is to just make a list of a few dozen words (hate, love, screw, damn, etc) and to assign a weight to them (hate = -5, love = +5, screw = -2, damn = -2.5, etc). Then it's a simple matter of sentiment = sum of weights * frequencies / total words found.
@JamesKhoury It's not the approach that's reviewed, but rather the implementation, so really it doesn't matter how simple or complex people make it. I'm just afraid that people might see it, overthink it, and not try it because they don't want to make it complex, not realizing that they don't have to.
but meh... i'm probably just worrying about nothing
4:25 AM
I tried to clarify the post as best as I could:
A: Weekend Challenge #3

syb0rgSentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about some object in blog posts, comments, reviews or tweets. This challenge will have to be watered down a bit so that people will not be ov...

I also separated it into two sections, entry and advanced.
@Corbin What do you think of my new descriptions?
night everyone
@Malachi Good night.
@syb0rg might be better to just point out that it can be as easy or advanced as someone wants to make it rather than giving specific criteria
@Corbin So define what the entry level analysis is, and leave the advanced analysis open ended?
i wouldnt define either. i would just say "it can be very simple (for example ___). or, you can make it as complex as you want (for example ____)."
4:39 AM
@Corbin Now what do you think?
A: Weekend Challenge #3

syb0rgSentiment analysis (opinion mining) Sentiment analysis, which is also called opinion mining, involves building a system to collect and examine opinions about some object in blog posts, comments, reviews or tweets. This challenge will have to be watered down a bit so that people will not be ov...

looks good
@Corbin Sweet. I think I'm going to go.
I'll look at some of your answers and upvote them. Would you mind doing the same for some of my Raspberry Pi posts?
To a limit of 5.
ok, will look for some good ones :)
5:02 AM
@Malachi Yes, I hope to.
2 hours later…
7:02 AM
Q: Finding Largest Number Indices from an array

MaheshVarmaI have following code that gives me largest number's indices or index. public static void main(String[] args) { float[] elementList = new float[7]; elementList[0] = 8F; elementList[1] = 5F; elementList[2] = 4F; elementList[3] = 3F; elementList[4] = 0F; elementLis...

3 hours later…
9:33 AM
Q: Help in deciding how to represent a long regular expression

Alex PopovI wrote a simple Polynomial class: class Polynomial def initialize(coefficients) @coefficients = coefficients.reverse end def to_s return '0' if @coefficients.all?(&:zero?) @coefficients.map.with_index do |k, index| " #{Polynomial.sign(k)} #{k.abs}x^#{index}" end.re...

Q: Sort ObservableCollection after added new item

Jerry BianFor a WPF application, I have to sort the items in ObservableCollection after Added new item. public void UpdateSource(ObservableCollection<SomeType> source, SomeType newItem) { source.Add(newItem); SortSource(source, newItem); } private void SortSource(ObservableCollection<SomeType> s...

2 hours later…
11:48 AM
Q: Why no reputation is given upon selecting a best answer?

Alex PopovOn SO, when you select a best answer you get 2 rep. Why there is no such thing on CoreReview?

12:16 PM
Q: A c# class that represents an instance in Time

PeterPlease review my code and let me know of any additions or modifications would make this even more useable. The initial idea was to create a simple Time class that has only one function: To represent an instance in time. I've created this mainly because I found JodaTime to be way more then I nee...

12:28 PM
Q: word analysis and scoring from a file python

kulkarni.ankita09I am doing a word by word analysis of a sentence such as "Hey there!! This is a excellent movie???" I have many sentences like above. I have a huge dataset file like shown below where I have to do a quick lookup if that word exists. If it does then do analysis and store in a dictionary such as ...

1:06 PM
@retailcoder yeah yeah, go ahead and blame me ^^
@retailcoder What Rolf and I can come up with? No idea what you're talking about? Wildcards? Never heard of them.
@retailcoder the nice-answer and enlightened there were only meta-badges, doesn't matter so much ^^
1:41 PM
Q: What are the problems with this method?

Michael IVI got this question at C++ programming interview: void memcpy(char* dst, const char* src, int numBytes) { int* wordDist = (int*)dst; int* wordSrc = (int*)src; int numWords = numBytes >> 2; for (int i=0; i < numWords; i++) { *wordDist++ = *wordSrc++; } int whatisleft = numBytes >> 2 - (n...

Today I am in. Except for when I am out.
@Donald.McLean Sounds reasonable. Same here, I suppose
@Foobar Hi
@SimonAndréForsberg I have a physical therapy appt at 3:30 EST, but actually saying that would have been boring.
1:54 PM
The zombies hunting trip is finished?
@Donald.McLean Good luck (or what's the right thing to say?) with that one :)
@Foobar Zombie Hunting never gets finished. But the remaining Zombies are tough ones. We do try to kill incoming ones though.
@retailcoder Gratulations on the outspoken badge btw (How on earth did you manage to get it?)
@SimonAndréForsberg You just have to keep making witty remarks and eventually, you'll get enough stars to qualify.

« first day (222 days earlier)      last day (2705 days later) »