« first day (1302 days earlier)      last day (2718 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD! There are 3086 unanswered questions (92.1978% answered)
 
@SimonForsberg Trying to find a new job. Lol
 
Well, if you hold off for another 16 weeks until school is finished, I'll run.
At that time, I'll be a regular contributor again, at least.
20 weeks, more like it.
 
@EBrown Oh... okay. That's also a good activity choice.
 
@janos I can understand that, how is it going?
 
@SimonForsberg Yeah...no luck so far. Lol
 
12:05 AM
@EBrown Did you check out the one I sent you on Skype?
 
Well, it will be too bad to lose @Mat'sMug now...
 
@EBrown Is the job market not so great where you live? Or you being kinda picky, which you have all right of
 
I'd apply if I knew C#, but alas I don't really, except very basic stuff
 
@skiwi I've applied on like seven or eight in the last three weeks and nothing. Lol
 
I'm getting an infinite loop in this function, can I get a 2nd pair of eyes?
 
12:07 AM
@Phrancis Yeah but I don't think I'm qualified for it.
 
def get_number_of_swaps_needed_to_sort(array:list) -> int:
    number_of_swaps = 0
    while not is_sorted_asc(array):
        for i in range(len(array)):
            lowest_element_index = get_lowest_element_index(array)
            if i != lowest_element_index:
                array = swap_elements(array, i, lowest_element_index)
                number_of_swaps += 1
    return number_of_swaps
 
I get responses to about 3/10, and I have a 3.99 GPA.
 
@EBrown Ouch :/
 
And Roslyn and Rubberduck and VSD experience.
 
@skiwi It's no big deal, I think it's to do with where I live. I live quite a ways away from anywhere looking for tech people.
 
12:09 AM
@EBrown Detroit?
 
@EBrown Uh so no real interesting tech companies for you then?
 
> About You, Logistically
In order to be considered for this job, you’ll need to:

Be based in the Louisville, KY area
Have excellent communication skills (both verbal and written) and a knack for explaining technical concepts to non-technical customers
Possess a deep working knowledge of the tools of web development, including HTML, CSS and Javascript.
Our administration area is implemented in .NET framework 4.5 / C# with SQL Server as the back-end. A minimum of 3 years previous experience as developer working with this framework is required.
 
@Hosch250 Nah, I'm back home for the moment.
 
Oh.
 
Sounds like you fit the bill quite well
(except the Louisville KY part of course)
 
12:09 AM
@Phrancis I'd apply, but I don't have 3 years of SQL Server.
 
@Phrancis Wow it has git!
 
@skiwi I applied at SE and a few others, but the closest is over an hour away and my resume isnt that great.
 
Also, I don't have "deep working knowledge" of HTML/CSS/JS.
Otherwise, I'd apply.
 
I can do everything I apply on, I just don't have paper backing it up.
 
You could probably get a better position, just had that in my bookmarks.
Going to apply after finals.
 
12:12 AM
@EBrown With the situation around where I live there's so many job offers that I need to filter a lot, really a lot
 
Haven't looked, but I don't have any college degree.
 
And that doesn't leave much in the end :/
 
@skiwi I have the opposite problem. I even bid on a PHP position because I can't find anything. Lol
 
I haven't heard anything since my phone interview. Probably failed it.
That's usually as far as I get.
I was essentially offered a position once (we were even discussing wages), but I leaked that I didn't have a driver's license, and they looked at each other funny and said I would need it.
@EBrown Are you willing to move, or do you want it in the area?
There are quite a few openings if you are willing to move.
 
@EBrown Ouch that's pretty bad then
 
12:15 AM
If you know PHP there are plenty of good paying jobs out there
 
@Hosch250 If I move I want it to be near Denver, CO (within a hundred miles or so) or somewhere around the Mississippi.
@skiwi Yeah...lol
 
@EBrown Finale needs a C# dev.
They develop music software.
They are in Boulder, CO.
 
I'd wager a lot of companies want to transition away from PHP and to something better, but need people who know enough PHP to understand the original code base in order to refactor/rewrite it
Ohh I've used Finale software a bit before, it's brilliant for writing sheet music!
 
My sister uses it.
I've done some Joplin clarinet/piano arrangements with it.
 
@Phrancis Luckily PHP is not that hard :p
TTRGTB
 
12:19 AM
@Hosch250 Send me a link and I'll apply on it.
 
It is on SO Careers.
It was the top hit for C# a while.
 
Ah. I'll have to look.
 
@Phrancis I think it's cause of get_lowest_element_index(array), if you have {1, 2, 3} it will always return 0.
 
@Peilonrayz So I probably need to query the lowest element index each time I swap elements then, you think?
 
@Phrancis Using it like that shouldn't work, because it'll always return the same thing.
 
12:25 AM
@Phrancis I don't know what you mean. I think just slicing the array, get_lowest_element_index(array[i:]), should work
 
Ah, right
@Peilonrayz Ohhhhhhhh great idea!
def get_number_of_swaps_needed_to_sort(array:list) -> int:
    number_of_swaps = 0
    while not is_sorted_asc(array):
        for i in range(len(array)):
            lowest_element_index = get_lowest_element_index(array[i:])
            if i != lowest_element_index:
                array = swap_elements(array, i, lowest_element_index)
                number_of_swaps += 1
    return number_of_swaps
Still getting an infinite loop, but feels like it's getting closer
 
@Phrancis it is. more so than I anticipated. and I have to say it's somewhat satisfying to nuke a spammer account from orbit. but I have RL stuff going on (buying my first house, and spending more time with my MS-afflicted sister (not Microsoft, Multiple Sclerosis), among other things) and I need to cut somewhere... sorry it has to be CR.
 
That's too bad. You've done a good job and all.
How soon are you resigning?
 
I sent an email, haven't heard back.. I'm losing the diamond anytime now I guess
 
0
Q: Ruby On Rails: Implementation of dynamical forms for JSON ActiveRecord using JavaScript

Ilya  LapanI have some data in my database I store as JSON (PostgreSQL supports it). The data can be pretty flexible, something like work-experience, with names of previous companies and positions or education history, with names of universities and dates of graduation. And users can have any number of thos...

 
12:33 AM
OK.
 
@Mat'sMug usually you'd only lose the diamond when the election is over
 
I guess I can run. I won't be very active during my last midterms and finals if I get elected.
Depending on how things work out with my job, I might resign after about a year too, but elections are always fun.
 
@Phrancis I just set something up, seems like a one-off error at first, as array[i+1:] is stopping, erroring, but stopping, ;P
 
@Peilonrayz I added some print statements to debug (and also a loop limit) See: repl.it/E8Di/3
I think I see at least what the problem is, now just need to find a way to fix it
 
@Vogel612 hmm that makes sense
 
Kaz
12:35 AM
@Mat'sMug Feels like the end of an era.
 
@Mat'sMug Sorry to hear about your sister, MS can really suck.
 
Kaz
And I thought 2016 couldn't get any worse ^^
 
@EBrown oh trust me, MS really sucks. watching your little sister struggle to hold her fork is heart-wrenching.
 
Kaz
I really hope things get better for you and your family.
 
@Kaz lol
thanks
 
12:38 AM
@Mat'sMug It is, I had a friend with it and it's really difficult to hear about. I hadn't seen him for a couple years and then I saw him a few weeks ago and it was just terrible to watch. One of the best people I know and he couldn't really do anything on his own. I feel for you bud, and I hope that things turn up for her (and you).
 
I thought I had heard about MS research recently, here is what it was, actually looks like good news: New treatment can 'halt' multiple sclerosis, says study (BBC)
 
I don't think it can completely halt it.
But every bit does help.
 
@Phrancis news reporting on medical science is ... difficult to take at face value
2
 
Yeah, I can't tell you how many dozen articles I've seen that a new drug can cure cancer.
Usually, these drugs are still experimental, and most probably don't even get released.
 
@Vogel612 I try to get my science news, medical and otherwise, from trusted sources, which the BBC appears to be
 
12:43 AM
@Phrancis kudos for not mentioning CNN ;-)
 
