Posts

Showing posts from May, 2012

regex - use grep/sed/awk to extract string corresponding to certain field -

on fedora system, following: $ cat /proc/net/arp ip address hw type flags hw address mask device 130.48.0.1 0x1 0x2 80:4b:c7:10:3e:41 * wlp1s0 how can pipe result of device (in case answer wlp1s0) using screen editor such sed or grep or awk? thanks! $ awk '/^[0-9]/{print $6}' /proc/net/arp wlp1s0 /^[0-9]/ selects lines start digit, ip print $6 prints 6th colum being device

algorithm - NP-Complete reduction -

the problem states want show independent set poly-time reduces relative prime sets, more formally independent set <p relative prime sets . i need provide reduction f ind.set rel. prime sets, where - input of f must graph g , integer k, k denotes size of independent set. - output of f must set s of integers , integer t, t denotes number of pairwise relative prime numbers in set s. definition of relative prime sets (decision version): it takes set p of n-integers , integer t 1 n. returns yes if there's subset of p, t-many pairwise relative primes. is, a, b in a, must true gcd(a, b) = 1. returns no otherwise so far have come-up believe reduction, not sure if valid , want double check knows how this. reduction: let g graph.let k indicate size of independent set. want find-out if there exists independent set of size k in g. since problem np-complete, if can solve np-complete problem in poly-time, know can solve independent set in

animation - button click not working after view rotation android -

i have 1 relative layout, inside added 3 image button dynamically. when layout first appear 3 button action click event working properly, rotate whole layout per sensor changed, after rotation of layout button's postion changed can't click event of buttons again @ new postion instead got click event on button's previous positions. please suggest me proper solution. any appreciated. below code how added button , apply roation it's parent view. imagebutton mimage = new imagebutton(context); mimage.setx(x); mimage.sety(x); mimage.setid(id); mimage.settag(id); mimage.setimageresource(r.drawable.dot); this.addview(mimage); rotation code, rotateanimation ra = new rotateanimation(currentdegree, -degree, animation.relative_to_self, 0.5f, animation.relative_to_self, 0.5f); ra.setduration(210); ra.setfillafter(false); view.startanimation(ra);

c - How to convert SOCK_DGRAM to SOCK_RAW? -

i'm working on open source sock_dgram used send rtp packets. like this: int sock = socket(af, sock_dgram, 0); but i'm supposed use same socket sock_raw send udp packets prepare. is possible convert udp socket raw socket? if possible how can done? thanks in advance i don't know why said need use same socket , otherwise, can follow below steps transfer packet on raw socket. create socket using sock_raw . define , populate ip header [ struct ipheader ] define , populate udp header [ struct udphdr ] set socket not use system (kernel) provied header [ setsockopt() ip_hdrincl as 1 ] send buffer [ sendto() ] you can find nice tutorials (and maybe sample codes, too) here .

angularjs - Text in Textarea is not scrolling with ng-repeat with ionic- angular js -

when using textarea below ng-repeat in angular js - ionic . text area not working , time lost focus also. please provide me solution code : <div class="title">comments</div> <ul class="comment_list"> <li ng-repeat="x in comments "> <a><img no-image ng-src="{{profile_img_path.image_url_tiny+x.user.image}}" alt="" class="pro_img"></a> <div class="pro_deatil" > <h2> {{x.user.name}} </h2> <p>{{x.commentdish.comment}}</p> </div> <div class="pro_like" > </div> <div class="clearfix"></div> </li> </ul

Apache2 restart failed on ubuntu -

when trying restart apache server ubuntu, showing fail... typed command as, $service apache2 restart it shows, restarting web server apache2 [fail] when checked in log file, in var/apache2/errorlog description provided is, [mpm_prefork:notice] [pid 1263] ah00163: apache/2.4.7 (ubuntu) php/5.5.9-1ubuntu4.5 configured -- resuming normal operations it because not using sudo when running command, try: sudo service apache2 restart

php - Can't make Xdebug work with Eclipse PDT -

i have eclipse pdt , xdebug installed xampp . although there various solutions on web couldn't find solution problem . here phpinfo() xampp shows xdebug installed : xdebug xdebug support enabled version 2.2.6 ide key xdebug_eclipse supported protocols revision dbgp - common debugger protocol $revision: 1.145 $ directive local value master value xdebug.auto_trace off off xdebug.cli_color 0 0 xdebug.collect_assignments off off xdebug.collect_includes on on xdebug.collect_params 0 0 xdebug.collect_return off off xdebug.collect_vars off off xdebug.coverage_enable on on xdebug.default_enable on on xdebug.dump.cookie no value no value xdebug.dump.env no value no value xdebug.dump.files no value no value xdebug.dump.get no value no value xdebug.dump.post no value no value xdebug.dump.request no value no value xdebug.dump.server no value no value xdebug.dump.session no value no value xdebug.dump_globals on on xdebug.dump_

