Posts

Showing posts from June, 2012

c - scanf is not waiting for input -

i'm trying find bug here, still don't it. i've been debugging , googling , found close topics, there solutions don't need atm, , i'm curious why code not working: #include <stdlib.h> #include <string.h> #include <stdio.h> #define buffer 256 int main() { int missioncode; char *desc = (char*)malloc(sizeof(char)*buffer); { printf("please enter mission code (or -1 exit): "); scanf("%d", &missioncode); fflush(null); if (missioncode==-1) return 1; } while (missioncode>10); { printf("please enter string:\n"); scanf("%[^\n]s", desc); //it doesn't stop here! fflush(null); if (!strcmp("exit",desc)) return 1; } while (strlen(desc)<20); printf("your string:\n%s", desc); return 0; } there's wrong scanf\flushall in second loop, don't find out what.

How is Python's ROUND_HALF_EVEN supposed to handle decimals smaller than 1? -

it appears in every definition can find of round half even includes nearest integer (e.g., python's decimal documentation ), if integers rounded to. however, if round decimals smaller 1, appears follow same principal, assigning role of integer decimal place rounding to. example: >>> three_places = decimal.decimal('0.000') >>> >>> decimal.decimal('.0005').quantize(three_places) >>> decimal('0.000') >>> >>> decimal.decimal('.0015').quantize(three_places) >>> decimal('0.002') in example, value of third decimal place seems play role of integer (rounding down 0 , 2 ). the specified way of handling numbers less 0 (and how python's round_half_even supposed function), , if so, misunderstanding meaning of "integer" in context? or, there more story, , perhaps merely coincidence? your interpretation correct. documentation isn't clear , should use word

vb.net - Javascript Windows UI Automation -

in vb.net, can automate application installs using windows ui automation. possible in javascript? vbscript acceptable javascript preferable. javascript limited interaction dom , remote servers (same origin policy plus exceptions if defined server), can't install software on client machine that.

Python - CSV Reader - For Loop Reading The Rows, But Not Reaching The End of the File -

i've developed function aggregate total population of, each given cohort, given in file. function gets used twice. once total [actual] population, , once total number of 'cases'. i'm encountering problem function not reading end of 'cases' file. implemented row counter, prints number of rows iterated through. population file counter output 933 , case file counter output 911, means not reading bottom 22 cases. have idea why might be? here function have defined: def newpopcount(filename, fileheader): rowcount = 0 # row counter import csv popholder = [] cohorts = [] print (len(fileheader)) in range(3, len(fileheader)): cohorts.append(fileheader[i]) in range(len(cohorts)): popholder.append(0) popcsv = open(filename, 'r', newline = '') popreader = csv.reader(popcsv, delimiter = ',') row in popreader: rowcount += 1 counter = 0 if row[0] == filehea

ios - How do i make my picture relocate it self on the screen with a button -

im learning xcode , wondering how make button refresh part of code or something. im placing picture in random location on screen want able press button relocate random location, input appreciated. thanks. code. viewcontroller.m - (void)viewdidload { int xvalue = arc4random() % 320; int yvalue = arc4random() % 480; uiimageview *imgview = [[uiimageview alloc] initwithframe:cgrectmake(xvalue, yvalue, 70, 30)]; nsstring *imgfilepath = [[nsbundle mainbundle] pathforresource:@"clubs-2-150" oftype:@"jpg"]; uiimage *img = [[uiimage alloc] initwithcontentsoffile:imgfilepath]; [imgview setimage:img]; [self.view addsubview:imgview]; [super viewdidload]; } as code stands right not possible variables have scope, means, exists within functions or classes. variable imgview exists on viewdidload . able access somewhere else need declare instance variable. on .h file this: @interface yourclassname : uiviewcontroller { uiimage *imageiwanttochange; } t

php - mySQL insert just won't work, but will with other table -

this question has answer here: syntax error due using reserved word table or column name in mysql 1 answer i have mysql issue has me stumped hours! context: creating web-application teach children different musical symbols on touch devices problem: after running individual script, no row created although last echo argument works. wierd: modeled after other scripts have working. edit: re-furnish code prepared statements after find problem. here code: <?php $database_connect = mysql_connect('localhost','ragstudi','*****'); if (!$database_connect) {die ('not connected sql' . mysql_error());}; mysql_select_db('ragstudi_musicgamescores') or die ('db doesnt exist'); $username = "jimmy";//$_post["username"]; $gamelevel = 1;//$_post["level"]; $gamescore = 2300;//$_post["sco

