« first day (1453 days earlier)      last day (2565 days later) » 

12:00 AM
RELOAD! There are 3762 unanswered questions (91.3970% answered)
 
 
1 hour later…
1:26 AM
Quiet tonight here
 
0
Q: Comparing lottery numbers frequencies

BrandonMy project was to compare the frequency of occurrences of lottery numbers based on a given text file. I started by reading the file line by line, then extracting the numbers, and finally comparing the frequency of numbers. I'm looking for all types of criticism! /** * Author: Brandon F. * Purp...

0
Q: Using the XOR operator to calculate a checksum

RGrunAs part of a Google Foobar challenge, I'm trying to answer a rather difficult problem that involves the use of the XOR operator to calculate a checksum. While my solution works, my algorithm works in O(n) time, while the desired solution seems to need to be faster. You can see the text of the ch...

 
@Phrancis'DROPTABLEUsers-- NOT ANY MORE!
 
 
1 hour later…
2:37 AM
0
Q: Efficient way to create boustrophedon path

user_1_1_1I have following code that creates parallel swathes of specified sizes. Can someone suggest a better way of doing this? import matplotlib.pyplot as plt import numpy as np len=10; width=5; pts=[]; for i in xrange(1,width+1): y_curr=i-1; if y_curr%2==0 : for j in xrange(0,len+1): ...

 
3:19 AM
0
Q: User enter values to array

Johnny SmithI am trying to create code where the user enters the number of values they will input in to an array and it's saved to "count", then the user will enter "count" numbers to the "values" array. My program is giving me problems and i can't even build it to see if there are errors. I need to do a bub...

 
 
1 hour later…
4:21 AM
 
4:36 AM
0
Q: How to Show Common Contacts of Contact List and Fire Base Data Base using android

