« first day (958 days earlier)      last day (3990 days later) » 

1:00 PM
@DWRoelands In English, how do you say it? "Fetch the ball", or "The ball fetch"? Nuff said.
 
1:17 PM
@Bracketworks That's not tokenization.
 
private static ObservableCollection<Pendencias> TransmissaoPendencias = new ObservableCollection<Pendencias>();
TransmissaoPendencias.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(TransmissaoPendencias_CollectionChanged);
For some odd reason, this isn't triggering.
Since I've never done that before, I guess someone could explain to me why. :(
 
Looks fine, need more details.
 
The moment when I'm passing values to it is:
 
When should it be triggering?
 
ObservableCollection<Pendencias> pend = sql.VerificaPendenciasAtivas();
if (pend.Select(s => !(TransmissaoPendencias.Contains(s))).Any())
                    TransmissaoPendencias = pend;
There
And it is reaching it.
 
1:19 PM
facepalm
 
Whaa ?
 
It's assigning it a new object, not modifying the existing one (with the handler)
 
@KendallFrey Well during parsing; PHP issues a parse error.
 
@Bracketworks Seems like a grammar flaw.
 
How am I doing that? I'm never instantiating my collection.
If I create a second collection, the events get screwed ?
 
1:21 PM
TransmissaoPendencias = pend;
 
Ah
AH
Got it
 
pend does not have the event attached
 
Yeah yeah, I got that now..
pend.Select(s => TransmissaoPendencias.Add(s));
 
GAAAAH
my eyes
 
1:22 PM
they burn
use foreach, please
 
foreach(a in a[]) or .foreach?
 
lol
 
Because there is no .foreach ._.
 
Like, the language construct
foreach (...)
 
you shouldn't be manipulating objects with linq
 
1:23 PM
It's time to learn a lesson in method design.
 
:)
 
A method should either 1) Have side effects, or 2) Retrieve data. Not both.
 
