« first day (652 days earlier)      last day (3371 days later) » 
00:00 - 21:0021:00 - 00:00

12:00 AM
[Cardshifter/Cardshifter] 27 commits. 1 opened issue. 3 issue comments.
[retailcoder/Rubberduck] 13 commits. 5 opened issues. 3 closed issues. 9 issue comments.
[rolfl/StackMonkey] 1 commit.
2
 
I'm one vote away from passing JavaDevloper!
Hi, @lining
 
hey wassup
 
Hello @lining
 
Nothing really, if you mean "what's up"
 
0
Q: Shortest path for every source-destination (s-d) pair in a network?

liningI am working on Dijkstra algorithm and trying to find the shortest path for every source-destination (s-d) pair in a network. I have the below code which is working fine. class Vertex implements Comparable<Vertex> { public final String name; public Edge[] adjacencies; public double m...

 
12:05 AM
yeah same thing :)
not enjoying long weekend?
 
Don't really have one.
 
do you guys have any plan for the long weekend?
 
End of Saturday today, did school, trying to rest my eyes intermittently.
I'm an online student and I'm experiencing eye fatigue because I'm on the computer a lot.
So, I really shouldn't be here, but...
 
yeah I am Software Engineer and I am also infront of Computer a lot. My father is a doctor and he has provided me some eye tonic that I can use if my eyes are stressing out
 
That is nice.
 
12:09 AM
so sometimes I try out those things if my eyes are paining
 
I once (accidentally) used peppermint as an "eye tonic"
 
@Phrancis How you doing? Any plan for long weekend
 
That sure hurt.
 
lol, never tried that before.
 
Don't. Just don't.
 
12:10 AM
We are happy to release Cardshifter Alpha 0.5 for everyone to play! Here it is, give it a try! https://github.com/Cardshifter/Cardshifter/releases
 
I wasn't sure if I was blind for a second.
Anyway, they are really beginning to bug me now, so see you later.
 
Please retweet, if you can :)
 
cyaaa
 
@phrancis would you mind bumping this to a friend/someone who would know about Java in general? — Evan Bechtol 14 mins ago
@rolfl @SimonAndréForsberg @Vogel612 ^^ This looks pretty interesting
(I'm sure there are more Java people, just can't think on top of my head)
 