LuisI wan to show those contacts who saved in Fire Base Database and also in my android contact List. Here is my code ChildEventListener childEventListener = new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { final Person person = dat...

0
Q: Testing my comprehension of loops

IvenBachI want to make sure I'm understanding loops. Below are the two files I used to test what I've learned. Is there anything that I'm not using that would help simplify my code? //Program.cs using System; namespace _99_Bottles { class Program { static void Main(string[] args) ...

 
4:58 AM
Monking
 
0
Q: Get methods with the side effect of caching

NerrveI have deep graph that I'd like to traverse multiple times in a depth first fashion. Once the traversal for a particular node finishes, subsequent traversals can be optimized for that node, by keeping some state/cache on that node. However, the method that invokes the traversal starts with the w...

 
5:46 AM
@Heslacher Monking
 
1
Q: How to make the code run faster - Java with Spark?

NavieclipseI code data mining algorithm using Java and Apache Spark API. I think that my code is not very efficient. So I'd like to obtain some ideas or advice for more efficient. There are parts of my codes, and these take almost computational time of my algorithm. Dataload part: SQLContext sqlc = new...

 
6:44 AM
-1
Q: Creating an Mail account using Java code

Niket GuptaIs there any possible way that I can use for creating any account (GMail, Yahoo or Rediff) just by java code. Scenario is, I've to write a java swing code, get the data from user and register it on any Mail client(Gmail, Yahoo or Rediff) I've gone through many API's but didn't find any suitable c...

 
@CaptainObvious HAMMERTIME!
 
7:05 AM
possible answer invalidation by Mango on question by Mango: codereview.stackexchange.com/posts/161722/revisions
 
7:16 AM
1
Q: Static or no for Dependency Injection Container?

Terminal-JSI have built a DIC(Dependency Injector Container) and it holds all my services. I have another question that has come to mind about it, and I was wondering if I should go about it statically, or not. If I don't go about it statically I can make more than one container, an advantage I assume. What...

 
@Duga Eh, kind-of, not sure what to do with it.
 
7:48 AM
15 hours ago, by Simon Forsberg
@rolfl Factorio 0.15.1 experimental release is out.
 
 
1 hour later…
9:06 AM
0
Q: CSS and JavaScript DropDown menu

LuchezarHere is my first attempt to create an simple drop down menu with CSS and Java Script. This is the HTML code. <div class="dropdown menu1"> <button>Menu 1</button> <div class="dropdown-content"> <a href="#">Option 1</a> <a href="#">Option 2</a> </div> </div> <div clas...

 
 
1 hour later…
10:17 AM
0
Q: In Java, how can I enhance nested forEach using stream?

philipjkimIn List<Hotel>, I'd like to extract Hotels which has OTAProperty with a specific otaName, as Map<Long, Hotel>. The map's key is the id for the OTAProperty named given otaName, and the value for the map is the Hotel instance. I made a method createHotelMapByOtaName working as intended. But I thin...

0
Q: C# - Optimized matrix transpose algorithm?

Ythio CsiIf i have a List<List<T> like the following : Name city id Anna NY 1 Joe NJ 2 How can i transpose it efficiently in order to have : Name Anna Joe City NY NJ id 1 2 I tried the following public static void MatrixTranspose<T>(ref List<List<T>>

0
Q: Sliding Gallery with variety of image sizes

Martyn BallI have just created this simply sliding gallery, really I want it to just scroll from right to left forever without there being any gaps, so that would require a way to know when the animation is coming to the end and duplicate the images. I also want the images to have a variation is sizes whi...

 
10:33 AM
0
Q: Javascript - Simplify structure of code for the reading of coordinates from a file

youpilat13I have a first version of a small code which reads a data ascii file (called "input.dat") with 10240 lines (each representing a particle position) and 3 columns (representing x,y and z coordinates for each particles) : this version is available on this link Now I would like to simplify the struc...

0
Q: The perfect htaccess

AyanI have the following htaccess and I want it to be the perfect htaccess for my website so that it uses less bandwidth and meets the requirements of a good SEO. I am on an apache server and my files are html, php, js(minified and normal), css, ttf fonts, images. How can I improve this htaccess fi...

0
Q: Really simple immutable class

JᴀʏMᴇᴇI have a User entity. Each instance of the User class should have a first name, surname and email, and these shall never be assigned values aside from during their initialisation, since they should never change (in the context of my code). public class User { private string _firstName, _surn...

 
10:43 AM
0
Q: Is there a maximum length of code that is acceptable?

mikeySuppose a posted code is 1000 lines long - is this too long to post? Does the presence of docstrings affect this (if an upper limit exists)?

 
10:55 AM
possible answer invalidation by Toby Speight on question by coderodde: codereview.stackexchange.com/posts/161774/revisions
 
@Duga seems ok
 
11:26 AM
0
Q: Call and parse an API request

user674887I'm developing some API tests to a SOAP services. The class that performs the call to API is: class GetUserData(object): status_code = "" firstname = "" lastname = "" customer_id = "" def do_request(self, user_id): form = """ <soapenv:Envelope> <soapenv:Header/> ...

0
Q: User Favorites Service

foxtrotIt is a service that stores a user's favorites from an application. The favorite has an ID, a owner ID, and his type. This service only saves and makes this information available. When instantiating the service, must be provided a API KEY and the types of favorites available. class FavoritesSe...

 
11:58 AM
0
Q: Ensuring code builds

B. SimmonsMy code is supposed to have the user input the number of values that will be in an array and then enter that amount of numbers. Next it is supposed to list the numbers that the user input, then sort them, then list the numbers again after it's sorted. My program is giving me issue and I'm not abl...

 
12:11 PM
0
Q: General feedback on primitive solution of squeeze

geostockerAs some of you might know I'm working my way through The C Programming Language as recommended by the "The Definitive C Book Guide and List" on StackOverflow. I just finished my version of squeeze(s1, s2), a function to remove all occurrences of s2 in s1 and was hoping to get some feedback on m...

 
12:29 PM
0
Q: Is it good practices to read data from database in loop?

Damian UIn my code I have method which gets users from database with concrete status. And now I have to add new method which gets users from database with list of statuses. I don't know, is it better to create new repository method or reuse existing code. I created example method "getUsersWithStatuses" ...

0
Q: producers and workers with gevent of Python

Tony WangIt's a demo of producers and workers. Now, there is a producer named boss, and two worker, named worker01 and worker02. In the meantime worker01 is a producer too. It will consume some task from task1 queue, then produce something and put it to task2 queue. So, I want to know is there any better...

 
12:50 PM
monking
 
Kaz
1:00 PM
@EBrown No. Factorio has, regrettably, joined my long list of "Games I like far too much to enjoy responsibly"
Factorio. Oblivion. Skyrim. Anything Total War. Any and all flavours of MMO. It's a long list.
 
Greetings, Programs.
 
Kaz
@Donald.McLean Greetings.
 
It feels good to be back on a regular schedule after being out sick.
 
@Kaz Skyrim has been trashing my productivity as of late.
 
0
Q: Checking if a string is palindromic or not

maend5I have made this simple program in C++ for checking whether or not a given string is a palindrome: #include <stdint.h> #include <iostream> #include <string> #define O T #define x86-64 #define post_create_reference(h) h& #define STR(str) str #define MULTIPLY(a, b) STR(a pre_destroy_reference(b)\...

0
Q: Code for Solving Fredholm integral equation of second kind numerically

Richardson JosephCan anyone help me identifying/rectifying the occurring in the code as follows. function TestAll disp('SMOOTH KERNEL') TestSmooth(1,0,1) disp(' ') disp('********************************************************************') disp(' ') end %========================================================...

 
Kaz
1:09 PM
@EBrown But damn. I'm reading the changelog and it sounds awesome!
 
@Kaz - it's a significant improvement. I am finding the Science to be harder than before, the overhead for the setup, and the cost of science packs, is significant. This may not be a bad thing, but I gave myself "lots of space" to work science, and it turned out to be not enough, and my factory is a mess.
While getting rid of "Alien Artifacts" is a good thing, it's now heavily dependent on steel, which is a challenging resource to get lots of.
(and oil).
 
1:34 PM
Interview at 9:30.
 
-1
Q: java calulator error

user137383I am a beginner learning Java and this is a calculator program I've made. it was all good and working untill I desided to try and a square root to it. there are no errors in the code but its not working and I cant find why I will be very thankfull if u help me :) package calculator; import jav...

 
1:50 PM
0
Q: Can you find anything bad in this Framework?

AgeDeOA friend of mine created a framework and recently decided to make it open source. Is it possible for you guys to take a look at it? You can find it here: https://github.com/rbremen/phpfeather When you find anything, please let me know, I will make sure my friend will recieve the feedback.

 
Hi guys, do you know if this question has hit the HNQ or something:
14
Q: Object Oriented Design of Card Deck

mc20I am designing classes for a game with card deck. Please review my code. Each Player gets Hand of cards The Deck can be shuffled and cards are dealt one at a time from the deck and added to the players hands. Specifically, I am confused with the good method signature for the method dealCard i...

 
Kaz
@rolfl There is an iron law of Factorio (Which has a closely correlated programming law for closely correlated reasons): However much space you "plan" on using, you will need more.
 
I'm positively surprised over all the response and upvotes I've gotten on my answer, which was kind of written whilst I was running towards something else... :-D
 
@holroy IIRC saw it there earlier today
 
Kaz
I gave up "planning" my factories a long time ago, and just tried to design them in a way where I could extend/modify them later if I needed to.
 
1:55 PM
@Peilonrayz ok... That makes sense, for an ordinary Java question and me getting over 20 votes, kind of surprised me. I like it, but it surprised me. :-)
 
hey guys. Can we close trolling posts?
 
OK, interview delayed until tomorrow at 9:30 due to emails being sent in the middle of the night.
@Incomputable Consensus a while back was no.
 
1
Q: Checking if a string is palindromic or not

maend5I have made this simple program in C++ for checking whether or not a given string is a palindrome: #include <stdint.h> #include <iostream> #include <string> #define O T #define x86-64 #define post_create_reference(h) h& #define STR(str) str #define MULTIPLY(a, b) STR(a pre_destroy_reference(b)\...

even on that one? ^^
 
@holroy Have another one.
 
thx...
 
Kaz
1:57 PM
@Incomputable The intent of the poster is irrelevant. Either the code in the question is On-Topic or it is not.
 
Apparently, they had some meetings find their way into the schedule before the recruiter got back to them.
 
@Kaz I believe it's off topic, let me get the reference.
> Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar)
 
@rolfl yeah, thats what I was thinking about
 
@rolfl What about that famous question?
 
Opinions can differ, but this is clearly intentionally bad code:
#define O T
#define x86-64
#define post_create_reference(h) h&
#define STR(str) str
#define MULTIPLY(a, b) STR(a pre_destroy_reference(b)\
)
#define iterator(q) _q
#define pre_create_reference(a) &a
#define shoots |=
#define pre_destroy_reference(z) *z
#define NULL
#define getByte(as) ((uint8_t*)g_w_s)[as]
#define AUTOMATIC lvr(auto)
#define T NULL
#ifdef x86-32
        #define ARCH 32
        #else
            #define ARCH 64
