« first day (1566 days earlier)      last day (3392 days later) » 

Ram
9:09 AM
0
Q: Not updating the Read only textbox's Value using Jquery

RamI have three textboxes, two of them are readonly. when i update first then i am updating text-value of other two textboxes. i am using the following code to do this, $('[id$=txtQty]').change(function (e) { var pre_Id = this.id.substr(0, this.id.lastIndexOf('_')); var exactIdlblInvoice...

please help me
 
@Ram Stop mixing single and double quotes in the same code
There, I helped
 
@OliverSalzburg Be nice...
 
@SecondRikudo okay, right.
I'm sorry in advance. @SecondRikudo php.net/manual/en/function.array-filter.php
 
Ram
@OliverSalzburg can you please confirm about which line of code you are talking about
 
@SecondRikudo s/JavaScript/Sparta!!!!!!!/
 
9:13 AM
@Ram It's probably not the solution to your problem ;)
 
@Eugene Yeah, that's pretty much it
 
-1
Q: Javascript. Creating Array-like objects. Is it possible to make .length autoincrement?

MadBrozzeRThere is so much about creating and inheritance of Array-like objects, but one of my questions remains unanswered: is it possible somehow to add autoincrement .length property to object? Sample script: function ArrayLike(){ this.length=0; this.splice=[].splice; } var Arr=new ArrayLike();...

That's not how JS works...
 
@Cerbrus Don't downvote him though. It's not written badly, and he can't fault for not knowing that it isn't a good idea
 
Edited to unlock my DV. You have a fair point there, @Neil.
 
@Cerbrus I'm not going to upvote it though either :P
 
9:24 AM
^this
The question is okay (Though ignorant ;-) ).
 
It surprises me the types of things that people think of
I know that happens to me to and I just don't realize it, because when I search for help on the subject, I get crickets chirping
 
What's confusing to me is why the guy thought it'd be a good idea to start from scratch, trying to re-create an array...
 
Maybe he wanted a facade?
 
stackoverflow.com/questions/28211189/… : "How do I execute a function only if array x has items in it?"
 
I can see why perhaps, but that is just silly
 
9:35 AM
Yea, it doesn't really make sense to approach it like he did
 
Yeah that merits a downvote imo
There's not even a formal question in there
 
I'd have closevote-as-dupe-hammered it
But there are no dupes for something that basic
It's actually amazing people manage to post questions on StackOverflow when they seem to be unable to Google the most basic features of a programming language.
 
get(constructor) {
    var foo = new constructor()
}
Is this valid? It doesn't feel valid...
 
What would be the point if you don't return the constructor?
Seems okay, though
 
@Cerbrus I want to construct an object from the passed constructor.
Eventually I'd return it, it's just example code.
 
9:44 AM
hello
 
Hi.
@SecondRikudo: seems okay :P
 
hi for @SecondRikudo or me
@Cerbrus
 
Depending on your use, simply using new constructor() might be cleaner, though.
 
@Cerbrus I'm making a dependency injection container.
This is before the voodoo dependency resolution
 
I don't know voodoo, so that's voodoo to me :P
 
9:48 AM
new new new(new ())
 
What is that voodoo that you do so well?
 
what voodoo is going on
 
hi all!
 
I wonder if we can make that line work somehow :P
 
hi @DrogoNevets
 
9:50 AM
quick question about Angular resolves, if one fails, great, how do I know which one has failed?
 
!!tell BartekBanachewicz sandbox
 
@BartekBanachewicz Please go and play in the Sandbox
 
9 messages moved to Sandbox
get(Constructor) {
    if (this.sharePool[Constructor.name]) {
        return this.sharePool[Constructor.name];
    }
    let dependencyConstructors = Constructor.inject ? (Constructor.inject() || []) : [];
    let dependencies = dependencyConstructors.map(Chusha.get);
    let obj = {};
    obj.__proto__ = Constructor.prototype;
    Constructor.apply(obj, dependencies);
}
 
@SecondRikudo oh yeah sorry
 
What do you guys think of this wickedness? :P
Is there a way to avoid obj.__proto__ = Constructor.prototype;?
@BenjaminGruenbaum (looking for your input specifically ^)
 
9:59 AM
@SecondRikudo I'm doing LAMP all day, this is pretty nice.
@SecondRikudo also, of course, don't do that
Instead do:
let obj = Object.create(Constructor.prototype);
This is what Object.create does
 
Thanks, I knew I missed something
 
Chat doesn't work anymore on my laptop :/
On my chromium, actually.
 
Hello. Is the code snippet thing in SO broken for everybody or just for me ?
I get a 500 internal server error when trying to run my snippet
 
@dystroy someone raised that on meta
2
Q: 500 Internal server error in stacksnippets.net

OriolGo to http://stacksnippets.net/ or click "Run code snippet" in a stack snippet. ​ It says 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

 
@NaeemShaikh Thanks
 
10:10 AM
Anyone else can't load the chat in chromium?
 
I just loaded it in chromium
(and refreshed to test)
 
Hm... It seems my chromium doesn't want to load the tabs I had pinned for months. Everything else still works.
(Same for miaou)
 
In fact I wanted to ask a question on SO but maybe somebody here has the answer : is it possible to have a transition (the delay part) on the content property ?
@rlemon ^
 
Can anyone verify this issue:
https://code.google.com/p/chromium/issues/detail?id=453295&thanks=453295&ts=1422526453
 
Anyone care to salvage this junk?
xD
 
10:18 AM
@Jonathan sorry, my chromium is too old (and it renders fine in 37)
 
@Neil: that Array guy:
@Cerbrus The main aim is to clone Array object without unnecessary (in my case) methods (join, concat, forEach, etc.), but extended with methods I need. To win a small bit of performance while iterating, or just not to have it overloaded with extra methods. Not that I really in a need of using Arr[N]='value' method, but it would be really nice to have. — MadBrozzeR 2 mins ago
 
Oh wow, making a tiny DiC was much easier than I had thought
import {HttpClient} from './HttpClient';

export class ExampleClass {
    static inject() { return [HttpClient]; }
    constructor(http) {
        this.http = http;
    }

    doSomething() {
        return this.http.get('http://icanhazip.com/');
    }
}
import {Chusha} from './chusha';
import {ExampleClass} from './spikes/example_class';

let injector = new Chusha();

let obj = injector.get(ExampleClass);

obj.doSomething().then(([res, body]) => console.log(body));
 
@MadBrozzeR: You really won't gain any performance by copying part of the Array functionality. It's a native object that's well-optimized in modern browsers. Writing your own implementation will negate that optimization, not to mention the loops you'd have to jump through to actually make it work. — Cerbrus 9 secs ago
Is that somewhat accurate?
 
Yes
 
@Cerbrus Yes.
 
10:23 AM
@Cerbrus It won't negate the optimization, because he'd still be using an array underneath
But it certainly won't help to add a call between him and the array
 
Aside from manually implementing .length
Verdict: accurate enough. :-)
 
