« first day (1257 days earlier)      last day (2764 days later) » 

12:19 AM
0
Q: List of all possible monetary totals from a set of cash

VermillionThis code prints out a list of all the possible sums that can be made from a set of cash. For example, say you have 2 fives and 2 tens in your wallet. With these, you can make exact change for $0, $5, $10, $15, $20, $25, and $30. import itertools cash = {1: 1, 5: 3, 10: 2} # Keys are denominati...

0
Q: Slow "bit" flipping "Lights Out" game

TimmyThe way these 1's and 0's flip are like the Lights Out game, except I only have to worry about a single row. So, if I have 1001 and I "press" the first bit it will become 0101 Now if I "press" the third bit, it will become 0010 and so on until you get the string to be all zeros. The way I solv...

 
12:47 AM
Ooh, mobile chat
Fancy
 
0
Q: Sum of Series: 1^1 + 2^2 + 3^3 + ... + 1000^1000

jzbakosMy solution to ProjectEuler Problem 48. Would like feedback/advice to possibly increase efficiency and/or correct incorrect practices. public static void main(String[] args) { BigInteger start = BigInteger.valueOf(0); BigInteger sum = BigInteger.valueOf(0); for (int i = 1; i <= 1000...

 
@xDaevax I wouldn't call it fancy myself, but it's mostly functional =)
@Phrancis Actually, the "assign" snippet is a real piece of code I tested and that works. Putting the full context would be much too verbose. As stated in the question, my intention is to manipulate variables that depend on parameters, in a quite general sense. The snippet is an example of how I currently do, using assign and get. — bli 9 hours ago
Thoughts on this^ anyone?
 
1:03 AM
I agree with keeping it closed
 
1:17 AM
You might want to read how to get the best value of Code Review: asking questions and checklist for how to write a good Code Review question on meta; feel free to also take a look at a few of the top-ranked questions in your tags, see the type of answers to expect. Have you seen our help center? As far as code is concerned, on this site "too verbose" would be for reviewers to point out! ;-) — Mat's Mug ♦ 21 secs ago
 
1:30 AM
0
Q: Accurately calculating gravity for large systems

Jean ValjeanI'm in the middle of a program to simulate gravity between particles for > 50000 particles. It works so far, but the way I calculate gravity seems to be a tad askew. Generally, it works. It fails when particles get too close (distance between them approaching 0, gravitational force approaching in...

 
2:09 AM
0
Q: Have I done what the assignment is asking for?

eric ericI was wondering if I have done what this is assignment is asking me to do. Or if maybe I was supposed to implement this a different way. Below is the instructions, my code, and what the code outputs. Write a program in C to create 10 threads as specified below: The first thread will compute th...

 
 
1 hour later…
3:25 AM
0
Q: Singly linked list implementation in JavaScript

Matthew CliattI'm looking for feedback on my singly linked list implementation in JavaScript. Please let me know if you have any suggestions on coding style, documentation, bug fixes, etc. UML / code overview LinkedList _head - The first element in the list _size - The number of elements in the list...

 
3:42 AM
The Giants and Cubs are playing in a TNT park.
The Giants have the detonator, but the Cubs just struck a match.
GOOO CUUUUBS!!!!!
 
4:06 AM
YES!!!
 
4:32 AM
Monking @Phrancis
and @all
 
Monking @Heslacher!
@RMunroe Wow, that's actually true too (the hover text)
 
0
Q: Building an efficient Python backup module

ruengemoogI am writing a module that will synchronize destination to be the same as source, but will only overwrite files in destination that differ from source as to not cause excessive writes, hopefully prolonging the life of the backup. I will probably add additional functionality on top of this later. ...

 
Well time for some more JAVAscript :)
Oh wow, a Bible story reference joke in a coding tutorial LOL
> You should make like Solomon and divide Child in two: one component for displaying the name, and a different component for allowing a user to change the name.
 
5:09 AM
"Tabs or spaces?" "Hot dogs." https://t.co/yWYbdYa36g
 
Reboot time. BRB
 
5:42 AM
0
Q: WPDB Query Returns Duplicate Arrays

DaveyJakeI'm working with New RoyalSlider attempting to a custom {{variable}}. Everything works until I attempt to add the following: $query = "SELECT DISTINCT pm.meta_value FROM wp_postmeta pm INNER JOIN wp_term_relationships trm ON (trm.object_id = pm.post_id) AND trm.term_taxonomy_id = 6 WHERE pm.met...

 
6:22 AM
@Vogel612 monking
:)
I have a question about understanding reduce(T identity, BinaryOperator<T> accumulator)
when it comes to parallel streams
The identity value must be an identity for the accumulator function. This means that for all t, accumulator.apply(identity, t) is equal to t. The accumulator function must be an associative function.
it's from the docs
I can't understand This means that for all t, accumulator.apply(identity, t) is equal to t.
any help, appreciated!
 
6:44 AM
0
Q: QuadTree C++ Implementation