#endif // x86
#define raise_to_POWER(x, k) x ^ k
#define CREATE_ARCH_NAME(s) s##ARCH
 
2:04 PM
that code already gave me a headache and I haven't even looked at it in depth lol
6
 
Yes, it's intentionally bad code (if it actually works, but I won't bother testing). I did however answer his question regarding following best practices, for which the answer is "No"...
 
Kaz
@rolfl I would put it in the category of: "If we assume positive intent (which we should), the question is not Off-Topic". I personally wouldn't upvote it. Or answer it. But I would also VTR if it were closed.
 
hehe... really: "I have made this simple program in C++ ..."
 
If he's actually written it himself, he clearly knows a lot of C++ (and macro mumble jumble). If he hasn't written himself, we could however close it as "someone elses code".
A quick search on some of the longer macro names indicates it is not a copy of someone elses work.
 
@holroy I wouldn't say C++. It looks like C with some C++ classes
 
2:09 PM
He uses cout... Typical C++... But surely, it incorporates a lot of stuff from plain C...
 
I like the tag ....
 
3
Q: Simple object comparer

SCFiCreating a simple object compare function for public system types in a class meaning only looking at the first level of a class no breaking into an object and comparing sub properties. It performs very quickly however I am unsure about the extensibility of it for the future should criteria evol...

 
And: "maend5 (unregistered)" throwaway account.
 
