All Questions

Filter by
Sorted by
Tagged with
1
vote
0answers
41 views

Implementation of SCPI for control of test instruments

I work with electronics test equipment. I like to be able to automate tests using their remote control interfaces. I have built a pattern, a few base classes, that I can apply to all devices that ...
3
votes
0answers
21 views

SPI controller in VHDL

I designed a (q)spi controller which can be configured over generics in QSYS(Quartus) and acts as an avalon slave. The documentation started in german, so please bear with the partial translation. I ...
-3
votes
0answers
23 views

Is this a reasonable way to represent a test instrument that supports SCPI? [on hold]

I work with electronics test equipment. I like to be able to automate tests using their remote control interfaces. I have built a pattern, a few base classes, that I can apply to all devices that ...
1
vote
1answer
37 views

Compare multiple values of an array in the same time in Javascript [on hold]

As of now the below code working As expected. But in future if the newFilterArr have new record again I want to reedit this functionality. So how to overcome this? ...
6
votes
1answer
64 views

Mvc design for FTP Client

This app will be a FTP desktop application meant to transfer files between a server and a client, pretty much like Filezilla, there is no server code to show as I will not implement Network features ...
-4
votes
0answers
18 views

RegEx validation: not sure if anchors are okay [on hold]

I need to grab specific fields from several csv data log streams using a PCRE RegEx. All the fields in the log files are on a single line. ...
3
votes
0answers
24 views

Resizable split DIVs Vue.js

Hi fellow Developers/Programmers! I just started Developing Web App (Vue.js) for my company for around 1-2 months. Therefore, my knowledge and experience in HTML, CSS and Javascript is kinda shallow. ...
1
vote
0answers
56 views

Python Bubble sort

...
3
votes
0answers
34 views

Repeater for blocks of Ruby

I've written a module for repeating blocks of code, generally to cover issues related to eventual consistency and testing screen elements which may take some time to fully load. It looks like this: <...
1
vote
1answer
75 views

Ternary search tree implementation in python 3

I have implemented a Ternary search tree. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. ...
-5
votes
0answers
18 views

redirect to a new page if input value exists in database [on hold]

When I key in a value that exists in the database (the column name is "job_no"), nothing happens i.e. neither show errors nor redirect to another page. Please help me have a look at codes. What am I ...
4
votes
1answer
87 views

A Graph implementation in C++

I am building a generic Graph. I want to know whether the current design is fine. Are there any memory leaks ? Any suggestions are deeply appreciated. GraphCode ...
5
votes
3answers
458 views

Largest number order in string

Given a string, assuming the string is numbers only, rearrange the string to that it is the greatest possible number. Below is my solution to the problem above. I'd like feedback mainly on the ...
5
votes
2answers
867 views

Sum of all digits in a string

Given a string, return the sum of all the numbers in the string, 0 if none are present. Below is my solution for the problem above. I feel like this can be turned into one line. I would really only ...
6
votes
0answers
53 views

Optimizing a raycasting/voxelspace algorithm in Pygame

In the past three days, I've been developing a simple raycasting algorithm. I've made the renderer work as I'd like to. However, it is extremely slow (5 frames per second) because of two things (as ...
6
votes
1answer
52 views

Convert a Hex value string to an ASCII Text String

We had a little bit of fun in the 2nd Monitor this morning, one user greeted another with a hex string. It turned out that the user being greeted deals with Hex Dumps enough that they were able to ...
3
votes
0answers
37 views

Excel Import Data from Different Workbook Dynamic Headers

I have this code below that copies data into a master workbook, in sheets "Inputs1", by matching the column headers from the master workbook with the source workbook. If a column header matches, it ...
2
votes
0answers
26 views

Inherited class calls initialization code in base class [on hold]

I am interested in hearing your opinion on the approach I have taken to have inherited classes initialize their base class. Here's a Machines collection class from that maintains a list of Machine ...
2
votes
0answers
29 views

Validate (Possible) File/Directory Path

I am working on a "comprehensive" library for use in my internal applications and I have created a working method (as far as all of my testing has shown thus far) to ensure that a file/directory path ...
4
votes
2answers
76 views

Query to plot a histogram of song ratings

I wrote code to plot a rating distribution, which looks like this: The most important function is the stats function: ...
5
votes
1answer
48 views

GMAIL API -Create/Send/Search messages for keyword

I have written below code using GMAIL API reference which creates a basic message, sends it and also lists all the messages from user's mailbox matching a keyword.It works fine. Looking for experts ...
2
votes
0answers
36 views

SharedPreferences singleton wrapper

I was wondering wether my implementation of the PreferenceService below is thread safe or could cause memory leaks. Android Studio gives me the warning "Do not place Android context classes in ...
3
votes
1answer
38 views

Closest element in std map when discarding values

I have the following situation: I have two std::map<int,float> and I want to go through the first map one by one and find the element in the second map with ...
0
votes
1answer
69 views

database connection, fetching rows and handling error in csharp

Fetching database records and displaying as JSON. Asking for revision to ensure if everything's ok, i.e. connections are properly handled and closed in case of error. ...
-4
votes
0answers
42 views

Writing a large CSV file write to disk in C++ [closed]

