Posts

Showing posts from April, 2015

how to tap android view or textview page up or page down -

how can have full screen textview page , page down tapping top of view or bottom of view? i have tried using page , page down buttons @ top , bottom of textview, wasted space. if textview read only, tapping top or bottom of view should allow me page or page down through content. thanks in advance suggestions dean-o just create 2 buttons transparent background , place them @ top , bottom. easiest solution.

android studio - How to display the number of messages received in only in the receiver's main activity? -

i followed tutorial https://www.sinch.com/learn/android-messaging-tutorial-using-sinch-and-parse/ , worked fine, need display number of messages sent on receiver's main activity when receiver opens app he/she see "you have #number messages", can please tell me how that?

javascript - PHP/CSS If page is loaded on mobile, only display JPG background -

so site, i'm using php call random gif background. on mobile, can quite resource intensive. how can make when person loads site on mobile, displays 'static01.jpg'. php code calling background: <?php $bg = array( 'page01.gif', 'page02.gif', 'page03.gif', 'page04.gif', 'page05.gif', 'page06.gif', 'page07.gif', 'page08.gif', 'page09.gif', 'page10.gif', 'page11.gif', 'page12.gif', 'page13.gif', 'page15.gif', 'page16.gif', 'page17.gif', 'page18.gif' ); $i = rand(0, count($bg)-1); $selectedbg = "$bg[$i]"; ?> css background code: background-image: linear-gradient(to top,rgba(64,58,89,0.478),rgba(64,58,89,0.478)), url(<?php echo $selectedbg; ?>); you can override css rule: @media screen , (max-width: 680px

xaml - UWP CommandBar as resource -

i got commandbar i'd use pages within app. when creating new command bar using 'new' button in properties window , converting new value resource using 'convert new resource' (the resource placed in resource dictionary) vs creates following xaml: <page.bottomappbar> <staticresource resourcekey="bottombar" /> </page.bottomappbar> resource dict.: <commandbar x:key="bottombar" /> now when launching application unhandled exception message 'the parameter incorrect' thrown (inner exception: 'value not fall within expected range'). intended behaviour or there workaround (except using style)?

python - group by same partial string of pandas dataframe column -

i have several csv files , each 1 contains 1 stock price in 1 month , has millions of data. raw csv data data like: aa_candy.csv index companyname time price 1 aa candy 030101090355 1.78 2 aa candy 030101091533 1.79 ....... 333498 aa candy 031231145556 2.18 bb_cookie.csv 1 bb cookie 030101090225 3.20 2 bb cookie 030101090845 3.14 ....... 391373 bb cookie 031231145958 3.88 i use python , pandas process data, after load , combine of datafiles, have dataframe like: frame: index companyname time price 1 aa candy 030101090355 1.78 2 aa candy 030101091533 1.79 ....... 333498 aa candy 031231145556 2.18 333499 bb cookie 030101090225 3.20 333500 bb cookie 030101090845 3.14 ....... 712871 bb cookie 031231145958 3.88 the time 031231145958 represent 2013-12-31 14:59:58 now want highest price , final price in every 1 hour of each company

Trouble with a specific glew linker reference (C++ Codeblocks MinGW OpenGL and SDL) -

i'm practicing graphics tutorials on youtube windows 10 machine , i'm trying write simple program render sprite onscreen using vertex buffer object i'm having issues. i've gotten previous projects using glew work. i've loaded window , drawn triangle on it, when try set , delete buffers, undefined references these specific functions: gldeletebuffers, glgenbuffers, glbindbuffer, glbufferdata, etc. i'm compiling following linker options: -lmingw32 -lsdl2main -lsdl2 -lsdl2_image -lsdl2_mixer -lsdl2_ttf -lsdl2_net -lopengl32 -lglu32 -lglew32 -lglew32s -lglew32mx and feel of search directories correct. have #define glew_static in first class load, i'm not sure how glew half working. there specific file or setup step i'm missing? why things glcleardepth , glclear work if others don't? this tutorial i've been following: https://www.youtube.com/watch?v=w_octrsu754

