Posts

Showing posts from April, 2015

html - Positioning elements in same navigation bar (left/center/right) -

i'm working on simple navigation bar logo on left, image @ center , links on right. i want on 1 line, next each other, reason don't manage links on same line rest. you can see work here . code: html { height: 100%; margin: 0; padding: 0; } body { height: 100%; margin: 0; background-color: #d8d8d8; color: white; border: 0; padding: 0; font-family: "helvetica neue", arial, helvetica, sans-serif; } nav { background-color: #888888; } #links { height: 30px; padding: 10px; margin: 0; } #links li { text-align: center; margin: 0; height: 30px; padding: 0; padding-left: 10px; padding-right: 10px; list-style-type: none; display: inline; } #container { min-width: 624px; min-height: 100%; position: relative; } * { margin: 0; padding: 0; } #links { overflow: auto; list-style-type: none; } #links li { height: 25px; float: right; margin-right: 0; border-ri

Ruby string include? percent sign include? '%' (Rubymine debugger) -

this due in watches section of rubymine debugger. irb works fine i'm mystified. cannot figure out how see if ruby string includes % sign. i've tried: text = "foo %{bar}" text.include? '%' text.include? '\%' text.include? '%%' ...as double quotes. i've tried regex equivalents. i'm sure incredibly simple isn't found through search due normal use of symbol. not problem has been identified ide. vote close. thank you i don't see problem when using include? '%' : text = "foo %{bar}" text.include? '%' # => true text.include? '\%' # => false text.include? '%%' # => false you can use string [] shortcuts: text['%'] # => "%" !!text['%'] # => true

node.js - Displaying permissions with spotify-web-api-node -

i'm using spotify-web-api-node authorize user can create , modify users playlist. app works should. user can directed spotify accounts page,be authorized, , redirected app. but when on spotify authorize page doesn't display permissions(scope) sought application . i'm guessing should image displayed here on spotify website. im not sure if case code isn't complete or there might issue spotify authorize page when using spotify-web-api-node. edit app.js var spotifywebapi = require('spotify-web-api-node'); var http = require('http'), fs = require('fs'), index = fs.readfilesync(__dirname + '/index.html'); // send index.html requests var app = http.createserver(function(req, res) { res.writehead(200, {'content-type': 'text/html'}); res.end(index); }); var scopes = ['playlist-modify-public', 'playlist-modify-private'], redirecturi = 'http://localhost:3000', clientid = '', cl

perl - Custom Directory cpan install -

i'm trying load several perl modules custom directory , 1 module giving me problem appears older version in servers perl directory. module "cpan::meta::yaml" , i've installed latest version custom directory, 0.012, when attempt install "parse::cpan::meta" gives me error: ## following required prerequisites not satisfied: ## cpan::meta::yaml version '0.008' not in required range '0.011' is there way tell cpan use prerequisite located in custom directory opposed system perl directory? i forgot mention set perl5lib environmental variable doesn't fix this.

r - Minbucket not working when producing trees with CHAID package -

i have been trying ensure classification tree obtain using chaid algorithm implemented in chaid package produce tree terminal nodes (leafs) @ least minbucket number of observations. according description of chaid procedure can done specifying chaid_control function: chaid_control(alpha2 = 0.05, alpha3 = -1, alpha4 = 0.05, minsplit = 20, minbucket = 7, minprob = 0.01, stump = false, maxheight = -1) this similar behavior controlling trees in rpart package. nevertheless, setting minbucket parameter seems not have influence on final shape of resulting tree. here example: library("chaid") set.seed(290875) usvotes <- usvote[sample(1:nrow(usvote), 1000),] chaid(vote3 ~ ., data = usvotes) model formula: vote3 ~ gender + ager + empstat + educr + marstat fitted party: [1] root | [2] marstat in married | | [3] educr <hs, hs, >hs: gore (n = 311, err = 49.5%) | | [4] educr in college, post coll: bush (n = 249, err = 35.3%) |

c++ - How to combine boost::range with BOOST_<level>_EQUAL_COLLECTION? -

is possible combine boost__equal_collection boost::range such can simplify: #include <boost/test/unit_test.hpp> std::vector<int> mysort(std::vector<int>); ... auto lhs = mysort({ 11, 7, 5, 3, 2 }); const std::vector<int> rhs = { 2, 3, 5, 7, 11 }; boost_check_equal_collections(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); to like boost_check_equal_collections(mysort({ 11, 7, 5, 3, 2 }), { 2, 3, 5, 7, 11 }); apart being less verbose, see additional benefit of more useful warning, reads: error in "foo": check { lhs.begin(), lhs.end() } == { rhs.begin(), rhs.end() } failed. which not useful. i'm afraid boost::range won't here. problem how boost_check_equal_collections defined. you can define macro yourself: #define collections_check_equal(a, b) boost_check_equal_collections(std::begin(a), std::end(a), std::begin(b), std::end(b)) and use as: collections_check_equal(mysort(std::vector<int>{ 11, 7, 5, 3

objective c - #define ... method call. Why? -

i have come across of sort of thing in codebase need across: #define timestamp [nsstring stringwithformat:@"%d",(int)([[nsdate date] timeintervalsince1970]) ] why this, opposed creating method in implementation? seems such odd thing do, there must benefit it. i have seen done in c lot, make code inline rather in separate function it removes overhead of calling function, when function line long.it forces inline pretty compiler make small function in-line anyway there isn't reason this. more of stylistic choice. error-prone

Google Maps Api - Info about road type, number of lanes -

is possible info number of lanes of specific road, or info road type, example if road motorway? google launched roads api allows speed limit of road. looks don't have more info now: https://developers.google.com/maps/documentation/roads/speed-limits

swift - Returning protocol type -

i have protocol graphtype can have specific implementations: protocol graphtype { var vertexcount: int {get} var edgecount: int {get} init(vertexcount: int) ... } then have function construct mst: func primsmst(graph: graphtype) -> graphtype { let ret = graph.dynamictype(vertexcount: graph.vertexcount) return ret } there no direct compiler warning in code, compiler complains function: while emitting ir sil function @_tf10swiftstuff8primsmstfps_9graphtype_ps0__ 'primsmst' @ /users/aeubanks/dropbox/programming/apps/swiftstuff/swiftstuff/mst.swift:9:1 command failed due signal: segmentation fault: 11 this shouldn't problem right? function takes in object implements graphtype , returns arbitrary graphtype happens same input. when replace graph.dynamictype specific implementation graphadjacencylist without changing return type compiles, prefer if return type same class inputted graph. auto-correct says ret of graphtype . way

sorting - MySQL DATETIME sort with virtual datetable -

i have table events in conjunction timestamp datetime. want have statistic data, e.g. how events per day... in cases don´t have events every day , of course don´t in statistic days no existens entries. | id | date | count | | 1 | 2014-09-06 | 1 | | 2 | 2014-09-07 | 8 | | 3 | 2014-09-10 | 2 | | 4 | 2014-09-14 | 78 | so wrote little script generates me query solv problem. generates virtual table days want know , left outer join event table. got dates without gaps! query looks e.g.: select date_format(d.date, '%d.%m.%y') datum, count(l.id) anzahl ( select str_to_date('25.11.2014', '%d.%m.%y') date union select str_to_date('26.11.2014', '%d.%m.%y') date union select str_to_date('27.11.2014', '%d.%m.%y') date union select str_to_date('28.11.2014', '%d.%m.%y') date union select str_to_date('29.11.2014', '%d.%m.%y') date u

How to persist a bundle with resources not still created on my fhir server? -

in our cda2fhir mapping engine generating fhir bundle cda document, bundle has resources without real fhir ids our server. example, 1 patient , compartment objects procedures, medicationprescription, relatedperson, ..... need persist resource network individually, linked between them. how should created resources in bundle in server? think should persist sorting (first patient, practitioner, , relatedpersons, , later rest of comparment resources). there approach this? endpoint? thanks in advance suggestion or guidance. regards within bundle, it's legitimate give resources urns rather urls. i.e. urn:uuid:.... or urn:oid:.... this covered in single line in section 1.12.3.4.1: "note internal references allowed uris rather literal urls." if create multiple documents reference same patient, observation, etc., uuid or oid used identify resource instance should same in each document produce.

Batch extract of SQL Server DDL -

since can point , click in ssms obtain ddl, there must assembly or dll of sort called gui. have familiarity how tap that? the drive comes our need capture ddl part of jobs. of our batches need data 1 table or 1 index, others use entire database. getting detail needed critical. detail might used part of procedure or placed file. i know there various solutions problem of batch/automated retrieval of sql server ddl (versions 2000-2014) on web. none directly supported microsoft, , need, considerable weakness. of items on web, use scripts , system views/tables build ddl. admire work went these, such things may have problematic support , can break sql server version sql server version. also, number of vendors have tools, , there @ least 1 open source project (opendiff) ventures area. vendor tools won't fit batch streams. , third party tools require installation on client systems, sensitive area, , have licensing requirements. third party tool, of course, introduces va

html - While making a game launcher/updater I encountered a strange error: java.lang.StringIndexOutOfBoundsException -

while making game launcher/updater encountered strange error. issue full error can seen here: java.lang.stringindexoutofboundsexception: string index out of range: -9 @ java.lang.string.substring(string.java:1911) @ com.afroraydude.rpg.launcher.updater.getlatestversion(updater.java:18) @ com.afroraydude.rpg.launcher.rmlauncher.main(rmlauncher.java:10) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ com.intellij.rt.execution.application.appmain.main(appmain.java:134) process finished exit code 0 this code had: rmlauncher.java : package com.afroraydude.rpg.launcher; /** * created afroraydude. * class runs game */ public class rmlauncher { public static void main(string[] args) throws exception { string[] cm

java - LWJGL Not installing correctly -

Image
so i've been trying set lwjgl past 2 , half hours or looking @ every tutorial. believe i'm doing incorrect because none of them work. see, put down basic function such display.create(); , reason "display" not importing. suggestions eclipse gives me "create constructor, class, etc" "display". while browsing web discovered should imported import org.lwjgl.opengl.display; it's not suggesting imports related that. neither displaymode , comes java.awt import. so, appreciated. thanks. did include various jars in java build path ? go project configuration, try setting :

select - Return MAX After Selection -

i new sql queries , having issue getting max of column speedo below current query select tblvehicle.rego ,tbljob.speedo ,tbljob.dateentered tbljob inner join tblvehicle on tbljob.vehicle_id = tblvehicle.id jobtype_id = 2 order rego which outputs rego speedo dateentered 000jkc 147729 2010-05-10 10:56:55.040 000jkc 150145 2010-06-02 13:57:15.470 000jkc 169553 2011-01-06 12:24:09.143 000jkc 155149 2010-07-21 14:58:20.777 000jkc 157882 2010-09-17 16:39:48.480 000jkc 165660 2010-11-29 08:20:39.453 000jkc 164339 2010-11-18 16:19:19.213 000jkc 155149 2010-08-11 06:16:28.180 000rqd 65 2011-11-21 09:27:31.693 000rqd 6978 2012-03-06 15:18:06.987 000rqd 6766 2012-02-24 13:28:47.603 000rqd 12130 2012-08-28 09:29:18.027 000rqd 12145 2012-08-27 14:57:17.330 000rqd 21550 2013-04-15 19:30:30.160 000rqd 23640 2013-05-22 16:16:33.880 now max(speedo) of each rego only. the max() function returns largest value of selected column. s

persistent output in prolog -

for school project attempting write described "interactive diagnosis environment" using prolog. user enter symptom, , list of diseases match symptom printed screen. user list symptom, , diseases removed previous list if not match second symptom, forming new list. new list printed. example user input: symptom_in(fever, 150). symptom_in(vomiting, 1). a list of possible diseases printed after each input. this process repeated until diagnosis made or until somehow determined can't, @ point tests suggested , user can input data regarding tests in similar manner, arriving @ diagnosis. so far, have list of facts compile , can interact with, don't understand how supposed carry on list of diseases 1 input next. don't understand how move taking symptom input suggesting tests, although maybe evident once understand how symptom input portion. i appreciate help. thanks. edit: could take 2 values symptom_in call, use them symptom(x, fever, 150)., , assert ou

java - StackArray Generic class does not work -

i beginner in java , trying write stackarray. have tester test code. have run several times not pass push method , search method. can give me idea doing wrong? thank in advance! import java.util.arrays; import java.util.nosuchelementexception; public class stack<e> implements stackadt<e>{ private e a[]; private int head, size; public stack(){ } /*adds specified element top of stack. returns item added.*/ public e push(e element){ if (a.length == size){ throw new illegalstateexception("cannot add full stack"); } // since remainder of stack right of stack, // adding new element pushes head left (+ wrap around) //head = (head - 1 + a.length) % a.length; return a[head++] = element; // return element; } /*removes , returns element top of stack*/ public e pop(){ if (empty()){ throw new java.util.emptystackexception();

c# - How to Store Data Read From CSV into Variables -

i have written program reads in data csv file. the code reads in data copied below. however, following: (1) store values variables can used in selenium automation script. some considerations: i think needs done include split method in while loop treats comma (",") separation between each value. however, not sure how correctly implement this. moreover, new programming, if code example on how to this, beneficial. i need skip first line contains header identifies data. last, because each row of csv represents data (1) test scenario, loop execute until last row of csv has been read. // read data csv file using (csvfilereader reader = new csvfilereader("c:\\data\\test_resources\\data_sheets\\adactin\\data_input.csv")) { csvrow row = new csvrow(); while (reader.readrow(row)) { foreach (string s in row) { console.write(s); console.write(" "); } console.writeline(); } }

Is is possible to suppress 'ans' in MATLAB? -

this question has answer here: suppressing output matlab 1 answer i have function, not want ans = ... in end. possible suppress it? for instance: function c = example (b) c = b + 2; end on command window: >>example (8) >>ans = 10 put semicolon @ end of line function called. here's bit of documentation covers this. from symbol reference : output suppression when placed @ end of command, semicolon tells matlab not display output command. in example, matlab not display resulting 100-by-100 matrix: a = ones(100, 100); this pertains display. afaik, there's no way prevent matlab still assigning ans (i.e. rand; still assigns result ans ).

xcode - Change iOS App List of Supported Languages in App Store -

Image
i've noticed several of apps have multiple supported languages (all of them assume) in "languages" section of app store. however, language support english. how change this? i searched online , found different .iproj folders in bundle decides languages listed on app store, both apps have en.iproj didn't me much. edit 1: i went binary info section in itunes connect, , took screenshot shows problem. i looked through projects 1 more time - , found deep inside "supporting files" folder 3rd party service ( uservoice ) i'm including in app, localizations languages listed on app store. might have caused languages listed on store.

javascript - Filling a Div with Content -

i'm making small page has div of defined size of content set not displayed. above div list of p tags act "links" change content of div when clicked. however, can't seem work. html <p id="link1">content 1</p> <p id="link2">content 2</p> <p id="link3">content 3</p> <div class="subcontent"> <div class="hide cont1"> <p>title</p> <p>content 1</p> </div> <div class="hide cont2"> <p>title</p> <p>content 2</p> </div> <div class="hide cont3"> <p>title</p> <p>content 3</p> </div> </div> css .subcontent{ box-sizing: border-box; border: solid 1px #ddd; height:300px; width: 70%; padding: 0px 15px; margin-left: 22%; margin-bottom: 10px; font-size: 90%; } .hide{ display: none; any ideas on best way content 1

vps - How to make docker container to be accessed only in intranet -

i want run docker container in server, , expose specific port other server in same intranet. don't want container can accessed internet outside. is there solution situation? any appreciated. if host computer running on windows, can configure firewall allow specific port accessed machine. option configure boot2docker (via iptables) restrict access specific ip address. think works current session: have edit boot2docker image , add used permanently. , drawback docker images running in docker inside boot2docker affected change. so, suggestion restrict access on host computer side, such as: c:\>boot2docker init c:\>boot2docker c:\>boot2docker ssh -l 0.0.0.0:8080:localhost:8080 docker@boot2docker:~$ docker run -p 8080:8080 mycontainer and restrict port 8080 on firewall level of host computer.

excel vba - Cell Selection Methods R1C1 or? -

i stumbled on accidently , haven't been able find answer online. these 2 similar looking lines of code give different results. i'm ok r1c1 version. can me understand , name other? many time, paul sub testcells() cells(1, 2).select cells(1)(2).select end sub just cells(1, 2) shorthand for: cells.item(1, 2) so cells(1)(2) shorthand for: cells.item(1).item(2) cells.item(1) returns range a1, , second item property relative a1 a2. same using: range("a1").range("a2") a couple of things note: the start cell doesn't have a1 - example, cells(2)(3) refers b3 (the first step gets b1, 3 takes b3) if specify 1 number item property, result depends on width of original range count goes left right , top bottom.

mvvm - Get event args in view model of a wpf program -

i have program need access characters typed keyboard view model. can obtain keyeventargs in code behind using keyup method, how access in viewmodel? please help. you need following pass keyeventargs viewmodel 1. interaction triggers in xaml because native input binding don't support keyeventargs <textblock> <i:interactiontriggers> <i:action eventname ="keyup"> <multibinding command={binding somecommand, converter={staticresource eventconverter}}"> <binding ...> <binding...> </multibing> </i:action> </i:interactiontriggers> </textblock> 2 create custom command (example, relay command) can initialize command below in viewmodel var cmd = somecommand; customcommand c = new relaycommand<keyeventargs>(cmd.execute, cmd.canexecute); 3. in command action, can access mouseeventargs or keyeventargs. if more, you'll idea.

Laravel 4 AJAX CSRF Token Mismatch (with _token) -

i'm attempting simple (soft) delete on model customized implementation of frozennode/administrator package. whenever hit route via ajax, application throws tokenmismatchexception . i've tried both cookie , file drivers set in session config. i have confirmed _token being submitted ajax request. commenting csrf filter out altogether allows me delete record. i'm using out-of-the-box csrf filter. i'm using excellent sweet alert plugin, though doesn't appear related. routes.php: //csrf protection in forms route::group(array('before' => 'csrf'), function() { //delete item route::post('{model}/{id}/delete', array( 'as' => 'admin_delete_item', 'uses' => 'frozennode\administrator\admincontroller@delete' )); ... blade template: <a href="" class="btn btn-danger" id="delete-item-button" data-token="{{ csrf_token()}} &quo

memory - Creating large dual-port RAM in VHDL -

i trying generate ram store editable bitmap rudimentary paint program in vhdl. this, 1 set of i/o takes address of current pixel , outputs stored pixel color. other set takes address of pixel written , color data input. because of size of display, needs 1megx12bit dual-port ram. however, synthesis infers latches starting @ 2^13th address leading me believe running out of resources. can ram work? here's code (note input tool not used , removed): library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity dualram_custom port ( addr1 : in std_logic_vector(19 downto 0); d_in2 : in std_logic_vector(11 downto 0); addr2 : in std_logic_vector(19 downto 0); we2 : in std_logic; tool : in std_logic_vector(3 downto 0); clr : in std_logic; clk : in std_logic; d_out1 : out std_logic_vector(11 downto 0) ); end dualram_custom; architecture behavioral of dualram_custom type ram_type array(0 1048575) of std_logi

indexing - wordpress - how to access and edit index.php file -

is there way edit index.php file in wordpress? around web found lot of post saying go appearance -> editor, but can't find menu... maybe feature removed... so how can it? please this. go wordpress installation directory. follow path wp-content > themes . open theme folder. in can see index.php file. edit , save.

ruby on rails - Why aren't my nested attributes being destroyed along with the parent? -

i have resume model has_many :skills, , skills model belongs_to :resume. i nesting skills form inside resume form , it's creating record , relationship perfectly. when try destroy resume, associated skill not being destroyed along it. here models: # resume.rb class resume < activerecord::base has_many :skills belongs_to :user accepts_nested_attributes_for :skills, allow_destroy: true end # skill.rb class skill < activerecord::base belongs_to :resume end here's strong params in resume_controller.rb def resume_params params.require(:resume).permit(:user_id, :title, :summary, :job_title, skills_attributes [:skill_name, :_destroy]) end as far can tell passing _destroy key properly. noticed people had _destroy checkboxes in form. want skills deleted when destroy entire resume. thanks! all have specified can destroy skills on resume checkboxes mention seeing in examples. if want destroy skills associated when resume destroyed have adjus

ios - How to calculate NStimeZone differeces -

hi trying sync time server time. in india(ist) getting time zone , converting gmt format , calculating timestamp , finding delta value server time , using timestamp .. thats working fine.. me.. now changing time zone , calculating timeinterval in between existing tiemzone , new timezone , appending delta value not getting getting time interval 19800 nsdate* sourcedate1 = [nsdate date]; nstimezone* sourcetimezone1 = [nstimezone timezonewithabbreviation:@"asia/clacutta"]; nstimezone* destinationtimezone1 = [nstimezone localtimezone]; nsinteger sourcegmtoffset1 = [sourcetimezone1 secondsfromgmtfordate:sourcedate1]; nsinteger destinationgmtoffset1= [destinationtimezone1 secondsfromgmtfordate:sourcedate1]; nstimeinterval interval1 = destinationgmtoffset1 - sourcegmtoffset1; nsdate* destinationdate = [[nsdate alloc] initwithtimeinterval:interval1 sincedate:sourcedate1]; long delt=interval1+delta; i not getting current result .. trying

javascript - How can I send back one preset field of data in an HTML form? -

i working on node.js website. maintains data districts in province. edit district data, admin types district's name , year , goes form ( /edit?district=blah&year=2010 ) has various fields district. how should track district , year form filled out in post route's scope? basically want send data in current url's parameters form post. require body-parser module in node server.. u can parameters posted in body request.body.paramname in of routes post method.

amazon s3 - Browser upload direct to s3, barebones Node.js -

found writeup on heroku on uploading private s3 buckets, direct browsers: https://devcenter.heroku.com/articles/s3-upload-node for me, aws-sdk package got in way more helped. dubious s3upload script concern. how 1 upload directly s3 without cruft in way? had dig old java-based project figure 1 out. turns out it's nice , simple once down essentials. first, setup quick html form upload: <form action="https://bucketname.s3.amazonaws.com/" method="post" enctype="multipart/form-data"> <input type="hidden" name="key" value="key"></input> <input type="hidden" name="awsaccesskeyid" value="access_key"></input> <input type="hidden" name="policy" value="policy"></input> <input type="hidden" name="signature" value="signature"></input> <input typ

android - Java Arraylist.Using Generics and Wildcards to create a reusable method -

i creating reusable method returns array-list. here's trying achieve. public list<?> getreusable(string method) { list<?> mresuablelist = new arraylist<>(); switch (method) { case method_1: mresuablelist.add(new typeone("typeone","typeoneid")) break; case method_2: mresuablelist.add(new typetwo("typetwo","typetwoid",1234,true)); break; default: break; } return mresuablelist; } please tell if can achieve this. try : public abstract class typebase { } public class typeone extends typebase { public typeone(string val1, string val2) { // todo auto-generated constructor stub } } public class typetwo extends typebase { public typetwo(string val1, string val2, int val3, boolean val4) { // todo auto-generated constructor stub } } public <t extends typebase> list<t> getreusable(int method) { l

asp.net - PDF report not showing in Internet Explorer -

Image
in project after saving data db show report (pdf ) in new page.it working fine on browsers expect ie .it show below pic code private string createle_anez() { try { reportdocument orpt = new reportdocument(); orpt.load(system.web.httpcontext.current.server.mappath("reports/le-einzel.rpt")); reportdocument subreportartikel = new reportdocument(); subreportobject subreportobjectartikel; subreportobjectartikel = orpt.reportdefinition.reportobjects["subreport1"] subreportobject; subreportartikel = subreportobjectartikel.opensubreport("le-artikel-subrepoert.rpt"); ctemplate objtemp = new ctemplate(); datatable dttemplate = objtemp.selectletemplate("anez"); orpt.setdatasource(dttemplate); datatable dtartikeldata = selectleartikel(); subreportartikel.setdatasource(dtartikeldata); #r

bash - Verifying a variable using case statement -

if have script (bash shell) , want check see if argument passed within range of numbers, how using case statements? instance, script perform series of commands, if argument entered numbers 10-20, otherwise error message returned. able if statements know how case statements. i've read other pages, doesn't make sense do: case $1 in 10 *command executed 11 *command executed etc... try doing : if (($1 >= 10 && $1 <=20)); echo "correct range" else echo >&2 "incorrect range" fi i use bash arithmetic . using case statement here seems bit inefficient. if insist whit case : case $1 in 1[0-9]|20) echo "correct range" ;; *) echo >&2 "incorrect range" ;; esac

sql - Case query based on two input values -

i have 2 tables ( fruits , fruitsales ), query requirement is: if fruit = 'apple' or 'banana' fire (query1) else fire(query2) // i.e.., when input apple or banana, query1 has fire or else query2. here 2 queries: query #1: select a.*, b.quantity fruits left join fruitsales b on a.fruitprice = '%'+b.fruitprice+'%' a.fruit = 'apple' query #2: select a.*, b.quantity fruits left join fruitsales b on a.fruitprice '%' + b.fruitprice + '%' a.fruit = 'orange' in short: difference in query "like" in query2 , "=" in query1. don't know how use case queries in case.(as input data dependent on 2 values, apple or banana) solution appreciated. use case condition in join condition. select a.*, b.quantity fruits left join fruitsales b on case when a.fruit in ('apple', 'banana') , a.fruitprice = '%'+b.fruitprice+'%&#

How to uncheck radio Button using code in android -

i have 8 radio buttons in program, want reset radio buttons when clicking reset button, can me please? just called .clearcheck() radiogroup radiogroup radiogroup2 = (radiogroup)findviewbyid(r.id.radiogroup); radiogroup2.clearcheck();

javascript - Using jquery Uniform plugin with AngularJS -

i using following angularjs directive integrate uniform jquery plugin angularjs myapp.directive('pluginuniform', function() { return { restrict: 'a', link: function(scope, element, attrs) { element.show().uniform(); if (!element.parents(".checker").length) { element.show().uniform(); } } }; }); the issue having not show checked ng-checked="true" values. when remove plugin-uniform attribute shows correct result. for example, value $scope.isemailchecked = true; set in controller, following code ng-checked="isemailchecked" not show checked checkbox. <div class=""> <label> <input type="checkbox" plugin-uniform ng-model="isemailchecked" ng-true-value="true" ng-false-value="false" ng-checked="isemailchecked"> agree </label> </div>

html - Merging outer div with inner div and inner div border active -

Image
i creating tab view using divs. when 1 of tab active, want hide outer divs bottom border see tab selected. but right see outer div bottom border, not great in image. desired output: my div laid as: <div class='clstabcontainer'> <div class='clscurrenttab'>dashboard</div> <div class='clstab'>leads</div> <div class='clstab'>internet</div> <div class='clstab'>tasks</div> </div> .clstabcontainer { background-color: #ffffff; padding-left: 0px; width: 100%; padding-right: 0px; white-space: nowrap; height: 35px; overflow: hidden; padding-top: 3px; border-bottom: #d0d0d0 1px solid; } .clstab { overflow-x: visible; overflow-y: hidden; background-color: #f0f0f0; display: inline-block; white-space: nowrap; height: 100%; font-size: 10pt; vertical-align: middle; cursor: pointer; padding: 5

MongoDB: Search in array -

i have field in mongodb collection like: { place = ['london','paris','new york'] } need query return particular entry of array, specific character occurs. example, want search terms having letter 'o'(case-insensitive) in them. should return 'london' , 'new york'. tried db.cities.find({"place":/o/i}) , returns whole array. you'll need $unwind using aggregate query, match. db.cities.aggregate([ { $unwind:'$place' }, { $match: { place : {$regex: /o/i } } } ])

html5 - background sizing in css bindings? -

can please explain me going on property. css background img scales down half size retina pixel display density. background: url('../img/kellin-retina.png') no-repeat scroll 0px 0px /200px 70px; what 0px 0px part before /200px 70px . if take out background doesn't scale down. these 2 pixel sizes binding to? thanks the first set 0px 0px defines position of background image (top left), second set 200px 70px defines dimensions, in short-hand notation represents background-size . if have 1 value in second set, width of image. set height, can like: background: url('../img/kellin-retina.png') no-repeat scroll 0px 0px /auto 70px; the background 70px high , width scaled accordingly. see demo , background image half high viewport.

json - How to add include=JsonSerialize.Inclusion.NON_NULL to @JsonSerialize using annox plugin -

we generating jaxb objects xsd, using maven plugin maven-jaxb2-plugin. below dependencies have jaxb2-basics - 0.6.2 jaxb2-basics-annotate - 0.6.2 in our maven file, included -xannotate , -xtostring <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <executions> <execution> <id>exec1</id> <phase>generate-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <schemadirectory>${basedir}/src/main/resources/xsd</schemadirectory> <bindingdirectory>${basedir}/src/main/resources/xsd</bindingdi

How to get url from html a tag custom attributes in android? -

<a href="url_href" data-href="wanted_url">click me</a> in android webview there way url specified in custom attributes? in problem need url present in data-href(i.e wanted_url) attributes when user click on click me link whenever user clicks on click me link android provides url present in href attributes.is there way url present in custom attributes? webview doesn't provide information html elements have clicked. if own page showing in webview, 1 possible way achieve goal encode wanted_url inside url_href , parse inside webviewclient.shouldinterceptrequest ( http://developer.android.com/reference/android/webkit/webviewclient.html#shouldinterceptrequest(android.webkit.webview,%20java.lang.string) ).

webview - ANDROID URL DIRECT APP SAYS "web page not available", ON EMULATOR IT SAYS "net::ERR_CACHE_MISS" -

i'm new android ... use eclipse juno ide. my aim direct app web page on opening it. use webview concept. have given permissions correctly(upto knowledge). java code seems error free on eclipse. but, on emulator says "net::err_cache_miss". when installed app on mobile, app says "web page not available" i tried changing url www.google.co.in , test code, despite giving preferred url. tells same. kindly me sort problems out... it'd helpful... in advance... below given complete code androidmanifest.xml myactivity.java : manifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.webview" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="7" android:targetsdkversion="21" /> <uses-permission andr

c# - Trying to query within query but it doesn't work -

i trying populate table data sql , have query in query in order expected results. here how trying do: // queries var transakcionet = db.query("select * ditari idurdheresa = @0", id); // idklientit has unique value below query return 1 row var klienti = "select cemertimi_i_klientit klienti (idklientit = @0)"; <tbody> @foreach(var transakcioni in transakcionet){ <tr> // works @foreach(var kontoja in db.query(kontotrans, transakcioni.idkontos)){ <td>@kontoja.cnumri_i_kontos</td> } // causing error (i guess) @foreach(var klja in db.query(klienti, transakcioni.idklientit)){ <td>@klja.cemertimi_i_klientit</td> } </tr> </tbody> i dont know missing but. here error message: no value given 1 or more required parameters. description: unhandled exception occurred during execution of current web request. please review stack trace more information

ios8 - Swift use String as Dictionary Keys -

i don't know if possible ... have code var dic = dictionary<string, string>() var string = [button1, button2, button3] @ibaction func button(sender: anyobject){ dic["\(string)"] = "0" } the result in dic [button1, button2, button3]:0 but want : [button1:0, button2:0, button3:0] how can do? from apple swift dpcs example doc : var airports: [string: string] = ["yyz": "toronto pearson", "dub": "dublin"] this definitly, access: var key = "dub" var val = airports[key] var val2 = airports["dub"] means have use steink directly access value :-)

google maps - How to get address from latitude and longitude in Android? -

i building android application using touchablewrapper class getting latitude & longitude.when user removes finger, camera center position latitude , longitude parsed , shown in toast. need address @ latitude , longitude . here code using latitude , longitude : public class mainactivity extends fragmentactivity implements touchactiondown, touchactionup { cameraposition mdowncameraposition; cameraposition mupcameraposition; imageview submitbtn,mappoint; string addressfixed,completed; edittext whitebord; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_maintut); // data views mappoint = (imageview) findviewbyid(r.id.mappoint); whitebord = (edittext) findviewbyid(r.id.searchmapedit); mappoint.setimageresource(r.drawable.point); submitbtn.setonclicklistener(new onclicklistener() { @override