« first day (1336 days earlier)      last day (2664 days later) » 
00:00 - 18:0018:00 - 00:00

12:00 AM
RELOAD! There are 3237 unanswered questions (92.0037% answered)
 
@Hosch250 I don't think we should be updating. We have to find what causes the issue and solve that instead
we don't need any of the updates so increasing the dependency version only limits the number of people that can use the package
certainly considering it's only for testing
did you try creating a new solution and adding vsd as a reference?
If everything works fine then it's isolated to the test project
 
0
Q: python: coding issue

Abdalla Abbasnum1 = input("please entr a whole number:") num2 = input ("now enter another whole number:") print( 'input is ;', type(numb1), type(num2) total = num1 + num2 print('total:', total, type(total)) total = int(num1)+int(num2) print('total:', toral, type(total)) total = float(num1)+ (num2) pri...

0
Q: Making my 2d Vector class more "Pythonic"

CodeSurgeonAs part of a game engine I am creating, I am in the process of writing a bunch of math classes (vector2/3/4, matrix2/3/4, and quaternions to start with). Below is the code for my current Vec2 class: import math import random class Vec2(object): def __init__(self, x, y): self._x = fl...

 
12:39 AM
"Can you suggest a better design than that?" See codereview.stackexchange.comguest271314 46 secs ago
@guest271314 Why suggest Code Review? This isn't even on-topic there. — Peilonrayz 10 secs ago
 
12:54 AM
0
Q: Improving a color spiral generator

CarcigenicateI decided to resurrect an old project of mine and mess around with creating a color spiral. The code's pretty basic, except for the advance-color function that seems exceedingly ugly and excessive to me. My goal was to create a function that when given a color and some information about the curr...

 
@JeroenVannevel OK, I'll create a new branch and bring those three files over.
I have absolutely no idea what is going on...
Once we get that resolved, I'll have another PR for you.
 
I'll look into it after new years and get it fixed
 
OK. I'll do my PR now, and you can take a look when you want.
Actually, no, Johan said that a field can't be readonly if it is static and assigned in the ctor.
I don't check that.
Unless the ctor is static itself, that is.
 
1:28 AM
@Duga Going up! :)
4
 
1:40 AM
Hopeful it's not just the Winterbash effect
 
Just fixed a small error in my post with an answer. Don't worry, it doesn't invalidate any answers.
 
possible answer invalidation by Hosch250 on question by Hosch250: codereview.stackexchange.com/posts/151193/revisions
 
MUAHAHAHA.
That kid is a brat, but it sounds like the teacher is incompetent.
 
1:57 AM
-2
Q: A student hacked into my computer and I cannot get him out.

user126945I am a teacher and I allowed my student to use my computer- following this, I have noticed changes in my system that lead me to believe he allowed remote access and has hacked into my computer. I opened Terminal, and I can see log-ins from a "console" at times that I do not log into my computer. ...

1
Q: vertical sum in a given binary tree

Lin MaWorking on below problem and I am thinking if there is a way to not write recursive code? Here is my code of non-recursive solution, any advice on code bug, performance improvements in terms of algorithm time complexity, and code style is highly appreciated. Problem statement, http://www.geeksf...

 
2:11 AM
Pretty good for mobile
@Hosch250 What kid?
 
The one that the Captain just linked to.
I know how we can get more people in the chat.
 
free coffee would do it
 
Let's have an event on meta to decide on a new name for Captain Obvious.
 
which reminds me, I was told i would get free coffee by lurking here
so where's my coffee
 
No, that's in Software Engineering's room.
 
2:21 AM
:P
 
@Hosch250 Nooooooooo!
<3 our Cap'n
 
ASCII art coffee cup.
Compliments of: picascii.com
Too bad you can't set the font size for a chat message.
 
that... actually looks pretty nice at my resolution
@Hosch250 let's name him Captain Nubcake. shoots self in the foot
 
How about Captain Kidd?
 
possible answer invalidation by Jamal on question by Kris Hollenbeck: codereview.stackexchange.com/posts/14630/revisions
 
2:36 AM
0
Q: Bigger coroutine class

