« first day (1718 days earlier)      last day (3246 days later) » 

6:00 PM
@Justcode That is pretty much all of our life stories...
 
haha yea :D
 
                                                                      sometimes....
 
@MoonOwlPrince Because System.Collections.Generic was introduced in .NET 2.0 and everyone moved over to that instead
Looks like it's still maintained and used heavily regardless
 
I have string1 = "stackabcdfdoverflowsoffsdf" string2 = "stacksdfofshfefafnfdfeha" and I have to match string2 uniquely.
hi guys can you build a regular expression for me
 
@JagadishDabbiru What have you tried?
 
6:08 PM
@JagadishDabbiru "fine day isn't it"
 
stack.*
matching both
 
I built that expression by combining four words together. Perhaps it is regular enough to suit your needs.
 
so i have to build something like stack.* and not overflow
 
@JagadishDabbiru I suck at regex and usually use: regexr.com
 
@JagadishDabbiru We told you in the JS room to use negative lookahead. Any luck with that?
 
6:14 PM
u guys told to look for negative lookahead
i tried to see but
it's too complex to understand
build a regex for me for above question. I will derive logic and implement for my need
 
it's pretty simple. (?!regex) matches zero characters if there is no match for "regex" at the current location. it fails to match otherwise
 
29
Q: RTFM-like answers: Flag them or allow them?

