Posts

Showing posts from May, 2013

oracle - How to categorize several columns in one statement in SQL/PLSQL -

i've got table 20 columns categorize like; 0-25 --> 1 25-50 --> 2 50-75 --> 3 75-100 --> 4 i prefer not use 20 case ... when statements. knows how more dynamically & efficiently? can sql or pl/sql. i tried pl/sql, didn't see simple method use column names variables. many thanks. frans your example bit confusing, assuming want put value categories, function width_bucket might after: something this: with sample_data ( select trunc(dbms_random.value(1,100)) val dual connect level < 10 ) select val, width_bucket(val, 0, 100, 4) category sample_data; this assign numbers 1-4 (random) values sample_data. 0, 100 defines range build buckets, , final parameter 4 says in how many (equally wide) buckets should distributed. result of function bucket value val fall. sqlfiddle example: http://sqlfiddle.com/#!4/d41d8/10721

destroy - How do I delete all div with an id that begins with xyz with dojo 1.8.3? -

i want delete <div> id begins xyz dom tree. i know can done dojo.query , dojo.destroy never used combination before. i tried doesn't work: var divnodeswidgets = dijit.findwidgets('[id^="divnodes"]'); dojo.foreach(divnodeswidgets, function(d) { d.destroyrecursive(true); }); var ulwidgets = dijit.findwidgets('[id^="ulnodes"]'); dojo.foreach(ulwidgets, function(u) { u.destroyrecursive(true); }); var headingwidgets = dijit.findwidgets('[id^="h1nodes"]'); dojo.foreach(headingwidgets, function(h) { h.destroyrecursive(true); is destroying widget or element, if element try with: dojo.foreach(dojo.query('[id^="xyz"]'), function(entry,idx){ dojo.destroy(entry); alert(entry + " destroyed"); }); or dojo.query('[id^="xyz"]').foreach(dojo.destroy);

How to add 1 day to current date and have result in format yyyymmdd in SQL Server? -

i need add 1 day current date , have output in format yyyymmdd. code needs written on stored procedure on sql server. currently code follows: declare @dat date select @dat = dateadd(dd, 1, getdate()) select @dat =left(convert(varchar(8), @dat, 112),10) however, seems im doing wrong output on sql table in format yyyy-mm-dd. need rid of hyphens. any suggestions guys? in advance. the issue assigning date object. need assign varchar. i did following in sql server 2005: declare @dat datetime declare @string varchar(8) set @dat = getutcdate() select @dat = dateadd(dd, 1, getdate()) select @string =convert(varchar(8), @dat, 112) print @string

Using bootstrap-datetime picker with AngularJS -

