« first day (631 days earlier)      last day (3684 days later) » 

18:00
0
Q: SMS relay --> MySQL database

GregersenThe main purpose of my program is to extract GPS information from text messages sent to several GSM modems send from various GPS tracking devices. The main flow of my program loops in three steps: Receive SMS message (with the help of SMSlib) Extract data with regex Push data to MySQL database ...

So, my reason for dropping by today: @RubberDuck and @Mat'sMug , the Rubberduck parser looks great! Vast improvements over before
2
Music to my ears! Thanks @moarboilerplate :)
@Mat'sMug putting the behavior of managing sub-nodes on the nodes themselves instead of the parser was a huge improvement. No doubt it helped contribute to the cleaned-up looping/collection management in the parser. I may do a pull request since there are some minor improvements I hink can be made in terms of dealing with the IEnumerables (no need to call ToList() or treat as array in some circumstances)
I haven't merged it with into the "Master" yet though. But yeah, it just felt natural given that the injected context has all the knowledge for the child nodes.
1
Q: Which pattern could help to refactor this controller code?

gremoI know I should use services and patterns to refactor this controller action, but I can't imagine one that could fit/be appropriate for this problem. It seems a strategy or template, but a strategy is supposed to be changed if needed; in my case, it should be always the same: Get the customer ...

