« first day (813 days earlier)      last day (4134 days later) » 

12:00 AM
"require"? lol
 
So I have this "codz"
        private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView1.RowCount < 0)
            {
                var printer = CreatePrinter();
                printer.PreviewDialog = printPreviewDialog1;
                printer.PrintPreviewNoDisplay(dataGridView1);
            }
            else
            {
              if (
                  MessageBox.Show("Would you like to get all history and use that for printing?",
                                  "Get History for printing?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
The problem is that printPreviewToolStripMenuItem_Click(null, null); executes before getHistory finishes executing.
 
Hi all
 
@CCInc That's not actually true, period (not as posed/as stated)
 
@sehe ?
 
What might getHistory_Click do, anyways? Should I recognize this from somewhere (I don't do WPF, e.g.)
 
12:07 AM
@sehe it runs a backgroundworker
 
@CCInc Simply: statements are executed sequentially.
 
        private void getHistory_Click(object sender, EventArgs e)
        {
            Form1 form = (BrowserSync.Form1)Application.OpenForms[0];
            //Create an instance of the Program class of the Namespace namespace, to call its functions
            Program program = new Program();

            //Call Program gethistory to return the history
            const string methodString = "GetHistory";
            runBackgroundWorker(program, new object[] { new Program(), true }, methodString);
 
@CCInc Ah, so you were indeed sloppy on the phrasing.
 
well, no
it is a button event handler
 
Yeah, and it finishes just fine. However, the background worker, obviously, not so much
 
12:08 AM
Ah.
So how do I give my code the behaviour of when the BackgroundWorker is finished, execute printPreviewToolStripMenuItem_Click(null, null);?
 
Now. Onto the real meat. Obviously you should use a means of synchronization
If you can use TPL, I believe there should be a way to say 'await' task 1, 'then' proceed with task 2. No experience with that. However, that's quite intrusive.
I don't know whether your background worker already has synchronization built int, but you could just use a ManualResetEvent
 
@sehe I'm curious. What made this C++ guy use C#?
 
Work. Also, I love it
 
Well, duh :)
 
@CCInc I'm slightly puzzled about the implementation of the worker. Why is there twice an instantiation of new Program()? What library functionality does runbackgroundWorker employ?
 
12:12 AM
It uses reflection to find the method you want to run and runs it for you
 
faints
 
Anyways, the simplest thing would be to have a (public?) member of the Program class to synchronize on
 
First param is the class of which it will be run from
 
@KendallFrey Well, smelly, but really not the issue here, I suppose
 
True, but... faints again
 
12:14 AM
lol
 
sigh
 
Sorry, CC.
 
@CCInc The obvious solution here would be to not run the worker in the background at all
 
I don't have to use a backgroundworker for this task
 
@CCInc Problem solved
 
12:15 AM
Yeah
 
@CCInc perahps I can help you
 
Since you want to wait for it's completion anyway, why make it run on a thread(pool)
(Answer: because you want responsive UI and the task takes considerable time?)
 
Just watched Final Destination 5
 
In that case, async is the way to go.
 
People: JAB has a question
 
12:16 AM
Does anyone know of a JavaScript formatter?
 
@CCInc Dont ask it
 
...
if you don't want an answer go ahead
 
@RoelvanUden As in, beautifier?
 
It was awesome on account of not seeing the others, and 3D was awesome :D
 
@KendallFrey yeah. ContinueWhenAny looks a good fit
 
12:17 AM
@KendallFrey Much love (in a non-gay way) to you.
 
@RoelvanUden jsbeautify is a thing, IIRC
 
@RoelvanUden stares, shocked
 
1
Q: How can I use JSBeautifier from the command line?

Steve BrownI like jsbeautifier.org and I see they have a github repo with their code. The readme has two examples of how to use this tool via the command line: import jsbeautifier res = jsbeautifier.beautify('your javascript string') res = jsbeautifier.beautify_file('some_file.js') and: opts = jsbeauti...

 
posted on January 05, 2013 by Haacked

Tony Hoare, the computer scientist who implemented null references in ALGOL calls it his “billion-dollar mistake.” I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolu

 
@CCInc Oh no go ahead I was joking
 
 
@sehe I'll go with the online beautifier, it serves my purposes nicely.
Thanks tho!
 
[6:17:28 PM] Chris Lee: if someone decompiled your program should you be concerned about them hacking a database you connect to
[6:17:51 PM] JABFreeware dotcom: Add, by hacking I mean "Getting its contents"
 
@CCInc No need to decompile things. In 99% of cases database traffic is unencrypted and the protocol is widely documented
Of course, the authentication would still be encrypted (so disregard my loud-thinking)
 
Are QR codes overly complicated to learn? I think I want to generate them.
 
@JABFreeware ^^
 
12:20 AM
The real answer there is physical isolation: firewall your database so only authorized hosts can access it
@Billdr Let us know when you figure out whether you do (also: libraries, learn a library, not QR codes)
 
@sehe A library would probably do just fine. Less fun than making my own, but... meh.
 
@sehe But say I have a program that adds entries to a central server database for storage or the such, since they would have the connection string they could run querrys and get data. Can that be prevented some how?????
 
@Billdr Not too bad.
 
@Billdr Oh, looking for fun. Ah. Noble quest
 
They basically consist of recognition patterns, timing patterns, data, and error correction data.
 
12:22 AM
Well, the specs are probably not too complicated. But getting the margins of error right when preparing/scaling for print could be tricky depending on the size and resolutions
@KendallFrey I assume you're describing properties of a scan result, not so much the QR code itself? Where does timing come in in a static image?
 
result #1 on my google search is "To make a qr code, first download this library."
Blah
 
QR code (abbreviated from Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional bar code) first designed for the automotive industry in Japan. Bar codes are optical machine-readable labels attached to items that transmit information related to the item. Initially patented, its patent holder has chosen not to exercise those rights. Recently, the QR Code system has become popular outside the automotive industry due to its fast readability and greater storage capacity compared to standard UPC barcodes. The code consists of black modules (square dots) arrang...
See "Standards"
 
@sehe I don't quite get what you're saying, but let me explain.
You will of course recognize the large dots that obviously don't contain data. Those are used to make QR codes easy to recognize.
There are other areas that contain no data, and those are used for calibrating the timing of the scanner.
 
@KendallFrey so they call that "timing"? It's like a grid/ruler thing then
 
Right.
I think it was called timing...
 
12:27 AM
5 mins ago, by JABFreeware
@sehe But say I have a program that adds entries to a central server database for storage or the such, since they would have the connection string they could run querrys and get data. Can that be prevented some how?????
 
See 4.3
 
I can see this for handheld laser scanners, where the timing defines the density -> logical "apparent" size of the QR code
@CCInc ah missed that. reading message now
@CCInc not unless you relay the actual database connection to a trusted server, I guess. /cc @JABFreeware
3
A: encrypt SQL connectionstring c#

BhaskarThere are two ways of doing it: 1) You can use Configuration Secure Section to encrypt and decrypt connection strimng from your source code: try { // Open the configuration file and retrieve // the connectionStrings section. Configuration config = ConfigurationManag...

^ Also relevant - secure config. But this goes only skin deep once they decompile/debug the code
@Billdr This wiki page has links to the ISO pdfs (free of charge, as it appears): qrcodenet.codeplex.com
 
@sehe Okay thanks, on other question:
 
Thanks Sehe.
I'm going to circle back to this problem after I get some more critical stuff implimented.
 
Is it possible to make a .asp page that the user types in something in a textbox on a program on there computer and my .asp website then puts that in one of its textboxs?
 
12:35 AM
I complement your implimentation of clever spelunks
 
@JABFreeware Yes.
 
@JABFreeware I seriously hope not.
 
@RoelvanUden how, been trying to find a tutorial, can he show to one
@KendallFrey why?
 
Sure it is
The desktop app sends everything to the server via api, the api validates the data, stores it, and displays it to the text box
 
@Billdr I have limited knowledge of .asp and dont know where to start
@Billdr yeah, is there a simple way to do that?
 
12:36 AM
Simple. Add a handler to send each changed input to the server, and have an open connection from your own browser listening for changes. Think of long polling.
 
Nope.
 
@Billdr to what?
 
Its the same principle in everryyyy web language.
Find one for PHP or Node or whatever, it's the same.
Just a different back-end.
 
@RoelvanUden no, I'm wanting something even simpler than that, like this:
The user types test and click view, there browser starts up and goes to my .asp net page and "test" is right their. Cant I do something like emmbed the message in the url, and have the webpage code grab it?
 
1) write a desktop app that sends a character to a url on key press
2) write an api that compares what's in the database+what's to be added to make sure it's not going to break things (hint: it will)
3) save the verified good (ha) data to the database.
4) write another api that's called from the first, this one pushes notifications. It pushes the string.
5) use knockoutjs or something similar to update the text on the server
 
