« first day (746 days earlier)      last day (4207 days later) » 

7:01 PM
I think that Javascript was poorly designed
and now they can't fix the most obvious flaws without breaking retrocompatibility
 
what "flaws"
 
@rlemon hey.. javascript is good but it has some messy things in it..i had personally experienced this when i was devloping my personal website..JQuery helped a lot than javascript
 
JS is a POO
 
@zneak Are you saying we need another CoffeeScript/TypeScript?
@rlemon lol
 
:?.... if you think javascript is bad you cant follow it up with jQuery is good.
 
7:02 PM
@Fake.It.Til.U.Make.It jQuery is javascript
 
@rlemon how any property that doesn't exist on an object becomes "undefined" is a flaw
 
@Fake.It.Til.U.Make.It @TomW pastebin.com/KgQrbHST
 
which makes me now understand. you didn't learn js properly and don't like duck typed languages that is cool
 
but jquery makes this Dom interaction way simple
 
7:03 PM
@zneak What should it be then?
 
@KendallFrey it should throw an exception right away at the strict minimum
 
dom interaction is crazy simple in anything above IE7 with vanilla js.
 
@Fake.It.Til.U.Make.It Can you check and reply me. whats going wrong in getting list?
 
@zneak "strict mode"
also I can call our caveats in any language
 
love it or hate it JS is here forever :P
 
7:04 PM
doesn't mean they "suck" - just means it didn't function as I first expected it to
 
JS is designed to keep running on a failure. Throwing an exception is not a Good Thing (tm).
 
@rlemon I remember that using strict did not fix something related to undefined, let me check that again
 
might not, but I don't think it should in that specific case
 
@Abhishek You haven't said what the problem is, but I've already told you what's wrong. You're selecting url elements, then querying those for child elements called url. That doesn't make sense.
 
all I was pointing out was that they are improving it without breaking any backwards compatibility (aside from proprietary MS crap)
 
7:06 PM
from c in xmlDoc.Elements(Convert.ToString(Lang)).Descendants("url")- iterating over url elements
 
Strict mode prevents you from accidentally creating globals (which is great because that was another caveat)
 
then where c.Descendants("loc").SingleOrDefault().Value.Contains(url) looks for a descendent called loc in url, which it doesn't have
 
that aside, method references are still kinda broken (less now that you have bind, but still kinda broken)
 
JS is a pain in the ass to learn if it is not your first language. I can understand that. But the language (once you really get into it) is elegant and allows you to do things other languages just wont do.
 
non-transitive type juggling rules are not nice
 
7:07 PM
duck typing is awesome
screw that
 
duck typing is great
type juggling is not
 
nothing's broken. The scope references is the strongest thing, after prototype, for me.
 
there are some things that don't really function "as first expected" for me, but then you learn how they do function and move on.
like half of the controls in .net 3.5 winforms
 
@Abhishek try this
xmlDoc.XPathSelectElement("\\"+Convert.ToString(Lang)+"\url").Where(x=>x.Element("loc").Value.Contains(url)).Select(c=>
new
{
URL = c.Element("loc").Value,
Title = c.Element("title").Value,
Description = c.Element("description").Value,
Keyword1 = c.Element("Keyword1").Value,
Keyword2 = c.Element("Keyword2").Value
}
);
 
@TomW How to search whole node from Xdocument I have not use it earilar.. can u give me code How to search element from xdocument with Where condition.. I am searching URL from <url> node. if it match..
ok @Fake.It.Til.U.Make.It thx
 
7:09 PM
I'm not here to start a language war but there's a fundamental difference between the language not working as expected and the library not working as expected
you can always fix a library by implementing another one on the top of it
 
the language doesn't work as expected because it is unlike most other languages
you expect the wrong thing
 
I'd make a point that it's not coherent
 
drop all expectations. engulf yourself in the awesomeness that is ECMAScript
 
and that this is why it's "unlike most languages" (which is not quite true either)
 
not in large ways, small little things
 
7:11 PM
@Fake.It.Til.U.Make.It Are you use XDocument or XmlDocument?
 
it's not like i'm comparing brainfuck to erlang
 
no, it's not like we're comparing brainfuck to erlang
javascript is not unusable
 
@Abhishek use XElement
 
