« first day (2867 days earlier)      last day (2083 days later) » 
01:00 - 16:0016:00 - 22:00

1:34 AM
hello nerds
 
hello nerd
 
sup.
:P
 
not much, trying to not get kicked out of uni
:)
 
 
1 hour later…
2:40 AM
good on ya keep it up lol
 
mr5
3:16 AM
halo
Does Linq.Distinct operates per element or on the whole list?
 
4:04 AM
 
5:00 AM
Goooood wayTooEarlyMoooorniiing CeeeeShaaaarp! Have you encountered any interesting coding constructs lately?
Also @milleniumbug why would they kick you out of uni?
 
5:45 AM
Hola proxy o/
 
6:02 AM
´GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
 
I have a service that has users that connect to it. I would like to loop through all the connected users, and if they have a message, process the message.
what is hte best way to continuously loop through a collection that is mutable?
 
Good morning.
 
Good morning sharperinos.
 
hi
 
ohayou
is it bad if i continuously decline social events at my company?
 
6:16 AM
Not necessarily. Depends.
 
Define "bad". It will mark you as someone outside the company's social circles. It will have social consequences. Whether these are bad or not depends on what your goals are.
 
i know, but i do not plan to stick here for that long time
and there is not much room for an advancement even if you want to.
and we usually get invite for it 2 days before the event, like now i got an invite for a dinner at friday.
 
Don't worry, there' always people who dont go to social events in a company. We even have a guy...he is like a meme of a programmer. He doesn't really talk. You never hear him greet anyone. He's a bit fat. Not a good posture. Usually looks towards the ground.
I like him.
Also he doesnt attend social events.
Also this is in germany so your social norms may be different.
 
@Squirrelkiller That doesn't necessarily imply that his behavior is smart or beneficial. He might be regularly passed over for promotions, or interesting projects, because of his less than sociable manner.
 
that is true. I guess in the end it depends what you want to do
and how you want to be perceived.
 
6:28 AM
1) The "interesting projects" in our company are very limited. Very.
2) Promotion also is difficult here, since there isn't much fluctuation. Still not sure how that works in other companies tbh. Also he doesn't really look as if he wanted a career change.
Dude's nice being around. No thinking of what to say. No thinking of whether I already greeted him. No pointless talking for the sake of getting your head away from work for a moment.
 
That brings us back to my original point. What are your goals in the company?
 
is there a good pattern for upgrading a particular class
 
That massively depends on context I think
 
like lets say i get a raw string command that i store in a command class
and i want to parse it and upgrade it to a particular command like LoginCommand
 
@cubesnyc Usually you have to grind to get the best gear, then upgrade the relevant skill trees to match the gear you have.
 
6:30 AM
We have really old code that is kinda...dangerous to touch. So many upgrades here are using the onion.pattern. Isn't good, but works without breaking stuff.
 
@Squirrelkiller An Adapter pattern? As in, the first step is to wrap the existing class in a wrapper/adapter, and once that works, replace the inner class to a new implementation?
 
@Avner why not upgrade the skill tree first towards what you're trying ot be, and then aim for gear accordingly?
 
what does that even mean
 
What do you mean replace? Hell no I'm not touching that.
 
@Squirrelkiller Because gear drops are random. Unless you're willing to grind until you have exactly the gear you want (I rarely am), it's best to optimize for what you've got.
 
6:32 AM
Ima extend that shit and add like 5 methods and an interface.
 
Then again, I rarely optimize any characters I play.
In any game.
 
@Avner that's...pretty good advice actually. What does remind me of?
 
@AvnerShahar-Kashtan You don't min/max? What kind of gamer are you... seriously.
 
Yeah I also usually go for "make skills towards what is fun and switch gear by g1.stats>g2.stats?g1:g2;
 
I min/max'ed the shit out of most of my characters. My Dark Souls III char just tanks bosses without issues, hah.
 
6:34 AM
@RoelvanUden In tabletop RPGs I focus on the narrative and character interactions. In video games, I focus on the story and experience, rarely on winning.
I played WoW for a couple of years with a build that caused serious raiders to choke up, laughing. Had fun with it.
 
I find that it greatly depends on the type of game you play. Story-heavy games, yes, I agree.
Combat-heavy games? Optimize the shit.
 
