« first day (1102 days earlier)      last day (2917 days later) » 
00:00 - 16:0016:00 - 00:00

4:00 PM
you are listed on our memes page as the starter.
 
@Mast I was rewriting some CMake building code and there were a lot of changes I made lol
@EᴀsᴛᴇʀʟʏIʀᴋ Really? Where?
 
@EᴀsᴛᴇʀʟʏIʀᴋ There never was a start, it has existed from the beginning.
 
That halarious
 
18
A: The Many Memes of PPCG

DoorknobMeme: Code Review Originator: unclear / syb0rg? Cultural Height: up to CR's graduation :( Background: Ever since around March of 2014, Programming Puzzles & Code Golf and Code Review have had a friendly rivalry of who could graduate first (which has expanded to become a friendly rivalry in gen...

 
4:01 PM
@Mast Where/when/how did you see that?
 
18
A: The Many Memes of PPCG

DoorknobMeme: Code Review Originator: unclear / syb0rg? Cultural Height: up to CR's graduation :( Background: Ever since around March of 2014, Programming Puzzles & Code Golf and Code Review have had a friendly rivalry of who could graduate first (which has expanded to become a friendly rivalry in gen...

dangit ninja'ed
@syb0rg @Mast, @Phrancis and @Quill are all somewhat active in our chat, The nineteenth byte.
 
@EᴀsᴛᴇʀʟʏIʀᴋ Wow, so I was
Good times, good times
 
I'm not, but my duckduckgo-fu is over 9000.
 
@EᴀsᴛᴇʀʟʏIʀᴋ Are they regular contributors to PPCG?
 
I dropped in a couple of times when they were making fun of us, but that's about it :P
 
4:03 PM
@Mast Anyways, yesterday I was fixing up Khronos, but also gave Tritium a bit of a facelift: github.com/syb0rg/Tritium
The github readme a facelift, anyways
For Khronos I'm kinda deciding where to expand the program next
Do I want to work on improving the speech recognition? Or do I want to add chat bot capabilities?
 
in The Nineteenth Byte, Jan 23 at 21:46, by Mast
I don't know every esolang by heart.
in The Nineteenth Byte, Jan 23 at 21:46, by Mast
You guys keep making them up.
@syb0rg How's the recognition so far?
 
Decent, but could be better
Part of it is working with PocketSphinx
Part of it is working with the input audio
Like I should probably be doing more digital signal processing on the input and working to cancel out noise
 
@syb0rg I mostly hang in chat there, I only have 1 answer on PPCG
 
@syb0rg You could add issues to your repository with items you want to implement (eventually). I guess that would make it easier to track progress.
 
@Mast I have a running TODO list in the repo
 
4:08 PM
@Donald.McLean I haven't been watched this week just yet.
Oh look, a @syb0rg!
 
0
Q: Loading sub items of TreeView in background

JNSI am working with a TreeView (default control from .Net Framework) that displays hierachical data. Data are bound to the view using MVVM pattern with the HierarchicalDataTemplate. <HierarchicalDataTemplate DataType="{x:Type models:TreeItemViewModel}" ItemsSource="{Binding Children, Mode=OneWay}">...

 
@SimonForsberg Hello friend!
rob0t is also present
 
@syb0rg Thank you. You too.
 
Mention him and he'll talk to you
Otherwise he'll stay quiet
 
@SimonForsberg Finished mine today.
@rob0t You too.
 
4:09 PM
@Mast Yes I am.
 
Good. I was afraid he wasn't.
 
rob0t is very fluent in gibberish
 
@syb0rg The United Kingdom of Great Britain
2
 
Fluent in BS.
 
@SimonForsberg I'll be watched again tonight.
 
4:10 PM
Yes! More watchies!
 
@Donald.McLean I am considering waiting for tomorrow so that I can be watched twice.
 
Where's @Duga?
 
Unfortunately, 2 episodes per week will drain the queue of what's available very quickly. And we'll never be watched again.
 
@Mast She's here, guess she just doesn't have much to report right now
 
