« first day (1607 days earlier)      last day (2708 days later) » 

02:39
0
Q: Performance concerns for synchronous action methods

SinjaiI have an ASP.NET MVC 5 application using Entity Framework with SQL Server 2016. The application is mainly basic CRUD. The boilerplate generated when creating the project in Visual Studio did not have any asynchronous action methods, so I've left it alone for now. But at this point I can't figure...

03:36
0
Q: On right click draw triangle to the canvas

Phill This is a simple program that using easelJS adds functionality to the right click, when the right mouse button is clicked a triangle is drawn to the screen. I am just wanting to get the opinions of others on my coding style and how it could be improved. body{ margin: 0; background-co...

04:22
0
Q: defining class for maintaining hierarchy in interface

liv2hakI have the following interface. This is not well defined in the sense that I have flattened it. Ideally EntityIdSite and EntityIdApplication should be bundled together in a class so as to preserve hierarchy Same goes for ETypeCountry , ETypeCategory and ETypeSubCategory I move Site and Applica...

Monking
05:00
0
Q: Axiomatic Lisp interpreter in C

luser droogThis is not obfuscated. Or at least, that's not the intent. Let me try to address that concern straightaway. The goal here is brevity in the vein of Strunk&White. Nor is this codegolf, although inspiration and techniques derived from that source have contributed greatly to the current state of th...

05:38
0
Q: Word Squares Generator

m0meniI've solved the Word Squares problem: Given a set of words (without duplicates), find all word squares you can build from them. A sequence of words forms a valid word square if the kth row and column read the exact same string, where 0 ≤ k < max(numRows, numColumns). For example, th...

 
2 hours later…
07:18
0
Q: Hackerrank Abbreviation

jstrajI am trying to solve this problem from Hackerrank. There are 2 cases to be exact: Case 1: if a[i] == b[j](case-insensitive) Case 1a: if a[i].isUpper() then dp[i+1][j+1] = dp[i][j] Case 1b: if a[i].isLower() then dp[i+1][j+1] = dp[i][j] or dp[i][j+1] Case 2: if a[i] != b[j](case-inse...

07:33
0
Q: Improved QML Settings

OrientQt.labs.settings 1.0 module from QtDeclarative (depricated) allows to use QSettings to make some of QML properties persistent. It is quite outdated and inconvenient. E.g. to get access to value x in group a and to value y in subgroup b of group a one need to specify full path in second case: Set...

08:12
0
Q: MVVM Calling command by name from CommandBindings

Aram KocharyanFor example I have this property in my ViewModel. public IStorageFolder CurrentFolder { get { return _currentFolder; } set { Set(ref _currentFolder, value); CommandBindings[nameof(NavigateCommand)].Execute(Model); } } private IStorageFolder _curre...

08:28
0
Q: Message Save and Search REST server

Hassan HabbakThis is an assignment presented to me. I don't have much experience building servers in python so any comments would help me improve. The point of the server is to save and retrieve messages in a memory expensive environment. Those are the constraints presented to me: You don’t need to implement...

08:40
@202_accepted Marvellous :-)
@SimonForsberg It's actually a relic from doing HTML the old way, I didn't know it was considered a feature nowadays.
Kaz
Kaz
08:54
Monking @all
Monking
Monking
09:17
0
Q: Faster way to search a big (13 GB) Outlook PST file

HayatI have an Outlook PST file which is pretty big size (13 GB). For some indexing purpose I needed to scan through full PST file to get all the PR_SEARCH_KEY and then writing into a text file. This below recursive procedure is used to loop through all folder and sub-folder to get the PR_SEARCH_KEY f...

09:33
0
Q: CFUserNotificationDisplayAlert() not Showing Message Box

user149718I am Using CFUserNotificationDisplayAlert( 0, kCFUserNotificationPlainAlertLevel, NULL,NULL,NULL,"", cfsString, cfsStringOK,cfsStringCancel,NULL,&of); MAC OS X (Version 10.11.6) to display message box. My code compiled fine but CFUserNotificationDisplayAlert() Not showing any message Box. NOTE: I...

 
1 hour later…
10:43
Hello everyone
(Is monking the way to say morning here?)
5
Kaz
Kaz
@Moacir Yes ^^
30
A: What's a Zombie? And what are the many other memes of Code Review?

Vogel612Meme: Monking Originator: Morwenn Cultural Height: The 2nd Monitor Background: A morning greeting to the Monkey doing his monkey-business, in other words: monking Examples: A small chat search Variations: Monkernoon, Monkevening, Monknight, ... Important is only that it begins with Monk... ;...

1
Q: Desynonym [Angular] and [Angular.js]

PeilonrayzAs we should know from "“Angular” (Angular is not Angular.js)", Angular is not AngularJS - Angular is Angular2+. Wikipedia also says they're different things: Angular - "Angular (commonly referred to as "Angular 2+" or "Angular 2")"; and, AngularJS - "AngularJS (commonly referred to as "Angul...

Monking
Monking
I am reading about data types on vba, and on double it says its value range is:

-1.79769313486231570E+308 through -4.94065645841246544E-324 † for negative values;

4.94065645841246544E-324 through 1.79769313486231570E+308 † for positive values
Can I go from negative to positive with double or if I use it as negative I have to keep using it as negative
I can test this actually
Kaz
Kaz
@Moacir No, you can. It's just that it has a certain precision (~300 digits). So if you get really close to zero, it can't handle it.
10:49
@Kaz Oh, thats why sometimes excel go bonkers
It can be circumvented by using Round(DoubleValue,2)
Kaz
Kaz
@Moacir I hope not. If you're ever dealing with numbers with 300 decimal places, something's gone wrong somewhere.
@Moacir The excel going wrong stuff is usually your normal floating-point-arithmetic errors.
@Kaz Sometimes with formulas my excel do like "1-1" and the result is something like -3.4554e-50, when it is actually zero
So I got used to use the round function
Kaz
Kaz
@Moacir Yes, floating point arithmetic. Entirely unrelated to how many digits a double can hold.
But yes, judicious use of round() solves any problems.
Roger. Thanks
Kaz
Kaz
@Moacir IIRC, excel only stores calculations to 15 significant digits anyway.
10:59
@Kaz I just need 2, but it can float from positive to negative. The wording on double got me confused
@Moacir Excel isn't the only one with that problem. Many languages and environments don't handle it very well, since floating point arithmetic is a CPU problem.
@Kaz not quite entirely unrelated ...
the point is: the more precision you have in your floating-point type, the more exact you can represent arbitrary numbers...
that's why 1.9f - 0.9f most likely has a different result than 1.9d - 0.9d
11:21
TIL JavaScript has an exponent notation
@DanPantry lmao
1 * 1e-6 = 0.000001
You didn't know?
I didn't :(
Just found out when converting the output from process.hrtime() to millis
const NANOSECONDS_PER_SECOND = 1e9;
const endTime = process.hrtime(startTime);
const totalTimeInNanoseconds =
  endTime[0] * NANOSECONDS_PER_SECOND + endTime[1];
const totalTimeInMilliseconds = totalTimeInNanoseconds * 1e-6;
lol
11:39
@DanPantry Do you know if there's a way, in TypeScript, to make a wrapper have the same argument types as a wrapped function. So the type of fn is the same as wrap(fn)?
0
Q: Get typed results for examine indexer using Umbraco

H. PauwelynContinueing on this question on Stack Overflow Get typed document from an index using Umbraco 7.7, I've found a working solution. The case The case I'll create is that I've got a lot of persons and a knows person get 0, 1 or multiple languages. The language can get 0, 1 or multiple MVPs. Inside...

12:19
1
Q: What return type is more desirable for a HTTP request?

FredWhich return type is more desirable for a HTTP request? public async Task<bool> RemoveCar(string id) { var response = await _client.DeleteAsync("api/Car/", id); return response.IsSuccessStatusCode; } Or public async Task RemoveCar(string id) { va...

Hey @DanPantry, do you know anything about any of the JavaScript generators? (I'm speaking strictly non-JS -> JS, such as Fable, which is F# to JS, et. al.)
@Mast Glad I could help. ;)
@Moacir It's like "UGT" (Universal Greeting Time) - it's always 'monking' when you enter, and it's always 'monkeve' when you exit. ;)
It helps solve the "noise" problem when someone enters and says "good morning" and then several people respond "it's afternoon / evening here."
0
Q: Find value of salaries in given text

W WThe aim of the app is to find value of salaries in given text. The value can be written in many formats. Unit cases show what's going on: import org.junit.Test; import junit.framework.TestCase; public class SallaryFinderInTextTest extends TestCase{ @Test public void testGetSalaryFromT...

12:35
@Peilonrayz No, there isn't a way of doing that generically
@202_accepted Uh, not language->language stuff, no
I know of some languages that compile to JS
Alright, was just curious if you were familiar with any.
But I haven't used anything that compiles F# to JS for example
I know there's ClojureScript whichi compiles clojure to JS :D
I'm trying to gauge whether I should invest some time into learning something like Fable which does F# -> JS, because I suck hard at raw JS.
I would recommend languages that compile to js over raw JS if they have a good type system or are more expressive - F# Imo would be a good usecase here
Provided that it doesn't make it really hard to interop between 'raw' JS and f#
12:53
0
Q: Word Chain Solver

Carl Fujinami"Write a program that solves word-chain puzzles. There’s a type of puzzle where the challenge is to build a chain of words, starting with one particular word and ending with another. Successive entries in the chain must all be real words, and each can differ from the previous word by just one le...

@DanPantry I haven't yet looked at Fable, but I'm going to investigate further. From what I've seen of it there is very good support among the community. I appreciate your input. :)
NP :) I like JavaScript but a language like F# has a lot of features that JavaSCript doesn't have but would be really nice (Pattern matching and an expressive type system)
Kaz
Kaz
Goddammit, I had that number for almost 3 months:
Greetings, Programs.
@DanPantry I don't mind JavaScript, but when I'm working on the client side, I sure do miss some of the features of Scala that I enjoy on the server side.
13:09
0
Q: C++ program to compare two strings for equality and produce an output accordingly

GayatriI have just began to learn C++ and I am new to programming. I wanted to write a code for comparing a string input from user to a string that we pre define. I am not getting the output as "Equal strings" even if I enter the same string. Kindly help me figure out the mistake in my code: void main(...

@Kaz Your digits are coloured the same as the badge? Mine aren't.
Kaz
Kaz
@Mast I think it's part of the theme.
It also highlights any URLs that contain the words "rebecca black" on a friday ^^
Welcome to 2017! We don't have flying cars yet, but we do have URL checkers...
I'm pretty sure that URL checkers are child's play compared to flying cars.
3
@Donald.McLean Yup. But you didn't see URL checkers in sci-fi decades ago. Flying cars on the other hand.
Nvm.
13:23
I think the largest problem is that, without anti-gravity, the wings become a real sticking point.
13:36
Definitely. We can fold a lot of lightweight, very strong stuff nowadays though.
0
Q: Counting collisions in Hash Table

ElectricI have a Hash Table class and I'm trying to count the number of collisions that occurs in the process. from referential_array import build_array #importing an array, just like an ordinary array in python class LinearProbeHash: def __init__(self, size = 7): self.count = 0 self.table_...

-2
Q: Best coding practice for SQL Connection String Builder

TomFor a while now I have been using string builders in my code. However recently I have been getting warnings about making these "simplified". My question is kind of two parts Firstly what is the best practice for string buiders? Secondly what is the difference in the code? Is this more efficient...

0
Q: Dropdown menu in HTML/CSS

Chase BarnesI am trying to create a drop-down menu in HTML/CSS, but I am not getting anywhere. I am trying to display the content div ONLY when the 'Channel' button is being hovered on. I tried looking at w3schools, but it didn't help. .NavWrapper { background: grey; max-width: 5000px; min-width: 500...

Class modules are sorcery
@Kaz What I needed is finished. It is taking around a minute to do everything(it was around 60 mins) . I used what I learnt with the code on other parts of the code, added a class module thing and now everything is awesome
Welcome to Code Review :-)
@Mast I'll post the code later for history. Will need to obfuscate some things, so it may take a while
Anonimizing is allowed. Obfuscation is not.
13:50
I think I meant Anonimizing
English is not my first language
I dont want the code to be harder, I want the code to not reveal things from the company I work for
Of-course.
Obfuscation is when you make in such a way it gets harder to debug?
Harder to read.
Yea, not what I meant at all
haha
Before posting the code, is it good practice to add comments to the code?
Stop modifying your code explicitly for this site. The more you do it, the less benefit you'll get from a review.
8
13:58
0
Q: "" or string.Empty?

FredWhich is preferred? if (foo == "") or if (foo == string.Empty) I know that string.Empty actually is "".

@CaptainObvious Pseudocode.
@Moacir Do you want your code to have comments? Does it need them? If so, put them in regardless of posting the code here.
Got it
Then I shall post the way it is
14:13
0
Q: Should we change all private variables to var in C#?

sinoResharper is keep asking to change all variables to var , but I really think code is getting unreadable, I prefer only to use var when the other side is either anonymous or clearly known what is its type.But other peers keep pressuring to use var just as Resharper recommend. What do you think gu...

0
Q: Read data from Google Sheets API and populate a class

MaximeI have data stored in a Google Sheet. The aim of this program controller is to read this data from an MVC controller, and populate a class (Model) with it. I will skip most of the intermediate functions, to keep the focus on the Google API connection. My main concern is with the connection, an...

14:26
They always try to explain that they're called 'solar physicists', but the reporters interrupt with "NEVER MIND THAT, TELL US WHAT'S WRONG WITH THE SUN!"
3
0
Q: Optimize user control

LightGreenI have a calendar view that is slow in uploading. The part that slows down the calendarview should be in the CalendarPageViewModel.cs. But I do not know how to improve it because it's a loop for. Whole project Calendar View. CalendarPicker.xaml: <UserControl x:Class="CalendarView.CalendarPicke...

15:09
0
Q: Python - Time.Sleep(1) never ending - Poor structure issue?

WeInThisI have been recommended here from stackoverflow so I will basically just copy paste. So I have been playing around with schedule and finally got it to work. I was too excited to realize that there came ANOTHER problem haha. However, the issue is now that it doesn't end whenever the main is finis...

<div class="radio">
    <label>
        <input name="foo" type="radio" value="0" checked /> Foo
    </label>
    <br />
    <label>
        <input name="foo" type="radio" value="1" /> Bar
    </label>
    <br />
</div>
Does anyone know why that doesn't set Foo to checked?
@Hosch250 Try checked="checked", that's the only thought I have.
OK, but the official ruling is that you just need checked.
Though it should work as currently defined.
Also, it does work if I remove the name attribute..
15:17
Is there another radio button checked that has the same name?
Except it doesn't work as exclusive radio buttons then.
Ah shoot. That'll be it.
I have two widgets on the same bloody page.
Aha. ;)
Crap.
And this is part of a form, so the name matters...
Looks like you'll have to find a way to adjust the name. :(
Looks like I'm stuck with KO.JS.
Trying to redo a UI in ASP.NET MVC.
15:43
0
Q: Looping through with varied subtotal ranges

