Posts

Showing posts from August, 2014

ruby on rails - Failed Deploy Apps to Heroku -

i'm trying push rails apps heroku, first create heroku account , on command prompt git init git add . git commit -m "init" heroku login , push ssh heroku create mycvdemo git push heroku master c:\sites\mycv>git push heroku master counting objects: 253, done. delta compression using 4 threads. compressing objects: 100% (228/228), done. writing objects: 8% (21/253), 208.00 kib | 3 kib/s but i'm getting error : c:\sites\mycv>git push heroku master counting objects: 253, done. delta compression using 4 threads. compressing objects: 100% (228/228), done. write failed: connection abortedib | 3 kib/s fatal: sha1 file '<stdout>' write error: invalid argument error: failed push refs 'git@heroku.com:mycvdemo.git' i getting error when 8% writing object. not sure if problem, you're missing step here: git init git add . git commit -m "init" git push origin master heroku login , push ssh heroku ...

java - Conditional List Looping in JasperReport -

if size of list greater 2, there attachment(another template) file list. <![cdata[$p{policyinsuredpersonbeneficiarieslist}.size() < 3]]> report : <parameter name="policyinsuredpersonbeneficiarieslist" class="java.util.list"/> ..... <componentelement> <reportelement uuid="e7c57647-5643-443f-bc07-c0e4ff6c5392" x="124" y="412" width="140" height="18" isprintwhendetailoverflows="true"> <printwhenexpression><![cdata[$p{policyinsuredpersonbeneficiarieslist}.size() > 2]]></printwhenexpression> </reportelement> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printorder="vertical" ignorewidth="false"> <da...

c++ - C++11 searching a vector of objects -