@Phrancis I think I get it, rather than slice parse i as the start of the range, and make it the default return, :)
 
0
Q: Generating RPG Characters (Objects)

jzbakosI am a beginner Java programmer. I have just finished up an assignment and would appreciate some advice and/or constructive criticism on my program. I am trying to ensure I do not advance my knowledge using bad practices. For context, I have the assignment details, followed by the full code below...

 
> Dr Emma Gray, who is head of clinical trials at the MS Society, said: "This type of stem cell transplantation is a rapidly evolving area of MS research that holds a lot of promise for people with certain types of MS.

"This treatment does offer hope, but it's also an aggressive procedure that comes with substantial risks and requires specialist aftercare. If anyone is considering HSCT we'd recommend they speak to their neurologist."
 
Anyway gotta go now, cheers @all
 
@Mat'sMug You know what the "C" in that on estates for, right? ;)
 
12:44 AM
Later Mug
 
Stands, not estates...
 
lol autocorrect?
 
Yes. On my iPhone right now sitting in my living room.
 
@Phrancis yeah heard of that one I think
@EBrown ditto with 3% battery :-)
 
Kaz
@Phrancis Depends on the topic.
 
12:48 AM
The clinical trials were done in Canada, only 23 patients at the time, of which 22 survived it and have been "MS free" for 13 years
 
