Posts

Showing posts from May, 2014

web applications - How to create a shortcut for a simple app in Sitecore 7? -

i wrote simple application using web forms have data uploaded sitecore. application works fine can't shortcut created or configure application in sitecore desktop. took following steps create app. created application @ location - /sitecore/content/applications/ following template - /sitecore/templates/sitecore client/applications/application. entered path , name application. i created shortcut @ following location points above app - /sitecore/content/documents , settings/all users/start menu/left. i've checked security on , shows read access sitecore client user , author roles have. can't see shortcut in master database. also, can't see app admin. i'm using sitecore 7.2. appreciated. thanks i remember having issue, try following: go view ribbon, click on “raw values” , go shortcut item , check application field, should (notice .aspx in url , id parameter): <link text="app name" linktype="internal" url="/applica

Apigee Usergrid: Does usergrid allow subcollections? -

i understand in usergrid ui can create individual collection , not allow me create collection under collection. there way of doing . otherwise forced write business logic in proxy layer don't want do. with regards -s there no concept of subcollection, can use connections. can this: post cats/fluffy/hasa/toys/ball the above mean that entity of type "cat" connected entity of type "toy" called "ball" connection verb "hasa". you can store sub-objects in individual entity (e.g. full json supported). if want describe use-case bit more, can maybe recommend other ways structure data.

jquery - Creating multiple instances of dialog box -

i'm new jquery , java , i'm trying head round creating multiple instances of dialog box. i'm using in head: <script src="external/jquery/jquery.js"></script> <script src="jquery-ui.js"></script> if have 1 button , and dialog box works. when add stops working. i'm sure quite easy fix i'm struggling. <h2>subjects</h2> <button id="opener">maths</button> <div id="dialog" title="dialog title">maths important subject.</div> <br> <button id="opener">english</button> <div id="dialog" title="dialog title">this important</div> <br> <script> $( "#dialog" ).dialog({ autoopen: false }); $( "#opener" ).click(function() { $( "#dialog" ).dialog( "open" );

c# - Roslyn Diagnostic + Visual Studio Colorisation -

does know can location "simple" example of colourisation of token based on roslyn diagnostic. yep can make them info, warning, error or hidden. let want use hidden doesn't appear in errors list/window, accessible later. now i've got these hidden diagnostic, affect colourisation of text in ide. this i've tried for. private sub createvisuals(byval line itextviewline) try 'grab reference lines in current textview dim textviewlines = _view?.textviewlines if textviewlines nothing exit sub if line nothing exit sub dim linestart integer = line.start dim lineend integer = line.end dim q = textviewlines.firstordefault if q nothing exit sub dim qq = q.snapshot.getopendocumentincurrentcontextwithchanges if qq nothing exit sub dim sm = qq.getsemanticmodelasync.result '..getsemanticmodelasync.result ' dim di = sm.getsyntaxdiagnostics.toarray if sm nothing exit sub dim diags = sm.getdiagnosti

ios - PFQueryTableViewController in Swift using Cloud Code function -

i'm trying convert simple uitableviewcontroller pfquerytableviewcontroller in swift. far know have initialise class that: ( source ) class testtableviewcontroller: pfquerytableviewcontroller { required init(coder adecoder: nscoder) { super.init(coder: adecoder) } override init(classname aclassname: string!) { super.init(classname: aclassname) self.parseclassname = aclassname self.textkey = "your_parse_colomn_you_want_to_show" self.pulltorefreshenabled = true self.paginationenabled = false } } i have 2 problems: somehow cannot import pfquerytableviewcontroller i use cloud function feeding table instead of query object. any idea? in bridging header swift need import "parseui.h" below. need initialize class name in 'init:coder' #import '<parseui/parseui.h>' init of pfquerytableviewcontroller class object override init!(style: uitableviewstyle, classname: string!) { super.init(style:

iOS to Parse.com - SaveInBackground Object ID is null -

