Posts

Showing posts from March, 2011

ios - Return a copy of a UIImage instead of change in place -

i'm newbie @ ios development, , have run seems odd me. i've got following method take large image , make smaller version of it, upload both server: - (void)prepareanduploadimages { uiimage *originalimage = self.imageview.image; uiimage *smallerimage = [originalimage resizedimagewithcontentmode:uiviewcontentmodescaleaspectfill bounds:cgsizemake(1024.0, 768.0) interpolationquality:1]; [self uploadimage:originalimage withfilename:@"original.jpg"]; [self uploadimage:smallerimage withfilename:@"smaller.jpg"]; } this uploading images fine, weird thing when land on server "original.jpg" image shrunk version , "smaller.jpg" full-size image. i'm using uiimage resizedimagewithcontentmode: method uiimagecategories , it's return looks this: return [self resizedimage:newsize interpolationquality:quality]; the resizedimage:interpolationquality method it's calling returns this: return [self resizedimage:newsize tra...

osx - Accessing the Sandboxed Apple Store without XCode -

i working on osx app created using open source common lisp implementation called ccl. trying add in app purchases our app , read through storekitguide , wondering how able test in app purchases without using xcode. documentation gives instructions accessing sandboxed app store using xcode: when launch application xcode, store kit not connect app store. instead, connects special sandbox store environment. sandbox environment uses infrastructure of app store, not process actual payments. but doesn't tell how done without xcode. can done test in app purchases without xcode?

Try-except error in Python -

i have python script has batch command in between, batch_cmd = "batch command" subprocess.call(batch_cmd) consider scenario want repeat running batch command if fails. tried use try/except in such way batch_cmd has repeated in 'except' part too. is: try: batch_cmd = "batch command" subprocess.call(batch_cmd) except: print "error. retrying" subprocess.call(batch_cmd) the exception not getting caught, however. if batch command in try block fails, bypasses 'except' block , executes remaining of script. how can rewrite try/except part this? or there other method other try/except? know there have been similar questions on solutions have not helped me far. if want exception in case called command fails (nonzero exit code), use subprocess.check_call(batch_cmd) execute it. also use except subprocess.calledprocesserror: in case avoid catching more exceptions necessary.

excel - Extracting a Specific Variable from a Class Module in VBA to a Standard Module -

all, following code bloomberg. designed extract bulk data servers. code works, trying extract specific variable generated in class module , bring regular module user defined functions. help. option explicit private withevents session blpapicomlib2.session dim refdataservice blpapicomlib2.service private sub class_initialize() set session = new blpapicomlib2.session session.queueevents = true session.start session.openservice ("//blp/refdata") set refdataservice = session.getservice("//blp/refdata") end sub public sub makerequest(sseclist string) dim sfldlist variant dim req request dim nrow long sfldlist = "call_schedule" set req = refdataservice.createrequest("referencedatarequest") 'request type req.getelement("securities").appendvalue (sseclist) 'security + field string array req.getelement("fields").appendvalue (sfldlist) 'field string var dim cid blpapicomlib2.correlationid set cid = session.sendreq...

selenium webdriver - Entering login and pswd in new window -

i running test on creating movie , sharing on facebook using selenium webdriver. stuck after facebook login window opens. can tell me how can enter email , password inorder complete test. new selenium first of all, need check on internet. secondly, try tricks before post question that. so, need catch input fields : webelement inputname = driver.findelement(by.id("id of input")); inputname.sendkeys("freezer123@hotmail.com"); webelement inputpassword = driver.findelement(by.id("id of input")); inputpassword.sendkeys("pass1234"); webelement btnok = driver.findelement(by.id("id of button")); btnok.click(); take here

ruby on rails - What's the differences btw const_get and qualified_const_get? -

