« first day (1089 days earlier)      last day (2922 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD! There are 2180 unanswered questions (93.5179% answered)
 
12:17 AM
@SimonForsberg Nice update!
in VSDiagnostics, 33 secs ago, by Duga
Close #172 (#505)

* Push so I can check something else out.

* Display error message when no branches are found.

* Code fix works.

* Remove try/catch used in debugging.

* Fix Equal()'s implementation, add a couple tests.

* Respond to comments.

* Fix bug when base class implements both but derived class only implements one.

* Fix conflicting ID's

* Fix NRE
However, could you remove the extra spacing?
 
12:34 AM
I'm voting to close this question as off-topic because this question asks whether a particular implementation is a good idea, which might be a better fit at codereview.stackexchange.com. — templatetypedef 11 secs ago
I was unaware of codereview.stackexchange.com until just now, but I agree, it does sound like a better place for this. Whats the etiquette here? Should I delete the question and re-post it there? Or do I wait for the community to decide? — user6170930 51 secs ago
 
This is interesting, evidently TSQL is strict with functions not having any side effects
> Invalid use of a side-effecting operator 'PRINT' within a function.
 
1:00 AM
You should post this on code review. SO is not the right place. — roryap 40 secs ago
possible answer invalidation by Nkosi on question by Ga Sacchi: codereview.stackexchange.com/posts/126769/revisions
I think I was pretty clear. Read this and check out this. — roryap 48 secs ago
If your code works as is, but your looking for pointers on improving performance, readability, etc. then this code would be a better fit for code review. However, if there is some problem with the code (errors, unexpected results, etc.) it really belongs here. @roryap, from the statement "The problem is that the players income remains at zero no matter who's turn it is" it sounds like this was posted on the correct site. — p.s.w.g 29 secs ago
 
1:20 AM
possible answer invalidation by Jamal on question by Michael Lee: codereview.stackexchange.com/posts/126777/revisions
 
0
Q: Bash script that outputs processes and kills desired processes

jargonjunkieThis is my first Bash script and I decided to use what I've learned so far to help manage stray processes while I develop in my *nix environs. I've tested the script extensively and it seems to work (there may be some things I have not caught yet). If I could get some critiques/tips on the sc...

 
1:50 AM
0
Q: Tic-Tac-Toe game in C++

McLemoreI'm new to C++ and made this basic Tic-Tac-Toe game from scratch. I would like a way to simplify the process somewhat. I would like to make it to where the user doesn't have to input what character they are playing, have the game detect a tie early, and have the game detect who wins. As I said, I...

 
possible answer invalidation by APCoding on question by APCoding: codereview.stackexchange.com/posts/126603/revisions
 
 
1 hour later…
3:00 AM
0
Q: Multithreaded client socket

TurtleThis is my first time working with networks and multithreading in C, and would like to know how to make improvements. I wanted to make a client program that handles reading and writing to the server in two distinct threads to improve performance. I also wanted to have the user wait 3 seconds bef...

 
3:49 AM
 
yeah, right. BrainFuck production code. I'll be damned if that's not a troll post
 
-12 before it was deleted :p
 
I'm not sure whether it's the plain-English or the BF code that's harder to read
 
4:22 AM
@SimonForsberg Nevermind, that is something from GitBug (whoops, I literally typed that) GitHub.
2
Anyway, can you consider that a feature request for when we pull and a bunch of commits go through?
 
4:37 AM
Monking
 
hey there
 
5:25 AM
possible answer invalidation by Anatoly on question by Anatoly: codereview.stackexchange.com/posts/126201/revisions
 
-1
Q: Breaking up the program (classes) in a meaningful way in Java

AspergerI know this sounds weird and im not sure if this is the right place to ask. If you down vote please let me know why... If I wanted to write an object oriented programm where lets the user can choose a monster and then battle that monster vs other monsters. With each win it gains xp and updates a...

 
@Mast That's taken over from Grammars. Basically just a set of all characters used in the transitioning function. For convenience in a way.
@Mast I could try to describe the problem less cs-ey. That might help. Alternatively I could describe the standard algorithm....
 
@Duga rolled back by @Vogel612 and commented by me
Ah, didn't see you are here @Vogel612 stupid me
 
5:40 AM
Lol I was still typing :)
 
Autocommenting ;-)
 
Not on mobile :\
 
