Posts

Showing posts from March, 2014

c# - Caliburn.Micro attach event handler on event of Behavior -

i wrote own behavior handle swipe gesture , put itemtemplate of listview. if swipe completed, raise event leftswipe or rightswipe. event should handled viewmodel. i use syntax of caliburn.micro attach handler event: cm:message.attach="[event leftswipe] = [leftswipe($source, $eventargs)" . this behavior: public class swipeinteractionbehavior : dependencyobject, ibehavior { public dependencyobject associatedobject { get; private set; } public void attach(dependencyobject associatedobject) { // ... } public void detach() { // ... } public event eventhandler leftswipe; public event eventhandler rightswipe; // ... // ... private void onleftswipe(frameworkelement element) { // ... if (leftswipe != null) { leftswipe(this, eventargs.empty); } } private void onrightswipe(frameworkelement element) { // ... if (rightswipe != null) ...

java - Angular $http.get always get ERROR consuming local Restful Service -

i have error , getting confuse, have created simple java ee 7 project using jersey. i returning class in rest rervice: @xmlrootelement public class locationdtox { private long id; private string tittle; private string description; private long parent; //getter , setters... and in service class have: @path("/location") public class locationservice { @get @consumes(mediatype.application_json) @produces(mediatype.application_json) @path("/findlocation") public locationdtox findlocation() { system.out.println("findlocation"); try { locationdtox x = new locationdtox(); x.setdescription("description"); x.setid(0l); x.setparent(null); x.settittle("tittle ..."); return x; } catch (exception ex) { logger.getlogger(locationservice.class.getname()).log(level.severe, n...

Show html file in alertdilaog builder in Android -

final alertdialog d = new alertdialog.builder(this) .seticon(r.drawable.ic_launcher) .setcancelable(false) // cant cancel pressing key pressing positive button .settitle("about") // can done html style .setpositivebutton(android.r.string.ok, null) .setmessage(html.fromhtml("<i> etc etc stuff")) .create(); d.show(); but have html file in raw folder want display html file formatted , have put required escape sequences etc stuff in html file in raw folder what want display html file in .setmessage . getresources().open not working me how it? i used use code written above have html file in raw folder want display html file formatted , have put required escape sequences etc stuff in html file in raw folder you want use webview : webview webview = new webview(this); webview.loadurl("file:///android_res/raw/your_file_na...

gradle - Android Studio proguard handling in multi-library projects -

i have application uses externally referenced library (that is, directory of library in same level application - not copied inside application's folder). library referenced application , both library , application include proguard files. works fine until build application. when built app, referenced classes defined in library not found - 'cannot find symbol class ...) errors on imports of library classes. found, because when rebuilding application, proguard obfuscates classes , variables , therefore application cannot reference them. have added following build.gradle file, buildtypes { release { minifyenabled true proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-project.txt' } debug { minifyenabled false } } but seems when building application, above not taken consideration (or building done in release mode). if change above following (i.e., disable proguard in release mode), buildtypes { ...

java - Weird error on driver class -

i'm writing driver class piggy bank class created. idea is supposed add different types of coins (user input) , total cents , display them until "x" input user. think have code right, there weird issue if use "countmoney" accessor code, tells me of variables in driver class uninitialized. if remove it, there no errors shown eclipse. i've printed source , driver class below: package piggy; /** * @author kevin * */ import java.util.scanner; import piggy.piggybank; public class piggybanktester { /** * @param args */ public static void main(string[] args) { string num = "str", num1; int count = 0; int money; scanner scan = new scanner(system.in); scanner scan2 = new scanner(system.in); piggybank total = new piggybank(); system.out.println("welcome piggy bank tester"); system.out.println("what type of coin add (q, h, d or x exit)?"); ...

ruby on rails - The dreaded missing template error -

i've read can find, , i'm still stumped. i'm trying use before_filter catch users not logged in, , send them alternative index page. idea users logged in see listing of own articles when hit index.html.erb, users not logged in redirect showall.html.erb page lists articles not let them read them (and hits them ads). i added route: resources :articles do "showall" resources :comments end 'rake routes' shows route article_showall. have partial _showall.html.erb in views/articles folder (it contains text 'showall working!'). if render showall in view (<%= render "showall" %>), works fine. this applicable part of controller: class articlescontroller < applicationcontroller skip_before_action :authorize, only: [:index, :show, :showall] before_filter :require_user, :only => [:index] def require_user unless user.find_by(id: session[:user_id]) render 'showall', :notice => "please log in ...

Why does android need showAsAction="always" to be prefixed with an alias? -

i started journey on android development , there's 1 thing confusing me. when creating menu items why need specify alias properties when android studio's autocomplete suggests use of android:showasaction="value"? when using android:showasaction property ignored. if replace else works. why? related https://stackoverflow.com/a/17914095/1084568 if using native action bar, use android:showasaction . time see android: prefix, know attribute defined android framework. if using appcompat-v7 backport of action bar, comes library ( appcompat-v7 ). libraries cannot invent new android: attributes. instead, library-defined attributes, use new namespace (e.g., app: ) tied http://schemas.android.com/apk/res-auto url. it says android: namespace not able provide access property if pretend support older android versions such 2.1 correct. in case, while android:showasaction added framework in android 3.0, part of goal of appcompat-v7 support android ...

javascript - angular-ui-tab-scroll: Weird spacing beetwen block to tabs included separetely -

Image
first of all, great library! now, facing weird problem when wrapping tabset tabs included separately, ie either via single tab elements added manually in dom, either via group of tab added use of ng-repeat : see plunker : <scrollable-tabset show-tooltips="false"> <tabset> <!-- 1st block of tabs--> <tab> <tab-heading>tab 0</tab-heading> tab 0 content </tab> <!-- 2nd block of tabs--> <tab ng-repeat="tab in tabs1" active="tab.active" disabled="tab.disabled"> <tab-heading>{{tab.heading}}</tab-heading> {{tab.content}} </tab> <!-- 3rd block of tabs--> <tab ng-repeat="tab in tabs2" active="tab.active" disabled="tab.disabled"> <tab-heading>{{tab.heading}}</tab-he...

java - Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION: -

how can solve error error:execution failed task ':app:dexdebug'. com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/library/java/javavirtualmachines/jdk1.7.0_67.jdk/contents/home/bin/java'' finished non-zero exit value 2 app build.gradle apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "22.0.1" packagingoptions { exclude 'meta-inf/dependencies' exclude 'meta-inf/asl2.0' exclude 'meta-inf/notice' exclude 'meta-inf/notice.txt' exclude 'meta-inf/license' exclude 'meta-inf/license.txt' exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } defaultconfig { applicationid "com.app" minsdkversion 10 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minif...

r - ggplot2 extension and add-on packages -

i've used ggmap while , i've become aware of ggextra , cowplot . point me in direction of comprehensive list of ggplot2 add-on packages? take @ http://cran.r-project.org/web/packages/ggplot2/index.html , list of packages depend on starting point (particularly w/ gg in name). i've reproduced of link below. reverse depends: alphahull, ampliconduo, aoristic, apsimr, arqas, bcrm, bde, benchmark, biomod2, bootnet, brms, caret, catenary, chemosensors, cinoedv, cjoint, climclass, climwin, clustrd, coefplot, conformal, copasutils, cowplot, crossover, dae, deducer, depthproc, dfexplore, differ, dmod, dslice, dynnom, earlywarnings, eeptools, esgtoolkit, fbroc, fishmove, freqparcoord, gapmap, gettingtothebottom, ggmap, ggmcmc, ggparallel, ggroc, ggswissmaps, ggtern, ggthemes, goplot, gpmap, granovagg, gsdesign, gse, hmisc, hyperspec, idm, intsvy, learnstats, likeltd, likert, localgauss, lsbclust, mcmc.otu, mcmc.qpcr, mcprofile, mergegui, mete...

java - ExpandableListAdapter with searchView only Group -

i preparing app our city people find want fast , offline. using expandablelistadapter searchview , need make group items searchable.is possible please ? ... here´s code: mainactivity.java package com.martin.icmt; import java.util.arraylist; import java.util.hashmap; import java.util.list; import android.app.activity; import android.os.bundle; import android.widget.expandablelistview; import android.widget.searchview; import com.martin.icmt.com.martin.icmt.expandablelist.expandablelistadapter; public class mainactivity extends activity { expandablelistadapter listadapter; expandablelistview explistview; searchview search; list<string> listdataheader; hashmap<string, list<string>> listdatachild; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // listview explistview = (expandablelistview) findviewbyid(r....

php - Echo decimal value without point zero ( .0 ) at end -

i using decimal (5,1) to store data. when value 12.2, 66.4 ... evething ok. not decimal value : 5, 10 , 20 .... when echo 5.0, 10.0 ... how can echo them : 1, 2.2, 2.5, 10, 10.5, 10.6, 11 gordon linoff's answer may trick, here php way : echo (intval($var) == $var) ? intval($var) : $var; or, if don't ternary conditions : if (intval($var) == $var) { echo intval($var); } else { echo $var; }

c# - Selected Index Change Calling when Filling values in Combobox -

in below code have combobox . when try fill values in combobox , on loading calling selectedindexchanged without selecting value combobox . public void bindcombobox() { software pd = new software(); dataset dsproj = pd.userid(); cbvalue.datasource = dsproj.tables[0];//calling selectedindexchanged cbvalue.displaymember = "projectname"; cbvalue.valuemember = "projectid"; } private void cbvalue_selectedindexchanged(object sender, eventargs e) { } i guess must use boolean variable. may , used method avoid problem given below. 1) declare boolean valiable global scope, set false. 2) before binding combobox set boolean=false , , after binding has been completed set boolean=true . 2) on first line of combobox_selectionchangeevent , check condition boolean true or false. if true rest of things. like this.. boolean flag=false public void bindcombobox() { software pd = new software(); dataset dsproj = pd.userid(); fl...

html - How to add action for custom form in wordpress? -

i have created custom contact form in wordpress page using html , give action "../customer-details.php" .this file located @ theme folder. when click submit on form returns 404 page not exist error . why happening ? wrong action url ? here link used create form http://www.inkthemes.com/how-you-can-easily-create-customized-form-in-wordpress try use action="<?php echo bloginfo('template_url'); ?>/customer-details.php" instead.

node.js - can't revert to older version of node, can't uninstall node, OSX -

have installed node 0.12.2, need revert 0.10.33 run applications need to. have tried installing 0.10.33 , switching versions using set 0.10.33 default 'nvm alias default 0.10.33' but node runs previous version (0.12.2) when started again. i have tried uninstalling node via various methods, each 1 has been blocked: uninstall node "you must in root run tool" (i user (with admin access) on machine tried cd / then uninstall node but still got "you must in root run tool" tried sudo uninstall node "uninstall failed... reason: errormissingbundle" i may have installed node homebrew - while back, can't quite remember. tried: brew uninstall node "error: no such keg: /usr/local/cellar/node" other information can give: which node /usr/local/bin/node i see node , npm in /usr/local/bin any appreciated - i'm not command line expert, , new @ node. to switch different node.js version n...

mouseevent - how to avoid flickering on mouseenter event in jquery? -

Image
i don't know exact technical word in following jquery code on 'mouseenter' , 'mouseleave' event whole div movement button clicked (flickers?) , used 'mouseover' , 'mouseout' same problem occurs. $total_doctors=mysql_fetch_array(mysql_query("select count(*) doctor")); main div: <div class='mainspan action-nav-button'> <a href='doctor.php'> <span>&nbsp;</span> <i class='fa fa-user-md'></i> <span>doctor</span> <span id='countdoctor'>0</span> </a> </div> script code: var docnumbr = <?php echo $total_doctors['0']; ?>; $(document).ready(function(){ $({countnum: $('#countdoctor').text()}).animate({countnum: docnumbr}, { duration: 2000, easing:'linear', step: function() { $('#countdoctor').text(math.floor(this.countnum)+1); } }); $('#countdoctor').mouse...

Crystal Report continuous if statement? -

i have 12 check boxes in database , want crystal report @ each one. if first 1 true want return word , if it's false return nothing . ideally, want show ones true listed side side. example: if 1, 3, , 5 true show name of field dodge, chevy, nissan. my statement have //01 ( if {make.logical_1} = true 'dodge' else'' ); //02 if {make.logical_2} = true 'chevy' else'' ); //03 ( if {make.logical_3} = true 'nissan' else'' ); there no errors returns last if statement, not 1st , 3rd if 1st true well. can leave out else'' same wrong results it should show dodge nissan please help!! i think need use this: trim((if {make.logical_1} = true 'dodge ' else '') & (if {make.logical_2} = true 'chevy ' else '') & (if {make.logical_3} = true 'nissan ' else ''));

ios - Swift test if type is collection -

i'm busy trying write recursive method. there no explicit 'children', collections, i'd checking if can iterate on property. i've seen people find swift.array<string> , increase number of types need test for. should try cast , obtain count? class childarray : nsarray { } you can take advantage of toll-free bridging between swift , objective-c. objects in objc have iskindofclass method identify if descend class: class childarray : nsarray { } func iscollectiontype(value : anyobject) -> bool { let object = value as! nsobject return object.iskindofclass(nsarray) } var arrayofint = [1, 2, 3] var myarray = childarray() var anint = 42 println(iscollectiontype(arrayofint)) // true println(iscollectiontype(myarray)) // true println(iscollectiontype(anint)) // false

python - While loop break/continue not working for me -

i can't see why loop won't continue when input not float! addition issue, don't understand why python tries addition when non float input should terminate loop in exception. code: tot1 = 0.0 count1 = 0.0 while(true): inp1 = input('enter number or done end:') try: float(inp1) except: str(inp1) if(inp1 == 'done'): print("done!") break print("error") continue tot1 = tot1+inp1 count1 = count1+1 if(tot1 >0 , count1 >0): print("average: ", tot/count ) output: traceback (most recent call last): file "c:/users/gregeraar/pycharmprojects/untitled/chap5exc.py", line 16, in <module> tot1 = tot1+inp1 typeerror: unsupported operand type(s) +: 'float' , 'str' check 'done' first cast float inp1 = float(inp1) , don't need call str(inp1) string, furthermore nothin...

c# - The fastest way to check whether remote computer is offline -

i need fastest way check whether remote computer off . there ways i've tried, none of them gives me desired time speed (it should less 0.5 sec , it's critical, because occurs on context menu popup) //using system.net iphostentry iphostinfo = dns.gethostentry(hostname); //if error occurs - remote computer off //using system.net.networkinformation ping ping = new ping(); pingreply pingreply = ping.send(hostip); if (pingreply.status != ipstatus.success) { //remote computer off } //using system.management managementscope scope = new managementscope(@"\\" + hostname + @"\root\cimv2", null); scope.connect(); //if error occurs - remote computer off as far can see fastest way using dns.gethostentry(hostname) - still takes 3 sec throw exception. idea? use ping timeout . version ...

html - Margin: auto does not work -

Image
<!doctype html> <html> <head> <link type="text/css" rel="stylesheet" href="stylesheet.css"/> <title>meriniuc răzvan - dumitru</title> </head> <body> <div class="left"></div> <div class="right"></div> <div id="header"> <h3> cv </h3> </div> <div id="footer"></div> </body> </html> .left { border-radius: 10px; background-color: green; height: 310px; width: 75px; float: left; margin-top: 65px; } .right { border-radius: 10px; background-color: blue; height: 310px; width: 50px; float: right; margin-top: 65px; } #header { position: fixed; height: 65px; background-color: red; width: 720px; border-radius: 10px; display: ...

How to create a two dimensional array from a stream in Java 8? -

i have text file this: ids.txt 1000 999 745 123 ... i want read file , load in 2 dimensional array. expect have array similar 1 below: object[][] data = new object[][] { // { new integer(1000) }, // { new integer(999) }, // { new integer(745) }, // { new integer(123) }, // ... }; here code wrote: file idsfile = ... ; try (stream<string> idsstream = files.lines(idsfile.topath(), standardcharsets.us_ascii)) { object[][] ids = idsstream .filter(s -> s.trim().length() > 0) .toarray(size -> new object[size][]); // process ids array here... } when running code, exception raised: java.lang.arraystoreexception: null @ java.lang.system.arraycopy(native method) ~[na:1.8.0_45] @ java.util.stream.spinedbuffer.copyinto(unknown source) ~[na:1.8.0_45] @ java.util.stream.nodes$spinednodebuilder.copyinto(unknown source) ~[na:1.8.0_45] @ java.util.stream.spinedbuffer.asarray(unknown source) ~[na:1.8.0_45] @ java.util.stre...

java - How to demonstrate all the TCP Socket States -

i trying observe simple java echo server & client program in runtime on laptop using ubuntu os.to understand whats happening behind scene, ran server client & used command sudo netstat -pant 10007 proto recv-q send-q local address foreign address state pid/program name tcp6 0 0 :::10007 :::* listen 3551/java tcp6 0 0 127.0.0.1:35459 127.0.0.1:10007 established 3570/java tcp6 0 0 127.0.0.1:10007 127.0.0.1:35459 established 3551/java so, can see passive server(loop back) in listen state , after accepting client(127.0.0.1.35459) socket creates new tcp connection active server (127.0.0.1.10007) in established state. however, know there several tcp socket states such as:syn_send, syn_received, established, listen, fin_wait_1, timed_wait, close_wait, fin_wait_2, last_ack, closed etc. so, in confusion other states, whether ...

nskeyedarchiver - How can an NSIndexSet be a root object? -

here typical code snippet when reordering table drag , drop. - (bool)tableview:(nstableview *)tv writerowswithindexes:(nsindexset *)rowindexes topasteboard:(nspasteboard *)pboard { nsdata *data = [nskeyedarchiver archiveddatawithrootobject:rowindexes]; [pboard declaretypes:[nsarray arraywithobject:mydatatype] owner:self]; [pboard setdata:data fortype:mydatatype]; sourceindex = [rowindexes firstindex]; return yes; } look @ line nsdata *data = [nskeyedarchiver archiveddatawithrootobject:rowindexes]; how can rowindexes root object? the docs nsindexset class represents immutable collection of unique unsigned integers.... use index sets in code store indexes other data structure. example, given nsarray object, use index set identify subset of objects in array. it seems nsindexset not "an immutable collection of unique unsigned integers" set of pointers identify objects. it's confusing, can explain what's going on?

Maven Java GAE compilation error -

i'm getting build failure following error: [error] failed execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project r esponderhub: compilation failure [error] /x:/workspaces/responderhubworkspace/responderhub/src/main/java/uk/org/responderhub/memberservlet.java:[23,110] cannot find symbol [error] symbol: method now() [error] location: class com.googlecode.objectify.ref with following simple source code: package uk.org.responderhub; import java.io.ioexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import com.googlecode.objectify.objectifyservice; import uk.org.responderhub.data.member; public class memberservlet extends httpservlet { @override public void doget(httpservletrequest req, httpservletresponse resp) throws ioexception { member member = new member(); member.userid="1234"; objec...

javascript - angular directive call to controller method with parameter -

i have controller method gets parameter, , want directive call method , pass parameter. how add tag controller when user clicks tag inside directive. a bit of code: app.controller('mainctrl', function($scope) { $scope.chosentags = ['clicktoremoveme', 'if click on tags below should appear here']; $scope.jokes = [{ id: 0, content: 'bla bla bla bla', tags: ['fat', 'blondes'] },{ id: 1, content: 'another another ', tags: ['thin', 'dark'] }]; $scope.addtag = function(tag) { $scope.chosentags.push(tag); }, $scope.removetag = function(tag) { removea($scope.chosentags, tag); } }); app.directive("joke", [function () { return { restrict: 'e', templateurl: 'joke.html', scope: { joke: '=' } }; }]); plunker: http://plnkr.co/edit/v...

java - My JTable doesn't show up -

i'm new jtable, or gui matter, had been given assignment of building receipt program inside gui. manage basic things work, table looks awful. need on how display table properly public static void main (string[] args) { arraylist <item> lol= new arraylist <item>(); item ayam = new item("ayam",5678); item kambing= new item("kambing",5014); item buaya= new item("buaya",3000); item bocoranquiz= new item("bocoranquiz",5000); lol.add(ayam); lol.add(kambing); lol.add(buaya); lol.add(bocoranquiz); jframe frame= new jframe(); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setlayout(new gridlayout(3, 0)); frame.setsize(1000, 1000); simpledateformat sdf = new simpledateformat("dd/m/yyyy"); string date = sdf.format(new date()); jcombobox combo1= new jcombobox(); combo1.setpreferredsize(new dimension(10, 10)); combo1.additem(ayam.getn...

eclipse rcp - How to launch the default (native) application for a given file from Java? -

i displaying list of files; i.e. xls, doc, pdf, odt etc., in java application (eclipse rcp). when user clicks on file, want launch appropriate (according os thinks) native application, happens in windows explorer or finder. and while here: nice display same icons finder or explorer use different file types. is there library or eclipse plugin this? what want java.awt.desktop : desktop.getdesktop().open( file );

c# - Best WPF panel to create custom control -

i trying design custom control contains 1 rich text box , checkbox. need add control @ runtime in stack panel. since size of stack panel can change, want make sure custom control takes full space, , textbox inside control increases in size accordingly. i getting bit confused panel best bet custom control. should go canvas or dockpanel, or maybe grid? any suggestion welcome. edit below full code main page. contains 2 sections, 1 report preview, , report editing. report editing section count total subreports , create many sections. so, report editing pane needs stack controls nicely, , move other controls , down accommodate expansion of subreports. subreports can vary in size. telerik's radexpander looked idea @ first, main stackpanel not consider radexpander's visibility state. right now, stackpanel uses full height when radexpander minimized. <scrollviewer grid.row="1" panel.zindex="5"> <grid x:name="mainarea" ve...

android - AdView shows only test banner on emulator -

i've created account on admobs, created banner test. the code bannerexample, without addtestdevice(...) public class myactivity extends actionbaractivity { private adview madview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_my); // gets ad view defined in layout/ad_fragment.xml ad unit id set in // values/strings.xml. madview = (adview) findviewbyid(r.id.ad_view); // create ad request. check logcat output hashed device id // test ads on physical device. e.g. // "use adrequest.builder.addtestdevice("abcdef012345") test ads on device." adrequest adrequest = new adrequest.builder() .build(); // start loading ad in background. madview.loadad(adrequest); } activity_my.xml <com.google.android.gms.ads.adview android:id="@+id/ad_view" android:layout_width="match_parent" and...

php - Laravel Eloquent how to return one to many to many collection -

is possible eloquent relation based on one->many->many relationship? in below example, want of gallery_votes given user. users +----+---------------+ | id | user_name | +----+---------------+ | 1 | bob | | 2 | sam | +----+---------------+ galleries +----+---------------+-----------+ | id | gallery_name | user_id | +----+---------------+-----------+ | 1 | alaska pics | 1 | | 2 | texas pics | 1 | | 3 | california | 2 | | 4 | cars | 2 | +----+---------------+-----------+ gallery_votes +----+---------------+--------+ | id | gallery_id | vote | +----+---------------+--------+ | 1 | 1 | 1 | | 2 | 1 | 1 | | 3 | 1 | 1 | | 4 | 2 | 1 | +----+---------------+--------+ the relationships setup follows. class user extends model implements authenticatablecontract, canresetpasswordcontract {{ ... public function galler...

ios - Swift: Set UIButton Image with CGRect -

i'd set image of uibutton , without creating of assets @ different sizes. since should grey rectangle, text on top, i'm trying creating cgrect . title displayed desired, , button can clicked region described cgrect , when run app, nothing can seen, except title. tried fix setting tintcolor , no avail. here's have far. @iboutlet weak var swapbutton: uibutton! in viewdidload() : var rectangle = cgrectmake(0, 0, view.layer.frame.width, 20) uigraphicsbeginimagecontext(rectangle.size) cgcontexttranslatectm(uigraphicsgetcurrentcontext(), rectangle.origin.x, rectangle.origin.y) var rectangle2 = uigraphicsgetimagefromcurrentimagecontext() uigraphicsendimagecontext() swapbutton.setbackgroundimage(rectangle2, forstate: .normal) swapbutton.tintcolor = uicolor.blackcolor() is there way accomplish this? try code : var yourbutton = uibutton(frame:cgrectmake(100, 100, 100, 35)) var rect = cgrectmake(0, 0, 1, 1) uigraphicsbeginimagecontext(rect.size) var cont...

database - Oracle DB : What is difference between spfile and init.ora file? -

i have tried understand through oracle docs not body please explain. difference between spfile , init.ora file? thanks. init.ora init.ora or pfile(parameter file) simple text file can updated standard editor vi contains various initialization parameters used while starting database instance. here sample init.ora file: db_cache_size = 176000m db_2k_cache_size = 2048m db_16k_cache_size = 99000m db_keep_cache_size = 600000m db_recycle_cache_size = 64000m shared_pool_size = 14000m we need restart database after editing init.ora using text editor changes can come effect. if want start remote db need local pfile. rman(recovery manager) helps in data backup recovery process not keep backup of pfile or init.ora file. spfile the oracle spfile binary representation of text based init.ora file or pfile( parameter file) contains various initialization parameters used while starting database instance.came existence in , after oracle 9i. we not edit fil...

c# - WPF XAML Using Mouse Action Event -

i learning wpf 4.5 unleashed book. when tried incorporate mouse action event such mouseenter or mousedoubleclick button typing code manually, compiler told me not find reference mouse action event. however, when use double tab shortcut, works well. possibly issue? have bold trouble code below. <window x:class="wpfapplicationlearning0001.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="513.265" width="748.469"> <dockpanel> <menu dockpanel.dock="top"> </menu> <stackpanel name="buttonbar" orientation="horizontal" dockpanel.dock="right"> <stackpanel.layouttransform> <rotatetransform angle="90"> </rotatetransform> </stackpanel.layouttransform> ...

inno setup - Registry aren't fully deleting when uninstalling -

inno setup isn't deleting full registry key. here have done: [registry] root: hklm; subkey: software\ea games\need speed wanted-2012; valuetype: string; valuename: gdfbinary; valuedata: {app}\gdfbinary_en_us.dll; flags: uninsdeletekey root: hklm; subkey: software\ea games\need speed wanted-2012; valuetype: string; valuename: displayname; valuedata: need speed wanted-2012; flags: uninsdeletekey root: hklm; subkey: software\ea games\need speed wanted-2012; valuetype: string; valuename: locale; valuedata: en_us; flags: uninsdeletekey root: hklm; subkey: software\ea games\need speed wanted-2012; valuetype: string; valuename: install dir; valuedata: {app}; flags: uninsdeletekey these part isn't deleting when uninstalling: \ea games\need speed wanted-2012 folder in registry root: hklm; subkey: software\ea games\need speed wanted-2012 ( need speed wanted-2012 game hint). anybody please help. your code, is, automatically deletes hklm\software\ea games\need spe...

windows - Replace the part of the path by string in specific file type in a folder -

in u:\mtproject\obj\ folder , sub-folders having *.def files. need file paths , print in command prompt. before print need replace u:\mtproject\obj\ part e:\backupdir\defbackup\ . here tried , set objdir=u:\mtproject\obj\ set backupdir=e:\backupdir\defbackup\ /r %objdir% %%f in (*.def) ( set new_def_path = %backupdir%!%%f:%objdir%=! echo %new_def_path% ) it shows output. feel issue in syntax of string replacement. idea wrong? echo off. echo off. echo off. echo off. echo off. echo off. echo off. echo off. echo off. a) use delayed expanison (as somethingdark mentioned) b) remove spaces whith set commands or spaces part of variablename or value. setlocal enabledelayedexpansion set objdir=u:\mtproject\obj\ set backupdir=e:\backupdir\defbackup\ /r %objdir% %%f in (*.def) ( set new_def_path=%backupdir%!%%f:%objdir%=! echo !new_def_path! ) short demonstration of delayed expansion trap (interesting: use de...

php - Mysql - How to Give Alias name for column -

i getting list of tables matches query string database. my query show tables '%fit%' output tables_in_pdi (%fit%) fit_types in php while fetching these , getting output as array ( [tables_in_pdi (%fit%)] => fit_types ) if there anyway give alias these , easy me take data in php it easier use information_schema database: http://dev.mysql.com/doc/refman/5.0/en/tables-table.html select table_name information_schema.tables table_schema = 'db_name' , table_name '%fit%'

sql - How to display field if entry exists in join table? -

i'm writing query display data our issues table. have table called labels , join table called issues_labels . assign issue label of 'high-priority', 'medium-priority' or 'low-priority. i'm unsure how write query return result: id | title | priority 2 broken low-priority 4 internets down high-priority i write queries time, simplicity (or not) of 1 driving me nuts. need write 3 sub-queries pull issues linked each label so: with hp_issues ( select * issues inner join issues_labels on issues_labels.issue_id = issue.id issues_labels.label_id = 10 --id high priority issue ) .... any appreciated. assuming issues_labels table connects issues , labels in many-to-many situation, do: select i.id, i.title, l.priority issues left join issues_labels il on il.issues_id = i.id left join labels l on l.id = il.labels_id example: http://sqlfiddle.com/#!15/b78ee/1 for reason if 1 of i...

Fetch array of strings from ArrayList for JList Java -

the task quite simple, faced 1 problem jlist component. what need is. fetch data database, load string array, pack array arraylist (just because duno how many records have), return method arraylist. @ receiver side. have trouble, cant fetch string array arraylist can pass jlist. here code. arraylist<object> fetch = new arraylist<object>(); public string[] data =new string[10]; listmodel = new defaultlistmodel(); mylist = new jlist(listmodel); //mylist = new jlist(data); // works simple array of strings. fetch=dao.loadpasswords(); //at point asks me cast object smth late cause null pointer exception. mylist = new jlist(fetch.get(0)); and here loadpasswords(); public static arraylist<object> loadpasswords(){ dbconnect(); boolean unswer = false; string[] result=null; string query1 = "select * tblpasswordsstorage " + "_user_id = ?"; string userid=personal_organizer.userpr...