YAWNI. Plan for the present. Some latin phrase.
That's what you reminded me of.
 
@RoelvanUden Define "combat heavy". Mass Effect has a lot of combat, but it lets you dial down the difficulty so that you can have fun with combat without having to be optimized. Smart devs.
In Dark Souls, the difficulty is a central part of the game, so I simply don't play it.
 
eah but then yI don't get all the achievements.
 
*shrug*. Life's too short.
 
6:37 AM
Games that revolve solely about the combat, like DS3, that's where you optimize.
Similarly if you play competitive MMO PVP for exampl
 
I'd rather unlock the "Stopped playing halfway through because the game was nice but not good enough to waste time on" achievement.
Exactly why I don't play those. :)
 
I see. I love a good story-based game, but admittedly, I am totally crazy about dark souls 3 :-P
 
I don't enjoy those aspects of the game, neither the mechanical puzzle of topimization, the fiero of challenge and victory or the agon of PvP domination.
 
Currently playing Bloodborne but man that game hands my ass to me
 
For some reason I only bought games that were well worth the play. Haven't played all of them 100% though. Still gotta finish Human Revolution.
 
6:39 AM
Same as in board games - I much prefer cooperative games over PvP games. Not enough of those.
 
Oh I like PvP domination, if I'm on the dominating side.
 
Although I have to say I really enjoyed Betrayal at House on the Hill
 
Or if I'm on the dominated side but in a position where it's really on me so I have a chance to change it.
In Battlefront (EA), if you have a bad team, you can get dominated and it just sucks. You can be the best of your team, try to fluctuate between fighting and getting goals, but still be dominated because team mate suck.
 
Which mixes coop and PvP nicely.
 
DO you guys know Helldivers?
That's the kind of mix between Coop and PvP I love
 
6:41 AM
@cubesnyc We kind of hijacked the conversation. Not sure exactly what you mean by "upgrade to a LoginCommand". It looks like you want some sort of CommandFactory.
var myCommand = CommandFactory.ParseCommand("login -u root -p rootpass -h 192.168.1.6");
myCommand is LoginCommand; // true;
myCommand.Username == "root"; // true;
 
var myCommand = CommandFactory.GetCommand<ILoginCommand> // Is this a special pattern? I like this for getting things from seperate layers.
 
Well, it's a form of dependency injection, though localized.
 
7:11 AM
posted on August 22, 2018 by Scott Hanselman

This post won't be well organized so lower your expectations first. When Rob Conery first wrote "The Imposters Handbook" I was LOVING IT. It's a fantastic book written for imposters by an imposter. Remember, I'm the original phony. Now he's working on The Imposter's Handbook: Season 2 and I'm helping. The book is currently in Presale and we're releasing PDFs every 2 to 3 weeks. Some of the id

 
@Feeds Interesting post.
I think he touches on a good point there that experience shouldn't necessarily mean that you know everything, it's that you know what parts of what you don't know are knowable, or specifically easily knowable.
 
7:55 AM
good morning
 
in D2 it's hard to tell g1.stats>g2.stats
 
destiny?
They have like, one giant number telling you how good a piece of gear is.
 
8:16 AM
diablo 2
when does IAS better than +skill
etc
 
8:43 AM
@Squirrelkiller Sound a little bit like IV
 
@Squirrelintraining Kinda, but mostly without the possibility to upgrade.
 
Hey Scott is covering Imposter Syndrome again
 
The wise man only knows that he knows nothing.
- Einstein
 
8:59 AM
@Squirrelkiller IV can't be upgraded either FYI
 
I mean you can upgrade other stats in PoGo. Destiny doesnt do that.
 
It would have been nice to have some sort of code analysis tool that would raise some sort of "You appear to have called AddOrUpdateAsync, but there's no call to CommitAsync within the same scope. Are you sure you meant to not actually store your goddamn data, you idiot?"
 
Tried postsharp? No idea how much it does, I just heard of it.
 
Nah, postsharp is for runtime stuff. I need a static code analyzer here. Shouldn't actually be too hard to write one with heuristics for this.
If I were so inclined.
Which I am not.
At least not today.
 