i have 2 vectors std::vector<myobj> v; std::vector<myobj2> z; the objects in vectors both contain int has id. want see if when looking through v has matching id in z so thought use `std::find_if , lambda. for (int i=0; < _z.size(); i++) { myobj2 _g = _z.at(i); auto iter = std::find_if(v.begin(), v.end(), [this](myobj o) { if (o.getid() == _g.getid()) { std::cout << "we have match" << std::endl; } else { std::cout << "we not have match" << std::endl; } }); } but getting error dont understand. 43: member function 'getid' not viable: 'this' argument has type 'const myobj2', function not marked const i dont understand has marked const , why? an needing in .hpp?: myobj2& operator= (const myobj2&); myobj2& operator== (const myobj2&); from cppreference find_if : un...

asp.net - partial postback creating mutliple instances of jquery -

after partial post getting 4 instance of jquery plugin , i not able replicate how being done <div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all" style="width: 427px;"> <div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all" style="width: 427px;"> <div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all" style="width: 427px;"> <div class="ui-multiselect-menu ui-widget ui-widget-content ui-corner-all" style="width: 427px; top: 100px; left: please kind of stuck on 3 days you try removing old 1 , recreate new one. or use if condition check existing of block. if null create block. things happen in asp.net because of page refresh.. in updatepanel

java - why the "${}" tag in jsp output as a string -

i want import js file in jsp way <script type="text/javascript" src="${pagecontext.request.contextpath}/js/layout/jquery-ui.js"></script> but when browse deployed page ,i found ${pagecontext.request.contextpath} part showed on browsers string,the code above try find js file in ${pagecontext.request.contextpath}/js/layout/ folder instead of xxx/js/layout/ my developing environment "myeclipse10.5+tomcat7.0+jdk7.0" check jsp isn't configured ignore el page directive <%@ page ... iselignored="true" %> or, check web.xml hasn't turned el off jsps with <jsp-config> ... <el-ignored>true</el-ignored> ... </jsp-config> edit : also, check web.xml 's <web-app> version 2.4 or higher. add following web.xml workaround (if nothing else works) : <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <el-ignored...

d3.js - D3 show text for nodes when zoomed -

Image
the number of nodes in d3 graph large. built zoom mechanism in graph. problem is, cannot display text each nodes since overlap each other. when zoom in nodes, space enough display texts. so how show texts when space enough show of them without overlapping? i have had same problem in past. unfortunately optimal label placement not easy problem. mitigate overlap effects 1 option use restricted force layout label placement . can try using callouts allow labels move farther away nodes. in past have implemented sort of greedy collision detection based algorithm goes like: sort labels in decreasing priority each label in list // important first if label not overlap placed labels place label , add collision data structure (e.g. quad tree) else hide label obviously have non-optimal cases , can slow if have lot of animations going on. when have option zoom in see more label , if absolute number of labels not high works quite well. there number of o...

how to override filters configured in a java file? -

i writing plugin nexus oss , need use new filter instead of filter prescribed in nexus oss . in earlier versions of nexus oss ,all filters defined in web.xml follows <filter> <filter-name>nexusfilter</filter-name> <filter-class>org.sonatype.nexus.security.filter.nexusjsecurityfilter</filter-class> <init-param> <param-name>config</param-name> <param-value> [filters] authcbasic = org.sonatype.nexus.security.filter.authc.nexussecurehttpauthenticationfilter authcbasic.applicationname = sonatype nexus repository manager api authcbasic.fakeauthscheme = false authcnxbasic = org.sonatype.nexus.security.filter.authc.nexussecurehttpauthenticationfilter authcnxbasic.applicationname = sonatype nexus repository manager api (specialized auth) authcnxbasic.fakeauthscheme = true so used modify web.xml take our filter instead of nexussecurehttpauthenticationfilt...

backbone.js - How to properly use Marionette layouts? -

my current code looks this: define([ 'jquery', 'underscore', 'backbone', 'marionette', 'templates', 'gridview', 'detailview', 'detailmodel' ], function ($, _, backbone, marionette, jst, gridview, detailview, detailmodel) { 'use strict'; return marionette.layout.extend({ el: '#main', template: jst['app/scripts/templates/main.ejs'], initialize: function() { this.render(); }, onrender: function () { var layout = marionette.layout.extend({ el: 'div', template: _.template(""), regions: { grid: '#grid', detail: '#detail' } }); this.layout = new layout(); this.layout.render(); }, showgrid: function () ...

storage - How to get notified of updates on the Android filesystem? -

specifically looking way update current view of app (which displays media files) based on whether new files added or deleted in background, or when app in paused state. the way know of query mediastore , check count of returned tuples, , recreate whole view if counts different. ofcourse has caveats. is there way can establish call-back when type of files written or removed directory ? tia on linux, people use inotify achieve goal, and in android, can use fileobserver: see ref here: http://www.roman10.net/android-fileobserverthe-underlying-inotify-mechanism-and-an-example/ android file system hooks

css - How do I place <a>-block into right-bottom angle of current <div>? -

i have <div> news , need place author right-bottom corner. i tried use <a href="..." style="position: relative; right: 0; bottom: 0;">autnor name</a> but isn't working. i have not more ideas it. thanks there 3 position types @ play here: static, relative, , absolute. all elements default static. absolute elements positioned relative closest parent isn't statically positioned. why people position element "relative" without intending change position. so, in case, #b positioned relative body (well document, technically). <body> <div id="a"> <div id="b" style="position: absolute"></div> </div> </body> in case, #b positioned relative #a . <body> <div id="a" style="position: relative"> <div id="b" style="position: absolute"></div> </div> </body...

sql - how to do lag operation in mysql -

guys want use analytical function lag in mysql. in oracle supported can't in mysql. can me how perform lag operation in mysql? example uid operation 1 logged-in 2 view content 3 review i want use lag function output follows uid operation lagoperation 1 logged-in 2 view content logged-in 3 review view content does mysql support lag function??? you can emulate user variables: select uid, operation, previous_operation ( select y.* , @prev previous_operation , @prev := operation your_table y , (select @prev:=null) vars order uid ) subquery_alias see working in sqlfiddle live here initialize variable(s). it's same writing set @prev:=null; before writing query. , (select @prev:=null) vars then order of ...

validation - Java - validate operator -

i written below program, confused on part b of question. question is- write program evaluate simple expressions such 17 + 3 , 3.14159 * 4.7. expressions typed in user. input consists of number, followed operator, followed number. operators allowed +, -, *, , /. not required perform data validation here done in part (b) below. program output must show expression entered result (e.g. 17 + 3 = 20). part b: modify program in part (a) above validate operator entered. program repeats input until valid operator entered. required make use of method validation. here's wrote import java.util.scanner; public class javacalculator { public static void main(string[] args) { scanner console = new scanner(system.in); double digit1; double digit2; double total; string operator1; system.out.print("enter 1st number: "); digit1 = console.nextdouble(); system.out.print("enter operator: "); operator1=...

How to find Chrome download path in Java -

i'm trying write test webdriver using chrome browser, want download file, when click download link, file being downloaded automatically download folder. wondering if there way find out current path of download folder (win / linux) there configuration file chrome keep settings ? thans google chrome maintaining 1 config file such custom configuration named preferences in json format.so have read file.you current path of download folder file. "download": { "default_directory": "current_path_of_your_download_folder", "directory_upgrade": true, "extensions_to_open": "", "prompt_for_download": false }, parsing json file java read file. location of configuration file in linux is /user_home_folder/.config/chromium/default/preferences , in windows is c:\users\user_account\appdata\local\google\chrome\user data\default\preferences

Python Help - Learn Python The Hard Way exercise 41 "phrase = PHRASES[snippet]" -

i learning python - first programming language learning. little confused 1 line of code. full code can found @ http://learnpythonthehardway.org/book/ex41.html import random urllib import urlopen import sys word_url = "http://learncodethehardway.org/words.txt" words = [] phrases = { "class %%%(%%%):": "make class named %%% is-a %%%.", "class %%%(object):\n\tdef __init__(self, ***)" : "class %%% has-a __init__ takes self , *** parameters.", "class %%%(object):\n\tdef ***(self, @@@)": "class %%% has-a function named *** takes self , @@@ parameters.", "*** = %%%()": "set *** instance of class %%%.", "***.***(@@@)": "from *** *** function, , call parameters self, @@@.", "***.*** = '***'": "from *** *** attribute , set '***'." } # want drill phrases first phrase_first = false if len(sys.argv) == 2 , sys.argv[1] == ...

php - Mysql Database & drop-down List -

i want create database entry screen minimal programming. far phpmyadmin tool job except not offer options such drop-down lists on fields values populated table. there secure tool out there offers simple operations (preferably written in php , customizable). thanks if mean foreign keys, can below : convert both tables innodb, if not already. view structure of table have foreign key. make referencing field index. now come structure view , click relation view. you can see more details in here

php - How to optimize jquery chosen plugin for loading more than 50k results -

i using class 'chosen-select' loading product names.when user clicks on product_select , takes lot of time load.what can done improve performance. <select class='chosen-select' data-placeholder="choose product..." id="product_select"> <option></option> <?php include 'connection.php'; $query = "select * " . $table_name; $result = mysqli_query($con, $query); $results = array(); while ($line = mysqli_fetch_assoc($result)) { $results[] = $line; } $i = 0; foreach ($results $r) { $i++; echo "<option value=" . $r['id'] . ">" . $r['product_name'] . "</option>"; } ?> </select> <script> $('#product_select').chosen({max_selected_options: 1});...

How to Stop css for particular Page in Joomla? -

this question has answer here: joomla! 3.1, remove bootstrap 2 answers i want stop media/jui/css/bootstrap.min.css particular page in joomla 3.1, because insert css files in it,but same page following bootstrap.min.css. please stop bootstrap.min.css you remove link unwanted css file in head of html document keep importing. cascading style sheets called partly because multiple sheets can imported , declaration highest priority used. complete definition of levels of precedence css can found in css tutorial. one way own style sheet take precedent on standard template import after template css imported joomla. way, according order of precedence, style sheet declared rule , should execute on other one. able make changes care without over-riding rest of template. to more situation specific answer, helpful if tell have tried or include code. on other han...

logging - What is scope type for "cloud-storage-analytics@google.com"? -

i have been trying set access logs bucket using google cloud service. creating logs in target bucket , need update acl of target bucket write permission google cloud account - "cloud-storage-analytics@google.com" i have added email address on target bucket, has been added via " groupbyemail " , " userbyemail " scope type successfully. please clarify scope type correct add email address on target bucket. how time take create logs? thanks, neelam sharma it's group. use groupbyemail . here's example of valid setting it. <entry> <scope type="groupbyemail"> <emailaddress> cloud-storage-analytics@google.com </emailaddress> </scope> <permission> write </permission> </entry> access logs generated on hourly basis, , storage logs generated on daily basis.

iphone - How to display a PBFrame in iOS -

i working on app uses live stream ip camera(pnp ip/network camera manufactured v star). when connected using api provided frame o/p pbframes. having trouble displaying them. have been through please help. in advance void *thread_receivevideo(void *arg) { nslog(@"[thread_receivevideo] starting..."); int avindex = *(int *)arg; char *buf = malloc(video_buf_size); unsigned int frmno; int ret; frameinfo_t frameinfo; while (1) { ret = avrecvframedata(avindex, buf, video_buf_size, (char *)&frameinfo, sizeof(frameinfo_t), &frmno); if(ret == av_er_data_noready) { usleep(30000); continue; } else if(ret == av_er_losed_this_frame) { nslog(@"lost video frame no[%d]", frmno); continue; } else if(ret == av_er_incomplete_frame) { nslog(@"incomplete video frame no[%d]", frmno); nslog(@" biffer : %lu",sizeof(buf)); continue; } else if(ret == av_...

java - What is the difference between String. and String.this. ? -

this question has answer here: meaning of .this , .class in java 2 answers i'll straight point. im still learning bit of syntax , want know difference between code is code a: public class buttonz extends jbutton{ public buttonz(){ settext(new string(string.valueof(i))); } } please ignore fact i undeclared, not lost. code b: public class buttonz extends jbutton{ public buttonz(){ settext(new string(string.this.charat(i))); } } what don't yet understand difference in typing string.this , string. i under assumption when use dot operator on class accessing it's static methods(and/or variables if they're not hidden). i have studied little bit , have concluded when using string. accessing string static methods.. when using string.this. i'm accessing methods class buttonz extendi...

c# - How to know a specific checkbox inside datagridview is checked or not? -

Image
i had gridview has 2 columns , 1 textbox column , other checkbox column, how know checkbox checked . as shown in image ,suppose of checkbox checked , want display corresponding text box value checkbox. can me?i tried below code , problem facing , values getting displayed once clicked next checkbox checked checkbox values getting displayed.. datagridview1.cellvaluechanged += new datagridviewcelleventhandler(datagridview1_cellvaluechanged); void datagridview1_cellvaluechanged(object sender, datagridviewcelleventargs e) { object tempobj = datagridview1.rows[e.rowindex].cells[1].value; datagridview1_currentcelldirtystatechanged(sender, e); if (((e.columnindex) == 1) && ((bool)datagridview1.rows[e.rowindex].cells[1].value)) { messagebox.show(datagridview1.rows[e.rowindex].cells[0].value.tostring()); } } private void datagridview1_currentcelldirtystatechanged(object sender, eventargs e) { ...

ruby - Test file initialization based off template using ChefSpec -

i've got following template file creation in cookbook: template "my_file" path "my_path" source "my_file.erb" owner "root" group "root" mode "0644" variables(@template_variables) notifies :restart, resources(service: "my_service") end and following assertions in chefspec tests: chef_run.should create_file "my_file" chef_run.file("my_file").should be_owned_by('root', 'root') which results in following failure: no file resource named 'my_file' action :create found. this due fact not using a file resource template resource. question: how can test file creation off template resource using chefspec? there 2 ways solve problem. first, can use create_template matcher. match "template" resources in run context: expect(chef_run).to create_template('my_file') this matcher chainable, can assert attributes: e...

why does io:get_line return "\n" in erlang shell? -

when using io:getline("prompt") in erlang shell , function returns return value of "\n" io:get_line("prompt"). prompt "\n" but suggested in thread doing following reads standard_io correctly. spawn(fun() -> timer:sleep(100),io:get_line("prompt") end). waits user input , reads standard io (shell). mentioned race condition . can tell me why , how possible read value erlang shell ? io:get_line/1 , io:get_line/2 returns data \n every time. get_line(prompt) -> data | server_no_data() where: data the characters in line terminated lf (or end of file). if io device supports unicode, data may represent codepoints larger 255 (the latin1 range). if i/o server set deliver binaries, encoded in utf-8 (regardless of if io device supports unicode or not). in first case got \n , , try result of io:get_line in second case: spawn(fun() -> timer:sleep(100), result = io:get_line(...

javascript - how can I use functions as well as variables in the expression for ng-options in Angularjs -

i have 2 select boxes, 1 choose user type (e.g. groups or individual) , 2nd out put of 1st 1 display options choose user/group. there anyway in expressions ng-options pass function instead of variable : ng-options="user.id user.description user in getuserlist(usertype)" where usertype ng-model of first select box i'm under impression own trials not possible (seem's crash the current tab in chrome , entire application in firefox). what best approach this. have lot of selects use kind of 2 select box setup nice if avoid copying , pasting. depending on data, simple as: <select ng-model="type" ng-options="type type in types"></select> <select ng-model="user" ng-options="user.name user in users[type]" ng-if="type != 'skipped'"></select> with: app.controller('appctrl', ['$scope', function($scope) { $scope.types = ['group', 'individual...

cloudflare - Is there a Free or Opensource software like Cloud-Flare DNS ? -

is there free or opensource software cloud-flare dns ? example if mywebsite.com 's server unreachable show custom page . while biased because work cloudflare, free plan include always online & i'm not aware of services ours offer similar. may ask why wouldn't use us?

c++ - Cocos2d replaceScene not releasing the old scene -

i have box2d-cocos2d game has several levels. levels layers use box2d features inherited class. example first layer looks like: level1layer : box2dlevel : box2dlayer : cclayer : ccnode : nsobject my problem layer not releasing when should.for example if replay level code: [[ccdirector shareddirector] replacescene:[cctransitionfade transitionwithduration:0.5f scene:[[self class] node]]]; then memory footprint increases.the same thing happens if have circle menu -> level 1 -> menu -> level 1 , app crashes after time because insufficient memory.i tracked dealloc methods nslogs, every dealloc method called, when replace scene. log looks like: *** dealloc ***<level1layer = 0x1cdcfe70 | tag = -1> 2013-08-26 12:05:57.089 myapp[6334:907] ***box2dlevel dealloc ***<level1layer = 0x1cdcfe70 | tag = -1> 2013-08-26 12:05:57.093 myapp[6334:907] ***box2dlayer dealloc *** <level1layer = 0x1cdcfe70 | tag = -1> i'm stuck, because on iphone 4 after playing...

objective c - iOS : Is there any way to test .ipa file in multiple device without jailbreak? -

i created .ipa file using ad-hoc app in testing phase. want send .ipa file friend in other country test app, due company policies, cannot jailbreak device. how make .ipa file can executed in ios device? generated .ipa file xcode 4.6 why don't register friend's device member center , add ad-hoc distribution certificate? re-distribute it. here information need : https://developer.apple.com/library/ios/documentation/ides/conceptual/appdistributionguide/testingyouriosapp/testingyouriosapp.html

mysqlbinlog - Need advice on binary logs? -

we have set master slave configuration , storing bin logs of 30 days. taking more space on server , need find better way handle it. we thinking store logs of 7 days only. ok. yes, that's how it. make sure full-database backup every 7 days, , rsync or copy binlogs off-site location more frequently.

php - Display recaptcha error message on the same page -

i've got 2 pages. page 1 has form posts values page 2 page 2 has following: if (!$resp->is_valid) { // happens when captcha entered incorrectly die ("the recaptcha wasn't entered correctly. go , try again. " . "(recaptcha said: " . $resp->error . ")"); } else { instead of display die output on page 2, how display value or more appropriate value on page 1 under recaptcha control? you make on page 1 if (isset($_post['submit')){...} block. in block check recaptcha , echo "" error message.

eclipse - Jar issue while deploying a war -

well have application building using maven , running on eclipse(tomcat runtime) , working fine. when deploy war of project on tomcat (not using eclipse), failing. error due coustome jar have included. stack trace follows:- aug 26, 2013 3:18:16 pm org.apache.catalina.core.standardcontext startinternal severe: error in dependencycheck java.io.ioexception: jar: smartcharging-model.jar @ org.apache.catalina.util.extensionvalidator.validateapplication(extensionvalidator.java:207) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5256) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.manager.managerservlet.start(managerservlet.java:1256) @ org.apache.catalina.manager.htmlmanagerservlet.start(htmlmanagerservlet.java:714) @ org.apache.catalina.manager.htmlmanagerservlet.dopost(htmlmanagerservlet.java:219) @ javax.servlet.http.httpservlet.service(httpservlet.java:647) @ javax.servlet....

javascript - How to use scope variables as property names in a Mongo Map/Reduce emit -

there question (and answer) deals general case. having difficulty using scope variable field key (as opposed field value) in example below fully_caps fields scope variables. in case of service , identifier emit correctly uses value of scope variable passed m/r. however when try use value of scope variable key in emitted document, document created scope variable name (as opposed it's value). return emit({ service: service, date: _this.value.date, identifier: _this.value[identifier] }, { errors: { count: 1, type_breakdown: { singles_only: { count: 1 } } } }); is there way around problem? when using shortcut syntax creating objects in javascript, left hand side/property name interpreted literal value, regardless of quotes. for example: var d={ name: "aaron" } is equivalent to: var d={ "name" : "aaron" } as there 2 ways set property value: obj.propertynam...

python - How to specify upper and lower limits when using numpy.random.normal -

Image
iok want able pick values normal distribution ever fall between 0 , 1. in cases want able return random distribution, , in other cases want return values fall in shape of gaussian. at moment using following function: def blockedgauss(mu,sigma): while true: numb = random.gauss(mu,sigma) if (numb > 0 , numb < 1): break return numb it picks value normal distribution, discards if falls outside of range 0 1, feel there must better way of doing this. it sounds want truncated normal distribution . using scipy, use scipy.stats.truncnorm generate random variates such distribution: import matplotlib.pyplot plt import scipy.stats stats lower, upper = 3.5, 6 mu, sigma = 5, 0.7 x = stats.truncnorm( (lower - mu) / sigma, (upper - mu) / sigma, loc=mu, scale=sigma) n = stats.norm(loc=mu, scale=sigma) fig, ax = plt.subplots(2, sharex=true) ax[0].hist(x.rvs(10000), normed=true) ax[1].hist(n.rvs(10000), normed=true) plt.show() the ...

sql - Update existing records table with ID of foreign key table -

Image
i have following tables: and i added [history table id] column , added foreign key reference history table. has happen is, value of [history table id] column has updated id value of history table. have been able right 2 entries, entries have id of diary table in description column of history table. query below accomplishes that: update diary set [history table id] = history.id history (nolock) [lookup table ha] = 7 , [lookup table has] = 19 , description 'diary item (%' , patindex('%)%', description) > 13 , dairy.id = substring(description, 13, patindex('%)%', description)-13) is there way rest can updated @ all? can't head around this. thanks in advance. update: please see below updated table shots: problem in updating , joining lies: as have mentioned in comment, "issuenumber same. globalid same in both tables." work fine: update diary set [history table id] = history.id history (nolock) ...

c# - Facebook feed with windows app -

i take facebook feed facebook page , add display (the statuses , images) on windows store app. have installed facebook sdk .net , trying find tutorials can find how add login screen. ideas can do? if new c# sdk, can start here: facebook sdk .net concept you can feeds page using: /page_id/feed you can photos page using: /page_id/photos (only if feeds/photos public) implementation example- facebookclient fb = new facebookclient(app.accesstoken); dynamic parameters = new expandoobject(); parameters.access_token = app.accesstoken; dynamic result = await fb.gettaskasync("page_id/feed", parameters); graph api explorer examples - you can parameters required. posts example photos example

version control - Files in git showing as not staged after previously staging and committing files -

Image
i have staged , committed handful of files locally git repo. in line remote repo, after performed git commit done git status , expecting see 1 commit ahead of repo. however, found of files changed have found still marked modified , once again outside of staging area. i committed new untracked files in commit. files not listed changed, must have been committed successfully. what don't understand why these other files showing changed/unstaged again? i using git 1.8.2.1. what find confusing when git add -a , add files again , commit does recognise them. why take 2 commits desired result? this output terminal when firstly git status , git commit , git status see am: # on branch crmpicco-1872 # branch ahead of 'origin/crmpicco-1872' 3 commits. # (use "git push" publish local commits) # # changes committed: # (use "git reset head <file>..." unstage) # # modified: sass/iphone/page/sun.scss # modified: web/load/...

selector - how to get input type email's value from jquery -

i trying <input type="email" name="mail"> 's value jquery . i've run validation checking mail 's value <script> function valid(){ var em = $.trim($('input:email[name=mail]').val()); if(em.length < 5){ alert('please enter email id'); return false; } return true; } </script> but form still submitting if user left mail blank. i've gone through jquery api doc not found selector email . why so? why not present there , how solve problem? you do: $.trim($("input[name='mail']").val());

c# - using xmldocument to read xml -

<?xml version="1.0" encoding="utf-8" ?> <testcase> <date>4/12/13</date> <name>mrinal</name> <subject>xmltest</subject> </testcase> i trying read above xml using c#, null exception in try catch block can body suggest required change. static void main(string[] args) { xmldocument xd = new xmldocument(); xd.load("c:/users/mkumar/documents/testcase.xml"); xmlnodelist nodelist = xd.selectnodes("/testcase"); // <testcase> nodes foreach (xmlnode node in nodelist) // each <testcase> node { commonlib.testcase tc = new commonlib.testcase(); try { tc.name = node.attributes.getnameditem("date").value; tc.date = node.attributes.getnameditem("name").value; tc...

testing - test subscr_payment using paypal ipn simulator -

Image
i test txn_type of 'subscr_payment' using paypal's ipn simulator. there no such option. while can see here there such txn type correct; not transaction types supported in ipn simulator. planning add more scenarios simulator, kind of testing (which require multiple successive ipn messages), recommend creating subscription button in sandbox environment , having bill manually. unfortunately that's way simulate subscription ipn messages today.

c# - URL where user come from ASP.Net but have NULL -

i want know-from url user come from. so, use uri myurl = request.urlreferrer; but when null value myurl: i have 2 projects-first aspx page, second- redirects first project-page parameters. when second project redirect first project- have : object reference not set instance of object. my second test project simple: protected void page_load(object sender, eventargs e) { response.redirect("http://localhost:54287/go.aspx?id=default"); } first , main project: protected void page_load(object sender, eventargs e) { //request.servervariables('http_referer'); // request.servervariables; string id = request.querystring["id"]; if (id != null) { uri myurl = request.urlreferrer; console.writeline(myurl); response.write("referrer url : " + myurl.absolutepath); } } error in :response.write("referrer url : " +...

node.js - Access SFTP from NodeJS -

i have need have open sftp connection server, copy file there local. to end, have tried installing node-sftp module using npm install node-sftp it didnt work out of box, had replace sftp.js file installed npm of github repository here : https://github.com/ajaxorg/node-sftp (npm version using tty , github version using pty. not sure are) after start server , invoking code, see in console. launching: sftp -o port=22 jash@xxx.63.xxx.49 listening... console hangs here. trying print files in current directory after connection opened. this code var http = require('http'); var sftp = require('node-sftp'); var port = process.env.port || 1337; var msghandler = function(request, response) { var options = { host:"xxx.63.xxx.49", username:"jash", password:"mypassword", port:22 }; var conn = new sftp(options,function(err){ console.log(err); }); conn.cd(".", functi...

php - CodeIgniter DataMapper Unable To Relate tree tables -

i have tree tables: create table `bairros` ( `id` int(11) unsigned not null auto_increment, `cidade_id` int(11) unsigned null default null, primary key (`id`), index `fk_bairros_cidades` (`cidade_id`), constraint `fk_bairros_cidades` foreign key (`cidade_id`) references `cidades` (`id`) ) create table `cidades` ( `id` int(11) unsigned not null auto_increment, `estado_id` tinyint(4) unsigned null default null, primary key (`id`), index `fk_cidades_estados` (`estado_id`), constraint `fk_cidades_estados` foreign key (`estado_id`) references `estados` (`id`) ) create table `estados` ( `id` tinyint(4) unsigned not null auto_increment, primary key (`id`) ) in bairros class have function: public function get_by_id($bairro_id) { $bairro = new bairro(); $bairro->include_related('cidade'); $bairro->include_related('estado'); return $bairro->get_by_id($bairro_id); } in models have: bairro model: ...

r - Plotting in a for loop: Why can't I subtract from the counter? -

why following code plot points @ 1:10 , not @ 0:9 on x axis? (i know can code differently solve problem, nevertheless, wish know.) y <- rep(1,10) (i in 1:10) { if (i == 1) { plot(y[i]~(i-1),pch = 14, ylim = c(0,2), xlim=c(0,11)) } else {points(y[i]~(i-1), pch = 14) } } you have use i() (as-is) formula construct: y <- rep(1,10) (i in 1:10) { if (i == 1) { plot(y[i]~i(i-1),pch = 14, ylim = c(0,2), xlim=c(0,11)) } else {points(y[i]~i(i-1), pch = 14) } } this (according ?i ) because arithmetic operators ("+", "-", "*" , "^") inside formulae interpreted formula operators (for adding/dropping terms or creating interactions) rather arithmetic operators. you obtain same changing plot calls to: plot(i-1,y[i...

java - Retaining values between multiple JSPs and Actions in Struts 2 -

my struts project structure follows: page1 -> action1 -> page2 -> action2 -> page3 what need value entered in input tag in page1 accessed in action2. here code: page1: <div class = "container"> <s:form id = "idinput" method = "post" action = "identered"> enter id: <input id = "txtid" name = "txtid" type = "text" /> <input id = "cmdsubmit" name = "cmdsubmit" type = "submit" value = "enter details" /> </s:form> </div> action1: public class addid extends actionsupport { private int txtid; //getter , setter @override public string execute() throws exception { return "success"; } } page2: <div class = "container"> <s:form id = "formvalues" method = "post" action = "formentered"> <p>your id en...

jquery mobile - Function to be executed on home page only -

i have multi page jquery mobile document. structure like. page a page b page c i know can execute function on every pageshow using pageshow when u link page #pagea in browser leaves main url only. want execute function when user on mydomain.com i can propose general solution. each page can have div <div class="page_{variable}"></div> and check jquery whether have $(".page_a"), $(".page_b") and on. hope helps.

html - PHP XML fast read -

i load more 50 xml files on homepage. example structure can see here: http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000 i need price "sell" -> "min". run foreach() loops , stop when got it. page needs more 30 seconds handle this, think need direct entry data like: $min = $xml -> children() -> children() -> sell -> min; can give me right arithmetik? thx step use simplexml_load_file function. , quick! $xml = simplexml_load_file('http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000'); echo $xml->marketstat->type->sell->min; // 257.99 and simplexmlelement , file_get_contents $xml_str = file_get_contents('http://api.eve-central.com/api/marketstat?usesystem=30000142&hours=24&typeid=3683&minq=10000'); $xml = new simplexmlelement($xml_str); echo $xml->marketstat->type->sel...

Save recorded audio to file - OpenSL ES - Android -

i'm trying record microphone, add effects, , save file i've started example native-audio included in android ndk. i'va managed add reverb , play haven't found examples or on how accomplish this. any , welcome. opensl not framework file formats , access. if want raw pcm file, open writing , put buffers opensl callback file. if want encoded audio, need own codec , format handler. can use ffmpeg libraries, or built-in stagefright. update write playback buffers local raw pcm file we start native-audio-jni.c #include <stdio.h> file* rawfile = null; int bclosing = 0; ... void bqplayercallback(slandroidsimplebufferqueueitf bq, void *context) { assert(bq == bqplayerbufferqueue); assert(null == context); // streaming playback, replace test logic find , fill next buffer if (--nextcount > 0 && null != nextbuffer && 0 != nextsize) { slresult result; // enqueue buffer result = (*bqplayerbuff...

iphone - CSS Media Queries - Having Trouble making it work -

i have following css, including media query iphone users, not seem work: body { background: url('background.png') no-repeat center center fixed; background-size:100%; } #tab { width:30%; height:60%; position:fixed; background: url('tab.png') no-repeat center center fixed; background-size:33%; top:20%; left:35%; opacity:0.7; } @media screen , (max-device-width: 480px) { body { background:#1589ff; } #tab { width:30%; height:60%; position:fixed; background: url('tab.png') no-repeat center center fixed; background-size:33%; top:20%; left:35%; } } the normal css works fine, design not alter when switching iphone. can suggest why above media query not seem working? missing something? instead: @media screen , (max-device-width: 480px) try: @media (max-width: 480px) or @media screen , (max-width: 480px)

javascript - Cannot call method "setHtmlContent" in GAS -

i have script updates resources on or company's intranet , keep getting error: "cannot call method "sethtmlcontent" of null." can point in direction of why getting error , how fix it. thank , here code: var domain_name = 'website.com'; var site_name = 'intranet-site'; var doc_folders = ['intranet docs/admin resources/accounts payable resources', 'intranet docs/admin resources/finance resources', 'intranet docs/admin resources/hr resources', 'intranet docs/admin resources/payroll resources', 'intranet docs/admin resources/ssp resources', 'intranet docs/admin resources/vehicle & incident resources', 'intranet docs/directors resources/advisory boards', 'intranet docs/comm , pr resources/logos , graphics', 'intranet docs/c...

php - Foreach continous loop using file() function. -

$lines = file('array2.txt'); foreach($lines $line) { mysql_query("insert test (tweet, date) values ('$line', '22')"); } hi all, i trying use code above use file() function add lines text file array, can place in mysql database. file using contains 100 lines, using function above end on 116,000. known how causing this? thank in advance. maybe try way. read till file end line. $file = fopen("file.txt", "r"); while (!feof($file)) { $line = fgets($file); // code make db insert } fclose($file); for me works, , don't other records, 10 wrote in.

android - ImageView is not highlighting on click -

i designing app multiple devices.in using imageview , using selector setting background image depends on state.i works fine devices except 1 10 inch device. <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" > <linearlayout android:layout_width="145dp" android:layout_height="239dp" android:layout_marginright="6dp" android:background="@drawable/common_selector_thumbnail_shadow_title_background" android:gravity="center" android:orientation="vertical" android:paddingleft="5dp" android:paddingright="5dp" > <framelayout android:layout_width="130dp" android:layout_height="186dp" android:layout...

clojurescript - Finding unmatched (wrongly matched) parens in clojure code / More meaningful error messages -

i have asked question before ( locating unmatched delimiters in clojurescript ) , still not have sufficient answer. i warning of line error such parameter mismatch being detected reader. clojure throws general error naming file no line, etc. i have either clojure specific tool (something lint tool) provides information advice on reading stack traces i have found problem , more precise problem had. compiling clojurescript distributed on code on several files. knew had made changes in 3 of them when discovered code not compile anymore. error message mismatched ) in file a.cljs on line 1 . quite sure, did not change a.cljs substantially. so taking usual way perform when such error occurs (that not often). indent whole files vim see if indentation going "nuts". use git diff changes in working copy , recent history (i granular commits) find spots changed recently. this time did not spot change easily. in end found out issue missing ] in part of file c...

extjs - How create folder wise views in Sencha Architect? -

i developing application in sencha architect. application having different groups in it. in each group there multiple modules , in modules there no of views available. want have tree folder structure views. how achieve through sencha architect.? thanks in advance. you can put prefix on each component name, example: accounts.mainwindow will generated as /app/views/accounts/mainwindow.js

java - javaws always loads 32 bit libraries even when client is 64 bit -

i have jnlp file passes janela, has no errors. web start app runs fine on linux , windows 32 bit. fails run on windows 64 bit. devised following test determine if javaws loading correct native libraries: change name of library files in jnlp file files not exist load app force file not found error see file trying load here jnlp stub (the rest of file fine... trust me): <resources os="windows" arch="x86_64"> <nativelib href="swt-4.2-win32-x86_64.jarx" /> </resources> <resources os="windows" arch="x86"> <nativelib href="swt-4.2-win32-x86.jarx" /> </resources> javaws tries load 32 bit library means not recognize arch="x86_64" so changed first line to: <resources os="windows" arch="amd64"> but javaws still tries load 32 bit file. whatever going on, architecture of os not being detected. i have trawled great d...