« first day (1385 days earlier)      last day (3564 days later) » 
02:00 - 20:0020:00 - 00:00

2:23 AM
anyone here?
 
2:53 AM
I am
 
 
2 hours later…
4:34 AM
Hi guys !
 
 
3 hours later…
7:10 AM
Morning.
 
7:33 AM
anyone here... I have a small doubt in my C#.
I want to insert the datas into the sql database when the first time load only and not in other(database insertion is done by simply setting the src of Iframe) This what I tried...
protected void Page_Load(object sender, EventArgs e)
    {
        bool is_session = true;
        if (!IsPostBack)
        {
            if (is_session == true)
            {
                iframehidden.Attributes["src"] = "Default.aspx";
                is_session = false;
            }
        }
    }
Can anyone pls help me
 
@Shell you got a minute please?
 
8:15 AM
Just the following would be fine:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
iframehidden.Attributes["src"] = "Default.aspx";
}
}
 
yes @Marek i was in lunch break
 
@Illaya I haven't used that though, but that should suffice
 
@HowlinWulf its still inserted when second time load
 
@Illaya Interesting..
 
var spreadsheetLocation = Path.Combine(@"C:\Users\marek\Downloads\testExcel.xls");

var exApp = new Microsoft.Office.Interop.Excel.Application();
var exWbk = exApp.Workbooks.Open(spreadsheetLocation);
var exWks = (Microsoft.Office.Interop.Excel.Worksheet)exWbk.Sheets["Let1"];

exApp.Visible = true;

for (int i = 0; i < dt.Rows.Count; i++)
{
for (int j = 0; j < dt.Columns.Count; j++)
{
exWks.Cells[(i + 19), (j + 3)] = dt.Rows[i][j];
}
}
exWks.Activate();
 
8:19 AM
@Illaya You could maybe use a session variable?
@Illaya You doing ASP? MVC?
 
@Shell this is the final code, just wanted to let you know ;)
 
yes. how to do this
ASP @HowlinWulf
 
ok @Marek that's good
 
@Shell but it still has an issue, the Excel proccess somehow doesn't end itself. It is still in Task Manager even if I close that Excel which is opened by code. Dont you please know how to solve that?
 
you have to close application after finishing your process @Marek
 
8:23 AM
@Illaya like HttpContext.Current.Session[keyValue] = valueToStore;
 
@Shell yes, that worked, but is there any way to do it without closing App?
 
@HowlinWulf you mean like this??
protected void Page_Load(object sender, EventArgs e)
    {
        HttpContext.Current.Session["is_session"] = "True";
        if (!IsPostBack)
        {
            if (HttpContext.Current.Session["is_session"] == "True")
            {
                iframehidden.Attributes["src"] = "Default.aspx";
                HttpContext.Current.Session["is_session"] = "False";
            }
        }
    }
 
when you create the object of Microsoft.Office.Interop.Excel.Application() will automatically start the excel application. so, you must have to close it after finishing your stuff
 
@Illaya yes, if you could use it like that
@Illaya it sometimes required to be tied down more, like being under use of internal static prefixes
 
@HowlinWulf ok ok
@HowlinWulf oh know... still no change.. inserted in the second time tooo
 
8:31 AM
@Illaya Step through it in debug mode and see what it does
@Illaya That is because everytime you run, you set it to "True" as the first step
 
yes
 
@Illaya Which means that if (HttpContext.Current.Session["is_session"] == "True") will always be true, and will thus run every time
 
yes. how to solve this
 
protected void Page_Load(object sender, EventArgs e)
{
if (HttpContext.Current.Session["is_session"] == null)
HttpContext.Current.Session["is_session"] = "True";
if (!IsPostBack)
{
if (HttpContext.Current.Session["is_session"] == "True")
{
iframehidden.Attributes["src"] = "Default.aspx";
HttpContext.Current.Session["is_session"] = "False";
}
}
}
@Illaya Try that
 
