« first day (2446 days earlier)      last day (2728 days later) » 

00:34
@MadaraUchiha Lol
01:19
Could someone help me out?
 
4 hours later…
04:56
Hello Guys, I have been stucked in one situation picking up right modal. I have a requirement for connecting pinpad to the server and server will respond to the requests and give the proper response to the devices. The pinpad is connecting using TCP modal. I need to make an app in .net which takes care of client request and send appropriate response to the request.

I want to ask you that is TCP Client<->Server model is right approach to do that? Expecting huge amount of requests from the different pinpads.
05:32
is there something wrong with the method Akrem is describing ?
1
Q: Autofill textboxes from database based on one textbox value

Shajee AfzalI have a simple form in which there are 3 textboxes as seen in image below : using autocompelete function on textchanged event, I am displaying data from database in textbox1(Person Name). Now if your user selects a particular name from suggested items, I want to auto fill textbox2 and textbox3...

05:56
posted on June 25, 2017 by Scott Hanselman

There's a ton of cool new .NET Core open source projects lately, and I've very much enjoyed exploring this rapidly growing space. Today at lunch I was checking out a project called "Brighter." It's actually been around in the .NET space for many years and is in the process of moving to .NET Core for greater portability and performance. Brighter is a ".NET Command Dispatcher, with Command Proc

06:09
Who's been kicked tonight?
06:30
how can i have an autocomplete in multiple textboxes based on the value inserted in one textbox?
@AvnerShahar-Kashtan not me for once.
06:57
ohayou
mr5
mr5
07:11
\o.
While analyzing breakpoints in VS, I have noticed some variable are null and it is about to be executed. I was anticipating it to jump from another exception block after that invocation but turns out it did not. This might be because the debugger was not aware of the variables on an async method. Is this true?
@mr5 Can you show code so I can see wxactly what is going on? I'm not sure if I understand what you mean
@mr5 a variable & async method?
mr5
mr5
@misha130 a variable inside of an async method
a variable in a class as a result of an async method?
show some code :^)
mr5
mr5
@KamilSolecki the code is quite messed up. can I show you just the screenshot instead while it is on breakpoint?
07:18
good morning
@mr5 that would be best
o7
mr5
mr5
@KamilSolecki
The ex is null but it has been invoked without causing any exception?
it isn't my code before you cringe =P
Hey everyone. Good day. I have a question related to printing in WPF C# application
@sohaiby Printing? Is this the 20th century? Are we savages?!
@AvnerShahar-Kashtan I want to control HP LaserJet CP1025nw color printer in my WPF application
Control means sending print jobs, checking printer status, paper availability, ink levels etc
07:27
@mr5 not sure if this is related but why is your null in parenthesis?
mr5
mr5
@misha130 it's the IDE indicating the value of the variable, which is null at this point
yes but why ()
HP developer program provides multiple SDKs/APIs https://developers.hp.com/technologies
But I don't know which is the one for me and whether my goal is even achievable or not
and not just null
do you have a plugin or something?
mr5
mr5
@misha130 is this not the usual way to present null values in VS?
I'm not sure if it has any plugin that affects the presentation of it
07:30
could someone would have written "throw null"?
mr5
mr5
@sohaiby what have you done so far?
I think it is really a null value, no type. but somehow, the debugger was unable to access it so it just say it's null
because the following lines have been executed. it should throw an NPE in this case.
@sohaiby well, what is the question
@mr5 im looking at it now
@mr5 I am able to print using wither Twain library or by using .Net printing library. But that just adds a print job in the queue. I want to control the printer in my application, check its status, get responses if print job is done etc
@KamilSolecki I want to control the printer in my application, check its status, get responses if print job is done etc
I just want to know is it possible with HP LaserJet CP1025nw printer to control it in .NET application (using some SDK or API) in a manner that I described above.
mr5
mr5
@sohaiby if you have the API with the docs, I think you're good to go already
so it's just a matter of searching for the specific task in the docs and implement it.
https://developers.hp.com/technologies
This is the HP developer site with SDKs/APIs , but it's confusing and I'm not sure where to start. I contacted HP team and they are saying that it involves registration process which also involves a business review and signing of legal contracts. I think they are not getting the point because how come they need such thing for only getting the SDK
07:41
@sohaiby well I suggest you start with googling "printing with c#"
@mr5 in the docs of this printer, there's no mention of SDKs
isnt twain a universal api for these printers?
@sohaiby this sounds like its non printer specific.
especially old printers
@KamilSolecki How can you completely get hold of some specific printer in C#.NET (in my case HP LaserJet CP1025nw)? I am able to add the print job in the queue, but not able to get hold of printer
mr5
mr5
07:44
@sohaiby I have glanced at the doc. I think you would control the printer via REST methods
@misha130 I have no idea of this. Can you please explain a bit more?
@sohaiby It's so completely different like playing with a game, or buying the source code of it. One is 5 dollar, the other is not... Not same legal stuff at all...
@mr5 It's a WPF/C# application. Could you please guide me a bit more?
The Windows Spooler API seems like the right one. There's probably a C# wrapper for it.
07:46
@mr5 I know what your problem is I think
don't stop believing
Heyho guys
@AvnerShahar-Kashtan Let me try this. Thanks for giving me something new :)
@mr5 is it a void async method?
Goood morning C# :D
mr5
mr5
@KamilSolecki it's a Task<T>
@sohaiby you would be using an http client to communicate with the printer. for example, you can GET an information about the printer when you type a specific URI in your browser, example: http://localhost:8080/printers/01/get-version then it might respond a JSON content type and you need to parse it
07:52
tfw datetime.now does not work!!!
'hour' returns 7, but it's 12:52 AM
wtf Microsoft!!
@Halie globalization?
mr5
mr5
@Halie have you checked the timezone?
yes i put it before the code and it's still wrong
how doi check timezone?
my timezone on my PC is PCT, do i have to tell my code im in PCT?
mr5
mr5
maybe
Might have to, yeah
07:54
how?
mr5
mr5
where is PCT anyway?
can you tell the UTC offset?
var indianTime = TimeZoneInfo.ConvertTime (DateTime.Now,
                 TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));