I need to write a large csv file to disk. I've reduced the problem to the below code. When I compile with VS 2017 run on my Windows 7 box it runs on average in 26 seconds. Could someone suggest a ...
10
votes
3answers
611 views

Generating sequential alphanumeric values that match a certain pattern

I'm working on generating large volumes of test data for some performance testing. Part of this is going to involve generating a lot of values that represent an "MBI", which is a certain kind of alpha-...
7
votes
1answer
46 views

Rust echo implementation that supports command line options

I rewrote echo from the manpage to learn Rust, and got the following: ...
3
votes
3answers
83 views

How to write this method with similar checks and multiple returns more elegantly? [on hold]

I have written the following method which works as expected. But is there a way to write this more elegantly in Java 8? Appreciate any feedback. Thanks. ...
4
votes
1answer
53 views

Singly linked list implementation in python 3

I have implemented a Singly linked list. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. ...
3
votes
0answers
85 views

Calculating the total sum of inversion count for all subarrays

My approach was to visit all inversion count pair and count how many subarrays these pair contribute. Visiting every pair requires \$\mathcal{O}(n^2)\$ time, but I want an optimized version of this, ...
5
votes
1answer
59 views

Work-In-Progress Lexer

So, purely out of desire to learn, I decided to take on a project of making my own very basic programming language from scratch. After which, I made a lexer. I've tested the lexer (but only a bit) ...
5
votes
1answer
44 views

Image tracking code using opencv in python

I wrote this code to track small moving objects falling down a chute. The code works buts runs too slowly: using 60 FPS 1920 by 1080 footage the code only runs at about 10 FPS. The problem there is ...
5
votes
1answer
37 views

Calculating silence in a WAV file

I made this script to calculate the amount of silence in seconds in an audio file. Is this a good method to do this, and if yes, can it be improved? It takes about 4 seconds for 20 audio files of 100-...
1
vote
0answers
25 views

Thread await and execute different methods based on some event or value

Use case: I am writing a proactive session updater; The use case is for parallel API calls or sequential API calls intercept the API call and check whether token is valid. If token is valid ...
5
votes
1answer
240 views

Bash script to check available name in Github

I just wrote this script to check if the name (that has 2 characters: 1 alphabet and 1 number) in Github is available or not so I can accompany this name. Here is my script: ...
1
vote
1answer
59 views

HashTable implementation in Python 3

I have implemented a hash table. It works well. But if you think something needs to be improved, say it. This code was tested in Python 3.7.4. ...
7
votes
3answers
156 views

Optimizing Conway's Game of Life in C++

How could I further optimize my implementation of Conway's Game of Life? And how would you critique my current strategies? I'm taking a C++ optimization class, the deadline has passed and my ...
3
votes
0answers
44 views

Driver program using custom 3D game engine

I am working on a custom game engine and have been fleshing out the various submodules (meshes, physics, shading, etc.) Here is a sandbox program that exercises the newly finished camera system. ...
4
votes
1answer
49 views

Implement HTTP server using libevent

...
3
votes
1answer
42 views

clean approach to decorator that takes optional keyword arguments

I write decorators a lot in my work. Sometimes you need to write "decorator that takes arguments", it usually turns out to be something like this: ...
6
votes
2answers
219 views

Tokenizing SGML text for NLTK analysis

I have an NLTK parsing function that I am using to parse a ~2GB text file of a TREC dataset. The goal for this dataset is tokenize the entire collection, perform some calculations (such as calculating ...
0
votes
0answers
40 views

Bubble sort optimization

This bubble sort code is very slow compared to the original. ...
7
votes
2answers
79 views

Java command-line API client to fetch Bitcoin exchange rates

I am building a simple Java command-line application. And I want to know the best practice and make my code clean. Can anybody suggest to me how many different classes I can make and what more method ...
1
vote
0answers
20 views

Proper implementation of Django model inheritance architecture [closed]

I'm building simple Django app for reviews of diffrent objects (restaurants, car services, car wash etc), so I started with the app, but soon I faced first problem, every object have features (but ...
3
votes
1answer
27 views

SQL query on relational schema

I'm trying to find the best solutions for operations on the following database: ...
5
votes
1answer
65 views

Educational implementation of SHA256 in Rust

A few weeks ago I decided to have a look at the Rust programming language. After a few standard exercises I chose to try to implement the SHA256 hashing algorithm, because why not. The algorithm's ...
7
votes
3answers
136 views

Extremely basic login system in console

This is my first C# project. I still am a noob to programming, and while I'm happy I carried out this project, I know that my code needs A LOT of improving and that's why I posted it here. This code ...
11
votes
2answers
312 views

Self-inflicted killing utility

If you need to kill the same process that you're in (for testing purposes or whatever) this code will do it. A definitive, quick, unmerciful dead of the current Java program/app. Not a System.exit(0) ...
-4
votes
0answers
37 views

Memory Leak fetching data from SQL DB [closed]

I have created a simple Data Fetch method which fetches data from SQL DB. Each time I fetch data by calling this method the memory grows (application pool memory). When I explicitly call ...
4
votes
1answer
55 views

Rendering the AuthorName using the DOMParser to read XML

I need to concatenate the LastName and Initials and all of that authors affiliations. Is there a better way or faster way to do ...

15 30 50 per page