c# - Read/Write files on Windows Phone 8 via PC USB connection -

i'm attempting write music player windows phone 8 because current xbox music app lacking. i'd able sync files on device based on whether they've been rated or down. since device won't let me delete or make changes music files on app, i'm thinking of keeping database of ratings in isolated storage can write data. i'll have companion app on pc read database device, , remove files have been rated downwards. unfortunately unable access device on pc through code. know it's possible since can access device through windows explorer, when load c# code try read files, cannot find device @ all. i've used file picker see if can modify files, every time select file, windows copies file device temporary directory on c:\, when try deleting it, deletes temporary file , file remains on device. what in heck going on here? cannot seem find information accessing wp8 in code on usb. ideas? the windows phone power tools on codeplex can write files isolated

windows - Starting batch file command prompt from the directory location in which the batch file resides in -

i writing batch file uses of files within it's parent directory (lets folder1). c:\user\steve\foder1\ now want make whole folder_1 relocatable can copy paste folder anywhere on my/someone else's computer , run batch script. d:\user\random_guy\folder1\ the question how start batch file's command prompt (d:\user\random_guy\folder1) it's parent directory without writing batch script that. start batch file with: pushd %~dp0 that set current directory folder containing batch file. in batch file, make sure paths relative current directory. however, if batch file changes other directories in course of execution , still able refer batch's home folder's contents without knowing exact path, use same %~dp0 path file(s) want use. instance, filea same folder batch file addressed as "%~dp0filea" note absence of \ before filea . because %~dp0 includes trailing \ , entire thing evaluate correct path right. (although if put backslas

Need to make Sum IIF query in linq vb.net -

i new linq , need query linq in vb.net data table every column setted var char if useful query: select sum(iif([columnnametocountvalues] in ('value1','value2','value3') , [employeid] '[idvalue]' , [project] '[projectname]',1,0)) total [datatablename]; this query should return integer. where error , question have tried? have said "this query should return integer." may output got error, isn't it? so, why not change database column data type int

html - Failed to load resource: the server responded with a status of 404 (Not Found) error in server -

i'm trying load image in image folder, it's not working. upon debugging, see error: failed load resource: server responded status of 404 (not found) my image coding in .css file is, background: url("../images/bgbody.png") no-repeat; what doing wrong here? use browser's network inspector (f12) see when browser requesting bgbody.png image , absolute path it's using , why server returning 404 response. ...assuming bgbody.png exists :) is css in stylesheet file or in <style> block in page? if it's in stylesheet relative path must relative css stylesheet (not document references it). if it's in page must relative current resource path. if you're using non-filesystem-based resource paths (i.e. using url rewriting or url routing) cause problems , it's best use absolute paths. going relative path looks store images separately stylesheets. don't think idea - support storing images , other resources, fonts

c# webBrowser select dropdown value on before label -

i'm on coding programm , need help. dropdown 1 dropdownbox can select, want roboform: "fieldname:" job situation "content:" farmer und dann selected er in egal welcher box, die neben/über (über im source) die label ist, den inhalt. then should selected in whatever box next / on (over source), label content. thus, how find corresponding box under label? <label>your job situation</label> <div class="w_bg_input employmentselect longregistration"> <select tabindex="21"> <option value="-1"> auswählen</option> <option value="2796310"> farmer</option> </select> </div> greets, bl1zz4rd

javascript - Keith Wood Datepick inMonth Variable -

i'm using keith wood's datepick, , trying block out specific ranges of dates using ondate function found here . what value , purpose of inmonth parameter? rails website gives error uncaught typeerror: cannot read property 'dateclass' of undefined when include if (inmonth) statement seen in "national days" example in above link keith wood's site. any insight appreciated. thanks. the error due else, inmonth variable ensure function used in ondate parameter doesn't apply dates other months displayed in current month. example, prevents ondate style applying march 30 when you're in month of april.

xml - XSLT - wrapping xsl:template output up in a tag -

i need take in 1 .xml file, , output n files sub-set of input file. sub-set based on predicate check of 2 nodes. plan run input file on xslt template n times output each file. my input looks this: <employee_data> <employees> <employee id="1"> <first_name>2sk8d</first_name> <agency_code>38</agency_code> <offices_administered> <office_administered office_identifier="allpois" agency_code="hl" /> </offices_administered> </employee> <employee id="2"> <first_name>2sk8d</first_name> <agency_code>24</agency_code> <offices_administered> <office_administered office_identifier="allpois" agency_code="22" /> </offices_administered> </employee> <employee id="3"> <first_name>2sk8d</first_