there series of methods, i.e., const_defined?, const_get, or const_set, in standard ruby library. const_defined?, const_get, const_set and also, in active support core extensions of rails, "qualified_" counterparts these individuals exist. qualified_const_defined?, qualified_const_get, qualifeid_const_set is there can explain explicitly differences between bare , qualified forms these methods? thank in advance. hyo the qualified_ const helpers support interacting constants @ arbitrary depths (not children of subject). i think example easiest way explain one. let's foo::bar::baz exists: > object::const_get "foo::bar::baz" nameerror: wrong constant name foo::bar::baz > object::const_get "foo" => foo > foo.const_get "bar" => foo::bar > foo::bar.const_get "baz" => foo::bar::baz the qualified_ methods allow avoid walking module hierarchy directly: > object::qualified_con...

Looking for solution in case statement in SQL Server -

i trying write below statements in case statements. trying update value in 1 different tableb particular column. after update set dismmr = then trying check below condition in case statements 'h01' not null , ('h02','h03','hr04','s07','s08','s09') null 'unknown' here values table name : tablea , column name code . this particular column designed not null here is null means trying that, particular value ('h02','h03','hr04','s07','s08','s09') don't exist or present in tablea . when particular value h01 in tablea column code ---- is not null -- means particular value of column code exist/present in column tablea . i need 1 in case statements because once done checking condition , writing other case statements started when check condition , update different value i using sql server 2008 r2. wrote below query. runs fine in ssms when use s...

sql - How do I list the department name from another table in my results? -

