« first day (726 days earlier)      last day (3589 days later) » 

17:13
0
Q: Trying to implement a turing machine in Scala

Nick BucknerI have been trying to implement a simple Turing machine in Scala. Unfortunately it hasn't compiled although I am really not sure why not as it looks fine syntactically. The basic idea is that a Turing Machine has a machine table such that it has an instruction for every possible state and value...

lol, Java 7 EOL'd today
That's.. quick
too quick, I'd say
17:29
0
Q: In Handlebars what is the preferred way for accessing nested data properties

ChantzI have a nested object e.g. { "amount": { "preTax": 15.99, "tax": 0.0, "currencyCode": "USD", "total": 15.99 } } And I have the following template, {{#amount}} <div>PreTax is {{preTax}}. Tax is {{tax}}. Currency Code is {{currencyCode}} and total is {{...

@CaptainObvious Off topic (doesn't compile!)
Some of those syntax errors are pretty stupid too. Easily caught and fixed with a good IDE.
Is @janos around?
17:44
I wonder why Jamal didn't nuke it - it says it doesn't compile right in it.
Java can be written in Visual Studio
Now that's something I'll try out
@Hosch250 I actually pasted it into my IDE and fixed it.
No idea (pun not intended) whether or not it works.
0
Q: A simple C++ trading system demo

KimI need my code reivewed and it is a trading system demo. The code is listed here and on github. https://github.com/uptown1919/cmake/tree/master/make_tut/tradingsys packets.h #ifndef PACKET_H #define PACKET_H #include <stdint.h> class Header{ public: char marker[3]; uint8_t msg_type; ...

0
Q: error: expected constructor, destructor, or type conversion before ‘(’ token

GeoI'm building a program in c++ using Geant4 toolkit. I get the title error when compiling my program: /home/geo/Desktop/from the scratch/src/RunAction.cc:18:21: error: expected constructor, destructor, or type conversion before ‘(’ token RunAction::RunAction(DetectorConstruction* det, P...

0
Q: First 4-function Swing calculator

noobinator456This is for a high school class I'm taking. Any tips/improvements? Thanks. import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import javax.s...

@Hosch250 good catch
@RubberDuck I remember a time when we had 10 calculators a week posted on CR. — Morwenn Apr 3 at 9:25
@Hosch250 Last day? Pffft... I haven't posted mine yet! It's never to late to submit an entry to the challenges!
Hmm, I think @RubberDuck rigs it :)
18:21
Two more votes for Skeet and I before I get Populist over him:
21
A: Weird generics error

nhgrifFor starters, let's explain the error: Given: class Foo<T:Hashable> { } class SubFoo<String> : Foo<String> { } The confusing part here is that we expect "String" to mean the Swift defined structure which holds a collection of characters. But it's not. Here, "String" is the name of the gene...

two questions, unanswered duplicates of each other. Does it matter which one of them I answer? The older one got there first, but I like the newer one better.
Do you have a specific question? If you're just looking for a code review then you should post int codereview.stackexchange.comi3arnon 19 secs ago
@WayneConrad Probably not, but you should probably ask that on SoftwareRecs and not Code Review.
Oops, wrong site. Sorry!
In terms of being duplicates, chronology is irrelevant.
18:29
Thanks :) I'll go now and ... um... pretend that I didn't just completely screw up which site I was on.
No not code review but asking if the code like above is thread safe — aks81 16 secs ago
@aks81 how is that not a code review? — i3arnon 14 secs ago
18:52
0
Q: Microsoft TPL DataFlow Thread Safety

aks81From the MSDN site it mentions that all the public static members are thread safe. I have the below scenario and needed some advice I have a simple interface interface IMyInterface<T> { void DoSomething(IEnumerable<T> input); void Stop(); } A class implementing the interface internal cl...

So are you specifically asking the community how to flatten all the corners? Keep in mind SO is not a code review forum. — isim 22 secs ago
Is your output correct? If yes and you are looking for better way to rewrite your code than it looks like your question should be asked on codereview.stackexchange.com. — Pshemo 10 secs ago
@200_success Does the JavaFX Bridge game code not work?
I'd post this on codereview (SE site), as it seems more suited for them. In short: python displays function name when an error is raised, a good doc string (@Daniel) can easily show what the input should be, and good debugging would check that datatypes being passed into the function are the correct ones, so there's 3 lines you can remove. I read raise Exception("string") is bad practice, to use more detailed ones, but that might be preference! — Matthew 55 secs ago
0
Q: Using exceptions for logic internally in a Ruby module

Dhruv KapurI was trying to solve a problem to determine if 2 strings are isomorphic. They are isomorphic when each character in string one can be replaced with another character in string 2. Two different characters may not map to the same value, and same character must not match to different values. Also t...

hey @SimonAndréForsberg, you were looking for me?
19:27
@janos yes, hey! I have an idea that I think you might be interested in, as an AnkiDroid user.
wow, I don't even remember speaking about AnkiDroid here
oh yeah, what's up?
Looks like I'll need to take a look at IBM Bluemix again, as I'm looking around for a server
I do :) (and chat search does)
hey @skiwi, how's your team effort going?
hey @janos
19:29
I would like to see an easier way to create Anki-decks, so I was thinking about creating a program that can simplify this task. Essentially, I would like to see a Java API for Deck creation. Seeing as Anki (both Desktop and Android) is OpenSource, I'm thinking that it should be possible.
there's an API right? maybe in Python?
I haven't found an API for it yet at least
Still going good, we did a load of documents conform ESA standards (Acceptance Test Plan, Integration Test Plan, Software Configuration Management Plan, Software Project Management Plan, Software Quality Assurance Plan, Software Validation and Verification Plan, Unit Test Plan and last but not least User Requirements Document)
hmm, looking now for the repo...
The URD will hopefully be accepted tomorrow
I've been mostly working on the (Linux) server together with someone else
wow @skiwi, that all sounds very good
for example, I have a deck of 111 common Ukrainian verbs that also contain example sentences of how to use those words, I'd like to change that deck so that it also contains the same verbs the other way around, and then create another deck only containing the example sentences (both Ukrainian-English and English-Ukrainian)
We managed to get GitLab and Jenkins running, then we crashed the server, then we reinstalled the server, and now we have GitLab, Jenkins and a hook that automatically compiles LaTeX files and puts them on our site and the setup is a lot better
@SimonAndréForsberg Java bridge game won't compile.
And I'm slowly trying to learn Swedish
console.ng.bluemix.net/?ace_base=true/#/pricing/… I wonder if it counts the GB's Linux uses by default as well and how much Python+PostgreSQL+Apache would use
19:35
I know only one word in Swedish
@SimonAndréForsberg I see your point
@janos What word would that be?
Duga!
3
Oh... right!
("knowing" is a bit of an overstatement there though)
@200_success okay. I scanned through the code a bit but couldn't find anything, I guess I need to upgrade the compiler in my head.
19:38
The only distraction I have is that whenever I see läser I need to think about Star Wars
@janos It would be so awesome to just do export("newdeck.apkg", deck.stream().map(a little bit of substring magic).collect(Collectors.toList());
reading through the docs now. I really thought I looked at the API before
If there is a Python API, I could of course live with that as well
0
Q: Tic Tac Toe game in Haskell

yasarHere are my codes; import System.Random (randomRIO) import System.IO (hFlush, stdout, getLine) data Tile = EmptyTile | X | O data Player = Player1 | Player2 instance Show Tile where show EmptyTile = " " show X = "X" show O = "O" type Board = (Tile, Tile, Tile,...

@SimonAndréForsberg this is the closest thing to it: ankisrs.net/docs/addons.html
19:47
Still trying for badge over Jon Skeet...
Two votes each away...
0
Q: Spring oauth2 token store supported by redis

tgkprogI had to make a POC for Spring oauth2 with redis store for tokens. I sjavatarted with the sparklr2 (with tonr2) sample app from here. Cloned the project and added a CacheTokenStore, CacheTokenConfig.java and properties Instead of talking to redis directly, decided to use SpringCache. But since ...

@janos hmm, indeed looks useful. Which makes me think... perhaps there's an add-on already for exporting and importing to a "better" format? Then I could export a deck to some format, load it in whatever program I want, import it into AnkiDroid and export it to *.apkg again. (cumbersome, but would work)
I'm voting to close this question as off-topic because it belongs on Code Review. — TigerhawkT3 35 secs ago
Interesting... Using BlueMix I can host an app on a machine that uses 512 MB for free forever, but not sure to what degree BlueMix can replace a VPS
And similarly, it would be a very poor fit for Code review, as there is no code in the question to review. — rolfl 38 secs ago
@rolfl I'd say that this suggestion indicates that commenter never ever bothered to glance into CR Help Centergnat 25 secs ago
20:02
@rolfl Do you perhaps know how IBM BlueMix and a VPS Linux server compare?
@skiwi I do, and they don't
What is it exactly, I'm still a bit confused by it
Do you know tomcat (redundant question).....?
I have multiple scenarios here... 1) I want to host a Django app, an Apache server and a PostgreSQL server, 2) 1) + Jenkins CI, 3) 2) + GitLab
Do you know node.js (not so redundant)?
20:04
@rolfl I don't know enough about that to know about it
I did find that someone managed to get Django working ikarandeep.tumblr.com/post/86967783996/…
OK, bear with me..... what Bluemix is , and what it tries to be, are a bit different.
let me explain what it tries to be first, and then reconcile it later... OK?
Okay, all ears
There is also a cost component, which needs explanation, but that can come later too.
Bluemix is a collection of lego blocks for building applications that are predominantly web-based, or mobile-based.
There are currently hundreds of blocks available.
all the blocks have mostly compatible interfaces ... some more than others... but, they all fit together in some ways.
@Jamal do you really think this edit improves the question? codereview.stackexchange.com/posts/88497/revisions
Blocks are things like:
databases
storage
20:09
You had me at Lego blocks.
user-authentication
everything is essentially JSON and RESTFul.
So, you need to do something like...... Duga, for example. It has a web frontend.
you go to Bluemix, and say, I want to build an application.
You currently have a choice of.... 6 languages/frameworks.
Java (using Websphere, which is like "enterprise Tomcat"), JavaScript using Node.js, python, ruby, php, and ......Go.
Go? That's rather surprising
But okay... That idea totally wasn't clear from the product page methinks
So, you choose.... Javascript, for kicks, and you choose a name.... like, "duga".
(Or I'm just tired)
If that name is available you now also essentially have http://duga.mybluemix.net/
You have an environment (node.js) in which you can build your app, and an address against which you can call it.
Now, you build your front page, however you like it..... but, you want a database....
let's say, MySQL, or CouchDB.
So, you plug in a database component. You "bind" your application to the database, and that binding gives you a URL, and Credential you can use to access your database.
That is now yours.
Now you want to do language sentiment analysis on tweets... so you pull data from twitter using your node.js application, and feed the tweets through the watson sentiment analysis engine, and store the tweet and sentiment in your database.
That's OK, but you want people to log in, so you bind to the single-sign on block, which manages people's credentials for you (linked to their google, whatever account).
20:16
Is this a new IBM product?
Now, every 'service' or 'block' on Bluemix has an entry-level access which is more than enough for 'hobby use which is free. So, you can do at least some of everything for free.
So much for the how-it-should-work-in-theory part?
It sounds quite promising if it all "just worked"
A freemium tier.
It does, in fact, all work.... but, you can run in to some issus if you get hammered or go viral.
Now Jon skeet is 2 votes away and I am just 1 vote away...
Also, development is a bit hard to do, because, almost all the services are only accessible with their current interface, from inside the bluemix system.
20:18
@rolfl A practical question: Can you limit usage?
So, if you want to test an application, well, you can't test your app locally because, well, local does not have watson running.
So, actually developing against Bluemix can be a little hard.
I believe you can limit usage. I have not used my public bluemix in a while, I have "developer" access.
so I don't have some of the restrictions (but I also have pre-release accesss to cool components).
But, for example, the "free level" of access for your application is:
512 of memory, .... 1 application, 300HTTP rquests per second....
Then, blocks have costs as well, so for example, you want a database, say, MongoDB.....
500MB data free....
I don't see any major issues yet, but it's not exactly as open as I'd wish it to be
Cloudant, though, is much cheaper.....
20GB per month with 500,000 queries per month
I see that went well, @skiwi ^^
@SimonAndréForsberg Haha... yes
20:25
There is very little you can do though..... that's going to push you in to paid territory... and there's lots of cool things yu can do.
So, as a Bluemix app, you set up what you want, link in the services you thing you need, control them from your application, and serve them from your (secure) website
@rolfl Can anyone make use of Watson like that? You think @Watson could be used to analyze SO-comments?
You get an environment which is 100% yours... all your data is isolated from other applications.
Sure it can be.
The plugns I have acvailable to me are things like:
Voice recognition, text to speech visual recognition, personality analysis, concept insights, questions&answers, and more.
Each one of them will be avilable as a freemium service allowing you to use the RESTful API to process "things" through it....
I mean... can it be used to determine if a comment is a recommendation to post on another Stack Exchange site?
Real TTGTB now though, a lot of thanks for the information up til now @rolfl! And keep talking if you wish, I'll be sure to read up, and perhaps a recommedation for Django + React + PostgreSQL would be useful if you can give one; Hosting my own a Jenkins instance somewhere would also be way cooler than Travis, but Travis is still an option, it's just slower
> The Visual Recognition service enables you to analyze the visual appearance of images or video frames to understand what is happening in a scene. Using machine learning technology, semantic classifiers recognize many visual entities, such as settings, objects, and events. The service applies these pre-learned models to imagery that you have uploaded to the service and returns a score for each image for each model, indicating the likelihood of that visual element being present in the image
Anyway, a VPS and a BlueMix application are very different, as you can see.
You can integrate your application in with git, and stuff though, so you commit and push to git (not GitHub, a diferent git, I think), and the Bluemix will pull the app and restart.
All your services are persistent, and independent of your application, so you don't have to worry about that sort of stuff.
Regardless, a 30-day trial is free and no obligation, a longer trial is also free, but needs a credit-card number to maintain.
There is literally nothing stopping you from trying it out.
Sales-pitch done: console.ng.bluemix.net
(last thing, it looks like the: is now public too.
so, you can have Bluemix and a VM).
aparently not done yet, here's the catalog, no login needed.
20:37
Java 7 is now end-of-life — no more public updates.
2
0
Q: PyDOS Version 3.0

Mrfunny744This is a follow up to the questions: PyDOS shell simulation and PyDOS: Version 2.0 Introducing PyDOS 3.0! With brand new features and improved code, this will blow your mind! New Features (This list will be updated with PyWrite soon) +Dialogs are now in a window like design. +New start-scree...

tons of views but no votes?? ►►► stackoverflow.com/q/17813523/1214743
@200_success and yet it feels like there's a lot of companies who still haven't migrated to Java 8. Not to mention things like and
@Lyle'sMug
So close to ...
I think the idea is, you have to pay Mr. Larry Ellison for updates until 2022.
20:53
@nhgrif I can still give a vote to Skeet, but I didn't want to do that in case it would be too many votes.
He needs 2 and I need 1
Help @nhgrif get populist badge! @nhgrif's answer needs to be at 23, Jon Skeet's needs to be at 11 (not more!)
3
that should do it.
It's not wh***ing if it's not your own answer, right?
Right
I feel like getting populist over Jon Skeet is, in itself, badge-worthy.
Jon Skeet's answer can be at any number 11 or greater as long as I have more than double his.
@nhgrif yes, I know, but I didn't want to make the message even longer :)
While people vote on it, hopefully they will learn something about Swift and generics in the process.
Yup
I could look for something edit-worthy to bump it up... ...
21:06
If pimping is the name of the game, this could have some help <-- on SO.
Wowza. I'm no where near that badge.
Thanks @janos for answering that Calculator Java question
@nhgrif It's +101/-5... which nags at me a bit.
The accepted answer is great, don't get me wrong, and it is surely 100% authoritative, but half the question was about the C# logic too.... which I got wrong the first time around, so hence the -5.
Anyway, if this works, and you're just looking for suggestions on how to improve it, codereview.stackexchange.com is the place for that. — Barmar 43 secs ago
0
Q: Delete a vector element containing a string

rob777890I have made a vector that is full of people's name and their number ex: John 1231231234 I push back the whole string(name number) into the vector so I was wondering if there is a way for me to search for contents in a vector and delete the whole element for example if I know the name John 123456...

21:17
@rolfl This is where you wish people would always comment when down-voting so that you can ping them afterwards.
Yeah.... but, really, in time, that answer will make 100.
pimping is not needed.
That's what I thought about this answer, but it has not gained much...
89
A: Returning the other argument of 2 possible arguments without using conditions

Simon André ForsbergSimple arithmetic: return 7 - input + 5; (which can be simplified as return 12 - input;) Let's say the input is 7: return 7 - 7 + 5 --> return 5 Or if the input is 5: return 7 - 5 + 5 --> return 7

@rolfl in time, all (good) answers will get another upvote. 9 score will become 10. 10 will become 11. 11 will become 12.... x will become x+1, and so 99 will become 100. Does this mean that all good answers will eventually make 100 ?
Essentially, yes, and it is the money-for-jam query that is interesting.
let me dig it up......
Where goes the line for when pimping is not needed? How many upvotes is an answer required to have already?
monkey-for-jam?
21:27
@hjklhjklhjkl Then see my previous comment about it's complexity. Also I agree with Barmar -- better move it to codereview. — anxieux just now
@rolfl oh, nice! Where does it draw the line from "passive" and "active" rep?
0
Q: Genetic algorithm for solving a puzzle (v. 2)

GuillaumeThanks to your wonderful comments regarding the first version of my code, I have been able to improve it. This new version is more readable (I guess). The problem is that it seems to me that there is no overall performance improvement at all. Here is the full source code. Again: thank you very ...

@nhgrif Mission accomplished!
I hope you get it soon, before Skeet reaches 12.
I demand €50 or I upvote Skeet
DON'T MAKE ME DO IT
Will you just stop using sleep(), for the third time!
4
0
A: PyDOS Version 3.0

Hosch250 time.sleep(2.5) Again, don't sleep your program, it makes it unnecessarily slow, and it doesn't even act like an old machine would because when it does run, it runs quite fast. -------------------------- | | | Welcome to SimpleCalc | | | | A ...

21:42
Looks like I'm going to some nightclub next week which looks like it could be frequented by russian mobsters
I answered his last one twice, and this one once, I bet he is getting sick of me.
OK. @nhgrif got Populist, now we can all go downvote him again (JK).
Good job, @nhgrif.
Whoa, the Electorate badge is more rare on Stack Overflow than Populist! Talk about having voting problems!
Writing that answer took almost 2 hours, time to get to school.
from 7:04:30 it shows how to build a .NET app on linux
I haven't watched it myself yet (doing now) but the contents are titled "Hello world on linux"
so I assume that means a console app
Well, I hope.
okay, it's a console app
22:25
TY everybody.
Thank this guy:
He's a Facebook friend of mine.
Y U NO 1BOX
Achievement Unlocked: Earn Populist badge over a @jonskeet answer http://stackoverflow.com/help/badges/62/populist?userid=2792531
22:43
@nhgrif achievement unlocked indeed.
With any luck, Jon Skeet will retweet to his 39.7k followers...
The comments of a StackOverflow question aren't a great place to field design conversations. Consider asking this question on codereview.stackexchange.com instead. — Dan J 51 secs ago
@DanJ Questions regarding design aren't what Code Review is about. — nhgrif 1 min ago
23:40
0
Q: Simpler way to get substring of a delimited string?

sigilI have some underscore-delimited strings like abc_def_ghi. I would like to get a substring out of the string made of one or more delimited substrings, so that if I call: getUnderscoreSubstring("abc_def_ghi",2) then I get: abc_def This is the C# code I'm using: public string getUnderscoreS...

Anyone around who knows some stuff about JSON? (preferably in native JS context)
Maybe?
Just looking for someone to hopefully confirm that I'm not insane
JSON is just a data format.
23:44
I know XML better probably... but shoot...
OK. So I have this thing which I plan on writing game logic in JS in each of the sub-objects, then add some form of recursive-ish function to where if more effect elements are called from the card library (also JSON) it will search the tree again and look for other elements.
Am I out of my mind, or is this somewhat rational?
The main goal is for the effect elements to be flexible, and by extension, searchable
(and by flexible, I mean that someone who wants to fork the game and make their own mod, it's not terribly encumbering and most of it can be done in native JavaScript)
Hmm
I think this isn't as flexible as you might think?
23:59
Why are you persisting this into JSON?
I mean.. where does JSON come into play?
RELOAD!
@JeroenVannevel Not really sure, going with what I know

« first day (726 days earlier)      last day (3589 days later) »