« first day (1186 days earlier)      last day (2836 days later) » 

12:00 AM
RELOAD! There are 2609 unanswered questions (92.8194% answered)
 
12:11 AM
Clean-up and code review questions belong on the code review stack exchange. If there are actually development issues (I'm not entirely clear on what all you're asking) then reduce the problem to its basics and be specific. Good luck! — Dave Newton 52 secs ago
 
12:36 AM
0
Q: Advice on refactoring code

SakoBuCreated this drawing app with JS / canvas. JSHint is throwing errors but the app works just fine. Need help with code clean up / refactoring as I'm fairly new to Javascript. Check out the snippet: Any help would be much appreciated! Thanks in Advance! JSHint in Atom is fine but using codekit to...

 
1:10 AM
You can stop right here. codereview.stackexchange.com/questions/136341/… My answer is solid - thrust me — Paparazzi 38 secs ago
 
> thrust me
3
 
I just finished C# In Depth.
Except for the appendices, that is.
 
cc @jonskeet
 
Why?
 
@Hosch250 I have no idea.
 
1:15 AM
I learned easily the most in the async/await chapter (15).
 
I should really read C# in depth, but I don't want to pirate it nor pay 40 or so dollars to it.
 
@arda Might find it in a used book store or library
It's pretty canonical so they probably have it in most places that have programming/technology books
 
You could probably get it in any US library. Not sure how Turkey's library system works.
I'd be surprised if it was on the list of banned books...
 
@Phrancis no way I can find good dev sources in turkey. Last time I went shopping, the newest thing I found was developing VB6.0.
5
 
Ouch
 
1:19 AM
Wow.
 
VB6 is so old
 
I suppose I'm the only one who's ever written an analyzer for Roslyn in the room...
I'm having a bit of trouble getting a VB.NET test to work, and the Roslyn team says it looks right.
I hope I didn't just find a bug...
 
I actually bought that book for giggles. Threw away recently when cleaning my room unfortunately.
 
Didn't mean to start a politics conversation here, sorry
 
@Phrancis Don't worry about it.
> 12 running, 20 queued, 21 completed
I wish Roslyn tests ran faster.
@arda Just as a tip, each version of C# In Depth comes with a free ebook. You might be able to buy the ebook code online much cheaper than the physical book, but just know that some unscrupulous people might sell it more than once.
 
1:45 AM
> 12 running, 4 queued, 37 completed
 
Just saw this crap code posted in the SQL room feed
SELECT FeedbackId, ParentFeedbackId, PageId, FeedbackTitle, FeedbackText, FeedbackDate
FROM ReaderFeedback as c
LEFT JOIN (SELECT max(FeedbackId) as MaxFeedbackId FROM ReaderFeedback where ParentFeedbackId IS NOT NULL GROUP BY ParentFeedbackId) as d ON d.MaxFeedbackId = c.FeedbackId
WHERE ParentFeedbackId IS NOT NULL
AND FeedbackText LIKE '%?%' GROUP BY ParentFeedbackId
ORDER BY d.MaxFeedbackId DESC LIMIT 50
 
They've been running for about 20 minutes...
 
LIKE '%?%' is horrible for performance
 
@Hosch250 thanks for the tip. IDK where to look though. Still, will ask some people.
 
What does that do?
@arda Maybe EBay, if you can get it.
 
1:47 AM
@Hosch250 checked ebay. nothing
 
@Hosch250 pattern search
 
OK.
 
except 65usd for 3rd version and 4usd for the first - and I'm not interested in C# 2 or 3 anymore
 
Both % characters are wildcards. The one at the end of the string is fine, but the one at the beginning is what makes it very slow, since it makes it unable to use the indexes, only to do full table scans
 
I have the third, and I got it for +-35USD from Amazon.
It's a pity some countries don't even have a decent library system.
I know what I should do. I can become the next Bill Gates.
I'll start an online library and lend books for certain amounts of time for different, reasonable rates (more per time borrowed).
I bet enough people around the world would be interested to make it pay.
I could lend college textbooks, and just about any book.
I could do the books that free library systems can't do because I could pay the royalties.
And instead of being like Google &co. and cottoning up to governments that ban search results, I'd fight with everything I had to get past their firewalls. If I had the money, I'd even launch a satellite to provide wireless access (and rent it to other companies trying to get past the firewalls).
 