18:15
hey, @CodesInChaos I was just wondering, is your profile picture from a game or something? it looks interesting
@moarboilerplate any thoughts on this?
I'm actually torn between injecting the context like I'm doing, and using it in the derived types to expose getters for, say, the enum's Name and Accessibility (accessing the encapsulated context every time) - or injecting string name and string accessibility values to initialize private readonly fields (and possibly bloating up constructors when the node has many properties); the former has a dependency on ANTLR, the latter doesn't... I like the private getter that casts to the actual context type though.. decisions, decisions... ;) — Mat's Mug 2 hours ago
@CaptainObvious none, you will have to do the refactoring yourself
@Mat'sMug I haven't dug into that section of it yet...give me a few mins to do so
if I take the context out of the Node, I lose a node's ability to know about its child nodes, and have to put that responsibility onto the tree listener. But I also gain a Node class hierarchy that's totally decoupled from ANTLR, that I can keep 6 months from now if/when I ditch ANTLR for another shinier/newer lexer/parser generator.
I feel like the former is cleaner
18:18
@SimonAndréForsberg The red/blue blobs are archons from Starcraft, the shape is part of the crane's nest sequence from go, and the center shape is a glider from game of life.
There may be another way to decouple the ANTLR dependency
I was thinking of extracting an INode interface and have Rubberduck see that instead.. but it's kinda pointless, since Rubberduck will need to know about the actual concrete types anyway.
hey @RubberDuck
@CodesInChaos nicely mixed!
That's all @Mat'sMug @moarboilerplate.
Pull requests don't have to go to the master branch btw. =;)-
@RubberDuck for the parser yes but also the MVP implementation has come a long long way
18:22
Ahh well, thank you. I did work hard on that. Still a little more to do on that front.
But it works and integrating Git is more fun.
@RubberDuck let's imagine for a minute that the entire Node inheritance hierarchy is implemented, and now we want to switch ANTLR for something else. If it's implemented the way that's shown in the Episode IV post, everything must be re-implemented from scratch.
Yeah. That's not good.
just because of that context constructor parameter in the base Node class.
I think I need a NodeBuilder or something
Maybe...
What about taking in an IContext instead? Could the provide enough abstraction that you could write an adapter if you needed to? Or is it too dependent on ANTLR's implementation still?
NodeBuilder is a good concept
but may be too much abstraction for what you need.
18:29
it does feel like a "just in case" thing.
I think keeping the logic on your nodes is not bad for now
I think SRP is badly misinterpreted
Well... There is YAGNI... I doubt the parser will be swapped out anytime soon.
@RubberDuck From Ohio, eh? I just moved to Michigan after living my whole life in Columbus
so we swap ANTLR for something else - and reimplement the NodeBuilder stuff. Or we keep the context in the nodes, and reimplement the Node stuff. What's the difference anyway?
@moarboilerplate no. That's just where I'm from now. I'm from all over...
18:32
well, if you're in central Ohio enjoy it. I do miss it
@Mat'sMug I'm not sure really. Which would be less of a PITA. You know better than I.
I am, but I can't say there's much to enjoy. I don't care for the suburbs. I need to be in the thick of the city or the middle of no where.
I agree. I was born in Dublin and growing up there, you needed a car for everything, and you were pretty much isolated if you weren't in the center of whatever suburb you were in
Having said that, you can't beat the decent selection of food, shopping
and cheap beer
@Mat'sMug I promise I am still looking into this node design
I think it's simpler if this Node abstract class is the boundary - the way it is right now. Rest of Rubberduck doesn't know about ANTLR (it doesn't /can't use the Node protected constructor), and if we ever want to swap the parser/lexer generator, then we modify the Node class (that's OCP taking a beating, not SRP) and all derived types have to be modified/reimplemented as well.
Heh... I have friends in Dublin.
@Mat'sMug I support this
18:37
bottom line, we can't swap the parser generator without pain.
That's the stink I think Mug. Having to reimplement all of those child classes... That could get ugly...
Yeah. That^^
So... So be it.
I keep thinking there's still possibly a good way to decouple ANTLR from the underpinnings of node management while keeping it centralized
@RubberDuck I'd say given the current 2 options that seems to be the way to go.
so be it
> So let it be written, so let it be done.
so say we al
l
So say we all.
18:42
@Mat'sMug what's the problem with creating an interface for the object that inherits from the ANTLR class? why does rubberduck need to know the concrete types?
@Mat'sMug "I'm sent here by the chosen one..."
^^ that @janos! :)
I've gotta go. Big trip tomorrow. @Mat'sMug if you get a chance take a look at the last few commits on the source control branch and let me know if I'm heading down the right path. I'm thinking I need to add a base class to implement some of the common export/import functionality in.
@RubberDuck enjoy!
@RubberDuck I'll check it out
18:46
@Mat'sMug is this where I can see the most current full solution? github.com/retailcoder/Rubberduck
(containing your changes)
or is the lexicaltokens branch what i need
I had to leave the old parser crap in place to keep the project compilable. Node basically replaces SyntaxTreeNode.
I'll have to kill all SyntaxTreeNode usages before I merge this branch into the master.
I see. so you mentioned passing an interface to rubberduck but the problem with that was that rubberduck still needs to knwo the concrete types. why is that?
I'm starting to wonder if that's true
yeah, 'cause if it's not, that might solve a good chunk of your issues right there
actually...
say you have a code inspection that looks for ParameterNode instances where IsImplicitByRef is true - the inspection code can't work off a Node or an INode - it needs to know about a ParameterNode - right?
18:54
not if you have a dictionary of properties on the main interface
obviously it will undercut your need for inheritance and be a significant refactor
but that's an option
oh, it never occurred to me that the inheritance hierarchy itself might not be needed
I've always seen it as ParameterNode : Node and ProcedureNode : Node, etc.
You could still continue wiht inheritance though. if you continue with inheritance though, then you should not use strict inheritance with your interface types--you should have the concrete classes inherit, but you create one-or-two- property interfaces and compose your specialized nodes out of combinations of interfaces
You could have ParameterNode : INode, IProcedureElement(or IProcedureNode, depending on how specific the interface is)
doesn't it smell? interface IHasIdentifier { Identifier Identifier { get; } }
Wait. all nodes have identifiers though right
not necessarily
18:58
@Mat'sMug What would smell? And didn't now you could put properties in interfaces in C# to indirectly expose their getters/setters
ah okay
no, IHasIdentifier would not smell
i would try it and see what you can group together
ideally you should be able to find logical groupings for the combinations of properties so you don't end up with 100 different interfaces for 100 different properties
^^ that
but it would still be very segregated/specialized interfaces
I doubt that will happen though. If it does happen then you should have 100 different types of nodes
which is a smell in itself
that's okay though, you do have very segregated/specialized concrete classes as they stand today, am I right?
19:02
should be
and yeah, the concrete types essentially represent a code construct all by themselves
like that EnumNode and its child EnumConstNode
nice Python review by new user: codereview.stackexchange.com/a/78554/12390
I think defining an INode interface and keeping the main emphasis on having rubberduck treat everything as an INode in terms of collection management/traversal will provide enough abstraction to decouple the antlr implementation.
I think having ancillary interfaces for more specialized behavior is fine
INode is already in a local commit ;)
Remember, there is an OfType<T> IEnumerable method for exactly this
^^ exactly what I was thinking of
19:05
You can unroll all of the nodes in a tree and flatten them, and pull what you need out with OfType
oh crap.
I posted Episode IV too early
why's that?
the dynamic stuff in CreateProcedureNode is blowing up with a RuntimeBinderException
i was a bit unclear on the need for dynamic. is that an antlr implementation requirement
nope. it's a [broken] way of making one method to handle 5 different procedure kinds with one piece of code
19:09
The easiest silver badge to get is Necromancer.
gotta fix that asap
@Hosch250 that's likely ;)
I just earned a second.
Some kind person is giving me upvotes.
@Mat'sMug Console.WriteLine(RubberDuck.CountHacks())?
all right i'm out for now
gotta get going
See you.
19:12
take care
later!
@skiwi OverflowException ;)
@Mat'sMug It's a recursive function, or are there really that many hacks? ;)
nah just kidding. I'm trying to avoid hacks :)
30 more edits on SO until I get Copy Editor, though that number could go up.
@Mat'sMug it does smell
You can't make it a property of a subclass?
superclass*
@JeroenVannevel isn't that Java lingo? ;)
The word "hack" only shows up once in the whole code base. I'd say that's a good sign. Lol
2
@Mat'sMug Is it?
haven't seen it in C# books. "base class" would be more .net-ish I think
19:20
Yeah okay, makes sense
base() vs super(), I suppose
given keywords base and super. ... ^^
@RubberDuck //TODO fix ugly hack, like that?
ah, I think the dynamic stuff works after all - my ProcedureNode was just missing the appropriate constructor overloads
104
Q: Should I share my horrible software?

