Hmm... I owe @rolfl a thank you come to think of it. I just had to unroll a loop the other day. I wouldn't have thought about it if he hadn't taught me about it.
i am installing XNA framework for VS 2015, so I can run my code and then I am going to install unity and try to use it going forward
I am also thinking about making Review Queue Notifier into a Chrome Extension so that I can run it without opening the tab, and so the user can set how often to check and which review queues they want to be notified of
A few tips, but there may be more. These are just the things that immediately jumped out at me:
Break out AsyncTasks into their own class
With multiple tasks, it might be better to make them each their own class/file. You can call back to the main Activity with listeners. If you must keep...
moved out of the In-laws place finally and living in the RV with my Family, not the inlaws
plus it is supposed to storm tonight and it's almost time for bed
I am trying to get setup to work on a video game. I was thinking about getting my 2D version going pretty good and then maybe start a kickstarter or something.... but not sure with that yet
Friday (/ˈfraɪdeɪ/ or /ˈfraɪdi/) is the day after Thursday which precedes Saturday. In countries adopting Monday-first conventions as recommended by the international standard ISO 8601, it is the fifth day of the week. It is the sixth day in countries that adopt a Sunday-first convention. In other countries (see workweek and weekend), Friday is the first day of the week-end, with Saturday the second. In Afghanistan and Iran, Friday is the last day of the week-end, with Saturday as the first day of the working week. Bahrain, the United Arab Emirates (U.A.E.) and Kuwait also followed this convention...
If you're still with me in this drinking game, 1M rep + lead in a classical arcade game == a shot of gin.
http://meta.stackexchange.com/questions/277749/its-over-jon-skeet-has-1008k-rep-and-7-bronze-badges
This code outputs the smallest number with more divisors than the input:
from operator import mul
from math import sqrt, ceil
def next_prime_factor(n):
if n % 2 == 0:
return 2
for x in range(3, int(ceil(sqrt(n)) + 1), 2):
if n % x == 0:
return x
return in...
"Hypothetical" scenario question: I reviewed a first post. I looked over the code very briefly, and the OP said that everything worked, so I said the post was okay. However, later, another user called me out for being not careful when reviewing the post. He claimed that I did not look over the code carefully enough as it is apparently very obvious that the OP has no idea what they are doing. Did I make the right judgement is saying that the post was okay at first?
So for April Fools Day, I've made my senior developer a lovely beverage of hot milk and artificial sweetener, and I've raised a pull request into the ma5ter branch that deletes the entire codebase. Today will be a good day.
I have written an Express middleware function called authenticateRequest that looks at the Authorization header of an incoming HTTP request and determines if the credentials are valid. If they are, the next middleware function is called; otherwise, a 401 status code is set.
To accompany this mid...
function [covs, noise, X] = sim_AR(lagcof, lengthpath, numpath)
reverslagcof = transpose(fliplr(lagcof));
p = length(lagcof);
X = zeros(numpath, lengthpath + p);%pathes, the initial p elements are given.
%% generate the initial p elements xs
initial_element = randn(1, p);
X(:, 1 : p) = repmat(i...
In Java, using throw/catch as a part of logic when there's not actually an error is generally a bad idea (in part) because throwing and catching an exception is expensive, and doing it many times in a loop is usually far slower than other control structures which don't involve throwing exceptions...
def lines():
with open('p_input.txt') as f:
for line in f:
yield line.strip().split('|')
def parse_2(*file):
result_2 = []
rows_generator = lines()
next_row = next(rows_generator, None)
for line in lines():
if line[0] == next_row[0]:
...
I have some html and js codes. I can't understand how can I dry up this codes. I am using bootstrap-3 and jquery-1.11.0. on my js code I have some dropdowns. In dropdown I used a icon. When the dropdowns is collapsed the icon changed to down arrow and when the dropdown is expanded the icon change...
I have a sliding panel that I want to show content in. The content that I want to appear depends on the button that triggers the sliding panel. My project is growing rapidly and I would like to reusable jQuery code or perhaps a plugin. My code works, for example sake I have 6 buttons and 6 hidden...
Code from my last project, that have to work on python 2.7 and python 3.
I want to get a path as a unicode string from argparse :
parser = argparse.ArgumentParser(
description='Organize your movie collection using symbolic links')
parser.add_argument('media_src', metavar='FILE|DIR',
...
I've read about mediator, event aggregator, using, backbone.events ...etc
I need advise about another potential pattern below, do you think this is evil ? or good ? if not good what are the caveats/problems.
This 'pattern' answers a very classical issue. When you click something on View1 , View...
Let's pretend the following:
<?php
// Functions to validate/sanitize user input
function validateUsername {
// If accepted, return true, else return false
}
function validatePassword {
// If accepted, return true, else return false
}
function validateEmail {
// If accepted, return tr...
I'm currently working on an IRC bot for Twitch.tv and I was wondering how I can implement a banned words list? Here is what I have so far and I'm stumped because of my limited knowledge of python. Everything is working great so far except checking to see if banned words are in the message. This i...
Basically it's a revision of all changes that git knows about that are not necessarily associated to any given branch
So if you do something stupid and, I don't know, delete a branch of code, you can get it back by looking at reflog. Not that I would do something like that, you understand.
First some code style points:
Declare your
variables! Not only
does it help prevent a slew of bugs from cropping up, it makes it a
lot easier to read and understand what your code is doing. Looking
at only the code that was posted, I have no idea if they are local
or global scope or what data t...
@JohanLarsson I'd say probably null, unless Diff.Empty functions like a Monad (i.e, you can call all the functions on it you could on any other result)
I have written my first program in go. It's rewritten from python.
Program takes csv file, emulates query SELECT X, Y, SUM(Conc), SUM(ToxConc) FROM very_big_table GROUP BY X, Y. And runs on terabytes of data.
It's written messy, but runs 100x faster than same program written in python.
Here...
I want to parse a glob-like pattern (only the brackets functionality actually) and fetch all possible combinations of this pattern.
Something like perl -wE 'say while glob "{a,b,c}"'
I have managed to implement it in ruby but it's quite a big code.
Do you guys have some tips on trimming that do...
> In February 2014, GEMA won a lawsuit against YouTube at the District Court of Munich which ordered the website to remove blocking messages which claim GEMA is to blame for thousands of videos being unavailable in Germany on copyright grounds
I have this simplistic Python class for representing directed weighted graphs (digraphs for short):
Digraph.py
#! /usr/bin/env python
__author__ = 'Rodion "rodde" Efremov'
class Digraph:
"""This class implements a directed, weighted graph with nodes represented by integers. """
def ...
I have been using NLog for logging purposes in my Web applications, but it was not injectable. More precisely, each class using logging declared the logger like this:
private static Logger logger = LogManager.GetCurrentClassLogger();
Since my logging is very simple, I have defined some extensi...
Here is a nodejs code that copies values from one object (submitted from a firm) to a model object.
Model:
var directory_model = {
"link_title": {
"value": 1, // This needs to be filled with object data
"validation": null
},
"link_desc": {
"value": 2, // Th...
@Vogel612 I've had that problem every now and then. IIRC a full rebuild would sometimes fix it. I seem to remember that new files were especially problematic.
I've been trying to implement the most significant digit radix sort for an integer array. I know you are suppose to use a recursive method to add up all of the buckets. But I have a hard time figuring out how to determine the most signfiicant digit in the array. Here is what I have so far:
publi...
I have a python script that runs 3 compiled programs and make them communicate via standard i/o. This is my first time using pexpect and I am not so good at python. My program works very slowly. Is there anything that I can do to fasten that program without changing others? If not, I'll try to do...
I have translated Dijkstra's algorithms (uni- and bidirectional variants) from Java to Python, eventually coming up with this:
Dijkstra.py
import heapq
from Digraph import Digraph
from random import choice
from random import uniform
from time import time
__author__ = 'Rodion "rodde" Efremov'
...
Below comes a Value Object to represent UserId in ASP.NET application. It implements Value Identity, so equality is defined by matching of the state calculated at the moment of comparison. It depends on
public interface IAuthenticator
{
int CurrentUserId { get; } // may be imperson...
Title says most of what you need to know, really. Mass of text from Column C onward in each row may contain the names of countries, which I want to pull into the corresponding cell in row A. What I have so far is not pretty...
Sub PullCountries()
Dim Rng As Range
Dim Block As Range
Dim i As Long...
I have some code as follows:
$condition = true;
while($condition) {
$condition = doSomething($something);
if($codition) {
break;
}
$condition = doSomethingElse($somethingElse);
if($condition) {
break;
}
...
// $condition is true because we haven't exited the loo...
RPG is a high-level programming language (HLL) for business applications. RPG is an IBM proprietary programming language and its later versions are only available on IBM i or OS/400 based systems.
It has a long history, having been developed by IBM in 1959 as the Report Program Generator - a tool to replicate punched card processing on the IBM 1401 then updated to RPG II for the IBM System/3 in the late 1960s, and since evolved into an HLL equivalent to COBOL and PL/I.
It remains a popular programming language on the IBM i operating system, which runs on IBM Power i platform hardware. The current...
ah, yes. one of those things you want to shoot with an RPG
I have implemented a filter for filtering a IEnumerable of a specific type.
To accomblish this goal i have created three classes: FilterOption, Filter and the FilterManager.
FilterOption.cs
public class FilterOption<TFilterOptionType>
{
private bool _isSelected;
public bool IsSelected...
My code is very slow to run, and I am trying to find a way to make it more efficient. I know there must be a better way than to write each modulo operation.
def divide
z = 0
test = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
(2..Float::INFINITY).each do |x|
if x % 2 == 0 && x % 3 == 0 && x % 4 =...
I have been trying to write a bf*** program that prints the Fibonacci sequence numbers repeatedly. I was wondering whether this is the most efficient way to do it. I basically repeatedly duplicate two cells into a third cell, and shift one cell forward and repeat. Here is the code:
+++++[->----[...
I'm sure the CR community can help here just as well as the Roslyn community.
@JeroenVannevel If you are interested, you could probably provide some good comments there. Might even help you start building a relationship before you apply for a job with them.