1:58 AM
College textbooks are a huge industry, you probably wouldn't be making any friends there lol
Other than that, though, sounds like a reasonable idea. Kind of like a Netflix for books I suppose
 
Yeah. Or a Spotify.
 
@Hosch250 we do have 2 decent libraries in Ankara, one by METU and one by govt, but both are unlikely to have C# in depth, especially the government owned one. METU is an engineering university (not just "an", the biggest and most reputable one) but they don't teach C# (they only teach C and python - I do have twitter rants of their computer engineering curriculum being too theorical and not having much programming courses).
 
@Hosch250 Sounds like some people beat you to the party... google.com/search?q=rent+books&ie=utf-8&oe=utf-8
 
@Phrancis Those are awful scans.
 
@Hosch250 if it is on Amazon, I can borrow it for free using borrow websites.
 
2:01 AM
I've seen Google books before. Mine would use actual text.
@arda The books? That's where I got C# In Depth from.
 
@Hosch250 so, epubs?
 
Maybe you could get it from those places?
@arda Yeah, something like that.
 
@Hosch250 ah, I mean amazon kindle store
 
I know I'm beat to the party, but maybe I could successfully monetize it first ;)
 
Fun fact: Amazon doesn't ship anything (except some books depending on the seller) to Turkey. I probably can't buy with ebay anymore too as paypal is also banned in turkey.
 
2:02 AM
@Hosch250 Amazon book rentals look legit at least
@arda that seems extremely restrictive... what about ebooks?
 
@Phrancis zero
 
Oh wow
 
literally zero. I owned a kindle before. I could swap regions but they used to detect that I was in Turkey from my IP and lock me back to Turkey after a few days
 
It took me 35 minutes to run the Roslyn tests. I'm probably doing it wrong; I'll need to ask.
 
@Hosch250 what is your computer setup like?
 
2:06 AM
Quad-core Intel i7 a little over 3 years old (from when I bought it--it was being phased out, so it is probably 6mo. to 1+ years older...).
There are thousands, if not millions, of tests to run, so...
 
Are you on SSD?
 
And I don't even have the whole suite.
No, 7500rpm HDD.
 
hmm, so 35 minutes shouldn't be that bad
 
They, apparently, don't have an option to run just a particular project, except under debug mode, which takes even longer...
I've tried that WPF thing, but I've never been able to figure the thing out.
I'll try it again later.
I have to go now, BBL.
 
@Hosch250 wpf is very cool
 
2:10 AM
@Hosch250 Sounds like a pretty big program, it doesn't surprise me if it takes that long to build it with so many tests
 
Wow, roslyn has tons of VMs assigned to it: dotnet-ci.cloudapp.net/computer
 
3:02 AM
I wonder if this is better suited for Code Review maybe. — s952163 31 secs ago
 
 
1 hour later…
4:30 AM
0
Q: Acronym Generation

Jae BradleyProblem Implement relatively naive acronym generation. I was trying to implement a solution without using regex. Portable Network Graphics => PNG Ruby on Rails => ROR HyperText Markup Language => HTML Complementary metal-oxide semiconductor => CMOS Origin is from code exercise site, exercism.io...

 
4:58 AM
@Mast sphinxbase is fixed, just have to fix PortAudio2 and then it should be perfect
 
5:43 AM
0
Q: Permutation index Python

RockybillyHere is my Python code for finding the permutation index of a given digits and a target number. And by permutation index I mean, for example, given digits [1, 2, 3, 4]. find the index of 3124, meaning the position of 3124 in all permutations. This code finds that. However I have suspicions about ...

0
Q: How i can do this in one query

