« first day (2533 days earlier)      last day (1467 days later) » 

12:00 AM
RELOAD! There are 6480 unanswered questions (90.1159% answered)
 
0
Q: Zork-like text adventure w/ Python

digital_drakoI've been using python for around 3 months and decided to make a simple text adventure game for fun and to exercise a lot of ideas I've been learning about. I've just recently learned about classes and OOP, as well as modules so those are the two features I'm the least sure of. It's mostly a base...

 
12:18 AM
Your question might be more on-topic if you posted your current code with a description that shows what you mean by "too slow" (ex. maybe some timeit logs) and what your target performance for "fast" should be. Alternatively, if you already have a fully working code, you might want to check out another Stack Exchange site, Code Review, to ask people to peer review your code. Part of their on-topic list is "performance". Again, make sure to clearly describe what "slow/fast" means. — Gino Mempin 17 secs ago
 
12:37 AM
Welcome to SO! This is best for Code Review SE if the code works as you intend. — ggorlen 41 secs ago
 
1:28 AM
0
Q: Type inference similar to hindley milner in python

XilpexI was recently intrigued by the Hindley Milner algorithm (for type inference) and decided to implement it in python. After implementing it, I got the feeling that the implementation was incorrect. I also felt that it wasn't very pythonic, and was sort of inefficient. Here is my code (it isn't as ...

 
2:05 AM
-1
Q: I need to extract a data-value from google with BeautifulSoup in Python

Angel MeleanWhen you go to this link: "https://www.google.com/search?q=usd+to+clp&rlz=1C1CHBD_esVE816VE816&oq=usd+to+clp&aqs=chrome..69i57j35i39j0l2j69i60l4.1479j0j7&sourceid=chrome&ie=UTF-8" You can see the price of exchange between USD and CLP (chilean peso). I want to extract that number... I have alre...

 
 
2 hours later…
3:59 AM
0
Q: How do I use csv.DictReader() to define my own function?

Dabreil IgnisI have this piece of code def reader(file='file.csv', fields=['user','email', 'fname', 'lname', 'pass']): with open (file) as f: f_reader= csv.DictReader(f, fields) yield f_reader However, to actually use this function in my code, I have to do this: eggs= reader() for spam in ...

 
4:18 AM
0
Q: Overriding c# wpf property on one control element

EasyBBI've been searching to see if this is possible but is there a way to override a property on a label in wpf? Specifically the tag property. I only ask because as of right now I'm using a label to show my font icons. Problem is there is 250 icons. So I what I was hoping for was maybe intellisense...

 
4:56 AM
0
Q: How do I get the if else statement to do a decision tree in vba?

Josh BulloughI am hoping to make a quick decision tree using the if statement in excel vba. The point is to have a message with a prompt show up and then it will take the person through the prompts based on the answers. Is this possible to do? Sub Decision_tree() a = MsgBox("Want To Play A Game?", 3) If a ...

 
5:15 AM
0
Q: Expenses Calculation Using OOP in PHP

