« first day (708 days earlier)      last day (3607 days later) » 
00:00 - 21:0021:00 - 00:00

00:00
There are 1309 unanswered questions
0
Q: Exotic bitmap renderer for core drawing functions

EdeniaI am very interested in inventing the best way possible for rendering bitmaps on-screen using the base drawing functions (putpixel(x, y), lineto(x, y), moveto(x, y), setpen(r, g, b, transp, size) ) You don't need to use graphic library to have them. You can call BIOS interrupt or initialize re...

0
Q: create a agency list in c++

melloI am looking for a code review... I want to create a adjacency list based on data i get from a text file.. could I make this more simple ... Any ideas ? #include <iostream> #include <fstream> #include <sstream> using namespace std; struct Vertex ; struct Edges; struct Edges { // edges link...

00:44
stackoverflow is for when the user discovers a problem in their code that they cannot debug. it is not to review some existing code nor explain how some code works. there is a sister site 'codereview' for those kinds of things. — user3629249 48 secs ago
@Duga I do not believe that this is on-topic for CR
@user3629249 This post is not on-topic for Code Review. Code Review is for improving existing working code, not for explaining what code does or why it does something. — SirPython 1 min ago
@user3629249: Code Review does not explain code -- we only review working code and expect the asker to know all about it themself. — Jeroen Vannevel 1 min ago
0
Q: Had the idea to port a pc game to iOs, but I don't know where to start