Already seen... nothing much to say from my side :(
 
12:27 AM
-1
Q: Is this code correct MYSQLI? Is it SAFE from INJECTION? Is CLEANUP done properly?

jordan.peoplesIs this correct MYSQLI implementation? IS it safe from injection? IS the object cleanup done properly? <?php include_once '../../securelogin/db_connect.php'; include_once '../../securelogin/functions.php'; sec_session_start(); if (login_check($mysqli) == true) { $con = new mysqli("localho...

 
12:57 AM
0
Q: Condensing code that generates Pascal's triangle

user3673010I recently started learning Java for a class and my teacher gave us an assignment in which we had to write up code which would print out the Pascal's triangle to an amount of rows decided by the user, and use recursion to do so. I believe that I'm done with the assignment, but wanted to know, for...

 
1:09 AM
This question is better suited for codereview.stackexchange.comrednaw 16 secs ago
This question is better suited for codereview.stackexchange.comrednaw 50 secs ago
 
> Using a Selfie Stick may feel awkward, but just like a condom, when properly used, it is the best protection against unwanted surprises.
Still not convincing me
 
@Phrancis Done.
Thanks, @Jamal and @Mat'sMug
 
1:29 AM
If you do decide to post to Code Review, please make the question more concrete and less sketchy. — 200_success 19 secs ago
 
@CaptainObvious Ugh, Ugh!, UGH!
0
A: Condensing code that generates Pascal's triangle

Hosch250There is a lot that can be improved in this code. First and foremost - please use longer, descriptive variable names - p doesn't really tell you anything. The only time I would say it is acceptable to use a single-letter variable name is the traditional i and c variables used like this: for (i...

 
0
Q: Subtle error in calculate polygon centroid function?

user89Here's a function I have to calculate the centroid of a polygon, based on this document: import numpy as np # a polygon approximating a circle with geometric centre at (37.5, 37.5) testpoly = np.array( [[ 50., 37.5 ], [ 48.91931822, 42.58420804], [ 45.86413258, 46.7893103...

 
The question would need to be enhanced before it can be a good question for Code Review. You may be better off asking a new detailed question there than migrating this one. Such cross-posting is OK since you are tailoring the question for each site. Do mention and link the questions to each other, though. — 200_success 10 secs ago
 
1:55 AM
Yes!
I passed JavaDeveloper.
 
For all the downvoters, if the above code reviews a bug with Visual Studio, isn't it of some value then? — prestokeys just now
 
You're next, rachet freak!
And Eric Lippert after you (unless you pass him first).
@Duga False positive.
 
2:11 AM
Welcome to Stack Overflow! Please add meaningful code and a problem description here. Don't just link to the site that needs fixing - otherwise, this question will lose any value to future visitors once the problem is solved. Posting a Minimal, Complete, Verifiable Example that demonstrates your problem would help you get better answers. For more info, see Something on my web site doesn't work. Can I just paste a link to it? Also, questions of design patterns should go on Code Review. — Nathan Tuggy 44 secs ago
 
2:25 AM
0
Q: Reading configuration from a file

ZerowalkerI haven't done anything similar so I got nothing to go on. The point was to load everything from the file and I thought a struct would be a good choice to be the handler to store the information. The loading part is, however, not really something that is to my satisfaction as I find it very prim...

 
Pity it is the weekend.
My latest question hit the Top Network Questions.
I can always use a few more reps!
 
2:53 AM
Just a note, only 100% working as they want it to code is welcome on Code Review. I can't understand, Can Anyone help to understand, please? -> We don't answer these in Code Review SE. — JaDogg 1 min ago
 
3:57 AM
Code inspections, refactorings, navigation, todo's, unit tests and source control for your #vba code? @rubberduckvba gives you all that!
monking!
 
4:13 AM
If you want someone to review your code you should ask on Code ReviewHobo Sapiens 53 secs ago
You can also try putting it in code review codereview.stackexchange.comFred -ii- 29 secs ago
 
4:25 AM
In that case, I do not understand the question. Can you supply a specific criterion you're looking for when you say your current implementation doesn't "feel" like a great implementation? I'm going to vote to close the question under the current description since it seems to better belong at the code review site. I'm happy to revoke the close vote pending more details or possibly answers from others. — Mr. F 9 secs ago
 
0
Q: Drawing the same 3D-model multiple times

ShiroI am looking ways to improve the efficiency of my draw method in XNA/Monogame and understand how things work. I have just a group of 4 models (bricks), (red, green, blue, yellow) I am drawing multiple times on the screen (100-120 total models, so drawing each model 25-30 times) on the current fra...

0
Q: Should I prefer duplicate code or ignored parameters

Justin PihonyGiven the setup: val myList = List(1) val myList2 = List(2) val moreList = List(3) val moreList2 = List[Int]() I am between two method signatures: def do1(objs: List[List[Int]], message: List[Int] => String) = objs.foreach{obj=> println(message(obj)) obj.map(_.toString) } Or de...

 
Close vote: should be migrated to codereview.stackexchange.comMr. F 51 secs ago
 
4:42 AM
Well done @SimonAndréForsberg
2
(30k)
7
Q: Single class unit test framework in Java

JaDoggThis is a single class and dependency free1 unit test framework for Java. The only assertion available is assertTrue (this can be used for all test cases). (Utilizes feature of Java7 : Multi catch) What it does Execute all methods with annotation Test. should fail if any arguments are needed...

8
Q: Project Euler #2

JaDoggProblem: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four milli...

few more votes for these questions to become Good Questions, does any one have votes left ?:D
Thanks Santa(s) :)
 
4:59 AM
If we have , do we even need ?
 
if you have but not , will create itself ;)
 
I've just realized that we had the latter. It was first used by just one user.
 
hmm
interesting. the 3 posts are tagged with both and
TBH I've never used monogame
 
This type of questions better suited for Code Review site. — PM 77-1 21 secs ago
 
0
Q: MySQL: Join - order by vote-sum and check if user has voted

MaddinI have a vote and a comment table. Now I want to display all comments and order them by votes-sum. Sum because some votes can have a higher value than others. Therefore I want to display if the user has voted already on a comment. So I need to get that value too. This is my actual query: SELEC...

 
5:14 AM
Darn you, SE!
I just reviewed a question, and it removed the question from the queue, but didn't give me the review!
No one else reviewed it, either.
 
5:25 AM
Can you please improvise this answer without using print function? — overexchange 6 mins ago
@overexchange I'd do this:
def hailstone(n):
    return [n] + ([] if n == 1 else \
                  hailstone((n // 2) if n % 2 == 0 else (3 * n + 1)))
 
Welcome to Stack Overflow. Please take the time to familiarize yourself with the Stack Overflow help file, which will help you understand what kinds of questions are appropriate for this site. This site is intended to help you obtain answers to specific programming questions, as opposed to providing tutorial, design or code review assistance. — MarsAtomic 1 min ago
 
Or the more readable version:
def hailstone(n):
    if n == 1:
        return [1]
    elif n % 2 == 0:
        return [n] + hailstone(n // 2)
    else:
        return [n] + hailstone(3 * n + 1)
 
@Duga Whew. False alarm.
 
5:53 AM
0
Q: Optimizing a Query in Entity Framework

msb2040I'm wondering what can be done to optimize the following. I've tried to note the points at which most of the overhead is occurring. The main two points I see are The call to DiffDays from within the LINQ query. The ordering by DateTime LastOnline before putting results in memory. Right now...

 
It is getting harder to pass users.
About 200 to go to pass the next two.
I have a JavaScript question I can answer.
Maybe tomorrow.
Good night!
 
@200_success After debugging, am assuming repeat(square, 2) calls return apply_n_times(n) should just return a function body by name recursive_apply that refers to object that has internal call return apply_n_times(n - 1)(f(x)) but instead the debugger shows runtime executing return apply_n_times(n - 1)(f(x))
 
Is there a problem?
 
you solution gives correct result, but am unable to understand why return recursive_apply is just not returning function object to the caller repeat(square,2), but instead executing apply_n_times(n - 1)(f(x)) within that object.
 
This is a perfectly reasonable and on topic question, but it may have been better received on Code Review. — Esoteric Screen Name 1 min ago
 
6:08 AM
Context, for onlookers:
1
A: Functional programming approach to repeated function application

200_successI see that you have grasped the concept of higher-order functions. To be more generalized, though, your repeat function should be able to handle n = 0 correctly too. That is, repeat(square, 0)(5) should return 5. However, your solution is not written in the functional style, due to the use of ...

return recursive_apply indeed returns a function object.
It may actually be slightly easier to understand if you look at the lambda version.
def repeat(f, n):
    def apply_n_times(n):
        if n < 0:
            raise ValueError("Cannot apply a function %d times" % (n))
        elif n == 0:
            return lambda x: x
        else:
            return lambda x: apply_n_times(n - 1)(f(x))
    return apply_n_times(n)
The analogous piece of code would be
return lambda x: apply_n_times(n - 1)(f(x))
That is, return a function that takes a number, that when called, applies it n times.
It does the "apply n times" by applying it once — that's f(x) — then applying it n-1 more times.
 
`repeat(square, 2)` calls `apply_n_times(2)` returns object pointed by name `recursive_apply`. So, expression `repeat(square, 2)` is replaced by `recursive_apply` and the expression becomes `recursive_apply(2)` where name `recursive_apply` points to object `def recursive_apply(x):
return apply_n_times(1)(f(x))` is that correct?
 
and the expression becomes recursive_apply(2) is where you went wrong.
 
ok
I mean `repeat(square, 2)(5)` becomes `recursive_apply(5)` where `recursive_apply` points to object `def recursive_apply(x):
return apply_n_times(4)(f(x))`
 
no, still wrong
 
Let's change the example to repeat(square, 2)(5) so that we don't get the two twos confused.
 
6:18 AM
ok
 
So, try explaining again?
 
grabs popcorn and M&Ms
 
I mean `repeat(square, 2)(5)` becomes `recursive_apply(5)` where `recursive_apply` points to object `def recursive_apply(x):
return apply_n_times(4)(f(x))`
Because return apply_n_times(5) makes this happen, Is that correct?
 
Yes. More specifically, apply_n_times(4)(square(5))
 
1
Q: Rubberduck's "Extract Method" refactoring implementation

Mat's MugWith the ANTLR-powered parser, I was able to reimplement all code inspections from the last release build, and more importantly to add a bunch more inspections. Code inspections and quick-fixes are nice, but we want our Rubberduck even smarter than that. So I wrote one of the coolest things I'...

 
6:22 AM
@CaptainObvious I almost recreated the tag! :O
 
yes due to closure property which is part of object pointed by recursive_apply which has f pointing to square function object. so it is square(5) but not f(x).
 
That's a different kind of . Unfortunately, the distinction would be lost on most users.
 
totally :)
 
Well, f(x) is square(5) in that context.
 
'night @all!
 
6:27 AM
Good night!
 
Night!
 
So, are we comfortable with apply_n_times(4)(square(5))?
 
I think, expression repeat(square, 2)(5) becomes recursive_apply(5) which is yet to execute where recursive_apply points to object def recursive_apply(x): return apply_n_times(4)(square(x)). I do not think x is 5. x gets evaluated when we evaluate expression recurive_apply(5)
 
I'll suggest again that the lambda version might be easier to read.
return lambda x: apply_n_times(n - 1)(f(x)) says… "Return a function that takes a number x, that executes f(x), then applies it n-1 more times."
 
Good night Mat!!
 
6:35 AM
Is the lambda concept bothering you?
Try this: sq = lambda x: x * x
 
I equally prefer lambda approach but it is too early to get into lambda before understanding how functions return functions and how function define functions.
 
@overexchange Then master practical functions first, before moving onto hyper-function types.
 
Once you get used to lambda, you'll find that it can be less cumbersome than defining named functions.
Have you tried running sq(5)?
Do you see how that works?
 
I am picturizing the flow, one sec
 
6:51 AM
Just read sq = lambda x: x * x as "sq is a function that accepts an x and returns x * x."
Take your time to play with it. I'll take a break for half an hour or so.
 
7:12 AM
0
Q: Ruby - pair of squares - map or inject?

Dhruv KapurSo I was listening to this keynote in RubyConf 2014, Enumerable for fun and profit. There he mentions a problem of getting pairs of squares. so on input a = [1,2,3,4,5] we expect to get: [ [1,1], [2,4], [3,9], [4,16], [5,25] ] My instinct was to use a map: a.map { |n| [n, n**2] } While th...

 
7:28 AM
@200_success Sorry for the delay, but this is how I understand the flow.
 
7:47 AM
To be more precise, third evaluation is something like this..
 
7:59 AM
OK.
An alternate phrasing of that:
repeat(square, 2)(5)
 = apply_n_times(2)(5)                  where f = square
 = recursive_apply(5)                   where f = square and n = 2
 = apply_n_times(1)(square(5))          where f = square
 = recursive_apply(square(5))           where f = square and n = 1
 = apply_n_times(0)(square(square(5)))  where f = square
 = identity(square(square(5)))
 = square(square(5))
Note that in functional programming, the order of evaluation is irrelevant.
That's one of the nice consequences of the "no side effects" property.
 
8:25 AM
0
Q: How to optimize this parser?

user3163916I need to parse the following input string into a hash table with the following format: input: '1001=23;1001B=5;1002=0;1003=5;' output: => {'1001'=>23,'1001B'=>5,'1002'=>0,'1003'=>5} My solution: def parser input output = {} input.split(';').map {|ar| ar.split('=')}.each {|id, c| outp...

 
8:41 AM
No. We can't. We know nothing about your requirements, your application, your database type or even which database it is... Furthermore, code reviews should be done on codereview.stackexchange.comErik Funkenbusch 11 secs ago
 
9:23 AM
@ErikFunkenbusch: This is not at all a code review as there is no existing code here. — Jamal 12 secs ago
 
monking
 
-2
Q: SQL database design for ecommerce

Nithin SaripudiI need to create a database which stores details products, Manufactures,Suppliers. So initially I divided Products into categories and subcategories. Supplier table should contain supplier details and price they are offering. I am not good database design. But managed to create the below one. Co...

 
9:47 AM
0
Q: line_to, fill_rect, and clear_rect functions

Jikku Josedef line_to(x: 0, y: 0, rect: nil) unless rect.nil? x, y, width, height = rect.x, rect.y, rect.width, rect.height end `#{@context}.lineTo(#{x}, #{y})` end def fill_rect(x: 0, y: 0, width: 0, height: 0, rect: nil) unless rect.nil? x, y, width, height = rect.x, rect.y, rect.width,...

0
Q: C++ and command prompt?

RogUEI would like to make a simple program to hide/unhide hard disk partitions in windows. In order to accomplish that I have to run commands in command prompt within the program. I have heard that the command "system()" can be used to run commands. I have given a snippet of the program, let me know w...

0
Q: Improving the execution time of the below program

arindrajitI want to find the lowest hop count from source to destination. My output is correct but the execution time of my program is like 1.0015 seconds when given 100000 entries. But I need to do the program within 1 second time frame. I have tried a lot to reduce the execution time but couldn't. Can an...

 
10:05 AM
0
Q: Excel to serializable object

molnardenesI've got an Excel file from which I have to read out data to an object to serialize. So far I came up with this solution, I'm curious if there are any clearer solutions? public myClassFromXsd excelToMyClassFromXsd(String excelFile) { Excel.Application excelApp = new E...

 
10:45 AM
codereview.stackexchange.com would probably be a better fit for this question. — Bohuslav Burghardt 7 secs ago
 
11:14 AM
^^^ a pretty average Sunday morning ;-)
 
0
Q: Runtime error in segment tree

user3087202I am trying to solve a problem which requires to count the number of prime numbers in an an array from indices L to R. The problem is available here I have implemented the problem here but it gives runtime error.(SIGSEGV). Please help!! I am not able to figure out why it is doing so.

0
Q: Sudoku validator

CaridorcI decided to learn some more Haskell writing a Sudoku validator, the function checkSudoku outputs True if the Sudoku is valid and False if it is not. I did not write the checkSquares function because it would have been to hard. I am looking for any tip about Haskell and functional programming. ...

 
11:36 AM
Have you considered accepting BCdotWEB's answer instead?He made some good points, and it's a nice reward for taking the time to review. Or if you're still not happy with that answer and looking for more, you can just not accept any answer to leave the question open. Accepting own answers, especially in the presence of other good answers, is a bit fishy on this site. — janos 13 secs ago
This should be a follow-up question. If the review by Lukas helped you, it would be better to accept his answer instead. — janos 9 secs ago
^^^ aka, [Bad Naruto](http://data.stackexchange.com/codereview/query/267209/bad-naruto) crackdown
there's more suspicious stuff, in topics I'm not well-versed enough to step in. I hope somebody else will
 
@200_success For your answer, here is the given flow..
	`repeat(square, 3)(5)`                      where `repeat(square, 3)` gets evaluated
	= `recursive_apply(5)`                      where `recursive_apply` is `apply_n_times(2)(square(x))`
	                                            After evaluating `recursive_apply(5)` expression becomes
	= `apply_n_times(2)(square(5))`             Here `apply_n_times(2)` gets evaluated first
	= `recursive_apply(square(5))`              where `recursive_apply` is `apply_n_times(1)(square(x))`
	                                            After evaluating `recursive_apply` [here `square(5)` is yet to be eval
 
Monking
 
@200_success Definitely, it is tough for me to get such thought process to write such programs. It is important for me to understand your thought process to write such programs. As you said, generally, recursive idioms in functional programming are in style...
def recursive_function(input):
    if base_case_applies(input):
        return base_value
    else:
        return …(recursive_function(…))
@200_success Only reason, your program does not look intuitive for me to think about such approach, because execution flow comes out of repeat(f, n) multiple times.
i think 4 times with identity as last.
 
11:59 AM
0
Q: facelets navigation, flow, sequence, structure and organization

ThufirI might finally start to be getting a glimmer of a notion of how to use facelets! I'm just trying to work on the navigation, flow and organization for the sample "guess number" application. It seems as though it's possible to just create small composite component files in the includes directory...

 
12:43 PM
0
Q: Converting an array-returning function to a lazy evaluator

NasserTake a look at the following function: std::vector<double> get_data( std::vector<double> const &data, double const t, double const x) { std::vector<double> result(data.size(), 0.0); double const A = func(t, x), B = func2(t, x); std::transform(std::begin(...

 
1:09 PM
-2
Q: Find the no of Scramble pairs?

Sritharan M Let a pair of distinct positive integers, (i, j), be considered "scrambled" if you can obtain j by reordering the digits of i. For example, (12345, 25341) is a scrambled pair, but (12345, 67890) is not. Given integers A and B with the same number of digits and no leading zeroes, how man...

 
@janos would you mind not answering so much? Then I maybe can upvote the "lowest voted answers" without fearing a vote-reversal ;)
2
 
I'll see what I can do, Santa Vogel
 
Monking
 
Monking
 
1:23 PM
Monking
 
@janos clarified, please check again ;)
 
lookin' pretty bitchin ;-)
 
1:53 PM
0
Q: Gathering response from a pagable service

BasilTomatoI'm wondering how this code could be improved. I especially don't like the use of mutable Buffer but not sure what the best way to get it out cleanly. def find(service: Service): Traversable[Long] = { def loop(lastId: Option[Long]) (acc: mutable.Buffer[Long]) (q...

 
Monking :D
0
Q: Create New C++ Class CPP and H files

JaDoggI'm currently developing a new version of ExpressGenGen Using TDD. While I'm rewriting the new version of my Code Generator Generator, I'm using It's old version to generate code to be used by the new version. This is how I'm creating new classes, When a new class is created It will generate a .c...

 
0
Q: Create New C++ Class CPP and H files

JaDoggI'm currently developing a new version of ExpressGenGen Using TDD. While I'm rewriting the new version of my Code Generator Generator, I'm using It's old version to generate code to be used by the new version. This is how I'm creating new classes, When a new class is created It will generate a .c...

 
2:10 PM
0
Q: Am I violating the beginner tag?

JaDoggI consider my self a beginner, therefore I usually end up using the beginner tag. For these questions am I violating the beginner tag ? Reverse Polish Notation Compiler Code Generator Generator Also keep in mind that I consider myself a beginner when it comes to C++ and Perl.

 
0
Q: Am I violating the beginner tag?

JaDoggI consider my self a beginner, therefore I usually end up using the beginner tag. For these questions am I violating the beginner tag ? Reverse Polish Notation Compiler Code Generator Generator Also keep in mind that I consider myself a beginner when it comes to C++ and Perl.

 
2:48 PM
Monking @JaDogg
I wasn't supposed to answer anything anymore today.... but it's Bash, I'm left with no choice...
 
@almasshaikh please don't direct people to post non-working code on Code Review. This is unhelpful to both the OP and to Code Review. — Boris the Spider 15 secs ago
2
 
the indentation of what?
 
3:18 PM
1
Q: Something breaks my indentation

JaDoggSeems like there is a bug, that breaks my indentation. See In third code section of Create New C++ Class In first code section of Code Generator Generator

 
3:33 PM
@JaDogg I added a few more points to my review, I'm done now
that indentation issue is creepy....
 
3:47 PM
0
Q: Correct use of classes through interface OOP PHP

Pieter GoosenI'm busy rewritting some from my spaghetti code into OOP classes. I'm still learning OOP and very new to the concept. From help from this answer from @EliasVanOotegemto on a previous question I've asked I have written the following class which sets up conditionals according to 4 values passed to ...

 
There's a new duck in the twittosphere, who wants to follow?
5
@rubberduckvba
Rubberduck is a COM add-in for the VBA Editor (VBE) that provides an amazing range of functionalities that take programming in VBA to a whole new level.
4 tweets, 1 followers, following 6 users
 
0
Q: preg_match syntax

EducateYourselfI want to check if there are following chars in the input field: a-z A-Z whitespace , & () / Please check if the following syntax is correct or maybe no need for [] brackets preg_match('/^[a-zA-Z\s][,][&][()][/]+$/', $value)

 
4:04 PM
@CaptainObvious off-topic
...not
this code works like a charm. I just need to improve it. If there is no need for brackets, I can remove them. — EducateYourself 4 mins ago
 
I am not convinced that this code is working as you want it to. Please provide several inputs that it matches, and some inputs that it doesn't, and shouldn't, match. — Simon André Forsberg 18 secs ago
I don't think that is working as he expects it to
also, how can we review a regex when there's no examples of what the regex should match or not?
 
I always have a hard time gauging one-liner posts...
 
I'm not against the one-liner this time, I am against the crappy regex
3
 
stargreed
 
^[a-zA-Z\s][,][&][()][/]+$ will match a,&()//////, but it will not match abcde
And why on earth would he want to match a string that ends with &()/ ?
 
4:18 PM
there's not enough context to know that that input field is supposed to be, and why it needs to be validated like that.
 
E_WARNING : type 2 -- preg_match() [function.preg-match]: Unknown modifier ']' -- at line 2
 
His verbal description probably still means "restricted to these characters".
 
I think the regex is broken
 
4:32 PM
it's definitely broken
mostly because it's anchored
 
4:59 PM
0
Q: pygame text weird

user65187I want the text to go away in 2 seconds after level1text = true. #!/usr/bin/python import pygame import time pygame.init() blue = (25,25,112) black = (0,0,0) red = (200,0,0) bright_red = (255,0,0) white = (255,255,255) groundcolor = (139,69,19) green = (80,80,80) other_green = (110,110,110...

 
@janos Thanks, I'm going to accept it, I don't think anyone else can add more points.
 
awesome!
 
:D
 
how are you btw? how's your work / life these days?
have you tried PyCharm btw?
 
I'm a bit busy than I was, And I'm usually sleeping at the night, That's why I'm not here a lot now.
@janos Ah yes.
It works better, specially when it comes to refactoring.
 
5:05 PM
glad to hear
 
Python scripts I'm writing is being used for Continues Integration
Nice to see you again, bye :)
 
alright, see ya
 
0
Q: C# Log-reading & String-matching with hashtable for fastest execution speed

notsoobviousI'm new to C# and am currently enjoying this exercise I'm working on for fun: I wish to write optimized code for the searching of particular strings per line in a (very large) file, counting how many exist, and producing a text file with a count of said strings. The data format is actually very...

 
5:37 PM
I thought */App.config would be enough to exclude all app configs in my solution but it isn't
what gives?
 
re-monking!
 
Making another attempt at socializing here @uni? :P
 
no, lurking
 
Hi.
I'm enjoying being 1 rep away from the next milestone.
Maybe I should accept an answer.
 
Sounds like a good idea.
 
5:43 PM
I only had one question to accept.
Enjoy the points, acceptee.
I have 10 reviews in the First Posts queue to get the silver badge.
And only 4 votes left for today.
@Mat'sMug @Phrancis You guys created Twitter pages for your projects, should I create a Twitter page for Learn OneNote?
And have it apart from my own page?
 
heck, why not?
3
 
I don't know.
I think I will just change the name.
 
Just Do It
2
 
I won't use it if it is just about me.
Do it later, busy ATM.
 
has anyone ever worked with ANTLR? I have an ANTLR-specific question here:
1
Q: Can a walker be stopped?

Mat's MugI have a ParseTree listener implementation that I'm using to fetch global-scope declarations in standard VBA modules: public class DeclarationSectionListener : DeclarationListener { private bool _insideProcedure; public override void EnterVariableStmt(VisualBasic6Parser.VariableStmtCont...

 
5:52 PM
Nope, sorry buddy.
 
VariableNotAssignedInspection is turning out being much more complicated than I thought
 
nope, but at least ho ho ho, naturally
 
thanks! :)
 
hehehe
Three votes and nine reviews til silver!
Maybe tomorrow.
 
1
Q: TypeScript: Using Interface for Generated Functions or Just Create Functions Correctly

Jon49I was wondering which code might be "better." I'm abstracting away the rote code as follows: type InvokerArgs = any[] interface InvokerFunctions { /** * yep is a wonderful function */ yep: (r: string, s: number) => InvokerArgs nope: (t: boolean, u: string) => InvokerArgs } var invoker...

 
6:03 PM
BTW, I just read my next management chapter.
 
well that's helpful
Smash its brain. — JohnLBevan 19 secs ago
 
Apparently, the reason we use the QWERTY keyboard instead of the Dvorak keyboard is because...
Typists typed too fast and jammed mechanical typewriters.
So, they had to slow them down.
Dvorak keyboards are twice as fast and generate half the number of errors.
I want to start a computer brand.
It will use Dvorak keyboards by default, and have the Braille symbol on the key as well as the standard symbol.
I bet a lot of people would automatically learn Braille just by typing.
 
@Hosch250 that's a good idea. so when all the programmers are blind from spending too many hours staring at a computer screen, they can keep coding! :)
 
:)
I could code more easily with my eyes shut then.
Instead of accidentally typing sh*t instead of shut.
 
lol
 
6:08 PM
Or techbology instead of technology.
 
I know a monkey that would make a good tester for such a keyboard
 
I am really doing this stuff right now.
My eyes are really tired.
 
I sometimes (on QWERTY) type faster as I can think, that might become a real issue on DVORAK
 
Maybe.
 
and my friends would hate me for using a Dvorak keyboard
 
6:11 PM
If I was MS, I would have Windows be desktop-only and create a new OS from scratch.
Windows is a tired brand - they need something new.
I would make the other one tablet-oriented, and leave Windows as the desktop-power-user OS.
Maybe gradually merge them, but maybe not.
One can support all devices with the modern-style apps, while Windows can only run Win32.
Do you ever experience this: en.wikipedia.org/wiki/Flow_%28psychology%29
I usually get like that when programming.
 
6:28 PM
If I was MS, I would also implement Dvorak keyboards and provide heavy training for them.
If people can type twice as fast with half the amount of errors, that would reduce costs significantly.
Then, we would have a competitive advantage.
 
6:46 PM
0
Q: Receiving .mp4 file over TCP socket (C++/Android)

GeneralbrusI'm working on a project which requires transmitting a MP4 video from a Java (Android) server to a C++ (Visual studio) client. Everything works fine if I use a Java Client, but with the C++ client I receive a file 1bit larger that the file sent. As a result, the file won't obviously open. I don'...

 
@Hosch250 That's a slight mischaracterization. QWERTY is not designed to be slow. Rather it is designed to be fast. Given the challenge of jamming keys, QWERTY aims to reduce the probability of adjacent type arms being activated consecutively.
QWERTY won out over other key layouts at the time precisely because it was faster.
It might be better to say that QWERTY is not as ergonomic as Dvorak, or maybe not as fast as Dvorak. But QWERTY being designed to slow typists down is a myth.
 
@Hosch250 If you're looking to get people talking about your project, Twitter is a good medium. It's free and low maintenance, and just about everyone uses it.
 
Perhaps better suited over @ codereview.stackexchange.com or do you have a specific question? — Fredrik Pihl just now
 
@Duga No it wouldn't
 
This question sounds like it is asking about specific issues with the code, and therefore would not be a good fit for Code Review until the code works as intended. — Phrancis 1 min ago
 
6:59 PM
@Pimgd What is that?
 
@200_success OK. That is what the book said...
@Phrancis Yup, that is what I want.
 
@syb0rg does need deleting, doesn't seem to be spam though
 
I recommended deletion
 
@Vogel612 I'm not sure if it's spam or not, judging from the other deleted post on that same question
 
might be testing the waters, yea
 
7:08 PM
@Vogel612 poof
 
yaay
 
Why can I access the queue and recommend deletion if it doesn't do anything anyway?
Or does two recommend deletions count as one deletion?
So lower rep users can help handle content on sites with a lot of content generated.
 
@Hosch250 Pretty sure it works like flagging, so lower rep users who can't VTD yet can still help handle content, indeed.
 
0
Q: Two sets came to an intersection

LegatoChallenge: Print set intersections. Specifications: Your program should accept as its first argument a path to a filename. Each line in the file is a test case. Each test case contain two semicolon delimited sorted lists of numbers in ascending order, whose numbers are separated b...

 
7:24 PM
@Legato To include an empty line in a quote block use the HTML tag <br>
> <br>
> Like this
 
Thanks @Phrancis
 
I have an idea for a tree implementation.
I am going to write it and post it soon.
 
You should try: codereview.stackexchange.com. Flagged as off-topic. However, keep going! Programming is a great thing to learn! :) — Jordan Dolan 1 min ago
This is off-topic because it's asking for a code review. I'm not going to say that this is on topic for the CodeReview.SE because it's not something that'd appear in production code, but it's not on-topic for Stack Overflow. — Makoto 1 min ago
 
7:42 PM
@Hosch250 I don't know how I've survived without implementing a single tree in my life.
If I would implement a tree, it would likely be a Splay Tree, they seem cool.
A splay tree is a self-adjusting binary search tree with the additional property that recently accessed elements are quick to access again. It performs basic operations such as insertion, look-up and removal in O(log n) amortized time. For many sequences of non-random operations, splay trees perform better than other search trees, even when the specific pattern of the sequence is unknown. The splay tree was invented by Daniel Dominic Sleator and Robert Endre Tarjan in 1985. All normal operations on a binary search tree are combined with one basic operation, called splaying. Splaying the tree for...
But that is a very big if
 
0
Q: cm-to-inch calculator

nikola1970After a few pages reading Learning Python Hard Way, I've decided to try to make a simple cm-to-inch calculator. I am very excited about this achievement, and I want someone to check my code. It works well, but i just need someone to confirm everything is written well. # cm to inch calculator in...

 
8:23 PM
@Phrancis I think it's not great to mix html into markdown. You can add 2 trailing spaces at the end of the line for an effect like <br>
 
Ah, didn't know that either. Guess it's one of those quirks.
 
true, it's a very obscure feature
 
@SimonAndréForsberg What are trees for, anyways?
They seem pretty theoretical (at least to me)
 
@Phrancis to climb in, what else?
3
They're used to organize data in a way to make it easier to search, insert, and/or delete
 
This type of questions is better suited for Code Review site. They love to discuss using factories instead of explicit constructors and all such stuff. — PM 77-1 1 min ago
 
8:36 PM
@SimonAndréForsberg I see, just one of several types of data structures eh?
 
@PM77-1 This is what we would call example code, which is not something that we would like to "discuss". This would be off-topic on Code Review. — Simon André Forsberg 50 secs ago
My suggestion would be to post the real code on Code Review and ask for a review on that. It is likely that Code Review users can suggest a better way of doing things when being faced against the real code with real context. And while they're at it, they might discover something else that can be improved as well. — Simon André Forsberg 6 secs ago
 
8:52 PM
@SimonAndréForsberg easier faster
 
@skiwi Faster. Harder. Scooter.
 
@SimonAndréForsberg Holy... wow... I'm not the only person who knows the band Scooter.
 
@Phrancis oh definitely not! Listen to them a lot in the 90's :)
they're German, aren't they? (@Vogel612 ?)
 
Yes
 
00:00 - 21:0021:00 - 00:00

« first day (652 days earlier)      last day (3371 days later) »