Mohamed AhmedHow i can do this in one query SELECT SUM(rate)/COUNT(day) FROM feb_days_14 WHERE day = 1; SELECT SUM(rate)/COUNT(day) FROM feb_days_14 WHERE day = 2; SELECT SUM(rate)/COUNT(day) FROM feb_days_14 WHERE day = 3; SELECT SUM(rate)/COUNT(day) FROM feb_days_14 WHERE day = 4; SELECT SUM(rate...

 
@Vogel612 If we take the number of votes per day as the metric, CR is in 31st out of 316.
But Meta sites aren't ranked properly, as they don't have official launch dates.
 
0
Q: Integration strategies for integrating Multiple database with a product

user3278744Usecase: We have a platform. We might have multiple customers using our platform Platform is generic so we don't modify our platform for specific customers Our platform functions with data from different customer databases we would like to integrate our platform and let it function dynamically ...

 
@CaptainObvious off topic. No code no glory
Monking
 
6:05 AM
You might want to ask the same on codereview.stackexchange.com — CinCout 21 secs ago
 
Monking
 
Monking
 
@Jamal shouldn't have closed this question. It also did not deserve to be downvoted, in my opinion.
-1
Q: Drawing app with JS / canvas

SakoBuCreated this drawing app with JS / canvas. JSHint is throwing errors but the app works just fine. Need help with code clean up / refactoring as I'm fairly new to JavaScript. JSHint in Atom is fine but using codekit to compile and minify the JSHint freaks out - 31 errors: changeColor is defin...

The demo clearly works.
 
0
Q: Total number of stops a elevator( C++)

BubbleBoyI have seen this question asked around a bit. I am raising this code review request to see if i can get any feedback on the C++ implementation. Original Question& solution in Java can be found here Program to determine total stops taken by elevator for convenience the question is : write ...

 
6:23 AM
I think he misinterpreted the jshint errors as things that stopped the code from working @200
 
Monking
 
Yeah, miscommunication due to the use of the word "error".
 
@200_success Even though large parts are undefined?
 
The demo works.
 
@syb0rg Can confirm sphinxbase works. Now has a couple of warnings on runKhronos
Fails on 97% since there's no rule to make target lib/PortAudio/lib/.libs/libportaudio.dylib.
@200_success Except when you try to load an image.
Throws an error.
 
6:36 AM
Image loaded fine for me on Safari.
 
Not on Firefox.
 
Makes sense. Firefox isn't WebKit.
 
Can't seem to get it to work on Firefox either
 
Whether it's closable for that reason depends on whether we consider the problem is the main point of the question or just incidental. Vote to close as you deem fit. I don't think it should be mod-hammered, though.
 
Left a comment, we'll see.
I'm not in the slightest a fan of cross-posts, but I'll refrain from voting here.
 
7:02 AM
This execution plan is nasty.
 
monking @all
 
7:17 AM
@chillworld monking @partofall
 
If anyone wants to see how I get our stat date, it's on Gist.
There's a lot that goes on.
 
7:32 AM
0
Q: Running simulation using the API of a simulation tool

Stewie GriffinThe intro is a bit long, but I think it's necessary. I'm very interested in any improvements, but you can assume that all calls starting with psspy. are correct and can't be changed. Also, the calls to psspy that are inside a loop have to be inside a loop, I can't call the functions with several ...

 
7:43 AM
0
Q: Avoid duplicate code in multiple conditions and actions and improvement error handling

PreguntonCojoneroCabrónI have to handle an Action (Modify) about my web application. The app working with SMTP Email, ActiveDirectory, External System (Biztalk, CRM, FTP, others WCF Services) and Internal System (WebServices and Databases SqlServer-Oracle). The main action checks several conditions in several entiti...

 
This post should help with passing an array as GET data. If you don't want to use an array, just give different names to the checkbox elements. The values that exist as GET data are checked, and the ones that don't, aren't. — BobRodes 34 secs ago
possible answer invalidation by Stewie Griffin on question by Stewie Griffin: codereview.stackexchange.com/posts/136618/revisions
 
@Duga @StewieGriffin ಠ_ಠ
 
@Duga answer posted @44:28, edit @ 42:40
 
@Duga f, Uhh, this just adds comments >_>
 
If a code block is modified it'll trigger
Duga doesn't do syntactic analysis
 
7:48 AM
Aah, I inserted a line break in front of: #====
@Pimgd Does Duga post the warning if the edit was made < x minutes before an answer is posted?
 
Maybe duga checks every 5 minutes and diffs with last time - is there a code edit? Are there answers?
 
It would make sense, since an edit will effectively invalidate an answer if it's made 2 seconds before the answer was posted.
@Pimgd I don't only do crack ;) I'm experimenting with other stuff too! =)
@Pimgd thanks for answering by the way... Can't believe that part has survived all the testing and rewriting this code has been through...
I think I only had the if ierr !=0 part first, then added the ierr == 0 part later.
 
