« first day (1416 days earlier)      last day (3515 days later) » 
00:00 - 15:0015:00 - 23:00

12:00 AM
Still not updating :(
 
remove the binding, put a flat value instead
does it show at least ?
Content="100"
 
It still shows up as 50
which is the value money is set to.
For some reason I have it set in the constructor
public Game()
        {
            this.money = 50;
        }
 
Can you show me your updated constructor ?
<ListBox x:Name ="produceListBox" HorizontalAlignment="Left" Height="270" VerticalAlignment="Top" Width="142" SelectionChanged="produceListBox_SelectionChanged" ItemsSource="{Binding vegShopList }"/>
Does the vegetables appear correctly ?
produceListBox.ItemsSource = thisGame.vegetables;
Why is there a duplicate ?
 
updated constructor?
 
the produceshop constructor
the current one
 
12:15 AM
public ProduceShop(Game game)
        {
            thisGame = game;



            InitializeComponent();

            DataContext = game;

            thisGame.addFuckTonofVegetables();

            produceListBox.ItemsSource = thisGame.vegetables;
            produceListBox.DisplayMemberPath = "FullName";
            moneyLabel.Content = "$ " + thisGame.Money;
            this.Hide();
            this.Show();
        }
I'm not sure why there is a duplicate, learning remember? I am probably doing a lot of things wrong haha.
 
ItemsSource="{Binding vegShopList }" is useless since you already have produceListBox.ItemsSource = thisGame.vegetables;
 
Oh, didn't know.
 
The binding wouldn't have worked anyway. By the way, use ObservableCollection instead of List, so when you change the ObservableCollection, UI is updated
remove this.Hide() and this.SHow()
remove moneyLabel.Content = "$ " + thisGame.Money;
and try again
Yeah, that's it
moneyLabel.Content = "$ " + thisGame.Money; is the problem
 
Where do I use observable collection?
 
<StackPanel Margin="10">
<TextBox Name="txtValue" />
<WrapPanel Margin="0,10">
<TextBlock Text="Value: " FontWeight="Bold" />
<TextBlock Name="Displayer" Text="{Binding Path=Text, ElementName=txtValue}" />
<Button Content="Change !" Click="Button_Click"/>
</WrapPanel>
</StackPanel>
private void Button_Click(object sender, RoutedEventArgs e)
{
Displayer.Text = "Changed !";
}
In your XAML, you declared the content of moneyLabel is a Binding object
with parameters Path = Money
but in the code behind, in the constructor, you overrided it, by assigning it a string value
Read this, in order to show a dollar instead : wpf-tutorial.com/data-binding/the-stringformat-property
 
12:27 AM
It worked.
I took the constructor out.
I could cry right now, been stumped on that for a long time.
I still don't know why it did that or why it did that.
 
To make it short :
In order to synchronize two properties, a third object is created : a Binding
the Binding object has two references : the Source object and the Target
it has two additional references : a DependencyProperty of Target (TextProperty, ContentProperty, etc), and any property of Source
Source must either implement INPC (INotifyPropertyChanged), or its property must be a DP (DependencyProperty)
When you write Content={Binding Money}
You create a Binding object and put it in the Content property
the four references are :
Target : the object where the binding is declared (moneyLabel)
TargetProperty : the property where the binding is declared (Content)
Source : if not specified, it is the DataContext of the Target (so, in our case, it is your Game object, thanks to DataContext inheritance. Remember, you wrote DataContext = game)
SourceProperty = the property of the Source. in our case, it is the Money property
It would have perfectly worked, but since, in your constructor, you wrote : moneyLabel.Content = "$ " + thisGame.Money;
You removed that Binding object
and put "$50" instead, inside the Content property
as long as the Binding object is inside the property of the Target object, it works, and it keeps the synchronisation active
but if you remove it ...
it stops.
Sorry
Check the last link instead
There are a few pictures
Regarding your question about ObservableCollection : wpf-tutorial.com/data-binding/responding-to-changes
 
I'll read that in a sec, thanks for the help
 
It is 2:40am here
I'm a little tired, so I wish you a good night :)
 
 
8 hours later…
8:28 AM
Hi guys
can anyone help me with this
1
Q: Using “bindingRedirect” in app.config to redirect System.Net.Http references to a portable version

Samy S.RathoreI am working on a Windows Phone 8 project which has a PCL project as its business layer. The business layer project is shared with the Android(Xamarin) project solution, and uses a HttpClient which we realized is not available in WP 8 projects. So according to the blog here we decided to go with...

 
9:20 AM
wutuuuuuup
 
9:32 AM
hi guys, im trying to send some keys to an external windows without setting it as foreground windows, and my windows app sends sometimes 1927 (which is good), but sometimes sends 19927 (wrong), or (19227)..its not good, can someone help me? picpaste.com/pics/b-fExjoHF4.1409563753.png
 
9:54 AM
@KraziiKiiD Look at P/Invoke SendMessage API
 
@RoelvanUden i used that but the window is unknown always
 
The intended window is unknown, but you want to send a key stroke to a specific window without making it the foreground window. Ping me again when you start making some sense, will ya?
 
@RoelvanUden i wanted to say that i can't write something like : if windows == "windows" send key
 
Roel
Hey Roel
Roel guess what
 
@Sippy Hm?
 
9:58 AM
Still on webforms.
 
@Sippy Wow, Monday morning and Web Forms. You have a harsh life...
 
It's pretty high up here, could always suicide.
I have options.
It's such hard work making web forms do things.
 
It's better if you don't do that latter option. It's basically a dead end.
 
Ah
At the moment, I have an object defined in a class, but if that class isn't open in the IDE then the object stops existing.
That's pretty cool.
!!s/cool/retarded/
 
@Sippy I find it retarded but I don't get the functionallity (source)
 
10:01 AM
Oh she isn't here.
Oh she is here she's just retarded...
 
10:34 AM
Question, How ca I use HttpClient in WP 8
I tried using a Portable version of System.Net.Http as mentioned here:blogs.msdn.com/b/bclteam/archive/2013/02/18/…
but System.Net.Http.Formatting is creating a version conflict that I'm unable to resolve
Can someone please help me with this??
 
wtf?
caprica can search!?
 
yessir
 
neat
 
10:49 AM
She does doge translations too.
!!doge neat/caprica/really cool/
 
           wow
so neat/caprica/really cool
         wow
many neat/caprica/really cool/
 
Not doing that right but you get the idea.
 
@SamyS.Rathore If your aim is just to make http requests, you can use HttpRequest
 
i can live without Doge
 
That's a good point.
Did you ever see Dogescript?
Some idiot decided it'd be a good idea.
He was wrong.
 
10:51 AM
yeah i think im too old for that stuff
 
    shh this is dogescript

such goToTheMoon much doge
  very moon is false
  rly doge is 'a doge'
    moon is true
  wow
wow moon
plz goToTheMoon with 'a doge'
I'm 21 and I believe I am also too old for that.
Lol
 
I have a method like this,

Private Void GetSomeFruit(int a, int b, bool? abc)
now some old code is passing only 2 parameters
if I update this code, would it going to break it
I am adding bool? abc parameter myself
 
update how?
 
@CustomizedName yes it would break it. you have two options
1) provide a default value for abc
2) update the old method to call the new one
private void GetSomeFruit(int a, int b, bool? abc = null) { }
 
