« first day (1383 days earlier)      last day (3550 days later) » 

12:00 AM
the cpu one?
 
yeah
 
yeah it is ok, you can profile tests with it also, that is useful ime.
dotTrace is also very nice
 
12:17 AM
@JohanLarsson @avitex That's not 100% true - the idiomatic way would be to do that, but use an EventHandler<T> where T was an EventArgs - prior to 4.5, EventHandler<T> had it as a constraint so it was required
 
@ReedCopsey Okay, that's interesting.
 
12:54 AM
How would you implement nested structures which needed to have an explicit layout?
I mean, you would need know the size of a nested struct to use FieldOffset. Is there an easy to do this?
 
1:05 AM
@avitex If you want the unmanaged size, you can use Marshal.SizeOf
also sizeof
 
So in the place of the comment, I would have a Marshal.SizeOf?
The only problem is each time I add a struct, all following would need a extra "SizeOf".
I would end up with something like this
[FieldOffset(/* sizeof struct1 */ + /* sizeof struct2 */ + /* sizeof struct3 */ + 4)
 
1:25 AM
@avitex If all you want to do is put one after the other, use LayoutKind.Sequential
 
@KendallFrey Sadly this isn't the case, for example: github.com/avitex/VLCHug.NET/blob/master/Bridge/Internal/…
Wait I have a better example
I am trying to implement these structs, in C#
 
1:51 AM
sup all
 
Hello :)
 
@CCInc nice to see you again.
 
2:07 AM
WTF is Eric Lippert doing answering physics questions?
 
Anyone know XAML here?
 
l19
Does anyone use Selenium here? Is it possible to intercept HTTP requests within a cloud-based Selenium test? E.g. by using Sauce Labs?
 
2:35 AM
no one?
 
looks like so
 
do you know xaml?
 
yea but not an expert on it
 
