Posts

Showing posts from June, 2015

eclipse - Android SDK Issues Ubuntu 10.04lts -

eclipse - Android SDK Issues Ubuntu 10.04lts - i have looked through other questions on here, , on other forums. answers didn't help issue. started out 11.10 thought there bug or stopping working. have had sdk , adt working eclipse on both 10.04 , 11.10 @ loss going wrong. the error follows: cannot finish install because 1 or more required items not found. software beingness installed: android traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534) missing requirement: android traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.ui 3.6.2' not found when ran sdk install sec time (after uninstalling it) noticed next error: stopping adb server failed (code -1). unable run 'adb': cannot run programme "/home/ben/android-sdk-linux/platform-tools/adb": java.io.ioexception: error=2, no such file o...

playframework - How can I use a compound key with the Play framework? -

playframework - How can I use a compound key with the Play framework? - i have tried follow instructions here http://docs.oracle.com/cd/b31017_01/web.1013/b28221/cmp30cfg001.htm along using generic model. end primary key class follows import javax.persistence.embeddable; import java.io.serializable; @embeddable public class dailypk implements serializable { private int match_id; private int user_id; public int getuser_id() { homecoming user_id; } public void setuser_id(int user_id) { this.user_id = user_id; } public int getmatch_id() { homecoming match_id; } public void setmatch_id(int match_id) { this.match_id = match_id; } public int hashcode() { homecoming match_id * 1000000 + user_id; } public boolean equals(object obj) { if (obj == this) homecoming true; if (!(obj instanceof dailypk)) homecoming false; if (obj == null) homecoming false; ...

internet explorer - jquery position() not working in IE9 -

internet explorer - jquery position() not working in IE9 - has else had problem position() working odd in ie? i'm trying homecoming left position of div centrally placed. chrome returns 342, right. ie9 returns 0.5. what's about? var sp = $('.jcarousel-container').position(); alert(sp.left) it seems .offset() work in ie9 in jsfiddle example: http://jsfiddle.net/fme6v/7/ here's code: var sp = $('.jcarousel-container').offset(); alert(sp.left) jquery internet-explorer internet-explorer-9 position

ios - Is there a way to access the files of application cache of safari using javascript? -

ios - Is there a way to access the files of application cache of safari using javascript? - i looked @ options access files cached in browser, not one. thing ended counting number of files beingness cached listening caching events. here code: var cachestatusvalues = []; cachestatusvalues[0] = 'uncached'; cachestatusvalues[1] = 'idle'; cachestatusvalues[2] = 'checking'; cachestatusvalues[3] = 'downloading'; cachestatusvalues[4] = 'updateready'; cachestatusvalues[5] = 'obsolete'; var cache = window.applicationcache; cache.addeventlistener('cached', logevent, false); cache.addeventlistener('checking', logevent, false); cache.addeventlistener('downloading', logevent, false); cache.addeventlistener('error', logevent, false); cache.addeventlistener('noupdate', logevent, false); cache.addeventlistener('obsolete', logevent, false); cache.addeventlistener('progress', logevent, fals...

EditText in dialog android -

EditText in dialog android - i have made edittext in dialog cant alter height. alertdialog.builder editalert = new alertdialog.builder(this); editalert.settitle("messagetitle"); editalert.setmessage("here message"); final edittext input = new edittext(this); linearlayout.layoutparams lp = new linearlayout.layoutparams( linearlayout.layoutparams.fill_parent, linearlayout.layoutparams.fill_parent); input.setlayoutparams(lp); editalert.setview(input); editalert.setpositivebutton("send via email", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { } }); editalert.show(); you can utilize this: edittext.setheight(100); android android-edittext android-alertdialog layoutparams

ruby on rails - Why do I have to precompile my assets in development? -

ruby on rails - Why do I have to precompile my assets in development? - lately have precompile assets see css changes in development environment. don't know why this, environment setting config.assets.debug still set true. find rather annoying, believe didn't have run precompile after every alter before. how create rails compile on page load again? i'm running rails 3.1.3. don't know other info provide, please allow me know need know solve this. try removing compiled assets , should reset default development behavior. otherwise, rails maintain trying load precompiled public/assets/ files before loading stuff under app/assets/ : rake assets:clean ruby-on-rails sass precompile

google app engine - How to bulk delete by keys with python and appengine? -

google app engine - How to bulk delete by keys with python and appengine? - is next solution work in case of 10000+ items ? q = db.gqlquery('select __key__ event date_create < [date(2012, 1, 23)]') db.delete(q) what right solution mass delete ? as shown in implementation, datastore module batch multiple delete rpcs if number of keys > max_delete_keys (500). you should in task queue might take more 60s, , trigger deadlineexceededexception . python google-app-engine

Python: Shrink/Extend 2D arrays in fractions -

Python: Shrink/Extend 2D arrays in fractions - there 2d arrays of numbers outputs of numerical processes in form of 1x1, 3x3, 5x5, ... shaped, correspond different resolutions. in stage average i.e., 2d array value in shape nxn needs produced. if outputs in consistency of shape i.e., in 11x11 solution obvious, so: element_wise_mean_of_all_arrays . for problem of post arrays in different shapes obvious way not work! i thought might help using kron function didn't. example, if array in shape of 17x17 how create 21x21 . others 1x1 , 3x3 ,..., build constant-shaped array, 21x21 . can case arrays smaller , bigger in shape compared target shape. array of 31x31 shruk 21x21 . you imagine problem mutual task images, beingness shrunk or extended. what possible efficient approaches same jobs on 2d arrays, in python, using numpy, scipy, etc? updates: here bit optimized version of accepted reply bellow: def resize(x,shape=none): if shape==none: ...