10:55 AM
@drch thank you :)
 
or:
private void GetSomeFruit(int a, int b) {
   GetSomeFruit(a,b, null);  // or whatever makes sense as the default value for abc
}
private void GetSomeFruit(int a, int b, bool? abc) {
   // new implementation here
}
 
I am trying to do this,

private void GetSomeFruit(int a, int b, bool? abc = false)
{
if(abc) {} // it gives me error that it can't convert bool? to bool
}
so by default it's false as if not provided
 
@RoelvanUden Yes, but we have a shared project(business layer) which is already using HttpClient, so we were hoping to be able to use the same here.
 
Hi
I have some question
I'm working on a app that I want to load a txt file and save into the string, is it possible to do this?
 
Sure, almost anything is possible to do.
e.g. var myTextFileContents = File.ReadText("path_to_text_file.txt");
 
11:05 AM
it's online. it is work?
 
@CustomizedName there's a difference between bool and bool?
you can do if (abc == false) or if (abc.GetValueOrDefault())
 
just realized, changed bool? to bool
 
assuming you want to treat a null as a false
 
@MarkLi Be a little more specific please. Wherever that code runs, it will work as intended.
 
@drch yup
158
Q: How can you use optional parameters in C#?

KalidWe're building a web API that's programmatically generated from a C# class. The class has method GetFooBar(int a, int b) and the API has a method GetFooBar taking query params like &a=foo &b=bar. The classes needs to support optional parameters, which isn't supported in C# the language. What's ...

 
11:06 AM
instructions unclear. path_to_text_file.txt does not exists
=]
 