the following employees table: create table employees (empid char(4) unique not null, ename varchar(10), job varchar(9), mgr char(4), hiredate date, salary decimal(7,2), comm decimal(7,2), deptno char(2) not null, primary key(empid), foreign key(deptno) references departments(deptno)); insert employees values (7839,'king','president',null,'17-nov-11',5000,null,10); insert employees values (7698,'blake','manager',7839,'01-may-11',2850,null,30); insert employees values (7782,'clark','manager',7839,'02-jun-11',2450,null,10); insert employees values (7566,'jones','manager',7839,'02-apr-11',2975,null,20); insert employees values (7654,'martin','salesman',7698,'28-feb-12',1250,1400,30); insert employees values (7499,'allen','salesman',7698,'20-feb-11...

Cant use shared libraries in Qt project -

i created c++ library project in qt creator. after building project have libmylib.so, .so.1, .so.1.0, .so.1.0.0, makefile , mylib.o files. added library headers other project , added path .pro file this: libs += "/home/peter/workspace/build-libtester-desktop-release/libmylib.so" when building application don't no such file error, when running this: /home/peter/workspace/build-libtester-desktop-debug/libtester: error while loading shared libraries: libmylib.so.1: cannot open shared object file: no such file or directory which can't understand, because it's right there next .so seem find, because when path wrong no such file or directory error when trying build project. explain i'm missing here? thanks time. you adding library incorrectly. doing: libs += "/home/peter/workspace/build-libtester-desktop-release/libmylib.so" instead of: libs += -l"/home/peter/workspace/build-libtester-desktop-release" -lmylib the fi...

remove an element from a singly sorted linked list C++ -

i have sorted linked list , im trying create function delete whatever user passes nametosearch. keep geting error. below have far void deleteproduct(nodeptr head, char* nametosearch) { nodeptr nodeunderedit = findnodebyname(head, nametosearch); if (nodeunderedit == null) { cout<<"\n error: product not found \n"; } else { delete nodeunderedit; nodeunderedit = nodeunderedit->next; } } delete nodeunderedit; nodeunderedit = nodeunderedit->next; if delete nodeunderedit first, nodeunderedit->next lost. need first make sure node before nodeunderedit's next connected nodeunderedit->next , can remove.

javascript - jquery form results are not showing. Is my code wrong? -

i having difficulty form. on 1 of pages form. enter info, click submit, , returns result. well, supposed return result. appears nothing, currently. however, if check header responses in developer tools, show results. know being called correctly, not appearing on webpage. here calling code: $content .= ' <script type="text/javascript"> var $j = jquery.noconflict(); $j(window).load(function(){ $j("#pubverify-form").submit(function() { var str = $j(this).serialize(); $j.ajax({ type: "post", url: "' . $cs_base_dir . 'verify.php", data: str, success: function(msg){ $j("#note").ajaxcomplete(function(event, request, settings) { $j(this).html(msg); }); } ...

jquery - Unable to get cached AJAX data dimensions -

i'm trying make ajax calls more efficient caching data has been ajaxed. need render data in way depending on of resulting data's dimensions. when calling data first time, dimensions can read, , well. cache works enough, i'm having huge amount of difficulty getting dimensions of elements within cached data. below simplified version of i'm doing (with identical problems): var cache = {}; // ajax part function getdetails(request){ return jq.get(request); }; // filter & render ajax data function renderdata(data){ var endresult = $(data).find('#thetargetelement'); endresult.appendto($placehold); $placehold.find('#thetargetelement').css('visibility','hidden'); // log dimensions on ajax data fine // cached data returns height 0 console.log( height of elements within data ); }; // click handler jq('#slides').on('click', '.slidelink', function(e){ e.preventdefault(); var ...

getting error expression must have class type in c++ -

i getting following intellisense error: expression must have class type f:\c++\prj\map1\map1\testmap1.cpp 11 which referring following line in code (shown in full below): themap.insert(1, "one"); i cannot figure out issue is. not seem related declaration of themap , every time try call method on themap error. here code: map1.h #ifndef map_h #define map_h #include <list> #include <utility> using namespace std; //pair class definition template<typename f, typename s> class pair { public: pair(const f& a, const s& b); f get_first() const; s get_second() const; private: f first; s second; }; template<typename f, typename s> inline pair<f, s>::pair(const f& a, const s& b):first(a),second(b){} template<typename f, typename s> inline f pair<f, s>::get_first() const { return first; } template<typename f, typename s> inline s pair<f, s>::get_second() const { retur...

sql - Need all data from table -

this question has answer here: hierarchical queries in sql server 2005 6 answers hierarchical data in mysql 3 answers please help. i have 1 table called employee. i want record table self join parentid record like parent b child of a c child of a d child of c f child of b e parent g child of e h child of g if put self join , put record parent , a,b,c not d , f i want record parent a,b,c,d,e . you'll need use recursive cte if there isn't set number of parent/child levels. assuming you're using sql server 2005 or greater, should you're looking for: with cte ( select id, id parentid employee parentid null union select e.id, c.parentid employee e join cte c on e.parentid = c.id ) select id cte parentid = ...

iOS > custom analytics system -

the task interaction tracking data in ios app server-client service. analytics data being sent private back-end server why google analytics , flurry-like services not solution. ios app should collect , store tracking data in data base , send batches every n seconds specified server url. pretty ga , flurry ability send data specified server specified json representation. there open source or paid components doing functionality? update: best pattern kind of analytics dispatch system? thanks. cookieless analytics has webservice use accomplish this, make private server pull data every n seconds given date range. if you'd examples, welcome ask

html - After use .load my jquery doesn't work on the div -

i don't understand why happening, weird. since i'm jquery novice may missing something. here code <script type="text/javascript"> $(document).ready(function(){ $(".photos_container > a").mouseover(function() { $(this).fadeto("slow", 0.6); }).mouseout(function(){ $(this).fadeto("slow", 1); }); $('.pagination a').on('click', function(e){ e.preventdefault(); var link = $(this).attr('href'); $('.tab-pane.active').html('loading...'); $('.tab-pane.active').load(link+' .tab-pane.active > *'); }); }); </script> html <div class="photos_container tab-pane active" id="1"> <a href="javascript:void(0)" data-name="chameleon minds" data-photo-medium="http://localhost/site/wp-content/uploads/2013/04/chameleon-medium.png" data-title="art projects kids - status : client work"> ...

iphone - iOS App unknown crash issue - [SpeakCorrections key] unrecognized selector -

i use bwquincymanager log app's crash records. , found there lot of crashes this: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[speakcorrections key]: unrecognized selector sent instance 0x1f835a20' i dont know "speakcorrections" is, it's not in source code, or others thirdparty source code used in project. , not in apple's lib, @ least can't find @ developer.apple.com . and googled error, seems not many helpful informations. can tell me speakcorrections class is? the full crash infomation sample: incident identifier: [todo] crashreporter key: [todo] hardware model: iphone4,1 process: xxxx [3867] path: /var/mobile/applications/99b8fde3-189c-412d-9539-7fc73b33f3e0/xxxx.app/xxxx identifier: com.xxxx.yyyy version: 1234 code type: arm parent process: launchd [1] date/time: 2013-04-14 22:32:05 +0000 os version: iphone os 6.1.3 (10b329) report ve...

haskell - How to use createTransport? -

i'm following cloud-haskell tutorial , stuck @ createtransport . seems me i'm able open transport @ 127.0.0.1 server , can't open transport client connect server. i've tried using 2 machines, using curl ifconfig.me ip address, however, createtransport not create transport me. ideas? edit: locally working now. my program exact same tutorial, trying connect between 2 machines: curl ifconfig.me returns 101.119.27.24 command line server: serverclientserver 101.119.27.24 9000 error returned: bind: unsupported operation (cannot assign rerquested address) edit: server code followed: main :: io () main = [host, port] <- getargs serverdone <- newemptymvar right transport <- createtransport host port right endpoint <- newendpoint transport forkio $ echoserver endpoint serverdone putstrln $ "echo server started @ " ++ show (address endpoint) readmvar serverdone `onctrlc` closetransport transport the ec...

ios - Is there a private API available to access the SIM Toolkit? -

i'm investigating apis available accessing sim toolkit, exist? (yes know use of such api wouldn't permit app submitted app store) 1) can take @ coretelephony framework (disassemble it). has bunch of functions around simtoolkit like: ctserverconnectioncopysimtoolkitmenu ctserverconnectionselectsimtoolkitmenuitem , on. 2)you can take (disassemble) @ /system/library/springboardplugins/simtoolkitui.servicebundle/simtoolkitui you able see functions used there (you see lot of functions #1)

android - Can't perform translate and alpha animation on Gingerbread -

i have following animation resource: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator" android:shareinterpolator="true"> <translate android:duration="@integer/animation_time" android:fromxdelta="0%" android:toxdelta="0%" android:fromydelta="0" android:toydelta="10%" /> <alpha android:duration="@integer/animation_time" android:fromalpha="1.0" android:toalpha="0.0" /> </set> i have animation set on dialog, when dialog dismissed, shifts down , fades out. working on android 3.0+, on pre 3.0 devices, alpha portion of animation doesn't anything. if set duration longer time, dialog doesn't disappear right away, seems it's ru...

javascript - AngularJS strategy to prevent flash-of-unstyled-content for a class -

i have angularjs project, want prevent fouc during page load on classname. i've read ng-template seems useful content within tag. <body class="{{ bodyclass }}"> i "login" on page load. strategy this? or have fudge , load 'login' , manually use javascript to tweak dom instance. what looking ng-cloak . have add this: <body class="{{ bodyclass }}" ng-cloak> and prevent unwanted flashing. link docs this. edit: advisable put snippet below css file, according docs. "for best result, angular.js script must loaded in head section of html document; alternatively, css rule above must included in external stylesheet of application." [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }

ios - May 1st new iTunes submitting regulation -

1) iphone 5 (4 inch screen) according explanation on page 51 in ios human interface guidelines, shouldn’t use space display additional bar or banner. however, make space more artistic in order improve design quality of game. in fact, going decorate space beautiful design patterns. doing this, sure can provide rich game experience our customers. there problems implement artwork? 2) retina display we think should make our existing image resources( app icon, app icon appstore,launch image) adjust retina display. in addition, might need add @2ⅹ suffix files , scale image resources 200%. know details requirements meet criteria retina display. supposed do? does know minimum regulation take effect may 1? first question. thank help. 1) don't think there won't issue in adding artwork iphone 5. ensure doesn't screw & feel in iphone 4 ( 3.5 " screen) 2) here apple spec explains retina images iphone -> app icon (required) non retina: 57 x 57 pixe...

