0
votes
0answers
2 views
Time Complexity Analysis,Linear Sliding Window Algorithm Fails in SPOJ Aliens in a Train?
I need to find the largest interval with Value Less than a Limit Lt.
The Data is as Follows
For Every Test Case T
Number of elements N , limit Lt
N number of elements data
I wrote the ...
0
votes
0answers
7 views
JavaScript implementation of Pascal's Triangle [on hold]
I'm working my way through teaching myself JavaScript. If someone could critique my implementation of Pascal's Triangle I would be very grateful.
My code is hosted on JSFiddle.
1
vote
1answer
12 views
Ordered dictionary in swift 2
Loosely basing myself on this blog post, I implemented an ordered dictionary. In essence, it's a wrapper struct for a list of tuples with some initialisers and some functions (map, filter, toArray, ...
0
votes
1answer
15 views
Custom MySQLi connector class for PHP
I have written a class that connects to a database using MySQLi and has methods for the connection itself and returns the instance of the MySQLi class.
This works, but feels a little "clunky" and ...
2
votes
2answers
84 views
1
vote
0answers
12 views
Word Counter Project
I recently read K&R The C Programming Language and wanted to write a small program to count the occurrence of each word in the input (std-input - I piped a file with all shakespeare pieces in ...
0
votes
1answer
16 views
WCF service and database
I have a WCF service that work with databse. The service should handle incoming message and store messagId into database. Please suggest me how can I improve it?
...
0
votes
0answers
13 views
Do i need to wrap all my code into functions because otherwise i get undefined error
So i'm refactoring a bit of code where i used local storage. but now i'm replacing it form data from the database.
I got a service where i get the data from with this function:
...
0
votes
1answer
9 views
Configuring a date picker with support for disabled dates
I'd like to see if I can somehow make this loop more effective (smaller?). I'm using MultiDatesPicker to make a reservation plugin. And I've set everything right, and everything works, but I'd like to ...
1
vote
1answer
23 views
Improving Custom Comparator compare method
I have the class SeguimientoSeccion with this relevant attributes
...
3
votes
0answers
31 views
Combating magic strings in a web application
I'm on a quest to combat all the magic strings which tends to pile up in an ASP.NET MVC application.
All reviews will be highly appreciate but please note that:
Some of the classes contains more ...
2
votes
1answer
40 views
Find the Nth number divisible by only 1,2,3,5,7
First post here! I recently participated in a small friendly competition and this was one of the questions:
A number whose only prime factors are 2, 3, 5 or 7 is called a humble
number. The ...
4
votes
1answer
13 views
Python differential analysis of heat loss across a pipe
I made a differential equation solver to forecast heat loss through a pipe with heat loss coefficient contours. It does what I want it to do but I had to use global variables to change the outputs of ...
0
votes
0answers
25 views
Visitation in constant expressions
I tried to implement visit function (like boost::variant::apply_visitor(Visitor & visitor) member function, but better), ...
-1
votes
0answers
13 views
advice on my current progress in battle simulation [on hold]
I would love to hear any feedback on the current status of my game. Any advice on how to better utilize classes and any other tips would be greatly appreciated.
...
-2
votes
0answers
14 views
Stop Overwriting in a file in java [on hold]
The following codes for face detection and entering axis values in a file. The coding works perfectly. But when I run the program, it is automatically overwriting the the axis value from the first. So ...
0
votes
0answers
5 views
how to check a value or one after it? [migrated]
I'm writing a guessing agent for a random number generator. What I currently have written is
...
-4
votes
0answers
14 views
2
votes
1answer
22 views
A simple parcel checker Python script
My current student accommodation uses a manual paper and pen system for checking if students have mail so I made this simple Python script to help mitigate the problem of manually searching through ...
1
vote
1answer
23 views
Dynamic CSV Formatter
I made a dynamic CSV formatter as a personal challenge after having to hardcode a behavior to convert some data to CSV earlier. You input any List that contains supported types as properties (all ...
2
votes
0answers
25 views
Cat Clicker MVC
I'm training my coding and wish you guys to see how my code is. I made a cat clicker based on the MVC pattern.
Basically it shows a list of cats and when you click a cat name it shows an image, and ...
0
votes
1answer
32 views
Dictionary GetValueOrDefault
I'm pretty sure there's no better way to do this but I thought a consensus on here might be nice. Let me know what you think.
...
5
votes
0answers
18 views
Poor Man's UnDecorateSymbolName
Following is my hand-rolled implementation of name demangling for names generated by Microsoft's compiler, partially reimplementing the UnDecorateSymbolName WinAPI ...
0
votes
0answers
10 views
Unit tests for a repository with the help of AutoFixture
I find it hard to do a test for a repository and very time consuming.
Things I think about when creating unit tests for a repository:
Should I skip creating unit test for them?
Should I create an in ...
0
votes
0answers
18 views
Printing job task
Now I have task very similar to this:
Job is a group of print items. For example, a job can be a run of
business cards, envelopes, and letterhead together.
Some items qualify as being ...
0
votes
0answers
12 views
Perceptron with 2 output neurons and binary input
To the best of my knowledge I've implemented a functional version of the perceptron algorithm, but as my knowledge is not so developed as of yet I'm wondering if I've done it correctly or not.
What ...
2
votes
1answer
11 views
3
votes
0answers
19 views
Example script for teaching DDL and CRUD/DML operations
I have taught some SQL to others before, and I thought of making a script that has these attributes, for the purposes of teaching:
Fully functional to run on local DB instance with no fuss
Easy to ...
3
votes
1answer
23 views
is_Prime() function on PHP
I tried to make an is_Prime() function in PHP. What do you think about this code?
...
-2
votes
0answers
8 views
Pyhton count number of words before specific word? [on hold]
anyone know how to do this?
sentence= input ("type a sentence: ")
total=sentence.count ("the")
print (total)
this works it just that i want to count the words ...
1
vote
0answers
19 views
RX UDPClient that listeners for messages from devices from a list of ports and subscribes to data to post to Azure Event Hub
I have some code which rolls through a list of ports and sets up a stream containing the UDP Buffer contents which can be subscribed to.
This code seemed to be ok in early tests and handled all the ...
-5
votes
0answers
14 views
1
vote
1answer
15 views
Giving money to the bank
Lets say we need to write an algorithm for giving money to the bank. We need to know interest rate, money which we put every year on our account, and amount of money we want to get. F.e int. rate is ...
0
votes
0answers
5 views
Better filtering in Angular factory
I've just started my adventure with AngularJS.
I'm 'old school' programmer (C, C++), and I have step-by-step, algorithmic thinking. I'm writing some code in Angular + Django and I know that this code ...
-3
votes
0answers
7 views
Set Hyperlink to a label in excel cell using Apache POI [on hold]
I am working on a small tool using Java to update the Hyperlinks in an excel workbook automatically. I am using Apache POI API . Some of the cell has text and a URL with label. how would i replace the ...
3
votes
1answer
29 views
Email checker ('@' sign, provider, domain extension)
To learn about classes, I chose to create a little something that checks if you have included the following:
@ sign
Provider (e.g. 'hotmail')
Domain extension (e.g. '.com')
It also checks if you ...
2
votes
3answers
245 views
Merging two files into one .CSV
I'm relatively new to Python scripting. I made a script that takes two raw data files and merges them into one CSV file, but it takes a long time to complete. Are there any logic problems in this ...
0
votes
0answers
19 views
RockPaperScissorsV2 follow-up Advanced
I have posted my first version of RockPaperScissors a while back. It was on an old version of python with improper use of some functions. This version was updated to a more recent version of python ...
-3
votes
0answers
11 views
On Javascript code Where, when, how, check function arguments??. Best practices [on hold]
I have this functions definitions:
...
2
votes
3answers
58 views
Algorithm to add all lucky numbers under [N] to a Vector
A lucky number is defined as a positive integer whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. I need to ...
-3
votes
0answers
10 views
Error with HTA reading pwdLastSet AD attribute [on hold]
We have an AD domain that is at 2008 R2 levels. I have written a HTA which I use by right-clicking on a user from within AD Users & Computers and then selecting the HTA from the context menu that ...
1
vote
0answers
18 views
Cross validation of gradient boosting machines
I am fairly new to Python. I implemented a short cross-validation tool for gradient boosting methods.
...
4
votes
2answers
295 views
Wrapping tuples to be used as keys in a Dictionary
I'm currently working on a project where I have to map some objects to several properties.
Basically I need a Dictionary with Tuples as keys and instances of MyClass as values.
As using tuples can ...
2
votes
1answer
56 views
Find the number of quadraples (a,b,c,d) from 4 respective arrays such that a+b+c+d=0
Given four lists of numbers, calculate how many ways there are to
choose one element from each to get a sum of zero.
The input is given on stdin, first ...
0
votes
1answer
26 views
ES6 call `this` in Array.filter
Does exist a cleaner way to call a static method inside ES6 Array.filter function ?
...
0
votes
1answer
21 views
Naive Bayesian Implementation C++
For my assignment, I have to take a data set and stratify sample it into three different training sets (one with 10%, one with 30%, and 50%). Then I have to classify it using a Naive Bayesian ...
-2
votes
0answers
23 views
Random Questions in Java [on hold]
I hope to know when I choose 4 and put Number of Questions is 10. When it running to HCF it can not running. So I hope to know how to solve it?
...
0
votes
0answers
4 views
Fill array : the best way
In this code I fill simple array with static data (Strings and images) for Model
(the specificity of the language does not matter). But I think it's not the best way to do it.
Will be glad for tips.
...
5
votes
3answers
50 views
Look-and-say sequence
Here is my code in Ruby that shows the look-and-say sequence. It shows correct result, but my teacher said, that I could actually make it better. Can you tell me what the flaws are there in my code?
...
1
vote
1answer
11 views
Enforcing Paired Statements Using ScriptBlock
I really like c#'s Using statement as it allows you to pair Open statements with their corresponding ...