Posts

Showing posts from July, 2015

javascript - jquery display a list of items in <ul> -

hi want display list of item inside sample html code <h3 id="game-filter" class="gamesection"> <span>game</span></h3> <div id="game-filter-div" style="padding: 0;"> <ul id="gamelist"> </ul> </div> code var games = new array(); games[0] = "world of warcraft"; games[1] = "lord of rings online"; games[2] = "aion"; games[3] = "eve online"; games[4] = "final fantasy xi"; games[5] = "city of heros"; games[6] = "champions online"; games[7] = "dark age of camelot"; games[8] = "warhammer online"; games[9] = "age of conan"; function pageloaded(){ var list = ""; for(i=0; i<games.length; i++){ list ="<li>"+games[i]+"</li>";

Confused between Google's Universal Analytics and Async Analytics. Are we supposed to use both? -

after setting google analytics first time went admin > tracking code: apparently universal analytics given me. <script> (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('send', 'pageview'); </script> i can't find asynchronous tracking code (which this): <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setaccount', 'ua-xxxxx-x']); _gaq.push(['_trackpageview']); (function() { var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 

Access 2010 Data Macros Causing Form Refresh For No Reason -

i'd report bug microsoft, wondering if else has encountered this. ++++ here's interesting , obscure issue access 2010 data macros. the issue firing of before update data macro on table causing unwanted , unnecessary form refresh. refresh clearing selections several multi-select listboxes on th form. want selections stay. form worked wanted prior adding data macro (no clearing of mslb selections). to reproduce issue. this happening in split / front end - end scenario. front , both being access 2010 files. in end accdb... create table "items" id , description columns , date_updated column. put data macro on before update on table sets "date_updated" field now(). in front end accdb... items table linked... now create blank form unbound table. create unbound multi select listbox on form , populate via other table or value list (doesn't matter rowsource is) , can bound or unbound - doesn't matter. now notice if run form, select

jsf - Composite component javax.faces.FacesException: Cannot find component "inputID" in view -

i have composite component works pretty when used once in page doesn't work if use more once. let's component called my:field: <composite:implementation> <h:form id="myform" prependid="false"> <p:message for="inputid" display="text"/> <p:inputtext binding="#{mybean.valuebind}" id="inputid" value="#{mybean.value}" required="true" /> <p:commandbutton process="@form" update="@form" action="#mybean.action} value="do something" ajax="true"/> </h:form> </composite:implementation> and use this: <my:field id="field1"/> that works fine, if add below it: <my:field id="field2"/> i following exception javax.faces.facesexception: cannot find component "inputid" in view.

assembly - 8086 TASM: Illegal Indexing Mode -

this question has answer here: illegal use of register in indirect addressing 1 answer i writing 8086 assembly program needs compile through tasm v3.1. running error can not seem fix. my data segment has following set purposes of keyboard input: parao label byte maxo db 5 acto db ? datao db 5 dup('$') what trying first character entered, first byte of datao: lea dx, datao mov bl, [dx] however, when attempt compile, error: **error** h5.asm(152) illegal indexing mode line 152 "mov bl, [dx]" any appreciated. if matters, running tasm through dosbox (my laptop running 64-bit win7) google hasn't come helpful answers. can post entirety of code if necessary. pretty sure reason can't use dx register pointer. try instead using [si], [di] or [bx]: lea bx, data0 mov al, [bx]

Validation rule - access other field CakePHP -

i try write custom validation rule , need other fields of model data gonna save make validation happen. can't find way pass data custom validation rule. array validate: [user] [name] => 'bob' [message] => 'this message' validate: public $validate = array( 'message' => array( 'rule' => 'customvalidatefunction' ) ); custom validate function: public function customvalidatefunction($messagearray){ $valueofmessage = $messagearray['message']; $valueofname = ? return true; } can point me in right direction?

html - Responsive Images using CSS background image -

i trying figure out best way approach creating responsive image fit whole background of div container. there 2 text boxes have rbga value need inline part of image. i wondering if better z index , put image in html or keep image in css background image? right now, rest of images using javascript, jquery , php resize images located in html. using media queries adjust page. trying not 3 images; maybe best option? here have far. have removed code not add confusion. attached jpg of trying accomplish. can paragraph divs line up; not responsively match image. <section id="content" role="main" class="cf"> <div class="mission"> <h1>we create</h1> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. donec libero odio, gravida sedconsequat a, faucibus dignissim</p> </div> </section> css .mission { background-image:url(../images/gallery_banner.jpg);

Facebook Graph API not returing all comments of posts -

hi see facebook graph api not returing comments of posts page.it shows posts of page not showing comments each post.it showing last 2 comments only!!. other pages shows comments.so don't why problem pages? facebook bug? or please suggest if wrong.i used access token of app read_stream premission.i don't want use other permissions coz it's security risk. please reply thanks its because commentor privacy settings. if user turn off, can't request comments via api. when testing on facebook graph api: postid/?fields=comments.summary(true) you see debug info: total_count represents approximate number of nodes on comments edge. actual number of results returned might different depending on privacy settings. you can refer related question: facebook graph api returns not comments

Return unique tuples from a list of tuples in Haskell -

i have list of tuples of form [(a,b),(b,a),(d,c),(e,f),(c,d),(f,e)] . how return list [(a,b),(c,d),(e,f)] ? solutions i've found remove repeated tuples, , solutions can think of naive o(n^2) solutions. there way efficiently? if type of components of pairs in class ord , can in o(n log n) time: import data.list (sort, group) sortpair :: ord => (a, a) -> (a, a) sortpair (x, y) | x <= y = (x, y) | otherwise = (y, x) uniques :: ord => [(a, a)] -> [(a, a)] uniques = map head . group . sort . map sortpair so, if define data t = | b | c | d | e | f deriving (eq, ord, show) we have, example: > uniques [(a,b),(b,a),(d,c),(e,f),(c,d),(f,e)] [(a,b),(c,d),(e,f)]

On-call night scheduling algorithm -

i work in residence hall @ college ra, , each night need 2 ras on call (able respond incidents , emergencies). each month, ras submit nights cannot on call (due conflict of sort). there both male , female ras. trying come effective algorithm find best arrangement of on-call nights particular month satisfies following requirements: no ra scheduled night or has listed unavailable. no ra on-call more specified number of nights per month. no ra on-call twice within given three-night span. each night has 2 ras on call. each night has, if possible, 1 male , 1 female ra on call. doing research, i've found resource-constrained scheduling problem, , considered np-complete. therefore, don't need find optimal solution, solution works. so far, i've considered following approaches: a simple 2d array of ras x nights each cell holds boolean value answering whether or not ra on call night. hold ras in 2 priority queues (one male , 1 female) sorted how many nights they

Nested Loop in table PHP -

hello new php , trying make table using 2 foreach , not getting output want. <html> <head> <title>didier test</title> </head> <body> <h1>yesso!</h1> </body> <table border="1"> <tr> <th>books</th> <th>price</th> </tr> <tr> <?php foreach($name $item): ?> <td><?=$item?></td> <?php foreach($price $item2): ?> <td><?=$item2?></td> </tr> <?php endforeach; ?> <?php endforeach; ?> </table> </body> </html> i know having issue inner foreach, don't know how correct it. please let me know thanks well 1 thing closing body tag on line 7, before output table. <body> <h1>yesso!</h1> </body> i don't know why doi

How do queues work in python? -

this question has answer here: how implement priority queues in python? 2 answers i trying learn python stuff, , wondering if can me examples of using priority queue. know in java how work, cant seem see clear examples of how work in python. getting size of queue saw .qsize() here: http://docs.python.org/2/library/queue.html doesn't show examples of getting min, max, organizing, popping, adding queue, sorting them, iterating through them. if can give me example of these or point me in right direction of learn i'd appreciate it. the queues in queue module geared toward implementation of producer/consumer pattern of multithreading. if you're interested in general-purpose priority queue data structure, use heapq module .

shareactionprovider - Android - share button not responding -

i have intent button share = (button)findviewbyid(r.id.share); share.setonclicklistener(new button.onclicklistener() { public void onclick(view v) { //createshareintent( ); } }); and these 2 methods in class: @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.layout.menu, menu); menuitem item = menu.finditem(r.id.menu_item_share); myshareactionprovider = (shareactionprovider)item.getactionprovider(); myshareactionprovider.setsharehistoryfilename( shareactionprovider.default_share_history_file_name); myshareactionprovider.setshareintent(createshareintent()); return true; } private intent createshareintent() { intent shareintent = new intent(intent.action_send); shareintent.settype("text/plain"); shareintent.putextra(intent.extra_text, "testing"); return shareintent; } public void doshare(

java - Problems with toString(), how to use without calling the object -

sorry if question doesn't make sense. also, i'm limiting code here, , try same assignment, , plagarism checkers annoying :/ so, assignment in java, have define method in iterates until simple game one, printing out tostring() representation between every move. however, have been unable work, there no object created of class... i've tried call tostring() method without object before it, doesn't print. , i've tried this.tostring() well. pretty code below basic mock of method/class (not do) public randclass { randclass() { box box = new box(); square square = new square(); duck duck = new duck(); } public void dosomething() { tosring(); // tried this.tostring(); { box.postion ++; square.position = 100 - box.position; this.tostring(); } while(duck.quack() != true);| } public string tostring() { return box.tostring() + " " + square.tostring() + ";"; } } i realise call box.tostring() etc. in place of using tostring() method call, howeve

Emacs: how to rename a directory in dired-mode? -

in emacs, how 1 rename directory in dired-mode? in dired, if select file , type 'r', you'll prompt under modeline guide through renaming file. works files in general, including directories.

asp.net - Deploy website with internal asmx web service -

i have asp.net web site have created client. run hosted on laptops via iis own intranets @ various locations. in order speed data intensive processes, added web service web site project in vs2010. simple webs service within same namespace website itself. every runs fine in local testing environment not when deploy users machine. built deployment package, of files , folders placed correctly, when website attempts access web service, i'm getting 500 error: web service not found. do have start or install via iis manager or amiss in webconfig?

asp.net mvc 3 - AuthorizeAttribute not working if URL has query string? -

in asp.net mvc3 web application, entire controller has [authorize] attribute attached it. if user not logged in or session expired, redirected login page. working...sometimes. urls in "works" list below correctly redirect login page; urls in "does not work" list instead show iis 401 error screen - not redirect login page. works http://x.y.z/mycontroller/myaction http://x.y.z/mycontroller/myaction/123 http://x.y.z/mycontroller/myaction/123?x=y does not work http://x.y.z/mycontroller/myaction/123?returnurl= http://x.y.z/mycontroller/myaction/123?returnurl=xyz the model myaction action has public string returnurl { get; set; } in base class. has other properties, adding query string not affect login redirection. seems returnurl parameter. i'm not sure else into. ideas why returnurl parameters causing trouble? routes routes.maproute("default-title-id", "{controller}/{action}/{title}_{id}", namespaces); routes.maprou

actionscript 3 - Auto goto next scene without button click as3 -

is possible go next scene in flash cs5 using acs3 after activity done in 1 scene? if possible, how can accomplished? thanks. add ' stop ' prevent errors code next scene. stop(); gotoandstop(1, "nameofyourscene"); if you're in movieclip, change gotoandstop movieclip(root).gotoandstop , add this.parent.removechild(this);

android - Can I hide an obsolete widget class from the list of available widgets? -

the current version of app has app widget, , in next version i'm replacing different widgets. none of them have same name or class old widget. don't want old widget available more. the problem can't remove old widget manifest, because upgrading users have widgets deleted home screen. so i'm looking solution allow me keep supporting old widget without showing in widgets menu. any ideas?

javascript - Angularjs avoid scientific notation for number filter -

i need print small numbers app. prefer if displayed in decimal format. there way angularjs number filter or have write own or modify existing 1 somehow? http://jsfiddle.net/adukg/2386/ javascript var myapp = angular.module('myapp',[]); function myctrl($scope) { $scope.mynum1 = 0.000001; $scope.mynum2 = 0.0000001; } html <div ng-controller="myctrl"> small number: {{mynum1 | number:8}}<br/> small number: {{mynum2 | number:8}} </div> inconsistent output small number: 0.00000100 small number: 1e-7 i haven't tested , i'm not sure how working on jsfiddle, seems working time being. javascript var app = angular.module('myapp', []); app.filter('decimalformat', function () { return function (text) { return parsefloat(text).tofixed(20).replace(/0+$/,''); }; }); html <div ng-controller="myctrl"> small number: {{mynum1 | number:8 | decimalformat}}<br/&g

php - How do I namespace a model in Laravel so as not to clash with an existing class? -

in laravel 4 want use model represents event coming database. thus, in app/models have event model extends eloquent. however, laravel 4 has event class used manage events within application lifecycle. what want know is, how can namespace event model , access in way not clash existing event class. you need apply namespace would. so, example. <?php namespace models; use eloquent; class event extends eloquent { } you should correctly setup composer.json loads models. use classmap or psr-0 this, depending on whether or not you're following psr-0 directory structure. i'm pretty sure models directory mapped. edit mentioned in comments must run composer dump-autoload .

javadb - java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/Employees1 -

Image
i researched on problem did not find solution. following code: package database_console; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; /** * * @author superpc */ public class dbconnect { /** * @param args command line arguments */ public static void main(string[] args) { // todo code application logic here try{ connection con=drivermanager.getconnection("jdbc:derby://localhost:1527/employees1","admin1","admin"); } catch(sqlexception err){ system.out.println(err); } } } when run code following error: java.sql.sqlexception: no suitable driver found jdbc:derby://localhost:1527/employees1 please guide me why error coming , how can fix this. waiting replies. thanks check for: derbyclient.jar on class path. loading driver class by class.forname("org.apache.derby.jdbc.clientdriver");

gps - How to store a value from a textbox android? -

i developing gps program in getting gps values every 5 minutes, , working great, have store values get. has been refreshed every 5 minutes , have 1 text view deletes old values when new 1 refreshed. this code. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent intent = new intent("android.location.gps_enabled_change"); intent.putextra("enabled", true); this.sendbroadcast(intent); string provider = settings.secure.getstring(getcontentresolver(), settings.secure.location_providers_allowed); if(!provider.contains("gps")){ //if gps disabled final intent poke = new intent(); poke.setclassname("com.android.settings", "com.android.settings.widget.settingsappwidgetprovider"); poke.addcategory(intent.category_alternative); poke.setdata(uri.parse(&

How can I add window Service in C#/ install it and Run exe(My Job.exe) through this Window Service? -

actually want run exe file(my job.exe) through window service in c# window service should started automatically when start computer? i have added window service (myservice) manually. have setup project of application added service can installed when install application. have serviceinstaller1 property starttype=automatic;servicename=myservice. i have serviceprocessinstaller1 property account=localsystem; when run applicationo gets installed myservice don't installed , not see in service of computer management. could body please me spend 2 days on not finding proper guidline. in advance. how application being installed? did create installer (.msi file) it? sounds you're trying implement own installer instead of using existing tool this. i recommend advanced installer . powerful installer generator , has features need in free version, , more importantly, it's easy use. tool lets create install wizard ability patch , uninstall software (including se

google api - How to get the OAuth token from within android app? -

i have register app , prepared link generate oauth 2.0 users of apps. which way works android? listening to: localhost:portnumber or returning token in web page's title? and how create button request authentication user. if looking on how obtain access token access google api's user data protected oauth2 authorization, want read how use googleauthutil class request 'oauth2:' tokens. 2 sources are: https://developer.android.com/google/play-services/auth.html and http://android-developers.blogspot.com/2012/09/google-play-services-and-oauth-identity.html if looking token authenticate app + signed-in google user home server, should googleauthutil, request 'audience:' token: http://android-developers.blogspot.com/2013/01/verifying-back-end-calls-from-android.html

php - Refresh javascript calculations without reloading page -

i have submit button uses javascript xmlhttp request call php page that's sole function write kml file google earth window on main page. php page not viewable within web browser html. the formulas in php file work intended. problem i'm having after manually press submit first time script continue repeat every 5 seconds until manually reload page (or press button stop script). because plan on having multiple users @ same time viewing page each user assigned random 5 digit number hold session information , create kml files within newly created session folder until reload page (which create new session number user). because each user designated unique session id page cannot reload php calculations repeat. because of have return false line @ end of javascript function. i able use javascript call setinterval repeat function without reloading page. if page reload created kml file not viewable within new session. let me know if has suggestions. below applicable code. div i

sql server - How to call an extended procedure from a function -

hi im having trouble trying following function work. create function test ( @nt_group varchar(128) ) returns @nt_usr table ( [name] [nchar](128) null , [type] [char](8) null , [privilege] [char](9) null , [mapped login name] [nchar](128) null , [permission path] [nchar](128) null ) begin insert @nt_usr exec master.dbo.xp_logininfo 'domain\user', @nt_group return end as far know should allowed call extended stored procedure, im getting following error mes 443, level 16, state 14 could xp_logininfo might return different result sets depending on parameters? when use openquery can overcome setting this: set fmtonly off. know if there's similar workaround problem? you can't because xp returns data. though loading table. basically, xps in udfs non-starter... i'd use stored procedure from create function calling extended stored procedures functions the extended stored procedure, when ca

sql - Need help to perform an ETL task with SSIS -

i want connect server using ip address. then, want execute .sql file kept on servers drive. want store results of sql in text file on server itself. should execute sql task or run extraction database or else ? not sure how go it. need tips on how proceed. the database used sql server 2008. on ssis, can execute sql , export text file(csv). please refer article. http://dwbi1.wordpress.com/2011/06/05/ssis-export-query-result-to-a-file/

c - Serial port, WriteFile affects ReadFile -

i'm having problem serial port code. i do: opencomm(); send(); closecomm(); and clearcommerror() (inside recv()) returns in comstat.cbinque same amount sent. so, if sizeof (sendbuff) 100, 100 in comstat.cbinque . after reading 1 byte readfile , comstat.cbinque decrements (after subsequent clearcommerror() , of course). the values read not ones written. there no device connected port. the strangest thing this code used work , not anymore. word sendbuff[128]; static handle hcomm; static void opencomm (void) { static commtimeouts timeouts = {0,0,0,0,0}; static dcb dcb = { sizeof (dcb), // dcblength 115200, // * baudrate 1, // fbinary 0, // * fparity 0, // foutxctsflow 0, // foutxdsrflow 0, // fdtrcontrol 0, // fdsrsensitivity 1, // ftxcontinueonxoff 0, // foutx 0, // finx

algorithm - Form a Matrix From a Large Text File Quickly -

Image
hi struggling reading data file enough. ( left 4hrs, crashed) must simpler way. the text file looks similar this: from 1 5 3 2 2 1 4 3 from want form matrix there 1 in according [m,n] the current code is: function [z] = reed (a) [m,n]=size(a); i=1; while (i <= n) z(a(1,i),a(2,i))=1; i=i+1; end which output following matrix, z: z = 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 my actual file has 280,000,000 links , from, code slow size file. know faster in matlab? thanks you can along lines of following: >> = zeros(4,5); >> b = importdata('testcase.txt'); >> a(sub2ind(size(a),b.data(:,1),b.data(:,2))) = 1; my test case, 'testcase.txt' contains sample data: from 1 5 3 2 2 1 4 3 the result be: >> = 0 0 0 0 1 1 0 0 0 0 0 1

R function for plotting x number of variables -

i attempting write function inserted larger script. aim of function accept number of input variables , plot them accordingly: plot_funct <- function(figfolder,var1,var2,var3,...){ nargin <- length(as.list(match.call())) -1 } this i'm starting from, here have figfolder path of figures should saved (as .pdf), define 'nargin' specifies number of input arguments, , planning on looping through each of arguments (var1,var2, etc) , plot accordingly. main concern have how set function allow number of inouts? what easier provide list of these variables: plot_funct = function(figfolder, variable_list, ...) { for(variable in variable_list) { # make plot here } }) or bit more r like: plot_variable = function(variable, ...) { # make plot here }) plot_funct = function(figfolder, variable_list, ...) { lapply(variable_list, plot_variable, ...) }) you stick separate variables, , use ... : plot_function = function(..., figfolder) {

zend framework - Saving Model to multiple tables -

maybe on of can little problem im dealing right now. i have simple form with: loginname, loginpassword, name, firstname, age. want save these information in 2 different tables. users , userinfo. i have model "user" holds login information. want save additional data in other database-table. the user information linked normal user. my thinking was, store information in 1 big "user model" , upon $model->save() storing data in relating tables. especially when using model in different modules helpful magic in model , not controller. thanks in advance! i think want todo create model mapper handling users data reference both table models. there example here: multiple tables single model using zend_model_mappers , zend_db_table_abstract

c++ - VC 2005 error "Il mismatch between 'P1' version '20060201' and 'P2' version '20050411'" -

this question has answer here: fatal error c1900: il mismatch between 'p1' version '20060201' , 'p2' version '20050411' 3 answers i got 1 error can't find problem, can me or explain whats wrong? still tried comment out problem or search can't find clues goes error: 1>compiling... 1>option.cpp 1>linking... 1>fatal error c1900: il mismatch between 'p1' version '20060201' , 'p2' version '20050411' 1>link : fatal error lnk1257: code generation failed 1>build log saved @ "file://c:\users\modestas\desktop\ybtx\code\game\gas\gamegas\release\buildlog.htm" 1>gamegas - 1 error(s), 0 warning(s) ========== build: 0 succeeded, 1 failed, 12 up-to-date, 0 skipped ========== there no code because can't understand occur happened. it means, defined initvariantcontai

C# http request cookies or redirect error -

i trying use c# code log site. has been working can't work , can't figured out did website changed cookie setting or redirect method wrong: here code. source of this.sitepage "www.pof.com" , this.loginurl "processlogin.aspx" private void loginaction() { this.m_username = this.users[rotationcount]; this.m_password = this.passwords[rotationcount]; this.getcookies(); connectionsuccessful = this.login(); } private boolean login() { boolean connected = false; string postdata = string.format("username={0}&password={1}", m_username, m_password); htmlagilitypack.htmldocument htmldoc = this.getpage(this.sitepage + "/" + this.loginurl, postdata); htmlnodecollection linknodes = htmldoc.documentnode.selectnodes("//a[@href]"); foreach (htmlnode linknode in linknodes) { htmlattribute link = linkno

python - how to display text only using find_all in beautiful soup? -

there succinct solution displaying text div using beautiful soup , find here https://stackoverflow.com/a/8994150/1063287 : result = soup.find('div', {'class' :'flagpagetitle'}).text i wanting apply same logic in scenario where: content = original_content("div","class1 class2") if modify be: content = original_content("div","class1 class2").text i getting error: attributeerror: 'resultset' object has no attribute 'text' can please tell me how can use same logic shown in scenario using find_all above? (note using shortcut of find_all not type it, see here ) thank you. you using implied .find_all() method when call element directly, returns result set (a list-like object). using limit not change returned, how many returned. if want first element of set, use slicing: original_content("div","class1 class2", limit=1)[0].text or explicit , use .fin

php - Symfony2 moving to demo bundle over to production -

i going thorough quick start symfony 2 , i'm getting quite confused. have following directory structure after unpacking symfony2 (as in documentation): /var/www/ <- web root directory symfony/ <- unpacked archive app/ cache/ config/ logs/ resources/ bin/ src/ acme/ demobundle/ controller/ resources/ ... vendor/ symfony/ doctrine/ ... web/ app.php ... i've got demo working @ <host>/symfony2/web/app_dev.php/demo/welcome/james . far good. i know can't use apache's mod_rewrite app_dev.php wondering if give me step step to: moving demobundle on using app.php (because <host>/symfony2/web/app.php/demo/hello/james not working. it's throwing symfony error. swear haven't touched thing. i'm @ bott

rotation - iOS Stretching View using Auto Layout in Landscape -

Image
i started using auto layout upcoming projects. created uiimageview inside uiscrollview shown in image below: auto layout works expected , positions uimageview correctly after rotation. problem want uiimageview stretch in landscape mode fills whole width. how can that? @ moment has same size in portrait mode. when place uiimageview directly in uiviewcontrollers view without using uiscrollview stretches correctly. why that? happy hints. i using following constraints (leading , trailing space equal 0): ok found out using auto layout, uiimageview inherits size of uiimage. if change image on rotation uiimageview resizes properly.

java - Pass XML Marshalled data into a ByteBuffer -

for current project, need write xml data bytebuffer write output xml in binary format (.dat example). is there lib or class will, each java objects corresponding elements of xml, write value of attributes bytebuffer (or similar implementation) while respecting attributes type (int -> buffer.putint(intattribute) ... ps: ideally, need method put size of each element sequence before values of elements edit : here concrete example of i'd like let's have following class defining walker_template xml element @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "routestep" }) @xmlrootelement(name = "walker_template") public class walkertemplate { protected list<routestep> routestep; @xmlattribute(name = "route_id") protected string routeid; public list<routestep> getroutestep() { if (routestep == null) { routestep = new arraylist<routestep>(); } return this.routestep; }

Iterate through list of intervals in Python and return odd and even values? -

i'm working on fragment of code homework assignment. i want to: get user input(n). make list out of input(n) range. iterate through list. count odds , evens. return odds , evens use in function i stumped , far got: def input(): n = eval(input("enter number: ")) def getodds(n): odd_count = 0 even_count = 0 list_start = list[1] list_cont = list[1:] in range(n): ## know i'll using ## if position % 2 == 0: even_count = even_count+1 return even_count return odd_count you want like: def getoddevencount(n): odd_count = 0 even_count = 0 elem in range(n): if elem % 2 == 0: even_count += 1 else: odd_count += 1 return odd_count, even_count example usage : odd_count, even_count = getoddevencount(10) print("odds:", odd_count, "evens:", even_count) outputs: odds: 5 evens: 5 note however, if you're

c++ - importing crypto++ in QT application and occurring linker errors? -

i trying use crypto++ sankore-3.1 qt program, i've installed qt sdk 4.8.1 using vc++ 2010 compiler. i've compiled , built crypto++ using microsoft visual studio 2010, , have needed lib files, include .h files , dll file in hand. i testes these library simple qt application in empty project using qt creator, added libraries .pro file , run successfully. .pro file blow: win32:config(release, debug|release): libs += -l$$pwd/../../dokuman/sankore- 3.1/plugins/cryptopp/win32/dll_output/release/ -lcryptopp else:win32:config(debug, debug|release): libs += -l$$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/win32/dll_output/debug/ -lcrypto includepath += $$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/include dependpath += $$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/include sources += \ main.cpp win32:config(release, debug|release): libs += -l$$pwd/../../dokuman/sankore-3.1/plugins/cryptopp/win32/output/release/ -lcryptlib else:win32:config(debug, de

how to fetch the date and time and save it in textfile android? -

i fetching gps location once in half hour , displaying in textview saving values passed in textview sdcard gpsdata.txt file, using below code here have save time , date , numbered. now gps location in txt file : 13.01471695,80.1469223 13.01471695, 80.1469223 13.01471695,80.1469223 13.01471695,80.1469223 but need this: 1)13.01471695,80.1469223 time:12 30pm date:1/1/2013 2)13.01471670,80.1469260 time:12 45pm date:1/1/2013 public void appenddata(string text) { file datafile = new file(environment.getexternalstoragedirectory() + "/sundth/gpsdata.txt"); if (!datafile.exists()) { try { datafile.createnewfile(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } try { //bufferedwriter performance, true set append file flag bufferedwriter buf = new bufferedwriter(new filewriter(datafile, true)); buf.append(text); b

python - Is there such a thing as an ODBC driver which will connect to any SQL-92 database? -

if database has been written sql-92 standard why need proprietary driver? is there python library let me interact standard sql-92 database? the database 4d v12 sql , don't have 64 bit driver mac, need. the problem while sql standard, not specify how data must transfered on wire, nor way connections have negociated begin with. hence servers implement own protocol. odbc provides standard way @ programmatic level (a middleware) interact db driver, driver must implement proprietary glue connected vendor server. if odbc driver available on system, library able use odbc api should able access it, , access handled dbs. regarding specific problem, seems such driver exists . @ time unable access page referencing it. this other page provides guidance on how install driver.

ruby - How to get the content from an HTTP POST request received in thin? -

i using thin receive http post requests, server code this: http_server = proc |env| # want make response dependent on content response = "hello world!" [200, {"connection" => "close", "content-length" => response.bytesize.to_s}, [response]] end setting breakpoint, can see have received content-type (json), , content length, can't see actual content. how can retrieve content request processing? you need use rack.input entry of env object. rack spec : the input stream io-like object contains raw http post data. when applicable, external encoding must “ascii-8bit” , must opened in binary mode, ruby 1.9 compatibility. input stream must respond gets , each , read , rewind . so can call read on this: http_server = proc |env| json_string = env['rack.input'].read json_string.force_encoding 'utf-8' # since body has ascii-8bit encoding, # know json, ca

PHP, getting Thumbnail for an image in Elfinder -

i use elfinder 2.1 , i'm looking possibility right thumbnail path of image php. by default .tmb folder exist in every folder , contains resized thumbnails (i think) md5 hashed filename. how can retrieve correct thumbnail specific image in php? goal show thumbnails in php script , click original imgage shows up. take @ issue, may point in right direction: https://github.com/studio-42/elfinder/issues/671

XSLT Grouping on one subnode through multiple higher level nodes -

i'm new xslt trying xml file display node set through xslt. using xsl 1.0. xml looks this: <...> <entry> <organizer> <component> <observation> <code displayname="weight" /> <effectivetime value="5/21/2013 12:00:00 am" /> <value value="75" unit="lbs" /> </observation> </component> </organizer> </entry> <entry> <organizer> <component> <observation> <code displayname="bmi" /> <effectivetime value="5/21/2013 12:00:00 am" /> <value value="14.6" unit="98" /> </observation> </component> </organizer> </entry> <entry> <organizer> <component> <observation> <code displayname=&quo

ruby on rails - rake jobs:work issue in implementing projectfedena -

i trying implement fedena v 2.3. [projectfedena.org] opensource school management app. have problem feature of fedena. when try send internal messages, either recipient doesn't receive message or doesn't appear in sent box. the same problem discussed in fedena forum http://www.projectfedena.org/forum/9-support-and-troubleshooting/topics/724-internal-messaging-service-is-not-working i have run "rake jobs:work" again , again see output when executed rake command worked me problem dont know how run everytime when needed. the forum didn't give me solution. came across cron jobs, runs each , every minute doesn't seem optimal solution. i did this crontab -u root -e type following , save * * * * * cd <rails_source_dir> && rails_env=production <rake path> jobs:work rake path = "which rake"

regex - Python: convert variable-like strings to class-like strings -

this question has answer here: camelcase every string, standard library? 6 answers i'm having trouble trying create function can job. objective convert strings one one hello_world helloworld foo_bar_baz foobarbaz i know proper way using re.sub , i'm having trouble creating right regular expressions job. you can try this: >>> s = 'one' >>> filter(str.isalnum, s.title()) 'one' >>> >>> s = 'hello_world' >>> filter(str.isalnum, s.title()) 'helloworld' >>> >>> s = 'foo_bar_baz' >>> filter(str.isalnum, s.title()) 'foobarbaz' relevant documentation: str.title() str.isalnum() filter()

switch statement - My Javascript doesn't work -

i wrote simple program following example book. it's supposed draw dice random number of dots doesn't work. found problem caused simple "switch" instruction. thing downloaded program author's page , work. after slight adjustment in formatting code identical it's still broken. it nice if tell me if going on. this how code looks (and doesn't work): http://pastebin.com/1hjwpxi8 this author's: http://faculty.purchase.edu/jeanine.meyer/html5/dice1.html i found if copy/paste "switch" instruction author's code mine starts working properly. problem here: case 5; draw4(); draw1(); break; case 6; draw4(); draw2mid(); break; cases in switch statement followed colon, not semi-colon. replace case 5; case 5: , case 6; case 6: ... and code work.

android - Unable to apply Cascading styles, when used JQuery locally rather than through CDN -

i beginner in android app development using jquery , trying put jquery scripts in local storage, rather referring central depository. <script src="../www/js/jquery.1.10.2.js"></script> <script src="../www/js/jquery.mobile-1.3.2.js"></script> <link rel="stylesheet" type="text/css" href="../www/css/jquery.mobile.structure-1.3.2.css" /> but desired output not getting displayed. have below code in index.html file. <body> <div data-role="page"> <div data-role="header">hello android</div> <div data-role="content">from mani.</div> <div data-role="footer">test</div> </div> </body> plain text displayed rather css elements. checked in previous posts regarding question, , tried out solutions, didn't work. can please help..? the issue due framework, used; phonegap. expects paths given i

resharper 7.1 autocompletion and erase everything on the right -

suppose have line: return _jsonparser.parse(_filereader.read(filelocation)) ; then, remove "_jsonparser.parse" part: return (_filereader.read(filelocation)) ; then start writing return _csvp(_filereader.read(filelocation)) ; then press tab, here's happens return _csvparser the autocompletion did complete variable, erases line on right. how disable ? in resharper 5.1 didn't have problem. try using enter key. enter inserts, tab replaces. resharper 8 introduces ability configure this.

java - BIRT report error column binding -

i have birt report worked fine until altered database connected to. deleted column out of table on database , removed call in data query , i'm getting error whenever try , generate birt report. the following items have errors: data (id = 291): + column binding "iscomplete_18" has referred data set column "iscomplete_18" not exist. (element id:291) data (id = 298): + column binding "iscomplete_18" has referred data set column "iscomplete_18" not exist. (element id:298) data (id = 292): + column binding "iscomplete_18" has referred data set column "iscomplete_18" not exist. (element id:292) data (id = 299): + column binding "iscomplete_18" has referred data set column "iscomplete_18" not exist. (element id:299) data (id = 293): + column binding "iscomplete_18" has referred data set column "iscomplete_18" not exist. (element id:293) data (id = 300): + column bind

c# - The tag 'ViewModelLocator' does not exist in XML namespace clr-namespace:XXX -

i have tried numerous other solutions without success. have class called viewmodellocator located in portable class library. has property in called viewmodels , of type dictionay<k, v> then have windows phone 8 project references portable class library. added following wp8 app.xaml: <application x:class="kaizen.wp8.test.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:test="clr-namespace:foo.core.portable.viewmodel;assembly=foo.core.portable"> <application.resources> <test:viewmodellocator x:key="viewmodellocator"> <test:viewmodellocator.viewmodels> <test:sampleviewmodel x:key=&qu