So, the treatment killed 1/23 patients?
 
Yes
 
I highly, highly doubt the FDA will allow it.
 
I'm sure that larger clinical trials would be needed, 1/23 could be an anomaly rather than a meaningful statistic
 
Yes, it could be.
It could be high, or it could be low.
 
12:51 AM
Also, that was with technology from 13 years ago, stem cell research has advanced quite a bit since then
(and possibly the chemotherapy part, but I don't know much about chemo)
 
Chemo can be very deadly.
As can radiation and surgery, and lots of stuff.
 
The treatment basically performs a full reset of the immune system. It's basically like Jurassic Park: turn it off, "hold on to your butts", turn it on, get eaten by raptors
 
I've heard earlier this year that some researchers have been able to grow complete, functional organs for transplant from stem cells, that's really badass
 
isn't there a health.se?
 
Uh, maybe?
 
12:54 AM
I wonder whether questions about that would be on-topic there :/
 
I like how we're full-on off-topic after today's talk lol
 
> Health Stack Exchange is a question and answer site for medical specialists, students, dietitians, and anyone with health-related questions. Join them; it only takes a minute:
 
@Mat'sMug Well, not much site activity going on at the moment :)
 
There isn't site business going on, and nobody asked us to stop.
@Vogel612 I bet Biology would take those too.
 
anyway, </mug>
 
12:56 AM
See you.
 
Nanotechnology meets stem cells, pretty incredible
@Peilonrayz Not sure I really understand
 
@Phrancis Yeah that wasn't worded the best, have a look at this:
def get_lowest_element_index(array:list, start:int) -> int:
    '''
    Return the index of the lowest element of an array of distinct numbers.
    Examples:
    [2,5,3,1] -> 3
    [1,2,3,5] -> 0
    '''
    lowest_element_index = start
    lowest_element = array[lowest_element_index]
    for i in range(start, len(array)):
        if array[i] < lowest_element:
            lowest_element_index = i
            lowest_element = array[lowest_element_index]
    return lowest_element_index
 
Ohhhh nice
And, that fixed the issue and giving the correct answer! Thank you @Peilonrayz <3
 
No problem, :)
 
Wait, I just realized that you are @JoeWallis lol
Didn't notice the name change until now
 
1:08 AM
Yup, still the same old lurker, :P
 
lol
Oh boy, not quite done yet
Running it on the HackerRank site, it passed only the first sample case, all others are either wrong answer or TLE :|
 
Yeah, that happened to me, and I didn't know how to fix it...
But to note your algorithm isn't the same, you're doing a[i] - a[i-1], rather than doing | a[i] - a[i-1] |
 
Yeah, I thought it would yield same results but obviously not. I'll pull one of the failing tests' data and test with that now
Once I know it will yield the right answer it can be optimized then :D
 
You can do that?!
 
Yeah
It uses some of the Points you've earned on the site
 
1:23 AM
Ohhh, well I was planning to get into this site, so that's nice to know, thanks, :)
 
Yeah I like HackerRank, that's how I learned Python
 
Damn, that must have been tough
 
Nah, their Python challenges start pretty easy at first
And they go through a lot of the really cool Python features like Collections and all that
Plus you can do the tutorials/challenges with Python 2 or 3
 
0
Q: Express.js MVC controller router

PMVSo in the vein of an old dog trying to learn new tricks, I've decided to try to polish up my JavaScript skills. I've used it a lot but I don't claim expertise. I'm looking for any critique on the approaches I've taken, particularly in style - I can accomplish what I want, but I don't have the i...

 
TIL, and that's pretty decent. I think I learnt about collections from Code Review...
 
1:30 AM
This might be better suited for codereview a similar community. Is there something wrong with your code besides wondering if it could be better? — CollinD 57 secs ago
 
I'd like to delve deeper into maybe numpy and scipy, or maybe pygame and such
Maybe I could make a SQL DB connector in Python and then use numpy for statistical stuffs with data from the DB
 
Yeah, I need to learn how to do that too... I was scared off as a kid when I was trying to learn how to install them, and never went back.
 
Install the libraries?
 
If you do then you could answer the odd numpy question we get. That seems to go unanswered.
To use NumPy I think you have to compile from source (C) on Windows... It was daunting, and so I swiftly stopped
 
