I wrote a simplified versions of Windows' tracert command as an exercise and to learn about TTL in packets. It shows the path that your internet traffic will (likely) take on the way to the given destination.
Here's an example (some stuff is redacted out of paranoia):
python tracert.py google.co...
@DerKommissar I think the 5540 is one of the newer generations, do you have an i9 in it? If the ProPlus is the service package I bought, yes, I've spilled coffee into 2 laptops, that gets expensive. Keeping my old hard drive is also worth it if it fails. I'll fix a tower if it fails, don't want to mess with laptops when they fail.
To be honest: no! I just caught this major error and would have to check your whole script. But maybe it's more suitable for Code Review! — csabinho39 secs ago
my bad,code review does sound more reasonable.do i just delete post now? — blue58 secs ago
A string of characters including only alphabets (lowercase letters) is provided as an input.
The first task is to compute the frequency of each character appearing in the string. In the output, the characters have to be arranged in the same order as they appear in the input string.
Then character...
Hello I'm new to sql and php.i was trying to understand how a php pagination script works, i found a video on youtube which helped me understand it.this is the source code from that video,however i've got some questions :
-is this script good enough for displaying information on a site online?is ...
Here is my php code:
<?php
try{
//Need to make a connection
$con=new PDO("mysql:host=localhost;dbname=courseraassignment","root","");
$statementUpdate=$con->prepare("select * from position
where profile_id=:profile_id");
$statementUpdate->execute(array(
':profile_id'=>$_...
Usually questions asked on stackoverflow need a clear answer that solves the problem. 'Please clean up my code' is likely going to be closed pretty fast. The Code review stack exchange might be better. — Evert18 secs ago
When you think that you are finished, and have tested it & are satisfied, why not post it to our code review](codereview.stackexchange.com) site and get some feedback? Even thought the code works, there are usually some informativeness that can be made and you can learn from others that way. Good luck — Mawg says reinstate Monica37 secs ago
My experience is more general architecture and software design not code snippets like this. See any improvement to my code?
var message = @"This is a test message
012345678901234567890123";
var output = Split(message, 20);
output
"This is a test",
"message",
"01234567890123456789",
"0123"
Max...
The idea is to represent a hand as a list of cards and create a frequency mapping, which can then be used to identify what rank of hand you have and arrange your hand in a way that allows the Ord type class to compare hands of the same rank.
My solution feels a little cumbersome, however this is ...
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
namespace WebApplication1.App_Code
{
public class SqlHelper
{
public string connstring;
public SqlConnection con;
...
I've started Go for the last couple of months and I decided to challenging small projects, so I created this proxy requests script.
It works well (in my opinion at least) but I'm looking for different ways of improving this further like being able to target all servers, or making this more concis...
I have solved the following problem on Leetcode:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric.
Here's my iterative solution:
def isSymmetric(root):
if root == None:
return True
...
I made Password Generator on C#.
It prompts the user for the length of the password, whether it contains numbers, lowercase letters, uppercase letters or symbols, and generates a strong password from randomly added numbers, letters, or symbols.
There's the code:
using System;
namespace Password...
This question is off-topic due to MRC. In needs definitions for the following classes and objects: ScraperQueueItem, ISocialEventHandler, profile and ProfileConnection.
Ok? Every time MRC is brought up you and Mast seem to have to call me incompetent. Rather than attacking my point it seems like you'd much rather attack me.
@pacmaninbw I'm sorry you feel that way. I won't ask why you think something is MRC. I ask because of my own ignorance and I want to know your POV / learn from you. For example you taught me about the stack in C yesterday which I'm sure will help me in the future.
How to flatten the nested try-catch block in F# for the following code? I am using EF Core with F#. The nested is required because I need to Rollback the transaction if there are errors in saving or committing the transaction!
let createTenant (ctx: AppContext) (tenant: Db.Tenant) (firstUser: Db....
I was looking to this exercise: Is Valid Binary Search Tree
I tried to do the exercise by myself without looking to the solution and my code is "much simpler" than the code I found at the previous link. Is there anyone that can review this code or provide me some test cases for this problem? Gene...
@Peilonrayz You might like this, by the same token, if you say something is MRC, I know it really has to be MRC.
@Peilonrayz I realized this in mid-rant, Code Reviews are about mentoring. Can you tell me what languages besides Python you have had a lot of experience with?
I'm weak in most of the scripting languages, I can work my way through PHP (limited to 5 at the moment), CSS some JavaScript, HTML 4.1 (a little 5). I don't know Python, Lua, or the Data Science languages. I write a fair amount of SQL these day. I could probably learn Java in 2 or 3 weeks.
I know enough Lisp to know I don't want to know it. I've done extensive programming in C, C++, C#, and VBA (extensive is more that 3000 lines of code for a working application in this case).
I don't like working on the front end because I really can't be bothered with pixels.
@Peilonrayz And I will continue to explain things.
@pacmaninbw In experience I'd say from most to least Python, HTML, CSS (SASS, Stylus), fish, Lua, JavaScript + TypeScript, C#. I'm sure you can tell if I'm saying my next best language is HTML.
@pacmaninbw Wow, we're like polar opposites. You like typed + compiled languages and I like untyped + interpreted languages. I'm not a fan of the front end because I have to play with JavaScript.
I've worked in environments where millisecond, and nanoseconds matter so typed languages are better. That kind of work (system development) is what I really like to do.
@pacmaninbw That's probably some pretty interesting stuff to work with. I enjoy cutting milliseconds and microseconds in Python on Code Review at times. But relies on knowing what Python libraries are written in C and how you can duck tape it all together in as little Python as possible. Gets pretty boring when complexity genuinely has no correlation with performance.
And ofc it's not microseconds when $n$ is larger than say 3
@pacmaninbw Never heard of CShell. But yeah shell scripting is really weird, you don't return you only print.
Ah, I've only played with penguins never played with devils. The Unix family is just so large and after Arch I have a fear every distro also takes a day to just install.
This is the python code:
def do_adagrad():
w, b, eta = init_w, init_b, 0.1
v_w, v_b, eps = 0, 0, 1e-8
for i in range(max_epochs):
dw, db = 0, 0
for x,y in zip(X,Y):
dw += grad_w(w, b, x, y)
db += grad_b(w, b, x, y)
v_w = v_w + d...
This question is very broad and open ended which isn’t the best fit for this site. You may be best asking this on codereview.stackexchange.com Instead. If you want to keep it here, I’d ask a much more closed question that can have a correct answer. — Rich Bradshaw50 secs ago
If your code is working, and you are looking for a review of your code (for efficiency, best practices, ...etc), then this question is more suited for Code Review. If however there is a problem with the code, then you are at the right place, but then specify what exactly the problem is. — trincot47 secs ago
I don't have any idea with this error,
import NumPy as np
X = np.array([[1,2,3],
[4,5,100],
[-1,2,100],
[3,8,9232020]])
print(X)
print('\n Dimension of the array is:')
print(X.shape)
def getMax(X):
this_max=X[0]
for e in X:
if e > this_max:
...
I'm making an API that stores an Entity of type "Account" with this:
HTTP POST: /entities/Account
Body:
{
"accountName" : "superSecretName",
"isActive", true
}
At the same time making this API able to also do an "action" as part of the POST operation through a query parameter:
HTTP POST...
This program might seem lazy, I also tried iterating through the vector but performance was poor so I used this lazy approach that has more performance
#ifndef BINARY_HH
#define BINARY_HH
/**************************************************************************
* Name: Binary.hh
* Author: Sa...