I getting assembly reference error at XPathSelectElement syntax @Fake.It.Til.U.Make.It
ok @Fake.It.Til.U.Make.It
 
the language itself was just poorly designed
javascript is the second language I learned after php
I made a NES emulator with it
I know all those little ugly details that sting your face when you don't really expect it
that's not a big issue, it's just not pleasant
 
7:13 PM
QBASIC was my first language
I miss GOTOs
 
@Abhishek u need to include System.Xml.XPath
 
ok.. LEt me try @Fake.It.Til.U.Make.It
@TomW I wrote code at pastebin.com/KgQrbHST
see it
@Fake.It.Til.U.Make.It I getting error at .Where clause.. something going wrong.
can u pls recheck it?
ok It was XPathSelectElements() instead of XPathSelectElement().
sorry @Fake.It.Til.U.Make.It
 
@Abhishek its the problem with namespace..ur code was right
use this
XNamespace s="http://www.abc.com";
@Abhishek add s to every element like this
.Elements(s+"English").Descendants(s+"url")
 
ok @Fake.It.Til.U.Make.It good..
Good name anirudha.. my friend name anirudha too.
 
yay for halloween potlucks
 
7:27 PM
@Abhishek here is what you need to do
XElement xmlDoc=XElement.Load("c:\\hello.xml");
XNamespace s="http://www.abc.com";
xmlDoc.Descendants(s+"English").Elements(s+"url").Where(x=>x.Element(s+"loc").Value!="").Select(c=>
new
{
URL = c.Element(s+"loc").Value,
Title = c.Element(s+"title").Value,
Description = c.Element(s+"description").Value
}
)
 
yes like this. I will use ur code.. thanks @Fake.It.Til.U.Make.It I doing debug in my code..
@Fake.It.Til.U.Make.It what is ImageMax do u developed it?
@Fake.It.Til.U.Make.It @TomW Thank you very much for give your important time to me... Good night.. Tc. bye..
 
AMH
0
Q: usercontrol keydown at MVVM silverlight project

AMHam new to MVVM world ,I have a XAMl like <UserControl x:Class="KeyDownMVVM.MainPage" 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=...

 
7:49 PM
@Abhishek Imagemax..i made it just for fun..an image processing software to change brightness,contrast and all that stuff..:)
 
does it run on c#?
how were you able to determine a brighter version of #1d334c (for example) without changing its color?
 
object[] x = new object[1];
x[0] = x; // xception!
 
@TravisJ actually i used this library here he's explained every bit of normal image processing
 
interesting
 
8:05 PM
... too you o_O
 
TRON:LEGACY:RECONFIGURED is my new favorite techno album, I think
 
@rlemon - ping. Yes.
 
@TravisJ well, depends on what you mean by "brightness". Do you mean higher saturation, or do you mean being closer to white? There's no concept of "brightness" in digital color
 
BS. White is brighter than black.
 
@kendall - that did not throw an exception for me
 
8:07 PM
It's not supposed to lol.
See what I did there?
 
No.
Seems like a waste of time to even come up with that.
 
it all about separating the rgb colors and then changing those individual values between 0-255..but its too hard understand
 
You cannot change them individually though, they must be changed in unison
 
@TravisJ Maybe, but brains don't ask for permission.
 
ping @TravisJ

Pinging @TravisJ [123.456.789.10] with 32 bytes of data:
Reply from 123.456.789.10: bytes=32 time=42ms TTL=55
Reply from 123.456.789.10: bytes=32 time=42ms TTL=55
Reply from 123.456.789.10: bytes=32 time=42ms TTL=55
Reply from 123.456.789.10: bytes=32 time=42ms TTL=55

Ping statistics for 123.456.789.10:
- Packets: Send = 4, Received = 4, Lost = 0 (0% loss),
Approximation round trip times in milli-seconds:
- Minimum = 42ms, Maximum = 42ms, Average = 42ms
 
8:08 PM
basically, to make something brighter, you need to map it first
 
