Posts

Showing posts from April, 2014

each - jQuery change text of a div if it's sibling contains a certain string of text -

so know how this, have multiple elements .each(function() running on, need make sure .modules contain spans "open 24 hours" trigger change of div "always open" , can't figure out doing wrong if (thistimeset === 'open 24 hours'){ $(this).siblings("div").text("always open"); } full working demo of app: http://jsfiddle.net/dxav7/ have ton of comments because pretty new js , need walk myself though doing (newb) thanks can provide! try this:- problem here have many spans same text === doesn't match. using indexof find instance of atlease 1 mean "always open" if (thistimeset.indexof('open 24 hours') > -1) { $(this).find('.openornot').text("always open"); } another thing add not looking @ siblings of .module instead child .openornot . need use find descend down instead of looking @ peers using siblings . demo edit:- per comment can select spans visible ...

c# - PDF does not reload on directory browsing -

hi guys follow question , think real issue here. click here whenever access file using directory browsing (eg. http://localhost/temp/1.pdf ) render old or previous pdf file if change entire file same file name, example have 1.pdf content delete file on directory replace new , different content , rename 1.pdf when access using browser render previous value not new 1 replace. happens on ie , opera browser. please need production issue. edit: found strange, example have url location of pdf file (eg. http://localhost/website/tempfolder/1.pdf ) first pdf generated show part in code change casing of letter example 't', change 't' newly pdf shows when revert old case expecting show new pdf sad first pdf file shows. your browser caching pdf files. for ie, can ctrl f5 force reload web server. or put random query string in url e.g. /temp/1.pdf?v=1, /temp/1.pdf?v=2 assuming server iis, permanent solution configure http response headers. go iis manager nav...

multithreading - Can't get MFC worker thread to pass hWnd or MDI window pointer to thread -

for reason passing hwnd or pointer of newly created mdi window cannot recasted original value in worker thread. i've tried creating thread app class, document class , view class. have same effect. i'm using global function worker thread. funny thing i'm using same code used same thing in mfc mdi in 1998 , worked great doesn't seem work now. perhaps i'm not seeing problem. going on here? want simple, create new view window, capture it's hwnd , pass hwnd worker thread worker thread can send messages window print strings , forth. i'd launch thread document class. compiler vs2010 , it's being run in debug. after reading this: http://msdn.microsoft.com/en-us/library/h14y172e%28v=vs.100%29.aspx , realize can't pass pointer view class around worker threads. i'm focusing on hwnds. in ontestconnect block, valid hwnd returned valid pointer new view window. here's code (from app class): struct threadparms { hwnd hwndview; ...

Jquery Button CSS - Padding and Margin -

ok... may stupid question, can't remove paddings , margins simple jquery button. what doing wrong??? see fiddle: http://jsfiddle.net/liviozanol/mlmta/ body { padding: 20px; } #btnclose { padding: 0px !important; margin: 0px !important; } #image { padding: 0px !important; margin: 0px !important; you're targeting wrong elements - padding on <span class="ui-button-text"> not containing div. use #btnclose .ui-button-text override current declaration http://jsfiddle.net/mlmta/2/ #btnclose .ui-button-text { padding: 0; }

c++ - Getting a unique_ptr out of a priority queue -

i maintaining set of unique_ptr instances in priority_queue . @ point, want first element , remove queue. however, produces compiler error. see sample code below. int main () { std::priority_queue<std::unique_ptr<int>> queue; queue.push(std::unique_ptr<int>(new int(42))); std::unique_ptr<int> myint = std::move(queue.top()); return 1; } this produces following compiler error (gcc 4.8.0): uptrtest.cpp: in function ‘int main()’: uptrtest.cpp:6:53: error: use of deleted function ‘std::unique_ptr<_tp, _dp>::unique_ptr(const std::unique_ptr<_tp, _dp>&) [with _tp = int; _dp = std::default_delete<int>]’ std::unique_ptr<int> myint = std::move(queue.top()); ^ in file included /usr/include/c++/4.8/memory:81:0, uptrtest.cpp:1: /usr/include/c++/4.8/bits/unique_ptr.h:273:7: error: declared here unique_ptr(const unique_ptr&) = delete; ^ c...

ios - current goals hides facebook ok button during Facebook authorization in a web view -

we using latest facebook ios sdk (3.5) , have following problem webview login. current goals tab hides facebook ok , cancel button user not able authorize app. steps reproduce: 1) login using facebook sdk uiwebview 2) "you have authorized ..." text appears 3) both ok , cancel button hidden , view not scrollable. is there workaround issue? ------------- update ------------- the issue fixed facebook. i'm not sure if ios users, can tell how fixed app in android in case else runs across bug (and perhaps can translate fix ios). in facebooksdk modified com/facebook/widget/webdialog.java, once web dialog loaded "current goals" block , hide (if exists). in com/facebook/widget/webdialog.java: private class dialogwebviewclient extends webviewclient { // ... other methods ... @override public void onpagefinished(webview view, string url) { super.onpagefinished(view, url); if (!isdetached) { spinner.dism...