It'd be like making a function getVal(arr, index) { return arr[index]; } for all the optimization it would do
If he wanted to make a facade, that would make sense
 
His main concern is that having all those extra (native) functions on arrays that he isn't using, are slowing it down
Wat
 
Yeah, those extra (native) functions are on the protocol
 
Recommend him mrale.ph
 
10:26 AM
They exist in one place, not in every array object
 
@copy: whatsthat
 
I can see how he thinks that, but by calling a protocol function, you're really just invoking the protocol function with this bound to your current instance
@copy Afraid to click. ._.
 
No virus
My computer became sentient though
 
@Neil Mr Aleph's website
 
I literally just wrote a fully functional DiC in 25 lines
Head === Blown
 
10:35 AM
I got to learn this DiC
 
@SecondRikudo a DIC is usually tiny
@SecondRikudo that's service location though, hope you realize that.
Service location is the same thing as dependency injection only with the direction inversed.
Where's your DIC? Be sure to allow more than just creating an instance based on a class name
 
So, setTimeout in a web worker is subject to the 4ms limitation but not the 1000ms limitation for inactive tabs
Good
If you need sub-1s timeouts without 100% cpu usage, use a web worker
 
10:57 AM
@BenjaminGruenbaum I went with a similar approach as aurelia
See the two snippets I shared above ^
I also have the ability to add my own objects to a cache and have it use those
 
@copy or a setImmediate shim, probably.
 
That uses postMessage (without a worker) and therefore causes 100% cpu usage
The case where my tick function takes 5ms and I need to run it every 10ms (thus, 50% cpu usage) can't be done that way
 
@BenjaminGruenbaum He claims he has a large DIC, but he's just exaggerating
2
 
@copy it uses mutation observers afaik and doesn't but maybe I'm wrong
 
@Neil My DIC is bigger than your DIC.
 
11:01 AM
My DiC is so big it has to be served from a CDN
2
 
Tearing up right now.. my colleagues probably think I've gone funny
One thing I've learned about myself is that as time goes on, the type of humor that I find funny is increasingly crude
 
@Neil this will continue to be the case
 
Not that I've seen his DIC. I am not that kind of programmer
 
11:31 AM
room's dead
what's your opinion on nullability in JS?
do you think that pattern matching in ES7 could solve the problem?
 
@BartekBanachewicz java made an update to fix "nullability" with chains of calls by returning a Nullable<T> object
Idea being that you can make a chained call, and it wouldn't go tilt because one of the values contained within is null
Is something like this planned for javascript?
 
