Posts

Showing posts from September, 2013

Own filter Solr -

have long since have been researching, far have not found solve problem. i'm trying create filter solr, add token. example, entry "football" , output "football" , "brazil." if possible practical example. in advance. instead of filter can use synonymfilterfactory add synonyms mentioned in example. allow map terms , related terms, added index.

html - Styling table issue -

so want table have borders below each row. td{ border-bottom-style: solid;} but, between columns, there visible border break. don't how can remove that? table { border-collapse: collapse; } http://jsfiddle.net/adrift/lsnr7/

junit - Play2 Java - InvalidPropertyException when testing controller with form -

i'd test controller method named authenticate() , has simple logic: validating email , password request , returning result json. public class users extends controller { static form<user> userform = form.form(user.class); public static result login() { return ok(views.html.users.login.render(userform)); } public static result authenticate() { form<user> filledform = userform.bindfromrequest(); if (filledform.haserrors()) { return badrequest(views.html.users.login.render(filledform)); } else { objectnode result = json.newobject(); user u = filledform.get(); if (user.isauthvalid(u.email, u.password)) result.put("status", "ok"); else result.put("status", "authentication failed"); return ok(result); } } } following test code authenticate() : @test public void

kendo ui - How to access the device camera in KendoUI Mobile and phonegap build -

me again... i'm building multi platform mobile app using kendoui mobile. need access device camera cannot, life of me, figure out how so. i have tried <input type="file" accept="image/*;capture=camera"> doesn't work, once package built in phonegap build (and in emulator) opens choose file dialog. does know how access device camera in kendoui mobile "native" app?? regards, devon britton. please check documentation on how capture image phonegap: http://docs.phonegap.com/en/2.7.0/cordova_camera_camera.md.html#camera . you need use camera.getpicture method take picture using device. kendo mobile has nothing built in native features. phonegap apis need used in same way u use in pure js code.

random - Flash actionscript 2 remove linkage MovieClip -

