« first day (653 days earlier)      last day (4296 days later) » 

1:32 AM
@TravisJ More than a little :)
 
1:45 AM
yo
 
whats up
 
NOthing
 
can you integrate x^2 e^x dx ?
 
Math.Pow
 
1:46 AM
integrate
 
So picky
 
 
6 hours later…
7:32 AM
morning
 
good morning
@Boboon can I ask a question to you ?
there is index logic in comboBox ?
 
7:51 AM
what do you mean? does the index property do anything?
 
if I add items in combobox they are taking index numbers isnt it ?
I am trying to explain with an example
I have combobox1 and combobox2
combobox1 my elements are A,B,C and combobox2 a,b,c,d,e,f
When I choose "A" I want to see just "a","b","c" elements(I mean 0,1,2 index numbers) when choose "B" just b,c (I mean 1,2 index numbers of elements).
can I do this ,with using indexes ?
 
I don't think you can choose to hide the elements of a combobox
You may have to delete and add the elements programmatically.
"Programmatically" needs to be added to the dictionary..
 
you mean yes index is working but you can't hide ?
I will see all my eements
 
8:08 AM
I don't get you. Index is a number, how is it working?
 
ok I mean I can use indexes
but can't hide elements ?
 
"You may have to delete and add the elements programmatically"
The simple way I can think of would be to clear the second combobox, and add the items you want in the second combobox
 
but it will be so hard to write ..think combobox1 includes country's ,combobox2 includes city's
it will be thousands of city names
 
Are you getting the items from a database?
 
@awayoftarget is it WPF?
 
8:21 AM
no simple Windows Form
 
It shouldn't be too hard. Use a dictionary to group your data.
 
then I don't know, in WPF i'd make a Dictionary<string, string[]>
and bind the first combobox to the key of that dictionary
and the second combobox to the value
 
@Baboon How would you do that in XAML? I've been looking for a way to do just that..
Just the binding I am interested in
 
ok I do it a lot
I'll make an example
 
@LewsTherin I am not so perfect .Can you tell me more ?
 
8:27 AM
Since this is Windows Forms you can do all that in code behind. It just won't be as nice.
Baboon said Dictionary<string,string[]>, but I like Dictionary<string,IList> but it is up to you of course.
You add the keys to combo box1. When you select an item it is just a matter of looping.
 
Am I have to relate all city's one by one ?
MAybe you have better solution ?
maybe I can use xml
 
@awayoftarget It depends where you are getting your data from. XML, Database
 
i'm half way done on the example
 
But it doesn't matter, if it is possible I would rather load the data in memory instead of making some connection every time.
@Baboon Thanks, looking forward to seeing how it works.
 
Hey all..
0
Q: Fileupload Image not getting inserted..