how would I make a path opaque (it's opacity is initially set to 0) when a listbox item is selected?
 
3:13 AM
How do I create valid XML, when the value string contains special characters? (eg, "bullet")
I've tried XmlWriter & XmlElement, they escape <>& but not unicode special characters
 
3:33 AM
If anyone is versed in Dictionary<>, can I modify the Value received from TryGetValue() and have that modification be persistent?
 
4:06 AM
Dictionaries return pointers, so if you change that value then it will be reflected in teh deictionary
 
Anybody want to please help me with XAML?
 
4:41 AM
I'm not a xaml guy - sorry man
If you're online in 12 hours, more people will be on to help
 
5:31 AM
posted on July 30, 2014 by Scott Hanselman

While I'm not 100% gaga over Markdown as I know many of you are, I definitely appreciate it's usefulness and it's clarity. Some folks would say I shouldn't rest until every binary document on my hard drive has been converted to Markdown. I say, nay nay. That said, I totally dig MarkdownPad and you should use it every day. It's lovely. If you don't want to install anything, check out http://di

 
5:54 AM
@RyanTernier Thanks. One last thing, if I write 0 to a stream like this:
cli.Client.Send(BitConverter.GetBytes(0));
Will that close the connection?
 
6:24 AM
posted on July 30, 2014 by Scott Hanselman

If you right click in Windows and try to make a new text file with a . period/dot in front of it: Name the file...something like .gitignore, for example. You'll get the "You must type a file name" error. But, rather than typing .gitignore, if you include an ending dot also, like .gitignore. Then it works fine. Thanks, Mads, for the tip! © 2014 Scott Hanse

 
 
1 hour later…
7:32 AM
Hi. Has anyone worked with a dynamically added gridview? So if the gridview is once databound, and on a consequent postback, we've to add it to the control tree again...does this mean we've to manually add the rows to the gridview taking into account the number of rows the gridview is bounded with?
 
8:17 AM
hi
 
user4203923
hi akk
 
user4203923
all
 
user4203923
I'm importing System.Collections but always can't use ArrayList
 
user4203923
WHy ?
 
8:30 AM
@Tchi According to msdn.microsoft.com/en-us/library/… you should be able to access it after importing System.Collections;
 
user4203923
it's what I did
 
user4203923
using SYstem.Collections;
 
Is the no conflicting name?
perhaps a variable that is calles ArrayList?
called*
 
user4203923
when i'm putting the A letter
 
user4203923
it comes a lot of method/variable
 
user4203923
8:34 AM
like Array
 
user4203923
JArray
 
user4203923
but not ArrayList
 
user4203923
I'm trying to create it in a static method but I don't think this is the problem
 
Type in ArrayList and hit Ctrl + .
 
user4203923
no
 
user4203923
8:36 AM
I don't have any ArrayList variable ^
 
if its a valid type the intellisense will show options for namespace completion...
 
user4203923
the type or namespace arrayList not be found ..
 
user4203923
are you messing a directive or reference, something like that
 
user4203923
or assembly reference*
 
user4203923
Can I give you a pastebin ?
 
8:39 AM
what type of app are you writing console, winforms, wpf, asp.net?!
 
user4203923
windows phone
 
I don't think its available for windows phone...
6
Q: Need Hashtable and Arraylist

William JockuschI am trying to use someone else's C# classes in my Windows 7 Phone app. The classes use objects of type Hashtable. The file in question has using System.Collections; at the top, so I'm assuming that's the Hashtable object it wants. When I try to build my solution, I get errors that the t...

 
user4203923
yep thanks you ..
 
You should use the generic versions, indeed. If you don't want to rewrite anything, LIst<object> will work for you (but its ugly as fuck)
 
any one have any experience making visual studio extensions?
 
user4203923
9:00 AM
that's say Roel ?
 
10:08 AM
hi guys
When you want to add a file in winforms that ships with application on install but can be edited what is the best way.Say a txt or xml file.I have seen embedded makes it so it can be deleted or edited by user.What I did before was just add the xml to project and reference application.commonappdatapath but is there a better way
 
Use the AppData folder for your app to store settings, and generate when not exists
 
where can I find the Appdata folder I cant see it in my solution explorer? @RoelvanUden and I have googled that 1st :-)
 
%appdata%
 
I use appdata folder as well
 
10:23 AM
Jup. You get all the benefits from Windows for using that.
e.g. network copies for domain users etc.
 
@GotalovePHP just put %appdata% in an explore window and it will open up to it.
 
I get that I can find appdata path like Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) but how does the added file go there by default on install?
coz I noticed that when I just add item I usually have to reference it using Application.CommonAppDataPath
 
Having syntax trouble using xpath & htmlpack
 
If you try to load it, and it doesn't exist, create it.
 
let xpath = @"//div[@id='chat']" // does not work though there is a chat div right there
 
10:33 AM
It seems correct. Can you show what you feed into it? (Ill answer after lunch)
 
alright thanks @DaImTo and @RoelvanUden
 
let xpath = @"//body" // this gives me a node
let xpath = @"//body[@id='chat-body']" // this gives null
 
10:55 AM
What's the HTML you feed into it @JohanLarsson?
 
chat transcript, oh oh think I found the derp :)
@RoelvanUden found the dum
xpath is much nicer than linq imo, reads so much better
 
I am the queen of really long linq statements.
 
let xpath = "//*[@id='transcript']/div"
let nodes = selectNodes xpath doc
^ more fun to dig into in the future
 
I prefer Linq over XPath :)
 
11:01 AM
linq looks cleaner?
 
Cleaner, easier to read, static typed.
And supported on any device ;)
 
not that static imo, you still need the string "transcript"
 
I have never seen xpath before but it looks a bit like regular expressions which in and of its self is scarry.
or xml which is almost worse
 
I started with xpath today so not much exp. Relaly like what I see so far
 