my project needs datetime found (meridian format in) bootstrap-datetimepicker seems pretty good, not able use it all did in code <div class="control-group"> <label class="control-label">date</label> <div class="controls"> <div class="control-group input-append date form_datetime" data-date="2012-12-21t15:25:00z"> <input size="16" type="text" ng-model="transaction.date" data-date-format="yyyy-mm-dd hh:ii" value=""> <span class="add-on"><em class="icon-remove"></em></span> <span class="add-on"><em class="icon-th"></em></span> </div> </div> </div> but when console.log($scope.transaction) in controller $scope.save = function() { var transaction = new transaction(); transaction.

rest - OAuth access token for internal calls -

i'm tyring build api driven symfony2 web applicaiton.just basic application learn symfony2 , rest. it based on restful api. calls api authenticated using oauth. for e.g.: if client application wants data (information fruits) through api need make request url , pass access token parameter.so url this. http://www.mysite.com/api/fruits.json?=<access token> now problem needing same data in 1 of actions well. i need here.in order get data above url in 1 of actions need send access token in url. how access token?? should there fixed token used such calls within application?? you basic application project grow manifold if try want here. basically, need implement authentication server this. i) first, app should registered scope; ii) using app user logs in authentication/authorization server. iii) server verifies if app has access scope , if user registered in system. iv) server creates access token (which hmac signed string) , returns app. v) app hits

sql - calculation shows NaN error -

in visual studio report have sum of 2 textboxes when calculated shows 'nan'. reason because calculation projects 0. simple calculation textbox 1 / textbox 2. is there way can code show 0.00 or show blank instead of nan when type of project selected drop down parameters? i cannot have seperate report different prioject types linked same overall totals. any advice appreciated. change formula iif statement evaluate 2 textboxes. need make sure both numeric , divisor not zero. if of true, set value 0.00 else calculation.

sql update - Updating Multiple Columns from another table - Need Oracle format -

i have script use in sql server need convert oracle format. can help? update persons p set p.jobtitle=te.jobtitle, p.last_name=te.last_name, p.first_name=te.first_name, p.dblogin_id=te.dblogin_id, p.email_id=te.email_id, p.userlevel=te.userlevel, p.facility_id=te.facility_id, p.supervisor=te.supervisor, p.department=te.department, p.winloginid=te.winloginid temp_ecolab_persons te p.person=te.person; --from article below came following statement. still doesn't work unfortunately: update (select p.jobtitle, p.last_name, p.first_name, p.dblogin_id, p.email_id, p.userlevel, p.facility_id, p.supervisor, p.department, te.jobtitle, te.last_name, te.first_name, te.dblogin_id, te.email_id, te.userlevel, te.facility_id, te.supervisor, te.department persons p, temp_ecolab_persons te p.person=te.person) set p.jobtitle=te.jobtitle, p.last_name=te.last_

jquery - Show loading icon before the execution of a function -

i'm trying show loading icon before execution of function don't have clue how this. my code: $(".charttype").on("click", function(event){ $("#wrapper").addclass("loading"); changecharttype($(this).attr("value")); $("#wrapper").removeclass("loading"); }); it shows loading icon (if removeclass() commented out) after chart has been loaded. if knows solution please let me now. i've tried use settimeout(), jquery's when, , done nothing seems work. i'm using google's visualization charts displaying various charts. i've got possibility switch between charts click on icon. after function above executed. the function changecharttype(): function changecharttype(typepar){ charttype = typepar; chart = new google.visualization[charttype](chartdiv); drawchart(); } and in drawchart calls chart.draw(); takes while , therefore want show loading ic

How to handle mouseover event in EaselJS? -

i'm using easeljs , i'd change (slightly enlarge) images while mouse hovering on them. seems mouseover , mouseout events way it. http://www.createjs.com/docs/easeljs/classes/container.html#event_mouseover however, there no examples in docs, or @ least couldn't find any. tried googling without luck. i tried this: stage.enablemouseover(); var btn = new createjs.bitmap("mybtn.png"); btn.mouseover = function() { btn.x++; }; and found out works: btn.onmouseover = function() { btn.x++; }; but docs variant deprecated , 1 should use events. what's proper way? you should use addeventlistener shown in example (every time move mouse on circle, alpha/transparency changes): http://jsfiddle.net/wiredprairie/u3pyd/ circle.addeventlistener("mouseover", function() { circle.alpha *= .80; stage.update(); }); it assumes you've called enablemouseover documented well: stage.enablemouseover(20);

php - How do I order an array using a calculated value, where the rest of the data is received from mysql database? -

i have page called view.htm displays results according user assigns gold medals, silver medals , bronze medals , whether select use gdp or population calculate score view.php . need find way order these results calculated score , limit top 10 . data received mysql database , score calculated in php page. using json_encode encode data display on page. $results is two-dimensional array. results when echo out view.php: {"gold":"0","silver":"0","bronze":"1","gdp":"20343461030","population":"34385000", "country_name":"afghanistan","score":"0.029082448742184"},{"gold":"0", "silver":"0","bronze":"0","gdp":"12959563902","population":"3205000", "country_name":"albania","score":"0"},{"gold":&qu

Ruby performance: rewrite class extension to compare array elements in C? -

i have code extends ruby array class: # extendes array class have methods giving same rspec functionality of # checking if array elements equals ones'. class array def self.same_elements?(actual, expected) extra_items = difference_between_arrays(actual, expected) missing_items = difference_between_arrays(expected, actual) extra_items.empty? & missing_items.empty? end def has_same_elements?(expected) extra_items = self.class.difference_between_arrays(self, expected) missing_items = self.class.difference_between_arrays(expected, self) extra_items.empty? & missing_items.empty? end protected def self.difference_between_arrays(array_1, array_2) difference = array_1.dup array_2.each |element| if (index = difference.index(element)) difference.delete_at(index) end end difference end end and spec: describe array before(:each) @a = [1,2,3] @b = [3,2,1] @c = [1,2,3,4] @d = [4,1,

iOS BitCoin MtGox Streamming for other channels -

i trying ticker other channels in mtgox there many public stream channels in it. so, tried subscribe them { "channel": "057bdc6b-9f9c-44e4-bc1a-363e4443ce87" "op":"subscribe" } this channel ticker.btceur. getting following error now. { data = { channel = "eb6aaa11-99d0-4f64-9e8c-1140872a423d"; op = subscribe; }; op = client; uuid = "3b8e240e-25bc-4e3d-aa45-429c9357a176"; }; message = "unknown command"; op = remark; success = 0; } what's wrong? please me? best regards.

iphone - Publish app with the copyright of other company -

my company have been chosen develop app company. once app published, in appstore appear our team developers want appear name of other company on copyright. my concern if kind of problems in review process appstore, if i'll need provide document proving i've right publish app in name of company. best regards, javier. the company that's going sell app needs create own account in appstore, has assign agent company. person allowed post app store, careful in choice.

How to Save image in PC from a remote site Using PHP -

hey using php script generate random captcha image remote website want save images in c:\inetpub\wwwroot\sav\ how <?php $id= rand(11111,99999); ?> <img src="http://jeemain.nic.in/jeemain2013/myhandler/displaycaptchaimg.ashx?value=<?php echo $id; ?>" alt="image"> i want save image in directory ../sav/ , name images $id.jpg example $id= '22222' image named 22222.jpg well, assuming mean want save images on same machine running php... <?php $id = rand(11111,99999); $source = "http://jeemain.nic.in/jeemain2013/myhandler/displaycaptchaimg.ashx?value=" + $id; $target = "c:/inetpub/wwwroot/sav/{$id}.jpg"; $img = file_get_contents($source); file_put_contents($target, $img); ?> note attempt save file on same machine running php - is, server not desktop (unless they're both same machine).

excel - count people scheduled at work -

i have table shift start , end times, #n/a if person not due in @ all. (sample) mon start mon end 8:15 16:45 8:15 16:45 8:15 16:45 11:30 20:00 #n/a #n/a 8:15 16:45 8:45 17:15 9:30 18:00 13:30 22:00 i know how many people due on @ specified time e.g. if select 9:00 time, expect result 5 query, , if select 21:00, expect 1. i have tried countif =countif(a2:a93,"<"&d2)-countif(b2:b93,">="&d2) , produces negative numbers start of day, , positive end of day. with sumproduct, =sumproduct(--(a2:a93>=d2),--(b2:b93<d2)) , can 0 answer could point out going wrong? sumproduct won't ignore #n/a error values, if have excel 2007 or later try using countifs this =countifs(a2:a93,"<="&d2,b2:b93,">="&d2)

PrimeFaces ContextMenu on row hover -

i trying implement contextmenu appears when mouse on row. able implement context menu on selected row, not find event hover. have write own implementation data table, or there way attach context menu hover event? primefaces's contextmenu doesn't have option that, can use jquery that. if want show contextmenu, have change contextmenu's position mouse's position(page load contextmenu default, have css display:none , need change css). primefaces's contextmenu have widgetvar attribute use in client(it have method show show it). my solution is: when mouse hover on row, trigger show menu, when mouse out change menu's css display:none . ex: have form(id:form),a datatable(id:cars, data area have default suffix id _data , situation data area have cars_data), contextmenu(id:xxx) (you can set mouse hover , mouse out in jquery via mouseover , mouseout ) <h:form id="form"> <p:contextmenu id="xxx" widgetvar="me

math - Why does my JavaScript Prime Number-Generator not work? -

the aim of program list prime numbers 1 up. complete novice. began writing in c++ (unsuccessfully) , translated (js) aware of problems don't know how solve them: handling global variables, writing replaces, no timeout before writing, etc. important use external js file? in summary, how make work? <!doctype html> <html> <head> <script> var number = 3; //to run through prime test var prime = [2]; //numbers found prime var found = 1; //counter primes found var runs = 0; //counter times number has been tested //numbers tested against smaller found primes function test() { window.scroll(0,document.height); //automatically view latest prime var line = document.createelement("div"); while(runs < found && (prime[runs] < (number / 2))) //has number passed tests { if(number % prime[runs] !== 0) //is number divisible smaller prime { runs = runs + 1; //number passed test } else //

Emacs color theme for unrecognized file types -

i'm happy emacs color themes .c , .py , .m files, etc. there way make unrecognized file types use color theme, i.e. default colortheme? luckily emacs24 introduces custom themes without external color package. m-x customize-create-theme see http://batsov.com/articles/2012/02/19/color-theming-in-emacs-reloaded/ depending on needs can define progmode live in emacs/lisp/progmode directory. to set global color-theme there variable color-theme-is-global .

Cannot connect to remote SQL Database with SQL Server Management Console (Error 53) -

i have opened port 1433 on firewall, every time try , connect remote sql database sql server management console receive (microsoft sql server, error: 53) https://social.technet.microsoft.com/wiki/contents/articles/2102.how-to-troubleshoot-connecting-to-the-sql-server-database-engine.aspx http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/ http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx enable remote connections sql server express 2012 short answer check firewall check service running check tcp/ip enabled check sql server properties "allow remote connections" check if sql server on restricted subnet then run these if not resolve right-click on tcp/ip , select properties. verify that, under ip2, ip address set computer's ip address on local subnet. scroll down

java - Excel-like data grid editor with import/export functionality -

i need import data excel file , present on web application. next presented data on web should able edit user , exported excel file again. want implement web application possibilities to: import excel file view excel file in way (table simple a'la excel functionality: change cell type (radiobutton, checkbox, select, etc) or color, change column order/count, sorting, filtering, etc..., formula plus) change data presented in web app export data excel file what tools/libraries can suggest me use accomplish above requirements? i planning use spring 3/mvc (backend) & jsp (frontend) on jboss 5/6 (app server). my research: i've done research want ask because didn't find satisfactory results. for view , edit excel-like directly on website: handsontable: http://handsontable.com jquery.shit: http://jquerysheet.googlecode.com/svn/branches/3.x/jquery.sheet.html jqgrid: http://trirand.com/blog/jqgrid/jqgrid.html what think above propositions? there bette

nosql - Are there any other databases that use Map-Reduce for queries like CouchDB? -

after learning couchdb , map-reduce queries i've become enthusiastic them, dislike couch's revision , conflict model. there other, 'lighter' nosql databases support using map-reduce query data? i don't mean in sense mongodb it. mean 1 efficiently it's primary (or @ least first class) means of running query. the closest thing i've been able find an abstraction layer on top of leveldb .

opengl es - Is it possible to verify the components' size of non-color-renderable internal format? -

in opengl es 3.0 spec can read: § 4.4.5 when relevant framebuffer binding non-zero, if bound framebuffer object not framebuffer complete, values of state variables listed in table 6.34 undefined. table 6.34 contains x_bits constant. means can create texture or renderbuffer that's not color-renderable, can't verify has proper size. is there way around this, or idea skewed , information irrelevant (which render question incorrect)? you can query bound render buffer properties using getrenderbufferparameteriv (6.1.14 renderbuffer object queries). example renderbuffer_- internal_format. the problem unless framebuffer complete, not formed specification states values returned undefined. that's doesn't mean can query 1 of renderbuffers attached , desired information. not sure if looking for.

sql server - Pivot millons of records -

i have table 4 columns , more 100 million records. table design: id char(12) pk type char(2) pk (values 1,2,3) dcid varchar(10) null ind varchar(2) null (values y, n) this needs pivoted like id, dcid1, dcid2, dcid3, ind1, ind2, ind3 if type having value 1,then in pivoted table dcid1 should have value or if type 2 dcid2 should have value , on. correspoding ind needs placed in ind1 , ind2 , ind3 that. how pivot this? my suggestion @ using both unpivot , pivot functions result. the unpivot used convert dci , ind multiple columns multiple rows in single column. once done, can pivot data columns. the unpivot code similar this: select id, col +type new_col, value ( select id, type, dcid, cast(ind varchar(10)) ind yt ) d unpivot ( value col in (dcid, ind) ) unpiv; see sql fiddle demo . gives result: | id | new_col | value | ---------------------------------- | 1 | dcid1 | test | | 1 | ind1

button click not firing it's method VB.NET -

hello i'm having problem button. when click it, button's not firing method: private sub button1_click(sender system.object, e system.eventargs) 'initialize capture device grabber = new capture() grabber.queryframe() 'initialize framegraber event addhandler application.idle, new eventhandler(addressof framegrabber) button1.enabled = false end sub what missing in here? appreciated. thanks. there should private sub button1_click(sender system.object, e system.eventargs) handles button1.click or addhandler button1.click, addressof button1_click i suppose vb.net , winforms. vb6 or wpf solution little bit different.

nodeunit - How to run tests in node.js with compoundjs -

i trying figure out how run tests in compound. when run npm test receive following error. describe('accountcontroller', function() { ^ referenceerror: describe not defined @ object.<anonymous> (/users/sugarfist/webstormprojects/nimbus/test/controllers/accounts_controller.test.js:14:1) @ module._compile (module.js:449:26) @ object.module._extensions..js (module.js:467:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:362:17) @ require (module.js:378:17) @ /users/sugarfist/webstormprojects/nimbus/node_modules/nodeunit/lib/nodeunit.js:75:37 @ _concat (/users/sugarfist/webstormprojects/nimbus/node_modules/nodeunit/deps/async.js:513:13) @ async.foreachseries.iterate (/users/sugarfist/webstormprojects/nimbus/node_modules/nodeunit/deps/async.js:123:13) @ async.foreachseries (/users/sugarfist/webstormprojects/nimbus/node_modules/nodeunit/deps/async.js:139:9) @ _concat (/users/sugarfist/webstormprojects/nimbus/node_mo

java - JAXB, how to validate nillable and required field when unmarshalling -

i have small problem jaxb, unfortunately not able find answer. i have class customer, 2 fields name , city , mapping done using annotations , both fields marked required , not nillable. @xmlrootelement(name = "customer") public class customer { enum city { paris, london, warsaw } @xmlelement(name = "name", required = true, nillable = false) public string name; @xmlelement(name = "city", required = true, nillable = false) public city city; @override public string tostring(){ return string.format("name %s, city %s", name, city); } } however, when submit such xml file: <customer> <city>unknown</city> </customer> i receive customer instance both fields set null. shouldn't there validation exception or missing in mapping? to unmarshal use: jaxbcontext jaxbcontext = jaxbcontext.newinstance(customer.class); unmarshaller unmarshaller = jaxbcontex

javascript - twitter typeahead with headers for the suggestions, how? -

Image
i followed this tutorial , implemented twitter typeahead ajax source (django backend) recommendations drop down box. i can dropdown give me suggestions based on enter i'd able have headers organize various suggestions such in example: from site: http://twitter.github.io/typeahead.js/examples/ the problem examples on site non of them use ajax source. tried modifying typeahead call this $(".typeahead").typeahead({ source: function ( query, process ) {//ajax call stuff here...}, updater: function(item) {//stuff goes here...}, header: '<h3>header should here</h3>', //<-- should add header suggestions, no? } but suggestions list doesn't header.. is @ possible have such auto recommendations done via ajax data source header labels different types of suggestions? looking @ typeahead javascript source bootstrap project, seems doesn't implement 'header' option. clearly, version demonstrated @ http:

JIRA - Link issues and subtasks -

i have imported 2 excel files jira, 1 excel contains issues, , contains subtasks. both excels have id field. is there way link issues , subtasks same id? thanks you can if single import. give each parent unique value in issue id column. give each subtask appropriate value in parent id column.

c# - Copy controls from ItemTemplate -

i'm dealing formview . have ridiculous long input form, wondering if there's way programmatically copy controls itemtemplate insertitemtemplate/updateitemtemplate don't have repeat text boxes / ddls etc in .aspx since information entered same both update /insert (i know can copy /paste, .aspx messy enough already). i able set insertitemtemplate = itemtemplate , when set mode insert fields displayed. problem when try findcontrol in submit event null. you can create user control hold layout. register control in webpage: <%@ register tagprefix="ctrl" tagname="formcontrol" src="formcontrol.ascx" %> and add formview : <asp:formview id="formview1" runat="server" datasourceid="objectdatasource1" allowpaging="true" enableviewstate="false"> <itemtemplate> <ctrl:formcontrolid="mycontrol1" runat="server" mode="item"/&g

ruby on rails - Single Table Inheritance with Conditions -

i have model user , model recruiter. currently, these 2 separate tables, want make them one. current: user: id, username, password, name recruiter: id, user_id ideal: user: id, username, password, role (recruiter, admin) i understand basics of sti. i'm wondering is, when perform methods on new recruiter controller (that inherits user) how make sure methods calling on users recruiter? thus, queries along lines of... select * users role = 'recruiter' everything. that rails takes care of you, out of box. not have manually query on particular type of user, query on right model. i must mention default rails assumes sti_column called type , can overridden role easily.

web services - Am I reinventing the wheel with this ASP.NET Web API based webserver? -

in standalone (selfhosted) application, have httpserver on single base adress can either serve simple web pages (without serverside dynamics/scripting, returns content request files) or serve restful webservices: when http://localhost:8070/{filepath} requested, should return content of file (html, javascript, css, images), normal simple webserver everything behind http://localhost:8070/api/ should act normal rrestful web api my current approach uses asp.net web api server both html pages , rest apis: var config = new httpselfhostconfiguration("http://localhost:8070/"); config.formatters.add(new webformatter()); config.routes.maphttproute( name: "default web", routetemplate: "{filename}", defaults: new { controller = "web", filename = routeparameter.optional }); config.routes.maphttproute( name: "default api", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.option

base_url not working on Codeigniter controller -

codeigniter not recognize base_url() on specific controller, if works on other controllers , url helper autoloaded. results affected controller displaying html not necessary assets such css , js. say view of glitched controller should display http://localhost/sub/app/assets/css/style.css on html load stylesheet properly, instead, shows http://localhost/sub/app/controller/method/assets/css/style.css . here's log has that. for particular glitching controller: debug - 2013-05-08 18:02:18 --> config class initialized debug - 2013-05-08 18:02:18 --> hooks class initialized debug - 2013-05-08 18:02:19 --> utf8 class initialized debug - 2013-05-08 18:02:19 --> utf-8 support enabled debug - 2013-05-08 18:02:19 --> uri class initialized debug - 2013-05-08 18:02:19 --> router class initialized debug - 2013-05-08 18:02:19 --> output class initialized debug - 2013-05-08 18:02:19 --> security class initialized debug - 2013-05-08 18:02:19 --> input class

Add hibernate to existing web application in netbeans? -

i have created web application in netbeans , works fine. learning purpose want use hibernate database interaction. can create new project hibernate in netbeans don't know how add hibernate in existing project. thank you. in netbeans version 7.3.1 right-click on "source packages" >> new >> other... >> hibernate >> hibernate configuration wizard.

php - Time Limit On Page -

i run online gaming website , trying stop users being able reload page on , on again. thought way add timestamp variable url , if users presses try again, update timestamp. i trying make if timestamp within 5 minutes script allow them access, if timestamp in url outside 5 minute limit, script die , produce error. have searched , found ideas have implemented, still able use same url after 30 minutes. urls ends this: id players id number , t unix timestamp mug.php?id=186&t=1368036608 this have in code in order try put in place , hope clear enough on trying do. timestamp in url not update upon refresh, timestamps point press mug button, believe right. include "globals.php"; $_get['id'] = isset($_get['id']) && is_numeric($_get['id']) ? abs(@intval($_get['id'])) : false; $_get['t'] = isset($_get['t']) && is_numeric($_get['t']) ? abs(@intval($_get['t'])) : false; $time = time(); $time2

Photoswipe rotation issue when in ios4 UIWebView -

i using photoswipe 3.0.5 in ios application. working correctly in simulator (ios 6.1), when run app on real device (ios4.3) , rotate portrait landscape , viceversa uiwebview correctly rotates image doesn't. it seems common issue, infact photoswipe's github page( https://github.com/codecomputerlove/photoswipe ) says: work around issue #141 officially added - when rotating app photoswipe displayed in uiwebview, photoswipe not rotate. seems issue uiwebview not photoswipe. enable work around, set "enableuiwebviewrepositiontimeout = true" when creating photoswipe instance. can specify frequency of timeout setting "uiwebviewresetpositiondelay" (default 500ms) - please note not needed phonegap apps, nor web apps added homescreen. but don't know add line of code. can give me hand? would 'work around' trick? i'm asking question because working correctly on simulator. i found answer. need add 'enableuiwebviewrepositiontimeout:

javascript - Replace error in IE10 but not in IE8 or Firefox -

i have form written in cold fusion. when test form in ie8 or firefox, have no problems. when test form in ie10, gives following error: webpage error details user agent: mozilla/4.0 (compatible; msie 7.0; windows nt 6.1; wow64; trident/6.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; .net4.0c; infopath.2; .net4.0e) timestamp: wed, 8 may 2013 18:15:47 utc message: object doesn't support property or method 'replace' line: 7 char: 10560 code: 0 uri: http://www.mysite.com/cfide/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js when @ code surrounding character 10560 in js file, shows {return this.replace(a,"")} why happening? ie10 buggy? (no, not rhetorical question.) this not string. to make sure work, can change from this.replace(a,"") to this.tostring().replace(a,"")` or use .tostring() in var when it's still on control, don't need ch

java - StackMob Custom Code Update Schema on Get Request -

i trying complete stackmob hello_world tutorial custom code found here: https://www.stackmob.com/devcenter/docs/getting-started:-custom-code-sdk#a-register_your_method but when try run client-side ios code says: {nslocalizedrecoverysuggestion={"error":"hello_world not existing schema"}, i tried post request readparams example project , created schema , returned correctly. maybe requests don't modify schemas, how expect hello_world example? thanks! [edit]: got working making sure package of correct java package form src directory, etc. changed package name , forgot change pom.xml file reflect that. this happens when api doesn't think there custom code method registered name yet. when go settings page custom code module, should see list of custom code methods available in jar uploaded. if don't see such methods, went wrong trying validate jar uploaded. feel free contact support@stackmob.com questions specific app's custom code

ios - Fatal Exception: NSObjectInaccessibleException CoreData could not fulfill a fault -

some times application crashes while tries merge secondary thread moc main thread moc. crashes while merging deleted object main thread object. this merging code in app delegate: - (void)syncdidsave:(nsnotification *)savenotification { if ([nsthread ismainthread]) { [self.managedobjectcontext mergechangesfromcontextdidsavenotification:savenotification]; } else { [self performselectoronmainthread:@selector(syncdidsave:) withobject:savenotification waituntildone:yes]; } } i have attached couple of screenshots show stack trace. main thread img; http://i41.tinypic.com/30047qx.png secondary thread: http://tinypic.com/view.php?pic=24ql27p&s=5 any or suggestions appreciated!

apache - (mod_rewrite) Redirect / cloack to subdirectory -

i'm trying redirect http://www.domain.com to http://www.domain.com/subdir/ with "/subdir" being cloaked user. @ least in url-bar. what figured out based on rudimentary knowledge: rewriteengine on rewriterule ^(/(.*))?$ http://www.domain.com/subdir/$1 [p,l] it's working in terms of redirection, it's not cloacking. tips? first, according official mod_rewrite documentation , if substituion part absolute url external redirect might happen (causing url change in user's browser; however, mod_rewrite should check if absolute url matches request , strip part out, i've checked version 2.2 , redirect happens). so, 1 idea use relative url /subdir/$1 this looks good, not solve problem, because not work @ all. instead, suggest always internally add subdir/ : rewriterule ^subdir/.* - [pt] rewriterule (.*) /subdir/$1 a short explanation: the first slash / not included in pattern, resulting in pattern: http://www.domain.com/ --&

jQuery validation - Textbox requires data if checkbox is checked -

i have checkbox - hasraffle require textbox - raffleitem contain data if hasraffle checked. how this? i've never done own jquery validations before. attempted, it's not working @ all. close? $("#donationeventform").validate({ rules: { raffleitem: { required: function () { if ($("#hasraffle").is(":checked")) { if ($("#raffleitem").val === '') { return true; } else { return false; } } else { return false; } }, messages: { required: "this test!!" } } } }); edit: here's view @using (html.beginform("create", "donationevent", formmethod.post, new {id = "donationeventform"})) { @html.antiforgerytoken() @html.v

ios - Correct way to accessing attributes of a class modeled in core data -

let's recipe object has nsset of 1 or more ingredient s, , same relationship modeled in core data. given recipe , id correct way access ingredients? in example seems natural use recipe.ingredients , equally use nsfetchrequest ingredient entities nspredicate match recipe. now let's want ingredients 'collected'. less clear cut me - should use fetch request ingredients predicate restricting recipe , collected state? or loop through recipe.ingredients? at other end of scale, perhaps need ingredients recipe appear in other recipes. now, fetch request seems more appealing. what correct general approach? or case case scenario? interested in impact on: consitancy readability performance robustness (for example, easy make error in fetch request compiler cannot catch). in example seems natural use recipe.ingredients, equally use nsfetchrequest ingredient entities nspredicate match recipe. why latter when can former? have recipe, , has

xamarin.ios - Compiling HTML Agility Pack for Monotouch -

i have been pointed this answer regarding using html agility pack in monotouch. answer poorly formatted, ambiguous, , parts have android mentioned. i new xamarin please step me through process of compiling project use in monotouch? there multiple ways tackle this, 1 approach be create new ios library project add *.cs files htmlagilitypack build resolve build errors goto 3

css3 - Maintain list dimensions with CSS Transition -

i'm trying create effect list items in unordered list. basically, anytime 1 hovers on list, size adjusts 2px in padding. while effecting overall dimensions of list item, pushing other list elements right , pushing div beaneath down 2px. know of way remedy issue? all want list item during hover increase padding 2px without effecting other elements around it. you can find code on jsfiddle here below: html <div id="info"> <ul class="projects"> <li class="site wmhr"><a href="#">$</a> <p>what's hourly rate</p> </li> <li class="site proud"><a href="#">p</a> <p>proud</p> </li> <li class="site mdy"><a href="#">m</a> <p>manda dougherty yoga</p> </li> <li class="site rr&q

Python logging - using filters to remove information -

i trying remove information while logging console keep information while logging file here's basic example: import logging import sys class myfilter(logging.filter): def filter(self, record): record.msg = record.msg.replace("test", "") return true logger = logging.getlogger("mylogger") logger.setlevel(logging.debug) console = logging.streamhandler(sys.stdout) console.setlevel("info") logger.addhandler(console) logfile = logging.filehandler("log.txt", 'w') logfile.setlevel("error") logger.addhandler(logfile) filt = myfilter() console.addfilter(filt) logger.info("test one") logger.error("test two") what i'd see on console is one 2 and in log file test 2 but it's just two i'm assuming editing logrecord what's causing this. there way of achieving want or i'm trying not possible in way? i think need logging.formatter : cla

Does the Egit Eclipse plugin support the use of bugtraq IDs? -

i can't seem find in documentation. need able set numerical id each commit... does know if possible? , if so, how can enable in egit? references bug tracking systems put commit message. some project include number, see the following egit commit example. "bug: 406542" in commit message reference eclipse bug 406542. other projects put full url bug report commit message.

r - How to create black and white transparent overlapping histograms using ggplot2? -

Image
i used ggplot2 create 2 transparent overlapping histograms. test = data.frame(condition = rep(c("a", "b"), each = 500), value = rep(-1, 1000)) test[1:500,]$value = rnorm(500) test[501:1000,]$value = rnorm(500) + 2 fig = ggplot(test, aes(x = value, fill = condition)) + #scale_fill_grey() + geom_histogram(position = "identity", alpha = .5) fig the resulting plot looks great, it's in color. need grayscale or black/white plot. using "scale_fill_grey()" results in plot transparency difficult "read". ideally, black/white plot uses texture instead of color, instance, cross hatching: "///" 1 condition, "\\\" other condition, resulting in "xxx" when bars overlap. possible? how (no texturing still)? fig = ggplot(test, aes(x = value, fill = condition)) + geom_histogram(position = "identity", alpha = .8) + scale_fill_manual(values=c("grey20", "

How to sum entries that have same ID OpenOffice - Calc -

Image
i have spreadsheet similar 1 in screenshot. from want sum entries in data 2 have same data 1 id , store in column. this: i not able figure out formula this. figured out how column unique entries need figure out how sum of values have same data 1 id. can point me in right direction? you can use sumif , e.g. if i'm reading sheet right, =sumif(a$2:a$7, a11, b$2:b$7) , , copy down. sums values b2-b7 whenever corresponding value in a2-a7 matches a11. you can find more on sumif here .

jquery - Prepend a number with $ in javascript -

i have small script ( using nouislider ) i wish prepend rangething values $ sign outputting prices. code have is: $("#slider").nouislider({ range: [0, 1000000] ,start: [350000, 700000] ,handles: 2 ,step: 50000 ,slide: function(){ var values = $(this).val(); $("span.rangething").text( values[0] + " - " + values[1] ); } ,serialization: { to: [$("#exto"),$("#exfr")] ,resolution: 1 } }); the javascript creates span <span class="rangething"></span> the output format 200000 - 350000 i format ( commas ) thousand separators, thats gonna messy. trying prepend 2 sets of values $ sign signify price. so resultant output $200000 - $350000 i tried changing values this, didnt work lol. $("span.rangething").text( + "$" + values[0] + " - " + + "$" + values[1] ); i not sure if on right track, , fact trying echo $ culprit, ,

highslide - hs.htmlExpand DOMElement with or w/o image -

doc - http://highslide.com/ref/hs.expand : element - reference html element opens expander. when hs.expand used in onclick attribute, parameter this. when using hs , domelement element (div, span, tr) not contain image => zoom effect of newly generating hs popup starting whole surface of element. when element contains inside image => zoom effect starting image, instead of whole surface of element. please see example here - http://projects.prowavegroup.ca/test2/hs/ how can keep effect start whole surface of element while having image inside element? thanks highslide designed expand element’s innerhtml image. far know, way can avoid set image background image.

wordpress - How to display only specific part of the_content(); text? -

is there way how trim content , display text within h2 tags in wordpress? i trying display specific part of post content on specific page not whole of it. excerpt not work in case defined length. bet there simple way it... cannot find 1 yet..... thank all..... this can made in several ways, easiest : function o99_filter_the_content_h2( $content ) { $pattern = "/<h2>(.*?)<\/h2>/"; preg_match($pattern, $content, $matches); return $matches[1]; } add_filter( 'the_content','o99_filter_the_content' ); add functions.php file in theme. note no longer h2 :-) if use same other tag , can use more generic function: function o99_filter_tags_generic($content, $tagname) { $pattern = "/<$tagname>(.*?)<\/$tagname>/"; preg_match($pattern, $string, $matches); return $matches[1]; } where $tagname tag filter

Having issues making php soap request -

i'm having hard time understanding how create soap request properly, , receive info server. here's link docs service need connect to. shows soap request , response format. https://www.team-intro.com/ws/distributorws.asmx?op=getreplicatedsite looking @ request format, i'm not sure how i'm suppossed pass server. i've googled around , found several ways send requests, keep getting soap falut errors. below latest attempt. <?php //error_reporting(e_all); //soap connect $client = new soapclient("http://www.team-intro.com/ws/distributorws.asmx?wsdl"); $params = new soapvar("<soap12:header><authheader domain='thedomain' xmlns='http://www.prodogix.com/'><authorizationkey>myauthkey</authorizationkey></authheader></soap12:header><soap12:body><getreplicatedsite xmlns='http://www.prodogix.com/'><website>username</website></getreplicatedsite></soap12:body&

html - Load css without importing it -

i wondering, there convention allow style sheet of page used witout using link or import page? yes, style tags in page (preferably in head ): <style> /* css declarations here */ </style>

Git rewrite history move folders and files up to parent folders -

i want rewrite history , move files , folders in folder 2 folders branches. my repo looks like: src v105 src files folders tools lib i want be: src files folders tools lib i know how rewrite history removing files recursively in folder git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatched somefolder/somefolder' --prune-empty --tag-name-filter cat -- --all i know git mv command. using following command files , folders moved correct folder. first patterns matches files , folders within provided folder. second pattern matches files , folders starting dot. git mv src/v105/src/* src/v105/src/.[^.]* src however when want use command rewrite history command doesn't work. git filter-branch --force --index-filter 'git mv src/v105/src/* src/v105/src/.[^.]* src --cached --ignore-unmatched' --prune-empty --tag-name-filter cat -- --all because src folder not exist in cases in commit history tells me can&#