javascript - Call JQuery function when asp.net page has specific query string -

i have jquery function shows notification message. asp.net page want call when page gets loaded e.g when: request.querystring[c_opid] != null; tried call function page_load , page_loadcomplete using scriptmanager.registerstartupscript() function doesn't fire up. on other hand, when call on button click should done. jquery function: function showmessage(title, message) { pnotify.prototype.options.styling = "jqueryui"; var notice = new pnotify({ title: title, text: message, type: 'success', opacity: 1, animate_speed: 'fast', addclass: 'custom' }); notice.get().click(function() { notice.remove(); }); settimeout(function() { notice.remove(); }, 3000); } asp.net code behind call: scriptmanager.registerclientscriptblock(this, this.gettype(), "script", @"showmessage('" + title + "','" + message + &qu

override - Overriding getdirentries in C -

i override getdirentries (and others, lstat) libc syscalls. can override -for example- lstat , chmod, can't override getdirentries (and amongst others fstatfs). example code is: #include <errno.h> #include <dlfcn.h> #include <stdio.h> #include <strings.h> #include <string.h> #include <sys/_timespec.h> #include <sys/stat.h> #include <sys/mount.h> #ifndef rtld_next #define rtld_next ((void *) -1l) #endif int (*getdirentries_orig)(int fd, char *buf, int nbytes, long *basep); int (*lstat_orig)(const char *path, struct stat *sb); int (*fstatfs_orig)(int fd, struct statfs *buf); int (*chmod_orig)(const char *path, mode_t mode); #define hook(func) func##_##orig = dlsym(rtld_next,#func) int getdirentries(int fd, char *buf, int nbytes, long *basep) { hook(getdirentries); printf("getdirentries\n"); return getdirentries_orig(fd, bu

HTML 5 File input with iOS and Android [Cordova/Phonegap] -

Image
in phonegap app tried use camera using html5 input tag this. create new project using cli add ios , android platform add camera plugin build both devices run on both devices (actual device iphone 5 ios 7.1.2 , android 4.4.2 (samsung note)) following code line tried execute <input id="imageholder" type="file" accept="image/*" capture /> it works in iphone not in android. have missed? or not supported in android? after tapping on field in android nothing happens while in iphone acts below

postgresql - rails 4 rails_admin column does not exist -

i used rails_admin gem , devise gem,postgresql database in project.after installed rails admin gem , going see localhost:3000/admin throws error pg::undefinedcolumn @ / error: column customers.active not exist . have used user , customer models.i created relationship between 2 models.i think association problem how can fix don't know here user model class user < activerecord::base has_one :customer, inverse_of: :user accepts_nested_attributes_for :customer, :allow_destroy => true end here customer model class customer < activerecord::base default_scope { where(active: true).joins(:user).order("user.name") } belongs_to :user, inverse_of: :customer validates :user, presence: true end here rails_admin configuration railsadmin.config |config| ### popular gems integration # == devise == config.authenticate_with warden.authenticate! scope: :user end config.current_user_method(&:current_user) config.actions dashboard

cmmotionmanager - Measuring tilt with left, right, forward and backward in ios -

i want find tilt in side (left, right, forward, backward) i have use below code find left , right [motionmanager startdevicemotionupdatestoqueue:[nsoperationqueue mainqueue] withhandler:^(cmdevicemotion *devicemotion, nserror *error) { if (devicemotion.attitude.roll <= -1) { [self tiltcontrol:@"left"]; } else if(devicemotion.attitude.roll > 1) { [self tiltcontrol:@"right"]; } }]; now how can find forward , backward... what best way find 4 tilt... just use attitude.pitch property: if(devicemotion.attitude.pitch > 0 ) { nslog(@"forward"); } else if(devicemotion.attitude.pitch < 0) { nslog(@"backward"); } there rotation around z axis, available attitude.yaw . credits nshipster .

running phantomjs on a page that is opened with casperjs -

now have 2 parts of programs lets 'a' casperjs prog , 'b' phantomjs prog and trying pass page opened 'a' pass page 'b' i know both have 'page' object. have no idea how use 'page' object in casperjs... or there way run phantomjs prog after openning page in casperjs....? in phantomjs prog, want make use of if can pass page phantomjs in page/content object best var webpage = require('webpage') var page = webpage.create() var content = page.content

Android XDK Intel Html5 - img src width file:///storage/sdcard0 does't work -

if tag link on img src put file directly: file:///storage/sdcard0/myimg/test.jpg, image in preview view in android build compilation appears not. <img src="file:///storage/sdcard0/myimg/test.jpg"> its correctly in app preview. not view android ? why? need use different path? the problem solved. i installed new version (sep 2014) of xdk. in version, let android.config.xml files edit , expand itself. i put permission "read_external_storage". now images displayed.

java - Advice on how to handle Internationalization when there is a Database in the middle of the way -

