Posts

Showing posts from September, 2011

facelets - Adding message to faceContext is not working in Java EE7 run on glassFish? -

facelets - Adding message to faceContext is not working in Java EE7 run on glassFish? - i doing tutorial on java ee7 comes glassfish installation. available here. code nowadays in glassfish server installation directory /glassfish_installation/glassfish4/docs/javaee-tutorial/examples/cdi/guessnumber-cdi . the code works fine is. displays correct! when user correctly guesses number not display failed @ end of game. introduced, 1 minor alter display failed message. have added comments right above relevant alter in code. somehow, alter did not help. is, @ end of game, failed message not displayed. game works usual. know why did not work , how right it? thanks public class usernumberbean implements serializable { private static final long serialversionuid = -7698506329160109476l; private int number; private integer usernumber; private int minimum; private int remainingguesses; @inject @maxnumber private int maxnumber; private int maximum; @inject @random inst...

java - matching two strings, one with x, other one with any characters -

java - matching two strings, one with x, other one with any characters - i new regex not getting this. need match 2 string s in java in 1 of them have number of x , other can have character in places. for illustration - string 1 - time xxxx when string 2 - time 0830 when these 2 strings should match , returns true. please suggest. thanks. as many of mentioned question not clear. i'll add together more details - 1. x can appear 2 number of times. 2. strings dynamic, or in other words, they'll passed method - public boolean doesmatch(string str1, string str2) { // matching code homecoming false; } so illustration - this xxxday , xxxx fri , these 2 strings should match. you need rebuild state engine: public boolean doesmatch(string str1, string str2) { if (str1.length() != str2.length()) homecoming false; (int = 0; < str1.length(); i++) if (str1.charat(i) != 'x' && str1.charat(i) != str2....

c# - Transferring a Vector3 variable from one script (WayPointPositioner) to another and change it into a transform (Walking) -

c# - Transferring a Vector3 variable from one script (WayPointPositioner) to another and change it into a transform (Walking) - i'm having bit of problem getting vector3 waypointposition other script called walking , changing transform target. troubles lie in fact i'm trying grab dynamic variable waypointpositioner (it changes depending on object clicked in stage , whether player overlaps waypoint) , import , utilize in script. below code i'm using. waypointpositioner using unityengine; using system.collections; public class waypointpositioner : monobehaviour { public vector3 waypointposition = vector3.zero; private bool checkplayerwaypointcollision; void start() { } void ontriggerstay2d (collider2d other) { // check if collision occuring player character. if (other.gameobject.name == "player") { checkplayerwaypointcollision = true; } else { checkplayerwaypointcollision = false; } } //check if objec...

asp.net - Index was out of range. Must be non-negative and less than the size of the collection - chart databind -

asp.net - Index was out of range. Must be non-negative and less than the size of the collection - chart databind - i'm trying build datatable , bind gridview , chart object. gridview appears fine when build x,y array , bind them chart object error above. i've read many forums understand index looking @ field out of range i've queried in immediate window fields , values there. there error occurs bind chart object , don't know why chart object doesn't display properly. this aspx codebehind: dim dt datatable = new datatable() dt.columns.add("companyname") dt.columns.add("amount") dt.columns.add("proportion") using dbcontext new fundmatrixentities dim queryunits = (from c in dbcontext.units c.savingapplicationid = savappid select new {.loanappid = c.loanapplicationid}).distinct().tolist() dim companyname string = "" dim savingsamount string = "...

javascript - AngularJS ngOptions filter array by boolean field -

javascript - AngularJS ngOptions filter array by boolean field - i have array: this.chapters = { 1: { name: 'chapter 1', show: false }, 2: { name: 'chapter 2', show: true }, 3: { name: 'chapter 3', show: true } }; and want show chapters show value true in select <select ng-model="cart.newchapter" ng-options="v.name (k, v) in cart.chapters"></select> now it's showing chapters, need filter them. i've been trying apply filter didn't work. can help me? oh! can't alter boolean type of. you cannot apply filters objects, arrays. so, have 2 options here, alter chapters array or pre-filter chapters object using function this: $scope.filter = function(chapters) { var result = {}; angular.foreach(chapters, function(chapter, key) { if (!chapter.show) { return; } result[key] = chapter; }); homecoming result; }; and on html: ...

android - Transparent status bar covers Action Mode on Kitkat -

android - Transparent status bar covers Action Mode on Kitkat - i have activity fragment. fragment phone call method show contextual action bar , here problem. styles: <style name="mythemelight" parent="@android:style/theme.holo.light.noactionbar"> <item name="android:actionmodeclosebuttonstyle">@style/myclosebutton</item> <item name="android:actionmodestyle">@style/contextualbar.light</item> <item name="android:actionoverflowbuttonstyle">@style/overflow</item> <item name="android:actionbarstyle">@style/mymainactionbar</item> <item name="android:windowtranslucentstatus">true</item> <item name="android:actionmodeclosedrawable">@drawable/close_white</item> <item name="android:windowactionmodeoverlay">true</item> <item name="android:windowbackground">...

c# - Update multiple entities in MVC4 with LINQ, SQLquery -

c# - Update multiple entities in MVC4 with LINQ, SQLquery - is possible update/remove multiples entities, illustration [httppost, actionname("removeresponsible")] public actionresult removeresponsibleaction(responsible modelo) { responsible responsible = db.responsibles.single(x => x.responsible_id == modelo.responsible_id); db.responsibles.remove(responsible); db.savechanges(); viewbag.responsible = db.responsibles.tolist(); homecoming view("responsiblemanager"); } this code works 1 single responsible unique id, how can if there many responsible same id? example, know sql "delete table responsible_id=3". if using entity framework 6 can utilize removerange method: var responsibles = db.responsibles.where(x => x.responsible_id == modelo.responsible_id).tolist(); db.responsibles.removerange(responsibles); c# asp.net-mvc linq entity-framework asp.net-mvc-4

java - How to print first and last line of file in hadoop? -

java - How to print first and last line of file in hadoop? - what best way print first line , lastly line of input file using hadoop map cut down ? for illustration if have file of 10 gb , typical block size 128 mb approximately 80 mappers invoked keeping default configuration means not manipulating split size so 80 mappers invoked how differentiate how framework has assigned split size means starting split size offset or number mapper. so can't set logic in map function blindly way applied other mappers . one solution can think of using 1 mapper keeping block size of file size way can set functionality in map function way won't able create utilize of parallel computing . any effective way of doing ? can seek "hadoop fs" commands separately store first , lastly line , run map cut down jobs on it. hadoop has specific tail command straight gives lastly n lines in file. this tried: file size: 2.2mb first line: getting first strai...

Automating chunking of big data in R using a loop -

Automating chunking of big data in R using a loop - i trying break big dataset chunks. code looks this: #chunk 1 info <- read.csv("/users/admin/desktop/data/sample.csv", header=t, nrow=1000000) write.csv(data, "/users/admin/desktop/data/data1.csv") #chunk 2 info <- read.csv("/users/admin/desktop/data/sample.csv", header=f, nrow=1000000, skip=1000000) write.csv(data, "/users/admin/desktop/data/data2.csv") #chunk 3 info <- read.csv("/users/admin/desktop/data/sample.csv", header=f, nrow=1000000, skip=2000000) write.csv(data, "/users/admin/desktop/data/data3.csv") there hundreds of millions of rows in dataset, need create lot of chunks, , automate process. there way loop command each subsequent chunk automatically skips 1,000,000 more rows previous chunk did, , file saves "datan.csv" (n symbolizing subsequent number of previous file)? what next way? demonstration created info frame...

javascript - How to control posting form data on button click in CodeIgniter -

javascript - How to control posting form data on button click in CodeIgniter - previously posted reply myself problem, believing i've found solution. however, morning, found out wrong. it's partially solved. so, i've decided remove reply , edit post altogether. in codeigniter application, have next view page - meal_add.php , , there form there. there's submit button below form. form method supposed "post" . if click on submit button, info saved in database. code below: <form action="javascript:checktime();" method="post"> <fieldset> <legend id="add_employee_legend">add meal information</legend> <div> <label id= "emp_id_add_label">employee id:</label> <input type="text" name="emp_id" id = "employee_id_add" placeholder="employee id" required=...

java - Setting new Screen in constructor does not display properly -

java - Setting new Screen in constructor does not display properly - i made placeholder screen, since empty had phone call next screen in it's constructor. next screen running it's constructor not showing label placed. when skipped placeholder screen , went straight new screen drawing properly. why? place holder menu public placeholdermenu() { photographic camera = new orthographiccamera(); camera.settoortho(false, 720, 1280); batch = new spritebatch(); skin = assets.menuskin; stage = new stage(new fitviewport(technoflux.width, technoflux.height, camera), batch); //no need screen yet phone call next one... ((game)gdx.app.getapplicationlistener()).setscreen(new gamescreen()); } the new screen public gamescreen() { photographic camera = new orthographiccamera(); camera.settoortho(false, 720, 1280); batch = new spritebatch(); skin = assets.menuskin; stage = new stage(new fitviewport(technoflux.width, technoflux.h...

css - absolute vertical centering elements -

css - absolute vertical centering elements - i've tried lot of methods center children elements absolute vertical center couldn't success techniques. here's 1 illustration i've tried: html (cannot change) : <div class="foo"> <h1>blah blah</h1> <p>foo</p> <p>bar</p> </div> css: .foo{ position: absolute; top: 0; bottom: 0; background: yellow; } .foo:before{ content: ""; display: inline-block; vertical-align: middle; height: 100%; } please note: cannot alter markup i.e cannot wrap .foo parent div , cannot wrap childrens within .foo div. so, how can vertically center them on total window ? you accomplish using css flexbox layout this: jsfiddle - demo class="snippet-code-css lang-css prettyprint-override"> .foo { position: absolute; top: 0; bottom: 0; background: yellow; height: 100...

asp.net mvc - MVC C# Retrieving selecteditem intoDropdownlist on page load -

asp.net mvc - MVC C# Retrieving selecteditem intoDropdownlist on page load - i have dropdownlist in view , button. when click button loads info according value of dropdownlist value. filtering works , displays page dropdownlist value keeps re-setting. want retrieve lastly selected value. this view page alldates.cshtml , button filter , homecoming same page again: @{ viewbag.title = "all cars"; } <form name="filter" action="~/home/alldates" method="post" > <select id="fly" name='fly' > <option value='any'>any</option> <option value='plane'>plane</option> <option value='kyte'>kyte</option> </select> <input id="refine" type="submit" value="refine" /> here controller. ive been told calling controls using request not alternative new mvc , seems difficult. public viewresult alldates() { ...

parsing - Scala PackratParsers doesn not backtrack as it should? -

parsing - Scala PackratParsers doesn not backtrack as it should? - i have next code simple parser of logical expressions: import scala.util.parsing.combinator.regexparsers import scala.util.parsing.combinator.packratparsers object parsers extends regexparsers packratparsers // entities definition sealed trait logicalunit case class variable(name: string) extends logicalunit case class not(arg: logicalunit) extends logicalunit case class and(arg1: logicalunit, arg2: logicalunit) extends logicalunit import parsers._ // in order of descending priority lazy val pattern: packratparser[logicalunit] = ((variable) | (not) | (and)) lazy val variable: packratparser[variable] = "[a-za-z]".r ^^ { n => variable(n) } lazy val not: packratparser[not] = ("!" ~> pattern) ^^ { x => not(x) } lazy val and: packratparser[and] = ((pattern <~ "&") ~ pattern) ^^ { case ~ b => and(a, b) } // execution println(parsers.parseall(pattern...

php - What does this sentence mean? -

php - What does this sentence mean? - public static function has_setting() { homecoming (self::count() > 0); } count() php funciton,prepend self,i wonder meaning,thanks. know self means class, wonder meaning self::count() does mean count instance quantity of class? i don't know why people boy question!you can give advice other stepping on it i improve question, can set away feet? seems count() static function. when static functions used applies objects of class not particular object. self means current class. self::count means class saying : apply function on myself (all objects). php

Unpack DNS Wireformat with Python -

Unpack DNS Wireformat with Python - i trying unpack binary info dns (unbound). format (for example): '\x00\x10\x03ns1\x06google\x03com\x00' '\x00\x16\x00\n\x05aspmx\x01l\x06google\x03com\x00' '\x00\x1b\x002\x04alt4\x05aspmx\x01l\x06google\x03com\x00' i doing in python , have been trying unpack method of struct module. yet, couldn't find proper way express format. can have help on that? the dns wireformat can (and does) contain internal pointers within packet, falls outside python struct module intended do. on top of that, every single type of resource record needs unpacked according own specification. parsing wireformat dns packets great way of learning how dns works, if goal done suggest finding library you. it's not hard task, it's lot of work. python dns unpack

jboss - How to connect to Apache Cassandra with JDBC? -

jboss - How to connect to Apache Cassandra with JDBC? - i'm trying connect cassandra java code using jdbc connection. here jars i'm using now code found in stackoverflow this: string serverip = "localhost"; string keyspace = "mykeyspace"; cluster cluster = cluster.builder() .addcontactpoints(serverip) .build(); session session = cluster.connect(keyspace); string cqlstatement = "select * users"; (row row : session.execute(cqlstatement)) { system.out.println(row.tostring()); } but unfortunately it's throwing next exception: log4j:warn no appenders found logger (com.datastax.driver.core.cluster). log4j:warn please initialize log4j scheme properly. exception in thread "main" java.lang.nosuchmethoderror: org.jboss.netty.handler.codec.frame.lengthfieldbasedframedecoder.<init>(iiiiiz)v @ com.datastax.driver.core.frame$decoder.<init>(frame.java:130) @ com.datastax.driv...

java - Comparing 2 strings by ascii values ava -

java - Comparing 2 strings by ascii values ava - i have write method compare strings alphabetically , homecoming int . can't utilize built-in functions , i'm supposed utilize for loop. i'm unsure how deal strings beingness of different lengths. @ moment main issue code comparing first char of each string returning int, can't set return comparison; outside of loop public class poop { public static int compare(string s1, string s2) { (int = 0; < s1.length() && < s2.length(); i++) { int comparing = 0; int ascii1 = 0; int ascii2 = 0; //convert chars ascii values ascii1 = (int) s1.charat(i); ascii2 = (int) s2.charat(i); //treat capital letters lower case if (ascii1 <= 95) { ascii1 += 32; } if (ascii2 <= 95) { ascii1 += 32; } if (ascii1 > ascii2) { compar...

android - What is the server-side these days for Mobile Application -

android - What is the server-side these days for Mobile Application - i started developing android app starting think , server-side gonna be. so far learned j2ee , can create webservices , running them on server apache tomcat / glassfish / jetty / oracle etc... today know there cloud storage , dont understand when write server-side in java illustration glassfish. how deploy run on cloud / hosting server , command it. what aiming question how setup server side android/ios application. thanks android ios web-applications cloud server

concurrency - Goroutine execution time with different input data -

concurrency - Goroutine execution time with different input data - i experimenting goroutine parallelizing computation. however, execution time of goroutine confuse me. experiment setup simple. runtime.gomaxprocs(3) datalen := 1000000000 data21 := make([]float64, datalen) data22 := make([]float64, datalen) data23 := make([]float64, datalen) t := time.now() res := make(chan interface{}, dlen) go func() { := 0; < datalen; i++ { data22[i] = math.sqrt(13) } res <- true }() go func() { := 0; < datalen; i++ { data22[i] = math.sqrt(13) } res <- true }() go func() { := 0; < datalen; i++ { data22[i] = math.sqrt(13) } res <- true }() i:=0; i<3; i++ { <-res } fmt.printf("the parallel loop took %v run.\n", time.since(t)) notice loaded same info in 3 goroutines, execution time programme the parallel loop took 7.436060182s run. however, if allow each goroutine handle different...

html - hover is not working on child element -

html - hover is not working on child element - i have div within div below <div id="locations"> <div id="h-dragbar"></div> </div> and css below #locations { height: 50px; width: 100%; position: relative; z-index: -1; } #h-dragbar{ background-color:black; width:100%; height: 3px; position: absolute; cursor: row-resize; bottom: 0; z-index: 999; } #h-dragbar:hover{ background-color:blue; } but hover on div id h-dragbar not working. can test code here demo. what doing wrong? in advance. in new illustration jsfiddle you've provided, you're setting z-index of -1 parent div i.e. #locations why you're unable perform hover function on kid div i.e. #h-dragbar . need remove negative z-index on #locations , it'll work fine. update: i've checked latest fiddle , instead of using negative z-index #locations in order give priority #v-dragbar , can...

python - Connecting to STUN returned External IP address -

python - Connecting to STUN returned External IP address - i trying connect webserver behind nat listening @ port 4000. on webserver, using pystun (https://github.com/jtriley/pystun) , command: $ pystun -p 4000 i have returned value of nat type: symmetric nat external ip: <ip> external port: 1024 but when seek access http://:1024, not able connet , stuck @ waiting response. is right way of using stun? your nat has opened port (punched hole) only for stun server has seen outgoing packet stun while have run "pystun". when trying somewhere else reach webserver, packet unknown nat. nat silently discarding incoming packets. note that, event though getting external port nat while communicating stun server, because of it's symmetric type, port alter other random port while 4 tuple (src-address, src-port, dst-sddress, dst-port) changes. python stun nat-traversal

c++ convert from new to instance -

c++ convert from new to instance - there problem confuses me i created new variable foo *a=new foo(); then declared instance variable foo b; now want convert new variable instance variable, did b.setvalue0(a->getvalue0()); b.setvalue1(a->getvalue1()); b.setvalue2(a->getvalue2()); is there easier faster way this? you can utilize re-create constructor: foo b(*a); assuming of course of study copying object permitted. c++

javascript - How do I get text from input boxes to appear in a popup window? -

javascript - How do I get text from input boxes to appear in a popup window? - how go extracting info input boxes , display in separate popup window @ click of button? example below: html coding: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <table style="width: 50%" cellspacing="0" cellpadding="0"> <tr> <td>firstname</td> <td><input type="text" id="firstname"></td> </tr> <tr> <td>lastname</td> <td><input type="text" id="lastname"></td> </tr> <tr> <td>address</td> <td><input type="text" id="address"></td> </tr> <tr> <td>telephone<...

amazon web services - Getting Error while uploading image file to S3 via the AWS java SDK -

amazon web services - Getting Error while uploading image file to S3 via the AWS java SDK - i uploading image file s3 via aws java sdk, here code: amazons3 s3 = new amazons3client(basicawscredentials) putobjectrequest putobj = new putobjectrequest(bucketname, folderpath, getfile(filename,filecontenttoupload)); putobj.setcannedacl(cannedaccesscontrollist.publicread); s3.putobject(putobj); on windows scheme working fine, on linux giving next error: error message: unable calculate md5 hash: chrysanthemum.jpg (no such file or directory) linux case sensitive. windows not. try "ls" , note case. use same case in program. java amazon-web-services amazon-s3

php - Is it acceptable to mix static and non static methods in one class? -

php - Is it acceptable to mix static and non static methods in one class? - i have relatively simple question, , although there many posts on google, cannot find single 1 answers question. so short question "is acceptable mix static , non static methods in 1 class?". guess asking "is practice stick 1 type of method", or "are there things consider when using both". for example, if building class cope nutrient in fridge, of next (or else) best approach example 1: class nutrient { public function __construct( $itemname, $itemdescription ) { .... code new item of nutrient .... } public static function getallfood() { .... code items in fridge .... } } $food = new food( "apple", "nice juicy pinkish lady apple" ); food::getallfood(); or illustration 2: class nutrient { public function __construct( $itemname, $itemdescription ) { .... code new item of nutrient...

php - Allowed to use a second if statement? -

php - Allowed to use a second if statement? - am allowed utilize sec "if" statement @ end of existing if statement? i using "code a" create conditional title tags wordpress website. originally, "code a" did not include "code b", read utilize "code b" adding towards end of existing if statement. "code a" correct? example of output of code a: category "chicken" , website name "recipes" , "page 3": title displayed in browser: chicken - recipes - page 3 . code a <title> <?php if (is_category()) { wp_title(''); echo ' - '; } elseif (function_exists('is_tag') && is_tag()) { single_tag_title(); echo ' - '; } elseif (is_archive()) { wp_title(''); echo ' archive - '; } elseif (is_page()) { echo wp_title(''); echo ' - '; } elseif (is_search()) { echo 'search &quot;'.wp_spec...

Android studio gradle using deleted Material Design and SDK 21 -

Android studio gradle using deleted Material Design and SDK 21 - i have problem can't solve entire 2 week now. installed android l (sdk 21) testing, , because need develop app don't want utilize target sdk 21, deleted (uninstall sdk manager). end f**** up. (afterwards, because of errors, uninstall , delete (i hope) related android , reinstall 0 without sdk 21, sdk-s 8 19) when run android studio (intellj thought to) , create new project, gradle (i think) ruins project setting design "material design". i don't know how when delete related android (studio, sdk, files in user folder, intellj idea) , gradle (from users folder), mean everything, , reinstall zero? generate piece of code: <style name="base.textappearance.appcompat" parent="android:textappearance.material" /> <style name="base.textappearance.appcompat.body1" parent="android:textappearance.material.body1" /> <style name="bas...

Reset mysql root pass -

Reset mysql root pass - i've been trying reset password mysql of solutions i've found, nil seems work. i'm using osx yosemite mamp , mysql 5.6.20 i attempted reset password via mamp pass not work $mysql -u root -p come in password: pass error 1045 (28000): access denied user 'root'@'localhost' (using password: yes) $ and none of works $mysql -uroot error 1045 (28000): access denied user 'root'@'localhost' (using password: no) $mysql -u root error 1045 (28000): access denied user 'root'@'localhost' (using password: no) $mysql -u root@localhost welcome mysql monitor. commands end ; or \g. mysql connection id 62 server version: 5.6.20 homebrew copyright (c) 2000, 2014, oracle and/or affiliates. rights reserved. type 'help;' or '\h' help. type '\c' clear current input statement. mysql> utilize magento error 1044 (42000): access denied user ''@'localhost' d...

linux - Can I declare variables/arrays inside a sed script? -

linux - Can I declare variables/arrays inside a sed script? - i wondering if can declare variables within sed script. i.e. interpreter sed have concept of variables c, awk, python ... i'm not talking abt passing shell variables sed script. e.g. next awk script supposed mask names of real customers replacing them tom dick or harry in sequence. awk -f: ' begin{ ar[1]='tom'; ar[2]='dick'; ar[3]='harry' } /name:/ { print $1 ":" ar[i] if (i == 3) = 1 else = + 1; } ' customers.txt can declare variables i or ar in sed script? like commenter said, there rudimentary build called hold space can pile on info , pull off, easier if utilize bash function case statement or if want intuitive can utilize shell expansion , if don't need iterate sequentially can utilize $random: sed "s/name:.*/name: $([[ $(($random%3)) -eq 0 ]] && (echo -n "tom") || ([[ $(($random%3))...

database - How do I loop through certain records, check a query, and conditionally assign field value using VBA? -

database - How do I loop through certain records, check a query, and conditionally assign field value using VBA? - i trying accomplish following: use vba loop through table, , assign people seated @ dinner tables using next 3 parameters: 1) individual's priority score. 2) individual's preferences on table seated at. 3) seating capacity of table. ideally, vba start 1st record of priority 1 group, assign many people can placed in table1, , go on assigning priority 1 individuals according preference, while checking see if preferred tables @ capacity. after all priority 1 individuals assigned table (given 'table_assignment' value in table object), vba moves priority 2 individuals, , forth. in database, have next table (table object called 'tbl_assignments'): recordid | table_assignment | priority | title | preference_1 | preference_2 |... preference_n 001 1 ceo table1 ...

php - Get data from database and create needed JSON format -

php - Get data from database and create needed JSON format - i have php code fetch info database activity : try { $datestring = '09.03.2014'; $startdate = new datetime($datestring); $enddate = clone $startdate; $startdate = $startdate->format("u") . php_eol; $period = new dateinterval('p1m'); $enddate->add($period); $enddate = $enddate->format("u") . php_eol; $interval = new dateinterval('p1d'); $sql = <<<eod select timestamp_day,name activity timestamp_day between $startdate , $enddate order timestamp_day eod; $data = $db->query($sql)->fetchall(pdo::fetch_assoc); $output = ['data' => $data]; $jsontable = json_encode($output); //$date->format("u") . php_eol;//format date timestamp here } catch(pdoexception $e) { echo 'error: ' . $e->getmessage(); } echo $jsontable; this code give me info date date , json: data: [{timestamp_day:1394319600, nam...

ios - How to load .png images from Documents folder of an app -

ios - How to load .png images from Documents folder of an app - i have .png images in documents folder of app when seek load them don't work :/ i have class methods saving , loading : uiimage+loadscan.h : #import <uikit/uikit.h> @interface uiimage (loadscan) - (void)savescan:(nsstring*)name; - (uiimage *)loadscan:(nsstring*)name; @end .m : #import "uiimage+loadscan.h" @implementation uiimage (loadscan) #pragma save , load - (void)savescan:(nsstring*)name{ if (self != nil) { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring* path = [documentsdirectory stringbyappendingpathcomponent: [nsstring stringwithstring:name] ]; nsdata* info = uiimagepngrepresentation(self); [data writetofile:path atomicall...

android - java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null -

android - java.lang.UnsatisfiedLinkError: Couldn't load stlport_shared: findLibrary returned null - i working csipsimple , seek create business relationship in local network...the build runs fine....but can't create business relationship active....at origin of project run catches exception java.lang.unsatisfiedlinkerror.......and says unable load native library...i have been searching day long...i created armeabi-v7a under lib folder....and have downloaded 2 .so file firefox nightly build descripted in link.... here have same problem....please help me this thrown when effort made invoke native implementation not found. http://developer.android.com/reference/java/lang/unsatisfiedlinkerror.html please check link http://stackoverflow.com/a/22121375/1761003 please post code improve reply android jni unsatisfiedlinkerror

Putting Alt Text on Magento Category Thumbnail Images -

Putting Alt Text on Magento Category Thumbnail Images - magento has simple 'upload file' interface adding thumbnail images category pages not allow assign alt text while uploading. there on category page add together html thumbnail image. does know how assign alt text thumbnail images on main (but not root) category pages? thank you. magento

mysql - Custom form in WordPress and store values into custom database -

mysql - Custom form in WordPress and store values into custom database - i have simple form 2 text fields in wordpress site. created new page template , added next html code: this html: <form action="<?php the_permalink(); ?>" id="customform" method="post"> field 1: <input type="text" name="field1" id="field1"> field 2: <input type="text" name="field2" id="field2"> <input type="submit" name="submit" id="submit"> </form> now want achieve, whatever user inputs, stores mysql (which in same database wordpress), in table test_form , example. how accomplish this? you can next code: <?php include_once($_server['document_root'].'/wordpress/wp-config.php'); $field1 = $_post['field1']; $field2 = $_post['field2']; global $wpdb; $wpdb->query( $wpdb-...

Login Form using sql database c# -

Login Form using sql database c# - i'm trying create sign page . set user name , password , save in sql database. note: evrey thing worked until add together 2nd column(the password). this password code(the username same) : static public void delete(string _password) { seek { connection.open(); sqlcecommand commandinsert = new sqlcecommand("insert [table] values(@password)", connection); commandinsert.parameters.add("password", _password); commandinsert.executenonquery(); } grab (sqlceexception expection) { messagebox.show(expection.tostring()); } { connection.close(); } } and button settings : private void button1_click(object sender, eventargs e) { if (deletebox.text != "") { sqlfunctions.insert(insertbox.text)...

c# - Getting the selected row from dataGridView1 -

c# - Getting the selected row from dataGridView1 - i have datagridview1 on wondows form application. have populated datagridview1 list of strings. works great. but... i need able grab row user selected on , can't seem it. code gives me error, written below. i have copied gridviewrow form msdn site. private void editbutton_click(object sender, eventargs e) { gridviewrow row = datagridview1.selectedrow; //this have been using before list box. if (itemlist.selectedindex >= 0) { int newint = itemlist.selectedindex; form form = new newitemw(selectedfolder, this, items[newint], windowenum.itemedit); form.show(); } } i have tried getting error: "the type or namespace 'gridviewrow' not found." my basic question how work? assuming using winforms datagridview should this: private void editbutton_click(object sender, eventargs e) { if (datagridview1.selectedrows.count...

c# - Adding to mapped collection in NHibernate - transaction concern -

c# - Adding to mapped collection in NHibernate - transaction concern - i utilize nhibernate fluent configuration , have simple entity called administrator : public class administrator : entity { public virtual icollection<administratorclientassociation> clientsassociation {get; protected set; } ... public virtual void addclient(client newclient) { var clientassociation = new administratorclientassociation() { associationdate = datetime.now, client = newclient, clientowner = }; clientsassociation.add(clientassociation); } } collection clientsassociation 1:n relation mapped foreign key ( clientowner ) , has set cascade.onsaveupdate . question how nhibernate deals transactional concers in such situation? i'd create transaction in i'd add together client , , administratorclientassociation . question - should wrap transaction everywhere phone call addclient (cause injecti...

java - Zoom HTML in JTextPane -

java - Zoom HTML in JTextPane - i'm using simple jtextpane within jscrollpane show application's manual (simple html few pictures , bunch of links), , can't find way scale thing create application dpi-aware. i tried css, nothing, tried overriding paint method becomes impossible click on things because remain in original position. there way zoom it? java html swing zoom jtextpane

sql - Oracle listagg regexp_substr for code extraction and concatination -

sql - Oracle listagg regexp_substr for code extraction and concatination - i working pl/sql v10 on oracle 11g database. have codes beingness stored in description column of question table need extract. working on producing regex which works fine in 101regex fails in oracle, assume using wrong syntax. select '''' || listagg(regexp_substr(q.questiondescription,'(lif|lpa) ?\d{1,2}.\d{1,2}(\.\d{1})?'), ''', ''') within grouping (order q.questionid) || '''' question q q.isthunderheadonly = 0 or q.isthunderheadonly null patterns need match: lif 1.2 both lif 2.7.1 address line 1 lif 4.13 occupation lif 10.6.1 address line 1 lpa0.1 type of lpa want? lpa0.2 have same attorneys partner ? where did go wrong regex? edit: result getting 'lif 3.1', 'lif 4.1', 'lif 4.2', 'lif 5.1', 'lif 7.1', 'lpa0.1', 'lpa0.2' it's ignoring after sec grouping thi...

Avoid Horizontal Scrolling with JQuery DataTable plugin -

Avoid Horizontal Scrolling with JQuery DataTable plugin - how can set column width in table uses jquery datatable plugin avoid horizontal scroll ? what i've tried var table = $(data.datatable.container).datatable({ dom: "frtis", "columndefs": [{ "width": "5%", "targets": 0 }], autowidth: false, scrollx": false, scrolly: "250px", paging: true, order: true, language: { info: data.datatable.info, search: data.datatable.language.search, zerorecords: data.datatable.language.zerorecords, emptytable: data.datatable.language.emptytable, infoempty: data.datatable.language.infoempty, infofiltered: da...

jquery - How to set default time in Mobiscroll? -

jquery - How to set default time in Mobiscroll? - the main problem project bit old , can't update mobiscroll , don’t know current version of it... code looks this: jquery('#select-time').mobiscroll().time({ 'timeformat': 'hh:ii:ss', 'timewheels': 'hhiiss', }); i need set time 00:00:00 you can utilize setdate function passing arbitrary date , 00:00:00 time $('#demo').mobiscroll().time({ timeformat: 'hh:ii:ss', timewheels: 'hhiiss' }); $('#demo').mobiscroll('setdate', new date(2015, 0, 0, 0, 0, 0, 0), true); jquery mobiscroll

nsarray - Changing line of word numbers into numbers objective c -

nsarray - Changing line of word numbers into numbers objective c - hi objective c beginner , played around code got developer seek alter line of word numbers (two hundred , 30 two) numbers (232). have managed single word alter number cant figure out how link words gaps. 20 turned 20 20 2 doesnt homecoming anything. tips please on do? //text recognition nsarray *values = [[nsarray alloc]initwithobjects: @"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",nil]; nsarray *keys = [[nsarray alloc]initwithobjects: @"zero",@"one",@"two",@"three",@"four",@"five",@"six",@"seven",@"eight",@"nine" , nil]; numbers = [[nsdictionary alloc]initwithobjects:values forkeys:keys]; //passed text (nsextensionitem *item in self.extensioncontext.inputitems) { (nsitemp...

Android CardView cardCornerRadius gap -

Android CardView cardCornerRadius gap - i trying utilize new cardview ui widget in project on devices running android 2.3 there gap between cardview corners (see below). this in xml file: <android.support.v7.widget.cardview xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" app:contentpadding="50dp" app:cardcornerradius="50dp" android:layout_margin="10dp"> <view android:layout_width="50dp" android:layout_height="50dp" android:layout_gravity="center" android:background="@color/theme.apptheme.color" /> </android.support.v7.widget.cardview> and way see in 3.2 qvga screen avd in other device lg optimus sol, there veritcal gap. is there anyway prevent happen? i had same...

gps - Enabling 10 Hz sampling rate in Ublox modules -

gps - Enabling 10 Hz sampling rate in Ublox modules - i'm using ublox neo-m8n-0-01 gnss module. module supports 5hz gps+glonass , 10 hz gps only. however, when seek alter sampling rate (via ubx-cfg-rate in messages view) can increment 5 hz (measurement period = 200ms). value below 200ms impossible (changes box pink). it happens if produce nmea message gxgga. the way made gps via ubx-cfg-gnss has encountered issue? thanks in advance roi yozevitch you don't how setting rate going description i'm assuming using ublox u-center software. there simple explanation issue , simple solution: software has bug in (or wasn't updated match final specification of part). the solution not utilize u-center, it's pc software that's complaining not receiver. receiver doesn't care spec sheet says, seek it's best run @ whatever rate request. sending commands straight i've managed reliable 10hz gps+glonass. there occasional missing point...