Posts

Showing posts from July, 2014

android - How to detect app removed from the recent list -

i'm working on music app, , want stop service when user removes application recent list , not when first activity destroyed(because when user clicks back until app minimizes, in case first activity getting destroyed). please help. i want stop service when user removes application recent list. yes, can either using stopwithtask flag true service in manifest file. example: <service android:enabled="true" android:name=".myservice" android:exported="false" android:stopwithtask="true" /> or if need event of application being removed recent list, , before stopping service, can use this: <service android:enabled="true" android:name=".myservice" android:exported="false" android:stopwithtask="false" /> so service's method ontaskremoved called. ( remember , won't called if set stopwithtask true ). public class myservice ext...

ipad - IOS 8 APIs and IOS 6 deployment target -

Image
with drastic change in ios 7 onwards of apps prefer ios6 looks , same app uses 3rd party lib. have copied platform old ios latest ios , works great till when 3rd party library using in app using text-font (uifonttextstylecaption1) supported ios7 onward in there lib. when use recent release in app getting linking error deployment target ios6.1 . app works great if change deployment target latest ios8.1.1 . is there way can link library or make visible have both both platform within latest xcode. is possible... can not change deployment target , need 3rd part library well... i don't know why think of users preffer ios 6 official apple statistics states 4% of users still on ios 6 and below . with said advice drop ios 6 support has numerous problems, except of missing apis. to directly answer question - it's hard support 3rd party libraries. meant used as-is instead of modifiyng. if had source code can try refactor newer api calls use old(and deprecated) ...

php - Instantiating the self class inside a method? -

is there problem if instantiating current class inside method ? using code: class say_hi (){ function __construct(){ echo "hi"; } public function again( $data ){ new say_hi(); } } yes can , work correctly.

Rails fragment caching with personalization -

my site has top navigation menu bar has infrequently changed contents , it's therefore candidate fragment caching. if user signed in, part of menu bar have user's name in it, , therefore personalised , can't cached. i can either: fragment cache static part , serve personalised part separately. seems pretty easy. cache lot, possibly in memcached or cloudfront, keep user's name in session, , use javascript extract user's name session , personalise page @ client end. what best option go with? preferably based on personal experience of similar situations. try this: ##in user.rb cache user after_save :invalidate_cache def self.serialize_from_session(key, salt) single_key = key.is_a?(array) ? key.first : key rails.cache.fetch("user:#{single_key}") user.where(:id => single_key).entries.first end end def invalidate_cache rails.cache.delete("user:#{id}") end credit: rails devise: how (mem)c...

android - How to retrieve marker image to display full sized image in google Maps API v2? -

i have image marker , want tap on marker display full sized image. use hashmap add marker id of image , onmarkerclick display full sized image. displays large image not correct image marker clicked, last marker added. here code have far: weakhashmap <marker, object> haspmap = new weakhashmap <marker, object>(); marker m; and when adding marker: m = googlemap.addmarker(new markeroptions() .position(point) .icon(bitmapdescriptorfactory .frombitmap(bitmap))); haspmap.put(m, bitmap); and onmarkerclick : intent intent = new intent(); intent.setaction(intent.action_view); haspmap.get(m); uri imguri = uri.parse("file://" + fileuri); intent.setdataandtype(imguri, "image/*"); startactivity(intent); it seems should work how understand it, doesn't doing wrong here?

terminal - Troubles with installation of Homebrew -

i trying install homebrew on fresh install of os x yosemite (removed old partition using disk utility , did complete re-install, carried on no media, completed 10 minutes ago). unfortunately have closed terminal since first time attempted install using: "ruby -e "$(curl -fssl https://raw.githubusercontent.com/homebrew/install/master/install )", as such not have original error code. used install command provided above, , directed install command line tools. part played out fine. after command line tools installed hit 'return' directed, , began 'installing home-brew'. the installation seemed stall , error message displayed. so re-attempted install re running same terminal prompt , terminal gave me message: "agreeing xcode/ios license requires admin privileges, please re-run root via sudo.", then said installation successful. however , prompted run brew doctor, ran , subsequently alerted with: "agreeing xcode/ios license re...

android - sencha app build package gives me a java.lang.NullPointerException -

Image
i use sencha architect build app. then copy project files such app, packages, resources, touch, app.js, index,html empty app built sencha cmd. use sencha app build package build package, error comes. cmd window follow picture, can me? i use win7+sencha cmd4.0+cordova+touch-2.4.1

Safari WebDriver not registered on Selenium Grid 2 -

i able run script on mac-chrome , fire fox using selenium-server-standalone-2.44.0.jar. but, when run safari on same mac, error: **exception in thread "main" org.openqa.selenium.webdriverexception: error forwarding new session cannot find : {browsername=safari, javascriptenabled=true, version=, cleansession=true, platform=mac} command duration or timeout: 130 milliseconds** when registered node got following message: mac:/ labuser$ java -jar selenium-server-standalone-2.44.0.jar -role webdriver -hub ://x.x.x.x:4444/grid/register -port 5566 23:08:11.804 info - launching selenium grid node 23:08:12.259 info - java: apple inc. 20.65-b04-466.1 23:08:12.259 info - os: mac os x 10.9.5 x86_64 23:08:12.267 info - v2.44.0, core v2.44.0. built revision 76d78cf 23:08:12.334 info - default driver org.openqa.selenium.ie.internetexplorerdriver registration skipped: registration capabilities capabilities [{platform=windows, ensurecleansession=true, browsername=internet explorer, v...

html - Background-clip not working in my code. (Border-Radius/Background bleeding issue) -

Image
i'm trying style default progressbar skin of jquery-ui. unfortunately i've discovered issue known "background bleeding". apparently solution problem use: -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; however not seem work me, no matter put it. :( image of background bleeding issue (zoomed) source: $(function() { var myprogressbar = $("#myprogressbar"); myprogressbar.progressbar({ value: 50 }); }); #myprogressbar { width: 580px; height: 92px; border: none; /* black background */ background-color: black; background-image: linear-gradient(rgba(255, 255, 255, 0.25) 50%, transparent 50%, transparent); } #myprogressbar .ui-widget-header { /* orange foreground */ background-color: orange; background-image: linear-gradient(rgba(255, 255, 255, 0.2) 50%, transparent 50%, transparent); } <link type="tex...

python - Browser rendered URL and Scraped URL are different. Please explain -

i new world of web scraping,python , scrapy. pardon me if there fundamental flaw in understanding. come java/r background. trying scrape www.amazon.in book details. built xpaths required after using chrome's xpath finder, when try same xpath query in scrapy shell different form of url being displayed. for example following xpath query //ul[@id='ref_976390031']/li[23]/a[@href]/@href in xpath finder get www.amazon.in/s/ref=lp_976389031_nr_n_21?fst=as%3aoff&rh=n%3a976389031%2cn%3a%21976390031%2cn%3a1318203031&bbn=976390031&ie=utf8&qid=1418660681&rnid=976390031 but when try on response variable of scrapy shell response.xpath("//ul[@id='ref_976390031']/li[23]/a[@href]/@href").extract() i get http://www.amazon.in/b?ie=utf8&node=1318203031 what's more interesting is, scrapped link when keyed browser lands in different page opposed page supposed land( same behaviour i.e. landing in different pages occurs when scrapped t...

windows - Suspend, Resume Drop Down box is disabled in Debug Location Toolbar in VS 2012 Professional -

Image
how enable suspend, resume drop down box in debug location toolbar when debugging vc++ window app. 'process lifetime management' , 'application lifecycle' events combobox come in vs windows store apps. cannot enable standard c++ gui application.

waterline - Sails.js - protect blueprint associations using policies -

in order create many-to-many association between models, use blueprints access like: /api/item/1/tags/2 how can protect action using policies? this action doesn't seem fit of find/create/update/destroy policies. there's no need custom routing here; blueprint you're referring called populate , can protected in config/policies.js with: itemcontroller: { populate: 'somepolicy' }

go - OnChange on a table is available in golang driver - rethinkDB? -

i working on rethinkdb , golang , new these 2 technologies/database . note golang driver - using this driver connecting rethinkdb. problem there no onchange on table functionality in driver. note - onchange functionality available in rethinkdb. any suggestion of golang driver supports rethinkdb onchange . thanks in advance sorry delayed reply dont check stackoverflow should. gorethink offer support changefeeds. unfortunately documentation bit lacking , hope work soon, until recommend having @ tests. should give idea on how use them. https://github.com/dancannon/gorethink/blob/master/query_table_test.go#l215 if have further questions regarding change feeds or other issues driver let me know.

osx - How can I disable the anti aliasing in eclipse -

Image
my settings are osx mountain lion java version "1.7.0_17" eclipse cpp 4.4.1 thunderbolt display i have tried running in terminal: defaults write org.eclipse.eclipse appleantialiasingthreshold 20 and even defaults write org.eclipse.eclipse appleantialiasingthreshold 40 and restarting eclipse everytime, never rid of antialiasing can see on picture below. i've been struggling lot it, lot in advance help. edit: on emacs antialiasing disabled. as of latest build of eclipse luna (20150109-0600), both of these have stopped working me. turns out application name has changed once more -- in case epp.package.jee since have java ee version. version-independent way using -app option defaults : defaults write -app /applications/eclipse/eclipse.app appleantialiasingthreshold 20

c# - Using reflection to serialize files -

in company's application, there's viewer take message , create xml document out of can presented nicely customers. each message has own class , far must individually written in examle below. class name given in "m_msgtypeversion", figured should possible use reflection generalize cases in switch statement doesn't have updated when new message types added application. however, having bit of trouble doing this. don't know how cast specific type. using .net 3.5, dynamic keyword isn't there. need cast instance specific class instead of object. and how use serializer? says needs t. type doesn't work this. gives syntax error. switch (m_msgtypeversion) { default: throw new notimplementedexception("message type " + m_msgtypeversion + " conversion xmlelement not implemented!"); case "utilmd_d11aun51": utilmd_d11aun51 utilmd51 = new utilmd_d11aun51(); serializer<utilmd_d11aun51> seruti...

java - How can I store primitive types in Hashmap or list as a value instead of a wrapper class object -

the question had been asked me in interview. i know primitive types converted wrapper class object store in data structure. but interviewer asked me dont want wrapper class object , should stored primitive type. how can that? using java's collection api, cannot in sensible way. of course implement list or map interfaces , decide store primitives instead of objects cause headache anyway. java's collection interfaces based on objects (generics don't play role in that), cannot have add or remove method takes int argument. let's have own implementation of list<integer> stores int instead of integer defined interface, write this: list<integer> intlist = new myprimitiveimplementation<>(); intlist.add(42); now happens primitive int 42 gets autoboxed integer object because collection interface defines add method add(integer e) . implementation unboxing integer object again primitive back. so, there's no point. either ser...

jpeg - Convert TIFF pictures automatically in php -

this question has answer here: convert tiff jpg in php? 2 answers i have folder path full of images loaded gallery script in php (i create thumbnails , works). unfortunately have tiff pictures in folder. is there way convert these pictures tiff jpeg automatically showing purposes? thanks in advance support! use imagemagick's mogrify convert tiffs jpegs in 1 go: mogrify -format jpg *tif

c# - Error in " SaveChanges() " method -

Image
i'm creating application using oracle database , asp.net mvc4. though seems no problems in code, calling savechanges() method causes error shown here: this image shows inner exception , related details this implementation have done saving changes if (modelstate.isvalid) { modelstate.clear(); using (ssp_entities database = new ssp_entities()) { database.request_tab.add(c_modal.request_tab); database.savechanges(); caseid = c_modal.request_tab.case_id; return redirecttoaction("newenv", cpe); } } i use following code in view <%:html.hiddenfor(model => model.request_tab.rowversion, new { @value="date"}) %> <%:html.hiddenfor(model => model.request_tab.case_id, new { @value=100}) %> <%:html.hiddenfor(model => model.request_tab.request_by, new { @value="pusnlk"}) %> <%:html.hiddenfor(model => model.request_tab.request_id, new { @val...

c# - Can't use an instance variable of non-generic class inheriting from a generic class with specified type -

i created classes these: abstract class aclass1<t> { // code here } class class2 : aclass1<int> { // code here } class class3 : aclass1<float> { // code here } class class4<t> : aclass1<t> { // code here } so far works. in class i'd have: ... aclass1<t> variable; and depending on specific needs set variable either: variable = new class2(); or variable = new class3(); or sometimes: variable = new class4<t>(); this produces compile error no possible cast or else tried. @ moment changed inheriting classes generic like: class class2<t> : aclass1<t> { // code here } but doesn't feel right, because there no generic methods or there. the question right way it, why, , why can't using original way? by way .net 2.0 i'm doing inside unity3d. to more clear: i have specific cases e.g. int type want handle specifically, there other i'd have generic class for. created s...

localization - changing locals for all io on a c++ code -

i using e57 library ( http://www.libe57.org/ ) , have e57 data set can read them correctly, when decimal point in windows set '.', on system decimal point ',', doesn't work (for example on windows language set spain or norway , several other european language). to test correctness code, using demoread application shipped library. i can see when locals set decimal point '.', application can read data point : x=0.24965 y=-0.1595 z=-0.29536 but if change decimal point in windows setting ',' application read these values: x=24965 y=-15950 z=-29536 as don't want @ bug in big library, wondering if there way can change locals application in code? i tried using code: setlocale(lc_all,"en-us"); without success. there way can change decimal point char in code effect ios deep inside library? you can set lc_numeric decimal point. monetary-formatting can set lc_monetary. lc_numeric "printf family" , loc...

How To handle SOAP Request and response in android -

i'm developing app in m handling web service using soap request , response. can 1 please tell me how handle soap request , response? have read of tutorial tutorial not understood. click here public class stockquotefetcher { private final string namespace = "https://book.mylimobiz.com/api"; private final string method_name = "getcars"; private final string soap_action ="https://book.mylimobiz.com/api/getcars"; private final string url = "https://book.mylimobiz.com/api/apiservice.asmx?wsdl"; private final soapserializationenvelope envelope; public stockquotefetcher(string apiid, string apikey) { soapobject request = new soapobject(namespace, method_name); propertyinfo quotesproperty = new propertyinfo(); quotesproperty.setname("apiid"); quotesproperty.setvalue(apiid); quotesproperty.settype(string.class); request.addproperty(quotesproperty); ...

curl - translate a PHP array value using google translator API -

i working on translating text via google translate api.i have translate english language data comes database other language japanese , save different language output in database. right sending every string google translate api output in other language. takes long time , due multiple request limitation cannot translate whole data. so question is, can translate whole array in single request using google translator api. right using below code : for($mn=0;$mn<count($languagefielddata);$mn++) { $field = $languagefielddata[$mn]['field']; $newval = $leadquery[0][$field]; if(!empty($newval)) { //$leadquery['ko'][0][$field] = translate($newval,'ko'); $leadquery['ja'][0][$field] = translate($newval,'ja'); //$leadquery['zh-cn'][0][$field] = translate($newval,'zh-cn'); } $newval = ""; } function curl($url,$params = array(),$is_coockie_set = false) { if(!$is_cooc...

javascript - Resolving require paths with webpack -

i'm still confused how resolve module paths webpack. write: myfile = require('../../mydir/myfile.js') but i'd write myfile = require('mydir/myfile.js') i thinking resolve.alias may since see similar example using { xyz: "/some/dir" } alias can require("xyz/file.js") . but if set alias { mydir: '/absolute/path/mydir' } , require('mydir/myfile.js') won't work. i feel dumb because i've read doc many times , feel i'm missing something. right way avoid writing relative requires ../../ etc? webpack >2.0 see wtk's answer . webpack 1.0 a more straightforward way use resolve.root. http://webpack.github.io/docs/configuration.html#resolve-root resolve.root the directory (absolute path) contains modules. may array of directories. setting should used add individual directories search path. in case: webpack config var path = require('path'); // ... reso...

c# - PrintDocument images on 203 dpi require dithering -

i having problem when printing label using printdocument class. trying print image happens barcode. image generated using code found here. the problem experiencing when printing image on printer dpi of 203, edge of bars blurry. assume caused dithering on pritner image trying print between 2 of dots on print head. i have tried scaling barcode before generating image, has no effect. public void print() { printdocument printdocument = new printdocument { defaultpagesettings = { landscape = label.landscape, papersize = label.papersize }, originatmargins = true, printersettings = { printername = "printername" }, printcontroller = new standardprintcontroller() }; printdocument.printpage += on_printpage; printdocument.print(); } private void on_printpage(object sender, printpageeventargs e) { e.graphics.resettransform(); drawbarcode(_elements[0], e.graphics); } private drawbarcode(ie...

java - org.apache.cxf.interceptor.Fault: Could not send Message -

client requesting rest web service api running tomcat server. rest web service completed operation trying send success message client not receiving message. checked catalina.out got stack trace given below. suggest me something. org.apache.cxf.interceptor.fault: not send message. @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:64) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:262) @ org.apache.cxf.interceptor.outgoingchaininterceptor.handlemessage(outgoingchaininterceptor.java:77) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:262) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:122) @ org.apache.cxf.transport.http.abstracthttpdestination.invoke(abstracthttpdestination.java:211) @ org.apache.cxf.transport.servlet.servletcontroller.invokedestination(servletcont...

compiler errors - Scala declare multiple variables at the same row with the first character as upper-case -

i'm trying declare variables through tuple-assignment, such as: val (hi, bye) = ("hi", "bye") and fine. when having first character upper-case, compiler explodes , complains these variables not being defined. val (hi, bye) = ("hi", "bye") why doesn't work? i'm running scala 2.11. by way works (as expected): val hi = "hi" val bye = "bye" from here : the tuple on left-hand side pattern; names starting capital letters treated constants when occurring inside pattern. these constants must exist values in context. find exact semantics in scala spec under pattern matching.

sql - Make a separate row respectively if a column contains comma-separated value -

i asked question here bit change 1 firstname lastname payscale ----------- ------------ --------------- alice,lisa simons,jack 100000 i want see result firstname lastname payscale ----------- ------------ --------------- alice simons 100000 lisa jack 100000 first value of firstname , first value of lastname make seperate row . in short want comma separate multiple columns as said garethd should normalize database. workaround create table #test (firstname varchar(100),lastname varchar(100),payscale int) insert #test values ('alice,lisa','simons,jack',100000) select firstname, lastname, b.payscale (select split.a.value('.', 'varchar(100)')firstname, payscale, row_number() ...

sql server - Use a calculated column in a where clause -

i'm trying use calculated column in clause. i've trying cross apply, sub-query select not give me near need. my query far: select p.code, c.accountnumber, sales = (sum(p.unitprice) * sum(od.qtyshipped)) [dbo].customer c left join [dbo].orderheader oh on oh.customerid = c.id left join [dbo].orderdetail od on od.orderheaderid = oh.id left join [dbo].product p on p.id = od.productid sales > 100 group p.code, c.accountnumber, sales this not work, 'sales' invalid column you'll need wrap inner query in derived table or cte in order able use derived columns in where clause (also, note sum() specified once, after multiplication): select x.code, x.accountnumber, x.sales ( select p.code, c.accountnumber, sum(p.unitprice *od.qtyshipped) sales [dbo].customer c left join [dbo].orderheader oh on oh.customerid = c.id left join [dbo].orderdetail od on od.orderheaderid = oh.id left join [dbo].product p on p.id = od.p...

How can we design android layout which are compatible to all mobile screens? -

i have taken layout-320dp,layout-360dp,layout-480dp,layout-600dp , layout-720dp still of devices not compatible it. you dont need create these layout files. app compatible mobile devices using layout , layout-large tablets need use layout-sw600dp , layout-sw720dp 7" , 10" screens. more reference visit link :- click here hope :)

TFS 2010 TF31002: Unable to connect to this Team Foundation Server -

Image
i have installed tfs 2010 on ws 2008 r2 more 2 years , every things worked fins till have installed app on server think change seting on iis/server. , after can not access tfs web services on tfs server localy!!. problem. after resolving security issues changed tfs applicaion pool's identification network administrator. tfs account nt authority\network service. can create team project collection tfs administration console. checked network traffic fiddler accessing http:///tfs , response was: http/1.1 404 not found server: microsoft-iis/7.5 persistent-auth: true x-powered-by: asp.net date: tue, 16 dec 2014 11:49:24 gmt content-length: 0 if have broken server installing recommend building new dedicated tfs server. option 1) create new clean server tfs. install sql , restore of databases old server. install tfs 2013. option 2) if not have room dedicated tfs server should create temporary instance working , push of data vso ( http://tfs.visualstudio.com ) if run t...

java - How do I extract data from pptx file using Apache POI? -

i using xslfpowerpointextractor extract text pptx file. text in pptx file returned me in single string. there anyway can text on each slide separately? new concept, please give detailed answers.. i looked api documentation , seems it's either or nothing. api documentation has method called gettext() returns entire text slides behavior observing. a bit more googling showed me way use api namely xmlslideshow . gives slide-by-slide access presentation. from there, can access different shapes including text areas can read text. matter of fact, explained in other question believe resolve issue: how pptx slide notes text using apache poi?

python - Add form fields to django form dynamically -

due bd design depending on value, data stored in different cells, have add form fields dynamically. thinking on this: class editflatform(basemodelform): on_sale = forms.booleanfield(required=false) on_rent = forms.booleanfield(required=false) class meta: model = flat fields = ('title', 'flat_category', 'description') ... def __init__(self, *args, **kwargs): super(editflatform, self).__init__(*args,**kwargs) flat_properties = flatproperty.objects.all() p in flat_properties: if p.type_value == 1: # text setattr(self, p.title, forms.charfield(label=p.human_title, required=false)) elif p.type_value == 2: # number setattr(self, p.title, forms.integerfield(label=p.human_title, required=false)) else: # boolean setattr(self, p.title, forms.booleanfield(label...

ruby on rails - proxy ember cli to api host in production not working -

i'm using ember cli 0.1.3 front end , rails 4.1.8 backend. i'm using ember-simple-auth authenticating users , followed https://github.com/givanse/ember-cli-simple-auth-devise set up. it works great locally using ember server --proxy http://0.0.0.0:3000 cannot seem set proxy production environment. i'm hosting both ember , rails apps on heroku. found there proxy generator ember cli used ember g http-proxy users http://"url" this created servers/proxies/http:/url.js : var proxypath = '/users'; module.exports = function(app) { // options, see: // https://github.com/nodejitsu/node-http-proxy var proxy = require('http-proxy').createproxyserver({}); var path = require('path'); app.use(proxypath, function(req, res, next){ // include root path in proxied request req.url = path.join(proxypath, req.url); proxy.web(req, res, { target: 'http://url' }); }); }; now once pushed heroku, xhr request stil...

javascript - appendTo working with div but not with textarea -

this question has answer here: how append text '<textarea>'? 5 answers i have following jquery code running: $('a.testlink').click(function() { var $essay = $(".tinyeditor iframe").contents().find("body").clone(); $essay.appendto("div.test"); }); as can see, finding contents of "body" inside iframe (same source); , appending div. the above code works fine. if change appendto div textarea, doesn't work. what doing wrong? .appendto() appends content html. not work textarea. need set value textarea. for appending inside textarea, need set textarea value original contents + new content. $('textarea').val($('textarea').val() + $essay.html()); update: what if want contents replaced new one you need set value using .val() along new content: $('textare...

db2 luw - How to unload data of syscat.tables on my prod db on instance1 -

how unload data of syscat.tables on prod db on instance1 on host , load data dev db on instance2 on host , want compare list of table names on dev db can correct table definitions. do have use load , unload command let me know if not clear if you're comparing table names , not else, can unload information text file via export command. db2 "export tablenames.csv of del select tabschema, tabname syscat.tables order tabschema, tabname" another way capture output of select statement -z option of command line processor (clp). db2 -z tablenames.txt "select tabschema, tabname syscat.tables order tabschema, tabname" that said, serious effort compare , contrast table definitions of different db2 databases should involve db2look command, can reverse-engineer db2 object set of ddl statements. highly recommend it. regardless of how decide generate details each database, you're have easier time comparing them text files rows inside database...

php - Getting a syntax error mysql_feth_array -

i getting syntax error on line of code ($info = mysql_fetch_array( $data )){ echo"<img src= images/ ".$info['photo'] ." <br>"; and have no idea why? appreciated. try like if ($info = mysql_fetch_array( $data )) { echo"<img src= 'images/ ".$info['photo'] ."'> <br>"; } you have missed 1) closing image tag 2) need put image url in quotes.

css - css3 translate3d zero height 100% destroyed -

i run problem google couldn't me. on container translate3d(0, 0, 0) applied , destroys dimensions of inner containers have width , height 100%. created small jsfiddle demonstrate this. if remove translate's on #page dimensions correct... http://jsfiddle.net/11vt14nx/1/ the html part <div class="page-wrapper"> <section id="page"> <div class="artworkpage"> <figure class="vertical-middle"> <img src="asda"> </figure> <div class="data"> <p class="description">asd</p> <div class="button-group align-center"> <button class="like small" data-object-id="1"> <span class="icon-thumbs-up"></span> <span class="value">0<...

jquery - Change the form action attribute taken from values in two selects -

i've found similar question here: javascript - change form action based on selection? but problem different. have 2 selects: <form id="carsearch" action="" method="post"> <select name="style" id="style"> <option value="" selected>any style</option> <option value="style/sports-1">sports</option> <option value="style/wagon-3">wagon</option> <option value="style/suv-6">suv</option> </select> <select name="make" id="make"> <option value="" selected>any make</option> <option value="make/porsche-3">porsche</option> <option value="make/ford-6">ford</option> <option value="make/volvo-7">volvo</option> </select> <input type="submit" value="submit"/> </form> i want ...

d3.js - How to customize the color scale in a D3 line chart? -

apologies super-basic question, i'm grappling simplest thing: how change color of lines, in mike bostock's simple multi-series d3 line chart . (i know – i'm idiot.) i've spent hours fiddling different solutions, rummaging through d3 documentation , googling furiously, i'm failing horribly. in example chart, mike bostock uses d3's built-in "category10" color scale, per line of code: var color = d3.scale.category10(); but suppose, instead of built-in scale, wanted line austin blue, line new york red, , line san francisco green. should simple enough, right? define custom color scale: var color = d3.scale.ordinal() .domain(["new york", "san francisco", "austin"]) .range("#ff0000", "#009933" , "#0000ff"); i thought might trick – but turns series black. so... total failure. i'm sure i'm missing obvious here – i'm stuck. i've tried css styling each series appendi...

netlogo - ask one agent set to get a value from another agent set -

my sellers set trade_price code: ask buyers [ ask sellers [if any? buyers-here [ if seller_price <= [buyer_price] of myself [ set trade_price seller_price + random ([buyer_price] of myself - seller_price) ]]]] i want buyers took same trade_price if have seller in same patch.(if any? sellers-here). , code so: ask sellers [ ask buyers [if any? sellers-here [set trade_price ( [trade_price] of myself )]]] i think wrong code because got different trade_price s agent couples. have idea how can set it? best reagrds as far can tell, you're trying this: ask buyers [ let candidate one-of sellers-here if candidate != nobody [ set trade_price [trade_price] of candidate ] ] note there no ask sellers around this. want each buyer run once each time through go . note if there multiple sellers on patch, one-of sellers-here picks 1 randomly.

c++ - Qt Application showing back content -

Image
i'm developing qt quick application c++ , qml. the mainwindow doesn't show content, , shows part of window content(the qt ide) problem when running project in debug/release(both) mode. running binary project folder works. need test debug mode. i'm using ubuntu 14.04 (xfce). how can solve it?

fluid layout - Scale image with CSS but limit to orignial size -

for responsive design, scale down images: img { width:100%; height:auto; } this works expected, if width of screen exceeds original size of image, blows image. is there way limit scaling original size? gets smaller if necessary? thanks in advance answer. willem you use max-width prevent image width becoming larger original size. img { width: auto; max-width: 100%; height: auto; }

mysql - SQL and PHP Issue - Error: You have an error in your sql syntax -

error: insert demorequests (firstname,lastname,email,phone,company,jobtitle,numberofstaff) values (hank,janssens,contact@hankjanssens.com,5193174848,imaginadev,,1) have error in sql syntax; check manual corresponds mysql server version right syntax use near '@hankjanssens.com,5193174848,imaginadev,,1)' @ line 2 database table structure create table if not exists `demorequests` ( `id` int(11) not null auto_increment, `firstname` varchar(30) not null, `lastname` varchar(30) not null, `email` varchar(60) not null, `phone` varchar(12) not null, `company` varchar(60) not null, `jobtitle` varchar(30) not null, `numberofstaff` varchar(12) not null, primary key (`id`) ) engine=innodb default charset=latin1 auto_increment=1 ; php //assign $_post variables $firstname = $_post['firstname']; $lastname = $_post['lastname']; $email = $_post['email']; $phone = $_post['phone']; $company...

eclipse - Cannot uninstall Java -

first off, i've been trying launch eclipse kept getting below error failed load jni shared library "c:\program files (x86)\java\jdk1.8.0_25\bin...\jre\bin\client\jvm.dll" so looked through thread failed load jni shared library (jdk) the sensing got might want uninstall java , make sure have right 64 bit version, since have 64 bit eclipse. i went ahead , went uninstall java update files via control panel, went fine. then when tried delete java files in program files (x86) folder, can't "file being used process" now can't install new version of java error code 1603 owing incomplete java files, , still got jni shared library error fix. i'm stuck now. do? if use 64 bit eclipse, need 64 bit operating system , 64 bit jdk. close eclipse , jdk, remove x86 jdk , install 64bit jdk.

javascript - Bind all methods to 'this' -

i have iife methods defined in it, public , not. in lot of functions (including private ones) use 'this' keyword, make sure i'm in right context, need use .call(this) method. there way bind functions inside iife correct context, without having use call() ? defining var self=this not option since messes knockout context. ko.utils.extend(singleselectdropdownviewmodel.prototype, (function () { var strings = { all: l10n('all') }; //public functions var init = function (params) { this.selectedvalue = params.selectedvalue; this.title = ko.observable(); this.items = params.items; this.menuopen = ko.observable(false); //would avoid using call , use _settitle() _settitle.call(this); }, ... //private functions _settitle = function(){ if (ko.unwrap(this.selectedvalue)){ var = ...

perl - Obtain reference from keys() -

i have array : my @y = keys(%{$table->{fields}}); i'd have reference of array : $columns = \@y; is there way operation on single line ? yes, can assign $columns anon array reference, my $columns = [ keys %{$table->{fields}} ];

fopen - Segmentation fault in opencv usage -

running on ubuntu 12.04 the following program first reads 50 characters file, , converts these values int. values in file these: 0020.50 0020.49 0020.47 0020.46 0020.51 0020.50 0020.50 0020.49 0020.49 0020.50 0020.50 0020.52 0020.51 0020.47 0020.49 0020.48 0020.48 0020.50 0020.49 0020.49 0020.48 0020.50 0020.48 0020.50 0020.51 0020.47 0020.47 0020.47 0020.49 0020.50 0020.47 0020.53 0020.42 0020.57 0020.43 0020.47 0020.49 0020.50 0020.46 0020.49 0020.40 0020.48 0020.32 0020.39 0020.55 0021.39 0020.66 0020.77 0020.34 0019.52 0052 24.81 i opening file , closing it, have opencv specific header files included: #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <stdlib.h> #include <stdio.h> #include <math.h> #include "opencv/cv.h" #include "opencv/highgui.h" using namespace cv; using namespace std; int main() { file *fp; int i,x; int read; char * buffer; buf...

ios - Xcode - Inferred navigation bar layout issues with tableview -

Image
i having frustrating issue layout of tableview when have inferred navigation bar. in order re-produce bug 1: create navigation based app. 2: create 2nd viewcontroller xib file included (in xib file, select top bar simulated). 3: on first screen, place button when clicked takes new controller created in step 2 4: on new xib file, place tableview on screen , setup delegate methods. 5: create 3rd viewcontroller xib file. now under didselectrow table delegate method in 2nd screen, have setup take me 3rd screen. when app navigates new screen, button pressed, tableview pushed down height equal navigation bar. see images originally tableview screen looks this i select table row, taken 3rd screen, press button, , looks this this happens in xib files. if create same functionality using storyboard instead of xib files, issue not occur. can fix removing inferred top bar, , instead manually placing navigation bar in xib file. shouldn't have each time, annoying. th...

php - GuzzlePHP mock response content -

i want mock response guzzle request: $response = new response(200, ['x-foo' => 'bar']); //how set content of $response to--> "some mocked content" $client = mockery::mock('guzzlehttp\client'); $client->shouldreceive('get')->once()->andreturn($response); i noticed need add third parameter interface: guzzlehttp\stream\streaminterface but there many implementations of it, , want return simple string. ideas? edit: use this: $response = new response(200, [], guzzlehttp\stream\stream::factory('bad xml here')); but when check this: $response->getbody()->getcontents() i empty string. why this? edit 2: happened me when used xdebug, when runs works great! the previous answer guzzle 3. guzzle 5 uses following: <?php $body = guzzlehttp\stream\stream::factory('some mocked content'); $response = new response(200, ['x-foo' => 'bar'], $body);

jquery - Return JSON response to image upload in RUBY -

i'm newbie ruby .the question might sound worthless of you. sorry that. i'm struggling find solution problem past 6 hours. aim: i have html editor. here, want insert image editor have been uploaded via file dialog. what did once, user uploads image via file dialog, return path image( 1 have been constructed dynamically @ server side) . i'm using jquery ajaxupload method uploading image. where did struggle i have no problem saving uploaded image using ruby . class imagecontroller < applicationcontroller def upload post = datafile.save(params[:upload]) #how send json response here end end i need send uploaded image url browser json response follows { 'url' : 'app/uploadedimage/***.**'} in js, use url src image element follows $.ajax({ url: 'image/upload', * * * success: function (returndata) { var image = document.createelement('img'); ...

asp.net mvc - MVC5 OWIN ws-federation AuthenticationManager.GetExternalLoginInfoAsync() returns null -

i'm trying setup integrated owin ws-federation (adfs) authentication in new mvc 5 project in visual studio 2013. wsfederation in startup.auth configured follows: app.usewsfederationauthentication(wtrealm: "myrealm", metadataaddress: "https://myadfsinstancehost/federationmetadata/2007-06/federationmetadata.xml"); federation button @ login page works fine. adfs login page achievable, can log in there. required cookies seems being set properly. @ least there passed .aspnet.externalcookie cookie. when callback mvc app performed, in externallogincallback controller authenticationmanager.getexternallogininfoasync() returns null.

Smooth animation WPF -

i have animation making image wheel rotate forever. here code: <image name="bigwheelimage" source="{dynamicresource bigwheel}" height="400" width="400" > <image.rendertransform> <rotatetransform centerx="200" centery="200" /> </image.rendertransform> <image.layouttransform> <translatetransform x="0" y="0" /> </image.layouttransform> <image.style> <style> <style.triggers> <trigger property="image.isenabled" value="true"> <trigger.enteractions> <beginstoryboard> <storyboa...

Ruby on Rails App vs Core Development -

i have been doing searching ruby on rails there 1 thing don't quite understand reading it? difference between app , core development? core development improving upon rails while apps website creation? explanation on difference useful. thank you! yes. :) if you're seeing "rails core" or "rails core contributor" or like, that's referring development of rails itself. rails apps app/site creation, stated. (though if in app-building business, both useful , educational pay attention development of framework itself.)

php - Yii: Unable to upload file using Ajax -

after reading accepted answer on this post, trying implement same not able figure out problem. when select file, nothing available in $_files on server side. doing wrong? using apache 2.2.22, yii 1.12 my view file <form enctype="multipart/form-data" action='/webapp/index.php/emu/default/uploadfile' method="post"> <input type="hidden" name="max_file_size" value="30000" /> <input id="files" type="file" > </form> <script> document.getelementbyid('files').addeventlistener('change', function(e) { var file = this.files[0]; var xhr = new xmlhttprequest(); xhr.file = file; // not necessary if create scopes xhr.addeventlistener('progress', function(e) { var done = e.position || e.loaded, total = e.totalsize || e.total; console.log('xhr progress: ' + (math.floor(done/total*1000)/10) + '%'); }, fals...