Portable code can be run with little to no modification in multiple environments. Portable applications can be run from, for example, a USB drive without modifying a computer's environment.
1
vote
1answer
18 views
Secure file system utility functions
For Khronos, I've had to develop these utility functions to help me deal with storing the .wav files. However, they could also be used in a variety of ...
5
votes
0answers
58 views
The birth of my intellegent assistent: Khronos
I've done a lot of reworking to this main file recently, in regards to using a new speech recognition engine and integrating the last reviews suggestions. My question before is going to be phrased ...
1
vote
0answers
39 views
Portable periodic/one-shot timer thread - follow-up
This is a much improved version (I hope) of code in this previous code review of mine.
I have:
renamed several things. Are the names good?
made it lazily start the worker thread only after the ...
3
votes
1answer
62 views
Reverse Polish notation calculator similar to dc on Unix/Linux systems using dynamic libraries
This problem is using dynamic libraries so that additional calculator functions can be added by dropping a library into a specific directory.
What I'd like to get out of this code review is:
What ...
7
votes
2answers
59 views
Portable byte order conversion
I'm trying to improve the portability of a file format converter, specifically to POSIX platforms other than Linux. I'd appreciate a review of the following functions used for converting between ...
3
votes
2answers
43 views
Constraining stdin in Python, v2.0
Rags, again.
This is the rewrite of Read stdin like a dictator.
From that post:
All too often I find myself wanting to allow only a certain list of characters to be written to stdin, and only ...
3
votes
1answer
62 views
Timestamp function with millisecond precision
I want to be able to print timestamps with milliseconds precision and time_t doesn't provide this. I also want the code to be portable, so operating specific ...
0
votes
2answers
42 views
3
votes
1answer
65 views
Non-curses pager in C (revision 2)
In this revision (follow-up of this post) I've fixed reading from stdin, and also tried to minimise the damage caused by typing additional characters. You might want to see my original post on this.
...
1
vote
0answers
43 views
Check if page was scrolled all the way to the end
I am not sure if this is the best way of doing this or if it works in all situations.
...
5
votes
1answer
37 views
Pseudoportable C script pattern - follow-up
See the initial/previous iteration.
I have rewritten the script following the answer of @200_success.
Now it looks like this:
...
5
votes
1answer
61 views
Pseudoportable C script pattern
(See the next iteration.)
From time to time, while working with a command line in *nix family of operating systems, we have to write those scripts doing a rather specific task. Usually we use ...
0
votes
1answer
50 views
Print a “shebang” line, or prepend it to a file
This is a sort-of-useless "utility" I wrote to learn my way around shell programming better.
My concerns are:
Is the code readable? Could it be more efficient, or just simpler? The logic ends up ...
0
votes
0answers
46 views
jQuery plugin that filters and orders boxes with CSS transform
I made this jQuery plugin based on MixItUp and Isotope. In short, one needs to create an <ul> list filled with <li> ...
2
votes
2answers
109 views
Colored <hr> in emails
Sometimes, I need to change the color of <hr> elements in an email.
The only achieveable way is by using CSS. But not every email client supports CSS. Most ...
7
votes
2answers
55 views
Printing the days of the week for every day this year
@chux pointed out that my attempted solution contained several problems. Since I screwed that up so badly, I figure that I should put my revised solution up for review.
...
12
votes
1answer
130 views
Khronos: Primary CMake file
So recently I made a large project of mine open source: Khronos. I will be dissecting parts of it so that I can have it reviewed more easily here and so that the project as a whole will be improved. ...
6
votes
1answer
218 views
ANSI colors cross platform
I am trying to write for both NT and POSIX (my two usual platforms) and have come up with the code below. The clrs code I refer to is apparently from blender build ...
3
votes
1answer
68 views
Userscript hiding boxes on linkedin
When looking at people you may know on LinkedIn (requires you to be logged in) there are sometimes some annoying boxes that are for people who are email contacts but not on LinkedIn. I don't want to ...
11
votes
2answers
415 views
jQuery plugin that makes a slider out of an <ul> list
This is one of my very first jQuery plugins. In short: it makes a slider out of an <ul> list filled with <li> items ...
6
votes
3answers
119 views
Cross-platform performance and statistical information script
My usual disclaimer, I'm new to Python and scripting and I'm still studying the PEP8 guide, so please forgive any huge failures with respect to syntax, formatting and style. I'm open to any ...
8
votes
1answer
140 views
Looping until browser document is ready
I made a do...while loop in order to wait for the web browser to load completely in order to enter username and password. I don't know whether this impacts the ...
2
votes
3answers
124 views
Simple and safe file reader for C
As an exercise to improve my coding ability in C, I have attempted to write a simple and safe file reader. I believe this should be portable as well to major platforms (correct me if I'm wrong). For ...
3
votes
3answers
1k views
Unix shell function for adding directories to PATH
Adding a directory to the PATH in Unix/Linux is a very common task. However, what if the directory is already in the path? My goal is to write a shell function ...
3
votes
3answers
479 views
More portable toLower() implementation
I am challenging myself to try to attempt to write a function that is as efficient, portable and failsafe as possible. The function is very simple and just converts a ...
0
votes
3answers
65 views
Data-entry keypads for entering addresses
This was a little app I wrote looking for a way to create consistency in the way employees taking phone orders enter the address.
The purpose of the app is to require a user to enter a valid ...
6
votes
2answers
757 views
Speed optimization for block XOR
In code I'm currently maintaining, there is a need to do very many repeated XOR operations of blocks of memory. The block size in my case is always 16 bytes. Because the code is executed very ...
1
vote
1answer
161 views
Load stylesheet for “rem” value fallback to “px”
I'm applying fallbacks to rem values only if required (you know, the whole progressive enhancement train), without conditional comments (because it's not just an IE ...
8
votes
2answers
118 views
Making multiple copies of a pattern
Here's a function for making multiple copies of a block of memory in another block of memory. It handles the case when the size of the target is smaller than or not a perfect multiple of the source ...
6
votes
2answers
86 views
Inferring Memory Alignment
The following code is intended to infer the alignment of double.
My questions include:
Is there a better to do this? Either by refining the code or using an ...
2
votes
2answers
614 views
Preventing XSS attacks with proper escaping
The following page simulates XSS attacks and successfully (?) prevents them. I want to know if I've missed any other major attack vectors (or small ones) and/or if anyone has suggestions as to ...
7
votes
1answer
1k views
Restricting user to one open tab in browser
I had a requirement to restrict my web site's users to just one open tab in the browser. I am aware that this is not the best thing to do in terms of general user experience guidelines but its an ...
5
votes
1answer
244 views
Vertical-align in Nested Column
Requirements:
There are two columns. The left column is fixed width.
The height of two Column should be the same.
Left column contain a title (can be multi-line) and an Image (limit max width to ...
3
votes
1answer
95 views
Parsing OS names
I am making a function to return a two-item tuple of ('os basename', 'os distro'). For instance, the return for Vista should be ...
6
votes
1answer
188 views
Program that replicates itself
While misreading the beginning of Stage I of this classic paper by Ken Thompson, I decided to create program that replicates itself.
Let's say this program is called Replicator.exe. Upon running it ...
-1
votes
2answers
216 views
A platform-independent implementation of “which” in Ruby
I like to know if there's anything that I may have missed in this implementation. The method tries to provide the absolute path of the binary or script which is likely to execute based on the provided ...
4
votes
1answer
90 views
Pathname matching and listing program
This Python 3 program outputs a list of all pathnames in the filesystem
that match a list of rules taken from a file. You can add and remove
sets of pathnames.
The original purpose was to generate ...
4
votes
2answers
183 views
JavaScript parallax cross-platform efficiency
I wanted to get some feedback on this JS I am working on. It works wonderfully on my desktop, but on my and my friends' laptops (especially Safari) it is very slow. I need some pointers on improving ...
8
votes
1answer
207 views
Recording audio in C 2.0
I posted my audio recording program to Code Review before, and received a stern review along with the other reviews that caused me to rewrite the entire code base. Here is what I would like reviewed:
...
12
votes
2answers
15k views
Windows keylogger in C
I have had this keylogger code for a while now (a few years*), and I figured I would put it up for review. Here is what I would like reviewed (in order):
Portability - right now, this program can ...
5
votes
2answers
193 views
VLC media player watchdog daemon v6
This question is a follow-up to a previous version of this program, which I wrote because I found it annoying that VLC Media Player (which I love) prevents the screensaver from starting after playback ...
4
votes
3answers
3k views
Checking endianness at compile-time
I've tried to make a portable way of ensuring endian-specific code gets generated at compile time using C++11, however I only have a computer with Windows on it to test at the moment. Because of this, ...
8
votes
1answer
328 views
VLC media player watchdog daemon
I'm looking for bugs, ways to make it more portable or standardized, improvements of any kind. Seems to do what it is supposed to on my Ubuntu 12.04 PC.
...
15
votes
1answer
1k views
Brainfuck-to-C compiler written in C++
This compiler, implemented in C++, takes brainfuck code and produces a valid (but still obfuscated) C program, which in turn can be compiled to a native binary.
Expected usage is as follows:
Build ...
7
votes
2answers
594 views
Serial port library across different compilers
I'm writing a C++ library with MinGW (4.8.0, DW2, POSIX) compiler. But this library must be used by another compiler. I've read this post, so I've re-written the C++ library interface in this way:
...
5
votes
1answer
147 views
Portability and “dark corner” gotchas in this “watchdog” program
The following program is intended to "watchdog" a child process, and all subprocesses the child spawns.
The intended behavior is:
A child process (as specified on the command line) is run in a ...
5
votes
2answers
1k views
Portable Python CSV class
I have been working on a project where I needed to analyze multiple, large datasets contained inside many CSV files at the same time. I am not a programmer but an engineer, so I did a lot of searching ...
2
votes
1answer
1k views
AES-128 encrypt/decipher class
For the past few days I've been working on a AES-128 encrypt/decipher class. I needed something very scaled down from Cryptolib so that I didn't have to constantly ...
16
votes
1answer
680 views
Portable CMake script
I'm trying to write a portable CMake script for a simple Qt application. The target platforms are Win and Mac OSX. But as you can see, it's quite a monster already.
Are there any CMake profs? Can you ...
3
votes
3answers
202 views
Optimizing a JavaScript snippet for portability and readability
We have an in-house time-tracking application at the office.
We, the employees, can view an overview of our hours on a web page. This web page renders a table, with worked hours per day in table ...