Posts

Showing posts from July, 2013

javascript - Bootstrap light box, with next arrows not aligned -

Image
for 1 of web sites developing have used bootstrap light box, along next , buttons. slider when video or image clicked displayed in light box, , there next buttons navigates. while navigating arrow suppose in middle moves top. how can prevented moving? the java script code light box ekkolightbox.prototype = { modal_shown: function() { var video_id, _this = this; if (!this.options.remote) { return this.error('no remote target given'); } else { this.gallery = this.$element.data('gallery'); if (this.gallery) { if (this.options.gallery_parent_selector === 'document.body' || this.options.gallery_parent_selector === '') { this.gallery_items = $(document.body).find('*[data-toggle="lightbox"][data-gallery="' + this.gallery + '"]'); } else { this.gallery_items = this.$element.parents(this.options.gallery_parent_selector).fi

MQTT in AWS Lambda function for Alexa Javascript -

please help, need use mqtt protocol in lambda function send data broker. use simple code test : mqtt = require('mqtt'); var client = mqtt.connect('mqtt://test.mosquitto.org'); client.on('connect', function () { client.subscribe('presence'); client.publish('presence', 'hello mqtt'); }); client.on('message', function (topic, message) { // message buffer console.log(message.tostring()); client.end(); }); but error "cannot find module 'mqtt'", how can include module in lambda function??? how can use mqtt in lambda anyways?? somebody??? first in directory of project: npm install mqtt --save after zip folder (inside folder, files , subdirectories) , upload lambda function. every time must create handler function, create function this: exports.handler = function (event, context, callback) { ... code... } in lambda function @ aws panel appoint file , function using in handler

javascript - display alert based on checkboxes displayed -

i'm building medication reminder app, , works user clicking button , system display medication user should taking based on current time. , if user should take med , med b @ 3pm, , when user clicked button @ 3pm, 2 checkboxes med , med b pop up, if user checked "med a", system should display message asking "why didn't take med b?" dropbox allowing user choose reason. however @ moment, if user checked "med a", system display message asking "why didn't take med b , med c" because med c listed 1 of option checkbox, wasn't displayed should taking @ different time. doesn't matter medication user should taking @ particular time, system ask based on checkboxes options , not based on current displayed checkboxes (which displayed based on time). js: function validate() { var msg = []; [].foreach.call(document.queryselectorall('input[type="checkbox"]:not(:checked)'), function(elem, index) {

.htaccess - How to avoid redirect from subdomain in htaccess file? -

i using in htaccess: rewriteengine on rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ https://www.example.com/$1 [l,r=301] rewritecond %{https} !=on rewriterule ^ https://%{http_host}%{request_uri} [l,r=301] but has unfortunate effect of redirecting every call mobile site (m.example.com) main page. how make exception m.example.com? don't know how setup rewriterule correctly. you can use: rewriteengine on rewritecond %{http_host} ^example\.com$ [nc] rewriterule ^ https://www.%{http_host}%{request_uri} [ne,l,r=301] rewritecond %{https} !=on rewritecond %{http_host} !^m\. [nc] rewriterule ^ https://%{http_host}%{request_uri} [l,r=301,ne] and make sure clear browser cache.

Oozie fs:exists with variables -

i'm struggeling on following problem using variables in oozie workflow definition checking if specific file created. working absolute path following, cannot use absolute path: ${fs:exists('/mypath/file.hql')} in case, namenode , workflow id has replaced in decision node not working. variables not replaced, correct syntax this? <decision name="check-hql-file-created"> <switch> <case to="hive-exec-il2rl-hql4baseentity"> ${fs:exists(${namenode}'/tmp/oozie_tmp/'${wf:id()}'.hql')} </case> <default to="il2rl-loop"/> </switch> </decision> it working concatenation following: <switch> <case to="hive-exec-il2rl-hql4baseentity"> ${fs:exists(concat(concat(concat(concat(concat(namenode, '/tmp/oozie_tmp/'), wf:id()), '_'), replaceall(asjson, "\\{\"|,.+$&quo

r - Rename columns in data frame using "arithmetic progression" -

suppose i've got following data.frame composed of multiple rows (not displayed here) , 31 columns. first 1 (and should remain) labelled "gene_id" and, second way thirtieth column have weird names, follows: |gene_id | weird1| weird2|all_the_way_to | weird30| |:-------|------:|------:|:--------------|-------:| |bpk282x | 4| 1|... | 7| |bpk282y | 5| 2|... | 8| |bpk282z | 6| 3|... | 9| i rename 30 columns names pattern this: tpm_1, tpm_2, tpm_3, tpm_4.....tpm_30, resulting in following table: |gene_id | tpm_1| tpm_2|all_the_way_to | tpm_3| |:-------|-----:|-----:|:--------------|-----:| |bpk282x | 4| 1|... | 7| |bpk282y | 5| 2|... | 8| |bpk282z | 6| 3|... | 9| i rename columns individually by: names(data.frame) <- c("gene_id", "tpm_1", "tpm_2", "tpm_3", ..., &q

lotus notes - xpages : Filtering a View Data Source using the keys parameter(filter by category name) -

i have xpage linked 1 of our databases displays history view of documents in database. view categorized in notes client. need filter data view value selected combobox, have limited data single category adding parameter categoryfilter :" filter category name". the problem display of filtered view takes lot of times appears me time error message. n.b: history view voluminous. can 1 me please fix problem. thank you. @modified : 29/07/2016 when use filter column value : have first document filter column value but when use filter category name : have complete result filter category name use " filter column value " instead of "filter category name". your source code should then: <xp:viewpanel ... <xp:this.data> <xp:dominoview var="view1" viewname=... keys="#{javascript:sessionscope.categorykey}"> </xp:dominoview> </xp:this.data

jquery - Add images in select dropdown box -

i trying add small images options in drop down box in form, rather text. works in firefox (but nobody uses firefox anymore right?!) need way chrome primarily. keep coming across ddslick thing cannot download site want alternate method. appreciated! html: select#severity option[value="minor"] { background: url(../assets/constants/minor.png); } select#severity option[value="moderate"] { background: url(../assets/constants/moderate.png); } select#severity option[value="major"] { background: url(../assets/constants/major.png); } <div class="variables"> <select name="severity" id="severity" class="icon-menu"> <option value="severity" selected disabled>please select</option> <option value="minor">minor</option> <option value="moderate">moderate</option> <option value="major">majo

java - Mapping all the classes in hibernate.cfg.xml with just one line? -

i'm bit lazy , i'm trying find single liner map classes in hibernate.cfg.config . (i'm using annotations not xml file) what i've tried : <mapping class="my_group.my_artifact.*"></mapping> can acheived using 1 line of code? i've looked other answers on didn't find lazy way fits me, , i'm new i'll appreciate helpful comment. you can't using hibernate only. you can use spring org.springframework.orm.hibernate5.localsessionfactorybean (package hibernate5 hibernate 5, change if need) or additional libraries described here: hibernate config not list entities in xml

javascript - Select2 displays bold text correctly, but when typing, bold becomes the html tag -

i using select2 dropdown, , templateresult function using when defining dropdown, in order apply formatting results: templateresult : function (item) { if (item.loading) { return item.text; } var term = query.term || ''; var $result = markmatch('<span class="boldwrap">' + item.text.substring(0, item.text.indexof(":")) + '</span>' + item.text.substring(item.text.indexof(":")), term); return $result; } the markmatch function have in there, refers function have defined somewhere else, highlights search results type. works , highlights expected. my problem bold text $result supposed return. it works fine , when opening select menu, see first words (up symbol ":") showing in bold. the problem when start typing in search area of menu, bold text goes away , can see html tag <span class... etc... how can do, bold

android - disable heads up notification for a specific app using adb -

i know can disable heads notification apps using : adb shell settings put global heads_up_notifications_enabled 0 and block or unblock notification using : adb shell service call notification 6 s16 \"package\" i32 uid i32 0/1 now how can disable/enable heads notification specific app android 6.0

typescript - Route with children cannot be match, when navigating to it -

good day. can't understand how new routes children work in angular 2 rc 4. want route testcomponent , have child, error " cannot match route 'test' " appear. routing way: this.guide.navigate(['test']); . how declare routes: const routes: routerconfig = [ { path: '', component: logincomponent }, { path: 'pin', component: pincomponent, }, { path: 'test', component: testcomponent, children: [ { path: '/:page', component: foodcomponent } ] } ] export const mainrouterproviders = [ providerouter(routes) ]; i cannot use page default in test (like "path: '/'") because children tabs , list loading in testcomponent's constructor. there few things add pathmatch: 'full', first route, otherwise example /ping search child route ping in logincomponent add

monitor - How do we set docker containers to restart on reboot and on-failure? -

i docker containers come up on host reboot or when docker restarted on host on failure maximum retries . i aware docker restart policies unless-stopped , always in same direction want them fail after maximum retries. thinking of below steps solution no restart policy on docker containers systemd-docker restart containers on-failure , enabled on reboot. is there better way this? i docker containers come on host reboot or when docker restarted on host this not complete answer, know docker 1.12 add daemonless container mode ( pr 23213 ): daemonless containers starting docker 1.12 containers can run without docker or containerd running. allows docker daemon exit, upgraded, or recover crash without affecting running containers on system. to enable functionality need add --live-restore flag when launching dockerd . ensure docker not kill containers on graceful shutdown or on restart leaving containers running.

javascript - view icon(ex. eye icon ) on click of a link -

i want display eye icon after click on link. eg. have job listings , saw 1 post , clicked view details after should show icon tells me visited post , have store viewed posts in collection , retrieve. have tried show eye icon on click when refresh page it's not displaying. how fix it? can me out that. in advance. here sample html trying <div id="search"><h2><a href="#">clinical psychologist </a><span class="job-type part-time">part time</span></h2></div> <div id="eyeicon"> <span class="glyphicon glyphicon-eye-open"></span> </div> and js $(document).ready(function(){ $("#eyeicon").hide(); $("#search").click(function(){ $("#eyeicon").show(); }); }); your question has not simple jquery answer. javascript variables or changes javascript in dom (html) not stored. need way store items can

heredoc - Writing a bash script from bash script. Lines without interpretation -

i want create bash script bash script. problem doing old echo style (example echo -e "some commands" > /path/to/file.sh) commands interpreted , substituted values. googling found solution on forum: generating bash script bash script there, use: cat >/path/to/file.sh <<'eof' commands eof if mini-script this, works... problem while try integrate in big script... basic "some commands"... generates error: warning: here-document @ line xxxx delimited end-of-file (wanted `eof') ./myscript.sh: line xxxx: syntax error: unexpected end of file what doing wrong? can't used inside functions or what's point of error... i'm not sure of being understanding error tries say. thank you. the end delimiter here-document needs flush left, no indentation whatsoever, regardless of whether occurs in function or elsewhere. indentation allowed, tabs, if here-document started <<-word rather <<word (any initial t

android - Wrong Fragment Picked using View Pager -

i have 3 different fragments show using view pager. have added fragment adapter follows. title shown correct on click picking wrong fragment private void setupviewpager(viewpager viewpager) { viewpageradapter adapter = new viewpageradapter(getsupportfragmentmanager()); adapter.addfragment(new acceptsfragment(), "accepts"); adapter.addfragment(new askedfragment(), "asked"); adapter.addfragment(new helpedfragment(), "helped"); viewpager.setadapter(adapter); } here adapter implementation. class viewpageradapter extends fragmentpageradapter { private final list<fragment> mfragmentlist = new arraylist<>(); private final list<string> mfragmenttitlelist = new arraylist<>(); public viewpageradapter(fragmentmanager manager) { super(manager); } @override public fragment getitem(int position) { log.d("fragment

How to use shared memory in android native code? -

i porting existing linux application android. application using shared memory api's shm_open() etc. checking bionic in android source , see these api's not supported. hence linking error during build. external/l2/avbtp.c:138: error: undefined reference 'shm_open' external/l2/avbtp.c:151: error: undefined reference 'shm_unlink' external/l2/avbtp.c:186: error: undefined reference 'shm_unlink' how resolve correctly? android intentionally doesn't provide sysv ipc . try avoid using of shared memory or, if want, examples of using ashmem .

For Swift, is Double? the same as Optional<Double>? -

var title: double? = nil var title2 = optional<double>.none the 2 things above seem both behave optional doubles. when hold option , click on title , title2 , shows have different types. 1 double? , other optional<double> . i'm wondering if theres difference between two. , if aren't different, why have 2 of them? optional objective c thing got transferred on swift or something? there no difference, , there nothing special double here. for any type t , t? (compiler built-in) shortcut optional<t> . so var value: t? var value: optional<t> are equivalent. optional conforms nilliteralconvertible protocol, i.e. value can instantiated literal nil , and var value: t? = nil var value: t? = .none var value: t? = optional.none var value: t? = optional<t>.none var value: t? = t?.none are equivalent. in first 3 statements, type optional<t> of value on right-hand side inferred type annotation on left-hand side. last

python - XML to pandas: Export to csv and make the childrens in same row -

i in "munging stage", trying convert xml file csv pandas. did code bellow: for element in etree.iterparse(path): data.append({element.tag: element.text}) df = pd.dataframe(data,columns=['nome_distrito', 'nr_cpe', 'marca_equipamento', 'nr_equipamento','valor_leitura','registador', 'tipo_registador','tipo_dados_recolhidos','factor_multiplicativo_final', 'nr_digitos_inteiro','unidade_medida','tipo_leitura','motivo_leitura', 'estado_leitura','data_leitura','hora_leitura']) df.to_csv('/lecture.csv') this xml file: <distrito xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <nome_distrito>braganca</nome_distrito> <cpe> <nr_cpe>pt000200003724&

java - How to search a full phrase along with single terms using Hibernate Lucene? -

earlier searching "father david azrael". returns results names term father or david or azrael. following code in picture: string[] fields = { "id", "person.firstname", "person.middlename", "person.lastname" }; (string field : fields) { (string match : pattern) { bool.should(qb.keyword().wildcard().onfield(field).matching(match).createquery()); } } query = bool.createquery(); along above scenario, there additional requirement if end user want search "father david azrael"; should 1 result only. means if search "father david azrael"; results having name should appears if user search "father azrael" should work working now. so changes need done above code implement same? you can use phrase query, shown in section 5.1.2.4 of documentation: bool.should(qb .phrase() .onfield(field) .sentence("father david azra

c# - Convert a String, which is already malformed -

i have class, uses class reads textfile. textfile written in ascii or clear cp1525. background info: the textfile generated in axapta , uses asciiio class writes text using writeraw method the class using collegue , using c# streamreader read files. works okay because files written in utf8, in particular case isn't. so streamreader reads file utf8 , passes read string me. have letters, example lating small letter o diaeresis (ö) aren't formated need them be. a simple convert of string doesn't in case , can't figure out how can right letters. so how reads it: char quotationchar = '"'; string line = ""; using (streamreader reader = new streamreader(filename)) { if((line = reader.readline()) != null) { line = line.replace(quotationchar.tostring(), ""); } } return line; what happens is, in textfile have german word "röhre" which, after reading streamreader, transforms r�hre (which looks stupid

buffer overflow - C++ code exploit -

i learning basic buffer overflow issues, can please explain how code can exploited. char gwelcome [] = "welcome our system! "; void echo (int fd) { int len; char name [64], reply [128]; len = strlen (gwelcome); memcpy (reply, gwelcome, len); /* copy welcome string reply */ write_to_socket (fd, "type name: "); /* prompt client name */ read (fd, name, 128); /* read name socket */ /* copy name reply buffer (starting @ offet len, * won't overwrite welcome message copied earlier). */ memcpy (reply+len, name, 64); write (fd, reply, len + 64); return; } void server (int socketfd) { while (1) echo (socketfd); }

python - Check GitHub credentials validity -

i trying verify github credentials python. i have tried this: import urllib2, base64 username = "test@example.com" password = "password" request = urllib2.request("https://github.com/") base64string = base64.encodestring('%s:%s' % (username, password)).replace('\n', '') request.add_header("authorization", "basic %s" % base64string) result = urllib2.urlopen(request) if result.code == 200: print "success" else: print "error" but returns success , wrong password. doing wrong? change line request = urllib2.request("https://github.com/") to request = urllib2.request("https://api.github.com/") try change credentials. working me. tested on ~/ $ python2 --version python 2.7.6 ~/ $ uname -a linux wlysenko-aspire 3.13.0-37-generic #64-ubuntu smp mon sep 22 21:28:38 utc 2014 x86_64 x86_64 x86_64 gnu/linux

android - By running the App on versions below 22 Changes some views? -

Image
i developing app minsdkversion 11, targetsdkversion 23 , compile/build tool version 23. on android versions, 5 , 6 app works fine, installing app on versions below 22 modifies layouts, buttons , text fields disappear or color changes, me this. manifest file <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.khan.bilal.salamrides2"> <application android:allowbackup="true" android:icon="@mipmap/cc" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> styles file <resources> <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="android:windownotitle">true</item> <item name="colorprimary">@color/colorprimary</item>

c++ - Forcing QGraphicsItem to use z value and ignore the parent child relationship -

i have problem using qgraphicsitem class. there base_parent, base_part, part_1, part_2. base_parent parent of base_part. part_1 , part_2 children of base_part. want set z value of items in way part_1 , part_2 stack behind base_parent , base_part stacks in front of base_parent. i've implemented this: base_part->setparentitem(base_parent); part_1->setparentitem(base_part); part_2->setparentitem(base_part); at first tried setting z value using setzvalue() didn't work. base_parent->setzvalue(0); base_part->setzvalue(1); part_1->setzvalue(-1); part_2->setzvalue(-2); in documentation said that: an item's children stacked on top of parent i giving saw parameter. you can call setzvalue() on item explicitly stack on top of, or under, other sibling items. default z value item 0. items same z value stacked insertion order. you can call stackbefore() reorder list of children. directly modify insertion order. you

java - Mockito Junit testcoverage removal of unit test coverge -

hi have done unit testing entire project using mockito framework. project on java spring rest project. coverage below 35%. need improve unit testing coverage. 1. want remove unneccesay package code coverage, test packages , beans class 2. need write unit test case controller class , generated class tools. i grateful, if can me. test classes , packages not counted in test coverage, if were, how test code tests code etc.. when run coverage should run on src/main/java etc. controller classes should tested, when call method, correct delegated class , method called? generated classes, if xml using jaxb etc not need explicitly tested if plain old java objects getter, setters , fields. it's tested via class uses these objects , calls methods. these classes generated/compiled before tests run available- make sure aren't committing generated classes code repository. you may want consider testing behaviour of third party libraries depend on. way can instantly see i

java - How to serve static content in spring mvc? -

i using spring-mvc framework in current project. root folder has lots of web folders containing html, jsp, css, js etc. spring mvc configuration follows: <context:annotation-config /> <bean id="comiccontrollerbean" class="tv.cinemacraft.videogramwebapp.springmvc.controllers.comiccontroller" /> <bean id="dashboardcontrollerbean" class="tv.cinemacraft.videogramwebapp.springmvc.controllers.dashboardcontroller" /> <bean id="genericcontrollerbean" class="tv.cinemacraft.videogramwebapp.springmvc.controllers.genericcontroller" /> <bean id="channelcontrollerbean" class="tv.cinemacraft.videogramwebapp.springmvc.controllers.channelcontroller" /> <!-- <context:component-scan base-package="tv.cinemacraft.videogramwebapp.springmvc.controllers" /> --> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver&

nginx - Consul and registrator add port to service name -

i run consul , registrator container on same machine using docker docker-compose . in same file nginx service started. however, nginx registered in consul name nginx-80 . have nginx name. ideas? btw: replace nginx arbitrary service. as stated issue, happens when docker exposes more 1 port. though publish one. https://github.com/gliderlabs/registrator/issues/437

Gas with hyperledger Fabric? -

with ethereum, gas anti-denial of service measure. equivalent in hyperledger fabric avoid abuse of chaincode invocation transactions ( invoke )? nvp expected check abuse? from understood, there no need such gas system in hyperledger fabric. the blockchain supposed work in "private" mode, meaning know other peers in network. easy detect malicious peer , revoke access. also, there no "mining" process, consensus rules triggered each incoming transaction. results in lighter block generation process compared bitcoin or ethereum example. however, can still implement own custom gas system chaincode add kind of "transaction fee" before validating invoke transaction, don't think possible "mine" gas in current state of project.

sitecore8 - How to check if Context.Item is uCommerce item or Sitecore item -

i developing language switch sitecore-ucommerce solution , using default ucommerce item resolver , urlservice nice urls. have urls http://sitename/catalogname/productname/c-xx/p-yy . then every sitecore 'page' item use linkmanager.getitemurl(context.item, options) languageembedding.always option. now, if context.item ucommerce item, url http://sitename/nl/sitecore/ucommerce/products/3/34/productname/ , not caught ucommerce item resolver , have document not found error. so need check before if context.item ucommerce item , use urlservice instead of linkmanager. question: there in ucommerce class templateids similar sitecore.templateids? way check if item derives base ucommerce product template. related question: how can embed language in ucommerce nice urls? here httprequestbegin pipeline <httprequestbegin> <processor type="sitecore.pipelines.preprocessrequest.checkignoreflag, sitecore.kernel"/> <processor type="sitecore.pi

jquery - Customize tool tip in highchart -

i want customize tooltip functionality in highchart. have bar chart , on hover tooltip showing 1 value right now, wanted show 3 value. below code : $(function () { $('#container').highcharts({ chart: { type: 'bar' }, title: { text: '' }, subtitle: { }, xaxis: { categories: ['question\'s'], title: { text: '' } }, yaxis: { min: 0, title: { text: 'average scores', }, labels: { overflow: 'justify' } }, tooltip: { valuesuffix: '' }, plotoptions: { bar: { datalabels: {

html - Hide scrollbar in div with 100vh -

i having great deal of trouble scrollbar in new portfolio . as can see, layout divided 2 columns, content on left side. want able scroll, need scrollbar hidden. have tried following code, didn't work. don't know if it's problem, use 100vh setting? example of tried .parent{ height: 100vh; overflow: hidden; } .child{ overflow-y: scroll; } my html <div class="slider"> <ul class="slides"> <li class="container-fluid content"> <div class="row row-eq-height"> <div class="col-sm-6 static"> <div class="text"> <div class="vertical"> <p>content</p> </div> </div> </div> <div class="col-sm-6 overflow-hidden"> <div class="image personal"&g

android - Toolbar is clipped underneath the system bar -

Image
as found on internet use translucent system bar, coordinatorlayoutwith appbarlayoutand toolbar. scrolling nestedscrollviewmoves toolbar top, underneath systembar, pixels left behind. looks quite ugly: so here comes details: compilesdkversion 23 buildtoolsversion "23.0.3" minsdkversion 21 targetsdkversion 23 'com.android.support:appcompat-v7:23.4.0' 'com.android.support:design:23.4.0' styles: <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <item name="colorprimary">@android:color/transparent</item> <item name="colorprimarydark">@android:color/transparent</item> <item name="coloraccent">#22ddaa</item> <item name="colorcontrolnormal">#ffffff</item> <item name="windowactionbar">false</item> <item name="windownotitle">true

osx - Listbox equivalent in Swift -

is there equivalent tkinter listbox widget (or of other language) in swift? tried nsdocumentview, apparently not thought want. yes, can use uitableview. each row represented uitableviewcell.

node.js - Nodejs - Getting Error in babel loader when i initiate npm start -

getting error: error in multi main module not found: error: cannot resolve module 'react' in c:\users\username\deskto p\reactapp @ multi main module.exports = config; var config = { entry: './main.js', output: { path:'./', filename: 'index.js', }, devserver: { inline: true, port: 8080 }, module: { loaders: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'react', query: { presets: ['es2015', 'react'] } }] } } node version - 4.4.7 npm version - 3.10.5 babel loaded globally npm install -g babel npm install -g babel-preset-react you can try changing loader 'babel' module.exports = config; var config = { entry: './main.js', output: { path:'./', filename: 'index.js', }, devserver: {

html - Vertically align glyphicons in a jumbotron -

i have created jumbotron , on left have text on left , text glyphicons right. while text on left vertically aligned middle, text on right along glyphicon below jumbotron. here html code:- <div class="jumbotron" > <div class="container-fluid text-left" style="padding-left:4px;"> <p style="color:#f8921e">text</p> <ul style="list-style-type:none "> <li><a class="glyph" href="#"> <span class="glyphicon glyphicon-cog"></span> settings</a></li> <li><a class="glyph" href="#"> <span class="glyphicon glyphicon-log-out"></span> logout</a></li> </ul> </div> </div> this css code:- .jumbotron { width:100%; color: #f8921e; top:0; paddin

Reverse reading via regex or grabbing last match with no tail -

i need grab 2 character letter , numbers after that: what want is: ab 12 cd-12345-67 -> cd-12345 ab12 cd 12345-67 -> cd 12345 ab-12cd12345-6 -> cd12345 abc1234556 -> no match, 2 character letter , numbers after that. abc-1234556 -> no match, 2 character letter , numbers after that. a1-bc-12d345-56 -> no match, after 2 characters letter, numbers must come i used regex [a-z]{2}[ |\-]?\d+ which grabs cd-12345 , ab 12, in first example. need cd-12345. grabs bc1234556,bc-1234556, bc-12 in last 3 example don't want. sometimes, space,no space or - character placed between numbers , letters block. thank much. based on posted ^.*(?<![a-z])([a-z]{2}[- ]?\d++)(?![a-z]) demo

visual studio - How to set XAML Design View to be on right by default? -

Image
when set split orientation vertical xaml designer in visual studio, design view positioned on left. is possible make on right default?

java - Extending and returning values over classes -

i having trouble getting values 2 sub-class. how return values main program 2 other class? classes have hierarchy , cat.java extends animal.java. able values animal class not extended cat class. doing wrong? main program import java.util.*; public class animalproject { private static scanner input = new scanner(system.in); public static void main(string[] args) { system.out.println("welcome create own animal."); system.out.println("start typing name animal: "); string name = input.next(); animal newanimal = new animal(name, 0); system.out.println("new animal created"); system.out.println("set state of animal: [1] alive. [2] dead. "); int status = input.nextint(); newanimal.animalstate(status); system.out.println("print name of animal? [1] yes [2] no "); int answer = input.nextint(); if (answer == 1) { newanimal.getname(); } system.out.printl

reporting services - SSRS: How to add data table on x-axis? -

ssrs : trying create a graph can have data-table on x-axis . how can achieve below graph? idea ? [image showing data. want values on y-axis , x-axis should contain multiple rows.] http://i.stack.imgur.com/dkchy.png no, can't put table in axis. there walk-around. create chart dates on x axis, table (matrix) below chart, have experiment width of column group (where dates sit) , location of table dates column in table align dates in x axis. , can hide dates in table, report looks picture shown. chart , table cab generated same of different data sets (depending on business rule).

configuration - Passing properties files to JBoss in IntelliJ -

as have been trying make switch eclipse intellij possible @ work, there. last issue running configuration of local jboss in intellij. in eclipse pass 3 properties files our jboss server, adding parameters program arguments (double-click jboss server in servers list -> in general information click open launch configuration ). specifically: -p="../standalone/configuration/my.properties" how can deploy these 3 files local jboss server in intellij? have tried passing them environment variables, no success.

ios - Inapppurchase Receipt -

i developing application non renewable subscriptions, working fine ios6, changed deployment target 7. transactionreceipt deprecated in ios6, move nsurl *receipturl = [[nsbundle mainbundle] appstorereceipturl]; nsdata *receipt = [nsdata datawithcontentsofurl:receipturl]; but returns nil receipt. encode data nil. please me resolve issue. thanks advance. you should appstore receipt, when notification purchased transaction received, check skpaymenttransactionobserver . - (void)paymentqueue:(skpaymentqueue *)queue updatedtransactions:(nsarray<skpaymenttransaction *> *)transactions non-renewable subscriptions aren't persistent in receipt , removed after transaction finished.

Kubernetes - not unique ip per pod -

i'm building 3 vm (centos 7) cluster of kubernetes 1.3.2. according kubernetes documentation page networking in kubernetes : “we give every pod own ip address” , there no port collision when few pods use same ports on same node. seen here, pods same ip addresses: [root@gloom kuber-test]# kubectl pods -o wide -l app=userloc name ready status restarts age ip node userloc-dep-857294609-0am9d 1/1 running 0 27m 172.17.0.5 157.244.150.86 userloc-dep-857294609-a4538 1/1 running 0 27m 172.17.0.7 157.244.150.96 userloc-dep-857294609-c4wzy 1/1 running 0 6h 172.17.0.3 157.244.150.86 userloc-dep-857294609-hbl9i 1/1 running 0 6h 172.17.0.5 157.244.150.96 userloc-dep-857294609-rpgyd 1/1 running 0 27m 172.17.0.5 157.244.150.198 userloc-dep-857294609-tnnho 1/1 running 0 6h 172.17.0.

javascript - Getting index of clicked list element -

how can index of clicked element in list? so if have following list: first second third when click third , index 2 , provided index starts 0 . with code 0 s: html: <ul> <li><a href="#" class="listelem">first</a></li> <li><a href="#" class="listelem">second</a></li> <li><a href="#" class="listelem">third</a></li> </ul> js: $(".listelem").click(function(param) { console.log($(this).index()); }); here fiddle . you should use parent() return index of li demo $(".listelem").click(function(param) { console.log($(this).parent().index()); });

excel - Downloading a .csv format file from a website -

i looking automate process @ work, has step requires me go website, download data csv format, , work , email out. have written set of macros of me, however, having trouble understanding how download data after navigating website (i see few tutorials given website in excel format). basically, navigate website, click drop-down menu, , pick export option. i have following script currently, , gets me correct page. need click on "export" button , ".csv" format button once page. have advice, solutions or tutorials can at? 'method open chrome, collect jira report , download folder sub getjirareport() dim chromepath string chromepath = """c:\program files (x86)\google\chrome\application\chrome.exe""" 'loads jira page report shell (chromepath & " -url https://companyname.atlassian.net/issues/? filter=10600") end sub

How could I write the right entry point in Spark 2.0 program (Actually pyspark 2.0)? -

today, wanna try new features spark2.0, here program: #coding:utf-8 pyspark.conf import sparkconf pyspark.sql import sparksession spark = sparksession.builder.master("local").appname('test 2.0').config(conf=sparkconf()).getorcreate() df = spark.read.json("/users/lyj/programs/apache/spark2/examples/src/main/resources/people.json") df.show() but errors follow: traceback (most recent call last): file "/users/lyj/programs/kiseliugit/mypysparkcodes/test/spark2.0.py", line 5, in <module> spark = sparksession.builder.master("local").appname('test 2.0').config(conf=sparkconf()).getorcreate() file "/users/lyj/programs/apache/spark2/python/pyspark/conf.py", line 104, in __init__ sparkcontext._ensure_initialized() file "/users/lyj/programs/apache/spark2/python/pyspark/context.py", line 243, in _ensure_initialized sparkcontext._gateway = gateway or launch_gateway() file "/users/lyj/programs/ap

c# - Mocking OpenXML with Moq -

how should test following getworksheetpart method: public class exceldocument : iexceldocument { private readonly string _filepath; public exceldocument(string filepath) { _filepath = filepath; } public worksheetpart getworksheetpart(ispreadsheetdocument exceldoc, string sheetname) { sheet sheet = exceldoc.getsheet(sheetname); if (sheet == null) { throw new argumentexception( string.format("no sheet named {0} found in spreadsheet {1}", sheetname, _filepath), "sheetname"); } return exceldoc.getpartbyid(sheet.id); } } where iexceldocument , wrapper's spreadsheetdocumentwrapper interfaces are: public interface iexceldocument { worksheetpart getworksheetpart(ispreadsheetdocument exceldoc, string sheetname); } public interface ispreadsheetdocument { sheet getsheet(string name); worksheetpart getpartbyid(string id); }