mr5
9:27 AM
New update for Visual Studio for Mac breaks the syntax highlighting. Gawd, it's awful to work like this
 
awesome
 
anyone wants serious fun ?
0
Q: Deserlize, Copy and Merge Orders from XML to C#

MathematicsHere's the code, Self explanatory but here's the follow, Load XML file Desearlize to list in c# Map xml object to c# list Merge orders but increment order's product count public Order[] Load(string path) { var element = XElement.Load(path); var orders = new List<XElement>(); ...

 
@Mathematics Is there a question in there?
 
9:45 AM
@RoelvanUden Looking for code review :)
 
I feel like writing "Self explanatory" is usually not a good idea, since it never actually is.
 
return i > 0 ? i << 2 : ~(i << 2) + 1;
I consider this self explanatoory
 
what's that? Some 2's complement?
 
Does this doc contain any error codes, that should not be returned to client? docs.aws.amazon.com/cognito-user-identity-pools/latest/…
 
@ntohl return Math.Abs(i * 4);
duh
 
10:09 AM
Obvio
 
mr5
Every time I read Convert.ToInt32, it always reminds me of VB days
use int.Parse ffs
 
Int32.Parse()
 
@Squirrelkiller removing it now
 
I often write self explanatory code though
public void BeLazy()
{
	DoNothing();
}
or this maybe?
fun with(some: Person): Child?
protected fun with(some: Person)
private private: Private = Private.private
 
@mr5 They're not equivalent.
int.Parse() specifically does string parsing.
 
10:25 AM
oh yes, that is how you are supposed to implement an interface
"oh hey, I can convert to a boolean! ... CRASH ERROR BREAK DESTROY BASE"
 
Yeah, the IConvertible interface is... weird.
 
I find the IQueue weirder
 
Why not route the not implemented IConvertible convert to Convert.ToXXX?
 
im not sure if you are being sarcastic or not
 
Honest question
 
10:30 AM
this is what Convert.ToXXX redirects to
so, doing the redirect back will be an infinite loop
then I prefer a not implemented exception
 
Oh, I thought that's an IConvertible implementatino in your code
 
no, that is DateTime
I would never implement an interface like that
I would fart in Microsoft's general direction instead
 
strange no comments on question yet lol
 
it isnt even a question
its just a story
and it doesnt even have a happy ending
 
@Wietlol what's the story behind your lion or lioness in profile picture don't have or have white eyes :P
 
10:39 AM
that is just the colour that makes it look cool... I think
/afk lunch
 
10:49 AM
hello squir
 
Hi c0d
 
im that dependent
 
can I do groupby using multiple column and then add them together
 
i shortened coz theres no intellisense
 
<orders>
<order date='2000-04-20' Id='1' categoryId='100' productCount='3' />
<order date='2000-04-20' Id='1' categoryId='100' productCount='6' />
</orders>

output will be,
<order date='2000-04-20' Id='1' categoryId='100' productCount='9' />
 
10:54 AM
Actually with @ there is AutoComplete, @c0dem0nkey
 
var order =
    from c in orders
    group c by new
    {
        c.date,
        c.categoryId,
        c.Id,
    } into gcs
    select new Order()
    {
        date = gcs.Key.School,
        categoryId = gcs.Key.Friend,
        Id = gcs.Key.FavoriteColor,
        productCount = what will go here ????,
    };
 
wtf
hahahahaha
 
@Mathematics What type is gcs?
I'm ignoring for the second that you're grouping by date, categoryId and Id and then projecting using a combined key that has School, Friend and FavoriteColor.
 
LPT: Don't use var unless you're absolutely sure what's going on and everything works.
 
@Squirrelkiller Won't help here, because gcs exists only inside the query.
 
11:03 AM
@AvnerShahar-Kashtan please do. I forgot to change the code
let me change it properly
but agenda is to group by 3 columns, and then add the forth as a sum
 
Yes, I understood what you're trying to do. I was pointing you at the answer. What type is gcs?
 
11:19 AM
var is fine if the type can be inferred properly.
Otherwise though yeah you're probably inn for a bad time
 
@AvnerShahar-Kashtan Tuple should be fine though right?
 
@Wietlol For what?
 