Hmm
 
1:37 AM
@Phrancis If you're going to roll your own SQL DB connector, test it on a server that's not mine, eh? ;)
 
Of course :P
Besides, I've made one with Java before, not that difficult :)
That's what localdb is for
Unlocked Sony Xperia XA phone for $199 right now, I might go and get me one
To replace this old iPhone 4
 
@Phrancis I like this iPhone 7.
 
@Phrancis Why not the Nokia 520?
Pretty cheap, runs Windows 10 more or less nicely...
 
@EBrown I'm kind of tired of iPhones
@Hosch250 You couldn't pay me to own a Windows phone :)
 
@Phrancis I wouldn't recommend any Windows Phones. Lol
And I'm a Microsoft fanboy. Lmao
 
1:52 AM
I'm calling you racist.
 
Android seems like the most reasonable option right now
 
I like the OS, but my phone is very low end, so I get an occasional hang.
 
iPhones are way too expensive, and Windows phone... run Windows, so that's an automatic minus
 
The Windows Phone is pretty customizable, but the software is crap.
 
@EBrown What software?
 
1:54 AM
BRB driving to Best Buy to pick this phone up
 
@Hosch250 All of it. Lol
 
Were you on the insider preview?
 
@Phrancis Have fun. :)
 
That is crap, but the latest stable version is nice.
 
@Hosch250 Nope, Lumia 950.
 
1:55 AM
Windows 8.1 or 10?
If 10, did you have the anniversary update?
 
10, all updates.
 
Well, what's crap about it?
I'd expect the 950 to work better than the 520...
 
