« first day (3263 days earlier)      last day (1679 days later) » 

7:51 AM
Jesus christ users are fucking stupid
"I got this message which came up when I tried to do something which says I must be logged in, what do"
"Log in."
"But I've never had to do that" blah blah giving me shit
"Just log in."
works
 
8:16 AM
lol
 
 
4 hours later…
12:32 PM
hi folks, what is the lambda equivalent for anonymous empty delegate?
 
@AvnerShahar-Kashtan
Thank you!
 
mr5
Beat me in milliseconds
 
But it does not compile:

Action<int, string> f = () => { };
The following works:

Action<int, string> f = delegate { };
@AvnerShahar-Kashtan
 
That's because it's not an empty delegate. It's an Action<Int,String>. So you would need (i,s) => {}
 
12:41 PM
But the delagate {} does not need such a restriction.
OK. Thank you!

Action<int, string> f = (_,__) => { };
 
You can do that but it's a bit uglier than (i,s), IMO.
> When you use the delegate operator, you might omit the parameter list. [..] That's the only functionality of anonymous methods that is not supported by lambda expressions.
 
@AvnerShahar-Kashtan: Thank you!
 
Right not answering questions here is all the .NET I'm doing, so it's a nice interlude. :)
 
mr5
@AvnerShahar-Kashtan is creating a NES Emulator the same as creating virtual machine (e.g., VirtualBox)?
 
Hi friends
 
12:56 PM
@mr5 Thanks for the input, I didnt put the piece in a single image.

Instead I manually made the piece by dragging the coloured block textures into my hierarchy, and setting the dimensions accordingly.

Then i compiled that little 'piece' into a Prefab in unity
And now I have a "semi" working Tetris
I just have to resize everything a bit, as I think I may have accidentally set the textures too small, and I have little gaps between my pieces when they land :3
 
How i can find jobs in canada?
 
so i changed my texture block into seperated images (Sorta like how minecraft does it) and applied them to prefabs, then summoned the prefabs using a Spawner class :3
 
mr5
@TaylorSpark oh I didn't know you were creating that in Unity
 
Yeah, I got bored of spending 12 hours on winforms
winforms is hard to get any progress
making a game on there is a pain in the arse compared to unity. Plus unity is a gaming standard, and Winforms is getting old.
in the past month, Ive been really only using winforms for my exploits and converters
not for any "games" anymore
 
mr5
Now make your tetris abide the Physics law. It wouldn't take you much time to implement in Unity
 
1:01 PM
Thanks for telling me early on, as i feel like Surface Detection on an image wouldve been much harder
It does, it falls correctly, it just has gaps when it lands because I made the textures too many pixels small :3
as you can see here:
Plus I rendered on a 1x1 scale in my Field
but in reality its more like 1.25x1.25
so everythings looking trash rn
 
mr5
Check this out FPS in console
@TaylorSpark nice. You work faster than me
 
Woah
thats a cool 3D engine
Ascii based, reminds me of Doom
2D but 3D
Ya know, I think I might just start from scratch with this "Tetris" thing, make a new Unity project, as I think I just screwed stuff up from the start lol
I need to draw the textures in the right size this time
and actually place my field in the update function correctly XD
 
mr5
Yeah don't put any padding
 
1:18 PM
@mr5 Umm, maybe?
@mr5 I mean, I think the NES was a relatively simple environment, but there's still a whole CPU and GPU to emulate, even if they're relatively primitive ones.
 
@mr5 if I did it in 3D, would it be relatively similar?
in terms of writing the script for it?
ive never written in the 3D environment
 
Wait you were trying to write a game in Winforms?
 
yup
sounds dumb doesnt it
but I was determined.. er... for 10 minutes...
 
I think literally everyone in here would have told you that would be a bad time
 
1:20 PM
Yeah, i realized my mistake quite soon
I noticed that it would be physically difficult to make in winforms
and I dont know how to write Arrays, so yeah that was going nowhere
 
@CaptainObvious I remember a game I played, oh, probably 25 years ago. Early Windows programming. Using Windows (3.11) UI elements for the game. I imagine that's what a Winforms game will look like.
 
Yeah but that was probably fine at that low res
Winforms repaints are slow at higher resolutions
 