12:38 AM
@RoelvanUden it's a property of the HTTP protocol, really
 
So, what you've got is data entered on the client side to be sent to a server to be sent back to the client.
 
@JABFreeware if I was a bit quiet to you, I just realized why: I had you ignored :)
 
@sehe why?
 
@Billdr yes, basically
 
@sehe That is also debatable. HTTP was never really intended for long polling and such, but the freshly added WebSockets are perfect for something like.. I THOUGHT he ment.
 
12:40 AM
@sehe why may I ask?
 
@CCInc Don't remember. But no doubt deserved :) ^
 
There's no easy way to do most of that.
But that's what you'd need to do.
 
@sehe thanks
 
@JABFreeware It must have been since quite a while too, because I rarely visit here
 
@JABFreeware Uh just start the page with something in the url and pick it off window.location
 
12:40 AM
Anyways, off the list now
 
form.SetDesktopLocation(
                (int.Parse(System.Windows.SystemParameters.PrimaryScreenWidth.ToString()) / 2) - form.Width / 2,
                (int.Parse(System.Windows.SystemParameters.PrimaryScreenHeight.ToString()) / 2) - form.Height / 2);
 
@RoelvanUden I dont follow what you are saying?
 
nvm
 
Now you can use window.location to pick 'text' from the query string and place it in the text box.
That is what you are after, isn't it?
 