qsphanAfter I had published my paper, some people asked me to share the software that I developed. At first, I was very happy that my paper attracts some attentions, and I was happy to share not only the binary but also the whole source code, case studies etc. But looking at my software, I feel very em...

saw that one
Dirty secret: most academic software is horrible. Even the stuff coming out of the Computer Science department. — Mark 2 days ago
I could have sworn I saw a comment linking to codereview.stackexchange.com there
19:34
0
Q: Multithreading, C++ library

Victor LopezI'm creating a C++ framework that could be really useful in the community. I'm writing the best I can with the new C++11 and C++14 standards but I'm not really sure about some things related to multithreading. If we use a mutex to protect an std::shared_ptr<> from write access we're protectin...

There was somewhere. I think shuttle something or other posted it.
> GUI menus that you have to access in a specific order. Otherwise, you get a segmentation fault and have to start from the beginning.
2
^^ gotta love that one
Posting your code in a public place such as GitHub gives you a chance to show how you have incrementally improved your software. Significantly improving the software without changing the results generated from the software is not an easy task and therefore is a skill that is highly valued. You might find posting some of the code to the code review site codereview.stackexchange.com to be of help here. — shuttle87 2 days ago
shuttle seems to be assuming that they're actually using git. what an optimist.
@Mat'sMug Or worse... when the Technical University you are on does not ask the CS department to help out on IT projects
@SimonAndréForsberg LOL
yes, indeed
> Releases that don't even compile. (Did you even test it?)
2
20:25
Idk about that @skiwi. I wouldn't want a bunch of CS people involved with real practical projects. Nothing would get done because they'd start right down at the hardware and build up from scratch. =;)-
I can run it without errors, so I probably can't help you. :( — Builder_K 5 mins ago
Ah, useful comments
2
1
Q: Assert.IsTrue(BunchOfAsserts == Bad Tests)

