Posts

Showing posts from February, 2010

wordpress - I want payment in paypal with dynamic price entered by user -

i want payment in paypal dynamic price entered textbox in wordpress. can me?according user choices , price rate list,total price change , calaulated user.user enter amount in textbox paid in paypal.how this? did research on it. you use code similar following, have text box buyer enter in amount. click button make payment , redirected on paypal amount. <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- identify business can collect payments. --> <input type="hidden" name="business" value="my_site@my_site.com"> <!-- specify buy button. --> <input type="hidden" name="cmd" value="_xclick"> <!-- specify details item buyers purchase. --> <input type="hidden" name="item_name" value="hot sauce-12 oz. bottle"> <input type="hidden" name="currency_code" value=&q

iphone - Issue with storing cocos2d game configuration in sqlite + coredata -

in previous cocos2d game had limited number of levels had made separate class files each levels (.h , .m) but in current game im having large number of levels felt having individual files not idea. so decided store level's configuration in sqlite , build levels fetching data it. but i'm using box2d cocos2d becoming more complex handle bodies, joins, positions single code iterating bodies sqlite. sqlite proper option or should go seperate classes each levels?? one of our game have 150 levels , still handle plist. create generic dictionary level , add levels plist in form of dictionaries. , in code side, write level handler through can load level plist.

Opening a file in ruby -

i tried opening file in ruby following code got unknown error message. no such file or directory - -p code: myfile=file.open("/home/cucumber/profiles/data.csv","r") please advice correct method do. ensure whether file exists in designated location or not, either check manually or use in code: file.exists?("/home/cucumber/profiles/data.csv")

asp.net - Getting error with dots in the url -

i have routed page url http://www.example.com/2/2332/example when give period in url http://www.example.com/2/2332/example . taken server error page: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review following url , make sure spelled correctly. i redirect same page http://www.example.com/2/2332/example or custom 404 error page http://www.example.com/404.aspx . i tried debugging not hitting application_error event in global.asax.cs. any solve issue? the breakpoint not hit because not asp.net error. iis error. have modify web.config redirect custom error page.

android fragments - Change Orientation with different layout (Out of memory) -

my app have 2 different layouts, 1 portrait , landscape. define 2 .xml same name change position of view. things work until change orientation. when change orientation "out of memory". use class extend of "fragmentstatepageadapter" create fragments. override "onconfigurationchange", this:. setcontentview(r.layout.main); //if don't use this, views not change fragmentstatepageradapter = new fragmentstatepageradapterpersonal(fragmentmanager); viewpager.setadapter(fragmentstatepageradapter); fragmentstatepageradapter.notifydatasetchange(); i solved problem adding next line remove out of memory in "onconfigurationchange" viewpager.setadapter(null); fragmentstatepageradapter.notifadatasetchanged();

creating factors in R with differing number of replicates -

