Posts

Showing posts from August, 2010

asp.net mvc - Dropdownlist in Razor MVC 4 -

i want add dropdownlist view few static options without using viewbag, , want bound model. how can this? well, start writing view model: public class myviewmodel { public string selectedvalue { get; set; } public ienumerable<selectlistitem> values { get; set; } } then controller action populate view model , pass view: public class homecontroller : controller { public actionresult index() { var model = new myviewmodel(); // todo: values coming database or model.values = new[] { new selectlistitem { value = "1", text = "item 1" }, new selectlistitem { value = "2", text = "item 2" }, new selectlistitem { value = "3", text = "item 3" }, }; return view(model); } [httppost] public actionresult index(myviewmodel model) { string selectedvalue = model.selectedvalue; return conte

android - SQL-statement for ordering -

i order database - doesn't work is order <field> asc the statement android? you can't "order" database. however, can order query results, appropriate query overload. public cursor query (string table, string[] columns, string selection, string[] selectionargs, string groupby, string having, string orderby) sqlitedatabase.query | android developers for example: db.query("sometable", new string[] { "columna", "columnb" }, "where columnc = ?", new string[] { "columnc_condition" }, "columnb", null, "columna"); translates select columna, columnb sometable columnc = "columnc_condition" group columnb order columna

Maven assembly plugin: prerequisite but not bind -

i know can bind assembly plugin "package" phase of project want different: when run mvn package execute without assembly when run mvn assembly:single execute package phase first. i know can mvn package assembly:single manually verbose , error prone: if edit code , forget put "package" mvn assembly:single , generate the old version of code in assembly, without compiling changed code. when running cli mvn package assembly:single must (see update) provide required properties single goal explains why error prone. but, if add following plugin definition pom under build plugins section: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-assembly-plugin</artifactid> <version>2.4</version> <executions> <execution> <id>default-cli</id> <phase>never</phase> <!-- or undefined --> <

collision - Andengine Tiledmap How to make sprites impassable by another? -

i have working collision system sprites dont want "player" pass. problem have no idea should execute on collision make player not pass sprites. wallcollision() method empty. if(tmxtileproperties.containstmxproperty("collision", "1")) { rectangle rect = new rectangle(tmxtile.gettilex(), tmxtile.gettiley() ,128, 128, mengine.getvertexbufferobjectmanager()) { @override protected void onmanagedupdate(float psecondselapsed) { if (player.collideswith(this)) { wallcollision(); } } }; rect.setvisible(false); mainscene.attachchild(rect); } the question located here addresses this. method below creates jbox2d body @ same position blocked tile. i'm not sure how works in conjunction pathfinding exclude blocked tiles, i've seen same approach used in other places, assuming you're using gles2. hope helps. private void create

javascript - NOT a specific word at ending in regex -

i have strings: "/page/test/myimg.jpg" "/page/test/" "/page2/test/" "/page/test/other" i want true strings starting /page/test except when ends .jpg . then did: /^\/page\/test(.*)(?!jpg)$/ . well, it's not working. :\ it should return this: "/page/test/myimg.jpg" // false "/page/test/" // true "/page2/test/" // false "/page/test/other" // true use negative behind anchored end: /^\/page\/test(.*)(?<!\.jpg)$/ for clarity, regex match input *doesnt end in .jpg : ^.*(?<!\.jpg)$ edit (now must work in javascript too) javascript doesn't support behinds, ugly option must used, says @ least 1 of last 4 characters must other .jpg : ^.*([^.]...|.[^j]..|..[^p].|...[^g])$

browser - Back Two Steps Activity Android -

hi m using twitter4j , theres issue of stack because when loged in open browser verification , create new activity , press button opens browser again.i want remove browser activity stack 1 , mystery me how that. a start's b , b starts c ,b browser dont have control of . want remove b stack you need call finish() on activity want remove stack. code this: startactivity(new intent(myactivity.this, nextactivity.class); finish(); // removes activity stack

.net - How to combine lists into single data entity in c# -

i have web method in c# web service creates 3 lists, filled xml input. want combine these 3 lists 1 entity (a dataset best, ios app consuming web service programmed accept , parse datasets), , return them web method. here code looks like: [webmethod] public dataset selectobjects(string externalid, string password) { dataset ds = new dataset(); membershipauthservicereference.membershipauthenticationservice objservice = new membershipauthservicereference.membershipauthenticationservice(); membershipauthservicereference.soapheadercredentials objsoapheader = new membershipauthservicereference.soapheadercredentials(); membershipauthservicereference.memberuserinfo objmemberinfo = new membershipauthservicereference.memberuserinfo(); try { objsoapheader.username = externalid; objsoapheader.password = password; objmemberinfo = objservice.getmembershipinfo(); list<obj1> listobj1 = new list<obj1>();

c# - Session losing variables fairly randomly -

i'm seeing odd: environmental background: i have couple of servers on load balancer (sticky turned on) i'm keeping object in session - 1 property of object may contain large amount of data. the process: i'll upload image, keeping copy of in session because i'm doing manipulation on (it's pre-resized consistent width size shouldn't issue) i'm logging , can confirm it's not switching servers (the loadbalancer working correctly) in 1 browser i'll upload image, basic manipulation (rotations) in second browser i'll upload same image couple more rotates. after minute (sometimes) second browser looses variable in session containing image i can still manipulate image in first browser. after looking @ logging: session id consistent call call, appears session #2's variable set null. i should note we've seen when hit either server directly. can give me place start looking? (i've made sure i'm not doing silly , sett

plsql - Can Oracle PL/SQL support short-circuit evaluation? -

given v_ssn_ind integer := if trim(p_ssn) null 0 else 1 end if; i know can this: if v_ssn_ind=1 then… but can short-circuit evaluation, ie: if v_ssn_ind then… ? first off, talking not appear have short-circuit evaluation . short-circuit evaluation when code like if( quick_condition , slow_condition ) <<do something>> end if; evaluates second slow condition if , if initial quick condition evaluates true. second, assignment of value v_ssn_ind not syntactically valid. third, no, cannot say if <<integer variable>> because not make sense. value evaluate true , value evaluate false? if 0 false , 1 true, example, 17 translate to? if declaring sort of indicator variable, make sense use boolean data type rather integer. if use boolean, can if <<boolean variable>> because eliminates ambiguity. won't faster adding = true if condition however.

sql server - Microsoft SQL-Apply "Where" Clause to Particular Columns -

i trying number of days person has total recording time on amount multiple amounts. right able 1 column of accurate data number of days(i getting days on 60 in of days columns. want return 0 persons not having days particular recording length increment. want number of days increments persons having days recording lengths in increments. essentially wish put "where" clause column name define column.(i know doesn't work way) best way to tackle problem? here code: with cterecordingsbydate ( select person.firstname, person.lastname, cast(created date) whole_date, sum(length)/60 recordings_sum, --length in seconds recordings join person on recordings.personid=person.id created between '2013-07-01 00:00:00.000' , '2013-08-01 00:00:00.000' group person.firstname, person.lastname, cast(created date)

scripting - Automate editing .csv file -

i working .csv files contain 4 fields , varying count of records in each file. need delete 2nd, 3rd , 4th field , first record in each file. i have lot of files working , not looking in excel or csv editor. there way batch file or other scripting language ? info using shell script: tail -n +2 input.csv | cut -d ',' -f 1,5- > output.csv

html - CSS height adjusting -

in html have this <div id="content"> <div id="wrapper"> <div id="steps"> <form id="formelem" name="formelem" action="" method="post"> <fieldset class="step"> <legend>general information </legend> </fieldset> <fieldset class="step"> <legend>medical history</legend> </fieldset> </form> </div> <div id="navigation" style="display:none;"> <ul> <li class="selected"> <a href="#">general information</a> </li> <li> <a href="#">medical history</a> &l

html - IIS 7 virtual directory not targeting website root? -

i'm trying configure virtual directory in iis 7 target root of website on our server. structure example follows: websites: | --- assetsserver | - /images/ | - /css/ | - etc. | --- demoserver - assets (this virtual directory pointing "assetsserver") now in demoserver's html, have following code image want target images folder within "assetsserver": <img src="/assets/images/logos/my-logo.png" alt="my logo"> the url when viewed in browser displays as: http://www.mysite.com/assets/images/logos/my-logo.png this looks should targeting virtual directory, goes "assetsserver"s image folder > logos > my-logo.png. 500 error , suspect configuration setting wrong (maybe not wrong not set how need it). when modify virtual directory points "assetsserver\images\" , modify html code accordingly, image displays fine. the reason why want virtual directory target

loops - Ways to iterate over a List in java? -

being new java language i'm trying familiarize myself ways (or @ least non-pathological ones) 1 might iterate through list (or perhaps other collections) , advantages or disadvantages of each. given list<e> list object, know of following ways loop through elements: basic for loop (of course, there're equivalent while / do while loops well) // not recommended (see below)! (int = 0; < list.size(); i++) { e element = list.get(i); // 1 - can call methods of element // 2 - can use make index-based calls methods of list // ... } note: @amarseillan pointed out, form poor choice iterating on list s because actual implementation of get method may not efficient when using iterator . example, linkedlist implementations must traverse of elements preceding i-th element. in above example there's no way list implementation "save place" make future iterations more efficient. arraylist doesn't matter because complexity/cost of ge

Excel: select value from multiple id's -

so, want find id's (there multiple) in column orderid. formula have... =lookup(indirect("a" & row()),table2[orderid],table2[quantity]) it selects value of last id of said number, how write select them , add them together? i think you're looking sumif: =sumif(table2[orderid],a1,table2[quantity])

codeigniter - Backbone js model get method returns "(an empty string)" even if modobj.attributes is correctly set -

i french, sorry poor english. beginner backbone js. have app uses codeigniter 2.1.3 (with mysql) , backbone js 1.0.0 i don't know why model getter console.log(obj.get("x")); still returns " (an empty string) " here js code : var questionnaire = backbone.model.extend({ // contain 3 attributes. // these default values urlroot: site_url + '/api/questionnaire/id/', defaults: { label_questionnaire: '', id_visuel: '', intro_questionnaire: '', version_questionnaire: '', type_questionnaire: '' } }); // create collection of questionnaires var questionnaires = backbone.collection.extend({ url: site_url + '/api/questionnaires', model: questionnaire }); var q =new questionnaire({id: '7'}); q.fetch(); console.log(q.get("type_questionnaire&quo

uilabel - NSRangeException Out of Bounds error -

i setting attributed text of label, , getting strange error: terminating app due uncaught exception 'nsrangeexception', reason: 'nsmutablerlearray replaceobjectsinrange:withobject:length:: out of bounds'. have never seen error before, not sure how fix it. here code causing crash: if ([cell.wavetextlabel respondstoselector:@selector(setattributedtext:)]) { const cgfloat fontsize = 16.0f; //define attributes uifont *boldfont = [uifont fontwithname:@"helveticaneue-medium" size:fontsize]; // create attributes nsdictionary *attrs = [nsdictionary dictionarywithobjectsandkeys:boldfont, nsfontattributename, nil]; nsrange rangeofis = [cell.cellwaveobject.wavestring rangeofstring:@" is"]; nslog(@"the range of is: {%lu, %lu}", (unsigned long)rangeofis.location, (unsigned long)rangeofis.length); nsrange namerange = nsmakerange(0, rangeofis.location); nslog(@"the range of name: {%lu, %lu}", (unsigne

jquery select child by class, on child-click toggle the parents class -

i trying select element class , , when clicked parent toggled. html: ` great-grandparent <div class='section' id='section-18'> grandparent <div class='docs'> parent <div class='octowrap'> * <a class='octothorpe' href='#section-18'>#</a> ` $('octothorpe').closest('div.section').click(function() { $(".fold").toggle(500); console.log('fold', $('.fold').length); }); }); console.log("closest", $('.octothorpe').closest('div.section').length); ` <style> .fold { display: none; } </style> ` q1 answered << neither work, how test class element being selected? there standard console log message can output? (i tried looking @ firefox inspector, couldnt tell if getting selected or not. how test straight

css - Bootstrap: how to extend input to occupy available space? -

i created example: jsfiddle <div class="container"> <div class="row"> <div class="span6"> <ul class="thumbnails"> <li class="span4"> <div style="height:200px; position: relative" class="thumbnail"> <div style="position: absolute; left: 5px; right: 5px; bottom:5px;"> <form style="margin:0;" class="form-inline"> <input style="margin: 3px 0 0 0;" type="text" placeholder="name…" ng-model="mashname" class="pull-left span3" /> <button type="submit" style="margin: 3px 0 0 0; " class="span1 btn btn-primary pull-right">create</button> </form> </div> </div> </l

target HTML option label instead of its value in PHP? -

i trying target option label instead of value in php page. i know php server side , difficult target option label there work around this? the code using this: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href= "css/mainstyle_css.css" /> <meta http-equiv="content-type" content= "text/html; charset=utf-8" /> <title> title </title> </head> <body> <form method="post" action=""> <select name="mylist" id="mylist" class="mylist"> <optgroup label="list 1"> <option value="music/one" label

c# - Datagridview checkbox column has a dead area -

i have datagridview (winforms) checkbox column other text-based columns. i've worked through of common issues around checkbox columns documented on site. however, have 1 remaining problem. able click "directly" on checkbox , respond way want. however, if move mouse pointer between cell boundary , checkbox control, , mouse click, able select cell state of checkbox not toggle. problem more evident when row height bigger given row. thanks help note: not, repeat not , issue occurs when focus moves off given checkbox cell after checked. have 1 solved. this not issue. how supposed work. grid column can have cellclick events , cellcontentclick events. since want checkbox check when click anywhere inside cell, should use cellclick. among other events need listen for, added following code: private void grid_cellclick(object sender, datagridviewcelleventargs e) { if ((e.columnindex == 1) && e.rowindex != -1) {

php - WAMP 2.2 Localhost Call to undefined function curl_init() -

i using wamp 2.2 php 5.3.13 , apache 2.2.22 , getting error on localhost: call undefined function curl_init() i removed ; extension=php_curl.dll extension_dir = "c:/wamp/bin/php/php5.3.13/ext/" correct have restarted wamp server , download php_curl.dll following url http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/ and still getting error...anyone got ideas? thanks, j make sure php_curl extension selected in wamp php extension options. edit make answer clear: there 2 php_curl.dll files found on website linked in question: http://www.mediafire.com/file/0hm40owj08y68p7/php_curl-5.3.13-nts-vc9-x64.zip , http://www.mediafire.com/file/qwgdzgccthzwc15/php_curl-5.3.13-vc9-x64.zip looks 1 of them worked op.

sql - Concatenation issues -

i have table "patient" has 5 fields. create table patient (pat_id char (4) primary key, pat_name varchar (7), admitted date, room char (3), doctor varchar (7)); insert patient values (1001, 'fred', '30-mar-07', 101, 'payne'); i want create view output this: patient doctor room admitted "-----------------------------------------------" 1001 fred payne 101 march 31, 2007 the problem want concatenate pat_name , pat_id own separate "patient" column have other 3 fields concatenated (notice there no separation in 'dashes'). basically, want 1 single column 5 columns concatenated, need have first 2 columns combined single subcolumn named "patient". can concatenate within concatenation? select concat(pat_id, ' ', pat_name) patient, doctor doctor, room room, admitted admitted patient

HTML Scraping with Javascript -

i use simple javascript script, in batch file, download audio , video - radio , tv shows - bbc iplayer. part of script extracts data bbc's xml pages. i want try extracting data html page. can point me javascript method extracting data ordinary .htm or .html page? i'm anxious keep things simple, having javascript routine can include in html page on website, i'm interested in javascript solutions. thanks. edit, 24 aug - the bbc's html pages don't respond javascript scripts parse xml pages. i use simple javascript interrogate xml, based on - function loadxml() { xmldoc = new activexobject("microsoft.xmldom"); xmldoc.async = false; xmldoc.onreadystatechange = readxml; xmldoc.load(url); } your question kinda vague. think there may 2 ways done: 1. apply regexp match patterns 2. import html dom simulator , walk tree find data ( assume using nodejs )

How to connect to SQL Server from R under cygwin? -

i'm having real difficulty coming set of tools/configuration works connect microsoft sql server r under cygwin. i'm using rodbc library i can connect when i'm using r under windows using statement like: db.connex.string <- 'driver={sql server};server=machine_name;database=db_name;trusted_connection=true' db.connex <- odbcdriverconnect(db.connex.string) when try same command in r under cygwin, flurry of warnings , errors start out: > warnings() warning messages: 1: in odbcdriverconnect(db.connex.string) : [rodbc] error: state 00000, code 1807981029, message [iodbc][driver manager]no such file or directory 2: in odbcdriverconnect(db.connex.string) : [rodbc] error: state im003, code 1807981029, message [iodbc][driver manager]specified driver not loaded 3: in odbcdriverconnect(db.connex.string) : [rodbc] error: state im003, code 1807981029, message [iodbc][driver manager]specified driver not loaded 4: in odbcdriverconnect(db.connex.string) : [rodb

ssis - Excel formula changes when columns are added dynamically -

i have excel workbook sheet1 cell a10 refers sheet2 cell a1. using formula sheet2!$a$1 i run ssis package, has script task adds column , row sheet2. formula automaticlly changes sheet2!$b$2 although using absolute formula, dont expected. ideas on how achieve want? please try =indirect(a11) (adjust a11 suit) instead of =sheet2!$a$1 , in a11 (or wherever chosen) =address(1,1,1,1,"sheet2") . think should want if understand correctly - ie not want follow a1 around rows/columns added literally top left hand corner, regardless of column/row changes.

java - Unfortunately, (app name) has stopped - Android development error -

i learning develop android applications , have come across problem in first project. following tutorial (derek banas) create app allow user type in text, hit button , app output text. have written code , have recieved no errors, whenever run app on emulator, says "unfortunately, (app name) has stopped. here log cat: 08-23 17:51:36.026: d/androidruntime(800): shutting down vm 08-23 17:51:36.063: w/dalvikvm(800): threadid=1: thread exiting uncaught exception (group=0x414c4700) 08-23 17:51:36.196: e/androidruntime(800): fatal exception: main 08-23 17:51:36.196: e/androidruntime(800): java.lang.runtimeexception: unable start activity componentinfo{com.nick.android.nick/com.nick.android.nick.mainactivity}: java.lang.runtimeexception: binary xml file line #12: must supply layout_height attribute. 08-23 17:51:36.196: e/androidruntime(800): @ android.app.activitythread.performlaunchactivity(activitythread.java:2211) 08-23 17:51:36.196: e/androidruntime(800): @ andr

ruby on rails - Active Admin Filepicker.io error -

i have followed instructions here: https://github.com/ink/filepicker-rails i have config.filepicker_rails.api_key = "myapikey" in config/application.rb , filepicker.io script being called via <%= filepicker_js_include_tag %> in application layout. i have in admin/geography.rb file: form |f| f.inputs "town" f.input :town f.input :name f.filepicker_field :filepicker_url end f.actions end the error getting on admin page is: runtimeerror in admin::geographies#new showing /users/user/.rvm/gems/ruby-2.0.0-p0@guides/bundler/gems/active_admin-72a9c30cef47/app/views/active_admin/resource/new.html.arb line #1 raised: set config.filepicker_rails.api_key extracted source (around line #1): 1: insert_tag renderer_for(:edit) has experienced or have solution? have tried moving initializers/active_admin.rb file no luck , i'm not sure else remedy. there doesn't seem info on ror filepicker.io implementation outside of github doc.

css - Place DIV Between & Above Two Lower DIVs -

i designing webpage requires @ least 3 divs , possibly 1 container div. need 1 div on left, 1 in middle, , 1 on right. seems simple enough need 2 side divs underlap middle div. +-----------------------+ +-----------------------|-----+ +---------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o | | | | | | v | | | | | | e | | | | 5

javascript - toggle() accordion script not working -

i've run roadblock , can't seem wrap head around why script not run on test page. have jquery linked, followed script. script know not js conflict. fiddle here: http://jsfiddle.net/dxway/7 var content = $('.content').hide(); $('.togglebtn').on('click', function() { $(this).next('.content').slidetoggle(); return false; }); .togglebtn { background:deepskyblue; display:block; float:left; width:100%; padding:10px; border-bottom:1px solid #ccc; border-top:1px solid #fff; color:#fff; cursor:pointer; } .content { background:skyblue; float:left; overflow:hidden; width:100%; padding:10px; } <a class="togglebtn">click me!</a> <div class="content">lorem ipsum dolor sit amet, consectetur adipisicing elit. inventore accusamus porro modi ut itaque ipsum natus explicabo vero sequi beatae libero voluptatibus sit culpa debitis tempore! sint eum ipsum

Raphael: Inherited transformations -

based on thread ( raphaeljs transformations sets ) have played around inherited transformations using sets in sets. i tried put set in set , each set apply 45° rotation. expected, both rotation sum 90° rotation. working fine. but both rotations relative centerpoint of each single object in set. how can achieve, rotations relative center point of set? possible? to clarify mean. if have 2 rectangles in set , apply rotation on set, want rectangles stay in same position , angle relative them self, because both rotate around axis between them, in middle of set. must translated additionally rotation... how can achieve this? jsfiddle: http://jsfiddle.net/bby9b/ var paper = raphael(0,0,500,500); var = paper.rect(10,10,50,10); var b = paper.rect(10,30,50,10) var c = paper.rect(10,50,50,10); var d = paper.rect(10,70,50,10); var set = paper.set() set.push(a); set.transform("r-45"); var rootset = paper.set(); rootset.push(set, b, c); rootset.transform("...r

Python 3.3.2 - Creating a List of the Length of Words -

i have string of words punctuation, let's example... string = 'did quick brown fox *really* jump on fence?' i have filtered out punctuation, now: 'did quick brown fox jump on fence' and have split list. list = string.split() now, list , need count length of each word list, length of list being longest word. setting out of list follows: lengthlist = [1_letter_words, 2_letter_words, 3_letter_words, ...] so, string , be: lengthlist = [0, 0, 4, 2, 3, 1] unfortunately, having trouble doing this. can please provide assistance? thank you. i didn't want harangue (at all, not) without giving proper answer, skip ahead if don't care coding practices. don't use variable names list , string because - in case of list - that's name of type you're making. in fact, that's how make empty instance of type you're making: something=list() # empty list! this make confusing reference list[2] or along lines. di

android - Is there any reason to continue using IntentService for handling GCM messages? -

as know, google changed gcm documentation, , claim intentservice no longer required handling arriving gcm messages. handling can done in broadcastreceiver . when trying figure out if there reason continue using intentservice , came across quote : a service (typically intentservice) wakefulbroadcastreceiver passes off work of handling gcm message, while ensuring device not go sleep in process. including intentservice optional —you choose process messages in regular broadcastreceiver instead, but realistically, apps use intentservice . why apps use intentservice ? there scenarios in handling gcm message directly in broadcastreceiver won't work? why apps use intentservice? because whatever doing in response message take more 1-2ms, means want work off main application thread. common pattern doing in response broadcast delegate work intentservice . so, if work in response gcm message involves: disk i/o further network i/o (e.g., retrieving additiona

c# - Types of polymorphism. More than one? -

i still in college , remember hearing 1 type of polymorphism when learning java; however, when in c# class, remember professor talking 4 types of polymorphism. i aware of subclassing , defining specific behavior within more specific classes, , being able call specific behaviors single method in base class because of interface signature. what other types, , of big of importance type taught above? why there not taught? yes there 4 kinds of polymorphism overloading (same function names, different parameter types. includes operator overloading , done @ compile time) parametric polymorphism (these templates in c++) compile time subtype polymorphism (if function has parameter subtype, example car->honda, f(car), function f accept f(honda) well.) runtime parameter coercion (this implicit type conversion. example, function might require double/real/float, accept int , implicitly upcast parameter) compile time reference: "on understanding types, d

java - Do we need to extend struts-default package always? -

do need extend struts-default package? seeing following exception on server startup: caused by: error building results action loginscreen in namespace /user - action - file:/c:/glassfish4/glassfish/domains/domain1/eclipseapps/struts2example/web-inf/classes/login.xml:9:30 package: <package name="login" namespace="/user" > <action name="loginscreen"> <result>pages/login.jsp</result> </action> </package> if add extends="struts-default" above package server starts without error. can please give more details on error/exception? in configuration using dispatcher result type default configure result. type defined in struts-default package package should extend. it's not obligatory extend package, have support struts2 framework need @ least root package extend struts-default .

windows phone 8 - Hide scrollbar in LongListSelector -

i'm using longlistselector , scrollbar on right adding bit of empty space messing design, want hide it. i've tried following: scrollbar sb = ((frameworkelement)visualtreehelper.getchild(filelist, 0)) .findname("verticalscrollbar") scrollbar; sb.width = 0; but that's not working wp8, can make width larger though not smaller. has scrollviewer.verticalscrollbarvisibility property changing hidden or disabled doesn't anything. /edit: this appears work: var sb = ((frameworkelement) visualtreehelper.getchild(filelist, 0)) .findname("verticalscrollbar") scrollbar; sb.margin = new thickness(-10, 0, 0, 0); but if has cleaner method still hear it. you can address retemplating whole control. add resource: <style x:key="longlistselectorwithnoscrollbarstyle" targettype="phone:longlistselector"> <setter property="background" value="transparent"/> <

javascript - Twitter Bootstrap tabbed form -

Image
i doing webpage bootstrap framework. want have single page, form pops , has 2 or 3 tabs on it. want this, the tabs "the markup", "the css", "the javascript". have them showing on top left of page it's on main navbar, can't them anywhere else. ideally, i'd them on top of form , switch between forms. another question that's elementary, buttons have them used code, <div class="note-tabs"> <ul class="nav nav-tabs"> <li class="active"><a href="#navbar-fixed-html" data-toggle="tab"><strong>the markup</strong></a></li> <li><a href="#navbar-fixed-css" data-toggle="tab"><strong>the css</strong></a></li> <li><a href="#navbar-fixed-js" data-toggle="tab"><strong>the javascript</strong></a></l

ios - Cocos2d: .plist file giving me a SIGABRT error -

Image
hello making side scrolling cocos2d app. using .plist file of data in game. when run code gives me sigabrt error. new objective c , cocos2d , not experienced .plist files. .plist file. this code pretty sure causing problem. nsstring *path = [[nsbundle mainbundle] bundlepath]; nsstring *finalpath = [path stringbyappendingpathcomponent:@"gamedata.plist"]; nsdictionary *plistdata = [nsdictionary dictionarywithcontentsoffile:finalpath]; nsmutablearray* characterarray = [nsmutablearray arraywitharray:[plistdata objectforkey:@"characters"]]; nsdictionary *thecharacterdict = [nsdictionary dictionarywithdictionary: [characterarray objectatindex:0]]; nsdictionary* characterdict = [nsdictionary dictionarywithdictionary:[thecharacterdict objectforkey:@"playerproperties"]]; character = [character createwithdictionary:characterdict]; [self addchild:character z:kcharacterlevel]; i not know if code causing problem. post more code

java - Why isn't the MAIN and LAUNCHER activity not starting first? -

i have 2 activities, 'splash'and 'startingpoint'. xml explicitly states 'splash' activity main , launcher, when running app, 'startingpoint' seems first thing running. how can fix it? <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.commer.commest" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="18" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.commer.commest.splash" android:label="@string/app_name" > <intent

import data from excel sheet using codeigniter -

i want import sing column of excel sheet database table name admin_record , excel sheet consist of 1 column , name of column bar codes , rows can many. i want save in database table name admin_record , consists of 2 fields id (which primary key) bar_code. find code totally cant understand public function read_file($table = 'admin_record', $filename = 'example.xls') { $pathtofile = 'uploads/' . $filename; $this->load->library('spreadsheet_excel_reader'); $data = new spreadsheet_excel_reader($pathtofile); $sql = "insert $table ("; for($index = 1;$index <= $data->sheets[0]['numcols']; $index++){ $sql.= strtolower($data->sheets[0]['cells'][1][$index]) . ", "; } $sql = rtrim($sql, ", ")." ) values ( "; ($i = 2; $i <= $data->sheets[0]['numrows']; $i++) { $valuessql = ''; ($j = 1; $j <= $data->shee

regex - How to show always the same url? -

i using apache. i have www.example.com/?p_action=user_profile&post_author=34 , want use www.example.com/niceurl/ i want if user enters of urls, www.example.com/niceurl/ shown in browser (of course, www.example.com/?p_action=user_profile&post_author=34 retrieved server). rewriterule not seem solution this, it? thanks well can try putting, rewriteengine on rewriterule ^([^/]*)/([^/]*)$ /?p_action=$1&post_author=$2 [l] in .htaccess file. imo rewriterule should solve problem.

android - Can not setContentView with layout resource file -

a package named "ui" created in package layout, , layout resource file "my_listview.xml" put in package "ui". setcontentview "my_listview.xml" in mainactiviy.java , failed. what's problem here? appreciated. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.my_listview); ... } edit if put "my_listview.xml" put in package "layout", setcontentview(r.layout.my_listview); works. you should place xml files in directories belong, not in custom directories. names of directories in res directory has meaning. example, resources layout-mdpi used if user has phone medium dpi screen. same thing other dirs. should read this,it helpfull: http://developer.android.com/guide/topics/resources/providing-resources.html

php - Variable from Navigationcontroller to navigation.phtml -

i new zend2. question how can pass var or array navigation.phtml, succeeded layout. want controle navigationcontroller what missing?! navigationcontroller: namespace front\controller; use zend\mvc\controller\abstractactioncontroller; use zend\view\model\viewmodel; class indexcontroller extends abstractactioncontroller { function __construct() { return $this->layout()->myvariable = 'navigation test'; } } navigation.phtml: <?php print_r($this->layout()->myvariable); ?> module.config 'controllers' => array( 'invokables' => array( 'front\controller\index' => 'front\controller\indexcontroller', 'front\controller\pages' => 'front\controller\pagescontroller', 'front\controller\navigation' => 'front\controller\navigationcontroller' ), ), 'template_map' => array( 'layout/layout' => __dir_

after installing magento cannot login admin -

after installing magento admin panel cannot log in. have installed magento on localhost. after setup when used admin page login can't able login in chrome browser right username , password i found solution : go app/code/core/mage/core/model/session/abstract/varien.php file within magento directory , comment out these 3 lines of code : comma must removed file .save , try login magento admin panel. // 'domain' => $cookie->getconfigdomain(), // 'secure' => $cookie->issecure(), // 'httponly' => $cookie->gethttponly()

fatal error - Android RunTimeError: Java.lang.RunTimeException: Unable to Instantiate activity -

i getting following error every time run android app on avd. app crashes instantly upon running it: 08-24 02:18:01.629: e/androidruntime(1860): fatal exception: main 08-24 02:18:01.629: e/androidruntime(1860): java.lang.runtimeexception: unable instantiate activity componentinfo{com.zamani.randomizedworkout/com.zamani.randomizedworkout.mainscreen}: java.lang.classnotfoundexception: didn't find class "com.zamani.randomizedworkout.mainscreen" on path: dexpathlist[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.zamani.randomizedworkout-2.apk"],nativelibrarydirectories=[/data/app-lib/com.zamani.randomizedworkout-2, /system/lib]] 08-24 02:18:01.629: e/androidruntime(1860): @ android.app.activitythread.performlaunchactivity(activitythread.java:2137) 08-24 02:18:01.629: e/androidruntime(1860): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2261) 08-24 02:18:01.629: e/androidruntime(1860):

sql server - sql is not returning correct count -

i have sql table hr_registrantcategories this: registrantid categoryid 1 47 4 276 4 275 4 278 4 274 4 277 16276 276 16276 275 16276 278 16295 276 16295 275 16295 278 16295 274 16295 277 16292 276 16292 275 16292 278 16292 274 16292 277 16293 276 16293 275 16293 278 16293 274 16293 277 16294 276 16294 275 16294 278 16294 274 16294 277 16303 276 16303 275 16303 278 16303 274 16303 277 16302 276 16302 275 16302 278 16302 274 16302 277 16303 276 16303 275 16303 278 16303 274 16303 277 16304 276 16304 275 16304 278 16304 274 16304 277 26 276 26 275 26 278 26 274 26 277 16305 276 16305 275 16305 278 16305 274 16305 277 29 276 29 275 29 278 29 274 29 277 16306 276 16306 275 16306 278 16306 274 16306 277 16306 276 16306 275 16306 278 16306 274 16306 277 16307 276 16307 275 16307 278 16307 274 16307 277 16307 276 16307 275 16307 278 1

javascript - Should learn angularjs without jQuery? -

i newbie client-side javascript. in 1 web project, found angularjs , use basic on this. should learn jquery or use angularjs other project? while learning angularjs best not include jquery. please note i'm talking learning process here, not saying shouldn't use jquery in final project. the philosophies , approaches of both libraries ui construction (declarative angularjs , imperative jquery) different need somehow unlearn many of jquery habits of angularjs. leaving out jquery during learning process "force" embrace angularjs way. when you've got full grasp of angularjs can start introducing jquery in directives only . for broader discussion of topic see "thinking in angularjs" if have jquery background? in short: start learning angularjs without including jquery.

php - Display all file with prefix id -

i have user folder /folder_name , there files name prefix example pattern id_radom.example 5__1490952185fed525d92.24525311.jpg 15__4658521860030a66d0.90328377.jpg 15__6654521861778060e1.31100475.jpg 15__6654521861778060e1.31100475.jpg i want display of these image( id=15 ) using php i trying: $path = "uploads/registered_files/".$_session['user_data']['username']; $a = glob("/".$path."/".$article->article_id."__",glob_brace); print_r($a); but got empty array() solution may this: if (false === ($handle = opendir($path))) { //catch error here } $images = array(); while (false !== ($file = readdir($handle))) { preg_match('/^15__.*/', $file)) , $images[] = $file; } closedir($handle); foreach ($images $image) { echo '<img src="',$path,directory_separator,$image,'"/>'; }

c - Classification using LibSVM -

i using libsvm carry out multi-class classifications. trained model using matlab interface of libsvm. saved model in format recognized in c. want classify using svm_predict in c. having trouble being able reproduce results saw in matlab. in fact same class output irrespective of test vector feed in (even vector of zeros) think issue way loading test vector x svm_node structure. below code snippet. let me know if correct way or if missing something. struct svm_model *libsvm_model = svm_load_model('mymodel.svm'); struct svm_node x[2001]; // 1 feature vector of size 2000x1 int index = 1; int = 0; (i = 0; < features.size(); i++) { x[i].index = index; x[i].value = features.at(i); index = index + 1; } x[i+1].index = -1; x[i+1].value = '?'; double result = svm_predict(libsvm_model, x); this seems problem: x[i+1].index = -1; x[i+1].value = '?'; libsvm requires svm_node input vector, should have positive indexes, , double values. shoul