as Key
I suppose the anonymous type uses reference equality
while a Tuple would have attribute equality
which is a key component of the grouping by
 
I believe anonymous types use structure equality as well. It's perfectly fine for a group key.
The point isn't about the key, but about what actual type gcs is. It's not they key, otherwise it wouldn't be in a property named Key.
 
oh, ok
 
11:43 AM
@AvnerShahar-Kashtan would you think this is duplicated code?
or rather said, duplication of effort
I feel horrible because it looks like the same code
its basically the same instructions but then slightly different
 
What are the differences?
 
LeftQueue <-> RightQueue
Item1 <-> Item2
both use both of both, but they swapped them
 
Why not move most of it into some other method and call that from both of them, and pass the queue as a param
 
Maybe you can merge them, passing in a function as a parameter.
 
I'm not sure about the item selector but there should be something similar for that
 
11:55 AM
i would have to pass both queues and two Func<Tuple<T1, T2>, R1> functions
 
private static IEnumerable<S> SplitData<S, O>(
	IEnumerator<Tuple<T1, T2>> sourceEnumerator,
	Queue<S> thisQueue,
	Queue<O> otherQueue,
	Func<Tuple<T1, T2>, S> thisValueGetter,
	Func<Tuple<T1, T2>, O> otherValueGetter)
like that
like... understandable
 
It doesn't look nice, but at least it wouldn't be duplicated?
 
i suppose
 
12:19 PM
o/
am I the only one having a problem while connecting to github?
 
its fine for me
 
Oh thanks for confirming @BugFinder it's weird I'm having trouble connecting now haha
 
12:38 PM
still fast as ever for me
 
Looks good to me too
 
12:54 PM
I guess there's problem with my current network
 
roadworks somewhere in the middle most likley
 
Yeah probably haha
 
1:26 PM
@mark333...333...333 did you try a tracert on the site?
 
1:36 PM
I'm trying to figure out if storing user data in the cache in MVC is a good idea. Regular user data I'm storing in the session, but in addition there are big blocks of data associated with the user that I don't want to always be hitting the database for. Is the cache better for that or is there a different solution?
 
@Wietlol why does enumerating something modify the underlying collection?
 
what?
 
@Hypersapien There are only two hard things in Computer Science: cache invalidation and naming things.

-- Phil Karlton
 
it doesnt... I think
 
What does Enumerating do?? lol
 
1:41 PM
You are modifying some IEnumerator while enumerating an IEnumerable, this means if someone calls foreach(var x in foo.LeftStream) {} then the IEnumerator will have reached the end and subsequent calls to foreach(var x in foo.LeftStream) {} will likely enumerate nothing
 
@Hypersapien how much data is there to store?
 
@M.Aroosi that is kind of the idea though...
 
So those should be IEnumerators
 
Usually I store say shopping cart data in a table until the user checks out then I delete it, it's not something I would store in cache
 
0.o?
 
1:43 PM
IEnumerable implies you can get plenty of IEnumerators
IEnumerable<T1> LeftStream -> IEnumerator<T1> LeftStream
 
Multiple List<int> of maybe 10000 each. Unknown how many Lists. Maybe I should just hit the database.
 
Do not Cache it until performance is unacceptable.
 
Ienum means it supports a simple iteration over a collection of a specified type
@Teomanshipahi I like that scenario
don't fix it till it's broke
 
IEnumerator and IEnumerable are different interfaces, tho IEnumerator.MoveNext should throw if the underlying collection is modified.
 
@M.Aroosi but IEnumerator<T> doesnt have methods like Select or Where
 
1:45 PM
IEnumerable<T> doesn't either. those are extension methods
 
@M.Aroosi if you are trying to change a collection while in a ForEach loop on the collection you're using in the ForEach it will error
ForEach is a Forward only ReadOnly process, any changes to that collection will error the loop
 
@juanvan that's dependent on the implementation of the IEnumerable/IEnumerator
 
What he is trying to do / understand?
 
No that's how ForEach works has nothing to do with the collection
 
I'm creating a site to show aggregate graphs of person data. There is a set of filters that the user can use to look at different cross sections of the data. One of the filters is to select a list of people in the database that the user already prepared.
 