c++ - Unable to send data over windows UDP sockets:Error Code 10035 -

i trying receive data on program program running on same windows 7 pc through sockets. have made 2 separate program, 1 sending , other receiving.send program showing success receive program waiting indefinitely.when put receive socket in non blocking mode receiving error code 10035 ie resource unavailable. there system setting have firewall or thing. although after disabling firewall getting same error.i searched stackoverflow.com not solution problem. giving code below send , receive functions. for send function: #include "stdafx.h" #ifndef unicode #define unicode #endif #define win32_lean_and_mean #include <winsock2.h> #include <ws2tcpip.h> #include <stdio.h> // link ws2_32.lib #pragma comment(lib, "ws2_32.lib") using namespace system; int main(array<system::string ^> ^args) { char ch; int irun =1; int iresult; wsadata wsadata; socket sendsocket = invalid_socket; sockaddr_in recvaddr; unsigned short por

regex - Is there a way to search terms in order with RegexpQuery in lucene? -

i search indexed documents in order using regexpquery. for example have 2 document text: oracle unveils better expected quarterly results. text: research in motion shares gained 13 per cent on toronto stock exchange friday, day after smartphone maker posted better expected quarterly results. so far tried got no luck. query regexq = new regexpquery(new term("text", "^.+better.+quarterly.+results")); is there way of implementing this? thanks i believe phrasequery fits looking better. can use phrasequery.setslop(int) allow terms appear between terms of query. like: query pq = new phrasequery(); pq.add(new term("text", "better")); pq.add(new term("text", "quarterly")); pq.add(new term("text", "results")); pq.setslop(10); //or whatever appropriate slop value you. this sort of query supported standard queryparser, as seen here , like: text:"better quarterly results"~10

constraints - Mysql Create Index Set As No Duplicates -

i have table p_places has 2 columns both foriegn keys references parent tables: mysql> create table p_places( -> user_id int not null, -> place_id int not null, -> foreign key(user_id) references people(user_id) on delete cascade, -> foreign key(place_id) references places(place_id) on delete cascade -> )engine=innodb; i trying create index both of columns there can not duplicate rows(there can duplicate foriegn keys however...just not rows). i tried: alter table p_places add index(user_id+place_id no duplicate); alter table p_places add unique index(user_id+place_id); alter table p_places add unique index both_id(user_id+place_id); but had no success. try alter table command learning purposes rather creating table. you close want. alter table p_places add constraint tb_unique unique(user_id, place_id) purpose of naming constraint

python - nested defs not working -

what need add second def statement in order work? def main(): # user has choose picture , asked pic = makepicture(pickafile()) # user asked select color wants remove picture color = requeststring("which color remove?") show(pic) # whats wrong last part doesn't make modifications picture def removecolor(pic, color): r = red g = green b = blue px in getpixels(pic): setred(px, 0) px in getpixels(pic): setgreen(px, 0) px in getpixels(pic): setblue(px, 0) repaint(pic) here take out removecolor function main function, , call inside main def removecolor(pic, color): r = red g = green b = blue px in getpixels(pic): setred(px, 0) px in getpixels(pic): setgreen(px, 0) px in getpixels(pic): setblue(px, 0) def main(): # user has choose picture , asked pic = makepicture(pickafile()) #

Bash array export? -

is possible declare , export bash array single statement within function ? my current workaround first declare, export. f() { foo=(1 2 3); export foo; }; f; export -p | grep foo= declare -ax foo='([0]="1" [1]="2" [2]="3")' i observe that: f() { export bar=(1 2 3); }; f; export -p | grep bar= <no output> and: f() { export baz="(1 2 3)"; }; f; export -p | grep baz= declare -x baz="(1 2 3)" # not array i use bash v3.2.48(1)-release , can't upgrade. some background: i have friend whome trying study "some" django. he's more clueless me @ command line , needs following, on osx hackintosh: launch interactive shell find path variable including django bin dir, per specification find updated pythonpath env var, various django libs visible a nice interactive ipython shell start typing commands in after double-clicking (tricky) interactive shell fall once ctrl-d exits ipython on

typo3 image processing test fails -