@Neil this is just monadic composition.
(Nullable a) -> (a -> Nullable b) -> (Nullable b)
M a -> (a -> M b) -> M b
(Promise a) -> (a -> Promise b) -> (Promise b)
I can go like that all day
@Neil So, are Monads planned for JS? Probably not. That being said, some subset could be useful.
 
JS is dynamic
We don't need Monads to implement everything a Monad is
Do we?
 
@adeneo yeah I see it everywhere
 
11:40 AM
Too fancy web design, probably hiding many flaws in the actual browser
 
@copy a monad isn't an implementation; it's an interface.
 
That's what I said, we don't need an interface to implement the interface
 
@copy You don't need to formalize it in the language. You need to formalize it for the developers though.
Just like, say, .map() function on any data collection.
If you write a "bindM" function that uses duck-typed .then() or whatever, everyone has to use .then() in order for it to work
the language won't enforce it in any way and the only thing that can make it work is the convention the developers take
 
@BartekBanachewicz Right, but that'll be tough
 
@copy IKR
In a statically verified language there are formal idioms you can follow. In JS you can write whatever you want to as an library author.
If you know that someone wrote their own Monad in Haskell, you know you can chain it via >>= and fmap your actions on it, always, without knowing a thing about the library.
 
11:46 AM
so long as it makes sense
 
@Neil I've seen enough JS libraries that don't in my life.
 
most js libraries are born from necessity
 
Unless someone defines >>= differently from how you'd like it to be defined
i.e. not according to your convention.
 
@Neil s/js//. So what?
@BenjaminGruenbaum In Haskell? It's hardly possible if he doesn't break the Monad Laws
 
@BartekBanachewicz So necessity is the basis for "sense"
 
11:48 AM
@Neil "sense" can be subjective.
You have a need for a feature, but however you expose it is your choice
 
@BartekBanachewicz oh, sure he can break monad laws. He doesn't have to though, he can for example never call the chained operation in a bind. It's up to every single person writing a monad to understand how to use them and the convention they introduce.
That's what makes them powerful in the first place, that they allow you to express new forms of sequencing computations.
 
@BenjaminGruenbaum Sure. But in practice, monad laws are hardly ever broken
 
How many user-land monads have you used :P?
 
dunno, a dozen or two
I've seen Lenses with broken laws (most notably traverse), but never monads I think
 
My argument is that it's a convention here too. The advantage is that you have language support for chaining it (with do notation) - that's about it.
 
11:50 AM
@BenjaminGruenbaum And the fact that the type class of Monad is kinda "standard"
 
Haskell's stong points are the type system, strong curried functions and automagic laziness. Not having monads as an operator.
 
just like Eq, Ord, Functor, Applicative, Show...
The standard "interfaces" kinda help to reduce the mess IMHO
sure, no one has to use them
but in practice, people do, because it makes it easier for everyone
And of course people do that too in JS, but I think to a lesser extent
if only because the understanding of "control" patterns (like monads) is arguably lower
 
Can somebody tell me why the text doesn't disappear on hover here ?
 
Hi guys... I'm trying to write some regular expression code... I'm trying to find angular style <li>{{x.name}} {x.id}}</li> strings. I have the following expression /{{([^}]+)}}/g; which returns "{{x.name}} {{x.id}}". I want the expression too return an array of angular tags rather then a string with both tags in it
 
... and now you have two problems
 
11:59 AM
?
 
@PrimeByDesign That regex won't return that string as a match
 
it is returning that string
:/
 
Probably because he's using replace
 
!!> "<li>{{x.name}} {x.id}}</li>".match(/{{([^}]+)}}/g)
 
@KendallFrey ["{{x.name}}"]
 
12:00 PM
It doesn't return that string
 
what does it return?
for you?
 
Hello!
 
45 secs ago, by Caprica Six
@KendallFrey ["{{x.name}}"]
!!> "<li>{{x.name}} {{x.id}}</li>".match(/{{([^}]+)}}/g)
 
okay... but what I need is
 
@KendallFrey ["{{x.name}}","{{x.id}}"]
 
12:01 PM
yes!
 
I assume the string you gave was a typo
 
let me check that out
 
I need to run another XMLHttpRequest based on prior response .. how to do that ?
 
I thought I copy pastes
pasted*
 
if you did your angular code is broken
 
12:02 PM
@BenjaminGruenbaum wait, did you just say laziness is a strong point? :P
 
perhaps...
the problem is elsewhere
 
@PrimeByDesign perhaps :)
 
2 mins ago, by copy
Probably because he's using replace
 
I am using replace somewhere
 
@copy I fail to see what that has to do with it
 
12:04 PM
That's the original problem
 