i struggling find why getting null value when using saveinbackgroundwithblock parse.com. sure missing something, have tried both if (!error) , if(succeeded) same result object created eventid (the objectid) null... suggestions? thanks in advance! [event saveinbackgroundwithblock:^(bool succeeded, nserror *error) { if (!error) { [commonhelper hidebusyview]; eventobj *obj = [[eventobj alloc] init]; obj.eventid = event.objectid; obj.eventname = strnameevent; obj.eventdatetime = self.dateevent; obj.eventaddress = straddress; nslog(@"eventid: %@",self.eventobj.eventid); previewinvite *invitepreview =[[previewinvite alloc] init]; invitepreview.eventobj = self.eventobj; [self.navigationcontroller pushviewcontroller

unity3d - unity doesn't show preview -

Image
my question quite simple. learning unity , watching tutorial making 2d game. in tutorial, there preview section @ bottom right corner. in unity, there nothing there. there inspector on right , below of add component there nothing. can explain me how can activate part? in advance! this want: this preview box resources. shows preview of resource. show must click on 1 of resources(like image). however when not have resource selected not show

javascript - Jquery Dot Navigation within Drop Down Gallery -

i developing parallax portfolio site , want include jquery features. have working drop down gallery wanting add dot navigation gallery. once added dot navigation, drop down feature stopped working. have set example on jsfiddle. first link, shows drop down feature. (currently opens every gallery @ same time.) second link adds dot navigation. http://jsfiddle.net/carincamen/pvphpcuw/12/ html: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <body> <p>click small black box show large rectangle box.</p> <img class="arrow"> <div class="gallery"></div> css: .gallery { position: relative; width: 620px; height: 215px; top: 30px; left: 50px; background-color: rgb(0,0,0); } .arrow{ position: relative; width:20px; height: 20px; top: 15px; left: 340px; background-color: rgb(0,0,0); } jquery: $(document).ready(fu

javascript - How does Wikipedia create images from <math> element? -

i've noticed that, using <math> element on wikipedia, can input latex code , have latex result. code, however, not maintained on actual page after being edited; somehow saved image element (meaningful?) source (e.g. this picture/equation ). example given's source .../math/a/9/7/a97cd92ab2cdf4de6ea533805627f7f3.png . i wondering if there way can manipulate (i.e. create script interpret user's latex input , convert source), or if use whatever code/process wikipedia uses achieve this. source appears in base 16 (hexadecimal)--does have sort of meaning? the main question i'm asking is: how can use wikipedia's latex interpreter advantage? trying use in google sites, not allow native javascript executed. wikipedia, afaik, uses tex render image serverside, when submit page. hex appears hash, of original content. use mathjax (heavy) or katex (light) render latex on clientside html. if want render serverside (to image), want use tex itself. i

matlab - Low pass gaussian filter with a specified cut off frequency -

i'm playing around hybrid images , , wanted use gaussian filter low pass filter image. however, make hybrid images, 2 filters supposed used on 2 images being combined different cut off frequencies. does fspecial() allow specify cut off frequencies when employ make gaussian filter? (i know can specify filter size , sigma , there relation between sigma , cut off frequency). if can specify cut off frequencies using sigma, sigma need set cut off frequency of 0.2 hz. i'll first answer regarding 1d , rest follow. may trivial, bare me while. lets assume following code: t=linspace(0,20,2^10); %time vector in seconds w=0.2; %in hz signal=cos(2*pi*w*t)+rand(1,length(t))-0.5; % signal in seconds dt=t(2)-t(1) ; n=length(signal); df=1/(n*dt); % frequency resolution (df=1/max_t) if mod(n,2)==0 f_vec= df*((1:n)-1-n/2); % length vectors else f_vec= df*((1:n)-0.5-n/2); end so, have created noisy signal of specific frequency. f_vec frequency vector stretches f =[

c# - How to efficiently generate strong ETags using a System.Net.Cryptography HashAlgorithm? -

when handling httprequestmessages in webapi2, we're looking @ multiple ways handle if-none-match using strong etags. hashing response content strong etag obvious solution needs hashing process scale. it appears best practice code generating hash like: using (var hasher = sha1.create()) return hasher.computehash(stream); what costs associated creating hashalgorithm object? is using byte array more efficient stream? using (var hasher = sha1.create()) return hasher.computehash(bytearray); i've encountered info suggesting managed version of algorithms might stateless, possibly allowing computehash called multiple times on same object, makes me wonder if means there no real cost associated creating new object each time. thanks in advance!

Trouble with PHP sessions -

i have html page few buttons take me php page, page handle logic i'm having trouble setting sessions. i going wrong way i'd appreciate if pointed me in right direction. this html page code i'm working with: <form action="reportpage.php"> <center><input type="submit" value="view customers"></center> <?php $_session['customer'] = "checkcustrains"; ?> </form> <form action="reportpage.php" mehtod="post"> <center><input type="submit" value="view admins"></center> <?php $_session['admins'] = "checkcusadmin"; ?> </form> i each button go reportuser.php page, different session, have if/else statements set in report page display information corresponding session. h

sql - How to assign a variable different values based on a column cell values -

i need loop through rows , following: if date_deleted null set @form = '01' else @form = '02' currently returning form = 01 only. thank you! select @checkdate = [date_deleted] executive__vehicles (state = 'nc') if ( @checkdate null ) begin set @form = '01' end else begin set @form = '02' end you need load results executive_vehicles temp table , loop through them 1 one set. create table #temptable1(iid int identity(1,1),date_deleted datetime) insert #temptable1 select [date_deleted] executive__vehicles (state = 'nc') declare @countrows int declare @checkdate datetime declare @toprow int set @countrows =(select count(*) #temptable1) while @countrows>0 begin set @toprow = (select top 1 iid #temptable1) set @checkdate = (select top 1 date_deleted #temptable1) if ( @checkdate null ) begin set @form = '01' end else begin set @form = '02' end de

java - Why is every System.out.println I do failed? -

every system.out.println fails multiple errors. trying have input 5 integers "please enter 5 integers" showing up. here have. import java.util.scanner; public class simplemath { public static void main(string args[]) { scanner user_input = new scanner( system.in ); system.out.println (“ please enter 5 integers. ”); int firstnumber = user_input.nextint(); int secondnumber = user_input.nextint(); int thirdnumber = user_input.nextint(); int fourthnumber = user_input.nextint(); int fifthnumber = user_input.nextint(); okay! using mac cause i'm out of state, here updated version of code, i'm brand new beginning coder, literally took me 20 hours do, , have no idea why quotes on mac keyboard curly can't find straight quotes. so here update better code source. import java.util.scanner; public class simplemath { public static void main(string args[]) {

postgresql - SQL: Calculating the day over day repeat user percentage -

i have events table has user_id , created_at columns. what i'd figure out percentage of users having day-over-day repeat entries in events table. so, if day d1 has user_id s [a,b,c] , , day d2 has user_id s [b,d,e] , b repeat user_id of 3 (from d1 ), , there 33% overlap between d1 , d2 . i'd able extend arbitrary number of days. the schema in question: create table events ( events_id serial primary key , user_id varchar(255) not null , created_at datetime not null ); this large table, having ~25mm rows per day, ~4.5mm distinct user_id s per day. example data set: +---------+---------------------+ | user_id | created_at | +---------+---------------------+ | bob | 2014-12-02 11:11:11 | | sally | 2014-12-02 12:12:11 | | zed | 2014-12-02 12:22:11 | | | ... | | chris | 2014-12-03 11:13:11 | | mark | 2014-12-03 11:11:13 | | zed | 2014-12-03 11:11:33 | | | ... | | sydney | 2014

javascript - jQuery empty out text area then append data does not work -

i have textarea , supposed empty out data, append new data. tried this, ended empty data. textarea standard html input: <textarea name="mytextarea" id="mytextarea" rows="8" class="form-control" readonly="readonly">myolddata</textarea> //this resulting in empty data $('#mytextarea').val(''); $('#mytextarea').append("mydata1"); $('#mytextarea').append("mydata2"); but if: //this resulting in mydata1 $('#mytextarea').val(''); $('#mytextarea').val("mydata1"); $('#mytextarea').append("mydata2"); case 3 if don't need empty out data , append work fine: //this resulting in mydata1mydata2 $('#mytextarea').val("mydata1"); $('#mytextarea').append("mydata2"); what happening here? how can empty out data first, append new data? if attempting set value. build out string

ruby on rails - nothing changes when making change in assets fiels -

i'm trying make change in css file seems not responding if deleted whole file, still loaded in page, i've tried remove assets folder public , made bundle exec rake assets:clean bundle exec rake assets:precompile but nothing changed that's development config file rails.application.configure # settings specified here take precedence on in config/application.rb. config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } # in development environment application's code reloaded on # every request. slows down response time perfect development # since don't have restart web server when make code changes. config.cache_classes = false # not eager load code on boot. config.eager_load = false # show full error reports , disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false # don't care if mailer can't send. config.action_mailer.raise_delivery_

How do I create a Single JAR for source code spanning multiple projects in Eclipse and another JAR with just the dependencies using Maven -

i trying create single jar out of multiple projects in eclipse using maven. requirement make 2 jars, 1. single jar source code projects 2. single jar dependencies without source code. i deploying storm cluster need different jars since jar dependencies fat. thank you!

java - jhipster- how to add a new role -

i trying add new role (role_reports) on project generated using jhipster. can see tables need updated (role, authority , role_authority mapping), not sure how go java part of it. there few bits , pieces can figure out, concerned customisation may break design philosophies (like swagger api, spring security, etc.,) has attempted , if in right direction highly appreciated. add security/authoritiesconstants.java. , webapps/scripts/contstants.js. in example below, authority/role of manager added. public final class authoritiesconstants { private authoritiesconstants() { } public static final string admin = "role_admin"; public static final string user = "role_user"; public static final string manager = "role_manager"; public static final string anonymous = "role_anonymous"; } and in constants.js: myapp.constant('user_roles', { 'all': '*', 'admin': '

Sort php sub array based on sub key -

here snippet of array used in php 5.3.x : $arr[$category][$item][$attr_qty] = 3; $arr[$category][$item][$attr_price] = 12.00; $category arbitrary integers, $item , $attr_qty , $attr_price . is there quick way of sorting, $attr_qty , items in each category? using integers makes code easier, feeling have use associative arrays. you can use usort allows specify custom sorting function usort($arr, 'customsortfunction'); function customsortfunction($a, $b) { if ($a['item']['attr_qty'] > $b['item']['attr_qty']) return 1; //first element bigger elseif ($a['item']['attr_qty'] < $b['item']['attr_qty']) return -1; //second element bigger else return 0; //both equal }

Runtime.exec() fails with space in directory (Java) -

i trying execute process in same directory jar file getting location of file with private static file jarlocation = new file(main.class.getprotectiondomain().getcodesource().getlocation().getpath()).getparentfile(); then calling runtime.getruntime().exec("command", null, jarlocation); this works fine when path has space in "the directory name invalid". have attempted add debug code prints path of directory has replaced spaces "%20" (i assume because ascii hex of space 20). there way able use directory spaces in path? that getpath() call, url.getpath() , not return filesystem path. returns path portion of url. in case of file: url, url-encoded local filesystem path. if original url in fact file: url, need use uri , url classes, or custom string processing, convert local filesystem path runtime.exec() can work with. this might work directly in case. file jarlocation = paths.get(main.class.getprotectiondomain().getcodesource().get

java - mockmvc standalonesetup how to inject freemarker viewresolver? -

i'm using spring test framework present in spring 3.2.0 test spring mvc controllers. im trying create standalone test setup have total control of variables. i've got test working internalresourceviewresolver. i'm trying use freemarker templating engine , can not figure out how include freemarker configuration bean standalone setup. the following class: @runwith(mockitojunitrunner.class) public class standaloneregistrationcontrollertest { private mockmvc mockmvc; @mock private userregistrationservice userregistrationservicemock; @before public void setup() { mockmvc = mockmvcbuilders.standalonesetup(new registrationcontroller()) .setviewresolvers(viewresolver()) .build(); } private viewresolver viewresolver() { freemarkerviewresolver freemarkerviewresolver = new freemarkerviewresolver(); freemarkerviewresolver.setcache(false); freemarkerviewresolver.setprefix("/view/"); freemarkerviewresolver.setsuffix(&quo

templates - Maybe types in D -

i'm trying define value type either holds size_t or null (which mean 'maybe type'). want able (where relevant type maybe!size_t : maybe!size_t something_which_could_fail (int foo) { if (foo < 0) { return null;} else { return foo;} } how implement such thing? ideally, able make template (so have other maybe types well), , have conversions maybe non-maybe types possible above (although don't mind typecasting if not possible). nice if this: maybe!size_t = 50; maybe!size_t b = null; what nullable type in phobos library? http://dlang.org/phobos/std_typecons.html#.nullable and other info in d forum: d forum thread option(maybe) type

php - Create a table from an array -

need there 5 servers $server1 = “1234”; $server2 = “”; $server3 = “5463”; $server4 = “”; $server5 = “1827”; $server = array($server1, $server2, $server3, $server4, $server5); then curl initialised $ch = curl_init(); curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_url, "https://api.domain.com/$server1"); curl_setopt($ch, curlopt_returntransfer, 1); $result = curl_exec($ch); $json = json_decode($result, true); $ip = $json[droplet][networks][v4][0][ip_address]; $status = $json[droplet][status]; $currentapp = $json[droplet][image][name]; $hostname = $json[droplet][name]; $memory = $json[droplet][memory]; $cpu = $json[droplet][vcpus]; $disk = $json[droplet][disk]; and result echoed in table : <tr> <td style="text-align:center"><?php echo $ip; ?></td> <td style="text-align:center"><?php echo $status; ?></td> <td style="text-align:center">

python - Pandas calculate year over year (or any other index) change in rows -

say have dataframe such: b c d --- -- -- -- 2012-01-01 aaa 11 22 33 2013-01-01 aaa 11 23 53 2014-01-01 aaa 11 78 96 2012-01-01 bbb 12 42 24 2013-01-01 bbb 13 97 91 2014-01-01 bbb 14 25 12 (index datetime) i want figure out change in column c between first appearance of aaa , last (in case 78-22 = 56). doing pivoting table years columns across top , adding difference column. there better way without modifying table? if has many groups, may consider using groupby . assume df dataframe work with. a = df.groupby("a")["c"] newt = a.last() - a.first() print(newt) the result: a aaa 56 bbb -17 name: c, dtype: int64

c++ - Why am I getting this bash: syntax error near unexpected token `('? -

Image
i testing c++ boost library , trying recompile dynamic libs. in order following link , getting terminal error -bash: syntax error near unexpected token ('` this script used venushkas-macbook-pro:~ venushka$ otool -l exefile:@executable_path/ dyliblibboost_atomic.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0) /usr/lib/libsystem.b.dylib (compatibility version 1.0.0, current version 1213.0.0) i have changed white spaces of above script nothing works me. appreciated. this command otool -l exefile everything else in link output command.

r - Vectorizing or for loop or apply function? -

i have dataframe 6 columns. column 1 holds dates, column 2 individuals , column 3 6 used calcuation. date <- c(1, 1, 2, 2, 2, 3) ind <- c("a","a","a","b","c","c") c <- c(5, 6, 5, 7, 8, 8) d <- c(8, 8, 9, 9, 9, 9) e <- c(8, 9, 11, 10, 9, 7) f <- c(5, 6, 8, 5, 7, 4) df <- data.frame(date, ind, c, d, e, f) i want perform calculation (like (c-e)+(d-f) (in real life coordinates , i'm calculating distances, that's not problem right now). i want perform calculations, stored in new column (g), 1 day difference between use value of column c , e day 1, , values of column e , f day+1 same individual. i'm not sure if should use loop or apply function. i've tried far, vectorized operation , subsetting, based on thread: loop on rows of dataframe applying function if-statement df$g <- na df[!(df$date ==(df$date+1)), "g"] <- ((c-e)+(d-f)) this works, calculations on coordi

java - What's the result of HQL select from an interface which have two implemented classes -

i have interface named customer , these 2 classes customerimpl , ownercustomerimpl both implemented interface, have hql "select customer customer customer customer.username=:username" , what's result of hql? i objects of customerimpl , want ownercustomerimpl . i read doc like: 14.8. polymorphic queries a query like: from cat cat returns instances not of cat, of subclasses domesticcat. hibernate queries can name java class or interface in clause. query return instances of persistent classes extend class or implement interface. following query return persistent objects: from java.lang.object o the interface named might implemented various persistent classes: from named n, named m n.name = m.name these last 2 queries require more 1 sql select. means order clause not correctly order whole result set. means cannot call these queries using query.scroll(). as think, result should include both these 2 classes, can explai

CakePHP: Flexible redirection for views and controllers -

i have views called different views. customers edit view can called customers list, customers search, within order , on. of views simple views other contains forms add, edit or delete data. after user has done had to on form should redirected calling form or form. using $this->referer() wouldn't work navigations have go this: list order --> edit order --> delete order --> list order. i fine defining redirection every call i've tried use query strings , add ?redirecttarget=<wherever> every link or redirection. i've made controller function in appcontroller.php public function getredirecttarget() { if ($this->request->query('redirecttarget')) { return $this->request->query('redirecttarget'); } else { return array( 'controller' => 'pages', 'action' => 'home' ); } } this works forms can use getredirecttarget() in cont

memory management - Separate one process into several processes in C# -

i have function setcamerachannel open camera channel based on device data in database. tested open 5 channels , works fine (around 400,000k memory though), if open 20 channels, lead "failed allocate memory". is possible separate 20 channels 4 different processes (1 process contains 5 channels) , when channel cannot opened, automatically trying re-open channel? or have idea how run 20 channels without having memory allocation problem? private void setcamerachannel() { system.threading.threadpool.queueuserworkitem(new system.threading.waitcallback(delegate(object state) { foreach (datarow dr in dtfdinfo.rows) { fdcamera fdcamerachannel = null; url = string.format("rtsp://{0}:{1}@{2}:{3}/live/video/h264/record/ch{4}?tcp", dr["sourceuserid"], dr["sourceuserpw"], dr["sourceip"], getchannelport(dr), getdevicechnum(dr)); if (fdcamerachannel != null) {

SQL Server: the conversion of a varchar data type to a datetime data type resulted in an out-of-range value -

i want insert date , time in 2 ways shown below: table: ft create table ft ( columndate datetime, columntime datetime ) insertion of records: format 1 insert ft values('2014-12-25', '01:55:56'); insertion of records: format 2 insert ft values('25-12-2014', '01:45:54'); note : yeah! of course want insert date first column columndate , time second column columntime , want use datetime datatype that. both format of insertion getting same error shown below: error: the conversion of varchar data type datetime data type resulted in out-of-range value. it conversions , datatypes. first, implicit conversion dangerous. know, take @ link: how sql server decide format implicit datetime conversion? i use format: 'yyyymmdd hh:mm:ss' it not problem store day, suggested in comment, recommend use date type , time type. store time in datetime type not possible. if, reason, need this, must in old days, when datet

jquery - Invoke two different actions with same url in ajax call -

how invoke 2 different action methods based on parameters supplied in ajax request, url should same ex : public actionresult method1(int a) { return json(true); } public actionresult method2(int b, int c) { return json(true); } sample url : /controller/method parameters supplied different , corresponding action method should invoked in javascript doing ajax call check on parameter , decide url this. (in pseudocode): <script> function yourajaxkcall(param1, param2, param3){ string url; if(param1 === someexpectedresult){ url = '@url.action("method1", "controller")'; data = param2; } if(param1 === someotherexpectedresult){ url = '@url.action("method2", "controller")'; data = param2, param3 (do proper converting json here) } 'doyourajaxcall' } </script>

Measuring exact rotation angle of device in android -

Image
i need exact angle of android device each axis. first should searched through web , stackoverflow , saw pages these: how measure tilt of phone in xy plane using accelerometer in android get android rotation angle in x-axis but not helpful. used of them give wrong values. if axis in device this: i need these rotation angle: i don't want use any hardware sensor except accelerometer , work api 17 . think possible based on racing games, don't know how that. i appreciate if me. thanks there no way can rotations using type_accelerometer alone. need type_magnetic_field . if not care how sensitive values changed respect quick movement need type_gravity or type_accelerometer type_magnetic_field . rotation respect z-axis can follow first link in question. rotation respect x , y axes can use pitch , roll , screen facing.

ruby on rails - Using Devise, can I allow inactive users to still login but only to a landing page? -

as understand it, using devise, inactive users not allowed login, instead see inactive user message on login page. can change behavior user allowed login, see landing page? you global before_action in applicationcontroller , redirecting logged in inactive users landing page.

nginx - codeigniter gives white screen -

i creating web app using nginx , codeigniter, when install codeigniter project give white screen checks 1) nginx installed because shows default page says "welcome", 2) phpfpm installed because file shows phpinfo(); worked perfectly, but when have installed codeigniter project shows blank screen or white screen. nginx default server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /srv/www/vishalnlabz.com/public_html; index index.php index.html index.htm; server_name 104.131.57.74; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { #fastcgi_split_path_info ^(.+\.php)(/.+)$; include /etc/nginx/fastcgi_params; #fastcgi_pass 127.0.0.1:9000; if ($uri !~ "^/images/") { fastcgi_pass unix:/var/run/php5-fpm.sock; } fastcgi_index index.php; fastcgi_param script_filename

java - Cassandra Acessor annotated interface for insert statement -

i developing full fledged application having cassandra 2.1 back-end , writing api latest driver. wanted use accessor annotated interface crud operations. but, per doc select , update works jdbi interface model provided cassandra 2.1.3 driver. know if insert , delete works. appreaciated finally found couple of ways execute insert statements create accessor method returns "statement" object, can executed using session object you can construct dao object record , invoke mapper.save(daoobj) save record.

html - How to make div at the bottom center all the time? -

i'm making website first time , it's hard me on simple tasks. right i'm stuck @ problem. have 1 div floats left , 1 floats right. @ pages div @ left bigger div @ right, it's opposite. i need 1 more div stays @ bottom center no matter (left or right) div bigger. right managed work if div @ left bigger div @ right. sorry it's confusing , hard explain, problem positioning, can't figure out myself how make work. in short: need id bottom @ bottom center, below other divs. forgot mention: if move divs, messes on different screen sizes. <div id="bottom"><p>how make text @ bottom center time?</p></div> example here (check id bottom): http://jsfiddle.net/zmlyz/61/ well, problem not in css, rather in html. you've placed div id="bottom" within "div style="float:left;" element. why bottom bar appears flying in between. in reality, placed it, css doing it's supposed to. solutio

api - How to download files from svn (https site) using cURL PHP in Laravel Framework? -

i created login using curl site " https://svn.logicgenie.com:8090/svn/ " , displayed file names in it. need download particular file svn. how can that? please me codes. i used curl script: $url = "https://svn.logicgenie.com:8090/svn/cheapssls/trunk/admin.php"; set_time_limit(0); $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_userpwd, "firstuser:welcome"); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_ssl_verifyhost, 0); curl_setopt($ch, curlopt_ssl_verifypeer, 0); $r = curl_exec($ch); echo $r; curl_close($ch); header('expires: 0'); // no cache header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('last-modified: ' . gmdate('d, d m y h:i:s', time()) . ' gmt'); header('cache-control: private', false); header('content-type: application/force-download'); header('co

ruby on rails - Wrapping user_params in an array Android -

i trying pass user sign details rails user controller. while rails rails creates form tag using @user object, not know how same android. using following code send post request using volley. public class register extends activity { button btnlogin; edittext inputusername; edittext inputemail; edittext inputpassword; edittext inputpasswordconfirmation; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.register); inputusername = (edittext) findviewbyid(r.id.fld_username); inputemail = (edittext) findviewbyid(r.id.fld_email); inputpassword = (edittext) findviewbyid(r.id.fld_pwd); inputpasswordconfirmation = (edittext) findviewbyid(r.id.fld_pwd_confirm); btnlogin = (button) findviewbyid(r.id.btn_login); final requestqueue queue = volley.newrequestqueue(this); btnlogin.setonclicklistener(new view.onclicklistener() { @override

c# - Asp.Net MVC 5 with Google Calendar -

i have asp.net mvc 5 website. commented in google authentication. can register myself google login. in application, have calendars of users. added in startup.auth.cs-file var googleoptions = new googleoauth2authenticationoptions() { clientid = configurationmanager.appsettings["clientid"], clientsecret = configurationmanager.appsettings["clientsecret"], callbackpath = new pathstring("/signin-google"), }; googleoptions.scope.add(calendarservice.scope.calendar); app.usegoogleauthentication(googleoptions); now user gets asked if want share calendar us. allright. but how can save in asp.net mvc 5 google user in database , google calendar. tried many things var calendarconnection = new calendarservice(new baseclientservice.initializer()); var calendars = calendarconnection.calendarlist.list().execute().items; but these things doesnt help. i hope understand problem , can

neo4j user availability data model -

i having use case of mapping user availability in neo4j user can mark availability on calendar or task in going participate. how capture , model in neo4j? the main concern limit number of nodes. i found blog regarding timeline http://neo4j.com/blog/modeling-a-multilevel-index-in-neoj4/ is data model suitable?

vb.net - Outlook COM Add-in: Application_NewMail not getting fired -

all in outlook 3 different mail id have configured.i have given button on command bar clicking on button open forms 3 mail id name along radio button. whatever radio button have selected inbox mail need convert in pdf , stored in physical location....it working single mail id not working multiple. note:- outlook 2010(application_newmail) firing in every mail id when try office 2007 not firing event. plz me.... here msdn states newmail event of application class: the newmail event fires when new messages arrive in inbox , before client rule processing occurs. if want process items arrive in inbox, consider using itemadd event on collection of items in inbox. itemadd event passes reference each item added folder. the newmail event not fire when user in offline mode. you can handle newmailex instead. the outlook newmail event unleashed: challenge (newmail, newmailex, itemadd) series of articles describe possible ways handling new mail events.

ANDROID : How can i achieve Listview similar to 'today in history' app? -

Image
i want developer app show event "today in history", want build ui timeline listview image, please let me know if there way or library related this. in advance i done this, upto now, how hide listitem divider apply transparent background divider, listview layout should similar this. <listview android:layout_width="match_parent" android:divider="@android:color/transparent" android:layout_height="match_parent"/>

.net - How to limit users in the new Stakeholder access level to only see their own work items? -

i finished updating our team foundation server 2013 update 3 update 4. have new "stakeholder" access level replaces old "limited" access level. can find more information here . while additional features don't require cal nice users, liked limited rights of old "limited" access level other users. example, our customers can view , edit our internal bugs , tasks. don't want that. how limit user once again has access own work items? this not possible in out-of-the-box ui update 4 onwards. suggest create simple interface want , give externals that. its days work create simple work item view using api.

android - Where should I put background images in different screensizes? -

i've been reading drawable-xxdpi folders, , created icons in sizes. what want now, put background image on main screen. , assumption @ moment, don't work dp @ moment px , because background image needs fill pixels . when assumption correct, put created background images? i've created 1 480*320 , 800*400 largest 1600x2560 . in assumption can't put them in drawable-xxdpi folders because dpi related, , need fill pixels . i don't work dp @ moment px ... should always use dp. fill available space, use android:background instead of android:src . note image stretched (if don't make 9 patch - stretched, in "controlled manner"). to create background exact pixel size not practice. you'd end wit oversized images. better practices include (not mutually exclusive - can stacked using layer-list ): stretchables (such 9 patches) tiles (seamlessly tileable pictures) drawables (which vectorial, svg files) these ones inclu

c++ - How to put variables into an array -

i making basketball scoreboard can determine winner of game in each quarter , the main game. how can store values of variables in array? want put values of "q1teamone, q2teamone, q3teamone, q4teamone" in array , values of "q1teamtwo, q2teamtwo, q3teamtwo ,q4teamtwo" or make them elements of array. #include <iostream> #include <string> using namespace std; int main() { string team1; string team2; double otscore1; double otscore2; int q1teamone, q2teamone, q3teamone, q4teamone; int q1teamtwo, q2teamtwo, q3teamtwo ,q4teamtwo; int q2teamonetotal, q3teamonetotal, q4teamonetotal; int q2teamtwototal, q3teamtwototal, q4teamtwototal; double teamonescore[4]; double teamtwoscore[4]; int index; double sumone, sumtwo; cout << "basketball scoreboard:\n" << endl; cout << "enter team 1 name: "; getline (cin, team1); cout << "enter team 2 name: "; getline (cin, team2); //first quarter cout << "\n

string - Uppercase for first letter with php -

how can convert uppercase following example : title-title-title result should be: title-title-title i tried ucwords converts this: title-title-title i have this: echo $title = ($this->session->userdata('head_title') != '' ? $this->session->userdata('head_title'):'our home page'); in particular string example, explode strings first, use function ucfirst() , apply exploded strings, put them again: $string = 'title-title-title'; $strings = implode('-', array_map('ucfirst', explode('-', $string))); echo $strings; should straightforward on applying this: $title = ''; if($this->session->userdata('head_title') != '') { $raw_title = $this->session->userdata('head_title'); // title-title-title $title = implode('-', array_map('ucfirst', explode('-', $raw_title))); } else { $title = 'our home page'; }

c# - WCF Custom Authorization -

basically, i'm creating first ever wcf web service , i'm looking implement custom authentication , authorization. authentication seems working well, want able store roles , permissions using custom authorization well. my authentication done overriding usernamepasswordvalidator , making use of validate method. validate(string username, string password) now i've tried implementing authorization using iauthorizationpolicy interface public class authorizationpolicy : iauthorizationpolicy { private string _id; public string id { { return this._id; } } public claimset issuer { { return claimset.system; } } public authorizationpolicy() { _id = guid.newguid().tostring(); } public bool evaluate(evaluationcontext context, ref object state) { iidentity client = getclientidentity(context); context.properties["principal"] = new customprincipal(client); return tru

xaml - How is Windows 8/8.1 Start Screen made? -

i have make control , windows 8/8.1's start screen matches requirements dragging , dropping 1 column another, renaming columns, etc. so, asking experienced minds here how screen made maybe hub coupled hubsection . not know so, please suggest on started with. currently, have managed replicate using gridview columns , inside gridview containing tiles. create default probject called "grid app" (vs2013). you'll find grouped gridview headers inside. don't need additional gridview . looks this: <gridview x:name="itemgridview" automationproperties.automationid="itemgridview" automationproperties.name="grouped items" grid.rowspan="2" padding="60,100,40,20" itemssource="{binding source={staticresource groupeditemsviewsource}}" selectionmode="none" isswipeenabled="false" isitemclickenabled="true&

sql server - SQL Query to update department -

i have special scenario update department without having conflicts existing records. can tell me how write query it? here need. table dept : deptid deptname ----------------------------- d001 accounts d002 hr d003 dev d004 support now, want update 1 of existing records , make sure should not allow duplicates (either deptid or deptname , both). ex: case 1: when try update d001 , should not give deptid d002, d003 or d004 existing. case 2: when try edit deptname , should not accept of existing deptnames you'd better off storing department identifier int / primary key auto increments. take care of id's being unique. alter table dept add deptid int not null identity (1,1) primary key if want format d001 , on values, can add when retrieve data: select deptid, 'd' + right('000' + cast(deptid varchar(3)), 3) dept then need worry department names

Color options in GPLOT in SAS -

i have temporal series variable in horizontal axis year. once have drawn gplot procedure want divide graphic in years painting each year in different color. have tried if statemente inside gplot procedure when defining color inside symbol options this symbol if year=2006 c=red; (this simplified, depend on more years , stuff) desnt work. edited: think didint explain myself properly. have code proc gplot data = work.datosipppa ; plot ipppa * date / overlay vaxis=axis1 haxis=axis2 frame legend=legend1 href='01jun2006'd '01jun2007'd ; plot2 tasaparomensual * date = 2 / overlay vaxis=axis3 overlay legend=legend1 ; run; quit; and want colored each of years in different colour. want show graph cant if idont have 10 of reputation :( in fact want somethng equal example http://support.sas.com/documentation/cdl/en/graphref/63022/html/default/viewer.htm#a003259878.htm instead of in procedure in gplot one st

wordpress - how to add shipping cost with product actual price? -

i using woocommerce plugin v2.2.8 ecommerce site. using weight based shipping method. there possibility add shipping cost products actual price displaying in product page? for eg.. product1 = rs 800/- & shipping cost of product rs 50/- product1 price in shop page should displayed rs 850/- (actual price + shipping cost) note: shipping cost calculated weight based shipping method. possible? any idea regarding this??? shipping needs destination address, when showing product in shop page no address available there. but, can have flat rate shipping setting every zone can retrieve value own , add price product. if need product based shipping price, define shipping classes, assign desired shipping class product , configure prices each shipping class. now while showing price product in front end can use following woocommerce hook , put logic modify price. function return_custom_price($price, $product) { //apply logic , modify price return $price; } ad

android - Listview crashes on scrolling in a fragment under tabhost activity -

my application has 2 tabhosts , both of them necessary. had use tabhost instead of actionbar application need supported low-end android device. now, fragmentactivity has 2 fragments , 1 of them has listview . listview loads fine application crashes java.lang.stackoverflowerror when begin scroll list. my layout each row simple , told before loads first time , crashes while scrolled. i put logcat here. 12-02 15:14:26.929: e/androidruntime(22971): fatal exception: gui thread 12-02 15:14:26.929: e/androidruntime(22971): java.lang.stackoverflowerror 12-02 15:14:26.929: e/androidruntime(22971): @ android.graphics.paint.measuretext(paint.java:1020) 12-02 15:14:26.929: e/androidruntime(22971): @ android.graphics.paint.measuretext(paint.java:1057) 12-02 15:14:26.929: e/androidruntime(22971): @ android.text.styled.drawdirectionalrun(styled.java:284) 12-02 15:14:26.929: e/androidruntime(22971): @ android.text.styled.measuretext(styled.java:447) 12-02 15:14:26.929: e/and

sql - c# - using % as a text symbol(percent) -

i'm searching in datatable datarow[] found = table.select(f_sep); //table - datatable, f_sep - string query looks like: f_text '%some_word%' in query need use % percent(to find percent values). if in query write 5% return results 5 , other symbols after it, tried replace %: string stt = textbox.text.replace("%", "'%'"); i error - can't use operator mod replace("%", "\"%\""); i error using operator. how can replace % ? you need escape % sign, use brackets. 75% where mycol '%75[%]%' source: how escape percentage sign in t-sql?

ios - Testflight : "You are currently not testing any apps" error -

i have submitted apps test flight , able download using testflightapp.com. however, when access through testflight app itself, says "you not testing app"? i have checked following link it's not helpful http://help.testflightapp.com/customer/portal/articles/829653-i-don-t-see-any-apps-after-connecting-my-device-to-my-account- i guess donwloaded apple testfligt app. it's different system using. need access testflightapp-website ipad/iphone. have in emails. there should testflight link. open ios device , should work. reate icon on home-screen looks app link testflightapp.com