« first day (575 days earlier)      last day (3441 days later) » 

12:00 AM
@Vogel612 Seems like Edward is not entirely satisfied yet though.
 
 
1 hour later…
1:06 AM
0
Q: EOF Do While Not VB

JCS5353Any input This is a small assignment I have to do for a class. I'm not sure if I'm reading ti correctly to do it right. I'll input what I have at the bottom. "Goal: This practice assignment requires you to write a eof controlled loop, a counter, an accumulator, and selection structures. Apply wh...

 
1:20 AM
1
Q: Hadoop map reduce for counting specific set of words in a text file java program

NEW_PYTHON_LEARNERI am new to Hadoop Map reduce Programming. I am trying to learn it with word count example. I am finding the count of specific words in a text file. import java.io.IOException; import java.util.*; import org.apache.hadoop.fs.Path; import org.apache.hadoop.conf.*; import org.apache.hadoop.io.*;...

 
2:06 AM
An (unfortunately quite rare) review from me: codereview.stackexchange.com/a/71198/27623
First time I think I have gotten to comment on creating temporary files safely!
 
 
2 hours later…
3:58 AM
@syb0rg Love the toaster image
 
4:39 AM
@anyone Is *.tiff a pretty universal format for images to have on a website?
 
@Phrancis Thank you!
 
And... broken... ugh.
 
hi!
 
0
Q: Split CSV into Repeated IDs python

Xodarap777Any time that a row ID (oddly placed in column 8, i.e. row[7]) is repeated after the first instance, I want to write those rows into a second file. The code I'm using is extremely slow -- it's a 40-column CSV with about a million rows. This is what I have: def in_out_gorbsplit(inf, outf1, outf...

 
I guess *.tiff is actually not that great of a format... or I'm doing something wrong...
Probably the latter
 
4:52 AM
@CaptainObvious what am I, chopped liver?
 
@Mat'sMug hi!
 
oi :)
(drumroll)
hi @Yuushi!
@Captain whenever you're ready.
 
@Mat'sMug Heya
 
1
Q: Inspector Rubberduck