Awesome PoodlesIf an answer essentially tells the OP to "Read the ¤cough¤ Fine Manual", should we flag it? I'm not talking about rude answers (that's a given), but answers like "Look up X in the Y" (and maybe don't even provide a link!). For example, see this answer... To my mind, this isn't even as useful...

If "RTFM" and "LMGTFY" answers aren't allowed, I'm going to go with "CACC" answers now - Consider A Career Change.
 
So a(?!b) matches "a" in "a1", but does not match anything in "ab"
 
oh.. got it
thanks dude
 
Maybe there should be a regex slaves fanatics room...
 
6:23 PM

RegEx - Regular Expressions

Discuss about Regular Expressions. Learn at: Regular-Expressio...
 
@KendallFrey if i give a.*(?!b).* for the string axyzbxyz not to match and should match the string axyzxaxz will this help?
 
@Jeremy aha, needs more slaves though D:
 
@JagadishDabbiru That won't work quite right
a.* will match the entire string
 
I have a question about web api PUT method. Assume I have an entity named Movie with the following properties: Title, Synopsis, Imglink. In PUT method, I would like to handle both partial and fully update.
 
then it will see that there is no b after the end of the string, and continue matching
 
6:25 PM
@KendallFrey help me how to handle this scenario
 
Here is what i am doing:
public HttpResponseMEssage Put(int Id, Movie movie){
Movie movieToUpdate = context.Movies.Find(Id);
if(string.isnullorwhiteSpace(movie.Title)){
movie.Title = movieToUpdate.Title;
}
//more checking for Synopsis and Imagelink
context.Entry(movieToUpdate).CurrentValues.SetValues(movie);
 
@JackyNguyen are you calling SaveChanges?
 
yeah
i took that out for simplicty
so my question is: is it a practical way to do it
or should i have another method for PATCH
 
you want "Upsert"
Update+Insert
 
@JagadishDabbiru Hint: after the "a", you don't want to be checking for a "b" immediately, you want to check for "any string ending with a b" because you know that if there is a b anywhere after that, there will be a string from there to the b, that ends with a b
 
6:27 PM
context.Entry(movie).State = EntityState.Modified;
then call SaveChanges()
 
and you know the regex for "any string ending with a b"
 
I usually use like context.Entry(movie).State = EntityState.Modified
if movie doesn't have that id in it, you can do movie.Id = Id first.
 
public HttpResponseMessage Put(int Id, Movie movie){
    context.Entry(movie).State = EntityState.Modified;
    context.SaveChanges();
}
 
@CharlieBrown: for partial update, assume user only supplies Imagelink
 
then your back to manually setting properties
 
6:30 PM
ahhh
 
i would make a separate action for each thing you expect
 
so I don't need an action for PATCH?
i just found out about PATCH so I am curiosu if I am doing it wrong
 
Personally, I NEVER use anything but GET and POST
theres really no reason to unless your trying to 100% HTTP compliant, and pretty much no one bothers
 
you don't use PUT either?
 
@JackyNguyen yeah, they are mostly just convention things
I like to use PUT/PATCH/DELETE just because it feels "right" but all of those can be POST without impacting functionality
 
6:34 PM
[HttpPost, Route("/movies")]
public HttpResponseMessage Post(Movie movie)

[HttpPost, Route("movies/title")]
public HttpResponseMessage UpdateMovieTitle(int id, string title)
 
Also most servers don't have the PUT/PATCH/DELETE verbs enabled by default.
 
@CuddleBunny: ahhh I see
@CharlieBrown: thanks for method signature demo!
 
Typically, people do upserts anyway, so PUT is not needed. Same goes for PATCH
 
just on the off chance, is anyone here really really good at regex?
 
here/anywhere
just walk around the office until you find someone really old j/k
 
6:40 PM
guess I'll have to ask SO later
 
I am so bad at regex, I always just use indexOf...
 
@KendallFrey I'm not bad. What do you want to do?
 
Unicode
Still in?
 
@KendallFrey I've used regex before.
 
@KendallFrey Sure.
 
6:43 PM
What are you trying to do?
I mean, I'm no Martin Buttner.
 
Match a code point above \uFFFF
 
Oh, Have fun.
 
I'm wondering if this is supported by any regex engine
 
@KendallFrey What? Something outside of UTF-16?
 
@Jeremy outside the BMP
 
6:45 PM
@KendallFrey Hm. I need some research. Post a question and I'll try to answer
for delicious rep
 
f# will just test an sql connection in design time - now that was cool
 
Oh, they're just surrogate pairs. Duh.
 
1
Q: How to match Unicode code points greater then \uFFFF in regex string without Java 7?

StephanHere is my regex: (?x)(?:[A-Za-z:_] | [\\xC0-\\xD6]| [\\xD8-\\xF6] | [\\xF8-\\x{2FF}] | [\\x{370}-\\x{37D}] | [\\x{37F}-\\x{1FFF}] | [\\x{200C}-\\x{200D}] | [\\x{2070}-\\x{218F}] | [\\x{2C00}-\\x{2FEF}] | [\\x{3001}-\\x{D7FF}] | [\\x{F900}-\\x{FDCF}] | [\\x{FDF0}-\\x{FFFD}] | [\\x{10000}-\\x{EFF...

I was curious and found this ^
 
@Jeremy In UTF-16, yes.
But what about in an encoding-agnostic regex?
 
I find it strange how some people use links in place of buttons
 
6:50 PM
@KendallFrey Hey now. One regex per encoding.
 
@juanvan it'll also verify your sql for you ;)
 
Ya it keeps ~ some code because it can't find the table
 
@KendallFrey Well, for the easy case, if you're in UTF-16, you just want to look for a high surrogate-low surrogate pair. That's not to bad - look at the documentation for Char.IsHighSurrogate and Char.IsLowSurrogate. I'm not sure there's a good encoding agnostic way to catch everything - how are code points above FFFF supported outside of UTF-16?
 
@Jeremy Depends on the encoding
I'm thinking most regex engines go by code units, not code points
And I'm wondering why
solely performance?
 
7:05 PM
Anyone here worked with Awesomium ? ( some kind of Chrome Based Web Browser Control )
Guess no one did :| i just want a Browser to set some cookie in it from my cookie container and it show me a site ! i Archived this with Basic Web Control which use IE ! but the site load so bad .... IE Sucks , i tried Awesomium , and it Load great ! but when i add cookie and load page , i am not logged in in the site :|
LOL , There are other rooms, with 114 users currently talking in 57 rooms.... Exactly 2 Person Per Room :P
 
I'd tried playing with Awesomium at one point
but abandoned it since it's x86 only
 
7:21 PM
:O
 
Just found out something kind of interesting about chat
Every time a conversation is moved to chat, it is moved with the tag of the question
 
haxxor
 
So you can filter discussions based on the tags and see everyone's conversations sorted by time that have been moved to chat
 
what does that mean
 
that is c#'s for example
 
7:22 PM
@ReedCopsey Do u have any suggestion for me to use for a Web Browser Control , other than the base one that use shitty IE ? :|
 
@TravisJ I see absolutely nothing interesting there
What am I supposed to be seeing?
 
@KendallFrey - The transcripts are rather interesting I thought. Did you look at any?
 
oh, you mean it finds all the rooms with a given tag in the description?
 
Yeah
Basically just a list of heated debate :)
 
augh printers are so evil
2
 
7:27 PM
@KendallFrey Which encodings do you need to support?
Write a regex for each.
 
@Jeremy I'm not writing regexes, I'm writing a regex engine, and I have no desire for half-baked Unicodeness
 
@KendallFrey oh
 
@KendallFrey read it already :D Its sooooooo true.
 
@Jeremy yeah :)
 
theoatmeal knows best
 
7:30 PM
So I'm debating the value of using code points over code units
 
@KendallFrey debating with who?
 
whos winning?
 
what is a code point and what is a unit?
 
@KendallFrey It'd be a lot easier to just use code units... and arguably the right layer of abstraction, too...
 
7:31 PM
@JohanLarsson In UTF-16, a code unit is always 2 bytes
In Unicode, a code point is a number between 0 and 0x10FFFF
 
and a point is?
 
@Jeremy Easier for me or the user or the CPU?
 
@KendallFrey ease of implementation.
 
oh, right, read that backwards at first
 
what is a point? :)
 
7:33 PM
Yes, easier to implement, but funky Unicode
 
pointer?
 
@JABFreeware The actual character
 
ahhhh
 
@KendallFrey Unicode is always funky
Encodings are funky
The leakiest of leaky abstractions
 
I don't know why using code points would be a bad thing
other than a slight performance hit
 
7:34 PM
wasnt meant for this room
 
@KendallFrey Because if you use code points, you need to basically implement one regex per encoding.
 
No, that means the opposite
 
Anyone got Any Suggestion of a Web Browser Control Other than the base one that use IE ?
 
@Pedram Webkit?
 
Maybe I'm still misunderstanding you.
 
7:36 PM
@Jeremy Or do you mean one regex engine?
 
@KendallFrey Hm. What's the public signature, and a test case?
Just so I can be sure I understand.
 
basically nothing at this point
I'm following my habit of overthinking and undercoding
 
;)
 
@KendallFrey Ok let's check this one :D i Checked EO.WebControl to figure it's both not Free and also i could not find a SetCookie method for it , tried Awesomium and it wouldn't load my cookie even when i set them :O
 
Cultures always rape me
 
7:37 PM
@KendallFrey Just for extra weirdness... are you going to support GB18030?
 
@KendallFrey tried the base one it work and load my cookies like a charm ! but it wont load the pages and all Css and such are screwed lol
 
@Pedram why not just fix the CSS, IE support isn't hard nowadays.
 
@Jeremy The point is, if the regex uses raw Unicode, encoding details are no longer relevant, and if it's ported to a different language with different encoding for strings, the behaviour will remain consistent
 
At least, from what I understand.
 
I think character sets and culture info are two areas that can easily rape someone
 
7:39 PM
@CuddleBunny it's not my site , plus IE open it better than the IE inside Web Control :| seems like it's older version there ! i try to make it use newer version , i figure i have to edit Registry value for it ! which i rather pass
 
@Jeremy Are you confusing point and unit?
A code point contains one or more code units
 
@KendallFrey Yes.
dunno, GB18030 is weird.
I think you should just start writing code and getting stuff to work.
 
@Pedram you can try wpfchromium.codeplex.com but at least last time I tried playing with 3rd party browser controls most of them cost money.
 
@Jeremy I'm not sure what that means, but I would only be using UTF-16
 
@CuddleBunny Currently my project is WinForm guess this one is Wpf , tnx anyway :D
 
7:42 PM
@Jeremy I don't want to rewrite everything to add Unicode support, which is why I'm thinking about this now :P
 
@KendallFrey If you're only using UTF-16, then all you need to do is look for a high-low pair.
easy peasy
 
It's not like code points are hard, but they're significantly harder than code units
especially when I start doing numerical comparison
 
It's so hard to answer questions like this.
 
zzz asp.net 5 won't be rtm with vs2015 rtm
 
Like, I know it's annoying to ask "why do you want to do this?" - but if someone asks "How do I drink rocks?" Someone would say "uh... you can't really drink solid substances... why do you need to drink rocks?"
 
7:47 PM
@Jeremy Are you talking to me? lol
 
@KendallFrey Not really. Inspired by you, though.
It's hard to reason about what you should do without getting a sense of the problem it's trying to solve
and it sounds like you don't really know what it is yet - or I just don't understand it like you do.
 
ello
 
One example is [\uA000-\uFFFF]
Should this include surrogate pair code units?
it makes sense to if your regex runs on code units
not so much if on code points
And using code points eliminates silly stuff like returning half of a surrogate pair
 
@KendallFrey How does C#'s Regex handle this problem?
 
Is encapsulating the object of a sealed class that you originally intended to inherit considered an anti-pattern?
 
7:52 PM
It also works on code units
It refuses a regex that contains a literal surrogate character without a valid surrogate pair
 
@KendallFrey Right. And that's because everything is UTF-16.
 
I'm running a test on .
aaand it rejects that as well
 
:)
 