yeah im rewriting my tetris again
3rd times a charm. atleast on the 2nd time, it was working
just wasnt perfect to the degree i wanted
 
I know that because I had an application (not a game) which was in use in the warehouse which was a legitimate seziure risk for people with epillepsy because when data would refresh it would repaint the background image across like 4 layers of controls
 
eecks
 
1:24 PM
Even with the double buffering trick?
 
Whta double buffering trick?
It's been a while so I can't remember
 
There was a Winforms trick I vaguely remember, where you would freeze screen refreshes, update all controls, then rerender.
Googling finds this, but my memory is completely gone (drugs, monks, etc): docs.microsoft.com/en-us/dotnet/framework/winforms/advanced/…
 
From docs: Standard Windows Forms controls are double buffered by default.
Looks like it was being used
 
I think it wasn't on by default originally, but at some point someone went "well, mostly people need it so it might as well be always on"
 
!!shrug
 
1:27 PM
¯\_(ツ)_/¯
 
Yeah, it seems the DoubleBuffered property was added in .NET 2.0: arstechnica.com/civis/viewtopic.php?f=20&t=385430
 
Yeah but by app was 4.something
So it was probably on
 
mr5
@AvnerShahar-Kashtan I think I already have an idea how to make one if that's the case :D
 
@mr5 Well, you can take the code in that project that already emulates the NES's CPU.
 
also rewriting all my textures
16x16 instead of 10x10 so it fits the canvas this time
how does it look?
 
mr5
1:33 PM
Yep
 