Everything. This phone feels less powerful than my old S4 (and it's supposed to be much more so), apps hang frequently, random reboots, Microsoft Sync from my car isn't sipported on anything...
 
Hmm.
My Nokia 520 is slow and has an occasional hang, but that's it.
 
Recently it has started a thing where it will not turn Bluetooth back on when I take it out of airplane mode.
 
2:00 AM
I kind of expect the slowness given the RAM level.
Well, you seem to have a way of breaking things.
 
Sometimes the display turns on but no touch input works.
 
VS, all your Windows installations...
 
This phone is factory on Windows 10.
Quiet Hours and Cortana don't work properly.
 
You seem to have broken it from start to finish.
 
Then there was this issue:
3
Q: No Audio/Vibrate Notifications for Texts when Phone Locked

EBrownA few days ago my Lumia 950 (AT&T) acted up, and now for some reason I get absolutely zero sound on texts when the phone is locked. Let be more clear: if I am using any app (or home screen, start screen, etc) and I get a text, the phone vibrates and dings just fine. When I set the phone down and ...

 
2:03 AM
Anyone want to play bejofo.net/ttt/45224147?
 
7
Q: Remove Custom Word from Auto-Correct Dictionary

EBrownHow do I remove a word from the autocorrect dictionary? (One I've accidentally clicked "+" on) I've seen both of these questions: How can I remove items from the custom dictionary? How do I remove a misspelled word that I accidentally taught to my phone? But it looks like with Windows Phone 1...

That one also happened.
When I got the phone (a while after Windows Phone 10 existed) you couldn't remove autocorrect entries.
 
2:30 AM
@Hosch250 @Mat'sMug Anyone else interested: VS 2017 RC is out, with C#7.0 in it.
Currently installing, will let you know how it goes.
 
2:52 AM
I have done so much coding today and yesteday
.__.
 
0
Q: Creating a border using ncurses in c++

AlexThe biggest question is if it's worth it to use a useless if statement to make the x and y variables local away from the main statement. //Unconventional part, make it so that x and y are local variables if(true){ int x,y; //set x and y to be the width + heig...

 
Well that was a lot of selecting
 
Remonking
OMG this phone looks nice
 
possible answer invalidation by Jamal, 200_success on question by mxdsp: codereview.stackexchange.com/posts/148089/revisions
 
@Phrancis Which one?
(I might not have read everything while I was on my phone.)
 
3:06 AM
1 hour ago, by Phrancis
Unlocked Sony Xperia XA phone for $199 right now, I might go and get me one
 
0
Q: Best way to search column and based upon cell contents, place text in different column of same row

TeeI have a spreadsheet that has numerous columns. There is one column that contains over 3,000 four character text, some of which are duplicates. I need to search this column and based upon the cell contents, enter a code in another column in the cell of the same row that refers to the four charact...

 
@Phrancis Good good, more beef than my 950.
 
Sweet, Sony made an app to transfer all your iPhone data from iCloud onto the Xperia
 
3:26 AM
0
Q: How to email thousands of customers from a PHP form using a MySQLi query on a MySQL database?

PhotonHow can a large internet service provider email certain customers to warn them about an impending service interruption? I'm providing what I think is a reasonable solution, but I have not tested it. Please assume that the ISP prefers procedural MySQLi, rather than object-oriented PDO. Please also...

 
4:02 AM
0
Q: Get height for tallest possible stack of boxes

cycloidisticThis code is meant to compute the height for the tallest stack of boxes out of a given collection of boxes. A box has width, height, and depth dimensions. The height of a stack of boxes is the sum of all of the heights of the boxes in the stack. The boxes cannot be rotated. A box can only be stac...

 
4:32 AM
I'm voting to close this question as off-topic because it belongs in codereview.stackexchange.comEmmanuel Rosa 44 secs ago
 
4:50 AM
1
Q: Pitch detection library, basic architecture

mattj23I'm a mechanical engineer/amateur programmer trying to learn modern C++. I'm working on a personal project where I'm building a library that uses PortAudio to abstract some basic audio processing, specifically pitch and volume extraction from microphone input as a way to facilitate that learning...

0
Q: I want to display element of the array that user chose [java]

MercyI am having problem with my codes ;ㅁ; What I want to do is, first, I want to repeat the process of exploremenu>movestepsize>pick for five times so i can pick up to ingredients Also, I want to show what user have chose after i put those into the oven. Can someone advice what codes should i fix o...

 
@EBrown Cool!
Any German-speaking person around?
We were watching Franzl Lang, and we found this video with a very infectious yodel-laugh in it: youtube.com/watch?v=gzwfVKPJkUE
I'd like to know the gist of what they are saying to laugh like that.
 
0
Q: Bool and check if Prime

JadSo we were given a C++ exercise in class that checks whether a user-input integer is a prime number or not. We were never taught how to use the Bool keyword before, so I'm not very familiar with it yet and our professor gave us the following solution: Bool IsPrime(int x) { for (int i=2; i<x=x/...

 
5:53 AM
are you pulling my leg, JavaScript!?
 
No it's just playing with you.
 
describe('wrapDeclarativeRequest', () =>  {
  it('should dispatch a request to the given url when invoked', async () => {
    const responseObject = { greeting: "Hello, world!" }
    const spec = {
      url: 'https://www.google.com'
    }
    nock(spec.url).get('/').once().reply(200, responseObject)
    const dispatcher = wrapDeclarativeRequest<any, typeof responseObject>(spec)

    const response = await dispatcher()
    expect(response).to.deep.equal(responseObject)
  })
})
Fixed it
turns out deep equality is not the same as equality, who knew
 
JavaScript knew.
 
Wooow mobile
 
??
 
6:01 AM
Buggy
 
Oh
 
lol
I had my headphones on
turns out the fire alarm has been going off for the past 10 minutes
 
I need.to switch it to the mobile version
 
good thing there wasn't actually a fire otherwise i'd be, uh, toast
 
Old phone didn't support it
This is displaying monospace font as Georgia
 
6:14 AM
@Phrancis Still about?
 
6:29 AM
Yeah why?
@EBrown ^
 
Nevermind, was brainstorming something decided I'm going to do it.
 
BTW. Mobile
 
VS2017 is installing Python and R.
 
Hey just make sure it's Python 3
 
Both
 
6:42 AM
Good for you, if VS supports Python 2 and 3 then PARTY TIME
 
-1
Q: I need help refactoring some Rails code that looks clunky

abkar t.Write an application that prompts a professor to enter grades for five different courses each for 10 students. Prompt the professor to enter data for one student at a time, including student ID and course data for five courses. Use prompts containing the number of the student whose data is being ...

 
7:10 AM
holy crap
someone got onto my league account]
not entirely sure how.. there are 4 password reset attempts sitting in my inbox
 
Change password?
 
7:39 AM
0
Q: decryption java code

A.lakkanthahelp me solve that question When a plaintext and a key N is provided, each letter of the plaintext will be incremented sequentially till N letters and the incrementing sequence will repeat again. For an example consider the word:DOTITUDE and the key (N)=3 Then the encrypted text would be:EQWJVX...

 
7:51 AM
@Phrancis done that now
but they've been on it a good few hours
they were still on it when I changed it
had to ask player support to ban my account
 
Is the IP traceable?
I'd ban that IP in a heartbeat, but if it's on dynamic IP it'd be wasted
 
definitely will be
but I don't have access to that info in front of me
that will have to wait until monday
name changed my account and played a few games on it (all the losses are from him today)
I would noticed it earlier if I had cell service..
 
0
Q: Game where two players take turns picking numbers until a target sum (part 3)

Lin MaHere is a continued discussion (Game where two players take turns picking numbers until a target sum (part 2)), since it is new code and new topic for discussion, I start a new thread. Working on the problem of sum game. Suppose we have consecutive numbers from 1 to n, and an expected sum number...

 
 
1 hour later…
9:00 AM
Congratulations, @t3chb0t, on passing 10k!
4
t3chb0t, Cologne, Germany
10k 2 11 41
 
thank you @200_success ;-)
 
