SVG images on android webview?

Uncategorized
Question: I have an SVG image showing the regions of Japan. I made a javascript file so that touching a region will shows you information, to do this I use an html page and here's the problem. I use a webView on android to display the page, on Android 7 everything is ok, but on Android 4.3 the graphics is disgusting, can someone explain me why of this problem? The two phones have almost the same screen size and resolution, does the problem depend on their html version (and is there a way to fix it?)? android 4.3 android 7 Answer: Read more
Read More

Bootstrap Carousel clashes with Bootstrap 4 Beta

Uncategorized
Question: again. I'm trying to implement Bootstrap's Carousel into my webpage. I'm running in to some issues, however. The images of the carousel show up stacked on top of each other. The navigation buttons don't show up. This is with Bootstrap's CSS v4.0.0 Beta. If I change the Bootstrap CSS file version to say 3.7, the carousel works, but the other stuff depending on bootstrap 4 of course stop working. Is this a mistake I'm looking over, or is this a bug in Bootstrap 4Beta? Here is the HTML code. /*Custom Irie Vibes colors.*/ .bg-irie-yellow { background-color: #E7DD96; } .bg-irie-grey { background-color: #41403E; } .bg-irie-red{ background-color: #CF7654; } .text-white { color: white; } /*Only applies to classes irie-green when navbar-brand is also used*/ .navbar-brand.irie-green{ color: #EDCE4F; font-weight: bolder; text-shadow: 9BA573…
Read More

python Tkinter Capturing keyboard events save as one single string

Uncategorized
Question: is it possible to store keyboard events into one string? with the code below it only stores one char and prints it. but for a card reader or bar code reader, it contains a collection of character/ string not one character at a time. The goal is the save all the char pressed into text variable. from tkinter import * root = Tk() def key(event):text= event.char text+= event.char print ("pressed", text) def callback(event):frame.focus_set() print ("clicked at", event.x, event.y) frame = Frame(root, width=100, height=100) frame.bind("", key) frame.bind("", callback) frame.pack() root.mainloop() Answer: Currently, you are creating text variable , everytime the key() function gets called, and text it only stores the last character you typed. You can define text as a module level variable , and use that module level text…
Read More

ValueError: not enough values to unpack (expected 3, got 2) – python/tensorflow

Uncategorized
Question: I am trying to understand some code implemented using the tensorflow framework on jupyter notebook, when I get the following error on running this cell. I do not understand the problem here and some clarification would be very helpful. For reference, a training decoding layer is being created here in tensorflow. Code: def decoding_layer_train(encoder_state, dec_cell, dec_embed_input, target_sequence_length, max_summary_length, output_layer, keep_prob):""" Create a decoding layer for training:param encoder_state: Encoder State:param dec_cell: Decoder RNN Cell:param dec_embed_input: Decoder embedded input:param target_sequence_length: The lengths of each sequence in the target batch:param max_summary_length: The length of the longest sequence in the batch:param output_layer: Function to apply the output layer:param keep_prob: Dropout keep probability:return: BasicDecoderOutput containing training logits and sample_id """ # TODO: Implement Function # Helper for the training process; used by Basic Decoder…
Read More

error C2440: ‘=’: cannot convert from ‘div_t’ to ‘double’

Uncategorized
Question: i'm a beginner and my english is not so well so sorry first. 1. im trying to compile this code and i dont understand the problem- function div returns 'double', so why can't i write this line: "sum= div(x, y);" ? i tried to find the answer here and google it but it doesnt work. 2. beyond that, someone knows what is the solution to this problem- 1>Done building project "test.vcxproj" -- FAILED. ? thank you for your answers! #pragma once #include #include using namespace std; class DivisionByZero { private:const char* zero_description = "error: division by zero"; public:const char* getZero() {return zero_description;} void printZero() { cout
Read More

Calculation CRC32 Without Table

Uncategorized
Question: Hmm.. i made crc32 calculation for my program, However, it consumes a lot of memory to use the table. so i made crc32 calculation without table. But the result is bad.(The result are different.) #include #include unsigned long crc32_table[256] = { 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,…
Read More

ember, nginx, reverse proxy

nginx
Question: I have my app deployed to a file server here at: http://example.com/my-team/my-app We want our app to be facing at: http://amazingapp.com So far this is what I have on nginx server { listen 80; server_name http://amazingapp.com; location / { proxy_pass http://example.com/my-team/my-app/; } } This works for initial http://amazingapp.com but any subsequent requests http://amazingapp.com/post/1/comment/2 result in 404 Most of the ember deploy examples have the file being served from the same location as the web server, using try_files $uri $uri/ index.html So i don't believe i'm able to go down that path? I've tried using regex on the location but that requires the proxy_pass to have parameters. If you could point me in the right direction would be so grateful. Thanks in advance! Answer: Consider your config below server {…
Read More

How to boost a document if full query text is present in it? – Solr

Uncategorized
Question: I need to give priority to the documents where full search term occurs. For example if the search term is "Georgia Tech", I want the document having "Georgia Tech" in it to have extra boost than those having more frequent "Georgia" term in them. Answer: that is almost standard:index it two fields (use copyField), one whitespace (or similar) tokenized, one as a keyword. you use edismax and boost the keyword field with more weight than the other Read more
Read More

WordPress rest api not closing browser session

Uncategorized
Question: When I call a rest route, the browser session is not closed and the browser keeps loading. Due to this, chrome generates ERR_INCOMPLETE_CHUNKED_ENCODING error. Here is the request header:GET /?rest_route=/test/v1/advertiser/logout HTTP/1.1 Host: www.domain.com Connection: keep-alive Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Cookie: wp-settings-1=libraryContent%3Dbrowse%26editor%3Dhtml; wp-settings-time-1=1499682179; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_dc4e3a2222d11ce1c897e40579a199d39=admin%7C1501067732%7CgpNTUVy5lddq6EDTuDg6YzR9G2F222220zRTbEsgVTRF9%7C11627a0ad7e00c5d4f0a1b8a822d6ac366da838d7648c3d5c7cf7826eb5eb856 Query String Parameters view source view URL encoded And here is the response header:HTTP/1.1 201 Created Date: Tue, 15 Aug 2017 04:48:00 GMT Server: Apache X-Powered-By: PHP/5.6.30 X-Robots-Tag: noindex Link: ; rel="https://api.w.org/" X-Content-Type-Options: nosniff Access-Control-Expose-Headers: X-WP-Total, X-WP-TotalPages Access-Control-Allow-Headers: Authorization, Content-Type Allow: GET Cache-Control: private, must-revalidate Expires: Thu, 14 Sep 2017 04:48:00 GMT Connection: close Transfer-Encoding: chunked Content-Type: application/json; charset=UTF-8 If there is anything else I…
Read More

How to solve running node server error

Uncategorized
Question: I am keep facing the below error when running the node server, but the code used to work properly before. Could any expert to resolve the issue? Below is the error part of server.js try { app.listen(port, function(){ console.log('Server started on port'+port); }) } catch (e) { console.log('There was an error', e); } -------------------------------error--------------------------------------- PS C:UsersUserWebstormProjectsmyapp> nodemon server [nodemon] 1.11.0 [nodemon] to restart at any time, enter `rs` [nodemon] watching: *.* [nodemon] starting `node server app.js` events.js:182 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE :::3000 at Object.exports._errnoException (util.js:1024:11) at exports._exceptionWithHostPort (util.js:1047:20) at Server.setupListenHandle [as _listen2] (net.js:1319:14) at listenInCluster (net.js:1367:12) at Server.listen (net.js:1467:7) at Function.listen (C:UsersUserWebstormProjectsmyappnode_modulesexpresslibapplication.js:618:24) at Object. (C:UsersUserWebstormProjectsmyappserver.js:52:9) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) [nodemon] app crashed - waiting for file changes before…
Read More

Phoenix View for huge HBase Table

Uncategorized
Question: I'm working on a Hortonworks Data Platform 2.6 cluster with HBase 1.1.2 and Phoenix 4.7 installed. I have a huge HBase table with lots of columns, where sometimes new columns are added if new data is added (data is added by HBase API's Put mechanism). Now I would like to use Phoenix for this table. I found this tutorial, that sais that I have to create a separate Phoenix view based on the HBase table structure: https://khodeprasad.wordpress.com/2016/07/26/how-to-use-existing-hbase-table-in-apache-phoenix/ Based on the tutorial I'd have to list all the column families and columns (! more than 1000 at the moment, and still increasing), that would be a lot of work and the view wouldn't be up-to-date if new columns are added to the HBase table. Now my questions here are:Does it…
Read More