brandonpI recently created a QuadTree implementation in C++. It varies slightly from most implementations. Instead of storing elements it only organizes elements. This allows programmers to insert elements into the QuadTree and maintain access of those elements outside the QuadTree. Nodes will only sub...

 
7:01 AM
@Jude It means that if you combine the identity value with any other value, called t, it equals to t. Consider for example addition. accumulator is (a, b) -> a + b and identity is 0.
As any value plus zero equals itself.
Or multiplication, identity is 1 as any value multiplied by 1 equals itself.
 
7:28 AM
@SimonForsberg ohh, thanks for your reply
that said, we can't write something like this
BiFunction<Integer> bi = (p,q)->p+q;
Identity : 1
 
You were supposed to use a BinaryOperator, not BiFunction, right?
BiFunction takes three generic parameters, BinaryOperator only one.
And the identity when using addition is 0, not 1.
 
opps!
it was a mistake that I typed, BiFunction instead of BinaryOperator
actually, if the identity becomes 1, then it will be invalid
isn't it?
 
7:47 AM
Yes, exactly. The identity shouldn't be 1.
 
if it returns identity + t = t,
then do we need to have a identity ?
 
Yes you need to have an identity.
It can't just guess what the identity is.
The identity is also the starting value. That identity will then be combined with the other values using the BinaryOperator.
 
let's say I have List<Integer> list = Arrays.asList(1,2,3,4);
 
What the reduce method does is essentially this:
T value = identity;
for (T curr : values) {
    value = operator(value, curr);
}
return value;
 
yes. That's clear. But I'm confused with when it runs in parallel
int newValue = list.parallelStream().reduce(1, (id,v)->id+v);
 
7:55 AM
Well, let's say that you have your list with the values 1 2 3 4. Then one thread might take identity 1 2 and combine those and another thread takes identity 3 4. And then the results of these two threads will be combined.
@Jude That will give different results depending on how many threads are used.
 
let's say, we have 3 threads
1st one will take the value 1
2nd one will take the value 2
3rd one will take 3,4
 
And all the threads will in addition to the values also make use of the identity value.
 
1st thread will have : 1 + 1 (as my identity is equal to 1)
2nd thread will have : 3
how the 3rd thread will operate here?
 
So you will get:
1st thread: 1 + 1
2nd thread: 1 + 2
3rd thread: 1 + 3 + 4

That's why the identity needs to be `0` if you are using addition.
 
8:00 AM
@SimonForsberg yes. I understood the importance of making identity + value = value. But I want to know how the rest of the execution happens
@SimonForsberg I think, once all threads ended up with values respectively 2, 3, 8, then combination is happening
 
After each thread is done the thread values are combined together. So you will get 2 + 3 + 8 = 13 as the result. But the sum of 1 2 3 4 should be 10.
@Jude Exactly.
 
but with this reduce signature, we haven't defined a combiner
@SimonForsberg will this method signature, uses the accumulator as the combiner too ?
 
0
Q: Handling a user control that needs to be put on my form in WinForms project using MVP pattern

Marthe Veldhuisin my application i have a form 'DetailScreenView' which implements 'IDetailScreenView'. It is connected to 'DetailScreenPresenter' by the Passive View MVP pattern. I also have a 'DetailScreenUserControl' which needs to be put onto the 'DetailScreenView'. I have looked at how other people have ...

0
Q: Method which handle HttpResposeMessage

RaskolnikovI need to create method which handle HttpResposeMessage. Method should throw an exception if error exist, client will handle rest. You can see my code bellow. This code is working fine and doing what I want, but still it looks quite ugly to me. Do you have some ideas for nicer implementation? p...

0
Q: find shortest whole repetitive sub-string

Lin MaWorking on a problem to find wholly repeated shortest sub-string of a given string, if no match, return length of the string, for example below. My major idea is using a Trie tree to build sub-strings from length 1 to half length of the whole string, then traverse the Trie tree to find if there ...

0
Q: C# What is best way for if statement to check validation instead of string?

BinaryTieI have page where I am inserting some data into Entry fields. For each Entry I have written in XAML different controls with parameters. One of them is Formated parameter where I am giving a string which I am checking on C# logic code. The problem which I figure out that some one could insert wron...

 
@Jude Yes.
 
@SimonForsberg thank you for clarifying it. I am actually going to take the OCP exam
I have done 2 enthuware exams and sadly, both I got failed :(
damn.... i can't believe it.
I thought I was in a confident level. But with this, i felt down
 
8:10 AM
Naruto answer; accepted non-selfie answer with 0 score: Ruby Select uniq in one statement
 
@Jude Ah. I took that exam almost a year ago. Luckily I passed :)
@Jude Not sure what enthuware exams are.
@Jude My recommendation: Read a lot of the Javadoc for things you are not very familiar with. And understand how they work. (Such as this reduce thing)
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Processing files with streams
 
8:27 AM
Monking
 
:)
 
8:42 AM
Monking @Vogel612
 
8:53 AM
@SimonForsberg is @Duga sleeping or has she crashed ?
 
IIUC she's been down for a few days now ...
 
Oh, poor @Duga
 

 Duga's Neighborhood

It's a beautiful bot in the neighborhood. Would you be mine, w...
I restarted her two days ago as well. Doing it again now.
 
