« first day (1469 days earlier)      last day (2680 days later) » 
06:00 - 15:0015:00 - 23:00

6:23 AM
Morning!
 
6:38 AM
morning
 
Morning
 
7:33 AM
morning
 
morning
 
any boosted yet?
 
nein!
 
It's so strange that they don't seem to have any real competitor...
someone who can build them cheaper and better :)
 
the market isn't that big I guess
most people can't ride
 
7:44 AM
I guess that also depends on the price
let's say €500
 
the battery has a cost
 
A friend of mine bought a 15Ah battery (for bike) for ~€300 from china.
but a producer must be able to get much better prices than that
and that was with casing and all
Other boards that I have seen doesn't have any flex though. I think that's one of the pros with boosted
 
8:04 AM
there's Yuneec boards
 
morning
 
Hi, good morning :)
Can someone go here and try to help me? stackoverflow.com/questions/40262396/…
 
They looked awful, but at least they were cheap
 
@Ricardo "Why does this happen if the function is the same and works perfectly in the button command?"
because of shared mutable state
 
@franssu yes, my ListBox is having concurrency issues :(
but I don't know how to solve it. I've lost all day (yesterday) and still nothing, in the last minutes before going to bed I've managed to find a solution that if I don't change to another view model it works, but if I were with other VM open it stop working
 
8:18 AM
seek and destroy mutable state
 
can you explain me better? :s
 
use mutable objects only if absolutely necessary
your code will be easier to reason about
 
I have an ObservableCollection<Friends> that contain attributes and ObservableCollection<Messages>
the friends list is updated through a timer each 5min and the messages each 15s...
 
sorry, I don't have time to look at your question in details
 
And also is a requirement that I had a button in the UI where I can force update.
 
8:29 AM
Morning
 
english lack an expression for "tomber en marche" @Hamza_L
"to suddenly start working as expected for no reason"
 
@Ricardo There is no reason on using the Application.Current.Dispatcher.Invoke in timerchat_Tick, the callback is already executed on the UI thread
 
lol
yeah
 
@NovitchiS but if I use the getMessages() directly nothing happens...How do you suggest?
 
Should call await getMessages();
 
8:35 AM
30s for testing
@NovitchiS it didn't updated the UI :(
 
so you need to use F# instead C# ;)
 
I can't Foggy :(
 
Leave the tick message that way, and search for the problem elsewhere. Show the code that calls the getMessages and works always
 
@NovitchiS if you can take a few seconds to go here: stackoverflow.com/questions/40262396/…
I have my code (getMessages() there...)
basically it calls a webservice and add the messages for each friend >update UI >insert localDB and thats it
 
I have read the question. You are saying that you call getMessages() from button handler and the UI is updates. Show us.
 
8:45 AM
I use a Relaycommand 'public RelayCommand GetMessageCommand { get; set; }'
GetMessageCommand = new RelayCommand( async ()=> { var x = await getMessages(); });
 
Does the getMessages gets called from the timer, use a breakpoint?
 
hyes
i receive the messages (if you check in the code, there is anotification there and it appears always...)
just doesnt update the UI
 
No, I don't believe this, if it works from command handler it should work from timer as well, you should create a better sample that people can actually run, remove all the DB and service calls and use some dummy data.
 
9:03 AM
@NovitchiS basically is this that I'm doing
public ObservableCollection<string> FriendsX;
        public async Task<bool> getMessagesTest()
        {
            var a = "test";
            FriendsX.Add(a);
            OnPropertyChanged("FriendsX");
            return true;
        }
but instead of a string I an Object and inside the object I have another observable collection...
 
9:18 AM
@Ricardo is FriendsX a property ?
 
@franssu is an example I made to try in a very simplistic way emulate my problem.
and yes is a property.
 
you have to keep correctness when you simplify
 
public ObservableCollection<string> FriendsX {get;set;}
        public async Task<bool> getMessagesTest()
        {
            var a = "test";
            FriendsX.Add(a);
            OnPropertyChanged("FriendsX");
            return true;
        }
 
why introduce var a, why raise propertychanged ?
why return true ?
 
var a to emulate a new message (new string)
 
9:23 AM
those could be simplified without altering correctness
FriendsX.Add("test");
 
propertychanged because I'm simulating I have already some messages in the UI and I want to add me.
 
FriendsX is Observable, you don't need to raise propertychanged
 
really? Why?
 
why did you use observable collection in the first place ?
 
I have a list of friends
I will send you a printscreen of my app
 
9:26 AM
you don't need to
why did you use observable collection [instead of a list] in the first place ?
 
because I have a List of friends with multiple attribues
attributes
And my observablecollection Friends has attributes and one is an ObservableCollection of Messages..
that is the thing I'm doing in the getMessages, updating the messages...
 
it doesn't answer my question
I'll answer for you
you used an observable collection because you want some controls in your UI to update themselves automatically when items are added or removed from this collection
the observable collection notifies whoever wants to listen via an event (collectionChanged) when items are added or removed to it
 
i didn't know that, thanks for the teaching :O
I'm using Onproperty for nothing then
 
generally speaking you don't want to use things if you don't know why you're using them
 
@franssu you are absolutely right but when you are learning for yourself a language and you to do things in a schedule
you try to go through the things quick and easy, later is when problems occur. Like is happening to me.
 
9:37 AM
you have to understand everything you write, there's no other way around
if you don't programming soon turns into black magic
there might be areas where how things work isn't 100% clear
 
that is why you go to C only :)
 
