Posts

Showing posts from April, 2012

javascript - Login and Create Account HTML Forms in One Div -

i have 2 forms specified in 1 div. 1 login , other create account. login form works create account button gives login error though call create-account.php file. below have code. the login create / account forms <?php include('login.php'); // includes login script if(isset($_session['login_user'])){ header("location: index.php"); } ?> <!doctype html> <html> <head> <title>login</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="main"> <div id="login"> <h2>login form</h2> <form action="" method="post"> <label>username :</label> <input id="name" name="username" placeholder="username" type="text"> <label>password :</label> <input id="password" name="password" placeholder=&q

java - Merging two sorted Arraylists into one sorted Arraylist -

my code should merge 2 sorted arraylists 1 sorted arraylist , if 1 of arraylists used not sorted should return null. public class mergesorted { public static void merge(arraylist<integer> a, arraylist<integer> b) { (int = 0, j = 0; j < b.size(); i++) { if (i == a.size() || a.get(i) > a.get(j)) { a.add(i, b.get(j++)); } } } } this attempted can't idea of returning null if not equal, im new java , second week please patient me. know should have if statement checking if sorted , else should include inside if? the generic way this: public class mergesort { public static <t extends comparable<? super t>> list<t> merge(list<t> a, list<t> b) { if (!issorted(a) || !issorted(b)) { return null; } final list<t> result = new arraylist<t>(a.size() + b.size()); result.addall(a); result.addall(b); collections.sort(

html - page not render correctly some time -

my website developed in asp.net forms. problem sometime different page of website not render correctly. instead of correct page html of shows. for example: if open link http://www.mobilescorner.com/qmobile_mobile_prices rendered correctly. correct page displayed. but if open link http://www.mobilescorner.com/motorola_mobile_prices server not rendering page. server shown html (view source code) of page. if click on view source of html page again same opens. to solve issue: stop restart website on hosting server after every 3 4 days. unable figure out why happening. can body me sort out issue? thanks salman

android - How to keep informations in fragment after onBackPressed? -

i'm newbie in android , i'm working fragments. my problem: i have 2 fragments, "a" , "b", fragment "a" complex form, user can add , remove products, set customer information, payment method , more. fragment "b" show information user set in previous fragment. but if user press button, i'm losing information set in previous fragment. how can maintain informations on fragment a? thanks. you can save data using sharedpreferences so once fragment load data sharedpreferences

Snipmatch and Code Recommender plugin does not work together in the Window Builder editor in Eclipse -

Image
after installed snipmatch plugin eclipse mars, not see code assist proposals in eclipse. want see code proposals code recommenders plugin. usable. after installed plugin, can seen below. [ ] after hitting ctrl + space, can seen below. [ ] i not configure eclipse see proposals. way snipmatch plugin works in eclipse. how can correct ? i committer of code recommenders project. happens because of our change bug 470372 . in order prevent errors when working other java editors, disable code recommenders proposals editors other standard java editor. since installed newest version of snipmatch, updated newest version of code recommenders, includes change. in case, opened java file window builder, includes java editor. if open in standard java editor instead ( right click > open > java editor ) , try content assist, believe see proposals again. workaround disable code recommenders , use standard jdt proposals. won't give proposals percentages, @ least you&

concurrency - Dining philosophers in java -

