instruction stringlengths 71 71.9k |
|---|
I have many thousands of image files spread around various places and would like to copy them into one directory. However, may of the files are duplicates with the same names (often thumbnails or reduced resolution etc). I want to delete all files that have the same name except for the largest.
The following code rea... |
I have created WordPress theme options using an array, and it is working. There are 5 type of input: text, textarea, checkbox, select and upload.
Please read over my code and offer some possible improvements and/or tweaks.
<?php
add_action( 'admin_menu', 'admin_enqueue_scripts' );
function admin_enqueue_scripts() {
... |
My code looks like "spaghetti code". I have yet to use OOP in PHP but I am really interested in how a good programmer would handle this many if statements. It looks like a mess.
<?php
session_start();
include './functions.php';
if(empty($_FILES['browseMovie']) || empty($_FILES['browseThumbnail']) || empty(... |
I'm developing a model for web applications. The database that I use is Redis.
I created special DbField objects like HashDbField, SortedSetDbField, ScalarDbField and so on, for each data type in Redis. This objects provides a convenient way to work with redis keys. Each of it takes target key name in constructor
The s... |
private function getFeatureByParam ($classname, $module, $action) {
$needFeature = array();
foreach ($this->featureConf as $featureIndex => $feature) {
if ($feature['classname'] == $classname &&
$feature['module'] == $module &&
$feature['action'] == $action) {
$... |
I am trying to use Entity Framework as simple as posible. Use UnitOfWork and Repository patterns seems to be overkill because whole web application will be pretty straightforward. I came with this idea:
public class Entity
{
...
}
public class MyContext : DbContext
{
//Set database connection details here.
... |
I created a program to find the largest prime factor for a given number. The program works but unfortunately takes very long time to compute a huge number like 600851475143.
How can I optimise this program to run faster?
I don't know what does this multicore thing is, but I think it is a possible way to improve this p... |
If I create a brush like so
HBRUSH hBrush = CreateSolidBrush(RGB(33, 33, 33));
and then later on, I want to change the color of the brush, how would I do this?
I googled a bit and found out that creating a bunch of different brushes is not the way to go.
I was thinking that one possibility would be to just set hBrush ... |
I have the following function that looks up a mathematical operation that can be applied to a Numeric sequence based on a String
def getAction[T : Fractional]( op : String ) : Seq[T] => String =
op match {
case "add" => seq => seq.sum.toString
case "product" => seq => seq.product.toString
case "mean" => s... |
I was thinking in a way of implementing a graph in such that would let find a minimum spanning tree.
Graph.h
#ifndef GRAPH_H
#define GRAPH_H
#include <list>
#include <vector>
#include <utility>
#include <iostream>
#include <map>
#include <queue>
using namespace std;
template <class KeyType, class WeightType>
class G... |
I would like a review of how I am comparing two java.util.String in a private method in a java.util.Comparator. Either of the Strings could be null or blank, and would be "less than" the other String if that other String were not null/blank.
My gut feeling is that this is at the very least inelegant, probably difficul... |
I tried to implement an answer for the algorithm question given below. I implemented two different solutions. I couldn't decide which one is better. ( Maybe none )
Note: Node class and ZigZag interface are given along with the question.
Problem Definition A binary tree is given. Return a list of nodes in Zig Zag manner... |
I am a newbie to C++ programming and am currently reading this book called Jumping to C++ by Alex Allain. I have finished the pointers chapter and I am doing the exercises at the end of the chapter.
The following paragraphs are the exercises and included are my own solutions:
Write a function that prompts the user to... |
I would like to get an advice regarding how to test the same code with different input data.
I would like to test that method operationSucceeded will be invoked for all successful status codes. Here is how I can test (with Kiwi) single status code (i.e. 200):
it(@"should call operationSucceeded", ^{
MKNetworkOperat... |
At the end of the immediately-invoked function expression, there is an if statement that checks the screen width and loads in some resources. I'm curious if it is best practice to include this logic inside my IIFE, or outside. Both seem to function the same as far as I can tell, though I'm curious if there is preferred... |
At first I tried using a timedelta but it doesn't accept months as an argument, so my next working example is this:
from datetime import datetime
current_date = datetime.now()
months = []
for month_adjust in range(2, -3, -1): # Order by new to old.
# If our months are out of bounds we need to change year.
if c... |
I am fetching rows from the DB and returning the result in JSON. The output needs to be an array of associative arrays.
$i = 0;
foreach($resultSet as $r)
{
$output[$i]['key1'] = $r['col1'];
$output[$i]['key2'] = $r['col2'];
...
$output[$i]['keyN'] = $r['colN'];
$i++;
}
Is there a more elegant way to do this?... |
This is my solution to SPOJ Problem 442. How can I make this code run faster? What are some techniques that can be used to make this faster? I am getting a Time Limit Exceed Error here.
import java.util.Scanner;
class main{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
... |
def users_list
html = ''
self.users.each do |user|
html << user.link_avatar_tag
end
html.html_safe
end
I feel that it is possible to write shorter.
Is it possible get rid of the temporary variable(html)?
|
A few days ago I've faced an annoying problem.
Let's imagine we have 3 classes: Base, System, Handler.
The classes Systen and Handler both inherit from the class Base.
I want to access those classes this way: System::DoStuff();
I also need the Handler be available in the System, but do not want to instantiate it there... |
I made the popular Guess-The-Number game and included an AI version that picks random numbers. The AI version has slightly different Console output that differ slightly, for example:
I generated a number between 1 and 100. Can you guess it?
You generated a number between 1 and 100. Let me try
First I did this:
Console... |
I have some sample code where I used string.Format but after reading about benchmark performances by other people I believe that it may be better to do multiple appends by a StringBuilder
Here is the scenario:
In my gridView, I have a function called before a databind. The function looks like such:
public string getCol... |
I have this working code. I think this must be easier with a while loop.
if not c.e1.nil?
extrapreis = number_to_currency Extra.find(c.e1).aufschlag, :unit=>"EUR "
array.push Extra.find(c.e1).name + " (" + extrapreis.to_s + ")"
extpreis = extpreis + Extra.find(c.e1).aufschlag
end
if not c.e2.nil?
extrapreis = n... |
This is intended to be a simpler replacement of std::vector, written for entertainment.
It should be as fast or faster than std::vector, but does not need to have as many features.
It should also be simple to use.
I am looking for a review on the following:
Bugs
Performance
Class/Functions/Variables Naming
Useful feat... |
This is my implementation of Conway's Game of Life in JavaScript. While I know that it runs slowly, I do not ask for performance improvements, but for a review on the code quality in general from professional JavaScript programmers.
Working HTML/CSS/JS files can be found here.
Here is the main part of the code:
(funct... |
I am currently learning C++ (note: I am using C++11) and have begun working on a small project to practice what I've been learning. This project is a deck of cards that I hope to use later to create simple card games. I have created three classes: Card represents a single playing card, CardStack represents a stack of c... |
I use the following functions to encrypt my $_GET variables (whenever I can't easily get away with using $_POST or some other way of passing information between pages).
function decryptStringArray ($stringArray, $key = "Your secret salt thingie")
{
$s = unserialize(rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($ke... |
I wrote a simple script that converts a decimal to a mixed number, proper, or improper fraction depending on the inputed decimal.
It works but I think it could be improved as it hangs when large decimals are used. Please review and let me know how I could improve and simplify it. Thanks.
My script on JS Bin: http://jsb... |
I've put in quite a bit of hours on this BlackJack project for Codecademy to get it to the point where I'm satisfied with it. Before I move on to create the UI for it I would really appreciate feedback on things to improve, such as my use of classes and objects, best practices, etc. I'm including a link to my jsFiddle.... |
I've developed mini utility, the source code can get reviewed here:
http://rle.codeplex.com/SourceControl/BrowseLatest
It's developed in C#, in the general page there is a description.
I'm listening to well criticism to make code more elegant and better to work with.
/*
* GNU General Public License version 2 (GPLv2) ... |
I am trying to wrap my head around how to properly use OOP in PHP when dealing with form submissions.
The example below is a form for editing course information. I have a class called Course which has methods for loading the class with information from the database and saving information into the database.
Everything w... |
I am a JavaScript beginner. Here's a fictional example which isolates the functionality mentioned in the subject line. I hope to employ this functionality as part of a larger web application in the real world soon.
Live example here
An HTML5 page containing a simple form with one row:
<!doctype html>
<html lang="en">
<... |
I'm trying to write a simple triplestore in Common Lisp that will store triples in the form subject-predicate-object. The code is inspired by the book "Programming the Semantic Web".
(defvar triplestore-graph (make-hash-table))
(defun triplestore-init ()
(puthash :spo (make-hash-table) triplestore-graph)
(puthash ... |
I have this question in my exam and I want to know if my answer is correct.
Consider the following program written in C language to implement a reader:
// to simplify the exercise, are not checked the return values of calls to the operating system
int main(int argc, char* argv[]) {
sem_t *sem_wrt;
int fd,... |
I have this working code for C++ state machine using STL (not using boost state chart).
The purpose of posting is two-fold:
To share a simple and working code C++ state machine using the STL for the sparse 'state' and 'event' function matrix.
To seek enhancements of implementation, since with this approach I have to i... |
I wrote code that queries a data structure that contains various triples - 3-item tuples in the form subject-predicate-object. I wrote this code based on an exercise from Programming the Semantic Web textbook.
def query(clauses):
bindings = None
for clause in clauses:
bpos = {}
qc = []
f... |
From times to times I stumble over the following situation:
I have got a class with a property that's only used if another property has a particular value, for instance:
public enum enum_ConnectionType
{
Local,
Server
}
public class Session
{
private enum_ConnectionType _connectionType;
private string ... |
I have been working on a php driven template engine. This is fairly light weight, and fast from all of my testing, but I was hoping to get some feed back on it. First I would like to show you an example usages before I show the actual library. For full documentation and more examples: http://plater.phpsnips.com/
This f... |
It currently takes about 10 minutes to process ~16k teams and ~81k games. I could soon have ~17k teams with ~160k, and multiple sports. I run this as a cron job overnight and store the results in a serialized gzipped array which is processed upon each pageload to sort teams by states for displaying and actually calcula... |
Just a small PHP exercise to write some simple reports, I thought I'd do it without a framework for fun and profit. I'm particularly concerned about the potential for SQL injection, since the user could pass their own values to $_GET['status'].
I also understand that mysql_connect() et. al are deprecated in PHP since 5... |
Introduction
In my Java application, I need to represent the result of an operation. This can either be OK or ERROR + an error message.
Background
I have a class to verify the integrity of a directory (e.g. to check that a few conditions hold). If it finds out the directory is corrupted, it should return a description... |
I'm just wondering if you see any ways I could simplify the following code without making it too difficult for a newbie to understand what I'm trying to do:
if (trim($this->uri->segment(5)) == 1) {
if ( $this->my_model->functionA($this->uri->segment(8),$this->uri->segment(4)) )
{
$data['light'] = ... |
This is my code to partition a list into two parts according to a value. I.e. nodes smaller than value x should precede nodes larger than the value x.
It seems correct. Any corner cases I am overseeing or corrections are highly appreciated.
public Node partition(Node head, int x){
if(head == null) return head; ... |
I have a system that needs to be able to reboot a different piece of hardware partway through a script that programs it. It used to wait for me to come and reboot the hardware halfway through, but I've since automated that. I use this python script to control a USB Net Power 8800.
I have two setups to show you: First ... |
I wrote a JavaScript that takes 2 fractions and finds the common denominator for both. If the user inputs 2/6 and 1/2 --- the script outputs 2/6 + 3/6. I'm interested in feedback on possibly simplifying it or improving it. Thanks.
JS Bin: http://jsbin.com/omelen/1/edit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Trans... |
I've developed program, which may work with graphs and its edges (connections between vertices):
http://ideone.com/FDCtT0
/*
Oleg Orlov, 2012(c), generating randomly adjacency matrix and graph connections
*/
using System;
using System.Collections.Generic;
class Graph
{
internal int id;
private int value;
... |
I'm writing a WCF service for validating password and getting company ID for the clients that requests the services. The service runs on a server locally as a windows service, which sends queries to the database and returns the appropriate info back to the client.
I'd first like some comments on how the overall design ... |
I'd like this reviewed.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SWITCH(S) char *_S = S; if (0)
#define CASE(S) } else if (strcmp(_S, S) == 0) {switch(1) { case 1
#define BREAK }
#define DEFAULT } else {switch(1) { case 1
int main()
{
char buf[256];
printf("\nString - Enter your str... |
For example I have 2 dates (year and month) like :
2013-03
2013-01 <-- Jan. current month.
2012-10
So my code is :
// Get current month and year
$m = date('m');
$y = date('Y');
// So I do something to get highest date so result is..
$highest = "2013-03";
// Current month and year
$current = $y."-".$m;
// So I do... |
The below code does Read csv files and process it to do some sort of
cacluations.This is more of small picture code , to introduce big picture.
The csv file contains information of seeds of crop which have some
information in number depending upon the numbers the calcuation have to be
done.There are different types of ... |
This is a script to access the Stack Exchange API for the genealogy site and create a list of user dictionaries. It contains a snippet at end to validate. The data obtained is stored in YAML format in a file for use by other programs to analyze the data.
'''
This is a script to access the stackexchange api
for th... |
I designed this object for a "bread formula". They use a concept known as baker's percentages, but you don't need to understand the math to help with the object design.
I designed it as an object (of type Formula) that contains objects (of type Ingredient).
Both classes have nullable properties. C# demarcates nullable... |
I've designed an algorithm to find the longest common subsequence.
These are steps:
Pick the first letter in the first string.
Look for it in the second string and if its found, Add that letter to
common_subsequence and store its position in index, Otherwise
compare the length of common_subsequence with the length o... |
I want to ask whether my following implementation is good in the view of good practice and performance. I have an app where I have to show another page or template html in an iframe. I get that template html via ajax and render it in the iframe. Iframe must be used because the template must be isolated.I am now storing... |
I have designed couple of aspects using PostSharp for different projects, but there is a design flaw in many of them: dependency management.
This is a question about injection of dependencies into aspects, not about dependency injection using aspects
Due to nature of PostSharp post-compilation there are several limitat... |
I'm trying to think of ways to separate things out. I'm open to ideas, or if you see anything blatantly wrong, I'd like to know that too.
Generally, I'm happy with this, but the sheer size of the class seems like a code smell.
Original Source
'''The Game class.'''
import game_exceptions
from bases import Bases
from c... |
I am trying to factor integers using the trial division algorithm (Wikipedia: http://en.wikipedia.org/wiki/Trial_division).
I reviewed the Wikipedia entry for trial division and multiple other sources but I don't completely understand the trial division algorithm.
I wrote the code below based on my findings and it find... |
I'm not sure if there's a standard view where the placement of a success result should be in a conditional that can return multiple statuses. The success condition of this function is in the middle of the conditional block:
def redeem(pin)
success = false
message = nil
if !self.date_claimed.nil?
message = 'Re... |
Here is an algorithm to evaluate best matching System.Type for two types in hierarhy. This is one of answers for this StackOverflow question by Ken Kin:
Evaluate the maximum possible type to fit both of types
Algorithm
Searching for common base class (either concrete or abstract)
FindBaseClassWith method
If there... |
I'm finally "done" with my small prototype for an element inside my website. I'm just a learner in the jQuery code and that reflects in my code. It's bloated, a lot of functions do the same thing, but for a red or green button which results in this kind of code.
$('.submenu').on('click','.rood',function() {
$(this)... |
I have this method that basically takes a string and does different things
depending on what the string starts with. Is there a cleaner way to write this method?
public String analyze(BotMessage message)
{
String lcmsg = message.message().toLowerCase();
//Not a command
if(!lcmsg.startsWith("!")) return "-1... |
I have inherited a node-js project, and I am completely new to it. Fortunately, it is already covered by unit tests.
The class under test, FmsRescuers, has the responsibility of sending HTTP requests to a remote server.
My first refactoring was to extract the HTTP behavior into the HttpRequest class, to allow testing ... |
I have a DataSet with only two tables in it. The first table is a list of models (of products) with default parameters (settings), and the second table is a list of modules. A module is a product based on a given model but with some parameters that have been changed. A sample DataSet in XML format could be something li... |
Before, I had this code, sometimes it is longer:
String dbEntry = "idBldgInfo = '" + currentBldgID + "',scenario = '305',installCost='" +
installCost + "',annualSave='" + annualSave + "',simplePayback='" + simplePayback +
"',kwhPre='" + preKWH + "',kwhPost='" + postKWH + "',co2Pre='" + preCO2e + "',co2Post='" +
postCO... |
Project Euler problem 3 asks:
What is the largest prime factor of the number 600851475143?
The first step I took is to determine the highest value number I should be looking at as a possibility (600851475143 / 2). Next I wanted to check each prime number as I go to see if it is a factor of 600851475143. If so, I stor... |
I am still trying to wrap my head around good programming practice and just wrote this routine to read in an Excel file and return all the sheets into a dataset:
Public Shared Function ReadExcelIntoDataSet(ByVal FileName As String, Optional ByVal TopRowHeaders As Boolean = False) As DataSet
Try
Dim retval A... |
I've written a small utility for monkey-patching native JavaScript constructor functions. For example, you can use it to modify input arguments before returning an instance (this can be useful for unit tests).
There is much more detail about the utility on GitHub, so it may be useful to read through the readme on there... |
I came up with a solution for the InterviewStreet problem "Triplet"
In short, there is an integer array d which does not contain more than two elements of the same value. How many distinct ascending triples (d[i] < d[j] < d[k], i < j < k) are present?
It successfully passes 9 test cases of 15. but my solution exceeds ... |
I'm just starting with Ruby and decided to do two different implementations of Conway's Game of Life. In this first one I'm not using cells as a separate class and instead just track everything as a location on the board, using a state pattern I guess.
Anyway, I want this code to display good Object-Oriented programm... |
I'm wondering if you see anything terribly wrong with this code, or if you see any areas for improvement. My objective is to make sure its simple enough for someone else taking over my job to be able to pick up fairly quickly.
My basic question has to do with the fact that in my model, I'm trying to distinguish betwee... |
I have a situation where depending on what the value of a uri segment is, my controller will load a different view. Here's what the code looks like in part:
//which view do we load?
if (strpos(strtoupper($data['hardwaremodel']),"HP") !== false)
{
//hp view should be loaded
... |
The exercise is the bunny linked list exercise; the last beginner exercise from here.
I'm looking for feedback on absolutely everything that could make me a better programmer:
Syntax
Optimization
Form
Functions or variables naming
Bugs
Performance
Code structure
Keep in mind that I haven't completed all aspects of t... |
I want to filter the options of a large select group based on text input in a textbox. I am currently using this code to filter from a SELECT group based on the text of a input box.
Can you please tell me whether there is a more efficient way of doing this? My SELECT group is very large with around 7000 entries, which ... |
I frequently run a script similar to the one below to analyze an arbitrary number of files in parallel on a computer with 8 cores.
I use Popen to control each thread, but sometimes run into problems when there is much stdout or stderr, as the buffer fills up. I solve this by frequently reading from the streams. I also... |
I often need to return empty collections.
One of those days I wrote the following to return a cached instance:
public static class Array<T>
{
// As a static field, it gets created only once for every type.
public static readonly T[] Empty = new T[0];
}
I didn't know about Enumerable<T>.Empty() maybe it didn't ... |
I've just created a teeny little script to count the seconds until I get auto-logged off. I already solved my issue with my ssh client settings, but I'd still like any help making the bash script nicer to read, or just tips in general.
#!/bin/bash
count=0
while ( [ : ] )
do
count=$(($count+1))
n=${n:-0}
for i i... |
This morning I was trying to find a good way of using os.path to load the content of a text file into memory, which exists in the root directory of my current project.
This approach strikes me as a bit hackneyed, but after some thought it was exactly what I was about to do, except with os.path.normpath(os.path.join(__f... |
I'm trying to track down what I suppose to be memory/thread leak in one of my programs.
My program uses a function to upload a file to a Windows Azure Storage Blob. In order to make this function resilient to various transient error conditions (such as intermittent network failures, etc.), I want to make use of the Tra... |
I am in the process of writing a simple Node.JS webserver. I am about halfway there in terms of functionality. Please see the full code in this Pastebin (the client-side code is not shown as I want to focus on server-side).
Before I implement the rest of the functionality, I would like to pause and reflect and the qual... |
I am using Bootstrap for a front-end project. I would like feedback concerning my HTML markup. I have spent quite some time polishing it, and I feel it is somewhat "mature". I have run the W3C HTML validator on it, and it only complains about three things:
My use of center tags (consider this a "known issue")
"Element... |
I currently have code that looks like this
private string _stringField;
protected string StringField
{
get
{
if (_stringField == null)
_stringField = GetStringField();
return _stringField;
}
}
ReSharper is suggesting I change the property to:
protected string StringField
{
... |
I'm working on an A* search algorithm implemention and this is what I came up with for the open list:
from heapq import heappush, heappop
class OpenList(set):
'''
This uses a heap for fast retrieval of the node with the lowest path score.
It also uses a set for efficiently checking if a node is contained. ... |
I'm a Scala beginner and looking at the trim() method of the Java API. I noticed side effects, so I attempted to implement a functional version in Scala.
Here is the Java version:
public String trim() {
int len = count;
int st = 0;
int off = offset; /* avoid getfield opcode */
char[] val = value; /* avoid get... |
I'm developing an iPhone app that is heavily Calendar-based, and it requires a good amount of (what I'm calling) "date boundaries."
I use these "date boundaries" to fetch EKEvents from specific calendars and display data for specific years, months, and quarters.
SPECIAL NOTE: This app is for government employees, spec... |
Following snippet reads CSV Line count using BinaryReader.
Currently it checks \r and \n for line delimiters.
private static int GetLineCount(string fileName)
{
BinaryReader reader = new BinaryReader(File.OpenRead(fileName));
int lineCount = 0;
char lastChar = reade... |
Today I solved a question from Google Code Jam: mimicking a cell phone keypad messaging.
Here is the program, with goto statements. I know it is an unstructured style to use goto, but I still did because it improved speed.
#include <stdio.h>
int main()
{
char c, c1 = NULL;
int top;
top:
while((c = ge... |
I'm sure this can be done in less lines and in a more clean way?
function BaseClass() {
BaseClass.prototype.talk = function () {
alert("I'm BaseClass");
}
}
function MyClass() {
BaseClass.call(this);
}
MyClass.prototype = new BaseClass();
MyClass.base = {};
MyClass.base.talk = MyClass.prototype.talk;
MyClass... |
I am running a simulation with 250 interacting agents and have a few functions that are called over and over again. Even with precomputing all distances between agents before the N2 (250x250) interaction loop, my simulation is still very slow. Are there any C++ optimization tricks that I could use to speed these up?
Th... |
In my library Transfuse I use a code generator to build a handful of classes that look up resources. Each of these look up classes are proxied by a static utility class so they may be referenced before the generated class is built. For instance, the Parcels class can be used to wrap an object with a generated Parcela... |
The full code is located here: https://gist.github.com/4521540
It's a dummy List in C++. My concern is with freeing up memory.
It doesn't crash when I run my code. It looks like my if/else covers everything.
It starts by deleting the second item if there is. That's what the while loop does.
If there is only one pres... |
This is my code and I would like to get it code reviewed. It is functional and behaves as expected.
I pass some basic types to the Serialize() function and then deserialize the output to get back the original value.
size_t returnSize(const char* s)
{
string string(s);
return string.size();
};
template<typ... |
I am new to web apps and I am having a difficult time structuring my apps. I put together a very simple math web app which I wish to expand on. The app has the following pages/screens:
Home screen
About screen
Math question screen
Answer check screen
Results screen.
Right now the app works fine and is probably struct... |
I am curious to know if there is a faster, better, and more efficient way to accomplish this program that acquires employee information:
<?php
session_start();
//require 'functions.php';
//require 'DB.php';
$employeeID = $_SESSION['employeeID'];
$clockIn = $_GET['clockIn'];
$clockOut = $_GET['clockOut'];
$timeToday... |
I'm particularly concerned about where I have declared the functions, can I move them around to clean up the code without breaking anything? The "conjugate" function contains a lot of stuff that has nothing to do with actually conjugating verbs and rather handles output strings and html DOM objects. I really want to mi... |
I want to remove my goto's in this code but I'm not sure how. There must be a cleaner way to write my code. Perhaps move the "if" statement to the end of each loop then use break?
Sorry if this is a stupid question, I'm self-taught, and I'm finishing up my first sizable program. Any suggestions as to how I can clean my... |
I've discovered that using hashed passwords with salts is a much better idea than MD5/SHA256, so I'm not hashing them with PBKDF2. However, I'm wondering if this is a correct approach to authorizing my user. I also have logic for logging authorizations. When the same IP has entered an incorrect login/pass, it becomes b... |
I have following code for doing custom paging from an asp.net web application.
Points of interest
It uses Link Buttons as suggested in
https://stackoverflow.com/questions/14335067/passing-search-parameters-to-same-page-when-hyperlink-clicked
The link buttons are added in Page_Load itself as listed in
https://stackov... |
On an IRC channel I'm a member of, one particular person mocks every piece of code I post, even if it's a rough draft or if I haven't coded in months. I am pretty well versed with computer theory and knowledge, but my skills with programming lack due to little practice.
This particular code was from a project I was s... |
I am trying to create a randomly generated array of x numbers with no duplicates. I am choosing numbers, one at a time, then comparing each new number to the numbers already in the array.
Here is my code. At the end I should have an array of seven numbers, none that match, but sometimes I get a nil:
array = [] #DEFINE... |
I'm very new both to programming and to R so please bear with me :-)
I've written the following bit of code, which works perfectly well and runs through a data file with 17446 rows in about 35 seconds. I don't really have a problem with this but am sure that this could be a lot more elegant with probably the use of the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.