These are the reverse and display functions of the linked list.
Correct output :
1->2->6->7->NULL
7->6->2->1->NULL
My output:
1->2->6->7->NULL
1->NULL
When i made the reverse function with no parameters the output is correct.
But if i make it p...
A friend of mind works at a certain space agency. I posted an article on the facebooks about how they were looking for programmers to develop software to detect near near earth objects because I thought it was cool.
Practice is that neural networks would require tons of nodes and that's simply not feasible (our brains do a far better job though), and they need training data as well, but humans also need that
Yeah, but that's code review process and I'm talking about merging here. So maybe to put it another way I want to be notified if something has changed in the code in particular files since the time I branched out instead of manually check it every time. — Maximus42 secs ago
I think it is important to clear up that what I have done is just rambled about the ideals and goals (as I personally see them) of code review as a site. I am fully aware that the reality is a lot more messy. I am not trying to use the ramblings as a "meter" against which questions are closed, or voted on. Rather, it is a way for me to assess whether site policy discussions are aligned with the goals and values of the site, or whether the topics being discussed would hinder or devalue the site — rolfl ♦4 mins ago
I would encourage you to produce more explicit output, particularly with the filenames. If I wanted to reverse the process and scrape the code into files on my machine, using a Python script such as the following…
import json
from lxml import html
import re
import requests
FILENAME_HINT_XPATH ...
Most likely, code for your task will implement several patterns, working together. Seems like more constructive way to go is to write sketch of a code and post it to codereview.SE, or something like that. In short -- start with a code snippet. — Victor Sorokin50 secs ago
A little over a year ago, I asked this question. Since then, I've implemented the larger bit variations and am looking for any and all feedback - performance is obviously key when talking about FNV-1a, but having maintainable code and being correct and decently unit-testable are also paramount. W...
Is it good to empty an array on focusout, like I did in my example:
var arr = [];
$("#automobil").focus(function() {
$.getJSON("auto.json", function(data) {
$.each(data, function(key, value) {
if ($.inArray(value.name, arr) === -1) {
arr.push(value.name)
...
I am trying to simply measure my code execution time. I wrote this class
public class PerfMeasureUtil {
private static final Logger LOG = Logger.getLogger(PerfMeasureUtil.class.getName());
private long startTime;
private long duration;
private static final EnvironmentProperties env = new Enviro...
I tried develop a new logic for this. I have written my code & it is working fine.
int isDivby9(int x)
{
int status = 0;
int divby8 = 0;
int orgx = x;
if(x>=9)
{
divby8 = x >> 3;
int olddivby8 = divby8;
while(divby8 >= 9)
...
I'm running a JQuery function to equalize heights. I want to equalize the heights of several pairs of elements. How can I combine the seperate functions below into one function that equalizes the heights of each class without forcing each class to the same height as the other classes?
//Equalize...
When running unit tests in javascript it is often useful to gain access to private members. Previously I would add an extra snippet of code inside the class definition (or whatever one calls this in a prototype-based language :-)) to open up the object. Something like this was usually suffient:
...
First post here. I have been working on a small script that allows communication though the TCPsocket command. I am stuck on a small error in my code. For some reason after running it twice the it stops running the RX loop.
I also worry that while its waiting for me to enter something for the get...
I want a generic super-class that I can easily subclass - and if desired add slots to my class - without having to worry about any pickle issues (with the lowest protocol). Is this in general a good idea?
And if so is this class a good implementation?
class HasSlots(object):
"""Top-class th...
I did not check if your code works, I assume it does since you say so.
Your code lacks consistency
if(divby8 == (orgx - (olddivby8 << 3)))
{
//...
}
vs
else{
//...
}
and
if(x>=9) vs while(divby8 >= 9)
I suggest using an automated formatting tool.
Avoid nesting
You can avoid ne...
I'm currently writing a program where efficiency is rather important.
In this program I sometimes end up with values from up to 4 different sources. I want to check if any of the values I end up with are the same, and if they are the same I also want to know which sources gave me the same number...
I have code which asks the user for their name, asks them 10 simple maths question and stores their name and score out of 10 on a txt file. From this point, I need help on finding a way to sort the file, from highest score to the lowest score.
Thanks in advance :)
class ShareSvc {
public object Data { get; set; }
public static ShareSvc instance;
}
class PrototypeCtrl {
public PrototypeCtrl() {
Watch(ShareSvc.instance.Data, data => this.data = data);
}
}
Dan, thanks
I want to ask you about one thing. If you decide to do next refactoring, please tell me in advance. Sometimes I don't see any strong reason to do this changes.
It is translated from typescript, btu they were usin the any type which is essentially the object type
essentiallyl, I had to tell the application that the user wanted to see a different company
Now, being this is web based, you'd think we would just browse to /company/id, right?
Nope, instead they wanted me to publish an event searchclick which would then be caught byt he parent class and then rebroadcast out as searchclick across the ENTIRE application
When I turned my nose up at this they came up with ShareSvc, where I am to put the company on a singleton object and they watch the ShareSvc for changes
So I just said fuck it and made a prototype of my own to show how it could be done with URLs, haven't actually changed their code all that much, and I got that email back lol
I should paraphrase some of their code and post it for code review lol
This was the old part of their code that I would have to use to set the'next' company:
var companyIndex = 0;
$scope.GetCompany(companyIndex);
$scope.NextCompany = function () {
this.GetCompany(++companyIndex);
};
yeah, I would have to find the implementation of GetCompany and then put the next company in a 'queue' so the next time you hit a button it would increment companyIndex
I think I should mention this is the asme company that would load up an admin page before checking if you were logged in or not and then hastily redirecting you away from it if you weren't logged in on the client side..
/rant over
i think i will do a blog post on spaghetti code = job security
I have the following code which I would like to simplify in Haskell, although I'm not sure how. I recall that I can use monads to simplify a case chain when the result of the case leads onto a next bit of code but in my example, I return from the function when I get a value, and continue to the n...
I tried to develop a new way to check if a number is divisible by 9. I have written my code and it is working fine. I'm not allowed to use *,/ and %.
int isDivby9(int x)
{
int status = 0;
int divby8 = 0;
int orgx = x;
if(x>=9)
{
divby8 = x >> 3;
...
your runtime being heavy, horrifically slow and non-portable makes you a bad programmer because it does all of the programming for you?
wat?
I don't see this being a constructive discussion but I just can't follow the logic that If you do C# .NET you are not a real programmer, if you do C# Mono you are slightly better than C# .NET scrubs, and C++/C are the master race
No.. this is just a language qualification. You are not good, because C# does everything for you and you have no clue of memory management, hardware management.. you don't even know how sockets work.
C# has everything for you.
The GUI is very restrictive.. C# is also not as much powerful as C is.
I have collected a large amount of data about the train network in my country. Now, I am writing some code that calculates the average amount of delay on the entire train network, for each day, in a given period of time. Important to note: every train has a unique train-number. Each train-number ...
Well, you're welcome to tell me what makes me a real programmer all you want. I'll just sit here and earn money for actual writing real life programs in C#/JavaScript
If I got an edge case rounding error I would have to resort to doing it the long way. but otherwise I would use the calculator because it's faster, 99% of the time.
You did just say that C# .NEt is terrible because it's slow.