« first day (319 days earlier)      last day (4630 days later) » 

8:00 PM
@BrandonBenvie Thanks Brandon, also $el is shorthand to $("#myTable")
 
user748221
and $el should be some element I'm guessibng
 
user748221
ok
 
@MattMcDonald Yep
 
user1385191
why have you not jumped off a cliff yet? that kind of code would drive me insane
 
@AMH What kind of web service?
 
AMH
8:00 PM
C# web service
@RyanKinal
 
@AMH Is the Service registered on the page in which you're trying to access it?
 
user748221
myColModel
 
AMH
@RyanKinal could u explain to me more
 
user748221
that just the handle for it?
 
user748221
the callback
 
AMH
8:02 PM
what do u mean by register @RyanKinal
 
user748221
for columns or something
 
user748221
or list of columns
 
@BrandonBenvie I'm an idiot... I'm setting properties more than once, all over the place
 
user748221
yeah haha
 
AMH
@RyanKinal any idea
 
8:03 PM
<asp:ScriptManager>
	<Services>
		<asp:ServiceReference Path="~/myServices.asmx" />
	</Services>
</asp:ScriptManager>
do you have one of those on your page?
 
AMH
@RyanKinal No
U mean I add it , but how to call function in it with parameters
 
@BrandonBenvie I've cleaned it up, but the Enter key is still not registered to invoke the save
 
@AMH If you can add it, that makes things easier
 
user748221
oh better
 
AMH
@RyanKinal could u give me example please , I am new to that
 