Hahaha What if I pend.ToList().ForEach(f => TransmissaoPendencias.Add(f));
JUST KDDING :(
 
Select is designed to do #2. Don't force #1 down its throat.
 
1:24 PM
Ok :(
I used Select because ObservableCollection doesn't have a .ForEach
 
@AndréSilva That's actually not bad, but the C# foreach is more normal.
 
And it was on my intellisense thingy so I just <TAB>
Yeah I put as foreach (Pendencias p in pend) TransmissaoPendencias.Add(p);
 
Perfect.
 
The only weird thing is. My logic
Look at this
try
            {
                SQL sql = new SQL();

                ObservableCollection<Pendencias> pend = sql.VerificaPendenciasAtivas();

                if (!(TransmissaoPendencias != null) || !(TransmissaoPendencias.Count > 0))
                    foreach (Pendencias p in pend) TransmissaoPendencias.Add(p);
                else if (pend.Select(s => !(TransmissaoPendencias.Contains(s))).Any())
                    foreach (Pendencias p in pend) TransmissaoPendencias.Add(p);
            }
FYI: the variable cex is there on purpose
I had to do that if...else if
 
i hate how chat formats large code chunks in my browser: it doesn't
it throws alll of it on one line
 
1:27 PM
IE ?
 
yep
ollld IE too
 
@AndréSilva Why did you?
 
Well, you deserve then..
 
lol, i have no choice!
 
@KendallFrey I get a nullexception if I go directly into it.
 
1:28 PM
You should be just checking for null, then have the foreach inside that, with no else
 
It will never be null but when there is no pendencias that .Contains() returns an error
 
Wait. lol.
I just remembered that Extension methods don't error on null.
 
The logic there is ( at least should be ) : If the variable is new or there is a new item to be added.
There error I think it is on Any because since there is no rows.. I don't know what I'm saying.
 
if (TransmissaoPendencias != null) foreach (...) ...Add(...)
 
._. No
 
1:30 PM
Why not?
 
Because if it isn't null, I should verify if there is anything new.
If it is null, it means it is the first time the variable is being filled.
 
You mean if there are items in pend that aren't in the other?
 
It doesn't matter.
I think.
Regardless, you still don't need that else if
foreach (var p in pend.Except(TransmissaoPendencias))
Something like that
 
Oh yeah, I was going to duplicate with what I did lol
Not even see it
foreach (var p in pend.Except(TransmissaoPendencias)) TransmissaoPendencias.Add(p);
Ok.
You said that ObservableCollection would never be null right ?
 
1:34 PM
No
It's an ordinary object. It can be assigned null
 
Hm..
 
5 mins ago, by Kendall Frey
if (TransmissaoPendencias != null) foreach (...) ...Add(...)
An alternative would be:
if (TransmissaoPendencias == null) TransmissaoPendencias = new ...
The put the foreach outside the if, after that.
oops, == not !=
 
in visual studio, i saw a movie of some people using shortcut keys to create code skeletons, something like a for loop when they pressed shift+ctrl+L, or something, i made up that series of keys, but how do I set this up\
 
No need to instantiate. I instantiate on its creation.
 
@Steve snippets
 
1:36 PM
great thanks
 
@AndréSilva then it will never be null
 
@KendallFrey Yeah, only pend could be null but I put a verification there
 
oh, then check that pend != null
 
TIL : There is a method called .Expection()
If only I knew that before.
@KendallFrey Well yeah, I did that haha
Well lets debug !
Hm
I could
if (!(TransmissaoPendencias != null) || !(TransmissaoPendencias.Count > 0))
                        foreach (Pendencias p in pend) TransmissaoPendencias.Add(p);
                    else foreach (var p in pend.Except(TransmissaoPendencias)) TransmissaoPendencias.Add(p);
Instead of
 
@AndréSilva Expection? What's that?
 
1:39 PM
if (!(TransmissaoPendencias != null) || !(TransmissaoPendencias.Count > 0))
    foreach (Pendencias p in pend) TransmissaoPendencias.Add(p);
else if (pend.Select(s => !(TransmissaoPendencias.Contains(s))).Any())
    foreach (var p in pend.Except(TransmissaoPendencias)) TransmissaoPendencias.Add(p);
@KendallFrey Except*
 
@KendallFrey wow, i did not realize this whole time i only had to press tab again for the snippet to appear... </noobMoment>
 
Low level of Dyslexia + Sleepness = messy english
I have to answer Lync in portuguese, code in portuguese+english and talk here in english
Things get messy
 
lol
 
This: foreach (var p in pend.Except(TransmissaoPendencias)) TransmissaoPendencias.Add(p); did not work.
Even though both has the same values inside, it added.
Maybe because they have different instances of the same class ?
With the same values in its properties ?
 
does anybody watch "its always sunny in philly"
 
1:46 PM
initialize TransmissaoPendencias to an empty list
and then dont worry about it
in the constructor
 
@drch But TransmissaoPendencias is an ObservableCollection ._.
 
and dont use count > 0, use .Any()
 
õ.o
 
var p in pend.Except(TransmissaoPendencias)) TransmissaoPendencias.Add(p); looks sketchy cause youre modifying the collection to compare against
 
.Any() is a LINQ extension method (?) which tells you if there are any elements in the enumerable.
 
1:49 PM
foreach (var p in pend.Except(TransmissaoPendencias).ToList()) {
    TransmissaoPendencias.Add(p);
}
 
@drch Would that provide unique additions?
I feel the point of that code is to make sure that no duplicates come in from TransmissaoPendencias. herp derp not looking at the pend.Except part.
 
yeah, i dont really have the 500ft view of it yet ;)
looks like it can still throw a null ref if it gets into the else
 
                TransmissaoPendencias.Clear();
                foreach (Pendencias p in pend)
                    TransmissaoPendencias.Add(p);
Couldn't I do that ?
 
If you want to get rid of everything that isn't unique in TransmissaoPendencias...
 
Oh no wait.. I can't.
 
