« first day (552 days earlier)      last day (3597 days later) » 

12:06 AM
This is a real question that it doesn't make any sense
I have an ObservableCollection with the T being a class of mine
The class of mine has a initializer that does some work and fill the attributes of this class
But when I add something to this OC, I trigger the CollectionChanged
For some reason the initializer wasn't called and the attributes weren't filled
arquivos.ToList().ForEach(f => VM.lPwC.Add(new Model.ArquivoPwC(f)));
        public ArquivoPwC(string Arquivo)
        {
            if (string.IsNullOrWhiteSpace(Arquivo)) return;

            Caminho.Add(Arquivo);

            var _conteudoLido = string.Empty;
            if (Arquivo.LastIndexOf(".csv") > 0)
                foreach (var arq in Directory.EnumerateFiles(Arquivo, ".csv", SearchOption.TopDirectoryOnly))
                    using (var sr = File.OpenText(arq))
                        while ((_conteudoLido = sr.ReadLine()) != null)
                            _conteudo.Add(_conteudoLido);
private void lPwC_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            return;
        }
What ?
I'm a dickhead. Forget everything I said
 
lol
 
btw - in my mind, doing ToList().ForEach( is horrible practice
List<T>.ForEach is questionable all on its own, but building a list just to use it is awful
 
For good practices or is it performatic ?
 
both
And I'm not alone - it doesn't exist in Windows Store API (Microsoft dropped it)
great read on the subject
 
No more ForEach ?
 
12:20 AM
nope - List<T>.ForEach was dropped
it's gone in the framework for Windows Store apps
 
F*ck
Changing everything
 
if you really want to use something like that, at a minimum, make an extension method to do it on IEnumerable<T> so you don't build a list just to iterate over it
but I don't recommend it
 
I'll follow your suggestion, I'm already removing all the ForEach
 
is _conteudo a List<T>?
List<string>?
 
12:24 AM
You can write that stuff above as:
if (Path.GetExtension(Arquivo) == ".csv")
    _conteudo.AddRange(Directory.EnumerateFiles(Arquivo, ".csv", SearchOption.TopDirectoryOnly).SelectMany(File.ReadLines));
much more elegant and concise than all of the nested loops/using/etc
 
Arquivo doesn't have the file name
It will get all the files from the folder and then verify if it should do something
 
ahh, okay
wait, what is the .csv for then?
public ArquivoPwC(string arquivo)
{
    if (string.IsNullOrWhiteSpace(arquivo))
        return;

    Caminho.Add(arquivo);

    _conteudo.AddRange(Directory.EnumerateFiles(Arquivo, ".csv", SearchOption.TopDirectoryOnly).SelectMany(File.ReadLines));
}
 
To retrieve all the csv from that folder
 
that seems like it'd be fine
 
Hehe
ReadReadLines...
 
12:27 AM
:p
 
I giggled
I'm going to need to save the filename too, should I just read the add range ?
I just ended up with
            var _conteudoLido = string.Empty;

            foreach (var arq in Directory.EnumerateFiles(Arquivo, "*.csv", SearchOption.TopDirectoryOnly))
            {
                _nomeArquivo.Add(arq.Replace(_caminho.Last() + @"\", string.Empty));
                using (var sr = File.OpenText(arq))
                    while ((_conteudoLido = sr.ReadLine()) != null)
                        _conteudo.Add(_conteudoLido);
            }
That filename is going in a grid in my window :(
 
        foreach (var arq in Directory.EnumerateFiles(Arquivo, "*.csv", SearchOption.TopDirectoryOnly))
        {
            _nomeArquivo.Add(arq.Replace(_caminho.Last() + @"\", string.Empty));
            _conteudo.AddRange(File.ReadLines(arq));
        }
 
o.o
You really impress me
 
anyways, gotta run
 
Thanks man
You helped me a lot again
Good run I guess
 
 
7 hours later…
no9
7:12 AM
mirnign
mo9rning
 
@no9 rning
 
no9
aint good thats for sure :)
 
7:37 AM
hey hey!
my program override the OnClosing and when I close the program the code is called, BUT only if I have done a certain thing first ("opened a module"). What would make that function not being called?
 
8:22 AM
Ok, I was wrong, it was called...
 
8:46 AM
:)
 
no9
9:20 AM
Assembly attribute with type 'ThemeInfoAttribute' could not be loaded.
anyone has a clue how can i add this in assembly info?
 
9:41 AM
morning all
 
10:05 AM
1
Q: shift+click couldn't select correct items with listview

Allen Li - AI3in my ListView, I want to press ctrl+A to select all items, and select multiple items cooperate with shift button. But it doesn't work. I use keybinding to rewrite select all command, but how to deal with select multiple items with shift button? XAML: <ListView VirtualizingPanel.IsVirtualizing...

 
Morns
 
10:40 AM
Morning
 
no9
10:58 AM
@Maverick
good morning :)
 
11:12 AM
elo No9, and press tab when you use @ pings - so you don't end up doing typo in names ;)
 
Is there a control into which I can place an object O, and if I set O.Margin="-10" it will be "hidden" outside the borders of the control?
...just the 10 px that's outside the control...
 
no9
wellllllllllllll
thankx bro :)
i have a fever so typos are allowed today
is anyone familiar with nant echo append?
i am adding something to Assembly.info but it creates an empty line and I dont like that
 
markus what you mean like ClipToBounds ?
 
no9
looks like this:
</asminfo>
<echo file="${assemblyInfoFile}" append="true">
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
</echo>
 
@E.LDunn sound about right
Sweet! thanks
 
11:28 AM
Sorry no9 .. no idea and hope you feel better soon
 
11:49 AM
@Maverik Use your extreme knowledge and look at this msdn.microsoft.com/en-us/library/s8bz4d5h.aspx
Did you that existed ?
 
12:12 PM
Hey! Have anybody used xamarin for ios app development?
 
12:37 PM
hi guys
instead of dispatcher what we can use
 
12:49 PM
@AndréSilva I did - but you realise that's for pointer magic right?
 
1:06 PM
@Maverik No, I did not know. I not even knew that existed
Even the >>= and <<=
I still did not understand how that works
 
1:43 PM
you must be kiding
 
Why ?
 
what is it you don't understand ?
and hi by the way :)
478
Q: Absolute Beginner's Guide to Bit Shifting?

John RudyI've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ... What I'm wondering is, at a core level, what does bit-shifting (<<, >>, >>>) do, what problems can it help solve, and what gotchas lurk around the bend...

 
@franssu The reason behind -> >>= <<=
 
2:03 PM
hi guys
var timer = new DispatcherTimer(TimeSpan.FromSeconds(10), DispatcherPriority.SystemIdle, (s, e) => OnRefreshData(), Application.Current.Dispatcher);
i'm using this code to invoke my method when system goes to idle state after 10 sec but it invoke the method every 10 sec
please help me
what i did wrong in that
hello @AndréSilva
 
Hi there
 
please check my msg
 
I did check it, I just don't know how to help you
Have you tryed asking in the C# room ?

C#

General discussions about the c# language, Squirrels | gist.gi...
 
@CnuSeran are you serious ?
 
yes
 
2:12 PM
please don't spam
 
hey i'm not playing
just need help regarding my post
i want to know how it getting invoke without system become idle
 
how do you see that your system idles ?
 
if i left my machine without using for 15 mins
 
mmh
 
is that any way to check system idle time without using dispatcher timer
 
2:16 PM
that's no what's meant by "DispatcherPriority.SystemIdle"
 
yes but it doesn't work
 
I think you just missunderstand what it's suppose to do
 
will you explain please
 
your system is indeed idling, you just missunderstand what idling means in that context
 
okay leave that give me solution for this. in my application i have listview which should refresh when the machine become idle
 
2:24 PM
please define exactly what you mean by "when the machine become idle"
 
Hey, it's on topic discussion. WTF is going on here?
 
is it ?
 
That looks like C#.
 
yes
i'm developing wpf c# application
@franssu: when the machine become idle - system is left without using
for a moment
 
please define exactly what you mean by "left without using"
 
2:30 PM
hehe. i have code for idletime
        public static TimeSpan? GetInactiveTime()
        {
            var inactiveTime = new TimeSpan();

            if (SystemParameters.IsRemoteSession)
            {
                ITerminalServicesManager manager = new TerminalServicesManager();
                using (var server = manager.GetLocalServer())
                {
                    server.Open();
                    foreach (var session in server.GetSessions().Where(session => session.SessionId == Process.GetCurrentProcess().SessionId))
if (GetInactiveTime >= new TimeSpan(0, 0, 0, 0, 60000)
 
@Julien: this code works by utilizing sql server right
 
mmm. the terminal services stuff is used by Cassia
free dll you can find
no sql server
 
@Julien: okay
who are all c# developers in this room ?
 
most of us id imagine
wpf is c# only isnt it
 
.NET only for sure.
(meaning VB.NET gets in there)
 
2:38 PM
ah
 
hehehe
i think most of them
@Julien:s that code works under windows application ?
 
yes
 
heh.
 
@Julien: i cant get the Cassia dll. will you please provide download link
 
dl link on the left
 
2:44 PM
got it
 
3:04 PM
@Julien: we dont need any dll to check system idle the below code is enough
 
yeah theres nothing wrong wiwth it
it just wont work in any TS environment
 
okay
my problem is whenever dispatchertimer invokes my ui get freeze for a moment
 
so use a regular timer
not a dispatchertimer
_myTimer = new Timer(MyMethod, null, 0, 1000);
 
if i use regular timer i'm facing this issue The calling thread cannot access this object because a different thread owns it.
 
call dispatcher in your method once you've determined that idle time is high enough
 
3:12 PM
this is my code
where you want me to call
@Julien: got it
 
you could wrap all that in a dispatcher
but id recommend you learn how to bind
then dispatcher is less required
 
yeap
 
3:44 PM
Also this isn't really a code debug channel. Please don't post long snippets of code nonstop
6 messages moved to recycle bin
 
if you do, use the fixed font button.
    It makes your code legible and adds appropriate spacing.
 
gj billy with those marks :P
 
forgot it hates the line break character for some reason.
But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.But it doesn't mind wordwrap text.
 
yes it just sux at dealing with <br>
 
4:21 PM
Multiplicity constraint violated.
I know what the error is getting at, but I'm not sure why anyone should be expected to.
 
that made no sense to me :)
 
If I'm writing an error message for my code, I'm expected to make the error understandable to everyone. If Microsoft is writing an error message for their compiler, it can be " Multiplicity constraint violated." which is understandable by no one.
 
at least its better than "an error has occurred" ?
"Server refuses to cooperate" (actual ADSI error)
 
I guess, I can google this one.
 
4:43 PM
don't like @ReedCopsey see this @Julien!
 
hahaha i am noob
 
(F# and VB also apply)
as bill said, you could probably get any .NET to work with it, so C++ too.
but that might be the noob in me talking
 
 
1 hour later…
6:00 PM
well, C# and VB are the only ones that can compile the baml
you can use it from F# - I have a library with a type provider that makes it work from pure F# projects
but it's not as "ideal" as from C#/VB
 
bows down to King Reed
So is Rosyln what compiles into BAML @ReedCopsey?
 
no
Roslyn is just C# and VB
 
how does the BAML get compiled then?
 
it's handled by a custom MSBuild rule
it used to be ac.exe, then XamlC.exe (the xaml compiler), but I think those don't exist anymore and it's built into msbuild
 
so couldn't you recreate what you're doing in F# with C++, it just wouldn't be as good? ;)
 
6:07 PM
well, what I'm doing in F# leverages a very specific, and unique, feature of F#
but I'm never compiling to baml - I'm leaving it as a resource containing the xaml content
 
gotcha. so interesting.
might have a resume headed your way from a friend that's inspired by C Tech's technology
lastly, I asked in C# and google but didn't find anything, do you know when ConnectToPrintQueue would be used @Reed? My guess was if you want to build a PrintQueue from the ground up and provide things like the PrintQueue.HostingPrintServer (PrintServer). Essentially connecting to the PrintQueue manually
 
yeah, I think you can use that if you want to query the queue, etc
 
well if my case, I use LocalPrintServer to find all the printers... those are returned as a collection of PrintQueues‌​. So I imagine I wouldn't have to make that call to connect to them?
but when you switch printer selection in MS Word, you see it momentarily say "Connecting to printer..." and thats what made me wonder if they are making a call like that?
 
6:32 PM
they may be - I don't really know, since I'd never bother working with printers at that level
IMO, it's a disservice to your users (unless your Microsoft and want to spend hundreds+ hours reinventing the wheel)
 
haha i know you don't agree with me Reed, but how can i fight the machine?
 
don't know enough about it to help
 
no, i mean, how do you reject business requirements
 
well, it helps that I'm the one in charge of evaluating them :p
being a CTO has its advantages in that respect
 
i'm a peon, my opinion is practically useless
 
6:35 PM
but in the past, it's always been making a strong case of why the requirements are foolish (without using that word)
and why there is a better approach
which always worked for me (and helped me go from peon -> non-peon in my last job quickly)
 
was anyone there to back you up while you're giving business the bird?
 
nope
but I was never afraid to say it like it is - I just made myself invaluable, and didn't keep my opinions to myself
you piss people off at first, but (provided you're right) you earn respect quickly
 
yeah I've done that like 3 times. didn't go so good.
me vs. 4 everytime, you quickly become muted.
 
invaluable is a strange word.
 
6:51 PM
isn't it? lol
 
 
1 hour later…
8:05 PM
@ReedCopsey some reason that resource thing didn't work
i set the icon index, but they seem to be offset by one (icon index 2 is resource file index 3)
 
8:22 PM
well, as long as they're all there, it should be easy to adjust for it
 
i adjusted them and no dice
 
8:57 PM
implementing INotifyCollectionChanged is bs right?
I see STA bugs
 
what do you mean 0_o
 
thought/hoped it would be like inpc
If I bind to it I start to get runtime errors
I should hack a repro for it
if I have the strength
 
INCC can't be cross threaded
INPC can work across threads
 
@Reed figured it out. no matter what the index is set to in the .rc/assembly the first icon will be at 0, the second will be at 1, the third at 2, and so forth
 
yes, it's always 0 based for using with the shell
 
9:14 PM
then why can you specify an ID for each index? what is ID if its not index?
 
@ReedCopsey is INCC a bad idea in general or do you have a nice dispathcer invoke way for it?
 
@NETscape ID is used by C++ to pull things out - it typically maps to a macro, so you'd get ICON_FOO
 
I also find it strange that it does not work cross threads, the eventargs are immutable I think
 
@JohanLarsson WPF doesn't put in the thread checks, though 4.5 does allow it to work
if you provide an object to use for synchronization
 
We use 4.5.1
 
9:17 PM
you can do that, but you need to provide the object, and always lock on the collection
 
do you think it is a hack or nice enough?
 
9:32 PM
private readonly ConcurrentStack<HistoryItem<T>> _stack = new ConcurrentStack<HistoryItem<T>>();
private readonly object _lock = new object();
public History()
{
    BindingOperations.EnableCollectionSynchronization(_stack, _lock);
}
^ that did not solve it, it is the listbox that complains
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
{
    NotifyCollectionChangedEventHandler handler = CollectionChanged;
    if (handler != null)
    {
        if (Application.Current != null && Application.Current.Dispatcher != null)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() => handler(this, e)));
        }
        else
        {
            handler(this, e);
        }
    }
}
^ that ~solved~ it but prolly dumb
pretty dumb to have synchronization on ConcurrentStack in the first place
 
9:53 PM
Is there a good lib for using svg from wpf?
 
10:37 PM
posted on April 24, 2014 by The .NET Team

This post was authored by Xy Ziemba, the Program Manager for .NET Native performance, and Andrew Pardoe, Program Manager on the .NET runtime team. In our previous blog post introducing .NET Native, we talked about how .NET Native gives you the performance of C++ with the productivity of C#. Putting that in quantitative terms, Windows Store apps compiled with .NET Native start up to 60% faster

 
@JohanLarsson Having synchronization on a concurrent collection is kind of against the point ;)
 
 
1 hour later…
11:48 PM
Resume!
er... this room was frozen to a conversation yesterday for some reason. Not sure why. Sorry about that.
 

« first day (552 days earlier)      last day (3597 days later) »