AnoplexianI've got an issue where my looping through the rows on my sheet are extremely slow. For 20,000 rows, it takes about 20 minutes, whereas before, it was taking 3. The only pieces I added were at the very bottom, starting with the for l = 2 to lastLet and ending at the bottom of the code. When ...

@Hosch250 KnockOut JavaScript? If only somebody would've done that years ago.
16:05
M nk ng
@Hosch250 what's up with the weird label placement?
there's <label for="foo">Foo</label> for a reason ...
@Vogel612 Bootstrap expects <label><input /></label>.
that seems terrible...
16:35
No, BS doesn't expect it, AFAIK, but they are both proper styles.
This one gets the best display for checkboxes and radio buttons; I usually use the other.
16:54
1
Q: Dry Rails Model Methods That return boolean

DogEatDogI'm trying to dry up this rails post model: class Post < ActiveRecord::Base extend FriendlyId friendly_id :title, use: [:slugged, :finders] validates_presence_of :title scope :published, -> { where('hidden = ? AND published_at IS NOT NULL AND published_at < ?', false, DateTime.now).order...

17:33
-1
Q: Simple Chat room full code

JustAGustI've tried to implement what has been suggested in the following link: previous question, I've found it not so useful because every change in theMessage.MessageTypeenum forces me to make changes in two other classes -ClientModel.ServerListenerand ServerModel handleMessage function and I wish to ...