1:52 PM
Hey @Bracketworks, if I want a function to accept a class as an argument in php... what's the syntax?
 
Can anyone see why I'm getting an `Collection was modified; enumeration operation may not execute.` error on this Foreach loop?

https://gist.github.com/anonymous/5685117
 
@AndréSilva have you overridden equals/gethashcode on these?
 
function myFunction($var = new myObject()) is failcakes.
 
or do they have some id?
 
I get the error when the second loop tries to loop a second time.
 
1:52 PM
@Billdr You can typehint with userland classes function foo(Bar $bar) { }
 
@drch Nope. No Interface in those.
 
because otherwise 2 objects arent going to be the same unless they are the exact same reference
 
But I can't because I have an event in ObservableCollection, and if I remove, it would trigger.
 
Thanks!
 
wat
 
1:54 PM
Hm.. Like a primary key you mean ?
 
yeah something to compare these objects
 
@Billdr No prob, but don't get excited; primitive types aren't supported in typehints, so you can't do function foo(int $bar) { }
 
Ah. I haven't. Probably it is why it wasn't working.
 
.Contains will just call .Equals to test if the collection contains it
 
And there isnt' any reasonable way to box them into userland types (reasonable as far as using auto-unboxing)
 
1:56 PM
And Equals needs a primary key.. I haven't done.
 
You can do function foo(MyInt $bar) { } where MyInt is simply class { public $value; }, perhaps accessor functions to verify the type with is_int(), but there is no way to cast MyInt to int, and no magic function like __toString
 
I'm more worried about my object. Will it bark if someone tries to pass something that isn't my object?
 
@Billdr Yes, it follows normal rules of parameter type variance
 
Hi :) Maybe somebody have an idea and can help me stackoverflow.com/questions/16858676/…
 
@Billdr Come on over to chat.stackoverflow.com/rooms/11/php if you wanna get dirty :)
 
1:57 PM
So weird. I really need to convince my boss to give me an IIS instance.
 
@AndréSilva then you have to override .Equals/.GetHashCode if you want to use contains
unless they are actually the same instances of the objects
but since youre grabbing records from the db, i assume thats not the case
 
So I need to use an Interface for it, right ?
 
nope
 
public override bool Equals(object obj) { }
public override int GetHashCode() { }
 
2:00 PM
@AndréSilva Lync? haha that sucks
 
@KendallFrey Hey slowpoke. It doesn't suck so much. I can ( have to ) get it on my cellphone.
 
@AndréSilva or i think you can pass an equality comparer into .Contains
 
I hate it. We used to use Skype.
 
Enumerable.Contains<TSource> Method (IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)
 
I rather implement the Equals.
So I won't need to do that every time I need to use Equals
@KendallFrey My company is associated with Microsoft since ever. So I guess they won't change from a Microsoft product to another.
 
2:03 PM
Skype is a MS product.
 
Yes I know
 
(We're a MS comany too)
 
You know Deloitte ?
 
nope
 
Well, one of the big four in the world in consulting and auditing
 
2:05 PM
yeah theyre massive
 
So there are too many employees to change from a product that works for them to another product that would work too.
 
lol, there's a Deloitte branch office that is a few blocks from my apartment in downtown Milwaukee.
 
We are everywhere.
 
how much of their development to they send out to brazil?
;)
 
Code development? Nothing.
Deloitte Brazil uses all the softwares we do.
But nothing really tough or anything.
Most changes are because of law changes..
Damn, observablecollection doesn't allow addrange
 
2:15 PM
extension methods to the rescue
 
@AndréSilva creeeeeeeeeeeeeeepy...
 
@ShotgunNinja We are like that The Police music..
Every breath you take.. we'll be watching you.
 
2:37 PM
Woo, got clearance to leave at noon!
 
High five, me too
 
you all hear an ex microsoft executive is trying to create a national pot brand?
 
@Billdr o/
 
he was on CNN yesterday with the ex mexican president talking about it
 
