« first day (1125 days earlier)      last day (4049 days later) » 

15:03
hey there could anybody help me out with a small problem i have please
@abhi just copy the link
@AndyOHart, best to just ask your question
okay so I have this class
    public class City
    {
        public CityResponse ParentResponse { get; set; }
        public string id { get; set; }
        public string country { get; set; }
        public string region { get; set; }
        public string city { get; set; }
        public string latitude { get; set; }
        public string longitude { get; set; }
        public string comment { get; set; }
        public bool wasThereAnError { get; set; }

        public class CityResponse
        {
            public string status { get; set; }
and i want to be able to print the elements
like id and country etc
but im not sure how as I have a city.page class that has a
City.CityResponse city = await wr.GetCity(url);
yeah i want to be able to print the properties
@AndyOHart Please, edit and press Ctrl+K to format your code.
there i fixed it thanks i didnt know you could do ctrl k
yeah basically
i want to be able to do
        if (city.status.Equals("error"))
        {
            myTextBlock1.Text = "Status: \t\t" + city.status + "\n\nMessage: \t" + city.message;
        }
        else
            myTextBlock1.Text = "Status: \t\t" + city.status + city.cities.ToString();
and print the elements
15:12
Do you have a way to match IDs ?
Because you could always cities.First(f => f.id == the id you could match).message...
yeah i was going to try a foreach
however
it said something about not having ienumerable
But you want to retrieve a city from your List<City> right ?
yep!
1 sec
So, just use your variable that is a List<City> to retrieve the one with the matching IDs...
it wouldnt let me access it for some reason
my for each is like this
            foreach (City c in city)
            {
                myTextBlock1.Text = c.id;
            }
woah wait a second that messed up
there i fixed it
so for example i wanna print the id
15:16
city is a List<City>?
yep, what @ton.yeung says
ah your a star man
that worked!
that worked great
Hello,

I am having a problem with some filewatcher events. The filewatcher has 4 events. Created, Changed, Deleted, Renamed. Now my Created event works fine, but the rest doesn't although the application does run the events. I made it so when the created event is activated, the file in the 1st directory will automatically be copied to the 2nd directory. And so on with the rest of the events. Like for example, this is my Deleted Event:

private void fileSystemWatcher1_Deleted(object sender, FileSystemEventArgs e)
People never want an introduction here but when I post this I always feel like I am rushing things...
Loko, why don't you just post a question on SO... ?
15:18
@ton.yeung ba dum tss
Well I am not sure if I need to add in more information since I dont know where the problem is
@Loko The event doesn't get called ?
yeah should name it better but im sort of confused as to how this is all working at the moment
i will play around with it tho
ok
This isnt my whole code btw
Just trying to understand your problem
15:21
I do call the event
Right.. but does the code triggers it ?
Like, does the event really get fired /
room topic changed to C#: Greetings! ;) [.net] [asp.net] [asp.net-mvc] [c#] [entity-framework] [linq] [visual-studio] [wcf] [wpf]
I'm sleepy and I can't quite express myself
Yep
Everything gets called
even the File.Delete (target + e.Name);
it triggers
So what is the problem ? ._.
15:25
It doesn't delete the file in the 2nd directory...
I'm not quite sure but, can you check if your code, after creating the file, still has the file opened in the memory?
how?
exactly?
I never used the filewatcher
But since it probably uses Stream, try to find some kind of .Close()
Or simply dump the variable that created
ok
thanks
I don't know if that will solve your problem, but it won't harm anyone to try :D
15:28
yeah ok i'll try some things
so now that i have an List of cities, how can i go about adding them to a list view displayed on the app?
You can still Foreach the cities and ListView.Add(); Or something like that
i have no idea what either of them are tbh :S
just we got an assignment in college to make an app that makes json requests from the lecturers api
he wants like a scrollable list that shows the cities and its like buffered or something
Don't evangelize MVC ._. Make them study first
MVC is really hard at the beggining, but it is amazingly beautiful
If you're used to winforms and webforms, mvc is really hard because you need to follow the OO normalization
I still can't decide whether something belongs in the view model or not...
15:32
Just like WPF
I found it kind of confusing at the start as well.
Runtime.InteropServices.Marshal.GetHRForException(ex)
@ton.yeung Exactly, that is why I said about winforms and webforms.
@ton.yeung Something about a programming contest
15:33
But really, MVC is becautiful
Yes yes
mvc is awesome
Yeah, I know that feeling.. Since I can't MVC, I simply HTML and JS everything
Let JSON solve my problems
@AndréSilva you can still use MVC without .NET!
I really can't get passed those @Something { }
It really screws my brain
15:37
@ton - How do you host your applications? Locally?
colo? Is that like a version of yolo?
I think the question is more like how do you do server side validation?
@TravisJ you only colocate once?
haha
I cant do listview.add
1
Q: How to Bind List<string> into ListView in WebForms

rofansmanaoI have a List<string> collection that I would like to bind into my ListView. Below is the markup for my ListView: <asp:ListView ID="lvList" runat="server"> <LayoutTemplate> <div id="Div1" runat="server"> <div ID="itemPlaceholder" runat...

@ > <asp: imo
15:40
Hello, I had a question about using MVCContrib Grid. I am sorting the grid as per documentation, but wanted to know how do I pass additional parameters while sorting. this seemed to work right out of the box for MVC2 but isnt for MVC4
0
Q: Passing additional parameters while Sorting using MVCContrib Grid

frictionlesspulleyI am using MVCContrib Grid for MVC 4 and am facing an issue with the sort option available on the grid check documentation here Consider a view model such as public class Order { public int OrderId { get; set; } public string Name { get; set; } public string Status { get; set; } ...

Kind of hard to tell what you are asking there. It isn't clear how your view model is being used in the sort method.
how can i make items added to a list view have a larger font?
@AndyOHart set the font size
i have it set to 48 but the text size hasnt change
changed*
i set it in the designer properties
set to something bigger. Try 2389462935
15:45
nope didnt work
does the text property in the listview in designer make the text bigger for items?
make it as big as you can
or do u have to do something different for item
@ton.yeung Ahh yes... I am not sure what we use...
I hate MVVM sometimes
@TravisJ unless I am reading this wrong the .Sort() method accepts only GridSortOptions class which has only Direction and Column. this generates a link with the parameters Direction=xxx&Column=xxxx
hello world!
15:48
nice application
@Loko You deal with Raspberry Pi?
@frictionlesspulley - However, your Model you reference does not seem to contain the same fields that you show in your example view model.
@frictionlesspulley - You can place a filter on the status field by using a custom filter in the getter
@TravisJ you mean to extend GridSortOptions ?
posted on November 14, 2013 by Eric Lippert

Last time we showed how you can take any two coprime positive integers x and m and compute a third positive integer y with the property that (x * y) % m == 1, and therefore that (x * z … Continue reading →

16:04
@TravisJ I updated the question with all more details
Heylo all
@ton.yeung I'm looking for Thanksgiving music
I can't take it seriously lol. All of the songs just make me laugh
would rather dubstep than techno
Some techno songs are good for sports. Like Sandstorm.
Other than that, I find them kinda boring.
16:09
i am learning c# and i would like to practice more by developing , could you please suggest me a website where i can work with other people developing c# projects
Dubstep is good for just chilling.
@ton.yeung There is not really thanksgiving music
I am dying over this one
im not a fan of using _initializing = true; I wish I could write`dontFireCallbacksUntilThisShitsDone(this){ .... }`
whats up friends
@ton.yeung You : Caprica Six :: Overly Attached Girlfriend : Poor Boyfriend
16:11
It didn't let me do it at first...
is that you
:)
The black guy is ridic
Thanks @ton.yeung
@JLott booo
DO IT
16:14
lern2realmusic
I laughed so hard
I didn't say it was good.... lol
I boreded so hard
Morning.
The comments are the best part
"My mom walked in and I started watching porn because it was easier to explain"
6
Porn is pretty easy to explain.
16:15
@SpencerRuport Please explain
"I was horny."
lol
But, but, watching porn doesn't make you unhorny.
You're doing it wrong!
@TravisJ Check out that GIB.A Stock this morning ;) 39.90 +2.28 +6.06%
@JLott Arlo Guthrie Alice's Restaurant - that is about thanksgiving.. Or on thanksgiving
16:19
@Ryan :D
for app developement if i add items to a list how can i do stuff for that particular item when i click on it
for example i want to load city data depending on what list item is clicked
@AndyOHart data binding
well like i want the listview to be displayed so that i guess
so like when you click a box it will display information about that item
event handlers
@AndyOHart What framework? MVC? WPF? Winforms?
16:28
i think its winforms?
its a windows 8 app like
WinRT?
XAML?
xaml yeah
WPF or WinRT?
so i have designer view and
all
16:29
its different for each framework
You either need to handle the click event, or handle the callback with a binding in your viewmodel
@AndyOHart You either need to add details to your question, or add details to our answers. Up to you which is easier.
well i have a list of cities
and right now i have the listview displaying each city name in the app
but i want to make it so when i click on one of the cities
it will load data that is stored in the list of cities
so im not sure how to make it so that when an item in the list view is clicked it gets that specific info
Say, how do you get the local IP that is going to be used to send a connection over to a remote IP?
@AndyOHart We aren't either...
@AndyOHart What does your code look like to display the list of cities?
16:36
sorry ha
        private void Print_City(City.CityResponse city)
        {
            if (city.status.Equals("error"))
                myTextBlock1.Text = "Status: \t\t" + city.status + "\n\nMessage: \t" + city.message;
            else
            {
                foreach (City c in city.cities)
                {

                    if (city.status.Equals("error"))
                        myTextBlock1.Text = "Status: \t\t" + city.status + "\n\nMessage: \t" + city.message;
                    else
                    {
@ton.yeung Let me elaborate. I am making a UDP client that is going to send a packet to 1.1.1.1 and I need to know over which local network interface the packet will flow.
@AndyOHart ok, what is the button called? Or do you want to just click the item?
Also, it looks like your displaying stuff in a giant textbox, not in a list view
@RoelvanUden just for normal c# desktop clients? or servers?
@CharlieBrown Desktop clients are fine.
@CharlieBrown yeah that example code is from a seperate class that is used for just displaying the City, but I will be basically using that code to display a single city
so for cities i get them like this
                City.CityResponse city = await wr.GetCities(url);

                foreach (City c in city.cities)
                {
                    myListView1.Items.Add(c.city);
                }
            }
that adds them to the list but im not sure how i can make it so each item can be clicked on and then print out the city info like in the other code example i gave
@AndyOHart myListView1.SelectionChanged += <tab>
That will create an event handler for you, that will listen for changes to the selected item in the list. Inside that method you can do whatever it is you need to do.
@RoelvanUden seems like you can get the list, but no guarantee whether thats the interface the client will use or not (in the case of multiple)
16:46
@CharlieBrown
i have a method auto created called
private void myListView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{

}
@CharlieBrown Yeah that's pretty much the issue I'm having too. I need to figure out which interface is used to route the packet to :/
is that the same thing?
@AndyOHart yep, you got it
@CharlieBrown ah okay i see! so inside of that method, is sender the box that was clicked? so if i wanted to access the city<list> should i pass that as a parameter?
@AndyOHart Inside that method, you can look at myListViewItem1.SelectedItem, that will be the City
var city = (City)myListViewItem1.SelectedItem;
16:50
@JLott That is a horrible song.
I've finally found one benefit to ASP.Net Forms.
At least with Forms you know people aren't styling using object IDs.
...unless they set the clientid
@SpencerRuport I'm trying to find a horribly painful Object not set to an instance of an object. error.
@CharlieBrown - That's nearly impossible to do in a .css file.
@Greg - In ASP.Net Forms?
@Greg The worst
16:55
I'll try that now man thanks so much
@CharlieBrown yeah so it didn't work
i had this var city = (City)myListView1.SelectedItem;
myTextBox2.Text = city.id;
@SpencerRuport Yeah, in a Content Management System.
@JLott It is like two words. No lyrical value except a catchy beat.
and i got this error
Additional information: Unable to cast object of type 'System.String' to type 'CityApp.City'.
@ton.yeung All the Stack Trace says:
[H3-MAINSTSOFTWA][Thread:8][ERROR] DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.   at DotNetNuke.Framework.DefaultPage.InitializePage()   at DotNetNuke.Framework.DefaultPage.OnInit(EventArgs e)   at
System.Web.UI.Control.InitRecursive(Control namingContainer)   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
any idea
That is literally all it tells me.
16:58
eesh. Not fun.
@Greg - That can happen if a using statement swallows an exception and then you try to use something which you expected to be built from inside the using statement. Was that scenario possible there?
@TravisJ Not sure, ironically. I have a site that is working perfectly. All I did was copy that folder, to another folder, automate the creation of a new subdomain and site bindings, and then rewrite the web.config to point to the new database.
@ton.yeung Manually it works.
@AndyOHart did you get an error?
Unless, the part that rewrites the config file modified something it shouldn't have.
yeah
Additional information: Unable to cast object of type 'System.String' to type 'CityApp.City'.
@CharlieBrown Here is the code i had
@CharlieBrown

        private void myListView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            City.CityResponse city = (City.CityResponse)myListView1.SelectedItem;
            Print_City(city);
        }
it gives me the error the city object is assigned
17:10
@AndyOHart sorry, your original code confused me and I thought city.City was an object, when its just a string.
@ton.yeung Yeah, except the only part that could cause the issue would be the rewriting of the web.config.
private void myListView1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string city = (string)myListView1.SelectedItem;
            Print_City(city);
        }
@ton.yeung Yeah, that is what I was thinking.
Do you think that the CMS may be holding onto the old web.config before I delete it, then write the new one?
@CharlieBrown That's great it worked. It prints out the selected items name, so if the listbox item has the text of "America" in it, it prints out america, but since i want to access the properties of the city such as id and country and latitude and longitude, how would i do that? should i pass the city to the selected item somehow
                StringBuilder build = new StringBuilder();
                using(StreamReader reader = File.OpenText(Path.Combine(target, @"web.config")))
                {
                    char[] readResult = new char[reader.BaseStream.Length];
                    reader.Read(readResult, 0, (int)reader.BaseStream.Length);
                    build.Append(readResult);
                }

                build.Replace("connectionString=\"Data Source=H3-MAINSTSOFTWA;Initial Catalog=Parent;User ID=Default;Password=\"",
17:14
@AndyOHart myListView1.Items.Add(c); instead of c.city
then you can use my original suggestion and cast to (City)
@ton.yeung That File.Move part, maybe it doesn't like renaming it then deleting instead of using the new web.config.
Also set the myLIstView1.DisplayMemberPath="city"
@ton.yeung I will, question which System.IO function will open and modify the same file rather then do it the way I did.
Isn't there an IO that will open, delete the contents, then rewrite the contents in the same folder.
@ton.yeung Hm, I suppose I'll need to Google for it then.
Shit, I think google chrome just removed the "New Dialog Style" in chrome://flags . I can't disable it any more.
Google is now literally objectively physically hitlerally worse than hitler.
MF! corporate network whackos blocked Trello.com. How can that possibly be 'unacceptable use of the internet'?
17:32
@CharlieBrown thanks il try that when I'm home man really appreciate it
Works fine for me locally. Sounds like an ops problem. I'm going to lunch.
I think I'll just print that out on little cards
and hand them out when my code breaks.
Does anyone have any experience with ASP.Net Forms client side validations that suddenly stop firing?
hello everyone,
I want to conditionally initialize a variable for e.g.
MyClass a = new MyClass()
{
a.X == true ? a.y = 4 : a.y ==nul;
}
any ideas?
I could always do
MyClass a = new MyClass()
{
a.Z == true
}
if(a.X)
a.y = 4;
It's like the auto-complete shuts it off.
but tht sucks
17:44
@jaminator what are you trying to solve?
basically conditionally set a.Y when creating MyClass object
public MyClass(int x){ if (x > 0) y = 1234; }
use the constructor
Will these directives be enforced even if commented out?
#if !DEBUG
i think so
/*#if !DEBUG
[Attribute]
#endif*/
so that will still add the attribute?
17:48
nope, it doesnt work, just comments out the conditional
Can you restate that?
why we have to use attribute? What is the use of attribute
@prafulsurve - Thanks for your insight.
@CharlieBrown error
does the error say anything useful? lol
17:52
@CharlieBrown - A ha, found a missing one :D
(as in it wasn't commented out)
@CharlieBrown

I have an overridden ToString method inside my city class like this

        public override string ToString()
        {
            return "\n\nID: \t\t" + id + "\nCountry: \t" + country + "\nRegion: \t\t" + region + "\nCity: \t\t" + city + "\nLatitude: \t" + latitude + "\nLongitude: \t" + longitude + "\nComment: \t" + comment;
        }
can i use that or will i have to print out each element seperatly
when you use it, does it break?
@AndyOHart I would think that you dont need that at all
how come?
@TravisJ No, but it applys the attritbute still
@AndyOHart I can't see where you would need it, I rarely use it for anything for some 12 years, other than debugging
17:55
@CharlieBrown - Wait, so the attribute is being applied even though the area is commented out?
@TravisJ ah, your right, i was not using multiline comments
@CharlieBrown I need to display the properties of the city on the screen though
success!
@AndyOHart The general approach is bind the entire object to the listview, then override the template to display the correct information
override which template?
17:57
Ha ha :D
@ton.yeung thats what kills me... we dont have one... so I use trello instead
0
Q: How to locate house in 3D Map correctly?

Gelo VolroI've done my 3D map generation in WebGL/THREE.JS project and have a new issue with the locating buildings. I have the data about building position ( its polygon ) from DB server, but first of all I want just to locate not the polygon data, but a simple cube. The aim is clear is as a crystal: to ...

@AndyOHart In the xaml view for the ListView, you can define what each of the items in the list will look like
@ton.yeung more general, imagine yellow stickies in columns
@CharlieBrown how can you do that when the listview items are generated at run time
@ton.yeung true, but no methodology. I use it for xmas shopping lists and god knows what else
17:59
could be nice if vala room were made
@AndyOHart Exactly!

« first day (1125 days earlier)      last day (4049 days later) »