my site allows user choose language. texts shown in website handled reloadableresourcebundlemessagesource of spring, reads texts properties files. i have menu many links, taken database. my question is: should write different languages text of links? what's best practice? 1) write languages inside dabatase? example way? -------------------------------------------------- | id_link | url | italian | english | spanish | -------------------------------------------------- | 1 | /url | ciao | hello | hola | -------------------------------------------------- 2) bind dabatase , properties file? example way? --------------------------------- | id_link | url | description| -------------------------------- | 1 | /url | link1 | --------------------------------- | __ language_it.properties | | link1= ciao | |

javascript - how to take screenshot of dragged and dropped elements using html2canvas -

i creating app in user drags image 1 div , drops canvas. how take screenshot of canvas along images dropped canvas. <canvas class="can" > </canvas> <div class="pictures"> <img src="abc.jpg" /> //before dragging <img src="xyz.jpg" style="top: -150px" /> //after dragging , dropping canvas </div> js function call(top,this1){ // alert("hello"); if(top==0){ var clone= this1.clone(); clone.css("top","0"); clone.draggable({addclasses: true , revert: "invalid", drag:function(){ var position = $(this).position(); var top=position.top; call(top,$(this)); } }); this1.parent().prepend(clone); this1.css("position","absolute"); } } $("img").draggable({ addclasses: true , revert: "invalid", drag: function(){ v

NoClassDefFoundError - Android 2.3.X -

i have task defined in class. fatal exception "noclassdeffounderror" happening on following line mycutetask mytask = new mycutetask(equations) here code public class myclass { public void run() { mycutetask mytask = new mycutetask(equations) } protected class mycutetask extends asynctask<string, integer, string> { ... } } recently, have strange bug reports. android throw exception when instantiate task. have bug android 2.3.x only. do of got same bug? edit: here stack trace java.lang.noclassdeffounderror: com.mathssolver.main.k @ com.mathssolver.main.logic.updategraph(logic.java:310) @ com.mathssolver.main.graph.update(graph.java:249) @ com.mathssolver.main.mathgraphfragment.plotfunction(mathgraphfragment.java:236) @ com.mathssolver.main.mathgraphfragment.plot(mathgraphfragment.java:158) @ com.mathssolver.main.mathgraphfragment.showexample(mathgraphfragment.java:141) @ com.mathssolver.main.mathgraph

python - How to check for a ForeignKey that no longer exists? -

class personsite(models.model): vps_id = models.autofield(primary_key=true) person = models.foreignkey(canonperson, db_column='p_id',null=true) site = models.foreignkey(canonsite, db_column='s_id',null=true) person_sites = personsite.objects.filter(person=cp) person_site in person_sites: if person_site , person_site.site_id , person_site.site.s_id: # crashes records we have problem data, personsite may point site no longer exists. in debugger can see person_site.site_id has value of 5579, id doesn't exist in database: select * tbl_vpd_sites s_id = 5579 hence person_site.site_id not null, yet accessing person_site.site within conditional crashes app message: doesnotexist: canonsite matching query not exist. this difficult situation, can't check case bypass it. personsite.site has null=true , makes sense have check if object exists before accessing it. in stead of doing che

ios - Can I use Apple's TestFlight with Xcode 5? -

is there way can use apple's testflight (as opposed original testflight, still accept sign ups , can used) xcode 5? i want able use xcode 5 because xcode 6 works ios 8 sdk. while there hacks make ios 7 sdk work xcode 6, don't seem build archive (i link errors metal framework architectures). i wanted use ios 7 sdk because our app needs modifications work ios 8 sdk. modifications largely due changes in implementation details of autorotation, carried out @ window level under ios 8. libraries use rely on ios 7 approach , broken under ios 8. while we're happy update of this, we'd prefer resolve @ future time. short answer – no . longer answer… i noticed xcode 5 , xcode 6 share same "archives". it possible create archive build xcode 5 , see archive build in xcode 6. can use xcode 6 upload build itunes connect. works, , itunes connect let distribute build created in xcode 5 test devices. using testflight app on devices, they'll download , a

hibernate - Named JPQL Query and Native SQL Query produce different SUMs -

i'm dealing following scenario: the entity class: @namedquery( name = "table.getsum", query = "select sum(s.price) table s (s.openingdate >= :openingdate , s.closingdate <= :closingdate)" ) the ejb: calendar openingdate = new gregoriancalendar(year, 1, 1, 0, 0, 0); calendar closingdate = new gregoriancalendar(year, 12, 31, 23, 59, 59); bigdecimal salepricesum = em.createnamedquery("table.getsum", bigdecimal.class) .setparameter("openingdate", openingdate) .setparameter("closingdate", closingdate) .getsingleresult(); the native sql query: select sum(price) table openingdate >= 'yyyy-01-01t00:00:00' , closingdate <= 'yyyy-12-31t23:59:59' but 2 sums of significant amount. drives me crazy. how can be? i'm using hibernate 4.3.7 wildfly 8.2.0 , current mariadb on centos 7. thank suggestion. month parameter in c