pacific time is in south california, US
To get list of TimeZone run this method

ReadOnlyCollection<TimeZoneInfo> zones = TimeZoneInfo.GetSystemTimeZones();
Console.WriteLine("The local system has the following {0} time zones", zones.Count);
foreach (TimeZoneInfo zone in zones)
    Console.WriteLine(zone.Id);
That's.. handy
07:56
@Halie first rule: It's never microhards fault, only ours for using it the wrong way
@KamilSolecki omg your code worked :3
thank you!
mr5
mr5
@KamilSolecki that's very readable in C#
@Halie no problemo.
I have the sickest google abilities ^^
mr5
mr5
okay. now tell me the error kamil =P
sohaiby is gone. I wonder where did he go
@mr5 He dissaprinted.
08:02
@mr5 sir :)
@mr5 I need to see more to understand what could be going on. Would you mind pastebinning?
mr5
mr5
@KamilSolecki ooohh
what does throw; means in C#?
what does it throw?
well, its used to throw an exception
like
mr5
mr5
45
Q: What does "throw;" by itself do?

CJ7 Possible Duplicate: difference between throw and throw new Exception() What would be the point of just having catch (Exception) { throw; } What does this do?

throw new NullReferenceException();
mr5
mr5
08:04
I have pinged myself
@mr5 It rethrows the exception. It can only be used inside a catch block and rethrows the same exception thatwas caught.
@AvnerShahar-Kashtan TIL
Tbh, there is not a single try - catch in my code
And it's important to use throw; instead of throw ex; in most cases for rethrowing.
@KamilSolecki That's... probably not ideal.
mr5
mr5
@AvnerShahar-Kashtan for retaining the call stack?
@AvnerShahar-Kashtan I THINK ABOUT ALL POSSIBILITES ARRR
08:06
@mr5 Exactly.
mr5
mr5
@KamilSolecki I'm curious how would you handle a JSON parsing then
I dont parse JSON :D
problem solved
@KamilSolecki Like being passed in a non-existing filename, your DB's drive running out of space or the internet suddenly collapsing?
mr5
mr5
@KamilSolecki it's like a reference for Jon Skeet lines: "JSON content type would parse itself before delivering to Jon Skeet end"
@AvnerShahar-Kashtan Ok ok, they are in my database driven apps. I just have a hate-hate relationship with try-catch and try to neglect its existence
This is one of those things that you dont like just because you dont like seeing it
Like, someone could have that going for their family
@KamilSolecki That's like having a hate-hate relationship with traffic lights. You're welcome to ignore them, but you're gonna get run over.
I have that going for try-catch
@AvnerShahar-Kashtan I strongly suggest you come to Eastern Europe then :DD
@AvnerShahar-Kashtan catching exception of internet is collapsing is futile. When there is no internet, the life will cease to exist in short time...
mr5
mr5
or you would just continue to rethrow everything and let the `main` entry handle it:
main() {
    try {
        run(new App());
    }
    catch(Exception e) {
        // ...
    }
}
08:10
@ntohl And is it not important to leave detailed logging information for the alien archaeologists who will dig us up in the future?
mr5
mr5
perhaps, that's how the Windows OS was implemented. except they execute BSOD() right after the catch block
@mr5 I have connected it with USB port
@AvnerShahar-Kashtan :D I'm going to have some prank for them, and log random internet outage...
@KamilSolecki haha nice
mr5
mr5
@sohaiby is the printer WiFi-capabled in the first place?
I'm not sure how you would interchange information in http via usb port
08:14
@mr5 Yes, but the requirement is to connect with a desktop PC (not with WiFi capability), so we need to connect it with USB port
@mr5 I don't get it. The only way to get the printer status and other info is with http?
mr5
mr5
@sohaiby I think so... you can read more information in actual doc
currentDomain.UnhandledException += new UnhandledExceptionEventHandler( CurrentDomainOnUnhandledException );
no try catch needed
mr5
mr5
@ntohl is that for real?
(where currentDomain = AppDomain.CurrentDomain)
mr5
mr5
will it also work for console apps?
08:20
@mr5 yes. We use it for logging purposes
@mr5 I think so.
mr5
mr5
but console apps does not have the concept of AppDomain built to them?
AppDomains always exist.
@AvnerShahar-Kashtan #appdomainiswatchingyou
@ntohl is this a dispatcher for unhandeled exceptions?
Guise, Can I get your opinion on my ad banner design? I need some unbiased feedback
@Nerdintraining yes
08:22
@ntohl neat
OK / Should be changed?
whenever the "send failure info to microsoft?" shows up, I can put code here
The e-in-the-lightbulb is a bit weirdly positioned.
@KamilSolecki make it purple :D
mr5
mr5
@KamilSolecki it looks like an ad for a cigarette
or a rhum
08:24
@AvnerShahar-Kashtan I think so as well
@ntohl Oh, the color theme actually has to stay. It resonates with the website
Although I have tried blue / azure / ultramarine
I didn't really like them
@KamilSolecki I know :D I had a copy of Your Castle Windsor design. Just joking.
@ntohl hahah yeah right
Löl fun fact:
To prevent instantiation of your class, you can simply make the Constructor protected. No need to mark the entire class as abstact^^
Not exactly
protected constructor can be called by subclasses
@Nerdintraining one of my friends played with reflector, and got a .dll, where there was a private method. He sent back the same .dll, just the method was public...
mr5
mr5
08:29
@Nerdintraining if you're targeting a specific dev to not to instantiate your class, you could just throw an exception in the constructor. someone hates it and probably wont call the c'tor
@KamilSolecki or even have a delegated constructor call in some method, like Singleton's .Instance
@ntohl yeah
mr5
mr5
is it possible to throw a null exception?
@mr5 Any reason why?
@KamilSolecki true, but you cant do var c1 = new ClassWithProtectedCtor
08:31
@ntohl Not hard to use ILDASM/Reflector/ILSpy to reverse engineer a DLL and modify it. That's what strong names are for.
@mr5 kek
@AvnerShahar-Kashtan wat are strong names
mr5
mr5
@AvnerShahar-Kashtan the code I am dissecting seems to throw or rather the debugger evaluates it as null
@Nerdintraining Signing a DLL with a cryptographic hash, so that if it's replaced with a hacked version, it won't load.
Guise I think its time
@AvnerShahar-Kashtan signing always sounds complicated in my ears^^
@KamilSolecki it's on bitch :P
08:37
@Nerdintraining for me its singing thats hard
var hash = new SHA256Managed()
    .ComputeHash(
    Encoding.UTF8.GetBytes("signing always sounds complicated in my ears^^"));
