Posts

javascript - Trying to get $(document).on('Click') to work for a p tag -

i trying document.on function work when user clicks on p tag has class called card. far function non responsive. should change function respond when click on p tag has class called card. here html , jquery code. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="description" content="contacts"> <title>contacts</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('button').click(function(){ var first = $('input.first').val(); var last = $('input.last').val(); var desc = $('textarea').val(); $('div.right').append("<p class='ca...

sql - Why cast as timestamp give out two different result -

i have hive table 2 rows this: 0: jdbc:hive2://localhost:10000/default> select * t2; +-----+--------+ | id | value | +-----+--------+ | 10 | 100 | | 11 | 101 | +-----+--------+ 2 rows selected (1.116 seconds) but when issue query : select cast(1 timestamp) t2; it gives out unconsistent result, can tell me reason ? 0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 07:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (0.913 seconds) 0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 08:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (1.637 seconds) i can't reproduce problem, hive version using? hive had bug timestamp , bigint (see h...

Issue in sending a string from Android to other device via Bluetooth -

i trying send string android device other device. in code trying fetch date , time , storing in string , sending string device via bluetooth. the issue when send string, of characters missing when received other device. my code : private void time() { int day = 0; date = new date(); string sdf = new simpledateformat("eeee", locale.english).format(now); switch (sdf) { case ("monday"): day = 1; break; case ("tuesday"): day = 2; break; case ("wednesday"): day = 3; break; case ("thursday"): day = 4; break; case ("friday"): day = 5; break; case ("saturday"): day = 6; break; case ("sunday"): day = 7; break; } int mm = calendar.getinstance().get(calendar.min...

java - How do I check if a string contains keywords? -

i'm writing program asks user enter keywords, , essay, , checks how many keywords used in essay. current output: enter keywords: dog, cat enter essay: i cat exception in thread "main" java.lang.runtimeexception desired output: enter keywords: dog, cat enter essay: i cat 1 here's code far: static int keywordschecker(string shortessay, string keywords) { int count = 0; (int = 0; < keywords.length(); i++) { string[] ary = keywords.split(","); if (shortessay.contains(ary)) { count++; } system.out.println(count); } return count; } public static void main(string[] args) { scanner input = new scanner(system.in); system.out.println("enter keywords: "); string keyword = input.nextline(); system.out.println("enter essay: "); string essay = input.nextline(); ...

go - What is the best way to map windows drives using golang? -

what best way map network share windows drive using go-lang? share requires username , password. similar question asked python what best way map windows drives using python? as of there no direct way in go; recommend using net use , of course limits functionality windows, that's need. so, when open command prompt in windows can map network shares windows drives using: net use q: \\server\share /user:alice pa$$word /p q: represents windows drive, \\server\share network address, /user:alice pa$$word credentials, , /p persistence. executing in go like: func mapdrive(letter string, address string, user string, pw string) ([]byte, error) { // return combined output std , err return exec.command("net use", letter, address, fmt.sprintf("/user:%s", user), pw, "/p").combinedoutput() } func main() { out, err := mapdrive("q:", `\\server\share`, "alice", "pa$$word") if err != nil { log.fatal(err...

javascript - Treegrid library with connector functionality? -

Image
i have data needs multiple columns. 1 of columns (preferably not first, can be) display nested tree structure data. both maxazan's treegrid.js , ludo van den boom's treetable.js accomplish want, almost. can hard distinguish hierarchy quick glance: the data hierarchy unclear here and here solution: adding connectors -> the visualisation fixed connectors the actual data has 7 columns ...but treegrid nor treetable support functionality. in both, indentation accomplished through spans padding. treetable uses single spans, makes connector implementation near impossible. treegrid uses multiple spans, imitate connector distinguish levels better. how implement connectors eg. treegrid, or there similar js libraries creating tree grids connectors have missed? if answer is: "it's semantically incorrect, should use nested lists" (in connectors quite trivial implement), follow-up question is: what different possibilities vertically align elements...

ios - Basic Questions about Create Texture Atlas in Xcode -

i think might using texture atlases incorrectly, , wanted ask advice. i found few sites online suggested create folder, let's ball.atlas, , in there, add animation frames (ball1, ball2, ball3). then drag , drop ball.atlas actual xcode content tree, , reference atlas in code this: self.ballatlas = sktextureatlas(named: "ball") self.ballimages.append(self.ballatlas.texturenamed("ball1")); self.ballimages.append(self.ballatlas.texturenamed("ball2")); self.ballimages.append(self.ballatlas.texturenamed("ball3")); self.ballimages.append(self.ballatlas.texturenamed("ball4")); self.ballimages.append(self.ballatlas.texturenamed("ball5")); and can reference self.ballimages display animation, etc. i saw guide, however, said go xcassets folder, , click '+', , hit 'new texture atlas', , creates folder. drag ball images in there. there 1 fundamental difference here, however: in second approach, can ...