Posts

Showing posts from June, 2010

Html with Custom font in android -

i programmatically creating html file , storing same in sdcard custom font. for on first run of android application storing html file , customfont.otf in same location (i.e inside sd card). so question when pullout html file sd card , open on desktop not able see html content custom font.its opening default font of browser. when copy html file desktop want open html file custom font only how can achieve programmatically, any appreciated, thanks somewhat had similar scenario, need load html content in custom font. stored ttf (or otf) file in asset folder. created string css as private final string css = "<style type=\"text/css\">@font-face {font-family: mycustomfont;src: url(\"file:///android_asset/fonts/mycustomfont.ttf\");}body {font-family: the-2k12;}}</style>"; then while loading webview, appended string html string webview.loaddatawithbaseurl(" ", css + my_html_data, m...

python - What is the correct way to switch from os.system to Popen for spawning an interactive shell? -

i trying rid of os.system in python code, of done, have 1 line can't seem convert. os.system('/bin/sh -i -c "/bin/runner catch exts"') so far things tried: p = subprocess.popen(['/bin/sh', '-i', '-c', '/bin/runner catch exts']) that returns: /bin/sh: 1: cannot set tty process group (no such process) edit: instead of running custom runner, i've tried "ls" , still same error. os.system('/bin/sh -i -c "ls"') # works fine now trying convert -- p = subprocess.popen(['/bin/sh', '-i', '-c', 'ls']) # doesn't work returns: /bin/sh: 1: cannot set tty process group (no such process) trying (this shouldn't work, suggested user in comments): p = subprocess.popen('/bin/sh -i -c "ls"') returns: oserror: [errno 2] no such file or directory interactive shells aren't possible popen . subprocess module designed gi...

html - CSS property applied after inspect element -

i'm working on site egtripper.com , when page load slider section doesn't in center expected, , css slider .slider { width: 1000px; height: 330px; margin: 30px auto; overflow: hidden; position: relative; } but when try inspect slider chrome tools, position fixed can me, thanks just suggesting, wrap .slider div 100% width, overflow hidden , position relative. and try removing 'min-width', if possible.

android - Setting custom ttf font in preference activity -

i trying set custom ttf font inside preferenceactivity. the preference activity contains 2 listpreferences, nothing else. inside preferenceactivity, have code: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.prefs); preferencemanager.getdefaultsharedpreferences(this).registeronsharedpreferencechangelistener(this); } public void onsharedpreferencechanged(sharedpreferences sharedpreferences, string key) { preference conpref = findpreference(key); // works correctly, i'm able correct text form tv.gettext(); textview tv = (textview) conpref.getview(null, null).findviewbyid(android.r.id.title); typeface gilfontbook = typeface.createfromasset(getassets(), "fonts/gilbook.ttf"); tv.settypeface(gilfontbook); // doesnt change typeface } but doesn't work form me. fontface remains same before , after selecting item listpreference as far know you...

python - Two classes with a structurally identical method but one differently named variable -

i have 2 classes common function f , here: class classa(object): def f(self, var): self.a = g(var, self.a) # specific code classa, changing self.a class classb(object): def f(self, var): self.b = g(var, self.b) # specific code classb, changing self.b in both classes, f same on 2 variables called a , b , structurally equivalent. put f abstract class avoid code duplication. 1 way is class classx(object): def f(self, var): self.x = g(var, self.x) class classa(classx): # specific code classa, changing self.x class classb(classx): # specific code classb, changing self.x in solution variables a , b have been renamed x . however, make code more self-explaining, keep specific names (say a , b ) x in special classes. is there way this? also please comment if can suggest more meaningful , descriptive title, becomes more valuable community. edit: solution should work if variables a , b take type pass-by-value ...

ruby on rails - Accessing nested models in an after_create callback -

i have model accepts_nested_attributes_for child model: class parentresource < activerecord::base has_many :child_resources accepts_nested_attributes_for :child_resources after_create :log_child_resources private def log_child_resources logger.debug "child resources: #{child_resources}" end end unfortunately, after_create callback doesn't log child_resources, when child_resources provided nested attributes. these child_resources saved , accessible, @ point cannot examine them child_resources . presumably because parent_resource saved before nested children, there not yet children in associative array. so question is: @ point in creation cycle, there way access child_resources? well, can try , log each child resource in own after_create callbacks. since these records aren't created yet, can log supplied attributes: logger.debug "child resources: #{child_resources_attributes}"

android - Eclipse can't find generated ids from R.java -

i have strange problems eclipse (kepler) , r.java file. symptom (but not always), eclipse either doesn't generate r.java file @ all, or if generate it, marks of ids not resolvable in source. though ids show in r.java file. i've been using project > clean million times now, behaviour keeps coming back. obvious things restarting eclipse not seem change anything. here's example: (gameactivity.java) protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.game); // "game" marked not resolvable } (r.java) public final class r { public static final class layout { public static final int game=0x7f030000; public static final int main=0x7f030001; } } any ideas going on here? after find , fix wrong code, try clean projects , generate again.this because have 1 or more errors in code. please verify project. after find , fix wrong code should work

How to use Shape Distance and Common Interfaces to find Hausdorff Distance in Opencv? -

i find hausdorff distance between 2 canny detector output image contains group of contours, find similarity of 2 shapes. need find hausdorff distance estimation. opencv has function implemented in it? i've found this link in opencv api reference cant find how use anywhere. please guide me how use functions? there's nice sample on github this, 'll need opencv3.0 (master branch) use it. actually , hausdorff distance not big mystery, // internal helper: int distance_2( const std::vector<cv::point> & a, const std::vector<cv::point> & b ) { int maxdistab = 0; (size_t i=0; i<a.size(); i++) { int minb = 1000000; (size_t j=0; j<b.size(); j++) { int dx = (a[i].x - b[j].x); int dy = (a[i].y - b[j].y); int tmpdist = dx*dx + dy*dy; if (tmpdist < minb) { minb = tmpdist; } if ( tmpdist == 0 ) ...

php - Jquery Form Validation in ColorBox -

i click on link opens colorbox ... in colorbox have loaded form(addproject.php) <a href="#" id="addproject"> <script> $('#addproject').on('click',function(){ $.colorbox({ width:'450px',height:'370px',top:'80px', opacity:0.3, iframe:true,href:"addproject.php"}); }); }); </script> i want validate form fields of addproject.php displayed in colorbox. code in addproject.php ---> <script> $(document).ready(function(){ $("#addpro").on("click",function(){ $("#validate").validate({ rules: { pro_name: "required", pro_desc: "required", }, messages: { pro_name: "enter project name", pro_desc: "enter project description", ...

java - self-signed applet running in windows,but not in linux -

Image
i have developed applet, , self-signed it. working on browsers on windows machines, when try run on linux, shows following error: "your security settings have blocked self-signed application running" . need deploy applet several machines,on whom don't have control. plz me , tell me how free. thanx in advance. the new security panel of java deines security level high default, means can't run unsigned or self-signed apps on older versions of java . my bet running older version in linux distro. if running applets, wise alert users keep java updated latest version.

android - How to add a button to actionbar? -

i have tried adding looking @ various guides , stackoverflow topics, didn't help. various guides say, still unable settings icon @ action bar. mainactivity.class: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); actionbar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); if (savedinstancestate == null) { getsupportfragmentmanager().begintransaction() .add(r.id.container, new placeholderfragment()) .commit(); } } @override public boolean oncreateoptionsmenu(menu menu) { menuinflater inflater = getmenuinflater(); inflater.inflate(r.menu.entry_test, menu); return true; } @override public boolean onoptionsitemselected(menuitem item){ intent myintent = new intent(getapplicationcontext(),mainactivity.class); startactivityforresult(myintent, 0); return true; } entry_test.x...

how to write a OQL query comparing with number -

this oql query have written select * myclass.session ses ses.creationtime <= 1391171576144 i following error when execute query java.lang.numberformatexception: input string: "1391171576144" @ java.lang.numberformatexception.forinputstring(numberformatexception.java:65) @ java.lang.integer.parseint(integer.java:495) @ java.lang.integer.parseint(integer.java:527) the attribute value type|name |value long|creationtime|1391172135198 you need add l @ end; otherwise, 1391171576144 interpreted integer: select * myclass.session ses ses.creationtime <= 1391171576144l

Linker error, Xcode 5 and Armadillo: "library not found for -larmadillo.4.0.2" -

i'm trying install , compile small example program using armadillo framework, unfortunately i'm getting linker errors. here steps far: installed armadillo edited config.hpp remove constant definition of arma_use_wrapper added accelerate framework xcode project added /usr/include/ header search paths added /usr/lib/ library search paths added libarmadillo.dylib "link binary libraries" section modified include statements #include "/usr/include/armadillo" specifically, linker error in xcode 5 follows: > ld: library not found -larmadillo.4.0.2 clang: error: linker > command failed exit code 1 (use -v see invocation) does have clues i'm missing/doing wrong? i've tried solutions posted in similar questions no success, in advance! edit : interestingly, compiling , running example programs in terminal functions correctly! i'm not sure why, removing link libarmadillo.dylib in "link binary libraries" secti...

customization - Searching for a Custom Forms -

i have question working customforms. implement function/search in suitescript search customform name instead of id. suggestions? not sure 100% problem, see if doen't help: remove code email support case script sets field "customform". create specific role user used create cases - don't assign generic role, "administrator". in code script, specify role created in #2 login/authentication. now, can flip , forth between forms netsuite ui making needed form default role created in #2. all other users unaffected, , won't have modify script going forward, except if have new functionality add it. the other option make script use standard case form. way, you'll never need change it. standard form contain custom fields , standard fields. thing need control preferred form role.

python - How to unpack optional items from a tuple? -

this question has answer here: idiomatic way unpack variable length list of maximum size n 5 answers how unpack tuple of length n m<n variables [duplicate] 5 answers i have list of input values, of first couple of mandatory , last couple optional. there easy way use tuple unpacking assign these variables, getting none if optional parameters missing. eg. a = [1,2] foo, bar, baz = # baz == none ideally length - including longer 3 (other items thrown away). at moment i'm using zip list of parameter names dictionary: items = dict(zip(('foo', 'bar', 'baz'), a)) foo = items.get('foo', none) bar = items.get('bar', none) baz = items.get('baz', none) but it's bit long-winded. from linked question, works:...

performance - Python - Fastest way to generate list of random colours with fixed alpha -

so i'm looking generate large list of approximately 332 million colours (tuples 4 values - r,g,b,a) in python, fixed alpha value of 0.6. need duplicate every colour in row below (i.e. end 664 million rows - 332 million distinct colours. i have tried , tested many methods have concluded fastest far use numpy to: create array of length 332 million containing 3 random float values per row using numpy random create second array of same length values [0, 0, 0, 0.6] per row using numpy tile copy values first array first 3 values per row of second array use numpy repeat function repeat every row onto new inserted row below (interleave array duplicates of previous row) the code takes approx. 574 seconds or 10 minutes , is: import time import numpy np t1 = time.time() randomnos = np.random.random_sample((332000000, 3)) trans = np.tile([0,0,0,0.6],(332000000, 1)) trans[:,:-1] = randomnos colorarray = np.repeat(trans, 2, axis=0) t2 = time.time() totaltime = t2 - t1 prin...

entity framework - EF 6 Code based migration exception: Microsoft.VisualStudio.Data.Tools.Package not serializable? -

i have configuration internal sealed class configuration :dbmigrationsconfiguration<ias.models.applicationdbcontext> { public configuration() { automaticmigrationsenabled = false; contextkey = "ias.models.applicationdbcontext"; } protected override void seed( ias.models.applicationdbcontext context ) { var basedir = appdomain.currentdomain.basedirectory; context.database.executesqlcommand(file.readalltext(basedir + "\\myinsertscriptsql")); } } when running upate-dataabase following exception excepción al llamar "setdata" con los argumentos "2": "el tipo 'microsoft.visualstudio.data.tools.package.internal.oaproject' del ensamblado 'microsoft.visualstudio.data.tools.pa ckage, version=11.1.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a' no está marcado como serializable." en d:\d...

python - Configuration of Ipython -

i'm new python , ipython. i'm following data analysis pandas on youtube. the link i installed anaconda , started use ipython on windows 8.1 for several commands, seems ok in [2]: print 5 5 but when tried followe tutorial online seems ipyhon has got problems, in [3]: %pylib inline error: line magic function `%pylib` not found. also, copies code tutorials, simple codes this in [4]:plot(arange(10)) nameerror traceback (most recent call last) <ipython-input-6-353c92d67d6b> in <module>() ----> 1 plot(arange(10)) nameerror: name 'plot' not defined after "imported matplotlib", still didn't work. also, code a = arange(10) didn't work. have use this: import numpy np = np.arange(10) but tutor in video didn't use this. i think should associated configuration anaconda or ipython? but i'm not sure , don't know how figure out. i'm using latest version of anaconda on windo...

java - Android gridview change backgound by position -

i have gridview images. above image have text(hello) , can show images(without text) gridview .now want if click gridview's 5th element want hide 5th image's text.meybe problem solution gridview.setonitemclicklistener not know how can wrote code witch can show toast message position,but not know how can hide text position gridview.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view v, int position, long id) { toast.maketext(getapplicationcontext(), "cliked" + position, toast.length_short).show(); } }); you try setvisibility along array sort through gui identifiers: int textid = this.getresources().getidentifier(position, "id", this.getpackagename()); textview pictext = (textview) findviewbyid (r.id.textid); pictext.setvisibility(textview.invisible); or that. invisible makes inv...

css - Hover on td affect superior tr -

i made table first <tr> has 2 <td> (the first rowspan) , second <tr> has <td> . want when make hover on <td> of second <tr> affect , first <td> of first <tr> . this similar want: http://jsfiddle.net/m3wya/ this code: <table class="class"> <tr><td rowspan="2">a</td><td>b</td></tr> <tr><td>c</td></tr> </table> if make hover on b want , b change (it works .class tr:hover{} ) , if make hover on c want , c change in same way. it's possible make css? don't know how (i know sibling selector can't find how use here. if it's not possible css how javascript? this solution: http://codepen.io/anon/pen/cghwl you won't able css alone. couldn't find generic javascript solution, created following in jquery. hope helps: http://jsfiddle.net/uject/1/ $("td").hover(function(){ var $...

Git remote tags aren't staying deleted -

we attempting delete tags on our remote git server mistakenly added, don't seem want stay deleted. i'm deleting git tag -d 12345 git push origin :refs/tags/12345 then i've instructed team members run git fetch , git fetch --tags update locals. suspected people may have been pushing before fetching, pushing tags local should have been deleted, except after going through couple times, remote tags still showing up. is there step missing? might try: git push --delete origin tagname

R Scale plot elements within PDF of set width and height -

Image
though r plots sent pdf can rescaled @ in illustration or page layout software, scientific journals insist plots provided have specific dimensions. can size of plotting elements scaled within given pdf size directly in r? require(ggplot2) p <- qplot(data=iris, x=petal.width, y=petal.length, colour=species) pdf("./test_plot_default.pdf") print(p) graphics.off() produces adequate scaling of plot elements however, changing pdf size elements not cause plot elements scale. smaller pdfs, plotting elements overly enlarged compared plotting space. pdf("./test_plot_dimentionsions required journal.pdf", width=3, height=3) print(p) graphics.off() using @rosen matev suggestion: update_geom_default("point", list(size=1)) theme_set(theme_grey(base_size=6)) pdf("./test_plot_dimentionsions required journal.pdf", width=3, height=3) print(p) graphics.off() journals insist on having specific pl...

jQuery removeClass called at end of slideUp removes from all elements not just this -

i struggling (pretty simple) jquery. have few boxes on page slide description on rollover. slide starts class added , when ends class removed - done classes rather hover styling remains until slide completes. it works fine on individual box when mouse off 1 box , straight onto class gets removed second box , left on first first item completes slide up. here jquery: jquery(document).ready(function () { // rollover on features jquery(".titleimageblurbandlinkwrapper a").hover( function () { thisfeature = jquery(this); // change class when slide starts thisfeature.addclass("hover"); // show info sliding thisfeature.find(".blurb").stop(true, true).slidedown(); }, function () { // hide info thisfeature.find(".blurb").stop(true, true).slideup({ queue: false, complete: function() { // change class when slide finishes...

dom - Javascript state for saved values in fields? -

i'm using javascript library move field labels field itself. when user starts typing in field, fade out. however, when user has saved username/password in fields, library isn't smart enough not put labels in fields, text of label overrun username or obfuscated password. is there state of pre-populated fields query javascript selectively disable moving labels fields? edit library i'm using: in-field labels jquery plugin i see there has been vote close question because unclear. let me try more clear. when page loads, there saved username , password in username , password fields. wondering if there property on these fields tell me if populated saved values when page finishes loading. if unclear please ask clarifying question. the reason want know because using javascript library puts field's label visually within field, [username____] instead of username [________] . problem when browser has saved username, text "username" in field runs on saved us...

ios - Is it possible to have multiple UIViews inside a UIPageViewController -

i trying set uipageviewcontroller swipes through 3 different views. need have uicollectionview , uitableview , uicollectionview different format. can clarify, whether possible or not? have been searching last couple days , have not found definitive answer. not asking solve me, want know if should give , go different approach. yes, possible. from uipageviewcontroller class reference: a page view controller lets user navigate between pages of content, each page managed own view controller object. you need have viewcontroller each page. recommend read here: https://developer.apple.com/library/ios/documentation/uikit/reference/uipageviewcontrollerclassreferenceclassref/uipageviewcontrollerclassreference.html

java - listview crash after i put in cutom arrayadapter -

i start program android , want make program little more complex, practice. i run on problem related how java super classes work , can not debug know @ moment. i wrote code work perfectly, when put listview in default arrayadapter , try make custom arrayadapter crash try refresh listview. here part of code related custom adapter: private button buttonnovoime; private listview lvradnici; private arraylist <string> listaradnikaarray; private stablearrayadapter adapter; private edittext novoime; private textview buferzaime; private textview errortext; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_organizator_smena); buttonnovoime= (button) findviewbyid(r.id.buttonnovoime); lvradnici = (listview) findviewbyid(r.id.listviewradnici); listaradnikaarray = new arraylist<string>(); novoime = (edittext) findviewbyid(r.id.edittextnovoime); errortext= (text...

twitter bootstrap - How do I load the Antetype default widgets to use in my project? -

Image
i'm using recent version of antetype , created web bootstrap project , wireframe blank project cannot see default antetype widgets (i.e. radio button, checkbox, dropdown). searched on google , antetype , support cannot seem find how load in default widgets. found widgets stored in shared library , pull down ones need project, can't figure out how view shared library or view all of widgets. in version 1.3 of antetype find widgets in each of templates, can copy them shared library. 1.3 shipped empty shared library. in version 1.4 due out next month find pre-loaded shared library (renamed widget library) 420 new widgets.

Servicestack - Grouping like services together -

was wondering if there's recommended best-practice way of grouping similar services in what's becoming larger , larger project. of services can lumped in either dealing "pro" data or "amateur" data (the data goes way beyond simple flag in table, data totally different, different tables, on pro or amateur side. i know can add routes classes... /pro/service1 /am/service2 it looks can put dtos in namespaces.... what service.interface items (service , factory classes). put namespaces also? finally, there way metadata page reflect these groupings? started go down road, services listed out in alphabetical order, , couldn't see route or namespace differences between service1 , service2. thank you if want, can split multiple service implementations across multiple dlls described on modularizing services wiki . you can safely group service implementation classes nested folder groupings without having impact external services. changin...

angularjs - Stop propagation of underlying ng-click inside a jQuery click event -

a twitter bootstrap dropdown nested inside tr . tr clickable through ng-click . clicking anywhere on page collapse dropdown menu. behavior defined in directive through $document.bind('click', closemenu) . so, when menu opened, , user click on row, want menu close (as does) , want prevent click event on row. jsfiddle : http://jsfiddle.net/lmc2f/1/ jsfiddle + directive inline : http://jsfiddle.net/9dm8u/1/ relevant code ui-bootstrap-tpls-0.10.0.js : angular.module('ui.bootstrap.dropdowntoggle', []).directive('dropdowntoggle', ['$document', '$location', function ($document, $location) { var openelement = null, closemenu = angular.noop; return { restrict: 'ca', link: function(scope, element, attrs) { scope.$watch('$location.path', function() { closemenu(); }); element.parent().bind('click', function() { closemenu(); }); element.bind('click', function (event) { ...

Valgrind stack trace missing symbol names -

i running "valgrind --tool=memcheck --leak-check=full -v" , call stack being reported missing symbols. here's i'm seeing: ==11734== 20 bytes in 1 blocks lost in loss record 5 of 29 ==11734== @ 0x4005903: malloc (vg_replace_malloc.c:195) ==11734== 0x5308223: ??? ==11734== 0x53077fb: ??? ==11734== 0x52d8b17: ??? ==11734== 0x52f3a1d: ??? ==11734== 0x5259b3d: ??? ==11734== 0x5258274: ??? ==11734== 0x5251e26: ??? ==11734== 0x524735d: ??? i running debug build using shared object libs, should not problem because have used valgrind on app many times, using shared object libs. ideas?

html - Not able vertical align -

Image
hi trying align text ' mybrand ' middle of box(highlighted in orange ). not able achieve that. have tried using ' vertical-align: middle '. not working. missing here? css header, nav, form, a, ul, li, form, img, input { padding: 0px; margin: 0px; } header { width: 980px; background-color: #6c8dd5; margin-right: auto; margin-left: auto; font-family: "helvetica neue", sentinal, sans-serif; padding-top: 7px; padding-bottom: 7px; } header nav {display: table;} header nav ul {display: table-row;} header nav ul li {display: table-cell;} header nav ul img { width: 25px; height: 25px; } html <header role="banner"> <nav role="navigation"> <ul> <li id="logo"> <a ...

mysql - Summing timestamp returning incorrect value and format -

i looking pull scheduled hours in given time period. our start , end schedule times datetimes converted them timestamps. when dont sum them looks correct, when sum them on time period, output isnt in timestamp format , numbers incorrect. the query using: select sal.public_name, sum(timediff(timestamp(end_time), timestamp(start_time))) bi.support_agents_list sal join bi.support_sp_shifts_scheduled ss on ss.agent_sp_id = sal.sp_id join bi.support_sp_shifts s on s.pk_id = ss.pk_id date(start_time) between '2014-01-29' , '2014-01-31' group sal.public_name a few examples of results getting: agent 1: 53000 - when should 5.5 hours or 5:30 agent 2: 196000 - when should 20 hours any thoughts on this? prefer output in hour count 5 hours , 30 min formatted 5.5 rather 5:30. try instead of sum date_format(timediff(timestamp(end_time), timestamp(start_time)), '%k hours, %i minutes, %s seconds') thesum like that select sal.public_name, ...

jquery - Marking Only Some List Items with a Class -

i have following list item <ul id="lxx" class="lst"> <li>arnold</li> <li>becky</li> <li>arnold</li> <li>kathy</li> <li>carol</li> <li>arnold</li> <li>carol</li> </ul> i using code adds class 'someclass' items repeated more once. $('#lxx li').filter(function(){ return $(this).siblings().text().touppercase() .indexof($(this).text().touppercase()) != -1; }).addclass('someclass'); however happens original item gets highlighted using above code, whereas want repeated items highlighted. out of arnold, arnold , arnold last 2 should highlighted. other dups too. how can change code accommodate this? also there better way this? try var texts = {}; $('#lxx li').filter(function () { var text = $.trim($(this).text().tolowercase()); if (texts[text]) { return true; } ...

c# - Windows Phone 8 Map incremental movement based on series of coordinates -

i want have map control on windows phone move between coordinates 1 one. cannot seem the map control wait until animation has finished reaching 1 location before tries move next. have tried few ways wait between movements no avail. here code have far sample app. public mainpage() { initializecomponent(); map.center = new geocoordinate(54.958879, -7.733027); map.zoomlevel = 13; } private void button_click(object sender, routedeventargs e) { list<location> locations = new list<location>(); (double x = 0, y = 0; y < 10; x+=0.005, y++) { locations.add(new location(54.958879 + x, -7.733027 + x)); locations.add(new location(54.958879 - x, -7.733027 - x)); } foreach (location location in locations) { map.setview(new geocoordinate(location.latitude, location.longitude), 13, mapanimationkind.linear); //i want app wait until view has finished movi...

javascript - C:\fakepath\*.* in Ajax, jquery -

this question has answer here: how can upload files asynchronously? 25 answers how send cross-domain post request via javascript? 17 answers i trying document able pass through ajax , jquery , keep getting c:\fakepath\ when attempting pass through. know security feature within browsers, haven't found way past it, passes doc. here's code, , jsfiddle. appreciated, can't figure out. <form method="post" action="contact.php" name="contactform" id="contactform" enctype="multipart/form-data"> <label for="email" accesskey="e"><span class="required">*</span> fbn document</label> <input name="fbndoc" type="file" id="fbndoc" size=...

javascript - creating extjs store data record is failing -

i have error uncaught typeerror: cannot read property 'items' of undefined following line create neweditinfo type. alert shows there values in arrays have no clue.. getneweditinfo : function () { var values = {}; var form = this.getform(); var formvalues = form.getvalues(); (var fieldname in formvalues) values[fieldname] = (formvalues[fieldname] != "") ? formvalues[fieldname] : null; alert(json.stringify(values)); alert(json.stringify(formvalues)); neweditinfo = ext.data.record.create([{ name : "id", type : "string" }, { name : "hardwareid", type : "string" }, { name : "location", type : "string" }, { name : ...

c - What is the compiler warning option for catching array length mismatches? -

i did not dig enough on own, thank time , responses. in actual code (proprietary embedded) header extern 's #ifdef 'ed , default not create them when .c included .h . when set option did produce warnings (errors actually) had wanted. i have header with: extern int array[10]; and source file with: int array[2] = {0, 0}; clearly incorrect. how can cause compiler warn me? error acceptable well. compilers of interest me gcc (old, 3.4.5) , tasking (not new, 2.3r3). note succeed @ not making error supplier code generation application apparently this. of course, getting application fixed important , can write script compare files, general compile time solution catch error in cases preferred.

wordpress plugin - poedit string too long error -

Image
i have error 'string long' when trying scan wordpress plugin translation. have been on plugin fine tooth comb there no mistakes in translatable strings , quite short. have looked clues in documentation , forums error pertains far no luck. know error means? many thanks

iis - ApplicationPoolIdentity or Local Services privileges -

iis 7.5 has new inbuilt identity called applicationpoolidentity. iis takes care of authentication , avoiding interference of other process running network services. know whether applicationpoolidentity has more permissions or local services. per understanding local system has got higher privilege, network service , local services minimum privileges given applicationpoolidentity. if running iis application in applicationpoolidentity can access network resources. can please clarify minimum privileges?? thanks keshav

SQL Server : Pathname of stored tables -

what pathname tables stored in, please ? cannot drop table 'dbo.superviseur', because not exist or not have permission. i've got error, thought may try delete table manually. delete table manually. that's how big database server sql server works. did was "delete manually". error message pretty descriptive. either it's not in database you're connected to, or account doesn't have permission. satisfy prerequisites, , table can dropped.

html5 - how to share a video from my website on facebook like youtube -

i have website has html5 video player. i want share link ( ex: http://site.com/video/example-2 ) on facebook , 1 users click on image of post on facebook starts playing video there. just youtube videos , vimeo videos. how can that? thanks i have website has html5 video player. you want find swf (*.swf) video player can stream video url={video_hot_link} (pass url parameter swf player) now after got swf player ready streaming videos add facebook open graph <head> tag below: <meta property="og:type" content="video"> <!-- site/page type more information http://ogp.me/ --> <meta property="og:video:type" content="application/x-shockwave-flash"> <!-- need because player swf player --> <meta property="og:video:width" content="width in pixels"> <!-- player width --> <meta property="og:video:height" content="height in pixels"> <!-...

windows - Python script importing results to ctrl-c memory -

i know possible python script import results clipboard (ctrl-c memory) on windows. enable me manipulate-transfer results more easily. is possible do? how? it's called "clipboard" copied this link : import ctypes def winsetclipboard(text): gmem_ddeshare = 0x2000 ctypes.windll.user32.openclipboard(0) ctypes.windll.user32.emptyclipboard() try: # works on python 2 (bytes() takes 1 argument) hcd = ctypes.windll.kernel32.globalalloc(gmem_ddeshare, len(bytes(text))+1) except typeerror: # works on python 3 (bytes() requires encoding) hcd = ctypes.windll.kernel32.globalalloc(gmem_ddeshare, len(bytes(text, 'ascii'))+1) pchdata = ctypes.windll.kernel32.globallock(hcd) try: # works on python 2 (bytes() takes 1 argument) ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchdata), bytes(text)) except typeerror: # works on python 3 (bytes() requires encoding) ctypes.cdll.ms...

Does latest Cassandra support openJDK? -

on github readme says tested on >=1.7 (openjsk , sun). however, when looked @ cassandradaemon.java , warning asks upgrade oracle java still exists. can comment on ? i sure datastax testing against openjdk, recommendation use sun jdk. there several people on community use openjdk without problems there have lot of problems openjdk. if read few lines later started: https://github.com/apache/cassandra/blame/trunk/src/java/org/apache/cassandra/service/cassandradaemon.java#l119 you see 1 example warns may not work intended if non-sun-jdk used. affect performance , gc. so, use openjdk @ own risk. latest version required java 7.

css - How to skip <p> tag in HTML? -

i'm trying use ckeditor wysiwyg editor blog posts. works fine, contents inserted fine in db. however have 1 problem. ckeditor inserts automatic <p> tag in begining, mess code while returning db.(i loose css stylings). therefore, i'm wondering there way tell html ignore(skip) tag (and closing 1 in end). thank you... you need change configuration file (plugin.js) this: config.autoparagraph = false; whether automatically create wrapping blocks around inline contents inside document body, helps ensure integrality of block enter mode. http://docs.cksource.com/ckeditor_api/symbols/ckeditor.config.html#.autoparagraph

debugging - Can I debug my iOS app on a device without adding it to the Apple provisioning portal? -

i want run app in debugger. there way without adding apple portal? or perhaps enterprise provisioning profile used debugging? no. need running on device enabled development. need have been added development portal. an enterprise-signed app won't allow debug connection. you can run in simulator , attach without provisioning profile however.

Problems using jquery.knob dynamicly -

i dynamicly load js - files: $(document).ready(function () { $.when( $.getscript("./setup/js/jquery.knob.js"), $.deferred(function (deferred) { $(deferred.resolve); }) ).done(function () { $(function ($) { $(".knob").knob({}); }); }); }); in source error "object [object object] has no method 'knob' " when load sources inside page using works fine, have wrap whole page js-file no other error messages in console, no security-related error messages (update) when copy/paste complete knob-source .js works, of course not preferred solution

cron - Why does this node.js script not run in crontab? -

if run node.js script in containing directory, runs fine. if run crontab */1 * * * * /usr/local/bin/node /users/full/path/to/main >> ~/mtf.log i see errors relating twilio config var twclient = require('twilio')(configtwilio.accountsid, configtwilio. ^ typeerror: cannot read property 'accountsid' of undefined why doesn't work when run cron? same behaviour occurs on server (ubuntu) , localhost (osx 10.8.5) top of script (main.js) var phantom = require('phantom'); var portscanner = require('portscanner'); var feedparser = require('feedparser'), request = require('request'); var configdb = require('config').db; var configtwilio = require('config').twilio; var mysql = require('mysql'); var twclient = require('twilio')(configtwilio.accountsid, configtwilio.authtoken); the co...

css - How to push Fixed div with another fixed div -

how push fixed top div 100% width, when fixed right div supposed push right side? making collapsible mobile menu. toggled button on top fixed div. right now, right fixed div overlaps top fixed div menu button. want button move left on screen visible @ times. how accomplish this? have not worked whole lot fixed elements in css. help. note: see menu , menu button talking resizing browser window smaller. menu designed mobile layout. site: http://dai1.designangler.com/ css: #slide-menu { margin-right: -250px; right: 0; top:0; width: 250px; background: #222; position: fixed; height: 100%; overflow-y: auto; z-index: 10001; font-family: roboto,sans-serif; color: #fff; font-weight: 100; font-size: 1.5em; } #push{ /* div holds menu button */ position: fixed; top: 0; padding: 0 1em; background: #366982; width:100%; display:none; z-index: 10000; } screenshots illustrate point: menu closed: http://prntscr.com/2oaf82 menu open button ...

c++ - Undefined reference to operator << in inherited class -

i'm trying overload << , >> operators polygon class , derived triangle class. problem compiler returning following error: error: undefined reference `operator<<(std::ostream&, triangle const&)' i did define above operator however. have following line in triangle.h file: std::ostream & operator << (std::ostream & os, triangle const&); this problem occurs triangle class. when remove line trying output triangle, program works correctly. there no problem outputting polygon. causing problem , how fix it? problem include hierarchy? i think relevant files main.cpp, triangle.h, , triangle.cpp included full copy of code below in case error caused else. thank , patience. main.cpp #include <iostream> #include "triangle.h" using namespace std; int main() { triangle t (vertex (0, 0), vertex (5, 0), vertex (0, 5)); triangle l (t); cout << l[0] << endl; cout << "l: " ...

java - BFS: PriorityQueue not getting empty -

so want solve problem described in last post: terrain/mountain algorithm not working intended . copy of problem following: i want create terrain mountain on it, using basic principle, shown height mapping: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 1 2 3 2 1 0 0 0 0 0 1 2 3 4 3 2 1 0 0 0 0 0 1 2 3 2 1 0 0 0 0 0 0 0 1 2 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 it starts @ random point height = 4 , , gradually decreases amonst neighbours. the recursive idea simple, start point, recurse top/down/left/right height - 1 (in example), , if not encountered yet, set values. so went ahead , implemented bfs: private void createmountain(final float[][] heightmapping, final float startheight) { boolean[][] traversed = new boolean[width][depth]; boolean positive = (startheight >= 0f); int x = random.nextint(width); int z = random.nextint(depth); priorityqueue<queueelement...

c# - Use certificate when issuer is not is X509Store trusted roots for client authentication using Microsoft .NET framework -

while working on question, identified problem different stated, changing title , description i'm trying authenticate myself against webservice using client certificate. using webrequest purpose. need use self-signed certificate, without registering in windows x509 trusted root store. the way know if client certificate presented or not examining request object on server i tried use code this question guidance. doesn't work on .net. here code: var certificate = new x509certificate2(properties.resources.mycert); httpwebrequest req = (httpwebrequest)webrequest.create(host); req.clientcertificates.add(certificate); webresponse resp = req.getresponse(); var stream = resp.getresponsestream(); what observe though req.clientcertificates contain certificate valid private key, certificate never presented server. no indication webclient certificate not used during handshake. if put certificate "trusted root...