Posts

Showing posts from September, 2010

ms access - timestamp column doesn't update in sql server -

i moved access database backend sql server , still using access frontend. getting overwrite errors when entering records. found solution (thank you) add timestamp (rowversion) column table did. however, timestamp column not populate new records nor did update on existing records. appreciated. the timestamp field sql server's use only. access neither reads or writes it, odbc driver does. sole purpose odbc driver see, before updating record, if has changed on server since last reading driver. if hasn't, update safe - if has, record re-read , update cancelled.

sql server 2008 - Change x-axis legend font size in ssrs 2005 -

Image
i m using ssrs 2005 develop reports. failed change x-axis legends font size. it have been showing default font size. you can change font size of either x-axis or y-axis, clicking on style properties button next show labels section. you can select font size , other attributes here....

java - Connect bluetooth from android to computer(paired devices) -

so, want application connect pc , use android touch pad. iv been doing lot of research on net, didn't find anywhere how connect phone pc. made pair device function , else, need connection method, or @ least how done. here code: public class mainactivity extends activity { private bluetoothadapter adapter; private intent turnon; private set<bluetoothdevice> paireddevices; private listview lv; private button on,off,paireddevice,discoverable,neardevices; private list<bluetoothdevice> discovereddevices = new arraylist<bluetoothdevice>(); private handler mhandler; private static final uuid my_uuid = uuid.fromstring("04c6093b-0000-1000-8000-00805f9b34fb"); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); initialize(); buttonfunc(); find(); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if

javascript - Should I return a method call like console.log()? -

good day everyone. haven't found research or articles regarding this. maybe using wrong search terms. question lets example writing small utility library in javascript myself , want include 2 small functions out(arg) , outln(arg) . question should call console.log() or return console.log() . i've seen done both ways never saw reason return method call. wondering way better or make difference @ all? ex. // way: var lib = { out: function(args){ console.log(args); }, outln: function(args){ console.log(args + "\n"); } }; // or way? var lib = { out: function(args){ return console.log(args); }, outln: function(args){ return console.log(args + "\n"); } }; do have use return value console.log (which undefined anyway iirc ) ? might plan override log or create own console object, though (not recommended). more important, check presence of console object , log method, user age

php - COM('word.document') open in read only whilst file is opened by other -

i'm using php , try fiddle around com objects read word files. getting litereally finding documentation. what want open file in read dont "file in use" popup on host computer. how tell word via com open file read only? trying use variants following error: parameter 0: type mismatch. #0 c:\xampp\htdocs\test.php(17): variant->open('\\remote\test\test.doc', false, true, false, object(variant), object(variant), object(variant), object(variant), object(variant), object(variant), object(variant), true, true, object(variant), object(variant), true) #1 {main} this code use $word = new com("word.application") or die("unable instantiate application object"); $worddocument = new com("word.document") or die("unable instantiate document object"); $missing = new variant(); $word->visible = 0; $documentpath = "\\remote\test\test\alamo.doc"; $htmlpath = ""; try { $worddocument = $word->documents

linked list - Per-node memory overhead -

i learning pros , cons of using stacks linked lists, when found cons say: " memory cost each node can more databin stored. ex 32 bit value such integer can memory overhead 7 times larger integer itself." what mean? when use general memory allocator don't know how big block allocates on each request. many of them round requested size quantity each block aligned address divisible, say, 8 or 16, or 32. in case always use @ least 32 bytes, if request 1 byte. 32 bytes of heap 4-byte piece of data, 8 times need, overhead equal 7. edit often allocator adds 'header' before block returns , header size allocation size step. header 16 bytes long requested allocation size rounded nearest 16 multiply , incremented 16 header. requested size 1 through 16 use 32 bytes, 17—32 use 48, 33—48 it's 64 , on.

CodePro Analytix: Where to find the plugin now the link http://dl.google.com/eclipse/inst/codepro/latest/3.6 is not working -