It's not like that, but it requires a XPATH engine and magic strings adhering to the XPATH specification. I don't prefer it at all, especially since XPATH supported isn't quite as broad as Linq in .NET world (e.g. try xpath on wp8 and you're screwed)
 
11:03 AM
ok valid argument
 
11:32 AM
@JohanLarsson That looks like F# written like C#. I don't think it's supposed to be that way :P
 
Suggest something better?
I'm getting my feet wet with F#, feeling dumb & old.
<- collapsed eet
the lets was just when fiddling around with it
 
I just can't appreciate F# yet.. does the IDE play nice now Johan?
 
Nah, writing F# is nothing like writing C#, the upside is that one writes less I hope
Most likely I'm doing it wrong also
 
Rather than the amount of writing... is it readable?
Because reading/comprehension takes more time than writing
 
@RoelvanUden dunno yet but think it will be awesome. Need a solid grasp of the syntax before being able to read it.
Hacking an example.
F# wins that one imo :)
 
12:03 PM
Bit baffled by the xpath conversation
not sure how you can do anything useful with xml without knowing xpath
 
@TomW XLinq
 
that hasn't been around that long. Before that?
And in environments that aren't c#?
 
XPath
or environments that have other XML manipulation
 
@JohanLarsson Uhm, yes, totally..
 
@TomW :)
@RoelvanUden the F# also has nice tostring() capabilities
 
12:07 PM
I can imagine newbies looking at F#: What's a mu table?
 
@JohanLarsson Such as?
I did see some weird magic in F# knowing all types of a json etc.. it was weird. How did that work
 
hackinga sample
 
1
Q: drag drop not working.. want to trigger the DragOver command when you drag and drop some object from the view in it

Harjeet SinghI am trying to implement Drag-and-Drop in MVVM, but when I try to drag the item, the event doesn't get triggered. However, when I drag the items from outside, it starts working. I want the first case, make it working while dragging. Is there any special way? I am using behavior and relay command...

Hello friends..do you have any idea regarding above posted problem?
 
What does MVVM have to do with drag-drop?
 
12:11 PM
its all about pattern @KendallFrey not about drag drop..creating problem in mvvm
 
@JohanLarsson Oh that's sweet. It basically does a print for all types like that?
 
I think so if you pass "%A" this is about all F# I don't know :)
 
looks like C
 
any idea guys?
 
@JohanLarsson Does F# make sense to use for web and such?
 
12:17 PM
@RoelvanUden Reed loves Websharper, the guy behind Websharper is chatting in F#. Looks like he left
I know no web and no F# so you don't want my answer
Trying to write something this week though, gonna try Websharper
 
Oh, that's front-end in F# (That's just mental...), but I was referring to back-end?
 
@RoelvanUden I think it is both-end (shared code) he is back now.
 
12:32 PM
F# doesn't have open source tooling right, instead of VS?
 
ask in F#
 