cool
 
0
A: Access element of previous step in a stream or pass down element as "parameter" to next step?

JudeChild aggregates to a parent, hmm.. Smells like key-value pairs. Map! So, I tried it in this way. and it worked. Hope this would be helpful. parents.stream() .flatMap(parent -> { List<Integer> children = new ArrayList<>(); children.add(1); ...

Is it correct? I just tried it out. but not sure this is an appropriate way to do this
 
9:09 AM
0
Q: Ruby: comparing two Arrays of Hashes and mapping one to the other

NewJavaanCan you help me to optimize my code for the following problem: I have two arrays of hashes which I need to compare and map. The expected_tasks are my input. The actual_tasks are a set of tasks that I need to execute an action on. To be able to execute an action defined in my expected_tasks, I h...

 
9:42 AM
0
Q: Complex report generator using huge SQL Query

Cajuu'As the title say, I have a huge SQL Query which was built over the time (as new requests came, fast workarounds were demanded).More, there were three DB Admins who contributed to this query, and I'm just a poor programmer who has to deal with it. This query's purpose is to build a report, using...

 
9:57 AM
Monking
 
@Ped7g well, in fact my real usage is as trivial as the example. I want to make absolutely sure that the function is called with parameter of the correct type and no conversion takes place. Whether this is good approach or not I am not yet sure, but thats not a discussion for here. I will put it on codereview... — tobi303 40 secs ago
 
Welcome back, Duga!
5
 
Neeed a star ^^
 
10:12 AM
I'm starting to dislike universities even more and more :|
Just over five years ago I bought a laptop that was sponsored by my university such that I had to pay 50%, it was a good laptop and they added extra software. Apparently the regulations stated that after five years we had to bring it back so they could reinstall it and remove said software, obviously everybody forgets those small letters and a few days ago I got a notice that I had to do it within five working days...
They'll format it and install a clean image, so yay for forced reinstall too
And I still don't have any clue what the "extra software" is supposed to be :D
/rant
 
Kaz
@skiwi Can't you just back it up and restore it immediately afterwards?
 
@Kaz The laptop actually is borked beyond repair, it's abnormally slow and I've got no clue why
Maybe a reinstall helps :D
I suppose they put W7 back on it, but I'll put W10 on it afterwards
It's just that I think it's odd that they want to clean the laptop, it's not like there's any stuff on it that shouldn't be shared, and otherwise I could still copy it somewhere else, they actually recommend creating a backup
The only thing I could imagine is that it is about the Windows license, but it's W7 Professional, I don't have a license key though, perhaps it's registered on their server once I enter the network?
Even though it's been bugging me for the last few years that the install is no longer valid and that the device may be compromised (because it cannot verify that the key is legal)
 
possible answer invalidation by BinaryTie on question by BinaryTie: codereview.stackexchange.com/posts/143961/revisions
 
Kaz
10:30 AM
Don't ever use [name][initial]@ for your corporate domain. You will get an unfortunate combination which turns the email address into something inappropriate. Say, Takeshi Tanaka (Takeshit@). Or Ana Lewis. Or Dan Gardiner. Or, well, you get the idea. Just do Firstname.Lastname@ and be done with it. — Kaz 8 mins ago
Thinking up combinations for that one was fun ^^
 
Nice ones ^^
Trying to figure out the issue with the third one though
11
Q: Who owns genes?

shieldgenerator7I'm building a world where humans reproduce by machine, not by sex. Two or more individuals submit their DNA together to a breeding company. This company has pods that take multiple people's DNA, combine them in the most advantageous way (based on an algorithm), and turn it into egg and sperm, wh...

@Kaz ^^
 
Kaz
@skiwi It's not so much inappropriate as just unprofessional. Dang@[Company] doesn't exactly scream professionalism ^^
See also: Dan Kristos, Dan Eccleston
 
10:50 AM
0
Q: C++ implementing stack memory leak

H72L76I am implementing a stack by C++ and here I think it has memory leakage problem: in Stack::peek() and Stack::pop(), where I created heap space and returned pointer to function caller. Users who call these two functions may perform deletion on returned pointer, which will recycle heap space once...

0
Q: Entity relationship diagram for a small image upload system

TenTen PeterI'm creating a small application where users can upload images. The application will let users like and comment on the image and also like comments. please review my ERD.

-1
Q: Stuck Up On how to apply Iterator to a Composite Pattern

Dimitrios DesyllasI am making a Java Webserver that creates checkerboards with more that 2 type of tiles , Eg. can be A checkerboard that can have Blue,Black, Green and Magenta tiles. Also a tile can also be a checkerboard. The implementation is on https://github.com/pc-magas/webChecker The composite containes t...

 
But the naming of the nucleotides themselves is ultimately arbitrary. According to etymonline.com, adenine is "so called because it was derived from the pancreas of an ox", while guanine is named "from guano, from which the chemical first was isolated" and thymine "from thymic acid, from which it was isolated" (cytosine comes from cyto- meaning "cell"). Had the discoveries occurred differently, those chemicals would have very different names. — Robin Saunders 2 days ago
lol v2
Conflicting comments are funny too...
We have a couple of PhDs on rolling loan to our company (part of a knowledge transfer gov't scheme). They're incredibly smart people but utterly clueless when it comes to business realities. The truth is that even if we told the world how we do what we do, it would take years for a 20-man team to turn that process into a robust, tested, accredited piece of business software suitable for sale to Enterprises. We couldn't do what we do without the algorithms, but they're still a tiny, tiny part of the whole operation (and not even the most important). — Basic Oct 7 at 22:47
> We couldn't do what we do without the algorithms, but they're still a tiny, tiny part of the whole operation (and not even the most important).
Couldn't do it without... but it's not important, huh?
 
Kaz
@skiwi I think they mean "The algorithms are the foundation, but 95% of the work involved in building a business is spent on stuff other than the foundations". Development, Sales, Marketing, Customer Service, Legal etc. etc.
 
11:08 AM
@Kaz Yes, but if they wouldn't have the algorithms, then they wouldn't have the business... so therefore it should be important, right?
 
Kaz
@skiwi It's a bit like the idea for a startup. Sure, you have to have the idea, but by itself it's not worth anything. The value is instead in the execution.
When you have, say, private research or patents involved then it's different.
 
Right, good point, didn't consider for a moment that the algorithm is public domain
 
0
Q: C# Logging System

Liam HardyI created a small logging class library and wanted you guys to check it out, I used to use Log4Net but thought I could create something more user friendly that was more suitable for my project than Log4Net was, don't get me wrong Log4Net is an amazon library but it can just be hard to edit to you...

 
11:47 AM
hmm... okay I think I'm good with keeping my reviews to around one page
 
11:58 AM
If this code already works then you might try CodeReview instead...but check their guidelines first. — Paulie_D 1 min ago
Asking for a code review, or suggestions to optimise code is unfortunately off-topic. — evolutionxbox 1 min ago
 
Kaz
Why I intend to avoid "smart" everything for a long while to come:
Well the kettle is back online and responding to voice control, but now we're eating dinner in dark while lights do… https://twitter.com/i/web/status/785905327967498240
 
@3zzy: That's what codereview.stackexchange.com is for. — squint 46 secs ago
Perhaps you should move this to codereview.stackexchange.com though? — Jon Skeet 16 secs ago
 
0
Q: SQL query C++ code (My first C++ application)

Gábor ErdősI would really welcome some advice, and notes about my code. I am a long time Python user, and some days ago i decided i should try C++. So a couple of days passed, and i wrote my first application which has a practical use. I still find C++ very complicated (my current perspective is over compli...

 
@Kaz They're becoming a bit too smart...
I just powered off a PC that said "Please do not turn off this PC while installing updates".
 
12:13 PM
I'm voting to close this question as off-topic because is belongs on codereview.stackexchange.comJon Skeet just now
I will delete the question, and I didn't know about the existence of codereview.stackexchange.com, thanks! — Tareq B. just now
 
12:28 PM
-2
Q: compress and decompress more than 20000 character long string in c#

Satva InfotechI want to compress more than 20000 character long string in c#. I Almost use all possibility but not success..This is code but not work. please help me..i want a compressed string too short.. private static string Compress(string strInput) { try { byte[] bytData ...

Burn it
Broken code
 
You should have probably asked this here: codereview.stackexchange.comnick zoum 1 min ago
 
-2
Q: compress and decompress more than 20000 character long string in c#

Satva InfotechI want to compress more than 20000 character long string in c#. I Almost use all possibility but not success..This is code but not work. please help me..i want a compressed string too short.. private static string Compress(string strInput) { try { byte[] bytData ...

 
@nickzoum I'm afraid hypothetical & example code are both Off-Topic for CodeReview. — Kaz 20 secs ago
 
1:07 PM
0
Q: JavaScript function for to create HTML-elements

mizechI have written this function for creating complete HTML-elements including arbitrary attributes and inner HTML. I want to keep and reuse it. Therefore I have tried to document the usage well. I would be interested in hints concerning: Could the code be improved. So that it is becomes more s...

 
1:33 PM
And we're back
 
0
Q: C++ small 2D matrix class

space_voyagerI make a 2D matrix class (where matrix elements are of type float) which so far can: Create a matrix of zeros of any size by typing Matrix2D myMatrix(n,m) where n is row size and m is column size (default is 1) Create a matrix based on an initializer list, for example Matrix2D myMatrix({{1,2},{...

 
1:53 PM
@xDaevax about the optional parameter question. In your first example you need to use where x.DATE_DELETED_DTE == null because you are checking for !includeDeleted. The same is true for the second example using GuideQueryRequest as well. You switched the if condition as well as the checking of the x.DATE_DELETED_DTE.
^^^In your edited answer
 
Ahh, I got switched around again. Fixed
 
great
+1
 
monking
 
Heslacher: I can't stand up for the meat of my suggestion (I've copied that from the question) but I think my conclusion is justifiable from my arguments :-). My point is that the caller does not gain anything from a deleted-flag. – Henrik Hansen 7 hours ago
Thats a fun comment
 
If one doesn't listen to advice I can't help it ;-)
Monking @EthanBierlein
 
2:01 PM
Monking!
 
Remonking @Phrancis
 
Is Remonking a thing? That's fantastic!
3
 
0
Q: Optimizing code for UVAJ 573 The Snail

SuckersI'm getting the right results for the code for the sample outputs, but the OJ is giving a TLE (3 seconds max). The questions is here. int main() { double h,u,d,f; while(scanf("%lf%lf%lf%lf",&h,&u,&d,&f)!=EOF) { //cin>>h; // if(h==0) // break; //cin>>u>

 
Not really. I just said Monking to Phrancis 9 hours ago ;-)
 
@CaptainObvious In that question, even the title and question itself seem like code...
 
2:04 PM
 
I can only assume OJ means Orange Juice and TLE means Totally Legitimate Egg'
Which reminds me that I didn't eat breakfast
 
And I haven't had coffee yet x.x
 
0
Q: Calculate amount of elements in collection by property

misteriossI was given this task: Calculate amount of elements in collection by property: "name" let array = [ {name: 'Serhii'}, {name: 'Serhii'}, {name: 'Nile'}, {name: 'Apple'}, {name: 'Serhii'}, {name: 'Serhii'}, {name: 'Apple'}, {name: 'Serhii'}, ]; Here is my solutio...

 
2:44 PM
0
Q: Improvements on sample interpreter

amanuel2I have an interpreter here : /** * Bone Lang. * BoneLang <>{}[]() Interpreter. * @author Amanuel Bogale * @date 10/12/16 **/ #include <iostream> #include <string> #include <algorithm> #include <stdarg.h> #include <stdint.h> ///////////////////////////////// // DEBUG - Developer Helper ...

 
2:56 PM
-3
Q: Peer Code Just want to kno what others think

Jasonvoid getSomeData(char * pData) { // pointer to a memory mapped register int * pRegister = 0xa1001234; int i; char result[100]; // read 100 bytes while ( i < 100 ) { int * pRegValue = new int; *pRegValue = *pRegister; if ( *pRegValue == 0 ) ...

0
Q: wpf generic datatemplate

Dr. FreI'm working with interfaces and inheritance in my models and want to display such an interface model in a list. Because of the inheritance I run into some problems which I solved by creating code parts who I would call "technical debt". Furthermore it is not eaven fully working right now. (The D...

0
Q: Iterative implementation of K of N variations

ZieziObjective: Print all combinations with repetition of k elements out of a set of n elements. using System; namespace Chapter10Exercise2 { class KofNCombinationsIterative { static int[] combination; //------------------------------------------------------------------------...

 
3:08 PM
-1
Q: C# implementation for merging( AES+RSA+LSB) to hide files in images

moshira abdoI put together this algorithms to ensure the security of files. first i hash file data and then encrypt the file data using AES and encrypt the hash code and a new session key with RSA and finally i hide all results into an image. But when i retrieve data from the image and decrypt it ,i can retr...

0
Q: Javascript/Jquery Glossary Lookup Function Optimizing

j-man86I'm looking to identify any weak points and unnecessarily slow/expensive operations to optimize this function: https://jsfiddle.net/vkoc22kh/20/ Any help is much appreciated!!! Thank you!!! function cleanTerm(term) { // Escape any regex syntax inside this.term var cleanTerm = term.repl...

0
Q: Logging that can silently fail

JᴀʏMᴇᴇSo, the idea is that I want to log an error. If logging fails, I will try an alternative method of logging. In either case, logging should silently fail. Thus, I've ended up with an empty try - catch, and that never feels right. So I'm asking for any opinions on the design of it: public void Err...

 
Dang @Capn busy today?
 
he just wants attention :P
 
@CaptainObvious This (function($) { I don't understand... isn't $ the magical jQuery selector function?
 
@Phrancis $ is the jQuery function yes
but (function($) just declares an anonymous function that takes a parameter and names it $
 
@Phrancis Yeah, it makes sure that $ is JQuery. Say you do $ = 'foo' earlier. IIRC you do the same with undefined as doing undefined = 'bar' is funny. :)
 
3:18 PM
Without looking at the question it's probably an IIFE that takes a jQuery instance
(function($) { ... })(window.jQuery)
and yeah you can reassign undefined outside of script mode hurrr
 
@CaptainObvious design review with boiled-down code, bad fit IMO
 
You'd use an IIFE if you wanted to use function foo() without polluting the global namespace (because every script tag is executed in the same script context and functions are hoisted) or use 'use strict' or var.
 
here is another program for the n-queen problem. codereview.stackexchange.com/questions/77669/…r xu 7 secs ago
 
Is installing Windows 10 on a laptop that retail came with Windows 7 a risky move? Talking about a clean install here.
 
You're opening a Window to issues.
/s
 
3:22 PM
@skiwi If the laptop's specs are fine and it's a new install I don't see a problem
 
@skiwi Potentially, yes, if the system is old enough taht Windows 10 drivers for hardware are not available (Windows 7 drivers are not guaranteed to work with Win10!)
 
I'm not exactly sure about stuff that Lenovo puts on the laptop by default, but I suppose it's always possible to download it afterwards
 
and that's been the case on a few systems I've handled
 
Apparently there's a partition created that has some sort of boot image on it that I need to burn on a DVD, so that can always be used to recover Windows
 
3:26 PM
0
Q: Go: binary trees exercise

deltaskeltaNot sure about this code but it feels ugly to me... It is a solution to this: https://tour.golang.org/concurrency/8 package main import ("golang.org/x/tour/tree"; "fmt"; "reflect"; "sort") // Walk walks the tree t sending all values // from the tree to the channel ch. func Walk(t *tree.Tree, ...

0
Q: go exercise images (two solutions)

deltaskeltaI wrote two solutions, one easy and one harder (just for practice in dealing with interfaces) SOLUTION 1: (HARD WAY) package main import ( "golang.org/x/tour/pic" "image" "image/color" ) type Image struct{ // one array for x value, one array for y values, array of integer for ...

0
Q: Rock Paper Scissors C++ Game

Nikhil DeorkarI just started to learn C++ and I decided to make a Rock Paper Scissors game. It works fine but I would like to know how can I improve it further. In particular I couldn't find an efficient way to implement a play again feature. Thanks in advance. #include <cstdlib> #include <ctime> #include <i...

 
Backstory: This is my university laptop and it came with W7 Enterprise and today I had to return it to "clean" it from university stuff and they put W7 Home Premium on it and I want to install a W10 Professional key I have around
 
there's a windows 10 upgrade advisor tool
you may wish to run that to see if any issues'll crop up
no clue where to download it though
 
Kaz
Hi @johnsmith
 
Hi @Kaz
 
Hi!
 
3:29 PM
@ThomasWard Ah thanks, I'll find that somewhere
 
Greetings!
:p
 
Well I just finished "Learn ReactJS" parts 1 and 2 on Codecademy, I think I should start coding something of my own now
 
everybody brace for impact YAFB*
*Yet Another Fizz Buzz
 
Oh no, I'm not going to do a React FizzBuzz :P
 
phew
 
3:31 PM
heh
 
I'm thinking a calculator with GUI - maybe I can make a button to turn on FizzBuzz mode though ;-)
 
everyone take cover! (heh)
 
Public Service Announcement: we're out of titles
7
 
:\
 
Can someone help me with this problem I asked this on stackoverflow also but no good response was received codereview.stackexchange.com/questions/144014/…
 
3:36 PM
@Mat'sMug Secret Public Service Announcement: Just add spaces at the end of the title
 
@johnsmith FYI code that doesn't work is offtopic here. We only review working complete code, not give you guidance on an uncoded feature 'work'
 
@johnsmith that's a Code Review link, from 11 minutes ago
 
0
Q: Fast I/O in python

john smithI am solving a problem in which I need fast I/O my initial solution passed the test cat case with small input but with large input my code gives TLE (time limit error) so I tried to use sys.stdin() for the first time and I am stuck on how to use it Here is the input format : The first line...

 
@CaptainObvious how timely
 
@Mat'sMug Very fast
@CaptainObvious Speedy slithering eating and pooping snake
 
3:41 PM
@ThomasWard The code works fine on my pc with the sample test cases but it give runtime error when I submit the code to online judge
 
@johnsmith I added the tag to your post.
@ThomasWard TLE for online contests is a bit of a special case
 
@Mat'sMug I see.
 
@Mat'sMug Thanks
 
basically, outside the context of the "online judge", the code works fine, it's just inefficient
 
@Mat'sMug that's why i asked for clarification
if the code didn't work on their end or the judge's end that's one thing
but without that clarification on the question (in comments) or in here, "won't work" in the post could be an admission it doesn't work :)
 
3:48 PM
@ThomasWard The code works but its slow it passed the test cases with low constraints
 
@johnsmith you said that already in the comment on the question (and I gathered it also from Mat'sMug and the question)
i was talking to @Mat'sMug about why I asked and commented it might be Off Topic
and why i bothered to mention that is all
 
-2
Q: C# Best way of locking a null check on an application variable

liamNeed to prevent the chance of multiple attempts to populate 'myVar'. Is this the best way to use a lock or should I be doing something else? var padlock = new object(); lock (padlock) { if (HttpContext.Current.Application["myVar"] == null) { ...

 
monking
 
quack!
 
I've got two allocators: stack and wrapper over malloc, and am getting malloc to be faster. Is optimization of stack allocator in this case on topic?
 
3:54 PM
I totally read that as "I've got two alligators"
4
 
^^ Andrei Alexandrescu said something about std::allocator on the lecture, and it was about alligators too
 
lol
I guess it would be on-topic if you give us the code for the stack allocator.
 
ok, I will post both allocators, stressing that mallocator is kinda a goal to reach to
 
0
Q: String searching using hashing - refactor code

Babra CunninghamI've trying to write a quick text searching program based on Rabin-Karp, it returns the position of the first instance of the pattern in the text. However I'm not satisfied that the below is as readable as it could be? text = "sfdfdfdfdscatsdfdfdfdfddsdsdsdsdasdaas" pattern = "cat" --Hash st...

 
4:13 PM
0
Q: Create new columns depending on the columns in a table

LetUsSengI have code in the this following example. legacy_id phone_type phone_number 1 f 1234567890 1 b 1233854100 1 f 4110256565 2 f 0707070770 2 b 7895120044 I want the data to end up like th...

 
4:31 PM
0
Q: C++ linked lists with smart pointers

typemoonI want to know about smart pointers in C++11, so I started to write my own linked list implementation. Here's my code: #include <iostream> #include <memory> template<typename T> struct link { T data; std::shared_ptr<link> next; link(T value) : data(value) {} void add_to_end(T v...

0
Q: Logging System - Follow Up

Liam HardyHello so before I posted a question asking you to help me improove my logging system that was similar to log4net. Previous question: C# Logging System I have took your answers on board and added the following changes to my LogManager.cs class, below is the new one. using System; using System.C...

 
Kaz
4:44 PM
If I had a wall, this would be going up on it.
 
heh
 
5:23 PM
0
Q: Pygame Slideshow

bstipeI have written a basic slideshow program that uses pygame to manage the display screen. It cycles through all pictures files in the directory and sub-directories. There is a user configuration section for the start directory, sub-directories to ignore, image file type, display time, full screen o...

 
If your code works, then a better place to ask for how to make it better is Code Review. — Rad Lexus 59 secs ago
Finally for question regarding improvement of code you are better of posting to codereview.stackexchange.com. I shouldn't go on detailing unrelated code problems in the comments. — Eichhörnchen 26 secs ago
 
5:45 PM
0
Q: Background image mixin

wiredI've created sass mixin for background image and it look like this: $path: "../img"; /* fixed path to images folder */ @mixin back-img($image, $position: null null, $size: null null, $repeat: null, $origin: null, $clip: null, $attachment: null, $color: null) { background-image: url('#{$pat...

 
I hate how small our answering community is, when I'm in the mood to answer a question, all the important things have been said.
 
@EBrown can't find any unanswered zombies to answer?
 
@Phrancis Not ones that I have time to investigate to answer.
Some of them require a bit of investigation to answer, and I haven't time for that right now.
But I suppose I'll get to them eventually.
Maybe I'll do a few ones tonight.
 
0
Q: Find Numbers with Same Amount of Divisors

Łukasz KorolI try to resolve below task: The integers 14 and 15, are contiguous (1 the difference between them, noticeable) and have the same number of divisors. 14 ----> 1, 2, 7, 14 (4 divisors) 15 ----> 1, 3, 5, 15 (4 divisors) The next pair of contiguous integers with this property is 21 and 22. 21 -...

 
6:12 PM
probably belongs on codereview.stackexchange.com — Kritner 46 secs ago
 
0
Q: 1.#INF00 how is this coming

Lovely_Karn0/0 = undefined (program stops) printf("%d" , 3/0.0) // ans 0 But printf("%f",3/0.0) // ans 1.#INF00 Pls explain how ans is coming

0
Q: Robustness of this first difference function

Trevor AlexanderHere is a first difference function I threw together for a quick check in another program: use std::ops::Sub; fn first_difference<T>(input: &Vec<T>) -> Vec<T::Output> where T: Sub<Output = T> + Clone { let vec_len = input.len(); input.iter().take(vec_len-1).enumerate().map(|(ind, ...

 
6:27 PM
I'm not sure how an SQL question with an ERD and no code was upvoted and reviewed by a somewhat high-rep user. I'm at least glad it was still collecting close votes.
 
Hello and welcome to Stack Overflow. Since this is a working code, I'd advise you to move it to Code Review instead. I believe you will get better answers in there. People there always gives great advises on coding improvements. — Victor Moraes 40 secs ago
@YowE3K I have had this discussion with Mat'sMug before. I will answer the question and fix glaring mistakes, but I will leave it to the OP to go to CodeReview to get the pointers on how to make it faster and/or simpler. I break this rule on occasion when I feel lazy. Today was not one of those days. — Scott Craner 32 secs ago
 
6:51 PM
0
Q: MVC + WCF: Architecture Design Decisions

JohnI'm currently working on a project that consists of an ASP.NET MVC web application with a back-end wrapped in WCF services. I've used MVC and WCF on past projects but I've never been responsible for designing the architecture from scratch. I'm hoping for some feedback on my current design to make...

 
@CaptainObvious should this have been closed as a dupe?
 
7:19 PM
-1
Q: How to turn this piece of code into a function?

AizzaacThis is my fully functional code. But I need to use it in other scripts so how can I turn it into a function (I am not a pro in python)? from sklearn.ensemble import RandomForestClassifier clf = RandomForestClassifier(n_estimators = 10) ################################10x10 SSS###...

 
7:31 PM
0
Q: Simple factory pattern for cooking a pizza. PHP

ExohJoshI have developed a command line application which prompts the user to initially select an oven & then requests that they cook a pizza. The oven affects the pizzas cooking time. The pizzas information will be printed to the command line as well as the altered cooking time. I wanted to use the bes...

 
Piping Hot Pizza?
 
The meetup went great! Now about 90 more people know about Code Review!
19
 
7:46 PM
nice!
 
0
Q: Reduce square root to simplest radical form

VermillionThe function redsqrt(n) prints out the most reduced form of the square root of n. It calls on another function perfsq(n), which produces a list of perfect squares less than or equal to n. from math import sqrt def perfsq(n): # Returns list of perfect squares less than or equal to n l ...

0
Q: Multiway Ruby conditional

Ray ToalI'm a little unhappy with the look of this "flexible" way of dealing with errors from an API in Ruby: class ApiError < StandardError def initialize(response) message = response.is_a? String ? response : !(response.respond_to? 'body') ? 'Error' : response.body.is_a? ...

-1
Q: How to code for Secure Search Box for Google n Database both in python Djangoo

GecjManishHow to code for Secure Search Box for Google n Database both in python Django.

 
@SimonForsberg Awesome!
 
8:03 PM
0
Q: Item categories

Piero MariniThis is my second day into C++ and I wanted to get a small review from someone experienced with the language. I'm coming from Python so some stuff seems kind of weird. My plan is to build a little "web store" with this. #include <string> #include <vector> #include <iostream> #include <initialize...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Shrinking header on scroll
 
8:26 PM
My start screen committed suicide.
2
It "comes up", but doesn't show any of my tiles on it.
 
8:54 PM
0
Q: Creating a Pandas dataframe columns from regulars expressions

studentIf I am working with a number of .txt files allocated in a directory. From all this files, how should I extract specific words or chunks of text and place them into a pandas dataframe (i.e. tabular format), preserving a column with the name of each file? So far I created this function that do th...

 
9:05 PM
@Hosch250 How do you know it wasn't foul play?
 
I saw the typo, but I can't think of a good enough pun without chickening out.
3
 
lol
 
@xDaevax Hmm, I don't.
 
0
Q: Passing help options to bash script

SherryI used the below code to give -h(help) options to my bash script. Its working fine, wanted to get the code reviewed. while true; do if [ "$1" != "-l" ] && [ "$1" != "-a" ] && [ "$1" != "-h" ] && [ "$1" != "" ]; then output=$(curl -k -s -u "$username:$password" -H ...

0
Q: Is there a better way to implement this audio player?

Matt ThomasI just built an audio player in Angular2 using a player component and a player service. It's all working fine, I just feel like there is a much better way to do this. Should the audio object be in the service or the component? I'm skeptical because I'm using three different observables and I...

 
I bet it was because of the discussion we just had in VBA Rubberducking. Probably agents of the government did it.
 
9:08 PM
I find that my machine fails me right when I'm about to do something productive. So I usually just blame whoever has the most to lose in the event that I actually accomplish something.
 
"You know who is likely to be the next terrorist threat? These guys who are happy working with VBA. We should shut their computers down" - NSA, probably
4
 
@DanPantry I'm not happy working with VBA, and that's the truth.
 
9:35 PM
0
Q: Stopping ncurses printing with key presses.

SergeantPenguinI've been updating a little text-based game of mine to have the text roll out over a time period to give the appearance that it's being typed. I'm doing this by using non-blocking output with ncurses. The text to be output is passed to a function called TimedPrint, along with arguments for the s...

 
9:47 PM
0
Q: MySQL Database Library

Liam Hardyso I created a database manager and wanted to know if I could improove it in any way? Thanks. DatabaseManager.cs: using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sahara.Core.Database { ...

 
Kaz
New favourite quote:
> [The Internet] is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it.
 
10:07 PM
TTQW
 
0
Q: Swap first and last name in C

chris360So basically I took an entire line of input in the form of a string, and tokenized the string into sub-strings and obtained the first string as the first name and the second as the last name. This program as it stands is very basic and limited however my primary focus was on the creation of gener...

0
Q: Game of Nim beginner. I need to make a function for computer moves and my moves to complete the game.

Lesley Wayne var pileA = '00000'; var pileB = '00000'; var pileC = '00000'; function yourMove(); var example = prompt('Enter letter and number'); var exampleSplit = example.split(''); if(exampleSplit[0]=='A'){ pileA = pileA.slice(exampleSplit[1]); console.log(pileA); console.log(pileB); console.log(pileC)...

 
 
1 hour later…
11:16 PM
0
Q: Pass Multiple parameters to a SQL Query in VBA

mag123I am trying to use the below VBA code to pass a SQL stored procedure multiple values from an excel sheet. I am able to do it if I run/paste the procedure multiple times in VBA but ideally I don't want to hard code the parameters to specific cells in the workbook. I want to reference cells A1:A1...

0
Q: Drag to adjust size of two divs

tobloefBelow I have a browserify module I've made for resizing two divs I have beside each other. The idea is that I have two panes with a bar between them which I can grab and drag to resize the panes. As one pane gets bigger the other gets smaller. It's not really that important for the code review th...

 

« first day (1257 days earlier)      last day (2764 days later) »