2:24 PM
0
Q: put the words in the sentence in alphabetical order

daosThe task is to put the words in the sentence in alphabetical order according to the first letter (taking into account the multiplicity of the space) Here is my code import java.util.Scanner; public class Task { public static void main(String[] args) { Scanner in = new Scanner(Syst...

0
Q: If array element doesnt exist, add it to the lowest index. Also remove it if it does exist

Willi have an array which handles all the games being hosting on the server. Users can host games and cancel the host as they please. What i have below seems to work, im not sure if its add the object to the lowest free index but it adds them and removes just fine. The code is abit of a mess so ive c...

 
Guys
My apartment is awesome
That's the window in my office.
Today it's even better because it's sunny
/EndShowAndTell
 
@EBrown Nice!
 
@EBrown I'm going to take a picture out of the window in my office, but I have to wait till tomorrow as I'm home today! I like my view (and it's changing all the time)!
 
@holroy This is my home office
It's the spare bedroom
 
I reckoned that much!
Is it a pine you have outdoors?
 
2:39 PM
No idea, those are between my apartment and the country club next door
@holroy ^^
The Mac keyboard, trackpad and mouse are shared with the windows PC through Synergy.
I only need the Windows mouse and keyboard for gaming on it.
 
Looks like a nice setup. I contemplated on buying a iMac, but I ended going low-end and bought a Mac mini instead. (But I do have a rather nice 27" monitor)
I got that from my last engagement, where I originally had triple screen setup with only 27" monitors! I moved one of them back home, and when I left they gave me the monitor!
 
Nice. :)
I can't wait to start work on Monday
 
@EBrown You have a real office and not a cubical?
 
@pacmaninbw This is at my house.
But at work I have a cubicle against the wall with a window, that may-as-well be an office.
 
:)
Yesterday and today I started living dangerously by asking questions on SO about swift.
 
2:58 PM
How'd that go?
 
He got referred to Code Review... :-P
HeHe... Just kidding, I've got no idea how it went. But it would have been fun if I got a referral back here...
 
Got one vote on each of the questions. I stated in the first question that if it was working I would have posted it on codereview for a review.
 
3:17 PM
Back to pounding my head against a swift wall. Talk to you all later. Onsite interview that spawned my swift questions on SO is later today.
Will ask for a code review of objective-c and swift next week.
 
0
Q: Add the Scores of the name into ArrayList "Scores"

PanthyI have a text file with about 5000 names or so, each separated by line. I am have already accomplished adding all the names to an ArrayList "names", but i am not able to add anything to my arrayList scores. I don't know where I'm going wrong, especially in the addScores method, nothing gets out...

 
3:55 PM
0
Q: Troubles when implementing partition with ternary operator

user31223I have successfully implemented partition and I'm trying to rewrite it and optimize, rework, the code as much as possible . I'm starting with using the ternary operator in place of the if else block, I think that the business logic of the algorithm is still there, but apparently there is a bug t...

 
posted on April 26, 2017 by CommitStrip

 
0
Q: Object Oriented Design of Juke Box

mc20Please review my code for JukeBox Jukebox is plays songs or playlists Each song has an Artist For playlist, the first song is played and other songs are added to the queue Relation between playlist and songs is many-to-many Relation between Song and Artist is Many-to-one In particular, I am ...

 
4:15 PM
Monking
 
gniknoM
 
Hey lflor!
How are you?
240
Q: How do I deal with the "30 minutes remaining" problem?

sh5164As a developer, I often get to this point where at the end of the day I finish a big task and still have approximately 30 minutes to go. The problem is that 30 minutes are not enough time for me to code anything, and if I start coding the very start of a task I know that I will struggle to conti...

^^ My variant of this is: "How do I deal with the 15 minutes over time problem?"
Not like it's a real problem though :)
 
Hey @skiwi - working hard, playing hard ;-)
 
1
Q: Bisect Insertion Container for Calculating Running Median

Gio PalacinoI'm looking for general feedback on this implementation. What issues might it have? How could it be improved? public class FindRunningMedian { public void Run(string[] args) { var bound = 100000; var rando = new Random(); var values = new[] { bound.ToString() }.C...

0
Q: Delphi: TFileStream child class with progress event on read/write

ar099968i want implement a progress event on TFileStream for read/write operation for assign on it a progress bar. I have create a clild class (TProgressFileStream) of TFileStream: unit ProgressFileStream; interface uses System.SysUtils, System.Classes; type TProgressFileStreamOnProgress = pro...

0
Q: Find a way to check if each element of my list param contains all data string passed as a parameter

user137405My code below is working but I am searching for performance and improvement. It consists of looping my PartList elements and check if my string parameter orginalDataStringList contains the elements on label string for each Part element. Thks! private boolean excludeAllInformationVariation(List<

 
Working on any cool stuff?
 
5:09 PM
All depends on definition of "cool", I am working on my basement, which is always a few degrees cooler than the rest of the house.
Otherwise, I am building a standard REST interface to a system in IBM, which would be cool, 10 years ago.
 
5:38 PM
@rolfl Anything that involves using a significant amount of your brain cells :P
 
Ahh, I have been planning a 2-week road-trip in the summer, should be good.
 
Sounds cool
(No pun intended)
 
6:08 PM
0
Q: Multi-threaded window class (SFML)

DeiDeiI've written a tiny wrapper class for educational purposes that separates the inner workings of the window from the actual elements displayed on it. I'm using the SFML library. I'm interested in getting some tips about the safety of the multi-threading aspect of the code, as well as general opt...

 
6:22 PM
hrngh ....
I really should write the finishing touches on the paper ...
but I can't seem to motivate myself to anything ...
 
6:34 PM
Did I hear "motivate"? alexvermeer.com/getmotivated
 
1
Q: Minimize comparisons and variables/simplicity

Edu GI, have written this DynamicIterable, where the usage i created it is basically so it can be a Lazy Iterable, where you give it a Supplier of something and a number of times it can be used. This is an Iterable of T and it also stores the consumed values, so when the iterator is called for a secon...

0
Q: Convert object with 'long.property.name' property to object tree

Dmytro RudnitskikhI want to transform such object from: foo = { 42: 'foo', 'a.b.c[0].42': 'bar', 'a.b.c[0].43': 'zet', 'a.d.c[0].42': 'baz' } To: bar = { 42: 'foo', 'a.b.c[0].42': 'bar', 'a.b.c[0].43': 'zet', 'a.d.c[0].42': 'baz', a: { b: { c: [{ ...

 
@SimonForsberg I have that image as the background on one of my desktop, but I'm not motivated enough to actually check my tasks against it...
 
got some energy :)
 
@SimonForsberg @Kaz (and @rolfl?) Factorio 0.15 is pretty awesome
 
@EBrown Is that a positive motivational factor? :-P
 
6:46 PM
Yes it is
 
lol
 
0
Q: N-Layer Boilerplate code in .Net

Jacob MasonI'm new to using design patterns in my development, I am trying to come up with a good pattern to produce a boilerplate solution I can work from for future developments. Could I please get some advise on how far I have got so far? One thing I need to add is the use of AutoMapper, any advise on ...

 
@holroy Irony of motivation.
3
@EBrown It makes things a bit more interesting. Overall I like it but there are some things I think could be improved.
 
It's still a 'beta'
 
Monking
Can we delete that trolling post? I don't have VTD privilege yet otherwise I'd vote
 
7:02 PM
@Phrancis'DROPTABLEUsers-- What one?
 
c++, currently scored -11
you should be able to easily find it in the 10k tools
 
Why was that even answered?
It can't be VTD'd by 10k with an answer
 
I answered it in an attempt to shut it down, as the current consensus seemed to be that it was an on-topic question. That answer could easily go away...
 
"Technically" it's on-topic, but I don't think that it's really appropriate.
 
Just that, so by giving an answer I thought it could be shut down (and we could discourage other more in depth answers).
@ThomasWard What is that?!
 
exactly.
Not an answer, and junk.
How it wasn't captured anywhere, I do not know.
but it needs burned from space.
 
@SimonForsberg, what do you suggest for the C++ question? Do you want me to delete the answer, so that you could delete the question?
 
so let's all flag those and get it destroyed.
@SimonForsberg I can has a hammer for a minute on CR?
 
@EBrown I am aware. I always play the experimental releases.
 
7:10 PM
@SimonForsberg I meant Factorio in general. Lmao
 
@ThomasWard looking
 
and it's gone :)
thank you
 
@ThomasWard User destroyed.
 
anyways, back to your regularly scheduled banter :)
@SimonForsberg ooo, even better, UNLEASH THE FLAMES UPON THEM LOL
 
Nope... Still the C++ question to be handled
 
7:12 PM
sorry i had a tad too much coffee today :)
@holroy that's 'regularly scheduled banter' :P
 
@holroy I can delete the question no matter if it has an answer or not
 
Is that the appropriate response, you think?
 
dead post is dead now so it doesn't matter.
 
@holroy Considering we can't be sure that the code actually does what he claims, yes.
 
@SimonForsberg It wouldn't be hard to drop it in a compiler and then test it, the problem is the fact that the original code is not just bad, it's intentionally created poorly, in my opinion.
 
7:23 PM
Sob... I lost some upvotes... :-) (Nah... It doesn't matter, it was a foolish answer to a foolish post anyways)
@EBrown It could be potentially dangerous code, triggering some strangeness, so I for one wouldn't like to compile it. Not likely, but it could be.
 
7:45 PM
Exactly. It could be a tiny version of Samaritan in that code (@rolfl and @Donald.McLean among others knows what I'm talking about)
 
I do? I forget, it seems ;-)
 
Person of Interest? Hello????
 
Oh, woot, yes, of course.
It's been.... years.
Quantico, Crossing lines, Wallander, Firefly, Outlander, and some other series back.
(In fairness, I assumed it was a (previously) moderator-related thing)
 
0
Q: C++ constexpr trampoline

JustinFor fun, I implemented a trampoline function for C++ constexpr functions, since the recursion limit for constexpr functions is much smaller (500 by default on gcc). It is a bit messy with the type deduction and the fact that the trampolined function must only take a std::tuple as its argument. ...

0
Q: Refactor code to get HostnameVerifier per instance

RanPaulI have below java class which checks if the instance is not blank and matches dev/qa/stg/staging/prod and hostnameVerification is true then getHostnameVerifierForInstance returns a customized HostnameVerifier public class SSLConfig { private static final String PROD_INSTANCE = "Prod"; pr...

 
8:08 PM
0
Q: Looking for a best way and best performance for my method. Need to check if my string parameter contains the label string parameter of each entry

N. LeroyI am trying to improve the performance of my method below. Please let me know if you have a recommendation. Thank you private boolean excludeAllInformationVariation(List<String> orginalDataStringList, PartList parts) { for (Part part : parts) { List<String> listTemp = new ArrayList<S...

 
8:29 PM
@SimonForsberg I am not being watched any more.
 
@Donald.McLean I am. Watched s04e12 today.
and in 42 minutes, I will have watched s04e13 as well.
 
I binge-watched Silicon Valley on HBO recently
 
-1
Q: Optimize memory management of a C++/CLI wrapper

Benjamin BougotI have made an open source wrapper of libtorrent (https://github.com/arvidn/libtorrent) in .NET using C++/CLI here. I started learning C++/CLI quite recently but this Microsoft extension of the C++ language is hard to master and I think my code could be improved especially regarding memory manag...

-1
Q: Does using trim() with mysql_real_escape_string() make sense?

user137419Quick question: Is "trim()" necessary at all in this simple example below of escaping a user-submitted "First Name" field? Or is trim() completely unnecessary? $firstname = trim(mysqli_real_escape_string($connection,$_POST['firstname']));

 
Very funny programmer-oriented humor (if you don't mind the vulgar language)
 
8:54 PM
0
Q: Surrogate Type for System.Net.IPAddress Type in Protobuf-net

NathviI'm pretty new to protobuf-net. As it stand right now, there is no native support for [de]serializing the System.Net.IPAddress type. I'm pretty sure the standard way to rectify this problem is to make a surrogate class, and then to register it with the protobuf-net's RuntimeTypeModel object. Here...

 
9:07 PM
0
Q: Is this quicksort implementation efficient ? and does this code follow common best practices

hjsv41Is this assembly(tasm) implementation of quicksort efficient ? and does this code follow common best practices. IDEAL MODEL small STACK 100h DATASEG ; -------------------------- ; Your variables here ; -------------------------- arr db 3,1,2 var db ? CODES...

 
9:49 PM
0
Q: Re-inventing the wheel: Binary search in Scala

patrickI am trying to implement the code described in this post about how Reddit uses binary search to identify duplicate user names, in Scala. Just to clarify, this is mainly for me figuring out how these things work, i.e. reinventing the wheel. The way I understand it, the steps for binary search are:...

 
10:03 PM
0
Q: TicTacToe in Python with MiniMax/AlphaBeta

DanielI know barely anything about Python, I just jumped into this project as I've already coded it in different languages and it's my go-to when figuring things out in a new one, any feedback will be appreciated. I deliberately tried to avoid making things too object oriented with private attributes ...

 
10:16 PM
1
Q: Iterate through python iterable in chunk of n

charlieh_7I need a function to iterate through a python iterable in chunks. That is, it takes an iterable and a size of n and yields generators iterating through each chunk of size n. After some experimentation, I wrote this stupid hack because it seems there is no easy way to preemptively check whether an...

 
10:30 PM
0
Q: Disposing SQL objects inside another using block

mkulIn one sql connection I have multiple sql commands and I wonder what approach is better - create and dispose SqlCommand for each operation or use only one sql command? Eg: using (SqlConnection connection = new SqlConnection(ConnectionString)) { connection.Open(); using(SqlCommand cmd = n...

 
10:45 PM
0
Q: memory management for matrices built with dynamic arrays

hydecppI am working on C++ code which builds matrices (3D and 4D) using dynamic arrays. I am using arrays instead of vector; as in the future, I might extend this code to some kind of multithreading or parallel process (e.g. CUDA). In my code, I often initialize and define the source matrix in the main...

1
Q: Common factor of two numbers

Trung NgoThis is just a practice challenge on HackerEarth, as followed: https://www.hackerearth.com/challenge/test/programming-practice-challenge/algorithm/c6f4c9b405004de4937dd5e641b1b2f8/ The problem is straightforward. Before I came up with this version, I thought to adopt the Euclidean algorithm for...

 
11:00 PM
-1
Q: Programming in c

Karo Tardígrado//I'm learning C, however, I have some problems with simple programs like that. I //can't see error. In the warnings show it:C:[Error] ld returned 1 exit status. #include <stdio.h> #include <stdlib.h> #include <locale.h> main () { setlocale(LC_ALL,"Portuguese"); int a,b, din=0, cont=0,...

 
11:13 PM
0
Q: More efficient way of storing variables to a map by splitting a text file

p315I'm currently making a social media app that contains profile details such as interests in a text file. The following code works by using markers in the text file to upload these details to map data structures. I'm wondering if there is a more efficient way of doing this. textList = ReadFile(Fil...

0
Q: Slow 8/15-puzzle IDA*

superphunthymeI am trying to find the optimal solution for a given 15-puzzle. So far as I can tell, the algorithm works (on simple instances of 8-puzzle), but is extremely slow for complex starting states (order of 100 seconds), and practically unsolvable with 15 tiles. I know finding the optimal solution is h...

0
Q: Java Generics and ArrayLists

JeremySo this abomination of code creates arrays based off input from the user. Sample input would be something like "S 4 aba bab baa aab" where: args[0] = array type (Int, Double, String) args[1] = length of array args[2...] = contents of the array The creation of the arrays in my code is horrible...

 
11:36 PM
0
Q: Simple program to split DNA sequences based on ambiguous content

Daniel StandageThe problem I have a program that takes a file of DNA sequences as input and writes each entry to one of two output files: one file for sequences containing only canonical characters (A, C, G, and T), and another file for sequences containing non-canonical (or ambiguous) characters. The data D...

 
11:56 PM
 

« first day (1453 days earlier)      last day (2565 days later) »