XML comments from C# project are not shown in VB -

i created solution 2 projects. 1 written in c#, other 1 written in vb , has reference c# project. when call method c# project in vb code, xml comments not shown. if call method c# project xml comments show properly. created third project (c# well) , added reference first c# project. xml comments show here well. what need see xml comments within entire solution? why comments not shown current setup? thanks justin ryan noticed missing .xml documentation file. follow instructions on http://msdn.microsoft.com/en-us/library/x4sa0ak0.aspx if run same problem (this applicable if generate .dll file , need include .xml comments).

android - Add custom data with ForegroundColorSpan -

i'm using foregroundcolorspan highlight portion of text in edittext . jeff feeling hungry @ northbay . in above example, i've identify northbay based on id in db. later on, have perform querying based on id. apparently there seems no way add custom data foregroundcolorspan instance. possible workaround this? figured out solution myself. created custom span class as; public static class myspan extends foregroundcolorspan { private object instance; public object getinstance() { return instance; } public void setinstance(object instance) { this.instance = instance; } } then used span on style substring in textview.

entity framework - Why does LINQ throw a NotSupportedException? -

let's have table called car columns such id, identification, modelname, ownerid etc ownerid points primary key in owner table. good, want add driver car, since want know drives each car @ given time. sounds straight forward, right? create driver table , add new nullable (there's no driver if car in garage etc) int column called driverid car table, connect foreign key , we're go. i did this, , updated edmx in model designer new table, column , foreign key showed up. looks good. driverid property , driver navigation property both there in generated code , new driver class generated. now when tried use new table , connect drivers cars there's wrong. looks linq doesn't know driverid column or foreign key (navigation property) driver. if try getting car given driver: car car = (from c in db.cars.where(x => x.driverid == driverid) select c).firstordefault(); i expect car if driver driving car or null otherwise. error message: system.notsupportedexcep

Azure SAML 2.0 Error only on night-time -

i error: aadsts75005 request not valid saml2 protocol message from around 23:00 - 08:00 in morning, varies in time. works great on day, nights , mornings error. this authrequest send redirect: <samlp:authnrequest xmlns:samlp="urn:oasis:names:tc:saml:2.0:protocol" id="_79a4e166-3b3b-496c-bc8a-4f887f854390" version="2.0" xmlns:saml="urn:oasis:names:tc:saml:2.0:assertion" issueinstant="2014-11-27t10:38:52z"><issuer xmlns="urn:oasis:names:tc:saml:2.0:assertion">https://response.url.com</issuer></samlp:authnrequest> from have read azure issueinstant send authrequest doesnt matter, though have tried changeing without result. what can try continue troubleshooting? it tomcat server time difference. if use -duser.timezone=utc in tomcat startup works :)

pyramid - how to add scaffolds in virtual environment. I want to add Akhet scaffold into my virtual environment? -

after googling , searching came here... want use akhet http://pypi.python.org/pypi/akhet scaffold , want continue develop application. problem don't have idea include scaffold in virtual environment. have tried following lines env/bin/pcreate -s akhet pythonakhen since don't have akhet in scaffold list line given me error unavailable scaffolds: ['akhet'] . please me add scaffalod in virtual environment can them generate skeleton of application. forget akhet. current version 2.0 not provide scaffold anymore , rather outdated. follow official pyramid documentation, there plenty of stuff builtin if rely on scaffolds shipped pyramid 1.5 , way works in year 2014. akhet scaffold gone if want provide akhet scaffolding in future :-) these links friends http://docs.pylonsproject.org/projects/pyramid/en/latest/index.html#getting-started

php - I have three div's, how to refresh a second div without reloading the complete page? -

i have 3 div tags, on click of link want reload second div tag instead of loading complete page, want keep first , third div tag static , second div tag should dynamic? <div class="first"> <a href="patientlogin/patientvisit_details/<?php echo $data->patient_visit_id;?>"><?php echo $data->hospital_name;?></a> </div> <div class ="second"> //content// <div> <div class ="third"> //content// <div> first of should make difference between divs making ids unique billy said in comment. classes used make common selector elements. create html below: <div id="first"> <a href="patientlogin/patientvisit_details/<?php echo $data->patient_visit_id;?>"><?php echo $data->hospital_name;?></a> </div> <div id="second"> //content// <div> <div id="third"

java - block IP using tuckey-urlrewrite-filter rermote-addr -

i trying block ip parts of application using urlrewritefilter 4.0.3. can not work no matter try. can please help? i have added urlrewritefilter-4.0.3.jar - /var/lib/tomcat7/webapps/myapp/web-inf/lib have added urlrewrite.xml in /var/lib/tomcat7/webapps/myapp/web-inf/. i have added following lines web.xml in /var/lib/tomcat/webapps/myapp/web-inf/ : <filter> <filter-name>urlrewritefilter</filter-name> <filter-class>org.tuckey.web.filters.urlrewrite.urlrewritefilter</filter-class> <init-param> <param-name>confreloadcheckinterval</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>statusenabled</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>loglevel</par