Wewt, let's smoke a cigar over skype while playing dota2! :)
 
2:40 PM
@Billdr That is an excelent idea.
 
I'm going to have lunch with Mrs. Billdr, should be home in ~4 hours.
 
I'll be leaving in 1 hour, so I'll be home in 2 hours
 
I'm home right now.
 
Oh man.. I wish I was home. I really hate using a suit to work, but I feel damn fine.
Type 'VerificaChamadosConsole.TransmissaoCollection`1[[VerificaChamadosConsole.Pendencias, VerificaChamadosConsole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' in Assembly 'VerificaChamadosConsole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
 using (var stream = new MemoryStream())
                {
                    var binary = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                    binary.Serialize(stream, TransmissaoPendencias);
:( Whyy
Stop giving me errors ffs
 
VerificaChamadosConsole.TransmissaoCollection needs the Serializable attribute
 
2:49 PM
Wearing a suit in Brazil sounds like torture.
 
And should my event not have a NonSerialized ?
@Billdr Yep, today is really cold ( 18C )
 
I've been doing too much JS. I just typed Console.log in a C# program.
 
But some days we have 28C + massive amount of body fat = Sweat.
 
Eh, 64 is suit wearing weather.
28c is suicide weather.
 
@Billdr And I'm going to Rio de Janeiro in two weeks because of work...
 
2:51 PM
whats best practice: if I have two if(string.Compare(.....)) statements. and inside both of them I would need the same parameters should I declare variables before the if statements or within the if statements...
 
Get girls to stand on their heads and shake their butts.
2
I hear that's big there, atm.
 
Also, my internet is down. How the hell am I sending this.
 
@KendallFrey i ran into the predicament the other day.
 
@Billdr Yep, but the dance group is banned here now since 4 out of 5 are underage.
 
Yea... I saw the video. I noticed one had braces. I suddenly felt very weird watching it.
 
2:54 PM
1 is 14, other 2 are 15, another is 17 and just one is 18
I think the main one is 15
 
@Billdr @AndréSilva are you guys referring to "daggering"?
 
@Billdr are you back for good?
 
No
 
@N00B.NET Nah, that is nothing..
 
In my heart I never left, Johan.
 
2:54 PM
@AndréSilva I read that as "4 and 5 are underage"
 
@N00B.NET youtube.com/watch?v=veFwT8Y1QNc NSFW
@KendallFrey ._. why ?
 
don't click play on that.
big fat NSFW tag.
 
@AndréSilva I don't know. I don't know.
 
thanks for removing that
 
Unless 14 year old girls shaking their ass is safe for your job, in which case, gross.
 
2:55 PM
i figured haha
 
@Steve Yeah sorry, I thought that it would appear as a link since it was a reply.
 
@Billdr lmao
how do you know they're 14? today half of the 15 year olds look 20,and half of the 20 year olds look 15, we live in a fucked up time
 
@KendallFrey What is the legal age there ?
 
@Billdr My sister is babysitting the neighbour's twins. I'm sure they would be enthralled.
@AndréSilva Legal age for what?
 
I didn't, until I noticed the braces on one of them.
 
2:57 PM
@Steve Because if you go to television, you have to give them your papers.
 
well, shit that makes sense then
 
@KendallFrey Sex, drugs and rock'n'roll derr
 
18 maybe?
There is no legal age for illegal drugs.
 
@KendallFrey You're a minor; I'm pretty sure you should get the neighbor twins to watch it, sit back, and enjoy.
assuming they're +/- two years of your age.
 
Not even close.
 
2:58 PM
@Billdr bow chicka bow wow
 
They just turned 2.
 
a coworker had braces when she was 31...
so @Billdr, could still be 'of legal age'
 
@deltree It is working now, thanks.
 
Well, if you're into that...

...actually, I would judge for that. A lot.
 
2:59 PM
2 is not an acceptable age.
Find older twins.
 
lol.
 

« first day (958 days earlier)      last day (3990 days later) »