Posts

Showing posts from September, 2013

java - Why badge doesn't appear? -

Image
i try make smth this: to obtain result use code: i have navigationview <android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" android:fitssystemwindows="true" app:headerlayout="@layout/nav_header_main_second" app:menu="@menu/activity_third_drawer" /> i have menu xml file: <?xml version="1.0" encoding="utf-8"?> <group android:checkablebehavior="single"> <item android:id="@+id/nav_inbox" android:icon="@drawable/ic_mail_outline_white" android:title="inbox" app:actionlayout="@layout/badge" /> </group> <item android:title="@string/about_app"> <menu> <item android:id=...

lambda - Merge list of maps using Java 8 Stream API -

i'm trying learn java 8 stream , when try convert function java8 practice. meet problem. i'm curious how can convert follow code java stream format. /* * input example: * [ { "k1": { "kk1": 1, "kk2": 2}, "k2": {"kk1": 3, "kk2": 4} } { "k1": { "kk1": 10, "kk2": 20}, "k2": {"kk1": 30, "kk2": 40} } ] * output: * { "k1": { "kk1": 11, "kk2": 22}, "k2": {"kk1": 33, "kk2": 44} } * * */ private static map<string, map<string, long>> mergemapsvalue(list<map<string, map<string, long>>> valuelist) { set<string> keys_1 = valuelist.get(0).keyset(); set<string> keys_2 = valuelist.get(0).entryset().iterator().next().getvalue().keyset(); map<string, map<string, long>> re...

javascript - How to combine multiple css, js files and serve as one file in rails 3? -

i have been trying improve page load time in rails 3, went through few blogs learned can include css , js file names in application.css , application.js respectively. for testing purpose removed files layout , included in application.css , , on page reload css files didn't reload. my current application.css file: /* * manifest file that'll compiled application.css, include files * listed below. * * css , scss file within directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can referenced here using relative path. * * you're free add application-wide styles file , they'll appear @ top of * compiled file, it's better create new file per style scope. * *= require_self *= require 'owl.carousel.min.css' *= require 'owl.carousel.min.css' *= require 'owl.theme.min.css' *= require "flag-sprites.min.css" *= require 'owl.transitions.min...

Is there an in-built function in PHP that allows me to select array keys that are not one(s) I have specified -

consider array $my_array("key1"=>"value1", "key2"=>"value2", "key3"=>"value3") does php have function in can pass in key1 , returns key2 , key3. assuming key1 same key2 , key3 can change time time. $my_array("key1"=>"value1", "key2"=>"value2", "key3"=>"value3"); $result = the_function_i_want("key1"); print_r($result); expected output array ( [key2] => value2 [key3] => value3 ) if wish compare keys use following; $array1 = array("a" => "green", "red", "blue", "red"); $array2 = array("a" => "green"); function key_diff($array1, $array2){ foreach ($array2 $skey => $value) { if(isset( $array1[$skey] ) ) unset($array1[$skey]); } return $array1; } var_dump(key_diff($array1, $array2)); exit; ...

php - Set cart permalink when cart is not empty -

i have no cart link set in backend of woocommerce. instead have cart redirected checkout page. works fine, end empty urls. when add product cart message 'successfully added cart, see cart here'. 'see cart here' linked wc_get_page_permalink( 'cart' ) , not set. is possible through function set wc_get_page_permalink( 'cart' ) when items in cart? i tried like: function custom_continue_shopping_redirect_url ( $product_id ) { $url = "http://www.url.com"; // add link here return $url; } add_filter('wc_add_to_cart_message', 'custom_continue_shopping_redirect_url'); but replacing whole add cart message. thanks. you missed code. try way: add_filter( 'wc_add_to_cart_message', 'custom_continue_shopping_redirect_url', 10, 2 ); function custom_continue_shopping_redirect_url( $message, $product_id ) { global $woocommerce; // $permalink = get_permalink(woocommerce_get_page_id('...

django - Safari push notification in python using pyapns -

what use of cert.pem , key.pem? how can create these file safari push notification?? or can send notification on safari desktop? import time apns import apns, frame, payload apns = apns(use_sandbox=true, cert_file='cert.pem',key_file='key.pem') send notification token_hex = 'b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b87' payload = payload(alert="hello world!", sound="default", badge=1) apns.gateway_server.send_notification(token_hex, payload) i have done it. payload = payload(alert={ "title": "", "body": "", }, sound="default", badge=1,url_arg={"name":"https://www.epush.in",},)

crf - Installing python-crfsuite to anaconda -

i downloaded pythoncrfsuite package from https://pypi.python.org/pypi/python-crfsuite and installed via python setup.py install command , installed on system. however, i'm not able use spyder, whever import pycrfsuite following error, can provide me appropriate solution same? import pycrfsuite traceback (most recent call last): file "<stdin>", line 1, in <module> file "pycrfsuite/__init__.py", line 2, in <module> ._pycrfsuite import * importerror: no module named _pycrfsuite despite there file named _pycrfsuite.cpp in folder containing __init_.py.

How to change directory? in PHP -

when worked wamp, had no problems, because have of files in same directory, using hosts server, have change path file working with, py files work. hello.php in /public_html/wp-content/plugins , py, php working with, in /public_html/cgi-bin . hello.php code: <?php # -*- coding: utf-8 -*- /* plugin name: hello */ header('content-type: text/html; charset=cp1252'); add_shortcode( 'hello', 'execute_python_with_argv' ); function execute_python_with_argv(){ ob_start(); $description = array ( 0 => array("pipe", "r"), // stdin 1 => array("pipe", "w"), // stdout ); $application_system = "python "; $application_path .= plugin_dir_path( __file__ ); $application_name .= "hello.py"; $separator = " "; $application = $application_system.$application_path.$application_name.$separator; $pipes = array(); $proc = proc_open ( $application ,...

excel vba - Temporarily disabling VBA's worksheet_change() -

i have vba macro need run initialise monthly data dump of raw data. works fine. in addition, have private sub worksheet_change() step runs each time cell's value changed. works fine. my issue initialisation macro makes many changes, keeps firing off private sub worksheet_change() . there way can have disabled until after initialisation has finished running? you must temporarily disabile eventi with application.enableevents = false and set true initializing macro end to ensure set you'd better settings inside initializing macro , use error handler, follows: sub initializingmacro () on error goto errhandler application.enableevents = false 'your code here... errhandler: application.enableevents = true end sub

Number of visitors Count is resetting to 0 every one hour for website in asp.net c# -

visitors count resetting every 1 hour zero. i need total number of visitors website each day. can store total count in db per day. protected void session_start(object sender, eventargs e) { application.lock(); application["sitevisitedcounter"] = convert.toint32(application["sitevisitedcounter"]) + 1; application.unlock(); } is there other way store total number of visitors per day?? as marcusvinicius answered here you configure periodic restart settings application pool recycling in iis: the element contains configuration settings allow control when application pool recycled. can specify internet information services (iis) 7 recycle application pool after time interval (in minutes) or @ specific time each day. can configure iis base recycle on amount of virtual memory or physical memory worker process in application pool using or configure iis recycle application pool after worker process has processed specific number of reque...

win universal app - Qt Quick Controls 2 UWP CommandBar implementation -

Image
i want implement commandbar uwp design such here: i didn't found accepted solutions, therefore, think how implement own implementation. main problems me: how implement moving buttons menu if width not enough displaying buttons? how implement item control cascade filling him?

html - Why don't I get all 4 elements in the same row? -

please @ following code: <div class="container"> <form class="form-inline" role="form"> <div class="form-group"> <label for="first">first</label> <input class="form-control" id="first" ng-model="???" ng-readonly="true" /> </div> <div class="form-group"> <label for="second">second</label> <input class="form-control" id="second" ng-model="???" ng-readonly="true" /> </div> <div class="form-group"> <label for="third">third</label> <input class="form-control" id="third" ng-model="???" ng-readonly="true" /> </div> <div class="form-group"> <label for="fourth">fourth</label...

3d - threejs get center of object -

i have trying retrieve , plot centerpoint of objects keep getting same value objects x=0, y=0 , z=0. centerpoint centerpoint of scene. i'm reading on 3d computer matrixes i'm bit novice in area. need update scene somehow or update matrix after every added object or something? function initboxes(){ var box = new three.mesh(geometry, material); box.position.set(0, 2, 2); getcenterpoint(box); var box2 = new three.mesh(geometry, material); box2.position.set(0, 6, 6); getcenterpoint(box2); } function getcenterpoint(mesh) { var middle = new three.vector3(); var geometry = mesh.geometry; geometry.computeboundingbox(); middle.x = (geometry.boundingbox.max.x + geometry.boundingbox.min.x) / 2; middle.y = (geometry.boundingbox.max.y + geometry.boundingbox.min.y) / 2; middle.z = (geometry.boundingbox.max.z + geometry.boundingbox.min.z) / 2; return middle; } the object boundingbox in local space. if want center in worl...

java - Serializing JSON with varing datatype with the same variable -

i trying out opensignal api , have run wall when trying use jackson 2.0 serialize result. networkrank can array or can string how set jackson serialize json properly, if it's string, save string networkrank attribute else save list <networkrank> = new arraylist<networkrank>() these result of api: (check out networkrank below) { "apiversion": "2", "latitude": "14.55669", "longitude": "121.370119", "distance": "10", "network_type": "10", "perminutecurrent": 0, "perminutelimit": 10, "permonthcurrent": 7, "permonthlimit": 2000, "networkrank": "no results area" } and { "apiversion": "2", "latitude": "14.55669", "longitude": "121.370119", "distance": "10", "n...

vba - Apply a picture style to all pictures in a word document -

is there easy way pro-actively or retro-actively apply 'picture style' images stored in word document? i want apply 'center shadow rectangle' picture style images add document without changing them 1 1. the picture style concept exists @ ui level. apply image, have check properties of style in ui , apply them 1 one using vba: sub formatpictures() dim oinlineshape inlineshape each oinlineshape in activedocument.inlineshapes applypicturestyletoinlineshape oinlineshape next dim oshape shape each shape in activedocument.shapes applypicturestyletoshape oshape next end sub sub applypicturestyletoinlineshape(shape inlineshape) ' borders shape.borders.enable = false ' fill shape.fill.visible = msofalse ' line shape.line.visible = msofalse ' shadow shape.shadow.style = msoshadowstyleoutershadow shape.shadow.type = msoshadow21 shape.shadow.forecolor = wdcolor....

php - Running Pow & XAMPP Simultaneously -

i have machine xampp installed , running , need install pow work in ruby project. anyone have luck running both xampp , pow? http://pow.cx/manual.html https://www.apachefriends.org/es/index.html you cannot bind 2 servers on port 80 (default of xampp apache & default of pow). you can change port of apache this: how change xampp apache server port?

ios - How to select all rows as default with checkmark? -

i want select rows when view appear, used index path in viewdidappear selected 1 row , without checkmark here's viewdidappear method: -(void)viewdidappear:(bool)animated { [super viewdidappear:animated]; self.navigationcontroller.navigationbar.topitem.title = @"select blood donors"; nsindexpath *indexpath=[nsindexpath indexpathforrow:0 insection:0]; [_tblresult selectrowatindexpath:indexpath animated:yes scrollposition:uitableviewscrollpositionbottom]; } my table view methods : -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nsstring *cellident = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellident]; if(cell == nil) cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellident]; cell.textlabel.text = [arrname objectatindex:indexpath.row]; if([arselectedrows containsobject:inde...

iOS/Objective C image alpha low when I goes out of bounds of parent image -

Image
i have image editing ios app. i have t-shirt(parent image) image background image , can add other image(sub images) t-shirt image. when scale, move, rotate sub images meanwhile if portion of image going out of bounds of parent image portion should low alpha value. similarly i’ve shown in screenshot. i’ve wrote following code. uiimageview* randomview = [[uiimageview alloc] initwithframe:self.imageview.bounds]; randomview.userinteractionenabled = yes; randomview.alpha = 0.8; randomview.image = image; // 'image' coming gallery or camera uiimageview *maskview = [[uiimageview alloc] initwithimage:self.imageview.image]; [maskview setframe:self.imageview.bounds]; self.imageview.layer.mask = maskview.layer; [self.imageview setneedsdisplay]; add 1 more imageview (copy of main image alpha) behind t-shirt view.

bash - Add element into Array -

i´m trying dynamically add element array: array=("element1" "element2" "element3") fa=() # loop through above array in "${array[@]}" fa+=("$i") # or whatever individual element of array done echo $fa but it's returning element1 . i've tried index, i'm getting same result: fa[index]="$i" ((index++)) am doing wrong here? the problem printing ie echo $fa . equivalent echo ${fa[0]} means first element of array, got element1 echo "${fa[@]}" should give entire array. reference [ ] should give nice description bash arrays.

android - MODE_MULTI_PROCESS I am studying SharedPreferences, can anyone explain me what it does? -

i studying sharedpreference , didn't understand this: mode_multi_process this method check modification of preferences if sharedpreference instance has been loaded. can 1 please explain me example? this behavior desired in cases application has multiple processes, writing same sharedpreferences file. there better forms of communication between processes, though. mode_multi_process used when application has multiple processes, of them writing same sharedpref file. , app having multiple processes rare thing in itself. shouldn't anyway use mode_multi_process sharedprefs. quoting reason documentation , mode_multi_process not work reliably in versions of android, , furthermore not provide mechanism reconciling concurrent modifications across processes. applications should not attempt use it. instead, should use explicit cross-process data management approach such contentprovider moreover, mode deprecated in api level 23

python - Flatten numpy array without double for loop -

i have 2-d matrix. purposes of example, let's random matrix >>> = np.random.randn(5, 7) >>> array([[-0.37279322, 0.28619523, -0.05309901, 0.26010327, 0.1846693 , 0.33112176, 0.75814911], [ 1.57001151, -0.86831693, -0.20576395, 1.46450855, -0.01631132, 3.02790403, -0.65313017], [ 0.2362675 , -1.52190536, 0.04687194, 2.01618876, 0.03780218, -0.53041096, -0.30104844], [-0.5504834 , 1.04286156, 1.12863785, 0.89583492, 0.28607363, 1.42858007, 0.28582572], [-0.768464 , 0.31952554, 0.81129581, 0.26239668, -0.23242878, -1.01584339, 0.39573906]]) and 2 vectors of labels: label_y = np.array([23, 984, 123, 9321, 121238]) label_x = np.array([121, 31312, 9123131, 1111, 1231441, 1929313, 192312312361]) i'd flatten elements of , output label indeces , values. example: 23,121,-0.37279322 23,31312,0.28619523 23,9123131,-0.05309901 23,1111,0.26010327 23,1231441,0.1846693 23,1929313,0.33112176 23,192312312361,0.75814...

c# - Visual Studio 2015 project fails adding to source control -

i'm trying use functionality of visual studio 2015 create project template. i have simple wcf-project special web.config. use classes project referenced it. those 2 projects in same solution , inherited in source control. when create template , try add new project same solution, choose custom template, solution gets checked out files doens't added source control. the source control says, binding invalid. dont know why. does have suggestions? thanks in advance! visual studio 2015 - solution explorer, click show files,check new file show in project tree. right click on file select add project. new file need add .sln (project solution file) show in project.

html - Custom checkbox is not aligned with text -

Image
im im trying create custom checkboxes in gwt using css far able style checkboxes not have text near them. checkboxes text looking messy current state: desired behaviour: <span class="gwt-checkbox" id="i294"> <input tabindex="0" id="gwt-uid-3" type="checkbox" value="on"> <label for="gwt-uid-3">run task after finish</label> </span> html input[type="checkbox"] { visibility: hidden; } input[type="checkbox"]+label { display: inline-block; width: 16px; height: 16px; background: url(images/custom_html_elements_sprite.png) 0 0; } input[type="checkbox"]:checked+label { display: inline-block; width: 16px; height: 16px; background: url(images/custom_html_elements_sprite.png) -64px 0; } css any appreciated edit: fiddle provided https://jsfiddle.net/2j0zke2z/ it solves problems: (you can set highe...

execution - Adding an additional printf line affects C code -

i adding simple printf line in code , affects whether line before executed or not. restarted terminal it's still same. tried on online compiler , executor , there's no problem, in computer have problem. restarting pc doesn't help. else { lf++; } when put lf not increased , program outputs "0 strings" on pc, "4 strings" on http://www.tutorialspoint.com/compile_c_online.php when replace with else { lf++; printf("\ndo here?\n"); } it outputs "4 strings" in both platforms (as should). can reason behind this? far know simple printf shouldn't affect whether line before executed or not, independent c compiler use. here original code: #include"mylib.h" #define max 67108863 char tab[100][27]; double val[100]; int l; void showtab(file *fout) { int i, j; printf("\nnumber of strings %d\n",l); for(i=0;i<l;i++) { fprintf(fout,"%lf ...

PHP - SPL file object returning null on seek -

alright, using spl file object a+ mode. data apends correctly want validate last row of data grabbing file again. data csv format, works first line in file , apends 2 line correctly. when seeking 2nd line returns null. <?php $handle = new splfileobject("filepath here","a+"); $handle->setflags(splfileobject::read_csv); // write using fputcsv $status = $handle->fputcsv($data,','); $status = $handle->fputcsv($data,','); $handle->seek(1); $fields = $handle->fgetcsv(','); $fields2 = $handle->current(); // both fields , fields2 return null there 2 lines worth of data in file. please help

javascript - accessing environment variable from react component -

i have non sensitive data need set different values based on environment node runs in staging or production , believe accessing process.env.node_env not work within react component itself, in server side files, hence need way somehow pass down react component. it show if string "staging" or "production" inside footer component. consider using defineplugin : define free variables. useful having development builds debug logging or adding global constants. example: new webpack.defineplugin({ version: json.stringify("5fa3b9"), browser_supports_html5: true, two: "1+1", "typeof window": json.stringify("object") })

Variable in enclosed local scope vs variable in global scope - Python -

hi guys can't figure out why when find_average() called, total = 20 in global scope being used find_total() function, instead of total = 10 in enclosing scope? in advance insights , help! total = 20 def find_total(l): return total def find_length(l): length = len(l) return length def find_average(l): total = 10 return find_total(l) / find_length(l) average = find_average(example_list) each function has own scope. starts @ functions local, inner scope, goes outwards through enclosing functions until reaches global (module) scope. sequence depends on scope function defined in . stack (calling sequence) not used variable lookup. in example, each function has inner scope followed outer scope. find_total , that's <module>.find_total.<locals> , <module> . so, whenever find_total run, total in local scope, failing, , in global scope. there, total == 20 . the scope inside find_average exclusive find_average . neith...

get counts of null and not null dates in mysql -

Image
i have table in mysql named cfixed table shown below i need counts of null , not null dates shown below i have wrote mysql query getting count of not null , null dates shown below for getting not null dates counts date not showing 0 count select date, count(*) counts cfixed fixed not null group date for getting null dates counts date not showing 0 count select date, count(*) counts cfixed fixed null group date can please tell me how counts of null , not null within single query count() automatically counts non-null values (if provide specific column). null values can use conditional sum() select date, count(fixed) non_null_counts, sum(fixed null) null_counts cfixed group date

Google Cloud new cluster generation failure. -

i have been trying create new cluster using both web ui , following command: gcloud dataproc clusters create cluster-2 --zone europe-west1-b --master-machine-type n1-standard-1 --master-boot-disk-size 50 --num-workers 2 --worker-machine-type n1-standard-1 --worker-boot-disk-size 50 --project <project-name> the cluster consists of 1 master node , 2 worker nodes , pretty small cluster. virtual machines generated , running properly. however, cluster generation fails. the error messages shown during cluster-generation point me file "dataproc-startup-script_output". error message have found error: "--max_wait_seconds" not port in file. the number of vms have 5. single machines can created , run successfully. in recent past (few days ago), able create cluster no problems. cluster deleted however. there limit how many clusters 1 can create? to summarize findings following separately email thread, in general if: it takes longer 10 minutes ...

jquery - How to display images and text using JSF? -

Image
i have requirement below: . i able using jquery autocomplete/typeahead have use jsf only. want format only. h:graphicimage having rowspan , title right , details below. tried using jsf panelgrid acheiving format no avail. can please help? there no ready jsf components features want. have 3 ways: link custom jsf library component want write own jsf component; use normal html , add own css. as me, 3rd way simplest.

ios - How do map the json data if user enter incorrect detail? -

my question implementation working when user enter correct credential, issue come when user enter incorrect details: my request map objects: alamofire.request(.post, urlstring, parameters: params, encoding: .json, headers: headers).responseobject(keypath: "data") { (response: response<user, nserror>) in { } below json response when user entered incorrect credentials: { "success": "false", "message": "the user name or password incorrect.", "data": null } error when user enter incorrect details: error : result : failure: error domain=com.alamofire.error code=-6004 " objectmapper failed serialize response. " userinfo={nslocalizedfailurereason=objectmapper failed serialize response.} please guide , suggest according implementation. there tow ways handle : 1- manually check fields data before passing alamofire request. : data not nil, number of characters , data type....

java - how to add different activity for each row in listview in android -

i know how add activity listview using intent , can see in below code added back.class mainactivity.java customadapter.java file. when click on each row of listview everytime open 1 activity(back.class). want add different activity (leg.class, abs.class, chest.class etc) mainactivity.java using intent when click on each row of listview open different activity. don't know how it? this mainactitvity.java file public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); string[] excercise = {"back day", "legs day", "abs day", "chest day", "shoulder day", "arms day"}; final int[] imgs = {r.drawable.back, r.drawable.leg, r.drawable.abs, r.drawable.c...

ruby on rails - How to query for the products belonging to category and sub categories the correct way -

categories , sub categories independent models. , each category have sub categories. while creating product, admin has select category , sub category. following models have come with class product < activerecord::base belongs_to :category end class category < activerecord::base has_many :products end class sub < activerecord::base has_many :products end here schema products create_table "products", force: :cascade |t| t.string "name" t.integer "price" t.integer "category_id" t.integer "sub_id" end the product created this product.create(name: "messi magnet custom",category_id: 1, sub_id: 2) and querying products belong particular category , sub category this product.where("category_id = ? , sub_id = ?",9,3) is there thing wrong associations having? , improve this? class category < activerecord::base has_many :products has_many :sub_cat...

Import CSV on Mac Neo4j: Couldn't load the external resource -

i'm running in neo4j community edition hoping upload csv in downloads folder load csv headers "file:/users/santouko/downloads/neo4j_module_datasets/test.csv" line return count(*); however return error msg path different 1 specified, possible reasons? couldn't load external resource at: file:/users/santokou/documents/neo4j/default.graphdb/import/users/santokou/downloads/neo4j_module_datasets/test.csv by default load csv path relative import directory of neo4j installation. you can configure specifying value dbms.directories.import in neo4j.conf . see this page or more info.

loops - overwriting values in dataframe in python -

i'm new python might seem bit easy problem expertise. i've 6 categories(0 5),each of has 4 sub-categories namely: '3','4','5','6'. for this,i've created dataframe using: df=pd.dataframe(index=list(range(5)),columns=list([3,4,5,6]) now,i'm getting calculated values loop: for in range(5): j in list([3,4,5,6]): somecalculation=a now,i'm trying replace values of df these calculations second iteration (i.e. for i=0,j=4 ), got somecalculation=b , third s omecalculation=c , further d. when loop again iterates on i=2 ,i calculations e,f,g,h , on further iterations. i'm trying append these values df obtain them i'm not getting desired output 3 4 5 6 0 b c d 1 e f g h 2 j k l ......... ......... ......... because ultimately,i want take average of column values using indices, replacing values of dataframe becoming troublesome. your suggestion of appending dataframe rows iteratively not optimal...

Unable to parse locally stored JSON file with special character like backslash "\" in R -

i not able parse locally stored json file looks this- [{"status_code":200,"operation_id":"13-10","response":"{\"emails\": [{\"campaign_id\":\"1111111\",\"email_address\":\"1111@111\",\"activity\": []},{\"campaign_id\":\"22222\",\"email_address\":\"2222@2222\",\"activity\":[]}}}] i using jsonlite can see \ present everywhere, , unable parse it. , when - st<-fromjson("/users/frantr/this_is_r/open_files/json_file.json") print(st) i this- $ : chr "[{\"status_code\":200" $ : chr "\"operation_id\":\"13-10\"" $ : chr "\"response\":\"{\\\"emails\\\": [{\\\"campaign_id\\\":\\\"1111111\\\"" $ : chr "\\\"email_address\\\":\\\"111111111\\\"" $ : chr "\\\"activity\\\...

how to clear browser cache using angularjs or javascript? -

i developed application angularjs , c program. when api c program change data, view should change. after refreshing page new data not updating in view. when clearing browser's cache manually, new data getting updated in view. problem cache only. in solution issue, have added following html tags. <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="cache-control" content="no-store" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="-1" /> <meta http-equiv="expires" content="tue, 01 jan 1980 1:00:00 gmt" /> <meta http-equiv="pragma" content="no-cache" /> these working, fails, , again catching cache data. so please know, if there sol...

javascript - CORS error - Working in Chrome but fails in IE -

i have below script doing ajax call , trying redirect url. problem here below code working fine in chrome fails in ie. function loginsubmit() { debugger; $('#loginform').validate(); if ($('#loginform').valid()) { myapp.showprogress(); $.ajax({ url: "/authentication/login", type: "post", data: $("form[name=loginform]").serialize(), success: function (data) { debugger; $('convertinsuredlogin').html(""); if (data != null && data.oldaccountnumber) { insuredlogin(data.oldaccountnumber); } else if (data != null && data.returnurl) { //error line window.location.replace(data.returnurl); } ...

sql server - Update column from another table based on matching column value using fuzzy logic -

how update column table on basis of percentage of matching of 2 column of 2 tables e.g suppose have table company1 having column address1 , companyname1 , table company2 having column address2 , companyname2 .i want update companyname1 of company1 table company2 on basis of address1 , address2 matching percent value. please suggest me efficient running query based on comment: ;with company2 ( select 'hamby chiropractic' companyname2, '6716 madison ave # a1' address2 ), company1 ( select null companyname1, '6716 madison' address1 ) select *, len(c1.address1)*100.00/len(c2.address2) company1 c1 left join company2 c2 on c2.address2 '%' + c1.address1 +'%' or c1.address1 '%' + c2.address2 +'%' i companyname1 address1 companyname2 address2 (no column name) null 6716 madison hamby chiropractic 6716 madison ave # a1 57.1428571428571 i have c...

reflection - How do I get the value of a sibling field in c#? -

class { public b; public c; } c func() { a=new a(); // set fields in private return a.c; } i have object returned func() c c=func() how value of connected field b? i know can type of b through type.reflectedtype,but don't know how value of b. i solve myself. use delegate.target parent object

Why use a Pointer and its dereference in if statement in c++ -

i looking c++ code, , confused if(ptr && *ptr) , in case? // process data here. break data separate pieces , // display sake of simplicity. char * a_pszbreak = null; char * a_pszdataitem = (char*)s_aucdatabuffer; { // poll data terminated either carriage return alone, or // carriage return/line feed pair. a_pszbreak = strpbrk(a_pszdataitem, "\n\r"); if (a_pszbreak && *a_pszbreak) { *a_pszbreak = 0; a_pszbreak++; logpolldata((const char *)a_pszdataitem); } a_pszdataitem = a_pszbreak; } while (a_pszbreak && *a_pszbreak); it means pointer should point , in addition must different 0. it's (a_pszbreak != nullptr && a_pszbrealk[0] != '\0')

What is the 'rails way' to pass a parameter to the controller in a link -

i'm trying pass variable view controller in link_to. link_to: <%= link_to "download csv", vendor_skus_path(format: "csv") %> i pass filter parameter, parameter set in view , not part of form. how can parameter controller use in model? how build filter parameter: <%= select_tag "vendor-select", options_from_collection_for_select(@vendors, "id", "name"), include_blank: true, class:"vendor-select form-control" %> in vendor_skus#index controller this: respond_to |format| format.html format.csv { send_data @vendor_skus.to_csv } end what below, can use parameter filter rows exported. respond_to |format| format.html format.csv { send_data @vendor_skus.to_csv, vendor_id } end

Disable all the default swipe gestures in android -

i trying build launcher blind in android. avoid unwanted complexity , improve accessibility, want disable default swipe gestures , allow clicks. note: disabling swipe gestures, want avoid access features " quick settings in android " opens when swipe down gesture, " google now " opens swipe gesture, etc.

javascript - I have MultipleSeletion Dropdown I want to deselect sleceted values of the dropdown do not Know how to do this -

now using code unselect selected values of dropdown not working var diag = document.getelementbyid('<%=seldiag.clientid%>'); var diag1 = ""; var diag2 = ""; var diag3 = ""; var diag4 = ""; var options = diag.getelementsbytagname('option'); (var = 0, len = options.length; < len; i++) { options[i].selected == false; } '==' comparison operation, need use '=' var diag = document.getelementbyid('tst'); var options = diag.getelementsbytagname('option'); (var = 0, len = options.length; < len; i++) { options[i].selected = false; } <select id="tst" multiple> <option value="volvo" selected>volvo</option> <option value="saab">saab</option> <option value="vw">vw</option> <option value="audi" selected>audi</option> </select>

java - Issues in Recycler view when retrive the data from using json -

this question has answer here: recyclerview nullpointerexception issue in getitemcount 1 answer my issue when creating recycler view using json shows exception 1 can solve issue u r brilliance please me solve issue , appreciate solve error? public class mainactivity extends activity { button b; textview tv; listview lists; recyclerview recyclerview; list<your> yourss; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); recyclerview = (recyclerview) findviewbyid(r.id.recycle); linearlayoutmanager ll = new linearlayoutmanager(mainactivity.this); recyclerview.sethasfixedsize(true); recyclerview.setlayoutmanager(ll); new jsontask().execute("http://yoursubshop.com/webservices/categories.php"); } public class jsontask extends asynctask<s...

Jupyter R Plotly 404 eror with sample code -

i tried run plotly r chart in jupyter here , get: 404 not found error. the code follows library(plotly) set.seed(123) x <- rnorm(1000) y <- rchisq(1000, df = 1, ncp = 0) group <- sample(letters[1:5], size = 1000, replace = t) size <- sample(1:5, size = 1000, replace = t) ds <- data.frame(x, y, group, size) p <- plot_ly(ds, x = x, y = y, mode = "markers", group = group, size = size) %>% layout(title = "scatter plot") embed_notebook(p,file="/jupyter notebooks/plotlyjupyterhtml/test3.html") the terminal has error message: 404 /jupyter%20notebooks/plotlyjupyterhtml/test3.html.embed (::1) 6.51ms referer= http://localhost:8888/notebooks/plotly%20%in%20r%20testing-copy1-ipynd there file in directory d:\jupyter notebooks\plotlyjupyterhtml\test3.html not 1 additional extension .embed . the html file has data , creates correct chart when opened in firefox. it seems statement may have wrong file name appre...

parse.com - Extend Parse SDK Object in TypeScript -

in order define easy getters , setters parse objects in angular2, want extend parse.object so: const parse = require('parse').parse; export class test extends parse.object { constructor() { super('test'); } items():array<string> { return super.get('items'); } set items(value:array<string>) { super.set('items', value); } } parse.object.registersubclass('test', test); however, following error: error ts2507: type 'any' not constructor function type.

sql server - I have managed to create a view statment with all the columns I need. Can I use it to somehow get also the table view that I need? -

in table there 120 columns. need 117 columns listed. script selects columns need. select column_name information_schema.columns table_name = 'table' , column_name not in ( 'columna' ) , column_name not in ( 'columnb' ) , column_name not in ( 'columnc' ) can use script generate table need? how? if not, there other solution (other writing down 120 , deleting 3)? you need use dynamic sql declare @col_list varchar(max)= '' set @col_list = (select ',' + column_name information_schema.columns table_name = 'table' , column_name not in ( 'columna', 'columnb', 'columnc' ) xml path ('')) select stuff(@col_list, 1, 1, '') exec ('select '+@col_list+' yourtable ')

javascript - contenteditable cancel push elements -

hey friend, need help... made page div "contenteditable" , want cancel push divs / br / p , stay empty elements after it's function because it's function create massage in "what'sapp web" ... the first lines (1-6) doesnt work click enter if clicking "send" button work... but please first open link in div contenteditable click @ least twice times enter , understand problem... you can see link: jsfiddle.net/sarelyuval/nl1rbel9 thank you! var t = document.createtextnode(input.textcontent); // line no 56 instead of input.innerhtml need content input.textcontent

ios - How do I get the string name of a storyboard? -

i've looked @ following guidance no avail: how know current storyboard name? i trying open specific view controller using storyboard remote notification based off of following answer: present specific view controller in didreceiveremotenotification swift let mvc = mainviewcontroller() let storyboardnamestring = mvc.storyboard. //<-proposed solution? nothing auto complete shows let storyboard = uistoryboard(name: storyboardnamestring , bundle: nil) storyboard.instantiateviewcontrollerwithidentifier("some-view-controller") i've checked "file inspector", "quick inspector", "identity inspector", "attributes inspector", "size inspector", , "connections inspector" no luck there either. when selected view controller on storyboard , tried find name of current storyboard able find view's storyboard id, not name of storyboard however. any solution appreciated, otherwise try fin...

asp.net - HTML 5 Video : Video not playing on TEST Server -

i have been working on html5 video need play video. video resides in solution folder. please visit link in iam able run video in localhost : yesterday discussion i have created folder in same solution , path iam providing src ..\..\trainingfolder\filename.mp4 iam able in local solution, when created same folder structure in test server , migrated code. video not playing. the below code working fine in local environment localhost not in test server. $("#<%= hdnstartdatetime.clientid %>").val(param2); var url = $get("<%=lnkvideolink.clientid %>").value; alert(url); $('[id*="myvdo"]').attr('src', url);//type='video/mp4' $('[id*="myvdo"]')[1].load(); //show panel $find("mpe").show(); ok got there no mime type associated iis mp4. added mime type , got it.

java - why this String desc variable not get inserted to the database in hibernate -

i newbie hibernate framework. following tutorial series available on link . here model class package kasun.hibernate.moreannotations; import java.util.date; import javax.persistence.entity; import javax.persistence.id; import javax.persistence.table; @entity @table(name="userdetailsmoreann") public class userdetailsmoreannotations { private int id; private string name; private string address; private date date; private string desc; @id public int getid() { return id; } public void setid(int id) { this.id = id; } public string getname() { return name; } public void setname(string name) { this.name = name; } public string getaddress() { return address; } public void setaddress(string address) { this.address = address; } public date getdate() { return date; } public void setdate(date date) { this.date = date; } // ...