Posts

Showing posts from February, 2014

chart.js - chartjs Line chart: scale respect value on x-axis -

Image
i new on chartjs. i using line chart. labels include value: [100,200,1000] the distance between labels same, , not depend on value of label. chart requires distance between [200] label , [1000] label 8 times longer distance between [100] , [200] label. please me stuck. chart.js x labels not number scales. there community extension ( http://dima117.github.io/chart.scatter/ ) this. linked in documentation ( http://www.chartjs.org/docs/#advanced-usage-community-extensions ).

android universal image loader not working correctly -

i have cursor adapter bindview follows: @override public void bindview(view view, context context, cursor cursor) { ... imageview imageview = (imageview) view.findviewbyid(r.id.icon); imageloader imageloader = imageloader.getinstance(); displayimageoptions options = new displayimageoptions.builder() .cacheondisk(true).cacheinmemory(true) .showimageonloading(r.drawable.ic_contact_picture).showimageonfail(r.drawable.ic_contact_picture) .resetviewbeforeloading(true) .displayer(new fadeinbitmapdisplayer(300)).build(); imageloader.displayimage(url, imageview, options); ... } the problem i'm getting is: when scroll through listview, item's imageview image gets displayed in item's imageview. why happen? is internal recycling of listview items causing problem? as say,the problem maybe because of recycler mechanism of listview,you should use viewholder hold item view performance o

Android database storage formats appropriate for JavaScript access -

i'm developing android application, typically small database (hundreds thousand or main entries, plus similar order of magnitude in joined tables) populated user. there file associated each main entry, kept separate, , not part of question. in current prototype, structured data stored in sqlite database in usual way, , synced between devices uploading file application folder on google drive. allows me avoid having provide user storage, hope stick to. storing files here has happy side effect can access them via javascript code in web page using google drive api. javascript interacting remote sqlite file incredibly ugly thing attempt. (downloading database server-side , handling there option sounds not great either.) wondering if has recommendations of best practice approach here, given have web-based version of app accessing same data. the obvious sensible idea seems be exporting sqlite other structured format xxx (like xml, json, csv, ...) first, uploading xxx file

python - Flask-Sqlite posting to DB from webform -

i have started learning flask , tried find answer how post sqlite db webform. far haven't managed work , bit lost this. manage print values db based on code sample simplypython don't know how add new ones webform. i need able address elements, open connection database, insert values, save , close connection. far aware should add post method app.py , use request.form statement pull elements when submit button pressed. then code should automatically display values on index html, works. please me code need add app.py file values added db , add form action webform-section on html file? index.html <!doctype html> <html> <head> <title>flask intro</title> <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> --> </head> <body> <div class="container"> <h3 potsit </h3> {% post in posts %} titleotsikko: {{post.title }}

java - Adding tab Navigation to my Fragment -

i new android developing . i've made tab navigation activity, transfer code fragment project, encountered errors . can me proper way inside fragment . note : used import android.support.v4.app.fragment; on both frmslide , fragmentfeedfragment my frmslide code this public class frmslide extends appcompatactivity implements navigationdrawerfragment.navigationdrawercallbacks { /** * fragment managing behaviors, interactions , presentation of navigation drawer. */ private navigationdrawerfragment mnavigationdrawerfragment; /** * used store last screen title. use in {@link #restoreactionbar()}. */ private charsequence mtitle; viewpager viewpager; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_frm_slide); mnavigationdrawerfragment = (navigationdrawerfragment) getsupportfragmentmanager().findfragmentbyid(r.id.navigation_drawer); mtitle = gettitle();

c - Difference between #include <filename> & #include "filename" -

this question has answer here: what difference between #include <filename> , #include “filename”? 26 answers here preprocessor directive in c : #include <filename> we can write in way also: #include "filename" is there difference between these two? in general, <> version should in "system directories", while "" should in "local directories" first, , system directories. what means implementation dependent. in cases "" in current directory first, in implementations in directory of source ( .c ) file first (and compilers have switch that). also, behavior different w.r.t. "set of system directories" search if "local directory search" fails (the same <> or not).

windows - echoing dynamically generated variable -

set css_folder_source=.\css set js_folder_source=.\js %%a in (js, css ) ( if defined %%a_folder_source ( echo %%%a_folder_source%% ) ) i want read contents of both folders. don't know how dynamically generate folder_source names use delayed expansion : setlocal enabledelayedexpansion ............ %%a in (js css) ( echo !%%a_folder_source! )

c++ - copying contents from one char array to another but getting junk -

i accepting user input in format (123) 456-7890 , storing char array per assigned instructions. want copy numbers of input array have 1234567890 , leave out ( ) - . i formatted user input using cin.getline() , use for loop transfer numbers second array bizarre output. here code: int main() { const int max = 15, dmax = 10; char nums[max], digit[dmax]; int usablen, rdx = 0; cout << "enter phone number in (xxx) xxx-xxxx format: "; cin.getline(nums, max); (int = 1; < 4; i++) { digit[rdx] = nums[i]; usablen = atoi(digit); cout << digit << endl; rdx++; } (int = 6; < 9; i++) { digit[rdx] = nums[i]; usablen = atoi(digit); cout << digit << endl; rdx++; } (int = 10; < 14; i++) { digit[rdx] = nums[i]; usablen = atoi(digit); cout << digit << endl; rdx++; } cout &

iphone privateapi - Private iOS Framework Returning NULL -

i'm trying use batterycenter , commonutilities private frameworks under ios 9.1 of nst's ios runtime headers . it's research purposes , won't make appstore. here respective codes: - (void)batterycenter { nsbundle *bundle = [nsbundle bundlewithpath:@"/system/library/privateframeworks/batterycenter.framework"]; bool success = [bundle load]; if(success) { class bcbatterydevice = nsclassfromstring(@"bcbatterydevice"); id si = [[bcbatterydevice alloc] init]; nslog(@"charging: %@", [si valueforkey:@"charging"]); } } - (void)commonutilities { nsbundle *bundle = [nsbundle bundlewithpath:@"/system/library/privateframeworks/commonutilities.framework"]; bool success = [bundle load]; if(success) { class commonutilities = nsclassfromstring(@"cutwifimanager"); id si = [commonutilities valueforkey:@"sharedinstance"]; nslog(@"is

jsp - MySQL Query for Stock Level Process -

i doing inventory management system rn , found dead end on how should on stock increases , decreases. heres thing, if ordered supplier , set stock status "ordered" stock remain unchanged , once change status "received" quantity of product/stock have order automatically added inventory table. where , how should make make happened. lecturer said smth having trigger. , dont know how start. please give input on how should start. in advance. i'm using tomcat 8.0, mysql , jsp.

c++ - Passsing primitives by value -

i'm reading scott meyrses c++ , section passing-reference-to-const . said user-defined types it's pass references-to-const, unlike built-in types. my question why built-in types should passed value. why more efficient? think, put registers, reason? when pass reference, behind scenes it's passing pointer. more efficient passing whole structure, large. primitive types same size pointer (at worst might twice big). smaller -- char 1 byte, while pointers typically 4 or 8 bytes. there's no efficiency gained passing reference instead of passing value itself.

memory management - Probability of recovering files - 100% -

is true if 1 deletes amount of files, turns off computer , runs data recovery program in bootable mode there 99% chance of , recovering files ? how possible.. not sure whether 99% possible ect when delete file off file system data isn't removed. operating system flags section of disk to overwritten when needs write disk. provided or system don't causes writes happen disk before using data recovery tool data still there , able recovered. if writes disk happen provided not in sectors trying recover still possible recover data. unfortunately there no way control safest thing shut down straight away. the best way boot off usb or cd has recovery tools on built job. way os booting won't write disk trying recover , possibly overwrite data hoping recover. cheers

How to fill a star with partially in android? -

fill star partially picture to see above picture. sample code below `protected void ondraw(canvas canvas) { mid = getwidth()/2; int a=100,b=100; min = math.min(a, b); fat = min / 17; half = min / 2; rad = 5; mid = mid - half; paint = new paint(); paint.setcolor(color.blue); paint.setstyle(paint.style.stroke); path path = new path(); path.reset(); paint.setstyle(paint.style.fill); // top left path.moveto(half * 0.5f, half * 0.84f); // top right path.lineto(half * 1.5f, half * 0.84f); // bottom left path.lineto(half * 0.68f, half * 1.45f); // top tip path.lineto(half * 1.0f, half * 0.5f); // bottom right path.lineto(half * 1.32f, half * 1.45f); // top left path.lineto(half * 0.5f, half * 0.84f); path.close(); canvas.drawpath(path, paint); super.ondraw(canvas); }` my question how partially fill star in android? i want fill option not half fill

windows 7 x64 - How do I get my java program running even though it has no errors? What have I done wrong? How can I make the program run? -

in program supposed ask user whether or not order 1 pizza , if yes, must enter: their last name (don't worry validating) , their choice of pizza type and their choice of pizza size. the choices veggie, cheese, pepperoni, , supreme. can small, medium, or large. each person can order 1 pizza. things need validate initial response, types of pizza, , sizes. when compiled program had no errors, when tried run did show code. when "all did show code" mean on browser used showed see in notepad++. ran clicking "run" drop down button on notepad++. gave me options run in different browsers. tried running in mozilla , chrome same results (only showing source code, not running program). advice on how program working?? /*this program keep prompting user enter pizza order, perform requested calculation, , output requested result. written hannah lane*/ import java.util.scanner; public class pizzaorders { public static void main(string[] args) {

ios - Call a function of an another class (protocol) -

Image
i have slide out navigation panel (menu) , "menu" on first page. slide out menu: index page 1 page 2 page 3 page 4 on index: page 1 page 2 page 3 page 4 so user have access pages index or sliding (or tap on icon menu) have menu. but have error: go page 1 index, tap on icon menu slide out menu tap on index, go page 1 again index, , here if tap again on icon menu, error: sigbrt (something that) i did breakpoints: on line: self.delegate?.pushviewcontrollerinstack!(uistoryboard.nosoffresviewcontroller(‌​)!) and 1 in function pushviewcontrollerinstack and when maniplations, app read line self.delegate?.pushviewcontrollerinstack!(uistoryboard.nosoffresviewcontroller(‌​)!) don't go in function. so view lost access of function, don't know why , how fix issue. there's lot of code, can find git repository here: https://github.com/vkt0r/slideoutsidebartest the error: 2015-10-28 09:00:33.038 solutis[477:5075] -[solutis.nosoffres

python - Plot with intermediate colors -

i've seen many questions regarding coloring plots, palettes, color maps, etc. want have intermediate colors between default w, m, g, k, b, r. for instance want plot below gray instead of black. import numpy np import matplotlib.pylab plt = np.linspace(1., 4., 6) b = np.array([3,4.,5.3,7.,8,0]) plt.figure() plt.plot(a,b,'ko-',) plt.show() you can define colours in many ways matplotlib . docs plt.plot : in addition [ to abbreviations listed above ], can specify colors in many weird , wonderful ways, including full names ('green'), hex strings ('#008000'), rgb or rgba tuples ((0,1,0,1)) or grayscale intensities string ('0.8'). of these, string specifications can used in place of fmt group, tuple forms can used kwargs. so, examples grey in plot: plt.plot(a,b,'o-',color='grey') plt.plot(a,b,'o-',color='#808080') plt.plot(a,b,'o-',color=(0.5,0.5,0.5) plt.plot(a,b,'o-',color=

java - Jackson serialization: Ignore uninitialised int -

now first off, i've read other answers on site , others jackson serialisation provide methods ignoring null fields. in java, however, int cannot null . i trying objectmap java object convert json ignore null fields. works strings int s end taking on value of 0 if uninitialised, , since 0 not null field not ignored. private objectwriter mapper = new objectmapper().writer(); private myclass data = new myclass(); //class contains string , int variable data.setnumber(someint); //set values data.setstring(somestring); string json = mapper.writevalueasstring(data); can shed light on please? edit: clarify, have tried using integer class data type causes conversion json string throw jsonprocessingexception. use int wrapper integer . way you'll able use null value. alternatively can use jackson's jsoninclude annotation ignore null value when serializing. @jsoninclude(include.non_null) public class myclass{ ... }

ios - Rest kit RKMappingOperation do not work -

rest kit rkmappingoperation not work here code run. should create data in cvvname object . not work. how make work? class cvvname: nsobject{ var firstname = "" var lastname = "" } class cvvmappingprovider: nsobject { class func namemapping() -> rkmapping { let resultmapping : rkobjectmapping = rkobjectmapping(forclass: cvvname.classforcoder()) resultmapping.addattributemappingsfromdictionary(["firstname":"firstname", "lastname": "lastname"]) return resultmapping } } func dorestkit() { var themapping:rkmapping = cvvmappingprovider.namemapping() let therepresentation = [["firstname": "firstname01"] ,["lastname": "lastname01"] ] let thedestinationobject = cvvname() let themappingoperation = rkmappingoperation(sourceobject: therepresentation, destinationobject: thedestinationobject, mapping: themapping)

android - fitsSystemWindows removes padding -

i have in layout: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/primary" android:paddingleft="32dp" android:paddingright="32dp" android:fitssystemwindows="true"> ... </relativelayout> but there no paddingleft or paddingright in app. when remove fitssystemwindows , padding comes back. why? how can keep fitssystemwindows , padding? fitssyatemwindows attribute overrides padding applied layout. so apply padding, should create 1 wrapper layout relativelayout , add fitssystemwindows attribute it, , padding child relativelayout . <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:lay

java - Multithreading in Titan throws exception -

i creating vertices in titan multiple threads. here's code trying connect titan, specifying schema , adding vertices. g = titanfactory.open("/conf/titan-cassandra.properties"); titanmanagement mgmt = g.getmanagementsystem(); final propertykey userid = mgmt.makepropertykey("userid").datatype(integer.class).make(); titangraphindex namei = mgmt.buildindex("userid",vertex.class).addkey(userid).unique().buildcompositeindex(); mgmt.setconsistency(namei, consistencymodifier.lock); mgmt.commit(); then i'm calling function add vertex multiple threads accessing function add vertex takes input parameter - randomly generated unique numbers (entitypk) tx1 = g.newtransaction(); vertex user_ver = tx1.addvertexwithlabel("user"); user_ver.setproperty("userid",entitypk); //adding other properties vertex tx1.commit();` i read exception thrown because of not specifying lock. after specifying lock, exception thrown. com.thinkaureli

mysql - Why InnoDB adds index for foreign key column -

mysql auto adding index when adding foreign key column in mysql innodb engine. primary key enough search rows, how affect performance adding index foreign key column. thanks in advance. mysql docs state reasoning behind here mysql requires indexes on foreign keys , referenced keys foreign key checks can fast , not require table scan. in referencing table, there must index foreign key columns listed first columns in same order. such index created on referencing table automatically if not exist. there many queries typically joins require rows match on basis of foreign keys , database has find rows. index typically helps faster.

sql server - Merge duplicate records and update its table -

can me problem sql query? i want merge/(sum if necessary) data of customer duplicate customer mame. in project, find out customer has been duplicated using code: select firstname, lastname, count(1) repeatedcount customer group firstname, lastname having count(1) > 1 how can update customer table 1 customer record , sum of totalsales , totavisits in 1 record only. sample data: firstname lastname totalsales totalvisits ---------- ---------- -------------- ----------- michelle go 0.00 0 michelle go 6975.00 1 michelle go 1195.00 1 michelle go 9145.00 3 michelle go 57785.00 5 michelle go 5845.00 1 michelle go 0.00 0 michelle go 0.00 0 expected output: firstname lastname totalsales tolalvisits ---------- ---------- -------------- ----------- michelle go 80945.00 11 you have use agg

Android SurfaceView: Show Video after Images -

i want play video after couple of images in same surfaceview. if show images after videos, works fine. if want play video after images, surfaceview stays blank (black). can help? seems problem of clearing or resetting surfaceview! the code of surfaceview (custom surfaceview!!!): public class mysurfaceview extends surfaceview implements surfaceholder.callback, mediaplayer.oncompletionlistener { private bitmap image; private mediaplayer mediaplayer; private list<mysurfacelistener> objectstocall = new arraylist<>(); public mysurfaceview(context context) { super(context); getholder().addcallback(this); } public void addonplayingfinishedlistener(mysurfacelistener listener) { objectstocall.add(listener); } public void notifyallonplayingfinishedlistener() { for(mysurfacelistener l : objectstocall) { l.onmediaplayfinished(); } } public static int calculateinsamplesize(bitmapfac

javascript - Build a form field to populate line in script? -

i have short script pulls information site called rpr. wondering if can build form " address " , have fill out " query " line automatically on next page? <script type="text/javascript"> var rpravmwidgetoptions = { token : "0596733f-54fc-4c23-89c8-8b021a6e486c", query : "278 s 23rd st, philadelphia, pa 19103", cobrandcode : "btsusspaces", showrprlinks : true } </script> <script type="text/javascript" src="//www.narrpr.com/widgets/avm-widget/widget.ashx/script"></script>

serial port - Python Auto-Start pyGSM Huawei -

i have python script uses pygsm library sending , receiving sms. however, wish put script on auto-run upon booting raspberry pi. connecting time of huawei modem takes while, hence causing shell script skip step. how make confirm connected perform python script? this not python-related question, try linux forum on boot sequence timeout

ssh - can find where git default username is set -

i have been using git command line long time. today tried installing git desktop, along way, there step says current git needs uninstalled. after which, seemed stuck personal git username. when git clone own repo in github, no username password needed. when git clone or git pull client's repo, complains can't find repos's url. i checked make sure no user.name or user.email exist in git config --global --list . set global user.name 1 needed client repo, still same result. ssh -vt git@github.com shows tries id_rsa , fails, ends permission denied (publickey) . checked, , id_rsa file not there. don't know right way set one. where can secret setting on macbook supplying default user.name during git command? ssh -vt git@github.com shows tries id_rsa, fails when git client shell, check $home refers to: ssh seek public/private keys in $home/.ssh . github desktop might use different path $home , or settings.

signals - Why spark executor receives SIGTERM? -

i using spark api (spark core api, not stream,sql etc.) see kind of error in spark dumped log: spark environment: 1.3.1 yarn-client error executor.coarsegrainedexecutorbackend: received signal 15: sigterm who triggers sigterm. yarn,spark or myself? will signal terminate spark executor? if not, wow affect spark program. i press ctrl+c, whould sigint. if yarn kill executor, sigkill. you find reason in yarn logs. if activated log aggregation, can type yarn logs -applicationid [app_id] and lookup exceptions.

java - Android Load Many Images Efficiently -

i have lot of png images contained in various drawable folders (drawable-xhdpi, drawable-mdpi, etc.) relatively small (at 10kb) @ 1 point need load 50 of them onto screen. when this, causes outofmemoryerror. ideally, able load these images calling setcontentview once (the content view has bunch of imageviews src attribute set corresponding images). that's i'm doing now, of course isn't working because of memory error. besides reducing size of images, there way prevent outofmemoryerror? avoid loading number of images @ once, instead can load them in gridview described here . use picasso gridview memory efficiency public view getview(int position, view convertview, viewgroup container) { imageview imageview; if (convertview == null) { // if it's not recycled, initialize attributes imageview = new imageview(mcontext); imageview.setscaletype(imageview.scaletype.center_crop); imageview.setlayoutparams(new gridview.layoutparams(

c++ - AVX segmentation fault on linux -

i trying run code , says segmentation fault when run it. compiles good. here code. (it works fine on windows). #include<iostream> #include<vector> #include<immintrin.h> const int size = 1000000; std::vector<float>a(size); std::vector<float>b(size); std::vector<float>c(size); void bar(int i){ const float = 2.0f; __m256 _a = _mm256_broadcast_ss(&a); __m256 _a = _mm256_load_ps(&a[0] + i*8); __m256 _b = _mm256_load_ps(&b[0] + i*8); __m256 _c = _mm256_add_ps(_b, _mm256_mul_ps(_a,_a)); _mm256_store_ps(&c[0] + i*8, _c); } int main(){ std::fill(a.begin(), a.end(), 1.0f); std::fill(b.begin(), b.end(), 2.0f); bar(0); return 0; } compiling: g++ -mavx t2.cpp -o t2 it's exiting when hit first avx instruction. want review code. here gdb trace (gdb) run program received signal sigsegv, segmentation fault. 0x0000000000400aea in bar(int) () missing separate debuginfos, use: debuginfo-inst

How to get time string to Time in oracle sql -

i have insert time in form of string in oracle varchar2 column. when try retrieve in form of time it's not giving me right time, it's giving me date have not saved. insert table1 (timestr) select substr(numtodsinterval(max(date1)-min(date2),'day'), 12,8) table2 ....; // stored timestr column value: 00:00:00 retrieve ... select to_date(timestr,'hh24:mi:ss') table1; ... giving 10/01/2015 you should use to_char see time select to_char(timestr,'hh24:mi:ss') table1;

spring jdbc - error code [17041]; Missing IN or OUT parameter at index:: 1; nested exception is java.sql.SQLException: Missing IN or OUT parameter at index:: 1 -

procedure parameters: procedure get_user_profile ( i_attuid in ras_user.attuid%type, i_data_group in data_group_tbl, o_user_info_tbl out user_info_tbl, o_service_tbl out service_tbl, o_user_role_tbl out user_role_tbl, o_permission_tbl out permission_tbl, o_work_group_tbl out work_group_tbl, o_business_domain_tbl out business_domain_tbl, o_skill_tbl out skill_tbl, retnum out number ) java code: jdbctemplate jdbctemplate = new jdbctemplate(datasource); jdbctemplate.setresultsmapcaseinsensitive(true); string procedurename = "{call get_user_profile(?,?,?,?,?,?,?,?,?,?)}"; simplejdbccall simplejdbccall = new simplejdbccall(jdbctemplate).withcatalogname("ras_user_profile_pkg").withprocedurename(procedurename).declareparameters( new sqlparameter("i_attuid", types.varchar), new sqlparameter("i_data_group", types.array), new sqloutparameter("o_user_info_tbl

Why is MongoDB preallocating so many data files at once? -

our mongodb sitting @ 1.2tb. have 2tb total disk space on server, , within 1 evening created few 2gb data files, using disk space , crashing process. when looked @ data files, noticed preallocates few of these files every couple of days, @ 1 point generating more 140gb of files. how can control this? if want control size of generated data files have following options available when starting mongod : --smallfiles decrease initial data files size , limit maximum of 512mb [--smallfiles manual reference] --quota , --quotafiles adjust maximum number of data files allowed per mongodb database [--quota manual reference]

javascript - Protractor-cucumberjs: browser.get() does not work -

when run cucumberjs protractor, error message, can me raise reason: c:\users\dave.le\appdata\roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108 var template = new error(this.message); ^ nosuchelementerror: unable locate element: {"method":"id","selector":"log"} documentation on error, please visit: http://seleniumhq.org/exceptions/no_such_element.html build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16' system info: host: 'davele-pc', ip: '192.168.1.16', os.name: 'windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_75' driver info: driver.version: unknown @ new bot.error (c:\users\dave.le\appdata\roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18) @ object.bot.response.checkresponse (c:\users\dave.

.htaccess - Is it feasible to use SSI (Combine CSS/JS files using htaccess) to speedup website? -

i went through article today http://isitvivid.com/blog/combining-your-cssjs-files-with-htaccess and found can use htaccess file combile css , js files , thing called server side includes. i usign gzip compression, keep alive feature , cache website. using ssi combine css/js speed website? i'm sure speed site little bit combining assets, unless you're loading hundreds of things synchronously shouldn't expect more micro optimization. you're more speed benefits using defer script tag attributes when loading script tags , minimizing css files.

cloudfoundry - Cloud Foundry `cf push` is slow: high CPU usage, disable resource matching -

for java application cf push takes long. uploading ${appname}... uploading app files from: ${path}.jar uploading 19.8m, 6584 files done uploading when pushing, first line shown minutes (with 100% cpu load). afterwards, actual upload starts (second line) , completed in second. with cf_trace=true see resource match request ( https://apidocs.cloudfoundry.org/220/resource_match/list_all_matching_resources.html ). request json string sent, containing hash sums of files in jar file. gathering information takes long in case, jar file contains many files. is there way disable resource match request? far see, used not upload files unchanged (already known cloudfoundry instance). uploading 20m of data takes second, though. i see when running jars contain lot of class files. cloud foundry not able cache small files , if uploading thousands of 3rd party class files it's wasteful. happens if use "shaded" jar. if repackage dependencies in jars, rather in flat di

apk - Android permission clean-up -

i know question has been answered here , while ago , since no answer has been given , might have changed, ask again: is there tool or ide plugin analyzes either source code or apk see if permissions being used anywhere in app. there lot of libraries, , large project not wise remove permission , running smoke test on app since used @ subtle places. for example, not know why have permission read_sms , if remove since there no obvious use of it, later cause crash. lint check missing permissions can see on lint checks . so, go androidmanifest.xml , remove tags <uses-permission> using android permissions (meaning, don't delete permissions belong app, such ua_data , c2d_message ). then run lint analysis. click on analyze inspect code... look under android -> constant , resource type mismatches you should see missing permissions. then can right-click them , select apply fix "add permission" . if select option, android studio include 1 per

python 2.7 - How to move current element to next position -

intention infinitely cycle through list, this: l=[1,2,3,4,5] after first loop l=[5,1,2,3,4] after second loop l=[4,5,1,2,3] and on, without using double ended queue, itertool use simple list you can using this: l = l[-1:] + l[0:-1] so after first iteration [5, 1, 2, 3, 4], after second [4, 5, 1, 2, 3]

asp.net mvc - Converting date format to -

hi guys/girls im super new asp.net mvc , im trying convert date readable format. looks this. /date(1444892163827)/ my model public class movie { internal string title; internal datetime releasedate; internal string genre; public int id { get; set; } [required] public string title { get; set; } public datetime releasedate { get; set; } [required] public string genre { get; set; } } public class moviedbcontext : dbcontext { public dbset<movie> movies { get; set; } } my controller public jsonresult getall() { using (moviedbcontext datacontext = new moviedbcontext()) { var movielist = datacontext.movies.tolist(); return json(movielist, jsonrequestbehavior.allowget); } } public jsonresult getmoviebyno(string movno) { using (moviedbcontext datacontext = new

jquery - How to show link in autocomplete -

i want show link autocomplete code $("#search-header").autocomplete({ source: function (request, response) { $.ajax({ url: "search", datatype: "json", data: { name: request.term, maxrows: 12 }, success: function (data) { response($.map(data.atomlist, function (item) { console.log(item); return { label: "<a href=" + item.id + ">" + item.name + "</a>", value: item.id } })); }, error: function (data) { ale

php - Call stored procedure postgresql -

how possible call stored procedure in postgres php? i'm trying don't work $result= pg_query($conect, select name_function()); $result= pg_query($conect, "select name_function();"); you need pass string query..

javascript - Tab content won't show on tab click -

i have tabs, won't show it's content when click tab button. home tab seems work, though content supposed hidden until clicked on. other tabs not working still. using google chrome. document.getelementbyid("home").style.display = "inline"; var tablinks = new array(); var contentdivs = new array(); function init() { var tablistitems = document.getelementbyid('tabs').childnodes; (var = 0; < tablistitems.length; i++) { if (tablistitems[i].nodename == "li") { var tablink = getfirstchildwithtagname(tablistitems[i], 'a'); var id = gethash(tablink.getattribute('href')); tablinks[id] = tablink; contentdivs[id] = document.getelementbyid(id); } } var = 0; (var id in tablinks) { tablinks[id].onclick = showtab(); tablinks[id].onfocus = function() { this.blur() }; if (i == 0) tablinks[id].classname = 'selected'; i++; }