And it has nothing to do with exceptions.
Inception is a 2010 science fiction/action heist film written, co-produced, and directed by Christopher Nolan. The film stars a large ensemble cast that includes Leonardo DiCaprio, Ken Watanabe, Joseph Gordon-Levitt, Marion Cotillard, Ellen Page, Tom Hardy, Dileep Rao, Cillian Murphy, Tom Berenger, and Michael Caine. DiCaprio plays Dom Cobb, a thief who commits corporate espionage by infiltrating the subconscious of his targets. He is offered a chance to regain his old life as payment for a task considered to be impossible: "inception", the implantation of another person's idea into a ta...
 
@Pheonixblade9 - Never really considered it as "closer to white". I was thinking of it from an intensity standpoint.
@rlemon - How did you has my ip!?
 
@TravisJ well then you're looking at saturation, not brightness. :)
 
Braveheart movie is great!.....
 
To answer your question, I think this works: stackoverflow.com/questions/737217/…
 
8:10 PM
@TravisJ what is sad about that is that I really really dislike windows CLI so I was unaware right click > context menu > Select All.... I hand typed that all out.
 
@Pheonixblade9 - I tried that once, but it changes colors to do that.
@rlemon - That is kind of impressive actually.
 
c#'s image processing libs are tooooooo slow..we need use pointers in c#..8O
 
@TravisJ well, you need to change the colors, or convert it to a different color format, then back to ARGB.
@Fake.It.Til.U.Make.It C# does use pointers... you just don't see them ;)
 
@TravisJ but now it's copied and can be reused
like most of my code!
 
8:12 PM
It also has pointers, in the C++ sense of it.
 
byte *ptr;
 