@StewieGriffin honestly, I don't think that's a good idea, you'd be better off trying various nootropics and seeing if there's anything in there that works for you
 
1
Q: Dynamic Official Receipt increment algorithm

Binsoiso i made a function that would automatically generate official receipt for POS. it is able to accept format such as xxx, xxx-xxx, xx-xx. But my code is really messy and horrible and it needs review. would really appreciate for corrections, recommendation and critic to improve this. The flow w...

0
Q: Doctrine - is it bad to have flush() instantly after persist in repository create/add function?

Darius.VI showed my code to people who have experience with doctrine and symfony and they said that it is bad that I call flush() instantly after persist() because maybe client class who uses this class might not want the object to be flushed. My intention was to have a method which does insert fully, wi...

0
Q: Implement 3 stacks using a single array in C++

MantrackerOne of the questions that is presented in Chapter 3 for Cracking the Coding Interview is this: Describe how you could use a single array to implement 3 stacks I've implemented a solution to this problem in C++. My assumption is that the array is a static array that is not growable (unlike a dy...

 
@CaptainObvious That inheritance structure is going to bite you in the ass
 
8:03 AM
@Pimgd Nootropic > Python... Got it!
 
@StewieGriffin you're still gonna have to do the work, it's a force multiplier
 
Naruto answer; accepted non-selfie answer with 0 score: Application container design
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Admin panel, secure login
 
Zak
8:27 AM
Monking @all
 
Monking @partofall
 
Zak
The saga of people-sending-bloody-spreadsheet-data-in-PDF-form continues
 
0
Q: Optimizing Java SHA-512 String-to-Hash Generator

AnonymousIn an attempt to learn Java and SHA-2 I created a very simple String-to-SHA512 generator. Here is the code: package main; import java.util.Scanner; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class SHA512_String_Hash { ...

 
8:54 AM
There is a whole SE site dedicated to improve working code: Code Review. You should post your question there, this site is for programming error problems. — Gerald Schneider 38 secs ago
 
Any C++ guys around with experience how to debug a expected primary-expression before ‘)’ token error?
 
Szia!
What can I do if I see a post which should be in CR that has posted in SO?
 
@CrazyNinja Duga will help with that.
 
for e.g. this one>
2
Q: Avoiding duplicate code when the unique part is within a loop/try-catch

SBmoreI have a class that has two methods that have a lot of duplicate code but the bit that's unique is in the middle of the whole thing. From my research I think I should be doing the "Execute around method" pattern but I can't find a resource that I can follow as they all seem to use code I can't re...

 
@CrazyNinja Don't migrate answered questions. Gets very messy fast.
 
9:06 AM
What's your reason for migration?
Code Review questions are perfectly on-topic on Stack Overflow when the asker doesn't want feedback on everything, but instead wants a single issue fixed.
 
Crazy idea, maybe first refactor your code and then try something new ;-) — Heslacher 13 secs ago
 
0
Q: jQuery needs Optimization - Each Loops vs For Loops

F.Bek TLDR: Rendering is too slow when having lots of custom fields and rules. So I need help to improve this javascript code. #9606: Trac ticket about issue I have a trac 1.0.8 installed on a ubuntu machine with DynamicFields 1.2.6 installed (compiled from latest revisions 0.11 folder). I have m...

0
Q: Decorator pattern using Java 8

