« first day (1496 days earlier)      last day (2817 days later) » 

00:00
RELOAD! There are 3951 unanswered questions (91.1749% answered)
0
Q: Karatsuba Algorithm in Python

Zaid HumayunI implemented a Karatsuba algorithm in Python but it doesn't give me the exact answer. def karatsuba(x, y): if x < 10 or y < 10: return x*y #making the two numbers strings here str_x = str(x) str_y = str(y) #finding the mid point for each number here n = max(le...

00:14
-2
Q: Anagram in C# Solution, what's the best solution in terms of O(n)?

dotNet DecoderAs per WIKI An anagram is direct word switch or word play, the result of rearranging the letters of a word or phrase to produce a new word or phrase, using all the original letters exactly once; for example, the word anagram can be rearranged into "nag a ram".

 
2 hours later…
01:55
0
Q: Speeding up maximum self-similarity test for heavy tail-exponents

mikeyI am trying to reproduce results from a research paper using python. I've checked my method and it works on relatively small sample datasets. However, the code does not run for my actual dataset, which is initially ~11,000 data points and becomes ~40,000 data points after padding zeroes. The algo...

Hey, guess what?
I got permission yesterday to rewrite some really awful code.
A whole section of it. And fix the UI while I'm at it.
The nice thing about my job is I don't need permission to rewrite that stuff, so long as I have time (which I never do).
Heh, this is considered 3rd priority, but I'm just going to stop asking for more work until it is done.
02:09
After I get far enough, I'm hoping it will get promoted to high priority.
02:29
0
Q: Implementation of a Fraction class in Java

Ishan DaveI am writing a bunch of Math related classes:BigInteger,Fraction,matrix,vector,polynomial,set etc.All of these classes will use each other.The classes will either work in decimal format or in Rational format at a time(eg as FractionalMatrix and DecimalMatrix) so I thought it will be best to imple...

03:07
This question was asked here codereview.stackexchange.com/questions/165064/… but I was told that codereview is not the right place for these kind of questions. — rdp 53 secs ago
03:50
0
Q: update state to render data in a form

milanI have a form which needs to display value in its input field initially. There is no post api used, only get and put. I could show the data initially by updating the state from componentWillReceiveProps lifecycle method. What is an efficient way to show the data in form field? Here is what i have...

 
1 hour later…
05:00
0
Q: check repeated digits of each row in an two dimensional array

Muhammed Basith PKi have a two dimensional array lets say int[][] arr=new int[9][9] ,or a 2/3 array. The question is i want to check each row of the array for knowing ,does it have any repeated elements in that row?

05:55
0
Q: (Tumblr Theme) Vertical Dropdown Menu With Submenus

Michelle SmithI created a vertical dropdown menu with submenus for my custom Tumblr theme. The menu is below a sidebar on the right side. I was wondering if someone could look over the code for me. I can't tell If there are errors in the code or not. I'm not a coding expert. I did get this code from a tutori...

-1
Q: Connecting to JIRA from a C# .NET app via Atlassian.Jira nuget package

PonniI'm trying to access my JIRA issues via a C# console application. I downloaded the Atlassian.Jira from nuget for this. I'm pretty new to this. The code runs fine, without any issues. However, it doesn't return any valid data, i.e, I'm not able to connect to JIRA. I used this link as reference. ht...

1
Q: Shorten a jQuery multiple if statements