I prefer to ask you :(
 
I would love to be able to answer
in F#, 13 secs ago, by Johan Larsson
Does F# have open source tooling or is it VS-only?
found a way
 
Does anyone know if an asp:updatePanel will have a way to save hardcoded html inside after the refresh?
.. the content seems to disappear.. hmmm
 
@RoelvanUden got some replies, can't tell which ones are serious
 
12:44 PM
Perhaps mono yeah.. I'm lurking in F# now :P
Xamarin Studio* it is called now.
 
internet searches dont bring anything up... how do you search for "asp:updatepanel loses html on refresh"?
 
That code is practically unreadable..
 
@RoelvanUden @rightfold probably knows
@RoelvanUden gotta know the syntax before reading any language imo
 
@JohanLarsson Perhaps I'm getting old. I like readable languages nowadays.
I do understand the basic syntax, but it's still hard to read.
Much like Python's list operations being a total nightmare.
 
I have no opinion yet
 
1:05 PM
hmm yes UpdatePanels do keep html content.. must be something else in this mess of spaggetti someone made...
 
@RoelvanUden I agree that there is more cognitive load from voodoo like |> than reading English. Just dunno if terseness beats the more verbose C#
 
@JohanLarsson Perhaps it's something to get used to, but I also see a bunch of underscores and whatnot.
 
Was DropDownListFor dropped from mvc 5?
 
@juanvan No
 
Humm
 
2:12 PM
Is there a way to refresh a ASP.NET Control refresh from the client?
 
hey Greg, do you know a bit of Cryptography?
im helping a friend, and if someone knows this, please help him, tell me or him.
0
Q: C# Decode AES256 From PHP

user3712833i have written this code to generate in php an ecrypted string: $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC,''); $iv_size = mcrypt_enc_get_iv_size($cipher); $key = '...'; $iv = '...'; if (mcrypt_generic_init($cipher, $key, $iv) != -1) { $encrypted = mcrypt_gen...

 
You mean with Javascript @Greg?
 
@JoJo Yeah.
@KraziiKiiD A little bit, why?
 
I had luck yesterday with:
function refUP() {
    __doPostBack('UpdatePanel1', '');
}
 
@JoJo It isn't in an update though.
 
2:14 PM
@Greg i have this in PHP, and i need to decrypt that output in c#
$cipher  = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC,'');
$iv_size = mcrypt_enc_get_iv_size($cipher);
$key     = '...';
$iv      = '...';
if (mcrypt_generic_init($cipher, $key, $iv) != -1)
{
$encrypted = mcrypt_generic($cipher, $text_to_encrypt);
mcrypt_generic_deinit($cipher);
echo base64_encode(bin2hex($encrypted)); // i want to decode this
}
the text is encrypted this way:    text->aes-256->bin2hex->base64
in c# i need to do: base64->bin2hex->aes-256->text
@Greg and i tried a lot of codding and i can't decrypt that well
i'm stucked at bin2hex and aes-256 decryption
i've written this so far:
string data   = "base_64_encoded";
string fromBase64  = Encoding.UTF8.GetString(Convert.FromBase64String(data));
now from fromBase64 i nee to get into bin2hex
and after in decrypt aes-256
a little help?
 
Is it a normal AES-256 encryption?
 
yes.
32 bytes key long, and iv same
 
0
Q: c# bin to hex and hex to bin

omfarI have a problem about converting binary to hex then hex to binary. For example I have an image file. First I want to convert that image to a hex string, then I want to insert this hex string to database. When a user wants to get that image file, the program has to read the hex string from the da...

 
@Greg i've found this for bin2hex decrypt
public static byte[] StringToByteArray(string hex)
    {
        int NumberChars = hex.Length;
        byte[] bytes = new byte[NumberChars / 2];
        for (int i = 0; i < NumberChars; i += 2)
            bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16);
        return bytes;
    }
but idk how to grab the string from byte[]
 
encoding.***.getstring(byteshere)
 
2:27 PM
yes but noething gives right output
 
You're doing it wrong ;-)
From what to what are you trying to go?
 
the data is base64->bin2hex->aes-256->text
 
Why 'bin2hex'?
 
that's the encryption algorithm
 
base64 is a form of binary encoding in representable characters too.
 
2:29 PM
those 3
 
any way to work as code first on Visual Studio 2008, any ORM is fine !
 
but now i need hex2bin and after
 
i need bin to aes-256
 
PHP's bin2hex takes a byte[] and converts it to a string representation (0abf, etc).
 
2:30 PM
yes, i have it from base64
and now to bin
i've one that too
 
You're not reading @KraziiKiiD
bin2hex and base64 both convert binary to string representable characters
 
@RoelvanUden i saw the link Greg sent me
 
It's useless to use BOTH.
 
1 message moved to Trash can
@AppDeveloper What are you blabbering about?
 
well, does any ORM framework supports code first on .net 3.5
 
2:32 PM
@RoelvanUden hmm i'll leave it like that then
 
