« first day (2721 days earlier)      last day (2228 days later) » 

10:00 AM
 
user7699326
hey guys, i'm having problems with a specific js function
 
user7699326
when i execute the js code, the following function is called:
 
user7699326
function getjstreedata() {
	$("#jstree").bind("ready.jstree", function(event, data) {
		var $tree = $(this);
		$(
			$tree.jstree().get_json($tree, {
				flat: true
			})
		).each(function(index, value) {
			var node = $("#jstree")
				.jstree()
				.get_node(this.id);
			var txt = node.text.trim();
			var lvl = node.parents.length;
			var idx = index;
			$("#jstree-code").append(
				"text = " + txt + " // index = " + idx + " // level = " + lvl + "\n"
			);
		});
	});
}
 
user7699326
it iterate through all the data on a jstree instance and append to a textarea
 
senpai?
 
user7699326
10:06 AM
but when i try to call it from a switch statement, the function is not executed, and there aren't any error on console
 
user7699326
function exec(op) {
	switch (op) {
		case "inclib":
			var lib = prompt("Library name:");
			$("#jstree")
				.jstree()
				.create_node("#", { id: "ajson5", text: "newly added" }, "last");
			getjstreedata(); // refresh jstree
			break;
	}
}
 
@Hawk ok, success here depends on several factors
You verified that getjstreedata is executed? you verified that exec is executed (passing "inclib")?
you verified jstree is launching the event ready.jstree?
 
user7699326
yes,both exec and jstreedata are executed
 
user7699326
but, jstreedata is executed only one time
 
you mean getjstreedata
 
user7699326
10:09 AM
yes
 
that's fine if it gets executed once
 
user7699326
but that's the problem
 
user7699326
a function isn't made the be executed once
 
well you put it in a function, not me :P
but there's nothing wrong with putting it in a function to better organize, even if it is executed exactly once
that's another issue though
 
user7699326
this is the reason i came here asking for help :/
 
10:11 AM
you verified jstree is launching the event ready.jstree?
 
user7699326
gonna verify that right now
 
don't assume documentation is right
you should verify
 
user7699326
checked
 
user7699326
the ready.jstree event is being triggered properly
 
and?
and yet your event isn't being called?
last check, however absurd.. verify that it isn't getting called
it should usually be the first check, but it's often overlooked
 
user7699326
10:17 AM
yep, the same problem
 
user7699326
ok, second try...
 
user7699326
can you take a look at this codepen: s.codepen.io/henriquehbr/debug/bvaRwB/nqMwveZXQKDk
 
actually, just noticed something
 
user7699326
your help would be very apreciated
 
you're binding after the creation of the tree
that means the event happens and is triggered, then you say "ok, if anybody creates a jstree, let me know"
of course that doesn't call your binding
 
user7699326
10:19 AM
then i say "if new data is added, let me know"
 
user7699326
or at least, i meant that :/
 
Add the binding then create the tree
 
user7699326
the tree already exists, i just need to check for new nodes added in the tree
 
well I'm not familiar with this plugin, but "ready.jstree" makes me think it triggers when it's created
not when nodes are added
the event is incorrect then
you should still be binding before you add the nodes though
 
user7699326
so, it will trigger only when the tree is created?
 
10:25 AM
@Hawk that's my take on it, yeah
"ready" in jQuery lingo amounts to onload
certainly not the creation of nodes anyway
 
@LaxmanPai Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
ok
 
ok
 
user7699326
10:29 AM
ok
 
@Hawk It looks like it's getting called, actually
 
!!tell Neil giphy combobreaker
 
hello
 
I'm working on a Slack bot which has several /commands
I'm not sure how to parse the command, as in to know which command was requested
Slack docs show how to respond to one command per bot
Does anyone know of different docs/tut ?
 
user7699326
10:30 AM
but why the textarea content isn't being updated according to the nodes? @Neil
 
@Neoares ok
@Hawk works fine for me
I'm using chrome
 
text = Simple root node // index = 0 // level = 1
text = Root node 2 // index = 1 // level = 1
text = Child 1 // index = 2 // level = 2
text = Child 2 // index = 3 // level = 2
 
user7699326
but when you add a new node using the <select> it won't display the created node on the <textarea>
 
user7699326
10:33 AM
that's the problem
 
@wadie you need to register one command per bot. Use that command as starting indicator. like /cmd translate or /cmd choose ect
 
@Hawk ok, well again, the event seems to suggest it happens only upon creation of the jstree
and not on the adding of nodes
 
that is how I did it. Did not have took time to check the slack API
 
user7699326
alright, i think i got it, gonna fix the code
 