the following command region <- gl(6,2,24, label=c("ag", "cb", "cx", "ec", "hp", "mb")) creates factor in following way structure(c(1l, 1l, 2l, 2l, 2l, 3l, 4l, 4l, 5l, 5l, 6l, 6l, 1l, 1l, 2l, 2l, 3l, 3l, 4l, 4l, 5l, 5l, 6l, 6l), .label = c("ag", "cb", "cx", "ec", "hp", "mb"), class = "factor") but when try create differing number of replicates goes wrong. instance when ag , cb 3 replicates each , need this structure(c(1l, 1l,1l, 2l, 2l, 2l, 2l, 3l, 4l, 4l, 5l, 5l, 6l, 6l, 1l, 1l, 2l, 2l, 3l, 3l, 4l, 4l, 5l, 5l, 6l, 6l), .label = c("ag", "cb", "cx", "ec", "hp", "mb"), class = "factor") how write command region <- gl(6,2,24, label=c("ag", "cb", "cx", "ec", "hp", "mb&

localization - Converting HTML into Xliff and vice versa -

i want convert html file (including images , tables , css too) xliff. appreciate if can tell me how this. please provide sample example code. in addition fine tools mentioned above translation suite "transolution" supports conversion of html/xml xliff. it's hosting site have been down time again @ location: https://bitbucket.org/fredrik_corneliusson/transolution/overview transolution runs on both windows , linux. you can find documentation filter here: https://bitbucket.org/fredrik_corneliusson/transolution/src/tip/doc/filters.rst?at=default as filter command line tool quite easy call code programatically conversion.

R Show P-value results of lm as matrix -

i have data frame containing multiple socio-economic factors correspondent obersvations. want run lm-analysis on of them , form new matrix(or data frame) contains pvalues each combination of variables. my original data in matrix sfi.matrix , contains 7 rows each 12 entries. i tried following: 1.) build result matrix 2.) run lm of different combinations 3.) combine results in result matrix. my code looks follows: levene.tests.results <- matrix(1, nr=7, nc=7) rownames(levene.tests) <- colnames(levene.tests) <- colnames(sfi.matrix) for(i in 1:7) { for(j in 1:7) { levene.tests <- lm(sfi.matrix[,i] ~ sfi.matrix[,j])$p.value }} my problem result matrix [n=7,m=7] nas. i appreciate advise :-) also, not sure whether works because data entries rates... can me this? thanks advice of @benbolker able solve problem. indeed, lm wrong function. correct function test.cor brings useful results: correlations<- matrix( nrow=7, ncol=7) for(i in 1:7) { for(j in

jquery - How to change enable to disable in Td? -

i have question. have table data as <table> <tr> <td>enabled</td> <td><button class="js-enabled">desabled</button></td> </tr> <tr> <td>desabled</td> <td><button class="js-enabled">enabled</button></td> </tr> <tr> <td>enabled</td> <td><button class="js-enabled">desabled</button></td> </tr> <tr> <td>desabled</td> <td><button class="js-enabled">enabled</button></td> </tr> <tr> <td>enabled</td> <td><button class="js-enabled">desabled</button></td> </tr> <tr> <td>desabled</td> <td><button class="js-enabled"&

PHP code doesnt "compile" when connecting via sockets -

i writing script mirc fetch data webserver, code generated via php. it works fine when connect via browser (firefox). however, when connect via mirc sockets, server fails "compile" php code. can still able fetch other text or html. seems webserver (litespeed) not acknowledge http requests(?!) this header information pass server: sockwrite -n ccsw_sock_reg /ccsw/ccsw.php?action=register&username= $+ %ccsw_username_temp $+ &password= $+ %ccsw_username_temp http/1.1 sockwrite -n ccsw_sock_reg host: www.[hidden].com sockwrite -n ccsw_sock_reg connection: close sockwrite -n ccsw_sock_reg user-agent: mozilla/5.0 (windows; u; windows nt 5.1; de; rv:1.9) gecko/2008052906 firefox/3.0 sockwrite -n ccsw_sock_reg accept-encoding: gzip sockwrite -n ccsw_sock_reg accept:accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 sockwrite -n ccsw_sock_reg accept-language: en-us,en;q=0.5 sockwrite -n ccsw_sock_reg accept-charset: iso-8859-1,utf-

javascript - How to use data created by JS in PHP? -

this code <script type="text/javascript"> function countnumber(){ var number = 10; document.getelementbyid("n").innerhtml=number; } </script> <body onload="countnumber()"> <?php $a = "?"; //<-- here want innerhtml of "n"-id-element echo $a+1; ?> </body> how access html-data @ initialization of $a? you cannot access data way want, php runs on server, files transfered client , javascript runs on client. if need process data calculated javascript, need ajax or forms.

How to place classes in separate files (C++) -

i'm having difficulties placing class separate file , calling in main . below simple code. wondering how can use getkey() function int main() #include "stdafx.h" #include <iostream> #include <string> #include "travelfunctions.h" using namespace std; travelfunctions::getkey() { cout << "i bananna" << endl; } my travelfunction.h class class travelfunctions { public: getkey(); } my main class #include "stdafx.h" #include <iostream> #include <string> #include "travelfunctions.h" using namespace std; int main() { getkey bo; return 0; } you have first instance object class. main function should this: int main() { travelfunctions functions; functions.getkey(); return 0; } you should define void return type of function. .cpp: void travelfunctions::getkey() { cout << "i bananna" << endl; } .h:

c# - cannot upload files to ftp asp.net -

i have problem creating files on ftp production server. following code working fine on development server, when move code production server on site have bought hosting gives error code string fullname = convert.tostring(txtbx_fullname.text); if (fu_img.hasfile) { string ftpurl = ""; httppostedfile userpostfile = fu_img.postedfile; string uploadurl = @"ftp://abc/upload/u" + fullname; string uploadfilename = path.getfilename(fu_img.filename); uploadfilename = "image." + uploadfilename.split('.')[1]; stream streamobj = userpostfile.inputstream; byte[] buffer = new byte[userpostfile.contentlength]; streamobj.read(buffer, 0, buffer.length); streamobj.close(); streamobj = null; // ftpwebresponse createforderresponse; if (!getallfileslist(uploadurl, "xyz", "******")) { ftpwebrequest ftp = (ftpwebrequest)ftpwebrequest.create(uploadurl); ftp.method = webreq

"ResourceClosedError: The transaction is closed" error with celery beat and sqlalchemy + pyramid app -

i have pyramid app called mainsite . the site works in pretty asynchronous manner through threads being launched view carry out backend operations. it connects mysql sqlalchemy , uses zopetransactionextension session management. so far application has been running great. i need run periodic jobs on , needs use of same asynchronous functions being launched view. i used apscheduler ran issues that. thought of using celery beat separate process treats mainapp library , imports functions used. my celery config looks this: from datetime import timedelta api.apiconst import rerun_check_interval, automation_check_interval, \ auth_delete_time broker_url = 'sqla+mysql://em:em@localhost/edgem' celery_result_backend = "database" celery_result_dburi = 'mysql://em:em@localhost/edgem' celerybeat_schedule = { 'rerun': { 'task': 'tasks.rerun_scheduler', 'schedule': timedelta(seconds=rerun_check_interv

Set activity orientation always in reverse Portrait mode in android -

i want set orientation of activity reverseportrait. this, set following value in activity of manifest file: android:screenorientation="reverseportait" but works enable "screen rotation" settings of device. if "screen rotation" disabled shows screen in portrait mode instead of reverse portrait. please help. insert android:configchanges="orientation" below android:screenorientation="reverseportait" it means developer takes whole control of screen rotation, not android pattern

gorm - Mapping legacy domain class using Grails -

i trying map legacy domain class grails class, when table generated, field associated legacy class tinyblob, , not bigint linked id, , foreing key stuff. class newclass implements serializable { grailsentitya grailsentitya grailsentityb grailsentityb legacyentity legacyentity } the table has foreing keys grailsentitya , grailsentitya not legacyentity , type tinyblob , without relationship legacyentity table. is possible this? how?

linux - Command not found error while shell scripting -

i'm trying execute program followed. ./chext1.sh cpp test.cpp this should rename test.cpp test.cpp don't think script executing @ all. consistently getting " command not found error ". script below : #!/bin/sh newextension=$1; oldfile=$2; firstpart=`echo $oldfile | sed 's/\(.*\)\..*/\1/'` newname="$firstpart.$newextension"; #echo $oldfile #echo $newname mv "$oldfile" "$newname" #echo "$oldfile" #echo "$firstpart" #echo "$newname" i fixed issue. went horribly wrong when ftp'd text file contained script , transferred inside of .sh in linux. wrote in scratch in emacs , cleared up.

java - Jboss Web (Running PHP script in jboss ) cannot find SAPI class error -

i facing problem want run php script inside jboss 7.1.1 : i installed apr , ajp jboss now states error [org.apache.catalina.core.containerbase.[jboss.web].[default- host].[/php-examples]] (msc service thread 1-2) standardwrapper.throwable: java. lang.unsatisfiedlinkerror: can't find sapi class, no libphp5servlet in java.libr ary.path(c:\program files\java\jdk1.7.0\bin;c:\windows\sun\java\bin;c:\windows\s i downloaded jboss-native-2.0.10-windows-x86-ssl windows 32 bit system , did proper installation jboss nativa api then i installed php5servlet-windows-i586-sp1_2 c drive php5 folder , edit php.ini file accordingly. now states can't find sapi class..? please me sapi class ? compulsory ? i try using php-examples.war file comes php5servlet-windows-i586-sp1_2 distribution

How to refer to an equation in a different page with Mathjax -

i have several html pages lot of equations rendered mathjax. refer several equations not in same page. the problem "\eqref" working if equation in same page. one solution use "\tag{}" equations , use simple html links. for example, \label{myequation} \tag{4.1} and link "<a href="http://www.mysite.com/mypage#myequation"> 4.1 </a>" the problem solution need have personal tag equations. does has solution referring equations in different pages producing tags automatically ? see documentation automatic equation numbering . allows have equations numbered automatically rather requiring \tag . note numbered or tagged equation automatically gets id can used in link, there no requirement use \label (though helps if adding , removing equations during editing). if equation numbered 5, id mjx-eqn-5 . there functions can override in order change format of equation numbers. see equationnumbers section of tex con

How to execute device camera from main form to another form using Aforge direct show in C#? -

i have problem in executing device main form form use combo box select device, after select device main form click button open form, form has button start when click it, should start run camera without selecting device anymore because did in main form got exception saying. "object reference not set instance of object." this code other form. private void start_click_1(object sender, eventargs e) { if (start.text == "&start") { if (deviceexist) { frmmain cam = new frmmain(); videosource = new videocapturedevice(videodevices[cam.combobox1.selectedindex].monikerstring); // exception shows here! videosource.newframe += new newframeeventhandler(video_newframe); closevideosource(); videosource.desiredframesize = new size(160, 120); //videosource.desiredframerate = 10;

Spring Security with two LDAP servers -

out corporate network set different active directory / ldap servers, 1 server per each location. example: germany: ldap://ldapserver1.germany.corp.domain/dc=germany,dc=corp,dc=domain amerika: ldap://ldapserver2.america.corp.domain/dc=america,dc=corp,dc=domain as can find american users in american ldap server (to authenticate), have configure multiple servers multiple dc's. is possible configure such setup spring security ldap?

javascript - CKEditor 4 - How to set default font? -

i use ckeditor 4 , want set default font. added "font_defaultlabel" font choice doesn't work ... i found solution on internet it's trick me , not true solution : ckeditor.on( 'instanceready', function( ev ) { ev.editor.setdata('<span style="font-family:arial, verdana, sans-serif;">&shy;</span>'); }); can me? epokk you can use ckeditor's dataprocessor modify (for example) paragraphs choice font-size, font-family, affect paragraph entered ckeditor pasted, written or changed in source; this: ckeditor.on('instanceready', function( ev ) { ev.editor.dataprocessor.htmlfilter.addrules({ elements: { p: function (e) { e.attributes.style = 'font-size:' + fontsizevariable + 'px; font-family:' + fontfamilyvariable + ';'; } } }); }); same dataprocessor.datafilter but if intend view html created outside of environment, these rules might make real mess

.net - Modify the preferences of chrome with C# -

i developing application in c # modify file "preferences" of chrome. problem when want overwrite file ~users\"user"\appdata\local\google\chrome\user data\default\preferences for reason not rewritten, works fine. if delete file manually, file disappears. if application removes file reappears .. in manifest have declared <requestedexecutionlevel level="requireadministrator" uiaccess="false" /> what problem in file deleted , reappear, or may rewritten?

iphone - How do i scroll a UITable view down until i see a cell with label "Value" in Calabash -

how scroll uitableview down until see cell label "value" in calabash/cucumber . i've been trying using: swipe down until see "value" and using: scroll down until see "value" but none of them seem work. thanks! the message when try above obviously: you can implement step definitions undefined steps these snippets: then(/^i swipe down until see "(.*?)"$/) |arg1| pending # express regexp above code wish had end add step definitions then /^i scroll cell "([^\"]*)" label$/ |name| wait_poll(:until_exists => "label text:'#{name}'", :timeout => 20) scroll("tableview", :down) end end to projectname/features/step_definitions/my_first_steps.rb ruby file , in calabash script add then scroll cell "aaa" label its working fine me.

python - Creating if statements with floats -

i trying create conversion program automatically copies converted text windows clipboard. trying make if user inputs number taken out 2 decimal places or less copies converted results taken out 3 places clipboard. if user inputs number taken out 3 decimal places or more copies converted results clipboard taken out 4 decimal places. when run code valueerror cant figure out why. here error getting line 88, in con if float_number >= ("%.3f" % float_number): valueerror: incomplete format heres part of code thats giving me trouble(and put in comments explain things might missing guys/gals) def con(): while true: print("return = main menu, surface = ra conversion") print(mm_break) #this defined globally elsewhere number = (input()) if number in('return', 'return'): break elif number in('surface', 'surface'): surf() #i have def surf() elsewhere in program

knockout.js - Set knockout css binding based on item in observable array -

whenever save item remap model doing following: ko.mapping.fromjs(data, {}, deal); my model looks like: { "dealid": 0, "brokenrules": [ { "property": "enddate", "description": "end date required." }, { "property": "customerid", "description": "customer required." }, { "property": "livestate", "description": "live state required." }, { "property": "workstate", "description": "work state required." } } i want set css class on div based on contents of brokenrules array , hoping like: <div class="control-group" data-bind="css: { error: brokenrules.filterbyproperty('property', 'enddate').length !== 0 }"> <label class="control-label">end date</l

django - set field's initial value within haystack's FacetedSearchForm -

i using django-haystack solr backend in 1 of projects. have searchform inherits facetedsearchform . now, trying add intital value of fields within form. from django.forms import forms haystack.forms import facetedsearchform mysearchform(facetedsearchform): """ basic search form """ field_one = forms.charfield(required=false, initial='0') field_two = forms.charfield(required=false, initial='some_value') previously when using django.forms.form used work absolutely fine. have been digging around django code , haystack code , fond facetedsearchform extends haystack.forms.searchform extends django.forms.forms . can not see reason why should not work. references: haystack.forms.facetedsearchform django.forms.form i tried overriding __init__ method , thought set initial values there: def __init__(self, *args. **kwargs): data = kwargs.pop('data', none) if data: values = {

Nuget package restore -

i trying work out how nuget knows packages needs restore (and how knows find them) in case not present locally (i.e. when packages have not been committed source control). i can see in solution have .nuget directory contains nuget.exe. there's packages.config in each project, looks promising, contains following (shortened clarity); <?xml version="1.0" encoding="utf-8"?> <packages> <package id="automapper" version="2.2.1" targetframework="net40" /> </packages> i expecting see url pointing source of package. if nuget uses package id string, how know if had multiple package sources both list available same package id. through priority in package sources? i ask because have package local source, deleted packages , disabled package source, cleaned solution , rebuilt. worked when expected fail. many thanks. there 2 questions in post, i'll try address 1 one: how nuget knows packages

c# - How to access selected tab tabcontrol from another component class? -

i trying access(get) selected tab tabcontrol component class. want see tab pressed every time clicks on different one. i have component class embedded class has tabcontrol in it. thanks in advance if understand correctly, add event handler tab control's tabindexchanged event in other component class.

Powerpoint attaching a VBA function on a button -

i have found how create button , want make when press it following function. <-button-> sub addbutton() dim cb commandbar set cb = application.commandbars.add("additional_toolbar", msobartop, , true) cb.controls.add(msocontrolbutton) .caption = "click me" .onaction = "macro_name" .style = msobuttoncaption end cb.visible = true end sub <-action want perform-> sub copysizeandposition() ' usage: select 2 shapes. size , position of ' first shape selected copied second. dim w double dim h double dim l double dim t double activewindow.selection.shaperange(1) w = .width h = .height end activewindow.selection.shaperange(2) .width = w .height = h end end sub do u know how that? change: .onaction = "macro_name" to: .onaction = "copysizeandposition"

cordova - Android GCM Service Works on One Tablet but not Other -

i've encountered weird issue in android application. i'm using jquery mobile , cordova 2.4 gcm plugin found here: https://github.com/marknutter/gcm-cordova the odd part code works on nexus 7 running 4.2.2 on other, albeit worse, trio stealth pro tablet running 4.0.4, code not work @ all. receive no registration id gcm server when make request. here javascript code making calls: //cordova's deviceready callback function ondeviceready() { document.addeventlistener("backbutton", onbackkeydown, false); //setup gcm messaging usercontext.deviceready = true; window.plugins.gcm.register(my_project_number, "gcm_event", gcm_success, gcm_fail); } //called specified attribute in login.html <body onload="onload()"> function onload() { document.addeventlistener("deviceready", ondeviceready, false); document.addeventlistener("pause", function () { unregistergcm(); }, false); } i recieve errors applicat

E2E testing remote AngularJS application -

i'm trying realize e2e testing of existing angularjs application karma test runner . application located on host1.internal , i'm on host2.internal . in karma config file have: proxies = { '/': 'http://host1.internal/', }; before logging in shows different <div> 's inside of index.html , after logging in hides visible before divs ng-hide='loggedin' . problem partial view files being fetched <div ng-view> angularjs routing config that: $routeprovider. when('/', { controller: overviewcontroller, templateurl: 'views/overview.html', // templateurl: 'http://host2.internal/views/overview.html', title_prefix: 'home' }). etc. etc. etc. and these errors in browser's console: get http://localhost:9876/views/homepage.html 404 (not found) as can see in routing config code snippet, i've tried getting templates full url, unfortunately, request not simple get , it's op

Rails: Getting a Pluralize-able Translation Without a Count -

i have model translation can pluralized: en: activerecord: models: user: one: user other: users if call translation directly, these results: t("activerecord.models.user", count: 1) => user t("activerecord.models.user", count: 2) => users t("activerecord.models.user") => {:one=>"user", :other=>"users"} is there way last translation default "user"? if going pass count , other times not, should set separate keys them: counted_user: one: user other: users user: user t("activerecord.models.counted_user", count: 1) t("activerecord.models.counted_user", count: 2) t("activerecord.models.user") if default used in minimal circumstances don't warrant separate key, call directly: t("activerecord.models.user.one")

Drupal 7 - bulk reference nodes using entity reference fields -

i have 2 content types; publisher , campaign. when create campaign node, need use entity reference reference publishers work on campaign. have added reference entity field campaign content type however, need search , filter through publishers find ones in right category, bulk add them using kind of checkbox next each. idea how can this? thanks help it looks entity reference view widget module might looking for.

php - Get the URL of current script even if it's included? -

i have php script needs know it's url, if it's included within script. i've tried: $_server['request_uri'] but doesn't return uri script--rather, returns uri including script. i've tried: dirname ( __file__ ) but can't seem convert absolute url. can script find own url, if it's being included in script? help! i think can't, @ least not in robust , portable way. php encourages developers think url maps directly script, 1 may convinced each script s there's function(s) gives public url. unfortunately, not true. quick reference, think of mod_rewrite or chance script may requested reverse proxy. if need functionality, have design mistake, if tell problem (in terms of functionality, not implementation) may come right solution you.

excel - Read a value from spreadsheet X, compare adjacent values between spreadsheets X and Y -

i have macro based excel file generates list of items received , status (i.e. received, repaired, etc). program runs daily, , right have capture previous day's list , place in spreadsheet called previousdata before updating current day's list, placed in spreadsheet called data; used compare believe fixed/changed status on previous day. i'm self taught in vba, i'm not super efficient or experienced. want following: on data spreadsheet, grab order number starting in j2 switch previousdata spreadsheet, , search order number step 1 scenario a: if order number found on previousdata, compare status values next order number on both sheets; if differ, run code otherwise nothing scenario b: if order number not found on previousdata, nothing repeat until 1st blank cell encountered in data spreadsheet i did searching around interwebs , found (it might have been forum, actually) go row row , compare cell values, if scenario b came function fail "out of r

fortran90 - How to use Fortran 77 subroutines in Fortran 90/95? -

i'm writing code fortran 90 , need use special functions in the*amos fotran 77 library( http://www.netlib.org/amos/ ). found module interface routines( https://github.com/certik/fortran-utils/blob/master/src/amos.f90 ). my question is: how can combine them , use them in fortran 90 program , how compile them correctly? i have been struggling 1 whole day , still not figure out. the following test code: program test_zbesi use set_precisions use amos implicit none integer :: n, i, nz, ierr !double precision :: zr,zi, cyr(5), cyi(5) real(kind=dbl) :: zr, zi, cyr(5), cyi(5) n=5 zr=1.0_dbl zi=2.0_dbl call zbesi(zr,zi,0.0_dbl,1,n,cyr,cyi,nz,ierr) print *,' ' i=1, n write(*,10) i-1, cyr(i) write(*,11) i-1, cyi(i) end print *,' nz=', nz print *,' error code:', ierr print *,' ' 10 format(' zr(',i1,') = ',f10.6) 11 format(' zi(',i1,') = ',f10.6) end program test_zbesi the result got following: zr(0) =

java - I am getting a not a statement error -

i need figuring out doing wrong. here coding far. trying plot coordinates on circle. not statement error. public class mathclass { public static void main (string [] args) { double y1; double y2; system.out.println("points on circle of radius 1.0"); system.out.printf ( "%6s" , "x1", "y1", "x1" , "y2"); system.out.println ("----------------------------------"); (double x1 = 1.00; x1> -1.10; x1 + -0.10) { double x1sq= math.pow(x1,2); double r = 1; double y1sq = r- x1sq; y1= math.sqrt(y1sq); system.out.printf( "%.2f", x1, " ", y1); } } your problem on line 10 of code posted. issue x1 + -0.10 expression, not statement (hence "not statement" error you're getting). want x1 += -0.10 instead. or, more clear it, use -= instead of adding negative, whole loop condition looks this: for (

forms - Newbie Django filter uniques 2 many values -

i trying filter uniques list form: class specform(modelform): = doctors_list.objects.values_list('specialty', flat=true) unique = {z: i, z in a} qs = doctors_list.objects.filter(id__in=unique.values()) specialty = forms.modelchoicefield(queryset=qs) class meta: model = doctors_list everything seems correct me, error: too many values unpack any hints? i think correct statement should this: unique = {z: in a} are trying put values dictionary? yield list: unique = [ in ] if go this, have remove .values() in qs = doctors_list.objects.filter(id__in=unique.values()) leaving this: qs = doctors_list.objects.filter(id__in=unique) what's going on here brackets in first approach you're creating dictionary 1 key , list value of key. when issue .values() list dictionary's values. it's pointless use dictionary. with second approach list directly. hope helps.

jersey - Checking Principal-user by Injected SecurityContext inside the constructor of a web resource -

i'm relatively new jersey , jax-rs, can't find way in documentation use of securitycontext inside constructor of resource. our oauth implementation such requests on rest api intercepted implementation of resourcefilter. resource filter sets user principal calling: containerrequest.setsecuritycontext(new mysecuritycontext(user)); ... inside containerrequest.filter() method, wwith concrete class mysecuritycontext, as: public class mysecuritycontext implements securitycontext { private final user principal; public mysecuritycontext(final user user) { this.principal = user; } @override public string getauthenticationscheme() { return securitycontext.form_auth; } @override public principal getuserprincipal() { return principal; } @override public boolean issecure() { return false; } @override public boolean isuserinrole(string role) { return principal.getroles().contain

android - how to disable viewpager adapter on touching specific views? -

i have viewpager switches between tabs when swiping left/right.in second tab, have custom views have listeners pinching , dragging when try pinch or drag, viewpager starts swipe page. a solution comes mind disable swiping when touching specific views , swipe when touching outside views.is possible? updated: @asok kindly provided solution. updated code wouldnt work in case post previous piece of code worked me: public class customviewpager extends viewpager { private boolean swipeable = true; public customviewpager(context context) { super(context); } public customviewpager(context context, attributeset attrs) { super(context, attrs); } // call method in motion events when want disable or enable // should work desired. public void setswipeable(boolean swipeable) { this.swipeable = swipeable; } @override public boolean onintercepttouchevent(motionevent arg0) { return (this.swipeable) ? super.onintercepttouchevent(arg0) : false; } lets suppose have draggab

Winforms to WPF, measure text width(Graphics.MeasureCharacterRanges) -

we trying measure width of text, displayed (not number of characters). in winforms there method called grapihcs.measurecharacterranges. in wpf, formattedtext.widthincludingtrailingwhitespace. while seem these give same value, don't. why not? graphics.measurecharacterranges, can't pullin winforms, 1 method. wpf app. we using following utility class perform simple text measurements in wpf: public static class textutilities { public static size measuretext(string text, fontfamily family, double size, fontstyle style, fontweight weight, fontstretch stretch, textformattingmode formattingmode) { formattedtext formattedtext = new formattedtext( text, cultureinfo.currentculture, flowdirection.lefttoright, new typeface(family, style, weight, stretch), size, brushes.black, null, formattingmode); return new size(formattedtext.width, formatted

html - How to attach bargraph bars to bottom without fixed height -

Image
i trying make bar graph show visitor stats, cannot figure out how attach bars bottom without knowing exact height. height in % , it's different every time check cannot set fixed height. my code is: css: #graph { width: 447px; height: 250px; border: 1px solid #aeaeae; background-image:url(css/bargraph.png); background-repeat:repeat; border-top-left-radius:5px; border-top-right-radius:5px; position: relative; } #graphtext { padding-left:17px; width: 430px; height: 20px; background-color:#ccc; font-size:9px; border-bottom-left-radius:5px; border-bottom-right-radius:5px; } .bartext { width: 10%; margin-right: 17px; display: inline-block; height:20px; text-align:center; margin-top:5px; } #bar { width: 10%; display: inline-block; margin-right:17px; background-image: linear-gradient(bottom, rgb(0,240,84) 0%, rgb(0,187,255) 68%); background-image: -o-linear-gradient(bottom,

alert - How to get the content of a hidden sibling-div to a button - JQuery related -

maybe i've searched poorly, far have not found answer question. first code of javascript function: <script> function showcomment(){ var $data = $(this).parent("td").contents("div.hiddencomment").text(); console.log($data); alert($data); return false; } </script> i've included the html code i'm working on below. <table> , , in 1 <td> there <button> , hidden <div> . content of <div> should presented in alert/dialog box. <table class="center"> <thead> <tr> <th>status</th> <th>datum</th> <th>zeit</th> <th>amount</th> <th>source</th> <th colspan="2">comment</th> </tr> </thead> <tbody> <tr> <

php - Chrome Cron Job on Windows -

i wonder if there way setup cron job on google chrome run every 2nd hour , when cron complete, automatically closes window? i have cron job setup go cron page using windows task scheduler, although window isn't closed when rdp server has quite few windows opened using ram on server. so real question is, how make google chrome close when cron complete? thanks in advance. regards, tom. you can kill running process in windows using command line: taskkill /im <process name> eg: taskkill /im chrome.exe close running instance of google chrome. guess can run command @ end of task.

drag and drop - Framework required for a dynamic IVRS application generator -

can tell me framework 1 should use designing ivrs generator app dynamically generate ivrs using drag , drop method? have build app compatible microsoft-xp machine. take @ open source project called voicemodel . uses asp.net mvc , c# generate voicexml . voicexml web-based standard modern ivr's use there programming language define voice/speech application. voicemodel supports voxeo's cloud based ivr called tropo . there numerous examples in project including couple show how use database store meta-data dynamically create voice application. handle portion of application generating dynamic voicexml during runtime. without knowing requirements behind development environment creating suggest looking @ html 5 portion graphical design of application. allow users develop , deploy in saas work on os, including microsoft xp, microsoft stop supporting soon. if going take of effort build 1 of these development environments scratch should not lock 1 type of environment.

bash - Script that uses variable username in find command -

i'm trying write script lists absolute paths of of given user's home files , directories, recursively, , writes of them array. currently, i'm using find ... user="foobar" usershomefiles=( $(find ~$user -printf "%p\\n") ) however, when execute script tells me ... find: `~foobar': no such file or directory even though foobar valid user home directory. same error running user="root" . ideas how fix find command works in script? this happens because in bash "tilde expansion" happens before "parameter expansion". tilde expansion attempts find user "$user", fails , tilde remains unchanged. next comes "parameter expansion" substituting "$user" "foobar". see bash(1) "expansion" section. one way "eval", this: user_home=`eval "echo ~$user"` another directly querying passwd database, this: user_home=`getent passwd "$user"

c - srand() is not working below initialization of array randomly -

below gives me 42 size. wanted randomise size srand(time(null)) not working because below randomisation of size. when try add before randomization of size, compiler yells @ me. have ideas how correct it? int i,numbertobefound; int size=(rand()%100)+1; // size can in range [1 100] int *array2 = (int*) malloc(sizeof(int)*size); srand(time(null)); for(i=0;i<size;i++) //fill array random numbers array2[i]=rand()%100; you need call srand() before call rand() initialize random number generator. you can try srand( time( null ) ) give different result once per second. if need more variable that, have come better way seed number generator. int i,numbertobefound; int size; int *array2; srand( time( null ) ); size=(rand()%100)+1; // size can in range [1 100] array2 = malloc(sizeof(int)*size); for(i=0;i<size;i++) //fill array random numbers array2[i]=rand()%100; ps: should not cast malloc() in c -- see this post .

mysql - getting latest timestamp from 2 joined tables for each row output in select statement -

i have 3 tables shown below. want list of member names, ids, latest activity time each of them, given particular member name search term. this 'latest activity time' latest time comparing both game_record , eating_record tables. the desired output given below. member_info table: name m_id ---- ---- john 1 doe 2 johnson 3 game_record: time_of_activity game_id m_id ---------------- ------- ----- 2013-01-20 23:01:00 1 3 2013-01-20 23:01:07 4 1 2013-01-20 23:01:06 1 2 2013-01-20 23:01:05 3 1 eating_record: time_of_activity food_id m_id ---------------- ------- ----- 2013-01-20 23:01:04 1 1 2013-01-20 23:01:03 4 1 2013-01-20 23:01:02 1 2 2013-01-20 23:01:01 3 3 desired output when search term 'john': name m_id latest_time ---- ---- ----------- john 1 2013-01-20 23:01:07 johnson 3

google maps - GIS Political Townships Layer -

is possible obtain political townships gis layer used in google maps? example, if search "guilford township illinois" highlights outline of township. have searched online cannot find it. different plss townships. thank you. the place can think of data straight census. have here: ftp://ftp2.census.gov/geo/tiger/tiger2008/17_illinois/17085_jo_daviess_county/ . file you're looking tl_2008_17085_cousub.zip. guess cousub stands county subdivision, since civil township subordinate county if i'm not mistaken.

sql server 2005 - There is already an open DataReader associated with this Command which must be closed first SQL Reporting Services -

i getting 'already open datareader associated command must closed first'. have enabled mars still error. i'm using sql server 2005 , i'm doing within report. below code: insert [ins data collection files].dbo.[orders missing seats] (insuser,ordernumber, reference, seat, processdate) (select distinct 'frc16',[ins data files].dbo.[mes queue detail].ordernumber, [ins data files].dbo.[mes queue detail].reference, [ins data files].dbo.[mes serial parts].partnumber, [ins data files].dbo.[mes queue detail].processcompletetime [ins data files].dbo.[mes serial parts] inner join [ins data files].dbo.[mes queue detail] on [ins data files].dbo.[mes serial parts].insuser = [mes queue detail].insuser , [ins data files].dbo.[mes serial parts].serialnumber = [ins data files].dbo.[mes queue detail].serialnumber ([mes serial parts].insuser = 'frc16' , [mes queue det

c++ - How to test lvalue or rvalue in this case -

the code following: struct a { static int k;   int i; };   int a::k = 10;   a func() { a a; return a; } my question is, how can tell whether func().k or func().i lvalue or not? if both lvalues/rvalues, how can test them? func().k = 0; // compile ok under g++-4.4 , g++-4.6 func().i = 1; // compile ok g++-4.4, g++-4.4 gives error: //"using temporary lvalue [-fpermissive]" func().k lvalue , func().i xvalue. you can see more details: rvalues , temporary objects in fcd althrough, not difficult test whether lvalues or rvalues: #include <iostream> struct { static int k; int i; }; int a::k = 10; func( ){ a; return a; } void f (int & ) { std::cout << "int& " << std::endl; } int main () { func().k = 0; //ok, because func().k r f(func().k); func().i = 1; //compile error: "using temporary lvalue" f(func().i); //compile error because func().i rvalue of type ‘int’

c++ - Drawing a Texture to the Screen -

i attempting learn directx, , feeling quite overwhelmed. can tell me why not working? image not display screen. window black. trying follow along tutorial this, , code had. #include <windows.h> #include <d3d9.h> #include <d3dx9tex.h> lpdirect3d9 direct3d = null; lpdirect3ddevice9 direct3ddevice = null; idirect3dtexture9* texture; lresult winapi wndproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam); idirect3dtexture9 *loadtexture(wchar_t *filename); void blitd3d (idirect3dtexture9 *texture, rect *rdest, d3dcolor vertexcolour, float rotate); int winapi winmain(hinstance hinstance, hinstance hprevinstance, lpstr lpcmdline, int nshow) { msg msg; wndclassex wc = {sizeof(wndclassex), cs_vredraw|cs_hredraw|cs_owndc, wndproc, 0, 0, hinstance, null, null, (hbrush)(color_window+1), null, l"dx9_tutorial1_class", null}; registerclassex(&wc); hwnd hmainwnd = createwindow(l"dx9_tutorial1_class", l"directx 9 bare bones tutoria

javascript - How to make TinyMCE to fit content height when it's read only? -

please because i'm stuck hours. have multiple count of text areas in 1 page. each text area has different content inside makes different height. when init tinymce this: tinymce.init({ mode: "textareas", theme: "advanced", width: "870", readonly: true, theme_advanced_path: false, theme_advanced_resizing: true, theme_advanced_resize_horizontal: false, auto_resize: true }); all text areas same height , of them have more content has scroll inside. ideas how rid of scrolls , make text area height as content inside ? have @ function resizeiframe in this thread . need issue code after readonly editors have been initialized.

jquery - Where can I convert JSON date format when data from WCF ajax call? -

i getting json data wcf service below format. binding data handsontables. json {"d":[ { "__type":"initdata:#company.reductiondata", "owner":"test9", ... ... "startdate":"\/date(1366848000000+0000)\/", "risks":"test9", }] } jscript $(function () { var $value = $("#body_hiddenclientid"); // alert($value.val()); var $container = $("#datatable"); $container.handsontable({ contextmenu: true, startrows: 1, minrows: 1, colheaders: true, stretchh: 'all', columns: [ { data: 'owner' }, ... .... { data: 'startdate', type: 'date', dateformat: 'mm/dd/yy' }, { data: 'risk' }