Posts

Showing posts from January, 2014

css - opacity on linear gradient background-image -

how can set opacity value, example opacity: 0.6 on linear-gradient background-image? background-image: linear-gradient(to left, #00497a -26.48%,#003366 73.52%); thanks! replace hexidecimal color-codes rgba color-codes : div { width: 150px; height: 150px; background-image: linear-gradient(to left, rgba(0,67,116,0.6) -26.48%, rgba(0,51,102,0.6) 73.52%); } <div> </div>

jquery - json for making a cross browser request -

sorry if duplicating qn. none of answers present me solution cross browser request problem. i need send request different url using json , required headers. tried following code doesnt seems working. it takes 3 parameters.. var url = 'url?firstname=myname&lastname=mylastname&email=myemail'; $.ajax({ type: 'get', url: url, datatype: 'jsonp', success: function(){ alert("hi"); }, error: function() { alert( 'something goes wrong!' ); } }); the output 'something goes wrong!'. working when copy url in browser area. looking accomplish same through jquery , json formatted input. need pass required headers. much appreciated if let me know missing above code? while using jsonp datatype, need bind call function in server side.. example, if need json response {"id":"myid"}, @ server side should return "mycallback({"id":"myid"})";

How to Add in Less Meta Informations for a Mixin Class? (phpStorm) -

is possible in less setup mixin informations can read phpstorm? i write mixin this: .action-btn(@size: 32px, @color: #fff, @bgcolor: @overlaystyleblack, @bgcolorhover: @red) { { width: @size; display: block; color: @color; text-align: center; line-height: @size; background-color: @bgcolor; &:hover { cursor: pointer; background-color: @bgcolorhover; } } } what want is, when use mixin in less file: ".action-btn();" want see have in mixin 4 settings can setup. in php classes can with: /** * @param string $xxx * function check , change user is_online flag in sphinx , in mysql */ but dont work in less mixin file. and how can skip settings? here example explain mean. (this ry dont worked) .action-btn(64px, , , #fff);

android - Cardview not at back position in RelativeLayout -

Image
i have problem implement cardview in relativelayout. set cardview @ position in relativelayout. it's seem not want. i want (edited photosop): current display (on live device , on android studio) this xml : <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="4dp"> <android.support.v7.widget.cardview android:id="@+id/root_parent" android:layout_width="match_parent" android:layout_height="match_parent" android:background="?android:attr/selectableitembackground" android:descendantfocusability="blocksdescendants

javascript - removeListener in the Listener in nodejs -

in addition this question. possible remove listener inside callback function? for example: var callback = function(stream) { if(something) dosomething(); else server.removelistener('connection', callback); }; server.on('connection', callback); yes possible. node's eventemitter class provide once function, in order attach listener called... once.

swift - PFQuery not picking up variable -

a user enters text textfield, , want parse query results based on field. "kvc syntax challenged"!, wondering code need pick newtext var in parse filter. in advance can me... func wordentered(alert: uialertaction!){ // store new word newtext = newwordfield.text! string // query parse getlist() } func getlist() { let query = pfquery(classname: "wordlist") query.wherekey("sharingcode", equalto: "@\(newtext)") // not picking newtext?? query.findobjectsinbackgroundwithblock { (objects:[pfobject]?, error:nserror?) -> void in if error == nil && objects != nil { object in objects! { // process objects } else { print("error") } } }

javascript - Updating or deleting d3.slider with variation of visualization -

Image
i want visualize data on map on time , per day. therefore got 2 functions plotting points on day , remove after day has passed var showone = function (){ var slider = d3.slider() .axis(true).min(mindate).max(maxdate) .on("slide", function(evt, value) { sliderdate = moment(value,"x").utc().format("yyyy-mm-dd"); newdatas = site_datas.features.filter(function(d){ datadate = d.properties.date; if (datadate == sliderdate) { return dps(datadate); } }); displaysitess(newdatas); }) d3.select('#slider3').call(slider); } and have function shows incidents on time var showtwo = function (){ d3.select('#slider3').call(d3.slider() .axis(true).min(mindate).max(maxdate) .on("slide", function(evt, value) { sliderdate = moment(value,"x").utc().format("yyyy-mm-dd"); newdatas = site_datas.features.filte

c - Linking separate binaries -

say have 2 executables need loaded in same address space, @ different addresses. want keep 2 executables separate files, allow 1 call functions another. for example, if executable a, has loaded @ 0x1000, contains function void foo() @ 0x1abc , executable b, loaded @ 0x2000, calls foo() , want end call 0x1abc in executable b. the reason need toy os. need bootloader know interrupt handler , kernel code starts. might able squeeze whole thing 1 file, i'd rather not. at moment solve problem manually loading needed functions @ "nice" addresses , manually writing jumps them. works, but, needles say, suboptimal. one option provied addresses of function on second path. file example, or fixed memory address. if have full control on system, last version should work well.

R: How to install tiff package on OS X El Capitan -

i trying install r tiff package on mac os x el capitan homebrew installation of r. used post r: how install package tiff on mac os x mavericks? follow suggestions. r-version: > version _ platform x86_64-apple-darwin15.0.0 arch x86_64 os darwin15.0.0 system x86_64, darwin15.0.0 status major 3 minor 2.2 year 2015 month 08 day 14 svn rev 69053 language r version.string r version 3.2.2 (2015-08-14) nickname fire safety > install.packages("tiff", type="source") installing package '/usr/local/lib/r/3.2/site-library' (as 'lib' unspecified)

Opencv in QT giving error for no reason -

Image
i trying use opencv library in qt i'm keep getting error shouldn't suppose occur. here code of simple program. #include <opencv2/highgui/highgui.hpp> using namespace cv; //all classes , functions defined in c++ api of opencv defined within name space cv. using namespace std; int main(){ mat image = imread("c:/opencv/opencv/samples/c/cat.jpg",cv_load_image_grayscale); cout << "number of rows: " << image.rows << endl << "number of coloumn: " << image.cols; imshow ("image",image); waitkey(0); } c:\users\cipher\downloads\programs\untitled2\main.cpp:1: error: c1083: cannot open include file: 'highgui.hpp': no such file or directory the problem that, file there qt couldn't able find file, can access file , when hold ctrl , move cursor on #include <opencv2/highgui/highgui.hpp> , click on accessing file, still qt keep saying find such file or director

ios - Do I have enough time to perform a Server update when my App is started from Background mode? -

i failing find documentation on this. if application able use background location services, how processing can before device stops task using resource? e.g. when location changes, ping server new location. regards: john if app has permission of getting location updates in background, not limited on performing tasks, run code, app allowed execute code while suspended (this used apps providing navigation). however, aware, apple not approve app, background location updates permission, unless it's app justify requirement (sports tracking app, navigation app, etc) you can location updates region monitoring or significant location changes, without having use location updates background mode. so comes tricky part. have enough time perform server update of users location when app started background mode region monitoring or significant location services ? the answer, seems yes , as suggested article i haven't tried this, judging code, don't find reason wh

algorithm - When would it be important to be able to calculate order of growth? -

i'm reading chapter 2 , 3 of clrs , , stuck often, in problems provided @ end of each chapter, wonder if it'll ever worthwhile effort. can't understand solution online one: http://clrs.skanev.com/02/problems/01.html i heard book 1 of popular text books university cs class, people skip intricate parts , memorize important things, insertion sort has order of growth , merge sort has order of growth, , go ahead? isn't enough familiar many useful algorithms have understanding of computer science people degree in cs in general? understanding isn't memorization. it's being able apply knowledge solve problems. textbook problems quite simple compared real-life problems. so, skipping these means you're not learning @ all, , won't able apply of in real life. you're memorizing, can't use you've memorized. tl;dr: proof of being able use knowledge ability solve problems, , textbook problems simple . ‡ 1 doesn't go without other.

sql server - Update MySQL table from an MSSQL Table with Talend -

i want update mysql table values retrieved mssql table in talend. i used mssql table tmssqlunput, tmap , mysql table tmysqloutput couldn't update establish join query , update table. what should do? you can define key in schema of tmysqloutput , select action update. way talend generate update statement using key columns in update clause...and process them @ mysql db. it done each row coming out of tmap. if want write own sql should use tmysqlrow..

postgresql - Postgres hierarchical (jsonb) CTE unnecessarily slow -

i have jsonb column in table holds hierarchical information. mytable (id uuid, indexes jsonb, content bytea) now if create cte say with recursive hierarchy(pid, id, content) ( --load first parents select t.indexes ->> 'parentid' pid, t.id, t.content mytable c join mytable t on t.indexes ->> 'id' = c.indexes ->> 'parentid' c.id = any('{..some uuids}') union select t.indexes ->> 'parentid' pid, t.id, t.content hierarchy h, mytable t t.indexes ->> 'id' = h.pid ) select id, content hierarchy now example run of building parent tree 2 nodes within table of 300k records takes approximately 10s. now if create index create index myindex on mytable using btree ((indexes ->> 'id') this reduces time 4.5s. produces analysis of -> recursive union (cost=23.81..4528423.71 rows=80794929 width=1219) (actual time=0.188..1802.636 rows=5 loops=1) -> nested

c# - Performance vs clean code? -

msdn's performance tuning recommendations this: make chunky calls chunky call function call performs several tasks, such method initializes several fields of object. viewed against chatty calls, simple tasks , require multiple calls things done (such setting every field of object different call). it's important make chunky, rather chatty calls across methods overhead higher simple, intra-appdomain method calls. p/invoke, interop , remoting calls carry overhead, , want use them sparingly. in each of these cases, should try design application doesn't rely on small, frequent calls carry overhead. but how comply solid design principles? trying tune performance on brownfield windows forms application, , have been refactoring more solid. degrading performance this? i think important part is: where overhead higher simple, intra-appdomain method calls so if you're calling web service, make 1 call returns data in 1 go rather making multiple calls

java - Passing an arraylist in array-android app -

i have been referring app make gallery module https://github.com/nostra13/android-universal-image-loader however according requirement in app images dynamically added.so, fetching images via json.the image response json iam adding in arraylist. how should pass " image_urls.add(folio.getstring(i)); " in new class : public class test extends activity{ private static string url = "http://www.xyz.com/album_pro/array_to_encode"; jsonarray folio = null; arraylist<string> urllist = new arraylist<string>(); @suppresslint("newapi") public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); jsonparser jparser = new jsonparser(); { try{ jsonobject json = jparser.getjsonfromur

java - How to generate Paragraph in itext conditionally and add content to it -

i have got content in arraylist , want generate pdf file the content in arraylist goes way arraylist<string> my_list = new arraylist<string>(); my_list.add("today date"); my_list.add("some content1"); my_list.add("*****"); my_list.add("some content2"); my_list.add("some content3"); my_list.add("some content4"); my_list.add("*****"); my_list.add("some content5"); my_list.add("some content6"); my_list.add("some content7"); my_list.add("*****"); my_list.add("some content8"); my requirement want generate new paragraph after every ****** i started way shown couldn't proceed further on public class test { public static void main(string[] args) throws filenotfoundexception, documentexception { arraylist<string> my_list = new arraylist<string>(); my_list.add("today date"); my_list.add("som

r - Error on XLConnect::readWorksheet function -

i have line of r code giving me error. line of code is: var <- readworksheet(paste(dir.censo, arq.variaveis, sep="/"), sheet = sheet.variaveis) where dir.censo holds directory path of excel workbook , arq.variaveis name of variable holding file name. naturally sheet.variaveis holds name of worksheet need. file saved xlsx. here error: error in (function (classes, fdef, mtable) : unable find inherited method function ‘readworksheet’ signature ‘"character", "character"’ i searched error online, nothing showed up. if me resolve problem, i'd appreciate it. system information in case need them: operating system: windows 10 r version: 3.2.3 rstudio version: 0.99.473 java version: 8.0_66 again, lot. i figured out how resolve issue. i'm posting answer here in case else runs problemj, search wouldn't fruitless. replaced line of code above following 2 lines: wb <- loadworkbook(file.path(dir.censo, arq.variavei

php - MySQL subquery from another database where table name depends on main query -

hi trying sub query table(name: table_guest_id) database id table name depends on main query. here set of databases: three tables: events, profile, table_guest_id two databases: main , guest(dbname below make clear) main contains: events , profile guest contain: table_guest_id(where id = e.id) and sql code: public function getlistattendee($user) { $sql = "select p.name e.user, e.id, e.date events e, profile p p.user_id=e.user , e.event_date >= curdate() , (select count(*) dbname.table_guest_[??note: need insert e.id??] a.event_id=e.id , a.user_id='{$user}' , a.status='invited') > 0"; } i have put note id or e.id inserted, not working yet. please let me know if have different solution on how sub query table name of table depends on main query values. idea possible? it seems trying perform variabl

three.js - ThreeJS: Converting from screen 2D coordinate to world 3D coordinate on the canera near plane? R73 -

i got little bit in trouble coordinate conversion. have object on screen known coordinates (x,y) , want convert world coordinates (x,y,z) projected on camera's near plane. so far, can make projection onto z plane this: var vector = new three.vector3( mouse.x, mouse.y, 1 ); vector.unproject( camera ); but unfortunately cannot proceed further :( if use -1 z component, you'll projected on near plane, instead far plane: var vector = new three.vector3( mouse.x, mouse.y, -1 ).unproject( camera ); assuming mouse.x , mouse.y between -1 , 1. three.js r.73

Azure DocumentDB will move from global to regional meters -

documentdb users receiving email saying 1 february charged based on region in data resides , clear far. moreover mail said: "the resource guids documentdb change" , there link " guid mapping ". could explain better thing? i've not understood if guid relative single document, subscription or else. guid , meaning? don't know if need make changes application , type. thanks maybe i've understood guid is. think id of documentdb subscription , needs billing. in fact, can find here: go billing area inside azure dashboard download , open billing item screenshot see row "data services" in file , you'll find guid on other hand, don't know if need make changes application.

elm - How to filter a Signal on page load -

for sake of learning, i'm trying load content when click on button. far i've managed : reload content when click button. and filter signal when click (if string send not "getperf") but problem ajax call still triggered once page loads. here's code: -- signals & mailbox inbox : signal.mailbox string inbox = signal.mailbox "some text" result : signal.mailbox string result = signal.mailbox "" -- view view : string -> html view msg = div [] [ h1 [] [text "mailbox3"], p [] [text msg], button [onclick inbox.address "getperf"] [text "click perf"], ] main : signal html main = signal.map view result.signal -- task & effects port fetchreadme : signal (task http.error ()) port fetchreadme = inbox.signal |> signal.filter (\sig -> sig == "getperf" ) "boo" |> signal.map (\_ -> http.getstring "http://localhost:3000/d

javascript - Socket getting text string as hex array, multiple socket call in each other's event -

client: var iosocket = io.connect(); iosocket.on('connect', function () { iosocket.on('message', function(message) { console.log(message) }); }); $('#input').keypress(function(event) { if(event.which == 13) { event.preventdefault(); iosocket.send($('#input').val()); } }); server: (ingnore require part) var socket = require('socket.io'); conn = function (socket) { console.log("connnect"); socket.on('disconnect', function (socket) { console.log("disconnect"); }); socket.on('message', function (data) { var socket1 = new net.socket(); socket1.connect (port, host, function() { socket1.write(data); socket1.end(); }); socket1.on('data', function(data) { socket.broadcast.emit('message', data); socket.emit('message',data); }); socket1.on('error', function(exception){ console.l

Jedis and JOhm Error -

i using redis installed on windows via chocolatey , setup jedis , johm in java project. redis server live redis version 2.6 when want save java object 1 in post got error message. java.lang.nosuchmethoderror: redis.clients.jedis.jedis.sadd(ljava/lang/string;ljava/lang/string;)ljava/lang/long; @ redis.clients.johm.nest.sadd(nest.java:168) @ redis.clients.johm.johm.save(johm.java:220) @ redis.clients.johm.johm.save(johm.java:146) this java object: /** * */ package com.smsgh.unitysmpp.messageprocessor; import java.io.serializable; import org.joda.time.datetime; import redis.clients.johm.attribute; import redis.clients.johm.id; import redis.clients.johm.model; /** * @author arsene tochemey gandote class holds messages needs * delivery receipt */ @model public class storedshortmessage implements serializable { /** * */ private static final long serialversionuid = 6185862961624213864l; @id private integer id; // sessi

jquery - Show 2 Additional Rows After Each Button Click -

i fan of google images, , attempting similar search results page. using bootstrap 3, trying show first 2 rows of image gallery. below gallery, have "additional images" button should show next 2 rows after each click. i've gotten close, it's not exact , can't seem find clear solution anywhere. here code have gallery. <!-- gallery carousel --> <section id="sc_gallerycarousel"> <div> <div> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <h1>image gallery</h1> <p class="lead">description of gallery</p> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit. sed eaque perspiciatis est quod labore minima quia delectus dolorem voluptas vero magni laudantium, praes