Always lurking
5
 
4:12 PM
@rob0t What do you think about @Duga, friend or enemy?
 
Always watching
 
@skiwi Could I borrow a cup of sugar?
 
hey @syb0rg
 
@Donald.McLean Yeah, don't remind me. I try not to think of that. :/
 
@skiwi Hi friend!
 
4:13 PM
22
A: The Many Memes of PPCG

PhiNotPiMeme: Stealth Pinging Origin: Unknown, various techniques have been developed Cultural Height: June 2015 to November 2015 Background: In chat rooms, normal pinging involves writing a message containing @username123, which sends a notification to username123 that he has been mentioned in chat. ...

good thing I didn't know about that....lol JK
 
@skiwi He isn't much for intelligible responses
 
@syb0rg Is there... anything intelligent about him?
 
@Duga Human generated response?
@skiwi Well, he's responding to everything on his own
 
For some values of intelligent.
@syb0rg I'll give it another shot, see if it does more than last time.
 
@syb0rg We all know that @Duga is the human and @SimonForsberg is the bot
 
4:15 PM
@Mast I still am having problems getting Travis CI to compile it fully, but it works for my Mac
You can test the accuracy for yourself, you'll see it's probably a bit less than 50%
 
@syb0rg The whole point of CMake is to make it runnable on more than just your Mac, right?
 
@Mast Exactly
But I don't have access to many build systems
Which is why I try to use Travis CI to help me with that
I don't think Travis is failing the builds because of my CMake script tho, I think I'm just not setting up the Travis environment correctly
 
@syb0rg Side suggestion: Setup Jenkins on some Machine of yours instead of running Travis.
Jenkins might be more difficult to setup for building for multiple platforms though... but the top-side is that on Jenkins you can control everything.
(Yes, I like Jenkins, but I've never really been a friend with Travis)
 
@SimonForsberg Hm, I've never really given Jenkins a shot really
I suppose I'll try it
The thing I like about Travis tho is that it gives that little banner telling you how your build did
 
@syb0rg VMs and dual-boots don't cut it?
 
4:21 PM
(the "build passing")
@Mast I could probably do that, I'm just being lazy :P
 
@SimonForsberg Tough enough to require a book or will 2 pages of how-to do the trick?
 
I've set up Jenkins before, I forgot how I did it, but it isn't that hard
I think I bricked the server once during setup though
 
@syb0rg Those aren't very difficult to make... I wonder if there's a Jenkins plugin for that. I found wiki.jenkins-ci.org/display/JENKINS/Figlet+plugin but it's not clear what it does.
 
@skiwi Let's hope I don't brick my computer
 
@Mast Well, with Jenkins you can control exactly what shell script you want to run, for example. So if you just know what shell script to run, then the rest is easy.
 
4:26 PM
@SimonForsberg That's easy.
 
@syb0rg I typed chmod / * 777 or something like that, that was a bad idea
 
@Mast Have you downloaded and run it?
 
@syb0rg Not yet, will switch OS in a moment.
 
@skiwi Yes, that is a very bad idea.
 
@SimonForsberg So far I'm liking the setup
 
4:29 PM
I don't understand Travis though, they had something you could host on your own machine but decided to move everything to the cloud
 
I don't like clouds.
5
 
@syb0rg Awesome!
 
@syb0rg @Phrancis has posted once I think, @Quill a bit more (a bunch during winterbash 2015).
@Mast I don't like pessimists.
 
aww :/
 
#oops
ninja'ed
 
4:33 PM
yar
it probably didn't like the original url because of the asterisk in it
 
I'm voting to close this question as off-topic because it is a request for code review and so belongs on the Code Review site. — Toby Speight 35 secs ago
 
So, any suggestions on what I should work on next with Khronos anyone?
I could see myself taking the project multiple ways right now
And outside input is always a useful thing
 
Build your own Jarvis. Make his presence available throughout the entire house so you can just talk and have it do your thing
 
Oh, right, I recently crashed the x-org part of my distro...
 
@JeroenVannevel So implement a chatbot then
So he isn't as robotic
 
4:45 PM
Did you just reduce Jarvis to a chatbot?
 
Smart house.
 
What am I even doing here
 
Well, baby steps
 
chatbot is boring, everyone has done it already
 
Reword it then: intellegent response system
 
4:46 PM
You'll just end up with an AI and no or too little data to train it after which you'll turn to an existing API like Microsoft's bot framework
might as well skip all the work and just integrate it already and continue with the fun innovative stuff
You could create tiny apps for your home AI. Like saying "yo babe, translate 'alles goed?'"
where "yo babe" is how you get your AI's attention
and "translate" a command
so much fun
 
But the commands would be directly related to the AI's interpretation and response
 
response you get from APIs you use (or develop), interpretation is what you have existing chat frameworks for
 
in Discussion on question by thexiv: RAM overhead on a compression program, 19 mins ago, by thexiv
I've always fought reading those guidelines because I just convinced myself that, A. it'd be okay to try, and B. that it'd be hard to read.
well that explains it
in Discussion on question by thexiv: RAM overhead on a compression program, 1 min ago, by Mat's Mug
so, if you put your working version up for review in a new post, with a nice title that roughly says what problem the code is solving (i.e. what it does), and a decent description of it in the post body, with the whole working code in its glorious context (we love context/surrounding code!), I'm sure you'll get valuable feedback and a massively positive experience on CR (as usually happens)
 
5:01 PM
Wait for the new post, nuke the old one if required.
@syb0rg What's Khronos' final goal?
 
@Mast Intelligent assistent
 
Assist with what, general computer usage? Controlling the house? Launch missiles?
 
@syb0rg - Hey there, I went to see what language kronis is written in, and I was surprised:
You wrote your app in Makefiles?
2
 
@Mast Uh, all of that I suppose
If I really wanted to launch a missile, I wouldn't want all of the blame
@rolfl The cost of portability ;)
 