@Nerdintraining Here, I signed your message for you:
@Nerdintraining bring it on, bby.
@KamilSolecki i'm going to twist your ancle mafaka!
you know what? That does not look complicated but i still dont get it^^
I will read up upon signing in near future
AVAST YE SCURVY DAWGS
Thy ass is mine Kieran!
08:43
ufkinwotm9
Anyone use TFS? We've been fixing bugs in the trunk and merging them to the release branch, and I wonder if I can go over all changesets in the trunk and see which was merged and which weren't.
ifknownum10
mr5
mr5
I'm glad I don't need to deal with Microsoft stuffs. Everything they build always seems complicated
there will always be a "infrastructure bahaynd"
@AvnerShahar-Kashtan looking on our tfs server i can't see a way to filter for merges
@mr5 TFS-as-source-control isn't more complicated than Git or Perforce. It has its (considerable) flaws, but over-complicated isn't necessarily the problem.
08:50
@AvnerShahar-Kashtan imho Git is more complicated. Yes
We do use TFS; unfortunately cant help you in this case though @AvnerShahar-Kashtan
And Visual Studio is considerably less complicated than Eclipse.
Not because it's a simple tool, but because Eclipse is a mess.
I tried to install some VI plugin for eclipse. After 1 try of fail plugin, the whole Eclipse got so messed up, that I had to reinstall it. Every time...
mr5
mr5
I judge IDE's complicatedness base on the number of visual elements it has. I have only used Eclipse for basic Java apps and some Android before so the navigation seems straightforward. Meanwhile in VS, the UI seems more cluttered. There are lots of features I haven't tried yet and you can see them all over the place. Might just be because of Xamarin though.
But no doubt, VS can handle numerous plugins without messing up but I dislike the interface
@mr5 When you say "I've used Eclipse", you're referring to a small subset of what Eclipse is. Even for a basic Java app, there are different ways of doing the same things that can be confusing (do you use the Package Explorer or Project Explorer? They're 90% equivalent - but not 100%).
And any Eclipse setup you find might be radically different.
09:00
oh lordy I dislike Eclipse. It claims to be able to do literally anything, but achieves none of it particularly well.
probably the most complicated IDE I've used
Loving Visual Studio Code right now, but Visual Studio 2017 is still great for larger solutions.
Has anyone here used Project Rider?
mr5
mr5
@AvnerShahar-Kashtan that's exactly what should be seen on IDE. You just need to use the smallest possible subset and use only the feature you need. Unlike VS. It's all bundled by default
it's shaping up to be a really good IDE for C#/.Net. A real contender for Visual Studio's crown, especially cross-platform.
mr5
mr5
I mean, by means of navigation. You wont need all those stuffs don't you?
@Squiggle did you get paid for this? lol jk
@Nerdintraining the chessboard has gotten thin
The marsh queens are gone
@mr5 Yes I'm a JetBrains shill. Gotta make a living somehow.
off the record, it's still pretty good
09:08
@KamilSolecki ^^
@KamilSolecki and i didnt see you could hit my jumpy horse
mr5
mr5
@Squiggle oh. so you're a fan of JetBrains IDE as well?
I really like their design
but you're advertising for VS not JetBrains
@Nerdintraining jumpy jumpy horsey backflipped
@KamilSolecki he jumped straight of the board
@mr5 I'm saying Visual Studio and Rider are both good IDEs.
but I'm really pimping Visual Studio Code, 'cos I deal with a lot of microservices and React apps right now.
@mr5 But for Eclipse, there's no "smallest possible subset". There's a skeleton, and a mish-mash of plug-ins that weren't designed to work with each-other. The default, standard installation - out of the box - has conflicting key bindings!
09:13
[white]but i am no pussy and wont take it back
Takeback sent
Takeback accepted
mr5
mr5
@AvnerShahar-Kashtan well, I only used it in a short time. I didn't had a hard time back then ^^
Anyone in here who knows sql?
that's always an ominous question
@Kieran somewhat. Why do you ask?
@KamilSolecki thats not the entire chat!
@Kieran sex quality love?
@Squiggle I've got a stored procedure that will only ever bring back one row
But i've got an outer join to a table that has two seperate rows of data in it
Ideally they need to be returned in the single row as different column names
I know its possible to do with union, but the usage of it for this is eluding my brain
09:25
using pre-determined column names?
yep
well
if you're feeling brave you could PIVOT - docs.microsoft.com/en-us/sql/t-sql/queries/…
exciting game @KamilSolecki
oo shit
that might work
09:26
Imma try dis
I'll let you know how it goes @Squiggle
or if it's definitely just two columns, and you can access each row by a predetermined key, you could just combine CASE and SELECT in a sort of hacky way
oh sorry, ROWNUM
I was thinking of just using two sql var's and just setting them via their own select statement
and then just passing that into the results
which is what i believe pivot does?
you shouldn't need variables for this at all
@Nerdintraining I h9 u u know
@KamilSolecki why you guys write an 9 instead of an 8?
And i came back from a bad positon
yeahy
09:31
PIVOT performs an aggregate function on a result set, providing each result as columns. Basically flipping the axis of the table.
\o/ time for coffee
So, back to the HTML to PDF conversion we are. I currently got this code but it throws "Object reference not set to an instance of a object (iTextSharp.text.pdf.draw.LineSeperator CreateLineSeperator())" on line 21. I know HTMLWorker is obsolete but that doesn't explain the error for right now. Any ideas?
@Kieran like I said, there's probably a simpler solution using ROWNUM.
but PIVOT is quite elegant if you understand how to use it
@Nerdintraining its a meme
@KamilSolecki no it's not a meme, it's stupid :P ♥
09:37
u stupid :(
mr5
mr5
i h7 all of u
opposite of hell -> h7
the 's' is silent ;)
^^
thats actually quite stupidligent
@KamilSolecki i am pumped with adrenelin from that chess game and i don't know why^^
mr5
mr5
it's like coming from a "ngongo" (deformed mouth)
i h7 nyu
@Squiggle pivot does not work for what i need it for
i am do a sad now
09:52
oh. The win...
10:02
!!tell Kieran Kieran2
@Nerdintraining That didn't make much sense. Use the !!/help command to learn more.
@Kieran Union is for joining similar rows into a resultset, not for returning columns.
Alright, semi-update on the HTML to PDF issue. Using XMLWorker instead of HTMLWorker as to not use obsolete workers, I can now create PDF's from raw HTML like such:

string html = "<html> <head> <title>Test page</title> </head> <body> <p>My test paragraph</p> </body> </html>";

However, attempting to supply it via HtmlAgilityPack, it crashes and throws a object reference not set to an instance of an object error, like such:

HtmlWeb hw = new HtmlWeb();
HtmlDocument hd = hw.Load(url);
HtmlNode node = hd.DocumentNode.SelectSingleNode("body");
Any ideas?
Could you clarify the use case again? You have a table that you want to retrieve two rows from and return a field from each of those rows as a field in your result?
@Xariez Always state which lines throws the exception.
"string html = node.InnerHtml;" is what causes the code to throw.
10:07
And node is null?
It seems to me that body is the child of html, so you won't find it under the document root.
Damn.
Yes it is. Not sure why i didnt pay attention to that.
NullReferenceExceptions are pretty straightforward to investigate. Find what's null.
They are
Apparently I had a massive brain fart though
Not that I got the problem fixed but i got a better base
Alright, i can see a lot more content if i switch it to 'html'
InnerText would be the normalized text nodes, without the HTML Tags.
God dammit this has been a issue for too long xD
Starting to miss obvious errors
Right, now I get it to run to xmlWorker.ParseXHtml(writer, document, input, UTF8Encoding.Default); where it then crashes with the same error.
Nevermind. "Invalid nested tag head found, expected closing tag link". wtf.
10:13
XHTML is much stricter than regular HTML.
Evidently so
@AvnerShahar-Kashtan Its all gucci now, I've just figured a workaround
Seeing where in the HTML document it actually finds it would be neat to know as well, as im not finding anything
I mean, <head> .. </head> aren't found on many places but..
SHIT NO I HAVENT
FUCK
!!kieran
Feb 27 at 16:02, by Kieran
Thank you for confirming im an idiot c:
10:15
lol
oh
God fucking dammit
I may just have found it as well
why do we.. what
why do we have two <head> .. </head> sections
@AvnerShahar-Kashtan Basically i have a select statement that returns a whole bunch of data from across 10 tables
AAAAAAAAAAAH Now i get whats happening
I think
one of the tables is used for reference id's in a table that has multiple entries
the table that has multiple entries has unique reference id's
10:25
Nevermind, got it!
Atleast this far
@Kieran You can return a subselect as a column.
:37834342 select (select Blah from Table1 where id=1) as 'First Column',
                        (select Blah from Table1 where id=2) as 'Second Column'