Rails 2.3 - How to prevent a browser from caching a partial? -

Rails 2.3 - How to prevent a browser from caching a partial? - i have cron job generates block of static html code (saved erb template) every 60 minutes, block shows recent 20 products have been added clients product catalogue. my code renders block partial: <%= render :partial => "/products/partials/most_recent_products" %> the problem partial getting cached users browsers come & browse site. does know how add together sort of cache-buster here forcefulness partial code reloaded upon each visit users? i've read lots of instructions doing on individual page or sitewide basis having problems figuring out how can done partial. that's not browser cache, rails. when runs in production environment - caches erb files, simpliest thing restart rails application. think can create task without changing erb template file. can provide more info needs? ruby-on-rails caching

windows - How can I create new project in Trac? -

windows - How can I create new project in Trac? - i have installed bitnami trac windows. (bitnami-trac-0.12.2-5-windows-installer) during installation, asked me creating project , username , password. created project , set user me(admin). @ moment, there written 1 available project created during installation. new it, why asking you, please help me how can create new project? also, how can create other users? bitnami installer asks creating project because means create new trac instance database (.db file). terms bit misleading here. the question is, if want create separate trac database, it's own trac world of speak. in case must utilize approach of phil's reply , utilize trac-admin.exe initenv on command-line. new trac instance must added new <location> in apache's httpd.conf then. if want have sec user-project in trac instance, should solve on level of trac plugins, , install instance simplemultiprojectplugin can create multiple user-pr...

ios - How to react to UIControl resize when its data changes -

ios - How to react to UIControl resize when its data changes - i've built uicontrol subclass display 1-month calendar view on iphone. months require 5 weeks display dates, months need 6, i've built command dynamically resize needed. i'm using uiview animation alter frame of command here. the problem is, need other controls on screen move/resize when calendar changes size. , need happen animation of calendar command changing size. ideally, i'd without coding bunch of details in calendar command other controls on screen. what's best strategy here? hoping somehow anchor other controls frame of calendar command , have platform adjust location/size animates frame change. but, far, can't find combination of struts , springs create happen. do need bite bullet , add together other on-screen controls animation happening within calendar control? i'll interested see if there improve answers this. at point, know override setframe on calen...

ruby on rails 3 - Helper methods available in mailer views depend on environment? -

ruby on rails 3 - Helper methods available in mailer views depend on environment? - related previous question still have 1 thing understand - why this: = link_to(root_path) = link_to(@some_path_set_in_mailer) works in development mode (config.action_mailer.perform_deliveries set true , emails sent) , in production or staging has changed to: = link_to(@some_path_set_in_mailer, @some_path_set_in_mailer) to avoid "no route matches {}" error? i had problem in rails 3.2. i'm not exclusively sure why there difference since there shouldn't be. however, link_to typically has format: = link_to("some link description here", root_path) the time typically leave off link description text if have longer description need set within do block this: = link_to(root_path) %p link description here = image_tag("some_image.jpg") so recommend sticking preferred syntaxes above. the docs link_to don't talk short-hand me...

session for sub-domain.example.com using PHP -

session for sub-domain.example.com using PHP - i have setup .htaccess redirect me.example.com example.com/fun/index.php. index.php has session. when user on me.example.com/index.php session never enabled, enabled on example.com/fun/index.php. how enable session on me.example.com/index.php path. ini_set('session.cookie_domain', '.example.com' ); php session cookies subdomain

mysql - Update query for time that will save it to the database -

mysql - Update query for time that will save it to the database - i utilize query: update `times` set `date` = 2012-04-04 `id` = 1 , `id2` = 2; it shows update successful, time shows 000-00-00 . clue? when utilize phpmyadmin filed show info want set in. after putting in same information, info changes. how come sql doesn't? am using wrong info format date? you need enclose date single quotes. update times set date = '2012-04-04' id=1 , id2 =2; your previous statement trying update date numeric value of 2004 ( 2012 minus 4 minus 4 ). mysql

height - jQuery flot more space at the top -

height - jQuery flot more space at the top - how can create more space @ top of charts? now this: but want this: this js code: $("table.chart").each(function() { var colors = []; $("table.chart thead th:not(:first)").each(function() { colors.push($(this).css("color")); }); $(this).graphtable({ series: 'columns', position: 'replace', width: '100%', height: '200px', colors: colors }, { xaxis: { ticksize: 1 } }); }); adjust autoscalemargin property of y axis. api: the "autoscalemargin" bit esoteric: it's fraction of margin scaling algorithm add together avoid outermost points ends on grid border. note margin applied when min or max value not explicitly set. if margin specified, plot furthermore extend axis end-point nearest whole tick. default value "null" x axes ,...

sqlite - Android how to convert an exsting dump db in other one with FTS support? -

sqlite - Android how to convert an exsting dump db in other one with FTS support? - i have .db sqlite file can import form sdcard. how can add together fts support? must recreate table? please give tips. yes, need create fts tables info want search. example, if have client table , products table, need create both customerfts table , products fts table. after tables created, have insert info wish search tables. can either @ illustration of fts back upwards in http://blog.andresteingress.com/2011/09/30/android-quick-tip-using-sqlite-fts-tables/ or android developer site http://developer.android.com/training/search/search.html show how create table , populate data. android sqlite sd-card fts3