This question needs to be posted on codereview.stackexchange.com not here, as this seems more like an opinion on refactoring and comments — Sreekanth 34 secs ago
 
9:15 AM
0
Q: Player statistics class architecture

denisI've made a stats hierarchy for my Unity game project, it consists of 1 base class and few derived ones. abstract class Stats : MonoBehaviour public abstract class Stats : MonoBehaviour { [SerializeField] private int pointsInStats; public int PointsInStats { get { return poi...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Java MySQL handler for a Minecraft mod
 
9:37 AM
If this is working code that you think could be improved, see Code Review. — jonrsharpe 55 secs ago
 
9:55 AM
-1
Q: 2048 game implementation in Clojure

Anton ChikinThis is my first Clojure program. Source code and run instructions are posted here https://github.com/achikin/game2048-clj

 
10:09 AM
0
Q: WBQuiz - A 4-person quiz made with Node.js, Vue and WebSockets

wb9688I've made a quiz in Node.js at the backend, Vue at the frontend and WebSockets for communication. The quiz is made for 4 players. There's also a screen that shows the questions at /tv. The quiz has three question types: single: A multiple choice question where there's only one answer correct, ...

0
Q: Optional statements in a function

RoellandI'm writing a python script to find restrictionplaces. I was wondering if there is a better way to write the following: def restrictionplace(string, minLength = '', maxLength = ''): if minLength == '': minLength = 4 if maxLength == '': maxLength = 12 #rest of script if there is no...

 
10:24 AM
I have a program that computes the powerset of some input and then feeds that to set cover. I should put it on code review. — Dan D. 36 secs ago
 
10:49 AM
0
Q: nodeJS, fs, path - creating new directorties

Miha ŠušteršičI wrote this function that takes 2 arguments - the path to an existing file - file, and the newRoot name. The function splits the new path into directories, replaces the first directory in the path to the file with newRoot, , then loops trough all the directories checking if the director exists, ...

0
Q: Partition Equal Subset Sum Challenge LeetCode

thebenmanI solved this problem in LeetCode. Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. Note: Each of the array element will not exceed 100. The array size will not e...

 
11:10 AM
> You've earned the "game" tag badge.
bronze
 
11:22 AM
0
Q: Splines on Unity3D

StudI've written this small code chunk to implement a very basic spline system for object motions. As I've only used C# on Unity3D so far I would appreciate feedbacks on this, especially on access levels, naming and the use of C# API. Most of this code is executed before runtime so I'm not really con...

 
11:34 AM
-1
Q: I have an error in my program