java - AlarmManager not started at specified timing -

i having problem when trying start alarm manager in android send push-notifications upon condition. so trying have list of events, system send push notification on events' eve. , here part grab event date , make comparison: for (int count = 0; count < _eventlist.size(); count++) { date alarmdate = null; try { alarmdate = dateformat.parse(_eventlist.get(count) .geteventdate()); } catch (parseexception e) { e.printstacktrace(); } calendar calendar = calendar.getinstance(); calendar.settime(alarmdate); calendar.add(calendar.date, -1); date alarmbeforeoneday = calendar.gettime(); calendar.add(calendar.date, 1); if (dateformat.format(alarmbeforeoneday).equals(currentdate)) { if (!alarminitialized(context)) { notifyeventname = _eventlist.get(count).geteventname(); notifyeventtime = _eventlist.get(count).geteve

c# - Where does CLR store methods for instances of one type -

Image
class myclass { public string myproperty { get; set; } public void mymethod() { //do difficult here //100500 lines of code here ... } } we have lot of instances of myclass . does clr creates memory-expensive mymethod() for instance of class ? no not. method compiled once, when have first call of method. compiled code used instance of type myclass . performance hit happens in first call of method, il code compiled native code. below, posted 2 images may make more clear: and for further information, please take @ book clr via c# .

sql - Using the next_day to retrieve the previous day and the following day -

i have sql code. trying retrieve previous monday , next sunday using next_day function. how make query work? using oracle sql developer run query. this data want show: fullname, monday sunday john brown 31-dec-2012 06-jan-2013 here code have far: select first_name, last_name, dob, add_months(dob, (extract(year sysdate)- extract(year dob))*12) birthdatethisyear customers i tried adding these statements, got error after runninng query: next_day(birthdatethisyear-8, 'mon') previousmonday next_day((birthdatethisyear-8)+6, 'mon') upcomingsunday i can try this: select first_name || ' ' || last_name fullname, next_day(birthdatethisyear-8, 'monday') previousmonday, next_day(birthdatethisyear-1, 'sunday') upcomingsunday (select first_name, last_name, dob, add_months(dob, (extract(year sysdate)- extract(year dob))*12) birthdatethisyear customers)

r - Max efficiency in removing duplicated rows in data frame -

i have large data frame: more 6 million rows, 28 variables of type (num, factors, characters). need remove duplicated rows. however, way identify actual duplicates run check on large character variable (approx 1,000 2,000 characters in each observation). use standard duplicated() function not sure time efficient solution. is there function or package allows efficiently job ? thank in advance suggestions. structure(list(city = c("new york", "new york", "new york", "brussels", "london", "arlington"), prodcategory = structure(c(1l, 1l, 1l, 1l, 1l, 1l), .label = "4", class = "factor"), date = structure(c(16351, 16352, 16351, 16353, 16354, 16355), class = "date"), userid = c("abcd", "xyzz", "abcd", "abcd", "sdfg", "wedgd"), review = c("in opinion 1 of best pastrami or corned beef sandwiches places in ny (an more). way each s

javascript - How to identify XPages errors at the console -

Image
i have xpages application has been running in production few years , has been built on continually add new functionality. in last few months have noticed errors these below on server console. console advises check error-log-0.xml file, reported there doesn't lead me useful conclusions causing problem. 2014-11-27t07:27:12.156+00:00 severe clfad0131e: unable push data because: unable open database: com.ibm.xsp.binding.javascript.javascriptvaluebinding@539c539c 2014-11-27t07:27:12.156+00:00 severe clfad0134e: exception processing xpage request 2014-11-27t07:27:12.359+00:00 severe clfad0131e: unable push data because: error while executing javascript computed expression 2014-11-27t07:27:12.359+00:00 severe com.ibm.xsp.exception.evaluationexceptionex: error while executing javascript computed expression com.sun.faces.lifecycle.applyrequestvaluesphase 2014-11-27t07:27:12.375+00:00 severe clfad0134e: exception processing xpage request 2014-11-27t07:27:16.468+00:00 severe clfad013

html - Using PHP to generate part of a background URL in CSS-file -

i need php generate part of path name background image, used in css-file. changed file type php , added header, suggested in post on stackoverflow. however, cannot work. believe php generates , error , terminates other code after that, not sure how acquire error message. code is: <?php header('content-type: text/css'); ?> body { min-height: 100%; background: url("<?php echo asset_url(); ?>images/backgroundimage.jpg"); background-size: cover; background-repeat: no-repeat; background-position: center top; } the asset_url() function has been tested, , working elsewhere, should not issue. example of working here: <link rel="stylesheet" type="text/css" href="<?php echo asset_url(); ?>css/basicstyle.php"> am missing totally obvious here? update: pretty sure css loaded, worked before changed php (i did not change else). inspection of site, once uploaded, shows following in <li

asp.net mvc - How to get a webgrid selected row values of using jquery -

i have webgrid in have 3 columns want catch columns of row , display on alert message example row has 3 columns teamname,description , usercount, when user click on of column user must have 3 details values on alert message. how can have no idea.please help. here view webgrid. <div class="table-responsive"> @{ var grid = new webgrid(source: model.teamlist.tolist(), canpage: true, rowsperpage:10); } @grid.webgridselectall( headerstyle: "gridheader", tablestyle: "table table-condensed table-striped table-bordered table-hover no-margin", checkboxvalue: "teamid", columns: new[]{ grid.column("teamname",format: @<a href="#" class="details" data-id="@item.teamid" data-dialogmodalbind=".dialog_content3">@item.teamname</a>,header: html.customtext("lblctteamname", "team name&quo

c# - How to make to limit the image dragging area in app? -

Image
now, i'm developing photo application(windows phone 8.1 runtime) got problem did not limit image dragging area while photos zooming. here below code: <canvas name="zoomgrid" visibility="collapsed"> <image x:name="zoomimages" stretch="fill" width="480" height="800" manipulationdelta="img_intro_manipulationdelta" rendertransformorigin="0.5,0.5" manipulationmode="all"> <image.rendertransform> <compositetransform/> </image.rendertransform> </image> </canvas> double mincale = 0.5; double maxscale = 10.0; private void image_manipulationdelta(object sender, manipulationdeltaroutedeventargs e) { image elemt = sender image; compositetransform transform = elemt.rendertransform compositetransform; transform.scal

java - Converting an integer to a ASCII key String -

this question has answer here: how convert ascii code (0-255) string of associated character? 10 answers how 1 go converting integer like int keycode = 65; into string keycode = "a"? thanks everyone, know how vice-versa, i've searched on , have not found solution. i think do: string str = string.valueof((char)keycode);

php - sql query returning string instead of integer while using COUNT -

$query_products_records="select @myint=count(*) products"; $result_query_products_records=mysql_query($query_products_records); echo 'table records ...'.$result_query_products_records; i used above query count of rows in table, got resource id #4 on echo. i have 3 records in table. mysql_query creates resource. that resource should used mysql_fetch_row(). mysql_fetch_row(mysql_query($query)); for example. or use in while loop extract more 1 result. ps: consider using mysqli extension on mysql. deprecated. the working code $result_data = mysql_fetch_assoc(mysql_query("select count(*) c products")); echo 'table records ...'. $result_data['c'];

Removing bottom shadow on ActionBar - Android -

i want disable actionbar shadow in 1 activity . if use code change in whole aplication. <style name="myapptheme" parent="android:theme.holo.light"> <item name="android:windowcontentoverlay">@null</item> </style> i tried code, not working getsupportactionbar().setelevation(0); any suggestion...? you can set own style activity this: <!-- main theme actionbar shadow. --> <style name="myapptheme" parent="android:theme.holo.light"> .... </style> <!-- theme without actionbar shadow (inherits main theme) --> <style name="mynoactionbarshadowtheme" parent="myapptheme"> <item name="windowcontentoverlay">@null</item> <item name="android:windowcontentoverlay">@null</item> </style> so in manifest.xml can set different style activities: <!-- activity actionbar shadow --> <act

c# - How far back can you go back with the Twitter API -

i have developed application in c# fetches in tweets database. i'm using tweetsharp wrapper. since has been announced twitter have indexed of previous tweets, allows go first tweets, started wonder if it's possible go time period. lets want see tweets contains "microsoft" time period 2008-10-10 2009-10-10. possible twitter api??? let alone possible tweetsharp module?? any answer accepted. thanks! my assumptions using free version of twitter rest api (there twitter streaming apis have no experience with) , tweetsharp wrapper on rest api. given that, i'm inclined think query requesting ("microsoft since:2008-10-10 until:2009-10-10") not possible few reasons: searching twitter rest api goes 7 days. the number of tweets relating microsoft tweets in year exceed rate limit my source adam green's blog: 140dev, nov 2013 . documentation bit vague on how far rest api go. experiences show past 7 days. rate limits pretty explicit

sql server - Get Exact Match Rows in same Sequence using SQL Query -

i have 2 table , data in following format. need match rows using sql server query table number 2 in same sequence appearing in table number 1. tab 1: sno    codeseq         lno    docno 3845   255636363      1    anydoc 3846   255696969      1    anydoc 3847   255747474      1    anydoc 3865   255646464      2    anydoc 3866   255707070      2    anydoc tab 2 sno    codeseq         lno    docno 53951 255636363    21 demo1 53952 255696969    21 demo1 53953 255747474    21 demo1 53954 255747474    21 demo1 53955 255737373    21 demo1 54086 255646464    22 demo1 54087 255707070    22 demo1 54088 255747474    22 demo1 54089 255636363    115 demo2 54090 255696969    115 demo2 54091 255747474    115 demo2 54092 255747474    116 demo2 54093 255737373    116 demo2 54094 255747474    116 demo2 i need output result in format. sno    codeseq         lno    docno 53951

c# - How to delete a appoiment from device calendar in windows phone8.1 -

when trying delete event device calender through application showing error error message: an exception of type 'system.unauthorizedaccessexception' occurred in mscorlib.ni.dll not handled in user code additional information: access denied. (exception hresult: 0x80070005 (e_accessdenied)) please @ below code iam using delete operation appointmentstore appointmentstore = await appointmentmanager.requeststoreasync(appointmentstoreaccesstype.appcalendarsreadwrite); appointmentcalendar syscal = await appointmentstore.getappointmentcalendarasync(dcalendarid); await syscal.deleteappointmentasync(dcalendareventid); anyone have idea please me.thank you do have permissions use calendar? id_cap_appointments in application manifest file wmappmanifest.xml .

ruby on rails - Can we have two workers with different jobs in Procfile for Heroku? -

i have following in procfile: worker: rake sf:subscribe web: bundle exec unicorn -p $port -c ./config/unicorn.rb worker: bundle exec sidekiq how can have above config? currently when push code on heroku, first worker task ( rake sf:subscribe ) ignored. is there other way that? only web process 'hard coded' - can call other processes whatever want, eg worker1 , worker2, start heroku ps:scale worker1=1 , heroku ps:scale worker2=1

java - Libgdx blender bullet Maximum size of model , object -

please let me understand following: 1)is there limitations on maximum size of model (from blender exported fbx g3dj) can loaded in libgdx. 2)is there limitations on maximum size of object bullet physics can handle. and can 1 please provide on best practices models , corresponding physics objects can followed have better efficiancy. thank you. for physics shapes should keep units around 1.0f . there's no hard maximum both libgdx , bullet, other of single floating point precision. if need use big models, consider scaling units. e.g. use kilometer instead of meter. the bullet manual provides useful information on choosing correct shape. have at: https://github.com/libgdx/libgdx/wiki/bullet-wrapper---using-models

jquery - Datepicker not set to value passed in the controller -

i have created datepicker using : @html.textboxfor(model => model.dateto, new { @class = "form-control dateto" }) and $(".dateto").datepicker({ dateformat: 'dd/mm/yy', numberofmonths: 1, autoclose: true, }); and in view model : [display(name = "to")] public string dateto { get; set; } and have updated field dateto , passing view in controller as: return view(searchviewmodel); in searchviewmodel, dateto set 26/11/2014. when page, caching old values , not resetting value. any input on helpful. modelstate.clear() asp.net mvc modelstate.clear . if retreive value via ajax call, set cache:false

r - Issue with sorting one column after rank is assigned -

*****this deal question asked in coursera , hence may not able reveal complete code***** hi, below data frame (outcome_h) hospital_name h_a h_f pn abc 4.5 5 6 cde 4.5 1 3 efg 5 2 1 1) need rank column provided in function call (it 1 of h_a ,h_f,pn) 2) there rank provided in call. need match rank rank calculated above , return respective hospital_name i had used ties.method="first" solve tie problem. when @ final output hospital name not sorted. example: if give rank =2, expect cde printed, due problems(which note aware) abc gets printed rank=2 , cde printed rank=1. below parts of code better understanding: h_a <- as.numeric(outcome_h$h_a) ha <- h_a[order(h_a)] // newly added piece order value df <- data.frame(ha,round(rank(ha,ties.method="first")),outcome_h$hospital_name) rowss <- df[order(df$round.rank.ha..),] before ordering output: ha round.rank.ha.. outcome_h.hos

Extjs4 Check-tree: tri state checkbox on nodes to summarize leaves states -

is possible incorporate tri-state checkbox in extjs check tree? by tri-state, mean parent node is: checked if children checked unchecked if children unchecked grey/filled if children checked not all something this: http://shamsmi.blogspot.fr/2008/12/tri-state-checkbox-using-javascript.html i found create tri-state checkbox regular forms: http://www.sencha.com/forum/showthread.php?138664-ext.ux.form.tricheckbox&p=619810 but don't know how apply custom checkbox tree view, or if possible. any idea?

javascript - Advanced Material Design Transition with JS & CSS - Where to start? -

i'm working on animation prototyping web right , noticed material design packs pretty advanced stuff. while many examples of animations visible online, found 1 got me real interested due it's fluid motion. there's video of transition in music player, container breaks free grid, information slides out behind , coloured bubble grows , cover screen while dissolving show background image. you can find video here, under "visual continuity" (displaying use on tablet, non-the less) http://www.google.com/design/spec/animation/meaningful-transitions.html this pretty far stuff i'm used to, , after 5 failed attempts i'd see how else approach problem. ideas on structure, positioning rules or else? you can use structure this: <div class="container"> <div class="image-container"></div> <img src="coolimage.png"> </div> the image-container has background-color , border-radius of 50% re

javascript - Passing variable to ON method (in jquery) -

i'm trying pass variable(present in global scope) function(present in on method). i'm passing data object on it's not working. it's working if take variable inside function. here's code: var firstname = $("#firstname").val(); $("#firstname").on("blur keyup paste", {firstname: firstname}, function(){ //access firstname }) also, best way of using on method. should use have used above or should use this? var firstname = $("#firstname").val(); $(document).on("blur keyup paste", "#firstname", {firstname: firstname}, function(){ //access firstname }) as event being raised on element has value you're trying retrieve can use this reference @ it: $("#firstname").on("blur keyup paste", function(){ var firstname = this.value; // or $(this).val(); }); with regard usage of on , first example used when element you're attaching event exists in dom. secon

javascript - window.open() causes weird table display -

i have 1 table. table items having context menu. when particular option, pop-ups new window using window.open() method, new window comes table columns in older window gets elongated. can me figure out going wrong in scenario. in advance :)

actionscript 3 - AS3 - Hindi font half letters getting converted -

i have text in hindi language should appear क्या appears क् या (without space) not way want. i embedding fonts, flash auto converting "half letters". these sentences getting read xml (which utf-8 encoded) , being directly applied textfield. in flash professional shows fine when check in app appears above. missing out on here? here textfield settings in code: tf.multiline = true; tf.wordwrap = true; tf.autosize = textfieldautosize.left; tlftextfield way go. had convert of text fields in application tlftextfields in order show international characters. tlftextfield larger in size regular textfield. notice when compile swf grow quite large if have many tlftextfield's.

javascript - Overlapping elements - HTML, CSS, and jQuery -

i have elements overlapping , prevent this. here picture: http://grab.by/cb7t also, here css elements: .navigationitem { background: #808080; -webkit-border-radius: 360px; padding: 1.0em; text-decoration: none; color: #fff; position: absolute; -webkit-box-shadow: 0px 2px 5px #909090; font-weight: bold; text-shadow: 1px 1px 2px #707070; font-size: 1.0em; } and here in html: <a href="#" class="navigationitem" id="nav0">play</a> <a href="#" class="navigationitem" id="nav1">register</a> <a href="#" class="navigationitem" id="nav2">our blog</a> <a href="#" class="navigationitem" id="nav4">contact us</a> <a href="#" class="navigationitem" id="nav5">about us</a> <a href="#" class="navigationitem" id="nav6&qu

iOS 7+ UISearchBar cancel button has unwanted alpha on highlighted state -

i have uisearchbar cancel button. cancel button has custom backgroundimage normal , highlighted states sets in appdelegate: [[uibarbuttonitem appearancewhencontainedin:[uisearchbar class], nil] setbackgroundimage:[<somenormalimage> resizableimagewithcapinsets:<someedges>] forstate:uicontrolstatenormal barmetrics:uibarmetricsdefault]; [[uibarbuttonitem appearancewhencontainedin:[uisearchbar class], nil] setbackgroundimage:[<somehighlightedimage> resizableimagewithcapinsets:<someedges>] forstate:uicontrolstatehighlighted barmetrics:uibarmetricsdefault]; everything works fine. images showing, except of highlighted state, backgroundimage showed unwanted alpha (opacity). when button highlighted, highlighted background blink , opacity changed. wasn't able find answers problem, how change appearance of cancel button (which working well). thanks help.

html - Input number in text box display the image -

i have 3000 images in folder. named 1000.jpg 1001.jpg , on. 1000 3000. make html file , have text box , when input number (ie, 1000) show me file 1000.jpg. when click file hide this. i need manage warehouse , have pattern images on mobile. thanks maybe can you-- <input type="number" id="my-input"> <a href="#">see image</a> <script> $("#b").click(function() { var s=$("#my-input").val() $("#b").attr("href", s+".jpeg"); } }); </script> so, takes value of "#my-input" , appends value of href attribute filename.

CRM 2013 Updating the Quote Product section -

has tried create plugin updates record's values in quote product form? created one, because need custom formula calculates extended amount field, there automatic calculations in crm fill these fields. doesn't allow me update formula of calculation @ all. what plugin do, is: gets values fields price per unit, quantity , discount % (which custom field); calculates value need; sets @ extended amount field. but, none of works because "business process error"; error tells me can't use record's guid access it. here code: protected void executepostquoteproductupdate(localplugincontext localcontext) { if (localcontext == null) { throw new argumentnullexception("localcontext"); } ipluginexecutioncontext context = localcontext.pluginexecutioncontext; iorganizationservice service = localcontext.organizationservice; guid quoteproductid = (guid)((entity)context.inputparameters[&