so it may be a string thing as well
 
@KendallFrey Yep. All C# strings are utf-16.
 
7:53 PM
nope
 
What do you mean nope
 
substring works fine
So regex works on code units, but errors on malformed surrogate pairs
for example, .. matches a surrogate pair
. throws an error if it matched half of a pair
 
@KendallFrey That makes sense - since C# strings are UTF-16, C# can't return anything.
 
(.) also fails
 
Well, can't return a string, at least.
 
7:56 PM
@Jeremy C# has no problem with that, it's the regex that prevents it
 
@KendallFrey You can create a string consisting of only half a pair?
I'd be surprised.
 
"𤭢".Substring(1)
"\uD800"
 
Hm.
 
@KendallFrey: is your project open source? :D I am very inspired by what your working on
 
@JackyNguyen It will be if it ever reaches some form of maturity
Right now I have exactly 0 lines of regex code
 
8:02 PM
ohhh
 
@ton.yeung A regex engine
 
TIL C# strings can be ill-formed
i.e., a C# string is just a sequence of UTF-16 code units.
 
Looking to buy gopro like camera, any experiences with that/ cheaper alternatives?
 
@Marek buy a used Nokia Lumia and duct tape it to yourself imo... probably more rugged.
 
@Marek, Monoprice had one we used for racing
lol
 