curl - Using proxies in PhantomJS with PHP PhantomJS library -

the documentation phantomjs show how use proxies. however, how is used in php when using library php phantomjs ? for matter, how of phantomjs addons used? i'm doing curl use proxies: curl_setopt($curl, curlopt_proxy, "http://$proxy:$port"); curl_setopt($curl, curlopt_proxyuserpwd, "$username:$password"); i'd exact same thing phantomjs. have installed , configured , example works (php pantomjs's own example). use jonnyw\phantomjs\client; $client = client::getinstance(); $request = $client->getmessagefactory()->createrequest(); $response = $client->getmessagefactory()->createresponse(); $request->setmethod('get'); $request->seturl('http://jonnyw.me'); $client->send($request, $response); print_r($response); where proxy info go here? thanks. i'm new phantomjs. from official php phantomjs documentation, section "phantomjs options". can add options running phantomjs binary this:

How to convert Matlab code to Delphi? -

how convert part of matlab code delphi? for i=1:popsize fi=rand(1,dimension); % generate vector of uniform random numbers p=pbest(i,:); pbest(i,:)=x(i,:); end my code: for i:= 1 popsize begin fi:= // function generates vector of uniform random numbers in delphi? k :=1 popsize begin p:=pbest(i,k); pbest(i,k):=x(i,k); end; end; you can call random function generate uniformly distributed random value. calling randomize once makes random generate different values in each run. var fi: array of double; j: integer; begin randomize; j := 0 dimension - 1 fi[j] := random; end;

javascript - Jquery - Detect click options disabled HTML select -

$(function(){ $("select:option").on('click', this, function(event) { event.preventdefault(); alert("a"); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select name="options" id="options"> <option value="">select</option> <option value="1">options 1</option> <option value="0" disabled="disabled">options 2</option> <option value="0" disabled="disabled">options 3</option> <option value="0" disabled="disabled">options 4</option> </select> i need check jquery, if user clicked on option of selector disabled, if user clicked display alert() . example: select several options, options in select have value of 0 disabled, if user clicks on of these options disabled, show an aler

node.js - How do I extend the Error class? -

this code: let errorbadrequest = new error("bad request"); res.statuscode = 400; errorbadrequest.errors = err.details.reduce(function(prev, current) { prev[current.path] = current.message; return prev; }, {}); throw errorbadrequest; i wanted extend error attribute in error instance, tsc said joi-utils.ts(21,23): error ts2339: property 'errors' not exist on type 'error'. the structure of errors {fieldname: fieldmsg} , it's according joi request schema decide. how solve error typescript compiler? think need declare interface , designate attribute. property 'errors' not exist on type 'error'. create file called error-extension.d.ts , have following: interface error { errors: error; } more : https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html

c# - AspNetCompiler - An attempt was made to load program with an incorrect format -

i building 64bit web application ( assemblya ) , referencing application have built 64bit ( assemblyb ). when add assemblyb reference in assemblya , following compilation error in visual studio: aspnetcompiler not load file or assembly 'assemblyb' or 1 of dependencies. attempt made load program incorrect format. both of application's platform target setting set x64 , both target framework settings .net framework 4.6 , prefer 32bit unchecked . i have tried referencing every dependent reference of assemblyb in assemblya , making sure versions of dependent references same. i have used question: how determine if .net assembly built x86 or x64? confirm referenced assemblies either msil or amd64 . i have used aspnet_compiler.exe command line tool errorstack option enabled , got following stack trace: [badimageformatexception]: not load file or assembly 'assemblyb' or 1 of dependencies. attempt made load program incorrect format. at sy

Keeping a total score in Java hangman game -

import java.util.scanner; import javax.swing.joptionpane; public class hangman { public static void main(string[] args) { string playagainmsg = "would play again?"; string pickcategorymsg = "you've tried words in category!\nwould choose category?"; int wincounter = 0, losecounter = 0, score = 0; string[] words; int attempts = 0; string wordtoguess; boolean playcategory = true, playgame = true; int totalcounter = 0, counter; while (playcategory && playgame) { while (playcategory && playgame) { words = getwords(); counter = 0; while (playgame && counter < words.length) { wordtoguess = words[counter++]; if (playhangman(wordtoguess)) { wincounter++; system.out.println("you win! have won " + wincounter + " game(s)." +

Spring boot - Maven - Exclude folder not working -

i have spring boot app , project structure follows. project |__src/main/java |__src/main/resources |_static | |_css | |_fonts | |_node_modules | |_src |_templates i exclude node_modules build. have entry in pom exclude folder, not working. pom.xml, <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.xxxx</groupid> <artifactid>xxxx</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>xxxx</name> <description>test</description> <parent> <groupid>org.spring

progress bar - Unrecognized selector for instance error Swift -

im creating simple typing app timer. timer should in form of progress bar decrements every second. to implement progressbar, intended set progress 0.1 lesser current progress every 1 second. there "unrecognized selector instance " error when set progress. there other way work around. import foundation import uikit class testview: uiviewcontroller, uitextinputtraits { @iboutlet weak var testlabel: uilabel! @iboutlet weak var typingfield: uitextfield! @iboutlet weak var progressview: uiprogressview! var time : float = 0.0 var timer: nstimer! var test = 0; var progress : float = 1 var mymutablestring = nsmutableattributedstring() var teststringarray = ["abode" , "tutorial" , "completed", "war", "method", "continue", "machine", "texting" , "iterate"] var idx = 0; var setprog :

node.js - How do I execute typescript watch and running server at the same time? -

i developing project in nodejs. found if need code , test api, run 2 console, 1 execute typescript watch, execute server. i think it's troublesome. find other developers on github have written scripts in package.json . it's easy call commands. attracts how write scripts , development workflow. in short, comand of typescript watch tsc -w , comand of running server node app.js . idea merge commands tsc -w & node app.js can't work 2 commands @ same time. how do? thanks. my idea merge commands tsc -w & node app.js can't work 2 commands @ same time. how do you have few options. simplest use ts-node : https://github.com/typestrong/ts-node

python 3.x - Pandas: Calculate Median of Group over Columns -

given following data frame: import pandas pd df = pd.dataframe({'col1': ['a', 'a','a','a','b','b'], 'col2' : ['aa','aa','bb','bb','bb','bb'], 'col3' : [2,3,4,5,4,2], 'col4' : [0,1,2,3,4,2]}) df col1 col2 col3 col4 0 aa 2 0 1 aa 3 1 2 bb 4 2 3 bb 5 3 4 b bb 4 4 5 b bb 2 2 i like, efficiently possible (i.e. via groupby , lambda x or better), find median of columns 3 , 4 each distinct group of columns 1 , 2. the desired result follows: col1 col2 col3 col4 median 0 aa 2 0 1.5 1 aa 3 1 1.5 2 bb 4 2 3.5 3 bb 5 3 3.5 4 b bb 4 4 3 5 b

vb.net - ContextMenu in Visual Studio -

so i've been looking around , searching google, can't find answer. i'm trying set textbox's context menu context menu, not context menu strip. in properties window, doesn't allow me set context menu, context menu strip. can show me how set context menu textbox? know answer might somewhere already, can't find it. you have first create contextmenu. this private void initializealtcontextmenu() { mnucontextdefault = new contextmenu(); mnucontextdefault = this.textbox1.contextmenu; mnuitmaltmenutest = new menuitem(); mnuitmaltmenutest.index = -1; mnuitmaltmenutest.text = "test menu item"; mnuitmaltmenutest.click += new system.eventhandler(this.mnuitmaltmenutest_click); mnucontextalt = new contextmenu(); mnucontextalt.menuitems.add(mnuitmaltmenutest); } private void textbox1_mousedown(object sender, mouseeventargs e) { if (e.button == mousebuttons.right) { if ((control.modifierk

Google Drive Integration in AEM -

i want integrate google drive in aem , want fetch photos of folder exist in google drive in aem. used cloud services , able fetch pagetoken using auth 2. want fetch list of files in folder in form of json using rest api. can advice me,how can achieve ? public jsonobject imagesjson(string accesstoken) throws ioexception,jsonexception { string url = "https://content.googleapis.com/drive/v2/files/{folder-id}/children?key={server-key}"; string str = gethttpresponse(url, accesstoken); jsonobject jsonobject = new jsonobject(str); return jsonobject; } public static string gethttpresponse(string url, string accesstoken) throws ioexception { httpsurlconnection urlconnection = null; inputstream is=null; if (url != null && url.trim().length() > 0) { try { url _url = new url(url); urlconnection = (httpsurlconnection) _url.openconnection(); urlconnection.setrequestmethod("get");

how to call exe file in vb6 with multiple parameters -

i tried below code dim pthname string dim parms string dim rpno integer dim glngbr long dim prtvw string pthname = "d:\sample.exe" rpno = 1 prtvw = "v" glngbr = 84003 shell pthname & parms i getting error "run time error 53 ". i tried without parameter working shell pthname you can use this, shell "d:\sample.exe" & " " & param_1, param_2

Php Connection with Sql server not working on Production Server -

Image
i working php. want connect php sql server not working on production server.it worked on local machine, installed sql server driver in extension folder of php , activated in php-ini file.i confirmed driver has been loaded production driver hosted in windows server , not linux server.i need assistance,because same script connected local machine cloud sql server same script using connect php application same sql server not working. please, need help. take @ connection script works local machine. $servername = "remote sql server ip"; //a.b.c.d $connectioninfo = array("database"=>"sqlserverdbname", "uid"=>"sqlsvruserid", "pwd"=>"sqlsvrpassword"); $conn = sqlsrv_connect($servername, $connectioninfo); if($conn){ echo "connection established<br/>"; }else{ echo "connection not established<br/>"; die(print_r(sqlsvr_errors(),true)); } ?>

java - I want to post array param in HttpURLConnection android -

i fresher in developing android apps, in app want post params in format below: user_id=12&task_id=100&user_ids=["91","92"] i not able send user_ids in array format. receiving user_ids string in rails api. i using httpurlconnection, , in writer.write() passing post params as writer.write("user_id="+id+"&task_id="+tid+"&user_ids="+["91","92"]+"); please help. if 1 facing same problem, found work around. need add array in string 1. step 1 create final arraylist<string> selectedtagids = new arraylist<string>(); and add array items using selectedtagids.add("one"); selectedtagids.add("two"); ... 2. step 2 convert selectedtagids.tostring(); 3. step 3 format string replacing string to selectedtagids.replace("[","").replace("]","").replaceall("\\s","").trim(); 4 step

android - use private Google spreadsheet as a queryable data table and get the response back as JSON -

i'm following this tutorial , referring source code here . got working public google spreadsheet described. how extend private google spreadsheet? i'm interested in extending example , not in alternate ways of achieving task.

node.js - NodeJs (Express) wont listen to the IP and host in ubuntu -

i have deployed app ununtu. this bin/www: app.set('port', 3000); app.set('host','app.site.com'); var server = http.createserver(app); server.listen(port,'64.143.255.122');//i put here fake ip (deployed real one) server.on('error', onerror); server.on('listening', onlistening); i have created host in pc: 64.143.255.122 app.site.com , open browser in: http://app.site.com:3000 , not work. but, if go via lynx , inside server, , write lynx http://localhost:3000 work, correct page. what might problem? thanks did make iptables allow it? try this: iptables -a input -p tcp --dport 3000 -j accept

ios - Invoking tests on iPhone from Windows OS using Remote Server -

i've started working appium. have automated flow on android device , run on device. have tried same ios tests invoked mac. document on appium states following "appium on os x supports ios , android testing windows can test android." my question is, has tried invoking tests on ios platform os other mac os x windows or linux?. for example, using remote server windows os connect appium server running on mac. or usual iphones remain incompatible other mac. yes can automate ios devices using appium windows platform all have run appium server in mac ipv4 address.. then execute automation script windows ip address.. make sure ip address pingable windows platform... in way can use c# automation script automate ios platform

business intelligence - How to correct organize olap-cub -

could suggest me way organize nice olap-cube? it's sales (standard fields product, customer, region, etc.). of products always measured values, other volume. can use same field both , separate field (var or vol). or better make different field each measure. i use cubes python framework. i'd favour making different field each measure, , adding dimension unit type anyway.

mysql - Is this the right way to passively assign categories to an entity -

i trying design database can used 'passively' identify (and optionally assign) any/all categories object fits into. below way i'm implementing not having done before, wanted see if has better idea of how go doing it. using symfony mysql , doctrine. 1/. tables define objects: an element table contains features animal have. table evolve on time - eg animals have wings added: id name criteria 1 leg 0-100 2 arm 0-2 3 pouch boolean 4 horn 0-2 an animal table give individual information on each animal in database: id name gender weight dob 1 gertrude f 450 2010-01-01 2 shiela f 200 2008-01-01 3 bruce m 250 2012-01-01 an identity table assign elements assigned each animal : animalid elementid count description 1 1 4 1 4 0 2 1 2 2 2 2 2 3 true // female kangaroo has pouc

Unable to locate SimpleAmqpClient library for the C++ project on OSX -

i try use simpleamqpclient library build multi-agent environment simulation. have installed library after cloning sources, making them: make sudo make install after that, created main.cpp file: #include <iostream> #include <simpleamqpclient/simpleamqpclient.h> using namespace std; int main() { cout << "hello, world!" << endl; return 0; } just try out. also, have following cmakelists.txt: cmake_minimum_required(version 3.3) project(sampleproject) include_directories('/usr/local/include/') find_package(libsimpleamqpclient required) include_directories(${libsimpleamqpclient++_include_dirs}) set(libs ${libs} ${libsimpleamqpclient++_libraries}) set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11") set(source_files main.cpp) add_executable(sampleproject ${source_files}) so, question is: how find , link library. you need include line target_link_libraries(sampleproject ${libs}) after l

java - How to add the row num to the employee loop variable? -

i want add current row number of excel row mapped employee variable. from example below: want know employee "yuri" in excel row number 8. but can't find way access it. xlsrowcursor has how can add mapped bean? know reader uses current processing row number when writing exceptions , poi has too. a simple self row counting solution on side isn't valid idea, because use skip row @ error mechanism. any tips or hints? the xml file: <?xml version="1.0" encoding="iso-8859-1"?> <workbook> .... <loop startrow="7" endrow="7" items="department.staff" var="employee" vartype="net.sf.jxls.reader.sample.employee"> <section startrow="7" endrow="7"> <mapping row="7" col="0">employee.name</mapping> <mapping row="7" col="1">employee.age</mapping> <mappin

R :: tm - Create a table/matrix of term association frequencies and add values to dendrogram -

Image
i got corpus vector of short sentences (n > 50), e.g.: corpus <- c("looking in r","check whether milk sour or not", "random sentence dubious meaning") i able print dendrogram fit <- hclust(d, method="ward") plot(fit, hang=-1) groups <- cutree(fit, k=nc) # "k=" defines number of clusters using rect.hclust(fit, k=nc, border="red") # draw dendrogram red borders around 5 clusters and correlation matrix cor_1 <- cor(as.matrix(dtms)) corrplot(cor_1, method = "number") as far have understood - please correct me here if wrong - findassocs() i.e. correlation checks whether 2 terms appear in same document? goal: don't want see correlation, frequency of 2 terms appear in same document not adjacent each other (bigramtokenizer won't work). example: term , term b appear in 5 different documents across corpus regardless of distance. ideally want create frequency matrix similar

Include commons-net.jar at the custom location instead of ant install location -

i using ftp task ant . ftp work, need commons-net.jar dependency @ ant_home/lib folder. as best practice, following folder structure keep external folders under customized external jars folder. there way keep commons-net.jar @ customized folder instead of ant_home/lib folder? another option place plugin jars in "$home/.ant/lib" directory. you can automate install of dependent jars follows: <project name="demo" default="build"> <available classname="org.apache.commons.net.ftp.ftp" property="ftp.installed"/> <target name="init" unless="ftp.installed"> <mkdir dir="${user.home}/.ant/lib"/> <get dest="${user.home}/.ant/lib/commons-net.jar" src="http://search.maven.org/remotecontent?filepath=commons-net/commons-net/3.3/commons-net-3.3.jar"/> <get dest="${user.home}/.ant/lib/oro.jar" src=&quo

java - Docker-machine ip in Dockerfile -

i have spring boot project docker. dockerfile this: ...<many useful info>... cmd ["java", "-djava.rmi.server.hostname=<docker_container_ip>", "javafile.jar"] i need set docker_container_ip (ip of docker container can docker-machine ip default ) when run docker. how can it? use environment variables. https://docs.docker.com/engine/reference/run/#env-environment-variables docker run -e docker_container_ip=a.b.x.y mycontainer if need specify them in dockerfile: https://docs.docker.com/engine/reference/builder/ from someimage env docker_container_ip a.b.x.y

Android Gradle sync failed (import project from github) -

hi guys download project github , imported in android studio , after imported getting error gradle sync failed: cause: assert localprops['keystore.props.file'] | | | null [ndk.dir:e:\sdk\ndk-bundle, sdk.dir:e:\sdk] consult ide log more details (help | show log) gradle file: signingconfigs { release { def properties localprops = new properties() localprops.load(new fileinputstream(file('../local.properties'))) def properties keyprops = new properties() assert localprops['keystore.props.file']; keyprops.load(new fileinputstream(file(localprops['keystore.props.file']))) storefile file(keyprops["store"]) keyalias keyprops["alias"] storepassword keyprops["storepass"] keypassword keyprops["pass"] } } buildtypes { release { minifyenabled true proguardfiles getdefaultpro

javascript - Alert all checkboxes that are checked in ng-Repeat : AngularJS -

i have small program have 3 checkboxes. may check or of checkboxes. need alert names of people infront of id have checked checkboxes. html: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> </head> <body ng-app="myapp" ng-controller="myctrl"> <table> <tr ng-repeat="(key,x) in people"> <td><input type="checkbox" id="{{x.id}}" >{{x.name}}</td> </tr> </table> <button ng-click="alert()">click</button> <script> //module declaration var app = angular.module('myapp',[]); //controller declaration app.controller('myctrl',function($scope){ $scope.checkboxarray = []; $scope.people = [ {name:"peter",id:"201"}, {name:"lina",id:"202"}, {name:"roger",id:"20

magento - Authorize.net CIM responding error -

i using live account on magento store.while doing transaction getting below error message.so please me why happening. [resultcode] => error [messages] => stdclass object ( [messagestypemessage] => stdclass object ( [code] => e00027 [text] => transaction has been declined. ) ) [directresponse] => 2,1,4,this transaction has been declined.,000000,r,7962739058,100000052,test payment,249.00,cc,auth_capture,5,kren,brow,,130 indianwood drive,brofield,wiscin,53005,us,<<ph no.>>,,nwood@aerer.com,,,,,,,,,,,,,,<<key>>,,,,,,,,,,,,,xxxx5454,mastercard,,,,,,,,,,,,,,,,

java - Why "Numeric overflow in expression" warning occurs -

using intellij 15.0.3 + java 8u65... lower = system.currenttimemillis(); long upper = lower + 31536000000l; //add year-ish works fine. if do: lower = system.currenttimemillis(); long upper = lower + (1000l*60*60*24*365); intellij gives warning "numeric overflow in expression". i'd understand if in fact true, , consistently warning on both expressions, it's not. anyone know why 2nd expression generates warning? i'd rather have breakdown way number because it's easier other devs on project understand it's doing (though suppose comment). code still compiles find warnings in builds itch can't scratch. edit responses... think caching issue in intellij... if know copy/paste above don't warning. if try edit after paste 1 or 2 times out of 10 warning popping in. i have tried on machine. same version of intellij, newer java 1.8.0_66. if copy paste code , assume lower long, don't warning. if remove "l" warning (obviou

html - Bootstrap column with two fullwidth block buttons -

Image
i want bootstrap column resize buttons nicely when screen type changes. buttons end no space between them , and 2 separate lines (on small screen). how them resize smaller buttons, , not split onto new line? <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <div class="container-fluid"> <div class="row"> <div class="col-md-8 col-md-offset-2"> <div class="panel panel-default"> <div class="panel-heading">example!</div> <div class="panel-body"> <div class="form-group"> <div class="col-xs-3 col-xs-offset-4"> <a href="#" class="btn btn-success btn-block" role="button">add item</a>

ruby on rails - passenger phusion stopped working after apt-get update/upgrade -

well, not sure start. have rails based apps. we did nothing in our websites. (did not touch config file etc). just regular apt-get update, upgrade. 2 websites down! can problem? this ubuntu machine running. dns ok. can go root page says: ubuntu... working fine. we have apache server. tried to: sudo apachectl restart. also, working on amazon cloud if matters (aws.amazon) tried reboot amazon. same result. if goes wrong, first thing should try follow official troubleshooting guide: https://www.phusionpassenger.com/library/admin/apache/troubleshooting/ruby/

php - how to access form data using post in loop -

i trying access data form field dynamically created , store db.i don't know how that.i tried many ways didn't worked.please me.thank reading this..... <html lang="en"> <head> <title>toggle</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <?php $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('could not connect mysql server: ' . mysql_error()); } $dbname = 'attendance'; $db_selected = mysql_select_db($dbname, $link); if (!$db_selected) { die("could not set $dbname: " . mysql_error()); } $res = mysql_query('select * student', $link); if(isset($_post["submit"])) { $name=$_post['student']; echo $name; } ?> <script type="text/javascript"> function change(obj) { var tr

indexing - How to index and serve poems using apache solr -

i using solr 4.10. have index poetry data in solr. should document structure. basically, want give search facility term in poem. specific distich should given back. should index complete poem in single document or 1 document per distich. know poems have 2 lines single concept , 4 etc. should storing format ? index distiches individually , link them through poem identifier , sequence id. way can retrieve distich before or after - or whole poem. if there's use cases need treat poems whole instead, create separate collection , index both collections. way can adjust , tweak search results need, depending on use case.

android - Getting heavy data throws Cursor Window: Window is full error -

i new android , in app have fetch heavy data server (out of 2 images) , store in local database. till now, have done standard way involves fetching data @ once , storing in local database. getting out of memory error. there guidelines need follow while fetching heavy data? storing images in local database in blob form. i think because query results large cursor's window , requests more memory or caused because of blob image . since requirement met using endless scroll or infinite scroll recomment use . and best way store image store path in db , store image in sd card you reference following link implement infinite scroll view using recycler view http://android-pratap.blogspot.in/2015/06/endless-recyclerview-with-progress-bar.html

css position - Use site background for CSS fixed element -

i have fixed div "hovering" above rest of site through position: fixed . however, ugly when other site-elements (i.e. text) appear behind hovering element. hide elements when behind hovering element, meaning show site background behind it. because site background in gradient, can't give floating element it's own background. there way this? body { width: 200px; font-family: sans-serif; background: linear-gradient(to bottom, #b4ddb4 0%,#83c783 17%,#52b152 33%,#008a00 67%,#005700 83%,#002400 100%); } #fixed { position: fixed; top: 0; left: 0; padding: 20px; font-size: 200%; z-index: 5; } <div id="fixed"> text </div> <div id="text"> <script> for(i=0;i<50;i++) { document.write("text text text text<br />") } </script> </div> edit : clarify: want background of fixed element same site background fixed element over. don't

openerp - How to get the following situation solved in odoo 8? -

i trying print many2many field value in qweb pdf report following code purchase_quotation.py class purchase_quotation(osv.model): _name="purchase.quotation" _rec_name='vno' _columns={ 'name':fields.many2one('res.users','name', readonly=true), 'date':fields.date('order date', required=true), 'vno':fields.char('voucher no',size=40,readonly=1), 'branch':fields.selection([ ('blocka', 'block a'), ('blockb', 'block b'), ('admin', 'admin'), ], 'branch/office', readonly= false, select=true, required=true), 'user_manager_id':fields.many2one('res.users','manager'), 'approve_by':fields.char('approved by'), 'order_line': fields.one2many('product.text', 'pro_ref', 'order lines',required

openerp - Way to get specific user's ID -

there self-made timesheet module. using few digital signatures (tableman, division boss, accountants , on) sign timesheets. users respective roles can see timesheets of specific states (unsigned, signed, signed division boss , on). as now, accountants making timesheets tablemen, went on vacation. due restriction rules, after returning, tablemen can't see timesheets of divisions, made accountants. is there way id of specific user? can add accountant's id domain_force make timesheets visible respective division's tablemen. know, admin's id = 0, rest? that's how looks now: <record id="inf3" model="ir.rule"> <field name="name">tableman can 'unsigned' documents, made himself or admin (0)</field> <field name="model_id" ref="model_tabel_tabel"/> <field name="groups" eval="[(4, ref('tabel_inf_division'))]"/> <fi

matlab - Not able to perform frequency domain windowing correctly? -

i trying perform frequency domain windowing convolving sinc signal (in blue color) impulse response of raise cosine window (1+0.5*cos()). the convoluted output getting plotted in black color. but, want output should 1 plotted in red color. i have attached code same below. highly appreciated. n0=0; w=0.5; n=64; ncap=5*n; l=ncap/n; n=(-ncap/2:(ncap/2)-1); ws=n/ncap; s=sinc(ws.*(n+n0)); test_fir=[0.5 0 0 0 0 1 0 0 0 0 0.5]; conv_out= (conv(test_fir,s)/max(conv(s,test_fir))); figure(2) plot(s,) hold on plot(conv_out,'k','linewidth',2) for way proceed, result expected. you're plotting s (which has 320 doubles) along conv_out , has 330 elements (because convolution's result going have 1 less sum of number of elements per vectors convolve, i.e. 320 , 11). since you're plotting both vectors against position of elements, quite normal conv_out shifted compared s (because have different lengths). need correctly choose x axis plott

c++ - Is there any diffrence between {} or default in initializing constructor -

is there difference (no matter how tiny is) between 3 methods of defaulting constructor of class: directly in header using {} : //foo.h class foo{ public: foo(){} } directly in header using default keyword: //foo.h class foo{ public: foo()=default; } in cpp using {} //foo.h class foo{ public: foo(); } //foo.cpp #include "foo.h" foo::foo(){} yes, there difference. option 1 , 3 user-provided . user-provided constructor non-trivial, making class non-trivial. has few effects on how class can handled. no longer trivially copyable, cannot copied using memcpy , like. not aggregate, cannot initialized using aggregate-initialization a fourth option following: //foo.h class foo{ public: foo(); } //foo.cpp #include "foo.h" foo::foo()=default; although may seem analogous second example, user-provided well. functionally, defaulted constructor same thing foo(){} , specified in [class.ctor]/6 .

how i can import an excel file using php and print it in a html table -

i try use phpoffice/phpexcel haven't idea of it... have form in html <body> <div align="center">elenca tabelle presenti nel db</div> <form action="index.php" method="post" enctype="multipart/form-data"> <table> <tr> <td> filename: </td> <td> <input type="file" name="file" id="file"> </td> </tr> <tr> <td colspan="2" align="right"> <input type="submit" name="submit" value="submit"> </td> </tr> </table> </form> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integ

c# - ToolStripComboBox in overflow -

Image
i created form tool strip menu. there lot of items in tool strip. items consist of toolstripbutton, toolstriplabel , toolstripcombobox. problem combobox data source doesn't initialize when in overflow this code public partial class form2 : form { public form2() { initializecomponent(); } private void form2_load(object sender, eventargs e) { var data1 = new list<tvpair>{ new tvpair{ text = "text1", value = 1 }, new tvpair{ text = "text2", value = 2 }, new tvpair{ text = "text3", value = 3 }, new tvpair{ text = "text4", value = 4 }, }; toolstripcombobox1.combobox.displaymember = "text"; toolstripcombobox1.combobox.valuemember = "