Posts

Showing posts from April, 2014

jquery - Fixed Header Issue - addClass doesn't work on page load -

i trying build hidden header has appear once scroll web page below 100px. header contains logo has hidden well. issue on page load hidden same has be, on scroll head appears, logo still missing. if refresh page when below 100px top logo appears , works fine if go on top. could please explain might reason behind issue not find proper solution. html <header> <a id="logo" href="index.html"></a> </header> css header{ position: fixed; top: -50px; left: 80px; height: 50px; width: 100%; background: rgba(255,255,255, 0.9); z-index:9999; transition: 0.3s ease-in-out; } header.show{ top:0; } a#logo{ display: block; position:absolute; top: inherit; left: -80px; width: 80px; height: 50px; background: url('images/logos/logo.svg'); } jquery $(document).ready(function(){ $(window).scroll(function(){ if($('body').scrolltop() > 100){

javascript - Multiple nested dropdown menu from MySQL -

i have following php page 4 dropdown list correctly populated 4 differents mysql query. populate categories_2 through query depending on categories_1.c_id , same nested others dropdown. tried call myfunction() onchange seems not working. don't alert. does know how this? appreciated. i know have use mysqli it's existing page , later. <script> var mydropdown=document.getelementsbyname('cat1')[0]; function myfunction(){ alert('option changed : '+mydropdown.value); } </script> <form enctype="multipart/form-data" method="post" action="import.php"> <label for="cat_name">categories_1</label> <select name = "cat1" onchange="myfunction()"> <?php $s = mysql_query("select * `categories_1`"); while($row = mysql_fetch_assoc($s)) { echo ('<option value="' . $row['c_i

Dechunking a string in python -

i have array of bytes in python, looks this: chunk_size = 8 = b'12341234a12341234b12341234c12341234...' i have remove each nth byte (a, b, c in example). array length can many thousands. typical chunk size can 128 or few thounds. this current solution: chunk_size = 8 output = b"".join([ i[:-1] in [ a[j:j+9] j in range(0, len(a), chunk_size + 1) ]]) i looking other solutions, more elegant. python 3.x solutions fine. i'd pull 'chunk , skip' logic out generator, like: >>> = b'12341234a12341234b12341234c12341234' >>> def chunkify(buf, length): ... while len(buf) > length: ... # next chunk buffer ... retval = buf[:length] ... # ...and move along next interesting point in buffer. ... buf = buf[length+1:] ... yield retval ... >>> chunk in chunkify(a, 8): ... print chunk ... 12341234 12341234 12341234 >>> ''.join(chunk chunk in chunkify(a, 8)) '

How can I send message to phone by using diafaan sms gateway with php -

i want send message web phone using diafaan sms gateway .but cann't send message using diafaan server api.the error "no recipient phone".if substitute to="my phone number",it correctly sent.how can that? $diafaan_user = "admin"; $diafaan_password = ""; $diafaan_url="http://localhost:9710/http/send-message?username=admin&password=&to=%2b44xxxxxxxx&message-type=sms.automatic&message=message+text"; function diafaansend($phone_no, $activate_code, $debug=false){ global $diafaan_user,$diafaan_password,$diafaan_url; $url.= 'username='.$diafaan_user; $url.= '&password='.$diafaan_password; $url.= '&action=sendmessage'; $url.= '&messagetype=sms.automatic'; $url.= '&recipient='.urlencode($phone_no); $url.= '&message='.urlencode($activate_code); $urltouse =$diafaan_url.$url; if ($debug) { ec

Installing cassandra on RHEL using docker -

i trying install cassandra on rhel-7 source code using docker. have done following steps inside container: 1 - yum install -y git java-1.8.0-openjdk-devel ant 2- export java_home=/usr/lib/jvm/java-1.8.0 3- export path=$path:$java_home/bin 4- export ant_home=/usr/share/ant 5- export path=$path:$ant_home/bin 6- export java_tool_options=-dfile.encoding=utf8 7 -git clone https://github.com/apache/cassandra.git 8 -cd cassandra && ant the build successful. when try start cassandra server inside container getting following error: a fatal error has been detected java runtime environment: internal error (cppinterpreter_zero.cpp:812), pid=836, tid=4397984807184 error: unimplemented() any idea?

android - Why using LayoutInflater is not same to xml? -

Image
i created layout <linearlayout android:id="@+id/list" android:layout_width="0dp" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_margintop="10dp" android:layout_marginbottom="20dp" android:layout_weight=".7" > <relativelayout android:layout_width="70dp" android:layout_height="wrap_content"> <imageview android:id="@+id/icon" android:layout_width="50dp" android:layout_height="50dp" android:layout_margintop="10dip" android:layout_marginright="10dip" android:layout_marginleft="10dip" android:src="@mipmap/icon" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap

javascript - Slicknav autoclosing multilevel menus -

i'm working slicknav mobile menu. came across cool little way have parent menu close automatically if click on parent menu , have working if i'm using below (please note, not know javascript. see me hacking other code i've found online): <ul id="menu"> <li class="first"><a href="#">parent1</a> <ul> <li><a href="#" title="">child1</a></li> <li><a href="#" title="">child2</a></li> </ul> </li> <li><a href="#" title="">parent2</a> <ul> <li><a href="#" title="">child3</a></li> <li><a href="#" title="">child4</a></li> </ul> </li> <li><a href="#" title="&

c# - asp:DataGrid visibility with async? -

.net 4.5.2, iis 8.5 on windows 8.1 x64. have single asp.net web site @ /localhost/. i've got real async-puzzle here i've been wrestling 2 days now. i'm reworking long-running reports async, can demonstrate problem simple code. i have asp:datagrid on page i've set visible="false". should visible if populated. problem is, if code populates async don't see grid! here's markup: <body> <form runat="server"> <asp:datagrid id="grid" visible="false" runat="server"></asp:datagrid> </form> </body> in code-behind, code works: void page_load() { grid.datasource = new dictionary<string, string>() { { "col1", "value1" } }; grid.databind(); grid.visible = true; } now if make 2 changes: add async="true" @page directive replace page_load this void page_load() { this.registerasynctask(new

How to get method level variable declarations using javaparser? -

am trying method level variables using visit(fielddeclaration n, object arg) , it's not working. on appreciable. first of need use javaparser on source code compilationunit (which represents single file). @ point can use visitor. can create anonymous class extending genericvisitoradapter , override public r visit(final variabledeclarator n, final arg) . take compilation unit , run compilationunit.accept(myvisitor, null); . in method override can parent of variabledeclator see if method or else. as alternative can take compilation unit, access classes in there, access methods of classes , body of methods looking variabledeclarators. disclaimer: javaparser contributor.

How to merge two branches in git -

i have branch name development . made 4 commits , needed revert first commit while preserving these 4 commits. checked out first commit new branch development_back . merge these 2 branches, not want continue in development_back branch in development branch. doable somehow? if understand correctly have this: a -> b -> c -> d -> e ^ ^ development_back development but want this: a -> b -> c -> d -> e ^ development ^ development_back if correct need merge development development_back , not in opposite way. checkout development_back branch , git merge --ff-only development . --ff-only flag ensures merge fast-forward.

Cannot start container on docker compose -

once removed tiger machine config file. everything go well. don't wrong tiger. each machine share same image when ran docker-compose up , got cannot start container 38c203136f645a62451fbbc19bcdae0b1c31a45495e3e02588bc8182397f0e2e: [8] system error: open /proc/self/fd: no such file or directory - docker-compose 1.2.0 jetstar: mem_limit: 512m image: newbike/firefox-standalone volumes: - "./:/project-bird" ports: - 5902 peach: mem_limit: 512m image: newbike/firefox-standalone volumes: - "./:/project-bird" ports: - 5903 scoot: mem_limit: 512m image: newbike/firefox-standalone volumes: - "./:/project-bird" ports: - 5904 tiger: mem_limit: 512m image: newbike/firefox-standalone volumes: - "./:/project-bird" ports: - 5905 vanilla: mem_limit: 512m image: newbike/firefox-standalone volumes: - "./:/project-bird" ports: - 5906 chances 38c203136f645a62451fb

angularjs - How to access JSON payload -

i have bit of problem trying use json load angular-translate. mean, how can access it? file loads , other don't know how set it. i want to like: $scope.translations = /* json */ here code loading file. angular.module('app.core').config(config); /* @nginject */ function config($translateprovider) { $translateprovider.usestaticfilesloader({ prefix: '/assets/lang/', suffix: '.json' }); $translateprovider.preferredlanguage('fi'); }

python - CherryPy server running on windows gives random locking error -

i'm running cherrypy server using file based sessions. when run server on mac works fine, when run on windows machine have problems. i have web app makes many requests (~50) server on page load. on 1 or more of requests i'll below error message @ server. doesn't happen same request each time, seems random. loads without problems @ all. 14-07-2015 10:42:16 : info : (cp server thread-81) : (_cplogging ) : 127.0.0.1 - - [14/jul/2015:10:42:16] "get /static/scripts/jquery-2.1.4.min.js http/1.1" 500 823 "http://127.0.0.1:8099/" "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.132 safari/537.36" 14-07-2015 10:42:16 : info : (cp server thread-80) : (_cplogging ) : 127.0.0.1 - - [14/jul/2015:10:42:16] "get /static/scripts/moment.js http/1.1" 304 - "http://127.0.0.1:8099/" "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.

What is netbeans doing now? -

this getting tedious. created test project, simple java hello, test problem have in project. having created project, run , build jar. then added ivy stuff , tried build did not work. ivy stuff consisted of ivy.xml ivysettings.xml , 2 tasks added otherwise default netbeans build.xml. so removed ivy files , ivy sections build.xml. did diff on , previous unedited build.xml file , identical. so why after clean build error? /home/tester/workspace/netbeans/foo/nbproject/build-impl.xml:63: source resource not exist: /home/tester/workspace/netbeans/foo/lib/nblibraries.properties correct file not exist , not exist in other project have access whether use ivy or not. i have reset did yet netbeans cannot continue. have tried work out how hell nb builds project got lost. don't know say. i guess nb , myself differ on clean means , on whether task should able produce exact same results everytime given same input, nb not seem able do. or cannot recover real world or documentatio

php - Destroy the Session File after logout -

i have code login storing following in session variables: if($do == "login") { session_start(); $_session["valid"] = true; $_session["studentuniqueid"] = $user_row['studentuniqueid']; $_session["loginname"] = $loginname; $_session["timeout"] = $now; } session file looks likethis: valid|b:1;studentuniqueid|s:5:"10001";loginname|s:13:"abc@gmail.com";timeout|s:19:"2015-07-01 18:26:32"; also code logout destroying user session: if($do == "logout") { session_start(); $_session = array(); session_unset(); session_destroy(); } after logout session files contains: valid|b:0; even have used session_destroy(), after logout session file exist valid|b:0; on servers temp directory , size of temp directory increases considerably. i want rid of these files after session_destroy()/l

java - Obtaining list views in Jenkins from nested view plugin -

i have developed plugin has extension point listviewcolumn have run problems when combining plugin, nested view plugin . my plugin enables 1 select jobs in current view , make modifications 1 button press. when view resides inside nested view, can't find view (from java code , jelly scripts) , no modification can made. in columnheader.jelly execute ${it.getheadertext(view.name)} where getheadertext() defines as public string getheadertext(string viewname) { hudson.getinstance().getview(viewname); // access jobs return object of .getview(viewname) return viewname; } this works fine regular list views whenever enter nested view's list view, getview(viewname) returns null. upon further investigation i've noticed nested views show when calling hudson.getinstance().getviews(); which returns views in toplevel of whole jenkins instance (no views inside nested views). here have nested view shows , instance of hudson.plugins.nested_view.nestedview.

Xpages document changing document mode? -

i have strange thing occurring; usual, can't post code, unfortunately, i'm describing problem in case can suggest possible cause. i have xpage custom control included on it; custom control handles document locking , changing edit/read-only modes via links. document locking done setting applicationscope variable based on unid. make more friendly other users on system, run function periodically on page check whether document locked or not , update link/label/tooltips appropriately (e.g. if locked user, "edit" button disabled; when lock released, it's re-enabled). done calling "xagent" through standard, simple dojo-based ajax call. for reason, behavior of system gets erratic after 45 seconds minute. i'm checking lock status every ten seconds or so, it's not happening first call. i'm displaying list of records associated document; each record row in repeat. when first go edit mode, controls displayed should be, i.e. editable. if us

javascript - Make part of the text as readonly -

i want make part of strings read only. ex: name: ss,ks,mm,ll,pp in name text want make ks , ll read using javascript or jquery. can suggest how can implement functionality? you cannot make part of textbox readonly. however, can try add pattern textbox. correct pattern logic may able want. you can find many jquery plugin textbox pattern. instance: http://www.jqueryrain.com/demo/jquery-mask-input-plugin/

javascript - How to add a mute button to my app? -

i have few events in app make sounds. for example, background music looped background on click makes sound when 2 rectangles collide makes sound what want have button when clicked toggles between letting sounds play , not letting them play. i don't want have load of if statements on each sound, there way around ? here how im calling sounds @ moment //html <div id='mainright'></div> //js var mainright = $('#mainright'); $(mainright).width(windowdim.width/2).height(windowdim.height); $(mainright).addclass('mainright'); var sounds = { coinhit : new audio('./sound/coincollect.wav'), playerclick : new audio('./sound/playerclick.wav'), gameover : new audio('./sound/gameover.wav'), backgroundmusic : new audio('./sound/backgroundmusic.wav') } sounds.backgroundmusic.addeventlistener('ended', function() { this.currenttime = 0;

AngularJs $resource return my Java Enum as an array from a REST service -

i'm pretty new angularjs, , have trouble retreiving correctly java enum rest service. code put @ end of question, here result got : {"0":"c","1":"u","2":"s","3":"t","4":"o","5":"m","6":"e","7":"r"} it's array, excpecting simple string. maybe miss how transform string ? can't find correct way ... here controller : angular.module('myapp') .controller('labcontroller', function ($scope, labservice) { $scope.clientouabonneresultat = ''; $scope.clientouabonne = function () { labservice.get({noclient: 10002782, nocontrat: 1003}, function(result) { $scope.clientouabonneresultat = result; }); }; }); my service : angular.module('myapp') .factory('labservice', function ($resource) { return $resource('api/lab/clientouabonne'

javascript - Opening pdf in new tab using a png image with jspdf works in Mozilla, but not Chrome or Internet Explorer -

i create flot graph on html website , want able export pdf (on click of button) should open in new tab, people decide if want download computers or not. i started jpeg , working fine, background appears black because of transparency issues, changed png. after code crashes chrome browser, or opens new empty tab! same internet explorer... in mozilla seems work fine. saving pdf file rather opening in new window works perfect in browsers, i'd rather not fill people's download folders junk may not want. i created fiddle reproduce issue: http://jsfiddle.net/8tlt9yof/10/ jquery code inside "get pdf" button reads (plot name of flot graph): var canvas = plot.getcanvas(); var src = canvas.todataurl("image/png"); var doc = new jspdf('landscape'); doc.addimage(src, 'png', 10, 20, 280, 150); doc.output('dataurlnewwindow'); can me see i'm doing wrong?

javascript - How to split single line into multiple lines? -

i've been looking how split single line multiple lines using d3. when user clicks single line split on click. can't find examples online on how this. can let me know if possible? thank in advance! d3: var link = svg.selectall(".link") .data(force.links()) .enter().append("line") .attr("class", "link") .style("stroke-width", function(d) { if(d.value < 76742302){ return 1; }else if(d.value < 159879796){ return 2; }else if (d.value < 354232554) { return 3; }else if (d.value < 695427312) { return 4; }else{ return 5; } }); 'svg:line' have x1, y1, x2, y2 values. you can use basic algebra calculate line equation ( http://www.coolmath.com/algebra/08-lines/12-finding-equation-two-points-01 ) and find point want split line , create 2 new line elements. if want split half

angularjs - variable and it's parent scope inside ng-if -

according links read "unlike ng-show ng-if directive creates new scope. " confused below scenario. see demo <div ng-if="true"> <div> visibility variable: {{showit}}<br> visibility variable: {{$parent.showit}} </div> <a href="" ng-show="!showit" ng-click="$parent.showit = true">show it</a><br> <a href="" ng-show="!$parent.showit" ng-click="$parent.showit = true">show it</a> <div ng-show="showit"> dynamically-shown div. <a href="" ng-click="hideit()">hide it</a> </div> </div> in above example both {{showit}} , {{$parent.showit}} evaluate same value , ng-sho evaluate same values. in ng-click if dont specify parent give unexpected result ng-if creates child scope. checked while using ng-model parent scope nee

php - Search Form Error sends to ?q= -

i'm using bootstrap theme , form this: <form class="navbar-form" role="search" method="get" action="<?=$domain?>search" onsubmit="dosubmit();"> <div class="input-group"> <input type="text" class="form-control input" placeholder="search" name="q"> <div class="input-group-btn"> <button type="submit" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> the original page placed http://www.domain.com/toys/search/electronics kids/ when search form "test" , press enter, sends me http://www.domain.com/toys/search/?q=test with should replace code send me to: http://www.domain.com/toys/search/test thanks in advance! i assume use jquery if use bootstrap.

ruby - How to check if user input is a number -

i'm making small program , want check if user entered integer number, if did program continue if user enters string want program ask user enter integer until it, here's code snippet: print "how old you:" user_age = gets.chomp.to_i if user_age.is_a? string puts "please enter integer number:" user_age = gets.chomp.to_i until user_age.is_a? numeric puts "please enter integer number:" user_age = gets.chomp.to_i break if user_age.is_a? numeric end end i think error to_i after gets.chomps . to_i returns first number(s) @ begining of string or 0, allways number (0 or number). here examples: 2.2.1 :001 > "12".to_i => 12 2.2.1 :002 > "12aaa".to_i => 12 2.2.1 :003 > "aaa12aaa".to_i => 0 2.2.1 :004 > "aaaaaa".to_i => 0 i wrote code, works me: print "how old you:" begin user_

multithreading - Concurrent threads in Vector (Java) -

i designing multi-threaded piece of code includes part several sensors queried (through socket), , data stored first in vector , subsequently written db. the entire process time sensitive since each sensor updates every few seconds new data. if data not retrieved in time, lost. currently, have vector of (custom sensor data) class stores information obtained , each of sensors. the plan open thread each sensor (say, 40-50 in total, not want limit number in case more sensors added later) , have access , fill particular (set index of vector) cell of vector. is such operation on vector allowed , prudent? also, knowing peculiarities of tcp/ip sockets, drastically speed process introducing threads (as opposed to, say, running in single thread)? there better or more elegant way of doing this? from write seems queue beffer fit; threads push sensor data on queue , later (perhaps thread) can take elements queue , process them. java (at least version 7 , 8) offers different qu

excel - Find all duplicate values in one column and combine all its values -

Image
so got excel file lot of data why want avoid doing manually. want find values same in 1 column , combine it's values 1 row. if have data in worksheet. i output this i appreciate can get. edit: this pivot table when want this. you must use pivot table function (i recommend it) ms excel. it lets set wich columns becomes rows, type of values contain , more. pivot tables want. it saved career @ previous job :) here got screenshot of example making sums duplicates in first column: original table:

php - How to get number of queued jobs in IronMQ using Laravel 5.1? -

Image
implementing queues & jobs in laravel 5.1 in project using ironmq , can send jobs ironmq queue see in image bellow : what want current number of messages in queue (number in red box) in handle function in job, find job code bellow : class getwords extends job implements selfhandling, shouldqueue{ use interactswithqueue, serializesmodels; /** * create new job instance. */ public function __construct(url $url) { } /** * execute job. */ public function handle() { //getting name of queue dd($this->job->getname()); //return 'words' $currentnumbermsgsinqueue = ?????; //i can't find how //condition if($currentnumbermsgsinqueue == 10){ //do } } } question : how number of queued jobs (messages) in ironmq queue using laravel ? after days of searching found answer, there's no method/function in laravel 5.1 can give number of queued

.net - System index out range exception C# -

i have following code: using mysql.data.mysqlclient; using system; using system.collections.generic; using system.data; using system.linq; using system.text; using system.threading.tasks; namespace timeclock { class company { datatable rows = new datatable(); public company() { mysqlconnection connection = null; try { string connectionstring = timeclock.properties.settings.default.timeclockconnectionstring; connection = new mysqlconnection(connectionstring); connection.open(); mysqlcommand command = new mysqlcommand("select * companies id = @id limit 1", connection); command.parameters.addwithvalue("@id", timeclock.properties.settings.default.companyid); mysqldataadapter da = new mysqldataadapter(command); da.fill(rows); } catch (mysql.data.mysqlclient.my

.net - How to store XML in MongoDB? -

context: existing system heavily based on passing xml around in various forms (xmldocument, xdocument/xelement, string encoded). developing new component talk existing system , have it's own data store of kind holding xml later processing. mongodb seems fit data store doesn't have native support xml, i'm wondering options exist handling xml in mongodb. there 2 options come mind: 1. use xml json converter (for conversion in both directions) i believe allow querying of data , creation on mongodb indexes. there isn't immediate need lots of querying or lots of different types of querying, @ least have key based retrieval , maybe 1 or 2 queries on values useful (certainly useful keep option open). is generic xml-2-json converter fit here, or mongodb/bson converter better? are there specific downsides converting json/bson? ever result in loss of information, perhaps whitespace in blocks of element space mangled? 2. string (or binary) encode xml , store bson by

xaml - Powershell WPF Forms changing textbox background to an image -

i trying make background of text box image in powershell. im using xaml converter http://blogs.technet.com/b/heyscriptingguy/archive/2014/08/01/i-39-ve-got-a-powershell-secret-adding-a-gui-to-scripts.aspx load xaml form: <window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="uat" height="300" width="300"> <grid> <button name="btngo" content="go" horizontalalignment="left" verticalalignment="top" width="75" margin="207,240,0,0"/> <textbox name="txtout" horizontalalignment="left" height="233" textwrapping="wrap" text="textbox" verticalalignment="top" width="272" margin="10,0,0,0"/> </grid> </window> the .ps1 file: add-type –assemblyname pr

android - Adding a shadow to Sliding Drawer -

i knew sliding drawer deprecated. imported sliding drawer class own package , customized satisfy requirements. scenario is, want add shadow wraps both handle , content of sliding drawer. if add shadow handle , content separately (by giving image shadow background both handle , content),then shadow makes gap between handle , content. not requirement. please guide me through this. navigationdrawer.setdrawershadow(r.drawable.somedrawable,gravitycompat.start); you need use drawable shadow. use setdrawershadow method on navigationdrawer object.

svn - Is there a git equivalent to clearcase catcr -

my experience of version control systems clearcase and, while it's served purpose well, move free tool. i've read , experimented git & svn , see advantages in commit based approach opposed file based approach clearcase uses. however, there parts of clearcase miss if there no equivalent in other tools. clearcase distinguish between files written user , files created programs user had written. user written files 'file element versions' , program generated files 'derived object versions'. furthermore dependencies of 'derived object version' determined using clearcase cleartool catcr command. my question is: there equivalents these files types in git , there equivalent of cleartool catcr command? agree isn't strictly part of version control system, still replicate if moved git. the cleartool catcr there use metadata (the configuration record or crs ) attached derived objects (the .o files), generated clearmake . this use

angularjs - When changing states browser doesn't find project js files -

i trying create new state in angular using ngrouter. have index.route.js file contains following: (function() { 'use strict'; angular .module('testapp') .config(routeconfig); /** @nginject */ function routeconfig($stateprovider, $urlrouterprovider) { $stateprovider .state('home', { url: '/', templateurl: 'app/main/main.html', controller: 'mainctrl' }) .state('tools', { url: '/tools/:category', templateurl: 'app/tools/tools.html', controller: 'toolsctrl', controlleras: 'tsctrl' }); $urlrouterprovider.otherwise('/'); } })(); then, have created tools.html , tools.controller.html . tools.html : hello world tools.controller.js : (function(){ 'use strict'; angular .module('testapp') .controller('toolsctrl', toolscontroller); /** @nginject */ function

html - How to keep :active css style after click a button -

once button clicked want stay active style instead of going normal style. can done css please? im using blurb button divi theme (wordpress). please me! code: #blurb-hover.et_pb_blurb .et_pb_blurb_content .et_pb_main_blurb_image .et-pb-icon:hover { color: red !important; } #blurb-hover.et_pb_blurb .et_pb_blurb_content .et_pb_main_blurb_image .et-pb-icon:selected { background-color: #ff4b46; color: #fff; } #blurb-hover.et_pb_blurb .et_pb_blurb_content .et_pb_main_blurb_image .et-pb-icon:active { color: white !important; background-color: red; width: 140px; height: 100px; } css :active denotes interaction state (so button applied during press), :focus may better choice here. however, styling lost once element gains focus. the final potential alternative using css use :target , assuming items being clicked setting routes (e.g. anchors) within page- can interrupted if using routing (e.g. angular), doesnt seem case here. .active:a

summarization - MEAD (Perl Package) Installation -

i trying install mead http://www.summarization.com/mead/ text summarization, when try run basic example bin folder ./mead.pl ga3 i error below: cannot locate loadable object module xml::parser::expat in @inc (@inc contains: mead/bin/../lib mead/bin/../lib/arch /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) @ mead/bin/../lib/xml/parser.pm line 15 compilation failed in require @ mead/bin/../lib/xml/parser.pm line 15. begin failed--compilation aborted @ mead/bin/../lib/xml/parser.pm line 19. compilation failed in require @ /mead/bin/../lib/mead/cluster.pm line 16. begin failed--compilation aborted @ mead/bin/../lib/mead/cluster.pm line 16. compilation failed in require @ ./mead.pl line 29. begin failed--compilation aborted @ ./mead.pl line 29. strange enough, have expat installed. wondering, cause of error?

r - Can't write data frame to database -

i can't create code example because i'm not quite sure problem , actual problem rather involved. said seems kind of generic problem maybe somebody's seen before. basically i'm constructing 3 different dataframes , rbinding them together, expected smooth sailing when try write merged frame db error: error in .external2(c_writetable, x, file, nrow(x), p, rnames, sep, eol, : unimplemented type 'list' in 'encodeelement' i've tried manually coercing them using as.data.frame() before , after rbinds , returned object (the same 1 fails write above error message) exists in environment class data.frame why dbwritetable not seem have got memo? sorry, i'm connecting mysql db using rmysql. problem think little closer , try explain myself columns of data frame lists (of same length), sorta makes sense of error. i'd think (or think anyways) call as.data.frame() take care of guess not? a portion of str() since it's long looks like:

visual studio 2015 - how to include views in asp.net 5 class library nuget package -

i'm creating class library project contain viewcomponents. nice vs 2015 can automatically produce nuget package me, there way can make include content files .cshtml view files viewcomponents need? previously i've done packaging batch files , nuspec files make include content, have continue approach or there way tell vs 2015 content files include? not doable yet. feature in beta7

android - Shared Preferences leading to multiple activities -

i checking whether user has "logged in" using sharedpreferences using inside oncreate. tried doing inside onstart too. problem after "productcategories" visible user, when click button of mobile screen can see multiple productcategories activities have been opened. keep on clicking button few times first activity "mainactivity". package com.example.pager; import android.content.intent; import android.content.sharedpreferences; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.pageradapter; import android.support.v4.view.viewpager; import android.view.menu; import android.view.menuitem; import android.view.view; public class mainactivity extends fragmentactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(

java - JMH: Perfomance comparison -

i try improve perfomance of program. used jmh comparate 2 versions don't know if there real difference. example of results: version1(op/s) score error(op/s) version2 score error benchmark 1 12382150,338 1277638,481 18855038,903 50835,395 benchmark 2 11708047,2 4061755,193 18843828,659 41966,689 benchmark 3 7814465,4 9483927,071 18821356,961 72364,651 benchmark 4 10481146,451 464691,58 13936537,089 40726,506 benchmark 5 6863734,072 175974,219 9709381,687 21774,816 can results show real difference between version 1 , version 2? iirc, benchmark score (ops/s) arithmetic mean of 90% distribution (that is, extreme outliers filtered out). thus, no matter how slice it, version 2 scores higher on benchmarks.

Disable Case sensitivity on Python's Webserver -

to explain issue, dad teaches english , switched him on linux, works apart teaching cd uses. i figured out shortly later cd mess of flash files, , putting on webserver meant use cd without official launcher (there 1 linux doesn't work) so ran folder : python3 -m http.server and sure enough loaded fine, issue case sensitivity. i don't know coder doing, in swf (it's flash), calls xml files first letter capitalised, files not capitalised, therefore python's web server 404's due case). i'd avoid having change each file i wondering if possible tell python's webserver ignore case entirely when processing requests ? i should note i'm using python3 any appreciated ! if files in server root (including eventual subdirectories) lower case, easiest override translate_path method of simplehttprequesthandler unconditionally operate lower case paths. simple example: from http.server import httpserver, simplehttprequesthandler class low

linux - GitLab: How to filter bad formats? -

i want make sure users wont able push formats. check file format before uploading file gitlab server. web hooks affects specific project, while want whole server filtered. idea? ok, found out do. used hooks. can add own script inside path: /opt/gitlab/embedded/service/gitlab-shell/hooks/ you can edit existing samples. wrote in ruby , script in bash, make sure add "#!/bin/bash" (or whatever script language write) file header. make sure bring file chmod 755 or higher, , file name should event name (without format, "pre-rereceive" example). notice parameters, can read in "pre-receive.sample" notes. luck.

Selenium IDE: Nested variables -

Image
is possible evaluate expression nested variables in selenium ide? example: store | 2 | scenario store | $10 | data${scenario}cost so data2cost = $10 store | ${data{$scenario}cost} | ${scenario}result echo | ${scenario}result | which returns 2result = ${data2cost} opposed 2result = $10 . you can use storeeval store evaluated expression variable tutorial helped me achieving that |store | 2 | scenario | |store | $10 | data${scenario}cost | |storeeval | storedvars['data${scenario}cost'] | ${scenario}result | |storeeval | storedvars['${scenario}result'] | mainresult | |echo | ${mainresult} |

html - jQuery Script Triggering Another jQuery Script -

i making use of 2 jquery scripts in page made of repeating elements (a gallery of thumbnails basically). scripts @ end of html page in 2 separate script tags. the first calls script making use of touchtouch plugin presents images in nice overlay , allows swipe navigate. the second infinite ajax scroll appends more items page scroll down. the problem seem having when page first loads, touchtouch script modifies thumbs present on page. scroll , infinite scroll script appends more thumbs, newly appended thumbs not modified touchtouch script, not function should when clicked on. how make touchtouch script run again after infinite scroll script has added new elements page? here snippet end of html <script src="assets/touchtouch.jquery.js" type="text/javascript"></script> <script> $(function(){ // initialize gallery $('#thumbs a').touchtouch(); }); </script> <script type="text/javascript" src="assets/j

Subclassing vs Extension in swift -

i want customise 1 uitextfield reason. subclassed , added few methods. instead of can use extension on uitextfield ? approach ? please explain ! as general rule of thumb (ymmv): are adding general-purpose functionalities should available every uitextfield ? if so, make extension. uitextfield instances can call new methods. are adding functionality should restricted special instances of uitextfield identify precisely? if so, make subclass. instances of subclass can use new methods. there other technical considerations, extensions can't add fields, instance.

php - Looping through image array and moving them - Laravel -

i have form has 5 file inputs create array of images. when processing, wish loop through images , process them. $images = input::get('images'); // image proccessing foreach ($images $image) { print_r($image); } that output file name, if call move function on $image variable "method move called on string". how should doing this? you should doing $input = input::file('files'); //get file input //check if input has file if ($input){ foreach($input $key){ //loop through file , perform action... $array = image::file_upload($key, 'file', 'images'); // assume have method upload above $key = $array['filename']; print_r($key); } } $this->image->save($input); //save db file name.

sql server - SQL Incorrect total while combining equations -

for report creating need take 2 separate expressions , combine them 1 solution. the first expression need total sales calculated by sum([dct].[quantity_stk] *[icp].[unitcost]) [total sales] the second expression need total cost which calculated by max(cast ((@purchasecost + @prod_costlbs) * @inputweight decimal (18,2))) [cost] both of statements work because used other columns in query , display properly. in order find out total profit tried combine 2 using sum, avg, max , trying make expression results in error. believe code below has right idea, missing important parts. perhaps over() statement: cast (([dct].[quantity_stk] *[icp].[unitcost]) - ((@purchasecost + @prod_costlbs) * @inputweight) decimal(18,2)) [profit] the problem have is calculating profit each row want total profit. make aggregate function believe. or there way store other 2 expressions variables , use those? i using microsoft sql server 2005. full code: set nocount on; declare @purchasec

javascript - knockout custom select binder with update function -

i trying develop custom select binder not able understand how develop update functionality. this have done. want custom binder handle type of data [{ message: "hello", value: 1 }, { message: "hi", value: 2 }, { message: "bye", value: 3 }, ] the problem, understand it: using bootstrap fullscreen select , , can initialize it, when select new value, no observable gets updated. basically, need know when new value selected. since way widget works pop screen of options , allow select one, , close popup, and widget provides ability onclose callback, that's need. i'm using standard convention of value binding in select. when widget closes, if new value different bound value, update bound value new value selected in widget. ko.bindinghandlers.menu = { init: function (element, valueaccessor, allbindingsaccessor, viewmodel) { var valueobservable = allbindingsaccessor().value; $(element).mobi

ios - XCode unable to recognise the distribution profile present in my keychain -

Image
in nutshell : i got distribution profile in keychain (image 1) from xcode developer account preferences see developer profile (image 2) when try add new ios distribution profile says 1 , should visit member centre (image 3) i did , brings me step 1 infinite loop (aka "i'm stuck here keep retrying..") edit: when try use ios mobile distribution profile generated don't see many options code signing identies. how looks like: i have downloaded team distribution profile on computer apple developer member centre. way looks in keychain : however when try sign code ad hoc distribution cannot find distribution certificate in code signing identities tab. i manage build product archive (for local ad hoc distribution, e.g. testflight) when try export (or submit appstore) message saying have code signing identity , need download it. more details on in question asked yesterday . today trying different approach , decided go account->preferences , tr