8:14 PM
And I haven't even started worrying about graphemes and normalization
 
I use mine for everything
 
haha
 
@KendallFrey Why not just create a wrapper class around Regex that takes data, a pattern, and an encoding, and internally translates the data and pattern to UTF-16 and calls into Regex to do the work?
 
No, sir. I'm making a regex engine
wrapping a regex engine would defeat the purpose
 
Lol, okay.
 
8:20 PM
It's also not C#
 
I'd argue for the same principle, though. Implement your engine for one encoding, and translate everything else to that encoding.
 
But by translating everything to UTF-16 and using code units, I inherit all the quirks of UTF-16, even if I happen to be using a different encoding
The engine will only be implemented for one encoding (UTF-16) regardless
 
@KendallFrey Which quirks concern you?
 
the thing of one code point being multiple characters in a regex, for example
I want ^.$ to match a surrogate pair
 
@KendallFrey Then implement that in your engine.
 
8:25 PM
Right, that's what I've been talking about all along
 
Or, if you like, implement everything for UTF-32, and translate everything to UTF-32 first.
All of the above are more wasteful than just doing everything in UTF-8, but if you want to talk about implementation quirks...
UTF-16 is only the C# standard because of compatibility concerns with UCS-2
 
@Jeremy Because UTF-32 is equivalent to the Unicode code point values, that's effectively what I'd be doing
@Jeremy DCS-2?
 
oops. UCS-2.
 
@KendallFrey would some snooping on others' implementations help?
 
@CuddleBunny Are there other implementations that use code points?
 
8:34 PM
beats me, but more often than not it has been done before. It is at least worth a look.
 
A look where?
 
maybe github
I'm not sure exactly what you're looking for but whenever I get stuck on something specific I try to find where it has been done before
 
I don't have time to go out looking for regex engines that support code points
 
:)
 
go is an acclaimed new language that doesn't carry any windows encoding cruft with it. check out what they did.
go does some interesting things with strings that seem correct. for example, there's no string.length()! :)
 
8:54 PM
there is also the source for the C# one here, if it does anything like what you want: referencesource.microsoft.com/#System/regex/system/text/…
 
@CuddleBunny You will be surprised that a lot of things have not been done
Otherwise if that were not the case then people wouldn't repeat the same code in the same languages over and over again
 
@MoonOwlPrince there are levels of acceptable duplication, but most abstract things have been done to death.
 
@CuddleBunny One problem is using a library that does not provide an API for your language of choice. Another problem is that while most abstract things have been done to earth, like the non-abstract, most of the code for them is not easily accessible or usable because of legal restrictions.
 
> The regexp implementation provided by this package is guaranteed to run in time linear in the size of the input.
I wonder how they pull that off.
 
It is the reason why the Bing Team wrote a crawler from scratch after Google was pissed off that they were stealing results from their search engine
 
9:02 PM
@MoonOwlPrince not saying that you should never rewrite things, I'm saying there is almost always something to take from.
 
@CuddleBunny I will agree with you until that something to take from is inappropriate
 
bloody hell
 
@Jeremy How does that seem correct?
 
I believe one of the reasons a lot of big companies choose not to open source certain code is: most people will want to just take and never contribute. Mr. Torvalds cried that this was one on of the major flaws of the free software model.
 
The whole reason I open source code is so people can take it
not so they can contribute
contributors just make code that isn't mine
 
9:07 PM
@KendallFrey Linus doesn't like that
He wants you to contribute
 