window - How do I restore a minimized batch script? -

i have batch script have minimized @ point in script i'd able restore window can done? you can nircmd useful tool writes batch scripts should have in arsenal. here example of doing want. when run it, minimize script window, in 10 seconds restore it. @echo off title "my script" nircmdc win min ititle "my script" set /a i=0 :loop ping -n 1 127.0.0.1>nul set /a i+=1 if %i% equ 10 goto :max goto :loop :max nircmdc win activate ititle "my script" cmd /k

Calling C functions from fortran -

i'm trying call c functions using fortran (need project). first trying call non parametrized, void function via fortran. kindly me resolve following errors in given code. c code matrix multiplication: #include <stdio.h> extern "c" { void __stdcall mat(); } void mat() { int m, n, p, q, c, d, k, sum = 0; printf("enter number of rows , columns of first matrix\n"); scanf("%d%d", &m, &n); int first[m][n]; printf("enter elements of first matrix\n"); ( c = 0 ; c < m ; c++ ) ( d = 0 ; d < n ; d++ ) scanf("%d", &first[c][d]); printf("enter number of rows , columns of second matrix\n"); scanf("%d%d", &p, &q); int second[p][q]; if ( n != p ) printf("matrices entered orders can't multiplied each other.\n"); else { printf("enter elements of second matrix\n"); ( c = 0 ; c < p ; c++ ) ( d = 0 ; d < q ; d++ ...

python - loading strings with spaces as numpy array -

i load csv file numpy array. each row contains string fields spaces. tried both loadtxt() , genfromtxt() methods available in numpy. default both methods consider space delimiter , separates each word in string separate column. there anyway load sort of data using loadtxt() or genfromtxt() or have write own code it? sample row file: 826##25733##emanuele buratti## ##mammalian cell expression here ## delimiter , space denotes missing values. i think problem default comments character # conflicting delimiter. able load data this: >>> import numpy np >>> np.loadtxt('/tmp/sample.txt', dtype=str, delimiter='##', comments=none) array(['826', '25733', 'emanuele buratti', ' ', 'mammalian cell expression'], dtype='|s25') you can see dtype has been automatically set whatever maximum length string was. can use dtype=object if troublesome. aside, since data not numeric, recommend us...

android studio error startup in ubuntu -

i had installed android studio in ubuntu 13.04 , it'was easy when launch first error printed in terminal: error: null java.lang.reflect.invocationtargetexception @ java.awt.eventqueue.invokeandwait(eventqueue.java:1269) @ java.awt.eventqueue.invokeandwait(eventqueue.java:1244) @ javax.swing.swingutilities.invokeandwait(swingutilities.java:1349) @ com.intellij.util.ui.uiutil.invokeandwaitifneeded(uiutil.java:1991) @ com.intellij.openapi.externalsystem.util.externalsystemutil.refreshproject(externalsystemutil.java:353) @ com.intellij.openapi.externalsystem.util.externalsystemutil.refreshprojects(externalsystemutil.java:228) @ com.intellij.openapi.externalsystem.service.externalsystemstartupactivity$1.run(externalsystemstartupactivity.java:43) @ com.intellij.openapi.externalsystem.service.externalsystemstartupactivity.runactivity(externalsystemstartupactivity.java:50) @ com.intellij.ide.startup.impl.startupmanagerimpl$2.run(startupmanagerimpl....

