« first day (1455 days earlier)      last day (2554 days later) » 

12:00 AM
RELOAD! There are 3789 unanswered questions (91.3527% answered)
 
 
1 hour later…
1:02 AM
0
Q: PHP Form validation and db insertion, one page or two

MCP_infiltratorI have a php form that uses the POST method to get information from form to db. I have my form separate from the form validation and insertion page. Here is my form: <?php //get the header and the navigation bar inside the page. $page_title = 'Demographics'; include('php_includes/header.html'); ?>

 
1:18 AM
0
Q: Is there a better way to check these nested conditions?

ValI'm parsing some data in C# where I have an object with 3 properties: "large", "medium", "small"; each property may contain a string array with an image path, and I'm trying to extract that path. The data should always have a large image, but not always a medium or small. I'm trying to generate ...

 
1:30 AM
Monking!
 
0
Q: Apply function to array of decimals in c#

Lachlan BI am writing some code to transform an array of decimals so that they are discounted (http://www.investopedia.com/terms/d/discounting.asp) over time. Initially I wrote the following code: private decimal[] deflateArray(decimal[] items, decimal deflateRate) { decimal[] deflatedItems = new de...

 
1:59 AM
0
Q: Serve folder content using PHP route (SSI) (dynamic includes)

BenjacoI have just wrote a PHP router, but I have some security concerns about this function. I am trying to serve all the content of a folder using this function. I am trying to prevent harmful URLs. public static function set_up($reletive_path = true) { self::$url = parse_url($_SERVER['REQUEST_UR...

 
2:41 AM
0
Q: Can my lengthy validation be simplified/imporived?

seizedSo I created method that will validate an email address for the following criteria: must have only 1 '@' and '.' '@' must be before the '.' must have at least 1 letter or digit before the '@' must have at least 1 letter or digit between the '@' and '.' must have at least 1 letter or digit after...

 
3:06 AM
-1
Q: Is there a way to do my input validation without using try-catch?

Navi4458Here is my code: https://pastebin.com/pk1QPfcE Everything works like I want to, but I was wondering if there was a way to write my validation method without using try-catch i.e using only while loops or regex.

 
 
1 hour later…
4:09 AM
 
0
Q: Written bash script to query database and check server details

me24hourI have written bash script to query database and check server details. Please let me know if the script is as per best standards: if [ -z "$1" -o -z "$2" ] then echo "FAIL : Put username and password" else fulltoken=`curl -s --insecure -H "Content-Type: application/json" -X POST -d "{\"user...

0
Q: custom thread local stl allocator with boost pool allocator

Ravikumar Tuluguwe have a huge legacy code base which is multi-threaded and uses vectors extensively, to cut down the time spent in dynamic memory allocation , we are moving to a pools, the plan is to use boost small vector with a custom allocator, the custom allocator will create a thread local pool per each co...

 
4:54 AM
@JeroenVannevel @Mat'sMug and anyone else interested: github.com/dotnet/roslyn/pull/19067
 
possible answer invalidation by Lachlan Barclay on question by Lachlan Barclay: codereview.stackexchange.com/posts/162001/revisions
 
5:21 AM
@RMunroe lol
 
 
1 hour later…
6:41 AM
0
Q: Inserting 100000 records to MySQL takes too much time

budthapaI'm using spring boot, hibernate any MySQL for reading 100000 records from csv file and write the same to the database. I'm doing the batch insert where the data is committed at intervals equal to batch size. The data is saved properly but it takes around 3 minutes to insert all data. Is there an...

0
Q: How to increase performance of bfs python3

user14511how to increase speed perfomance of next python 3 code: import sys if __name__ == '__main__': global distance input = sys.stdin.read() data = list(map(int, input.split())) n, m = data[0:2] data = data[2:] adj = [[] for _ in range(n)] distance = [0 for _ in range(n)] ...

 
6:54 AM
0
Q: Get element at a specific position in a string with separator

Aleph0I have created the following user defined function in order to get the element at the position POSI (starting at 0) in the string EXPR. Each element is separated by a separator (SEP). CREATE FUNCTION [dbo].[getStringElement_Expr_Pos_Sep] ( @EXPR nvarchar(MAX), @POSI int, @SEP nchar ) RET...

 
7:08 AM
0
Q: Referring to a file outside of the publicly visible root directory

John HinerTo enable my PHP scripts to access my mySQL database, I have a configuration file containing the name of the mySQL database, usernames, etc. In order to keep that information secure, I'm storing it outside of the web root on the server. I WAS setting an environment variable in httpd.conf to the ...

 
7:45 AM
-2
Q: Unable to run Java program on cmd

basha sayyadeverything is ok but after compiling my program a class file is created as First.class and I typed java First but it says Error: could not open 'C:\Program Files\Java\ jre1.8.0_131\lib\amd64\jvm.cfg' what to do .... plz help me...

 
 
2 hours later…
9:33 AM
0
Q: Improving Java LinkList implementation

user340I am trying to implement linklist data structure in java. Following is my implementation: // A singly Linked List class Node{ int value; Node next; Node(int n){ this.value = n; this.next = null; } public void printNode(){ System.out.println("Value: " + value); } } class LinkList{ ...

 
9:50 AM
possible answer invalidation by Jamal, Jamal on question by user1383163: codereview.stackexchange.com/posts/155689/revisions
 
@Duga Manual rollback
 
10:11 AM
0
Q: Simple MVVM Create, Update, Delete Records using WPF

Jatinder WaliaI'm new to MVVM and WPF. Please suggest whether this is okay or I need to correct my understanding of MVVM which I confess is very limited as at the moment. The default namespace to all classes as MVVMDemo. Please go thru the code and help me with the questions that I have added at appropriate pl...

 
10:25 AM
0
Q: Is ThreadPool QueueUserWorkItem best option for handling event?

maykI have an winform application that has value change event coming from ble device. The event can be hit from more than one device also one device can send a notification to event in every 4 secs. averagely so i am adding device data to a queue to use data after that. This method working but after ...

 
10:46 AM
-1
Q: Interfaces in JAVA

Sumit Jha//Help me guys...this code does not give an output import java.io.*; interface Print{ void printit(String text); void disconnect(); } class IBM implements Print{ public void printit(String text){ System.out.println(text); } public void disconnect(){ System....

0
Q: Node.js 7 async / await - usage in current state and speed improvements

A1exandrI know that async/await is planned to be released only in the next stable version (Node.js v8) somewhere in April 2017, but it perfectly solves my current needs. So I decided to use it with v7 and --harmony-async-awaitkey. Question: is there any room left in my code to make it more robust and f...

 
0
Q: Is it possible to add JSX to React code dynamically

BenSay I wanted to create a tree of JSX tags dynamically inside of a Javascript function, and then add them to my React code. Is that possible? If so, how would you do it? EDIT: I am receiving <div className="msg"><p>Hello World</p></div> as a String, so I can't just return it without the quotatio...

My comments were silently removed from this question and I don't think it's too out of line. Thoughts? :s
 
0
Q: Logarithmic random distribution satisfying RandomNumberDistribution concept

WalterI provide logarithmic_distribution to satisfy the C++ RandomNumberDistribution concept implementing the PDF p(x) = Norm * (floor + logfac * log(x) ) with min <= x <= max. Parameters are floor, logfac, min, and max, while Norm is a normalisation constant. This is the second, improved implement...

 
11:45 AM
Greetings, Programs.
 
12:05 PM
0
Q: One Header with Name and Data DataType Validation

Amitabh KumarOne Header with Name and Data upload in Text Field and store in DB and DataType Validate like Numeric ,String,date if valid the Store in DB Otherwise Error Message Pl Guide me I am New In this Sector.

 
12:28 PM
0
Q: Iterator producing unique random numbers in a specified range

Mikhail RamendikI needed an iterator that produced random numbers, never repeating them, in a specified range of 0..max-1 (index for a collection). When the numbers are exhausted it should not have a next anymore. The simplest way might be to shuffle an ArrayList and make an iterator. But in typical usage, I w...

 
12:41 PM
1
Q: History feature

GibboKI am implementing a history feature which could resemble of what an user can experience in a browser using back and forwards buttons (Chrome). How does the following scrip workst: When user visit page for first time, initial view view0 is shown. When user click buttons prev/next view is switc...

 
1:20 PM
0
Q: Optimizing JSON append template

2neI am fetching a list of messages from some JSON and appending each message as an LI within a UL. I have created the message template within jQuery to append each message to the document. My code works well but I can't help but feel it could be improved (I am a beginner JS programmer). From what I...

 
 
1 hour later…
2:26 PM
I got 175/200 on that paper. I could get 155/200 and still have an A.
 
1
Q: Calculator for magic item creation in RPG

GilbrilthorI have created a simple calculator that will assist in creating magic items from the tabletop RPG Pathfinder. Here are the full requirements, and if you want a more concise version, here is a player generated summary of the process. I have been trying to get into F# and functional programming in...

 
2:38 PM
@Hosch250 Nice. Congrats. Pleased that her response was positive. My experience is that people who own their mistakes as completely as they own their successes, are generally treated well.
 
Thanks.
 
Monking
 
gniknoM
 
0
Q: How to complete SQL Rank correctly

Simon PriceI am working with some SQL code and I am looking at ranking the results, where if Category ID is 17, this should always be at the top and then anything else should come after this. I would typically expect 1 result unless there is a result with 17, then I would expect there to be two results. ...

 
Monking
 
3:06 PM
@rolfl gniknoM
 
!gniknoM
 
why are you guys constantly toying around with Chaos? It's dangerous to do that!
rule 1 of the Internet: Don't toy around with chaotic manipulation of words :p
 
@Mat'sMug ?ti seog woH
 
we eat chaos for breakfast
4
 
it's like division by zero
@Mat'sMug lies, that's me you're describing
 
3:08 PM
@Mat'sMug I eat cheerios.
2
 
since I dish out chaos like it's air.
 
lol
 
Which is why I'm so cheery. #PunIntended
 
Oooh's
pun
    indented
8
 
My girlfriend wants flowers for her graduation (University), what type do I get her?
 
3:09 PM
@EBrown chaotic flowers :P
 
@Mast and @Mat'sMug I need your help lmao
 
trick question
 
0
Q: Load JPanel into JFrame

Abbas Mereallypublic static void main(String[] args){ JFrame frame =new JFrame("Chess"); StatusPanel status = new StatusPanel(); frame.add(status, BorderLayout.SOUTH); BoardSetup ui=new BoardSetup(); frame.add(ui); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSiz...

 
@EBrown you can just go to a florist and ask for a bouquet of flowers for your girlfriend's graduation
or you can get her her favorite flowers.
 
3:10 PM
What the hell is a florist?
 
or you can get her some nice red roses if you really love her.
 
that. make it someone else's problem
 
expect a shot to the face if it doesn't work in any of the categories there :P
 
@ThomasWard I asked Alexa
She was very helpful
Well, time to head to Area 51.
Anyone want to up vote a bunch of questions on an Area 51 proposal and help get it moving?
(I kid, it's a slightly political one and I don't want to put any of you in a weird spot.)
 
@ThomasWard You can blame me.em emalb nac uoY
 
3:23 PM
@Zeta I already blame you for @EBrown's momentary lapse in sanity :P
 
I never lapse in sanity, I downright choose to disregard it.
 
@ThomasWard What did I do? Well, except for that bad Monad joke some days ago? :D
 
I don't like how the Area 51 rep tracker is very separate from the regular SE one
 
@Zeta you're playing with Cthulu summoning spells, so you've done plenty.
 
Fhtaghn.
 
3:34 PM
@EBrown lol
@EBrown It Depends(TM)
Do you want the flowers to say anything? Or do you just want to fulfill the specification?
Can't go wrong with leis and carnations, but they're a bit impersonal.
 
@Mast I just do things to see the requirements lmao
 
stick to the specs. the only allowed Easter Egg here is a ring hidden in one of the flowers.
 
For graduations specifically, something matching the school colours is always a nice touch.
 
@Mast Blue and yellow
 
Blue and yellow are perfect for flowers, plenty to pick from.
 
3:38 PM
@Mat'sMug Not yet lmao
 
Mix with a hint of green if it gets too primary otherwise.
2
 
and white
 
Stay away from the red, the roses and the red roses.
They're not for graduations lol.
Unless it's a single one, but that's not conform the spec in this case.
Around this time of year, tulips are probably great. Those exist in any colour you like.
Tulips, carnations and those green petal thingies I can't remember the name of.
 
truth is, anything can work if you have a good catch clause for any unhandled exceptions. catch(Exception e) { throw new BailOutWithGoodHumor(e); }
 
lol
Irises can be a nice touch.
 
3:43 PM
0
Q: Looking for the fastest way (performance wise) to remove NULL + EMPTY + DUPLICATE elements in arraylist of string

N. LeroyI am looking for the best and fast way(performance wise) to remove null, empty and duplicate elements in arraylist of string. This method can be called maximum 700 times and the list can contains around 13 strings maximum. I have created a test case and I can not get an exact value of the executi...

 
I got my wife Five Roses once, It did not go over that well, She asked for Flour:
8
 
lol
 
Thank you @Mast and @Mat'sMug. I know nothing about flowers but at least I know now that I'm totally boned.
 
@EBrown - I can tell you 1 thing "for sure", Set yourself a budget of what you think you want to pay, then double it, then go to the store, and you'll need to double it again.
2
 
D:
 
3:45 PM
LOL
 
My recommendation is to start a "couple's thing" instead of flowers. I buy my wife "fun" socks. It's cheaper, more personal, and a whole lot more fun, than buying flowers.
 
Well this is a somewhat special occasion.
 
@EBrown the way I went with it are just some carnations, leis, a handful of mixed greens that go in with them, and some irises. I had some fun with that. Then I promptly ran out of money for three days.
 
You can get really special socks. promise.
 
She graduates from university with her Bachelor's in two (I think?) weeks.
@rolfl I don't know man, she was pretty specific
 
3:48 PM
OK, you can't ignore that ^^^
 
Nope.
Ignore that and you're gone.
You can always buy her socks later :-)
 
Monking
 
gniknoM
 
I'm wondering... what's the best way to serve lots of users at the same time that make expensive requests?
Is the only option to either optimize code or to throw more servers at it?
 
@skiwi Jailtime.
5
 
3:49 PM
Alright, time for me to go to the store and such.
 
Option C, kill the clients
 
Also, throttle the requests.
 
@Mast That's the way it works (tm)
 
@skiwi - in all seriousness, you will have to improve the expensive requests regardless, but you can mitigate the problem by: rate limiting, reducing the need to call the API, caching the response, scaling up the server, sharing data between requests, etc.
 
Tell arbitrary clients that their request was malformed until the load is acceptable again.
 
3:52 PM
Basically I spent half of my day debugging why about 20 requests on a single page were taking exactly the same time as the longest request
 
synchronization ^^^ ?
 
Turns out that there was one expensive request and the others were small, but the expensive one came first on a multi-threaded server that was configured to use one thread concurrently
@rolfl My first guess exactly, because I do have locks in the code
Assumptions are the root of all evil...
I assumed that that thread would spawn worker threads
It didn't.
@Mast You can only ignore that once :P
 
@skiwi Well, you could make the same mistake again on the next girlfriend, not sure if you counted that.
 
Monking
 
4:16 PM
We need a Malachi here for some Rebecca Black.
 
for some values of "need"
but yeah
it's fry day
 
 
4:44 PM
Unrelated, I'm not a fan of singletons, but I think I found one I can make an exception for.
user image
2
 
5:00 PM
0
Q: Google Code Jam 2017 1B - Stable Neigh-bors

Yk CheeseLast week I participated in Google code Jam round 2B and miserably failed. I still decided to finish the second question, for practice. Here it is: Problem You are lucky enough to own N pet unicorns. Each of your unicorns has either one or two of the following kinds of hairs in its man...

 
5:39 PM
posted on April 28, 2017

Brief outage planned for Wed, May 3, 2017 at 0:00 UTC, 8pm US/Eastern (like a fire drill for computers): Planned service degradation: All Stack Overflow/Stack Exchange sites read-only for 20 minutes on Wed, May 3, 2017 shortly after midnight UTC (8PM US/Eastern). If you blink, you’ll miss it. Visit the link for the full story.

 
6:36 PM
lol
> Eventually the tedious configuration and management of enterprise tools became painful enough that frameworks, most notably the Spring framework, came along to manage the management. You could put all your configuration in one place, the theory went, and the configuration tool would then configure the pieces and wire them together. Unfortunately these "framework frameworks" added more abstraction and complexity on top of the whole ball of wax.
 
6:47 PM
0
Q: Mapping .csv rows to a Dictionary

SeeSharpCodeI have a .csv file in which each row represents an association between a software application and a web server. My goal is to fetch a List<Server> by application, so I'm mapping the .csv to a Dictionary<string, List<Server>>. I'm using CsvHelper to read the .csv file and map it to objects. .csv...

-1
Q: Visual Studios Code Setup

user137592I am running into an isssue when trying to debug c# code in Visual Studios Code when I run the debugger I get this message "The .NET Core debugger cannot be started. OpenSSL is not correctly configured. See the C# output channel for details." I have searched around but can not find out how to p...

1
Q: Print lyrics of 99 Bottles of Beer

Mickey SheuI read 99 Bottles of OOP, and one of the offhand comments was that doing the 99 bottles problem with composition was another route that one could take (the book used inheritance). Here is my attempt. Here are the lyrics needed: Beer Song Some difficulties I had: 1) Implementation of successo...

 
7:21 PM
0
Q: Python bloom filter

BobloblawlawblogsI was hoping to get some feedback on my bloom filter implementation! Thanks in advance. I tested it with some simple words and seems to be working import hashlib import bitarray import mmh3 def calc_optimal_hash_func(lenght_of_entries): m = (-lenght_of_entries * math.log(0.01)) / ((math....

 
7:34 PM
-2
Q: clarifying a task

user1560400i was given the question below and would like to know if any one could help clarify what it is asking and why this nodes class is needed/what it does. Find the element in a singly linked list that's m elements from the end. For example, if a linked list has 5 elements, the 3rd element fro...

 
7:46 PM
@skiwi Sounds about how I feel about them.
 
0
Q: Program to model stress on furniture

InterviewsAreUsI found this question in glassdoor and careercup, this is an OOP design question. many people claim to have solved it using different design patterns. I think It can be solved either with bridge pattern or decorator pattern. In the original question the base class is derived by 4 classes: 1. woo...

 
possible answer invalidation by SeeSharpCode on question by SeeSharpCode: codereview.stackexchange.com/posts/162057/revisions
 
 
1 hour later…
9:01 PM
0
Q: Is this good acceptance criteria, in a JIRA?

BobPlease give honest feedback about whether this is a good style of acceptance criteria. Please detail what is wrong with it. Given <source system> has pushed the <account details file> into the specified location when <file system> receives this <account details file> then <file system> should pr...

 
9:14 PM
0
Q: Random range with no repeat and efficient for small subset

PaparazziRandom range with no repeat and efficient for small subset. But still survives if return most or all. This comes up poker simulation as you typically only deal 1/3 the deck. The idea is to use Random and HashSet to determine what has gone out. When the first or last goes out then trim the r...

 
9:26 PM
Why can't I write simple and short answers! Why do I have to write long and tedious answers all the time!
 
Same reason we all do: short, simple answers are mostly less-helpful to OP's.
 
Yeah, but still. Couldn't some of my answers be short and easy and not so time consuming and still be helpful!
 
9:52 PM
0
Q: Keep data in class attributes or pass it through class methods?

VictorI'm writting code in PHP & Javascript. Most of the time when I see some good-quality code, for example in Laravel, I notice that nobody uses the pattern that I used when was coding in Delphi/C++ when doing labs in my university. Imagine we have a class which is responsible for getting some analy...

 
@CaptainObvious Stub code, hypothetical code, isn't it?
 
 
2 hours later…
11:57 PM
0
Q: Map-range supporting different precisions

CarcigenicateI'm writing a Mandelbrot Set implementation, and to map the "Mandelbrot" coordinates to screen coordinates, I'm using Quil's map-range function. Essentially, it takes a number within a certain range, and "maps" it to a number of another range. It worked great when I was first testing since it's f...

0
Q: Optimize Huffman Compressor in C++

Negligible SenescenceI'm currently writing a Huffman compressor for educational purposes. I want it to compress/decompress files less then 5mb. The time limit is 5 seconds. Now it compresses a 5mb file in almost 8 seconds. The decompression speed is really awful. It requires almost 6 seconds on a file of the size ...

 

« first day (1455 days earlier)      last day (2554 days later) »