1:46 PM
but IEnumerator<T> doesnt have those extension methods
 
@juanvan no, the compiler can't detect whether a method will modify the collection
 
at runtime it errors
it's not a compiler warning
 
that's because of the implementation of MoveNext/Current for the specific IEnumerator
I can easily give you an implementation that doesn't throw
 
I'd run that :)
 
: 'Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context.'
I am getting this exception in EF 6
var AllPosts = new inlinxEntities();
var lst = AllPosts.Images;
What am I doing wrong here?
 
1:50 PM
inlinxEntities what is the object look like in the Context class
 
@M.Aroosi im not sure how the implementation would be if I would allow it to make new ones each time
 
public partial class inlinxEntities : DbContext
{
public inlinxEntities()
: base("name=inlinxEntities")
{
}

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
throw new UnintentionalCodeFirstException();
}

public virtual DbSet<sysdiagram> sysdiagrams { get; set; }
public virtual DbSet<Text> Texts { get; set; }
public virtual DbSet<User> Users { get; set; }
public virtual DbSet<Comment> Comments { get; set; }
public virtual DbSet<Interaction> Interactions { get; set; }
public virtual DbSet<Paragraph> Paragraphs { get; set; }
 
this the line that's errors?
var lst = AllPosts.Images.ToList();
 
change it to that
 
1:52 PM
The same..
 
@AmirNo-Family has any of your models got a property of type System.Object?
 
I don't think so no
 
This a DB first EF?
What if you do .FirstOrDefault()
using (var context = new inlinxEntities())
{
    var lst = context.Images.ToList();
}
or try that
 
It throws the same Exception on FirstOrDefault
 
@M.Aroosi how would a lazy loading unzip method look like?
 
1:56 PM
Do a search in the whole project for Object
 
@AmirNo-Family can you show the Image class?
 
public partial class Image
{
public int Id { get; set; }
public Nullable<int> PostId { get; set; }
public string Url { get; set; }
}
 
@Wietlol what does unzip do?
 
the opposite of zip?
 
fly
 
1:57 PM
searching for my ascii art collection operations
 
allposts.Images.Where(x => x != null).ToList(); worked fine
 
enjoy, and never ever do that
 
seems like I have a null entry
 
@Wietlol so, [(a,b)] -> ([a], [b])?
 
2:00 PM
wait
 
@M.Aroosi thank you :)
 
Does anyone use ref returns?
 
probably, I don't know
I know I don't
well, at least I didn't need to up to this point in time
 
input1: [ a , b , c , d , e ]
input2: [ 1 , 2 , 3 ]

input1: [ a   , b   , c   , d , e ]
input2: [ | 1 , | 2 , | 3 ]
          | |   | |   | |
output: [(a,1),(b,2),(c,3)]
this is zip
it takes 2 collections and outputs a collection of tuples
 
yes
 
2:06 PM
possibly taking in a function that merges them
 
hence ([a], [b]) -> [(a,b)]
 
unzip would take a collection of tuples and outputs a tuple of collections
 
flipping that [(a, b)] -> ([a], [b])
 
but I want a lazily loaded one
 
so make it load lazily
 
2:07 PM
i did
 
good
 
Nice to know, I never used zipping
 
but then you can only consume the output once
as you mentioned
 
not really
 
if I do unzip -> take output 2 to list -> take output 2 to list then the second list is empty
 
2:08 PM
Hi @J.Doe
 
(not that you really want to do that anyway)
 
Still not banned I see
 
Did you ever have to sneeze while farting? Serious shock moment right there.
 
+1
Now that feeling killerino
 
@M.Aroosi the approach I used was to set up two queues
consuming data on the left side would poll from the left queue
 
2:17 PM
@Squirrelintraining Yo?
 
if the queue was empty, it would consume data from the source enumerator
and add the right value to the right queue
this way, the source is only consumed once for both outputs
but the outputs can only be used once because the queue would be emptied
 
I'd make those into lists instead
 
(I have to add the disposing stuff to it so that once the left stream is consumed, nothing would be added to the left queue any more)
into lists and make them eagerly load it?
or make the queues to a list?
 
no, add to the lists on demand
but keep the lists for when someone enumerates again
 
i dont think that is reasonable though
 