i need code first approach
but cant use vs 10 or above
 
I googled "code first" and all that came up was EF
that's an ORM
 
@KendallFrey Except they have coined the "Code First" / "Design First" approaches for Entity Framework.
@KendallFrey So now when you type those EF usually appears, even if you don't want it to.
 
@KraziiKiiD So you took a base64 string. Decoded that into another string. Now you hex2binned that string, and you finally have a byte[].
 
@AvnerShahar-Kashtan yes i do have that
 
2:34 PM
Now you feed that byte[] to the decryptor.
 
yes but i dont have a good aes-256 decryption, i didnt find one
 
It's build-in.
 
You're using Rijndael-256. .NET has it built in, I think.
 
ok i will try it 20 times =]
 
5
Q: C# Example of AES256 encryption using System.Security.Cryptography.Aes

TeamWildI need to implement AES 256 encryption /decryption and I haven't been able to find an example that works correctly. MSDN suggests that I should use the AES class. The Rijndael class is the predecessor of the Aes algorithm. You should use the Aes algorithm instead of Rijndael. For more inform...

 
2:37 PM
@AvnerShahar-Kashtan allright
@AvnerShahar-Kashtan im a little stucked here, am i doing something wrong?
    byte[] fromBin2Hex = StringToByteArray(fromBase64);

    var aes = new AesManaged();
    aes.Mode = CipherMode.ECB;
    aes.IV = new byte[32];
   aes.Key = new byte[32];
  aes.Padding = PaddingMode.None;
 var dec = aes.CreateDecryptor(Encoding.UTF8.GetBytes("key_value"), Encoding.UTF8.GetBytes("iv_value"));
 
Now you have your decryptor - use it!
(I assume "key_value" and "iv_value" are the same as the "..." in your PHP above.
 
yes
but it says that Specified initialization vector (IV) does not match the block size for this algorithm.
 
Your php seems to indicate that the ciphermode is CBC
 
2:52 PM
hmm right
but the key and the iv are both 32 bytes long
why it says that for iv?
 
Probably because ECB doesn't need a 32 byte block size.
I'm not a crypto expert, but the first step is to match the encryption's parameters.
$iv_size is 32 bytes?
 
yes,
and ECB matches
but CBC no
 
and the key size is also 32 bytes?
 
yes
 
Setting the IV and key twice is actually meaningless, I think.
The CreateDecryptor overload that you use will ignore those you set there, anyway.
Also, I'm assuming the key and IV are simple ASCII strings, so it's probably not a problem of UTF8.GetBytes being surprising.
 
2:59 PM
but there needs to be set am also iv length
 
Have you tried using the RijndaelManaged class? msdn.microsoft.com/en-us/library/…
 
im using it combined to get a aes256
 
right, so to get the actually iv and key byte
should i use ASCII instead of utf8?
 
Assuming you're not using any funky characters, there shouldn't be a difference.
 
3:04 PM
hmm i'll try it, and from the crypted text should i get utf8 string or the same ascii ?
 
I think PHP uses UTF8 by default.
 
Here's a similar but reversed situation:
5
Q: Php Decrypt a String from C# .NET RIJNDAEL 256

ActionOwlFixed it. $data = base64_decode(str_replace(' ', '+', $_GET['data'])); for whatever reason, Php was converting the +'s from the GET variablesinto spaces -- I am trying to decrypt a string that is being decrypted in C#.NET. The results of the code vary, There were several occasions where the...

 
im trying it
@AvnerShahar-Kashtan allright, i've done it. many thanks. :)
 
You're welcome.
 
4:13 PM
hello
will the C# compiler optimize an unused variable away?
it is the result of a JSON deserialize
and i only want to test if an exception is thrown or not
i don't think deserialize has side effects
 
4:27 PM
The deserialize call is a side effect, so it can't optimize it away entirely
it can optimize away the storage of the result in the current stack frame, but that doesn't really "optimize" anything since the call has to allocate it anyways
@RoelvanUden F# has quite a bit of open source tooling, btw
and in my mind, is much more readable than C# code (when both are written decently)
There's MonoDevelop and Xamarin Studio + bindings for emacs and sublime, etc
 
ok cool, thanks
 
People!
Top of Da Morning To Ya!
What is the easiest/safest/best way to create a new WinForm and show it attached to MDI parent without blocking the thread?
 
What is blocking the thread?
 
        private void policyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var form = new MvvmPolicy {MdiParent = this, WindowState = FormWindowState.Maximized};
            form.Show();
        }