@PrimeByDesign We should have a SSCCE or MCVE.
 
6 mins ago, by Prime By Design
Hi guys... I'm trying to write some regular expression code... I'm trying to find angular style <li>{{x.name}} {x.id}}</li> strings. I have the following expression /{{([^}]+)}}/g; which returns "{{x.name}} {{x.id}}". I want the expression too return an array of angular tags rather then a string with both tags in it
 
The if my function runs itself, some kind of overlapping.. how you do this ? For example to run different post requests on some php file and give user progress bar ?
 
SSCCE? MCVE?
 
its like a chaining XMLHttpRequest() calls one after another
 
12:06 PM
@PrimeByDesign Two different terms for the same thing. Read the links.
 
ah yea sorry didn't realise that they were links
@KendallFrey You're absolutely right
I'll get on that
 
anyone ?
`function ajax_post2(fn){

var hr = new XMLHttpRequest();

var url = "process2.php";
var fn;

var vars = "num="+fn;
hr.open("POST", url, true); //tru

hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

hr.onreadystatechange = function() {
if(hr.status == 200) {
var return_data = hr.responseText;

document.getElementById("status").innerHTML = return_data;
ajax_post2(return_data);
}
}
`

hr.send(vars);

document.getElementById("status").innerHTML = "processing...";
}
function not calling itself in order, but somehow async .. sorry for spam
 
Good morning. I have the frustrating situation of "code that worked yesterday". This is in relation to the code mentioned at stackoverflow.com/questions/28180525/…. The guy who manages me had me change some parameters in the SQL, namely changing DateTime into EffectiveDateTime, and now, I'm getting nothing from the DateTimePicker (it's the Telerik one FWIW) when I try to pull it in on Update.
My suspicion is that there's some sort of binding issue such that the system can't pull in the bound control value. I've tried reverting the SQL changes, at the least in the simple ways such as changing the return type of the function that retrieves the value from the database so that the name is changed back to DateTime for the data structure. No dice.
 
@animaacija XHR is supposed to be async, what's the problem?
 
12:24 PM
Please let me know if I need to stop rambling on about it and give a chance for questions or clarification. I made the mistake of trying to "sleep on it" last night and wound up tossing and turning as variables and procedures chased me down in corridors and the keyboard kept disappearing as I typed. :)
 
0
Q: how long should i wait to post my question?

Krishna Mohanhow long should I wait to post my question? before asking your question I can solve my question. I have to ask more questions.I need solutions quickly. but you people are not giving chance to ask questions. how long I will wait to post my question

What?
 
Non-native speaker perhaps?
 
Probably
 
Currently, I'm reverting back those changes to the database output so that I'm back to EffectiveDateTime. Maybe I'd better off asking this is the C# forum... part of the problem is that the project I'm on uses both about equally.
 
@KendallFrey I'm new in javascript.. I need to call another post request based on response (and populate the responce)
any ideas?
 
12:37 PM
@animaacija ideas about what?
 
chaining XHR's ?
they run in asynchrony
Someone told this as a solution
@KendallFrey but he gave no examples.. how could i know what ajax-calling-function into the callback function is ?
 
@animaacija It's pretty much that
 
well ... u can't imagine @RoelvanUden ... I've no idea how to type it!
 
get('/smth').then(function(res) {
  return get(res.url);
}).then(function(res) {
  // second response
});
Something like that for example. Just make your XHR function return a promise.
 
@animaacija The code you posted seems to be along the right lines.
 
12:41 PM
@RoelvanUden than ill try ... so .then
 
well it loops
 
between 1222212222, and it should go 1234567 (based on pgh responce)
@RoelvanUden well yes i saw the Promise ... too high shelf!! didnt started to dig that
 
@animaacija if it's an infinite loop, then figure out how to stop it
 
12:44 PM
@copy haha
That's hilarious
Oh sorry, figured out the guy is still here.
@BartekBanachewicz of course it's a strong point - it's also really confusing, the two are not mutually exclusive
 
@KendallFrey well you were right on that ... ill better go with this.. promise still is to complicated. But it might work if you could tell how to check if data returned and wait for returned data to run next XHR
 
@animaacija Maybe you shouldn't be using recursion
 
better not...
could i chech if div content value is changed and then call my func ?
i mean listen for div content changes ?
Any way what are you up to guys & girls!?
 
Attempting to rewrite a jython script in order to stop uninstall then install and start a web application using websphere on a as400 machine so that it will work both with websphere 7 and websphere 8.5, you?
 
padding-left: 100% - 650px / 2;
why doesn't it work :S
 
12:59 PM
@BartekBanachewicz Hah, would be nice if it did, though right?
 

« first day (1566 days earlier)      last day (3392 days later) »