timezone - Convert Local Time Zone to PST Time Zone in C# -

timezone - Convert Local Time Zone to PST Time Zone in C# - let time zone in scheme right +5gmt right on machine 01/14/2012 05:52pm want convert pst time zone 1/14/12 4:52:50 pst and vice versa pst gmt timezoneinfo timezoneinfo = timezoneinfo.findsystemtimezonebyid("pacific sa standard time"); datetime newdatetime = timezoneinfo.converttime(existingdatetime, timezoneinfo); you can see finish chart of available time zones here also take @ converting between 2 time zones c# timezone

java - Accessing external storage -

java - Accessing external storage - i want save file on external drive i'm facing problem. despite environment.getexternalstoragestate returns "mounted", getexternalfilesdir(null) returns null file . any thought reason of behaviour? thanks in advance time spend trying help me. java android storage

contacts - Replace stock address book in Android -

contacts - Replace stock address book in Android - i'm developing contacts manager android , goal replace standard one. have been looking appropriate intent without success. is there intent it? or google doesn't allow replace? regards , in advance, rafael muñoz you have create intent-filter. here illustration on stackoverflow should able modify create work you. android contacts addressbook

javascript - alternating table row backcolor without jQuery -

javascript - alternating table row backcolor without jQuery - suppose table : <table> <tr><td>aaaaaaaa</td><td>nnnnnnnnnn</td></tr> <tr><td>aaaaaaaa</td><td>nnnnnnnnnn</td></tr> <tr><td>aaaaaaaa</td><td>nnnnnnnnnn</td></tr> <tr><td>aaaaaaaa</td><td>nnnnnnnnnn</td></tr> <tr><td>aaaaaaaa</td><td>nnnnnnnnnn</td></tr> </table> with css: <style> .even{background:red;} </style> how can write pure js code adds class tr's of table ? [no jquery] if need style reasons, can utilize css3 selectors (no javascript needed): tr:nth-child(odd) { background-color: red; } tr:nth-child(even) { background-color: green; } javascript jquery html css

drupal 7 - how to write node content module programmatically -

drupal 7 - how to write node content module programmatically - i have write node module have no thought how start with. construction this: content type => nutrient {tite, description, nutrient type} content type => meal {title, description, detail( nutrient title, sequence) } the design view meal this: https://picasaweb.google.com/lh/photo/panw269fpn_2drykkhsmttmtjnzetymypjy0liipfm0?full-exif=true on right hand size, allow user search nutrient , drag left hand size (detail( nutrient title, sequence)). however, had created meal create page heavily utilize of jquery (client side program). however, don't know how integrate content type. how to: 1. when click new meal, can refer page created. 2. when click edit meal, page beingness load. 3. when click view deal, page without edit function loaded. 4. how can implement module, e.g. flag, comment, e.g. content type. may summary how can write node content type programmatically , callback should use. thank....

php - Real Estate Google Map Widget -

php - Real Estate Google Map Widget - i need map widget on real estate website. have seen on few of websites i'm unable find widget googling. link 1 of sites widget available below www.rebeccalaing.ca/search_toronto_real_estate_listings or widget on redfin.com.. http://www.redfin.com/homes-for-sale#!lat=42.53686494220565&long=-71.00828000000001&market=boston&v=6&zoomlevel=13 please if can tell me can widget. thanks in advance. chances these called "widgets" custom made implementations of (google) maps. i don't think of these can found anywhere download, allow lone 'plug-and-play' since these widgets require 1 or more back-end webservices supply data. i have written 1 such 'widget' myself, , suggest same if need this. should utilize the google maps api map stuff, , maybe jquery gui itself php javascript google-maps

backbone.js - Accessing view from within ajax success() call -