Ajay IyengarWikipedia has an example of a decorator pattern here: https://en.wikipedia.org/wiki/Decorator_pattern#Second_example_.28coffee_making_scenario.29 I was trying to solve this using functional style using Java 8,the solution I came up: 1.CoffeeDecorator.java public class CoffeeDecorator { publi...

 
@CaptainObvious and your question is... well.. the question does contain the questions... but...
Should I answer? It's gonna be a really bad answer
> Is this solution acceptable ?
depends on business requirements
> 2) If not, is there a better way to solve it using functional style?
see previous answer
> 3) Should we stick to the usual GOF way of having an abstract class and separate decorator classes in scenarios where the object that we are decorating has multiple methods?
need more context, isn't your coffee example working just fine?
Ah
> If we had a single responsibility in the Coffee interface, getCost(),
Yeah, now you're changing your business requirements.
We can't answer such questions
 
Plus why would Coffee know it's cost?
surely coffee is a type of product and the cost belongs to that product, not the coffee itself
because there are different types of coffee
 
I am voting to close this question because you're 1) talking about abstracts to later apply them to some situation you haven't shown us, which is a good way to shoot yourself in the foot. 2) You're changing the requirements halfway through the question, complicating everything and making answering impossible (if Coffee suddenly has different methods, then, yes, patterns might be too much! But if you can change the domain model by that much, then you're NOT following business requirements, are you?) 3) This code is pretty much ripped from wikipedia; you're not looking for a code review. — Pimgd 9 secs ago
 
9:21 AM
Slam dunk
 
took out point 3 because he did rewrite it but... it's still abstract
Maybe he is looking for a code review, in which case, come up with some requirements
aaand a way of escape
Now, I see that you have changed the calling code to be functional style. If you want us to review that, sure, we can do that. In that case, you should provide a clear set of requirements (to help restrict the "what-if"'s, preventing the question from becoming too broad), after which we can talk about what impacts your choices have on performance and future extend-ability of the coffee combinations. — Pimgd 19 secs ago
 
I'll keep the UWYA on it till he answers my comment. His questions make no sense without spec.
 
yep
 
Zak
@DanPantry And the same coffee might cost different amounts in different contexts
 
I guess this is why the article I read recently says that getters are bad for encapsulation
 
9:29 AM
I dunno
I think getters are wrong here because it's not a getter
it's a "calculate according to business logic" kind of thing
which, yeah, you don't use Employee.getMonthlyPayAmount() for
but PayrollCalculator.calculateFor(Employee, ... month?) or something like that
 
@DanPantry It shouldn't, the vending machine should.
SRP.
The coffee could have a cost, but it shouldn't know it's selling price.
 
Decorators are so complicated because they require your base class to be an interface... if you were working with instances before you're pretty much fkced
add an ORM layer and blehhhh
7
Q: Regex to enforce password requirements

Bibek SharmaI'm trying to write regex to validate the password for the given rule. Passwords must be at least 8 characters in length and contain at least 3 of the following 4 types of characters: lower case letters (i.e. a-z) upper case letters (i.e. A-Z) numbers (i.e. 0-9) special characters (e.g. !@#$&*...

apparently, implementation > words
so much for reviewing
then again, conveying an algorithm works better in code
I am only trying to solve the same problem mentioned on wiki in Java 8 functional style, I have mentioned that in my original description. So the first question of my solution being acceptable is assuming there are only 2 methods in the Coffee interface but the 3rd question is pretty much if the functional style loses value once there are multiple methods on the object being decorated. — Ajay Iyengar 23 mins ago
uhhh
one of these days I'm gonna remember to make my pull requests in a way that I don't have 2 critical bug fixes packed with 20 typo fixes
and to use branches so that if I make typo fixes afterwards, they don't get stacked on top of the already existing pull requests
 
10:04 AM
0
Q: Advice to speed up small haskell text-processing script

bliI'm a bioinformatician and mainly use python, but I'm trying to learn haskell. So far I like this language because it's beautiful and fun, but my haskell scripts usually end up being much slower than my python equivalent. Here is my latest attempt: -- Define type synonyms for fields in a fastq ...

 
Szia
Time for one code review :)
let me see, what I can take out there...
 
@Pimgd, let us assume that the coffee interface has just 2 methods as mentioned in wiki. — Ajay Iyengar 49 secs ago
alright you want an answer I will give you an answer
 
@Pimgd I saw your comment I upvoted it
He has mentioned too much, i guess
Did you try the Rainfall Challenge?
 
fffff
> This question has been closed - no more answers will be accepted.
 