;-(
 
I'm off for the bus to university.. bbiab
 
^^^hadn't been possible on monday :-( I needed to go by car
I am just installing the third GB of updates for a Win 2012 R2 Server which I have installed yesterday. I wonder how many updates will be found on the next run.
 
5:48 AM
If that's prod, then your sysadmin needs a kick in the backside
 
No prod. Testing for some exchange alternative
and by the way I am the sysadmin as well :-(
more or less
 
6:05 AM
possible answer invalidation by Anatoly on question by Anatoly: codereview.stackexchange.com/posts/126758/revisions
 
@Duga seems ok
 
6:30 AM
0
Q: Can this runtime compiler code be faster

James SouthI've been playing about with runtime compilation to allow me to get/set runtime property values in C# and so far I have come up with the class as the bottom of the question. This allows me to write code like the following which works well and is much faster than standard reflection: TypeWrappe...

 
When you get this working. You should post it on codereview.stackexchange.com to get it reviewed for better practice. — Loki Astari 28 secs ago
 
@Hosch250 removing all the empty lines you mean? If there's only one such empty line I don't think there's a point of it, but when there are many that could help. But is it worth it?
@Hosch250 although I'm not sure what update you mean? Haven't @Duga always posted multi-line commit messages like that?
 
6:49 AM
0
Q: Chain nesting XML elements

NegorathI have a scenario where I need to chain nest XmlElements, and I got a working solution using a recursive function, but I can't help but feel that it can be made better. Here's my code so far: function AppendChild { param ( [string[]]$string, $obj, [System.Xml.Xm...

 
7:06 AM
0
Q: How to Develope a Code in MATLAB for Static FlowShop Scheduling

sarahHow to make a code for Static Flow-Shop Scheduling Problem in MATLAB using 3 machines and 10 Jobs such that i can get the total processing time of the last job on the last machine,using following variables, The scheduling parameters for a typical job, say job j, are defined as follows: • pj = the...

 
7:30 AM
I'm not sure but I believe that this should fit better on codereview.stackexchange.com — Matías Fidemraizer 35 secs ago
Thanks vish4071, vote up and what do you mean "generic implementation of Binary Search"? I have one implementation here (codereview.stackexchange.com/questions/106076/…), and wondering if it is what you mean the generic one? — Lin Ma 12 secs ago
No, this is not going to be a good fit for codereview.se, and to some extent for the same reason it's not a good question here: it's incomplete. The Convert class isn't the best choice for parsing strings, but even with all those calls to Convert, there's nothing in the code you've posted that would explain taking 30 minutes to process a mere ~44K lines of text. Without more information, the most likely cause is slow I/O (e.g. reading over a really slow network). Please improve the question by providing a good Minimal, Complete, and Verifiable example, if you want help. — Peter Duniho 36 secs ago
 
monking
@Hosch250 But when it comes to @Mat'sMug it's GitMug :D
@Quill Needs more chips
 
8:00 AM
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: C++ custom memory allocator
 
8:12 AM
0
Q: Byte array to floating point such as FPE2 in Java

Daniel WiddisI'm writing a method in Java that converts a byte array to a float. While my specific use case is converting an FPE2 format number, I'm trying to make it a bit more general. In FPE2, the leftmost E (14) bits are converted to the integer portion of the number, and the rightmost 2 digits repres...

 
8:30 AM
@Quill What the heck, how many languages are that combined? Stupid trolls.
 
I actually had to explain to one of the guys in the SOCVR room that it was a troll
 
@RoboSanta I'm not sure it's even an answer. It seems like a whole bunch of miscommunication.
That's odd, coming from Loki.
@Quill Now I'm worried about the SOCVR room.
 
possible answer invalidation by martijnn2008 on question by martijnn2008: codereview.stackexchange.com/posts/126751/revisions
 
@Duga its ok
 
This Question belongs to Code Reviewbansi 34 secs ago
@bansi Only if it works and the code is included in the question itself. Code behind a link is unacceptable at Code Review. — Mast 8 secs ago
 
8:38 AM
@bansi Only if it works and the code is included in the question itself. Code behind a link is unacceptable at Code Review. Since the link appears to be broken from here, there's nothing to see. — Mast 37 secs ago
 
@Quill lol
> the practice of concealing messages or information within other non-secret text or data.
 
@Vogel612 That would probably help.
 
We no longer need to support IE! :D
5
Service workers ahoy
 
8:58 AM
@Mast You weren't before?
 
Zak
Monking @all, from an office where (19 hours later) the power has finally come back on.
 
Hey there @Zak
 
Try codereview.stackexchange.com as this question is not suited for SO and remember to post your code in the question and not link to an external website. — Nasreddine 31 secs ago
 
0
Q: How to increase efficiency of Depth First Search program

SantoshThis is a problem from programming contest. In the first line there is one integer T denoting the number of test cases. Description of T test cases follow. Each one have two integers N and K given in the first line denoting the number of variables and the number of relations between the...

 
9:19 AM
@Mat'sMug :P
Yesterday, we got 23 more accepted answers, 40 more questions were answered, 51 more answers were posted, 145 badges were earned, 156 comments were left, 41 more questions were asked, 1 more questions were unanswered, 82 users were created, and 320 votes were created.
Our question answer accept rate went down by 0.0038%.
Our question answer rate went up by 0.0049%, and our answer accept rate went up by 0.0091%.
 
With much more context and specifics of what you need help with, this may be a fit for codereview.stackexchange.com. But not Stack Overflow. — T.J. Crowder 24 secs ago
I'm voting to close this question as off-topic because it is asking for a code review. — Quentin 36 secs ago
There really isn't much difference between "a comment" and "a suggestion". You aren't asking about a problem that is preventing your code from working. You have some code which works (or if it doesn't, you've said nothing to explain the problem) and you want people to tell you how to improve it. That's a code review. — Quentin 33 secs ago
 
9:36 AM
0
Q: Learning Javascript - Calculator

user103954 window.onload = function() { var numbers = document.getElementsByTagName('span'); var result = document.querySelectorAll('.result')[0]; var clear = document.getElementsByClassName('clear')[0]; for (var i = 0; i < numbers.length; i += 1) { if (numbers[i].innerHTML === '=') { ...

0
Q: Simple Questtion Answer game Constructive Critism

DarkZekIt's my first post here and I just wanted to get some criticism on my programming to make me better. I made a game in Unity, just a simple question and answer game. https://gyazo.com/bb21e154d02b00f83b0b63b7c5858033 Code: using UnityEngine; using UnityEngine.UI; using System.Collections.Generic;...

-1
Q: Return values not working

RalspI'm a student in a into to Java course. I am trying to use an array of objects and a custom constructor to make a simple database. I am trying to pull the data that I thought I set but I keep getting responses of null or 0. Any help would be appreciated. This what it prints out: Student Data Na...

 
@CaptainObvious broken code
 
@Zak Did you actually leave the office? :P
Or were you stuck in there, The-Day-After-Tomorrow style
 
Excellent answer, thank you very much @dfri! While I am basically aware of dynamic vs. static dispatch, the given code slipped through code review before commit: Silently "failing" (while being logically correct due to optimization) but requiring the keyword override is a dangerous thing: Even though I need to use dynamic dispatch with e.g. Realm properties, I overlooked it in conjunction with an UIViewController superclass subclass extension. Looks like the author of SwiftBond ran into some dispatch issues, too (but not exactly the same problem): openradar.me/23067007Frederik A. Winkelsdorf 24 secs ago
 
10:01 AM
0
Q: Typesetting A* in LaTeX using algorithm2e - follow-up

coderodde(See the previous and initial iteration.) I have this second version of my LaTeX code. I made it less dry by removing the duplicate keyword definitions shared by the two algorithms being typeset. Also, in the previous version, in the argument of main While loop, OPEN was typeset instead of desir...

 
10:24 AM
0
Q: c# Delimited File Parser - clarity and effeciency

Matt ThrowerThis is some code I've cobbled together that reads a delimited file. If the user is able to tell us some stuff about the file, it uses the supplied information. Otherwise, it tries to work stuff out itself. Then it pushes what it thinks are the first two rows of data back to the user to see if it...

 
10:48 AM
As to where you can post and discuss it, check out codereview: codereview.stackexchange.comDima 27 secs ago
 
10:59 AM
0
Q: Secure token usage

3kymy question is quite simple but I can't find an answer. I'm using 3rdy part API in a very simple script, I have a access token that should be added to the connection with the server, but I don't know if what I'm doing is secure and if it's possible to read the token in some how. The code is this...

0
Q: Simple yaml based config file parser

IsaacI have written a simple yaml based config parser in python. The idea is that it will get passed around in other scripts after being initialized with a config file within a main function. I am interested if this code is OK with regards to the following general best coding practices interface ...

 
11:14 AM
Isn't that question more suitable for CodeReview? You have only 3 loops inside. Try changing i and j by ii and jj because they are reserved gor imaginary units (mathematicians are used to imaginary i and those who work with signals are used to imaginary j). — Crowley 25 secs ago
@Crowley We have many questions on vectorization / code optimization in the matlab tag here on SO, so in my opinion this question is ok here. On CodeReview, there are 83 Matlab questions, of which only 30 have an accepted answer, so the chance of getting good feedback there doesn't seem to be very high. — hbaderts 59 secs ago
 
11:37 AM
0
Q: Project Euler problem #11 - Largest product in a grid

Marcus Vinícius MonteiroI have recently solved the following Project Euler problem: In the 20×20 grid below, four numbers along a diagonal line have been marked in red [here bold]. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 3...

 
11:47 AM
0
Q: A Star Search with Array Lists

JustBlossomI implemented A* Search with Array Lists following the pseudocode here. I have been working with different algorithms on my own, and now, I am trying to optimize them so that I can run them with less code. The actual algorithm I wrote does not use a lot of code, but the setup does (creating the ...

 
12:06 PM
-1
Q: Using java findLongest method find the longest consecutive block value

user103970in java, if an array nums contains the values (7, 10,10,15,15,15,15,10,10,10,15,10,10) findLongest (10) should return 3, what is the code for this?

 
Zak
@DanPantry No ^^ we went home early, came back in the morning, and still didn't have power until about 10am.
Apparently, the local substation's been broken for quite a while, and has been running on a temporary generator while they wait to replace it. The temporary generator is what broke and it took them nearly 24 hours to get it back online.
 
@CaptainObvious gimme the codez
 
12:23 PM
no, GIMME TEH CODEZ
 
You've earned the "Famous Question" badge (Question with 10,000 views) for "SudokuSharp Solver with advanced features".
8
 
Perhaps better suited to codereview.stackexchange.com? — Andy Turner 39 secs ago
You really shouldn't use your own salts on password hashes and you really should use PHP's built-in functions to handle password security. Make sure that you don't escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding. — Jay Blanchard 45 secs ago
 
12:41 PM
1
Q: Concat a collection's sub arrays

Yann BertrandI have an array like this: var arr = [ { revision: 19, text: 'hello', details: [ { id: 5 } ] }, { revision: 19, text: 'hello', details: [ { id: 6 } ...

 
                            @Override
                            public void run() {
                                Toast.makeText(LoginActivity.this, "保存登录信息失败", Toast.LENGTH_SHORT).show();
                                mButton.setClickable(true);
                                mButton.setText("登录");
                            }
 
If the code works and the author is looking for improvements, this would be OK on Code Review. However, please see How do I ask a good question? to improve its quality, namely describing in the title and body what the code does. — Phrancis just now
 
What's with the hard-coded Mandarin? @Phrancis
 
> I'm a student from China
See the SO post I just commented on
 
oh.
Well, that would explain it
 
12:51 PM
I'm sure it's interesting code if you know Mandarin
 
It reminds me when I was learning RPG maker VX
the glue scripts were written in Ruby in Mandarin
also, high resolution music = bliss
 
Not sure what issue you have. If the code works alright for you, you'd rather post it at Code ReviewWiktor Stribiżew 8 secs ago
 
@SimonForsberg congrats
 
hey @DanPantry, how is it going?
 
@Malachi It's alright. You? I'm guessing you need JavaScript assistance.. :p
 
12:59 PM
lol
I am searching ATM..... but yeah
 
lolol
what's the issue
 
trying to read a property from a JSON object I got from Stack API. I am probably doing it wrong....
 
If you know exactly where it is, it can't be too hard.
 
sure, let's see?
 
and I know the property exists
 
1:03 PM
uh
that's not going to work
 
I know I am doing something wrong
 
var obj = { foo: 'bar' };
for (var i = 0; i < Object.keys(obj).length; i++) {
  console.log(i); // 0
  console.log(obj[i]) // obj[0] -> undefined
}
 
it's not zero based?
 
no, keys of an object aren't zero based
 
You can't call it like that.
 
1:05 PM
maybe you meant to do this?
var obj = { foo: 'bar' }
for (var key in obj) {
  if (!obj.hasOwnProperty(key)) {
    continue
  }
  var value = obj[key]
}
where value is your object in the, uh, object
 
I thought that the foreach loop was deprecated?
I think too much.....
 
This is for-in, and it's not
for-in is basicaly the only tool you can currently use to iterate object keys
only caveat is that it doesn't necessarily preserve iteration order. Not a problem for objects as they don't do that either but you should never use it to iterate arrays
 
it's an array of objects.
 
See here for more info
oh.
oh, now I see your problem.
 
It doesn't matter for key-value pairs.
 
1:07 PM
Nah, it's something else
 
oh I guess it is an object that holds an array object.
 
@Malachi you're trying to access sites which hasn't been defined yet
sites is undefined because $.getJSON() hasn't had its callback called yet
all async calls in node are guaranteed to execute after the end of the current function
solution is to wrap all of your code that accesses sites inside of the $.getJSON() comment
 
Just FYI: Only post at code review if you are sure your code actually works. If you are unsure, please post an MVCE (minimal complete verifiable example) for us to help solve the issue. — Wiktor Stribiżew 30 secs ago
 
s/node/javascript
 
sigh I need to study more
 
1:09 PM
that's a pretty common error whne people are first getting used to js' concurrency model
 
It's also one of the reasons I gave up on the whole bunch of them...
It's easy once you understand it, but it doesn't make sense to me.
 
TBH it works exactly the same in any other language without an await keyword
Oh, no. recursive relationships.
 
0
Q: How to make my code look more elegant

WangZhiYaoRecently I was wrote some code about android,but I think this code is too many nested functions,so I want make this code more elegant, but I can't make it,because too many nested functions like"if else"and "try catch" to make I can't split it,So I wondering how to handle this code,to make this co...

 
okay so now I didn't get any errors, but it didn't work the way I want it to....thank you for your help.
it's kind of like a promise
I should have assigned the getJSON to a function and then called it, right?
that isn't what I did, but curious
 
@Mast added the "canonical" algorithm
it's unfortunate, but I'm not able to explain it easier
 
1:27 PM
@Vogel612 Isn't it a tad complicated for a community challenge then?
 
@Mast in principle it's terribly easy
 
But explaining the principle is hard?
 
the explanation up to there is in theory how a DFA works
the idea is eliminating redundant paths from a directed graph
 
it would be nice to have somewhere to upload that to the Stack Imgur, especially when they want it that way for registering the app....
 
@Malachi The link you had pointed to the stack imgur.
 
1:29 PM
after your create the registration and click edit there is a place to upload to imgur
@Mast I know, that is why I did that
lol
 
@Vogel612 Ah well, perhaps I'm the only one having trouble parsing the challenge.
 
then it would have more upvotes..
 
@Malachi eh, why would you want that?
var foo = $.getJSON()
foo()
that wouldn't make much of a difference, unless I misunderstand you
 
I am going to use it to return all the sites?
then I can call it when I want it, right?
 
yeah, you could do that, but you'd still have the same issue you had before
 
1:34 PM
like I said, I am not doing it that way, but I want to know what my options are
I moved all my code inside of the success function.
 
well, yeah, you'd basically want to use a promise for this. I believe $.ajax might return a promise, $.getJSON might, too. and then yes, you could create a function like this
var getAllSites = () => $.getJSON(....)
 
	$.getJSON("http://api.stackexchange.com/2.2/sites", function (data){
		var sites = data;
		console.dir(sites);
		chrome.tabs.onUpdated.addListener(function(tab) {
			for (var site in sites) {
				if (tab.url == site.site_url + '/review'){
					chrome.pageaction.show(tab.id);
					return;
				}
			}
		});
	});
 
0
Q: Typical DI Configuration in a .NET MVC Web Application

TommyCurrently, we use SimpleInjector for dependency injection, but this question is a little more generic as Ninject was configured similarly. Do most typical configuration/setup calls for your DI just become a long list of .Register<>(); type calls or is there a better/quicker/shortcut method? For...

 
Yes, $.getJSON returns a promise so you could do this
var getAllSites = () = > $.getJSON('http://api.stackexchange.com/2.2/sites')
... elsewhere...
getAllSites().then(sites => {
  chrome.tabs.onUpdated.addListener(....)
})
obviously replace the arrow functions with function() { if you're not using es6
hello @Mat'sMug
 
monking!
 
1:38 PM
monking!
 
monking!
 
question on working code are maybe better for codereview.stackexchange.comtobi303 1 min ago
@tobi303 this is example/pseudo-code which is off-topic on Code Review, on that site we require real, working code. See A guide to Code Review for Stack Overflow usersPhrancis 19 secs ago
 
1:59 PM
@DanPantry it doesn't like that syntax....lol I will figure it out though, I have done it before, like once...lol practice makes perfect
 
@Malachi => is new syntax, so it might not work
 
that is what I figured. isn't that like delegation or something like that?
 
() =>? it's just sugar for (function() { ... }.bind(this))
(sort of, anyway)
it creates a function that retains the this of the context it is declared in
 
possible answer invalidation by Engineer Dollery on question by WangZhiYao: codereview.stackexchange.com/posts/126840/revisions
 
@Duga Hmmm... I'm not sure that's necessary.
 
2:07 PM
Rolled back
 
@DanPantry the op has approved it
 
Wat... why?
 
her loss
 
Fine, fair enough
 
2:25 PM
If OP approved, no point in rolling it back.
 
1
Q: Interview Coding Test: Fizz Buzz?

Engineer DolleryI was recently given a coding test to complete for a potential client. It was a fizz-buzz type of thing with a two-hour time limit. I had a request to write basic fizz buzz, then add a special case, then add a report. I didn't get an interview, and they didn't return any feedback so I don't know ...

 
Zak
@Mast OP (being new to CR), is not exactly in the best position to judge whether the edit was a good one.
 
@CaptainObvious 2 hours for a ?
Well Eclipse Mars.2 fails to compile the code but the JDK 1.8.0_51 compiles it fine. This could come into play. — Tunaki 2 mins ago
wth is Eclipse Mars.2?
 
Zak
IMO, removing non-English comments on the basis that they're not english is not a valid edit.
 
translating them would be a different story, right?
 
2:36 PM
pretend OP didn't put them in in the first place then ;-)
@Vogel612 yes
 
Zak
@Vogel612 IMO, same story. The code is the code (comments and all). It not being in english is the kind of thing that should be mentioned in a Review.
 
meh... you're assumin (incorrectly) that most programmers actually understand and produce intelligible english code
 
@SimonForsberg Not multi-line commit messages, things like pulling a zillion commits from a different repo.
It would help prevent "duga-spam"
 
-2
Q: If/Else cleanup

TylerAndFriendsIm working on an API that has a lot of controller functions like this: def create = Action.async { implicit request => if (request.body.asJson.isEmpty) { Future.successful(BadRequest("Missing body")) } else { val body = request.body.asJson.get.as[JsObject] va...

 
2:53 PM
@CaptainObvious I VTC for gimmeh-teh-codez
 
Is this a poor question? I am mainly wondering what I can do in place of the early returns I would use in a non-functional language? — TylerAndFriends 1 min ago
hope it's not too harsh
0
A: Interview Coding Test: Fizz Buzz?

Mat's Mug Then add a special case In all likelihood, they were looking to see how flexible and maintainable you could make your code be, and you gave them a showcase of some raw technical knowledge instead. I'm not impressed with the fact that the fizzbuzz logic is written in three different places, ...

 
3:10 PM
-1
Q: Stop repeating myself inloops

NWardI have two functions with loops that behave nearly identically, but with some key differences. As a consequence, most (but not all!) of the code in the functions is repeated. I can accept this repetition, but I would prefer to have the repeated code in a single place, so that I do not need to rem...

 
This is code that is not functioning properly (the OP thinks it is leaking memory) and thus has bugs. Code review is for code that IS functioning properly. — jfriend00 49 secs ago
 
monking
 
crazy how never gets old
 
That way of doing it is certainly overkill, good on you for pointing that out
 
> That way of doing it is certainly overkill
says the guy that did it in
:p
 
3:18 PM
lol
 
Matt Sherman on April 27, 2016
Running a productive meeting is the FizzBuzz of management.
 
@StackExchange that's... a coincidence, right?
 
@StackExchange I first thought that was a post that was already deleted...
 
3:35 PM
-4
Q: reversing a strings in line

maheswarMy string is Input My mobile cost is morethan huawei Output: Mobile my cost is huawei more than My requirement is just i want to reverse the first two strings and reverse the last two strings ,remaining as same Advance thanks

 
Good grief, Team Foundation Slowness...
3
 
@CaptainObvious too bad there's no code, I'd have turned that into "Yodaspeak Translator". boom, hot.
3
although, no. it needs a comma. a comma, it needs
 
4:09 PM
Anyone around who knows C#'s GC? I have a quick question.
 
hides
I'm not sure I know enough to answer it, but go ahead
 
Does GC.GetTotalMemory return the amount of memory currently being used, or the amount that is available?
 
> Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval before returning, to allow the system to collect garbage and finalize objects.
 
Okay, that's what I thought. Thanks! :)
 
(MSDN!)
 
4:13 PM
Yeah, can't use it where I'm at unfortunately. For some reason it's blocked on the network I'm using.
 
huh
 
0
Q: Uploading images and adding records to the database

morbidCodeI am doing a php project with the codeigniter framework. In my controller, I have a function that does the following. Uploads an image to the server Add a row to the database. The data would be retrieved from the form that calls the controller. The best approach might be to put these two thin...

0
Q: Connectes to the user database on phpMyAdmine

Darcey Mckelvey<pre><?php print_r($_POST); ?></pre> <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <!doctype html> <html> <head> <title>Register and Login Page</title> </head> <body> <center><h1>Register and Login</h1></center> <div class="register"> <h2>Sign Up Below

 
The network admins have the strangest thought process. They don't block sites like steam, but when it comes to almost anything programming-related, it's completely blocked.
 
@EthanBierlein Sounds like they used a ! by accident.
 
Could be the case, but I'm thinking it may just be a paranoid old network admin who thinks that access to programming resources could cause something to "get hacked".
 
4:18 PM
LOL.
Tell them it will cause it to get hacked because programmers won't be able to look up good security practices.
3
 
They already aren't using good security practices anyways.
 
OP put the whole class in - @whoever cast a close vote, feel free to reconsider:
0
Q: Stop repeating myself in loops

NWardI have two functions with loops that behave nearly identically, but with some key differences. As a consequence, most (but not all!) of the code in the functions is repeated. I can accept this repetition, but I would prefer to have the repeated code in a single place, so that I do not need to rem...

 
All student passwords are stored in plaintext.
 
They already aren't using good any security practices anyways.
 
I'm also going to guess that their login page is vulnerable to SQL injection (haven't tried though).
 
4:21 PM
@EthanBierlein Can I try?
Actually, I'm too close to graduation to go to jail ;)
 
@EthanBierlein if passwords can't contain semicolons, dashes and apostrophes, you have your answer
 
Well, passwords are set by the district, but none of the passwords do use any of those characters.
 
You don't need to use them.
You just need to type them in to the box.
 
All of the student passwords also follow the same format, TTTT####, where "T" is a letter and "#" is a number, making guessing passwords even easier.
I've emailed the tech staff about all of these things multiple times and their only response was "poor security standards make it easier for parents, students and the district to manage their accounts and information".
 
4:26 PM
so you replied with "congratulations, your security department and its policies earned an award at dailywtf.com"
 
Publish all this information on Twitter/FB with a different account.
They will get hacked fast, and that might teach them.
On the other hand, they probably won't even know that they were hacked...
3
 
LOL
I'm probably going to post to plain text offenders.
 
if someone pulls a "bobby tables" on them, I'd wager they'd notice
 
@Mat'sMug Be sure to delete the logs too.
He might get expelled if he tries that.
 
4:28 PM
I said someone, not Ethan ;-)
 
I'd love to, but my academic career is slightly more important than teaching someone about bad security practices.
 
@Mat'sMug needs a better title
 
yes, indeed!
 
@EthanBierlein Contact the BBB. I think they deal with stuff like this.
 
...British ...Broadcasting ...Board?
 
4:29 PM
Better Business Bureau.
 
LOL
> plaintextoffenders.com has been blocked
3
 
bwahahaha
@EthanBierlein and your request has probably been logged
 
unless the VPN I'm using can prevent that, then yeah. don't care though
 
good boy :)
 
4:45 PM
0
Q: C++ Console variables

user103990I've written some code for console variables. They support different types e.g. integer, string, vector, float etc Is there a better way to do this? Like with an interface and a class for each different type? I also have to create a register function for each type of variable float, int etc Is...

0
Q: Conversational bot architecture

Graham SlickI am currently building a small conversationnal bot, and I am struggling with the architecture. I use Facebook Messenger combined with Wit.ai's API and a shopify store API. My rails app is the interface between those three API. First, the rails app receives a message from facebook. It transfers...

 
    var baseValue = base.LogDate;
    if (LogDateRegex.IsMatch(baseValue))
    {
        // LogDate is "Apr 19/16" for "Apr 19 2016"; assume parsed log was taken in 20xx:
        baseValue = base.LogDate.Replace("/", ", 20"); // todo: defuse timebomb
    }
// todo: defuse timebomb... or not
4
hopefully the provider that's giving me these stupid logs will have been out of business for over half a century by then
 
If you have working code you are probably better at: codereview.stackexchange.com Also I wouldn't create functions just to return arrays. — Rizier123 just now
 
5:08 PM
Nice edit @Mat'sMug. I copy/pasta'd the crap out of that.
 
@EBrown wait what? where? who? me?
 
@Mat'sMug Hmm? ;)
According to my Fitbit, I had no heartbeat from 6:55 to 7:25.
3
 
lol
 
OMG HE'S A ZOMBIE
 
@Mat'sMug Someone better review me, then.
 
5:20 PM
@EBrown Does "too much booze" count as a review? ;P
 
@Hosch250 Yes...:(
 
You'd like Rat and the Crocs in Pearls before Swine.
They practically worship booze.
 
Though I'm going to completely ignore it.
 
That's your right.
Let's see, what else do I know about you?
 
Indeed. ;) I just can't edit the question to state not to review my booze habits now.
(It would invalidate the answer.)
 
5:21 PM
Hmm, I'm not sure whether you program too much.
 
Or not enough?
 
Right.
 
@EBrown sleep.. you could use that from what I hear
 
@Vogel612 That too.
 
#define SLEEP ((void*)0)
 
5:29 PM
#define SLEEP "For the weak"
#define self weak
sleep(self, 0, 8*60*60*1000);
 
so, ... then haha
 
0
Q: (Java) Dice Rolling Program GUI

LoganGardner15I am working on writing a small program for a game called "Turkey Trouble" that we did in my biology class. The game involves the rolling of two dice. The two numbers are then added and this number corresponds to a list of "events" that will occur in a population of turkeys. I have the code writt...

 
> An aggregate may not appear in the set list of an UPDATE statement.
Annoyance
 
@Zak True, but in the end, the author has a mayor say in what should and what shouldn't stick in it's post.
 
a mayor say
 
5:46 PM
-1
Q: How to extend/ use inheritance in a modular design pattern in javascript

GabrielOkay, so I have the module pattern of my main class as follows: Var draggable = {}; (function(){ var initialMouseX = undefined; var initialMouseY = undefined; var startX = undefined; var startY = undefined; var draggedObject = undefined; var startDragX = undefined; var startDragY = undefi...

0
Q: Singleton method for Redis connection in Python

John BachirHere's my class for providing a singleton instance of a Redis connection. What do you think? from redis import StrictRedis import os class RedisConnection(object): REDIS_URL = os.environ['REDIS_URL'] def __init__(self): self._redis = StrictRedis.from_url(self.REDIS_URL) de...

 
I heard a mayor say something once.
 
and every 4 years or so, a mayor yumps if something doesn't yive with the way they're handling things
 
blech
update cfg set
    HowManyBranchesSetup = cnt
from #AgencySuppliesConfig as cfg
    inner join (
        select svslb_svid,
            count(*) as cnt
        from SUPPLY_VENDORS_SERVICELINES_BRANCHES
            where svslb_externalid is not null
            and svslb_externalid <> ''
            and svslb_active = 'Y'
        group by svslb_svid) as counts
        on counts.svslb_svid = cfg.svid
Could I use a CTE here?
 
I would
 
I don't see why not
 
5:50 PM
Ah, that looks a lot better
 
> Get home at 0530
> Leave at 1430
Awesome.
The things I do to help other people out.
 
@Phrancis CTE?
 
@Mast Common table expression
 
@EBrown You get paid per hour I hope?
@Phrancis Like a template?
 
@Mast Yeah but only at work.
Only 11.5 hours of that is work time.
The rest of it is travel time.
 
5:54 PM
Just rent the apartment next to your work. Problem solved.
 
@Mast More like a pseudo-table (like a subquery)
 
@Mast It's not my living arrangements that are the issue. :p
 
@EBrown No issue? Good.
@Phrancis I wouldn't know when you'd want to use those. It probably improves maintainability.
 
It's the person I've been giving a ride to the past couple days.
 
@EthanBierlein There is no reason whatsoever why you'd want to generate passwords in a format like that. That's most seriously evil. If they'd be within driving distance I'd knock their door down.
It's setting a bad example.
@EBrown Do you like her?
 
5:58 PM
@Mast She's a nice person and all, but I actually feel bad for her more than anything.
 
@EBrown You feel bad for her being driven by you? Exactly how bad are your driving skills?
 
@Mast Not for that. She's just in a really bad life-situation right now.
 
Oh, that woman. Well, at least you're doing what you can.
 
00:00 - 18:0018:00 - 00:00

« first day (1089 days earlier)      last day (2922 days later) »