i need set codepro analytix plugin . link http://dl.google.com/eclipse/inst/codepro/latest/3.6 not opening. please me out. there other way install codepro analytix or there other tools same functionality. also if 1 downloaded codepro analytix please share. email: chanduram7@gmail.com that eclipse update site, can't open in web browser. instead install eclipse opening 'help > install new software...'. in 'work with:' field enter update site url example https://dl.google.com/eclipse/inst/codepro/latest/3.7 still works eclipse oxygen. eclipse show can installed update site. note: code not appear have been updated while.

javascript - JQuery - Why is JQuery animation simultaneous? -

<!doctype html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("#a").hide(1000); $("#b").hide(1000); $("#c").hide(1000); }); </script> </head> <body> <p id="a">paragraph 1</p> <p id="b">paragraph 2</p> <p id="c">paragraph 3</p> </body> </html> javascript single threaded, think functions executed 1 one. in sample above, seems 3 paragraphs start hide animation simultaneously , ended @ same time, if there 3 threads each running 1 distinct animation. why animations not run 1 one ? there not simultaneous. starting animation not block execution of code. start 1 after others run "almost" simultaneously. jquery animations in fact similar setinterval, update opacity each x milliseconds. b

iphone - is there a way to sort an array by category on ios -

how can create custom sort order on app? suppose have company , workers divided positions inside factory , wanna see performance of workers on specific position. could, on core data, predicate result wanna, @ same time, see more 1 positions, constructor, driver, engineer, etc. how can order fetch request result should of constructors first, drivers , @ end of of engineers? thanks in advance , hope explained want. just create nssortdescriptor position when fetch coredata. nssortdescriptor *sortdescriptor = [nssortdescriptor sortdescriptorwithkey:@"position" ascending:yes]; [fetchrequest setsortdescriptors:@[sortdescriptor]]; that go positions alphabetically... if don't want done alphabetically implement new attribute nsnumber keep track of sort order want , fetch based upon that. this post seems talk bit example. however, if order going different @ times, might better off holding nsmutablearray total list, , performing individual fetches each position

RPM spec missing uninstall section? -

i see no uninstall section in rpm spec documentation. see preun , postun. is there uninstall phase? what happens during uninstall phase? basing on %files section, list of files removed? , that's it? correct. the %install section of rpm spec file not run on rpm package installation (the name misleading in sense). %install section run during package creation install files need packaged such rpmbuild process can package them up. as such, because %files section lists files , directories package contains uninstallation process rpm removal of packaged files. if additional work needs done before or after files removed %preun , %postun scriptlets available in spec file work.

how to link from one module to another using DXL in DOORs? -

i have link 2 modules: ex: have information in module 'a' , information in module 'b' similar module 'a' , module 'c' has same information. linking present between 'a' 'b' , 'b' 'c'. target link 'c' 'a'. creating link doors object resides in different module not differ creating link objects of same module. have retrieve object handle module. consider this: object sourceobj = ... // have object handle object targetobj = null const string targetmodulename = "/my/doors/module" // open module module mod = edit(targetmodulename, true, false) if (null(mod)) ack("error!") // depends on how can identify target object targetobj in mod { // example: if object identifier matches ... if (... == identifier(targetobj)) { sourceobj -> targetobj break } } additionally, have @ this question steve explains scenario well.

How to wait for result of speech recognition in android? -

