« first day (1451 days earlier)      last day (2567 days later) » 

12:00 AM
RELOAD! There are 3762 unanswered questions (91.3870% answered)
 
12:30 AM
0
Q: create a recursive method to check an arraylist in alphabetical order

thepreI need to write a recursive method to check if all strings in the arraylist are in an alphabetical order in java.

 
 
1 hour later…
1:36 AM
-2
Q: is it difficult for me to send an email by 'python' code?

vx2008Now I wan to send an email by python code: sending mail(mine) is "myself@foxmail.com"; receiving mail is "test@example.com"; how shall I code for this or need other something?

 
2:28 AM
0
Q: Confirmation that this mergesort on linked list uses O(1) extra space?

Alonzo RobbeJust for my clarification, constant space means O(1) space, right? Anyway, here is a code i have written, please tell me if it uses O(1) space. void mergeSort() { ListNode merge = this.head; this.head = mergeSort(merge); } ListNode mergeSort(ListNode head) { if(head == null || hea...

 
3:07 AM
0
Q: Add two signed integers, given in stdin(space separated) in i386 ASM Linux ABI

user69874.global _start _start: mov $0x1000,%edx mov %edx,%eax neg %eax and %eax,%esp mov %esp,%ecx xor %ebx,%ebx mov $3,%eax int $0x80 add %edx,%esp mov %ecx,%edi mov $label00,%ebp jmp parse_eax_load_constants label00: push %eax inc %edi mov $la...

0
Q: How to reject a file import if the name isn't in sequential order

SamI have yearly data files (text delimited) that will each be named "2016 latest", "2017 latest", "2018 latest", etc. I have a macro written that will bring up the file window and allow the user to chose the file and then automatically import it into the workbook. However, I want to include some er...

 
4:05 AM
0
Q: How to reject a file import if the name isn't in sequential order

Samhave yearly data files (text delimited) that will each be named "2016 latest", "2017 latest", "2018 latest", etc. I have a macro written that will bring up the file window and allow the user to chose the file and then automatically import it into the workbook. However, I want to include some erro...

 
4:32 AM
Monking!
 
4:43 AM
@CaptainObvious assembly without code comments is blasphemy.
 
5:34 AM
Your "hacker" name is the name of your first pet, your social security number, and your mother's maiden name.
 
 
2 hours later…
8:02 AM
0
Q: it sorts a character array in alphabatcial order

Ayush Malik#include<stdio.h> #include<stdlib.h> void sort(char** str,int n);//function prototype given main() { int n,i; char *str[10]; printf("Enter number of strings : "); scanf("%d",&n); for(i=0;i<n;i++) { str[I]=(char*)malloc(100); printf("Enter the string : ",i+1...

0
Q: Summation and multiplication of digits of a number

pouyan_BNThis program takes digits of a number and calculate summation and multiplication of its digits .How can I make this code more OOP ? //Calculate Sum and multiplication of digits of a number . #include "stdafx.h" #include <iostream> #include <vector> using std::cout; using std::cin; using std::e...

 
 
1 hour later…
9:08 AM
0
Q: Pause & Resume producer

Mangat Rai ModiFollowing code produces number sequentially. There will be only one such producer, However there can be many threads to pause/resume the list of sequential numbers. package pauseresume; public class Sequential implements Runnable { volatile boolean pause; @Override public void run() { ...

 
9:38 AM
0
Q: Code duplication vs wordiness

KolyunyaIn my program I read values from a configuration array. First I just used magic constants like this: private function ignoreWarnings() { $ignoreWarnings = false; if (isset($this->config['ignoreWarnings']) === true && is_bool($this->config['ignoreWarnings']) === true ) { ...

 
9:51 AM
0
Q: Any more different way for sorting a character array using pointers

Ayush Malik/*This is a program to sort character array in alphabetical order*/ #include<stdio.h> #include<stdlib.h> void sort(char** str,int n); void main() { int n,i; char *str[10]; printf("Enter number of strings : "); scanf("%d",&n); for(i=0;i<n;i++) { printf("Enter the st...

 
10:11 AM
0
Q: Refactor a class operating with concrete table

Gordon FreemanI created a class to operate with concrete table and I want to generalize this code to develop more universal class. Here is one method of this class: public void FillColumns(DataTable table, OracleDataReader reader) { if (reader != null) if (reader.HasRows) { table.Rows.Clear();...

 
possible answer invalidation by Kolyunya on question by Kolyunya: codereview.stackexchange.com/posts/161636/revisions
 
10:35 AM
possible answer invalidation by Kolyunya on question by Kolyunya: codereview.stackexchange.com/posts/161636/revisions
 
10:59 AM
Monking or something ...
 
^ so much free time
but it's funny tho' ...
 
That was quick to go, :)
 
possible answer invalidation by Kolyunya on question by Kolyunya: codereview.stackexchange.com/posts/161636/revisions
 
0
Q: Improving query by reuse sub query

Roy ShmuliI have the following query: SELECT userstable.ID, if(guardsTable.guardsCount >= 1,guardsTable.guardsCount,0) as guards, if(guardiansTable.guardiansCount >= 1,guardiansTable.guardiansCount,0) as guardians FROM userstable LEFT JOIN (SELECT ID, SUM(guardsCount) as guardsCount from ( SELECT us...

0
Q: Encapsulate common parts of Entity Framework queries

Andre BorgesI'm developing a system with some complex logic regarding user permissions to access different data from a SQL Server database using C# and Entity Framework. I have different places across the system where I need to query certain DB entities called 'documents' that are only accessible to current ...

 
11:49 AM
0
Q: Java Game Of Life

user1882585my Java needed a little refresher so I implemented the Game of Life as a little excercise. The game is working as expected, but I'm sure there is some room for improvement. Here is the code (skipping the interfaces, packages and imports) /** * Controller Implementation responsible for starting...

0
Q: Efficient way to store the values of the variables of an expression

SubhranilI've written a simple expression parser in C which right now parses an expression, checks its semantic correctness, and converts it in postfix. I want to add a evaluator module to the program, which will evaluate the postfix expression. My program allows to use variables in the expression, as wel...

 
12:02 PM
0
Q: Fetching system info using python

Raghavendra lokineniThe following piece of code does ssh do different servers and fetches the system info and display it to the user: import paramiko #list variables : ["IP_ADDR", "USERNAME", "PASSWD", "ROOT_PASSWD"] ip_list = [ ["192.168.11.44", "root", "****", "****"], ["192.168.11.8", "root", "****", "*...

0
Q: Python - Extraction of multiple subset of 1D array

NuageuxI have two vectors (1D array) of different sizes. I want to compute the shortest distance between them using a sliding window. My code is the following: import numpy as np v, l = [1,2,3,4], [1,2,3,4,5,6,7,8,9,10] [np.linalg.norm(np.subtract(l[i:i+len(v)], v)) for i in range(len(l)-len(v))] I...

 
FYI, in response to this Meta conversation:
14
Q: Common Review Quotes

Loki AstariIn my reviews a couple of points come up again and again (and again). It's like somebody is teaching bad practice out there. As a result a lot of my reviews look very similar (or get terse with my annoyance). It would be nice if there was an area we could have canned quotes that we could link to...

I created this answer:
-1
A: What should main() return in C and C++?

EdwardOmit return 0 When a C or C++ program reaches the end of main the compiler will automatically generate code to return 0, so there is no need to put return 0; explicitly at the end of main. Note: when I make this suggestion, it's almost invariably followed by one of two kinds of comments: "I ...

Upvotes on it would be appreciated.
 
@Edward Huh, why was that down-voted...
 
No clue.
 
12:24 PM
1
Q: First Complete Script - How pythonic is it?

Travis BathurstI am sure I am opening myself up a bunch of criticism but I am doing this to get better. I just started learning Python and I wrote my first useful script for work. I did a bunch of the basic tutorials and really enjoyed learning Python so far. SO my question is this? I am looking for any advi...

 
12:37 PM
0
Q: Hovering over an arrow symbol into a preview of the next blog post

Anna Mayhttps://media.giphy.com/media/l0Iy8Njq0yAdosSFW/giphy.gif (Forgive the red watermark, used a free programme) I saw this on one of those Squarespace blog templates, but I couldn't replicate it on Blogger. I write my own code on Blogger, so I'm not using any of their templates. The hovering of ...

 
Monking
 
Monking!
 
Can I get a reality check? Is my comment on readability appropriate?
 
12:59 PM
Not necessarily a problem -- I take it as a bit of humor with a serious issue beneath. We'll see how the person whose answer it is reads it.
Since I don't know Haskell, I can't really voice an opinion on the actual readability of either version.
 
sees haskell Damn, I'm out, sorry.
 
0
Q: Filtering a list of Pojo's based on multiple attributes in Java 8

gringogordoI wrote some code to filter a list in Java and I think there must be a much better way of doing it... Essentially I have a web page with a jqGrid and I am passing the filtering parameters into the java back end and trying to duplicate them. I have done this by making parsing the rule json into a...

0
Q: Parallel.ForEach work partitioning

user120241I'm wondering about following use of .NET Tasks Parallel Library. Is there any need to use MaxDegreeOfParalellism to prevent multiple network requests if we are thinking in terms of performance? Download method here is a synchronous method. files = new[] { file1, file2, ..., file1000 }; Paralle...

 
@Edward I'll guess I'll just write an alternative review later and remove my comment.
 
That's probably most beneficial, but I understand that lack of time issue...
 
Ah, well, I can just copy and paste one of my previous Vigenère reviews. (j/k)
 
1:26 PM
@Isofruit …join us… we have monads…
 
What are monads?
<- really bloody beginner, as in, it is still necessary for me to look for exercises to properly structure code since I'm not that proficient in it.
 
@Isofruit Just monoids in the category of… screw that joke. It's a way to combine computations in (purely) functional languages.
 
@Zeta Wait, is monads an attempt to pun for gonads?
 
Nah.
 
I studied APL many years ago and somewhat lost my taste for functional programming languages.
Almost lost my taste for programming entirely.
3
 
1:34 PM
Whenever I look at APL, I can only imagine a bunch of cats running around on a neo2 keyboard.
@Isofruit To be honest, I wouldn't bother with monads, unless you want to learn Haskell or another language that uses them.
 
I'm currently learning on a step by step basis.
 
Which language(s)?
 
@Zeta No worries there, I'm currently wrapping up improving my implementations, now going more towards improving my algorithms for searching/sorting and somewhere on the side I'll try to improve my code-structuring
Only java at the moment, potentially python lter.
*later
 
@Zeta Here's an old StarTrek program in APL.
 
@Isofruit You can press up to edit the last chat message (only for some limited time)
 
1:43 PM
@Zeta Not after 4 minutes you can't ^^
 
0
Q: Twitter bot coding to stream tweets

user357588I am creating a twitter bot from a twit package (https://github.com/ttezel/twit) for a project I am working on, however I have never done programming before. I have attached what I have managed to do so far, which is getting the bot to search for a term in a geolocation. But what I am stuck on is...

0
Q: The while loop doesn't stop

Aditya # Simulating Dice Game from random import randint total_number = 20 gameover = False def check(x,y): diff = x - y if(diff < 0): print("It's less than the number") elif(diff>0): print("It's greater than the number") else: gameover = True print...

 
@EBrown How do you have time to be on The 2nd Monitor?
@Zeta Does anyone still use APL, and I agree with what you state it appears to be.
@Edward I studied COBOL, Snobol (?snobal?) Fortran 77, Simula, Lisp and Pascal. I didn't have to learn APL and for that I am very grateful.
 
2:00 PM
@pacmaninbw I haven't seen APL "in the wild" for decades.
I'm familiar with most of the language you mention except I never did anything with SNOBOL.
 
It was a language comparison class to teach us some of the underlying principles of computer languages.
I used Simula for a simulation project my senior year, it was the first time I met OOP.
 
It's good to learn multiple languages. I'll get around to Haskell one of these days.
I still sometimes use concepts from other languages even if I'm actually writing in C or C++ (which are my usuals these days).
 
:) I don't think you need it for most of what you do. Was your degree in Electrical Engineering?
How much C do you still use in comparison to C++?
 
Computer engineering.
I still do a lot of embedded system work, so C is still king there.
 
@pacmaninbw Err, wrong recipient? I don't use APL, I've only seen it on codegolf.SE
 
2:06 PM
See Edwards comment, I doubt anyone has seriously used APL in decades.
@Edward That is a lot shorter than the BSD 4.2 C implementation of trek.
 
@pacmaninbw Yes, and shorter than the BASIC version I wrote that ran on a timesharing system via TTY.
Too bad APL is utterly incomprehensible.
 
:) A lot of goto's in that basic program?
 
Littered with 'em.
 
I ran across it some months ago when cleaning up old files. It made my eyes bleed.
 
2:10 PM
LOL
 
0
Q: Faster way how to insert line in Excel interop

RaoI have a program which takes photo, analyzes it and saves the result. So far it works fine. I added (on request from my colleague) removal of certain data-lines as they didn´t convey any information. I want as a finishing touch insert a empty line if the data have been removed. So far I have this...

 
@Edward I wrote some VBA and VB along the way but by then BASIC was more structured. When I was a Student my job was assisting other students with programming problems, I had to debug a lot of BASIC programs. I understand the eyes bleeding!
There were no while loops in BASIC back then.
 
It was useful when it was invented (over 50 years ago) but BASIC is one of those languages that we should let slide into history.
 
Amen!
 
My favorite obscure language is still FORTH
: ? . ;
That's a complete program.
 
2:15 PM
@Edward Hm. I have no idea, but is that cat?
Has some similarities to ,[.,].
 
@Edward I think this zombie can use your help if you have time codereview.stackexchange.com/questions/152759/…
 
No, I exaggerate slightly. It's not a complete program, but it is valid syntax.
 
I look at Brainfuck and think it is properly named.
Never learned FORTH, some co-workers took an extension course in it.
 
It's been too long. Correct version is : ? @ . ;
The ':' introduces a definition and ; terminates it.
? is the name of the new word.
@ says get the value from the address on the stack.
. says print the value on the stack.
So you'd use it like MYCOUNT ? and it would print the value of the variable MYCOUNT
And that's more than anyone cares to know about FORTH, I'm sure...
 
You have to learn something new every day, that's why I'm on code review.
6
 
2:20 PM
Me too.
 
@pacmaninbw With only 8 symbols and 7 (or 8, depending on how you count) operations, it's a simple language. Not one to be productive, though.
 
0
Q: What code should I write to submit yes or no answer in database?

rohit singhI want to create HTML form which will have two radio buttons One radio button for YES and other for NO. User had to check one radio and submit the form. After submitting the form answer should have to be saved in database automatically. The answer should have to be submitted in database in such a...

 
@Captain Obvious No Code.
"What code should ..."
 
Answer: "working code"
6
 
2:37 PM
+1 for that answer.
OK, back to pounding Swift into my thick skull. See you all later.
 
3:10 PM
 
@Edward That's such a smart-ass answer, I love it xD
 
0
Q: Last three values sfdc trigger functionalty

AdamoPlease review the following salesforce trigger code trigger BrandTrigger on Brand__c (before update) { for(Brand__c brand: Trigger.new){ Brand__c oldBrand = Trigger.oldMap.get(brand.Id); if (oldBrand.Name != brand.Name) { if(String.isBlank(oldBrand.Old_Name__c)){...

 
3:26 PM
0
Q: vb.net 2012 I want to edit the code

Geared SilentlyWebBrowser1.Document.GetElementById("submit").InvokeMember("click") =================================================================== It does not work When you place the button Please Help <button type="submit" class="btn btn-warning pull-right"><i clas s="icon-menu2"></i> تسجيل...

 
Finished my 3rd class and am backing up 52.6GB of data.
Only one assignment left.
 
3:43 PM
@Hosch250 52.6GB of data for an assignment? What did you do?
 
No, that's all my documents.
Does this degree/school look reasonably reputable? erau.edu/degrees/master/information-security-assurance/
Apparently, this school was the first college to offer online degrees, is considered the top online school, and has a lot of students hired by MS.
I know the later is at least partially true because I know someone at MS that studied here; I think they did an on-campus degree, though.
 
posted on April 24, 2017 by CommitStrip

2
 
4:03 PM
0
Q: React.js modularity and error

aemcShould I keep this update function separate as is or can I save 3 lines of code and embed this.setState({newDeadline: event.target.value}) directly in the callback function below? eg. onChange={event => this.setState({newDeadline: event.target.value}} import React, { Component } from 'react'; i...

 
Monking
@CommitStrip whatsthejoke.jpg?
 
4:18 PM
And another Vigenère review.
Maybe I should put that on my resume: "knows Vigenère ciphers"" >.>
4
 
4:54 PM
@Zeta Perhaps it's time to write the ultimate Vigenere yourself and post a question, link back to it in future answers when appropriate. As canon source, of sorts.
 
The last time I've asked for a review, I forgot to put in a duck and had to review my own code…
 
2
Q: OOP Battleship console game in Java

Nilzone-I wanted to make a simple console game in order to practice OOP. I would really appreciate a review that looks at Readability Maintainability Best practices What annoys me a little bit with this code is I don't use interfaces, abstract classes, or inheritance, but I couldn't find a good ...

 
0
Q: PcgRandom Implementation

Kittoes0124I attempted to answer this question last week and was thrown off when someone mentioned in a comment that my method would show bias. Eager to prove the naysayer wrong I discovered that things were even worse than he suggested as certain ranges will cause things to break down entirely. So I decide...

 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: C++ concurrent queue and testing
 
@Mast Hm. Now that I think about it, a Vigenere is just a generalized zipWith. Hmm...
 
5:38 PM
0
Q: Is this good PHP OOP practice?

Rafael GuglielmiI need to make a simple CSV->MySQL script in OOP and I was wondering if there's anything I am doing wrong in a object-oriented sense. I have a file name db.php where I connect to MySQL via MySQLi and then I have another class where I load a csv file into MySQL like this: function __construct() ...

 
6:05 PM
3
Q: Why does Java have a void type?

marisbest2Does / why does Java need to have a void type? As far as I can think, every use of void would be better served by returning a status flag, the object being invoked, or null. This would make every call a statement that is assignable, and would facilitate builder patterns and method chaining. Meth...

I like what he's smoking
 
0
Q: 99 bottles of beer- function call and loop issue

Marijan PericProgram Task: Given an input number between 1-99 output the lyrics to the "99 bottles of beer on the wall" song, where the program also converts the integer value input to its English string. i.e. 45 -> forty-five My problem: Most confusing, is that when I compile the program, its outputs my s...

 
@skiwi Nope. Strip-Reflexion-de-Codeurse650-finalenglish.jpg
 
6:29 PM
@RoboSanta Relatively good answer of relatively new user. Voting is encouraged.
 
6:47 PM
-1
Q: Compute area and circumference of a square

Ronald BocalyHi guys here is the program I have to write: Create a class to compute area and the circumference of square or rectangle. Create three methods: void setSides(int, int); int getArea(); int getCircum(); Also create a program to implement the class So here is the program with the methods: ...

 
@CaptainObvious It so nice when the OP says it doesn't work... :-D
 
7:01 PM
0
Q: Is it possible to speed up an Excel query within PowerShell?

PowershellPauperI am currently using the following query to add a specific row (with 10 columns) from an Excel spreadsheet (~1500 rows and hosted on SharePoint - I've also tested locally with the same issue) to an array in PowerShell. $connection = New-Object System.Data.OleDb.OleDbConnection $connectstring = ...

 
 
1 hour later…
8:25 PM
0
Q: How can I make this C# code faster?

NikitaI need to find the number of inversions in the given permutation. Now my solution is working correctly, but slowly (with large lists). Suspect it's because I'm using List<T>.IndexOf and List<T>.Remove methods..? private static int InversionCount(List<int> permutation) { if (permutation.Count...

0
Q: This code hosts a game, can it be optimized and compacted?

WillHi i have the following code but its abit messy and hard to look at, i could include a function to host a game so that block of code isnt repeating but could this be optimized any further? server.em.addListener('hostGame', function(settings) { if (Object.keys(hostingGames).length != 0) //If ...

 
9:05 PM
-1
Q: Trying to get better performance recursive function

Jade_LayyneMy following code is working fine but I am trying to improve its performance. If you have a recommendation, I really appreciate to get it. I am using java 8 but as I am not familiar yet with it, I did not use it but if someone has an idea and can comment it, I really appreciate that. Thank you ev...

 
 
1 hour later…
10:19 PM
0
Q: Swing UI for a Virtual LaunchPad (part2)

FERREI'm currently working on a school project where I try to create a virtual Launchpad. I already publish a question about the first part of my code where I created the virtual keyboard ,and it helped me a lot. In this second part, I'm trying to link my buttons to the keyboard by a key listener bu...

-1
Q: Check if a string is a Palindrome (recursive approach), Unable to return a boolean

se77enfunction palindrome(word) { console.log(word); if(word.length <= 1) return true let strArr = word.split(""); console.log(strArr) if(strArr[0] != strArr[strArr.length -1]) return false palindrome(word.substring(1 , word.length -1 )) } The function takes in a string and checks whether or ...

 
10:57 PM
0
Q: Counting the number of Relative primes between 1 and 10000

AyazI've been trying to write a program that is capable of counting the number of Relative primes between 1 and 10000. Following code yields the wrong amount where as the original value is near 60800000. Please help me out. this is the code for my program: #include <iostream> using namespace std; ...

-1
Q: My code takes in a char array and converts it to a string.It then converts it to html;adding tags and text formats

Daniel OluwadareTakes in char array.returns String with html tags. the purpose is to display this on a page as a java code.with data types and key words colored. before: public class Test { public static void main(String[] args)System.out.println( "Hello World, from command line!" );}} function formatCode(...

 
11:10 PM
0
Q: Cycle decomposition in python

NesaIs there an algorithmically better way of doing this? import numpy as np l=np.random.permutation(10) p=list(range(10)) print(l,p) i=0 k=0 prod=1 z=0 def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) while z<10: """count how...

 

« first day (1451 days earlier)      last day (2567 days later) »