for example ex.com/1.txt it's my txt file and I want to save the text of the file into the string and show it in lable
 
@CustomizedName Make sure you set the default value as false, not null. Oh you already did nvm.
 
@MarkLi use WebClient.DownloadString
 
^ That. If you are accessing stuff through the HTTP protocol, use some class that facilities getting stuff through that protocol.
 
@drch but I'm new at c# :-s
 
11:08 AM
@MarkLi It's easy you'll be fine.
 
@drch P.S. instructions unclear: WebClient.DownloadString is not a static method :P
 
:P
 
@MarkLi Do you have any prior programming experience? :P
 
yep PHP :D
 
11:09 AM
there's an example there. it's extremely simple
it's similar to file_get_contents or whatever in php
 
[sarcasm_on]I said programming experience; PHP doesn't count![/sarcasm_on]
 
IF php doesn't count nope :D
 
Yeah, it's like file_get_contents except that is magical. It can do FTP, HTTP, etc. In C# you need to use the appropriate stuff.
 
Depends how you used PHP really lol
 
If you used OOP in PHP, with namespaces, you just need to learn API and typing.
And well, that C# runs forever and isn't fire and forget like a PHP request
 
11:12 AM
for example this code:
WebClient client = new WebClient ();
string reply = client.DownloadString (address);
can do it for me?
 
Right maybe someone can answer this for me
 
@MarkLi You might want to wrap WebClient in a using though.
 
As in Mark's example right there, why bother instantiating webclient at all?
If you only use it for one method call, is it worth instantiating?
 
@Sippy Very little choice in the matter. :P
 
11:15 AM
DownloadString isn't static then
But if it was
Would there be a point in instantiating other than readability?
 
in that case, probably not
however a webclient has state
 
No. If you aren't using anything else, then absolutely no.
Exactly, WebClient can authenticate, proxy, keep cookies, etc.
 
eg, there are differences between File.ReadAllText() and opening a stream
share levels, read/write access, etc
 
guys I can't understand U :D I'm very very new at c#
 
Is there a benefit to instantiating if you were doing maybe 10 method calls or would it be fine to just call static methods from the class where possible?
@MarkLi don't worry lol, I'm asking my own question atm :D
 
11:17 AM
@MarkLi your code is mostly fine as is, but you should read up on the using() { } construct in .NET. it's very important
it's used to free up resources when you are done with them
 
@Sippy It's "fine", but anyone would frown upon heavy usage of statics.
 
@Sippy it really depends on the method in question
 
I try very hard to avoid using static, dw ^_^
 
could you give the code you said? for example it's my txt file: behdad-es.ir/file.txt how to save it in string name text?
 
for example, someone here was working on some logger
 
