« first day (1329 days earlier)      last day (3669 days later) » 

user41796
12:34 AM
@RobertHarvey subqueries are one approach. Common Table Expressions (CTE) would be another approach. If you really need to, you can create a temp table and dump to there. I believe additional voodoo magic can be done with cursors, but I haven't really needed to play with them so I don't know. I'm not sure about treating a stored procedure as a table or view but that's one more tool I would throw out there to look at.
 
user41796
@DarkMirror Have a look at: stackoverflow.com/a/18157278/1345223 on how to declare and initialize 2D arrays. Why you would want a 2D array of pointers is a bit beyond me though, unless you were trying to declare a 2D array of strings. And I'm really not sure why you would want to make your brain hurt so badly.
 
user41796
@DarkMirror char is a variable type and char * is a pointer to a type of char. Strings in C are generally char[] but you can reference the head of that char array with a char *.
 
1:11 AM
@RobertHarvey Why? Usually subqueries are nothing to shy away from. They may get a little odd sometimes, but they're usually not particularly large - any given SQL query only has a small number of clauses to it, subqueries no different, I've never seen someone trying to avoid them for reasons other than performance. I've never had difficulty maintaining them nor seen anyone else either... CTEs though do give syntactic sugar to make them clean. You can use a view if really necessary
 
Some of my earlier Access programs had three layers of subqueries. It was a batch process having 30 or so queries executed in four or five steps (for an MRP system); it worked surprisingly well.
Eventually I had to break it up into intermediate results tables.
But each query had a name. SELECT queries in Access are essentially Views.
 
user55340
1:34 AM
@GlenH7 on nurse scheduling competition - kuleuven-kulak.be/nrpcompetition
 
1:39 PM
The fact that Java's Observable is a class and not an interface upsets me.
 
composition over inheritance?
jk that is older than that
 
I wanted to make a parent type that had a collection of empty methods for different types of messages, then each child would choose the message(s) it cared about and provide an implementation for those. Although...I did miss the obvious solution. The parent class extends Observable and the children classes just extend the parent.
 
2:23 PM
Dammit, @Oded. You're too damn fast.
 
39 seconds from post to close...
he has to be refreshing the page constantly
 
My record is in the 30s, too.
 
user41796
It's kind of like high frequency trading. Oded has closer network access to the main servers so he sees the questions just a bit sooner than the rest of us. :-)
 
This is a non-trivial comparison operation, I think. Unless I'm overthinking it. My timestamp is broken up into an integer microseconds component and an integer seconds component.
I've got to be overthinking this one...
 
user41796
@ThomasOwens You really don't want to get burned by floating point, do you?
 
2:28 PM
@GlenH7 It's not my idea. It was the raw packet data that was implemented that way. My POJO to hold raw packets follows the same structure.
 
if(this.sec!=other.sec) //compare micros
 
Yeah. That's what I have now. Compare the seconds. If they are the same, look at the microseconds.
 
or combine into a single long first
 
@ratchetfreak naw. Just happen to see the tab getting a number and seeing what it is about :)
RealTime FTW
 
user41796
The community's input is that your question is too braod, and we don't know what you're specifically asking. What specific problem are you having? A proper answer to what you've asked so far would take for too long to write up. — GlenH7 30 secs ago
 
2:29 PM
micro is only 6 orders of magnitude
 
Wait...wtf at this spec. The microseconds "may be greater than or equal to 1,000,000". Isn't 1,000,000 microseconds = 1 second?
 
maybe there is no 0
 
user41796
@ThomasOwens You could potentially cheat and hold the value in a different manner internal to the class. Then provide getters for seconds and microseconds to recreate the original format
 
user41796
@ThomasOwens It was the last time I looked.
 
@GlenH7 that was my siggestion
I think just adding to a table that the user polls
 
2:33 PM
:15134683 web sockets with fallback to XHR long polling
 
user41796
@Oded thanks! I just found your MSE answer to that same question
 
:)
 
user41796
I think everything has already been asked before. It's just a matter of finding the question(s).
 
user41796
And now today's dilemma -- figuring out the difference in network latency between NY, the rest of the US East Coast, and the UK or bug hunting based upon vaguely and poorly described defect reports.
 
one is just pinging servers all day the other is a pain
 
user41796
2:38 PM
As I'm already devising ways of setting up virtual workstations with Azure in their various worldwide data centers, I think the latency question is edging out real work.
 
3:07 PM
What do you think about the term proximity programming.
One step from pair programming, sit within 5 m of the devs one works with.
I think it could solve many problems.
 