Mat's MugOur Rubberduck open-source VBE add-in project is coming along nicely. One of the main features we're going to be implementing in the next release, is code inspections. I started by defining an abstraction: namespace Rubberduck.Inspections { /// <summary> /// An interface that abstracts ...

 
^^ prettty proud of that thing
 
5:06 AM
+1 just for the title!
 
Hahahah
 
does the tag apply here?
 
5:22 AM
Found an off-by-one typo: /// Gets/sets a valud indicating whether the inspection is enabled or not.
Should be value
 
in VBA, 2 hours ago, by Mat's Mug
having issues with Instruction.Selection...
lol
 
Nice!
Hm. *.tiff seems to work everywhere but on my website. And *.tiff is the default for Mac. Guess I'll have to fire up Photoshop or something to convert to PNG.
 
@Mat'sMug No dude this is Chrome
(I know the alignment is jacked up, that's the next fix)
 
One this: Where is the question? (In other words: what do you want us to review?) — Ismael Miguel 8 mins ago
hmm
 
5:55 AM
@Phrancis Preview.app should be able to convert images.
I wouldn't count on browser support for anything other than GIF, JPEG, and PNG.
 
user image
2
25K!
5
 
Congratulations!
 
thanks! :)
 
6:26 AM
@200_success I'll give that a try. I'm planning to have SVG images, we'll see how that goes
 
0
Q: Guessing Game in C++

James Henrickmy objective is to create a Windows Forms program in C++/CLI using Visual Studio 2012. The program should allow a user to enter a number in a text box, and then button1 click basically manipulates a label and textbox, displaying whether the guess is either too high(cold, blue) or warm(red). For...

 
6:43 AM
Some modern browsers will support some subset of SVG natively, to some degree of correctness.
 
0
Q: Hook COM Object and get data from SIEMENS Step 7 software to control PLC through events in their code modified at runtime

Acaz SouzaI'm a first traveler coding in WinApi, Hooks, COM objects. Then, I made a dll to inject (EasyHook) this in the target SIEMENS Step7 process and modify the software code at runtime: Maybe I want some opinion about this kind of practices, hooking, injection, file system driver, kernel hook, modify...

 
7:26 AM
0
Q: Immediately send redirect response, preserving session data

Double GrasThis question is for Laravel 4 only, as the relevant parts are completely refactored in the upcoming Laravel 5. I have written an helper function for validation, so I only have to put this in controllers: public function postAdd() { validate([ 'foo' => 'required', 'bar' => '...

0
Q: Levels of breadth First Display

tytlwkltc1import java.util.LinkedList; import java.util.Queue; class Node { public int iData; // data item (key) public double dData; // data item public Node leftChild; // this node's left child public Node rightChild; // this node's right child public int level; public void displayNode() // display our...

 
8:16 AM
0
Q: Checking if first bit in first byte of every n bytes is not 0

CeleritasI'm reading the status of a file and if the first bit in the first byte of the file entry is 0 then the entry is actually available and no file exists so it should be skipped when printing out the directory listing. The string data contains the binary representation of an entire file system. str...

0
Q: Javascript traits implementation

MisiurI wanted to step up my js game, and move on from mostly closure based scripting, so I decided to write an application in node. I don't have much experience with prototype based programming, and I guess it's a little too early for ES6 (well, maybe with traceur). During planning of my app I saw th...

 
 
1 hour later…
9:37 AM
0
Q: Override innerHTML, outerHTML, lenght, width, height and console.log arguments?

user3709489I'm writing an AdBlocker and it modify browser native to block DHTML effectively, example block Anti-AdBlock. So I really want to override innerHTML, outerHTML, lenght, width, height using javascript, find a way to get those function arguments[x] to compare, if there is ad words then I will skip...

 
10:09 AM
0
Q: Minimum Scalar Product

morbidCodeHere's the problem statement from Minimum Scalar Product You are given two vectors v1=(x1,x2,...,xn) and v2=(y1,y2,...,yn). The scalar product of these vectors is a single number, calculated as x1y1+x2y2+...+xnyn. Suppose you are allowed to permute the coordinates of each vector as you wish. ...

 
 
1 hour later…
11:25 AM
0
Q: Find smallest prime number greater than given n

Brian BrownI have a question. I need to write a program which will find a prime number, greater than the given n. I wrote the below code, which, I think, works good: #include <stdio.h> int isPrime(int n) { int i,j=0; for(i=1; i<=n; i++) { if(n%i == 0) j++; } if(j ==...

 
11:50 AM
I think it's a ghost, It makes more sense than a virus that works in Windows and Linux. — JaDogg 18 secs ago
 
0
Q: Reading and processing an array

OpoSo i have the following code that reads everything into a single char*, then splits that by line into a array of char* and then lastly converts each line to an int by calling atoi. (note : This program takes the file to read as a command line parameter, if you want to test the code with text fil...

 
@CaptainObvious Smells like "explanation of someone elses code"
 
12:11 PM
hey
 
hey @skiwi
Question for the c-folks around... does the latest Cpt. question work??
 
@Vogel612 As in compiles, or produce the desired result?
 
the latter..
see comment thread for more info..
 
@Vogel612 comment thread?
 
bla bla explanation off-topic -> 2-people project need 2 finish -> whaddaya mean finish -> irrelevant bla bla
~food
 
12:35 PM
0
Q: Hangman Game guesses

Ben SmithI'm new to Python 3.4, and trying to make a hangman game with additional features, as required by my course spec. I was wondering if someone could give this code a quick look, and work out what's happening here. The initial code ran the word guesses off of a single variable (ie, only 3-4 words)...

0
Q: Happy Number Program

user3189142I wrote this program, to determine if any given number is happy, and would like to know of any improvements that can be made to make it better. I have tested it, but whether or not it works perfectly I have no idea, there might be some numbers that get through, although I doubt it. import java.u...

 
1:02 PM
@RubberDuck I don't see this compiling...
int number = new Scanner(System.in).nextInt(), value;
in
1
Q: Happy Number Program

user3189142I wrote this program, to determine if any given number is happy, and would like to know of any improvements that can be made to make it better. I have tested it, but whether or not it works perfectly I have no idea, there might be some numbers that get through, although I doubt it. import java.u...

Unless that actually declares int value?
 
@skiwi I have no idea. I don't know JAVA really. I just saw logic all tied up in Main.
 
hello @morbidCode.
 
@RubberDuck I'm bored
 
It's usually pretty hard to be bored in this room, but it is early on a Sunday morn.
 
1:10 PM
0
Q: Simulation of bus route

dimanistTheme of my course work in institute is simulation of bus route. Could you determine any faults and defects in this code? I will be very grateful if you give me some advices about one global variable, counters or etc. It's a console version. I have one month to do GUI with help of Qt or Visual C+...

 
@skiwi yes, excactly
@RubberDuck well around 9am gmt+1 it's rather quiet
 
@Phrancis .tiff is an unusual format for a webstie.
 
1:31 PM
Monking!
 
Monking!
 
@Phrancis It has a number of advantages, but also a number of issues.
the things that make tiff good for its intended purpose, make it bad for web sites.
 
0
Q: Django template filter - sort by multiple keys

noisyI have prepared an implementation of sort_by_keys filter {% for donation in donations|sort_by_keys:'date,-value' %} <img src="{{ donation.stamp_img_url }}" /> {% endfor %} example data: donations = [ { date: '29-07-2014', value: 150, }, { date: '07-10-2...

 
That off-by-one is going to follow me till when?! Uh!
 
@Mat'sMug well it is one of the hard things in programming ;)
 
1:42 PM
@Mat'sMug Actually looks like off-by-2?
Ahh, nevermind, I see.
Monking @All, by the way.
 
@Vogel612 That's ugly
 
Guess what? I reviewed it and told him ;)
sure it's ugly, but "it werkz"
 
1:58 PM
0
Q: Morse code emitter

EdwardAs the first step for writing a Morse code practice program, I thought I'd start with the very simplest step of a text-based Morse code translator. This simple program reads lines from stdin and emits them as a text-based representation of the Morse code equivalent. Any character that doesn't h...

 
@rolfl Roger that
 
@CaptainObvious using namespace std; really?
 
2:26 PM
Monking.
 
Monking @Morwenn
 
@Vogel612 Wait, where?
Oh, in main.
 
hmm. yea...
 
Well, anyway, as long as it is in a .cpp it doesn't matter much.
 
don't ask me...
I don't know C / C++
 
2:29 PM
Ok, we stress beginners not to use it, but it can be used without a problem in a .cpp; the real problem is using namespace std; in header files :p
 
hmm... that teenage sex thing..
if you are using a condom, you're fine??
shivers
 
Wait what, the conversation suddenly turned here..
 
@Amession it is common when teaching beginners because makes it simpler, but it is a bit like avoiding the sex talk to your children because it is difficult. — Davidmh Aug 14 at 12:11
@skiwi we're still on using namespace std; no worries
 
@Vogel612 using namespace cndm;
2
 
ya that may be better..
 
2:32 PM
Actually, we woudn't stress beginners that much if this statement didn't appear in many tutorials meant to teach the basics of C++.
 
3:21 PM
0
Q: NodeJS and Express with promises

jhenriquezI'm relatively new to NodeJS and express, and I've recently run into the pyramid of doom while doing stuff that requires multiple steps. I've found that promises are very promising indeed. But I've definitely would love some opinions on various aspects of my approach to routes as a whole. Here'...

 
3:54 PM
0
Q: Anagram Palindrome checking

user2040026Problem To figure out if any anagram of the string can be a palindrome or not. Idea It relies on two observations. Frequency of every character in the string is even, if length of the string is even. Frequency of every character in the string is even except for one character, who frequen...

 
4:08 PM
0
Q: how to check if a sequence is alternating

Sara Chatilai need to write a program that reads a sequence of integers and determines if the sequence is alternating.An alternating sequence is a sequence of numbers in which every number should be greater or smaller than the one before it according to the base alternation. for example 1 5 4 8 2 10 is alter...

 
4:36 PM
0
Q: Natural merge sort in Java

coderoddeNatural merge sort is a modification of merge sort that sacrifices O(N) to actually build a list of "runs" that may be defined as monotonically increasing or strictly decreasing contiguous subsequences in the input array. After the run queue is established, the algorithm repeatively pops two runs...

0
Q: csg.js Port to C#

Dominic BeauchampI'm trying to port the constructive solid geometry csg.js http://evanw.github.io/csg.js/ to C# but I have a bug that seem to happend in the Node.ClipTo or Plane.SplitPolygon function but I can't find the problem. using System; using System.Collections.Generic; using System.Linq; using System.Tex...

 
5:09 PM
0
Q: Go number database using binary trees

Jan BerktoldI recently got interested in Go and wrote a database server which uses a binary tree for data storage for fun. As I have no prior experience in Go, I'd like to gather a bit feedback on my code and would like to know how I can improve/optimize it. Thanks in advance. File: BinaryTree.go package B...

-1
Q: Swaping Strings

MrShowI want to reverse string. If the string begins with a "'" the whole string should be reversed. Ex: "'Hello you" -> uoy olleH Hello you ello you llo you lo you o you you you ou u If there's no "'" the string should be reversed word by word. Ex:"Hello you" -> olleH Hello ello llo ...

 
            }

        }

    }
}
 
5:30 PM
0
Q: Haskell: parsing 2d matrix: "[[1,2][3,4]]"

j-aLearning Haskell on my own. On lecture 5 of CIS194 I feel I am over-complicating things, and that there should be a succinct way to achieve this - perhaps using concepts I have not learnt - or some prelude function I have missed out on. Thankful for any pointers on how I can improve (also on t...

 
6:08 PM
0
Q: AES256 + HMACSHA256 'secretbox'

HenrikI aim to create a few primitives for creating AES256-then-HMACSHA256 secured session state through cookies. What I've considered: HMAC instead of plain sha to avoid hash extension attacks input validation from the programmer AES in CBC mode, because we're supporting more than 128 bits of data ...

 
 
2 hours later…
8:01 PM
0
Q: How to simplify and shorten code by organising it in procedures and functions

user3462189I'm making a code that makes the monster in depends of value "followHunter", follows or run away from hunter. I have written following code. Unfortunately it's long and non-optimed. I feel that there is a way to make it simpler by organising it in procedures and functions but I have no idea how t...

 
@CaptainObvious Cleaning up the English part was difficult enough. Hopefully someone else can improve the code part.
 
8:33 PM
0
Q: Unifying Types of Applicatives

Kevin MeredithTypeclassopedia presents the following exercise: One might imagine a variant of the interchange law that says something about applying a pure function to an effectful argument. Using the above laws, prove that pure f <*> x = pure (flip ($)) <*> x <*> pure f Here's how I understand the ...

0
Q: ObjC - MD5 Brute Force Algorithm

Patx1I am coding an Objective-C MD5 hash "decrypter". Since you cannot decrypt such a hash function, I am approaching it with a brute force algorithm, that tries every single password combination until it found the correct one or not. I would highly appreciate any help from you guys to improve the alg...

 
in VBA, 4 hours ago, by RubberDuck
> I'm currently working on making Rubberduck easier to customize and configure, but Mat keeps babbling about being ReSharper for VBA.
hehe
 
 
2 hours later…
10:10 PM
hey @Mat'sMug are you using Roslyn for Rubberduck?
 
10:23 PM
0
Q: Implement `Applicative Maybe`

Kevin MeredithTypeclassopedia presents the following exercise: Maybe can easily be made an instance of Applicative; writing such an instance is left as >an exercise for the reader. Here's my implementation: data Option a = Some a | None deriving Show instance Functor Option where fm...

 
@mjolka nope. All hand-made :)
 
impressive! :)
4
it's funny how familiar the code looked, right down to instantiating the inspections via reflection
 
10:43 PM
@mjolka thanks! TBH I have never used Roslyn.. using reflection to discover implementations just seemed like the natural "right thing" to do.
 
i've never used Roslyn either
we use a sorta crappy c-to-xml converter :/
 
I'm going to be hitting a bit of a wall soon though.. parsing Expression nodes is going to require some ...brain power.
like, I capture If {bool-expression} Then, but {bool-expression} is a bit of a riddle at this point.
 
The joys of parsing.
3
 
yeah.. but if I want to be able to find all usages of an Identifier, I'm going to have to figure that one out :)
 
11:02 PM
0
Q: Java GUI - Farenheit to Celsius

VMozaI am required to convert Farenheit to Celsius using Java GUI. My code: package my.tempconvert; public class TempConvertUI extends javax.swing.JFrame { public TempConvertUI() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collaps...

0
Q: PHP DAO Refactor

Tom BurmanI'm creating a small App and decided to write my own DAO for learning etc. At the moment its in one big file, which i really don't like. COuld you give me some tips on how: you would separate this into smaller classes and use abstraction, inheritance etc? how i can update the CRUD functions(th...

 
11:12 PM
@Morwenn Yeah. I'm glad the Mug has been working on that.
 
the self-answers here codereview.stackexchange.com/questions/71182/… don't really seem like answers
 
Seems like OP is doing some rubber duck programming on that thread.
 
@mjolka I refactored CodeInspectionBase per your suggestion - except I'm not going to return an IEnumerable<string>:
        private void ReplaceWithSingleQuote(VBE vbe)
        {
            var location = vbe.FindInstruction(Instruction);
            int index;
            if (!Instruction.Line.Content.HasComment(out index)) return;

            var line = Instruction.Line.Content.Substring(0, index) + "'" + Instruction.Comment.Substring(ReservedKeywords.Rem.Length);
            location.CodeModule.ReplaceLine(location.Selection.StartLine, line);
        }

        public override IDictionary<string, Action<VBE>> GetQuickFixes()
 
i'm sorta surprised you guys didn't name it RubberMug
 
lol
 
11:16 PM
0
Q: Swapping strings

MrShowI want to swap each word of a string and print it in a new line, something like: "Hey guys" -> yeH syug I really don't know how to start, i only print the first word: void triangle_print(char* output) { int i = 0; int j = 0; j = strlen(output); for (i = 0; i < j; i += 1) { printf("%s\n...

 
it was easier to find an image of a rubber duck
 
@Mat'sMug there's no CodeInspectionBase class in the question?
 
uh, right. I meant CodeInspectionResultBase
public override IDictionary<string, Action<VBE>> GetQuickFixes()
{
    return new Dictionary<string, Action<VBE>>
    {
        {"Replace Rem reserved keyword with single quote.", ReplaceWithSingleQuote},
        {"Remove comment.", RemoveComment}
    };
}
^^ why didn't I think of that! this is awesome... now gotta think of a way to design a UI for that
 
(pro tip: copy the UI design from R#...)
 
Oooh I'd love all these floating dropdown buttons and keyboard shortcuts to work in the VBE!
in VBA, 48 mins ago, by Mat's Mug
I'd have waited till we packed a little bit more features before a first release, but it's fine. The worst that could happen is a lawsuit from JetBrains :)
 
11:24 PM
Are you saying I need to figure out how to intercept the keystrokes sooner rather than later? =;)-
I've gotta say, I've been having fun learning about the Win API.
 
intercepting Alt+Enter in particular, would be awesome :)
and Ctrl+T (goto everything/type)
and Shit+Alt+L (locate in Code Explorer)
 
11:45 PM
Well... I know how to get a handle on the code window now, so it shouldn't be too hard to mimic what the dockable window host does to listen for keystrokes.
 
Hmm
 

« first day (575 days earlier)      last day (3441 days later) »