i wanted start learning typo3 , reason installed typo3 on local apache practise. if use testmenu install tool, got errors creating every file format except .gif , .bmp . tried other configurations of graphics magick reason same. read, maybe problem disabled exec function. can tell me how solve problem? thx edit: problem missing library delegates of graphicsmagick imagemagick , graphicsmagick requires exec() function. there no way use alternate way. need change provider.

python - Template directory logic in Django -

i've been fooling around templates time now, , loving every moment of django experience. however, since django such big fan loose coupling , wanted know, why not have piece of code: import os import platform if platform.system() == 'windows': templatefiles = os.path.join(os.path.dirname(__file__), '..', 'templates').replace('\\','/') else: templatefiles = os.path.join(os.path.dirname(__file__), '..', 'templates') template_dirs = ( # includes templates folder templatefiles, ) instead of: import os template_dirs = ( templatefiles = os.path.join(os.path.dirname(__file__), '..', 'templates').replace('\\','/') ) would not first example follow philosophy of loose coupling better second (which believe does), , if so, why django default second code example , not first? you ask, "why django default second code example?" in django 1.5, when run $ django

android - OpenGL ES Degenerate Triangles With TRIANGLE_FAN? -

in opengl es, possible use degenerate triangles (triangles 0 area) separate triangle_fan objects in vertex array? or possible triangle_strip? if answer no, best way batch multiple triangle_fan vertex array draw calls one? you correct, answer no, since triangle fan triangles share same vertex. if want batch multiple triangle fans better use vertex buffer objects or vbo's gl_triangles mode instead. there small index buffer overhead, provide better flexibility.

asp.net mvc - Knockout with class scoped properties -