Adrian773Here is one of my msTest Unit Tests and possibly one of the worst "looking" tests. [TestMethod] public void UniquePositionPoint_CreateUPP_UPPExistsInPPField() { //Setup the values to be used by this test. CIM_Network network = new CIM_Network(); string x = "5"; string y = "10"; ...

    }catch(Exception n){

        System.out.println("That wasn't a number, yo!");

    }
seriously? "yo!"
SO much joy!
It would be nice to edit the implementation being tested here, into the post - be it only for reference. — Mat's Mug 18 secs ago
0
Q: jQuery Scroll to ID on Next Page Loading and Back to Top Anchor

wilburlikesmithI'm no jQuery fundi and I kinda hacked this together, it does work. I just want to know if there's a better smoother more code compliant way of doing it? <script> jQuery(document).ready(function() { var offset = 220; var duration = 500; jQuery(window).scroll(function() { if (...

0
Q: Positioning this websites elements properly

Sean ParsonsI want the NAV below the header to have no red line between the header and the NAV. I've spent some time trying to figure it out, maybe it's something simple and i'm over thinking it but it's really bothering me. Thanks, Sean /* New Perspectives on HTML and CSS Tutorial 4 Case Pro...

@skiwi
in VBA, 15 secs ago, by Mat's Mug
oh look, commiiiiiiiiiiiits!
3
A: HackerRank - Insertion Sort - Part 2

Jerry CoffinProbably the single biggest (or most obvious, anyway) improvement would be to write an actual insertion sort. What you have right now appears to be a bubble sort rather than an insertion sort. Rather than swapping elements that are out of order an insertion sort divides the array into a sorted p...

20:44
@Mat'sMug why is he using 1-char variable names?
because OP is and his review isn't about naming I guess
or so that we have something to say in part 3
@RubberDuck haha
@Mat'sMug Commits, commits, everywhere
21:07
0
Q: read line function

karimi have developped a readline function in c and i want to know you're opinion on it : // read a the whole line, stop if encouter eof static char *readline(FILE *in, sid_error *error) { #define MAX_SIZE 64 size_t size = MAX_SIZE; char *str; if((str = malloc(sizeof *str * siz...

@SimonAndréForsberg is a genius
or well, close - stupid character encoding
Hey ducky!
my bot talks too much.
2
Hey Simon! (not really here, I was pinged)
20 mins ago, by skiwi
@RubberDuck haha
@Duga mwahaha parse error
21:15
@Mat'sMug no it is not - I am not parsing anything
this really has to be the best invention ever...
user image
3
@SimonAndréForsberg Wait... you actually made that?
@skiwi with some JavaScript userscript magic, yes
this one was simple really, got it working in about 15 minutes.
I'm working on another userscript as well, but that is apparently a bit more complicated. been on it for a couple of hours already
That's really awesome!
Eh... A MEMORY_MANAGEMENT BSOD on a PC here doesn't look too good..
21:20
@skiwi I thought userscripts was going to be a lot more complicated than they really are
@SimonAndréForsberg What is that?
@Gemtastic a userscript I added to my Chrome, so that I can send messages as my bot
whoops, wrong button.
@Duga Ah! :D
Neat
previously I had to go through a bit of trouble to post a message as @Duga, this made it so much simpler.
21:22
Or as we say here: "Dé får la duga" ;P
Det är en bot som heter Duga!
what does "duga" mean? should I flag her?
"good enough"?
lol
@Mat'sMug when we say "det får la duga", it means "it's good enough". when we say "en bot som heter duga" it means "a really good bot" ("som heter duga" litterary means "who's name is Duga")
0
Q: Accessing 2d-arrays

TheBestOneWhen I create an array like this: double[][] twoDArrray = new double[2][5]; there are two ways to imagine the created array. This is the first way: 0 0 0 0 0 0 0 0 0 0 This is the second way: 0 0 0 0 0 0 0 0 0 0 In the first case, twoDArray[0] evaluates to a column of 0s. In the second cas...

Monkernoon @all
@CaptainObvious Um. No code to review?
21:36
We had a recent question about a grid and a menu walking into a program, I'd recommend checking out that question. — Simon André Forsberg 10 secs ago
I didn't know Java was so dumb.
Apparently, it works differently based on your locality.
What happens when code compiled in locality A is run in locality B?
Bugs/undefined behavior?
locality B is used
which is how i18n works
That is good.
But how does it know to switch?
it doesn't switch
it uses your current system settings from the start
Once it is compiled, isn't it the 0's and 1's?
But it is compiled in A, so wouldn't A be used?
21:42
what's the relevant code?
I was just looking at an SO question.
Java (C#) compiles to bytecode (IL), the JVM (CLR) turns it into closer-to-the-metal code
locale issues are very often caused by input
input isn't hardcoded, obviously
1
Q: Simple try & catch code for scanning not working with decimal values

Arnauimport java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner a = new Scanner(System.in); System.out.println("Enter a number: "); try{ float b = a.nextFloat(); System.out.println("You wrote " + b); }catch(Exception n){ ...

That ^
So, if that code was compiled in A and downloaded/run in B, how would it know it was being run in B?
this isn't about how the code is compiled
21:44
system settings
Oh, I see.
Like how I can reference a system file, and I don't need to include it in the source code.
OK, thanks.
Now I wonder how I am so dumb.
@Phrancis Scala? Sounds like something for @Donald.McLean
Sure does. Didn't you do a bit of Scala as well?
21:48
13
Q: Oh ye beloved bejeweled

Simon André ForsbergBefore @bazola asked his recent question we chatted about it for a bit. I figured that I could try implementing something similar myself. As I've heard that Scala has all the advantages of Java but fewer of the disadvantages, I'd figured that I could try Scala. I have implemented checking for b...

yup
my Scala is nothing compared to the real Scala folks.
0
Q: Simplify multiple if statements

ArchitectI'm building a user module in PHP. It reads a text based user type and it assigns a numeric value to manage report view rights: if ($usr_type == "Architect"){ $usr_rights = 0; } if ($usr_type == "Director"){ $usr_rights = 1; } if ($usr_type == "Manager"){ $usr_rights = 2; } if ($usr_type == "A...

why did noone send that question to us?
I'd wager, too basic?
too easy to answer, probably
Ah, the joys of SO
@Phrancis That's what I was thinking.
21:59
Hello @stickypens!
The best translation for "dé får la duga" is "I guess it'll do". "duga" means "to be good enough" it's a word like "lagom". It's hard do describe since english doesn't have any equivalence :P
Hi @Phrancis
0
Q: How to refactor Rails models?

user2931706I want to simplify my Rails models, current looks like this: class User < ActiveRecord::Base has_many :offers, dependent: :destroy has_many :reviews, dependent: :destroy has_many :comments, dependent: :destroy end class Offer < ActiveRecord::Base belongs_to :user has_many :documents, ...

@SimonAndréForsberg Is that better? — TheBestOne 1 min ago
is it re-opening time? is it on-topic enough? there are still two versions in the code...
@Mat'sMug ^^
Another A vs. B question... but at least looks on-topic, IMHO
Hmm, Rails looks like it has quite a bit of syntactic sugar, doesn't it?
22:06
@SimonAndréForsberg VTR'd, holding back on DV with all of my will.
@CaptainObvious How to refactor titles?
@CaptainObvious design-review? where's the code that actually does something?
not voting, despite the pretty pictures.
wow, I'm in such a mood today...
@Mat'sMug I was thinking the same thing, but it seems like there is an existing design that is implemented, so I'm holding back on DV and CV
yeah, me too
gosh
-1
Q: Create combo box and text box inside list box in VBA Excel 2010

Georgy boyI am creating an application using vba Excel 2k10. I need to create a listbox with multiple fields. Three of them must have information coming from Worksheets and the other two must be information entered by the user using a Text Box and a Combo Box respectively. Thank you very much!

"will program for food" ...and asks gimmeh-teh-codez on SO
2
There are too many of those types of questions on SO
22:18
> I enjoy reading and watching movies.
I didn't know you could read movies.
0
Q: What is the best way to implement a PHP interface with variable options?

Luke BI can't seem to decide the best way to expose an interface's options to the user of a client. I feel the transport ideally should be hidden from the user and only it's options exposed, somehow. The user interacts with the client, the client interacts with the transport Each transport interface ...

@SimonAndréForsberg you can, it's called subtitles ;P
And subtitles kinda ruins cinemas for me :/ but at least it isn't dubbed
I always watch things with subtitles.
Everyone who is watching with me hates it -_-
@CaptainObvious Is this kind of question on topic?
> Below are the ways I'm considering, how would you implement the following code?
nope.
@SirPython what is "this kind of question"?
22:22
Nevermind, I can't quite explain it.
Can you share what you have attempted so far? Do you have a specific problem or bug? Stack Overflow is not a code-writing service. — Phrancis 8 secs ago
@SirPython I usually use subtitles as well. I'm not really good at picking up English speech patterns when they are just sound, I ask people to repeat themselves pretty often. Doesn't happen so much in my mother tongue, interestingly. So, I like subtitles :)
I like subtitles as long as they are match when the person is speaking. I've seen a few TV shows where the subtitles are about 10 seconds behind.
@SirPython there's always the possibility to fix that, at least if you use VLC
22:27
VLC?
VLC Media Player!?
@SirPython I've seen some Japanese anime (with English audio) where the subtitles say something different than what is said lol
Oh! That thing!
I thought for a second that VLC was a type of DVR...
Can someone tell me what they thing about codereview.stackexchange.com/questions/75446/… please?
0
Q: Depth-first search in Python

metoI wrote this BFS in Python and I was wondering if it correct. Somehow it seems too simple to me. Each node is a class with attributes: visited: Boolean sons: list of nodes linked to the current node. This code should work both for directed and undirected graphs. def DFS(node): node.vis...

@SirPython Looks like a good answer to me!
22:41
0
Q: C Not Iterating over array correctly

user63771I am trying to implement insertion sort in C, but it is not stepping through the array correctly. I'm attempting to implement the pseudocode from Cormen's Algorithms book. It looks like the first element is being ignored but all the others are being stepped over just fine, so I imagine it's a pr...

The code is finished but I've omitted everything unrelated to my specific question, the rest of the code isn't relevant. — Luke B 14 mins ago
^^ Thoughts?
was about to say the same thing and ping @Mat'sMug
A vs. B again '~'
22:48
Comments deleted eh?
OP linked to some pastebin in a comment
and then comment is gone
@SimonAndréForsberg want to tell him to embed the code in the post? IIRC you have an autocomment for that..
@Mat'sMug will use example code comment with modifications.
Seems like every new version of iTunes makes the UI less and less user-friendly.
22:52
Unfortunately, you have reduced so much context that it looks like example code now. It's a bit hard to review code like this because the code you are showing has been stripped of a lot of context. Unlike Stack Overflow, we prefer to look at real code instead of example code. Please see the meta question: Why is hypothetical code off-topic for Code Review?. I'd personally recommend including your entire bpaste code you linked to just a minute ago. (trust me, we're quite used to long questions here, I am an expert in writing them...) — Simon André Forsberg 8 secs ago
@Mat'sMug @Phrancis what do you think? ^^
@Phrancis same with skype
@SimonAndréForsberg you give me faith in humanity
2
@SimonAndréForsberg Very well worded
@Mat'sMug and I give you faith in botanity
thanks fellas, I couldn't have done it without you ^^
@Duga in 61 minutes you'll be pretty busy :)
22:58
@Mat'sMug looking forward to it!
in VBA, 2 mins ago, by Duga
> added variable declarations node, and some actual unit tests
^^ and they pass!
You shall not pass!
2

« first day (631 days earlier)      last day (3684 days later) »