@RoelvanUden yeah thats whay I want, but I dont understand what you mean by "window.location"
 
12:43 AM
In JS window.location.search contains everything after, and including the ?
65
Q: Parse query string in JavaScript

sinawI need to parse the query string www.mysite.com/default.aspx?dest=aboutus.aspx. How do I get the dest variable in JavaScript?

document.getElementById('mytextbox').value = getQueryVariable('text');
I think.
 
@RoelvanUden YAY, that should get me started!
Thanks
+20
:)
 
Yay :P
 
hi there
 
Hello.
 
@Nasenbaer well hi there!
who are you?
:)
 
12:49 AM
well. just playing grepolis a little and programming in 2013 (happy that the world is still alive ;) )
 
Oh, but an apocalypse pretty much means all of humanity dies. Doesn't have to end the world at all!
Always look on the bright side of life, tum dum, tum dum tum dum.
 
;-)
I need to create an Interface of an reference class now with hundrets of methods. Before I start, I don't want to miss to ask: is there a automated way of reflection all methodes of an assembly I don't have to source from?
To create the same methods as interface?
 
Press F12?
 
ha ha ha
yes, but that does not write it into interface c# file
 
True. I have no clue if there is an automated way. I'd just copy/paste and use a few regex to remove comments and stuff I don't need.
 
12:54 AM
@RoelvanUden ok, thanks ;)
@RoelvanUden you mean, if you HAVE the original source code of the class, right?
 
I need some help putting drop shadows on a border-less form
 
@Nasenbaer No, you can just jump to the definitions generated from meta-data (Click the class name, press F12) and use that as a base. You don't need to have the actual source code at all for just signatures and summaries.
2
 
@RoelvanUden ahh, I remember now, that is possible in C# project. I am doing a VB.Net project. I will take a look now on VisualStudio's setting of going into the definition.
 
Hmm, right-click and goto definitions?
I don't use VB.NET but it should be there, after all, it's all the same.
 
@RoelvanUden on VB.Net it went to the Object browser.
 
1:04 AM
@Nasenbaer vs2003?
 
@sehe 2010 pro. But I think it can be setup in the VS options somewhere. Or I will shortly change to C# ;)
 