Fujiwara no SaiRaw Data & Analysis Objective There is a company called Nerdina Entertainment (Nerdina for short). It's been decided to optimize the operation costs of 4 departments (see below). These have 4 types of specialists on staff. Each of the 4 types is characterized by three base properties: pay rate per month, gallons of coffee consumed per month and (just for the fun of it) the amount of code units (whatever this means) produced per month. Additionally, Nerdina employs a system of grades: each employee is assigned a grade that affects their monthly pay rate. Head of a department is a special status that alters all of the base stats. The summary of the available data is in the next sections. The preliminary goal is to produce a report like this: +--------------+-------+------------+--------------+------------+---------------+ | DEPARTMENT | STAFF | LABOR COST | COFFEE DRUNK | CODE UNITS | COST PER UNIT | +--------------+-------+------------+--------------+------------+---------------+ | Analytics | 17 | 142,450 | 102 | 1,037 | 137.4 | +--------------+-------+------------+--------------+------------+---------------+ | Training | 16 | 129,050 | 102 | 1,265 | 102 | +--------------+-------+------------+--------------+------------+---------------+ | Development | 36 | 335,150 | 224 | 3,175 | 105.6 | +--------------+-------+------------+--------------+------------+---------------+ | Sales | 28 | 218,450 | 131 | 1,045 | 209 | +--------------+-------+------------+--------------+------------+---------------+ | TOTAL | 97 | 825,100 | 559 | 6,522 | 554 | +--------------+-------+------------+--------------+------------+---------------+ | AVERAGE | 24.25 | 206,275 | 139.75 | 1,630.5 | 138.5 | +--------------+-------+------------+--------------+------------+---------------+ Employee Types Base stats. The figures for pay rate, coffee consumption and code units produced are per month. +----------+---------+--------+------+ | TYPE | PAYRATE | COFFEE | CODE | +----------+---------+--------+------+ | Manager | 7,000 | 5 | 75 | +----------+---------+--------+------+ | Marketer | 6,600 | 4 | 5 | +----------+---------+--------+------+ | Engineer | 8,300 | 8 | 200 | +----------+---------+--------+------+ | Ananyst | 7,500 | 12 | 125 | +----------+---------+--------+------+ NOTE: Heads of the departments earn and drink two times the base figure and don't produce any code. Grades +-------+-----------+ | GRADE | PAYRATE | +-------+-----------+ | 1 | base | +-------+-----------+ | 2 | base×1.25 | +-------+-----------+ | 3 | base×1.5 | +-------+-----------+ Staff E.g. 6×man3 translates to 6 Managers of Grade 3 +--------------+-------------------------------------------------+ | DEPARTMENT | STAFF | +--------------+-------------------------------------------------+ | Analytics | 9×man1, 3×man2, 2×ana3, 2×mar1 + chief 1×man2 | +--------------+-------------------------------------------------+ | Training | 8×man1, 3×mar1, 2×ana1, 2×eng2 + chief 1×man2 | +--------------+-------------------------------------------------+ | Development | 12×man2, 10×mar1, 8×eng2, 5×ana3 + chief 1×eng3 | +--------------+-------------------------------------------------+ | Sales | 13×man1, 11×mar2, 3×mar3 + chief 1×man1 | +--------------+-------------------------------------------------+ My Solution This is a long one. /** * input.php * the input format is determined by me based on the given data. * I've been told by the peers that the current one is way too complicated and * the array should look like this: * $input = [ * ['Analytics', 9, Employee::MANAGER, 1], * ['Training', 8, Employee::MANAGER, 1], * ... * ]; * Please advise on this point */ $input = [ 'Analytics' => [ [9, Employee::MANAGER, 1], [3, Employee::MANAGER, 2], [2, Employee::ANALYST, 3], [2, Employee::MARKETER, 1], [1, Employee::MANAGER, 2, true] ], 'Training' => [ [...

 
5:53 AM
0
Q: LeetCode: Increasing Order Search Tree C#

Giladhttps://leetcode.com/problems/increasing-order-search-tree/ Please review for performance Given a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right child. Constrai...

 
6:12 AM
0
Q: Pygame snake as first game

DionAfter poking around in some areas of python, I've decided to try Pygame. After about two hours of coding, this is what I came up with: import pygame import time import random pygame.init() pygame.font.init() WINDOW = pygame.display.set_mode((500, 500)) pygame.display.set_caption('snake') FOOD...

 
7:08 AM
-1
Q: Task with Loops in C#

MariaInsert a digit into an integer after the digit specified by the number. The digits are numbered from right to left. For example, insert after 2 digits the value 6: Original number: 123456 insert 6 after 2 category Result: 1234656 Console.WriteLine("Enter the number"); int...

 
7:27 AM
0
Q: Bash wrapper for connmanctl with autocompletion

Enrico Maria De AngelisSo the idea came from the fact that connmanctl only completes filenames/directories when used non-interactively, whereas when used interactively (executing connmanctl without arguments an interactive shell is started), it does support autocompletion, but when it comes to completing services (wi...

 
I think your question is a better fit for codereview.stackexchange.com . Stackoverflow tends to prefer questions that have a single clear right answer. See stackoverflow.com/help/on-topicPaul Hankin 27 secs ago
 
7:46 AM
-2
Q: Cut The Sticks Hackerrank solution in JavaScript

Chaitanya VI tried my solution as shown below. First I sorted the array and upon each iteration over the array I subtracted each element by the value of least number --> (tried to) eliminate all zeroes --> record length of the array after each iteration. ((arr) => { let remainingSticks = [arr.length]; ...

 
MOnkin
 
8:09 AM
I wouldn't allow this code past a code review. It is inefficient and difficult to read. — Jasper Kent 51 secs ago
 
9:01 AM
1
Q: Python Extended Euclidean algorithm + inverse modulo

ChryfiI am working on an oop RSA system in python from scratch. Therefore I have programmed the extended euclidean algorithm and with it the inverse modulo. Any feedback is welcome, also regarding efficiency. class Math: def inverse_mod(a, mod): va, y0, a0 = Math.ext_gcd(a, mod) re...

 
9:39 AM
-1
Q: MongoDB store as array or object?

IfarukiHello guys i have following structure in my mongo database: followers: [ { userID: 324, user_img: "path/to/img", name: "max" }, //many other users... ] In case i want to unfollow someone, i send the userID to my unfollow API endpoint so i would first need to ...

 
There's a specific sister site to be used for code reviews: see codereview.stackexchange.compaxdiablo 30 secs ago
 
9:51 AM
Consider asking this kind of thing on codereview.stackexchange.com — Jerry Jeremiah 39 secs ago
 
@CaptainObvious Is it just me or is the preview on this question huge?
Monking
 
10:07 AM
@Sumit I'm also not familiar with designing properties, so I don't think I'm the best source of help here. You might want to post a question on CodeReview or SoftwareEngineering (both are other Stackexchange sites, more on-topic for alternative design suggestions) — GPhilo just now
 
10:36 AM
-2
Q: Boost serialization "read access violation" when outputting to file via ofstream

Drake JohnsonI have a pretty simple Player class in a game I'm creating. After the user enters a user name, I go into a save directory that should hold all player save files. If the file cannot be found, the program is supposed to create a new player object to use for the rest of the game. Right after this ...

 
 
2 hours later…
12:14 PM
@Peilonrayz Holy jeez
That's new
 
Yeah, I guess the stars aligned perfectly for a mysterious bug
 
yay for collapsible previews :D
 
Unrelated, can you help me with a python issue? Lol
 
I can give it a go. What's up?
 
I have a project
-- /
-- /core/
-- /api/
I want files in /api/ to access /core/ but the internet is saying "you can't do that".
I.e. import core.whatever
 
12:19 PM
I have an answer that may help here, you need a properly configured environment and you can do import myproject.core.foo or import ..core.foo. I'll find it one sec
 
Awesome :D
Also, if it matters, I'm doing this for a web-app / Apache2
 
This will show you how to setup an application and library in Python. codereview.stackexchange.com/a/234109
 
Interesting, I'll check that out. That would make this whole thing so much easier.
 
posted on April 10, 2020 by CommitStrip

 
@DerKommissar Not really, I wrote a small apache site and followed the above and it worked fine. I did however use pip, or I manually installed it, to the apache environment. No-one really said to do that, but what they were saying to do was long and seemed archaic.
 
12:25 PM
Gotcha, it sounds like it should work. I'll have to play with it.
 
12:48 PM
0
Q: Partial copy constructor vs member factory method

HerpDerpingtonHave a look at this code sample I extracted from the code I am working on: template <typename I> // Used for Curiously recurring template pattern struct A { // This field (placeholder) cannot be copied, only moved, // e.g a very huge array that takes forever to copy or an // object ...

0
Q: Code structure of website API

Joshua NixonI manage the Python API for the Manganelo (and Mangakalot) sites and I am not fully convinced that the code structure I currently use is the best. (https://github.com/nixonjoshua98/manganelo) The API has various objects (MangaInfo, SearchManga, DownloadChapter) and an example of the usage are as...

-1
Q: Trigger an recuring event with Task.Delay()

AckdariI'm in an asp.net-core with .net-core 3.1 context and want the server to run code every moring 9 o'clock. For that I have implemented this code: task = Task.Run(async () => { var cronExpression = CronExpression.Parse("0 9 * * *"); while (!tokeSource.Token.IsCancellationRequested) { ...

 
Working code belongs on codereview.stackexchange.com — jmargolisvt 35 secs ago
 
1:09 PM
-1
Q: Code Analysis C# LINQ Entry() call for Insert Add

c0micrageI am looking at someone else code and am confused on the c# linq call. I reviewed some of the post here a and Add/Insert calls usually take two calls like ctx.TableData.Add(ObjectWithNewData); ctx.SaveChanges(); or ctx.SubmitChanges(); I am confused by why someone would use the following code ...

 
If the code is your own, functions as desired, and you'd like all aspects of the code reviewed, this question is likely a better fit on Code Review, but please review their help center first before asking. — Heretic Monkey 7 secs ago
 
Ben Popper on April 10, 2020
In this episode of the podcast, we talk about the history of COBOL, a “common business-oriented language”, which is suddenly missions critical to government systems, like unemployment, overwhelmed by the pandemic. After that, we chat about the supply chain in China, which pivoted within weeks from pitching Ben electronic components to offering critical medical supplies.…
 
1:28 PM
0
Q: LeetCode: FloodFill C#

Giladhttps://leetcode.com/problems/flood-fill/ An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value ne...

 
Nibjubg! Happy Friday!
 
Monking Sam
 
1:47 PM
-1
Q: Is there any faster way to solve this exercise?

xyz9Write and test your own double abc (char * b) function in the program, taking in the form of a string the fractional binary number of the form "1101.101" and returning an equal decimal number (here 1 * 2 ^ 3 + 1 * 2 ^ 2 + 0 * 2 ^ 1 + 1 * 2 ^ 0 + 1 * 2 ^ -1 + 0 * 2 ^ -2 + 1 * 2 ^ -3 = 8 + 4 + 0 + ...

 
2:02 PM
This answer is adapted while maintaining efficiency for k-subsets here (in a k-subsets/partitions question where this variation was asked): codereview.stackexchange.com/a/240277/218590Gregory Morse 50 secs ago
 
Ryan Donovan on April 10, 2020
This week, we’re going deep on dark mode, balancing code quality with deadlines, and rolling your own chat apps.
 
2:24 PM
-1
Q: Sync objects in array

AlexI have the following input: [ { "Items": [ { "Timestamp": 1584811808412, "Value": 2500.0, "ObjectId": "ObjectX", "Error": null }, { "Timestamp": 1584811818472, "Value": 2500.0, "ObjectId": "ObjectY", "Error":...

 
Is there a better way to python this? float(latency[5].__str__())
 
@DerKommissar Yes float(str(latency[5]))
 
The problem is latency[5] comes back as a Decimal(<whatever>), so I need to convert it to a float for JSON serialization.
 
You should normally never use __str__ or any other dunder methods as there is normally a builtin for it.
As for Decimal, can you not just use float?
 
Gotcha, and I don't have a choice it comes from pg8000.
 
2:29 PM
Sorry, no I mean float(latency[5])
 
Oh, I can try that
Beautiful, worked like a charm. :)
 
If you're using json then you can automagically call float on Decimals IIRC
There's some cool function you can pass to json.dump.
 
Yeah that did what I wanted, but I think it's because the Postgres driver used the Decimal type.
And interesting, because I'm using json.dumps.
result = []
for latency in latencies:
    item = {
        'DataSource': latency[11],
        'PingTarget': latency[12],
        'Interval': {
            'Date': str(latency[2]),
            'Start': str(latency[3]),
            'End': str(latency[4])},
        'Latency': {
            'Avg': float(latency[5]),
            'Max': float(latency[6]),
            'Min': float(latency[7])},
        'Packets': {
            'Dropped': latency[8],
            'Total': latency[9],
            'DropRate': float(latency[10])}}
That's what I'm rolling with right now.
I could just result.append({ ... }) which I might do, I was creating an item to REPL test it.
Yeah still works fine.
 
Eh, with that code there's not much point in defining a JSONEncoder.
 
Gotcha, I'll check it out anyway just in case I want to use it later.
My JSON objects are pretty small.
Fortunately.
 
2:37 PM
I'd use a comprehension. It seems list.append is discouraged by most now.
 
Nice
result = [{
    "DataSource": latency[11],
    "PingTarget": latency[12],
    "Interval": {
        "Date": str(latency[2]),
        "Start": str(latency[3]),
        "End": str(latency[4])},
    "Latency": {
        "Avg": float(latency[5]),
        "Max": float(latency[6]),
        "Min": float(latency[7])},
    "Packets": {
        "Dropped": latency[8],
        "Total": latency[9],
        "DropRate": float(latency[10])}}
    for latency in latencies]

print(json.dumps(result))
 
I find they allow you to get rid of a lot of noise ^^
 
Absolutely, much simpler.
 
this might be a better fit for codereview.stackexchange.com . — Dan O 30 secs ago
 
What about this one?
offset = int(query_string["ref_offset"]) if "ref_offset" in query_string else offset
agg = int(query_string["agg"]) if "agg" in query_string else agg
 
2:43 PM
Looks fine. I'd personally use offset = int(query_string.get("ref_offset", offset)) if offset is an integer.
 
They both are lol
# 5 minutes * 60 seconds
agg = int(query_string.get("agg", 5 * 60))
# 6 hours * 60 minutes * 60 seconds
offset = int(query_string.get("ref_offset", 6 * 60 * 60))

ref_time = datetime.datetime.utcnow() - datetime.timedelta(seconds=offset)
 
Nice, yeah that looks quite nice to read.
 
Last one, this might be a bit tougher.
where = ""
params = (agg, ref_time)
if "identifier" in query_string:
    where = "WHERE {0}.{1}_data_sources.identifier = :3".format(
        config.data_source.schema,
        config.data_source.prefix)
    params = (agg, ref_time, query_string["identifier"])
 
Hmm, I think that's the best you'll get.
 
I figured, it's a weird one.
 
2:47 PM
I'll write what the equivalent in 3.8 Python could look like.
 
Ok, I've only got 3.5.3 on the box this is all running on, but I'm still curious.
 
where = ""
params = (agg, ref_time)
if (identifier := query_string.get("identifier")) is not None:
    ds = config.data_source
    where = f"WHERE {ds.schema}.{ds.prefix}_data_sources.identifier = :3"
    params = (agg, ref_time, identifier)
 
Now the if is definitely different, but it's the same otherwise.
Many are not a fan of :=.
 
Yeah, it looks reasonable enough honestly.
 
2:51 PM
It lost Python it's BDFL
 
Dang
Is there an alternative to doing x.__dict__?
 
I don't really get what the fuss was about tho. After learning about it I've been like. "if I weren't targeting Python 3.5" right now I'd be using it XD
 
Hahaha
 
@DerKommissar Eh. Can you show me what x is
 
It's a class I built
 
2:53 PM
Ah so you're getting all the attributes on the class. Yeah you can use dir or another one I've forgot it's name.
dir is technically different but it allows you to build the dict
 
Oof, that's not gonna work lol
I'm gonna have to make this actually serializable
 
I'm confused now. Could you provide a little more context?
 
I built a class, I want to json.dumps it for an API
Except I can't because it's not serializable.
 
Your best bet would be to use a 3rd party library
You could use a library like dataclasses_json to automatically convert the class to JSON. Whilst the library works the code is really not great and they seem to have a lot of problems because of it.
 
It's all good, I made it work.
def for_json(self):
    return {
        "Assessment": self.assessment.for_json(),
        "DataSource": self.data_source.for_json()}
I just defined a for_json that returns a dictionary on all the objects in it.
There are only 4 so it's not a big deal.
 
2:59 PM
That seems fine. If you out grow it then at the very least dataclasses should help cut out a lot of the cruft
 
Just to make it clear. This comes up in code review that I was performing and found it. My opinion as people started pointing out - it's a UB. Looking for someone that can find the actual std clause/paragraph or something along those lines. thanks. — Kobi 5 secs ago
 
-1
Q: NodeJS - Auto Module Loader

Dewald ElsI took some time to try and solve a problem. I am building a basic Node + Express API. In the app I have created a models folder and will be adding new models as I continue development. I attempted to write a small autoloader for a directory to automatically load and export my models. This code...

-1
Q: Time diff in days

daisenI have following snippet import datetime as dt end_date = dt.datetime(2020,04,10,0,0,0,0) current_date = dt.datetime(2020,04,10,0,0,0,0) diff = end_date - current_date days = diff.days + (1 if diff.seconds > 0 and diff.days > 0 else 0) I need 0 when day is the same and 1 or more when day > 1. ...

-1
Q: Caesar chiper table in Haskell

BeeHivieI know there are thousands of Caesar chiper code out there but I still couldn't figure out how to implement the table itself. I want to implement a Caesar chiper in Haskell (using lower case only).Most importatnly I'd like to create a table that looks like this if we shift everything by 3 to the...

 
3:25 PM
possible answer invalidation by daisen on question by daisen: codereview.stackexchange.com/posts/240281/revisions
 
3:40 PM
-1
Q: Why I get `undefined` in my custom React.createElement?

Vs99I study JS and React. I can't understand why in my custom React library when I pass React.createElement, I get undefined for this: React.createElement ("span", undefined, "Hello") function createElement(type, props, children = []) { if (Array.isArray(children)) { const setChildren = chi...

0
Q: Using Python's gettter/setter For dictionary creation

SumitI have written below code to create/get a dict with n number of key, value pairs. Main idea is to use the same instantiated class object across my code and play around with k/v pairs. Current implementation: class DataForm: def __init__(self): self.data_dict = dict() def creat...

 
4:18 PM
0
Q: STL vector Implementation (extremely basic), why it works

HBatalhaI just started a book on algorithms and data structures. So I am trying to learn how to implement my own STL vector version (starting with integers and then moving to template). So after reading a little (too little) and seeing other people's implementation here on CodeReview I started babysteppi...

0
Q: XML and XML schema definition

Aashish PawarI want to define the XML schema for an XML representation of shopping order data. See following requirements The XML representation of order should contain order id, description, request date, and many line item Each line item element should contain book, quantity, and price. Price (which...

0
Q: Advice on path-finding visualisation program

James RobinsonIm looking for some help on improving my code which visualizes path-finding algorithms. The code is working however I know it can be improved. Any suggestions would be appreciated. Github code - https://github.com/James-Charles-Robinson/Path-Finding-Visualisation-with-Pygame Code import pygame...

 
4:55 PM
0
Q: Encode Huffman Trees Scheme

carbonblastI am trying to write a function, (codeWords t), which traverses a huffman tree (adds #\0 when it goes left, adds #\1 when it goes right...) and returns these values in pairs of the symbol at a leaf along with its associated encoding as a string over the characters #\0 and #\1. Similar to what thi...

 
5:30 PM
possible answer invalidation by Joshua Nixon on question by Joshua Nixon: codereview.stackexchange.com/posts/240270/revisions
 
6:11 PM
0
Q: OOP pure JS two Roint Range Slider

lucaplaysthenoobI'm currently trying to learn how to OOP in JavaScript by making use of ES6 classes. As an example I created this Slider using classes. I didn't find any class example where the DOM is highly involved class Slider { constructor(_options, _className) { this.options = _options; this....

 
6:30 PM
0
Q: 3 Pack Collectible Card Sorter, High-Value Return

Jcode94New to Python and recently turned in an assignment that, in the grading, was reviewed as 'very bad' and 'doesn't use sets' with no further elaboration. Wondering what I can do to improve this code. The assignment instructions and restrictions were as follows: Problem : Card Collections (car...

 
6:49 PM
-1
Q: Using OpenLayers in React

user3566338I am student who is creating a big project trying to display data and information on maps using Openlayers and React. At this point I have created a basic two page project where the map is the central piece of the application. For every page I have one main Component that contains its Sidebar, th...

 
7:03 PM
if run using shell command then it will not return function value to script ...take a look at this exampleryyker 30 secs ago
 
-1
Q: Consuming an API with Pagination

Henka ProgrammerGiven a Tax type and city, access a REST API to get the total amount of taxes with the given type and at the given city. This information is to be grouped by users and ordered ascending by numerical id. To access the log of taxes, I perform an HTTP GET request to https://api.doit.com/taxes/search...

 
8:04 PM
-1
Q: How can I optimise this code further?

Serum#include<iostream> #define MAX 1000000 #define lli long long int using namespace std; lli factor_2(lli n) { lli cnt=0; while(n%2 == 0) { cnt++; n = n/2; } return cnt; } int main() { lli a[MAX]{0}; lli i, t, n, in, cnt=0, get_factor, sum, j; cin>>...

 
Hello! If you're looking for overall critique and review of a working piece of code, you may wish to post this to CodeReview.SE instead. — Brian 51 secs ago
Make what more efficient? You haven't even shown the inefficient version. Code Review is the appropriate place to post when you have working code and you're looking for advice on how to improve it. — Barmar 42 secs ago
 
@CaptainObvious looks like user has multiple accounts, given Duga's report of comment by Brian on this post that has identical code
Serum == Merus ?? just reverse the user...
 
8:23 PM
-1
Q: Python extended Euclidean algortihm + inverse modulo

ChryfiI programmed the extended Euclidean algorithm together with the inverse modulo because I am making an RSA system from scratch. Any feedback regarding efficiency etc. is welcome :) def ext_gcd(a, b): a0, a1 = a, b x0, x1 = 1, 0 y0, y1 = 0, 1 while a1 != 0: ...

 
@SᴀᴍOnᴇᴌᴀ Strange that the location for one is USA the other is Indonesia. Something smells a little fishy...
 
8:37 PM
yes...
 
9:01 PM
-1
Q: LeetCode: Deepest Leaves Sum C#

GiladGiven a binary tree, return the sum of values of its deepest leaves. Constraints: The number of nodes in the tree is between 1 and 10^4. The value of nodes is between 1 and 100. Please review for performance and style using GraphsQuestions; using Microsoft.VisualStudio.TestTo...

-1
Q: best method to draw in a agme on android

aqwAfter several tries to draw my player, enemy object in my game, I often face a problem rendering either because the method cannot be resolved or because I have a player and enemy classes both extend Sprite class. First, I tried representing them as Bitmaps, after that as drawables: drawable pla...

 
Maybe Code Review is a better place to ask. — pzaenger 21 secs ago
 
9:39 PM
-1
Q: Java JPA - searching for user across multiple tables

Maciej CyganI am working with a legacy database that isn't structured in the best way so to speak. I have 3 tables account users stats_agents Now the account table holds the 'master account' details with some extra account settings/parameters The Users table holds the details of all users that are defi...

 
9:50 PM
 
0
Q: Mail Crypt CLI encrypted email wraper for Gmail

Joe SmithI've spent the past few days writing a python based client that allows you to locally encrypt your message and send it through Gmail. The encryption scheme is based off of hybrid RSA/AES encryption, where the message body is encrypted with AES and the one time session key is RSA PKCS1 OEAP. It al...

0
Q: POLYMORPHISM - Design a database connection and command

Milliorn> Exercise 1: Design a database connection To access a database, we need to open a connection to it first and close it once our job is done. Connecting to a database depends on the type of the target database and the database management system (DBMS). For example, connecting to a SQL Serv...

 
 
2 hours later…
11:46 PM
I wish I could dump code in an answer and get an upvote, like this one did
 
I would say a more suitable place to ask this question is at codereview.stackexchange.com. If you decided to do so, please make sure to follow the guidelines in the Help Center. — Ahmed Abdelhameed just now
 

« first day (2533 days earlier)      last day (1467 days later) »