11:17 AM
Just asking the question
 
so to log to the file, he did File.AppendAllText()
but it would be better to use a stream so that the file wasn't constantly opened/closed all the time
 
Agreed.
So I would be right in saying it's mostly contextual
 
its very case by case. but if i was simply reading a file once, i wouldn't hesitate to use the File.ReadAll* static helpers
 
Right
Got my head round that now. :D
I love how little I actually learned at uni.
 
can someone answer my question? :(
 
11:20 AM
good design decisions usually come from experience, and they are very dependant on the problem at hand
 
@RoelvanUden Can you pls look at my question??
1
Q: Using “bindingRedirect” in app.config to redirect System.Net.Http references to a portable version

Samy S.RathoreI am working on a Windows Phone 8 project which has a PCL project as its business layer. The business layer project is shared with the Android(Xamarin) project solution, and uses a HttpClient which we realized is not available in WP 8 projects. So according to the blog here we decided to go with...

 
that's why we have "Best Practices" and not "The Way" :P
 
I'm stuck and can't find a solution
 
@drch Aye, I tend to find I make decent decisions that conform to best practices without often understanding them, hence I ask a lot of theory questions :D
The best debate I started was the debate about using constants haha
Which again, the answer was 'it's contextual'
 
@MarkLi You already gave it yourself; what more did you need? :P
 
11:22 AM
in visual studio it's trow and error :((
 
What error is that?
 
It's helpful to describe what doesn't work. Imagine your clients telling you: "It doesn't work!" That's not exactly helpful, is it?
 
Error 1 The type or namespace name 'WebClient' could not be found (are you missing a using directive or an assembly reference?)
 
Add a reference to the namespace. :)
 
^
!!help
 
11:24 AM
@Sippy Information on interacting with me can be found at this page
 
@MarkLi Right click the error, resolve => add using
it adds a namespace import to the top of your file
 
yeeeeeeeaaaaaaahhhhhh
1000 time thank to @RoelvanUden
it works!
 
lol :)
 
guys I got go
have a nice day
 
 
1 hour later…
12:54 PM
hey everyone
!!
 
@baeltazor That didn't make much sense. Maybe you meant: t, d
 
!! t
 
@baeltazor Input not matching /(\w+) (\w+) (\w+)/. Help: User-taught command: <>http://www.wordreference.com/$1$2/$3
 
Hello.
 
hey @Sippy
is there anybody in here who uses third party UI controls (Button, ListBox, ListView, etc etc etc) for winforms?
 
1:11 PM
Why?
 
um
just cause i'm interested lol
 
I mean why did you ask the question
What is it you'd like to know
 
um, i'd just like to know whether or not anybody in here uses third party ui controls... I made a control suite, and now that I think about it im not sure if I should bother releasing it cause people are moving to wpf now
 
I'd argue if it works then it's probably worth releasing.
 
1:44 PM
Hi everyone, just a quick question: I'm planning to use Entity Framework 6 - when deploying my application, should I also install EF on clients? I.e. must I deploy EF dependencies to each machine that will use the application?
or is it already included in .NET 4.*?
 
It's included when you build your solution.
 
thanks @Sippy
 
All third party dependencies are to be deployed to the client, that includes EF and other junk you reference. The sole exception are the build-in .NET framework assemblies (for now).
 
Am I confused about what he was asking?
If you add EF as a ref to a project and build it, then deploy the built application to a client, why would the client need their own copy of EF?
 
You are not. But whether or not the third party dependencies are included is up for debate -- copy to output folder can be disabled, he can be making an installer, etc. He has to know they have to be there, one way or another :-)
 
1:49 PM
Ah right.
 
the thing is, normally i'd deploy assemblies to GAC, but supposedly that's not recommended (for whatever reason) for entity framework
 
I guess my brain figured that was implicit :D
 
Deploying to the GAC is a bad idea IMHO. Why would anyone ever want to do that on a client machine? :-O
 