@Nasenbaer IIRC you can use the mono disassembler tool (whatever it was called) to get signatures as well.
 
mododis, although I think you are referring to monop2
 
@RoelvanUden great thanks Roel
 
1:17 AM
The best way to get .NET code is the .NET code itself.
(I just downloaded it today)
 
Is there an equivalent to @Request.Url.AbsoluteUri that forces https?
ducking out. Later gentlemen
 
@KendallFrey But remember, once you've seen it, you might not be allowed to work on Mono again, if you wanted. Of course, they assume photographic memory, as any lawyer would
 
What?
.NET is open source, but you can't use the source?
 
1:32 AM
@KendallFrey Wait. What did I miss? The specs are 'open'. But the MS implementation surely isn't?
 
I think it is only the GC that is not open source, dunno where I heard it though
 
MS Implementation? I'm pretty sure the code in the reference source is the real deal.
 
I think it's just bits and pieces that are (recently) opensourced. Like, MVC, IronPython, IronRuby and F#
 
You can download the source for most of the .NET framework, including the base libraries like mscorlib.
 
@KendallFrey that doesn't actually make it opensource or free
 
1:37 AM
It's not free, but it is 'open' source.
As in, "here's the source"
 
Hi guys...hope you'll enjoying your time
 
nvm lol
 
It's free to download from referencesource.microsoft.com.
It's gratis, not libre.
 
@KendallFrey Yeah, but there are license restrictions. I.e. the knowledge taints you for work on true opensource projects (for the risk of 'thieving' the implementation details)
 
guys..any one knows how to control over sql db table rows...I want to have a field that calculate moving average stackoverflow.com/questions/14146902/…
 
1:45 AM
In short, the EULA says "You may not use this source for developing similar software for non-Windows OS's." Interesting.
As if that will stop me :)
Actually, what would stop me is making something as big as .NET.
 
@KendallFrey Well contributing is easier. That's the whole idea of opensource community projects
 
Right. Like Mono.
 
@KendallFrey Does it actually say "non-Windows OS's"? Linky?
 
Let me gist it.
 
@KendallFrey Not just that. You were saying 'something as big as' - well, you don't need to contribute a large body of code. It could be a few functions in a linux kernel module, right
@KendallFrey Ok, source links really appreciated too
 
1:48 AM
@sehe Source for what?
Oh, nvm
 
The EULA, just to clarify
 
Thanks
 
1:51 AM
Bah, gist sucks.
But it mentions a "non-Windows operating system" at least twice.
 
 who is not engaged in designing, developing, or testing other software, for a non-Windows operating system
 
@CCInc That's missing a very critical piece.
 
?
 
> ... that has the same or substantially the same features or functionality as the software.
 
ah
 
1:53 AM
So, I can legally still write code in Linux, as long as it's not anything like .NET.
 
@KendallFrey Three times. Very clearly. Surprising wordng. I don't see how it would be any better to create 'competitors' on Windows. Anyhoops
In vim:
:r! curl gist.github.com/raw/4464741/…

gqqg^G:

Col 1 of 74; Line 1 of 37; Word 1 of 432; Char 1 of 2784; Byte 1 of 2790
 
I should have downloaded the 2.0 source so I can mock the LOGIC class yet again.
 
@KendallFrey yeah, obviously
 
Sometime if you need a good laugh, look up the LOGIC class in mscorlib 2.0.
 
K, so... starting my first MVC project. To Membership, or not to Membership a custom user database?
 
2:04 AM
Guys, please support the proposal for a new QnA site at SE area51.stackexchange.com/proposals/49264/…
 
@bonomo Is this your site idea?
 
Yes it is
 
2:23 AM
how do you become an owner of a room?
 
@Inisheer It is quite an advanced process.
 
well, that was enlightening.
 
@Inisheer It took me 3 months
 
... then he lost it in a second.
@Kinected You never told me the story.
 
Try 3 more months
Kyle and Kendall didn't think a user who was banned should be a room owner :P
 
2:26 AM
Story please
 
33 secs ago, by Kinected
Kyle and Kendall didn't think a user who was banned should be a room owner :P
 
The story of why you BECAME owner
 