i using recognition listener speech recognition in android. basic construct of class follows: class speechinput implements recognitionlistener { intent intent; speechrecognizer sr; boolean stop; public void init() { sr = speechrecognizer.createspeechrecognizer(context); sr.setrecognitionlistener(this); intent = new intent(recognizerintent.action_recognize_speech); intent.putextra(recognizerintent.extra_language_model,recognizerintent.language_model_free_form); intent.putextra(recognizerintent.extra_calling_package,context.getpackagename()); intent.putextra(recognizerintent.extra_max_results,3); } ... } i stuck in situation want run android recognition listener in loop, on lines of: for(int i=0; i<n; i++) { // processing code sr.startlistening(intent); } now, want wait output before starts listening again. in order achieve this, tried use locking mechanism follows: for(int i=0; i&l

listview - customize android.R.layout.simple_list_item_checked -

Image
i want change drawable of predefined checked in android.r.layout.simple_list_item_checked possible? from checked and unchecked to checked and unchecked and don't want create custom list item. this possible using custom layout standard adapter, can defining same ids predefined layout custom layout changing ones want. unfortunately in case, source code android.r.layout.simple_list_item_checked doesn't have drawable default. ( https://github.com/android/platform_frameworks_base/blob/master/core/res/res/layout/simple_list_item_checked.xml ) uses checkmark attribute android:checkmark="?android:attr/textcheckmark" i'm unsure whether can change this, still reccomend using custom layout standard adapter, compare original current layout , define same attributes drawable instead of checkmark, in example below: it's though. <checkbox android:layout_width="wrap_content" android:layout_height="wrap_content" a

excel - Call 'Large' ref, grab value from column in referenced row -

let's have few columns, 5 example. multiple rows. each individual row, on column , b, have 2 strings reference. columns c , d add column e, totals 2 values. what i'm looking reference largest values in chart, pull number, , return 2 strings in columns , b. i know can pull largest number in range x,y in col e =large(ex:ey,1), how 1 reference row number represents? let's reference 2 strings in sixth row alpha , bravo , , sixth row contains largest value ( 26 example) want pull. i'm looking way output 26 alpha bravo , if that's possible. i'm making list going largest smallest, i'm looking way incorporate large in there - looking pick 10 largest values , respective strings. any thoughts? i'm looking way output 26 alpha bravo, if that's possible. please try: =max(e:e)&" "&index(a:a,match(max(e:e),e:e,0))&" "&index(b:b,match(max(e:e),e:e,0))

sphinx - What is instead max_matches? -

i have sphinx 2.2.7. in version, "max_matches" deprecated. use instead? a result of query has in average 20000 rows. its server wide 'cap' being deprecated. it still exists query time parameter. defaults 1000, can overridden on per query basis.

Should i use an SSL Certificate to protect information entered in a PHP form? -

i developing php form collects personal information user. information not kept in database, sent , email address. need on https connection? if please explain why or provide link can obtain knowledge of this. how can hackers access information if not kept online or stored in data base? i if information not sensitive, don't have go ssl certificate. for example, if collecting user's firstname, lastname, email address, , message don't have use ssl. however, if collecting sensitive data ssn, bank account number, routing number, credit card numbers etc, highly recommended use ssl.

Eclipse: How to get the MenuManager for a specific menu id defined in plugin.xml -

i have standalone eclipse rcp application. main interaction happens through main toolbar. here relevant snippet plugin.xml: <extension point="org.eclipse.ui.menus"> <menucontribution allpopups="false" locationuri="toolbar:org.eclipse.ui.main.toolbar"> <toolbar id="my.toolbar.id"> ... <command commandid="my.command.id" id="my.connect.id" label="connect" style="pulldown"> </command> ... </toolbar> </menucontribution> <menucontribution allpopups="false" locationuri="menu:my.connect.id"> </menucontribution> i populate pulldown menu my.connect.id when shown, can hold different items every time opened. can done using menumanager id , add imenulistener . how obtain instance of

java - servicemix 4.5 NoInitialContextException -

we have osgi application worked on servicemix 5. reasons must migrate servicemix 4.5. tried , got this error parsing sql mapper configuration. cause: org.apache.ibatis.builder.builderexception: error parsing sql mapperconfiguration. cause: org.apache.ibatis.datasource.datasourceexception: there error configuring jndidatasourcetransactionpool. cause: javax.naming.noinitialcontextexception: need specify class name in environment or system property, or applet parameter, or in application resource file: java.naming.factory.initial what need? install aries jndi feature? features:install jndi

xml - Java config storage choice -

first of all, i'm new here writer, not reader. used stackoverflow years find lot of useful information, decided join community. now question java config storage choice. the application currently i'm working on java (fx) project myself. java application used on few desktop machines. goal of application power on/off linux devices on ssh (for example server). i want make possible user add 5/10 devices information of device (name , ip), ssh credentials power on command , ssh credentials power off command (user, host, key, port, timeout, command). there javafx gui, gui have menu bar menu called devices select, add, edit or delete device. in center of gui there 2 buttons, used power on/off commands (or switch). design the programming language java. the gui based on javafx. for power on/off commands use command design pattern. storage i tried different storage options (sqlite, properties , xml) storing information of devices. didnt found out option fits best

javascript - How to get value from ajax php (can't get) -

page 1 : index.php script ajax <script> function fcall(clusters) { var clusters = document.getelementbyid("clusters").value; var request = $.ajax({ type: "get", url: "chart.php", data: {clusters: clusters} }); request.done( function( msg ) { $("#page").html(msg); }); } </script> script php $sql = mysql_query("select * tree_hie group no_cluster asc") or die(mysql_error()); while ($data1=mysql_fetch_array($sql)) { $clusters = $data1['no_cluster']; $sql2 = mysql_query("select * tree_hie no_cluster = '$clusters'") or die(mysql_error()); while ($data2 = mysql_fetch_array($sql2)) { <input type="button" id="clusters" name="clusters" onclick="fcall(<?php $data1['no_cluster']; ?>);" value="<?php ech

ruby on rails - Devise CustomFailure and mount in routes, bad redirect -

i'm using customfailure class shown in doc ( here ) redirect our sign in page when unauthenticated: class customfailure < devise::failureapp include localization def redirect_url url_for(controller: "/public/sessions", action: :new, locale: locale_to_params(i18n.locale)) end # need override respond eliminate recall def respond if http_auth? http_auth else redirect end end end so redirects http://www.acmecorp.com/en/signin , sidekiq panel in routes.rb : authenticate :user, lambda { |u| u.super_admin? } require "sidekiq/web" mount sidekiq::web => "/sidekiq" end i redirected http://www.acmecorp.com/sidekiq/en/signin instead of http://www.acmecorp.com/en/signin . reason why redirect not rid of /sidekiq part? thanks!

android - Apktool build fails due to Translation error -

Image
i took apk file decompiled using apktool , made few changes tried recompiled , got error. aapt: warning: string 'auth_client_needs_enabling_title' has no default translation in c:\users\dell\android-sdks\platform-tools\magesimi\simicart_com.magestore.simicart_2.0_5\res; found: af ar bg ca cs da de el en_gb en_in es es_us et_ee fa fi fr fr_ca hi hr hu hy_am in iw ja ka_ge km_kh ko lo_la lt lv mn_mn ms_my nb nl pl pt pt_br pt_pt ro ru sk sl sr sv sw th tl tr uk vi zh_cn zh_hk zh_tw zu aapt: warning: string 'auth_client_needs_installation_title' has no default translation in c:\users\dell\android-sdks\platform-tools\magesimi\simicart_com.magestore.simicart_2.0_5\res; found: af ar bg ca cs da de el en_gb en_in es es_us et_ee fa fi fr fr_ca hi hr hu hy_am in iw ja ka_ge km_kh ko lo_la lt lv mn_mn ms_my nb nl pl pt pt_br pt_pt ro ru sk sl sr sv sw th tl tr uk vi zh_cn zh_hk zh_tw zu aapt: warning: string 'auth_client_needs_update_title' has no default translat

php - How to add an editable accordion in WordPress -

i trying add accordion page in wordpress. the issue being, need accordion editable cms, , if possible, user add accordion on different posts. i have looked it, , found advanced custom fields repeater might way go, yet find read on how implement this. any great. i use advanced custom fields repeater similar, , give users ability enter content can repeated. valuable because can wrap each part in html , whole thing can wrapped, let accordion. here repeater code, mine events. if (get_field('monthly_events')){ $events = get_field('monthly_events'); foreach($events $event) { ?> <li> <strong><?php echo $event['event_name']; ?></strong> <p><?php echo $event['event_description']; ?></p> </li> <?php } } you should read instructions. have create , name fields using interface, apply new post type, , put accordion html

git - Ansible SSH private key in source control? -

i have been developing ansible playbook couple of weeks, therefore, experience such technology relatively short. part of strategy includes using custom ansible_ssh_user provisioning hosts throughout inventory, however, such user need own ssh key pair, involve sort of plan holding/storing correspondent private key. on production environment, playbook cloned/pulled , run inside playbook node role provision rest of infrastructure. at first, thinking put private key inside playbook git repository, having second thoughts nonetheless, because of obvious security reasons , common sense around it, hence reason need consult matter. with set on table, here follow-up questions: in ansible-based development environment, sane/reasonable hold private ssh key in source control? would practice advised only development environments whereas local git branch inside playbook node used hold actual production ssh private key? would better address case scenario via ansible vault instead?, ha

c# - Want to Create a Common WebAPI Login That Many Sites Will Use -

we need create simple site authentication/authorization. use latest oauth , owin , microsoft identity. assuming webapi way go new , mvc in general let me know if better way out there. i have created simple login service web api has account controller. here login action use: [allowanonymous] public actionresult login(string returnurl) { viewbag.returnurl = returnurl; return view(); } and here simple client web app call login service app . public async task<actionresult> index() { var client = new httpclient(); var response = await client.getasync("http://localhost:19604/account/login"); string thing = await response.content.readasstringasync(); return content(thing); } this returns me view wanting email , password , remember me , such. however, buttons not work. when click login button 404 on /account/login . suspect because webapi controller no longer hooked , client side not have account controller. is return content(thing);

javascript - JS not recoganizing Japanese charecters -

i putting japanese text in div @ run time these characters shown boxes , triangles .. here head portion of html page <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1.0"> and here how putting text in div if (getqscomponent(qskeys.langid) == 1) { $('#title').text("情報"); $('#message').text("プロセスが正常に完了しました。"); } <script charset="euc-jp" src="jp.js"></script> or <script charset="euc-jp"> if (getqscomponent(qskeys.langid) == 1) { $('#title').text("情報"); $('#message').text("プロセスが正常に完了しました。"); } </script> -- in tag <meta> , : <meta http-equiv="content-type" content="text/html; charset=utf-8">

ios - Swift : Checking if 2 NSDates are the same -

really simple one, sure bug in swift. trying check if 2 nsdates same. statement never passes thought printout below println("\(statistics.startdate) \(healthobject.date)") if healthobject.date.isequaltodate(statistics.startdate) { healthobject.flights = int(quantity.doublevalueforunit(hkunit.countunit())) println(int(quantity.doublevalueforunit(hkunit.countunit()))) } 2015-03-30 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-30 13:56:50 +0000 2015-03-31 13:56:50 +0000 2015-03-31 13:56:50 +0000 solution pointed out 1 awesome people replied, dates same until sub second level. odd part is, these values coming healthkit what works me in ios8 is: if let dif = calender?.comparedate(statistics.startdate, todate: healthobject.date, tounitgranularity: nscalendarunit.secondcalendarunit) { println(int(quantity.doublevalueforunit(hkunit.countunit()))) p

hashmap - Intersection of a Set with a twist Java -

so got following question in technical interview , thought pretty interesting. given 2 arrays: = {1,2,2,4,5} , b = {1,2,6,} write code performs following 2 operations: a-b {2,4,5} , b-a {6}. meaning, find common element in other array , remove original. if b {1,2}, b-a {} since contains elements of b , b has no unique elements. i solved question in following way, , hoping see if had suggestions on how possibly make better. public static void main(string args[]) { map hashtable = new hashmap(); int a[] = {1,1,2,4,5,6,6}; int b[] = {1,2,6}; arraylist ba = new arraylist(); arraylist ab = new arraylist(); int[] occurances = new int[a.length]; //int occurances = 0; (int = 0; < a.length; i++) { occurances[a[i]]++; hashtable.put(a[i], occurances[a[i]]); } //system.out.println(arrays.tostring(occurances)); system.out.println(hashtable); //find ba (int = 0; < b.length; i++) { if(hashtable.containskey(b[i])) { occurances[b[i]]--; hashtable.put(b[i]

properties - How to ignore property using graphdiff? -

i'm using ef6 graphdiff , edmx , must ignore property of particular entity. how should since getting property insert or update leave null field? the way able work around while still benefiting ease of graphdiff follows: set object equal graphdiff method set each property wish ignore .ismodified = false (example) user = db.updategraph(user, map => map .associatedcollection(u => u.userroles) .associatedcollection(u => u.teams)); db.entry(user).property(u => u.password).ismodified = false; db.entry(user).property(u => u.salt).ismodified = false; _context.savechanges();

PHP email script not sending emails -

this question has answer here: php mail function doesn't complete sending of e-mail 24 answers this php email script want use website. creating website father's company, , decided make bootstrap. html , css knowledge required still do, beyond knowledge. somewhere on internet dug script , doesn't work me. sure there logical reason this, have no knowledge whatsoever of php-scripting... hoping newbie out. willing learn, study php simple script(i not planning more web "development") seems bit overexaggerating. anyway, rambling on much. here script found(i've called it: sendemail.php): <?php 'success', 'message'=>'thank contacting us. possible shall in touch ' ); $name = @trim(stripslashes($_post['name'])); $email = @trim(stripslashes($_post['email'])); $subject = @trim(stripslashes($_p

How to read gradle file properties from Android app programatically -

the build.gradle file has following section. how read android.defaultconfig.versioncode android app mainactivity android { defaultconfig { applicationid "com.gatta.e.gatta" minsdkversion 11 targetsdkversion 21 versioncode 1 versionname "1.0" } } you don't have read gradle file obtain version code. here direct way within activity: private packageinfo getpackageinfo() { packageinfo pi = null; try { pi = this.getpackagemanager().getpackageinfo( this.getpackagename(), packagemanager.get_activities); } catch (packagemanager.namenotfoundexception e) { e.printstacktrace(); log.e("yourtaghere", e.getmessage()); } return pi; } and use in oncreate(...) method example obtain version code: string versioncode = "" + getpackageinfo().versioncode; more info on packageinfo class here . , quick description of class:

c# - How to get object json when deserializing array -

i have incoming json, consists array of objects, say, foo . deserialize them with result = jsonconvert.deserializeobject<list<foo>>(message); now want add string property foo, store it's json (which received), foo'll like: public class foo { public int myint { get; set; } public bool mybool { get; set; } public string json { get; set; } } but don't know how can json.net way can populate such field.. upd i'll clearify want. receive json: [{"myint":1,"mybool":0},{"myint":2,"mybool":0},{"myint":3,"mybool":1}] here array of 3 objects , want, when deserializing, add corresponding part of json object, that: first object contain {"myint":1,"mybool":0} second object contain {"myint":2,"mybool":0} third object contain {"myint":3,"mybool":1} in json property i'll gratefull help! this 1 way it

performance - Should I replace Android Activities by Fragments? -

i have large android game in there activity each logical screen. (splash screen, start screen, level chooser, game screen , settings distinct activities). working fine right now. if rewrite there 1 activity , logical screens fragments, reduce ram or cpu consumption? after years (two+) of saying "fragments way go", never replace activities fragments again. using fragments rehuse components fine. using fragments dialogs fine, have realized how awful fragment implementation is, how awful fragment lifecycle , how unpredictable (and buggy) fragmentmanager tends under circumstances. go ahead spend time googling around , find "edge not edge" cases hacks have implemented work around "by design" buggy behavior. sometimes have extend or copy source code of these classes android source code modify private or protected field… don't me wrong, fragments work. not solution problems (they possibly source of new ones in mid-long term). if have act

unix - Testing slob.c using malloc() -

i have altered slob.c gathers stats on last 100 small list allocations. made necessary edits make sure slob being used. i running test program calls malloc() 10,000 or 100,000 times on size of 20 bytes. but slob test results after test program runs states average claimed size 140 bytes (when expecting @ least somewhere near 20 bytes). what doing wrong, there way accurately test slob? i pretty sure stat collecting accurate, have had few professors check out me. current test program: int main() { char * ; int ; for( = 0; < 1000000; i++) { = (char*) malloc(20*sizeof(char)) ; if(a == null) printf("null\n") ; } //here print system call resulting stats memory claimed , free memory my original answer correct: char * ; int ; for( = 0; < 10000; i++) { = (char*) malloc(20*sizeof(char)) ; if(a == null) printf("null\n") ; } this simple code can used test how altered slob file allocates memory (co

how to find a table with a certain row id, add a class to the row and call button click using jquery -

i have table rows. each rows has id assigned e.g. , cell containing button. <tr id="69"> columns data <td><input type="submit" name="select" /></td></tr> <tr id="68"> columns data <td><input type="submit" name="select" /></td></tr> <tr id="72"> columns data <td><input type="submit" name="select" /></td> </tr> using jquery how can find row id '68' , add class hightlight , fire click event of select button present inside row i m trying on these lines $('#templatesite tr').find('#'+data.siteid).addclass('highlight'); where data.siteid value 68 any ideas? you looking tr child id of id. try: $('#templatesite tr#'+data.siteid + " td").addclass('highlight'); $('#templatesite tr#'+data.siteid).find("input[type='su

javascript - Downloading file from ajax result using blob -

i use code download excel file server. $.ajax({ headers: client.authorize(), url: '/server/url', type: 'post', contenttype: "application/json; charset=utf-8", data: json.stringify(jsondata), success: function (data) { alert('data size: ' + data.length); var blob = new blob([data], { type: "application/vnd.ms-excel" }); alert('blob size: ' + data.length); var url = window.url || window.webkiturl; var downloadurl = url.createobjecturl(blob); document.location = downloadurl; }, }); the problem experience though data , blob sizes identical, moment document.location gets assigned i'm prompted download almoste 2 times larger excel file. , when try open it, excel complains wrong file format , opened file contains lot of garbage, though required text still there. any ideas causing , how avoid it? so solved problem using ajax 2. natively supports

java - view and viewgroup android -

i know java basics , learning android development now. have learnt there 2 central android classes ui,view , viewgroup. want correct me wherever wrong. viewgroup subclass of view,and holds view objects together.textview,edittext etc subclasses of view , linearlayout,gridview etc subclasses of viewgroup. want relate oop concept of java dont seem this. objects?how come subclass container? i'll give basic overview here. i'm pretty new android, correct-me-if-i'm-wrong thing goes me too. :) a view unit of ui; like, say, box of 24x24 pixels (yes, basic). box can used anything, because top-most entity in hierarchy. can define more precisely specifying want hold, textview, imageview, webview, etc. come in. box 24x24 may hold text, image or web-page content, respectively. a viewgroup can belong in 'etc.' above. showing text, 24x24 box can used display 4 boxes 12x12. if so, view can classified viewgroup. further, when know type of arrangement require box ho

shell - How I can Copy file by command line in android? -

i want copy file data/data/mypackage /mnt/sdcard when apply command line nothing happened. mobile rooted , have permeation make command.i have array list , put command inside array after command " getcommandstoexecute() " method , apply command: public final boolean execute() { boolean retval = false; try { arraylist<string> commands = getcommandstoexecute(); if (null != commands && commands.size() > 0) { process suprocess = runtime.getruntime().exec("su"); dataoutputstream os = new dataoutputstream( suprocess.getoutputstream()); // execute commands require root access (string currcommand : commands) { os.writebytes(currcommand + "\n"); os.flush(); } os.writebytes("exit\n"); os.flush();

interface - C++ compile-time un-implmented check -

we have several c++ functions implemented in phase 2 of our project part of public interface or respective classes , modules. because part of public interface, think should present, @ least in headers, during phase 1 still thinking them implement rest of classes. however, since unimplemented, want no 1 call them. check occur @ compile time, ensure correctness. my desires are: compile time (could error or warning; warnings better because more flexible - can selectively turn them off) works on g++4.8.1 , doesn't kill build under visual studio 2013 (we use visual studio/visualassistx editor refactoring tools don't work without building) not hard understand done , why functions present in class documentation (we can include \warning not implemented in phase 1 notation doxygen pick up) i considering 3 options: a belt , suspenders approach of marking them deprecated (which generate warning) , throwing custom exception - want except compiler warning "deprecate

How to merge/compare several tables by complex terms in R -

i tried compare 2 tables 2 terms. code in r: cbr <- c("usd", "eur", "sek", "rur") value <- c(2, 4, 5, 9) data <- data.frame(cur = cbr, rate = value) deals1 <- c("usd", "usd", "usd", "eur", "sek", "eur", "rur", "sek") deals2 <- c("rur", "rur", "eur", "rur", "rur", "usd", "usd", "rur") day <- 1:8 dealsn <- data.frame(day = day, cur_1 = deals1, cur_2 = deals2) (i in 1:nrow(dealsn)) { (j in 1:nrow(data)) { if (dealsn$cur_1[i] == data$cur[j] & dealsn$cur_2[i] == "rur") { dealsn$data[i] <- data$rate[data$cur[j]] } else if (dealsn$cur_1[i] == data$cur[j] & dealsn$cur_2[i] != "rur") { dealsn$data[i] <- data$rate[data$cur[dealsn$cur_2[i]]] /data$rate[data$cur[j]] }

javascript - Change amchart bullet placement using inputs -

say have amchart linewithscrollandzoom graph. want allow user change bullet point location on y-axis letting them click bullet point, can use dropdown input or other input form allow them change y-axis value. bullet point , corresponding lines change based on bullet point moved. is possible?

c# - Asp.net ViewModel and Controller MVC inheritance -

being new mvc, i'm attempting edit pre-existing application following structure: public actionresult create() { return edit(new book()); } the edit method uses editview viewmodel. needed reference id i've added id viewmodel, works great editing books, throws exception when creating books of course no id exists model @ point. what i've done is: copy properties editview createview viewmodel, , have editview extend createview as: public class editview : createview { public guid id { get; set; } } i replace reference edit method above return create(new book()); and code create method per edit method without reference id property, works looks ugly due lots of duplicated code - have long edit , create methods in controller identical bar id property: private actionresult edit(book book) { .... return view("edit", new editview { id = book.id, (rest of object initializ

python - Ajax, Rest, Flask, SQLAlchemy, JSON : create data -

i have problem when want add new data in file json , in sqlalchemy database. my form add new data : <form id="form" name="formquestions" style="text-align:center;" method="post"> <p> <h3>title </h3> <input type="text" id="title" required> </p> <p> <h3>answer 1 </h3> <input type="text" required> </p> <p> <h3>answer 2 </h3> <input type="text" required> </p> <p> <input id="buttonquestion" class="btn-success btn" type="submit" value=" create question " /> </p> </form> my request ajax : $(function() { $('#form').submit(function(event){ event.preventdefault(); var title = $('#title').val(); var answer1=$('#firstalternative&

c# - LINQ to XML file not saving correctly -

i have method removes sync times older 10 sec's old , adds new 1 when fired: public void addsynctime() { //delete archived sync times xmldocobject.descendants("lastsync") .where(e => convert.todatetime(e.element("time").value) < datetime.now.addseconds(-10)) .where(e => e.element("id").value != "1") .remove(); string t1 = xmldocobject.tostring(); //get last primary key added var lastprimarykey = (from in xmldocobject.element("dataloadtimes").elements("lastsync").elements("id") select i).lastordefault().value; //increment once int newprimarykey = convert.toint32(lastprimarykey) + 1; //create element insert var newelement = new xelement("lastsync", new xelement("id", newprimarykey), new xelement("time"