i ordered a large latte and the guy put it in a bowl
so theres no handle
 
because for some apps it supposedly makes sense and is the easiset to mange (think sharepoint server, where deployment can be pretty painful)
 
1:51 PM
but i took too long to notice and now i feel dumb mentioning it to him
</blog>
and i forget the german word for bowl so it would be hard to explain
 
Throw the bowl at him and shout WAS IS DAS?
@w128 Sharepoint is right behind web forms in the context of 'things which need deleting'
 
sharepoint will live a much longer life than web forms
 
Both fortunate and unfortunate at the same time.
 
i am fortunate that neither appear on my resume
 
I won't be adding web forms to mine lol
And this had damn well better be a temporary project or I'm quitting
 
2:06 PM
sharepoint?
 
Nono
@drch I'm doing maintenance on a legacy web forms application, and if they come back with more change requests when I'm done I'm gonna cry
 
2:22 PM
@Sippy Don't worry. They will. They always will.
 
@RoelvanUden I will quit :D
I'm not an archaeologist lol
Don't wanna get paid to dig up bits of old systems and try to piece them together until they work!
 
If I was doing that, I'd want to be paid double!
AT LEAST.
 
ye right
I'm 21 no one pays me double
I hinted to my boss that I could very easily find a job with a pay rise and he basically said go away then lol
More recently he was going on about a graduate payrise program or something though
 
Well, don't become a slave. I just graduated as well, but with 10+ years of experience I expect to be treated well, and subsequently, paid decently as well.
 
you were coding in the womb?
 
2:32 PM
Oh shush you. >_<
 
=]
hows work going anyways?
 
Oh not bad. Pretty relaxed so far.
 
@RoelvanUden I don't plan to be, I plan to work in ASP.NET MVC for 5 years and then get into contracting for stupidly large amounts of money.
Might even go to Dubai and do it
I bet good western devs can earn almost double their salary in Dubai
 
How much is 'double'? Compared to what? :P
@drch How is Germany for you :P
 
so far so good!
so weit, so gut ;)
 
2:34 PM
No major language barrier? :D
 
sometimes, when I'm missing the vocabulary
but ive been taking classes every day since February and I speak german about 50% of the time at work
My C1 course starts tomorrow
 
Ach so, sehr toll!
 
:P
 
@RoelvanUden I don't really know. I just know Dubai is full of MONEYYYYYYYYYYY
 
go to norway for the big bucks
 
2:37 PM
 
just make sure you have the job offer first. one can go broke while looking for a job there
 
Yeah
 
hey guyz
 
I think I'd only accept a job from someone willing to come to London or something to interview me for it
 
@Sippy lol
 
2:39 PM
If I were to go to Dubai
That is.
If they have so much money and are so successful they should be willing to sell themselves in order to get good devs
That's how I see it :P
 
@Sippy that would be kinda wierd
more likely, they would fly you out there
doesn't make much sense for a potential employer to give up an entire day for a 1-2hr conversation at your flat ;)
 
Or that, yano.
But you get what I mean.
 
we just interview people over skype
 
Or that.
 
@drch can I have a job?
 
2:41 PM
I'm not that experienced as you can see :D
 
Sure you can!
 
not that kind of job, @RoelvanUden... I want the kind that gets me money lol
 
braaaaaaaaaaainssssssssss
 
oh shit its zombie kendall
 
I love holidays
 
2:47 PM
> The risk of a zombie invasion is low but that does not mean one should not be prepared.
risk of|for|???
 
@JohanLarsson What will you risk for a Zombie invasion?
 
dunno, Kendall?
 
@JohanLarsson Both are correct, but are contextually different.
The risk of a zombie invasion describes the risk of one happening, the risk for a zombie invasion describes the risk associated with one.
 
ty ty
 
00:00 - 15:0015:00 - 23:00

« first day (1416 days earlier)      last day (3515 days later) »