17:52
0
Q: Finding all plurals in an array of Strings

cody.codesLooking for feedback on this here code. Is readability an issue? Is it good to mess with all these data types in Java (e.g. strings and Chars and using .equals() and != to compare data from different datatypes), or is there an easier way to do it? And in general, how can I improve this code? ...

OK.
Doesn't matter, anyway.
Monking.
@Vogel612 It's still valid.
@202_accepted Languages that only compile to JavaScript like TypeScript, CoffeeScript and PureScript don't count, right?
18:18
@Zeta Correct.
@Hosch250 Nah, I just thought I'd remembered seeing Bootstrap always setting them up like that. Either way, duplicate name values will definitely mess with automatic checking. :)
@202_accepted Hm. There's GHCJS to compile Haskell to JS, but I haven't tried it (yet). Emscripten can -- in theory -- compile any LLVM code to JS, as long as the C/C++ code was portable (no idea about other languages that compile to LLVM).
0
Q: Android: Dagger 2, a singleton & RxJava

milosmnsI have a complicated Dagger 2 use case on Android, where I have a lot of dependencies, but some of them are really slow to construct. Like 2-3 seconds slow. My solution was to create an rx Observable that will be provided through Dagger's injection mechanism to other components, instead of wait...

0
Q: Prims algorithm MST implementation using priority queue and heap