8:05 PM
@AMH Do you have an ASPX page you are working with?
Or is this not actually ASP.NET (and I'm just making an ass of myself?)
 
user748221
hmmmm
 
Woo, 10 whole views on my Long-Polling/Comet/Reverse AJAX question on Code Review -_-
 
AMH
@RyanKinal it's aspx page
 
user748221
hah trying to get this to work since it's not an obvious code problem
 
user748221
defining fake objects for everything seems to be backfiring
 
8:08 PM
@AMH Put the above code (the ScriptManager code) just below the first <form> tag (and hope it's an AJAX-enabled website)
(Gotta love technical ASP.NET terms -_-)
 
AMH
@RyanKinal I can use ajax
 
user748221
if (rowid && rowid !== lastsel) {
 
@AMH Did you put the ScriptManager in?
 
user748221
is it possible that may be returning false or true when you think the opposite
 
AMH
@RyanKinal yes
 
user748221
8:10 PM
hmm
 
@AMH Okay. What browser are you using?
 
user748221
where is lastsel defined
 
AMH
@RyanKinal I want it to work in all the browsers
 
user748221
lastsel is not defined anywhere in this
 
@AMH Lynx too?
 
8:10 PM
@AMH Right. But we need to test to see if your web service is defined.
 
AMH
@RyanKinal ok, suggest one
 
user748221
if (rowid && rowid !== lastsel) {
$el.jqGrid('restoreRow', lastsel);
$el.jqGrid('editRow', rowid, true);
lastsel = rowid;
}
 
@BrandonBenvie Hmm, that could be. I have defined it as a global variable up top. The script I've got is actually a bit larger than this...
 
user748221
lastsel magically comes into existance
 
user748221
what is it defined to?
 
8:12 PM
@AMH Actually, just put the following at the bottom of your page (just before the </body> tag)
<script type="text/javascript">
alert(your_webservice_name);
</script>
 
user748221
what if rowid is null and lastsel is null by default
 
user748221
and then it is true
 
user748221
when you think it'll be false
 
(yes, I'm using alert, because I'm unsure console is available)
 
@BrandonBenvie Son of a gun, I didn't even initialize it to null
 
8:12 PM
@AMH Once that's in there, open the page in a browser, and see what comes up
 
user748221
yeah javascript waits in the shadows
 
user748221
it looks for weakness
 
user748221
and it sees you being haughty, making assumptions
 
user748221
bam, pants gone
 
AMH
@RyanKinal can I summarize what shall I do
 
user748221
8:14 PM
make sure to either initialize variables, or if you're dealing with unknowns check them against null absolute first thing
 
user748221
in ondblClickRow: function(rowid) {
 
user748221
I'd just start it with
 
user748221
if(rowid == null) return
 
@BrandonBenvie Hah... Ayay, yeah this sure is odd. My if (rowid && rowid !== lastsel) seems to be true when I expect it to be true, the $el.jqGrid('editRow'...); is invoked as I expect, but the Enter key isn't working, as set by that true
 
user748221
which will solve a lot of problems
 
8:15 PM
@AMH I'm not sure what you are asking
 
user748221
whenever you have DOM event callbacks with that stuff, some null check is usually first priority
 
user748221
before you start comparing any other variables
 
@BrandonBenvie Can you clarify DOM event callbacks ?
 
user748221
stuff like
 
user748221
any human input is DOM stuff
 
user748221
8:16 PM
clicks, keyboard
 
@AMH Also, check this out at some point - it likely goes over a lot of the things I would teach you, and in more detail: Using Web Services in ASP.NET AJAX
 
user748221
but more generally, in any context
 
user1385191
foo.onclick = bar;
 
user748221
make sure to be aware if a function may be called with an argument as null
 
I see, huh, didn't realize keyboard events are DOM events
 
user748221
8:17 PM
this especially happens with mouse/keyboard, etc. stuff, but could be anything
 
user748221
and if you can envision that make sure you're checking that first, because null == null will get you ever time
 
user748221
cause it's true, and not what you want
 
AMH
@RyanKinal will u be online till I try what U told me about
 
user748221
javascript itself is very limited in scope
 
@BrandonBenvie right... but, I can do if (x === Undefined), right ? Saw that somewhere...
 
8:19 PM
@AMH I'll probably be gone in 40 minutes or so... so... maybe?
 
Man I hate being interrupted while working on something :?
 
user748221
best undefined check is
 
user748221
typeof x == "undefined"
 
^ canvas rather than divs.
 
user748221
8:19 PM
x == null
 
AMH
@RyanKinal ccould u skype if u never mind
 
what's that?
 
user748221
best null check is
 
Updates firefox nightly
 
8:19 PM
I just forked yours @RyanKinal lol had to do it with canvas.
 
on loading it openened a strange address
www.楦敬⼺⼯潨敭椯潶䐯獥瑫灯氯慥⽦楂体⽎敢据⹨瑨汭਍.com
 
@Loktar :-D
 
user748221
and keep in mind undefined and null are different
 
failed
 
user748221
though
 
8:20 PM
google translate points me to iteasypass.com
 
user748221
if something is null
 
user748221
it will return true for undefined
 
user748221
but if you try to test something that IS undefined
 
user748221
so you have to do typeof x == "undefined" for actually undefined variables
 
user748221
8:21 PM
BUT in a function
 
if (typeof undefined != 'undefined') { alert('Woah, WTF?'); }
 
user748221
a name parameters can be checked with a null check
 
user748221
you won't get undefined errors on xxx in function(xxx){}
 
user748221
even if it is
 
@AMH No Skype access right now, sorry
 
user748221
8:22 PM
but xxx == null is fine
 
user748221
shortversion if you're checking a function paramter, use (param == null)
 
@BrandonBenvie Got it, thank you. Going to read through jqGrid docs again. Something's not right
 
Why is it that all East-Asian sites look like phishing sites to me?
 
@RyanKinal Hm, no idea where it came from, seems like nothing happened
there's no JS on the page either
 
@IvoWetzel Well, that's a good sign.
 
8:25 PM
Also noScript and AdBLock should prevent most evil to happen
No real Idea though why FX tried to open that page
 
AMH
@RyanKinal no problem I will do that and tell u
 
AMH
@RyanKinal I did, and added webservice on it and used the following code, and it displayed the name of the web service
@RyanKinal <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
alert("WebService1.asmx");
</script>

</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Welcome to ASP.NET!
</h2>
<p>
To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.
</p>
<p>
You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.
@RyanKinal what shall I do next
 
@AMH might want to make an actual question honestly.
 
user1385191
8:30 PM
he already did
 
AMH
@Loktar I already did
 
user1385191
he's just filling the room with noise
 
AMH
@MattMcDonald thanks a lot
 
Yeah but you didnt say you needed the webservice done too
I thought the question was just how to display pixel data
 
AMH
@Loktar I already said call with web servie ad draw image pixes using javascript and html 5
 
8:31 PM
"I have a web service that contain function return array of bits I want to use javascript and html5 to draw this array of bits in imagebox for example , the array of bits form image

any suggestion"
So you might want to elaborate in the question more
 
AMH
@Loktar yes this my questions , and @RyanKinal help me
 
@AMH Question is answered. Using @Loktar's <canvas> code, but you could replace it with my <div> code
 
AMH
@RyanKinal remain calling the web service
and call function in it that take parameters and return array of bits
 
@AMH Look in your question ;-)
0
A: call webservice functon using javascript and HTML5

Ryan KinalUse the following code. Replace WebService1.getImage with your service name and the function that returns your data. <div id="image"></div> <script type="text/javascript"> function draw(data) { var canvas = document.getElementById('image'), ctx = canvas.getContext('...

If you'd rather use divs than canvas, replace it with the code from the Fiddle I linked earlier
 
Ah I was going to ask a question
 
AMH
8:38 PM
@RyanKinal thanks a lot , final question what WebService1.getImage prototype
 
._handleMultipleAPIs is a shit name. Recommend a better one
 
@AMH ... you don't actually have the method written? So you didn't actually have a WebService that returns an array of bits?
@Raynos ._rosetta
 
AMH
@RyanKinal I aready have
[WebMethod]

public byte[] imageArray(string path)
{

return new byte[] { 1,0,0,0,0,1 ,0};

}
 
So, where I have WebService1.getImage, replace it with WebService1.imageArray
 
AMH
@RyanKinal ok thanks a lot
@RyanKinal how to put the input parameters
and what about draw, fail
 
8:45 PM
@AMH WebService1.imageArray('/path/you/want', draw, fail);
And with that, I'm done.
Sorry for the noise all, I'll see you later
 
AMH
may I aks final question
please
@RyanKinal
@RyanKinal how to handle mouse events on div
 
@RyanKinal wait what, VB.NET 2.0
You choose doing it yourself in VB.NET 2.0 over using socket.io & iis-node ?
 
AMH
@RyanKinal still how to fill the data
<script type="text/javascript">
alert("WebService1.asmx");

function draw(data) {
var data = [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0],
i = 0,
image = document.getElementById('image'),
pixel;

for (; i < data.length; i++) {
pixel = document.createElement('div');
pixel.className = (data[i]) ? 'on' : 'off';
image.appendChild(pixel)
}
}

function fail() {
alert('request failed');
}

WebService1.imageArray('s//s/',draw, fail);

</script>
I modified it to be
<script type="text/javascript">
alert("WebService1.asmx");

var data;

function draw(data) {
//var data = [0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0],
i = 0,
image = document.getElementById('image'),
pixel;
for (; i < data.length; i++) {
pixel = document.createElement('div');
pixel.className = (data[i]) ? 'on' : 'off';
image.appendChild(pixel)
}
}

function fail() {
alert('request failed');
}

data= WebService1.imageArray('s//s/',draw, fail);

</script>
is it true ?
@RyanKinal
 
user1385191
aaaaaaaaaaaa
 
user1385191
put that in a pastebin link
 
AMH
8:51 PM
@RyanKinal any idea
 
Do you know how much tidier / cleaner / less like spam the chat looks if you ignore AMH
 
AMH
@MattMcDonald wish that make u stop complain, instead help me
@RyanKinal nothing be drawn
 
user1385191
boy oh boy, wouldn't it be fun to run into the middle of a restaurant and yell "HELP ME HELP ME!!!!"?
3
 
Can someone explain to me why IE8 hates this?
var temp = node.appendChild(document.createElement("input"));
temp.setAttribute("type","text");
temp.setAttribute("name","firstName");
 
user1385191
why setAttribute instead of .type/.name?
 
8:57 PM
Riiiiiight. v.v
Alright, that makes sense.
 
AMH
@all why this code not work pastebin.com/ZcZBR2Z0
 
@AMH You;re using a comma at the end of lines, you need to use a semi-colon.
 
user1385191
no, it's because the var line is commented out
 
user1385191
it's valid for declaring multiple vars
 
AMH
@Incognito @MattMcDonald , IT DOESN'T ENTER THE FUNCTION
the alert never be called
 
user1385191
9:03 PM
2 mins ago, by Matt McDonald
no, it's because the var line is commented out
 
AMH
@MattMcDonald I fill it using functions
 
not enough jQuery...
 
AMH
@MattMcDonald data = WebService1.imageArray('s//s/', draw, fail);
I use data to draw in the div
 
user1385191
I don't care, just uncomment that line
 
Why do you guys bother?
 
AMH
9:08 PM
@MattMcDonald this is the complete code pastebin.com/MmpHdFtb
what's wrong in it
 
AMH
9:19 PM
@MattMcDonald there's no var line
 
10:01 PM
Hi there
can anybody tell me how to create a reverse loop in coffeescript?
I have checked the documentation/github-issue-list/wiki but without any luck :(
 
Ehm
while (i--)
Thats some basic programming there
 
10:18 PM
I know that...just wanted to get an output similar to:
        for (var i = array.length - 1; i >= 0; i--) {
 
AMH
what's the error on pastebin.com/MmpHdFtb
 
just wondering if there was native support in coffeescript for reverse loops
I have tried....
for item in array by -1
but that just outputs an infinite loop :p
  for (_i = 0, _len = array.length, _step = -1; _i < _len; _i += _step) {
:(
 
AMH
@MattMcDonald any idea
 
Ehm
Thats why we dont use coffeescript :P
 
user1385191
what is the appeal of coffeescript again?
 
user1385191
10:25 PM
that it looks like Python?
 
haha
np guys
I stopped fighting the library and choose a different path instead
sorry for the lack of context
@unsubscribe = (fn) ->
index = handlers.length-1;
while index >= 0
handler = handlers[index]
if(handler == fn)
handlers.splice(index,1)
index--
return
return
that outputs:
this.unsubscribe = function(fn) {
  var handler, index;
  index = handlers.length - 1;
  while (index >= 0) {
    handler = handlers[index];
    if (handler === fn) {
      handlers.splice(index, 1);
    }
    index--;
  }
};
 
user1385191
while(index--)?
 
gotcha
@unsubscribe = (fn) ->
index = handlers.length-1;
while index-->0
handler = handlers[index]
if(handler == fn)
handlers.splice(index,1)
return
return
not sure why it does not display indentation correctly
 
user1385191
yuck, that looks terrible
 
I know :(
that compiles into
this.unsubscribe = function(fn) {
  var handler, index;
  index = handlers.length - 1;
  while (index-- > 0) {
    handler = handlers[index];
    if (handler === fn) {
      handlers.splice(index, 1);
    }
  }
};
 
user1385191
10:32 PM
why are you writing that if the js looks far cleaner?
 
user1385191
not to mention it's just while(index--) since 0 is a falsy value
 
is it?
didn't knew that, thanks
 
@MattMcDonald people dont grok javascript
 
why? well, our team have found coffeescript quite appealing since it brings many niceties comparing it with the old way to write js.
 
coffeescript does have a few nice thigns like ->
but significant whitespace is rage
My main issue with coffeescript is I'm a control freak
I find the "default things it does to help me" piss me off
 
10:40 PM
I see what you mean....but really this is my first day playing with it....read a ton about it in the past weeks, today is my first real experience with it, we have started a branch porting some js infrastructure to it.
the ugliness of the code I pasted before is probably my lack of familiarity with the tool at the moment
hahaha....also...my boss does not like js very much, so he wants to use this instead :D:D
this => cofeescript.
 
@Jaime Your boss wants you to use coffeescript instead of javascript?
 
nevertheless, I am chocked there is no support for reverse looping
nono, he wants to use "coffeescript" instead of plain javascript.
he knows coffeescript is in the end just javascript
but he founds appealing the shortcuts coffeescript brings to the table.
and in some ways, so do I.
e.g:
number = -42 if opposite
 
Your boss doesn't like JavaScript? But why? :p
 
10:55 PM
@JaimeFebres does your boss write code?
I mean if you want to use coffeescript thats cool.
 
11:14 PM
Hello all
anyone have time to help me learn the observer pattern?
 
depends what you mean by "observer"
 
meaning subscribe to a function and wait for a callback
i have soem sample code
 
Do you mean how do events work? How do eventemitters work?
how does pubsub work?
 
Well that code looks stupid :p
event emitters are simple
ev.on("someEvent", function(data) {
  console.log(data === 42);
});

setTimeout(function() {
  ev.emit("someEvent", 42);
}, 2000);
 
11:18 PM
that's it?
how about if you awnted the user to provide a callback with the data you provide
 
// your code
function someMethod() {
  var ev = new EventEmitter();
  ...
  return ev;
}

// user
someMethod().on("someEvent", function(data) {
  // users has data \o/
});
 
alright let me try that
thank you for the help
 
user1385191
function Emitter()
{
  var registry = {};
  return {
    "emit": function(name)
    {
       var i;
       if(registry[name])
       {
          i = registry[name].length;
          registry[name] = registry[name].reverse();
          while(i--)
          {
              registry[name][i]();
          }
       }
    },
    "listen": function(name, fn)
    {
       if(!registry[name])
       {
          registry[name] = [];
       }
       registry[name].push(fn);
    }
  };
}

function f()
{
   alert("you called me!");
 
user1385191
could be a lot better, but that's a quick stab at it
 
11:44 PM
0
Q: Image map dropdown menu shows on Mouse over but doesn't go away on mouse out, Please help me here?

HimalayI am trying a combine dropdown menu with image map here. When I mouse over on top of the image it displays the list of menu, but it doesn't go away when mouse is out. Please help me out. Following is the code I am working on; <style type="text/css"> <!-- #content {position: relative} ...

 

« first day (319 days earlier)      last day (4630 days later) »