user41796
@JohanLarsson You need to know what problem you're trying to solve first. Any solution is search of a problem is dubious at best.
 
isn't that just status quo for many people?
 
@GlenH7 communication, flow of info (same thing)
 
user41796
What impedes that communication now?
 
distance is def a factor
don't think relying on meetings is the way to go
 
user41796
3:11 PM
easy solution may be simply to move their cubes / desks closer together then. There's some effort involved in relocation but not that big of a deal
 
yeah, we don't have a good room as it is now
 
user41796
Do you have some sort of IM system available?
 
IM trumps closeness most of the time
 
I bought a GoToMeeting accout but the chat client was so poor we deemed it useless
 
there is lynk, skype an friends
 
3:13 PM
We have Notes at work and the Sametime chat client is nice
 
user41796
There's lots of IM clients & options available
 
user41796
I have used Sametime before, it's good enough
 
problem is that the consultants do not have access to it
 
if all else fails IRC
 
user41796
Sametime can be set up to allow external systems to access into it. Ditto with MS's Lync
 
3:14 PM
proxy blocks skype and many of the rest
 
Google Hangouts?
 
yeah lync can accept external phone calls
 
also we will not be allowed to discuss much on something that is not hosted by the company
 
user41796
Google Hangouts is another good suggestion
 
you can self host the server for lync I beleive
 
user41796
3:14 PM
Everyone can create a work related gmail account and use that
 
yes good suggestions, ty sirs.
 
user41796
One way to increase use of IM is to have an informal "etiquette" session on how to use IM
 
user41796
setup the ground rules that everyone can expect and also know to follow
 
user41796
simple things like asking if someone is free before blurting out a question
 
does it make sense tyo schedule cleaning for one whole sprint?
 
user41796
3:16 PM
realizing that your question via IM may get queued up behind something more urgent and it will be a bit before a reply is given
 
user41796
cleaning?
 
I'd say blurting on IM is not much of a problem, IRL or phone is much more intrusive that way ime.
 
user41796
The session isn't to correct behavior, it's to create a common set of expectations about how to use the tool
 
user41796
with a common set of expectations, people will be more likely to use it as they know the expected protocol to follow
 
user41796
In a previous life, we used IM extensively. Many times we'd be out of the office at meetings or whatever
 
user41796
3:18 PM
IM's were our electronic equivalent of post-it notes but with a lot more detail
 
and much faster
 
user41796
and more legible
 
and less dead tree usage
 
yeah IM is great
I still think proximity has merit
 
just in same building is enough if IRL meeting is needed
 
3:21 PM
I'd say ideally sit next to each other
 
if you have a IM with screen sharing, that will also help
 
perhaps even pair program.
 
user41796
@JohanLarsson absolutely. But sometimes things are out of your control and squarely within someone else's who can't make that option work for whatever reason
 
Maybe not pair on everything, leave it up to the devs.
 
user41796
@JohanLarsson you can get significant benefits without having to resort to pair programming
 
user41796
3:22 PM
Some people like pairing up. Others despise it with a passion; especially if it is forced upon them.
 
Pairprogramming depends much on the two involved ime
 
pair programming requires both devs to work on the same thing while unerstanding each other
 
yeah forcing is probably not good at all
 
compiler question
/parser
 
user41796
In a previous life, back when XP was the hot trend, my mgmt was considering moving to forced pair programming. Quite a few of us threatened to quit.
 
user41796
3:24 PM
@SuperCookie47 You can edit recently made comments. Hover over the comment, look for the down arrow on the left side; click and select edit. Or just hit the up arrow in the comment box.
 
there's a 5 minute time limit on it I think
 
user41796
@ratchetfreak yes. Unless you're a mod. No timers for them. Delete and edit are both subject to the 2 min window.
 
but you can always delete
 
I think it is two minutes for edit
 