JojoI am a beginner in python and working on Prims algorithm using priority queue . I am getting the final MST cost . But I also want to print the consequent edges as well in sorted order as below sample output . Can you please suggest . Code : import heapq from collections import defaultdict g = d...

@Zeta of course there was a haskell to js compiler :/
@Vogel612 There are at least three, although JMacro might not count. And there are some EDSL that generate JS in Haskell.
Shakespear comes to mind. And Servant can generate functions for some frameworks for the web api.
It still feels weird to go to chat by clicking in the upper-right.
18:37
Huh?
-1
Q: Cookie Calories

savannaA bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag, and that a serving equals 300 calories. Write a program that lets the user enter the number of cookies he or she actually ate, then reports the number of total calories consumed.

0
Q: Area under curve and its volume as solid of revolution

GabrielI would like to know if there is some more "elegant" way to write these 3 functions. Any tip or idea is welcome. open System module Calculus = let area f a b = let dx = 0.001 seq { for x in a .. dx .. b -> (f x) * dx } |> Seq.sum let rotate f x = let y =...

50
Q: New top bar is coming to the Stack Exchange network

Joe Friend Updated timeline: Done changes rolled out on meta.se and to Mods on all sites on Monday (9/18) Assuming no significant issues are discovered we will roll out to all sites within the next couple weeks I'm the new product manager for the DAG team. I’m excited to announce that the...