claudioshaving a hard time to achieve what I'm looking for. I was thinking of using arrays but don't know where to start. Code below is what I want to shorten to get rid of multiple if statement using jQuery. $("input#communication").on("slide", function(slideEvt) { if(slideEvt.value == 1) { ...

06:13
Call me boring if you wish, but I'd just put DON'T CALL THIS FROM AN INIT METHOD in the docs, and do a bit of code review on the init methods if anyone else was involved in the dev work. Nice and straightfoward, no magic needed. — Rook 14 secs ago
06:51
0
Q: How to changes time zone in mysql query?

Madhanmysql select query returns UTC Time $a = mysql_fetch_array(mysql_query("select concat(now(),'%') AS date")); but we change it in php using date_default_timezone_set('Asia/Kolkata'); echo date('d-m-Y H:i'); this returns correct date in php but not working in mysql

0
Q: Integrate to infinity

iknownothing[ Say I have a plot as shown in the figure for which I want to find the following $$I = \int_0^\infty C(t) dt$$ This graph can be fitted with multi-exponential functions. I know that the idea would be to integrate that fitted function to infinity instead. (I am sure there are smarter ways too!...

@SimonForsberg And Battleship, yea. Ordinarily, I think of a game either as state machine (which gets needlessly complicated pretty fast) or a bunch of objects. A Game, a Field (or 2, or 9), Subfields, Players, etc. With an approach like that, OO is the way. But if you approach it completely different, I guess FP can be just as appropriate. It's all about how you originally model it I think.
"N.B. Any programing language is fine." Nonononono. Please read the help center. We review code, not general approaches in settings where the language doesn't matter. And the current amount of code you provided is not enough to start a review on IMO. — Mast 9 secs ago
0
Q: Call webapi then parse part of json result

user140692this is a basic web api using HttpClient and parse some part of the result, this was working as expected, but the part inside the if (response.IsSuccessStatusCode) doesnt seems right. It feels like it can be simplified, but I don't know how. static async Task<List<Hero>> GetHero(string url, stri...

07:20
possible answer invalidation by Deuce on question by Deuce: codereview.stackexchange.com/posts/165101/revisions
0
Q: Web Scraping to extract data

Renu SharmaI am new to python and trying to fetch data from a website having multiple pages. My code is import requests from bs4 import BeautifulSoup for i in range(20): url = "http://www.realcommercial.com.au/sold/property-offices-retail-showrooms+bulky+goods-land+development-hotel+leisure-medical+co...

-1
Q: How to use two different order by in sql?

MadhanHow can i do like this ORDER BY A.pro_id DESC, S.siz_order ASC normally it works only 1st not working 2nd order

@Mast Can't you use both at the same time? Both a state machine and "a bunch of objects"?
08:13
Questions for working code could go to codereview.stackexchange.com — GhostCat just now
08:33
You can also refer to thisRajesh 34 secs ago
0
Q: Web token implementation in Golang

TravisI am new to Go and the web token / JTW concept. In order to learn Go and learn about web tokens, I am making my own implementation in Go (never to be used, of course). If a user gets authenticated (assume that part is secure), I generate a web token, [payload].[signature]. The payload has the us...

0
Q: Finding the n th term in Fibonacci series

CMouseSolving a problem in coding contest I came across a problem, which on digging a bit lead me to the data set in this question . Since the program to enumerate and finding the solution was too complex and execution time was below par I jot down the logic to the equation of curve (a single line) Up...

0
Q: Web scraping for Multiple Pages on a Site

Renu sharmaimport requests from bs4 import BeautifulSoup for i in range(20): url = "http://www.realcommercial.com.au/sold/property-offices-retail-showrooms+bulky+goods-land+development-hotel+leisure-medical+consulting-other-in-vic/list-{}?includePropertiesWithin=includesurrounding&activeSort=list-date&a...

Monking
08:58
Hi @Sen123 I believe, you should post the question in LINKSudipta Mondal 34 secs ago
09:08
0
Q: Plot timings for a range of inputs

GraipherWhen writing Code Review answers, it becomes often necessary to measure how long the modified code takes vs how long the OP's code takes. I needed a nice way to visualize this as a function of the input, so I cobbled together the following script. The plot_time function takes a single function (...

possible answer invalidation by yoshiMannaert on question by yoshiMannaert: codereview.stackexchange.com/posts/165145/revisions
0
Q: Execution took too long

SavanI'm solving Foobar challenege .My code runs perfectly in eclipse but when i verify it on foobar it says Execution took too long . The question is - You have maps of parts of the space station, each starting at a prison exit and ending at the door to an escape pod. The map is represented as ...

10:10
I think this is better in codereview.stackexchange.comSwellar 58 secs ago
@Swellar I don't really want to code reviewed. I already know it doesn't do what I want—in fact I don't even understand it. — Álvaro González 19 secs ago
0
Q: Test Case failed

SavanI'm solving this foobar challenege the code works absolutely fine.But when i verif code on foobar terminal 2 test cases fails out of 5 . I'm not able to understand what is going wrong. The question is - You have maps of parts of the space station, each starting at a prison exit and ending at the...

Well, it is 70k rows, and you are using quite a complex query, so I think the speed is understandable in a way. Since this is a working code and you want optimization, try asking in codereview.stackexchange.com/tagsSwellar 49 secs ago
10:48
0
Q: Less CSS Mixin for positioning with options for corresponding top, left, right, bottom values

lampshadeI've created a Mixin in Less CSS. It can do the following things: Set the position-rule of an element. Place the element in one of the corners (e.g. top left, bottom right etc.) Alternatively it can set explicit values for top|right|bottom|left. Usage example: .test-1 { .position(absolut...

11:11
I'm looking for review of design and not codereview. — Naruto Uzumaki 56 secs ago
0
Q: Scraper for parsing json data using vba

SMth80I've created a scraper using vba which is able to parse json response. When I was thinking of using scripting dictionary or json converter to scrape json data I could notice that applying split function on responsetext is fairly easy to get the expected outcome. It is working great now. I've writ...

0
Q: Prevent class redundancy

Richard KeilI'm currently developing a XML converter for a model of my app in PHP. Therefore I'm using a Pipeline Pattern, which passes a "payload-document" through each pipe and appends different information of the model to it. This works well. My Problem I need to create a second XML file, which looks si...

0
Q: Waits for a static value to appear

Andre BorgesIn my program I need to monitor the state of a static string value that can be changed from different threads in different parts of the system. I came up with the following simple function that, once called, waits 5 seconds to get the value, and if the value is not set, returns null: // Waits 5 ...

For working code, codereview.stackexchange.com might be a better place - after understanding the policies of that site. NOBODY will just jump and do you work, just because you drop some code and tell people: "and this is what i need" — GhostCat 1 min ago
11:52
0
Q: Speed up search/replace in VBA Word

SimonI have a word document with 450 pages (and growing) in witch I make a search and replace (linking referencies) after inserting new text. Unfortunately this procedure is very slow. Have you any suggestions to speed up this search/replace-function? Eg. by defining the range for the funtion to only...

12:05
This belongs more on codereview. As an idea: The functions do the same if weights are all 1. You can probably find a way to make that happen. — nwp 59 secs ago
I'm voting to close this question as off-topic because it belongs to Code Reviewgsamaras 18 secs ago
12:23
-1
Q: A FASM Program on division

monicahA FASM Program that prompts a user to enter 2 values,x and y divides them then displays a quotient and a reminder.I am so much a beginner in assembly programming and have no idea on where to begin .kindly include comments in the program.

@SimonForsberg Stateful objects, yes.
I got a couple of cookbooks at home with examples of those, but basically, a traffic light. That's a situation where you'd use stateful objects IMO.
1
Q: Move on element before another in an associated array

Giel BerkersI have this task where I have an associated array in PHP and I want to manipulate the order of entries. Basically I want to be able to move entry Y before entry X. So basically if I have the following array: ['foo1' => 'bar', 'foo2' => 'buzz', 'foo3' => 'bazz'] I want to be able to say: 'put ...

13:17
Greetings, Programs.
13:35
0
Q: Rewrite code into class with variable number of parameters

EinherjarI have the following code, which I would like to rewrite into a class. Reason being, I would like to reuse the code in the future, but would like to avoid copy-pasting the whole code and just changing the input method. private void SQLSearch() { string sqlCommand = ConfigurationManag...

13:49
0
Q: how to make R code faster

user140726I want to change this R function in order to make my code faster because it was terribly slow and parallel computing did not save the issue and i did not found the right solution. fi=function(data,s,dcp,...){ data1=list() for(k in 1:3){ data1[[k]]=subset(data,p==k) if(nrow(data1[[k]]) != 0){ d...

14:04
Question about codereview (improve working code) should be ask at codereview.stackexchange.comJens 57 secs ago
Maybe fits better in codereview. But one suggestion, ask user if they want to input metric or imperial. Then the output should be the same for imp/metric since it is a quota — Viktor Mellgren 40 secs ago
I'm voting to close this question as off-topic because it should be on Code Review — theblindprophet 35 secs ago
possible answer invalidation by user7875185 on question by user7875185: codereview.stackexchange.com/posts/165189/revisions
14:24
1
Q: What design pattern can I use in this script for getting RSS feeds and tweet new content in Python?

marcanuyI've build an app to tweet new content from RSS feeds to Twitter. Currently its entry point handles the two commands available, one for download new posts and other to publish them in main.py: @contextmanager def session_scope(account): """Provide a transactional scope around a series of op...

0
Q: Padded Version.ToString() extension

TobyI want to convert a Version to a string, but with the parts padded to a given width. E.g. 0.22.1 with parts padded to a width of '2' when converted to string would be "00.22.01" A simple task, simple enough that I'm surprised it's not part of the class already. I'm not that used to .Net and it's...

14:38
0
Q: Simple PUG system using Laravel and Vue.js

ToNySome time ago I made simple pick up game system using Laravel along with Vuejs. I wonder if my code is proper and clean. https://github.com/ImJustToNy/OverPugs Thanks for any comments!

0
Q: Snake Game Refactor in c++

AlaminutI have a c# background and mostly worked on Web Applications. Recently I wanted to learn c++. I read many online resources and inspect 10s of source code shared on Stack Overflow / Code Review or from C++ forums. During my research I've come accross this post: Snake game in C++ and based on answ...

0
Q: Creating many aspx pages

RockStarI just want to ask if its okay to create many aspx pages. What i did was, i made a guitar store website that has 6 brands and each of them have their own webpage. The code is like this: The aspx.cs code public partial class Pages_GuitarItems1 : System.Web.UI.Page { public List<guitarItem> guita...

Also thank you for referring me to Code Review, I'll try to get some help there as well. — Zhivko93 just now
15:00
0
Q: C++ the right container for a multi-threading environments

MangoI am wondering if using a std::map or std::list could lead to false sharing issues in a multithreaded environment, if one is processing things like integers which won't fill an entire cache line. As far as I know, this could only become a problem with variables which are smaller than a 64 bit in...

0
Q: Good appoach for custom QT widgets?

Joshua StrotI have a widget like below:: class MainWidget(QWidget): #This is grabbed by another function for the name of the page name = "First Page" def __init__(self, parent, sidebarWidget, customModulesLen): QWidget.__init__(self, parent=parent) self.customModulesLen = custom...

15:19
@CaptainObvious OT?
15:34
This question might find more traction at CodeReviewAndyG 19 secs ago
16:00
-1
Q: Using a Kalman filter to predict samples between measurements

antiI have a dataset where measurements were taken at 10 Hz, and I am trying to use a Kalman filter to add predicted samples in between the measurements, so that my output is at 100 Hz. I have it working ok when the velocity is linear, but when the direction changes, the filter takes a while to catch...

Monking
16:27
@Duga No, that's ok.
@MiguelAlberolaCano Do you have working code that you want to improve, for code-style? I think that's off topic, but you might want to consider codereview.stackexchange.comArtyer 48 secs ago
0
Q: r - reporting and explaining odds ratio with caret glmnet

ProjskiI have this code using the caret and glmnet library, and at the end I'm producing a data frame to export that includes importance, coefficient, and odds ratio. The problem is that I'm not sure the odds ratio is correct or meaningful. How would I explain the odds ratio to someone in plain english ...

@Zeta Yes, that is OT.
17:28
Does anyone here have a QHD or a 4K screen and can tell me what the use of it is?
I've got a QHD screen now at work, which is cool, it being bigger is definitely nice, but I just put scaling to 125%... so what's the point of the extra pixels then?
@skiwi if you do that, there's not much point... And is why I ignored the 4K craze and got a UW-UXGA
With 100% scaling I can barely read it, too much eye strain
Upgrade from 24 to 27 inch is still nice though
@skiwi we have big 4k screens for conference rooms, as they were cheaper than high quality projectors
my desktop has 4 1980x1200 monitors, though
@skiwi Without scaling the extra screen real estate is awesome.
17:40
they're great for demonstrating how comedically bad most applications are at high DPI scaling, too :)
@SimonForsberg Of-course you can, I just can't think of a good example explaining when that would be a good idea :-)
There are probably complicated scenario's out there where it's the appropriate method, sure.
@DanLyons I'm hating Windows again
But usually I'd stick with one approach as much as possible.
IIS Manager doesn't scale, and when I find the exe there's no Compatibility tab... Also the Eventviewer has the same no scaling issue
which version of windows?
17:43
Windows 10 Creators Update
that's a little surprising - I would have expected at least in 10 that most stuff would scale properly
You'd wish...
Hmpf, trying to buy something from amazon.co.uk from The Netherlands but it doesn't even accept Paypal, so I need to use gift cards, but I cannot see the shipping cost before I enter my gift card code
@skiwi Amazon doesn't accept Paypal? Lmao.
I don't see the backwards logic of paying before you see the total
And Amazon seems to have literally the single piece of stock of the product that's left in whole Europe
Getting something from the USA isn't necessarily more expensive.
I got a wide-range DC converter from the USA only a couple weeks back. Unavailable for private parties in the Netherlands and my boss doesn't like it when I go shopping on his account with such amounts involved :-)
17:52
It's just above the customs amount I think though
@skiwi Which is?
@Mast Under 22 euro you don't pay anything, between 22 and 150 you pay VAT and above you also pay import costs
The catch is that shipping is also included in that amount
You always pay VAT IIRC, it's like BTW in The Netherlands.
I've never had trouble with customs up till 250.
If it's under 22 then customs doesn't care
Don't you pay VAT at the company itself already?
17:55
Yes, but customs doesn't care
Customs will also charge VAT over second-hand items
As this is working code, you may want to try posting to Code Review as well. — Edwin van Mierlo 1 min ago
18:18
@Dejell Don't assume there is always a reasonable one-liner for every loop. I find your original loop slightly clearer than the accepted oneliner (although I wouldn't object to it in a code review). — chepner just now
2
Q: subreddit image bot

EpicNiceI wrote a bot in python 3 using PRAW, requests, and BeautifulSoup that downloads a specified amount of image posts from a specified subreddit. One limitation is that it can only parse the direct image link from imgur pages, but I am not too bent on figuring them out because the majority of image...

-1
Q: C++ "sidecast" std::unique_ptr between abstract base classes

OkroI have three classes, InterfaceA, InterfaceB, and C. C is derived from both InterfaceA and InterfaceB, which are abstract base classes. At one point I hold a std::unique_ptr<InterfaceA>, and at another point I want a std::unique_ptr<InterfaceB>. I also want the std::unique_ptr<InterfaceB> to ...

18:32
0
Q: Fraction type in Rust

Dan AmbrogioInspired by another question here on Code Review, I decided to try implementing a Fraction class in Rust. Requirements: Able to be added, subtracted, multiplied, divided Able to be compared (equality and ordering) Able to be converted to the floating point representation of the fraction When p...

18:48
-2
Q: Caching the results of an asynchronous function

TheNumberOneThis is similar to some code that I wrote to compute some stuff asynchronously and then cache the result. public interface IStuffProvider { Task<Stuff> GetStuff(); } public class StuffProvider : IStuffProvider { private Task<Stuff> _stuff; public Task<Stuff> GetStuff() { ...

19:05
I think this is more suited to codereview — juvian 8 secs ago
And what's your problem?If you want somebody to review your code go on codereview....If you want to ask on stack just post the part thats not working not your whole code :D — Arslan.H 18 secs ago
19:25
I call this "Mom-code", with all of those empty elses. "Go clean your room, or else!". It feels like the code is yelling at me. — TSar 16 mins ago
3
1
Q: String class in C++ and Heap

MontrealI was writing simple String class implementation (and it is quite ordinary), but I had found out that constructors, destructors and operator = are the most sensitive areas. So I wonder, if my implementation good in the sense of C++11/14 standard and are they efficient enough? String::String() { ...

Maybe more suited for code review? — FirstOne 14 secs ago
19:49
Why has nobody told me that Robert Miles passed away last month?
@200_success: Apologies for my naivete. I thought that Code Review would be a good spot following the guidance here, specifically that "Answers can suggest any improvement". I (incorrectly) assumed that OP thought that their code was working for most cases, but was looking for feedback on perhaps any edge cases where it would fail. — AndyG 40 secs ago
0
Q: Is there any benefit to to define constant local variables as static ( c++)?

T Mvoid Animation::playAnimation() const { static const int index = 0; const std::string& animationFileName = m_animationContainer.getAnimationName(index); static const int zOrder = -1; static bool isLooping = false; AnimationBank::play(animationFileName, ...

Ah okay - FYI if your code works fine, but you'd like to tweak to make it faster, I suggest asking in CodeReview. — BruceWayne 12 secs ago
20:20
Stack Overflow isn't really for "how do I optimize code" kinds of questions. Those are typically better suited to Code Review. But, as @PriyeshKumar has helpfully pointed out, it appears to have already been asked there. — Mike McCaughan 36 secs ago
0
Q: For Loop Faster Search

billy10101Sub DeleteRowsWithArray() Dim dontDelete() As Variant Dim actRange As range Set actRange = Sheets("Input").range("Account_Range") dontDelete = actRange Dim i As Long, j As Long Dim isThere As Boolean Sheets("FAR").Select For i = Cells(Rows.Count, "B").End(xlUp).Row To 3 Step -1 For j = ...

> Please ensure that the title states what your code does. If the code is a purely generic example that has no specific purpose, then the question would be off-topic for Code Review.
Oh boy, glad we got these new (poor) filters.
> \b(statements|loops|else|catch)\b
That's the regex they used? Dear god.
20:33
I guess titles with 'Automatically uploading bank statements' are no longer on-topic?
I was hoping they'd apply a machine learning model of sorts to figure out the intent... there are too many edge cases otherwise
1
Q: Pattern for writing a generic string transformation function

zett42I often need to write string processing functions that take an input string and transform that into some output string. I'm looking for a pattern to make such functions as generic as possible (with reasonable effort). Requirements It should be possible to supply the input as a range (like std:...

0
Q: Using hash_file for image recognition

Travis SmithMy team is writing software to be able to grade a basic skills in word/excel/powerpoint test. We are trying to figure out the best way to verify that they included a correct image in their word doc. We know how to get the image file that they use through the xml of the word file. The problem is w...

0
Q: Read, organize, and plot data from a formatted file

nivkI have a data output file from a LabVIEW program (that I cannot modify), and I need to plot the data and fit to a theoretical curve. I accomplished this with Python (with which I am entirely self-taught). My code runs and produces the desired output just fine, but I feel that it is much too mess...

@syb0rg They could have employed compound and complex filters, if it matches the regex but then has somewhat specific terms it can be ignored. Oh well, I think they just wanted to give us "what they can" without spending too much time and sacrificing to potential false-positives.
I'm not even going to post this question anyway.
21:00
If they code is working and you want suggestions on improvements then the question should be moved over to Code Review. And please pick a single language - C and C++ are different languages with possibly different answers. — kaylum 19 secs ago
0
Q: call one function with a variable get element by id

TurtleWolf function playGreen(){ var audio = document.getElementById("audioG"); audio.play(); } function playRed(){ var audio = document.getElementById("audioR"); audio.play(); } function playYellow(){ var audio = document.getElement...

22:00
possible answer invalidation by C.W.Holeman II on question by C.W.Holeman II: codereview.stackexchange.com/posts/165038/revisions
Kaz
Kaz
Come on Boris! I've got a 100:1 bet for you to stab Theresa May in the back and be next PM.
I believe this question should be asked at codereview.stackexchange.com — Sergey Berezovskiy 38 secs ago
0
Q: Average of three biggest parameters out of five without using sorting algorithm or vector/array

Bernardo CesarI'm trying to create a function with has 5 input parameters and returns the average of the 3 biggest. However I'm not supposed to use a sorting algorithm, vector/arrays or function libraries and still try to use to develop the most efficient logic possible. So far I've come up with the code belo...

0
Q: div table vs table

SILENTMy project is to create a self adjusting todo list. I've searched the net for the structure to use to build the todo list. Since my todo list is considered tabular info, its repeatedly recommended that I use table elements. However I also checked the html on professionally built sites for the ac...

Please ask this question, on Code ReviewChristian Gollhardt 9 secs ago
22:27
0
Q: Python Word Jumble Game

GregCan the following complete program be improved? I have been using the Python For Absolute Beginners book and recently made my own version of the Python Word Jumble game. The Areas I am particularly interested in improving; 1.) The while word Loop Block 2.) Python Standards 3.) Simplifying the o...

22:48
0
Q: Generating a list of menus with AngularJS

Zoltán SchmidtSome days ago, I decided to start learning a JS framework in order to gain skills and become more useful at work. I choose Angular for the purpose, and started learning it by building up my "professional" personal website. In this site, one of the biggest obstacles I could encounter was the extr...

23:19
0
Q: Proper use of Strategy design pattern for a simple networking layer in swift

AnonProgrammerDoes the following code demonstrate proper use of Strategy design pattern for a simple networking layer in swift 3? Some code smells I'm unsure about: violates Single responsibiility principle. Each strategy class such as Find, has a method for a different type of implementation. This is be...

23:53
0
Q: Lucas Lehmer Primality Test

Neil A.I have coded the Lucas-Lehmer primality test following Wikipedia's description. I used the mod 2^n - 1 suggested in the article but was wondering if there were any other improvements I could make. I am using the GMP library for arbitrary precision integers. The program asks an integer n as input,...

1
Q: More performant uint64_t to string

Thomas JohnsonMy goal is to take a uint64_t that represents a fixed-point decimal, and output a string representation of the decimal. The fixed-point representation always has eight decimal places, so for example 1.12345678 is represented as 112345678. How can I make the following code cleaner and/or faster? ...


« first day (1496 days earlier)      last day (2817 days later) »