backbone.js - Accessing view from within ajax success() call - i have backbone.js view has next ajax call: backbonedemo.views.projects.projectview extends backbone.view demofunction: () -> ... ... @collection.create(new_project_attributes, success: -> console.log @ $('#' + @options.query_id).html('saved successfully').delay(1500).fadeout(500, -> $(@).remove()) the problem is, this within success phone call returns domwindow , not view in @options.query_id located. (yes, demofunction bound view). how can access view attributes within ajax success() phone call in backbone? the idiomatic coffeescript way utilize fat arrow bind callback function this want be: the fat arrow => can used both define function, , bind current value of this , right on spot. helpful when using callback-based libraries prototype or jquery, ... so this: @collection.create(new_project_attributes, success: =...

php - Replace nuSOAP with cURL -

php - Replace nuSOAP with cURL - i have php script syncs info 3rd party service, , to, if possible, replace nusoap curl have heard curl faster. web service calling takes simple http post , returns it, curl parameters shouldn't involved. i need pass 4 things, user id, password, organization id, , name of web service receive info from. which part of curl options pass them? trying pass them in header, not sure if correct. kept receiving 'bad request (invalid number)' error. edit: setting httpheader looks still setting text/html. since, have thought have basic understanding of curl. giving shallow information. if posting info page create utilize of curl_setopt($agent, curlopt_post, true); curl_setopt($agent, curlopt_postfields, $post_data); where $post_data info post page , like $post_data="name=stanley&feedback=good"; or if trying create authentication page, use curl_setopt($ch, curlopt_httpauth, curlauth_basic); cu...

whitespace - Css text-overflow not showing properly -

whitespace - Css text-overflow not showing properly - can't show h2 title when large css: .column li{ float: left; width: 200px; min-width: 150px; margin: 5px auto; display: inline; } .column li .block { height: 200px; margin-left: 5px; margin-right: 5px; padding: 20px; font-size: 1em; background-color: #ccc; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; border: 1px solid black; } .column li .block img { width: 89%; padding: 5%; border: 2px solid white; margin: 0 auto; display: block; background: white; } .column li .block h2{ font-size: 1.1em; margin: 10px 0 20px 0; border: 1px solid green; } .column li .block h2 a{ color: #000000; } what doing wrong? well, i'm guessing... since rule text-overflow: ellipsis has height: 200px , it's not actual element text in, rather bounding box grayness background. text-overflow , overflow not inh...

NHibernate: Join collection on other than composite keys specified in mapping -

NHibernate: Join collection on other than composite keys specified in mapping - in legacy database have work nested tables associated through composite keys. translated nhibernate, have e.g. class fcotransportation has collection of children of class fcoconsignment. however, in 1 situation, load collection based on 1 of components of composite key , ignore other component. the mapping looks this: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false"> <class name="fcolib.fcotransportation, fcolib" table="fco_transportation"> <composite-id> <key-property name="id"/> <key-property name="fk_eventid"/> </composite-id> <!--...snip...--> <bag name="consignments" table="fco_consignment" lazy="false" cascade="save-update"> <key> ...

python - UnicodeEncodeError when using the compile function -

python - UnicodeEncodeError when using the compile function - using python 3.2 in windows 7 getting next in idle: >>compile('pass', r'c:\temp\工具\module1.py', 'exec') unicodeencodeerror: 'mbcs' codec can't encode characters in position 0--1: invalid character can explain why compile statement tries convert unicode filename using mbcs? know sys.getfilesystemencoding returns 'mbcs' in windows, thought not used when unicode file names provided. for example: f = open(r'c:\temp\工具\module1.py') works. for more finish test save next in utf8 encoded file , run using standard python.exe version 3.2 # -*- coding: utf8 -*- fname = r'c:\temp\工具\module1.py' # have file named fname can comment out next 2 lines f = open(fname) print('ok') cmp = compile('pass', fname, 'exec') print(cmp) output: ok traceback (most recent phone call last): file "module8.py", line 6, i...

c++ - Storing a list of rng's in a std::array for multithreading -

c++ - Storing a list of rng's in a std::array for multithreading - i'd multithread rng part of code using c++11. i create bunch of rng's this: typedef std::mt19937 mersenne_twister; typedef std::uniform_real_distribution<double> unidist; // 8 rng engines 8 consecutive seeds const size_t nrng = 8; const array<uint32_t,nrng> seed_values = {0,1,2,3,4,5,6,7}; array<mersenne_twister,nrng> engines; const array<unidist,nrng> distributions; // default constructor [0,1] interval const array<????,nrng> rngs; // type set here? for( size_t i=0; i<nrng; ++i ) engines[i].seed(seed_values[i]); rngs[i] = std::bind(distributions[i], engines[i]); with thought can later pass each of rng objects seperate std::thread fills array form of random numbers using supplied generator. don't know type need utilize rng array . know how create 1 rng, so: auto rng = std::bind(unidist, generator); but need explicitely have ( decltype d?...

How do I take an XML file with nested elements and get a set of C# classes from it? -

How do I take an XML file with nested elements and get a set of C# classes from it? - first off, i'm not terribly experienced in xml. know basics of reading in , writing it, part, things schemas start create eyes cross quickly. if looks i'm making wrong assumptions how xml works, there's chance am. that disclaimer aside, problem i've run several times without finding agreeable solution. have xml defines data, including nested entries (to give example, file might have "power" element has kid node of "alternatepowers" in turn contains "power" elements). ideally, able generate quick set of classes xml file store info i'm reading in. general solution i've seen utilize microsoft's xsd.exe tool generate xsd file xml file , utilize same tool convert schema classes. grab is, tool chokes if there nested elements. example: - column named 'power' belongs datatable: cannot set nested table name same name. is th...

c# - Maintaining Scroll Position and Selected Control on Postback -

c# - Maintaining Scroll Position and Selected Control on Postback - back web based issue. when command issues postback server page refreshes (fine). page scrolls top , loses command selected. if it's relevent after postback depending on changes have happened controls made visible or made hidden. focus lost , current scroll resets if nil changed on page visibility wise. info inputted in text fields kept , radiobutton/checkbox selections. problem tabbing reset index 0 , pages scroll sent top of page. i using .net 4.0 i have tried adding maintainscrollpositiononpostback="true" both on asp page , in web.config no avail. have tried , without ajax updatepanel using conditional updating triggering off when textboxes text changed or radiobuttons changed , postback still causes scroll , index loss. any ides fantastic. ta! first of all, maintainscrollpositiononpostback="true" has known bug in asp.net 2.0, see here. also, right syntax maintain...

ruby - Rails "MiniTest v1.6.0 is out of date. (RuntimeError)" error -

ruby - Rails "MiniTest v1.6.0 is out of date. (RuntimeError)" error - i'm using ruby 1.9.2 , rails 3.1.1 on windows 7. tried running rake test command, maintain getting error: `<top (required)>': minitest v1.6.0 out of date. (runtimeerror) `gem install minitest` , add together `gem 'minitest' test helper. i tried using gem install minitest , added gem "minitest" gem file , ran bundle install . nil worked. tried running bundle exec rake test , failed too. i'm still getting same error. gem file has this: group :test # pretty printed test output gem 'turn', :require => false gem "minitest" end any ideas i've gone wrong? total pastie of error: http://www.pastie.org/3214398 running gem query returns minitest: minitest (2.10.1, 1.6.0) i have found several people have had issue before, none of posted solutions have worked me. i've seen 2 solutions this: first gem uninstall minit...

WebView with an IFRAME android -

WebView with an IFRAME android - i want load html <iframe> within webview , don't know why, not able so. i using next code load <iframe> webview.loaddata("<iframe src=\"http://www.google.com\"></iframe>", "text/html", "utf-8"); here's have tried. websettings webviewsettings = webview.getsettings(); webviewsettings.setjavascriptcanopenwindowsautomatically(true); webviewsettings.setjavascriptenabled(true); webviewsettings.setpluginsenabled(true); webviewsettings.setbuiltinzoomcontrols(true); webviewsettings.setpluginstate(pluginstate.on); i have mentioned net permission: <uses-permission android:name="android.permission.internet" /> i have tried settings webviewclient shouldoverrideurlloading returning false. but isn't working. i have tried diffrent sites, i.e. sites other than, google.com. i testing on, samsung nexus s running ics 4.0.3 ...

linux - Calling script from shell script - getting command not found -

linux - Calling script from shell script - getting command not found - i new shell scripting. trying work through this. > script execute in cron (util.sh) #!/bin/sh host='ahostname' port='3306' user='auser' pass='apassword' db='adatabase' . /mnt/stor/backups/backup.sh (i tried source /mnt/stor/backups/backup.sh) > script execute (backup.sh) when backup.sh called (it called) appears parsed , not executed. no matter set in messages like: /mnt/stor/backups/backup.sh: line 8: date: command not found /mnt/stor/backups/backup.sh: line 8: mysqldump: command not found /mnt/stor/backups/backup.sh: line 8: tar: command not found /mnt/stor/backups/backup.sh: line 8: rm: command not found the thought have domain localized file, execute variables, , phone call master script uses variable dirty work. because of limitations 1 of hosts , multiple domains best method. the script problem seems /mnt/stor/backups/backup.sh . ...

java - How to read classes matching class name pattern (with or without extcos)? -

java - How to read classes matching class name pattern (with or without extcos)? - i want classpath scanning using existing library. extcos seems candidate, because supports jboss's vfs out of box. is possible run extcos (or other classpath scanning tool), that fs-based, jar-based , jboss's vfs's based classpaths supported and classes matching specific pattern (like com.example.*.entity ) loaded? the first prerequisite seems satisfied extcos , i'm unable sec one. may happen have weird classes in com.example bundle , don't want load them, not try. as extcos (extensible component scanner, http://extcos.sf.net): first supported rightly mention, sec isn't possible. it's idea, i'll consider feature added. java classpath classloader

android - ndk-build keeps rebuilding all sources -

android - ndk-build keeps rebuilding all sources - i have set eclipse build c/c++ files. created builder , set point @ ndk-build executable in ndk install tree. each time run keeps rebuilding sources. not passing arguments why this? it doesn't it's possible perform incremental builds using stock android-ndk . could, however, manually. it's quite involved process because you'll have redo makefiles , such. see this reply description of involves. android eclipse android-ndk

android - Displaying Cards on an imageView -

android - Displaying Cards on an imageView - hello trying display cards on image view 1 overlaying other. thinking of using padding, not sure how utilize it. thanks. here how display cards. while(bl.dealeriterator.hasnext() == true) { dealercards.setimageresource(bl.dealeriterator.next().cardimage()); } use absolutelayout , offset every imageview amount! android xml imageview

function - How to stop a jQuery effect on a menu item with the class of .curent? -

function - How to stop a jQuery effect on a menu item with the class of .curent? - i have list of blog categories in sidebar right of page. i have set-up jquery effect when hover on category name animates 5px padding left. everything working well, if click on category, want bring category page same category sidebar list, current category having class of .current. i current category have 5px padding left , have no effect when hovered over. basically create stand out other categories in list. here jquery have atm: // blog categories animation $(function() { $('#blog-categories ul li a').hover( function(){ $(this).find('img').animate({paddingleft: '+=5'}, 100); }, function(){ $(this).find('img').animate({paddingleft: '-=5'}, 100); } ); }); if knows way have 5px added padding nowadays on current category item. ie '#blog-categories ul li a.current' and have no farther animation when hovered over, gre...

java ee - Client-side Validation in Struts 2 -

java ee - Client-side Validation in Struts 2 - i new @ java web. follow tutorial struts 2 at: http://viralpatel.net i success @ create server-side validation, client-side not work. when submit, notice javascript method not defined. seek viewing source, see no script generated. generated html source http://pastebin.com/lc49jnms there no javascript 'validateform_customer()' method. in customer.jsp, have added validate attrubute: <s:form action="customer.action" method="post" theme="xhtml" validate="true"> and added: <s:actionerror/> <s:fielderror /> and <s:head/> in struts.xml: <action name="customer" class="mypackage.customeraction"> <result name="success">/success.jsp</result> <result name="error">/customer.jsp</result> </action> in code, have extended actionsupport, , have customeraction-...

javascript - Using RegExp.$1 in Fiddlers CustomRules.js -

javascript - Using RegExp.$1 in Fiddlers CustomRules.js - i've been using fiddler few days now, extending customrules.js own logic. i tried grab info out of response body using regular expressions this copied http://msdn.microsoft.com/en-us/library/bahdt634%28v=vs.71%29.aspx var s : string; var re : regexp = new regexp("d(b+)(d)","ig"); var str : string = "cdbbdbsbdbdz"; var arr : array = re.exec(str); s = regexp.$1; however using in fiddler give error when save file. saying regexp.$1 not supported. i assume related (http://msdn.microsoft.com/en-us/library/bahdt634%28v=vs.71%29.aspx) note properties of regexp object not available when running in fast mode, default jscript .net. compile programme command line uses these properties, must turn off fast alternative using /fast-. not safe turn off fast alternative in asp.net becafast mode not switched of. however how switch of fast mode in customrules.js? possi...

c# - When to use Mock's Callback versus Return? -

c# - When to use Mock's Callback versus Return? - i have, think, pretty straight forwards setup in search type created , passed through service layer , repository list of domain type returned. search type nil build look tree in repository method , results database come back. pretty simple the repository interface: public interface idonotsolicitrepo { ilist<dnscontract> selectwithcriteria(dns_search searchriteria); } the service implementing repository: public class donotsolicitservice : basebllservice, idonotsolicitservice { private readonly idonotsolicitrepo repo; private readonly ipartnerservice partnerservice; private readonly idonotsolicitreasonservice dnsreasonsvc; public donotsolicitservice(idonotsolicitrepo _repo, ipartnerservice _partnersvc, idonotsolicitreasonservice _dnsreasonsvc) { repo = _repo; partnerservice = _partnersvc; dnsreasonsvc = _dnsreasonsvc; } public serviceresult<dnsco...

algorithm - convert my database table to a tree and get leaf nodes in php -

algorithm - convert my database table to a tree and get leaf nodes in php - hi have database table , want set tree construction , leaf nodes of tree . in table have preferenceid , preferenceparentid . in case want built tree . level 1 should fashion , music , because have preferenceparentid = 0 in 2 nd level men's clothing should under fashion because it's parent preference id fashion . , artists sholud under music . in 3 level couture , denims should under men's clothing , african , afrobeat shoul under artists . and want all leaf node values . in case want couture , denims , african and afrobeat`. tree may grow n levels . please help me . suggestion welcome ....................... :d in response chauhan's linked article, i'd post much simpler solution: // sample info (from 1 big query selecting them in 1 go) $rows = array( array('id' => 971, 'parent_id' => 3, 'label' =>...

gcc - Error compiling imapfilter 2.4.1 in CentOS 5.6 -

gcc - Error compiling imapfilter 2.4.1 in CentOS 5.6 - i trying compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in centos 5.6. believe i've got dependencies sorted when run create get: make[1]: entering directory `/home/src/imapfilter-2.4.1/src' cc -wall -o -dmakefile_sharedir='"/usr/local/share/imapfilter"' -c -o core.o core.c core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’ core.c: in function ‘ifcore_append’: core.c:947: warning: implicit declaration of function ‘lua_strlen’ core.c: in function ‘luaopen_ifcore’: core.c:1162: warning: implicit declaration of function ‘lual_register’ core.c:1162: error: ‘ifcorelib’ undeclared (first utilize in function) core.c:1162: error: (each undeclared identifier reported 1 time core.c:1162: error: each function appears in.) make[1]: *** [core.o] error 1 make[1]: leaving directory `/home/src/imapfilter-2.4.1/src' make: *** [all] error 2 based on othe...

java - linked list (node) scope and memory allocation or garbage collection after method returns -

java - linked list (node) scope and memory allocation or garbage collection after method returns - maybe out of mind right now, have question scope, or memory allocation, or garbage collection. the class linkedintlist has private field, front, variable of listnode type (line 4). rest of linked list constructed calling add() function (line 29). question: when add() returned (line 39), listnode created in add(), new, out of scope , supposed garbage collected? or reserved because front end chain-pointing them? 1 // simple first version of linkedintlist constructor 2 // , methods add together , tostring. 3 4 public class linkedintlist { 5 private listnode front; // first value in list 6 7 // post: constructs empty list 8 public linkedintlist() { 9 front end = null; 10 } 11 //.... //.... 28 // post: appends given value end of list 29 public void add(int value) { 30 if (front == null) { 31 front end = new listnode(value); 32 } else { 33 listnode current = front; 34 while (cur...

c# - Unified finger print reader API -

c# - Unified finger print reader API - i have programme requires finger print authentication, trying find way develop once, types of finger print readers; possible? or have pick 1 of them , develop programme according it? there windows biometric framework, assuming can restrict application windows 7/server 2008 or better. c# .net authentication biometrics

c# - How to load view from one controller using a different one? -

c# - How to load view from one controller using a different one? - really simple question: want able redirect 1 page in razor mvc. the user clicks link on first page, calls method on first controller. method uses info own model, methods sec controller, build model sec controller. i wish display sec view using newly constructed model. however, there doesn't seem way utilize view() (unless i'm blind). 2 controllers in different folders, can't automatically find page load. any ideas? you can utilize like return view("../foldername/viewname", model); c# asp.net-mvc razor

c - PostMessage doesn't seem to work? -

c - PostMessage doesn't seem to work? - i'm trying larn how utilize , receive raw input messages, , devised next programme test understanding far... when recieve input message, seek alter string displayed , place new wm_paint message on queue. message doesn't seem called. when resize window text appear different. why wm_paint message not getting processed @ all, until resize window example? #define _win32_winnt 0x501 #include <windows.h> #include <assert.h> #include <cstring> #include <cstdio> lresult callback winprocedure(hwnd hwnd, uint msg, wparam wparam, lparam lparam); int winmain(hinstance hinst,hinstance,lpstr,int ncmdshow) { wndclass wc; hwnd hwnd; wc.hinstance = hinst; wc.lpfnwndproc = winprocedure; wc.style = cs_hredraw | cs_vredraw; wc.cbclsextra = 0; wc.cbwndextra = 0; wc.hicon = loadicon(null, idi_winlogo); wc.hcursor = loadcursor(null, idc_arrow); wc.hbrbackground = (hbrush)...

python - Calculate pixel values from latitude/longitude coordinates (using matplotlib Basemap) -

python - Calculate pixel values from latitude/longitude coordinates (using matplotlib Basemap) - i need convert map coordinates pixels (in order create clickable map in html). here sample map (made using basemap bundle matplotlib). have set labels on , attempted calculate midpoints of labels in pixels: #!/usr/bin/env python # -*- coding: utf-8 -*- ## step 0: points plot names = [u"reykjavík", u"höfn", u"húsavík"] lats = [64.133333, 64.25, 66.05] lons = [-21.933333, -15.216667, -17.316667] ## step 1: draw map using matplotlib/basemap mpl_toolkits.basemap import basemap import matplotlib.pyplot plt m = basemap(projection='merc',resolution='c', llcrnrlat=63,urcrnrlat=67, llcrnrlon=-24,urcrnrlon=-13) x, y = m(lons, lats) # transform coordinates according projection boxes = [] xa, ya, name in zip(x, y, names): box = plt.text(xa, ya, name, bbox=dict(facecolor='white', alpha=0.5)) bo...

Android Button onclick submit to email -

Android Button onclick submit to email - i have been working java , xml few months now, , have learned great deal everyones help on stackoverflow. my question java programming android in relation submit button. currently trying figure out how submit value email address (behind scenes) lets have text field , button; want take value entered in text field, , submit email address onclick. i unable find online shows me how this. thank in advance reading through post , forwards suggestions. this great illustration of how using intents can come in great handy! android has bunch of pre-defined intents things within system; may have clicked on image before , dialog popped asking whether view in gallery or in third-party app such astro. viewing of image has own pre-determined intent. sending email has own pre-determined intent: android.content.intent.action_send . you'll need create intent property , attach info (ie. address send to, subject/message body, etc.). ...

php - AutoIncrement Array in an Array() : Is that possible? -

php - AutoIncrement Array in an Array() : Is that possible? - i : $product[] = array ( "article_title" => valeures, "article_id" => , "article_value" => , "article_price" => "article_picture1" => , "article_picture2" => , "article_picture3" => , "article_picture4" => , "article_friends[]" => array ( "name" => , ), ); but know won't work, i've been looking hours on net , on php.net, don't know how do. want do, getting product[] array can handle product[1]; product [2] ... , within it, got same process : "art...

Authentication app for Django -

Authentication app for Django - what best authentication app django that: has configurable required fields, illustration allows using email username integrates other authentication apis, such facebook, twitter, google password recovery flow configurable, sends temporary password vs. recovery link preferably has invitation system, registration process can controlled i don't think there has these features, i'm looking 1 covers much possible. these features design web service should have. don't want reinvent wheel. there isn't 1 django bundle cover everything, instead there numerous great projects tackle each of requirements mention: general auth : django-auth - part of django distribution needs eneabled social authentication : django-social-auth - integrates social authentication default django-auth flow registration , passwords : django-registration - adds registration flow, including sign , email confirmation etc. invitation system : django-invitat...

salesforce - how do we call a javascript function after executing controller method -

salesforce - how do we call a javascript function after executing controller method - i have vf page save button. calling controller method in vf page. close vf page 1 time save method executed. <apex:commandbutton value="save" action="{!save}"/> i think can close page using javascript function. thanks prady here's easiest way i've found accomplish this. create visualforce page (i have same page named "closeme") markup: <apex:page > <script type="text/javascript"> window.close(); </script> </apex:page> then, redirect (by javascript or apex pagereference) page. also, make sure profiles have necessary security access page. instead, seek using actionfunction calls apex save action, set window.close(); javascript on oncomplete actionfunction parameter, think that's unnecessarily complicated. salesforce visualforce

c# - Converting a CSV file to XML based on XSD -

c# - Converting a CSV file to XML based on XSD - i have csv file needs converted xml based on xsd file. can utilize xslt this? if there way dynamically generate xslt based on xsd , transformation? newbie xml , xslt , trying find improve way of doing it. here sample csv. types other myrate, abc, xyz, wrap should go others. type,date,id,rate,amt1,amt2 myrate,1/1/2012,5120,0.35,, myrate,1/12/2012,4584,0.21,, abc,1/1/2012,8745,, xyz,12/31/2012,2451,, wrap,8/12/2011,7454,,5421250.12,778545.35 wrap,10/12/2011,5454,,48213550.12,4748545.35 wen,7/8/2011,521,,,, here xsd <?xml version="1.0" encoding="utf-8"?> <xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/xmlschema"> <xs:element name="position"> <xs:complextype> <xs:sequence> <xs:element name="post" maxoccurs="unbounded"> ...

vb.net - Datagridview combobox column's value -

vb.net - Datagridview combobox column's value - i have datagridview combo box few values in there. trying capture user clicked. tried cellvaluechanged , cellcontentclicked etc. nil works. i want store value variable (important) , shift cursor column after user has selected value. please help. please advise event fire. thanks private sub dg_cellvaluechanged(byval sender object, byval e system.windows.forms.datagridviewcelleventargs) handles dg.cellvaluechanged if flgld = 1 dim retreivedvalue object = dg.rows(dg.currentrow.index).cells(0).value dg.rows(dg.currentrow.index).cells(1).value = retreivedvalue dg.currentcell = dg.rows(dg.currentrow.index).cells(1) dg.beginedit(true) end if end sub use cellvaluechanged event, check column chosen user, can retreive value. here example: private sub yourgrid_cellvaluechanged(byval sender system.object, byval e system.windows.forms.datagridviewcelleventargs) handles yourgrid.cel...

css - How to design this html Box for legacy browsers -

css - How to design this html Box for legacy browsers - i need design box has next structure: i have next html/css works in ff/chrome/safari. ie had spoil fun. please suggest how can back upwards ie? the problem background images not getting displayed. problem browser ie 6,7,8,9 js fiddle http://jsfiddle.net/amitverma/u33ap/ <div id="canvasframe"> <img src="resources/images/canvasfrog.png" id="canvasfrog" alt="" /> <img src="resources/images/canvasleaves.png" id="canvasleaves" alt="" /> <div class="canvascontent"> </div> </div> #canvasframe { background: url("../../resources/images/canvastop.png"), url("../../resources/images/canvasbottom.png"), url("../../resources/images/canvasbg.png"), url("../../resources/images/canvasbgtexture.jpg"); backgr...

php - Can't locate file -

php - Can't locate file - after working files , trying figured out still have issue somewhere. saying unable locate model specified login attempts. modeling own thing against tank library. there’s ideas i’m using coding own needs. libraries/kow_auth.php <?php if (!defined('basepath')) exit('no direct script access allowed'); /** * kow auth library * authentication library code igniter * @author jeffrey davidson * @version 1.0.0 * @copyright 2012 */ class kow_auth { protected $ci; function __construct() { //assign ci superglobal $ci $this->ci =& get_instance(); } function is_max_login_attempts_exceeded($user_id) { $this->ci->load->model('kow_auth/login_attempts'); homecoming $this->ci->login_attempts->get_attempts_num($user_id) >= 5; } } ?> models/kow_auth/login_attempts <?php if (!defined('basepath')) exit('no direct script access allowed'); /** *...

Adding primes in a sequence in C++ -

Adding primes in a sequence in C++ - possible duplicate: adding primes in sequence in c++ consider n sequence of positive integers n, calculate sum of numbers of sequences cousins. how do that? tried next code failed: #include <iostream> using namespace std; int main() { int n, i, j, numero = 0, primo = 0, soma = 0; cout << "digite um numero: "; cin >> n; (i = 0; < n; i++) { cin >> numero; (j = 1; j < n; j++) cout << " numero " << numero << endl; { if (numero %j == 0) primo ++; cout << "primo" << primo << endl; } if (primo == 2) { soma = soma + numero; cout << " numero " << numero << endl; cout << "soma" << soma << endl; } } cout << soma ...

c# - Implementing download manager -

c# - Implementing download manager - i'm planning on writing custom download manager part of application. start researching, i'd appreciate pointer/opinions on following: how observe if target server supports resume given file. how download files in multiple parts. any libraries available .net? what practical way go? threadpool or tpl? assuming mean http download manager?? first 2... http header field definitions - accept-ranges c# resume download-manager

servlets - Internet Explorer 9 does not use file name for inline attachments -

servlets - Internet Explorer 9 does not use file name for inline attachments - i utilize code in servlet sets file name of inlined pdf document: response.setcontenttype("application/pdf"); response.setcontentlength((int) file.length()); response.setheader("content-disposition", "inline; filename=\"" + file.getname() + "\""); however not work in ie 9: "save as..." dialog shows lastly path part of url followed ".pdf" (for "/some/url/invoice" "invoice.pdf") is known bug? there workaround? that's indeed default behaviour of ie. not utilize filename attribute of content-disposition header in way prepare default filename save as. instead, uses lastly part of request url path info. i recommend rewriting servlet and/or links in such way desired filename supplied part of request path info instead of illustration request parameter. so, instead of <a href="/pdfse...

c# - Independent Domain Layer -

c# - Independent Domain Layer - if using nhibernate possible create class declarations independent such thing iesi.collections.generic.iset<> ? thanks! for part can have classes expose collections icollection< t >. remember initialize them in constructor though. c# nhibernate orm

Pre-populated databases in Android: Trying to put the pieces together -

Pre-populated databases in Android: Trying to put the pieces together - i have been gathering info in site , others best way include pre-populated sqlite database in android. confirm understood reasons of why should trivial… not. so please tell me if next conclusions right or wrong?: the main reason many people suggest copying pre-populated database file assets folder "/data/data/your_package/databases/" because there no way access database file in assets folder or doing overly complex (?). (could clarify of these 2 answers right 1 ?) another of import reason database files in assets folder must copied somewhere else because files in location cannot updated. if database in assets folder open, useful if such database not have modified. update: i launched new thread focussing on issue: opening read database straight in assets folder. files in assets folder can 1 mb size (unless have file extensions such mp3). note restriction not relevant if: database smaller 1 m...