-- Could NOT find sphinxbase (missing:  SPHINXBASE_LIBRARY SPHINXBASE_INCLUDE_DIR)
-- Could NOT find pocketsphinx (missing:  POCKETSPHINX_LIBRARY POCKETSPHINX_INCLUDE_DIR)
-- Could NOT find LibSndFile (missing:  LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
-- Could NOT find tritium (missing:  TRITIUM_LIBRARY TRITIUM_INCLUDE_DIR)
Meh.
 
5:08 PM
That's good! That works fine
 
0
Q: Where it all begins (again): Khronos

syb0rgI've done a lot of reworking to this main file recently, in regards to using a new speech recognition engine and integrating the last reviews suggestions. My question before is going to be phrased very similarly to how it was previously. How Khronos Works The process starts off by recor...

 
@Mast I would be surprised if you had any of those installed actually. I should probably include a message with the build process tho that says they will be downloaded...
 
I vaguely remember it used to try to download them automatically.
It doesn't do so now.
I'll try it on a better set-up later.
 
@Mast Really? What broke?
Did you run make?
I'm now revising the Khronos README, that Advanced Writing class is actually really handy for this stuff
 
0
Q: Haskell Non-Dominated sorting

tsornThis algorithm sorts a list of Individuals, each with two fitness values, into what's called non-dominated fronts. A non-dominated front is a set of individuals where none of the individuals dominate each other. An individual is said to dominate another if is equal or lower (<=) for all fitness v...

 
5:18 PM
cmake
But I'm trying to run it from cygwin on a windows machine, that's probably not an anticipated case.
 
Hm, yeah I haven't tested it on a windows machine
But theoretically it should be okay?
 
It probably has no clue how to download. Doesn't give a notification either.
 
@Mast This is when you run make? After cmake ..?
 
Yes -- see the almost-a-duplicate question I linked. BTW, I strongly suggest showing your implementation for code review when you have one together -- it's very, very easy to get the details wrong in a security-impacting way. — Charles Duffy 53 secs ago
possible answer invalidation by schneiderwm on question by schneiderwm: codereview.stackexchange.com/posts/127992/revisions
 
5:38 PM
@Duga handled
Monking
 
@Heslacher Monking!
 
I just came into the office and the new server case had been delivered. Unfortunately someone (me) didn't measure the door frame :-( but luckily it went through the door ;-) (had been a very tight fit)
 
Lucky you didn't have to take it apart then!
 
yeah
Now I know what I will do through the night. Networkcable, patch panel, usv .....
 
> Thanks Francis.

Thanks,

Michael
I dislike when people add an auto-salutation to their signatures
 
5:56 PM
You should ask a more specific question. Is there a problem with the code you've provided? If you want a more general review of your solution, perhaps try Code Review at codereview.stackexchange.comMichael Blackburn 38 secs ago
 
6:07 PM
@syb0rg No, just cmake ..
 
@Mast Make is what actually downloads the dependencies
 
@Heslacher If it doesn't fit, you're not using enough force.
@syb0rg So why isn't cmake .. calling make to make sure the things are downloaded?
 
@Mast I'm confused... cmake flagged those dependencies for downloading and setup the makefile, you run make and everything should download, compile, and link
 
Ooooh. cmake only flags them but doesn't auto anything. Ok.
 
;-) the door frame is made out of metal like the server case
 