heroku - Best practices for sending email to lots of recipients (Rails + SendGrid) -

i sending bulk emails rails app , plan on using sendgrid. assuming best send separate email each recipient (as opposed using bcc recipients). if true, should using delayedjob queue messages going on sendgrid, or safe throw 500 messages @ @ once? thanks! 500 messages isn't sendgrid. it's not blip on radar. worked company sent out 2.7 million emails in single month, , it's just blip. with sendgrid api's capabilities, wouldn't sending out 500 emails, send one email has specific sendgrid api header set. why? because have ever tried send 500 individual email messages , timed how long takes? how a single email ? single email's going quicker. the sendgrid api has ruby example here: https://sendgrid.com/docs/integrate/code_examples/smtp_api_header_examples/ruby.html . that's quite long winded , messy, let me simplify you. basically, set in email: headers["x-smtpapi"] = { :to => array_of_recipients }.to_json sendgrid parse , se...

jquery - Javascript API writing -

<div id ="filter"> <select id= "s1"/> <select id= "s2"/> <select id= "s3"/> <select id= "s4"/> <select id= "s5"/> <select id= "s6"/> </div> so create filters select elements of different ids in each of many data population , change events similar. wanted create api this: new filter({ele1:$("#s1"), ele2:$("#s2"), ele3:$("#s3"), ele4:$("#s4")}) this filter should handle population , change events. function filter(map) { this.ele1 = map.ele1.id; this.ele2 = map.ele2.id; //similarly other elements. this.e1e1.change(function(){ //these elements uses selectors of other elements how can access ele2, ele3 , on... }); } the problem here change events should able access other variables ele2,ele3 of filter object. i'm not sure question is, juggling id-s contraproductiv...

how to call only blocktopmenu module in prestashop -

can tell me how call blocktopmenu module in prestashop...if use displaytop hook calls various other modules along it..but want call blocktopmenu ..is possible create object of blocktopmenu class , access hookdisplaytop() of class..so can avoid other modules...i tried not working when try implement call module in tpl file in prestashop it shows "this module cannot transplanted hook." when call hook::exec() can specify module id in 3rd parameter. that: hook::exec('displaytop', null, module::getmoduleidbyname('blocktopmenu')); regards,

ios - My project doesn't work for simulator iPhone 6.1 -

Image
symptom it works if try run iphone 5.1 if run simulator 6.1 project start , "finish". that's it. no error message. nothing. i put breakpoint @ - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions it's never called clean project doesn't solve issue i don't know else can do. because of cannot take screen shot of 4 inch. seems 4 inch retina screenshot can done simulator 6.1 when run application . don't select deployment target 6.

Confusion about SQL Server snapshot isolation and how to use it -

i newbie ms sql server. few months experience maintaining sql server sps. reading transaction isolation levels optimising sp , quite confused. please me below questions: if run dbcc useroptions in clientdb, default value isolation level 'read committed'. mean db set isolation level set read_committed_snapshot on ? is set transaction isolation level (at transaction level) same set read_committed_snapshot on (at db level)? mean if db has snapshot enabled, can set isolation level in sp , process data accordingly? is allow_snapshot_isolation similar above? i have sp starts off long running select statement dumps it's contents temp table. uses temp table update/insert base table. there 8 mil records being selected , dumped temp table, similar number of total rows updated/inserted. problem facing sp takes disk space. client db , not have permissions check disk space/log size etc in db. not know if tempdb/tempdb-log taking disk space or clientdb/clientdb-log is. disk sp...

css - Polaroid Effect Acting Strange -

i'm new css , have been getting fine far going through tutorials , reading of great advice on site cant head around one. trying achieve polaroid effect using css , getting weird effects on website. have tested code on jsfiddle , works fine, copied entire sites css , still worked fine in jsfiddle. use code on website margins, padding, rotation etc. wrong. please i'm @ loss here , don't know affecting it, idea reason css selectors using not selecting elements properly. the site page is: http://kamhairandmakeup.co.uk/vintage/ the jsfiddle is: <iframe width="100%" height="300" src="http://jsfiddle.net/deepwaterlizard/nxsuq/1/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe> or http://jsfiddle.net/deepwaterlizard/nxsuq/1/ i can post css , html here if needed didn't want take space, thank in advance. i not entirely sure, starters, first image (black , white) has htm...

java - How can I get a bean from the servlet context instead of the root context? -

i have spring-mvc application has autowired beans use of <context:component-scan base-package="com.example.app" /> within dispatcherservlet context configuration. i have situation wish access service bean non bean class, requestcontextawaretag implementation. i can access beans registered in root context follows: applicationcontext ctx = webapplicationcontextutils.getwebapplicationcontext( pagecontext.getsession().getservletcontext()); myservice svc = ctx.getbean(myservice.class); if bean registered in dispatcher context nosuchbeandefinitionexception . if it's possible prefer @service beans registered in root context without @controller beans being picked up, , have @controller beans picked in dispatcher context. problem <context:component-scan/> picks both. if not possible need way access dispatchers applicationcontext retrieve service beans. any guidance appreciated. i have managed solve splitting 2 component-scan co...

tomcat - PS Perm Gen && Perm Gen JVM PROPERTIES? -

i need information: i have 2 redhat 6.1 linux server tomcat 7.0.28 , java jdk1.7.0_05 on 192.168.1.20(tom04) have 1 instance tomcat 7 mbean "java.lang:type=memorypool,name=perm gen" on 192.168.1.21(tom01) have 1 instance tomcat 7 mbean "java.lang:type=memorypool,name=ps perm gen" why mbean not same "perm gen && ps perm gen" mean? ( want ps perm gen everywhere ) http://img27.imageshack.us/img27/5803/tom01u.png http://img839.imageshack.us/img839/7539/tom04.png java version same: java -version java version "1.7.0_05" java(tm) se runtime environment (build 1.7.0_05-b06) setnenv.sh 192.168.1.20(tom04): !/bin/bash ld_library_path=$ld_library_path:$catalina_home/lib export ld_library_path export java_home=/usr/java/default java_opts="$java_opts -xmx1024m -xms512m -xmn384m -server -xx:maxpermsize=384m" java_opts="$java_opts -dlog_root_path=/opt/applogs/instance01...

forms - CUploadedFile::getInstance Always Returns Null on Uploaded File -

i have built form in yii , need process uploaded file. followed this guide , i've stumbled upon issue. cuploadedfile::getinstance returns null. here's use. model: class additionalfieldfile extends cformmodel { public $uploadedfile; /** * @return array validation rules model attributes. */ public function rules() { return array( //note wont need safe rule here array('uploadedfile', 'file', 'allowempty' => true, 'types' => 'zip,doc,xls,ppt,jpg,gif,png,txt,docx,pptx,xlsx,pdf,csv,bmp'), ); } } and handling uploaded file in controller on form submit: $model = new additionalfieldfile(); $model->uploadedfile = cuploadedfile::getinstance($model, 'field_'.$type_field.'['.$id_common.']'); and after $model->uploadedfile null reason. note $type_field , $id_common come dynamically. also, form has 'enctype'=>'mul...

html - How to give automatic width to divs inside outer div? -

Image
i have divs <div id='top' > <div id='top-border' > </div> <div id='top-menu' > <jdoc:include type="modules" name="top-menu" style="well" /></div> </div> and style #top { width:100%; height:40px; overflow: hidden; } #top-border { background: url(../images/border.png) repeat-x scroll 0px 18px; position: relative; /*width:74%;*/ height:40px; float:left; overflow: hidden; } #top-menu { margin:0; float:right; height:40px; padding-top:6px; } what want put content in top-menu shrink automatically depending content. rest width given top-border has background image. when give width top-border works fine. want flexible width not fixed. idea? you can use table(width:100%) instead of outer div. replace top-border , top-menu use td. top-border td use css "width: 1px; white-space: nowrap;"

How to check if select query is returning more than one value in java -

i executing select query through preparedstatment, have raise exception in basis of if resultset contains more 1 value,so question how determine rs returning multiple values.? try this: resultset lresult = stmt.executequery("select a,b,c yourtable"); boolean lmorethanone = lresult.first() && lresult.next();

eclipse - Creating a jar file from Scala project without using Sbt or Maven -

i developed scala project using scala eclipse ide. how jar file project can run scala classes present in project through command line? you don't need use sbt in order create executable jar file. jar file zip file fixed internal structure. jar file can contain file "meta-inf/manifest.mf" metdata instance main class. refer jar file article on wikipedia more information. there command line tool called "jar" can creating valid java archive.

c# .dat file assign to variable -

how can assign a variable, located @ same project, example @ project created folder named app_data , example file file.dat , how can assign file @ variable,.. example: var file = app_data/file.dat i need assigned variable because using variable parameter method,.. used : var file= httpcontext.current.request.mappath("/app_data/file.dat"); but want path @ same project if should absolute path should fine too you need read file using 1 of available methods (streams, readers, etc). the easiest be: string filecontent = file.readalltext(filenameandpath); where variable filenameandpath contains full path , file name file described darin dimitrov.

javascript - jQuery slide up/down effect not working on div -

developing asp.net web forms application using vs 2010 & have login textbox , password textbox on page. above have simple div tag contain error message if login textbox or password textbox empty. jsfiddle <div id="errordiv"></div> i wanted div slide down showing error message if either text box empty following jquery code have tried: <script> $(function () { $("#btnlogin").click(function () { var error = 0; if (error == 0) { $("#errordiv").slidetoggle(); } if ($("#txtloginid").val() == "") { error = 1; $("#errordiv").text("please enter loginid"); } if ($("#txtpassword").val() == "") { error = 1; $("#errordiv").text("please enter password"); } if (error == 1) { alert(document.getelementbyid(...

open a Finder's window with applescript a set focus on the spotlight search box -

Image
i want open finder's window folder , set focus search box, can start typing right away. script have far (ok, open new finder's tab, not window, totalfinder), , have not been able find focus be. any hint? thank you. property the_path : "/users/solignani/google drive/c-avv19/doc di lavoro/pratiche/" set the_folder (posix file the_path) alias delay 0.5 -- necessario per evitare che tasti vengano premuti assieme tell application "finder" activate if window 1 exists tell application "system events" keystroke "t" using {command down} -- apre un nuovo pannello end tell set target of window 1 the_folder else open the_folder end if end tell you can add tell application "system events" keystroke "f" using {command down} after setting target of window. select search bar , enable start searching immediately. if not search in current folder (or target selected window) go find...

javascript - JS-variable used with mailto is not updated -

encountered problem - want include js-variable in body of mail, users can forward friends, using following: <head> <script src="javascript.js" type="text/javascript"> </script> <body> <script type="text/javascript"> document.write('<a href="mailto:?subject=subject&body=bodytext' +total+ '">mail me</a>');</script> </body> the var total defined in .js file, , it's value can manipulated executing af function attached form. even after function carried out , page displays changes, opened mail display default value of var total instead of manipulated. basically question is: how modified var total display inside mailto-link, instead of default var total. disclaimer: i'm not smart (when comes coding @ least). bonus-info: i've made possible share var total facebook using fb.init etc., displays manipulated var. edit: js (cut bit short): var ...

javascript - Remove all occurrences of text within string -

say had string in javascript looked this: var str = "item%5b9%5d.something%5b0%5d.prop1=1&item%5b9%5d.something%5b0%5d.prop2=false&item%5b9%5d.something%5b0%5d.prop3=10%2f04%2f2013+00%3a00%3a00&item%5b9%5d.something%5b1%5d.prop1=2&item%5b9%5d.something%5b1%5d.prop2=false&item%5b9%5d.something%5b1%5d.prop3=10%2f04%2f2013+00%3a00%3a00&item%5b9%5d.something%5b2%5d.prop1=3&item%5b9%5d.something%5b2%5d.prop2=false&item%5b9%5d.something%5b2%5d.prop3=29%2f04%2f2013+00%3a00%3a00&item%5b9%5d.something%5b3%5d.prop1=4&item%5b9%5d.something%5b3%5d.prop2=false&item%5b9%5d.something%5b3%5d.prop3=29%2f04%2f2013+00%3a00%3a00" and wanted this: var str = "something%5b0%5d.prop1=1&something%5b0%5d.prop2=false&something%5b0%5d.prop3=10%2f04%2f2013+00%3a00%3a00&something%5b1%5d.prop1=2&something%5b1%5d.prop2=false&something%5b1%5d.prop3=10%2f04%2f2013+00%3a00%3a00&something%5b2%5d.prop1=3&something%5b2%5d.prop2...

Adding data to data bound DataGridView (WinForms, C#) -

i have 3 tables: order (orderid, columnxy ..) orderitem (orderid, itemid, quantity) item (itemid, name, price) the order table bound datagridview . on selection changed order dgv, ordereditem dgv populated this: view.getordereditemdatagridview().datasource = datacontext.orderitemset.where(o => o.orderid == orderid).select(o => new { o.item.id, o.quantity, o.item.price }).tolist(); upon pressing additembutton , dialog opens pick item, after item should added ordereditem dgv: using (var form = new orderitemview(datacontext.itemset.tolist())) { if (form.showdialog() == dialogresult.ok) { // add selected item orderitemview ordereditem dgv } else { } } the changes supposed saved later, clicking saveorderbutton, or canceled clicking cancelorderbutton. void view_saveorderclicked(object sender, eventargs e) { // order data int customerid = convert.toint32(view.ordercustomerid); order.customerid = customerid; order.weight ...

sql - Update table values using 2 tables -

i have 2 tables follows: comment text record_id_fk sort_order comment_text ----------------------------------------- 101 1 test text 101 1 more test text 101 1 more... 101 2 more... 101 2 more... 101 2 more... 101 2 more... 101 3 more... 101 3 more... 101 3 more... 102 1 test text 102 1 more test text 102 1 more... 102 2 more... 102 2 more... 102 2 more... 102 2 more... 102 3 more... 102 3 more... 102 3 more... products product_id sort_order record_id_fk ----------------------------------------- 111 ...

plone - Make new user data (collective.example.data) visible -

i followed collective.examples.userdata directive add fields member , works fine. new infos stored , visible in @@personal-information i'd go next step , show new fields in author.cpt page make new fields visible every members(in site directory instance). i think need customize membershiptool.getuserinfo() function don't how proceed. anyone knows how show new fields in author.cpt ? thanks

javascript - PHP file - Populating a dynamic <select> tag with values from a database issues -

okay problem have form contains select tag needs dynamically populated database, values populated determined postcode/zipcode user enters without submitting form. for example postcode of 1234, drop down list contain values x1, x2, x3 if postcode of 4321, drop down list contain values y1, y2, y3 i have done testing , sql statement fine, can populate tag on submitting form, yet dont know how implement on how without submitting page. i understand difference between js , php, onblur() js function used dynamically change drop down device, calling php function or having embedded php code somehow inside... im stumped on how javascript or php..(since it's assignment) , yes have looked on how this. you need onchange() , ajax method re-load select https://developer.mozilla.org/en-us/docs/web/api/element.onchange so once select option select tree re-loaded via ajax

c# - How to know when Web API Routing Engine Doesn't Find a Matching Service? -

i'd log requests web api application results in 404 (which means routing engine couldn't find matching service). how possible? for example, if have below mapping: config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); then calling below return 404: api_rootnotvalid/controllername i want capture such requests , log them. i've created class inheriting delegatinghandler when routing engine succeeds finding service goes delegatinghandler. so think there should else can help? i think tricky thing do...some info might need consider: route matching happens @ different stages when compared webhost(iis) , selfhost. web api stack diagram reference. webhost - happens before message handlers run. delegating handler wouldn...

java - How to specify a field, so that when we query, using Joda LocalDate or LocalDateTime value for the field, it is mapped to same column? -

i have postgres database has table "draft" containing column set_up_time, saved timestamp: @column(nullable = false) @type(type = "org.jadira.usertype.dateandtime.joda.persistentlocaldatetime") localdatetime setuptime; for reasons need keep structure is. expecting database queries searching records, setuptime localdatetime , setuptime localdate . how can map in way, hibernate queries database both these types setuptime, , returns results accordingly? the schema using : "create table draft (dtype varchar(31) not null, id int8 not null, creation_time timestamp not null, cust_ord varchar(1), description varchar(255), amount decimal(12, 2), user varchar(6), txn_time timestamp, text1from varchar(36), text2from varchar(36), text3from varchar(36), primary key (id))" what can write queries this: public void finddrafts(localdate targetdate) { final query query = entitymanager.createquery( "from draft setuptime => :beginofda...

Android Studio Add Jar give error -

hi try add nineoldandroid.jar , when run project give erros gradle: failure: build failed exception. * went wrong: execution failed task ':customproject:compiledebug'. > compilation failed; see compiler error output details. * try: run --stacktrace option stack trace. run --info or --debug option more log output. i can't understand me doing! put jar libs folder right click , hit ' add library ' clean build (you can fine in android studio, make sure navigated in terminal root folder of app , typed gradlew clean (i'm on mac os x, command might different on system)

c# - setting picture in image UI element using file picker -

in app user can set profile pic device memory i.e tablet memory or desktop local drive , upload server. used file picker user can select 1 picture , set profile picture, problem picture not sticking image element. code: private async void filepicker() { fileopenpicker openpicker = new fileopenpicker(); openpicker.viewmode = pickerviewmode.thumbnail; openpicker.suggestedstartlocation = pickerlocationid.pictureslibrary; openpicker.filetypefilter.add(".jpg"); openpicker.filetypefilter.add(".jpeg"); openpicker.filetypefilter.add(".png"); storagefile file = await openpicker.picksinglefileasync(); if (file != null) { string filepath = file.path; system.diagnostics.debug.writeline(filepath); uri uri = new uri(filepath, urikind.relative); profilepicture.source = new bitmapimage...

c# - Sql Query for unknown number of keywords -

i want write sql query unknown number of keywords. keywords (tags) stored in table column1 column2 item1 tag1 item1 tag2 item1 tag3 . . . . . . user can enter number of keywords search against table. if and used strict search. if use or search items match 1 keyword. want query dynamically shape , use maximum keywords given in search if not of them. vehicle item , has keywords. car, vehicle, conveyance, cycle, bike, truck . want enter keywords bike cycle in textbox should form query search vehicle item. you can search or operators or equivalent in (...) expression, group rows item column, , compare row counts. row highest count has highest number of keywords search list: select top 1 column1, count(*) mytable column2 in ('tag1', 'tag3') group column1 order count(*) desc ...

jquery - Set a parents parent css using javascript/ knockout -

i've got checkboxes within table , want css of parent dependent upon whether it's checkbox checked or not. can't seem work , hoping point me in right direction. at moment, i've got setcss() function on checkbox 'onclick' method getting resource undefined error. i've added jsfiddle function setcss() { if (this.checked) $(this).closest('td').classname = "selected"; else $(this).closest('td').classname = "deselected"; } you can quite using knockout css binding: <td data-bind="css: {'selected': selected,'deselected': !selected() }"> <!-- existing content --> </td> i've updated your fiddle work in way. this binding means "set 'selected' class if selected() evaluates truthy value, , set 'deselected' class if evaluates falsey". you neaten css using :not(selected) instead of explicit deselected class

nfc - Mifare ultraligtht and APDU commands -

i looking list on various apdu commands, supported mifare ultralight cards, have tried search how lock bytes, making them permanently readonly, far unable find anything, possible set of these blocks readonly, or there permanently reset card 0 ? thanks again all information looking in document "nfc forum type 2 tag operation specification 1.1" here copy: http://apps4android.org/nfc-specifications/nfcforum-ts-type-2-tag_1.1.pdf in general, if looking technical details, try nfc forum specifications first. you'll find pretty nfc related in them.

events - GWT - Handler for lost focus on widgets in flextable -

i'm coding in gwt, first time, , it's going far. i'm having problem eventhandlers though. have flextable has 2 columns, 1 labels, , 1 textbox/listbox fields. when user insert datas textbox , leaves textbox again, want write contents object. quite easy, but, can't figure out how make actionhandler it? works fine onclick event, want on focus focuslistener, it's deprecated...! need in gwt, onlostfocus eventhandler of type. add blurhandler on textbox . gets called when textbox lose focus.

How to display non-ascii in emacs? -

i looking @ text files of portuguese words in firefox, , see accented characters correctly, when download text files , open them in emacs, see n\372mero (which número), rela\347\343o (which relação), , on. needs done display words correctly in emacs? try m-x revert-buffer-with-coding-system . looks file in latin-1 .

jquery - Client side validation of from which is using partial views -

i completed visualization logic form , want use of client side validation asp.net mvc 3 provides. though i'm following examples can't make work , don't know might reason. here main view : @model list<dataaccess.mcs_documentfields> @{ viewbag.title = "documents"; } <div id="drawform"> @using (html.beginform("recievedatafromdocument", "forms", formmethod.post)) { @html.validationsummary(true) <table border="1"> <colgroup> <col span="1" style="width: 10%;" /> <col span="1" style="width: 40%;" /> <col span="1" style="width: 25%;" /> <col span="1" style="width: 25%;" /> </colgroup> @html.partial("_partialheader", model) @html.partial("_partialdrawing", model) @html.parti...

iphone - Checking a null value from Json response in Objective-C -

[ { "at" : null, "ea" : null, "ad2" : "", "op" : null, "adslst" : [ ], "ems" : null, "nd" : { "mn" : null, "fn" : "sony", "ln" : "j" }, "zp" : "23456", "ct" : 1, "pp" : 0, "cid" : 161464, "pos" : null, "wpext" : null, "os" : 0, "hp" : "(345) 678-7890", "bttc" : 0, "pwd" : null, "uid" : 627, "did" : 0, "un" : null, "cy" : "salt lake", "comp" : null, "pmc" : 0, "aea" : null, "and" : null, "dob" : "1\/05\/1979", "idel" : false, "st" : "uh", "ad" : ...

SQL Diagram in Visual Studio 2012 -

Image
how can create diagram in visual studio 2012 1 in sql server management studio... you'll popup "support objects required database diagramming". click yes

asp.net - Not able to disable Required Field Validator in VB.NET -

i have required field validator textbox want disable on click of link button. coded so. protected sub lnkdeletetimeslots_click(sender object, e eventargs) txttimeslotname_requiredfieldvalidator.enabled = false end sub the design of textbox. <asp:textbox id="txttimeslotname" runat="server"></asp:textbox> <font color="red">*</font> <asp:requiredfieldvalidator id="txttimeslotname_requiredfieldvalidator" runat="server" errormessage="timeslot name required!" display="none" controltovalidate="txttimeslotname" forecolor="red" validationgroup="timetable"> </asp:requiredfieldvalidator> but still validates required field. issue? edit: the linkbutton inside grid. when clicked, ...

java - TabHost in FragmentActivity and screen rotation -

i don't understand how use retain instance on screen rotation while using tabhost inside fragmentactivity. found lot of things that, either talking use onretainnonconfigurationinstance() deprecated. or tu use setretaininstance(boolean) fragmentactivity doesn't have method. fragment have it. on link can find out code of main activity: http://code.google.com/p/musclehackandroid/source/browse/src/com/musclehack/musclehack/mainactivity.java thanks in advance, cédric you can use onsavedinstancestate save current selected tab: @override protected void onsaveinstancestate(bundle outstate) { outstate.putint("tab_position", host.getcurrenttab()); super.onsaveinstancestate(outstate); } afterwards can retrain selected position in oncreate: if (savedinstancestate != null) { host.setcurrenttab(savedinstancestate.getint("tab_position")); }

symfony - how to get the session variable in the view in symfony2 -

thanks valuable suggestions i have created login system want store id's of users in session variables this controller login system use symfony\component\httpfoundation\session\session; class successcontroller extends controller { public function successaction(request $request) { --some code form-- $repository = $em->getrepository('repairstorebundle:users'); $query = $repository->auth($name,$password); $error="sorry invalid username or password"; if($query== false) { return $this->render('repairloginbundle:login:login.html.php', array( 'form' => $form->createview(),'error'=>$error,)); } else { $role=$query[0]['role']; $id=$query[0]['id']; if($role == 1) { $session = new session(); $session->start(...