@Shell yes but it waits also for user input if he wishes to edit the table. I Know there is exApp.Quit() command. But I believe it could stay open until user closes the app.
 
8:40 AM
@HowlinWulf thank you so much its working now
 
@Illaya Pleasure :) You could star the one that worked if you want, would appreciate it
 
hi guys
I want when I click checkbox my form listboxes scroll to selected item whose value = value I provide as text
winforms
 
9:10 AM
@HowlinWulf tnx
 
wsup @bhuvin
 
9:37 AM
@GotalovePHP - hey man doing well
u temme
hows life ? ?
 
Its good
 
 
1 hour later…
11:05 AM
hey, how do I create a vsmdi or testrunconfiguration file in Visual Studio 2012? I can't find a corresponding item in the add item dialog...
 
11:49 AM
1
A: How to set the SelectedItem when having databound ListPicker?

Chubosaurus SoftwareSince this is a two part question I will split it up into two sections. How to set the default Quantity in ListPicker (I am getting the Quantity of product from localstorage). You can set the SelectedItem only to an item in the ItemSource. Using your example, public partial class MainPage...

 
Guys any idea of any third party Web socket client ... ?
i mean the any one you have tried or heard of to be good ?
 
@bhuvin Why do you want a third party socket implementation o_o?
 
@RoelvanUden Because .NET doesn't have a working one.
@bhuvin WebSocket4Net I think is a good one.
 
@KendallFrey Eh? What?
 
What? It's true.
I think it works under specific situations, but it's simply not supported everywhere it needs to be.
 
12:03 PM
Right. Because it is tied into system level support from 8 onwards.
Roll your own @bhuvin. It's funny.
SignalR does use one, though, and runs everywhere. Perhaps look there.
 
@RoelvanUden - Actually to tell the truth .. I am pretty willing to roll my own one ... But for now i could do with is some existing ones .. .Already have too much of fire to handle for now ...
:P
@KendallFrey - Yeah looking through the same ...
Guys actually theres one thing :]
I have a Web Server and WebSocket server already running ...
I have a Services based structure for my app ... So i need to use the Websockets for the once which has got a big amount of data inclusive ...
So for such Services i am supposed to open a connection , get all the pages of data , and accordingly close the Web socket connection .. .
 
This doesn't sound like a use case for WebSockets
good old HTTP can do that
 
Kendall actually theres too much of data which is going to be taken and given ..
so for those dont u think its better to use Web sockets ?
 
I don't know why WebSockets would be better for big data.
 
and esp when i already have a Web Socket server working for other things also ...
@KendallFrey - Like i am needing more of your review on the same ... I am sort of new with little experience ...
 
12:10 PM
review on what?
 
Whether WebSockets will be prefferable in this case ?
 
I just gave you my opinion
 
2. If Yes , Then which are the situations under which it wont work ?
 
WebSockets won't work when TCP won't work, such as when UDP is ideal
 
oh ... @KendallFrey - So in that case why Http over WebSockets ?co
 
12:15 PM
HTTP over WebSockets sounds like a horrible idea
 
12:31 PM
wooo FRIDAY!
2
 
12:59 PM
@Steve hi sir
 
anybody see the new azure ui, its pretty neat... wish i could create a design like that.. atlas i am artistically challenged
 
@Steve yep i seen it
 
1:42 PM
how can I set selecteditems in listbox with multiselect if I have the value as text in winforms?
anyone active??
1
Q: How to set Multiple SelectedItem on Listbox?