i using knockout , have viewmodel bound data object in asp.net mvc 4 project quite nicely so: $(document).ready(function() { properties = @html.raw(json.encode(model)); selectedproperty = properties[0]; viewmodel = { properties: ko.mapping.fromjs(@html.raw(json.encode(model))), selectedproperty: ko.observable()}; viewmodel.setitem = function(item) { viewmodel.selectedproperty(item); } ko.applybindings(viewmodel); now want refactor javascript logic encapsulated inside class: realestate.search = function (properties) { this.properties = properties; this.selectedproperty = this.properties[0]; this.viewmodel = { properties: ko.mapping.fromjs(this.properties), selectedproperty: ko.observable()}; this.viewmodel.setitem = function(item) { viewmodel.selectedproperty(item); } ko.applybindings(this.viewmodel); } and instantiating object in html page so: $(document).ready(function() { search = new realestate.search(@html.raw(json.en

python - Django stuck on default page -

i have django set on server, return default "welcome django" page. i have django set on local machine, , use git push files server. both server , local machine configured apache/wsgi. on local machine display webapp intended, on deployment server, shows nothing default page. restarting apache on server , error in django project have not made difference. any ideas? i assuming have django set locally. if so, using localhost. suppose show welcome page unless configure on url.py redirect somewhere else. useful if showed url.py. if welcome page or url.py has not been altered, dont know else change besides default welcome page.

How to silence android phone based on set time -

i'm trying write program silence phone based on time. instance, press button can set start time , end time. @ start time phone silence. @ end time phone go regular ringer mode. silence phone not go regular mode once hits end time. have lot of things commented out previous attempts @ trying solve issue. uncommented parts have. help/guidance on issue. import java.util.calendar; import android.app.activity; import android.app.dialog; import android.app.timepickerdialog; import android.content.context; import android.media.audiomanager; import android.os.bundle; import android.text.format.time; import android.view.view; import android.widget.button; import android.widget.textview; import android.widget.timepicker; import android.widget.toast; public class presetedit extends activity { private audiomanager maudiomanager; private boolean mphoneissilent; button save; private button starttime; private button endtime; private int shour; private int sminu

unix - Calculate Sent and Received PING Packets at run-time in Linux -

i have calcuate sent , received ping packets @ run-time in linux. in linux, verbose, nothing gets printed if packets not received. prints successful replies, destination host unreachable. how can sent , received packets seen @ run-time on terminal? method can accomplished? the simplest solution - if want see sends , receives make source that. source ping command available , can edited make want. that said, if don't want edit source, because doesn't suit, should use -c option, count of packets send, , use command send one @ time . return code command can used determine if packet seen, , can use (roughly) time command started @ origin time of packet. bear in mind ping quite deterministic in it's behaviour. default, sends one packet per second , should able math based on how long runs , count of packets tried use.

show html text at the bottom of the JTextPane -

i've been trying show text @ bottom of jtextpane area using html. it's not supporting styles, used following code: <!-- saved url=(0040)file:///c:/users/tusim/desktop/test.html --> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> table { font-family:"tahoma"; font-size:11; width: 100% } td, th { background-color: white} .header {font-weight:bold;} .record-first {font-weight:bold; min-width: 130px;} </style> </head> <body><table border="0" cellpadding="2" cellspacing="1" height="95%"><tbody><tr height="95%"><td width="32%" height="95%" valign="top"><div style="background-color: black; width: 100%;"><table border="0" cellpadding="2" cellspaci

java - How to limit Jenkins child processes? -

i have clean installation of jenkins ci on ubuntuserver 12.10, no jobs, no nothing, jenkins. installation aptitude. thrills me jenkins doing nothing @ moment , has 40 child processes, consumes quite lot of server's memory. there way limit number of these child processes to, example, 10? yes can. go jenkins > manage jenkins > configure system > specify number of executers corresponding text box "# of executors" another best method using slave machines divide work load. use master slave configuration setup slave machines.

mongodb - How to use Devise authorization in custom middleware -

i have middleware serving files mongodb #serve_gridfs_file.rb class servegridfsfile def initialize(app) @app = app end def call(env) if env["path_info"] =~ /^\/grid\/(.+)$/ process_request(env, $1.force_encoding("utf-8")) else @app.call(env) end end private def process_request(env, key) begin mongo::gridfilesystem.new(mongoid.database).open(key, 'r') |file| [200, { 'content-type' => file.content_type }, [file.read]] end rescue [404, { 'content-type' => 'text/plain' }, ['file not found.']] end end end i use devise capabilities current_user. after that, use validation. not know how in simple manner.

Disable a Module in Certain magento Theme -

is possible disable modules when running theme? i'm working on mobile friendly version of our magento store , i've run issues few extensions. rather customize them, default iphone theme sufficient, i'd disable modules runs default code when on mobile device. possible? you can disable module in local.xml. paste xml in theme's local.xml. <config> <modules> <[your_module_name]> <active>false</active> </[your_module_name]> </modules> </config>

save - Symfony 1.4 Validation Error Unsigned -

when try save form in symfony 1.4 gives me these errors: validation failed in class cmscontentelementfile 4 fields had validation errors: * 1 validator failed on title (unsigned) * 1 validator failed on alt (unsigned) * 1 validator failed on link (unsigned) * 2 validators failed on direction (length, unsigned) what errors mean? edit: validators form fields: $this->setvalidators(array( 'title' => new sfvalidatorstring(), 'alt' => new sfvalidatorstring(), 'link' => new sfvalidatorstring(), 'width' => new sfvalidatorinteger(), 'height' => new sfvalidatorinteger(), 'direction' => new sfvalidatorpass() )); it works now. problem give field "direction" param "unsigned:1 , varchar. fix problem. hope helps somebody.

match - Domain Name Matching algorithms -

i have list of companies , want match domains fetched using google search ones belong same company. there existing algorithms available use case(legally allowed used in commercial project too). e.g. have internet movie database company name , google returns me results out of valid ones internetmoviedatabase, internet-movie-database, the-internet-movie-database, theinternetmoviedatabase, internetmovies, internet-movies, imd, imdb.(note: have excluded tlds list make question simpler) sounds looking approximate string matching algorithm. not sure if looking algorithm or implementation. there question on here: string matching algorithm one possible solution use levenshtein distance: http://en.wikipedia.org/wiki/levenshtein_distance if looking implementation, if google "approximate string matching c++", first result: http://www.chokkan.org/software/simstring/ good luck!

Android: How to measure distance with gps -

i trying make application,which take latitude , longitude on current place of user. , count momentary,what distance travel user in km. the "currentlat" , "currentlon" current latitude , longitude of user.but don't know latitude , longitude put "endlat" , "ednlon". sorry bad english. thanks in advance. /////////////////////////////////// i made app,but have 1 little problem. when started first time program,i value 5536 , when restarted program normal value 0.0 again sorry bad english. :) and guys helping me,you best :) public class gps extends activity { textview display; double currentlon=0 ; double currentlat=0 ; double lastlon = 0; double lastlat = 0; double distance; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_test); display = (textview) findviewbyid(r.id.info); locationmanager lm =(locationmanager) gets

c# - LINQ to Entities returning incorrect results for tables without primary key -

i have found linq entities needs primary key on table in order return correct results. without it, expected number of rows including duplicates (and accordingly, missed rows). problem described here , here , , consider bug. in 1 of tables, each row unique cannot create compound key across fields because nullable columns cannot used in primary keys (again, consider sql server limitation). so... how can correct results when selecting table using linq entities? believe "key" may create "entity key" across columns in visual studio model designer i'm not sure how this. setting entity key = true on nullable columns throws exception. at 1 stage gave , added identity int column auto-increment enabled , used pk, solved issue, had throw out because of volume of data being deleted/inserted time (it's not possible reset auto-increment counter on schedule because not of rows deleted, causing clashes). my last resort add bigint identity column pk, rid of aut

Dynamics CRM get extension attribute -

i have created custom field system entity. how access attribute value through xrm web services through late binding? i'm using code gives me entityreference object: entity objcase = service.retrieve("incident", new guid(request.querystring["entityid"]), attributes); string strvalue = objcase.attributes["new_papid"]).tostring(); you retrieving lookup value, in case need cast first entity reference entity objcase = service.retrieve("incident", new guid(request.querystring["entityid"]), attributes); entityreference pap = (entityreference)objcase.attributes["new_papid"]; guid papid = pap.id; // id of record; string papname = pap.name; // primary attribute of entity;

c# - not insert Turkish character Window 8 app to Sqlite -

i have been working sqlite database on windows 8 app.(sqlite windows runtime) turkish character problem when insert database. how can fix problem. can me? thank much. easy come. using (var db = new sqlite.sqliteconnection(app.dbpath)) db.execute("insert stock (name) values('ŞşİıĞğ')"); i try result -> ÞþÝýÐð string = "ŞşİıĞğ"; string b = string.empty; byte[] utf8bytes = encoding.utf8.getbytes(a); b= encoding.utf8.getstring(utf8bytes, 0, utf8bytes.length); using (var db = new sqlite.sqliteconnection(app.dbpath)) db.execute("insert stock (name) values('"+ b +"')"); most problem column cannot handle utf-16 (unicode) (could client api). safest bet convert to/from utf-8 on client side read/write database. system.encoding.utf8 has magic.

linux - "For" loop in bash script only run once -

the script goal simple. i have many directory contains captured traffic files. want run command each directory. came script. don't know why script run first match. #!/bin/bash # collect throughput group of directory containing capture files # group of directory can specify pattern # usage: ./collectthroughputlist [regex] # [regex] name pattern of group of directory dir in $( ls -d $1 ); if test -d "$dir"; echo collecting throughputs directory: "$dir" ( sh collectthroughput.sh $dir > $dir.txt ) fi done echo done\! i try with: for dir in $1; or for dir in `ls -d $1`; or for dir in $( ls -d "$1" ); or for dir in $( ls -d $1 ); but result same. loop runs 1 time. finally found 1 , did tricks work. however, know why first script doesn't work. find *delay50ms* -type d -exec bash -c "cd '{}' && echo enter '{}' && ../collectthroughput.sh ../'{}' >

c# - Entity Framework 4.0. How to create new property like Compute Column on SQL Server -

i need create new column, based on property. new property must on different datatype. need use new property create association object. new property must int32. i need cast(stringfield int) on sql. i know can use partial class create new property, need create new association. you can add properties using partial class public partial class yourclass { public int yourproperty { { return int.parse(this.astringvalue); } } } can give more detail mean assosiation or why partial class implementation not work you.

Smooth animation transition logic in Android OpenGL -

i have android app developed using opengl , libgdx. right not know strategy on how code smooth transitions among set of animations. example: we have cat actor. animation consists of set of key frames paired transform matrix. have 5 preset animations cat : idle , walk left , walk right , jump , lie down . how can transition lets say walk right => lie down walk right => walk left while walk right animation playing half way? right once animation starts, needs played 1 full cycle until end. cat can move neutral position. can play next animation starts neutral position. final result unnatural , jerky. what approach should use tackle problem? just starting next animation when previous 1 isn't finished standard way. looks good, not wait first animation finish. if still think looks unnatural. must create fast "transition frame" between animations makes more natural. not worth effort if ask me, try first way :)

javascript - show percentages google charts on tooltip -

Image
i want show ratio google charts, using percentages. know how change vaxis percentages: vaxis: {format:'#%'}, but problem data not shown percentages on tooltips, in decimal values (0.85 instead of expected 85%) my code below: google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(function() {}) function drawchart(data) { var data = google.visualization.arraytodatatable(data); var options = { title: "pourcentage de production et productivité de l'entreprise", chartarea: {top:39}, vaxis: {format:'#%'}, pointsize:2 } var chart = new google.visualization.linechart(document.getelementbyid('chart_div')); chart.draw(data, options); } drawchart([['year', '% de production', 'productivité'],[ '06/03/2013', 0.85 , 0.58 ],[ '07

actionscript 3 - How to Make Stage transparent in Action script 3 (Adobe flash professional) -

i making text animation in as3, added in movie clip. want transparent stage. there way make stage transparent . if possible describe in detail. in advance>> to set wmode parameter transparent . check flash object's html code. <object classid="00" width="600" height="450"> <param name="quality" value="high"> <param name="wmode" value="direct" > // change ... to this: <param name="wmode" value="transparent" > setting bg colour of flash file ignored if set wmode transparent. if run .swf inside player externally background color shown.

php - Combine Two Rows in MySQL to Show Data as One Row -

i want join woocommerce created post meta fields show first , last name of client in 1 row. the table structure of mysql follow: meta_id post_id meta_key meta_value ======= ======= ======= =========== 1234 1874 _billing_first_name john 1235 1874 _billing_last_name cobe now want return following results using mysql statement post_id _billing_first_name _billing_last_name ======= ==================== ================== 1874 john cobe looking forward suggestions , help. thanks. if have 2 fixed values meta_key, can use this: select post_id, max(case when meta_key='_billing_first_name' meta_value end) _billing_first_name, max(case when meta_key='_billing_last_name' meta_value end) _billing_last_name yourtable group post_id

c# - Unsubscribe event from asynchronous wcf operation -

i'm working on wp app, use wcf service. wp works asynchronous method, after adding service reference methods async. want ask you, when subscribe event, can unsubscribe event onsenddatacompleted method in example? serviceclient.senddatacompleted += onsenddatacompleted; serviceclient.senddata(params); void onsenddatacompleted(object sender, eventargs e){ serviceclient.senddatacompleted -= onsenddatacompleted; } thanks

c# - Running a .NET 4.5 program on XP with .NET 2.0 -

we have windows service written in c# 5.0 .net 4.5. code using of newer language features ( async , await ) , framework features ( task.run , task.delay , iprogress , cancellationtoken , etc). our product works fine on windows 7 , 8 when .net 4.5 installed. our problem is, need run on xp machine. if .net 4.5 could installed on windows xp , there's not enough space on machine anyway. is there way can .net 4.5 application run on machine? i've looked compiling program native code using either mono aot compiler or ngen.exe , haven't had luck - don't think either of them achieve i'm trying do. failing - we've thought of creating bootable preinstalled flash drive runs simple version of windows (like winpe?) our application installed, out of depth , wouldn't know start. idea? how approach this? another option we've had try , install .net 4.0 , use async targeting pack . or have other ideas? there way can build/compile/run .net 4.5 application

layout - Shrink Or Expand Margins With Window Resize -

here's code i've been fiddling with: http://jsfiddle.net/denwg/3/ first, you'll need expand right column contains html , css. notice how grey container expands , contracts 90% of available width. #container { width: 90%; margin: 16px auto; /* more rules... */ } ideally, want green box start on right wall of container. window shrinks, pushes right border closer left border. want green box have behavior. window shrinks, want right border push green box towards red box. both boxes display: inline-block; . initially, thought of adding margin-right: some%; red box, didn't work thought would. eventually, wanted have grid of red , green boxes. approaching correctly? advice? million! i changed following css: #container { width: 90%; margin: 16px auto; padding: 16px; position:relative; /* added */ border: solid 1px #333; background-color: #eee; min-width: 280px; } #gree

getRealPath("/")- How does the result of this method differ in Tomcat and WebSphere -

using method getservletcontext().getrealpath("/") returns "\" in end of path in tomcat (eg. c:\testfolder\myapp) whereas in websphere doesn't (eg. c:\testfolder\myapp) . reason ? relevance of ("/") in getrealpath("/") ? q-1: relevance of ("/") in getrealpath("/") / refers root web context path. , function returns physical path of web directory war/web app installed. q-2 why tomcat appends \ in end , websphere not. different servers vary in results have mentioned because api implementations vary server server when part vaguely defined java ee. regards, ravi

ios - How to add two navigationController in a viewController? -

i add 2 navigationcontrollers in viewcontroller. these 2 navigationcontroller totaly independent , not linked. display these 2 navigationviewcontroller 1 beside other, splitviewcontroller. with childviewcontroller, succeed add 2 viewcontrollers position , size want. when try navigationcontroller, take screen , display @ point (0,0). try change frame of navigationcontroller nothing changed. can me please? thanks lot. edit : here code used add childvc : self.meetingslistviewcontroller = [[meetingslistviewcontroller alloc] initwithnibname:@"meetingslistviewcontroller" bundle:nil]; self.navcalendar = [[uinavigationcontroller alloc] initwithrootviewcontroller:meetingslistviewcontroller]; [self.navcalendar setnavigationbarhidden:no]; self.meetingslistviewcontroller.view.frame = cgrectmake(10, 54, self.view.frame.size.width/2-20, self.view.frame.size.height - 64); self.navcalendar.view.frame = self.meetingslistviewcontroller.view.frame; self.navcalendar.view.autor

javascript - I cannot figure out how to exculde links from preventdefault -

i want exclude links inside child-div preventdefault <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#parent").click(function(event){ event.preventdefault(); }); }); </script> </head> <body> <div id="parent"> <div id="child"><a href="mylink.html" alt="link">click me!</a></div> </div> </body> is possible link in child div working? have spent 3 hours looking answer right now, , can't seem figure out! check target triggered event not anchor. if not not propagate event. $(document).ready(function(){ $("#parent").click(function(event){ if(!$(event.target).is("a")){ event.preventdefault(); } }); });

ssl - What certificate is being sent with my REST PUT call -

we have rest webservices running on clustered jboss servers behind f5. connecting on mutual ssl. want verify certificate being sent our request - namely it's f5 server name (that fronts both jboss boxes) , not cert individual box being hit particular request. ssl , has never been strong suit, can't wrap head around how verify going our put call. edit : request being sent individual server, certificate need send 1 on f5, fronting both servers.

osx - Embedded Mono: EXC_BAD_ACCESS (SIGSEGV) when calling mono_jit_cleanup() -

i'm embedding mono runtime existing cocoa application. i've built latest runtime github (master branch) , exiting application after running managed code gives me during mono_jit_cleanup(): https://dl.dropbox.com/u/108566029/bad_access.png it's reproduced when try send http request via httpwebrequest. if call getrequeststream(). code works fine , managed objects disposed correctly. mono_jit_cleanup() called once. problem occurs during shutting down runtime. this reproduced on latest mono 2.10.x branch. sigsegv then. this can occur in different places, seems threading issue. so, how should shutdown runtime correctly. mono_jit_cleanup() call sufficient correctly dispose of runtime? , can exit application without disposing runtime (no mono_jit_cleanup() call)? p.s. i'm using 32-bit build of mono v2.0 (3.5 actually) runtime on osx 10.8.3. link against libmono-2.0.1.dylib, should boehm gc. same problem reproduced sgen gc. p.p.s here goes error https://dl.d

c# - Bindable field in ViewModel -

this question has answer here: implementing inotifypropertychanged - better way exist? 31 answers in viewmodels there typically lots of these private string somefield; public string somefield { { return somefield; } set { somefield = value; notifyofpropertychanged(() => somefield); } } is there way short version of such construct, bindable ? so have write like: public bindable<string> somefield; perhaps action shall fired notifypropertychanged ... i suppose create own class maintains value , raises inotifypropertychanged against containing class create like: public bindable<string> somefield = new bindable<string>("test", this); and binding against somefield access contained value , setting lead inotifypropertychanged being raised against this you'd need

c# - Value Converter not Being Called XAML -

i have put breakpoints inside value converter , never triggered, page renders no image being shown. the xaml: xmlns:datatypes="clr-namespace:datatypes_portable;assembly=datatypes_winphone8" ... <phone:phoneapplicationpage.resources> <datatypes:winphone8imageconverter x:key="imageconverter" /> </phone:phoneapplicationpage.resources> ... <image x:name="levelimage" horizontalalignment="left" height="auto" verticalalignment="top" width="auto" margin="0" grid.columnspan="5" source="{binding converter={staticresource imageconverter}, path=app.main.game.currentlevel.currentpart.image}"/> the cs: public class winphone8imageconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { var imageprovider = value winphone8imageprovider; return imageprovider.image; }