@skiwi that new design crap ^^
It's weird if you visit both CR and SO.
which I do.
80 reputation from 10k on SO!
18:43
@SimonForsberg Post something so I shall downvote it >:D
@Moacir I have already posted quite a lot if you check my profile
@SimonForsberg Oh, I just have the chat tabs permanently open..
@skiwi Name one tab you don't have permanently open?
@SimonForsberg www.google.com
wanna take a look at this? codereview.stackexchange.com/questions/176527/… Im looking for the best way to write this in my environment — David Brierton 58 secs ago
19:01
@skiwi Are you sure you don't have it open in some tab right now?
@SimonForsberg Not that sure
I see I'm over 1000 tabs again... I need to fix this
Probably at 200 at work as well already too
Yes, since the code is working and you need improvements on it codereview is a better place for this question. — v.coder 35 secs ago
19:16
0
Q: python exception handling on a long process - how to standardize

M LeonardI have a long running process that involves a chain of api calls - some in functions, and some in-line operations. My goal is to make the exception handling both extremely robust, very thorough, but also very general so there isn't a lot of duplicate code (I know... Pick 2 :-) ). Here is an exa...

19:33
1
Q: JavaScript - Given a list of integers, return the first two values that adds up to form sum. sum = x + y

Hima ChhagThe following function sum_pairs takes two arguments one array and another number, It should return the first two values (parse from the left please) in order of appearance that adds up to form the sum. Negative numbers and duplicate numbers can and appear. For example sum_pairs([10, 5, 2, 3, 7...

0
Q: Why isn't this Misere Tic-Tac-Toe program working?

ducksAreCuteI have this code: import os from time import sleep from random import randint def amend(listTo, positionTo, newValue): listTo.pop(positionTo) listTo.insert(positionTo, newValue) x = "X" o = "O" bs = " " def printBoard(places): print("_", places[0] ,"_|_", places[1] ,"_|_", places[2]...

1
Q: The method tries to get the return types of the run time methods

user8155065The method tries to get the return types of the run time methods. public boolean scopeInfoString(List> annotatedClasses) { boolean isPassed = true; for (Class<?> clazz : annotatedClasses) { if (clazz.isAnnotationPresent(EnterpriseService.class)) { ...

19:57
If this code works fine, then this question is off topic on Stack Overflow, but may be good for our sister site Code Review. — Joe C 6 secs ago
20:38
0
Q: Pathfinding program gets occasional error

user8623827I'm confused as to why I get this error (quoted below code) about every 1 in 10 runs. What am I missing? import random board=[] #everything gets set off the width/height width=15 height=30 a_y=height//height a_x=width//width b_x=width-2 b_y=height-2 board=[[] for _ in range(height)] for...

0
Q: my first medium advanced javascript code for imageSlider

Dacid K.I would like to kindly ask you guys to check my javascript code telling me what I did wrong, what I should improve, etc. (() => { const mainSliderItems = document.querySelectorAll(".main-slider .main-slider__item"), thumbnailsInner = document.querySelector(".main-thumbnails__inner"), ...

21:15
0
Q: Combining ADD and VOLUME on a nodejs Dockerfile

Justin DearingI have a node project. My scripts section of package.json looks like this: "scripts": { "postinstall": "gulp", "start": "node index.js", "test": "node ./node_modules/mocha/bin/mocha test" }, My Dockerfile looks like this FROM node:6.11-alpine RUN mkdir -p /code ADD . /code WORKDIR /cod...

21:49
0
Q: Translating sentences with an API wrapper

Lukasz SalitraI've written a wrapper for this handy Yandex Translate API. I am pretty happy with is as it works just fine and the translations are accurate, even translations of entire sentences. However, I am curious if there is a better way to put the wrapper together, what would you do differently and what ...

22:03
1
Q: Posts that probably need editing

GaoI wrote this Data Explorer query (reproduced below) some time ago that helped identify posts containing potential spelling/punctuation errors and earned me a Copy Editor badge on Anime.SE. SELECT DISTINCT PostTypes.Name AS [Post Type], Posts.Score AS [Post Score], ...

22:30
This question would likely be a lot better received on Code Reviewscohe001 6 secs ago
0
Q: Connect 4 School Assignment. Not sure where to call on win checking method

EmankSo I'm supposed to make a Connect 4 game that two humans can play. I did most of it, but I don't really know where to call on the checkWin method. My code is as follows: package arraysex4; import java.util.Scanner; public class ArraysEx4 { public static void main(String[] arg...

0
Q: SE main site tag ratings based on Wilson score confidence interval

GaoAfter reading this illuminating article, I decided to put the concepts described therein to use on rating SE main site tags, and this is the result. DECLARE @SQLString nvarchar(MAX); DECLARE @SQLSubStringQ nvarchar(2000); DECLARE @SQLSubStringA nvarchar(2000); DECLARE @positive nvarchar(100) = '...

22:59
0
Q: Advice on view implementation (MVC structured minigame in python)

antoine-sacContext: I am programming a small game as a side project to get to know python. I just completed a textual version. I now want to interface my code with a web page. I am roughly following a MVC structure: Controller class controls the flow of the game. Controllers must implement a start() met...

23:16
-1
Q: Rock Paper Scissors without if statements

Jack BonesI want to return a boolean from rock paper scissors like player 2 wins it is True. But how am i gonna make python understand that paper beats rock etc.

23:41
If you're not looking for an answer, perhaps it's better to post this to the Code Review StackExchange: codereview.stackexchange.comConrad Parker 1 min ago

« first day (1607 days earlier)      last day (2708 days later) »