MarchThe sample code like this: <asp:Listbox ID="ddlCat" runat="server" SelectionMode="Multiple" /> ddlCat.Items.Insert(0, new ListItem("Item1", "1")); ddlCat.Items.Insert(1, new ListItem("Item2", "2")); ddlCat.Items.Insert(2, new ListItem("Item3", "3")); ddlCat.Items.Insert(3, new ListItem("Item...

something like this but for winforms
 
same way probably
 
@Steve findbyvalue is not member of listbox
 
2:02 PM
Meeting time, aka break time. Sup folks
 
You've been a naughty boy @KendallFrey
 
I know everything
 
so any ideas guys?
totally stuck here
 
Why are you using WinForms?
Is it a requirement?
 
2:07 PM
yea
@RodrigoSilva
 
@RodrigoSilva Please explain how the universe works. I've been waiting for a GUT.
 
I am feeding it the value in code
did something like this
Dim noncashIndex() As String = noncash.Split(",")
For i = 0 To UBound(noncashIndex)
lstnoncash.SelectedValue = noncashIndex(i).Trim
Next i
but that won't work since selectvalue accepts one item
 
@KendallFrey It works just like a cat
 
How does gravity work with QM?
 
Oh VB, haven't seen that in a while :P
 
2:09 PM
:)
 
just use C# will convert
 
@KendallFrey Like a QM cat
Cats are the answer
 
You're pretty inept
 
:(
@GotalovePHP How does the question you mentioned earlier doesn't work?
And wouldn't it be easier to bind the IsSelected property to your own property?
 
:D
 
2:17 PM
@RodrigoSilva findbyvalue is not member of listbox in winforms
@RodrigoSilva how would that be done?
 
!!google winforms bind listbox properties to object properties
 
One of those should help you :)
 
@RodrigoSilva that will not do because my listbox should contain both display and value members so if I bind it to my array it will get only the values
 
Well, don't bind to an array then. Have a collection of instances of a class which describes your data
class MyItem {

public string DisplayName { get; set; }

public string Value { get; set; }
}
You should add the IsSelected property aswell, so you can bind to it
 
2:26 PM
@RodrigoSilva my values are coming from an xml
Is there no easier way am missing
 
You should build your application in a way that it doesn't matter where the values come from
 
@RodrigoSilva let me give you whole scenario then maybe you can point me in right direction
my form has listboxes which I want user to be able to store a template of how he made selections then next time you only need to tick use template.So I made it so that it writes the selectedvalues and listbox to xml then when you need to use the template just pick it from there
 
I stand by my previous suggestion :)
You might want to wait for somebody else, there probably is an easier way
But that's how I'd do it
But what do you find not-simple about what I said?
 
2:42 PM
@RodrigoSilva this comes closest
but the items dont appear as selected though
string[] words = textBox1.Text.Split(',');
for (int i = 0; i < words.Length; i++)
{
for (int j = 0; j < listBox1.Items.Count; j++)
{
if (listBox1.Items[j].ToString() == words[i])
{
listBox1.SelectedItems.Add(words[i]);
}
}
}
 
g'morning everyone
any experienced users of Coded UI tests?
 
@Darek Never really used it, but I know how it works.
 
2:57 PM
Can I code a coded ui test or do I always have to record it?
 
You can code it
 
one of my vendors, created an "extension" for it, but it runs at half-human-speed
it can't be normal, right?
 
Extension? Runs at half-human speed? What?
 
The test is fed by Excel spreadsheets
no more code
it takes a human to complete the test in 1h, while the automaton takes 2
 
You mean a coded UI test is following instructions in an Excel sheet?
 
3:05 PM
yep, definitions of controls to touch and actions to perform is Excel driven
 
You think this is a bad approach:

<div class="Container">
     <div class="Form-Row">
          <div class="Medium"></div>
     </div>
     <div class="Form-Row">
          <div class="Medium"></div>
     </div>
</div>

Then I've got:

.Container {
     float: left;
}

.Form-Row {
     clear: both;
}

.Medium {
     width: 46%;
     float: left;
}
You think that is a bad approach?
 
@RodrigoSilva what I find not simple is creating an xml that will hold both display and value member and matching them.am afraid I will get lost somewhere in that
 