@AvnerShahar-Kashtan Doing it this way still gives me two rows
don't think im explaining it well
So, when i parse something using iTextSharp, it seems as if it will not accept any tags ending in />
No <hr />'s, no <img />'s, nothing
xml
is strict like that
oh hey, the crazy guy is here
Hai @J.Doe, how's that ban going for you
10:37
@Kieran No, just one.
I think the issue is down to the fact that one of my outer joins returns two records
those two records hold the reference id's for another table that has the data i need
@Kieran did I miss even more drama?
@KamilSolecki this was a while ago. guy came in talking about css exploits that had been outdated by like 6 years
Oh-my-god I hate everything with XML and XHTML at this point
Got banned, got around the ban, got a ban from the SO mod's
10:40
Oh wow
CSS Exploits?
I'll see if i can find it
its a good read
sec
I might just be completely out in the wind here but.. how do you even exploit css?
I'd love me some good reads, Thanks ;)
borders
10:42
@Xariez it was something to do with border-radius bypassing a no javascript rule or something
I..did not know that has ever been a thing
Thats actually quite interesting
!!border-radius

border-radiusery

Jan 17 at 14:58, 13 minutes total – 45 messages, 7 users, 4 stars

Bookmarked Feb 1 at 12:36 by satibel

yep
@KamilSolecki That link has the entire thing
@Xariez Something about the NSA using a bug in Mozilla's handling of the border-radius css element to crack TOR anonymization or something.
What the
kinda everything after that
Now thats semi-disturbing, if anything @AvnerShahar-Kashtan
@Xariez in 2012 or whenever it was found sure
After that it got patched
I remember reading about it
And then i've use border radius for as long as i can remember
.. the last 5 years I have been coding different things, that is
Started from HTML and CSS back in 2012, found PHP and SQL around 2013-2014, then Javascript+jQuery as well as ASP.net/C# around 2015-2016
10:56
Any WCF guru here...
am about to give up
No WCF knowledge, but i feel your pain with different issues ^
@Mathematics prey to kuthulu
I've WCFed before.
I've WCFed hard.
I change it to Windows then I get this,

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'.

and If I change it to NTLM...

The HTTP request is unauthorized with client authentication scheme 'NTLM'. The authentication header received from the server was 'Negotiate,NTLM'.

I got no clue how can I give it both lol
  binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;//.Ntlm;
"Negotiate,NTLM" means "Try using Negotiate/Kerberos, and fall back to NTLM if that fails".
10:58
@AvnerShahar-Kashtan yes, but server went crazy, it's clearly have problem with that for no clue what reason :(

« first day (2446 days earlier)      last day (2728 days later) »