QuuxplusoneThis is my attempt to implement the style of coroutines I described in my answer to Small coroutine class. What do you think of it? (My unusual dialect is due to my compiling with -std=c++1z on a moderately recent Xcode. It doesn't support std::apply or if constexpr or std::is_same_v, but it doe...

 
3:16 AM
0
Q: First small project - Snake in C

wengarmWe started programming in school this year. I wasn't expecting to learn much but the pace is really slow so I tried to learn some things myself. I decided to do a little project for a start and that is a simple snake game. I would like to know what I am doing bad ( I know about the lack of consis...

 
3:49 AM
@Kevin Krumwiede - Thanks for your question. I believe it isn't clean because let's say that you have 50ish variables, and you have created a function in a different file (I have transitioned from C to Java so I don't the equivalent of function or method in JAVA) to declare these variables. I think it will be not a good experience for code reviewer to go back and forth between declaration piece and usage (setting) piece. Right? I'm new to JAVA world, so I am not sure the best way to handle this. I'd appreciate your thoughts. — watchtower 1 min ago
 
4:06 AM
0
Q: Dynamic attribute key selector

SeekerI'm basically trying to build a function that searches all nodes on the DOM to check for data attributes, then swap them out with whatever is stored with the "data-intl-" attribute. For example, if someone had data-intl-attr, whatever attr is on, that node would get replaced by what's in data-int...

 
4:39 AM
This might be more suited to the code review site. codereview.stackexchange.comEric Sondergard 5 secs ago
 
4:54 AM
@Hosch250 I thought yesterday, crap, the WalkTree method works like a filter for the list but as I was already on my way to bed I couldn't fix it anymore. I've rewritten my answer.
 
OK.
I've already changed it.
@t3chb0t You know, the nonReadonlyFieldMembers and membersCanBeReadonly variables both point to the same item.
I'm not sure if it is worth it to rename it?
Even changing the value of one changes the value of the other, which isn't really surprising, but...
 
I was asking myself the same question...
I have one more idea about WalkTree...
private static void WalkTree(SemanticModel model, SyntaxNode node, Action<IFieldSymbol> processSymbol)
{
    // todo check whether node is reference to a field
    // check whether reference is assignment or ref/out param
    foreach (var child in node.ChildNodes())
    {
        if (child is ConstructorDeclarationSyntax)
        {
            continue;
        }

        var symbol = model.GetSymbolInfo(child).Symbol as IFieldSymbol;

        processSymbol(symbol);

        WalkTree(model, child, unassignedSymbols);
 
I thought about that myself.
Feel free to post it as a suggestion.
 
@Hosch250 what do you think about this. the WalkTree method does nothing but scannig the tree and you handle each item with a separate method
 
I could do that easily enough if I used dynamic.
No, I'll do as casts and null checks in each item.
...
The one is ugly, and the other is slow.
 
5:05 AM
there's no need for dynamic
 
It wouldn't work anyway, since I'm wouldn't have a method to handle each node type.
Want to delete your comment now?
 
did it already ;-]
 
Burn, VS, Burn!
 
Morning!
 
hi
 
5:11 AM
Ho.
 
Hey ho.
 
Is there an ideal answer for Naming Conventions which can be linked into answers rather than repeating the same thing in each answer?
 
No.
Want to write an article for a website I'm going to post sometime next summer? It's going to be all about programming best practices.
 
0
Q: Convert date time string with non standard timezone offset in C#

Malcolm McCafferyI couldn't find a .NET date format type to handle dates in format I need to process, they sometimes have time zone offset with +/- prefix followed by 3 digits for the number of minutes timezone is offset by. i.e. +11:00 is written as +660 Usage Example: GetDateTime("20161124181215.000000+660") ...

 
5:46 AM
0
Q: Linux background changing daemon in Rust

user7008548I'm working on a program that updates the background of an x11 desktop at a specified interval. However, it eats large amounts of my CPU just sitting idle. I know this is due to the main loop running faster than I want it to. I've used a couple shameful hacks to quell usage down to about 15% but ...

 
6:07 AM
Greetings!
Why mocking is not encouraged for unit testing? But we need it; don't we?
 
0
Q: Barebones Braintree Implementation in Django

EricI made a barebones braintree implementation in Django. However I am not sure my implementation is correct and secure and would highly appreciate feedback. I used the Braintree-Flask implementation as the guideline for creating it. Essentially my aim was that after a payment, the transaction id a...

 
6:23 AM
I just want to point out that this is off-topic because the code is actually working. I'd suggest you try to ask it on codereview.stackexchange.com which is meant for those types of posts... — nozzleman 7 secs ago
 
6:49 AM
0
Q: Finding the distance between every indices in an array that contain odd numbers

Sidharth SamantI'm doing this HackerRank problem which basically boils down to what I've written in the title. We have to find out the distance between all the odd values in the array. I've written this code below which passes all the test cases but I think I can do better, namely, I don't have to make a separa...

 
7:23 AM
@denis Answered your question you mentioned the other day. :)
 
Hello Skeet
 
0
Q: Memory access pattern

letsBeePoliteHere is the chunk of the code that hogs the maximum time: score_type m_compute__(int xi, set_type pa_set) { // no negative or floating numbers to be handled if (pa_set == 0) { return m_compute__(xi); } // Bitwise representation of a set of numbers std::vector<int> pa_vec = as_ve...

 
8:05 AM
0
Q: Stored XSS Prevention

Arun PrakashI am facing Stored XSS vulnerability in the two return statements of the below code. 1. return output 2. return query.list() The DAO gets data from the database as a list and flows through the code to controller. The vulnerability was identified under category OWASP Top 10 2013: A3-Cross-Site S...

 
8:16 AM
0
Q: Asynchronous TCP server

RiaanDPAfter some investigation, I implemented an asynchronous TCP server as per the following example. During my investigation I was unable to find an example that cleanly shuts down the server; after some experimenting I was able to furnish my code with this functionality. I would appreciate a review ...

 
@Tushar Every language has different naming conventions...
doSomething() in Java, or DoSomething() in C#, or do_something() in Python, etc.
 
@Phrancis or do_nothing() if you're lazy because it's Friday :D
5
 
lol
 
8:43 AM
C is a bit strange... why would one want to declare functions et al. in a header then define them elsewhere
    // foo.h
    void foo();

    // foo.c
    void foo() {
        bar();
    }
 
@Phrancis are u talking 'bout function prototypes ?
 
I guess that's what they are called, yes
 
@Phrancis have a look here for a better explanation than I could give:
36
Q: Must declare function prototype in C?

Mohit DeshpandeI am kind of new to C (I have prior Java, C#, and some C++ experience). In C, is it necessary to declare a function prototype or can the code compile without it? Is it good programming practice to do so? Or does it just depend on the compiler? (I am running Ubuntu 9.10 and using the GNU C Compile...

But if I'd have to summarize, I'd say that.. generally speaking, you don't need to explicitly declare functions because defining them already does also declares them. Here are two situations where you would need to:
1. The definition of the function is in an external module. (For example, if the function is defined in foo.c, but you want to call it from bar.c, you will need to declare the function in bar.c or a file included by it (typically, foo.h).
2. The definition of the function comes after a call to it (For example, if you have two functions that call each other, you will need to declare the second one before the definition of the first one).
 
:o
@Dex'ter #2 especially surprises me
 
8:59 AM
@Phrancis, C has its own weird concepts. The same as every language out there ^^
 
9:11 AM
First of all, this question should be posted on Code Review. Secondly there are several sub-optimal things you're doing. Most importantly: C = gather(bsxfun(myfunc,gA,gB')); mainly times the data transfer from the GPU memory to the RAM.. The computations are still done on the GPU. I'll try to write a longer answer. — Dev-iL 1 min ago
Thank you both for your support, I will dig in further, and have a look at Code Review :-) — Bertrand Warot 49 secs ago
Thank you both for your support, I will dig in further, and have a look at Code Review :-) Plus I added my optimisation code in my first post (but not my full report building script, which is too long). — Bertrand Warot 41 secs ago
offtopic.. please move it to codereview.stackexchange.comJerryGoyal 29 secs ago
Then post to codereview, not stack overflow. — BugFinder 37 secs ago
I'm voting to close this question as off-topic because it belongs on Code Review. — Patrick Hofman just now
 
0
Q: Sherlock and Anagrams

CodeYogi Given a string S, find the number of "unordered anagrammatic pairs" of substrings. Input Format First line contains T, the number of testcases. Each testcase consists of string S in one line. Output Format For each testcase, print the required answer in one line. ...

 
9:31 AM
Move your question to codereview.stackexchange.com. At very first instance after visiting your code, I suggests first separate your code, it seems you are mixing model and factory method in one go. Take off your GetUser method here in a way so you can also use dependency injection. — Gaurav Kumar Arora 43 secs ago
 
9:41 AM
@Duga Tried to argue it's off-topic here but didn't write the comment ultimately, can someone double check?
@Hosch250 I don't know your issue, but I approve of that statement
 
Thanks everyone, I was not aware of separate codereview site. — user2948533 47 secs ago
 
10:26 AM
0
Q: Rails Calendar Generation Method

MhmdI have this helper method that generates an HTML calendar based on the current day. module PageHelper def calendar(date) cal = "<table class='table-condensed table-bordered table-striped'><thead><tr>" days = %w(Sun Mon Tue Wed Thu Fri Sat) days.each do |day| cal += "<th>#{day}<

 
10:56 AM
0
Q: Finding all neighbors of any given element in a matrix like structure

InBetweenThis is the code I currently have to get all neighbors of any given element in a matrix like structure: struct Coordinates: IEquatable<Coordinates> { public int Row { get; } public int Column { get; } public Coordinates(int row, int column) { Row = row; Column = ...

 
11:07 AM
0
Q: Is there any better way to write this Linq

Kgn-webScenario:- Check if the users exists, in case yes update the details. Else insert the user details. public bool AddUsers(IEnumerable<UserDetail> users) { using (var dbTransaction = System.Data.Entity.Database.DefaultConnectionFactory.CreateConnection("MyCon").BeginTransaction()) ...

 
11:38 AM
0
Q: Simple string operations in C++

HeinziI'm a .NET (C#/VB) developer who knows a little C and happens to need to write a native C++ Windows DLL. Please have a look at the following code and tell me if the string operations are idiomatic C++: int userData; void __stdcall FooEntryPoint(ENTRY_INFO* inEntryInfo) { dpi = *reinterpret...

 
11:49 AM
0
Q: Random generator extension for VSCode

helixBackground A VSCode extension that uses Chance.JS to generate random data types. Concerns My main concern is that there are 4 levels of function references that feels like a hack. From registerCommand → insertFunc* → randomFunc* → processSelection. If the code is sensible TypeScript/JavaScr...

0
Q: class representing integral type

user3132457i wrote this template class to work only with integral types (until c++11). is there anything to add/remove/optimize? (i'm not sure that constructor and assignment operator are correct, probably no) p.s. i'm compiling with these flags: -Werror -Wall -Weffc++ -pedantic-errors #ifndef INT_HPP #de...

 
12:01 PM
There is no question. If you want someone to review your code, you should post it in codereview. Also you should change the names of your variables, as they don't tell what the variables are used for. — Philipp 13 secs ago
 
0
Q: python parallel module

Ethan YousefiCan someone help me figure out why the following code won't run properly? I want to spawn new processes as the previous ones finish but running this code automatically runs everything, i.e. all the jobs report finished and stopped when they arent, and their windows are open as well. Any thoughts ...

 
@denis I think it would make sense to mention in future unity-questions that you use public fields intentionalty because of unity and how it works. I believe you'll be seeing this in every review... first I mentioned them, now @EBrown, who's next? ;-]
 
Momomomomonking
Huh, C# already had properties in 2010?
 
what kind of properties?
 
Just normal ones with get { } set { } syntax
4
A: Cached Property: Easier way?

MikhailThe problem with ?? is that if CalcNotes() returns null then it will not be cached any more. Ditto for value types if for example both 0 and NaN are allowed as property value. Much better would be an "aspect-oriented" solution, something like Post-Sharp does using attributes and then modifying ...

I was if this is a good idea
Using [Cached] tag from some other library
I have a similar situation where I want to cache something and was hoping to don't need a private variable
 
12:09 PM
I started C# in 2005 and they were already there, I think since the beginning
 
It's funny, I've always been more Java oriented during my study since roughly 2010 and I never knew this was a thing in C#, so much easier
I guess I'll just give in to using a private variable, or maybe Lazy<T> is even better though I don't plan on multi-threading
 
12:21 PM
I'm sceptical about the aspect programming, I don't like the fact that something is injecting code into mine and I cannot control it
 
0
Q: Configuring thread_local structs

PSkocikI haven't played with MT programming much yet, but I'd like to lay some groundwork for what should ultimately support threads. I have this struct that should be thread_local, and I want to lazy-initialize it on first use by copying data from a readable-writable global struct. Would this be a vi...

 
possible answer invalidation by Heinzi on question by Heinzi: codereview.stackexchange.com/posts/151237/revisions
 
12:36 PM
While you're technically correct, such hackery would never make it through a code review as it's a landmine. — Jonathon Reinhart 34 secs ago
 
12:47 PM
@cobaltsoda I do not care what he wants. I answer the question stated. This is neither code review for free service nor a fortunetellers party. — mudasobwa 17 secs ago
 
12:58 PM
@Duga not sure if any answers were invalidated, but the Q is off topic.
 
1:09 PM
@t3chb0t It shouldn't be of any concern with well-known libraries... it just irks me that I would need to add a whole dependency for a feature I'm going to use in a single place
 
I've just had the most weird conversation about 9 (!) unnecessary equality checks of two coordinates of a struct and the OP still claims his solution is easier to understand then mine :-| codereview.stackexchange.com/questions/151233/… some poeple like it the hard way ;-]
@skiwi if it only was a part of .net, but you probably have to install some 3rd party libs,?
 
@t3chb0t I think I have to do so indeed
 
is regex101 broken or is it only my machine? it doesn't want to parse even a simple number anymore regex101.com/r/J35T5w/1
lol
how did I come up with the idea to write the string inside the regex field? embarassing
 
@t3chb0t move the Row + offset and Column + offset in the rect.Contains call and only create a new Coordinate when that is true
then you get rid of those unnecessary allocations
 
1:25 PM
@JeroenVannevel but I need this throw-away coordinate to compare it with the current one so that I can skip it. if I move the addition then someone will say I do four additions instead of two, this is insane ;-)
 
do the equality checks separately then
you're doing them anyway with the equality operator
I wouldn't accept your solution either because of the unnecessary allocations
 
you're joking now, aren't you?
 
I'm not?
You turn a solution with 1 allocation to a solution with potentially 9
 
I don't think that this matters at all
 
why not?
 
1:29 PM
how bad is this?
 
If it can be easily avoided then it should be
 
it's a struct, it doesn't cost a penny
you're scaring me with such optimizations :-(
 
that's beside the question
 
I think this one is most idiomatic
3
A: Finding all neighbors of any given element in a matrix like structure

DmitryYou could use a 2-dimensional loop to iterate over neighbors as follows: public IEnumerable<Coordinates> GetNeighbors(int numberOfRows, int numberOfColumns) { var canIncreaseRow = Row < numberOfRows - 1; var canIncreaseColumn = Column < numberOfColumns - 1; var canDecreaseRow = Row >...

I would be really surprised if I say a dependency on Rectangle for such simple code
 
@skiwi This can probably be improved by using Math.Min and Math.Max rather than the intermediate boolean values but I can't be arsed to look into it
 
1:33 PM
And I disagree with the OP saying the level of clunkiness is the same
@JeroenVannevel True that, it looks weird to me in the first place
 
@skiwi why should I write 8 lines of code for checking bound if I can use the rectangle and do it with only single line?
 
@t3chb0t Because you surprise other maintainers with your Rectangle class
 
oh no, Math, another dependance
 
you're being petty
 
@skiwi how do you mean surprise? they can take a look at the docs anytime
why can math be used but rectangle not?
 
1:35 PM
End result is that you do allocations that aren't necessary and can be removed with small additions
 
@t3chb0t Imo the tools you are using are too complicated for the problem you are solving
 
allocations that no one can even say how much they cost... well, I like to keep my code simple and use all available references (as long as I know they exist) rather then write everything by myself.
@skiwi well, I didn't have to write any logic but a simple if and a few pretty obvious comparisons wherease the other solution has like 4 ternary operators, 4 comparisons || and plenty of magic numbers for some magical logic where you can make at least 20 mistakes... ok, your choice
 
1:57 PM
0
Q: Safe handling of variables in multi-threading application with shared resources

NateGrecoI've been developing this application as my first C++ project and am at a point where it is functional and would like to take a step back and critique/improve my code from a standpoint of manageability and better coding practices. Additionally, it has some stability issues which I need to addres...

 
Might be better to ask the question here codereview.stackexchange.comFlexicoder 54 secs ago
 
Monking
 
2:15 PM
-1
Q: ReflectionTypeLoadException - assembly.GetTypes()

Dawid WekwejtI get ReflectionTypeLoadException when I want execute assembly.GetTypes(). Is a good idea to loading referenced assemblies by using code from example, or is another solution to get information from assembly which have references. public void Load(string assemblyFilePath) { var assembly = Ass...

 
0
Q: Less code using c++ techniques

cateofWe have a trivial c++ task to parse a big json file from and http endpoint and then copy the values to a custom local class instance. (In the code below the instance is obj that has some setters setField1, setField2, etc...). This code is "simple" however the json response is huge and I am endin...

 
That's because you cross-posted the same exact question without considering the requirements of Code Review. Stack Overflow is for generic questions; Code Review requires real code. — 200_success 51 secs ago
@Dev-iL Thanks Dev and especially for the answer below. I also didn't realize there existed a Code Review SE. :) — yurnero 32 secs ago
 
2:49 PM
0
Q: How to add adaptive refinement feature to existing mesh class?

soltiSo I have a mesh class that represents a 2d vertices. Now I want to add a adaptive refinement feature to this mesh. So my question is How should I add this feature to the mesh class that I have. I really don't want to add this feature to class Mesh because the mesh class grows big and becomes d...

 
42
A: Could this kind of authentification be attacked?

PolynomialThis looks like you're storing passwords in the clear, which is a bad idea. You should ensure passwords are protected using, at minimum, password_hash() and password_verify(), which use bcrypt under the hood. This is simple, easy, safe, and perfectly acceptable for most scenarios. Alternatively ...

Wow PHP has those methods now?
100
Q: PHP expresses two different strings to be the same

Andy Possible Duplicate: php == vs === operator How do the equality (== double equals) and identity (=== triple equals) comparison operators differ? Why does the following statement return true? "608E-4234" == "272E-3063" I have also tried this with single quotes around the strings. The ...

Even Javascript doesn't do this sort of stuff... does it?
Selfnote: Don't use PHP until this is fixed
 
Hello.
 
3:14 PM
Hi denis.
 
3:29 PM
0
Q: Text Snipper WordPress Plugin (JS code)

Jordan CarterI am making a text snipper plugin for WordPress. Basically, I want it to truncate multiline text that overflows the height of its container and add "...". My code works for direct child elements, too. It is also responsive and keeps working based on window resize. I'm worried that my method might...

 
3:40 PM
Please, be more specific. StackOverflow is neither code reviewing, debugging or code writing service. — Anton Samsonov 39 secs ago
Probably would better fit the CodeReview site. — alecxe 54 secs ago
 
4:00 PM
Monking
 
0
Q: Controlling Drone with iOS Speech Recognition

Sawyer05I got a Parrot Mambo which comes with an SDK for creating your own app for controlling it. I decided to use the iOS Speech Recognition library so I could use basic voice commands to control it. The majority of the iOS SDK that comes with the drone is written in pure C, so it has to be used in O...

-1
Q: Project Euler Problem #6

Egek92 The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 552 = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the squar...

0
Q: Simple Product Inventory software using C# and OOP

arthurI did this small program, as part of a list of coding exercises. The list proposes the coding of a small software that's supposed to manage an inventory of products. Here's what is requested: Product Inventory Project - Create an application which manages an inventory of products. Create a ...

 
4:24 PM
@skiwi PHP has had password hashing with bcrypt for a while
 
@Mast can you take a look at my question here and if you can, help me improve it ? codereview.stackexchange.com/questions/151201/…
 
password_hash is just a method that was introduced in PHP 5.5.0 that is little more than an alias around the crypt method
@skiwi JavaScript won't do it with strings like that, but it's still a bad idea to use == because it does do some implicit casts.
 
> As a user called "tyler1" notes in a discussion forum on StackExchange, this method of signing in may at first appear to be two-factor authentication.
Nonononono! We're not a forum.
@denis That's C#, not my forte.
 
Dang it, nvm than ty
 
-1
Q: python reduce sqlite3 db lookups

Muhammad AnnsI am trying to reduce sqlite3 db look ups in python. I have system with limited RAM of 1 GB only where i am implementing it. I want to store current DB values somewhere from where i can retrieve them without consulting DB again and again. One thing to keep in mind is that trigger point of all of ...

 
4:33 PM
@skiwi Oh, it unhung itself.
 
@denis Your question lacks an intro.
What does your code do and why did you write it? You start with a link, but questions should be stand-alone.
 
I will add the description of the problem into the question's body instead of referring to a question @Mast.
 
@Mast Expensive, but cool.
13 more answers for [silver-badge:c#].
2
 
-2
Q: Implementation of stack using pass by reference

atosh502I am having problem running this program. Here I have tried to implement stack using only pass by reference. #include <iostream> #include <cstdlib> #include <climits> using namespace std; //a structure to represent a stack struct Stack { int data; Stack& next; }; int isEmpty(Stack& nod...

 
We need to keep an eye on this user: codereview.stackexchange.com/questions/151268/…
That comment is OK, but I'm seeing them escalate things pretty badly in a few places.
 
4:46 PM
@Hosch250 Agreed. Question needs more VTC.
 
Yup, mine was the first.
 
@denis Better, but you still haven't told us what it's supposed to do and why.
 
the goal is to avoid the usage of System.Reflection I think this summarizes the use of the class, or do you mean like a list of functionalities/features ?
 
If you want to avoid using something, stop writing code.
That's not a goal.
Do you want to by chance? Why do you want to avoid using System.Reflection and what do you want your code to do?
 
@denis I think speed is an importat factor because otherwise one could just use reflection
 
4:52 PM
@Mast I will add more info on that, but how is that not a goal ?
 
worth mentioning, at least by a tag
 
1
Q: SPOJ - Aplha Code - Exceeds Time Limit

Uma KanthI'm trying to solve Alpha Code on SPOJ. http://www.spoj.com/problems/ACODE/ It works fine for small numbers but exceeds the time limit for bigger numbers. I'm using the exhaustive recursive traversing. Is there a way to make it optimal. Here's my code. import java.util.HashSet; import java.u...

2
Q: Rust recursion pattern in simple cat program

IanGilhamI'm trying to get my head around recursion in Rust. I've put together a basic implementation of cat here to play with the basics. Here's my recursive version: use std::env; use std::fs::File; use std::fmt::Display; use std::io; use std::io::BufReader; use std::io::prelude::*; use std::path::Pat...

 
@denis What do you want to achieve, regardless of existing methods to accomplish it?
Usually you have a problem and use solution X to solve it.
Now you have a problem without stating the problem but stating you don't want to use solution X. So you're looking for solution Y without telling the problem.
 
That makes sense @Mast will update it to reflect that + I will add the tag the @t3chb0t mentioned.
 
@t3chb0t Isn't speed always a factor?
 
4:59 PM
Here the speed is the goal of the whole thing
 
@Mast rarely, I'd rather write something quickly with linq that works properly then spend hours optimizing something that no one ever will notice, if something needs to be fast that it's a clear requirement and one needs more time
 
@t3chb0t Answered one of your questions that was over a month old.
 
@t3chb0t Why would I need to pass a delegate around in my Roslyn question? Why couldn't I just call a static method directly?
 
This would be off-topic for Code Review. You're presenting heavily simplified code where Code Review requires the real deal. You're also not interested in optimization but more in why something is faster than something else. That's code explanation, another thing we're notoriously reluctant to accept. On top of that you're encountering errors, which would make this code considered broken. Please check the Code Review on-topic help centre for more information before posting there. — Mast just now
 
I know it's not particularly substantive, but I tried to put enough in there for it to be worth it. :)
 
5:01 PM
This would be off-topic for Code Review. You're presenting heavily simplified code where Code Review requires the real deal. You're also not interested in optimization but more in why something is faster than something else. That's code explanation, another thing we're notoriously reluctant to accept. On top of that you're encountering errors, which would make this code considered broken. Please check the Code Review on-topic help centre for more information before posting there. — Mast 14 secs ago
 
@Mast How does that looks to you ?
 
@EBrown you don't like my var position = (int?)null; :P I forgot to put a warning about it in the question :)
 
@denis Much better, have an upvote.
 
@t3chb0t No, nor your var range = (CronRange?)null;. Lol
> Overall, excellent work here. It's always nice to see your questions as they tend to be very good code-wise to begin with, the worst I can find here is a few nitpicks. :)
As always, my default sign-off.
 
Thanks @Mast now I'm just waiting for someone to answer it -_- .
 
5:03 PM
@denis If it gets far enough up the C# zombie list I'm going to be working on it. ;)
 
@denis It already has an answer...
 
We have 207, I want to be down to ~100 by the end of January.
2
 
Sorry @t3chb0t but I'm looking for more in-depth review :/
Tho you still have my upvote as the answer is valuable.
 
You could always post a follow-up once you've waited long enough.
With the revised code.
 
@denis there's nothing to be sorry about, you pick the best answer and I know this one isn't complete (yet) as I didn't have the time to study the code completely
 
5:05 PM
Most of these C# zombies are either: long, already good, or difficult problems to solve. I think it's a good challenge to scratch them off one-by-one.
2
I already learned several things from answering a C# zombies.
2
 
I looked at several, but a lot of them involve DB's.
 
I might dig on some zombies to later today.
 
I've never worked with a DB in code.
 
@denis Don't be fronting on my turf. ;)
 
Yup, answering zombies can be a great educational exercise.
2
 
5:06 PM
(I'm kidding, I'd absolutely love if you would help out.) :)
@Hosch250 It's really easy.
 
@Hosch250 Sounds like you're about to learn something.
 
@Mast Yeah, except I'm already learning things.
I don't want to start yet another project...
 
Fair enough.
 
@EBrown I finally understand (I think I do) how async/await works by answering some questions, @denis question is for example one of those where you can learn a lot of cool stuff but it cannot be reviewed in even 2h, it requries much more
 
At least, not at the moment. It is very high on my list of things to learn.
@t3chb0t Go read about it in C# In Depth :)
 
5:08 PM
@t3chb0t Oh yeah, I had no idea how async/await really worked until I answered a few (long ago), I recently learned how CultureInfo works by reading and answering an old zombie.
 
You should be able to get it from the local library system.
 
Most of my C# answers within the last ~5 days have been zombies, ~330 rep from it.
 
 
@Hosch250 I did, but it's not the same as doing it yourself, besides I don't find books particularly useful :P I've learned more from msdn and SO
 
@t3chb0t The OP's code was also really well put together, it took me sometime to figure out improvements or any additions that I can propose.
 
5:10 PM
> 447/400 score
68/80 answers
Grrr
Need more
 
9
Q: Secure way to store and load password in app config

BoeseBI am trying to figure out a good way to store and load a password in the application configuration of my C# application. To achieve this I use the BouncyCastle library and the DPAPI from Windows. To protect the password from getting decrypted by other applications just using DPAPI under the sam...

 
@Hosch250 I've seen that one it's a good question indeed, but I'm not really into security to detect any flaws so I'm avoid it ^^
 
@denis it's not that I don't want to review it, it's just pretty complex so I need to run it for my self in VS with all the tests... I want to learn something from it not only writing, the naming is bad :P
and I'm not an expert with expressions but this one seems to be a nice start to using them more often
 
@Hosch250 I keep skipping that one for the moment.
I'll get to it when I have more time.
 
expressions?
 
5:18 PM
right, expressions
 
what do you refer to with "expressions"?
 
expression trees
 
expression trees
 
expression trees
 
expression trees
 
5:19 PM
:-)
 
where are the expression trees in that question?
 
@JeroenVannevel btw, I run a few simple benchmarks and all three versions of finding neighbours are virtually equaly fast, the difference was maybe 30ms for 10mln calls, it's like nothing :)
 
aha
it's not about speed, it's about memory impact
 
there seem to be no noticable overhead in using throw-away structure instances
 
5:22 PM
This is still hideous. I can't believe that would in any way pass a code review. — Jared Smith 36 secs ago
 
well, they don't have to be garbage collected so I guess they vanish as soon as you don't need them anymore
 
I'm not saying it would be a big issue but if you can have equally clear code and one of them has less allocations, I see no point in going for the one that has more
 
Monking
 
> Revival × 9
Necromancer × 3
;)
 
Hello @Vogel612
@EBrown Can you show me your list of zombies :?
 
5:30 PM
I don't have any.
 
Oh well nvm than
 
I have three questions without accepted answers, if you want to answer any of them.
But one is over a month old (almost 2) and I'll probably accept the answer on it here shortly.
@denis This this and this.
They're also three different languages, humorously enough.
 
@denis you can search for candidates [c#] closed:no hasaccepted:no
 
One of them I selfie-answered, since it was probably going to become a zombie.
 
C# only :/ luckily there is one but I haven't worked with wpf all that much I can take a look tho.
 
5:36 PM
I just answered a zombie without a single line of code: codereview.stackexchange.com/a/151274/34073
 
is it even legal? :P
 
@t3chb0t you can even restrict by things like score:2 answers:0
 
yup, I have the search parameters link bookmarked
 
@t3chb0t It is but the opposite is not, or at least it usually is not well received..
 
@denis It depends, there are many answers on this site without a line of code. A lot of times saying something about the algorithm itself in human-form is as valuable (or better) than writing code. You can also write an entire review here without putting a single bit of code in it by describing the general issues and how to fix them.
 
5:42 PM
@denis sorry, I'm afraid I don't follow you - OutOfThreadsException
ok, I'm back
it was about whether it's legal
 
@EBrown I mean that answer that consists only of pure code is not well received.
 
@denis Ah, yes. In the case that an answer is only code it's pretty much unfit here.
 
@denis yea, but that has reasons deep within the philosophy of the site
 
And that boosts me to 60/80 and 340/400 for a silver .
 
5:50 PM
there is probably no search option like didn't answer it mayself?
 
3
Q: Do Americans swap wives because Americans eat pigs?

DavePhDAccording to Dr. Zakir Naik, as reported in the Los Angles Times: Americans engage in wife swapping because they eat pigs, which also swap sexual partners Also, according to The Comprehensive Guide For Da'wah In Mosques (Masjids) as well as Answers To Non Muslims Common Questions About Isla...

What a stupid question.
 
Do they?
 
mhmm, this isn't serious? is it?
 
I've not even heard of that in first-world countries until now, so I'd say no.
 
heard of what?
 
5:54 PM
Do Americans swap pigs because Americans eat wives?
 
Wife swapping.
 
Pigeating, wifeswapping or the causality?
Wife swapping is totally a thing though
causality is bs, the other two occur
 
Do pigs eat Americans because Americans swap wives?
 
I'd heard of it in Inuit culture, but that's it.
Anyway, I meant it was stupid because of the causality question.
Just as a reminder, correlation != causality.
 
Btw anyone used Beautiful soup?
 
5:56 PM
1
Q: Simple C++ alternative to exceptions for embedded systems

Shmuel H.I have researched ways to implement a simpler alternative for C++ exceptions. The problem I had with exceptions was the complex and not-portable stack unwinding process which make him hard to implement for a multiple systems. However, the alternatives didn't look clean enough to indicate about a...

0
Q: Simple Caesar Cipher C++

IdempotenceI was surprised to learn that there are not many C++ Caesar ciphers on Code Review (3 others as of this question). And none that work in this fashion. Here's the code: // Caesar cipher #include <iostream> char chars[] = {"abcdefghijklmnopqrstuvwxyz"}; // Find position in array int findPositi...

 
@JaredSmith I'm sure this hideous code would pass code reviews where it was written. this [types.ADD_RECIPE] smells like a committee designed factories and type hierarchies... — Denys Séguret 14 secs ago
 
Trying to scrape a website for some simple phrases. I know the basics of regular expressions, but not enough of html to figure out the details.
 
00:00 - 18:0018:00 - 00:00

« first day (1336 days earlier)      last day (2664 days later) »