How would I go about counting the items in a list? I want to run the LINQ equivalent of SELECT COUNT(company_name), company_name FROM listofCompanyNames GROUP BY company_name on a List<string> object.
So if the list has Tom, Tom, Harry,Harry, Harry, Dick. The output would be Tom -2, Harry - 3, Dick - 1
 
@abhi You should have a .count
 
Yes, but the count will simply give me 6 for the example I gave.
I want to have a count for each unique item in the list.
in SQL I would do something like this -->
``SELECT COUNT(company_name), company_name FROM listofCompanyNames GROUP BY company_name``
Ok. Found it.
``var q = AllTokens.GroupBy(x => x)``
.Select(g => new { Value = g.Key, Count = g.Count() })
.OrderByDescending(x => x.Count);```
Is this not working ?
``
i am testing something
``
 
3:22 PM
Well, I just deleted what I was about to write, but yes you would pipe the expression together with Linq / Lambda.
 
Why is fixed font not working?
Not it is. Strange...
 
3:43 PM
:D
 
4:09 PM
posted on August 01, 2014 by ericlippert

This will be my last post before I head off for my annual vacation in Canada; see you again at the end of August for more Fabulous Adventures in Coding! Last time on FAIC I suggested a rule for translating … Continue reading →

 
Anyone know the best way to see if Javascript is losing the binding?
 
hi guys, i'm working on a .net desktop application, i need to display an image after retrieving image from database.
i have a class library that contains classes that will be mapped with tables(i know this is not the good way to do things ...), in class Products, i have an Image field that will contain image retrieved from database. the problem is i can't create an Image(system.net.mimes.mediatypenames) , is there a way that i can do this properly ?
@Greg no idea ?
 
4:26 PM
@redaa Hm.
 
@Greg all tutorials ... do this with asp.net and not a .net desktop application
 
posted on August 01, 2014 by Jon Skeet

(Apologies for the horizontal scrollbar on the code… this is my first post using markdown on WordPress, and it’s really highlighted the fact that I need to make the content area wider. Will see what I can do…) A few days ago, I was watching Dustin Campell’s excellent talk from TechEd 2013, “Essential truths everyone […]

 
:D
 
HELP !!
 
you can't display an image in winforms? that seems easily google-able
 
4:39 PM
@Steve i'm not using winforms
it's a wpf application
 
oh, i seem to have missed that important piece of information in your description
!!google how to display imagine wpf
 
!!tell Steve google how to type
 
!!tell kendall he likes the cock because he's a flaming homo
 
4:41 PM
@Steve Command he does not exist. Did you mean: hi (note that /tell works on commands, it's not an echo.)
 
turned down!
 
no, turn that shit up
 
@redaa ?
 
@Steve sorry for my noob attitude :D but i can't find how to display it after retrieving it from a mysql database
sorry guys if my question seems stupid :/
 
ordered a computer desk online
ups delivered it to the office instead of my apt like a bunch of douche bag dick heads, now i have to lug that shit up 3 flights of stairs
or
6
3 stories
needless to say, hulk angry
@redaa I don't know WPF. But I do know that you can google for the answer and probably 2000 results showing you how to do it, with step by step instructions, will show up
displaying an image (IMAGINE) isn't some corner-case, its common
 
4:50 PM
@Steve the problem is that i can't declare an image in my class because : cannot declare a variable of static type 'system.net.mime.mediatypenames.image'
 
!!google "cannot declare a variable of static type 'system.net.mime.mediatypenames.image'"
 
no answer to that question @Steve :/, what other class i can use ?
to display the image
 
not a clue
 
and sorry for bad english
 
4:52 PM
i could google it for you, but then i'd have to google it for you
 
ok no problem
 
Hey @Steve, you not been around much lately?
or is that me that's not been around
 
nah its me
been busy
its friday and all i want to do is go home and game
 
should live in GMT
I'm already home :D
 
haha :p
im thinking of taking pto, but i took monday off and don't want to waste all my days
annnnd ebay shipped my vacuum cleaner, wooot im old
 
5:05 PM
ebay seems convinced that I am in love with Dysons
 
lol
thats what i got :)
 
dyson parts, whole dysons, pictures of dysons, books written by people called dyson
 
haha
 
doesn't matter what else I look at, it doesn't refresh their targeted content
 
must be a sign
 
5:07 PM
hey y'all
 
o/
 
heyo
 
@Pheonixblade9 That didn't make much sense. Maybe you meant: hi
 
5:15 PM
@Pheonixblade9 Hello !! I am Caprica. Caprica Six. How are you?
 
!!hello
 
@Pheonixblade9 That didn't make much sense. Maybe you meant: help, tell
 
5:51 PM
Can someone tell me how this looks?
        private string CleanField(string field)
        {
            List<string> prefix = new List<string>() { @"mailto:", @"http://", @"www." };
            string subject = @"?subject";
            string[] cleaned;

            foreach (string item in prefix)
                if (field.Contains(item))
                    field = field.Replace(item, "");

            if (field.Contains(subject))
            {
                cleaned = Regex.Split(field, subject);
                return cleaned[0];
 
I could use some input. I have an ObservableCollection<> with class instances implementing INotifyPropertyChanged. Everything that changes has to be communicated to another process/machine. What would be the laziest way to achieve this?
 
:D
 
I'm fairly confident I screwed up my Regex. If I do: ?\bsubject\b shouldn't that split at ?subject?
 
what do you mean, split at?
 
Well, I have a crazy long email, which has this lovely johndoe@gmail.com?subject=asgkjbaskgasjkgasjkgasjkbgasjbgasjkgbasjb
 
6:04 PM
@RoelvanUden application running on another process/machine has to subscribe to the classes in the collection NotifyPropertyChanged?
 
I want to split it at the ?subject and grab the first index.
 
@Greg after the split, the left side will be in the index 0, and right side will be in index 1
so I think you want cleaned[1] after that split
 
@NETscape No, I want the email, I don't want the subject.
 
ahh, and that's not returning the e-mail?
 
@NETscape I figured out the Regex.
I just did @"[?]/bsubject/b"
 
6:09 PM
@Greg [?]subject ?
@Greg you could use a look ahead too
(.*)(?=\?subject)
 
5 oclock, why are you so elusive
 
@NETscape ProcessA has an observable. ProcessB wants to have a clone of the state. ProcessA makes a serializer to pick up all changes and send them to ProcessB via a TCP connection (or something). Like that. Except without all that much effort?
 
you would have to send an update to ProcessB everytime a setter in the object that implements INPC gets called? ya?
 
6:24 PM
i think that's the easiest way
 
Yeah but what about serialization etc, etc.. is there nothing that can help out with mapping, serializing, etc :/
 
@RoelvanUden implement ISerializable on your objects?
 
@NETscape Ew. I'll go for XML serialization then :P
Remember lazy :P
 
In Visual Studio, how can I find all references which set a field?
 
@KendallFrey Right click the set field and click find usages
Disclaimer: May or may not require ReSharper
 
6:32 PM
I usually just Ctrl + Shift + F, Match case, match whole word, and type "fieldName = " lol
 
I do that too @NETscape :P
 
@RoelvanUden "set field"?
 
I said FIELD
 
Oh excuse me for missing a detail and trying to help. I'm sorry, please forgive me!
 
6:35 PM
No, forgiveness is banned on Fridays
2
 
@KendallFrey ctrl f "field ="
 
guess that's as good as I can get, since the one I'm looking for has to be in generated code
 
@RoelvanUden it's okay, we still love you
 
7:02 PM
apparently our current system has an allotted 4-hour nightly build window. Eesh.
 
7:15 PM
Hello, all.
I have a project where I am reading in the contents of a file and manipulating it to hydrate some data objects. I am using LINQ quite a bit, and customer now wants a progress indicator.
Since I have something like this, I don't have the availability of progress reporting :DataList = lines.Skip(1).Select(line => new DataRow(line, sampleNumber++)).ToList();
 
I assume "hydrate" means "create"?
I don't think you want to literally pour water on your RAM
 
It does, essentially the DataRow class only holds data, it does not processing.
err it does no processing
 
That code would be just as clean as a foreach loop
 
I was hoping to see if there was source for LINQ methods so I could see if I would be losing any performance by translating that line above to a foreach loop
 
There is. You won't.
 
7:20 PM
Terrific.
Thanks!
 
@CodeWarrior if sampleNumber is just the index, there's already a Select overload that provides an index for you - you could avoid the side effects that way
 
7:36 PM
@ReedCopsey Unfortunately in this case it is offset as these objects will eventually be appended to a larger collection.
I initially wanted to use the overload with the index cause I thought it was cool.
 
I'd use a foreach loop then
 
i gave my device an invalid subnet :( I can't force set a bad subnet on windows can I?
 
Hmm. About that I don't know. Can you change the subnet on the device or does it think it is on that wonky subnet and your system can connect to it because of it?
I have seen one or two devices that if given invalid subnets will silently translate them to the nearest valid subnet. Have you tried masks near to to the subnet you set on the device?
 
hello guys, i have a question. i need to get bytes from a string. The string has 64 characters (32 bytes long), and if i'm getting to right bytes from it (i need to get 32 bytes), i will get a byte array. I really nee to get that byte array. I tried with simple encoding, like, utf8.GetBytes, ASCII.GetBytes etc. But none of them returns the spicific byte array i need. Here is a string from which i need to get those bytes (there are many strings generated). Please if someone knows how to help me.
string : dad7e13bdf11581908ef3aa91df34259487ee406
 
@CodeWarrior I can easily reset to factory defaults, but I'm trying to remotely configure device and to do that both device and PC have to be on same subnet. but the device has an invalid subnet and windows prevents you from setting an invalid subnet.
 
7:51 PM
@KraziiKiiD What is your expected output for that string?
 
@JohnKoerner i dont know that either...the output should be a byte array. That byte array is the key to a cipher which will decode some messages..
 
@NETscape The easiest thing would be factory reset, I think. Do you have a recent backup of config? If so, I would RESET, restore settings and go from there. Is there no serial communication to the device?
@KraziiKiiD What is the output when you call UTF8.GetBytes(yourString)?
 
@CodeWarrior 100 97 100 55 101 49 51 98 100 102 49 49 53 56 49 57 48 56 101 102 51 97 97 57 49 100 102 51 52 50 53 57 52 56 55 101 101 52 48 54
but is for this i've sent now: dad7e13bdf11581908ef3aa91df34259487ee406
 
That looks like a byte array to me.
 
yes
i need to get a specific byte array from that string
 
7:55 PM
And you want to get the last X bytes from the array?
 
but i dont know with what cus utf8 and ascii arent good
no
 
i need to transform this string into a byte array
it doesn helps
 
That is a byte array
 
ok let me tell you other ways
 
7:58 PM
Can you tell us what exactly you're trying to get?
Like.. an example?
 
yes
 
Indeed. Unless that is actually "100 97 100 55 101 49 51 98 100 102 49 49 53 56 49 57 48 56 101 102 51 97 97 57 49 100 102 51 52 50 53 57 52 56 55 101 101 52 48 54", that should be a byte array, that is what most of the overloads of GetBytes outputs.
 
i will tell you other ways
i know but i need to matches them
so let me write
 
It appears that you want the byte array for the hex number that corresponds to the string represented above
 
let me write
 
7:59 PM
thou shall write
 
02:00 - 20:0020:00 - 00:00

« first day (1385 days earlier)      last day (3564 days later) »