Posts

Showing posts from February, 2010

php - Preset the values of a form with data from a database -

i have form in web (build html). let's have values form can change, store them in database. want everytime user goes page form is, data database has read , form has filled information (for example, have field e-mail, want fill e-mail have in database). i've been looking way this, have not found "like". way can doing ajax request on javascript php script, connect db , data. once it, modify whole form via javascript, i'm not sure if safe enough. any ideas of how in different way or how safely enough? thank much. i'm not entirely convinced i'm answering right question, in order fill form, you'd have this: <form> <input name="username" value="<?php echo isset($datarow->username) ? htmlentities($datarow->username) : ""; ?>"> </form> i left out things not essential bring point across, if first time working html forms, may want read on well. of course first need data data

ruby - EncryptedDataBagItem.load produces 'cannot convert nil into String' -

i'm following method described in this post creating dns record new server chef provisions it. i've created encrypted data bag item aws credentials: $ knife data bag show passwords aws --secret-file .chef/encryted_data_bag_secret aws_access_key: <my_access_key> aws_secret_key: <my_secret_key> id: aws however, when run chef client, line... aws_creds = chef::encrypteddatabagitem.load('passwords', 'aws') produces error: typeerror: can't convert nil string i've tried searching error, while can see evidence other people have encountered this, it's not clear problem or how resolved. what's going on here, , how can fix it? i hit error today too. me, node missing encrypted_data_bag_secret. according bug ( http://tickets.opscode.com/browse/chef-4441 ), error (in case) have been clearer in chef 11.4.4: no such file or directory - file not found '/etc/chef/encrypted_data_bag_secret' i hope tha

zend framework2 - ZF2 router configuration -

i'm newbie in zf2, try write application. , faced problem invokables , routing config. i have 2 modules configs: <?php return array( 'controllers' => array( 'invokables' => array( 'index' => 'vocabulary\controller\indexcontroller' ,'add' => 'vocabulary\controller\addcontroller' ,'admin' => 'vocabulary\controller\admincontroller' ) ) ,'router' => array( 'routes' => array( 'vocabulary' => array( 'type' => 'segment' ,'options' => array( 'route' => '/vocabulary[/:controller][/:action]' ,'constraints' => array( 'controller' => '[a-za-z][a-za-z0-9_-]*' ,'action' => '[a-za-z][a-za-z0-9_-]*' ) ,'defa

Not Showing A Letter When Using Java Font -

i fooling around in java,when decided make font class, , own fonts. prints right, when type "hello world" code, program shows "hello xorld!". tried switching x , w, shows "hello yorld", , on. fixes? also, when try type in hello xorld, spits out "hello yorld". public class font { private static string chars="abcdefghijklmnopqrsrtuvwxyz 0123456789.,:;'\"!?$%()-=+/ "; public static void render (string msg,screen screen,int x,int y,int colour){ msg= msg.touppercase(); (int i=0;i<msg.length();i++) { int charindex= chars.indexof(msg.charat(i)); if (charindex>=0)screen.render(x+(i*8), y, charindex+30*32, colour); } } } in different class: font.render("hello world 0157",screen,0,0,colours.get(000,-1,-1,555)); in char[] array, have this: ....abcdefghijklmnopqrsrtuvwxyz.... . ^ note r comes after s.

html - CSS DropDown Menu Bug Fix -

i have created dropdown menu css, can't solve 1 problem: last menu element's width smaller dropdown's width. here code: http://jsfiddle.net/eefdp/ i maybe use width solve problem temporarily, not logical , permanent solution, considering menu extend new elements. please help? html code: <ul> <li><a href="#">home</a></li> <li> <a href="#">tutorials</a> <ul> <li><a href="#">php</a></li> <li><a href="#">css</a></li> <li><a href="#">javascript</a></li> </ul> </li> <li> <a href="#">contact</a> <ul> <li><a href="#">by contact</a></li> <li><a href="#">by email</a></li> <

version control - Need a Plan for Git Push/Pull -

i've started work on existing project wasn't using version control system. i've used subversion extensively, management wanted use git. learning it, , learning love it. own sanity, created git repository on windows 7 machine based on files downloaded development environment (linux) had been set me. happily committing changes master, found had change development priorities. realized branching best way go accommodate that. i've adopted " a successful git branching model ", , liking far. challenges one: project has symbolic links broken in local git repository. want fix them, getting them git repository. have tar archives available of production code, don't know how accomplish sane merge of that. on windows use winmerge doesn't preserve symbolic links. once have repository set on development server, abandon commits windows machine , pull server? two: project has file path goes way file system root. i've seen articles people using git versi

ios - UItextField Phone number formatting -

i have 3 text fields called home phone,work phone , mobile phone. need validation , number formatting these fields. below shown condition. the home phone , work phone text fields should not accept more 10 digits , less 8 digits. fields should accept numbers. format of numbers should xxxx-xxxx(if 8 digits) xx-xxxx-xxxx(if 10 digits) the mobile phone number field should not accept more 10 digits. fields should accept numbers. format of numbers should xxxx-xxx-xxx i not sure how achieve this. please me. i think can achieve doing following: capture text change event in uitextfield. add dashes after 4 characters, after 7 characters , on depending on format want. use regular expression validate entire string of numbers dashes. (eg: xxxx-xxxx format use '[0-9]{4}-[0-9]{4}')

Java .nextLine() repeats line -

everything of guessing game alright, when gets part of asking user if he/she wants play again, repeats question twice. found out if change input method nextline() next(), doesn't repeat question. why that? here input , output: i'm guessing number between 1-10 guess? 5 wrong. 3 want play again? (y/n) want play again? (y/n) n here code:(it in java) last while loop block part asks user if he/she wants play again. import java.util.scanner; public class guessinggame { public static void main(string[] args) { scanner input = new scanner(system.in); boolean keepplaying = true; system.out.println("welcome guessing game!"); while (keepplaying) { boolean validinput = true; int guess, number; string answer; number = (int) (math.random() * 10) + 1; system.out.println("i'm guessing number between 1-10"); system.out.print("what guess

Rails Has Two and With Many -

i'm working on rails 4 app there model called apps. each app can have multiple certificates stored in certificates model. out of certificates each app can have development , production certificate active current app. @ single given time 2 certificates (development/production) can active app. i'm trying come activerecord structure logic i'm lost. suggestions on this? apps (has many certificates) - development_certificate - production_certificate certificates (belongs app) the solution more closely models data 2 one-to-one relationships: class app < activerecord::base belongs_to :production_certificate, class_name: "certificate" belongs_to :development_certificate, class_name: "certificate" end

sql server - Enabling filestream with WMI and C# -

i have need enable filestream on sql server through program. according documentation have found, can done through wmi following code: set fsinstance = getobject("winmgmts:\\" & machinename & "\root\microsoft\sqlserver\computermanagement10:filestreamsettings='" & instancename & "'") set method = fsinstance.methods_("enablefilestream") set inparam = method.inparameters.spawninstance_() inparam.accesslevel = targetlevel inparam.sharename = sharename set outparam = fsinstance.execmethod_("enablefilestream", inparam) converting c#, following: managementclass mc = new managementclass(new managementscope(@"\\.\root\microsoft\sqlserver\computermanagement10"), new managementpath("filestreamsettings"), new objectgetoptions(new managementnamedvaluecollection() { {"instancename", "mssqlserver"} })); management

java - logback xml configuration for web application -

i using logback slf4j logging debug/error statements. please let me know how use single logback.xml configuration file multiple environments (dev/qa/prod)? right now, editing xml file each environment specify dbname...i appreciate help. couple of options (most of them documented here ) use properties in log configuration set externally (either java properties or os environment variables) use jndi settings (creating db datasources pretty common) generate logback.xml file part of deployment process jmx configurator allows reload configuration named file package war file each environment (don't recommend included completeness)

list - Android ListActivity using SimpleAdapter - Highlight selected item -

i´m using simpleadapter in listactivity , want when user select item highlight item. tried extends simpleadapter , override getview() method: public view getview(int position, view convertview, viewgroup parent) { view view = super.getview(position, convertview, parent); if (position == mitemindex) { convertview.setselected(true); convertview.setpressed(true); convertview.setbackgroundcolor(color.parsecolor("#ff9912")); } return view; } but solution don´t work properly. set background color more 1 list row. can sameone me? that's because convertview being reused , not update selected state both cases (selected / not selected). need call setselected(false) when not item want selected , reset background color. also, call setpressed not needed. you should checkout colorstatelist allow define colors various states. use built in support single item selection.

Sql Server Replace function inside of IN operator -

i trying build dynamic sql query. i have field string of pipe delimited guids. i want execute query finds users guids in field. in example below have added couple of dummy guids examples. second query works want to. first query replace function not working. if execute replace select return have in second query expect return same results. can please me out missing here? thanks. select * cms_user convert(varchar(36),userguid) in( select '''' + replace('6415b8ce-8072-4bcd-8e48-9d7178b826b7|aedd6e3f-61c1-46cf-b2d4-750180036fff','|',''',''') + '''' ) select * cms_user convert(varchar(36),userguid) in('6415b8ce-8072-4bcd-8e48-9d7178b826b7','aedd6e3f-61c1-46cf-b2d4-750180036fff') update: here sqlfiddle queries further show doing. select shows 2 records http://sqlfiddle.com/#!3/a5e426/5 select hardcoded subquery http://sqlfiddle.com/#!3/a5e426/6 select pipe delimited guids

jquery - How to redirecting page after submit form -

i have html forms 1 visible , 1 hidden , submit background. use jquery script submit hidden form. want redirect page http://www.youtube.com/ after submitting form in background. can add code code on how redirect? jquery script <script type="text/javascript"> $(function(){ $("#blast").click(function(){ if( $("#email").val() == "" ){ alert("please enter email value"); } else { // submit form $('#email1,#email2').val($('#email').val()); $('#form2,#form3').submit(); alert('thanks'); return false; } }); $('#email').keypress(function(e){ if(e.which == 13){//enter key pressed $('#blast').click();//trigger search button click event } }); }); if need redirect user after submitting form, doesn't make sense javascript. whole point of subm

How do I get http request header fields server side in a Meteor.js app? -

how http request header fields server side in meteor.js app? for example in php 1 use 1 of following determine host or domain request on. $_server['http_host'] or $_server['server_name'] i know on client side can document.domain and pass server. but there easier way @ least host (something.domain.com) client made request on? after meteor 0.7 have call on server side this.connection.httpheaders source http://www.meteorpedia.com/read/http_headers

asp.net - mvc poco list is null: add new item -

i have following poco in mvc4 project: public class gallery : modelbase { public string name { get; set; } public string description { get; set; } public bool ispublic { get; set; } public string thumbnailpath { get; set; } [foreignkey("id")] public icollection<galleryimage> images { get; set; } } if create new gallery entity, images collection null. how can add new image (in case) uninitialized list? code adding looks this: guid ggallery = guid.parse(request.form.getvalues("galleryid")[0]); gallery gallery = db.galleries.where(g => g.id == ggallery).include(g => g.images).first(); galleryimage.id = guid.newguid(); galleryimage.createdbyuserid = websecurity.currentuserid; galleryimage.insertdate = datetime.now; galleryimage.lastmoddate = datetime.now; db.galleryimages.add(galleryimage); if (gallery.images == null) galle

sql server - ASP.NET/sql full text search -

i using below query fulltext searh sql server. declare @mytable table (id int identity(1,1), searched varchar(200)) declare @keys table (word varchar(200), wordid int identity(1,1)) insert @mytable values ('mother father daughter son') insert @mytable values ('mother daughter son') insert @mytable values ('mother son') insert @mytable values ('daughter son') insert @mytable values ('mother father son') insert @mytable values ('son daughter father') insert @mytable values ('mother bun') insert @mytable values ('other word') insert @keys values ('mother') insert @keys values ('father') insert @keys values ('son') insert @keys values ('daughter') declare @nallwords int select @nallwords = count(*) @keys select mytable.* @mytable mytable inner join (select mytable.id @mytable mytable inner join @keys keywords on ' ' + mytable.searched + &#

java - Is it acceptable to globally and finally store the check for a SecurityManager -

is acceptable globally , store check security manager? given following line of code: public static final boolean sec_on = (system.getsecuritymanager() != null); would acceptable place in library , reuse result throughout lifetime of jvm? why? or why not? [update] similar code exists in reference implementation of java ee - jsp specification. app server/servlet container uses not support dynamic configuration of securitymanager. no. security manager can installed @ time if not present initially.

c# - How to programmatically hide the keyboard -

i have textbox button inside (telerik's radtextbox action configured). when user presses action, progress bas displayed, screen goes dark, , magic happens. my problem since action doesn't result in textbox losing focus, on-screen keyboard not hidden, , keeps covering half screen. i programmatically hide on-screen keyboard, don't know how. just set focus main page: this.focus(); this focus control doesn't use keyboard , hide keyboard. unfortunately there no api keyboard hide it.

cygwin - Python 2.7.5 on Cygwin64: requests installation fails -

our project j2ee based development automatic functional , integration tests written in python. test environment linux nonetheless developers use windows 7 (64-bit). able execute functional tests on developer machines (before comitting). unfortunately pexpect-windows-portability issue leave no choice but: to serious refactoring on our test libraries able use both winpexpect (or wexpect) , pexpect depending on os settings. or use cygwin. guess what, second option seem have issue :-) using python 2.7.5 on cygwin64 installing requests package results in error : pip says can not find file after downloading , extracting library easy install doesn't throw explicit error, leaves in temporary dir after copying files under site-packages directory simple import requests in python causes interpreter exit has encountered problem? with cygwin-32 requests install smoothly. (however have other issues - see next post ;-)) thank in advance: joe, public also ran same is

vbscript - VB Scripting to excel -

i desk technical @ company , trying create vb login script gather various things user , computer , create or amend excel spread sheet on network drive. little background programming, not programmer. knowledge limited understand programming logic. far have been able frankenstein vbs script various sources online of own programming. here snag. want list of network drives of user single cell within excel. i've tried no success. closest can listing 1 (the last) network drive. other issue i've been having not list of member of groups ad. know super novice willing learn , understand. great! here code: set wshshell = wscript.createobject("wscript.shell") set objargs = wscript.arguments set fso = createobject("scripting.filesystemobject") set oshell = createobject("wscript.shell") set env = oshell.environment("process") strcomputer = env.item("computername") set objexcel = createobject("excel.application") objex

c# - Entity Framework - Updating relationship by changing foreign key -

i have 2 following models , dbcontext: public class testdbcontext : dbcontext { public idbset<person> people { get; set; } public idbset<car> cars { get; set; } } public class person { public person() { id = guid.newguid(); } public guid id { get; set; } public string name { get; set; } public virtual list<car> cars { get; set; } } public class car { public car() { id = guid.newguid(); } public guid id { get; set; } public string name { get; set; } public virtual person owner { get; set; } } i declare list of people , list of cars, setting owner of first car first person in list: list<person> people = new list<person>() { new person() {name = "bill", id = new guid("6f39cc2b-1a09-4e27-b803-1304afdb23e3")}, new person() {na

Jquery Mobile Not able to append to body -

i append dynamically generated page body althought dont see error in console , not seeing dynamic page on ui. missing? once these, have multiple pages , these pages needed generated when navigate through list items pages. <!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> <title>appstore</title> <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"/> <script src="js/chaseappstore.js"></script> <link rel="stylesheet" href="http://code.jquery.com/mo

python - Default settings for application -

i know settingslogic - gem ruby. allows elegant way define default settings or fallback-settings application described in settingslogic example . i'm reading through pyyaml didn't find yet such nice way this. how solve such problem in elegant , pythonic way? i'm not sure why expect yaml-parsing library provide multi-layered settings fallback. ruby's yaml-parsing library doesn't, why there separate wrapper gems 1 referred in first place. but if @ linked to, there isn't logic in library @ all; application logic code has use ||= set value if it's missing. can same thing in python; it's spelled different. in ruby, use dot-access if want exception on missing key, brackets if want nil , brackets plus || if want different default value, , hacky idiomatic brackets plus ||= if want set , return different default value. in python, use brackets if want exception on missing key, get if want none , get argument want different default, ,

css - How to add custom features to zurb's Foundation drop-downs? -

Image
as shown in image bellow, foundation adds grey triangle pointing down icon drop-down area. problem is: how customize it? want turn white. i've tried find using both firebug , chrome dev tools no avail. can't find codes triangle , how customize it.. the arrow created in line 576 of presentation.css, following lines: border: solid 5px; border-color: #e6e6e6 transparent transparent transparent; i've never seen technique creating triangle, it's explained quite nicely here .

twitter bootstrap - Collapse navbar on navigate (link click) in mobile mode -

i'm using bootstrap 3 angular. when click link page isn't reloaded, causing menu stay open when in mobile mode. how make menu close automatically when click menu item? i have tried adding data-toggle="collapse" data-target=".navbar-responsive-collapse" a tags, causes strange behavior in desktop mode. this updated version of previous answer angular.module('app').directive('navcollapse', function () { return { restrict: 'a', link: function (scope, element, attrs) { var visible = false; element.on('show.bs.collapse', function () { visible = true; }); element.on("hide.bs.collapse", function () { visible = false; }); element.on('click', function(event) { if (visible && 'auto' == element.css('overflow-y')) { e

php - What exactly is the flow of logic for an ajax CActiveForm? (yii framework) -

i having trouble understanding flow of logic ajax processed cactiveform. context: i using ajax login , registration. login works , redirects user homepage after successful login. register works not redirect user homepage after successful registration. sits there. sure kinda works, don't understand doing behind scenes. controller code: (the controller/model/view code same between login , register actions) public function actionlogin() { $model = new loginform; // if ajax validation request if (isset($_post['ajax']) && $_post['ajax'] === 'login-form') { echo cactiveform::validate($model); app()->end(); } // render , nonajax handling here... } public function actionregister() { $model = new registerform; // if ajax validation request if(isset($_post['ajax']) && $_post['ajax'] === 'register-form') { echo cactiveform::validate($model); app

ManagmentObject queries for windows (C#) to find usb device -

i'm trying find particular usb device (1 or more) connected computer , retrieve relevant path mounted drive. ideally, finding vid/pid of usb device, i'm not sure how yet. following works, there must way data in single query. what i'm doing here looking or physical drive has model matching hs sd card bridge usb device , finding physical drive # associated , using find mounted partition.. foreach (managementobject disk in disks.get()) { //look drives match our string match m = regex.match(disk["model"].tostring(), "hs sd card bridge usb device"); if (m.success) { m = regex.match(disk["deviceid"].tostring(), @"physicaldrive(\d+)"); if (m.success) { int drivenumber = int32.parse(m.groups[1].tostring()); managementobjectsearcher mapping = new managementobjectsearcher("select * win32_logicaldisktopartition&quo

classification - Feature Extraction for Face Dectection -

i'm required design (extract) 8 features collection of face images (see url below). http://faculty.ucmerced.edu/mhyang/face-detection-survey_files/face-sample.gif these images results of moving window (of fixed size) on number of original images. train naive bayes classifier using training set contains values of extracted features , class label. so features should extract images? can give me examples? a simple approach use pixel statistics, namely, mean , standard deviation (sd), of raw pixel values (assuming these greyscale values) of given region of face image (e.g. rectangular region containing top or bottom half of face). if extract mean , sd of 4 different regions in each image, e.g., 2 rectangular regions , 2 circular regions, gives 8 numeric "high level" features. the mean , sd represent pixel contrast in region, , "high level" features because cover group/area of pixels (whereas low level features use some/all of raw pixel values d

Python unicode.splitlines() triggers at non-EOL character -

triyng make in python 2.7: >>> s = u"some\u2028text" >>> s u'some\u2028text' >>> l = s.splitlines(true) >>> l [u'some\u2028', u'text'] \u2028 left-to-right embedding character, not \r or \n , line should not splitted. there bug or misunderstanding? \u2028 line separator, left-to-right embedding \u202a : >>> import unicodedata >>> unicodedata.name(u'\u2028') 'line separator' >>> unicodedata.name(u'\u202a') 'left-to-right embedding' the list of codepoints considered linebreaks easy (not easy find though) see in python source (python 2.7, comments me): /* returns 1 unicode characters having line break * property 'bk', 'cr', 'lf' or 'nl' or having bidirectional * type 'b', 0 otherwise. */ int _pyunicode_islinebreak(register const py_unicode ch) { switch (ch) { // basic latin case

html - Float CSS Badge next to each other I guess I want to float -

i know how float badges next each other in footer menu. have 4 badges far six. badges ssl, avg, bbb, etc... very new website building stuff. use joomla 3.1 , use paid date template. can see codes , add badges pop on top of each other. had 1 person me did in tables , told me work not right way it. please remember when helping me child learning color first time when comes :) any 1 able give. if @ bottom of page( http://www.jcluforever.com/j-adore-god-christian-t-shirt-p/ts-jdrgod-prp.htm )that badges have payment, ssl, , front; how want line mine in footer , have 5 adding idea of have https://www.paypal.com/webapps/mpp/paypal-popup','wipaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;"> next 1 be <div id="avgthreatlabs_safetybadge_small"><noscript><a href="http://www.avgthreatlabs.com?utm_source=h&utm_medium=na&utm

xml - flash as3 and adobe air -- save drawing file with the ability to undo/redo afterwards -

i'm making adobe air drawing app using flash cs6. have save option lets undo/redo drawing line strokes after have saved , exited program , opened time. i have researched bitmapdata, bitmap, sprite, file, , filestream, nothing came me way save ability undo/redo after. by way, have made functions saving, opening, , reading file. have no idea on put in file being saved. make class each line hold graphics object in it. on every stroke create instance of class , add array. on save (let's imagine save xml file) can make node < canvas > store sub-nodes every line info. on load read xml file , recreate array objects. order of xml node depth/z-index/layer order , history undo/redo. if wish take further, let's undo color change of stroke, need make actionhistory class point action , object. hope helps!

c# - Best way to write code in a string -

i'm trying make 'code database' , multiple line code breaks string. need code type string span multiple lines. my final goal able click button, , textbox loads 40+ lines of code. if want hard code multi-line string, add @ symbol before. should allow span multiple lines. string example = @"this multiline string.";

javascript - whats the best idea to play several music in same html5 audio player? -

i want make player winamp html5 audio player. when click javascript button('play' button used onclick event call functions change audio source , play music) source doesn't load in time. code is: <script type="text/javascript"> function play(src){ document.getelementbyid('new').currentsrc=src+".ogg"; document.getelementbyid('new').play(); } </script> <audio id="new"> <source src="m.ogg" type="audio/ogg" /> browser not support html5 audio. please upgrade browser. </audio> <button onclick="play('source');">play next song</button> and problem there initial src need keep there(like m.ogg).otherwise new source doesn't load. if change innerhtml of 'new' audio player problem doesn't happen little slow load. so whats best practice ? changing current source or changing innerhtm

scope - ExtJS button handler not working -

my extjs button's handler not invoked after clicking. code looks this. ext.define('eds.view.selector.container', { extend: 'ext.form.panel', alias : 'widget.selectorcontainer', title: 'selector_v2', renderto: 'input-div', layout: 'fit', height: '100%', items: [ { xtype: 'tabpanel', defaults: { bodypadding: 10 }, } ], buttons: [ { text: 'reset', handler: function(){ console.log("reset"); this.up('form').getform().reset(); } }, { text: 'add constrain', handler: this.addconstrain, } ], /* * logic button "add constrain" * * adds entry constrain list describing person, cost center or application

Show div on li hover jQuery html -

so it's possible i've been looking @ long i've debugged code , searched everywhere know answer. maybe isn't possible, i'm not sure here's i'm trying do. have unordered list displayed horizontally acting top level navigation. when hover on 1 of items want show div full width of unordered list above it. here's caveat: i'm using wordpresss custom post type this. unordered list title of post , want show content in div revealed on hover. have working content loading that's not issue, can't seem find right jquery / css combination make div reveals match width of whole list. might have use ajax? not sure, i'm unfamiliar it. here's code: html <div class="menu-header-container"> <ul> <?php $args = array( 'post_type' => 'menu', 'post_status' => 'publish', 'posts_per_page' => 10, 'offset' => 0, 'order' => 'asc' ); $the_query = new

ember.js can't get pagination from metadata -

i example this ,but still can't pagination this store.js.coffee eme.serializer = ds.restserializer.create() eme.serializer.configure meta: 'meta' pagination: 'pagination' eme.customadapter = ds.restadapter.extend serializer: eme.serializer namespace: "api/v1" eme.store = ds.store.extend revision: 13 adapter: 'eme.customadapter' this controller eme.pluginscontroller = em.arraycontroller.extend content: [] pagination: (-> if this.get('model.isloaded') console.log @get('model.type') console.log @get('store').typemapfor(modeltype).metadata modeltype = @get('model.type') @get('store').typemapfor(modeltype).metadata.pagination ).property('model.isloaded') this response { "meta":{ "pagination":{ "total_count":16, "total_pages":2, "current_page":1 } }, "p

math - How would one round any integer to the next highest hundred in Java? -

to illustrate, i'd find out best way round following integers: (integer) -> (rounded value) 9 -> 100 200 -> 200 201 -> 300 1367 -> 1400 ...so on , forth... suggestions on best way accomplish using java? determine modulus 100 int k = 1234; int mod = k % 100; //mod = 34 int difference = 100 - mod; //difference = 66 k += difference; straightforward.

c# - How to Change Lock Screen Image from Windows Phone 8 Application -

in referencing http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206968(v=vs.105).aspx , trying change lock screen background application. 1 of first steps states must modify wmappmanifest file following code <extensions> <extension extensionname="lockscreen_background" consumerid="{111dff24-aa15-4a96-8006-2bff8122084f}" taskid="_default" /> </extensions> i confused consumerid , taskid criteria. i'm assuming both of these exist within application somewhere, or defaults. go access these , set them accordingly? you should use these values as-is. not unique per app.

iphone - Simulator wont start on home TableView -

i've created table view embeded in navigation controller such , connects view controller. i've connection table navigation controller modal segue , segue table bar view controller push segue yet still getting error: unsupported configuration scene unreachable due lack of entry points , not have identifier runtime access via -instantiateviewcontrollerwithidentifier: this worked last week , not. ive tried adding storyboard ids thats not working. appreciate help. did check start point in storyboard? in other words, on left side of starting navigation controller, have arrow pointing it? if not, drag until make point navigation controller. also, if you're doing dynamically, have provided uiviewcontroller/uitableviewcontroller/uinavigationcontroller storyboard ids? please, double check clicking on view controller in storyboard, in inspector (right side of xcode window), go third tab , make sure have set id , make sure consistent code.

html - Javascript textContent is not working in IE8 or IE7 -

i need add 2 cell content of table , display it. below javascript command works fine in chrome or ie10. but not working in ie8 or 7 . parsefloat(document.getelementbyid("total").textcontent).tofixed(2); it results, nan could please tell me equivalent command in ie7 or ie8 read cell content of table , convert float add.. textcontent not supported ie7/8. latter has different property called innertext returns text contents of dom node. here how use both: var text = e.item.textcontent || e.item.innertext; alert(text); note: e html element

c - change a pointer of address of another application -

i need edit title, can't find better title. assume have simple program called source.exe : #include <stdio.h> int main() { int = 5; printf("%p", &a); return 0; } i want write application, change.exe , changes a in above. i tried this: int main() { int * p = (int*) xxx; // xxx have printed above *p = 1; printf("%d", *p); return 0; } it doesn't work. assuming have administrator rights, there way i've tried above? thanks. in first place, when run second program, a in first long gone (or loaded in different position). in second place, many os's protect programs loading them in separate spaces. what seem looking inter-process communication (ipc) mechanisms, shared memory or memory-mapped files.

javascript - Open HTML5 date picker on icon click -

Image
i have html5 date picker. opened when click on date picker text box. have change event icon, i'm not sure how achieve this. have open date picker when click on calendar icon. here html code datepicker: <img src="date.png" alt="date picker" id="datepickericon" /> <input name="calendarselect{contactid}" class="timeselect" type="date" id="calendar"> <script> document.getelementbyid("datepickericon").onclick = function(e){ console.log('inside click'); document.getelementbyid("calendar").style.visibility="visible"; // document.getelementbyid("calendar").focus(); // write code toggle } by clicking on icon have open calendar view following image the html5 <input> type='date' work few browsers . also, programmer have no control on appearance or other aspect (such showing , hiding it) ( quick faqs on inpu

mysql - Use sequential CASEs as parameters for larger CASE -

select case when case when `aa`>6 `a` else null end, case when `bb`>6 `b` else null end, case when `cc`>6 `c` else null end `name` end table; the goal of query show columns through c , name. if a-c null not show name. i'm new cases , 'advanced' queries in general, if have set fool, feel free let me know. thanks reading. note: doesn't compile the logic i'm trying so: if( if(aa>6) 1 else 0 or if(bb>6) 1 else 0 or if(cc>6) 1 else 0 etc,etc ) 1 else 0 table: name b c aa bb cc -------------------------------------------------------- name1 data1 null data3 3 n 15 name2 null data2 data4 n 2 8 name3 null data2 data4 n 2 2 output wanted if it's showing values gt 6: name b c ------------------------- name1 d

Header function php -

warning: cannot modify header information - headers sent (output started @ /srv/disk2/1201823/www/-----------.org/florida/bookingv1.php:1) in /srv/disk2/1201823/www/-----------.org/florida/bookingv1.php this error i'm getting. how can fix it? here's code. <?php if ((isset($_post["mm_insert"])) && ($_post["mm_insert"] == "form2")) { $x = $_post['noofpass'] * 500; $insertsql = sprintf("insert booking2 (lastname, firstname, email, address, contactno, bustype, `from`, `to`, noofpass, datemonth, `day`, `time`,amount) values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s,$x)", getsqlvaluestring($_post['lastname'], "text"), getsqlvaluestring($_post['firstname'], "text"), getsqlvaluestring($_post['email'], "text"), getsqlvaluestring($_post['address'], "text"), getsqlval