today, decide try solve dining philosophers problem. write code below. think not correct, pleased if tells me wrong it. use forks locks ( read them, because of don't put access them in synchronized blocks), have class extends thread , keeps 2 locks. import java.util.random; public class eatingphilosophersproblem { private final static random random = new random(); /** * * @author damyan class represents eating of every philosopher. * represents infinity cycle of eating. */ private static class philosophereating extends thread { int forkone; int forktwo; public philosophereating(string name, int forkone, int forktwo) { super(name); this.forkone = forkone; this.forktwo = forktwo; } @override public void run() { super.run(); while (true) { requirelock(this, forkone, forktwo); } } } private static boolean[] forks = new boolean[] { new boolean(true), new boolean(true), new

javascript - Fade In/out div elements when a # anchor is clicked -

i trying different divs fade in , out when click image <a href> in , # make fade in , out. can not fade in , out no matter try. code: $(document).ready(function () { $("input[type='checkbox']").change(function () { var state = $(this).val(); $("#" + state).toggleclass("overlay"); }); $('#triggerbutton').click(function (e) { e.preventdefault(); $('#firstscreen').fadeout('fast', function () { $('#casualshirt').fadein('fast'); }); }); }); body { margin: 0; padding: 0; } #background { left: 0px; top: 0px; position: relative; margin-left: auto; margin-right: auto; width: 600px; height: 800px; overflow: hidden; z-index:0; } #background { left: 0px; top: 0px; position: absolute; width: 600px; height: 800px;

visual studio - Enable PUT and DELETE requests in ASP.NET MVC app for Windows 10? -

i have asp.net mvc website (4.5). try run application under visual studio 2015 , "page not found" exception on put , delete requests. how enable these requests? if want solution, in solution root .vs\config folder , applicationhost.config file. in file need add put , delete verbs extensionlessurl-integrated-4.0 module, that <add name="extensionlessurl-integrated-4.0" path="*." verb="get,head,post,debug,put,delete" type="system.web.handlers.transferrequesthandler" precondition="integratedmode,runtimeversionv4.0" responsebufferlimit="0" /> however think there should nicer way via ui, don't have win 10 installed can't check now. if 1 else tell how.

wordpress - javascript for stopped working -

this how script appeared in wordpress visual editor , database. has been working fine until pm. if (xmlhttp.readystate==4) { if ( xmlhttp.status==200) { document.getelementbyid("droptargethere").innerhtml=xmlhttp.responsetext; var svg = document.getelementbyid("droptargethere").childnodes; for(var = 0; < svg.length; i++) { var element = svg[i]; if (element.localname == "div") { var rect = element.offsettop; var retid = element.id; updtable (retid , rect , "../wp-admin/custom/"); } } } but viewing source in browser looks this, corrupted. after statement 1 continuous line. if (xmlhttp.readystate==4) { if ( xmlhttp.status==200) { document.getelementbyid("droptargethere").innerhtml=xmlhttp.responsetext; var svg = document.getelementbyid("droptargethere").childnodes; for(var = 0; < svg.leng

oracle - Using a pl-sql procedure or cursor to select top 3 rank -

can please tell how can results below. using dense_rank function rank <=2 give me top 2 offers. i looking 'total_offer' should sum of 'offer1' , 'offer2'. when there no offer2 ( eg:taurus) 'total offer' should 'offer1' , 'null' 'offer2' input: customer make zipcode offer mark focus 101 250 mark focus 101 2500 mark focus 101 1000 mark focus 101 1500 henry 520i 21405 500 henry 520i 21405 100 henry 520i 21405 750 henry 520i 21405 100 mark taurus 48360 250 mark mustang 730 500 mark mustang 730 1000 mark mustang 730 1250 desired output: | customer | make | zipcode | top_offer1 | top_offer2 | total_offer | | henry | 520i | 21405 | 750 | 500 | 1250 | mark | focus | 101 | 2500 | 1500 | 4000 | mark | mustang | 730 | 1250 | 1000 | 2250 | mark | taurus |

ruby on rails - Vagrant+Ansible+Redis - Get 127.0.0.1:6379 (Errno::ECONNREFUSED) when using different servers -

hope well. have following problem , hoping me out: i'm trying deploy rails 4 app using vagrant , ansible. part of app redis server. have set , running @ 192.168.33.2:6379 , rails app running @ 192.168.33.4 , running on ubuntu + nginx. even-though have redis set redis-rb (gem in app) , initialize redis object in 1 of initializers app global vars initiated yaml file: $redis = redis.new(:driver => :hiredis, :host => app_config[:redis_host], :port => app_config[:redis_port]) with app_config[:redis_host] = 192.168.33.2, app_config[:redis_port] = 6379 and bind 0.0.0.0 in redis.conf file, still receive error error connecting redis on 127.0.0.1:6379 (errno::econnrefused) when go rails app in browser. running redis-cli -h 192.168.33.2 ping when vagrant ssh-ed 192.168.33.4 returns pong . connections can made , can reach redis server / see keys 192.168.33.4 ... also running netstat -l in terminal gives me: tcp 00 *:6379 *:* listen does know how can fix probl

Syntax error due to using a reserved word as a table or column name in MySQL -

i'm trying execute simple mysql query below: insert user_details (username, location, key) values ('tim', 'florida', 42) but i'm getting following error: you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'key) values ('tim', 'florida', 42)' @ line 1 how can fix issue? the problem in mysql, words select , insert , delete etc. reserved words. since have special meaning, mysql treats syntax error whenever use them table name, column name, or other kind of identifier - unless surround identifier backticks. as noted in official docs, in section 10.2 schema object names (emphasis added): certain objects within mysql, including database, table, index, column, alias, view, stored procedure, partition, tablespace, , other object names known identifiers . ... if identifier contains special characters or reserved word , must quote whenever refer it.

ios - HKWorkoutSession: Not getting Heart Rate when screen is turned off in watchOS 2 -

i using ios 9 beta 4 , watchos 2 beta 4. i can't seem heart rate data when watch screen turns black (locks). call applicationwillresignactive , heart rate data stops. it seems sensor deactivating after time (not green anymore), when screen locks. anyone else seeing behavior? can post code initing workoutsession if else getting heart rate data when screen on watch locked. starting in watchos 3.0 can add wkbackgroundmodes entry workout-processing value extension's info.plist. from docs : running in background workout sessions can run in background. background running grants app following abilities: the app continues run throughout entire workout session, when user lowers wrist or interacts different app. when user raises wrist, app reappears, letting user , check current progress , performance. the app can continue access data apple watch’s sensors in background, letting keep app date @ times. example, running app can continue t

javascript - Mismatched anonymous define() module -

i'm getting error when browse webapp first time (usually in browser disabled cache). error: mismatched anonymous define() module: function (require) { html : <html> . . . <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script> var require = { urlargs: "v=0.4.1.32" }; </script> <script data-main="assets/js/main" src="assets/js/libs/require.js"></script> <script src="assets/js/ace/ace.js?v=0.4.1.32"></script> </body> </html> js : $(function () { define(function (require) { // }); }); anyway know error mean , why happening? source file , short discussion in github issues page like alienwebguy said, per docs, require.js can blow up if you have anonymous define (" modules call define() no string id ") in own script tag (i assume mean anywhere in global

ios - How to change current text in text field from another view at runtime -

i have storyboard this . my question how i, when log button pressed, example, add "log(" text field in main view? can accomplish opening new view updated text field via segues, need keep both current views open , update text without showing new view. in advance! you should read bit delegation: https://developer.apple.com/library/ios/documentation/general/conceptual/devpedia-cocoacore/delegation.html nevertheless set quick demo project you. hope helps: https://www.dropbox.com/sh/50cosenyi3u26s8/aaa3ktjyvimuk02oel4bhjska?dl=0

php anonymous function parameters -

i'm trying understand anonymous functions in php (laravel framework) , searched basic question here didn't find answer. echo preg_replace_callback('~-([a-z])~', function ($match) { return strtoupper($match[1]); }, 'hello-world'); // outputs helloworld what parameters gone inside anonymous function ?? route::match(['get', 'post'], '/', function () { return 'hello world'; }); http://php.net/preg_replace_callback a callback called , passed array of matched elements in subject string. callback should return replacement string. callback signature: so sends in array of matches.

POST update to Twitter using Oauth and HTTR, R -

i trying post update twitter using api. following steps @ https://github.com/hadley/httr/blob/master/demo/oauth1-twitter.r , can get call work, haven't managed post work. here relevant code: library(httr) library(httpuv) oauth_endpoints("twitter") myapp <- oauth_app("twitter", key = "key" secret = "secret" ) twitter_token <- oauth1.0_token(oauth_endpoints("twitter"), myapp) #this works fine req <- get("https://api.twitter.com/1.1/statuses/home_timeline.json", config(token = twitter_token)) #this doesn't work. returns error 403: status forbidden post(url = "https://api.twitter.com/1.1/statuses/update.json", body = "test", config(token = twitter_token) ) any solution allows status update (tweet) r acceptable. the docs need pass parameter status query parameter, not in body, makes sense b/c can 140 characters long anyway. post("https:/

screenshot - Android screen shot -

i wanted take screen shots android screen floating button. made floating button , takes screen shots , works there 2 questions 1. how can app take screenshot in way floating button gets hidden appears after screen shot has been taken in order not bother user 2. when press volume down , power key take screenshot, has great animation. how can add animation? get button's view, , before taking screenshot, hide , unhide after done taking screenshot in floating button's onclick method. findviewbyid(r.id.floating_button).setvisibility(view.invisible); // take screenshot here findviewbyid(r.id.floating_button).setvisibility(view.visible);

Does Guice binding bind subclass as well? -

so have module binds interface implementation class. bind(ilocalstore.class).to(localstore.class); will binding inject following constructor: @inject public localstoreuser(localstore localstore) { this.localstore = localstore } the injection work, not because of binding. guice treats lookups if simple map<key, provider> lookup, key composed of (binding annotation, parameterized type) pair. guice not automatically walk type hierarchy you, or otherwise modify lookup key (checking non-annotated or raw type binding, instance). however, if localstore has public no-argument constructor, guice can create type directly, code above work—it has nothing binding subclasses automatically. consider following example: interface {} interface b extends {} public class c implements b {} without bindings @ all, inject c, because has implicit public no-arg constructor. requesting injection of or b fail. if bind(a.class).to(c.class) inject (explicit) or c (impli

c - detecting no argument with getopt_long -

how detect user passed no arguments program getopt_long? detect user calling program no arguments checking argc, user calling program dash? $ my_prog - do need include option somehow in getopt statement? while(ca = getopt_long(argc, argv, "abc:d:",...) what function return? you can use optind variable determine such arguments: the variable optind index of next element of argv[] vector processed. shall initialized 1 system, , getopt() shall update when finishes each element of argv[]. for example, for(int = optind; < argc; i++) printf("unknown argument: %s\n", argv[i]); you can after argument processing find out if there such unexpected arguments.

variables - In R, using the vars package doing a VAR model, how to specify one specific lag within the p argument? -

i developing var model using quarterly data vars package. specify autoregressors, var function within package gives have 2 choices. can either let r select best lags maximum set using 'lag.max.' in case, given have quarterly data set @ 4. however, unclear how function selects best lags way. seems every time way, r appears select first 3 quarterly lags. theory , practice suggests lag 4 better others because picks seasonality (quarterly data). now, other way specify lags use "p" argument. so, if state p = 1. 1st lag. but, if p = 4; won't 4th lag (the 1 want). instead, 4 lags 4th 1 (lag 1, lag 2, lag 3, lag 4). how can specify using lag 4? not possible, because braking actual structure of var models? you can use restrict function in vars package model want. > library(vars) # example > data(canada) > var.u <- var(canada, p = 4) # first unrestricted var > > # building restriction matrix lag 4 > resmat <- bcoef(

ecmascript 6 - ES6 Class, extending Ractive -

i'm using es6 (via babel), , looking "proper" way define class extends ractive (without calling ractive.extend(...) if possible), since ractive allows new ( http://docs.ractivejs.org/latest/new-ractive ). tried following approach, seems work: class home extends ractive { constructor() { super(); this.template = "<h1>{{message}}</h1>"; } data() { return { message: 'this sample data' } } oninit() { console.log('ok'); } } ractive instance initialized without error, , oninit called, template seems undefined. i start using syntax well. :) but spent hour month ago trying see if hackable, concluded it's not possible due how of component extension works. it's on our radar , should land in near-future version.

google spreadsheet - Dividing a value between non-equal rows in order to balance them -

i have spreadsheet that's structured like: section total incoming new total ak 56,445 2,655 59,100 al 58,304 796 59,100 b 55,524 3,576 59,100 c 54,272 4,828 59,100 d 53,956 5,144 59,100 s 59,161 0 59,161 - generated pts 16,999 i'm trying automate "incoming" column. goal of sheet balance totals closely possible distributing generated pts between each row until no more points remain, ensuring lowest totals increased first higher values aren't increased while lower values exist. is possible in spreadsheet? suggestions on how done? i made attempt @ custom function. 2 parameters passed: range corresponding total column, , cell containing generated pts. incoming array returned. function distribute(range, value) { var indexedrange = range.map(function (e, index) {return [e[0], e[

Mongodb: Aggregation : sum up values in an array before $group -

i have collection of documents following structure: { _id: 1, array: [ {value: 10 }, {value: 11 }, {value: 12 } ] } i want make aggregate query on collection: proportion of each item. (i.e. example proportion of item 1 value of item 1 divided sum of values of 3 items. note: want within single query. the basic idea here $unwind array, $group document , apply each array member. works better mongodb 2.6 or greater due $map operator: db.collection.aggregate([ { "$unwind": "$array" }, { "$group": { "_id": "$_id", "array": { "$push": "$array" }, "total": { "$sum": "$array.value" } }}, { "$project": { "array": { "$map": { "input": "$array", "as": "el",

google app engine - python SAML in GAE -

is there library can use saml authentication in app engine using python? i've looked @ pysaml2 it's pure python implementation. however, it's using subprocess.popen cannot used within app engine , fail @ point. you can use python-saml on gae if use flex environment custom runtime built off of standard python27 runtime provided google . got onelogin's python-saml flask-demo working approach using following settings: dockerfile: from gcr.io/google_appengine/python label python_version=python run virtualenv /env -p python # install system packages onelogin dependencies not included in runtime run apt-get update && apt-get --yes --quiet install python2.7-dev libxmlsec1-dev # set virtualenv environment variables. equivalent running # source /env/bin/activate env virtual_env /env env path /env/bin:$path add requirements.txt /app/ run pip install -r requirements.txt add . /app/ cmd python index.py app.yaml runtime: custom env: flex entrypoi

html - img srcset and sizes not working as I would expect -

i trying make better responsive images on site. after research found the srcset , sizes attributes. my goal here following: when screen size above 600px or below 300px want serve 250x250 image when between these 2 values want serve 350x350 image also want higher resolution images screens have higher pixel ratio this came with. not working though would. small 250x250 being served. <img src="https://placehold.it/250" srcset="https://placehold.it/700 700w, https://placehold.it/500 500w, https://placehold.it/350 350w, https://placehold.it/250 250w" sizes="((max-width: 600px) , (min-width: 300px) , (min-resolution: 2)) 350px, (min-resolution: 2) 250px, ((max-width: 600px) , (min-width: 300px)) 350px, 250px" /> and have 1 additional question: in tests found out browser won't load new images when window resized different image should served. possible that? ok. after tidious research found out did not understand sizes -

How to compile and run java source code in memory -

this question has answer here: compile code in memory javax.tools.javacompiler [duplicate] 7 answers i want treat string java file compile , run it. in other words, use java script language. to better performance, should avoid writing .class files disk. this answer 1 of blogs, compile , run java source code in memory . here 3 source code files. memoryjavacompiler.java package me.soulmachine.compiler; import java.io.ioexception; import java.io.printwriter; import java.io.writer; import java.lang.reflect.method; import java.util.arraylist; import java.util.list; import java.util.map; import javax.tools.*; /** * simple interface java compiler using jsr 199 compiler api. */ public class memoryjavacompiler { private javax.tools.javacompiler tool; private standardjavafilemanager stdmanager; public memoryjavacompiler() { tool = to

php - How to check if there is an added record on the database -

i have here index.php. contains layout , php code inside it. want know if there new record on database. research needs refreshed. tried javascript auto refresh , whole page refreshes if there new records table automatically show new record. problem how know if there changes. able show if there update on database through refresh not able notify if there changes. want put notification if there new records. want know how check if there new records on database. here code. <div class="panel panel-default"> <div class ="panel-body"> <!-- table of reports --> <div align = "center" style = " font-size: 9000px"> <table class="table table-striped" name = "report"> <thead> <tr align = "center"class = "active" > <td class = "theads" >id</td> <td class = &

oauth - OAuth2 provider using Spring Security return accesstokens in json; Need to get Token in XML format -

i want write oauth2 provider return access token in xml not in json . using spring security (i.e. http://projects.spring.io/spring-security-oauth/docs/oauth2.html ) writing oauth2 provider. i followed tutorials on git not write provider can return response of /oauth/token in xml format. thanks in advance. this possible adding jaxb filters shown below

cocos2d iphone - What role does contentSize play in positioning and anchor points? -

i've read countless posts , articles on anchor points , affect on positioning, , yet still find myself in situations things make absolutely no sense. example: @interface displaytest : ccsprite; @property (nonatomic, strong) ccsprite *body; @end @implementation displaytest -(instancetype)init { if (self = [super initwithfile:@"test.png" rect:cgrectzero]) { self.position = ccp(384, 512); [self addchild:self.body]; self.body.scalex = 384; self.anchorpoint = ccp(0.5f, 0.5f); } return self; } -(ccsprite *)body { if (!_body) { cgrect rect = cgrectmake(1, 1, 1, 16); _body = [[ccsprite alloc] initwithtexture:self.texture rect:rect]; _body.anchorpoint = ccp(0.5f, 0.5f); } return _body; } i 384px wide, 16px high rectangle centered in screen. excellent.. now, let's want touch detection on object.. let's going have many other ccsprite children, , want perform touch d

ios - Sandbox environment asks for sign in twice -

i testing in-app purchases new version of our app, in-app purchase code tested before , working ok asks itunes sign-in twice before purchase confirmation alert. still works fine , purchases item correctly after double sign-in little bit disturbing. did have similar issue lately sandbox servers? to give more info actual transaction verification happens on our server, i'm using rmstore default dummy verification on client side, nothing checks if productid exists in app receipt, cool side refreshes app receipt if nil or productid not exist in receipt. there auto-renewing subscriptions in our app, , logout appstore before testing new purchase. this how code looks like: -(void) paymentqueue:(skpaymentqueue *)queue updatedtransactions:(nsarray *)transactions { (skpaymenttransaction * transaction in transactions) { switch (transaction.transactionstate) { case skpaymenttransactionstatepurchased: { rmstoreappreceiptverifi

boot2docker - Docker container not exposed on network -

i new docker. running on windows. trying container named "ghost" (available docker hub) work on windows 8.1 machine. while container starts correctly , supposedly exposes url @ http://localhost:2368 , when enter address nothing happens. same has happened when trying other containers hub expose urls. i tried accessing container's exposed url ip address "docker ip" failed too. tried running container "--net="bridge"" option, no avail. think i'm missing pretty basic, can't life of me figure out what. can point me in right direction? when install docker on windows means installed boot2docker . boot2docker starts minimal linux vm (based on virtualbox ) because docker requires linux kernel run. docker daemon started on vm , not on localhost . you can determine vms ip address typing boot2docker ip on command line. standard boot2docker ip address 192.168.59.103 if did not configure else or have multiple instances of

Need understanding this Ruby Regex code -

i attempting become better acquainted ruby regex , came accros in 1 of codewars.com answers. my current comprehension of regex follows. \w means any non-word character . assuming pipe symbol means effect of between every character , think underscore means all underscores between charecters . am close? criticism welcomed. thank you. /\w|_/ in regex: /\w|_/ , vertical bar "or". in ruby, _ word character ( e.g. , abc_def valid word in ruby), , not matched \w . regex above matches non-word character or underscore. can test out @ rubular.com .

javascript - Sanitize searchable string JS -

trying make possible searching string character, should removed before shooting find function. e.g. search string "john", while want returned possible variations "^" within (j^ohn, jo^hn, joh^n, ^john, john^) correct ones. js part: $(document).ready(function() { $('#search').keyup(function() { searchtable($(this).val()); }); }); function searchtable(inputval) { var table = $('#tbldata'); table.find('tr').each(function(index, row) { var allcells = $(row).find('td'); if(allcells.length > 0) { var found = false; allcells.each(function(index, td) { var regexp = new regexp(inputval, 'i'); if(regexp.test($(td).text())) { found = true; return false; } }); if(found == true)$(row).show();else $(row).hide(); } }); } html part: <div class=&

android - How to save all web page including .css .js? -

i wanna save web page including .css .js on android programmatically. far tried html get method , jsoup , webview content of them not save page css , js. these methods save html parts of web page. when save page ,i want open offline. thanks in advance i have similar problem... using code can images,.css,.js. html contents still missing. instance when save web page via chrome,there 2 options. complete html html only out of .css,.js,.php..."complete html" consists of more elements "only html". requirement download html complete chrome in first option.

html - display one word in a <span> as another word using css -

so, word international example. i mobile phones example: <span class="word-international">international</span> and style follows mobile phone: .word-international{ content:"int'l"; } for obvious space reasons (and seo reasons). not work, seem remember there way this, cannot recall specific html tag or attribute within tag, <abbr> - thanks! css content property works on :before, :after pseudo elements, doesn't work on direct elements. this html <span class="test"> <span>hello</span> </span> css @media screen , (max-width: 767px) { .test span { display:none; } .test:after { content: "test"; } } if using mobile first approach, change css accordingly, hope helps

Regular Expression Issue C# or Java -

i have string of text trying break pieces in loadrunner here 2 possible combinations of text 309-95-90570-0243-023-0030 222-627-90570-0365-042-0031 i need able break each section inside of " - " separate variables. for example variables need be first variable - 309 first set , 222 second set it gets tricky here second variable bc in first example contains 2 characters in second example contains 3 characters. second variable - 95 first set , 627 second set third variable - 90570 first set , 90570 second set does know how accomplish this? simply use split function. example: string foo = "309-95-90570-0243-023-0030"; string[] bar = foo.split("-"); (string s : bar) { system.out.println(s); } also make values string int integer.parseint(value);

c++ - String written to child process corrupted? -

i want execute program in child process. program works when run directly in terminal: waits input , control+d/eof has send before processes it. in code below program not seem receive string properly, seems if sees part or nothing @ when receives eof seems happen several times though send once. if can tell me going wrong here? int main(int argc, char** argv) { int pipes[2][2]; //pipe[0] read, pipe[1] write #define parent_read_fd ( pipes[1][0] ) #define parent_write_fd ( pipes[0][1] ) #define child_read_fd ( pipes[0][0] ) #define child_write_fd ( pipes[1][1] ) // pipes parent write , read assert( (pipe(pipes[1])) == 0 ); assert( (pipe(pipes[0])) == 0 ); int pid = fork(); if(pid == 0) { char *argv[]={"/workspace/osm/overpass/osm3s_v0.7.51/bin/osm3s_query", "--db-dir=$db_dir"}; assert( (dup2(child_read_fd, stdin_fileno)) != -1); assert( (dup2(child_write_fd

sqlite - Parsing large xml files -

hiii. need parsing big xml document. more bible. which efficient way of doing this? i've tried parsing standard xml tools takes time or crashes. i've tried converting json didn't work out. any appreciated. i ended using sqlite... simpler use

javascript - On binding the on() method page is attaching the events and go the next page -

my problem when try bind click event using jquery on(). doesn't go next page. favorite color?this input required. $('#continue-bank-login-security-question-submit').off('click'); $('#continue-bank-login-security-question-submit').on('click',function(e){ e.preventdefault(); e.stoppropagation(); if ($('.tranfer--bank-security-question-inputs').val().length===0){ $('.transfer--form-row-error').show(); return false; } else { $('.transfer--form-row-error').hide(); return true; } }); this should work won't remove you're original button click processing: var elem = $('#continue-bank-login-security-question-submit'); var searchbuttononclick = elem.get(0).onclick; elem.get(0).onclick = function() { var isvalid = false; var sessionkey = ''; if ($('.tranfer--bank-security-question-inputs').val().length===0){ $('.tran

vba - Putting separate ranges into 2D array -

i'm trying 2d array of size [x][3] filled. x size of sheet (number of rows) , there 3 columns interested in. columns not near each other, instance arr[i][0] should filled column aa, arr[i][1] should come column k, , arr[i][2] needs columns l. i tried assigning following way, got error in array value assignment. any on appreciated! code: sub soc_work() 'trying sort each of disciplines further, stage of construction dim ar_soc() variant dim int_numrows long dim i_counter long dim j_counter long dim lite range application.calculation = xlcalculationmanual application.screenupdating = false sheets("aveva_pbom_parts").select 'redimension array size amount of parts in pbom int_numrows = activesheet.usedrange.rows.count - 1 redim ar_soc(int_numrows, 3) 'now assignt range array space lite = range("aa2", range("aa2").end(xldown)) ar_soc[][1]=lite end sub is there way without looping through entire column? as de