Antony Naveenpackage com.test.practice; import java.util.Arrays; public class Alphabet { public static void main(String[] args) { public void setAll(String s) { String arr[]=s.split("Hi How Are YoU"); Arrays.sort(arr); for(String i: arr) { System.out.prin...

 
11:46 AM
0
Q: Email redirection script in python

R3turnzI am new to python and wrote a email redirect script. It extracts mails from a server and than resend them. I would like to get some feedback: import sys import smtplib import poplib import re import argparse def validate_email_address(address): email_pattern = '^[^@]+@[^@]+\.[^@]+$' i...

0
Q: Quarto game in Python revisited

alvomwccA while ago, I posted about advice for refactoring a game of Quarto I had coded before. I got some good advice, and did some revisions in lieu of this. import itertools # Enums for quarto. DRAW = "D" WIN = "W" UNDECIDED = "U" LOSE = "L" TIE = "T" class Piece(): """ Piece class: Each ...

 
12:10 PM
Goodmonking
@Pimgd Grats :)
 
To get idea on how to implement Start/Stop check Simple Multithread Timer implementation. — Nikita 20 secs ago
possible answer invalidation by Dan Dan on question by Dan Dan: codereview.stackexchange.com/posts/148090/revisions
 
12:29 PM
0
Q: Why is there an error?

Harry Karwasradef name(p): if p<=0: return print ('Jack') name(p-1) def do_n(fo, x): if x <= 0: return fo() do_n(fo(), x - 1) do_n(name(2),5)

 
12:40 PM
posted on November 26, 2016 by Vadim Kuznetsov

I'm trying to deal with the threading module and I wrote the following code, where two synchronous threads edit shared list: import threading _list = [] def a(): for element in range(8): condition.acquire() _list.append(0) condition.notify() print('a {} is waiting'.format(element)) condition.wait() print('a {} i

 
1:33 PM
0
Q: Python, if statement with multiple parameters

Roellanddef standvastig(reeks): """ Checks if the given input (list or number) is a series of one number (eg. 444444, 2222, etc.) Remark: raise an error if the input is a series of 0s or non-integers >>> standvastig(44444444) True >>> standvastig('44544444') False """ ...

 
Probably best to take this over to code review if it is functioning but just slow. — Jim Fasarakis-Hilliard 12 secs ago
 
2:03 PM
0
Q: Compile time error on 'Day 10: Binary Numbers' at HackerRank

RatulI tried to solve the Day 10: Binary Numbers on HackerRank with my poor algorithmic skills. This solution works on my PC: n = int(input().strip()) binary = "" while True: if n == 1: binary = '1' + binary break elif n%2 == 1: binary = '1' + binary else: ...

 
2:36 PM
Monking
 
2:57 PM
1
Q: Connect Four Game (Java)

JugheadI wrote this program as an assignment for an introductory programming course in Java, which I then decided to improve past the minimum assignment requirements. It allows two human players to play Connect Four. (If you don't know this game, its rules are explained in the code below.) /*ConnectF...

 
Monking v2
 
3:25 PM
IMHO this ought to go to Code Review SO first. There are so many issues (including several synchronization issues) evident even in this little snippet. | OP, please write legibly -- in your case, capitalize your sentences properly, this is a PITA to read. — Dan Mašek 17 secs ago
 
3:38 PM
Try Code Review instead. — Biffen 36 secs ago
I'm voting to close this question as off-topic because it should be on the Code Review SE (as others noted). — Some programmer dude 12 secs ago
@Biffen: They just don't like uncautions migration meta.codereview.stackexchange.com/questions/5777/… . OP apparently ignored SO rules, too, so pointing him at the FAQ seems to be necessary. — Olaf 18 secs ago
@DanMašek nope. This question is off-topic on Code Review, because the code doesn't work as intended. For more information, please read A Guide to Code Review for Stack Overflow UsersVogel612 50 secs ago
 
the others seem okay
 
0
Q: Making a deck of Cards in Python

RoellandI want to have a deck of cards that looks like this: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'...] For that I wrote the following code: import itertools kind = 'HCDS' value = ['1','2','3','4','5','6','7','8','9','10','J','Q','K','A'] temp = list(itertools.product(kind,value)) de...

 
4:25 PM
Monking
 
4:43 PM
> Setup Failed
I know Microsoft, just fix it.
 
0
Q: Pool allocator in C

flooblebitHow terrible is my code? After the #endif, that's where a new file starts, this is split into "pool.h" and "pool.c" #ifndef POOL_H #define POOL_H #include <stdint.h> struct list; struct block { void* data; uint64_t len; }; struct data_pool { struct list* blocks; struct block*...

 
Well, that would explain why it failed, I already have those components installed.
 
5:10 PM
@EBrown You would think that "Setup cancelled" would be an more appropriate message in that case.
 
@Sumurai8 Or "Component Already Installed, Skipping"
 
That would be... user-friendly - shudders
 
Thank you for the 'close' tags, typical StackOverflow as usual. The reason I can't post to Code Review now is that I have asked there a question that nobody is answering and now I am forbidden from asking for 48hrs. Gosh, is this network retarded... — Hristo Yankov 9 secs ago
 
@Hosch250 @DanPantry @Mat'sMug @t3chb0t Currently, as C#7.0 stands, you need to install (at least one) NuGet package(s) to get all the features to work. Tuples don't work out-of-the-box yet.
 
Hmm.
That didn't work?
 
5:21 PM
You don't need to do that for VS2017, and no. You still have to install the package.
 
Oh.
 
You have to Install-Package "System.ValueTuple" -IncludePrerelease for tuples to work.
 
0
Q: Which CountHolder implementaion is thread safe?

Damaji kalunge Is only synchronization on incrementCount method is sufficient ? Is is possible to all other threads to get the updated vale all the time ? as synchronize take care of publication. public class CoounterHolder { private int i=0; public synchronized void incrementCount(){ ...

 
Sorry that you feel that way. Code review is something that takes time, and it is currently weekend. It can take some time to create a good and helpful answer. This question would be off-topic on CR, because you don't include any code to review. This question is off-topic on SO, because it specifically asks for an opinion, and the question is not sufficiently specific. There are a myriad of answers that would be right in specific situations, and it is unclear which situation you are in. — Sumurai8 26 secs ago
 
But, once you do that, .NET Framework projects support Tuple's.
var tuple = (People: 5, Animals: 1);
var unnamedTuple = (5, 1);
 
5:34 PM
Looks like a job for Code Review. — ivan_pozdeev 5 secs ago
 
@Mat'sMug @Hosch250 @t3chb0t The new way out parameters works is awesome.
var testStringToParse = "15";

if (int.TryParse(testStringToParse, out int validInt) && validInt == 15)
{
    Console.WriteLine($"The number was {validInt}!");
}
else
{
    Console.WriteLine("Parsing failed, or the integer was not 15.");
}
The out int validInt declares validInt at the same time you're using it. No more having to create it before you call .TryParse, etc.
 
@EBrown this sounds very promissing. I had VS 2017 installed for one day and removed it as soon as I noticed that the properties window doesn't have the same colors as the rest of the application ;-) I think I'll wait until it's realeased, the RC seemd to by buggy.
no more out, I will miss my var result = (string)null :P
 
Please note that the question like how it is asked here is off-topic for Code Review. A question on CR must include the complete working code to review. The code must already be working as expected. — Sumurai8 55 secs ago
 
@t3chb0t Doesn't look that way for me, but I immediately switched to "Dark" theme.
 
@EBrown I like the new sync via MS cloud, it turned black by itself as soon as I registered my MS account
it synced with my VS 2015
 
5:45 PM
possible answer invalidation by Justin on question by Damaji kalunge: codereview.stackexchange.com/posts/148179/revisions
 
@Duga Looks fine.
 
Sorry, is there a 'Design Review' on the Stack Exchange, if this question is also off-topic on Code Review? If someone needs a code example about what I've just asked I will be better off without their review. — Hristo Yankov 16 secs ago
 
@Mat'sMug @Hosch250 @t3chb0t They added the expression-bodied member feature I wanted: public string Property { get => _property; set { if (_property != value) { _property = value; OnPropertyChanged(nameof(Property)); } } }
Now you can use expression-bodied members on the individual get and set portions of a property.
 
Nice.
I can hardly wait to start giving reviews telling people to use this stuff.
 
You can also throw inside expressions (sometimes).
abstract class Pet : Animal { public void Fail() => throw new InvalidOperationException(); }
Local functions are a thing. (Functions within other functions.)
 
5:52 PM
I knew that.
 
You can switch pattern-match with types and other things now.
var animals = new Animal[] { new Dog(), new Cat(), new Goat(), null };

foreach (var animal in animals)
{
    switch (animal)
    {
        case Dog d:
            Console.WriteLine($"Dog goes bark {d.Bark()}");
            break;
        case Cat c:
            Console.WriteLine($"Cat goes meow {c.Meow()}");
            break;
        case Goat g:
            Console.WriteLine($"{g.Name} does nothing");
            break;
        case null:
            Console.WriteLine("No instance to evaluate.");
Numeric literals can use _ as a digit separator.
And we have binary literals.
var hexLiteral = 0xFF_FE;
var binaryLiteral = 0b11111111_11111110;
Console.WriteLine(hexLiteral);
Console.WriteLine(binaryLiteral);
 
@EBrown Goes go Mah.
Also, BTW, what about case *?
 
@Hosch250 Wildcards are not yet supported, and may not make it into the spec.
 
F# uses that for the default.
OK.
 
there are so many new features it's almost like learning a new programming language
3
 
5:55 PM
var tuple = (People: 5, Animals: 1);
var unnamedTuple = (5, 1);

(var people, var animalCount) = tuple;

Console.WriteLine($"tuple.People value: {tuple.People}, animalCount value: {animalCount}");
Tuples are neat.
And that decomposition syntax can be defined on any type.
So if you have a Point, you can define Deconstruct on it:
class Point
{
    public int X { get; }
    public int Y { get; }

    public Point(int x, int y) { X = x; Y = y; }
    public void Deconstruct(out int x, out int y) { x = X; y = Y; }
}

(var myX, var myY) = GetPoint(); // calls Deconstruct(out myX, out myY);
 
@EBrown Was about time C# added that one :P
Other than that Java barely has anything on C# anymore, except the well-known support over multiple OS
 
00:00 - 18:0018:00 - 00:00

« first day (1302 days earlier)      last day (2718 days later) »