I don't care about this room specifically... just in general..
 
@CCInc Because I was better than Kendall, and Nadal and @Steve were harassing us at the time and they needed help
 
Anyone?
 
2:28 AM
Also Kendall liked me then
 
The story of Nadal.
@DemCodeLines I told you.
 
... nevermind then ...
 
@CCInc Ask @Kyle
 
@Inisheer You have to get one of the owners to like you.
 
@CCInc I told you its not working.
 
2:29 AM
But how did THEY get to be owners...lol. Did they originally create the room or something?
 
@Inisheer Yes
 
Ok, thanks
 
Someone created the room in the beginning
then owners were added
 
On the first day... there was C# room.
On the second, owners were created.
 
@DemCodeLines It should produce something like this:
 
2:30 AM
got it.. seen this before somewhere
 
LOL
 
except it doesn't show anything like that
 
@Inisheer Check out in the beginning times. chat.stackoverflow.com/transcript/7/2010/10/15
@DemCodeLines does for me.
Give me code.
 
My poor C room.... you can see the entire chat history on one page...
 
@CCInc says GetWindowLong is not declared
:S
:confused:
 
2:34 AM
@DemCodeLines code!
private const int CS_DROPSHADOW = 0x20000;
protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ClassStyle |= CS_DROPSHADOW;
        return cp;
    }
}
@DemCodeLines ^
 
That is not my code
 
USE THAT CODE
 
public partial class Dropshadow : Form
{

    public Dropshadow(Form parentForm)
    {
        /*This bit of code makes the form click-through.
          So you can click forms that are below it in z-space */
        int wl = GetWindowLong(this.Handle, -20);
        wl = wl | 0x80000 | 0x20;
        SetWindowLong(this.Handle, -20, wl);

        InitializeComponent();

        //Makes the start location the same as parent.
        this.StartPosition = parentForm.StartPosition;

        parentForm.Activated += ParentForm_Activated; //Fires on parent activation to do a this.BringToFront()
that is my code
anyways, what you said doesn't add a shadow either
 
Yes it does!
 
this is my code:
public class customForm : Form
{

	protected override void OnLoad(System.EventArgs e)
	{
		this.Text = "";
		this.ControlBox = false;
		this.FormBorderStyle = Windows.Forms.FormBorderStyle.None;
	}

	private const int CS_DROPSHADOW = 0x20000;
	protected override CreateParams CreateParams {
		get {
			CreateParams cp = base.CreateParams;
			cp.ClassStyle = cp.ClassStyle | CS_DROPSHADOW;
			return cp;
		}
	}
}
This is a class. A custom object.
 
2:38 AM
what does it display?
 
Now, I do customForm form = new customForm
form.show()
except it displays the form without any shadow
There is NO shadow
@CCInc ^
 
@DemCodeLines Ask on the main site.
 
Doing abundant[index] on a List<int> is O(1) right?
 
@JohanLarsson O(n)
 
hmm is it not the same as doing it on an int[]?
 
2:51 AM
List is a linked list, it has to traverse to the position you specified.
You'd want something that is an array internally in that case.
 
You mean accessing a list item? That's O(1).
This is the .NET System.Collections.Generic.List<T>, right?
 
Yeah, I don't know what Roel was smoking :) (I kid)
 
Oh, yeah, Kendall is correct. I confused LinkedList with List, my bad. I blame it being 4 in the night.
 
:D
Go to bed.
 
2:55 AM
Aye sir. Good night :3
 
@RoelvanUden You had me worried, was 80% sure, did not feel like doing research. 04:00 in Sweden too :)
 
Wacky coders still doing stuff at 4 in the night XD
Later :3
 
I don't get how someone can get 3 upvotes + accepted answer + OP commenting "Works like a charm" on an answer that isn't even close to right.
2
Q: How to replace all spaces except spaces inside "a b" in RegEx?

1.21 gigawattsHow would I replace all space characters with letter "_" except spaces inbetween characters "a" and "b" like this "a b". // this is what I have so far to save someone time (that's a joke) var result:String = string.replace(/ /g, "_"); Oh this is in JavaScript.

 

« first day (813 days earlier)      last day (4134 days later) »