when parsing a string, and replacing all, say, "=", "+" and "," characters with " = ", " + " and " , ", respectively. I want to keep track of the original position in the string (while iterating char by char, and the 'replaced' string, so I can give feedback to the user about where errors are (char pos. and line)
 
3:26 PM
don't think you can delete forever
 
well i tried to edit it and can't so that t must be the limit there
 
what language?
 
any really - vb.net
 
super instead of storing the token store a token-position pair
 
c# will do
 
3:27 PM
regex gives position for matches in C# I think
 
but i am using string.replace("string-to-be-replaced", "replacement")
 
it's often easier to just replace the string with a token stream that you don't have to do string operations on
 
so i can't keep track of positions.
 
user55340
Its going to sound sarcastic... but... "then don't do that"
 
my question could be read as, is it possible to use this function, and STILL calculate the original position?
 
user41796
3:28 PM
@SuperCookie47 find the positions first, then do the replace.
 
not unless you keep the original or find the positions first
but I'll repeat preparse the string into a token array
 
user41796
But remember that you're changing the length of the string with each replace, so you need to find all characters you're matching against prior to replacing
 
user55340
Have a data structure that has the tokens, original placement in the string, and the ability to generate a new string (either original or nicely formatted) from the data structure.
 
i am keeping string orig_code and string altered_code
so i am keeping acopy
i was going to replace all " "(two spaces), with " " for now. and replace all "=" with " = " etc. to make parsing easier
 
user41796
@ratchetfreak yeah, that would definitely work too. Push it to a token array; find & replace; concat it back into a string.
 
user55340
3:30 PM
The parser is working on the string rather than the output of a lexer?
 
my parser is my lexer xD
 
it's much easier to reason about a token stream than a string of chars
 
i think
lol
 
lexer just translates the string into tokens
the parser does the hard parts
 
user41796
3:31 PM
@SuperCookie47 I think you really meant "parsing question" not parser or compiler. Not a big deal, but the semantic implies what ought to be available.
 
i am trying to translate to tokens
 
user55340
Well, they're both hard parts, just the are different parts.
 
but first i need to have chars like "=" sep. from the identifiers etc
i find it hard otherwise
 
that is easy in a lexer
 
user55340
= and identifiers are both tokens.
 
3:32 PM
i know
that's why i need them separate
 
they are diffzerent tokens but tokens non the less
 
user55340
So store them as tokens.
 
user55340
Storing the tokens in a continuous string makes it harder to parse later.
 
how would i go about recognising "int abc=23443;" as "type:int id:abc op:= expr:23443 ?
 
a string "foo=bar+fuz" would then translate into tokens IDENT(foo), EQUAL, IDENT(bar), PLUS, IDENT(fuz)
 
3:34 PM
without confusing abc=23443; as one string or word
 
it's easier to let all identifiers (type and variable names) as the IDENT token
 
user55340
int abc=23443; becomes TOKEN_INT, TOKEN_ID (abc), TOKEN_ASSIGN, TOKEN_INT_CONSTANT (23443), TOKEN_SEMICOLON
 
user41796
@Oded how did you know I was already out of close votes today? :-) Thanks for swatting those down.
 
when the lexer sees the = it knows that it is not part of the previous token
 
user55340
because an identifier can't have '=' as part of its name.
 
3:35 PM
so is it possible to iterate source code char by char?
 
or would it be better to split into tokens right off the bat
 
user55340
Thats the job of a traditional lexer.
 
charAt in most languages
well java based languages
but similar enough
 
@GlenH7 aren't you always out of them around this time of day?
 
user55340
3:37 PM
You could also split the string into characters.... "foo".toCharArray()
 
user41796
almost always, yes. I VTC'd several last night and then ran through the queue this AM.
 
user41796
I keep hoping Tim will come back to my MP.SE question and change it to "status-completed" instead of "status-deferred"
 
@MichaelT wouldn't that be very slow on large portions of code?
 
@MichaelT I was about to say – characters != bytes. As it happens, Java's characters aren't true Unicode code points either, so it isn't actually much better.
 
because i'd have to iterate them too
if anyone wants to look at my syntax, to see if i'm on the right track there?
it's like a grammar list
pastebin?
 
3:40 PM
first get a substring of the interesting part (usually line by line)
 
pastebin.com/geBgatft SYNTAX of my language "Lupe"
 
user55340
Yes and no... you're worried about the memcopy thats being done... but its not that big.
 
remember the goal of the lexer (what we are trying to get you to build) is to take the input and create a token stream, it should be a deterministic finite state machine
 
it's a toy language which might actually work out (hopefully)
 
user55340
If you are interested in something a bit more useful, you might want to try antlr antlr.org for writing the language rather than from scratch.
 
3:42 PM
it's only in alpha, if you like
 
user55340
Not that from scratch isn't useful too... it lets you know whats really going on.
 
but the satisfaction of writing your own little compiler tho
..
 
user55340
But knowing how to do it in antlr is a very useful skill.
 
if it works out i could port it somehow
anyone looked at my syntax, could it work?
 
user55340
I wrote a language in C in a compiler class years ago - lexer, parser, code generator as separate modules.
 
user55340
3:43 PM
Knowing that, I then wrote my own language again for another class in flex + bison in a week to test some other code I was writing.
 
your syntax expects individual chars for tokens
 