2:20 PM
why not?
 
I dont see why someone would load data from the unzip result twice
 
it won't load it twice
 
but I dont see why someone would go unzipResult.Item2 twice
making it pointless to have it fill up two lists
 
Why not?
 
why would someone?
 
2:22 PM
what if you pass it along to another function that tries to GetEnumerator on it twice?
or to two functions, each tries to GetEnumerator on it
each of those should see the entire collection
 
@J.Doe 'sup
 
@M.Aroosi im not sure how to do that though, changing list while enumerating is really not nice
 
The lists aren't the underlying collection, so that's fine.
(you can't use foreach on the lists here tho)
 
0.o?
 
the underlying collection comes from the input IEnumerable<(A,B)>
 
2:33 PM
but I cant lazily add to the result lists while they are being consumed
 
why not?
if you don't consume them with foreach then there's no problem
 
but everything uses foreach
 
for example, .Where uses foreach
 
I mean, if you don't consume the lists with foreach
 
2:38 PM
then im clueless on how you would approach it
 
here's a basic example I just whipped up which is probably not the best paste.ofcode.org/didDtFvyPs7THpfqVrfcZJ
 
With an open mind, that's what the priest said...@Wietlol
 
(note, that is definitely not threadsafe)
(also you should probably call Dispose on enumerator if MoveNext throws, then throw the exception)
 
@Squirrelkiller Normalin, normalin
 
@M.Aroosi yours also doesnt allow you to enumerate the result multiple times
 
2:42 PM
WHat's a normalin
 
@Wietlol it does
 
public static void Main(string[] args)
{
	var chars = new List<String> { "A", "B", "C", "D", "E" };
	var nums = new List<Int32> { 1, 2, 3, 4, 5 };

	var (newChars, newNums) = chars
		.Zip(nums, (s, i) => (s, i))
		.Unzip();

	PrintList(chars); // list: A B C D E
	PrintList(newChars); // list: A B C D E
	PrintList(newChars); // list:
}

private static void PrintList(IEnumerable<Object> objects)
{
	Console.WriteLine("list:" + objects.Aggregate("", (s, o) => s + " " + o));
}
 
you should use string.Join btw
 
whatever
 
right, mistake I made
 
2:46 PM
the result is the same
 
i see
@M.Aroosi I dont get this, doesnt this call enumerator.MoveNext() and enumerator.Dispose() on the source data enumerator each time you enumerate the result lists?
 
hm... probably
 
hmm, looks like it does
 
3:01 PM
as I said, not the best implementation
 
i thought that would throw an exception
most things do when you try to operate on them after being disposed of
 
pretty sure the Dispose for List<T> enumerators is a noop
still should probably do something about it
 
> pretty sure the Dispose for List<T> enumerators is a noop
facepalm
 
will probably do something bad if you use it with, say the enumerator from File.ReadLines
 
nah, that will work just fine
i primisi
 
3:08 PM
  List<Order> orderLines = XElement.Load(path).Elements().Select(o => new Order
             {
                Id = int.Parse(o.Attribute("Id"),
                CID = int.Parse(o.Attribute("cID"),
                DateTime = o.Attribute("datetime").ToString(),
                Count = int.Parse(o.Attribute("count"))
             }).ToList();
am I doing anything wrong here ?
says CID doesn't exists, even though it's a property of POCO...
if I move CID to top then it says Id doesn't exists which it was fine with when it was on top
 
missing parens
 
new Order() { ....} like this ?
ahhhh
1 min
found it
 
> int.Parse(o.Attribute("Id") )
 
thanks
 
3:49 PM
wietlol could you take minute to help me with a design question
 
GOD I HATE LOTUS SCRIPT
 
I am designing a service that people will log into and communication with via websockets. My service class has a server class that triggers a ClientConnected event whenever a someone connects. The client starts reading for messages on connect, and storing them in a queue. I also wrap the client in a ServiceUser class to define functionality.
How would you consume the messages that accumulate in the ServiceUser/wrapped client class? Would you do it through the Service class? Or from within the user class then having to pass in a reference to the service class?
 
01:00 - 16:0016:00 - 22:00

« first day (2867 days earlier)      last day (2083 days later) »