What I am interested in though at the moment (although I haven't had a chance to play with it yet) is the C# PSX Emulator
 
I personally like these better than my previous ones, gives me more of a "gem" texture similar to minecraft's emerald blocks
 
@TaylorSpark Looks like a square with some sort of pattern
 
I just go in and out between 3 brightness variants
 
mr5
After knowing how to emulate the CPU and RAM, I'm kinda wondering how the hell did they make virtual machines, like virtual box very fast
 
1:34 PM
add a .5 decrease through the middle
1 decrease on the bottom right
gives it shade
 
@mr5 Optimising. And then optimising again. And a bit more
And of course relying on tech like vt-x
 
@mr5 I think a large part of the process is finding out places you can forward the instructions to the physical CPU instead of emulating every single thing. In many cases you're emulating AMD64 on top of AMD64.
And also, as @CaptainObvious states, more and more hardware support for common virtualization requirements.
 
Unless you're emulating another platform, in which case you can't really use virtualisation technologies
 
PSX emulator sounds cool
Though I hate controller emus on PC
 
Hence why most game console emulators are slow as dick (on anywhere near comparable hardware anyway) except for platforms like the original Xbox
 
1:38 PM
since I can never get controllers working correctly, even with drivers and programs
ruins the fun of emulators
 
@TaylorSpark It's open source, add contorlle rsupport yourself
 
1
A: Full emulation vs. full virtualization

Peter CordesWithout either emulation or virtualization, code runs directly on the hardware. Its instructions are executed natively by the CPU, and its I/O accesses directly access the hardware. Virtualization is when the guest code runs natively at least some of the time, and only traps to host code runn...

 
I mean, these days we can emulate x86 in fucking Javascript. Not amazingly, but we can do it
 
mr5
but how do you tell to the CPU that you will use virtualization?
 
I think that's a bit low level for us in the C# room
 
1:49 PM
@mr5 I assume that's up to knowing the VT-X instructions and using them.
 
mr5
2:23 PM
@CaptainObvious holy
 
2:59 PM
@CaptainObvious Worth noting that copy is one of the smartest people I know
(He used to be a regular here in chat)
 
hey guys I'm getting a predefined type system.object is not defined has anyone come across this before? I'm using .net core on mac.
 
3:20 PM
not a troll
system.object may be a windows only predefined class
 
Shouldn't that be System.Object?
 
mr5
.NET written in JS
 
3:41 PM
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Begin...");
        IServiceCollection sc = new ServiceCollection()
            .AddLogging();

        IServiceProvider isp = sc.BuildServiceProvider();

        ILoggerFactory ilf = isp.GetService<ILoggerFactory>();
        ilf.AddConsole(LogLevel.Debug);

        ILogger logger = ilf.CreateLogger<Program>();
I don't understand why my code above does not produce the expected output.
Only the following printed:

Begin...
End...
There is no

Testing...
 
Why does this method look odd
public static void WaitForElements(IWebDriver selenium, List<By> selectors)
{
    while (true)
    {
        if (selectors.Where(x => !ElementExists(selenium,x)).Count() == 0)
        {
            break;
        }

        Thread.Sleep(1000);
    }
}
 
because it is C#?
 
mr5
because it's a hack that's why it looks odd
 
any recommendations on better ways to do it are welcome.
 
How about my code?
 
3:47 PM
I think I could also wait less than 1000ms, maybe 50ms
 
mr5
new rank season!!
 
Wait what
Ew
 
mr5
lol
don't use hack mi friend
 
That code is baaaad
 
mr5
having an artificial delay is a hack
 
3:47 PM
It's better than Thread.Sleep(5000);
 
My code is very good but it does not print "testing..."
 
I honestly have no idea on how to improve it, can someone suggest an idea?
 
mr5
5
A: How to get a Console output in ASP.NET Core with IIS Express

Dawid RutkowskiYes, it's possible with IIS Express. Use Microsoft.Extensions.Logging.Debug nuget package: https://github.com/aspnet/Logging/tree/master/src/Microsoft.Extensions.Logging.Debug. Configure logger in the Startup.cs: loggerFactory.MinimumLevel = LogLevel.Debug; loggerFactory.AddDebug( LogLevel.Debug...

 
@notatroll dont use Count(), try using None()
 
mr5
@notatroll why do you need to wait for elements to be gone?
 
3:48 PM
dont use break, make good use of the while thingy
 
I need to wait for them to appear, so I can use them.
 
mr5
you can listen to the event the removes those element instead
 
you could try using Task.Delay() instead of Thread.Sleep
@mr5 can you?
 
I didn't know that.
 
My code below is a console application.

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using System;

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Begin...");
IServiceCollection sc = new ServiceCollection()
.AddLogging();

IServiceProvider isp = sc.BuildServiceProvider();

ILoggerFactory ilf = isp.GetService<ILoggerFactory>();
ilf.AddConsole(LogLevel.Debug);

ILogger logger = ilf.CreateLogger<Program>();
 
mr5
3:49 PM
why you support him having artificial delays wiet?
 
I'm a junior developer I know no better, any recommendations are welcome. I don't think you can hook onto dom events like that.
You can have implicit waits but that's near the same as what I'm doing here.
 
Maybe if you're junior messing with a complex framework like selenium might not be such a great idea
@WellHarassedProgrammer Please don't repost the same thing
I'm not sure what you're trying to achieve, but if you're trying to log to multiple places look at SeriLog. You can record logs and they will save to various "sinks", which can include the console, log files, databases, and all sorts
For example, try adding Serilog and Serilog.Sinks.Console from nuget.
Then you can simply call Log.Information("hey look ma, it's a log entry") and it will spit out into your console.
 
@CaptainObvious that is terrible advice, how does one learn without practicing with large frameworks.
 
Dude I'm trying to be helpful. Don't try and take on some mega project at once. You'll wreck your head and it'll make you think "software development is really hard"
Start simpler and work upwards.
 
I understand, but sometimes a junior needs that introduction and push. I do see your logic though.
 
4:04 PM
@CaptainObvious: am i trying the built in logging of .net core.
I am
not interested in serilog for this moment.
 
I tried using netcore's built in logging but I wasn't particularly happy with it. Although Serilog might be a bit overkill, it's certainly capable and simple enough to use.
 
@WellHarassedProgrammer looks like that answers the question
 
No. It still does not work.
 
It does what it's supposed to do
 
4:13 PM
I don';t understand.
 
Your program exits before the console logger can write. That's expected and how the framework works. If you don't like the behaviour, the solution is don't do that
 
I solved by changing LogDebug to LogCritical even without ReadKey as explained in the given link above.
 
@WellHarassedProgrammer where does it mention LogCritical?
That makes sense I suppose though
 
I compared my code with the OP's code.
 
If an issue is critical you really, really don't want to wait for a background thread to catch up and definitely log the event no matter what
 
4:25 PM
He used LogCritical.
If I use LogDebug, no ouput will be produced even with Console.Readkey.
 
4:39 PM
Only LogDebug behaves strangely. Others work.
 
Quick help please, is 30" display too big for the eye. We are buying new display, and it so huge, I didn't use something big like it before
 
Make it vertical
You need two more monitors and arrange them side-by-side. Left for watching youtube for example, center for coding, and right for reading documentation.
 
I don't think this is what you expected
 
Arrange like above
I am leaving. Thank you all!
 
wow how many devices do you have?
 
4:52 PM
But vertical is not optimal for coding, may be it's useful in other cases
 
By the way, they are not mine. I just picked up a random picture from the internet. I am very poor.
 
haha okay. i just joined and didn't follow the conversation :)
 
hold on
 
i have 2 monitors, it's perfect for development
 
4:54 PM
especially web development
 
gunna kms
Tetris isnt easy to make
I finally created the border and got the ground Solid and everything is working
but for some reason, sometimes, my blocks will have gaps in between them
I dont know why ;-;
 
1 screen for spotify, haha
 
btw, that was @CaptainObvious (Lee Butler)'s old layout
 
Tetris is NOT supposed to do that
Its stacking on air
 
4:57 PM
everyone what he prefers. i couldnt work with so many screens and such an arrangement
 
I have all the measurements perfect
textures are perfect 32x32
Im clueless
 
did you make a collision grid of 32x32 pixels?
 
I was relatively following this tutorial: noobtuts.com/unity/2d-tetris-game
yes, its a C# grid
it creates a grid in the script, and it acts like a gameObject
The only real thing I changed from that tutorial, was the textures
other than that, its a perfect step by step imagining of that tutorial, as far as I saw.
 
but is your grid like... 10x16 ? or 320x496?
 
10x20
 
4:59 PM
@Wietlol How many vga cards?
 
its not all fitting in the camera atm
You summon the pieces using a floating gameObject called Spawner that has the Spawner.cs script tied to it
 
then I think your collision detection is wrong
 
it then randomly chooses a prefab and adds it to the screen
Im just following a tutorial wiet
If you want, I can send you the scripts I made based off that tutorial
 
considering that your result is different than the tutorial "I am following a tutorial" is not entirely correct
 
I syntaxed them as best as i could
 
5:01 PM
or the tutorial sucks
but I doubt that
 
Maybe, but tis one of the few working ones I could find
 
I dont do unity tho, so sending me the scripts is probably not going to help
 
the scripts are mostly just equations and Vectors
I WOULD download the source and see what he wrote (the creator of the tut) but its one of those monetization sites that tell you need to buy premium or you cant download/view anything
I cant even compare scripts
So much for a "tutorial" that website was :L
3rd time remaking the game, still no success
sadness
Ah oh well I guess Ill stay up all night for 12 hours again following a different tutorial. I would love to see what all these vector scripts do, but the tutorial makers dont really explain things, And they rarely put any "troublshooting" information if a script has an error
 
5:39 PM
Is there an abstract interface around Queue in C#?
something similar to IList or IDictionary.
 
5:50 PM
nope, there isnt, because the silly devs didnt think interfaces were necessary
I always say interfaces are always necessary... even for model classes
you just dont always immediately see the use case
 
I guess there is IEnumerable, ICollection and all of them, I just needed it to bind to a dependency injection singleton.
I have to cast it to Queue<T> then which kind of sucks but still.
 
6:06 PM
why do you need it to be injected?
 
6:33 PM
dependency injection, I use a di framework and it accepts abstract and concrete to the AddSingleton method. It does support just concrete but Id prefer to follow consistency.
 
stupid question: in asp.net mvc - when there is a request, will the second request be enqueued and executed after the first request, or are the requests handeled parallel?
 
6:54 PM
@notatroll but the question was "why"
 
I just prefer to code to an interface. It's cleaner, less coupled and just feels more flexible, it feels more guarded also how you have to explicitly declare in the interface to show concrete members.
I've also been told its good practice by my senior developers.
 
Well I SORTA finished my tetris project
what should I try making next
with unity
 
You're using Unity? pretty cool
Wish I had the time to learn it myself.
 
7:11 PM
Im an amateur
trust me dude, i know barely anything**
6
 
7:45 PM
what are the best practices for modeling inheritance in sql?
like if i have a class called game, that has a score, but the exact model of score depends on the type of game
 

« first day (3263 days earlier)      last day (1679 days later) »