just got a reply RE final interview w Riot
its going to be sometime this week
 
10:11 AM
@DanPantry Hi there!
did you get a new job? :)
 
been lurking for a while, hello @CrazyNinja
no, i've been through the interview process with Riot Games for the past 8 weeks or so
I have one final interview left, which will be this week
Well, hopefully anyway
 
Awww..... That's great!
I've heard about Riot games. I guess it's a pretty big company
Wish you all the best! and hope you could do it better!
 
thank you :)
 
Might be more adapted to Code Review if the code is working fine, they'll give a detailed explanation on how to improve the code, what is considered good practices and what is not — Sidewinder94 10 secs ago
 
10:20 AM
Monking
 
VTC reopen, undelete answer, reeducate OP on CR & decorators
 
My Firefox is killing me :|
Or I'm killing my Firefox
 
see answer for detail
 
Will better fit in code reviewGilad Green 57 secs ago
If you decide to put it at Code Review, read the on-topic help center first! — Mast 34 secs ago
 
@Pimgd My comment on that question still stands.
 
10:22 AM
@Pimgd, let us assume that the coffee interface has just 2 methods as mentioned in wiki. — Ajay Iyengar 17 mins ago
Basically, Coffee is dumb and won't ever be expanded,
and we use decorators to keep track of ingredients.
 
Zak
@Pimgd Sounds like pretty rubbish coffee
 
It probably is!
 
Sounds like he doesn't know what a specification is.
 
Yes, which is why I want to educate him via answer - he insists all is fine, - either he truly believes this, in which case, answer applies, or he'll learn the importance of a spec
 
I don't think it's a good idea, in this case, to add ingredients in an enum in case he wants to add more, but I agree with the principle of your answer
 
10:27 AM
why not? All ingredients will have a price and a description
and... that's it
 
I'm thinking in terms of "real world business requirements", I wouldn't feel comfortable having ingredients (which are data) hard-coded
But changing from enum -> class read from a text file / external data source would be simple enough
 
I wouldn't be comfortable without a spec in the first place
 
I read it 3 times. I can't understand what is the problem they asking to solve :(
 
@CrazyNinja That question is based on a false premise. A girlfriend will never tell you what they want. They will just say that nothing is wrong in an increasing annoyed tone until you guess it right.
 
I will just select two integers a and b, if the element at the position a is same as the element as position b in the non-ending chant by Ashima, I will speak “Yes”, otherwise say “No”.
^^This is what I can't understand
 
10:29 AM
@DanPantry added to answer
 
@DanPantry you are talking about the practical application :D
 
@Pimgd sorry to be a pain :)
after all
 
@CrazyNinja "blah blah blah blah blah", return nonstopBS.charAt(a % nonstopBS.length) == nonstopBS.charAt(b % nonstopBS.length) ? "yes" : "no";
 
@Pimgd that's what I understood, until I look into their provided inputs and outputs
 
@CrazyNinja ah wait
fixed.
That's it.
maybe I got some of the details wrong
like... they mention 1 based indexing?
Which is a great way to trip people up
because if you use 0-based indexing everywhere it'll all work but business requirement fail and thus super low testcase pass rate
 
10:33 AM
but no where in the question they mentioned about that divisible by a or b.... meh
 
neverending chant
 
@DanPantry That's what we're here for.
 
neverending => cannot get the length, right?
 
@CrazyNinja circular linked list
or, put differently,
your input is 1 word.
It represents the endless stream.
 
In that case, answer is "No"
cos, you can't find a matching element as b
 
10:37 AM
... because?
asdnklsdfajklsdfakljsdfajklsdfa
how do I put this
 
It has a length
 
you are to make a neverending stream of it
that's your job
and then they'll ask
is the character at index 45000 the same as index 7
based on the infinite stream "vgxgp"
 
I would start with the first letter charAt(0)
 
which looks like
vgxgpvgxgpvgxgpvgxgpvgxgpvgxgpvgxgpvgxgpvgxgpvgxgp...
 
Oh ohhhhh
 
10:39 AM
=) sorry for venting my frustrations
it's a really badly worded challenge, though
 