@KarelG I have one command but would like to add another. how do I distinguish between both commands in my code ? because now I don't have to check which command is being passed since there's only one.
 
10:36 AM
you may not have read what I wrote
 
I did, but isn't it possible to add another command ?
 
then you have to set up another bot
 
why have one command with an extra keyword for every action ?
so it's not possible ?
 
or check slack API to see if it allows this. I made myself easier to have one command and an initiator
 
yea I thought about this, but wanted to make sure if there's such an option first
I couldn't see it on slack api
 
10:39 AM
@Hawk if you wanted to organize it better, make the actual event a function, then just pass it to $("#jstree").bind()
 
but the thing is, the command is returned in the post request
 
-5
Q: Monaco Font is not working well

Harshit SeksariaI recently googled for the best font out there for programming. And I got answer, That is Monaco. But, However when I use that font in Android-Studio or in IntelliJ IDEA, The font is not looking well. That font is looking amazing in NetBeans IDE and in other places too, though. But not in that t...

 
@Neil jQuery?
 
@HarshitSeksaria Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Neoares His choice, not mine
 
10:40 AM
@CapricaSix OK buddy
 
how can someone say that that question belongs to meta
and get 1 upvote
 
user7699326
7 downvotes 0_o
 
user7699326
8
 
@HarshitSeksaria your question has literally no specifics.
'looks bad'
'looks good'
what does that even mean
 
wait
a 157k user says that it belongs to meta
lol
 
user7699326
10:41 AM
9
 