GirishI have an ASP.NET FileUpload control. In the code-behind file, I used class to insert values- public void Insertcert() { String KKStech = @"Data Source=USER-PC\SQLEXPRESS;Initial Catalog=KKSTech;Integrated Security=True"; SqlConnection conn = new SqlConnection(KKS...

 
8:35 AM
I can do like that below but I dont want to write long codes
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  {
     comboBox2.Items.Clear();
     switch (comboBox1.SelectedItem.ToString())
      {
        case "A":
           comboBox2.Items.AddRange(new string[] { "a", "b", "c" });
           break;

        case "B":
           comboBox2.Items.AddRange(new string[] { "b", "c" });
           break;
      }
      comboBox2.SelectedIndex = -1;
   }
think all country's and city's
 
@awayoftarget No
 
@LewsTherin why no ?
 
@Baboon This might take me a little while to understand..
 
or which part no ?
 
8:41 AM
foreach(var keyValuePair in myDictionary)
{
   if(comboBox1.SelectedItem.Equals(keyValuePair.Key))
   {
         foreach.....
               combobox2.Items.add
   }
}
 
@anybody to solve my problem please. :)
 
@awayoftarget Do you get it now? I think it should be along those lines.. Nothing too complicated.
@Baboon I think I understand what's happening. I will have to take a look at ComboBox.SelectedValue.SubObjects then thanks
@awayoftarget You can replace the inner foreach with addrange. That may work.
 
@LewsTherin but first I have make dictionary ,isnt it ??
 
Yes...
@Girish No idea sorry :(
 
9:06 AM
Or how can I solve with xml ?
that picture explains what I wanted
country ans city matching
 
>>Weird, someone talked about EF and @DavidDV didn't appear out of nowhere to say how bad it is..
damn :'(
 
9:53 AM
hi all
 
 
1 hour later…
10:58 AM
Good morning
 
Is there a way to change I/O priority of a process?
My attempts are vain
 
Erm, by changing priority you want to O/I instead of I/O? I really did not understand...
 
Uh what?
 
Explain exactly what you want.
 
I am reading from a file, I would like to give my process more priority against other processes.
Mine has the lowest priority compared to other applications
 
Doesn't work.. tried it already
 
Hm, I don't know, I can search some more for you..
 
To reduce your search I have tried thread priority and the one you've seen already. I am still looking myself.
 
May I ask why you want that to happen ?
 
Because the other processes are greedy bastards.. I want to even the playing field..
 
11:18 AM
I found a SO question about why does priorityclass fails..
Maybe you should check it
2
Q: Setting a thread priority in a service

dennisVIn my service I have a few threads that each call the CreateProcess() function to launch an external application. I would like to adjust thread (or process) priorities to normal or lower, depending on some other factors. The problem is that SetThreadPriority() function fails with an error 6 (inva...

And if still doesn't work. Try this : msdn.microsoft.com/en-us/library/…
I like the word boost. So I think it will work
 
@LewsTherin I'm back from lunch, any questions?
 
._. @Baboon where do you live ?
 
France
 
GMT +1 ?
 
yup
 
11:28 AM
GMT + 1 FTW
Best timezone ever ;)
 
Hm, let's do math, if here in Brazil is 8:28am and it is GMT - 3... GMT + 1 should be 12:28pm ? ._.
 
13:29pm
i meant 13:29
so 1:29pm
 
Oh yeah I have to count the GMT0 too :( F-ck math.
 
@Baboon Hey, just having lunch :) Is there a way to increase how much time my app has with the hard disk, if that makes sense
 
@LewsTherin I don't get what you want =o
you mean I/O on HDD?
like when you use StreamWriter/StreamReader?
 
11:33 AM
@Baboon Exactly yeah
 
there's not much you can do afaik
but i remember writing down 2Go of data in a few seconds a few years back
how much data are you writing and how long does it take?
 
@Baboon Not writing but reading.... about 2-3gb. It fluctuates from 10-30 (sometimes 40) seconds. Not good enough.
 
do you need all that data at once?
otherwise you could try to implement lazy loading
 
@Baboon I do need it at once unfortunately
 
can you show some code?
 
11:40 AM
isn't there an win API that is faster?
 
I am not allowed :(
But... I can tell you some bottlenecks if that helps at all.
integer and datetime parsing, regex, try catch block (Max exceptions thrown 11)
@DavidDV Is that unmanaged?
 
so you execute additional logic on top of reading 3-4Gb?
improve that logic
store in a lookup strings already parsed, if you find it again, you don't parse it, you take what was already computed
 
@Baboon Trust me, I did that already using the ANTs profiler. It just isn't stable..
@Baboon Done that as well xD
 
multi thread it?
load it all up
in an array of strings
and then use Parallel.ForEach
or cut it in 4-8 and starts 4-8 Tasks/Threads
then reassemble
 
@Baboon parallel.foreach made no difference for some reason. I am willing to try again though.
@Baboon Um, not sure how to do that for file reading..
 
11:44 AM
say you load it all up in one array
call array.Count and divide that by 4 or 8
if you're writing that data into objects
try using structs instead
then pass parameters by ref
 
@Baboon That's the problem.. how do I load 3gb in memory.. I tried and I get OM exceptions
 
you have to stream it then
 
@Baboon I will see what I can do with structs thanks.
 
I know at my old job they were loading 10Gb XMLs into memory to do some 3D high def rendering
so it's possible, but they were crazy I never looked deep
 
@Baboon Ok so look at how to stream from a file? And that is different from Streamreader? I did try MMF not much luck - I gave up, because the code looked crazy :(
 
11:49 AM
hi
 
morning
 
 
I need to send to a class a datatable and its columns. What is it better to do? Send DataColumnCollection or a List with all my column names ?
 
@LewsTherin I'm not particularly pro when it comes to streamreader/writer
see if you can find some crazy blog post about it ;)
 
12:10 PM
@asifa i am not sure i understand your question properly. Do you want 2 of those columns to be the unique key meaning those 2 columns cant have any duplicate entries and all others can?
 
12:22 PM
Hm, I'm stuck with this problem now...
Nvm.
D:
 
12:36 PM
@Baboon No problem, I'm looking into it thanks! :)
 
OK, I thought I resolved my problem but I didn't.
 
sup guys
 
Problems.. lots of it.
you ?
 
weekend was too short
 
@HansZ Too short. I need sleep, lots of it.
 
12:39 PM
how have you guys been up and on so chat since 7am est?
 
It is 9:38am here. Been since 8am D:
 
it's like 7:30 cst here
so it boggles my mind that other people are awake
and at work
 
You lazy bastard, while you're sleeping, we are already working !! haha
 
yeah but you guys leave around 3 though, what slackers
 
I leave 1800 here, so 1600 there I guess...
Let me ask one thing quickly. How can I filter a DataTable to send just the values from some columns... DataTable A has the following columns : A, B and C. And DataTable B has just the column A and B.
How can I send just A and B value from DataTable A to DataTable B...
Of course I have a lot more of columns so..
 
12:43 PM
hi guys. is there a way to add CSS classess
 
@Peter Add to what exactly?
 
to WebGrid headers? not a default "headerStyle" but data specific or column specific
 
What do you mean @Peter ?
 
sorry i hit enter by mistake :P
i am using WebMatrix and WebGrid and I am trying to hide certain columns because it looks better to split up this huge table into tabas
* tabs
but then the sorting does not work because both Grids seem to be responding to the Sort parameters of the other and throws an error because it cant find the sorted columns in its definition of columns (i think and i hope that i am making sense)
so instead of having two Grids (since i can't figure out how to get them to sort idependently) i am trying to use CSS to hide the columns that I dont need in each tab
so is it a) possible to get the WebGrids to sort independently or b) add CSS classes to each column so that i can hide them?
maybe like this - @grid.GetHtml( headerStyle: "@grid.thisColumnName" )
 
Yup, definitely lost by now :(
 
12:53 PM
haha
:(
 
I have a question: I must persist data in a webpage and only hit the database once to get it. It can be range from a few hundred records to thousand of rows and a maximum of 10k. It will be filtered by various user controls. I am storing the data as 2 data tables in session. What security issues could I face?, and what should I know before hand about this process?
 
what type of data are we talking about?
how confidential is this data?
 
@HansZ why do people use capacitors in circuits? my opinion is they act as open circuits but then how do you determine what value cap you need ?
 
Data dealing with post employment benefits
It needs to be farily safe though even getting to the point of seeing it has plenty of checks and balances'
 
@Nadal capacitors are not open circuit/close circuit, their behavior is more complex than that
These days, you don't have explicit capacitors, basically any two conductors semi near each other with difference in voltage acts as a capacitor
 
1:02 PM
i know caps are also somehow used to provide a stable current
 
so you have to deal with parasitic capacitance
 
god damn i knew this wasnt gonna be a simple answer but i asked anyway :P
 
@Nadal capacitors are used in waveform generators to create integrators, which (sort of) turns your waveform function into the integral of the waveform function
they're also used in RLC circuits which are used everywhere
 
i dont understand what makes a parallel plate capacitor so usefull....
 
they're one of the building blocks for most circuits, and it depends on what you're trying to make, then there are a whole slew of formula to give you what capacitance you need
capacitors have imaginary impedance
impedance = resistance with time+phase angle component
 
1:06 PM
okay let me ask a different one, what is the purpose of inductors, everyone says stuff like oh caps are sotirng energy in electric field and inductors are storing energy in mag field...Doesnt make sense to me, caps storing energy yeah okay that makes sense but inductors? those things are nothing more than your wire running current through it an the fact its coiled, how is it storing energy it is just passing current
 
magnets
an inductor is an electromagnet
magnetic field effects current
 
but you arent really storing anything]
 
okay, stick out your right thumb
 
i know magnetic field goes in the direction of fingers
 
if your thumb is a wire carrying a current, then your fingers curl around the magnetic field it produces
but if you keep rotating your thumb around a spiral
you can see most of the magnetic fields cancel each other out
 
1:09 PM
but putting up a magnetic field cant mean it is storing energy, all it is doing is putting up a barrier, capacitor makes sense because after you charge it you can use it as a battery you dont even need current running through anymore
 
and you get either a lot of ups or a lot of downs
nono, these aren't used to "store energy" or "use as battery"
these are used to modify how your circuit behaves in AC
 
oh
 
in DC applications you never use LC
that'd be silly
 
they always said caps and inductors store energy, even the friggin wiki says it
 
they're used to make waves that look like sin waves into waves that look like squares
 
1:10 PM
hows is that useful
 
well for one, that's how your clock works on your motherboard
 
When the current is turned on, a magnetic field is generated by the current. Another magnetic field is induced by the iron core, in the opposite direction. This causes the current to use significant energy overcoming the resistance cuased by the opposing field.
When the current is finally stable, there has been a good bit of energy into creating the magnetic field. This energy manifests itself then the voltage source is shut off, causing the inductor to become a voltage source as it releases the energy in the magnetic field.
 
speaker pre-amps take digital signals i.e. square waves, and turns it into sinosoidal waves
that can be fed through your woofer
 
ooooooo so what you are saying is that electrical signals are sine wave because they start and end gradually but clocks are obviouslly straight planes so you need those electrical signals to be true or false and nothing in between which is why u use caps?
 
soooooooooooo many reasons
basically if you need to ask why use capacitors, you don't need to know why use capacitors
 
1:13 PM
so am i correct?
 
falstad.com/circuit Best electronics applet.
Yes.
 
well analog waves are sine waves most times
digital signals are all square
though they're not perfectly square they're really square looking exponentials
 
@KendallFrey so according to what you said it sounds like energy can be induced into the core but you really arent storing it
 
You are storing it, but it is retrieved in a different form.
 
well here's the thing, a magnetic field affects current
and current affects magnetic field
 
1:16 PM
thats interesting, according to what you guys are saying I think it makes sense to say that the amplitude of the sine wave must be a bit higher than the square wave to generate a square wave out of a sine wave since the capacitor needs to absorb some energy to give a consistant amplitude
 
@Nadal theoretically yes, the square wave you get back from a sine wave's amplitude is the rms of the sine wave (root mean squared)
 
Capacitor: current in, current out, stored as voltage. Inductor: voltage in, voltage out, stored as current.
 
but most ac currents are differential
they are two sine waves 180 degrees apart
so the total voltage is the difference in voltage between the two
it's kind of hard to explain without drawing
 
basically the sine wave has to be a bit higher for it to divide in half and cover the red portions of the square wave
 
yes
but add another wave to the sine wave
that is the sine wave but negative
your total voltage you have to work with
 
1:20 PM
what is root mean squared o.o
 
is the difference between the two
 
@HansZ Why do they do that? I mean, wouldn't one wave be simpler?
 
take integral from start of period to end of period
 
@KendallFrey that makes sense, I guess there has to be some applications where you want to store energy as voltage and other applications where u need it as current
 
In alternating current (AC, also ac), the movement of electric charge periodically reverses direction. In direct current (DC, also dc), the flow of electric charge is only in one direction. The abbreviations AC and DC are often used to mean simply alternating and direct, as when they modify current or voltage. AC is the form in which electric power is delivered to businesses and residences. The usual waveform of an AC power circuit is a sine wave. In certain applications, different waveforms are used, such as triangular or square waves. Audio and radio signals carried on electri...
@KendallFrey there's actually a lot of reasons why
for example in signal processing, when transmitting signals across really long distances, you'll get a lot of noise from em interference
 
1:22 PM
The picture: variable current. ROTF
@HansZ So, assuming the interference affects both signals equally, you get the same signal at the end?
 
but that noise should affect both waves equally
so you take the difference, yep
that's called differential transmission
also the way that most signals are generated
is either through a generator, in which case with some clever finagling, you can get both waves
or through some sort of analog amplifier using some sort of voltage high (Vdd) and some sort of voltage low (ground)
and those are always reversible
 
I knew about 3-phase, but figured that 'normal' AC was 1-phase.
 
so you can always get the same signal by just making another one and putting it upside down between vdd and ground
'normal' AC doesn't exist any more
most generators use 3 phase because it is so much more efficient
 
i never really understood how changing direction can get you farther distances
 
@Nadal have you seen a rotory generator?
it basically produces a sine wave
 
1:26 PM
Because it's easy to step up to very high voltage.
 
a dc motor being spin manually?
 
a DC is produced using a rotory generator and circuit finagling
 
How can I add an unique constraint using Entity Framework Code First?
 
No, it's like a DC, but without brushes.
 
@KendallFrey I think then they must use transformers with this AC current to get high voltage
 
1:26 PM
Yup
DC is very hard to 'transform'.
 
also you can't have differential transmission with DC
 
Why not?
 
I was thinking a while back of creating a method of transforming DC into AC, or making AC from DC
 
well you can, but you'll need to carry -Vdd, +Vdd at all times
 
would it be of any use?
converting AC from DC?
 
1:28 PM
for some applications
 
like what
 
like rechargable battery chargers
 
So, am I right that diff AC has 3 wires: +signal, -signal, and ground?
 
use AC -> DC
laptops use AC -> DC
@KendallFrey no ground
 
People listen to AC/DC.
 
1:29 PM
but if you can DC-> AC
 
@HansZ OK, so one is sort of the ground.
 
not really
you can think of +signal + (-signal) = ground
 
No no no.
 
the ground at the powerplant is gonna be different than the ground at your house anyways
"ground" is a very loose term
 
the -signal can be connected to the 'ground' at the receiving end, right?
 
1:30 PM
well not really
 
is there a way to convert DC into AC? would it be useful ?
 
one signal isn't "negative" and the other isn't "positive"
one signal is just the inverse of the other
 
Not grounded, but behaves as the grounding wire.
@Nadal Oscillator.
 
What the heck is wrong with Windows ? Why won't he dispose the memory that I no longer use ?
 
1:32 PM
I was thinking the purple one, but I guess that's wrong.
 
@Nadal DC -> AC = anything controlled by computer to anything electronic that is analog
@kendall well it depends on what time it is
if it's 3pi/2 o'clock, then ground is +signal
 
@Andredseixas It will when needed. Having a load of free memory does not do anything for your PC..
 
if it's pi/2 o'clock, then ground is -signal
 
@HansZ is there a way currently to make DC-> AC then?
 
@Nadal oh my, yes
 
1:33 PM
Yes. Oscillator.
 
must google this!
 
@RoelvanUden I do mutual calls to a class from separated threads and it is conflicting because it is not removing the class from the memory, I think I'll need to force GC...
 
inductors, differentiators, op amps, band passes
basically we have more ways to AC -> DC and DC -> AC than applications
 
omg now I wonder how FM or radios send data through air
 
@Andredseixas That makes no sense at all. If there are two threads that have references to your class instantiation, it's still referenced and shouldn't be disposed. It doesn't sound like an issue with memory or anything, but rather with multi-threaded access on whatever you're using...
 
1:35 PM
@Nadal if you stick a metal stick in the air at just the right length, it'll produce current
if you put current through that metal stick, it'll make a wave
 
:S how does this work...I dont get how signals work or how you send waves in air
 
@Nadal you should really just take 2 years of E&M classes
 
i would assume that some sort of transmitter emits electrical signals in a particular pattern and some receiver at a far end will accept the signal once it is of that specific pattern
 
that about covers it
 
1:38 PM
That pattern is a RF wave.
 
that shud filter out the "other" electrical signals
 
@RoelvanUden When my page loads, I do 3 ajax to 3 separated handlers, each handler access 2 different classes that each class have to access a data access framework. But it is starting to conflict because it is not disposing the instantiated class... I think my database isn't handling a lot of simultaneous requests from the same id... I don't really know.. I'm shooting in the dark. :(
 
omg I feel so happy when my hypothesis are actually true :P
 
@Nadal well antennas are optimized for a particular range of frequencies
it'll get other electric signals but it'll pick it up with the sensitivity of jack diddly squat
 
ooo so since frequencies can be virtually limitless then those are your "passwords" to let the buddy in
 
1:39 PM
however if you have really powerful em waves from other sources, it'll mess up your antenna
they're not really passwords
 
How does a tuner work then? It doesn't adjust the antenna does it?
 
@KendallFrey it does, sort of
it applies a tiny bit of voltage on the antenna
 
i dont get how waves are sent through air though or how you can have just a metal rod pick up the waves or how you can generate specific frequency waves
 
so that it phase shifts the sequences
you need to stand a funny way to get in
 
@Andredseixas How did you ever jump to the conclusion it is an issue with class disposal? .NET is pretty easy in that regard, if you keep a reference, it stays alive, if you don't, it gets disposed. Nothing magic there. Just make sure your code is thread-safe, i.e. when using something such as EF you need a different context for each thread, and so forth ...
 
1:41 PM
now if you stand weirdly you still might fit but you won't get in as easily
but you'll sorta get in
if you stand wrong you'll never get in
antennas are things that always stand a certain way
 
@HansZ i think I have a better analogy
 
do you have a better digital watch?
 
How can anyone have a better analogy than HUMAN TETRIS!?
 
@RoelvanUden That is the problem. As I said, I'm shooting in the dark. I'm not using EF nor any common DAO on the web. My boss and his "pet" made their own DAO Framework, with a lot of "hammering". And I can't mess with them because they said it works. So I really don't know what to do. :(
 
there we go
you can get in various positions but certain ones allow you more easily
 
1:43 PM
For f-cking sake my monitor is placed where my boss can see it..
I will spam until it is gone
!!!
 
tell him you are making some demonstrations
 
Thanks.
 
right click, inspect element, delete node in chrome
 
and that it is educational
 
1:44 PM
@nadal
we usually don't post NSFW images because most of us are at work
4
also that's a terrible analogy, my antenna would pick up every signal
 
@HansZ And I am at home :)
 
@OutlawLemur Re: did I have the link memorized? No, but google did.
 
@Andredseixas Yeah well, complexities just went up a million. Using some custom-rolled DAO some individual made probably causes more grief than joy, especially if that fool didn't consider the more complex threading. Buckle up and good luck.
 
@Kendall Damn that google, makes me look like an idiot in front of hundreds :). I least I won the question
 
@RoelvanUden Thanks, I already had some adventures looking at this DAO. Like, no verification of connection state and such...
 
1:55 PM
@Kendall Sorry that the first day after I am a room owner I don't make an appearance :)
 
This is awesome. Now that I'm 10k, I can see all the stupid stuff people flag.
 

« first day (653 days earlier)      last day (4296 days later) »