why put the start next to the variable name ? :(
hey trivia question for you Kendall
byte* a, b;
is b a pointer too?
 
delegate ftw?
 
In C++, I know what that does. Is it the same in C#?
I'd guess so.
 
This inverts the image in c# using pointer

public static bool Invert(Bitmap b)
{
// GDI+ still lies to us - the return format is BGR, NOT RGB.
BitmapData bmData = b.LockBits(new Rectangle(0, 0, b.Width, b.Height),
ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride = bmData.Stride;
System.IntPtr Scan0 = bmData.Scan0;
unsafe
{
byte * p = (byte *)(void *)Scan0;
int nOffset = stride - b.Width*3;
int nWidth = b.Width * 3;
for(int y=0;y < b.Height;++y)
{
for(int x=0; x < nWidth; ++x )
{
 
8:14 PM
true + true === 2; // true
 
@zneak Convention maybe?
@rlemon I already did that today.
 
not me
 
@rlemon that's how you make a tri-state boolean :)
 
in C#, byte* a, b; declares two byte pointers
 
I only sit on my own throne
 
8:14 PM
@zneak brilliant.
Here's something you may not know.
x[] is an array of x, right?
 
@zneak are you like the Jon Skeet of Dragons?
 
x[,] is a 2d array of x.
 
that's a very cool title @rlemon
yes @KendallFrey
 
but x[][,] is not a 2d array of arrays of x
 
it's an array of 2d arrays or something even weirder?
 
8:16 PM
+[[]] === 0; // true
 
Yeah (the first one)
 
I love JS!
 
you just summed up half of what I hate in javascript
 
it's like a ninja language
you have to be sneaky and use numb-chucks
 
+[][+[]] === "f" IIRC
 
8:17 PM
nunchuks maybe?
 
no numb-chucks
 
Nope. :( Trying again...
 
I know what I said.
 
![][![]] maybe
 
![][0]
 
8:18 PM
@rlemon - true + 1 === 2 * true; // true
 
some are not wtf's it's just people being stupid
"hummm drumm ,I don't know this language. it's stupid!"
 
it's annoying that js numbers become doubles as soon as you cross 2^31-1
 
javascript and java are the biggest mistakes
 
alert(1111111111111111111); // 1111111111111111200
 
and that there's just nothing to do if you need 64-bit integers
 
8:20 PM
lol they are always doubles
 
nope
 
javascript has ABSOLUTELY NO CONNECTION WITH JAVA!!!!!
 
In storage they are.
Only ints for bitwise math
 
Performs a bitwise left shift operation on the left operand by the amount specified by the right operand.

The production ShiftExpression : ShiftExpression << AdditiveExpression is evaluated as follows:

Let lref be the result of evaluating ShiftExpression.
Let lval be GetValue(lref).
Let rref be the result of evaluating AdditiveExpression.
Let rval be GetValue(rref).
Let lnum be ToInt32(lval).
Let rnum be ToUint32(rval).
Let shiftCount be the result of masking out all but the least significant 5 bits of rnum, that is, compute rnum & 0x1F.
 
if( name.indexOf("java") > -1 ){
 //same
}
 
8:21 PM
they both annoy me..thts wht is common in them
 
and you annoy me now. troll.
go back to your bridge and throw rocks at children
 
lol
but seriously, javascript is waaay cooler than java
 
Javascript is way cooler than most languages.
 
@zneak And...?
 
the result is a signed 32-bit integer :/
 
8:22 PM
is the question, "Is there a technical term for pushing website changes live?" suitable for SO?
 
I write c, c++ c#, java (ugh), and assembly for a living
js is fun
 
who else is going to take care of your front end that good, no matter what happens? javascript. thats who
 
I love it
 
@ajbeaven No.
@zneak converted to a Number (IEEE double)
 
@ajbeaven maybe programmers.se
 
8:24 PM
@ajbeaven - Publishing a new version.
 
thanks guys :)
 
@ajbeaven publishing, patching, updating
 
I was more thinking of a single term that described the process - like 'pushover' or something like that
 
"gneh"
!!/urban gneh
@rlemon gneh: A word that means ANYTHING, and i mean ANYTHING. This word can be used in ANY situation in response to almost anything.
 
@rlemon gneh you.
 
8:28 PM
you sir, are one gigantic gneh
 
@rlemon go gneh yourself
 
@rlemon - I hate to tell you, but you are HIV gneh
 
sweet.
 
Have a gneh day! :D
 
no more rubs for me
 
8:31 PM
lol @ the reference.
 
1
Q: How to convert binary string to integer string

KostekLets say that I have string which contains 1024 characters (represents 0 and 1). I want to present it as an number in decimal base (also as a string). The tricky part is that i have to do it in C/C++ without 3rd part libraries. Any clues?

 
@Fake.It.Til.U.Make.It oh man, I can think of a really ghetto way to do that.
 
@Pheonixblade9 i wonder how can we store a no with 2^1023
 
@Fake.It.Til.U.Make.It just iterate through it and add numbers with multiples. You can't represent it as a decimal, though
 
BigInteger, or in the case of no BigInteger, a byte or int array
 
8:34 PM
BigInteger is 128 bits.
-1
A: How to convert binary string to integer string

Pheonixblade9You can't represent a 1024 bit number as a decimal. The closest you could get is a floating point approximation.

 
guys, i have a question in mind i just can't put it together in a good question for SE.. need ur help..
 
DA FUQ???
 
jesus, people are just downvoting like crazy for no reason
 
> You can't represent a 1024 bit number as a decimal.
For no reason you say?
DA FUQ???
 
stupid TrackBar
Y I NO UNDERSTAND YOU
 
8:36 PM
I need to find the way the "progress ring" calculates the speed of the points...
I want to make something similar for winforms...
 
this is C# chat
 
@FreddyFlares the question is for C/C++... not sure why it was posted, but whatevs :P
 
@FreddyFlares I want to write it in c#
 
c,c++,c# has common grammar..
 
throw new StupidityOverflowException();
 
8:40 PM
} catch( StupidityOverflowException ex ) {
     Console.WriteLine(String.Format("rlemon is an idiot: {0}", ex.Message.ToString()));
}
 
No shit, if you use String.
 
:(
how else :P
 
string maybe?
 
8:41 PM
no you
 
@rlemon - Any way to force the gc to take action on a still scoped variable?
 
@TravisJ ask Kendall
he pretty much writes my code so.
 
sorry, in js
 
umm, gc in js?
i never hurd such things
 
Yeah, js has a gc
 
8:42 PM
I just manage my own data
 
You want to collect a referenced object? U crazy man!
 
delete obj.property
obj = null;
types of dealios
 
I tried that :(
 
what is the use case?
 
This is a good example, it will run up an extra 70BM of used memory for about 10s:
var fd = (function () {
        var x = "1";
        for (var i = 0; i < 1000000; i++) {
            x += " " + i;
        }
    })();
 
8:43 PM
@rlemon Still need the GC for obj. (and probably obj.property too)
70 Bowel Movements. Oh my stars...
 
afaik only JScript actually implements high level GC
 
So the browser is who does the GC?
 
yes I believe
but I could be wrong
 
Well, yeah, since it does everything else.
 
sounds right though
 
8:44 PM
JScript 'engine' iirc does it's own GC
 
ok, back to gneh
 
Gc.Collect(0);
 
GC.Collect(); // better
// if you wish to poison your code anyway
 
@TravisJ I'm not seeing the memory increase here
you must be using IE
I see it, but then it drops off after the IIFE is run
 
6KB/s download speed. Absolutely marvelous.
 
8:48 PM
good old ELippert blogs :)
 
yea I avoid JScript
 
Eric Lippert, He Whose Blog Shapes What Is
 
I stick to good old Javascript and just write around IE
 
@rlemon just use Jquery and modernizr
 
ummm, sorry, I have self respect.
jQuery - well I understand 100% of the source code so I'll just hand write the snippets I need.
modernizr - fuck IE7, so I don't need it
 
8:55 PM
@rlemon well I'll let you know how my meeting with Luke Hoban goes, if TypeScript is worth your time :)
 
@rlemon - That was from ff and chrome. It doesn't last long, you have to watch it. Like I said, 10s.
 
sorry, I get pissy when someone suggest justusejquery.com
@TravisJ well you are building out a string that is 1000000+bytes long
what do you want the browser to do
 
Collect it faster?
 
@Pheonixblade9 anything that compiles down to javascript is not worth my time
again, i understand the language. why in the hell would I learn some new dialect of it which I do not need
TypeScript just masks the code you don't like writing with syntax sugars you love
class Foo {
     int someProp;
}

function Foo() {
    this.someProp;
}
all of these "compilers to make js better" are bogus
these people should spend the time working with W3C/ECMA/etc to help further progress the standards and put pressure on browser vendors to actually implement it to spec.
 
they should take a lesson from GPU manufacturers, and write a reference implementation
vendors steal it, who cares, they're funding it anyway - and there's a chance that they might write something that actually does what it's supposed to
then they can focus on optimising and adding stupid platform features, which will always be a pain in the ass, but at least they're adding stupid features to a product that supports the sensible ones
 
9:11 PM
@rlemon lol "You know you're doing it right when you're loading 12 jQuery plugins."
 
9:41 PM
Hey guys, I'm trying to inline a method in C# but I can't get it to work, when I do Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name); it keeps saying its own method name.
This is the method I'm trying to inline:
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool isValid(int x, int y, BitArray[] map, Maze maze)
{
Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
if (x > 0 && x < maze.Width - 1 && y > 0 && y < maze.Height - 1)
{
return !map[x][y];
}
return false;
}
 
I don't know very much about inlining, but I know that you can't FORCE the JIT to inline
you can only hint
 
Yeah I know
But I've tried very simple methods
 
it'll ignore you for a variety of reasons
 
and nothing happened
 
Erm, call me dumb...wouldn't having a line that relies on the current method name being correct invalidate any possibility for inlining?
 
9:44 PM
I don't know :D
 
Sigh, I answered a question with code and an exact example. Darin posted two links which relate to what I answered 3 minutes later and got the accepted answer =/
 
complain to the OP, people should be taught how to use SO properly
 
But I don't want to piss of Darin, he is kind of epic...His answers have helped me a lot before
Aside from a problem factory, what do you call an object which would implement the factory pattern on an already implemented factory pattern?
 
@TravisJ consolation upvote
 
lol yay
@Kyle - What would I call something that produces factories?
 
9:56 PM
A FactoryFactory?
 
I have panel, a panel factory, and now I am going to make something which configures part of the panel factory
it is using the panel factory to build specialty panels to inject into the panel factory
 
"configures part of the panel factory"
like a bunch of properties?
 
Well, the panel factory has a lot of hooks to build panels. And there are patterns in how I am using these hooks that I want to make use of from a function call instead of just copy pasting all the time.
This is in javascript btw, but still, the approach is agnostic.
 
I was gonna say, make a PanelFactoryOptions class, and a PanelFactoryOptionsFactory. use the options class to store the options you want
 

« first day (746 days earlier)      last day (4207 days later) »