well, see edited the history for that question.... :(
 
@Neoares he edited the question so that it become totally different.
 
@HarshitSeksaria learning how to write questions will benefit you greatly
 
@KarelG yeah I just saw coldspeed's comment
wtf xD
 
I'm sorry if this is a bad experience for you, but try to be more concise next time. If the answer can only be concisely written using several chapters of a book, including the history of fonts in general, don't ask it
 
10:44 AM
> Damm... I cant delete this because of bounty.. It killing my reputations..!!!!
hahahahahaha
 
user7699326
@Neil take a look a this codepen, i can't figure out how to remove the ready event without getting a ton of errors
 
lmao
Damm... I cant delete this because of bounty.. It killing my reputations..!!!! — Harshit Seksaria 31 secs ago
 
yeah
I instantly downvoted after reading that
 
lmao nobody can hammer that cause nobody got an editor tag gold XD
 
10:46 AM
xDDD @MadaraUchiha halp
 
@Hawk Don't call the function, bind it to the event like you were doing anyway
 
@KamilSolecki nice thing is in the meanwhile we're killing his reputations
 
user7699326
i gave up from asking on stack overflow, if someone find a comma in the wrong place... instantly 50 downvotes
 
user7699326
chat is better
 
@Hawk $("#jstree").bind("ready.jstree", getjstreedata);
 
10:48 AM
> I collected that reputations from hard work!!
is there a way to see people with hammer given a tag?
 
just flag the post
 
eh?
 
@Neoares yea
go to tag
 
yeah, pity
poor guy is going to hit negative numbers somehow, and I don't think you can even get negative reputation
 
user7699326
15 downvotes, and counting...
 
10:53 AM
@KamilSolecki I already went to tag
 
16
 
now what
 
@Neoares can you delete that popcorn command. Totally unnecessary
 
@Neil nope
 
@Hawk I mean, thats expected seeing the question
 
10:53 AM
@KarelG is not a command, and the question is going to be hammered :(
 
* comment
 
@MadaraUchiha you should probably take a note on that, someone went through this guys questions and downvoted each of them, just now
 
that's not really fair to the guy
 
the question would have simply been deleted under normal circumstances
 
10:56 AM
he is in catch 22 kinda situation
 
I flagged, it hammered
 
to be fair that question is a valid one just not for SO
 
for some reason the guy has now more rep than before
 
and yeah it doesnt belong to meta at all lol
 
@ColdFire but its not really a question is it
 
10:58 AM
I see 130 reps
 
its just saying : this not work how fix
 
@Neoares all downvoting reversed
 
without any detail
 
@ColdFire oh nice
and bounty returned?
 
naah bounty is not returnable from what i know
 
10:59 AM
@KarelG You can give me his contact and I yell at him, acting like I'm in charge
 
:doing maths:
 
@KamilSolecki well he could have provided more detail but still a valid question
 
@Neil We know
 
it's valid, but hammerable
 
yes as i said its just not for SO
 
11:01 AM
@OliverSalzburg I figured. slaps @KarelG with a trout
 
@KamilSolecki "it killing my reputations" XDDDDDD
That's amazing
 
I think I am gonna make a framework and name it Nunchuck Js...just to get my name on the wiki
 
I'm Back
 
Curse those people XC
 
11:14 AM
@MadaraUchiha it seems they have been ressurected :P
 
@MadaraUchiha.. that was amazing (not: that is amazing).. I got all of my rep again including bounty
lol
 
@OliverSalzburg and nothing more than mozilla
@ColdFire bounty returned, as I said
 
yes.. true
 
@MadaraUchiha can you hammer my negative-rep old questions?
xDDD
 
@Neoares you can just.. delete them y'know
 
11:16 AM
really?
 
I'll get my reps back?
 
@Neoares sure
 
but idc about reps xD
 
@Neoares well a mod intervened so
@Neoares just delete them duh
 
11:18 AM
But ultimately. I got a medal for that question (first bounty).. that means it was profit
 
dude..
 
lol
 
@Luggage can you write code for me? I offer you 100 internet points and 1 silver medal from SO.
 
@KamilSolecki Will any code do?
 
Are you trying to bargain my deal terms?!
 
11:21 AM
i was restricted to talk in chats.. because of that question link..
 
@KamilSolecki I trade a script that opens a message box in the browser for 80 points
75 if you put in a bronze medal
 
@HarshitSeksaria yeah dont spam chat with links
 
@HarshitSeksaria not surprising. Spamming your question in every room is not the best way to say hello to the community.
 
@OliverSalzburg hmm.. Only if you add some JSON to it.
 
11:22 AM
I'm new to stackOverFlowChat... I'll learn everything gradually
 
user379888
It it a good idea to redirect all urls of the website to lowercase letters?
 
best start is probably reading the room rules
!!welcome harshit seksaria
 
@harshitseksaria Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@AnyAndroidDeveloper... I've a question for you.... From where you started learning android development?
 
TNG
 
11:24 AM
TNG?????
 
user379888
Hi all
 
user379888
I have a question.
 
user379888
It it a good idea to redirect all urls of the website to lowercase letters?
 
@HarshitSeksaria specifically Noonien Soong. great teacher
 
11:25 AM
And, the best robotic scientist!
 
@rlemon.. from YouTube?
 
probably not
DMCA
 
DMCA???????
 
user379888
??
 
@rlemon you too love the breeze of confusion in the morning, eh?
 
11:27 AM
feels good on the skin
 
speaking of breezes
 
where are you all from?
<h1>Just testing HTML</h1>
 
someone has sprinkled some kind of air refreshener liquid around my office
I literally cannot keep up with it
 

Sandbox

Where you can play with regular chat features (except flagging...
 
@KamilSolecki What a ripoff!
 
11:30 AM
Hey everyone I had a small question. Would anyone know of an algorithm to find efficiently all possible cells. imagining I have an origin cell and for each cell I know just the four neighbours however some cells can have no neighbours on some sides?
 
on the first sniff it smells like woods, but then I get a slight feeling someone has defecated in those woods repeatedly.
 
maybe that's why they brought the air freshener
too much Golabki last night
 
INDIAN ROCKS!!!!!!!!
 
I've never seen an indian rock tbh.
 
11:32 AM
Yeah, so I thought they would be pretty exciting.
 
user379888
Harshit why are you being a racist?
 
Well today's off to a good start
 
@Mederic Recursive backtracker
Sounds like a maze
And I like recursive backtrackers, even though they aren't as efficient as other solutions
 
@KendallFrey I shall try this visibly fun activity one day
 
11:36 AM
Which is the best programming laptop out there?
 
@HarshitSeksaria If you have to ask, you don't deserve one anyway
 
I like my lattitude 14
 
@oli
 
@FahadUddin dude.
 
@OliverSalzburg ill check it
 
11:37 AM
@FahadUddin That's rough
They call it the "Toilet Trade"
 
All of my days start by lamenting about british rule
 
user379888
Sorry guys. He insisted.
 
I really appreciate that @KamilSolecki got RO status and legitimately moderates the room
 
@FahadUddin don't be racist in your messages, or the next one is a kick.
 
11:38 AM
@FahadUddin.. We don't abuse anyone like you
 
@Cereal \o/
 
user379888
@KamilSolecki: Ok got it
 
My tax return got direct deposited into my deposit-only line of credit :(
 
But @OliverSalzburg me its just indexing the whole map not creating a maze haha
 
@Cereal mine literally came by mail
 
11:40 AM
@Mederic I didn't mean creating a maze, but solving one
 
@Cereal a deposit only line ?
 
it was 6 PLN ($2)
 
@KarelG Student line of credit, so onec I finished school it became deposit only
 
just asking: why do you have that?
 
To pay it off
 
11:40 AM
@OliverSalzburg oh ok haha ill check it then
 
oh lol USA
 
Canada
 
@Mederic And that process should be exactly like what you described. You walk the map into all possible directions, until you can't, then you turn back and try another path, until you have them all
 
* adds Canada to silly loan systems *
 
How would you have paid for school?
I didn't get approved for a student loan
 
11:41 AM
I have a simple question. On the startup balloon of android studio, which font-family is used in word "android" and in "studio"
 
Bought a 29inch ultrawide.
 
A maze can be constructed by the same algorithm though
@HarshitSeksaria Comic Sans
 
for which one... both word have different fonts
 
@Cereal like as buying a car? If you do not have enough money, there is a social loan you can take, 0% rent. But you have to pay a fraction of it back at the end of the month until it gets paid out
 
@KarelG No interest? How does the bank make money?
 
11:43 AM
"social loan" =!= loan from bank
it is from government
 
Right, so Canada has student loans, but you have to qualify for them. You pay no interest until x months after you graduate
I didn't qualify because my parents make too much money
 
if you can show that you are a student of an university (just show subscription papers), you have to send your bills (subscription fee, college books) to an administrative center. Then it grants you a loan
 
So I had to go through a credit union
 
@OliverSalzburg how to handle the fact though that I dont have an ending
 
· @OliverSalzburg.... that is not looking like comic sans bro
·
 
11:45 AM
Those student loans are from the government *
 
but you are being checked first though: not having wealthy parents at your hand and ect
 
@Mederic You walk until there are no more options
 
mm true
 
It's a very fun approach to play with if you have a visual approach
 
yet a student does not have to pay lots of fees like in USA.
 
11:47 AM
I would base my choice of direction on a template image. If the pixel at the location was a certain color, go up, otherwise, go right
The resulting maze resembles the image
 
aside from exceptions, going above 10,000 for a 3 years study is non-existent
 
@KarelG how much would school run you there? My tuition cost me somewhere in the vicinity of 35k over 5 years
not including rent, food, etc
 
only school: subscription fee for last year was 890 is EUR. Then college books, which racked up to 600~900. But some people spares money to get online copies.
 
Zzz
University here is a sham
 
not counting in my electric engineering, 5 years CS took me not more than 15,000 i think
 
11:49 AM
40% of my courses were unrelated to my degree
But required
 
I had also courses that I had to attend but was not so related
 
History of witchcraft and religion
History of the body
Japanese
 
hi
 
@Diamond Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
I got chemistry and biology. But not that
 
11:50 AM
1st time coming here,
 
all very relevant to computer science
 
History of the body? as in, the human body?
 
and geology
 
@KendallFrey yes
 
may I know how to contribute or benefit hre
 
11:51 AM
:o Japanese. Teach me senpai
 
what kind of history
humans have always had bodies
 
Are there websites that would help me identify what popular icon pack an icon belongs to if all I had is a picture of it?
 
@KendallFrey Social history for the most part. A lot of focus on how perception of the female body changed over time in europe and america
 
google image search ?
 
@KendallFrey in 1941, Hitler lost his left nipple in an unfortunate ironing accident
that kind
 
11:51 AM
@Cereal In Japan?
 
@FlyingGambit Doesn't help
 
@Cereal I got philosophy instead that. Much interesting
loved the professor
 
@KarelG I also took philosophy, critical thinking
It's just that, you need to hit these requirements to graduate
So instead of taking courses you're interesting in, you take the ones that fit in your timetable
 
@littlepootis u sure it did not work ? reverse.photos
 
It took me 5 years to hit those requirements and I took summer courses twice
 
11:53 AM
@FlyingGambit Yes, I've done that already.
Here's the icon
 
It would have taken 6, but I applied for credits based on work experience, just because the "4 year degree" assumes all your courses fit in your timetableand you never fail a class
I'm pretty salty. It's going to take 10 years to pay back this loan, and I learned fuck all
I can tell you the worst case running time of a graph algorithm is fucking yay
 
@littlepootis are you sure it is from a popular icon pack ?
 
I'm not sure, but I'm guessing it is.
 
your best bet is to ask it on that SE network about fonts/icon
 
11:58 AM
if someone recognizes it
 
This is a neat little site
 
There's an SE network for fonts/icons?
 
@littlepootis I just looked at a lot of houses. This one is not popular
 
Graphic Design, ah, thanks
 
And, compared to some of the awesome ones I just saw, I can understand
 
11:59 AM
graphic design yes
 
"What is this icon?" on Graphic Design is the equivalent of "Why my code no work?" here
 

« first day (2721 days earlier)      last day (2228 days later) »