@MoonOwlPrince yeah, but that is all like the Oracle v Google court stuff. I wouldn't worry about the legality of copying patterns.
 
In the future, a license will come forth that will go along the lines of:
If you are going to be using this software, you are liable to contribute in financial terms or to the source code itself. Failure to do so...
 
The more complex OSS gets the less likely folks are to contribute to it. Though just like dotnet/core, if the pull request is awesome enough someone will take it.
 
That's not a FOSS license
 
But it is an OSS licence
Linus' camp believes that the F from FOSS should be dropped
 
9:11 PM
source?
I strongly believe that libre software should be a thing
 
Google the open source vs free software arguments that were laid out by RMS and Linus
I believe in free software
 
Even if someone uses it and doesn't contribute directly to the source, they are still contributing to the proliferation of that source which in turn will help it reach those that can actually offer valuable inputs.
 
Some people don't think so
 
That much is true... because I feel the same way about software/media piracy.
If I ever release my own commercial software free from my corporate shackles, I'll toss it up on tpb myself...
 
However, I don't believe in the RMS philosophy of: You want to make proprietary software using my free software. You shant be allowed to do so. Make your software free.
 
9:18 PM
Same. If I wrote something some corporation would use in their product that will make it faster/more friendly to potentially thousands of users, the actual impact on society is immeasurable.
 
@CuddleBunny Wait, you would develop commercial software and distribute it freely? Are people supposed to pay or not?
 
both?
 
@CuddleBunny You need a course in basic logic
 
I think a lot of people pay for commercial software just because, but if people that can't or won't pay for it want to use it I don't want to stop them.
 
@CuddleBunny That's called donations
 
9:30 PM
I wouldn't advertise the unofficial free copies on the product's web page though of course
Yeah, donations would achieve the same result but I'd be interested in finding out which approach generates more revenue.
 
Would distribution for free be included in the license?
 
You could do it the Unity way
 
I dunno how I would handle the licensing of something like that. Maybe something included with the product itself along the lines of "however you got this, I don't care you can use it now"
 
What happens when you violate your own license?
 
It is YOUR license
You must honour it
 
9:33 PM
Maybe you could distribute it under two licenses, and from two different websites
@CuddleBunny That sounds like GPL, in that you can sell or give away software
 
I think the Unity license is fair. approx. "This software is free until you can afford it."
 
@MoonOwlPrince that doesn't make it okay; @KendallFrey Yeah, two licenses might work.
 
@MoonOwlPrince This seems like a more sensible approach
Require companies generating over $X revenue to pay
 
@KendallFrey Two licenses?
Oh yep
 
But I'm no lawyer, I'd probably need to hire one to write such a silly license. Unity model is fine too, but I probably won't ever make something on my own worth $1k+ licensing...
 
9:36 PM
You would use a scaling price meter
But there are people who might dodge the licence by mocking an outsourced company with no money
I wish we had extension operators
 
chances are I'll never write my own commercial software either, because that implies I need to maintain it even when I get bored of it...
 
@CuddleBunny That is why you hire new grads to maintain it in the name of an internship
 
Anyways, this font without punctuation is about to make me quit life... time to go home D:
 
cheers
 
Does anyone of you know a method (library) like Xamarin that uses HTML5 to deploy to iOS and Android? The main thing is.. it has to support the camera.
 
9:39 PM
@ErwinOkken does Cordova or Appcelerator support the camera? can't see why not.
 
I think PhoneGap uses HTML. That's all I know about it
 
Interesting, lets find out about those two :)
 
@NETscape Turns out my Ambiguous problem of last night was nothing related to the code :| i had a reference to a LinQBridge or something , i deleted it and all got solved :O
 
yep, that was the solution i was going to suggest but i signed off
actually i think i asked you
if you had any other extension libraries or something that you added to your project
and that was why
 
@NETscape yeh , i didn't notice it before coz i never added it lol , dunno how it got added there .... i been working a lot of this project and well sometimes i just copy paste some code to see how it works and resharper or other stuff add me reference. for them :P
@NETscape btw bro , have u ever used Awesomium ? or any other Web Browser for WinForm other than the base one ?
Been trying to add cookies for Awesomium , i use SetCookies method and get no error ! but the page load w'o the cookies :| used Base Web Browser control , Cookies load ! but page load so bad and nothing show up right ( IE Sucks :| )
 
9:55 PM
Finding a streaming possibility for the camera in PhoneGap/Cordova doesn't seem that easy tho :D
 
I am so done with trying to inherit LinkedList<T> and looking for a solution already out there. I am implementing my own CircularLinkedList<T>. pissed off
 

« first day (1718 days earlier)      last day (3246 days later) »