?
it's in VERY early stages, and i probably don't know that much tbh
@rachet how does it?
each <fgsdfsdffs> only represents an already defined code element
 
look at how you defined the <identifier> , a lexer would emit the identifier token dierctly
 
like: <type> := <int> | <string> | <char> | <bool>
this text file describes the language to ME. to help me write the code
a compiler shall never see it
 
letter and digit and all the <op> look for the actual characters
 
user55340
3:47 PM
@GlenH7 need another downvote on that square for a speedy delete start.
 
it is a visual definition of the language
 
yet there are tools that will transform that into a parser
 
such as?
 
user55340
antlr.
 
user55340
3:48 PM
bison
 
user41796
@MichaelT mine is one of the two
 
but even then,it would limit my interaction with backend, no?
 
user55340
What backend?
 
wouldn't it be rather easy to write a simple tokenizer
 
user55340
You get an abstract syntax tree back from a parser...
 
3:48 PM
?
 
writing your own parser is rather complex
 
user55340
'rather' is an understatement.
 
and solved in the general case
 
but if it only spits out AST then i can' control how certain things will be evaluated in special cases
 
user55340
Nothing like finding out that you've got something that isn't LL(1) when your'e writing your own LL(1) parser from scratch...
 
user55340
3:49 PM
what special cases?
 
can antlr do this (turn code into ast) from my syntx definiton>
 
whoa whoa whoa
alright everybody just calm down
all you need is a monad
Thankyouverymuch.
 
I knew you were going to say that
that or haskell
 
user41796
@JimmyHoffa enjoy your stars
 
user55340
Thats it! You should write your parser generator in haskell, using a monad... and Jimmy will tell you how.
 
3:51 PM
@MichaelT o yz, I can haz links for him!
 
don't scare him off
 
@ratchetfreak I'm not scary ...
 
your link flood is intimidating
 
user41796
Can I get some close votes please? I'd suggest "unclear what you're asking."
 
user41796
-1
Q: Is IT going to flex?

ReviousEnglish is not my native language so I hope someone will help me at better express what I mean. Do you know Google Ngram? is a nice tool for making searches on Google Books. You can check how many books in the years have been written on some subject. If you click on the link you will note a Gau...

 
3:52 PM
@ratchetfreak my link flood is awesome, it's not my fault awesomeness intimidates you
 
all i want is a way to convert "int my_int=543;" into "[TYPE:=int] [ID:=my_int] [OP:==] [EXPR:=543] [SEP:=;]
??
 
user41796
@JimmyHoffa but is there a monad for it?
 
@SuperCookie47 You just trying to get ASTs or something?
 
user55340
Still, back to the question at hand... while not impossible, writing your own parser is a ~3 week project with dedicated time spent to it (several hours a day) while studying the topic at hand, help from TAs and instruction from the professor who wrote the book.
 
@MichaelT ...come now, in all honesty, my approaches would say otherwise depending on what he wants, my approach may actually be valid for this dude
 
3:53 PM
if i get the above, i can then semantically analyse it, create ast etc.
 
@SuperCookie47 you can transform it into [ID:=int] [ID:=my_int] [OP:==] [INT:=543] [SEP:=;]
 
int is not an indentifier
 
and let the parser take care of differentiating which ID is a type or variable
 
and an int, will be recognised under expr
 
it's what nearly all C-style languages do
during lexing things are operators, keywords or identifiers
and the parser makes the decision about which should be which
 
3:55 PM
but i can go from here straight to sem. analysis, then gen. ast, then code gen
for my simple purposes anyway
 
the ASt will be able to say that it is a type though
 
user55340
After you spend ~20h on writing the parser, if you get frustrated... look at antlr.
 
user41796
<rant> One of the things I hate about full stack testing is that I have to check 4 or 5 different config files for local dev settings to make sure I'm actually working against what I think I'm working on. </rant>
 
plus my types will never conflict with indent.s
 
no user defined types?
 
3:57 PM
 
that will be later, IF i get it working
:)
 
user41796
@RobertHarvey Definitely living in the trough...
 
if you want to ensure that they don't clash you need to enforce caseness or add a $ or something to the vars
 
user55340
I'll admit I like sigils.
 
they make parsing much easier don't they
 
3:58 PM
but shant clash because it's case sensitive and they aren't allowed to be named types
for example int int; will never be allowed
plus what i am asking is how can i differentiate between my_int=234;
 
but that would get you into trouble when a new type is introduced and it clashes with a existing variable
 
how could i change that to $my_int = 234 ;
at least
but still keep track of origional parsing position within source code (unmodified)
 

« first day (1329 days earlier)      last day (3669 days later) »