i'm making banner , in banner have movie-clip link library in action script , call "mchelmet". need appear in randomly position on x axis , move top bottom (like rain). the problem after 25 sec' want go frame (10) , "mchelmet" disappear. works fine except "mchelmet" refuses disappear no matter code use; delete , remocemovieclip, using function nothing works. i need help. this code use: onenterframe = function (){ url_btn.onrollover = btn.ondragover = function (){ startdrag(mc_girl,true,10,186,270,131); mc_girl._x = _xmouse; if(_xmouse < mc_girl.width /2){ mc_girl._x = 0; } if(_xmouse > stage.width - mc_girl.width /2){ mc_girl._x =stage.width - mc_girl._width; } if(mc_girl._x <= 0){ mc_girl._x += mainspeed; } if(mc_girl._x >= stage.width - mc_girl._width){ mc_girl._x -= mainspeed; } s

javascript - window.open losing control in click event handler in firefox -

i'm trying open new window using window.open, in event handler click event: var onbuttonclick = function() { alert('start'); window.open('http://www.google.com', 'goog', 'width=800,height=400'); alert('done'); }; var element = document.getelementbyid("button"); element.addeventlistener('click', onbuttonclick); http://jsfiddle.net/egnpe/ i expect alert saying "start", alert saying "end", , window open. works in chrome on linux in firefox 20.0 on ubunutu, first alert, suggesting somewhere in window.open method, control lost. if popup blocker issue, i'd expect notification popup blocked, , window.open should return null , continue throw second alert. any ideas? misusing event handlers or window.open method? after disabling firefox extensions, code above works expected. issue may specific own machine , configuration.

android - Converting an ArrayList of Objects to JSON to be saved into SQLITE -

i want store arraylist of objects (arraylist) sqlite database. have read can done. believe converting arraylist json , save string field in sqlite table can point me in right direction on how conversion , how convert arraylist afterwards. thanks time this you: http://www.kodejava.org/examples/588.html this example shows how convert collection (list/arraylist) json can store json string in sqlite database. it showing how arraylist json string.

android - Execute a method when I click on the screen -

i need execute method every time click part of screen. have tried acessibilityservice , have activate on settings. have tried broadcastreceiver , doesn't work. idea it? as long want within own activity, override ontouch() . if want across entire device, not possible through public sdk, , have customize android @ source level.

android - How can I a load a Photosphere in my app? -

i made question 2 days ago, , ianhanniballake replied me right solution. now, trying follow this example. now, it's not loading image. i changed line: uri.parse("android.resource://" + getpackagename() + "/" + r.raw.pano1); for line: uri.parse("http://s24.postimg.org/d81cxh2sl/pano1.jpg".tostring()); what can be? looking @ android sdk cannot use http resource uri: the uri of panorama load info about. may file:, content:, or android_resource: scheme. so need download image first before can process it. check this link tutorial on this.

python - No error when Google App Engine sends email but the receipient does not receive any emails -

i trying send email using python , google appengine using code below: main2.app import webapp2 google.appengine.api import mail google.appengine.api import users class invitefriendhandler(webapp2.requesthandler): def post(self): user = users.get_current_user() if user none: login_url = users.create_login_url(self.request.path) self.redirect(login_url) return to_addr = "madhurima.basu@gmail.com" if not mail.is_email_valid(to_addr): # return error message... pass message = mail.emailmessage() message.sender = user.email() message.to = to_addr message.body = """ i've invited example.com! accept invitation, click following link, or copy , paste url browser's address bar: %s """ % generate_invite_link(to_addr) message.send() **app.yaml** application: r-email version: 1 runtime: python27 api_version: 1 thre

android.os.NetworkOnMainThreadException json android -

this question has answer here: how fix android.os.networkonmainthreadexception? 44 answers in below code got error when running android project sending json cloudant.com second layout, quiero mandar json desde android en un segundo layout pero me manda el error android.os.networkonmainthreadexception desde el logcat //obtenemos una referencia al locationmanager locmanager = (locationmanager)getsystemservice(context.location_service); //obtenemos la última posición conocida final location loc = locmanager.getlastknownlocation(locationmanager.gps_provider); // buton ejecuta btnactualizar.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // comenzarlocalizacion(); httppost request = new httppost( "https://tonatiuhnava.cloudant.com/android/"

.net - Facebook integration with C# desktop application -

Image
im going dive straight in , give little background on im trying do, i've tried, , obstacles in way. here goes.. my goal post facebook profile or wall desktop application. desktop application used individual users have own facebook account. aim create each user own facebook app , app id , app secret. , use app id , app secret in desktop application ( saved somewhere in database or config ) allow user of desktop application post profile without having enter email address , password login first so in summary, 1 facebook app per facebook account. app settings saved in each users desktop application post own facebook via own facebook app without logging in the main emphasis here being user not have log in manually via window or browser. i have created facebook app , have set live status.. have added in possible permissions , extended permissions in settings ( within facebook ) make sure wasnt missing anything. have appid , app secret.. have client token says use in pla

asp.net - Protecting querystring variable for use in SQL query parameter -

i'm writing simple website act discussion board/forums in vb.net. when user clicks on forum, forum id put in querystring variable "topic" page reads , collects topics forum id. likewise, when user clicks on topic, post page collect posts topic id. ie: f_id = request.querystring("f_num") mycommand = new sqlcommand("select * forum_topics forum_id = @id", myconnection) mycommand.parameters.addwithvalue("@id", f_id) my question is: while use id parameter in sql query, should id in variable before or after using or passing page purposes of security? are there best practices governing using querystring transport data page page? and lastly, there different method should use if 1 not secure enough? for purposes of question, long user logged in (handled elsewhere) allowed see , topics. thanks!

mysql - Proper way to create composite PK -

as far know, there 2 ways of creating composite pk, dont know differences or one: create table appusers ( id int not null, username varchar(20) not null, lastname varchar(100), firstname varchar(100), primary key (id, username) ) vs create table appusers ( id int not null, username varchar(20) not null, lastname varchar(100), firstname varchar(100), constraint pk_appusers primary key (id, username) ) specifications: according http://dev.mysql.com/doc/refman/5.0/en/create-table.html , http://dev.mysql.com/doc/refman/5.0/en/alter-table.html , constraint key word optional primary key . best practice: i say, use 1 whichever prefer regarding readability. i'd tend limit letters though, using join instead of inner join .

ios - Objective C- Import error with singleton -

this question has answer here: circular import issues in objective c & cocoa touch 2 answers i quite new on objective c please bit slow me. i have constructed views this: viewcontroller=>root(view)=>controls(view). root singleton can root element of app time. when add #import "root.h" controls.h parse issue. #import <uikit/uikit.h> #import "root.h" // triggers error @interface controls : uiview @end here root.h #import <uikit/uikit.h> #import <foundation/foundation.h> #import "controls.h" #import "content.h" @interface root : uiview { controls *m_controls; // parse error: unknown type name "controls" } +(root*)getinstance; @end what causes that? how fix? you use #import *.h in *.m file, when need use class in *.h use @class. so, must change class this:

nginx - questions about $args on try_files inside location with regex -

(sorry bad english) i have url this: http://www.domain.com/resize.php?pic=images/elements/imagename.jpg&type=300crop that php checks if image exists , serves, if not, creates image on disk size specified in type parameter , returns it. what wanted check if image exists on disk @ size, nginx, run resize.php when necessary create image. i tried this, think location directive doesn't operate on query parameters ($args) using regex, loncation not match sample url :( any please? i need rewrite parameters ($args) , use them in try_files directive... possible? location ~ "^/resize\.php\?pic=images/(elements|gallery)/(.*)\.jpg&type=([0-9]{1,3}[a-z]{0,4})$)" { try_files /images/$1/$2.jpg /imagenes/elements/thumbs/$3_$2.jpg @phpresize; } location @phpresize { try_files $uri =404; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_buffering on; proxy_pass

c - Replacing Tab(s) with a Space - Memory Issues (free invalid next size fast) -

this question has answer here: facing error “*** glibc detected *** free(): invalid next size (fast)” 2 answers i trying pass string tab(s) in function, , have function replace each tab, or repeating tabs space. problem having regarding memory issues. here code: void converttoonespace(char *dst, char *src) { int i, j, first_tab = 1; for(i = 0, j = 0; src[i] != '\0'; i++) { if (src[i] == '\t' && first_tab == 0) continue; if (src[i] == '\t' && first_tab == 1) { first_tab = 0; dst[j] = ' '; } else { first_tab = 1; dst[j] = src[j]; } j++; } dst[j] = '\0'; } int printcomment(char *desc) { char astring[4096]; char *result = null; strcpy(astring, desc); result = strtok(astring, "\n");

vba - Send two different mails when a cell reaches two different values (right) -

i'm developing program automatically send 2 different e-mail messages when cells in range reach 2 different values (1 or 2). the code i'm using consists of: a) private sub worksheet_calculate() b) sub mail_with_outlook1() sub code sub mail_with_outlook1 () sends 1 e-mail message text type content 1, 1 corresponding address registered in range of cells in column "af". this happens when value of corresponding cell of range "ae10: ae45" equal “1” (see mylimit = 1). i send second specific e-mail message text type content 2, 1 of corresponding addresses described in same range of column "af", when value of cell of same range "ae10: ae45" equal "2" (mylimit = 2). private sub worksheet_calculate() dim formularange range dim notsentmsg string dim mymsg string dim sentmsg string dim mylimit double mylimit = 1 set formularange = me.range("ae10:ae104") on error goto endmacro: each formulacell in formularange.ce

joomla - Submit button from imported php file doesn't validate data -

i using joomla , wanted add new functionality joomla componnent. designed php file called roomdetails.php contains textboxes , submit button. submit button validates textboxes first , saves data database. saved php file in joomla root folder , whenever navigate localhost/mywebsitename/roomdetails.php , click on submit button, can see validates data. haven't tested if saves data. anyways, imported php file (roomdetails.php) joomla components php file , can see textboxes on components front end form. <?php include 'roomdetails.php'; ?> but when click submit button now, redirects me joomla administration index page. doesn't validate data. should do? p.s wrote import statement below joomla component's tag. </form> <?php include 'roomdetails.php'; ?> when use import statement above joomla component's tag submit button doesn't anything, not re-direct. <?php include 'roomdetails.php'; ?> </form>

mysql - Avoid SQL Injection in query using dynamically loaded tables and database names -

i'm developing system manage in simple way tables in database. the system first loads ajax databases user can see , manage. load tables in database , load data table. i have this: $.ajax({ url : "myurl.php", data : { db : $dbselector.val(), table : tabletoload }, success : function (json) { /* cool stuff here */ } }); and i've found cannot use parameterized queries when parameters db name, tables or columns, cannot do: <?php $query = "select * :db.:table"; $st = $pdo->prepare($query); $st->execute( array( "db"=>$db, "table" => $table ) ); $rows = $st->fetchall(pdo::fetch_obj); i cannot use mysql_ or mysqli_ filtering cause don't have installed. you can use: $db = substr($dbh->quote($db), 1, -1); or remove non-alphanumeric characters with: $db = preg_replace('/\w/', '', $db);

Solr DataImportHandler - indexing multiple, related XML documents -

let's have 2 xml document types, , b, this: a: <xml> <a> <name>first number</name> <num>1</num> </a> <a> <name>second number</name> <num>2</num> </a> </xml> b: <xml> <b> <akey>1</akey> <value>one</value> </b> <b> <akey>2</akey> <value>two</value> </b> </xml> i'd index this: <doc> <str name="name">first name</str> <int name="num">1</int> <str name="spoken">one</str> </doc> <doc> <str name="name">second name</str> <int name="num">2</int> <str name="spoken">two</str> </doc> so, in effect, i'm trying use value key in b. usin

facebook - Posting to my FB page as the page owner/admin, not my profile name/id -

i have attempted find answer vis-a-vis fb api, google , forum. what know type of value use 'from' field when posting /page/feed using fb api. i began including 'picture' field , posts page happening fb account , not page does. you must first obtain page access token before can post page. you're going need manage_pages , publish_stream permissions too. page access token, should run request using page administrator's account. assuming you've done login , permission (scope) setting correctly, following code might give idea of how works. assuming $page_id variable holding page's id number. <?php if ($me) { $pageaccesstoken = $facebook->api('/'.$page_id.'?fields=access_token'); if (isset($pageaccesstoken['access_token'])) { // switch use page token instead of user token $facebook->setaccesstoken($pageaccesstoken['access_token']);

c - Checking THRE to send characters via serial -

i'm trying send string serial port using: #define uart 0x03f8 ... #define uart_lsr_thre 0x20 ... void uart_send(unsigned char *data){ int = 0, k = strlen(data); printk("uart_send invoked, data %s , k %d\n", data, k); while(i < k){ while( !(inb(uart + uart_lsr_thre)) ){ printk("called\n"); schedule(); } if(i < k){ outb(data[i++], (uart + uart_tx)); } } } when trying write abcdef, example, skips letters or prints them more once. guess i'm not verifying status of thre correctly, seeing it's not wrong result, while() being there or not doesn't seem doing anything. ideas?

php - What causes downloaded files to become corrupt? -

i stugling understand wrong app. as unable find solution (more here: codeigniter download helper corrupts .7z , .rar files or alternative solutions? ) decided take different approach. so question causes downloaded files via html request (if said right) become corrupt when not corrupted when downloaded via ftp. , follow is, causes specific type of extension become corrupt. since can download zip files fine 7z , rar files corrupted. this header list codeiniter's download helper uses: header('content-type: "'.$mime.'"'); header('content-disposition: attachment; filename="'.$filename.'"'); header("content-transfer-encoding: binary"); header('expires: 0'); header('pragma: no-cache'); header("content-length: ".strlen($data)); the helper uses file_get_contents() in order determine content-length , send. tried use filesize() , send file via r

alchemy - FlasCC open-source download? -

flascc uses several customized gpl libraries, such swig. aren't supposed provide source these libraries? can download it? it's buried in " flascc third party notices " pdf: http://www.adobe.com/go/flascc_oss

types - Get value of CheckBox in GridView, Bit Datatype, asp.net -

i beginner , question or syntax may silly. i have drawn grid view having based on sqldatasource query. converted status field bit. a checkbox automatically created. now how can value of checkbox on selectedindexchanged. protected void gridview1_selectedindexchanged(object sender, eventargs e) { panel_entry.visible = true; int = gridview1.selectedindex; string vdescr = gridview1.rows[i].cells[2].text; checkbox chk = (checkbox)gridview1.rows[i].findcontrol("bitstatus"); response.write(chk.tostring()+vdescr);} system.nullreferenceexception: object reference not set instance of object. error shown. please in regard. when add control dynamically , should load control again , not list in control tree.for finding can use loop find said in post better way find control in asp.net also @ post too: seems useful asp.net findcontrol not working - how come?

kendo ui - Persisting the default value of the numeric text after deleting entered value -

have @ sample here . problem have need have 0.00 value remain in numerictextbox though value deleted in control. @ moment appears empty on ui. can advise cleanest solutions problem? you can achieve goal wiring change event of widget , modify value , model's 1 when triggered. <div id="view"> <div data-template="containertpl" data-bind="source: people"></div> <button data-bind="click: addnew">add</button> </div> <script id="containertpl" type="text/x-kendo-template"> <div> <label for="firstname#:id#">name</label> <input name="firstname#:id#" type="text" data-bind="value: firstname"/> <input data-role="numerictextbox" data-bind="value: income, events: { change: numericchange }"/> </div> </script> var viewmodel = kendo.obser

html - How can I defer embedding a SWF until it's needed? -

i developing product combination of html5 , flash swf (using flex framework) in single page. i'll put swf div can hidden/shown needed. the swf not used of time, i'd defer embedding (or @ least loading/starting) of until first time it's needed. examples i've seen involve static embedding, swf loaded/started when page loads. so how do this? thanks.

xcode - Localizable.Strings not picked up on iOS command line build -

we have command-line build script creates our ipa automatically every day , working until added localization. for reason command-line build not picking localizable.strings. if project built through xcode, works correctly. we passing clean flag through in build, , i've tried emptying derived data , running project > clean within xcode before running build, still doesn't work. the thing can think of, looking @ other questions on here, have other common projects included workspace, , have localizable.strings files themselves, maybe causing conflict? if were, seems me manual xcode build have conflict. is there step missing in command-line build can think of? xcodebuild -workspace project_name.xcworkspace -sdk "iphoneos6.1" -scheme project_name code_sign_identity="$distribution_certificate" provisioning_profile="${provisonning_profile}" clean xcodebuild -workspace project_name.xcworkspace -sdk "iphoneos6.1" -scheme project_nam

inheritance - Can't weakening preconditions and strengthening postconditions also violate Liskov Substitution Principle? -

actual precondition of subtype created combining ( using logical or ) preconditions of base type , preconditions of subtype , makes resulting precondition less restrictive actual postcondition of subtype created combining ( using logical and ) postconditions of base type , postconditions of subtype , makes resulting postcondition more restrictive the following examples of strengthening preconditions , weakening postconditions , result violate lsp ( link ): assume base class works member int. subtype requires int positive. strengthened pre-conditions, , code worked fine before negative ints broken. likewise, assume same scenario, base class used guarantee member positive after being called. subtype changes behavior allow negative ints. code works on object (and assumes post-condition positive int) broken since post-condition not upheld. a) why isn't considered violation of lsp when overridden method weakens precondition , since metho

xcode - ROL / ROR on variable using inline assembly only in Objective-C -

this question has answer here: rol / ror on variable using inline assembly in objective-c 2 answers a few days ago, asked question below. because in need of quick answer, added: the code not need use inline assembly. however, haven't found way using objective-c / c++ / c instructions. today, learn something. ask question again, looking answer using inline assembly. i perform ror , rol operations on variables in objective-c program. however, can't manage – not assembly expert. here have done far: uint8_t v1 = ....; uint8_t v2 = ....; // v2 either 1, 2, 3, 4 or 5 asm("ror v1, v2"); the error is: unknown use of instruction mnemonic unknown size suffix how can fix this? a rotate 2 shifts - bits go left, others right - once see rotating easy without assembly. pattern recognised compilers , compiled using rotate instructio

Mysql Sql statement to Get Position of Student Ranked in order of marks scored -

i need sql give position of student ranked in order of marks scored in specific examtyp e.g. cat! only.the sql below gives position of student not distinguish examtyp.it ranks without considering examtyp. res_id admno stream examtyp termid marks grade points year 1 2129 0 cat1 1 525 c 62 2013 2 4093 0 cat1 1 569 b+ 69 2013 3 2129 0 cat2 1 550 b+ 67 2013 4 4093 0 cat2 1 556 b+ 68 2013 6 2129 0 final 1 559 b+ 68 2013 7 2129 0 average 1 545 b 66 2013 7 4093 0 final 1 581 b+ 70 2013 8 4093 0 average 1 569 b+ 69 2013 $sql = "select 1 + (select count(*) $table a.total_marks > b.total_marks ) rank $table b admno=? , examcategory=? , termid=? , year=? order rank limit 1"; $res

html5 canvas - How to Apply a Normal Map to a Portion of a Mesh? -

the question says all. want apply normal map a portion (a few select faces) of mesh. the normal maps 512 x 512 , come canvas. what ways of accomplishing this? taking @ three.meshfacematerial place start. allow use multiple textures on single mesh. i'm having trouble finding documentation, can check out this little demo on jsfiddle see in action. instead of defining color in each individual material, define it's normalmap intended normal map. then each face can mapped specific texture manually in our example using code like: cube.geometry.faces[desiredfaceindex].materialindex = desiredmaterialindex there slicker methods set modifying mesh before pass three.js. believe if have created model expect multiple textures, can apply them using method shown in fiddle reach desired result. luck!

javascript - YouTube API - Firefox/IE return error "X is not a function" for any 'player.' request -

i've been pulling hair out trying simple youtube api integration working in ff/ie , have had no luck far. it sounds either scope issue or call being made before player initialized i've tried suggests it's not 1 of 2 things. of note, works in (only) chrome. // async api load per yt documentation... var tag = document.createelement('script'); tag.src = "//www.youtube.com/iframe_api"; var firstscripttag = document.getelementsbytagname('script')[0]; firstscripttag.parentnode.insertbefore(tag, firstscripttag); // declare player , set basic functions... var player playvideo = function() { player.playvideo(); } stopvideo = function() { player.stopvideo(); } // yt api ready function... function onyoutubeiframeapiready() { player = new yt.player('player', { videoid: "tkjcg4bmays", events: { 'onstatechange': onplayerstatechange } }); // after player object created, bind popup function page anchors

elasticsearch - Elastica filter not working -

i testing out elastica , elastic search. trying add filter query returns results city location. returning empty. i've tried filter username, , on , returns empty, seem understanding isn't quite correct. here's code analyse, map, search filter $elasticaindex = $elasticaclient->getindex('users'); // create index new $elasticaindex->create( array( 'analysis' => array( 'analyzer' => array( 'indexanalyzer' => array( 'type' => 'custom', 'tokenizer' => 'standard', 'filter' => array('lowercase', 'lb_ngram') ), 'searchanalyzer' => array( 'type' => 'custom', 'tokenizer' => 'standard', 'filter' => arra

Conditionally formatting text strings from Excel using python -

i format spreadsheet (xls or xlsx) cells containing word or ending string formatted filling background specific color. for example, if cell contains word 'deleted', fill black , paint text white. if cell ends '.pf', paint cell red. i found similar question several years ago suggested following: import xlrd import xlutils.copy inbook = xlrd.open_workbook('input.xls', formatting_info=true) outbook = xlutils.copy.copy(inbook) def _getoutcell(outsheet, colindex, rowindex): """ hack: extract internal xlwt cell representation. """ row = outsheet._worksheet__rows.get(rowindex) if not row: return none cell = row._row__cells.get(colindex) return cell def setoutcell(outsheet, col, row, value): """ change cell value without changing formatting. """ # hack retain cell style. previouscell = _getoutcell(outsheet, col, row) # end hack, part outsheet.w

facebook fql - Need current syntax for writing an FQL query in PHP -

because using graph comment information craps out @ volume (even pagination) need fql solution. unfortunately, documentation , blogs i've found contain deprecated samples making impossible me figure out correct syntax. i need understand how this: select object_id, post_id, fromid, time, text, username comment object_id in (select comments_fbid link_stat url='*** event href ***') into php variable can access data decoded json object so: $fql_obj = json_decode($fql_query, true); i figured out. else confused append graph lookup , replace spaces +s: $fql_query = "https://graph.facebook.com/fql?q=select+object_id,+post_id,+fromid,+time,+text,+username+from+comment+where+object_id+in+select+comments_fbid+from+link_stat+where+url='***eventhref***')"; $fql_obj = json_decode($fql_query, true);

iphone - in ios dev, how to handle case based animations? -

my questions best asked stating problem: in app, there 2 button choices, lets 1 & 2. when click , hold on 1, 2 fades out (alpha change) on .3 seconds, , vice versa. if user 'cancel's' button touch (by dragging finger away button , releasing) opposite button fades in. this works great. problem arises when user not hold down on button, , clicks touch registered in under .3 seconds (the time takes other button fade out) thing there more animations have happen after guess issue animations further down line interrupt .3 sec fade , things start awkward. suggestions work this? thank you! as suggested in this post , should create secondary uiview animation goes same animation endpoint 0.3 second one. make sure set animation begin current state, , give short time let you. views @ end of first animation, , happen more quickly. after animation done, other animations based on button results. [uiview beginanimations:nil context:null]; [uiview setanimationbe

XAML/WPF focus textblock -

are textblocks focusable in wpf? want change background color of textblock if 1 focused, want in xaml. have now. bunch of textboxes in stackpanel. can xaml target non focus or base state, when try add trigger, background not change on focus. code below: <style x:key="queuelisttextblocks" targettype="textblock"> <setter property="background" value="#027802"></setter> <setter property="foreground" value="white"></setter> <setter property="padding" value="10,5"></setter> <setter property="margin" value="5,2,5,0"></setter> <setter property="fontsize" value="14"></setter> <setter property="focusable" value="true"/> <setter property="cursor" value="hand"></setter&

How to display html as text in email -

Image
i'm trying output example html code in html email plain text, can't figure out how it. tried changing > &gt; , < &lt; . tried using <pre></pre> tag doesn't seem work either. i've seen done before. idea how this? here's original code: <a href="http://www.schedulicity.com/scheduling/default.aspx?business={!account_externalid}" title="online scheduling" target="_blank"><img src="http://www.schedulicity.com/business/images/schedulenow_lg.png" alt="schedule online now" border="0" /></a> this source looks like: this preview looks like: this final sent email looks like: add \r\n content-type: text/plain; in headers, or change existing. if want part of body not translated try putting <xmp></xmp>

dvcs - EGit: what problems will I run into because there's no Recursive Merge available? -

i've been looking using egit eclipse. apparently it's based on jgit not complete implementation of git - no recursive merge functionality. if i'm understanding ramifications, means there issues criss-cross merges , file renaming. but issues like? / how painful work-arounds? the recursive merge strategy default since egit 3.0 (see bug 380314 ).

Allow Anonymous users to search for plone Members -

i'm trying allow anonymous users search plone members. got work setting anonymous role have "manage users" permission, not appropriate, of course. is there more specific permission this? "list portal members" didn't work. need allow anonymous search because our intranet users don't authenticate. our plone members come ldap custom fields (telephone, location, register). done plone.app.ldap. i'm using plone-4.0 , plonepas-4.0.1-py2.6 this triggers exception , open login_form anonymous users member_search_results.pt <metal:main fill-slot="main" tal:define="search_view here/@@pas_search; listing_allowed python: checkpermission('list portal members', here); results python:listing_allowed , search_view.searchusersbyrequest(request, sort_by='fullname') or []; if set listing_allowed false , template rendered normally, informing user couldn't search, because h

java - Navigate through a "chain" in OrientDB -

background: i new in orientdb, test in java days see if db need. context: suppose have similar linkedlist, made vertex , (o) edges (-): o - o - o - o - o - o - o - o each vertex has field called "name" , edge labeled "bestfriend". question: i need print names of of vertex of "chain". there way or api method navigate through entire list in fast way, complexity < o(n)? thank you try like: select name ( traverse out('bestfriend') #10:44 ) assuming #10:44 root vertex's id.

How to compile an Android project with command line -

i have android project java code , jni code. has 'android.mk', how can compile project? i tried 1. go top of android repository 2. source build/envsetup.sh 3. mmm {path top level of project} but don't see project compiled. any idea?

css - HTML5 Elements won't display:none; in IE even when using Modernizr -

i'm chucking quick splash page users visiting website in ie8 or below. i'm using modernizr's .lt-ie9 class target document, using css (with of sass) hide main content , show 'ie-warning'. .lt-ie9 { body { background:none; } .container { display:none; } footer { display:none; } .ie-warning { display:block; text-align:center; } } everything working except display:none; on footer element, of course html5 element. i'm @ loss why won't hide, it's not showing in inspector or being overwritten else.

javascript - Using Highcharts and displaying a message over or on the chart when there is no data -

i'd know if there built-in or accepted way show label or message on chart (or chart be) if there no data series. i couldn't find in highcharts docs , i'm trying stay away using jquery (or javascript in general) check if result has data , changing dom on own. the data coming in json mvc 3 controller call if helps or changes anything. ideally message displays on empty chart users know chart object there. thanks! there official plugin shows 'no data display' message, after loading message, when there no data loaded chart. i've found quite handy when user allowed select time range search , filter form, , no results returned search. looks better having empty chart. here link announcing plugin, , jsfiddle example. http://highcharts.uservoice.com/forums/55896-general/suggestions/1065633-display-no-data-to-display

incompatible types when trying to make random in java -

this question has answer here: java error: cannot find symbol, , can't figure out why 3 answers error: error: incompatible types question: have change or add code make work? this line: kies kiesnaam = lijst.get( n ); class: class kies extends onthoudnaam implements actionlistener { public void actionperformed( actionevent e ) { random r = new random(); int n = r.nextint(lijst.size() ); kies kiesnaam = lijst.get( n ); textvak2.settext("" + kiesnaam ); } } the whole code: import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; import java.util.*; // main method make frame public class loterij3 extends jframe { public static void main( string args[] ) { jframe frame = new loterij3(); frame.setextendedstate( frame.maximized_both ); frame.setdefaultcl

theory - Tail v. Head Recursion -

i wondering if identify head or tail recursive function: int exponentiation(int x, int y){ if(!y) { return 1; } return y > 1 ? x * exponentiation(x, y-1) : x; } this not tail recursion: returning result of exponentiation not last action taken function; multiplication x is. however, function easy convert tail-recursive implementation adding parameter, exp: int exponentiation_tail(int x, int y, int exp = 1){ if(y <= 0) { return exp; } return exponentiation_tail(x, y-1, exp*x); }

Advanced PHP Regex - Parse Wordpress Post Content -

i need extract text wordpress post.here code doesn't work, guess because regex, works fine on expresso, yet doesn't work on php. $content = get_the_content(); preg_match('\<form id="form1.*?(?=<zmfj>)\', $content, $matches); $setupform = $matches[0]; echo $setupform; in case variable content be: <form id="form1" method="post" action="http://google.com"><zmfj> so extraction result should be <form id="form1" method="post" action="http://google.com"> preg_match("/<form[^>]+>/", $content, $matches); //the [^>]+ bit matches consecutive characters not ">"