shell - Bash: How to set a variable from argument, and with a default value -

it pretty clear shell scripting sort of thing can accomplished in huge number of ways (more programming languages) because of different variable expansion methods , programs test , [ , [[ , etc. right i'm looking dir=$1 or . meaning, dir variable should contain either specified in first arg or current directory. what difference between , dir=${1-.} ? i find hyphen syntax confusing, , seek more readable syntax. why can't this? dir="$1" || '.' i'm guessing means "if $1 empty, assignment still works (dir becomes empty), invalid command '.' never gets executed." i see several questions here. “can write reflects logic” yes. there few ways can it. here's one: if [[ "$1" != "" ]]; dir="$1" else dir=. fi “what difference between , dir=${1-.} ?” the syntax ${1-.} expands . if $1 unset, expands $1 if $1 set—even if $1 set empty string. the syntax ${1:-.} ...

node.js - About this and self in javascript -

i know "self" magic. @ snippet nodejs(not complete). socket.prototype.connect = function(options, cb) { ...... var self = this; var pipe = !!options.path; if (this.destroyed || !this._handle) { this._handle = pipe ? createpipe() : createtcp(); initsockethandle(this); } if (typeof cb === 'function') { self.once('connect', cb); } timers.active(this); self._connecting = true; self.writable = true; ...... } it understanding must use self create closure. here there no closures in these lines author use both after assigning self. make difference here? in you've shown in particular code example, there no reason have self variable because there no other function scopes might need access original value of this . some developers have consistent methodology or convention create local variable self , assign value of this have use, if needed, in closures. self variable can minimized smaller this because can ren...

jquery - Find Length of Div -

how find no. of elements present in div?? want print list of element present in div . have tried not working .. <!doctype html> <html> <head> <title> div length</title> <script type="text/javascript" src="js/jquery-1.6.2.min.js"> </script> <script> $(function () { alert(' elements ' +$('#main').length); } ) </script> </head> <body> <div id="main"> <img src="images/thumb1.jpg"; height="30" width="30" /> <img src="images/thumb2.jpg"; height="30" width="30"/> <img src="images/thumb3.jpg"; height="30" width="30"/> <img src="images/thumb4.jpg"; height="30" width="30"/> <div id="main1"> </div> <div id="main2"> </div> </div> </body> </htm...

ios - Asynchronous loading of images? -

how can load images asynchronously? i'm doing (borrowed open source code loading image thumbnail): - (uiimage*)thumbnaillistview:(thumbnaillistview*)thumbnaillistview imageatindex:(nsinteger)index { nsurl* url = [nsurl urlwithstring:[recommendedarray objectatindex:index]] ; // [[cell grid_image] setimage:[uiimage imagewithdata:[nsdata datawithcontentsofurl:url]]]; nsstring *docpath = [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0]; bool isimageloaded = yes; uiimage *bookimage = [uiimage imagewithcontentsoffile:[nsstring stringwithformat:@"%@/%@", docpath, [[recommendedarray objectatindex:index] lastpathcomponent]]]; if(bookimage == nil) isimageloaded = no; if(!isimageloaded){ uiimage *thumbnailimage =[uiimage imagenamed:@"app-icon-144x144.png"];} else{ uiimage *thumbnailimage = [uiimage imagewithdata:[nsdata datawithcontentsofurl:[nsurl urlwithstring:[nsstring string...

java - Migration of my application from Glassfish 2.1. to JBoss 7.1.3 -Related to user shared lib -

good day! my application running fine in glass fish 2.1. .ear file. using more configuration file xsl,xsd,apache log4j xml , property files application. have created shared library in disk c:/sharedlib , put configuration files in location. in glassfish give location in application server-->jvm settings-->path settings --> classpath prefix --- c:/sharedlib i use property files,jar files , xsl,xsd location(c:/sharedlib. application (.ear ) contains ejb , war file. my question how can use same configuration in jboss 7.1.3? there way without changing code in application .ear?

tsql - Convert Varchar into Time in SQL Server -

how convert time format " 10:02:22 pm " sql server datetime format. i have column of such data. imported column csv file , want convert datetime format can able use date time functions. i want able insert column table correct datetime format. you don't need convert it. implicit cast occurs when use insert othertable select ....., timeasvarchar, ... csvtable if time data (leading space or not) parseable string, query work beautifully. if however, there possibility of bad or blank data cannot converted time, test first insert othertable select ....., case when isdate(timeasvarchar)=1 timeasvarchar end, ... csvtable else null implied left out.

ios - Xcode UINavigationBar Text font and color -

this question has answer here: iphone navigation bar title text color 31 answers i want change color , font of uinavigationbar title . how can either code or interface builder ? might easy 1 i'm new xcode. helping. for coding part, can initiate title view label. uilabel *mylabel = [[uilabel alloc] initwithframe:cgrectmake(0, 0, 10, 40)]; [mylabel setfont:[uifont fontwithname:@"arial" size:12]]; [mylabel settextcolor:[uicolor whitecolor]]; [mylabel settext:@"my text here"]; [**your navigation bar**.topitem settitleview:mylabel];

scope - Global variables across multiple files in python -

i have modules.py file : global dns_server_ip def setvnetglobalparameters(): dns_server_ip = '192.168.3.120' and i’m importing file in abc.py file from modules import * setvnetglobalparameters() print(dns_server_ip) but ‘dns_server_ip’ still not accessible. i want set global parameters through function only. appreciated! thanks.. as per question understand beginner python. while importing modules have use module name , don't need include extension or suffix(py) , in code miss starting single quote . here modified code: modules.py dns_server_ip = '' def setvnetglobalparameters(): global dns_server_ip dns_server_ip = '192.168.3.120′ here abc.py import modules modules.setvnetglobalparameters() print modules.dns_server_ip here through global keyword telling python interpreter change or point out global variable instead of local variable , variable either global or local if variable both (local , global) python un...

Combination of fields_for block and non fields_for block in Rails 3.2 -

i'm trying create form combination of fields_for block , non fields_for block: but outputs repeating, , looks they're looping... maybe because, there fields_for block , other 1 not fields_for / form. how can combine 2 of them inside <tbody> or <tr> tag. <% @annual_procurement_plan.project_procurement_management_plans.each |ppmp| %> <% ppmp.items.each |itemx| %> <tbody> <%= f.fields_for :project_procurement_management_plans |p| %> <%= p.fields_for :items |item| %> <tr class="nested-fields info"> <td> <%= item.select :category_id, category.all.map{|c| [c.code, c.id]}%> </td>   <td> <%= content_tag :span, itemx.description%> </td> <td><%= p.text_field :pmo_end_user%> ...

opengl - Drawing multiple objects with different textures -

do understand correctly typical way draw multiple objects each have different texture in opengl bind 1 texture @ time using glbindtexture , draw objects use it, bind different texture , same? in other words, 1 texture can "active" drawing @ particular time, , last texture bound using glbindtexture . correct? bind 1 texture @ time using glbindtexture , draw objects use it, bind different texture , same? in other words, 1 texture can "active" drawing @ particular time these 2 statements not same thing. a single rendering operation can use single set of textures @ time. set defined textures bound various texture image units. number of texture image units available queryable through gl_max_combined_texture_image_units . so multiple textures can "active" single rendering command. however, that's not same thing binding bunch of textures , rendering several objects, each object uses some (or one, in case) of bound textures...

Make Coverflow appear like a Horizontal Gallery Android -

Image
i trying make coverflow below appear horizontal gallery. original file looks there 3 classes the coverflow.class extends gallery public class coverflow extends gallery { private camera mcamera = new camera(); private int mmaxrotationangle = 50; private int mmaxzoom = -380; private int mcoveflowcenter; private boolean malphamode = true; private boolean mcirclemode = false; public coverflow(context context) { super(context); this.setstatictransformationsenabled(true); } public coverflow(context context, attributeset attrs) { super(context, attrs); this.setstatictransformationsenabled(true); } public coverflow(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); this.setstatictransformationsenabled(true); } public int getmaxrotationangle() { return mmaxrotationangle; } public void setmaxrotationangle(int maxrotationangle) { mmaxrotationangle = maxrotationangle; } public boolean getcirclemode() { return mcir...

asp.net - Datatable Archival SQL Server 2008 -

i have database 54 gb in size, of tables have loads of rows in them. now querying these tables eats performance , takes ages queries execute. have created indexes , stuff, planning archive records in tables , query them when user wants to. for example, let's have table called transaction , don't need rows of older 3 months. now want store rows of transaction table more 3 months old other table , query table when user in ui says view archived transactions. options can think of: creating archivedtransaction in same database, problem size of database keep growing , @ point have start deleting rows. moving rows different database altogether in case how manage database request, there lot of change required, not sure of performance when 1 says view archived rows adding column archived tables , checking flag when needed, size issue still same , performance doesn't improve extent. i not sure way go, sure there better way handle not aware of. any ideas way...

jsp - i dont know how to store a cookie value in java and pass then to html page i will use wicket concept in websession here -

code in java page protected void onsubmit() { system.out.println("login name inner submit function:"+this.loginname); if(loginname == null || password == null) { logger.error("login failed - login name " + (loginname!=null ? "is set (trimmed length=" + loginname.trim().length()+")" : "is null") + " , password " + (password!=null ? "is set" : "is null") + "."); error(getlocalizer().getstring("login.error", null)); return; } user user = jtracapplication.get().authenticate(loginname, password); system.out.println("user:"+user); if (user == null) { /* * ================================ * login failed! * ================================ ...

ios - Write to plist file (In Particular row/Item) -

Image
i have .plist file have structure, i want add or replace item 5. using code nserror *error ; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"introduction.plist"]; nsmutablearray *data = [[nsmutablearray alloc] initwithcontentsoffile:path]; nsstring *comment = str; [data replaceobjectatindex:1 withobject:comment]; [data writetofile:path atomically:yes]; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if (![filemanager fileexistsatpath:path]) { nsstring *bundle = [[nsbundle mainbundle] pathforresource:@"introduction" oftype:@"plist"]; [filemanager copyitematpath:bundle topath:path error:&error]; } if change replaceobjectatindex: 5 changes plist structure, , don't want that. how can insert/replace text @ row 5 (item 5) of particular index?...

Need possible options for "App wrapping " in Android -

i want know "app wrapping" options available in android. requirement have control on 2-3 apks, wrapped together. apks communicate each other data sharing not third-party apps. any options in android wrapping apks. use same certificate sign them (no jars, or library references needed, unless app structured way): application modularity – android system allows applications signed same certificate run in same process, if applications requests, system treats them single application. in way can deploy application in modules, , users can update each of modules independently if needed. then use contentprovider flag android:exported=false in manifest make sure outside applications don't have access it.

bash - Redirect output of a file to the write command -

i trying redirect standard outupt of file write command , display contents of file (with color changes) in terminal of other user. the contents of file output displayed (filename menu_sys.sh) echo -e "\t\t\033[4;41m welcome internal messaging system \033[0;0m" when use code $ sh menu_sys.sh | write 680613 output ^[[4;41m welcome internal messaging system^[[0;0m tried using standard output redirection using &1> did not work but need output in formatted condition. if write command allowed arbitrary control characters sent terminal of user, flagrant security problem. in fact, sanitizes contents of message sent render control characters harmless. that's why see esc control character 2 ascii characters '^' , '[' on other user's terminal. as aside: jonathan leffler mentioned, "standard output of file" doesn't make sense. appear doing sending standard output of command ( echo ) write command, not "stan...

algorithm - Ruby implementation for ROC curve -

i'm try implement calculation of roc curve in ruby. tried transform pseudocode http://people.inf.elte.hu/kiss/13dwhdm/roc.pdf (see 6th site, chapter 5, algorithm 1 "efficient method generating roc points") ruby code. i worked out simple example, i'm getting values on 1.0 recall. think misunderstood something, or made mistake @ programming. here gor far: # results classifier # index 0: users voting # index 1: estimate system results = [[5.0,4.8],[4.6,4.2],[4.3,2.2],[3.1,4.9],[1.3,2.6],[3.9,4.3],[1.9,2.4],[2.6,2.3]] # on score of 2.5 item positive 1 threshold = 2.5 # sort index 1, estimate l_sorted = results.sort { |a,b| b[1] <=> a[1] } # count real positives , negatives positives, negatives = 0, 0 positives, negatives = 0, 0 l_sorted.each |item| if item[0] >= threshold positives += 1 else negatives += 1 end end fp, tp = 0, 0 # array holds points r = [] f_prev = -float::infinity # iterate on items l_sorted.each |item| # if score of ...