it takes about two seconds (simulated) to create MvvmPolicy
so for two seconds, the MDI parent is frozen
 
you need to figure out what's blocking in the constructor
and push that work elsewhere and/or make it async
 
4:38 PM
I don;t want that.
 
hey guys i have a quick question, when i try getting from byte[] some string i get the specific string but after it im getting "\0\0\0\0\0\0\0\0...", why and how can i make stop getting that?
 
What I'd like is Task.Factory.StartNew() to return right away
but for soem reason it does not
        private void policyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Task.Factory.StartNew(() =>
            {
                this.Invoke((MethodInvoker) delegate
                {
                    var form = new MvvmPolicy {MdiParent = this, WindowState = FormWindowState.Maximized};
                    form.Show();
                });
            });
        }
 
@KraziiKiiD \0 is the zero character. If you're getting a string full of zeroes, chances are your bytes are all zero as well.
 
the parent still freezes
grabbing lunch
 
@KendallFrey they aren't !! im getting like this: "mystring\0\0\0\0\0"
 
4:40 PM
@KendallFrey You there! Figure it out!
@KendallFrey Pretty please ...
:P
 
@Darek That's sort of counterproductive, as you start a task bu right away go back to the main thread
is MvvmPolicy single-threaded?
 
cause I want the form to remain responsive
yes
why does the sucker freeze?
 
Because you're blocking the thread
 
should I put Task Factory call inside Invoke?
will be back in 20m
 
no, why would you start a task inside another task?
 
4:42 PM
well
parenty can open many mvvmpolicy forms
I don;t want UI to be frozen ... ever
 
If MvvmPolicy needs to be instantiated on the same thread that uses it, you'll just have to wait.
If you can modify the behaviour of it to be async, that would help.
 
@ReedCopsey I tried Xamarin Studio 5 with MVC 5 which, didn't really work. Would a F# variant work?
 
@RoelvanUden Haven't done a lot of web stuff - should be possible, though. See curtis.schlak.com/2014/02/04/…
@Darek What is in the MvvmPolicy constructor? That's the culprit
 
Yeah that's what I tried for C# on Xamarin, but that's still quite broken even following his steps. I don't expect my F# experience to be any better if so.
 
@RoelvanUden Yeah - not sure about asp.net on xamarin - haven't really tried
 
4:54 PM
You did some MVC F# stuff though by any chance?
 
ask in the F# room - there's enough people there somebody might know
 
Kendall, my problem still that..
MessageBox.Show(Encoding.UTF8.GetString(clean));
MessageBox.Show(Encoding.UTF8.GetString(Convert.FromBase64String(x)));
 
@RoelvanUden No - most of the stuff I've done is either client side or just service/backend type stuff
 
this 2 are the same
 
I don't really do web :)
and when I do, I try to use Websharper - since I really prefer it
 
4:55 PM
and here they aren't:
if (Encoding.ASCII.GetString(clean) == Encoding.UTF8.GetString(Convert.FromBase64String(y)))
                { }
cus the first one has after it those "\0\0\0\0\0"
 
ASCII and UTF-8 are different encodings.
 
Right thanks man :-) I'll just have to get to it and play around myself.
 
i tried both with utf8
any ideeas why they aren't the same in if statement?
 

« first day (1383 days earlier)      last day (3550 days later) »