user70188there's a game I love to play on my pc, and recently I got an iPhone. As I'm slowly learning how to code, I realized that it is possible to port this game to the iOS (granted, that I wouldn't sell it or distribute it unless I got an authorisation from the company). But, to do that, I'd need to kn...

01:37
0
Q: how to manage shared code in project containing 2 sites?

HanssieTeeuwenI am working on an existing angular/coffeescript project which has a admin site and a customersite. Recently I have begun to remove duplicate code which was used in the admin / customersite by moving files to a shared location in the project. What I am facing now is how to manage the functionalit...

02:07
0
Q: NotBF - A Brainfuck-ish like "language"

Ethan BierleinI've made an interpreted language that's like Brainfuck except it has keywords instead of characters. Here's an explanation of the commands, and how to run it. add_ostream - Add the ASCII value of the current cell to the output stream. chg_size & [position]; - Change the current position on the...

02:21
0
Q: Inserting with joins

JavaScriptHatesMe<!DOCTYPE html> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/mystyle.css"> <title>Plum List</title> </head> <body> <div id ="wrapper"> <div id="header"> <h1>Plum List</h1> </div> <?php require_once 'co...

This question appears to be off-topic because it is a code review request. This is better suited to the Code Review Stack Exchange site. Before posting there be sure to read their FAQ to ensure that your question meets their guidelines. — John Conde 1 min ago
02:45
0
Q: Javascript : Vigenere AutoKey Chiper

Eko Junaidi SalamI have written a small encryption that I would like some critiques on. Here is the code : function VAChiper(key, abc) { this.encode = function (str) { var result = '',i=0,j=0,k=0,l=0; while(i<str.length){ var x = function(y){return abc.indexOf(y);}; i...

03:33
0
Q: How would I change the output of this code to only display the final encoded string? Instead of outputting each step of the string being encoded

PureProPhat#include <iostream> #include <string> using namespace std; int main() { // encode string s by adding 1 to the ASCII code of each character string userInput; string s = userInput; // an example cout << "Enter a line of text: "; cin >> s; for (int i = 0; i < s.length(); i++) // for each c...

03:43
@nhgrif I don't think that the client code is that useful, but it's nice that the author offered to show it.
 
1 hour later…
04:52
I'm not sure what the question is here. Take a crack at it and if it doesn't work, post a question here. If it does work, but you're just looking for feedback on your design decisions, then post on codereview.stackexchange.com. — Rob 1 min ago
@Rob Code Review is for reviewing working code, not design sketches. — 200_success 1 min ago
@200_success Agreed. But this site isn't for design sketches either. Hence my comment about "take crack at it" (i.e. just do it). But he shouldn't ask us to do it for him. This site is for code that has been written that has problems. Code review is for code that is written, works, but you want someone to review the design. Neither site is for brainstorming on designs (IMHO). — Rob 1 min ago
05:11
0
Q: update user coordinates in the database with Swift (like Uber)

mattiaI would like to make an app that shows my users location like Uber shows all the cars moving. So far I have come up with this code: func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { println(locations) var userLocation:CLLocation = location...

05:28
@200_success Agreed. But this site isn't for design sketches either. Hence my comment about "take crack at it" (i.e. try to implement it and see how well it works). But he shouldn't ask us to do it for him. This site is for actual code (or really well researched problems) that has issues. Code review is for code that is written, works, but you want someone to review the design. Neither site is for soliciting opinions on conceptual design alternatives. — Rob 2 mins ago
05:52
attr_accessor :time_string creates a getter method time_string and a setter method time_string=. Later you overwrite the setter. I don't know if that was your intent, but it's not good practice. Better would be attr_reader :time_string. Note Module#attr_accessors is a method. Also, notice that you never invoked @timer.time_string=`. After you get your code working I just you post it on Code Review. — Cary Swoveland 18 secs ago
06:38
@CarySwoveland I have been having some confusion about setting up classes and what should be initialized, what should have getter/setter methods etc...and when it is just overkill or detremential. Rspecs and creating classes are very new to me, and any resources that explain the aforementioned(in regard to setting up classes) in a clear concise and simple way is greatly appreciated;) as it is I am getting bits and pieces from different online sources but have yet to find one that really brings it home for me. I will post my new code on code review and see what they say. Yikes. lol. — HolyMoly just now
06:56
If you've not been to Code Review before, I think you will be impressed. Read through some of the other q&a's before posting. — Cary Swoveland 37 secs ago
0
Q: Finding whether a number of the form 1444....4 is a perfect square

ADGSomeone asked me We know that $12^2 = 144$ and that $38^2 = 1444$. Are there any other perfect squares in the form? Here is my code: public class OneFours { public static void main(String args[]) { final int power_of_ten = 8; int num = 14; for (int i = 0; i <= Math.pow(10, pow...

 
2 hours later…
08:51
-1
Q: Function to sum the absolute value of all pairs of elements

Jamal DorolI need to calculate the absolute value sum of all possible pairs of elements. For example, given {2, -3, 1} S=|2-3|+|2+1|+|-3+1|=6 I realize that there's a pattern but it only seems to work if the integers are non negative (∑xi)∗(n−1) I tried to brute-force all possible pairs but it takes t...

09:15
0
Q: Making class that contains other classes

user255572Even though I have asked a question here related to my app Using swing and creating jpanel. I still have other ones about best practice making applications. I have this class screening with contains film class and auditorium class. At the moment class looks like this: Screening.java: pack...

10:06
What do you mean by nice way exactly? And would be better in Code Review? — Soner Gönül 25 secs ago
Monking
0
Q: Can the below program be written in a nice way?

priyanka.sarkarThere is nothing wrong but any other nice way to re-write the below program public IEnumerable<Employee> InsertEmployee(dynamic employees) { var newEmployeeRecord = new List<Employee>(); foreach (dynamic employee in employees) { newEmp...

10:37
0
Q: Speed up LINQ to Entities query with lots of subqueries

JamesThis MVC4 controller method, which uses EF6, is taking a long time to run (over 2 seconds). I've added verbose comments for the purpose of this post only. public async Task<ActionResult> Index() { // Get a list of all the classes I teach. var myClasses = await CurrentUser.GetClassesAsync(db)...

10:55
0
Q: Calculate discipline level from attendance record given a set of rules

DelightedD0DI have written an attendance calculator that compares a set of rules against an employee's attendance record and determines what level of progressive discipline that employee is at (how much trouble they are in). Information: the rules are provided as a json object whose information comes fro...

0
Q: Aim is to reduce 3 forms into 1 via script. But is there a better way to create the 3 arrays thanI am currently

MunkeySo the aim of my project (it's unfinished) is this: Currently, if someone leaves my dept at work. We fill out 3 seperate forms. Often duplicating info. So I'd rather fill out 1 form and split data accordingly. My solution was to try to fix this in Javascript, using GAS. I've got the first 2 pa...

11:41
And if you knew how to make it work with minecraft, it would be great. — Tom Lenc 15 hours ago
2
lol
2
Original question? Asking how a scanner works
12:10
This question doesn't seem to be about a problem with the code, but rather a question how the code could be improved. I think this question would be better suited for codereview.se. — Sumurai8 1 min ago
12:24
A DAL (data access layer) should return data, not components related to the inner workings of the DAL itself. You need to keep those sql objects as local as possible. ExecuteAdapter/Reader should return a data set/table or a list of business objects (entities). ExecuteScalar should return the scalar result. And ExecuteNonQuery should return the number of affected rows. You'll find a simple example of a DAL class over at code review: codereview.stackexchange.com/q/85506/36214Bjørn-Roger Kringsjå 1 min ago
 
1 hour later…
13:43
0
Q: ASCII game java applet

10 RepliesThis code is probably really badly written and terrible... but it works. I need some constructive feed back, and some tips on optimizing it as it kinda flickers whenever i move the x with the arrow keys. import java.awt.*; import java.awt.event.*; import javax.swing.JFrame; public class _Newmai...

14:28
@sᴉɔuɐɹɥԀ Nothing about religion and caffeine - just that we don't need to spend the money and that it is considered a gateway drug.
...what?
@nhgrif Oh, we were discussing sleep, insomnia, and caffeine the other night.
Turns out the CR folks rejected this question because you want two different things; not only do you want your code optimized, but you also actually have a problem with a query not returning the right result. Pick one. If you want your working code optimized, ask that question on code review.se; if you want the problem query fixed, edit your question to remove all traces of optimizing your code and I'll re open it here. — George Stocker ♦ 1 min ago
2
You should probably better ask the on codereview.stackexchange.comClemens 1 min ago
I think this belongs to Code Review, since there is no clear programming question and you're attempting to get input for a method you're unsure about using. — holgac 1 min ago
How is caffeine a "gateway drug"?
@holgac This would be close almost immediately on Code Review. It contains example code, and by the asker's own admittance, it's not even part of an actual project... it's code that he's thinking about implementing. These sorts of questions are off-topic on Code Review. I'd invite you to check out our help center. — nhgrif 1 min ago
@Vanadium90 Before you post to Code Review, please be sure to read the help center and make sure your question is on topic there. — nhgrif 34 secs ago
14:34
It is a drug, but just not as deadly as most of the others.
Also, my mom used to use it heavily, but had to stop for health reasons.
0
Q: insert String array as label content in datagrid row through radio button C# wpf? Best practice?

Vanadium90I have written some code for inserting label at runtime having its content set to a string array and then insert that label into a datagrid row . All of this will initiate when certain radiobuttons are checked. code is working perfectly fine. But i need to improve this code as i am learning C#, w...

Needs a good edit, and a VM.
"drug" doesn't mean inherently bad, but you still didn't answer my question.
What is caffeine a gateway to?
Marijuana?
Heoine?
Cocaine?
So, people who drink caffienated beverages have a high likelihood of moving on toward using marijuana, heroine, and cocaine?
14:46
Afternoon all
Any chance someone could advise me a good laptop :D
So I guess you are a mac user ;)
I always wonder why people pay double for a laptop that has mediocre specs.
You're not paying double.
Please.
Show me a laptop with comparable specs for half price.
Seriously.
I can't find the english version, but I doubt you need it for the specs: dell.com/be/p/inspiron-15-7548-laptop/…
How many USD is 1049 euros? Aren't they approximately equal right now?
14:53
16GB for a laptop is totally unnecessary unless you do some heavy ass video editing
I'm into big data processing
@DJanssens That laptop has 1TB HDD.
I couldn't do without my 17" screen
@nhgrif a macbook pro 15 inch is € 2.249,00
I want a 15 inch screen :)
yes, indeed. That's the major drawback. but my current laptop has only HDD and I managed.
Right, but that's not the same specs you were arguing.
14:55
the €2k macbook pro has 256GB, which isn't that much.
I'm pretty sure I just read somewhere on this page it said something about 1TB solid state drive.
Which one on this page are you looking at? store.apple.com/us/buy-mac/macbook-pro
15-inch: 2.2GHz
with Retina display
And what's the screen resolution of that Dell?
This is hard for me to compare. I don't speak that language even in the slightest.
Truelife en UHD-resolutie (3.840 x 2.160)
3840 x 2160?
pixels
14:59
yes
Are the processors the exact same?
I have no idea what generation of intel processors the macbook has, they are pretty vague in their description
both i7, though the dell is a 2-core, while the macbook is a quad iirc
Core i7 (I7-4770HQ)
So, 3.4Ghz quadcore vs 3.0Ghz dualcore, and you feel like they have the same specs and you should pay the same price? I mean, that's just one of the differences, but nonetheless.
Apple products are slightly overpriced, yes...
It's a 5th gen processor, not many laptops have that yet.
0
Q: Locker Puzzle in Java

FabZerosThe author of my book does not release odd-numbered solutions to students, so I can't check my solutions. I was wondering if there was a better way to solve this problem without simply printing out the square roots. Here is the question: (Game: locker puzzle) A school has 100 lockers and 100 stu...

15:06
I'm keeping the pssibility of apple open, but the major factor for that is since I want a unix system (dual-boot probably). I'm afraid that the dell won't support Ubuntu well, while mac is built on the unix kernel iirc.
Yes.
If you get a non-Apple computer, you can't get a stable version of OS X installed on it (and it takes a lot of hackiness either way). An Apple computer can boot into Windows or Linux though.
There's two good reasons to own a Mac as a software developer.
Reason Number 1:
Reason Number 2:
hehe, well I don't have an Iphone either, I'm an android developer ;)
0
Q: Parse error: syntax error, unexpected 'id' (T_STRING)

KingHilardyError: Parse error: syntax error, unexpected 'id' (T_STRING) in /home/u590953899/public_html/posts/index.php on line 27 Line 27: echo "id: " . $row['id']. " - Name: " . $row["content_url"]. " " . $row["username"]. "<br>"; Entire code: <?php $servername = "localhost"; $username = "u5...

You don't have to have an iPhone or iPad to write iOS code... and you don't have to write iOS code to use Swift or Objective-C.
Do you have a job as a developer, by the way? Or are you a student? (I think most people in this chat seem to be students, so it's hard for me to keep up with who isn't)
Also, by the way, you can do Android development on MacBook Pros...
15:23
Last year student, will join the working-force in september :)
you are not a student anymore, right?
The company where I'm about to possibly be taking a job, they do Android and iOS development, and overwhelmingly their developers all have MacBook Pros.
The only reason there are any Windows machines is because they have some .NET projects.
I am not a student.
Is it your first real job?
What? The job where everyone has MacBook pros? No. I haven't accepted the offer yet. I'm considering it.
I've been working at my current job for about a year and a half now.
cool.
May I ask, are those companies (the one you currently work for and the possible future one) big ones?
I find it pretty hard to decide if I want to apply for a big company or a rather small/startup one, next year.
The one I currently work for is small. The one I will possibly be accepting is larger, but the vast majority of their employees are all actual developers.
(or designers)
According to their website, the company I may be accepting an offer with has 120 employees.
(over 200million app downloads of their products)
15:29
Interesting ;)
15:59
0
Q: groupJoin() in Swift

vrwimI have created the following function in Swift, which joins two arrays on a key (extracted using given closures), and then groups them by key in a [T:[S]] where S is the result type (also through a given closure). /// Joins the array with another array on a specific key, and then gives two match...

16:11
@JeroenVannevel Don't cut yourself on that... 4 GB right now is not enough at all, 8 GB is better, though I'd still go with 16 GB always
@SimonAndréForsberg
    if (lockers[i] == true)
        System.out.println("locker " + i + " is open.");
Java is cool with that going on the same line, right?
    if (lockers[i] == true) System.out.println("locker " + i + " is open.");
@nhgrif Should be
I would never recommend it though
If you're going to omit the braces, you should do that.
the Java convention is to always use braces though, even for one-liners
(which then become three-liners)
16:25
I agree.
See my updated answer.
And if you make them 4 liners then... bad stuff should happen to you!
1
A: Locker Puzzle in Java

nhgrif lockers[i * j] = (lockers[i * j] == true) ? false : true; This line makes no sense at all. There are two red flags to me. Comparing to == true is just sort of bad in general. Using a ternary when the two possible options are false and true is always going to be unnecessary. We can rewr...

I assume this would work in Java
System.out.println("locker " + i + " is " + lockers[i] ? "open" : "closed");
close
System.out.println("locker " + i + " is " + (lockers[i] ? "open" : "closed"));
Okay
I think Swift would require that set of parens as well, but Objective-C does not.
Also, is there not a more efficient way to do this:
boolean[] lockers = new boolean[101];
//Open all multiples of 1 before moving on to 2
for (int i = 1; i < lockers.length; i++) {
    lockers[i] = true;
}
16:28
Oh wait, nevermind.
He's starting at 1.
yup, that too.
but even if he wouldn't, then no.
You can't create an entire array initialized to a specific value?
Like...
boolean[101] lockers = {true}
not that I know of
16:32
In Swift, we can do something like this:
var threeDoubles = [Double](count: 3, repeatedValue: 0.0)
Which... takes up less space, but I don't think it's any different assembly
Oh, I see... in C, if we did:
int[100] values = {0};
They'd all be zero.
But if we did:
int[100] values = {1};
It'd be 1 in the first index, and zero in the rest.
Any omitted values are set to 0.
Arrays.fill(array, value); works well
o...m...g... someone needs a Code Review...
Does that even compile?
Yes.
There are 6 different variables there.
16:40
Working code that you'd like to refactor belongs on Code Review instead. — CodeGnome 1 min ago
You can compile something similar in Java, Simon.
int[] x = new int[100];
for (int x = 0; x < x.length; ++x) {
    // do stuff
}
Well, that might compile...
No I can't
Two variables can't have the same name.
Yes they can
hang on
Not unless you're cheating with some hidden unicode characters or similar.
16:42
You can do this:
int[] x,y = new int[100];
for (int z = 0; z < x.length; ++z) {
    for (int x = 0; x < y.length; ++x) {
        // do stuff
    }
}
unless my first line is broken in someway
It's called scope.
You can do it in Swift, Objective-C, C, C++, 100% certain. I'm pretty certain you could do it in Java as well.
It's like having an instance variable, and a variable within a method with the same name.
Variable 'x' is already defined in scope.
I can't.
Maybe it's (relatively) new Java rules then.
instance variable yes. That's something entirely different
    int[] x, y = new int[100];
    public void nhgrif() {
        for (int z = 0; z < x.length; ++z) {
            for (int x = 0; x < y.length; ++x) {
                // do stuff
            }
        }
    }
that works
But there are lots of languages for which the example I posted will compile.
Java is not one of them (thankfully)
16:45
It's not a good idea in any of them, but you can scope-hide variables.
@nhgrif always been like that in java
Guess so. I don't know.
scope hiding cannot happen in Java/C# unless you do it through inheritance
or by having one instance variable and one local variable, in which case the instance variable needs to be accessed through this.xyz
That's not really hiding though
not in the way inheritance hiding works
Or can you also access that using super?
16:50
true
I think it's accessible through super
unless you make the variable private
In which case you're not hiding it.
Because you didn't have access to it in the first place.
either way, what @nhgrif is talking about is just not possible in Java.
It's possible in lots of languages though.
And not recommended in any of them.
I honestly don't understand how it can be possible. The whole thing looks absurd to me.
As I said, it's called scope.
The names you give variables doesn't matter at all. They don't make it to the assembly level.
16:54
There's a lot of ugliness possible when you're not properly doing the inheritance thing
like overriding a method in C# with new that isn't marked as virtual
Totally messes up the VMD table
In computer programming, the scope of a name binding – an association of a name to an entity, such as a variable – is the part of a computer program where the binding is valid: where the name can be used to refer to the entity. In other parts of the program the name may refer to a different entity (it may have a different binding), or to nothing at all (it may be unbound). The scope of a binding is also known as the visibility of an entity, particularly in older or more technical literature – this is from the perspective of the referenced entity, not the referencing name. A scope is a part of a...
@nhgrif Can you produce a working example in C++ or some other language?
I know what scoping means. It's still suspicious to me.
See how Autocomplete is telling me x is a double?
Obviously, that code is idiotic... because I can never change int x's value within the loop... so int x is never >= 100
And that compiles perfectly happily.
well... except the line with just x on it doesn't compile
That works in C/C++/Objective-C
Noted. But what about this kind of thing?
18 mins ago, by nhgrif
int[] x = new int[100];
for (int x = 0; x < x.length; ++x) {
    // do stuff
}
17:01
That's not the same thing as above though.
2 mins ago, by Simon André Forsberg
18 mins ago, by nhgrif
int[] x = new int[100];
for (int x = 0; x < x.length; ++x) {
    // do stuff
}
yeah, hang on
^^ using two different 'x' variables on the same line
0
Q: Combining 3 forms into 1, then writting data to 3 different sheets, with different layouts

MunkeyI did post a revision of this code before I discovered it was fundamentally wrong. I've completed and tested my project and all is now working as expected. Here's what I'm trying to achive. Where i work we have 3 forms for leavers, HR, IT and rota. Lots of questions are duplicated accross all 3...

Yeah, that example doesn't work actually
Then it's more reasonable.
17:04
And in Objective-C at least, I can't for-in with x in x... so let me check Swift, which is where the example comes from...
Doesn't work in Swift either... at least on Xcode 6.3, so maybe that guy's code is from an older version.
where did you find that code?
-1
Q: How to combine array positions in a summation?

tom3377 for (room,person,weapon) in playerOneArray{ var arrayLost : Array<Int> = [playerOneLostRooms[room], playerOneLostPeople[person], playerOneLostWeapons[weapon]] var arrayGood = [everyThing[room+12], everyThing[person], everyThing[weapon+6]] var arra...

It's Stack Overflow... is there even a guarantee that it has at any point in time actually compiled?
There's not a guarantee even on Code Review that the user has actually compiled their code.
but in this question, the user is talking about something that happens when a button is pressed...
so something has been compiled..
0
Q: Am i using the builder pattern correctly for my situation?

VahxFor a small administrative program i have to be able to register people and their data. But, files are sometimes created through a phone call "on the fly" and then later certain data is added to the file to complete it. For this reason i started making my Person class with different constructors...

0
Q: RockPaperScissor in Python

RobinbobySimple Rock - Paper - Scissor game Trying to find abetter way to write the algorithm And keeping the score board. #!/usr/bin/python # import random import os import json import pprint #-------------------------------------------------# def main(): user, sy...

17:23
@nhgrif Yes, people who dink caffeinated beverages have a somewhat higher chance of moving on to other drugs, or so I've heard. I'm not worried about myself, but I couldn't buy one if I wanted anyway...
@DJanssens I have an HP. I have not run Ubuntu on it yet, but I don't think there will be a problem, except you may have to edit some things in the BIOS to allow it to get past the malware protection layer to prevent rootkits.
Here is a webpage that discusses the gateway drug issue, and there are many others I didn't look through: caffeineinformer.com/energy-drinks-the-new-gateway-drug
> DAILY SAFE MAXIMUM
Your maximum is 12.5 cans per day.
I can drink a lot of cola
17:45
0
Q: Bug in weighted Graph implementaion through adjacent List

tejaI am trying to implement the weighted graph by adjacency list. Whenever a new edge is getting added, all the old edges are getting replace. ie, Insted of adding the new edge to the list of the edges, it is getting added to the empty list always. Please suggest me a way to fix the bug. Graph is...

@SimonAndréForsberg In JavaScript it's possible I'm quite sure... but not in any decent language
18:06
The 'was working bit' is why you use version control such as git. It's not nice to say but you've really written spaghetti code here that is very hard to decipher, also making your debugging now harder. Ask some programming friends who can help you or try Codereview for advice on how to clean this code up a little before trying to fix it. — MikeFoxtrot 1 min ago
I think codereview.stackexchange.com is more suited for what you are asking for. — ArchiFloyd 31 secs ago
You should put sections you might be unsure about on Codereview before uploading them. — MikeFoxtrot 27 secs ago
Uh oh, incoming broken code.
0
A: Count number of ways to paint a fence with N posts using K colors

VinodJava code: private void getCount(ArrayList<Character> res, char[]colors, int arrSize) { if(arrSize == 0) { System.out.println(res); ways++; } else { for (int i = 0; i < colors.length; i++) { if (safe(res, colors[i])) { res.add(colo...

Don't know what to do with this answer.
@skiwi JavaScript's concept of 'scope' is a joke.
0
Q: perlin noise 1D on circle to create a wave clock

Pascala) A circle is defined by the parametric equation: x = cx + rcosθ y = cy + rsinθ Where c = (cx, Cy) is the centre and r is the radius. θϵ [0, 2л]. Plot a circle of radius 10. b) How would you convert the circle into a spiral? c) Noise generally is destructive to a signal. Investigate the effec...

@MikeFoxtrot Code Review requires the code to be working before it is cleaned up. — Simon André Forsberg 1 min ago
@Hosch250 Comment and flag as NAA.
18:18
OK.
@Hosch250 what kind of HP? @JeroenVannevel what kind of laptop do you have if I may ask :)
@DJanssens 15" Envy.
17" Envy Dv7
Bigger is better
Before that the HP Pavilion dv6000 and HP Pavilion dv 9000
hmm, never had a HP before.
I've only used HP's
I consider them good quality
They all last 3-4 years, really
The one I have now I'm reinstalling Windows for the first time in 2 years because stuff started to get a little clogged up
18:26
I've only had one computer - this HP.
I have used a Surface and a MacBook Pro too.
The Mac always clogs up, and the Surface is the fastest with its SSD.
Need to go now.
@JeroenVannevel using windows or some unix distro? :)
@rayman1992: I'd suggest you make a simple implementation of your program, like just reading the gases, from scratch, and put it on codereview to perhaps get an idea of how to make a good foundation from which you can build the rest of the program. — MikeFoxtrot 1 min ago
@Hosch250 define "clogs up"? Also, I don't think any of the MacBook Pros come with HDDs any more.
@DJanssens Always Windows aside from a short mental breakdown years ago where I installed Ubuntu
@SimonAndréForsberg JavaScript's concept of 'scope' a joke.
18:39
Back in the days when you could still order a CD online with Ubuntu on it
There is a spider on the wall, at the very top, next to the ceiling...
The cat is trying to get it.
Cats can be useful at times ;)
18:56
@nhgrif Nice
19:08
We are aware some of our users are affected by a global routing problem piping some traffic through Seoul, KR. We are working on the issue.
19:22
Task.Run(Action, CancellationToken) uses the cancellationtoken to perhaps cancel the scheduling of the Action parameter. It is not used to pass the cancellationtoken to the action itself
That's tricky
and quasi pointless since the scheduling is done practically instantly
CancellationToken.Cancel = True
right?
I don't really know exactly what you're talking about, but presumably multithreading.
yeah something like that
Multithreading/parallelism/asynchronicity -- The latter, though I still haven't figured out what the exact nuance differences are
It's all sort of the same thing...? I mean, the basic principle is the same at the end of the day.
But I saw an example earlier today that would call for 3 threads...
The routing issue has be isolated to Telia's network. For the cuious, here's a neat animation of crazy: https://stat.ripe.net/widget/bgplay#w.resource=190.93.244.58 via @GBrayUT
I recall a heated debate in SO comments a few weeks ago about the difference between these terms
19:26
Let's suppose we're writing code for a mobile device with an accelerometer.
I'm not versed enough in the matter to follow yet
I think it's more or less the abstractness of the term
We want to poll the accelerometer on a regular basis, but we also want to take an integral of all of our datapoints.
There's a concept of asynchronicity, which is achieved usually by parallelism, which in turn is achieved usually by multithreading
I don't really know other ways to do those things though :/
We don't want to slow down our pollrate. And we don't want to lock up our UI.
So, we spawn one background thread that will grab the latest sample from the gyros/accelerometer/whatever as often is as appropriate (or as often as it has data).
Once we have started actually collecting data, we want to spawn a second background thread dedicated to calculating the integral of these datapoints. At first, with relatively few data points, this will calculate quickly, but the more datapoints we have, the longer this takes.
So while the first background thread is getting data at a pretty consistent rate (let's say 100Hz), this background thread will offer up the integral at an ever decreasing rate.
These two must be on different threads so we don't slow down the polling thread and miss datapoints.
Then our mainthread will check say twice per second to get a set of updated values.
It's not doing any calculations. It's just checking for whatever the latest data the background threads calculated and updating the UI with these precalculated datapoints.
19:32
@StackExchange It's always Telia's fault!
@skiwi I love that quote.
6 mins ago, by skiwi
There's a concept of asynchronicity, which is achieved usually by parallelism, which in turn is achieved usually by multithreading
Arguing over vocabulary terms isn't always particularly useful.
Who cares what it's called? What matters is if you are able to use it.
Right.
-1
Q: Inserting to multiple tables

JavaScriptHatesMeI'm trying to insert into two tables at once INSERT INTO img_upload(id,img_name) VALUES ((SELECT id FROM users WHERE id='38'), (SELECT id FROM users WHERE id='38')); This works fine, when I try INSERT INTO img_upload(id,img_name,img_path,img_type) VALUES ((SELECT id FROM users WHERE id='...

Captain Off-Topic-vious.
19:57
0
Q: My very first task scheduler

OrtundThis isn't meant as a scheduler for just any job. The job that I need to schedule here is very specific for an application I'm writing for one of my clients. The scheduler will run as a console application because it's comparatively lightweight. The application will be started with Windows (star...

Surely, there's a .NET way to schedule something for a specific time of day rather than relying on a time interval..
20:15
Please don't roll back a major edit unless it has changed the meaning of the post. I was trying to make it cleaner. If there were individual parts that should've stayed, then change those instead. — Jamal ♦ 24 secs ago
Is the CodeReviewCommunity group of GitHub still active?
@Jamal That's one of your best edits. Can't really see why that was rolled back
@SirPython Not really, no. We are all active on Github in our own way, but the CodeReview Community project on Github seems to have stalled.
@SimonAndréForsberg That's a little sad... it seems like a great way that the people of Code Review could code together.
Fortunately, I am using GitHub as part of a school project, so I'm getting a bit more familiar with it. However, last time I tried to push changes from NetBeans, it gave me some kind of error. I'll have to try it again later.
@Jamal Seen this part of this answer?
I'd suggest that you watch your language. Your "Note 2" doesn't sound very professional at all. I'd suggest you replace that with "your personal choice". — Simon André Forsberg 1 min ago
20:29
I don't see anything major in your edit... — Vahx 1 min ago
@SimonAndréForsberg Yeah. Feel free to edit out that part.
@SirPython The people of Code Review do code together. @skiwi, @sᴉɔuɐɹɥԀ, @bazola and I are working on a Trading Card Game. @RubberDuck and @Mat'sMug have a huuuge VBA-addin-thingy going on. @rolfl and I have been working together on his 'UBench' project which is available on Maven Central.
</a-lot-of-pings>
@Jamal You do know you have a whole bunch of git experts here in chat, right?
@Jamal there was many small things which made the edit quite major
Whoa. I guess I never noticed the amount of projects going on between CodeReview-ers.
@Jamal May I ask you to do it instead? As I posted the comment, I'm not sure it would be appreciated if I edited it.
@SirPython and @skiwi and @SimonAndréForsberg is working on me!
@SirPython That's probably because we are not all here in The 2nd Monitor. There's individual rooms for TCG Creation, VBA and MicroBench
20:35
Well hey there @SimonAndréForsberg and @ all :)
Although I have to admit, the TCG game project is not very active these days.
And oh, @Marc-Andre and @sᴉɔuɐɹɥԀ is working together on the website for Cardshifter, that's actually more active than the game itself at the moment.
Hi up-side-down @sᴉɔuɐɹɥԀ!
°/ @sᴉɔuɐɹɥԀ
Is it just me or have you rotated your image 90 degrees?
:D
@SimonAndréForsberg 180 degrees to be precise, to fit with the name
@SimonAndréForsberg Yup. :-) I'm getting this error.
20:37
You should've rotated 180 degrees and mirrored..
@sᴉɔuɐɹɥԀ yeah, the 180 degrees I am aware of, I just thought you had changed it 90 degrees recently but I was wrong...
@SimonAndréForsberg Okay
@Jamal Ah, so the remote contains some commits you don't have locally.... so try git pull origin master to try to fix that.
@nhgrif But then I would have needed to make my name @Ԁɥɹɐuɔᴉs which is even more difficult to ping!
No you wouldn't.
Write "Phrancis" on a piece of paper. Turn it upside down and look at it in a mirror.
20:39
@SimonAndréForsberg I tried to follow that answer first, and I now have "<<<< HEAD" and "=====" in my code. How do I remove that (I cannot delete it normally)?
@Jamal You have what is known as a 'merge conflict'
the stuff between <<<< HEAD and ==== is one version of the code. The stuff after ==== and before >>>>> xxxxxxxx is another version. You need to manually choose which version is correct, and/or merge the versions.
Then you do git add path/to/conflicted-file and then git commit -m"fixed merge conflicts"
The first part is what I want to keep.
then delete the <<<< and stuff
edit the file and remove all those marks, and the bad version of the code
Now it's gone.
1 min ago, by Simon André Forsberg
Then you do git add path/to/conflicted-file and then git commit -m"fixed merge conflicts"
20:43
I'm doing this through NetBeans, not the terminal.
Then figure out what the matching things to do in NetBeans are.
Although I can recommend using the terminal
I'll try that, then.
When I started using the terminal for git a bit, I gained so much more knowledge about how git works, and what is actually going on.
Except I'm on Windows, so it may not work.
then I could see the connections between the GUI in the IDE and the git commands
@nhgrif See? ^^
Oh wait, that's different
I'll just wait until I meet with my group again. I'm only pushing my own part of the project that they don't depend on.
Lol. That was a lot of pings. Back to non-code things now. @SimonAndréForsberg =;)-
Seriously though @Jamal ping me if you need Git help. I've learned quite a lot in the last few months. Most important thing I've learned is that sometimes it's best to crack open the command line.
2
Bbiab @all
0
Q: Haskel:l brute-force perfect-number algorithm

AJFarmarI made a reasonably fast brute-force perfect number finding function in Haskell. It works in under 3 seconds when I search up to 1000, but 10000 is too much. Here it is: isDivisor :: Integral a => a -> a -> Bool isDivisor n a = mod n a == 0 sumDivisors :: Integral a => a -> a sumDivisors a = ...

20:50
int perfectNumber() {
    return 42;
}
Pfff, wake up one day at 8am after merely 6 hours of sleep and I'm dead tired at 10pm
@SimonAndréForsberg Any particular reason for loving it? ;)
Nope, just love it :)
@RubberDuck I still can't get this to work. I can open the terminal here, but I'll need Cygwin first.
I just want to push my own changes.
@sᴉɔuɐɹɥԀ I think your clock is melting.
Yes, indeed. It's one of these:
user image
3
20:58
@RubberDuck Command line rocks!
Well, kind of. Mine has Roman numerals instead of numbers
@sᴉɔuɐɹɥԀ lool
00:00 - 21:0021:00 - 00:00

« first day (708 days earlier)      last day (3607 days later) »