Now I understood, so, it means, whatever the piece of String/numbers they provided will be joined together and built an infinite stream
@Pimgd But wait, if the question as you says, it always be printed "Yes" except the case where it has a single character or a number as the input
isn't it?
 
charAt
 
input -> sfdsdfsdf => Yes
g => No
2 => No
 
what? No...
 
3434343434 => Yes
 
10:43 AM
abc goes in.
 
I mean the result that should be printed
 
1 2 = no
1 4 = yes
 
@Pimgd why is this?
 
because abcabc, 1-indexed, 1 and 4 are "a" and "a"
 
if we take the infinite stream built upon it, it would be like 1 2 1 2 1 2 ...
 
10:44 AM
start reading a lot more carefully
> First line of the input contains a string S, the name of the item she is demanding.
> Next line contains an integer Q, the number of pairs of integers that used to say “Yes” or “No” to her.
> Next Q line, each contains 2 integers, a and b. (1-based indexing)
THUS
abc
2
1 2
1 4
and output expected
no
yes
@CrazyNinja The first line is your inputstream, all the other lines afterward describe the test cases for which you have to print output.
 
I am having doubt whether this program is expecting the inputs from a file or not
I totally got confused now :(
 
@CrazyNinja stdin is the standard unless mentioned otherwise. If no filename provided, then still stdin even if they say "from a file", because without a filename... how will you read?
 
shall we start it from the beginning?
1) enter the String => "ninja"
then program should display "Yes"/ "No"
isn't it?
 
11:01 AM
0
Q: Should I Check for null color?

cssGEEKI have the next piece of code which changes the colors of some buttons. public void applySettings() { bgColor = settings.getBgColor(); fgColor = settings.getFgColor(); for (JButton b : appFrame.getButtons()) { b.setFont(settings.getButtonFont()); ...

0
Q: TLE in APS - Amazing Prime Sequence in Python at Spoj

sarvajeetsumanThis series is similar to Fibonacci Series defined as : a[0] = a[1] = 0 and For n > 1, a[n] = a[n - 1] + f(n), where f(n) is smallest prime factor of n. for N in (1 < N < 10^7). Spoj Link for this problem . I have solved this problem in c & Python. But due to long range, I am getting Time Limi...

 
0
A: Should I Check for null color?

Crazy NinjaI would rather return Optional<Color> from settings.getBgColor(). Then I don't need to check for null, instead, I can handle situation in a proper manner. It could be return a default value or raise an appropriate exception etc. But if you can't change the return type of settings.getBgColor(), I...

 
0
Q: Tic Tac Toe (Decoupling patterns and component based design)

XecI'm learning unity with c# programming and trying to learn game design. I know the that the best way to learn games programming is recreate some of the existing games. This is my code to create Tic Tac Toe. Its not 100% complete yet but it will be eventually. However my question is regarding wri...

 
11:26 AM
0
Q: Find the first common ancestor of 2 nodes in a binary tree

kanav kariyaTreeNode* firstCommonAncestor(TreeNode* root, TreeNode* q, TreeNode* p){ if(root == p || root == q){ return p; } if(root == NULL){ return NULL; } TreeNode* temp = firstCommonAncestor(root->left,q,p); TreeNode* temp1 = firstCommonAncestor(root->right,q,p); if(temp1 != NULL && temp1 != p...

 
11:39 AM
back from lunch
@CrazyNinja No, in that case, the result is undefined behavior. Q, and input cases, have not been specified yet.
 
@Pimgd I didn't get your point :(
"This answer changes the functionality of the existing code. The font is no longer properly set."
 
Greetings, Programs.
 
@Donald.McLean Hi
 
old:
for (JButton b : appFrame.getButtons()) {
            b.setFont(settings.getButtonFont());
new:
if(bgColor != null && fgColor != null){
        appFrame.getButtons().stream().foreach(b -> {
            b.setFont(settings.getButtonFont());
there exist certain states in the system for which the fonts are no longer properly set
namely, any case where not all colors are specified
@CrazyNinja Does that explanation make sense?
 
11:58 AM
@Donald.McLean Did they fix your monitor?
 

« first day (1186 days earlier)      last day (2836 days later) »