@SadiaF Maybe you could post a more complete, and working example of your code at codereview.stackexchange.com with the Fortran tag. Code Review is dedicated to code improvements. Note, you do not need to stick to F77, even if other parts of the code are F77. For practical purposes F77 is a subset of F90, which means your code base is probably as well valid F90 code as it is F77. As mentioned above, we basically only have F90 compilers now, F77 compatibility is a moot point. You should not feel yourself restricted by it when writing new code or reworking existing parts. — haraldkl38 secs ago
I made this C++ doubly circular linked list implementation and it seems to work right, handle everything well, and not have any errors however I've been working with it for a while and would like some fresh eyes to take a look and see if I am missing anything large or my code contains any 'gotcha...
I made this C++ doubly linked list implementation and it seems to work right, handle everything well, and not have any errors however I've been working with it for a while and would like some fresh eyes to take a look and see if I am missing anything large or my code contains any 'gotchas'.
Side...
I wrote a little library for myself: implementing a generic finite state machine. I will be using this library in class assignments.
I clearly have little understanding of C++ templates because most changes I make break it and take around 30 minutes to debug each. So I would like some review esp...
I am trying to read a sequence of random characters, integers and symbols from the standard inputstream, split it into 3 separate arrays(uppercase, lowercase and numeric) and print them in that order using standard Java API and JDK7.
The code below does the same:
BufferedReader bufferedReader ...
Looking for comments on the use of decorators for the following problem (validating initial guesses for bracketing rootfinding methods), as well as any other comments you might have on the design below.
def bracketing(rootfinder):
def wrapper(func, x0, x1, *args, **kwargs):
func_x0, ...
I have used sort function from algorithm in c++ STL. I have made myfunction to sort a given array according to the function.
The question is to give maximum possible number with a given array of numbers.
Ex : [9, 3, 30, 5] -> 95330
bool myfunction(int i,int j){
string a=to_string(i);
...
Points on your code
You are specifically asking for help regarding JDK 1.7. I think that you should learn about a better/simpler approach to taking input: using the Scanner class. It was added in JDK 1.5, which can be as an alternative to the BufferedReader approach. Prior to it (i.e. in the ti...
A few things you can improve on:
function Sanitise_Mail($h) {
$h = filter_var($h,FILTER_SANITIZE_STRING,FILTER_FLAG_NO_ENCODE_QUOTES);
// Taken from PEAR Mail
$h = preg_replace('=((<CR>|<LF>|0x0A/%0A|0x0D/%0D|\\n|\\r)\S).*=i','',$h);
return $h;
}
You can just directly ret...
@ambigram_maker Why do you suggest the or (||) operator, and then not use it in the refactor
it's http://csg0.com/
After 10 min passed on it the Memory used is over 150MB, and after 30 min its goes up to 350MB
And it's the same for the CPU usage that is 3% when we go on the site and after 15 min , it's constantly at 20%
I have literally no Idea why this behaviour:
I always reuse alre...
@Vogel612 probably, that's why the tedious lambda x -> System.out.print(char) x) at the end instead of the simple System.out::println which would print out ints instead of chars
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Get a list of network interfaces on Linux.
This code is compatible with Python versions 2 and 3.
"""
from collections import namedtuple
import re
import subprocess
def get_interfaces(external=False, ip=False):
"""
Get a list of network...
the guidelines should be that all code must hit the review process and get reviewed to the standards defined by the workplace before it can become live
So, I did the CodeEval 'Longest Lines' problem and it works fine for any input data I can devise. When I upload it to CodeEval, it says it's wrong.
Because it's a "moderate" problem, input data is not provided. After some System.out.println nonsense I got the test data, and my solution seems t...
If your code review team tells you that your code is not efficient, why don't you ask them what part can be improved, because the code you've shown is very likely not what they were referring to. — Andreas36 secs ago
I've written some Python 3 code that computes the \$n\$-th prime. I implemented first a naive isprime function that looks for divisors of \$m\$ between \$2\$ and \$\lfloor \sqrt m \rfloor+1\$. Then a loop looks for primes and stops when the \$n\$th one is found.
from math import sqrt
def isprime...
That was my downvote - you presented code that does not even run, for review. I believe the downvote was justified.... I was going to wait a moment and cast a close-vote too, if it was not fixed. The real question is why you were editing your code in your edit box here, instead of fixing it in your actual computer, and posting the code you actually run! — rolfl29 secs ago
Inspired by Sam's question (Brute-force string generator) and rolfl's really short version of the algorithm I started to experiment with a different approach and created one that seems to run a little bit faster (about 40-50ms for a string of length 4). As it doesn't really optimize the orginal a...
@rolfl I don't think I can PR the description of a project
@Quill I've played around with Autodesk Fusion 360 aswell, seems like a good CAD tool, but I"m looking to combine CAD with animations for use in 3D engines
You got a problem with the code? Then describe it more thorough, please. You want to know a more efficient way of accomplishing that? Ask the question on Code Review. — cad49 secs ago
I believe the JavaFX route will improve the performance of the image manipulation I do. Also, I use a pretty poor algorithm at the moment.
It's tempting to use a GPU-based library for the actual mandelbrot computation.
additionally, at the moment, when you use the mouse wheel, it zooms in on the center of the mandelbrot, but it should really zoom in on the spot under the mouse pointer.
Time, time, time.... my parents are late.... so Ic an dawdle.
How can I efficiently store and process data for this problem?
Problem Statement
We have two arrays a and b of length N, initially all values equals to zero. We have Q operation. Let's define three types of operations on this arrays:
1 l r c:Increase al,a(l+1),...,ar by c.
2 l r c:Increase ...
@meshy At its present state, this would be closed as "example code" on Code Review. Unlike Stack Overflow where it is recommended to minify the code as much as possible, Code Review wants context. For more information read A Guide to Code Review for Stack Overflow users — Simon Forsberg17 secs ago
I'm trying to run a build scripts framework, so build scripts can be configured via yaml file tasks.yml:
---
release: # This is a 'runner' or group of related tasks. They share common initialization needs
config:
repo: ci-repo # Configuration parameters can be set at runner level and ove...
I've written a smaller version of 15 puzzle in C, using OpenGL 3.3 and freeglut. I've found a place you can play it online to get familiar. I'm new to OpenGL, so I have no idea if I'm doing this in the right way. Nevertheless, this game compiles and works as intended on my 64-bit HP COMPAQ laptop...
@RubberDuck I've been doing it in teams I was involved in, now I'm trying to push it wider. I've been planning a series of blog posts with my techniques and experiences so far, it's high time to actually write it up already...
I actually don't know if things like algorithms are considered math or not... But in any case, if you add logic and set theory, etc. to it aswell it's probably 25%?
Even though my main contribution on this project will be programming the Arduino and setting up a WiFi connectiotn to my laptop and making a control application for the vehicle to operate remotely, I want to help out with other stuff aswell
@itsbruce Technically we get taught the bigger concepts in pseudocode, but we use Java for some programming related classes
Java for Basic Programming and Programming Methods, the former teaches the real basic concepts and OOP, the latter teaches design patterns and such
And had to use some C89 for Operating System scourse to learn to work with multithreading on Linux
But it sounds as if the designers of your course think that learning practicalities of one very ornate language are basics.
Nobody would ever suggest that Physics students have to learn how to build and maintain an internal combustion engine before learning that speed = distance / time
5
And yet in Computer Science, this is forced on students all the time
The less bright, if first forced to learn lot's of trivia effectively by rote, don't understand it and fail when they do have to learn the higher concept
I had to walk one student almost through the entire class, starting from the very basics and working up the more advanced concepts (I never gave them the answer).
I think they were learning.
They were only halfway done when the class ended, though...
Certainly once you're teaching CS, there's a whole middle ground of smart but not imaginitive students who can reach the higher concepts with help and will benefit greatly from encountering them early.
I take a policy of learning the why, not the how. Once I know the why and the basics, I can usually figure out the how and the advanced by building on it.
I think that having a solid understanding of the basics is an essential to learning and understanding the advanced.
The trouble is, the teachers don't make sure everyone understands (nor can they, really).
Erm.. Cant you guys just post the code for this specific task in the example, or would that be too long/advance for a newbie? — Muhammad Salman Azhar1 min ago