What would you do to solve my problem regarding the timer updating the UI?
 
but you have to try to make a mental model of how you think things work, and later you can validate or invalidate your mental model by experimentating or by having unexpected bugs
I would break into pieces
proceed by dichotomy to isolate the bug
 
I've already checked that the timer is working correctly + the webservices are working correctly. Only the UI isn't updating.
 
is it hard to implement drag drop in wpf
?
 
9:42 AM
@Proxy never done that :( sorry
 
break into pieces Ricardo, make the simpliest code where you think UI would update
and add things until UI doesn't update
if you add things piece by piece you'll know the responsible of the bug is the last piece you added
 
I have somekind of refactoring like you are suggesting but it appears I don't have any bug
(at least programming one) but I have a behavior problem.
 
hi
 
The thing I can't understand is why if I use the refresh button the messages came clearly and update clearly and using the timer it doesnt.
So I though, the problem must be in the timer. I've tried using other timers instead of the dispatcher.. It still didn't worked.
I've put the doubt in stack, nobody could help me. I'm in despair :(
I have a friend who works in C# (windows forms tough) and he still couldn't help me using TV. You can imagine how I'm feeling
I have till 29/10 to deliver this... It's overwhelming.
 
TV ?
 
9:49 AM
teamviewer
where do you think that the problem is? (timer? function?)
I've debugged line by line..
 
break into pieces
 
i will try to do that again
you would start by the timer or by the function?
And using the button?
 
did you look at the output window ?
for error messages
 
yes. No error messages and I'm doing try catch with Debug in the catches
And if I use the button in the UI
it works like a charm.
 
10:05 AM
create a new project
update a UI with a button and a timer
 
is just the timer that should be doing the updates each 15s (requirement) call the message (works)
 
10:20 AM
done
and it works like a charm (but I'm using code behind in this example
public partial class MainWindow : Window
    {
        private DispatcherTimer dispatcherTimer;

        public ObservableCollection<string> friends { get; set; }
        public MainWindow()
        {
            this.DataContext = this;
            friends = new ObservableCollection<string>(); //initialization
            friends.Add("test"); // Add first string
            InitializeComponent();
            dispatcherSetup();
        }
        public void dispatcherSetup()
        {
            dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
XAML:
<Window x:Class="WpfTimer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfTimer"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
 
add the next most suspicious feature to your test code
 
maybe the webservices requests
because they use await
 
yes, maybe
Console.WriteLine(System.Threading.Thread.CurrentThread.ManagedThreadId);
^ can be useful to check what's happening thread-wise
 
I've already implement
in the dummy project
the webservices
everything fine
I'm adding to the string the entire message
 
10:38 AM
in your real app, check what's happening with the threads
how many threads, called from where
and make sure your dummy app follows the same model
 
I should put the console.writeline
in the getmessages function?
 
yes
 
THREADS: 10
THREADS: 10
THREADS: 10
another message THREADS: 10
THREADS: 10
another message
The thread 0x1dfc has exited with code 0 (0x0).
THREADS: 10
UI didnt update
 
continue adding features to your dummy project until UI doesn't update there as well...
or until you have created a working project ;)
 
10:58 AM
I have thousands of lines of code
I can't do that :(
 
that's problematic
try to find good candidates for the source of your bug
what's fundamentally different between your dummy project and your real one
which could lead to the bug
 
I can't even think in nothing
because my brain keeps telling me that if I use the button its on
ok
 
11:28 AM
I think I will handle the problem in other way
timer goes and do webservice and notification
and when the SelectedItemChanges (click on friends) it fires an even that goes to the local DB and update the UI.
That way I split the friends from the messages
what do you think?
 
12:11 PM
@Ricardo if you break on OnPropertyChanged("Friends");
and step into
 
Hi all
 
12:24 PM
'morning Alex
 
12:41 PM
waves from cubicle
Hi Lynn
 
yawwwwwwwwwn
 
Usually, the exhaustion hits me starting on Thursday afternoons
So if you hear snoring in the room, that's me!
 
12:56 PM
hahahahaha
 
By then, hopefully the WpfFarmer will have released some crickets to chirp and wake me up
So what are you working on these days, Lynn?
 
1:27 PM
@franssu break where?
 
I don't really know
you have another choice if you can't add thousands of lines of code to your test projects
you can remove lines from your real project
 
@Alex Sorry, not ignoring you; stuck on conference call
 
1:51 PM
not sorry Alex, totally ignoring you
:D
 
@franssu oh gosh, I don't have time to implement my whole project again
 
did you try removing asynchronous code
your dispatcher timer here :
dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
is not the same as the one in your real project :
_timerChat = new DispatcherTimer(DispatcherPriority.Render);
shouldn't change much
but yes, remove all async code ?
 
2:08 PM
Render is a pretty high priority
it should be dropped down to databinding
interesting fact discovered - DataBind is a higher priority than Render :D
Also I don't think we can help you Ricardo - your problem is too complex to be handled in chat
you need a competent wpf developer to run a debug session with you and do the debugging for you - not something this chat is equipped for
 
@franssu I have the webservices
using await..
 
remove the calls to webservices
 
Apologies, but this debug chat needs to end now. You can either give us a Minimal, Complete, Verifiable project to help you with or this chat isn't going to go anywhere.
 
replace them by dumb stuff
 
I've read the transcript enough to know this has been going on long enough and it isn't going anywhere
the answers have been constantly revolving around: try doing X - with an answer: I already have Y in code
this is a deadlock position and it needs to stop
 
2:14 PM
@LynnCrumbling No worries. Been in a meeting
 
I'm surprised franssu managed to spend as much time on this problem as he has, but he's just being polite.. something that I don't have ample amounts of :)
 
@Maverik i asked a friend of mine that is already working in enterprises but he develops in Windows forms.
@Maverik sorry, but I don't have anywhere else to go.
 
I know, but we just can't help
your problem is too complex for this chat
reality is - you don't know enough to be doing this project
you're using magic async code and you're using it wrong
 
Ricardo, have you posted your question to SO? That might help far more than anything we can provide here
 
yes @Alex
 
2:17 PM
he has - which is a code dump
 
Oh
 
and it already has close votes on it
 
Missed it
Ahh
 
0
Q: Different behaviors when instantiated from button or timer in c#

RicardoI have a function called getMessages that can be called by a Button click (using the RelayCommand trigger) or that is called in a timer every 15s. The desired behavior is: webservice > deserialize answer > system notification > updatelistview > insert localDB But when the function is call...

 
6 hours ago, by Ricardo
@NovitchiS if you can take a few seconds to go here: http://stackoverflow.com/questions/40262396/different-behaviors-when-instantiate‌​d-from-button-or-timer-in-c-sharp/40265520?noredirect=1#comment67800038_40265520
 
2:17 PM
with code
 
so this has been going for at least 6 hours with at least Novitchi & franssu involved - besides other SO folk commenting on question
 
and the hours I've searched before posting stack :(
 
well thats the life of a developer
you jumped into a project before grasping the theory unfortunately
and now it's biting you
 
is it a student project @Ricardo ?
 
your best hope is to remove all multi-threading from things you don't understand
 
2:19 PM
@franssu yes. The professor obligated me to use c#
 
Then, the best approach, IMHO is to learn the tech more. We can't solve your problems for you. We suggest things. Learn more and start with a simpler project, then add things.
 
recommend his some books then to read ( and me too :P)
 
I've never worked with it before
 
PS: somebody said await is going on wrong thread - it's not.. await, by default marshals to calling thread context
 
@Alex you are right but my deliver date was to short, I've just skimmed to the things I thought I will need.
 
2:20 PM
What Maverik said is correct. Get rid of multi-threading and go from there.
 
also Ricardo, please don't ping people who are actively present in chat already
@Ricardo its really loud for people using headphones
@Ricardo and gets quickly annoying
 
yes you r right xD
sorry
 
np
 
So here are your next steps, Ricardo:
0 - Fix naming conventions
1 - Remove multi-threading
2 - Get app working
 
I'll give Maverik a massage while Alex explains
 
2:22 PM
xD
 
3 - As time allows, learn multi-threading
 
no thank you - i'm calm :D
Alex missed a step 0 -- fix your naming conventions so we can actually read your code!!
 
The thing is that the app Works if I use the button.
 
when in c-sharp - write as c-sharpers do
 
Fixed
 
2:24 PM
hax @ Alex
 
but I have to do this using the timer
 
Ricardo we need this from you: stackoverflow.com/help/mcve
to have any hope of helping you - since you can't give us that - we.. the SO denizens can't really help you
 
I have already created a demo app xD
 
which doesn't have the problem
 
that don't use MVVM and using threads and buttons it updates automatically
 
2:25 PM
or am I wrong?
 
yes you are right
 
right so your demo app is wrong for the purpose
 
because I think is too simple
 
if its webservices that cause the problem - you need to add authentication stuff to it
 
to show the full app behavior
 
2:26 PM
we basically need a working project WITH the problem to see whats going on
it wouldn't have taken 6 hours if we had access to real problem
 
Can you spend a few minutes in teamviewer with me?
 
no - it'll take me longer than a few minutes to get an idea of whats going on with the code
 
where are you from @Ricardo ?
 
if its a student project - upload it privately somewhere and let us download it
we have no interest in keeping your project or using it in our nasa based research projects ;)
 
I could walk you through to decrease the learning curve.
 
2:29 PM
sorry but thats not how it works
i don't have a lot of time to explain what I'm doing and why I'm doing it
its more a feel the lay of the land and debug by intuition that comes from experience
 
Portugl
Portugal
 
don't think we have anybody from there resident here
 
How can I open private conversations?
I can talk english relatively well.
 
you'll need to switch to something away from SO
you could use a temporary email address to share the real contact info
something like temp-mail.org/en perhaps
 
do you have one?
can I send you stuff?
 
2:39 PM
citucocef@maileme101.com
^ random one generated from above domain for purpose of temporary communication
 
sorry
my internet went down.
Can I send you an email from my real mail?
 
np
sure if you wish
 
Do you receive the invitation?
Did*
 
Yea i got something
but its mostly not english - it wants me to do something i think :D
aa figured out - its google drive invite
 
yes. Its too big for simple mail
 
2:49 PM
np - you'll see i've accepted invite from my real address
but i don't see anything
 
hhmm how so?
 
i dunno - its a blank folder
i'd imagine its because I've accepted invite from my real google id rather than the temp address invite went to
 
ohhh its still uploading
 
oh
 
or the thing you said
 
2:52 PM
no uploading is a more likely suspect :P
 
i will do the things other way. Can you send me your real email for here
narul@maileme101.com
(I've copied my backup folder, and I've shared the one the isnt sync. I will do the other way around)
 
you can already see my real address from your google drive under Maverik Gately user (on your shared folder)
also i can see your stuff now
 
I'm so jealous
 
really? awesome.
 
jealous because?
 
2:58 PM
its the full Project?
 
i think so?
 
I'd like to have a look
 
you're on my skype aren't you?
 
06:00 - 15:0015:00 - 23:00

« first day (1469 days earlier)      last day (2680 days later) »