« first day (916 days earlier)      last day (3399 days later) » 
00:00 - 19:0019:00 - 00:00

00:00
Not the editor, the language
I guess that lowers him a notch in my respect.
OK, either way.
Eh, he revolutionized it. Before that it was macro land.
00:45
2
Q: Comparing md5.Sum to text from file

Adam SmithIn learning golang, I wrote a small CLI utility that will take paths as arguments and list out their md5 hash as hex strings. Included are two flags that alter functionality, --check | -c which takes an additional file, hashes both, and returns whether or not they match (and exits with the proper...

00:56
Lol. That was weird @Jamal.
I voted to delete and it deleted.
01:14
0
Q: Using reference to head node while reversing linked list using recursion

JohnReferring my previous post.Should I consider using current pointer for my code snippet below for reversing a linkedlist using recursion : public static List ReverseRecursion(List head){ List current = head; if(current == null){ return null; } if(cur...

0
Q: Provide non-duplicating records based on multiiple conditions

Alan WaynePostgreSQL 9.2 The below code correctly gathers diagnosis records for a patient to show distinct records based on the AMA ICD9 code, diagnosis description, and date of posting. The output is distinct on (ICD code, cdesc, tposted). The most recent date of useage, tposted, is assigned to each uniq...

01:35
@CaptainObvious Surprisingly up my alley
-1
Q: Bidirectional map

CohenFor fun and to learn a bit, I decided to implement a bidirectional map in Ruby, relying on Ruby core libraries where possible. Looking for feedback on the actual ADT code, as well as the spec code. It's behavior is intended to be that of a Ruby Hash, but one in which 'values' are also hashed as...

0
Q: Looping through JSON object with nested for loops

BlexyI've written a function that loops though all of the accounts, properties, views, and filters - each 'level' requires another for loop. I'm working with the Google Analytics Management API and Google Spreadsheet Script Editor. Wondering how I could split up all of these loops into their own fun...

0
Q: Reading lines from a file in random order

ElogentI originally wrote this as an answer to a question on Stack Overflow, but it turned out so nicely that I decided to post it here to see if I can make it even better. (defn char-seq "Returns a lazy sequence of characters from rdr. rdr must implement java.io.Reader." [rdr] (let [c (.read r...

02:27
0
Q: TicTacToe game with functional AI in ruby - follow-up 2

GlubiA week ago I posted my TicTacToe game follow-up question. The suggestions were referring mainly to the lack of polymorphism. Here's the new code, hopefully there's nothing to improve by now (except separating board functionality from Game class, but it seems to be a lot of work). As always, sugge...

02:39
Hello.
02:55
Hi
03:23
Bob Ross happy time: twitch.tv/bobross
03:56
0
Q: Python 2.7 Payroll Calculator program

Xaroticthis is a calculator I'm working on. I want to be calculate multiple payrolls until the program ends. I think this would work like.. Do you want to keep calculating?: y/n. I want to do this in a while loop but I'm not sure. The program runs but I have a few variables that are unneeded, which I'm ...

0
Q: Better design to avoid duplication

fscoreHow can I avoid duplicating line regis? private void getShoppingReg() { if (shoppingList.isEmpty()) { String str = getFileFromURL("/list.txt"); if (str !=null) { try { validate(); regis = service.getRegistration(this.class); ...

 
1 hour later…
05:25
Monking
@Heslacher Monking
hey @Phrancis
05:36
-1
Q: Inner Class class used by only its wrapper class

silly questionsI have a inner class ClassB which is only used by its wrapper class ClassA class ClassA { private String someMethod (x, y) { List<B> Bs = new ArrayList<B>(); for(... ) { B b = new B(); b.setX(x); b.setY(y); Bs.add(b);...

TTGTB
Night!
05:54
0
Q: Dependency injection with glob

João CalvinI have a folder called core with two files inside: index.js and module.js. I'm kidding a little with dependency injection and ES6, and I would like to receive feedback with improvements for my code. index.js module.exports = [ { mod: require('./module'), inj: ['bluebird'] } ]; I...

06:07
0
Q: Best practice to call the jQuery plugin method

SatryaI've 2 code below and my question is: Do you think which is the best practice and why? Which one is good for performance? Code 1 jQuery( function( $ ) { // Responsive video var $area = $( "#sidebar" ); $area.fitVids(); // Image gallery var $slider = $( ".owl-carousel" )...

0
Q: Event dispatcher / listener

Robert ReinhartI'm working on a program that will be significantly multi-threaded. I need to respond to events between objects and threads so I've come up with the following code. #ifndef EVENT_H #define EVENT_H #include <vector> #include <mutex> #include <algorithm> #include <memory> /** * Create the defi...

0
Q: Social network DB model in MongoDB

vigneshI am building a story site for pre school The basic functions are students will be posting stories and others will be able to like/comment on that story Below is the model of the DB Stories Story_Id StoryTitle StoryContent StoryAuthor StoryLikes { LikerId,LikedTime } StoryComments{ AuthorId,Au...

 
1 hour later…
07:20
0
Q: How much thread safe is this class?

user200312I wrote this class. I would be very interested in your feedback how much thread safe this class is. I know users of this class must still use some kind of synchronization but I am ok with it, they will do such synchronization. You can comment on other aspects of code too, but mainly I would be in...

07:32
@CaptainObvious I don't step into this trap.
07:57
0
Q: What is the best way to make the below more efficent in accessing roles and permissions

kymberlyI am using the following to validate my user which works but i wish to incoperate roles so I used the reg iis to add the standard tables aspnet_UsersInRoles. What I basically want is the ability to have variables canView canDelete canEdit and that I can just access them when my dal is called. ...

08:10
@CaptainObvious that hungarian notation..
I accidentally a domain name last night.. whatthefuckshouldiplaynow.com
Really ?
08:52
0
Q: Cannot assign a value to a variable

conerI have a XML file and the programme loads it and then assigns nodes' attributes to different variables. Now when I trace the variable after assignment, it seems undefined/"". Here I put the code and I am sure I am missing something big. Why does the variable return nothing? protected function co...

Zak
Zak
09:26
@CaptainObvious Cannot be bothered to read the Help Centre
Also, monking @all
Monking, @Zak
describe('DebouncedSearchField', function() {
  let clock;
  before(function () {
    clock = sinon.useFakeTimers();
  });

  after(function () {
    clock.restore();
  });

  it('should wait the given number of seconds after I finish typing before searching', function(done) {
    const timeframe = 100;
    const query = 'my search query';
    const callback = sinon.spy();
    const field = <DebouncedSearchField onSearch={callback} debounceMs={timeframe} />;
    const node = React.renderIntoDocument(field);
this feels super hacky and brittle :(
Monking all
> Police shut me down, had to wewrite question
3
Best edit reason ^
09:47
@SuperBiasedMan I did a little re-editing, and voted for reopening. Do kind of understand why the OP felt that the police had shut him/her down...
Yeah, closing often seems more harsh to new people who don't know the system.
@SuperBiasedMan I do see the need for closing, but sometimes I kind of feel that one could have a little leniency, and let the OP correct it after a comment, and not just closing it off directly. But YMMV
Zak
Zak
@holroy Personally, I always do both. Leave a comment and VTC. That way It'll get closed, but as soon as the OP follows the advice to make it off-topic, it'll show up in the VTR queue and should hopefully get reopened pretty quick.
10:03
@Zak I see your reasoning, but when done my moderators this immediately leads to questions being close, which I tend to think puts of the OP very easily. But maybe that is the way it has to be done.
I tend to leave a comment then wait a bit to give the OP time to respond. As much as the system says closing isn't a punitive measure, it's how it ends up feeling so I try to give a little more lenience to new users if they're in the grey area.
holroy I agree on this. I usually leave a comment and wait if the user responds to it. If the op say e.g "I didn't know I had to add the code` I will wait some time if he does it and if he doesn't I vote to close.
Too bad not everybody gives this leniency to new users...
10:21
0
Q: Looking up alias using inspect in Python

holroyI'm on a quest for making a good debug_print() method for printing out debug information in some of my private projects. When testing I aliased my debug_print() imported from a module to debug() print, and some of the intrinsic of my code stopped working. This led to a question on Stack Overflow...

0
Q: Coins problem in Elrang

kharandziukHow many different ways can 200 be made using any number of coins? The possible nominals are 1, 2, 5, 10, 20, 50, 100, 200 -module(coins). -export([coins/2]). coins(_, 0) -> 1; coins([], _) -> 0; coins(_, Goal) when Goal < 0 -> 0; coins([H|T], Goal) -> coins([H|T], Goal-H) + coins(T, Goal). ...

Zak
Zak
@holroy IMO, I feel like as long as you tell them why their question is being closed (in it's current form) and how they can change it to make it On-Topic, it shouldn't feel punitive.
^ Smart person in action
I'm in awe
@Zak My comment was not aimed at you directly, it was more of a general comment based on some (for me) early closings of posts.
0
Q: Most efficient way to index a document and perform analyses on it's term vector

MarcI have the following scenario: I create a lucene document from a potentially very large text. Apart from indexing the text, I perform some analysis on the document for which I need the document's term frequency vector. The results of this analysis also need to be stored in the lucene document/ind...

Monking
Zak
Zak
10:37
@JeroenVannevel I didn't understand half of that, but I understood enough to also be in awe
He casually modified the CLR and the CSC to emit IL bytecode that allocates local variables on the stack instead of the heap
major internal language change
changed the working of an existing keyword in the process too
He apparently has another blogpost detailing how he allowed struct inheritance so I'll definitely read that one tonight
@JeroenVannevel you have found my blog ?? Just kidding
10:55
Question:
Assume you have the following relative and absolute path
..\dir1\obj1.js
C:\Users\jeroen\Documents\Github\MyProject\dir1\obj2.js
You start from obj2.js. What is the path of your resulting location when you apply the relative path?
1
Q: Recursive comment function echoes HTML inside function

AdamTo display comments recursively I'm using this: function fetch_article_comments($article_id, $parent_id) { $app = new Connection(); if ($parent_id <= 0) { $parent_id = NULL; } $sql = "SELECT * FROM recursive WHERE article_id = :article_id AND comment_parent <=> :parent_id OR...

@JeroenVannevel obviously C:\Users\jeroen\Documents\Github\MyProject\dir1\obj1.js
It is. Now, what is the problem in this piece of code then:
string absolute = @"C:\Users\jeroen\Documents\Github\MyProject\dir1\obj2.js";
string relative = @"..\dir1\obj1.js";
string path = Path.GetFullPath(new Uri(Path.Combine(absolute, relative)).LocalPath);
Console.WriteLine(path);
According to this, it should be exactly that: stackoverflow.com/a/4796339/1864167
What's the output?
> C:\Users\jeroen\Documents\Github\MyProject\dir1\dir1\obj1.js
It's as if it only counts the dots once
11:01
your paths are being combined
it's just kicking off obj2.js
Are you saying it won't evaluate the relative path by itself?
51
Q: Path.Combine absolute with relative path strings

CVertexI'm trying to join a Windows path with a relative path using Path.Combine. However, Path.Combine(@"C:\blah",@"..\bling") returns C:\blah\..\bling instead of C:\bling\. Does anyone know how to accomplish this without writing my own relative path resolver (which shouldn't be too hard)?

wait, NVM. You're already doing that :)
Maybe try dropping new URI and .LocalPath?
no diff
11
A: Path.Combine absolute with relative path strings

Colonel PanicCall Path.GetFullPath on the combined path http://msdn.microsoft.com/en-us/library/system.io.path.getfullpath.aspx > Path.GetFullPath(Path.Combine(@"C:\blah\",@"..\bling")) C:\bling (I agree Path.Combine ought to do this by itself)

That answer insinuates it should do something else than what I see
but it doesn't
Zak
Zak
Btw guys, IT'S FRIDAY!
@JeroenVannevel The Path.Combine assumes it actually got paths as parameters, so it has no way of knowing that you provided a filename and a relative path. Therefore the relative path of '../dir1' removes the 'obj2.js' as if it was a folder, and then applies the new directory of 'dir'.
At least that what it seems to do, based on your input here in the chat room
11:14
Monking
0
Q: Queries using multiple tables and ANDs: should that be avoided?

BorisThis is a part of a project I am working on. I need advice and criticism regarding the data base design and general approach to querying the data. I am not at all experienced with relational data bases (as you should notice), and even though I have tried to invest some time in reading up I am cur...

0
Q: Git post-receive hook writen as a POSIX shell script (utilising a named pipe)

Anthony GeogheganThis is my first piece of code to post here. I wrote this script as a post-receive hook for a Git repository but I’m not so concerned with the Git parts (I’d like to have the part marked with TODO working but it’s not a priority). It’s my first time to use either named pipes or the trap command ...

0
Q: Recursive Depth first search java code for a large data

Gokul RajI am noob in this and have to do some project. The data set is https://snap.stanford.edu/data/facebook_combined.txt.gz and https://snap.stanford.edu/data/twitter_combined.txt.gz. Have to apply recursive depth first search but all the codes i find do not take this large data. I need to find the s...

0
Q: Polymorphic Container

sp2dannyI've developed a polymorphic container, that is itself a value-type, and also allocator-aware. This makes it slightly heavy, with each node having both a cloner and a deleter. It does not put any constrains on the target type, a clone method is not required. Instead, the container needs to know e...

Yeah, I assume that's it
This works just fine:
string path = Path.GetFullPath(Path.Combine(new FileInfo(absolute).Directory.FullName, relative));
cheers @holroy
11:28
0
Q: Upload multiple files in multiple sections while allowing removal of a single file, before upload

AlexMy requirements: Have 3 (or more) "sections" on a page where users could upload files. They are sectioned only from a UI perspective, to make it obvious what the user needs to upload where - Identity Documents Proof of address documents Proof of previous address documents for (example) ...

0
Q: Project Euler Project 5

DebashisI have a problem which says : 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? And here's my code but it won't show any results/errors. W...

0
Q: How to add XML String into an existing XML File using JAVA?

user88929I am having xml file called temp.xml with the below content. <?xml version="1.0" encoding="UTF-8" standalone="no"?><combinedstaff> <staff><firstname>added firstname</firstname><lastname>added lastname</lastname><nickname>added nickname</nickname><salary>$10,000</salary></staff></combinedstaff> ...

0
Q: Suggested improvements for C++ 14 event bus implementation

keithI would like to know if there are any improvements I could make to the following event bus code I have written (I am reasonably new to C++ but am experienced in other languages). A brief explanation of the code The code allows you to subscribe to events and publish events via an EventBus class....

0
Q: Parse Twine HTML to JSON

SuperBiasedManFor those who don't know, Twine is just a simple interactive fiction making tool. It lets you easily create a series of passages that are hyperlinked to each other, making a choose your own adventure style structure. It exports as HTML format, but if you wanted to just use Twine to write nodes to...

Zak
Zak
11:49
I love it when I go to do a Data Analysis thing and find that somebody's already built a tool to do it for me.
13
A: What is your best programmer joke?

Feminist Unix Command man bash

snort
0
Q: How to organize my CoffeeScript in classes

Alex PopovI am working on a simple Rails app. For the Expense resource I use a DataTable. So, in my CoffeeScript for this resource I basically do several things: initialize the datatabe; since I use a custom search field (not the one, provided by DataTables), I add a search function in the table api; ini...

12:08
@JeroenVannevel Great, now I have another tab opened
Oh well, why should I care about a 0.1% increase anyway
12:28
Alright
Initial testing shows I'm awesome
Wrote a little C# script that tells me if there are circular references in my NodeJS require statements
Fool me once, shame on NodeJS. Fool me twice, still shame on NodeJS. Fool me thrice, not gonna happen.
In the end I was just doing Permutation Programming: change random pieces of code and hope it works
0
Q: Movie torrent-site web scraper with IMDb info and streaming

tsornI'm completely new to Javascript and NodeJs and functional programming in general. The code below scrapes a torrent-website containing movies, gets info about the movie from the OMDb API and lets a user choose a movie to watch by streaming the torrent. Any feedback appreciated. var scraperhelper...

0
Q: Qt - Containers - Mean, Median and Mode

Ritchie ShatterI would like some help condensing this code down to size. I am trying to utilize Qt's container classes as efficiently as possible. I do not believe this code reflects my objective. include include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QVector<int> vect; v...

12:45
Markets have been rocked by a second day of uncertainty after someone set up a giant Ouija board on the NYSE wall controlled collectively by the movement of the stock tickers.
6
0
Q: What does ExampleClass.class mean?

bgurRecently I've seen some source codes like methodName(parameter1,ExamplesClass.class); What does this mean (ExamplesClass.class)? I couldn't find any source about that.

@CaptainObvious wat
Zak
Zak
@CaptainObvious About as Off-Topic as it gets
13:02
Monking
@CaptainObvious 2 comments and nobody linked the on-topic help?
Zak
Zak
@Mast Oh yeah, probably should have done that ^^
There's an auto-comment tool somewhere right?
0
Q: Cipher decryption and encryption c#

James CookI'm brand new to C# and I've started to make a cipher decryption program.... The code works and runs fine, apart from the odd exception... Just really looking for was to improve my code and make more efficient... Any advice or guidance would be very much appreciated. `using System; using System....

Yeah I'm too reliant on it, when I have to write a custom comment I don't think of stuff like that.
Zak
Zak
Could you link it to me?
I don't use it either. I prefer the Frequently posted comments thread on meta.
And the on-topic centre isn't too hard to memorize.
It's the same format for every site.
So, for example, the on-topic page for User Experience would be ux.stackexchange.com/help/on-topic
13:20
I JUST RELEASED SHRINK WRAP!!!
I had nothing to do with the project, but I released it...
0
Q: WPF canvas drawing very slow

Joey DriessenI am building a map editor to easily create 2d levels. To visualize how my level looks like I am using a canvas. On this canvas I can select which block is filled with a certain type ( like solid ). I did add click and drag but because I am live drawing on the canvas it goes very slow and if you ...

13:40
--Declare variables
		DECLARE @xml XML, @vendList NVARCHAR(MAX), @startdate datetime
		create table #soid (soid int)
		create table #Vendors (VendorID int)
Give me a break...
(monking @ all)
0
Q: when i click on search box it get disappear.How to stop disappearing it on entering?

Ashish Srivastava<style> .insta { background: fadeout(teal, 20%); text-align: center; padding-bottom: 2.5em; box-shadow: 0px 1px 10px fadeout(black, 50%); border-bottom: .25em solid darken(teal, 10%); padding: 0 1em 1em; position: absolute; float: bottom !important; .form-inline { .input { backgr...

Good morning!
@ArtOfCode I think your bot is kinda cool. :p
@TopinFrassi Salut!
@CaptainObvious I love the smell of downvotes in the morning.
13:58
Q: Why is it allowed?
To confuse people. — Neil Kirk 6 hours ago
0
Q: Code review for iOS/Xcode

Kunal ShrivastavaIs there a good code review tool around for iOS developers? How do you do code review in your company? I have looked into crucible but using it would mean to expose the code to the web. We have git installed on our intranet server in my company so I am looking for something that can be used inter...

@StackOverflow False positive (good question though, have an upvote)
Stackoverflow now posts questions tagged code-review here?
@Phrancis That question will be closed at too broad/opinion based
I'm sure
@TopinFrassi It has for a while, it's just a feed
And the point is suppose when we write anything in search box and enter it .....the search box get disappear ... i want to know what changes i can make in a code to make it fixed . — Ashish Srivastava 2 mins ago
*groan*
14:14
i want a solution. — Ashish Srivastava 6 mins ago
Eh eh eh
--Check if system setting value indicates all vendors, if yes then default the vendor list variable to 0
		IF (@vendList = '<ALL>' OR @vendList='ALL' OR @vendList = '' OR @vendList = '.' OR @vendList='..' OR @vendList = '*' OR @vendList = '0' OR @vendList IS NULL)
		SET @vendList = '0'
Wow. That's some quality control right there.
@Phrancis Lol. Wow
I don't like this meme shit but this one's message is spot on:
user image
6
@JeroenVannevel LOL
Source:
Sometimes using ReSharper's "Convert to LINQ"... https://t.co/HlPVBnJbzh
14:22
@JeroenVannevel fk.Ba(ll => s) Ahahahahah
@TopinFrassi Why thank you. You can get your own if you like, and extend it if you know Python.
I'm a big fan of Select().UnSelect().NoReselect() myself
@ArtOfCode I don't know it that much :p But it's a cool idea
@JeroenVannevel I use this on an everyday basis.
Select(p).Unselect().NoReselect().Plz.LinqStahp
3
@TopinFrassi What does that even do?
@Phrancis Only the first statement is a real one ;-)
14:27
@Phrancis It forbids reselection on the unselected selection. Obviously
6
@JeroenVannevel Seriously? That's evil.
0
Q: Safely aborting thrid-party code using TPL

RX_DID_RXI'm using some third-party libraries in my project. Once in a while the code in this libraries freaks out and produces infinite loops and other nasty things. My goal is to write a wrapper that allows me to abort execution of this third-party code after some timeout. Here's my current implementati...

14:54
0
Q: error on loop array of days

FabrizioI test this code to loop if one date is into my array. with the example on the column A, nothing problem, the result message is 3 and in the immediate window I saw (01/01/2015,06/01/2015,02/02/2015) to test some case when only 1 day is into array, I delete the 2 day (A3,A4) like column C. the res...

0
Q: Migrate Jenkins projects from Mask Passwords to EnvInject plugin

l0b0I used this snippet in the Jenkins script console to enable EnvInject on all projects (aka. jobs) which were using Mask Passwords: for(project in Hudson.instance.items) { for (buildWrapper in project.getBuildWrappersList()) { if (buildWrapper instanceof com.michelin.cio.hudson.plugins.mask...

0
Q: Digit Power Sum with BigInteger

Shelby115This is my 1st F# program so I'm open to any and all criticism on my syntax and the way I approached the problem. Challenge Project Euler 16: Power Digit Sum 2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000? open System open ...

15:08
AGH regex
Are you trying to parse HTML?
2
No... here's my regex [ ]{1,2}
I'm trying to match 1 or 2 spaces, but not 3... but this if it encounters 3, it matches 2 then 1 spaces
Basically trying to make a borked SQL file into something usable... right now it's like this: D R O P T R I G G E R [ d b o ] . [ T r g _ S u p p l y _ O r d e r s _ U p d a t e ]
2
Ah, would it work if you just always matched one, then matched an optional space? ie. [ ][ ]?
(? being 0 or 1 times, not me ending a sentence with a question mark)
Nope :\
Oh right, it'll just keep matching. Ugh
15:21
Right
What should be at either side of the spaces? Always alphanumeric characters?
It's not quite that simple
0
Q: VERTCAT in Excel

DanI need to vertically concatenate two disjoint ranges in VBA to be passed to an Excel function (in this case the LINEST function). I hate working with arrays in VBA but I managed to get it working using the following code: Option Base 1 Function VERTCAT(R1 As Range, R2 As Range) As Variant ...

0
Q: (Guessing game) How to progress level by level?

trippt02So I recently created this guessing game which works like it is, but I wanted to make a way were the user can't progress to the next level without completing the previous level. So far I have it in place where the game asks the user if they would like to move the next level, but I can't figure-ou...

@Phrancis You want to match the spaces?
@Phrancis Why don't you just have a programme go through and remove every other character?
15:33
Got it... (([ ])\2?(?!\2))+ ... regexr.com/3c57h
1
Q: SLOC Counter Script Optimization

mjswartzI'm a HPC guy so I'm all about "make it work, then make it fast." I have a little bash script which gets a Physical Source Lines Of Code (PSLOC) and Logical SLOC (currently just of Java code, but it would work for C and C++ too). It works by finding all *.java files in a directory and then goes t...

monking
@Phrancis Good job!
@DanPantry hey
LOL
--------------------------------------------------------------------------------
--   MJC 03/27/2008
--   temporary fix to create line items when supply requisitions
--   are marked as delivered through workflow.
--------------------------------------------------------------------------------
2
Nov 2 at 19:30, by Dan Lyons
Nothing is more permanent than a temporary fix that works.
0
Q: Absolve me of my guilt: Dynamically creating spans that highlight on click

ThriggleI'm working on a page that shows groups of users. The following JavaScript function is used to show more details about a user (such as email and login) when you click on their name. But there's a twist: clicking on one of those pieces of information will highlight it to make it easier to copy. T...

15:43
@DanPantry Hi!
15:58
@Phrancis michael jackson wrote a fix 7 years ago? god bless.
3
0
Q: Password Strength Detector

Mahmoud NaguibI'm just a beginner in Python.I wrote a simple code that detects the user's password strength,but I feel that it isn't very efficient.How can I improve it? The code is at pastebin.com.If it isn't allowed I'm sorry for that!just tell me in a comment and I'll put it here. Code : http://pastebin....

-1
Q: Implementation of user options c# console application

James CookI'm brand new to C#. I'm creating a cipher Decrypter/encryptor Console application.. I would like to give the user the option to choose between typing in a string of text or choosing a '.txt' file from the filesystem. I know how to read/write/create '.txt' files.... Just a little uncer...

Oh you gotta be f'ing joking... 3 separate nested stored procedures on this one trigger... running in a cursor... FML
@CaptainObvious feature request
I can't inline-edit tags anymore, am I the only one who has that problem?
I edited my question! — Phate01 34 secs ago
and I rolled back the edit ;-)
16:10
lol
0
Q: Error when trying to run python 3.5

DeliriousMistakesI have python 3.3 on my Desktop and works perfectly fine. I'm trying to install 3.5 on my main laptop I work from, but once it is "successfully installed" (the message the installer always gives me) It doesn't want to open. I get a message saying python.exe is not a win32 application or something...

@Heslacher ok, I'll ask a new question! — Phate01 19 secs ago
@Heslacher GJ new user!
GJ ?
I only know BJ
Beijing? Yeah, beautiful city
GJ = Good job :p
16:15
@TopinFrassi lol
@CaptainObvious I'm not a fan of password 'strength' checkers.
They just provide a false sense of security
I wonder if " " would be a valid password
Oops, imagine there's like... 37 whitespaces between ""
Well, 37 bits of entropy is okay.
But honestly youre just better off using a password manager.
That way you only have to remember one password instead of loads :)
37 whitespaces woudl be an interesting one because it probably wouldn't be in a dictionary attack and as I said, 37 bits of entrophy.
entropy
What happens if you put unicodes in a password? Guess it depends how it's parsed, but I bet that'd be funny to try
@Phrancis any user who is accepting unicodes will escape the unicode.
or any non-stupid developer will escape it
16:22
What if you put \u0000 in your password? :)
@DanPantry That would be fun to try. I already use a password manager. Best.Thing.Ever
\u0000 encodes differently to the appropriate unicode.
@Phrancis actually I already found a bug in some software that depended on something along those lines.
the software allowed to change your password over a website.
If you escape the `` then you would end up with the escaped \ plus u0000.
and you had to log in in a dedicated client...
but the client and the webpage would handle certain chars differently..
so when I changed my password to include one of those chars.. well..
16:24
to put it another way, `\u0025` (which is #)...

`mypassword\u0025` should be stored as `mypassword\\u0025`, whereas `mypassword#` should be stored as `mypassword\u0025`.
or something like that.
it doesn't really matter how it is stored as long as the behaviour is consistent
414
Q: Worst security hole you've seen?

si618What is the worst security hole you've ever seen? It is probably a good idea to keep details limited to protect the guilty. For what it's worth, here's a question about what to do if you find a security hole, and another with some useful answers if a company doesn't (seem to) respond.

If you wanna have some fun
I bet £10 the apple goto fail will be in there
16:39
"good taste for porn" - there's an oxymoron. — Zannjaminderson Feb 18 '11 at 6:58
Today is WTF Day here...
BEGIN
   SET NOCOUNT ON
--   SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
0
Q: lz77 is slow operating on byte arrays

Phate01I ported a lz77 implementation from java, changed it from operating on strings to bytes and improved its performance following the advices of this question. Testing the performance, I found that running in debug from visual studio, the string version of the algorithm is twice faster than mine. ...

0
Q: Horizontal page-loading accordion widget

sunnyInspired by this website, I wrote the following function to automatically generate a div and load a page for each page listed in an array of page names. The idea is that if I want to conveniently display webpages or other pre-packaged content, I just need to make an array of the file names/URLs a...

@EthanBierlein hey
Is anyone around here a VBA-er?
16:57
I think I'm going to try my hand at making my own Password Manager.
Adding stuff to redis causes the data to be inserted, the integration test passes but after inserting, the callback's 'error' field is populated with a message saying the function was called with an invalid amount of arguments
but it's not. It's called with key, value and callback just like elsewhere where it works without a problem
I'm tempted to ignore it since it works but I don't like it
0
Q: Optimizing "complex" iteration over Map with auxiliary maps

Patrick BardThis will be tough to explain. I am implementing a tool to support RFC6020. But when it comes to the Choice Statement, things get weird. For the sake of better understanding, I have to remember you a couple of things: I have a XML and a YANG file according to the RFC. A Choice (and it's cases)...

0
Q: Calculator using Tkinter

prodicusSo this is my first project. I made a Calculator using Tkinter. Known backdrops: oops concepts not applied stack not implemented Here's the code #!/usr/bin/env python3.4 from tkinter import * import parser root = Tk() root.title('Calculator') i = 0 def factorial(): """Calculates t...

17:22
0
Q: Reverse a string for array

user88958In the given code it gives the reverse order of elements in string.But I want the string in array to be reversed.I have tried using StringBuffer and charAt but it is not working.What to do.PLease give suggestion import java.util.*; public class Solve { public static void main(String[] args) { ...

0
Q: printing hollow diamond in Java

Mr.BLACKSo I'm trying to print a hollow diamond in Java. public static void main(String[] args) { int size = 9; int h = size/2; int o = size%2; for ( int row = 0; row<size; row++) { for (int i = row+1; i<Math.abs(size-h); i++) { ...

17:49
0
Q: How can I avoid the "for loop" in this case with numpy?

OliverI'm using numpy to write the "back substitution" method for solving linear system where "A" is a nonsingular upper triangular matrix. import numpy as np def upperTriSol(A, b): n = np.size(b) x = np.zeros_like(b) x[-1] = 1. / A[-1, -1] * b[-1] for i in xrange(n-2, -1, -1): ...

Zak
Zak
Alright, the work-week is over. Back to speedrunning
@Zak That sounds like too much work... Speedrunning that is...
@EBrown It shouldn't be that hard honestly
Zak
Zak
@holroy Well, yes. But I enjoy doing it, so it's not really work
(though my binder full of calculations and designs may beg to differ :)
Good for you! :D

Not so good for me, as I really should've enjoyed training/running/exercising a little more than I do ...
17:54
I enjoy Netflix, and chocolate. What else is there to enjoy in this world?!?
@Zak What are you speedrunning? I've always been pretty amazed by these things, but I wonder how people do it
Zak
Zak
@TopinFrassi Factorio!
As to how. It's basicaly a constrained optimisation problem
Admittedly, one with a lot of inputs and variables, but at the end of the day, still just maths
@Zak Yeah, I guess. Do you find game exploits or use some already known?
Zak
Zak
@TopinFrassi No exploits, No Mods
@Zak Oh alright! It makes it an even bigger challenge :p
That must be fun!
Zak
Zak
Since the game is, basically, one huge supply chain, optimisation really is optimisation
That's the supply flowchart for the first hour
Just setting that up
18:02
@Zak The video stopped after 23 seconds because my internet sucks. What's the purpose of the game?
Zak
Zak
Automate Everything
It's much like Minecraft, in that's there's technically a win-condition (in this case, launch a satellite into space), but it's really just one giant sandbox
That's everything else
@Zak Oh alright, so yeah the optimisation is really an interesting challenge
Zak
Zak
That flowchart shows everything I'd need set up in order to build a satellite (and rocket, and launchPad, and research all of it) in 100 minutes
The important thing to note: You don't actually need that many factories building stuff
But you need over 200 mines to supply al the raw materials
And then a 120 or so advanced furnaces to smelt all of it.
That's really where most of the time goes
That's an interesting project you got here!
Zak
Zak
Current WR is just under 3h 30m
I plan to do it in under 3
18:10
How do you "monitor" loss of time?
Zak
Zak
What do you mean by monitor?
Like, just timing a run in general?
I mean, lets say, you plan something. It takes 3h30, what's your thought process to find what you can optimize next?
Zak
Zak
Oh, right :)
The first plan was to build that flowchart
And just work out, what's the (minimum) raw input I need of everything
And where is the bulk of time actually spent
Which is mining and smelting ore
then, the thought process is: "Okay, what's the most efficient setup of Mines:Furnaces and how much can I support per transport belt?
And then it's just trying to optimise things:
That's quite interesting! How much time do you think you've spent thinking about this? And do you stick in front of your computer for 3h30 watching what's happening or do you automate it?
Zak
Zak
1) What's the current Bottleneck?
2) How can I optimise it?
3) Is it still a Botleneck?
4) If No, loop
Do that for 2 weeks, and you start getting somewhere :)
Plus just lots of Basic Science type research
18:16
That's really nice. A cool project I'd say!
Zak
Zak
"How many miners' output of ore can I put through a transport belt at full capacity?
I admire the dedication people put in personal projects. I wish I had motivation to stick to something. :p
Zak
Zak
IT's just something I enjoy doing :)
I've been analysing game mechanics since I was 12
(then, it was monopoly)
It's just how my mind works
It's much better than to waste time on Netflix or Shadow Of Mordor. :p
Zak
Zak
To be fair, I also do a lot fo that :)
18:21
0
Q: Location of static final constants for method in Java class

Josh BroadhurstLet's say I have a class with a method that uses some static final variables as constants, but no other method in the class uses them. For example, an AVLTree class with a balance method that uses these constants to describe balance factors for rotations private static final int L_HEAVY = 2; pr...

I'm looking at this C#
				try
				{
					workFlow.GenerateWorkFlow(_sqlTransaction);
				}
@Zak Then you have time management skills that I don't have :p
What's the _ in _sqlTransaction supposed to mean?
@Phrancis It's a way to indicate a private member!
@Zak I'm curious on your findings. How do you usually setup your factories?
18:23
It's an almost convention :p There's an holy war about whether or not you should use it
As in... the member is created by the class instance?
Zak
Zak
@EBrown I'm not really sure where to start :)
Plus, Most of my work, to date, has been on setting up mining/smelting
Well I mean as far as layout. Do you usually sprawl things out and use trains (when unlocked) or do you keep things packed together?
Zak
Zak
Never use trains for my speedruns
barely use fast-belts
Yeah, for example :

class Person
{
private string _name;
}
oops
Zak
Zak
18:25
And I sprawl, a lot
Not unnecessarily, just so I can build lots of long, straightlines
Zak
Zak
As well as resource-efficiency
There's one of my factories.
Zak
Zak
There's also: "How easy is it for me to actually lay this out with my mouse?"
I think, by the end of a speedrun, my entire operation's a bit bigger than that, but not by a huge amount
There's a better picture of it.
I always run into layout issues.
Zak
Zak
18:29
Think bigger :)
I am bad at that. Lol
Zak
Zak
Leave more space
GEnerate less water
Spawn a desert (trees are a apain :)
I always set all the resources to "very rich" as well.
0
Q: How to chain JavaScript's pop() with map()

BenI'd like to simplify the code below - particularly the last pop() operation. It doesn't seem like I can chain it off map though. Any suggetions how I can tighten this up? const splitLines = logData.split(NEW_LINE); const splitLineObjects = splitLines.map((line, i) => { if (i === 0) { thi...

Zak
Zak
For m speedruns, I have a specific map seed I use
18:31
FINALLY I found the issue.
I also always end up under-producing blue science packs.
Zak
Zak
This is where the flowchart comes in handy :)
@Phrancis What was it?
@Zak Do you have an SVG or PNG version of that anywhere?
Looks like this one method was called twice within 50ms of each call (like a double-tap), inserting a new row each time, which caused a whole chain of SQL events to cascade after all the triggers and procs kicked in, finally causing the customer issue with duplicate billing charges
Zak
Zak
18:33
@EBrown Better, I can point you to the tool that builds them :)
@Zak That'll work.
Zak
Zak
You can just create an output node of whatever thing you want
click on it, set a fixed amount or a production rate
click "Auto-complete flowchart"
and it'll fill in the entire production chain
Alright, this is good. I have a definitive optimal Mines:Furnaces number
11 ore: 1 coal: 20 furnaces: 1 belt (ore/coal)
@Phrancis That's quite a weird bug!
@TopinFrassi Want to bet the user double-clicked a button? ;\
2
@Zak This tool is awesome.
Zak
Zak
18:40
That's was pretty much my first reaction :)
@Phrancis Add a Thread.Sleep(1000) after each call! Diabolic laughter
Zak
Zak
Just a word of warning, whilst the amounts seem to line up 100%, the number of factories/miners required for production rates don't always
In particular, mine overstates (by more than 2x) the number of miners needed for a given output
They do movie nights at Sci-fi.SE. Like, I guess everyone sits in chat and watch a stream or something like that. Isn't that amazing?!?
Too bad this doesn't work with mods.
Zak
Zak
@EBrown It should :)
If I recall from the documentation, it's supposed to pull the recipes/production values straight from the game files (including mods) that you have
18:49
It doesn't work with Bob's Mods.
Zak
Zak
Anyway, I'm off to do a production setup speedurn
see you in a couple of hours
00:00 - 19:0019:00 - 00:00

« first day (916 days earlier)      last day (3399 days later) »