6:09 PM
Running make manually gives following:
CMakeFiles/tritium.dir/build.make:106: recipe for target 'library-build/src/tritium-stamp/tritium-configure' failed
After (attempting at least) to download tritium.
@Heslacher I fail to see a problem.
 
Well shit
 
I'll hijack the Nth for the full thing.
 
I find it odd, since tritium builds successfully on Travis
Which is a quite strict build system
 
6:23 PM
0
Q: prime generator SPOJ problem in python3

FreddyI am trying to solve [SPOJ] problem. I have used sieve of eratosthenes algorithm. But it is still slow when input is in range of 104 import math no_of_cases = int(input()) for i in range(no_of_cases): x = input().split(" ") a = int(x[0]) b = int(x[1]) lis = set([p*i for p in ran...

0
Q: An implementation of a static any type

user2296177Definition of util::any [Taken from the standard's description of std::any] A discriminated type that can contain values of different types but does not attempt conversion between them, i.e. 5 is held strictly as an int and is not implicitly convertible either to "5" or to 5.0. This indifferenc...

 
possible answer invalidation by 200_success on question by user3805080: codereview.stackexchange.com/posts/127884/revisions
 
@EᴀsᴛᴇʀʟʏIʀᴋ Hello again!
 
6:41 PM
I would suggest Code Reviewzondo 57 secs ago
I'm voting to close this question as off-topic because it belongs on Code Review. Questions on optimizing already-working code are off-topic on Stack Overflow. — MattDMo 14 secs ago
 
@EᴀsᴛᴇʀʟʏIʀᴋ Do you have any experience with C per chance?
 
Nope.
Other than a quick arduino lesson (read: 30 minutes) to test out of CS101, no.
Only Python and Jolf.
 
0
Q: Real-time polling without the CPU Spike in C#

Marc SchurichtI am reading a signal off of a meter using a managed C# wrapper on a C++ object. In order to calculate the value of the meter, I need to determine the length of time from when the signal goes from 0 to 1 then back from 1 to 0. So, my code looks like the following: var sw = new StopWatch(); var...

0
Q: Umbraco - MVC - traversing content tree

DavieThe code below is used to traverse up the content tree, and check if the document type exits, the Category doc type can never be on level 1 or 2 of the content tree, so I thought calling Model.Content.AncestorOrSelf(3) would be more efficient than just calling Model.Content.AncestorOrSelf() but ...

 
This mileage calculation system here is insane (and insanely undocumented)
 
@CaptainObvious Yea, that's not how you want to do that.
 
posted on May 10, 2016 by CommitStrip

Inspired by a comment from one of our reader, Ivan Petrushev

4
 
@CommitStrip sounds about right, no @DanPantry?
 
The worst thing about JS is its ecosystem
even its type system is better
give me ES6 with a proper library system around it and I'd dev in JS more often
 
7:17 PM
It's possible that Code Review would work. I'd be inclined to think Programmers would work. There are various ways to go about this. One such idea would be to use an interface to define common factors, convert values to match the interface declaration (but keep the unique originals at the model level), and then work off of both through the interface declarations. You could then build in comparisons since they'd have the same interface. — Chris Fannin 5 secs ago
 
-2
Q: Make Java faster

dadHow can I make this little program works little faster? import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int[] a = new int[sc.nextInt()]; for (int i = 0; i < a.len...

 
@Phrancis Hahah, yeah, I used bower for about a week and then switched permanently to npm.
@JeroenVannevel babel + npm is about the best you will get at the moment.
npm is already the de-facto module system
babel just lets you use es6 modules with commonjs ones
    container.RegisterType<CallController>(
        new InjectionConstructor(
            container.Resolve<IMembershipService>(),
            bool.Parse(ConfigurationManager.AppSettings["calls:enabled"]),
            ConfigurationManager.AppSettings["calls:overrideNumber"]
        )
    );
There has to be an easier way than doing constructor injection with Unity, surely :(
 
@DanPantry Echolocation
4
 
wow.
 
What is @rob0t?
 
7:25 PM
@EthanBierlein Could I borrow a cup of sugar?
3
 
@syb0rg's bot
 
Still way too many libraries/frameworks competing to do basic ecosystem things. Library variance is good when it comes to domain stuff but they shouldn't be so abundant when it comes to even trying to write code in the first place
 
@DanPantry Ah.
 
@JeroenVannevel I think the main problem really stems from the fact that any js library has to be backwards compatible, so everything is opt-in (because any given js could use the npm ecosystem in the browser or in node)
 
@EthanBierlein I thought he spoke mostly gibberish, but I'm not sure his vocabulary is that large either
 
7:26 PM
the only way to really avoid this situation would be to put a metric crap tonne of more std lib in browsers
(also see .NET Core 1.0, which is taking a similar direction)
JS working on both the browser and the server is both it's biggest blessing and biggest curse
 
7:37 PM
-1
Q: Java Guessing Game

Tray HaaffFor school, I am programming with Java. I am making a Guessing Game. I want to build it but It won't open. I think it is because there is no window. When you play it in eclipse, it is in the Console not in a separate window. If someone can please help me, It will be appreciated. Here is what I g...

 
holy performance degradation Batman
 
@CaptainObvious @JeroenVannevel TMI for a answer, I think?
 
+1, also why is it -5? because it's not a "fun" question?
 
Look at the history. Rev 1 was crap.
 
7:53 PM
Okay, fair enough.
 
The tag is meant to indicate that you shouldn't give complete solutions.
 
yeah I don't do that stuff
It's either complete or it's non-existant
 
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Document iteration: what problems should I account for?
 
0
Q: Python performance

HighwayJohnI have a question regarding the performance of my python program. The part which is written down is very essential and I already increased the performance with numpy. I would like to know if it is possible to make this part even faster? A 10x speed up would already be nice.. u = numpy.zeros((a*...

 
lol, our bitbucket server just exhausted the RAM on our AWS box. that's not good
 
8:06 PM
you used all the cloud's RAM
good job
 
it only has 2gb, but I honestly didn't expect it to be exhausted
 
Cross-posted on Code Review. — 200_success 7 secs ago
 
especially when it's only me using it....
lucky i can just docker start bitbucket again, but that's reallllly bad.
 
why don't you just use bitbucket normally from their servers
 
@Quill the business doesn't want code hosted offsite
 
8:09 PM
Most business don't.
 
The fact that I just managed to ssh onto the box and restart it without being VPNed into my network notwithstanding :)
 
yuck
 
The CTO is dead-set on using the entire Atlassian stack
on one hand, JIRA is better than some alternatives for Agile
on the other hand, Bitbucket is so slow and the integration between the two is quite rough around the edges
 
Is your code not working? If it is, this question might be more suitable for codereview.stackexchange.comCarsten 29 secs ago
 
@CaptainObvious Anyone else think that is stub code?
 
8:14 PM
lol, just had a co-worker send me this
user image
6
 
As a courtesy to users who triage and answer questions, please declare your cross-post. — 200_success ♦ 8 mins ago
What is triage?
 
it's fancy stuff for SO Review queue
there is a lot of stuff in their queues
 
Figuring out which questions are valid or off-topic, or need more information, etc.
 
@SirPython it's a system for SO where low quality posts gets one of three statuses: Needs editing, Low quality / off-topic or Looks fine
They also have a review tasks that are tests and if you fail enough, they review ban you
 
8:28 PM
@Phrancis Yes, me, VTC'd.
@Quill Audits.
We don't have those on CR (although it has been proposed to implement them).
 
omg
you guys remember Mr Amberjs guy?
he's back with a request for someone who knows LoadAsh
 
He really likes timber
 
LoadAsh?
 
@Phrancis lodash.com
 
8:44 PM
Ah thought that's what it meant lol, nice spelling
 
0
Q: Using Session Wrapper for Accessing Session Data; Is It Safe?

RoLYroLLsWhen users log in to our website, we store some information in a session to retrieve it across the site. We created a few wrappers to help with data retrieval/storage to lessen duplication of code. I'm trying to redesign it as I don't like how the UserModel is written. I believe it's dangerous w...

0
Q: build 2D [5][5] array using for loop ansi c

jreillygreekngineerHey so I know this is really basic but I'm having trouble building an array with a loop, heres my code so far. #include <stdio.h> #include <math.h> #include <stdlib.h> // int main( ) { int a[5][5]; int i,j; for (i=0; i<5; i++) { printf("\nPlease input values for row %d", ...

 
Have you Googled for this question? There are any number of reasons, one of which being how long the formula is. This page goes over formula optimization, which also includes why they may be slow. Here's another good page as well. This is a pretty broad question for SO, which is generally for Code review. — BruceWayne just now
 
9:06 PM
0
Q: Given a set of characters, check if a palindrome can be created with it or not. e.g. Aabbccdd

Akash DeepI have written a python code which works absolutely fine but I am looking for other ways to do this: my code: import itertools def permutation(word): for i in range(len(word)+1): perms=list(itertools.permutations(word)) for i in perms: j=(''.join(i)) j=j.casefol...

0
Q: C++ code to find the gcd of two numbers, can someone see what's going wrong please? I keep getting "Expected ' ; ' before ' ) ' token

user105114 #include <iostream> #include <string> using namespace std; int gcd (int num1,int i,int num2); int main() { int num1, num2; cout << "£nter first positive number. " << endl; cin >> num1; cout << "£nter second positive number. " << endl; cin >> num2; cout <<...

 
pro tip: don't try to randomly generate and instantiate 2.5 billion sprites at once
 
@CaptainObvious you need a ';' before the ')'
 
lol
for (i=0, i<=num1 && i<=num2, i++)
That's not how you for
3
 
@Fjotten with comments like that in the original code, it'd definitely fail code review, even though it does work, simply because, if you obfuscate the function name, it becomes nigh-impossible to figure out what the function actually does. — Compass 24 secs ago
 
9:15 PM
Not sure how I feel about writing these two lines of code:
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
 
why are you writing them?
 
where are you writing them?
 
I'm making a game which has to generate very large terrains, so those are called after the terrain has been generated.
A guy over on the Unity3D forums recommended that I add them, but I'm really not sure if they're needed, or if it's a good idea.
Messing around with the GC seems like a not-so-great idea to begin with.
 
I would argue that you should do 5000 attempts at allocating less before you start with explicit GC management
this is not scalable whatsoever
what will you do if you suddenly want a larger terrain? Call a GC sooner?
Ideally, you avoid GC altogether
See if you can pool objects, make objects smaller, etc
use a profiler to find out what exactly causes most of the memory pressure
For example: stringbuilders are great to avoid intermediate string allocations but maybe you're allocating too many stringbuilders as a result?
a pool would solve that
 
I'm not sure whether Unity3D supports pools or not, but I'm sure there's a way to do that (with some sort of hack or extension).
I also happen to have a profiler as well, so that'll come in handy.
 
9:29 PM
what?
You can just write your own pool class
 
I know.
Were you referring to C# thread pools when you said pool, or just pools in general?
 
0
Q: Avoid repeating default parameters from an interface

JoelFanSometimes I have an interface with default parameters and I want to call the implementing method from within the implementing class (in addition to from outside it). I also want to use its default parameters. However, if I just call the method by name I cannot use the default parameters because...

0
Q: Check if a numpy array contains numerical data

MSeifertThe function itself: import numpy as np def is_numeric_array(array): """Checks if the dtype of the array is numeric. Booleans, unsigned integer, signed integer, floats and complex are considered numeric. Parameters ---------- array : `numpy.ndarray`-like The a...

 
class MyPool<T>
{
    private T[] _pool = new T[100];


    T Acquire() { return something; }
}
Just like that, you know. Just write your own pool implementation
I can keep going. Just search for "pool.cs" in github.com/dotnet/roslyn/find/master
Pooling is essential in roslyn to keep allocations down
 
SO is not Code Review. Ask there if you are just asking for people to improve on your code. — Natecat 6 secs ago
 
10:34 PM
0
Q: Restrict html input field to decimal

billynoahI'd like to restrict user input in a form to a decimal with max two numbers before and 4 after decimal point. So valid values would be: 50 0.1 1.23 4.5678 12.943 I'm currently doing the following: $(function() { $('input').on('input', function() { this.value = this.value .repl...

 
10:54 PM
0
Q: Modifying reference object passed from another class

codingbizI saw this code on Youtube from a Liskov Substitution Tutorial. I have found myself coding like this but I have always felt it was wrong. My concern with this code is that InvoiceModifier class has control over my invoice instance though it manipulates its own instance variable, it is still po...

 
11:12 PM
What's a good type for a variable that represents something's state, but that is not boolean, for example, state "A" and state "B"?
 
An enum?
 
enum is a type?
 
definitely enum
 
I guess that would make sense
 
I think so. In Java it is, and in C it translates to ints (I think)
 
11:14 PM
an enum is a type where all instances are named and known at compile time
 
Oh,that sounds perfect then
 
0
Q: Chess game in Windows Forms Part #1

denisI've recently created my own chess game. It currently only supports a cooperative mode (player1 vs player2 on the same pc) because creating CPU to play against the player will be problem due to my lack of knowledge over the chess game and making it online will be way to difficult since I have abs...

 
enums don't have to be in their own class do they? Like if I know only one object will need the enum, can it be embedded in the class?
 
Which language are you using?
 
Java
 
11:15 PM
Then you make it using enum {}. It can either be on it's own, or it can be in a class.
 
OK cooll, thanks!
 
@Phrancis you literally described an enum ;p
 
0
Q: Chess game in Windows Forms Part #2

denisContinuing the code here RookPiece Class : public sealed class RookPiece : Figure { public RookPiece(FigureDefinition definition) : base(definition) { Moves = RemoveFailedTurns(this, GetValidTurns()); Moves = Moves.Distinct().ToList(); } protected override List<...

 
Huh enums don't look too bad, maybe I should use them more often
 
You should read about Finite State Machines
 
11:33 PM
Ahh interesting
 
I used that kinda thing for my tokenizer heavily, things like state == Enums.TypeDeclared ? variable.name = currentChars : variable.type = currentChars
 
0
Q: Set up maximization problem with a budget constraint for each periods. 2. Set up the maximization

PennyPython help not really sure where to start and i dont really know what else to put in the comment box either -.-

 
00:00 - 16:0016:00 - 00:00

« first day (1102 days earlier)      last day (2917 days later) »