Posts

Showing posts from March, 2012

javascript - Materalize CSS error labels -

materalize supports validation input fields such email, validate input fields such passwords on fly. means adding error or success label through javacript. my success far has been poor. when call change() js function , try addclass('valid') example, nothing happens , can see, class doesn't appear in html. know function working because if add nonsense class 'test', display in html. is not simple adding 'valid' or 'invalid' - need meet other criteria before label appear? any appreciated. my solution include error labels below: <div class="input-field col s9 offset-s1"> <i class="material-icons prefix">perm_identity</i> <input id="register_user" name ="register_user" type="text"> <label id="reg-user-error" style="display:none" for="register_user" data-error="short" d...

SAS - Replace the n'th word in a string, if a certain length -

i have list of customer ids, formatted follows: 123-456-78; 123-345-45; 12-234-345; 123-34-456; i want able find every 2-digit portion of code , replace new number. example, "78" in first entry, "12" in third entry. right i'm using scan function loop find each 2-digit section. data work.test12; set mylib.customers; i=1 5; x=scan(customer_id,i,'-'); if length(x)=2 do; <??????>; end; output; end; i think regular expression work nicely. 33 data _null_; 34 infile cards dsd dlm=';'; 35 input s :$16.; 36 if _n_ eq 1 rx = prxparse('s/(^|-)\d\d($|-)/\100\2/'); 37 retain rx; 38 length new $16; 39 if prxmatch(rx,strip(s)) new=prxchange(rx,1,strip(s)); 40 put s= new=; 41 cards4; s=123-456-78 new=123-456-00 s=123-345-45 new=123-345-00 s=12-234-345 new=00-234-345 s=123-34-456 new=123-00-456

jquery - Google spreadsheet Search using javascript -

Image
i'm trying build search option user input id , see result of corresponding id stored in google spreadsheet. like user input: 1 , see result : nitu 5 , see result : dipon <input id="id" type="text" placeholder="your id"> <input id="search" type="submit" value="search"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> function displaycontent(json) { var string = "<table>"; var len = json.feed.entry.length; (var i=0; i<len; i++) { var id = json.feed.entry[i].gsx$id.$t; var name = json.feed.entry[i].gsx$name.$t; string += '<tr><td>' + id + '</td><td>' + name + '</td></tr>'; } string += "</table>"; $(string).appendto('bo...

java - ThreadDump Collection from Tomcat -

i trying threaddump of jvm. used top command , ps aux find process id , user of pid [which root]. so run following command threaddump sudo -u root jstack -f pid > threaddump1.txt but getting following exception--------------------------------- error attaching process: doesn't appear hotspot vm (could not find symbol "ghotspotvmtypes" in remote process) sun.jvm.hotspot.debugger.debuggerexception: doesn't appear hotspot vm (could not find symbol "ghotspotvmtypes" in remote process)** @ sun.jvm.hotspot.hotspotagent.setupvm(hotspotagent.java:411) @ sun.jvm.hotspot.hotspotagent.go(hotspotagent.java:305) @ sun.jvm.hotspot.hotspotagent.attach(hotspotagent.java:140) @ sun.jvm.hotspot.tools.tool.start(tool.java:185) @ sun.jvm.hotspot.tools.tool.execute(tool.java:118) @ sun.jvm.hotspot.tools.jstack.main(jstack.java:92) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl....

log4j - Log4j2 programmatic configuration Log filename issue -

i have configured log4j2 using programmatic configuration.please find code below.i running code on jdk1.8.the log files getting generated log file names not created appropriately pattern defined.the file generate names test_28_12_2016_24.log looks simpledateformat not getting recognized.please let me know if missing anything. public class test { public static void main(string args[]){ public final string log_file_pattern = "-%d{dd-mm-yyyy-hh}.%i.log"; public final string my_log_pattern_layout = "%msg%n"; /* configuring logger context */ private loggercontext context = (loggercontext) logmanager.getcontext(false); final configuration config = context.getconfiguration(); final layout<? extends serializable> layout = patternlayout.createlayout(my_log_pattern_layout, null, config, null,null,true, true, null, null); /* configuring policies */ final timebasedtriggeringpolicy timebased...

java - How do I set the size of messages in Kafka? -

i'm using kafka 0.9.0.1. according sources i've found, way set sizes of messages modify following key values in server.properties . message.max.bytes replica.fetch.max.bytes fetch.message.max.bytes my server.properties file has these settings. message.max.bytes=10485760 replica.fetch.max.bytes=20971520 fetch.message.max.bytes=10485760 other settings may relevant below. socket.send.buffer.bytes=102400 socket.receive.buffer.bytes=102400 socket.request.max.bytes=104857600 however, when attempt send messages payloads of 4 6 mb in size, consumer never gets messages. producer seems send messages without exceptions being thrown. if send smaller payloads (like < 1 mb) consumer receive messages. any idea on i'm doing wrong in terms of configuration settings? here example code send message. producer<string, byte[]> producer = new kafkaproducer<>(getproducerprops()); file dir = new file("/path/to/dir"); for(string s : dir.list()) { ...

android - How to implement animated vector drawables using the design support library 23.2? -

Image
i've seen android developers blog new design support library 23.2 supports animated vector. when searched came across link implement animated vector drawable. same way implement animated vector drawables in design support library 23.2? can me out new implementation? here's link example project on github implementing support library make floating action button. using support library similar non-support library method in xml files animatedvectordrawables same, objectanimators , static vectordrawables. the differences come when setting project use support library , when referring animatedvectordrawables in code. make sure using @ least version 23.2.0 of appcompat in build.gradle, vectordrawable , animatedvectordrawable libraries not need added separately: dependencies { ... ... compile 'com.android.support:appcompat-v7:23.2.0' } the official anouncement blog linked to gives couple of different ways ensure android studio not convert vector drawa...

css - jquery: detach() not working in Safari -

i've written code utilizes append() , detach() hide , reveal full screen navigation. in safari, detach(), hide navigation, not working. why appreciated. $(document).ready(function() { var nav = $('#nav'); var menu = $('#menu'); var navlabel = $('#nav span') var menuitems = $('#menu li'); menu.detach(); navlabel.attr('data-content','menu'); nav.click(function(){ console.log(menu.css("opacity")); if (menuopacity == 0){ $("body").append(menu).after(nav); menuopacity = 1; menu.css("opacity"); menu.css("opacity","0.99"); navlabel.attr('data-content','back'); } else if ( menuopacity == 1 && menu.css("opacity") == 0.99 ) { menuopacity = 0; menu.css("opacity"); menu.css("opacity",...

python 2.7 - Confusion on cs231n image classification implementation -

i taking cs231n online class. trying implement simple image classification code using cifar-10 dataset, in http://cs231n.github.io/classification/ while running code, on predict function, time takes long, , didn't completed. copy-and-pasted codes. desktop has state-of-art machine. the code shown below. load function import os; import cpickle pickle; import numpy np; import matplotlib.pyplot plt; def load_cifar_batch(filename): open(filename, 'r') f: datadict=pickle.load(f); x=datadict['data']; y=datadict['labels']; x=x.reshape(10000, 3, 32, 32).transpose(0,2,3,1).astype("float"); y=np.array(y); return x, y; def load_cifar10(root): xs=[]; ys=[]; b in range(1,6): f=os.path.join(root, "data_batch_%d" % (b, )); x, y=load_cifar_batch(f); xs.append(x); ys.append(y); xtr=np.concatenate(xs); ytr=np.concatenate(ys); de...

html - Is there any CSS to align a box/element? -

i've seen people not use <div align="center">some text</div> , <center>some text</center> because it's outdated can't find css align inside element. closest thing i've found text-align: center; aligns text, not elements. there css allows align elements? this css. thing want center #editor . it's <textarea></textarea> tag. @font-face { font-family: bandits; src: url("bandits.ttf"); font-weight: bold; } #editor { position: absolute; bottom: 35px; left: 35px; width: 800px; height: 600px; resize: none; } #see-result { position: absolute; top: 276px; left: 425px; width: 125px; letter-spacing: 2.7px; font-weight: bold; background-color: #888; text-align: center; padding-top: 6.5px; padding-bottom: 6.5px; cursor: pointer; font-family: calibri; } #see-result:hover { background-color: #ababab; } header { text-align: center; font-size: 65px; f...

jquery - Javascript animation with variable speed based on cursors position -

what want achieve javascript animation variable speed based on cursor position. for porpouse i'm using jquery's animate function , mousever event , javascript's setinterval function, aren't required, if there better way achieve more happy hear (the requeriment javascript). the problem i'm facing can't change speed dinamicly, reason speed keeps adding 1 had instead of set wanted , if change spected doesn't happen in smoothly way because of unknown reason me. here javascript have far: //settings container_slider. used in startslider() handles animation var steps_animation_speed = 1000; var steps_interval = 1500; var steps_speed_factor = 1; // 100% var amount_sliders = 3; //cache dom elements var $container_slider = $('#container_slider'); var $shown_slides = $('.shown_slides', $container_slider); var $slide = $(".slide"); // making sure sizing (widths) fits should. var slides_width = $container_slider.width()/amount_...

php - JSONP Cross Domain Data -

i've been trying several hours examples find on google , none work me. want have 2 files, html 1 , php one, each on separate server. i'd html file able access information php page can use inside html file in alert(); function example. i need basic, dummy proof example says "put code in html file , put code in php file". to show example i've tried following article: http://www.fbloggs.com/2010/07/09/how-to-access-cross-domain-data-with-ajax-using-jsonp-jquery-and-php/ this put server side code: http://3d-sign.com/wip/recoup/database_2.php put client side code (from example 1): http://3d-sign.com/wip/recoup/read_test.php (i know need these files on separate servers if work on separate, should work on same server too, right?) please me :(

java - Http 500 error On using eclipse webservice explorer -

i using eclipse juno java 7 version on system.when try access websevice explorer.then gives http 500 error. well http 500 error means server error. there issue project thrown may in process of project deploy or may loading home page. better check dependencies first.

python - Google App Engine URL Handler Error While Running -

this app.yml file application: hello version: 1 runtime: python27 api_version: 1 threadsafe: false handlers: - url: /.* script: hello.py the hello.py located @ same directory app.yml file. when run app error: google.appengine.api.yaml_errors.eventerror: unknown url handler type. <urlmap secure=default static_files=none application_readable=none auth_fail_action=redirect require_matching_file=none static_dir=none redirect_http_response_code=none http_headers=none url=/.* script=none upload=none api_endpoint=none expiration=none position=none login=optional mime_type=none > in "c:\users\***\desktop\app\app.yaml", line 8, column 1 2016-03-01 11:36:12 (process exited code 1) i thought spacing issue added 2 spaces after script still getting same error. you need change definition of handler in app.yaml to: application: hello version: 1 runtime: python27 api_version...

javascript - Return a promised value to variable in angular.extend() -

in example below, how can set myvar value return async service method angular.extend(this, { myvar: (function() { getval(); })() }); function getval() { var d = $q.defer(); myfactory.get() .then(function (resp) { d.resolve(resp.data); }); return d.promise; // myvar should equal resp.data }; i think i'm showing lack of understanding of promises/deferral, advice great. since myvar variable set anywhere in controller. in initialization can assign fallback value or set undefined. , set after async call success. angular.extend(vm, { myvar: 'fallback' }); or: angular.extend(vm, { }); then: in controller: getvar(); function getvar() { getval().then(function(data){ vm.myvar = data; }); } function getval() { var d = $q.defer(); myfactory.get() .then(function (resp) { d.resolve(resp.data); }); return d.promise; // myvar should equal resp.dat...

arrays - PHP 'Illegal string offset' in foreach loop -

i getting assoc array mysql database using pdo. i want perform function on trim down number of words using following code: $newscontent = words::truncatewords($rows); i getting error , the function hasn't worked warning: illegal string offset 'content' in c:\www\mvc\libs\words.php on line 14 notice: uninitialized string offset: 0 in c:\www\mvc\libs\words.php on line 14 warning: illegal string offset 'content' in c:\www\mvc\libs\words.php on line 14 the first error repeated 8 times. line 14 points line $rows[$key]['content'] = self::trunc($row['content'], 60); here words class class words { // truncate each of news item's content set number of words public static function truncatewords($rows) { // loop through array foreach($rows $key => $row) { // , truncate content 60 words $rows[$key]['content'] = self::trunc($row['content'], 60); ...

java - Deviation Renderer in OverlaidXYPlot with JFreechart -

i use deviation renderer inside overlaid plot jfreechart. problem can't figure out how change axis custom one. here other plots : public class overlaidxyplotdemo extends applicationframe { final xyseries series0 = new xyseries("graph0"); final xyseries series1 = new xyseries("graph1"); final xyseries series2 = new xyseries("graph2"); final xyseries series3 = new xyseries("graph3"); public overlaidxyplotdemo(final string title) { super(title); final jfreechart chart = createoverlaidchart(); final chartpanel panel = new chartpanel(chart, true, true, true, true, true); panel.setpreferredsize(new java.awt.dimension(800, 600)); chart.setbackgroundpaint(color.white); jcheckbox chckbxcheck = new jcheckbox("check"); panel.add(chckbxcheck, borderlayout.south); setcontentpane(panel); } public void addelem0(double x, double y) { thi...

python - Supervisord - environment variables conflict for multiple porjects -

i have 2 sites build on django, both of them use gunicorn managed supervisor 2 supervisord.conf : [program:site1] environment=pythonpath="/home/www/virtualenv/site1/bin/:/home/www/site1/" command=/home/www/virtual/site1/bin/gunicorn wsgi:app -b localhost:1234 directory=/home/www/site1/ ... [program:site2] environment=pythonpath="/home/www/virtualenv/site2/bin/:/home/www/site2/" command=/home/www/virtual/site2/bin/gunicorn wsgi:app -b localhost:1235 directory=/home/www/site2/ ... with configuration noticed site2 tries start settings of site1, , fails because cant find packages required site1, because not installed in virtualenv of site2. think happens because of pythonpath mixes between 2 sites. how setup both sites use own virtualenv? have different configuration files each site.

ios - Loading online data very slow difficult to PUSH -

first of running map page show pins on map every store. running 1 pin on map , fast after put more 25 pins push slow map page. doing @ process app load data of pin location (as see in target output) , push next screen. please problem? - (void)viewdidload { [super viewdidload]; self.title = @""; self.navigationitem.title = @"mek"; response = [[nsdata alloc] initwithcontentsofurl:[nsurl urlwithstring:@"http://kalkatawi.com/maplocation.php"]]; if(response!=nil) { nserror *parseerror = nil; jsonarray = [nsjsonserialization jsonobjectwithdata:response options:nsjsonreadingallowfragments error:&parseerror]; jsonarray1 = [[nsmutablearray alloc] init]; jsonarray2 = [[nsmutablearray alloc] init]; jsonarray3 = [[nsmutablearray alloc] init]; for(int i=0;i<[jsonarray count];i++) { name = [[jsonarray objectatindex:i] objectforkey:@"name"]; longitude = [[jsonarray objectatindex:i] objectforkey:...

Add a reset date in python/django -

i understand question title may little vague let me explain. i need check see if object has gone past date. here's makes complicated. when object added model it's done string date not formatted date. it's coming csv it's way can this. it formatted m-dd-yy. now, need check see if reset has happened. resets occur every wednesday @ 4am cest. when i'm looking @ model can have set 2 things. expired objects (from previous reset) current objects (that not reset until next wednesday) i can't figure out best way tackle , open ideas , suggestions. thank you. convert field datetime in code using dateutil.parser before comparing current date: from dateutil import parser datetime import datetime object_date = parser.parse(my_obj.datefield) if object_date < datetime.now(): # else: # else you can install dateutil using pip install python-dateutil

javascript - iterate inside my .html.erb -

good morning, i developing application on rails , want show map locatión of cities alredy have. i try writing: <%=var="http://maps.googleapis.com/maps/api/staticmap&zoom=13&size=600x300&maptype=roadmap&" %> <%= @itinerary_city_visits.each |city_visit| %> <%= var = "#{var}&markers=color:blue%7clabel:s%7c#{city_visit.longitude},#{city_visit.latitude}" %> <% end %> <%= var = "#{var}&sensor=false" %> <%= image_tag var %> but application prints several times url don't show map. don't know ... appreciate collaboration *edit i trying show 1 map cities.

python - converted script to .exe with py2 exe but when I run .exe nothing happens? -

i ran following setup file generated 2 folder called 'build' , 'dist'. in 'dist' folder found file called final_project.exe. double-clicked launch nothing happened. i'm running windows 7. other files , folder , needed? hoping create 1 executable file send others, run without other files. took @ pyinstaller had trouble getting work. how can create single executable work: here's setup code ran create .exe: from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "final_project.py"}], zipfile = none,) probably nothing happens because in python don't enjoy handlers getch() function in c returns output standard output or console. alternatively can prepare module setup.py inside it, browse directory , run: python setup.py install or you can upload pypi and install easy_install or pi...

html - How to bring focused elements into view when behind fixed element -

i having problem textboxes being focused, hidden behind fixed footer. normally, focused elements outside viewable area scrolled view browser. there way treat fixed footer decreases view-height without decreasing viewable area? i prefer keep position: fixed; styling, understand may preferable (i.e. easier) have 2 non-overlaping containers. reference: http://jsfiddle.net/wjvsu/1/ if have first textbox focused , tab through each textbox, should reach point next focused element not visible, hidden behind footer. expect hidden element automatically scrolled view. if add z-index:999; footer element keep on top of else.

PHP: how to resize image for multiple size -

i have class resize image, worked create 1 size. need create multiple size each image. $resizeobj -> resizeimage(150, 100, 'crop'); line create image 150*100 . need create image 150*100 , 200*250 how fix this? class: <?php class resize { // *** class variables private $image; private $width; private $height; private $imageresized; function __construct($filename) { // *** open file $this->image = $this->openimage($filename); // *** width , height $this->width = imagesx($this->image); $this->height = imagesy($this->image); } ## -------------------------------------------------------- private function openimage($file) { // *** extension $extension = strtolower(strrchr($file, ...

c# - Unable to set number format -

i want put number format peruvian soles spreadsheetgear gave me format: "s/."#,##0_);("s/."#,##0) - don't know how cast string put in: reportworkbook.worksheets[wsnombre].cells[cpasomos].numberformat = "here"; i tried: reportworkbook.worksheets[wsnombre].cells[cpasomos].numberformat = "s/. ###,##0.00"; reportworkbook.worksheets[wsnombre].cells[cpasomos].numberformat = "s/.#,##0_"; reportworkbook.worksheets[wsnombre].cells[cpasomos].numberformat = "s/.#,##0"; but none of above works me. excel needs quotation marks in "s/. " recognise text. you need escape quotes in string this: reportworkbook.worksheets[wsnombre].cells[cpasomos].numberformat = "\"s/. \"#,##0"; see this guide excel formatting .

php - SQLSTATE[42000]: Syntax error or access violation: 1064 -

i writing software right now. reader's digest version: users select package, enter name, email, , desired subdomain. subdomain checked see if registered it, , if alphanumeric. had of working using oo mysqli, have decided make move pdo. exact wording of error: sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near '->subdomain' @ line 1 when instantiating admin object, well. however, when call createaccount() function, hell breaks loose. stack trace on place, , can barely figure out when begin troubleshooting this. have checked other answers here, , seem localized, here's code produces it, of methods contain errors. here go.... first, code produces error: include 'classes/admin.class.php'; $admin = new admin('test@test.com'); try { $admin->createaccount('john', 'smith', 'test', 'pro'); } catch(excepti...

xml - How to add "common" functions to multiple XSLT files? -

i've written following code saxon.api.xslttransformer object can use transform xml document. transformationxslt string contains xslt. xmldocument document = new xmldocument(); document.loadxml(transformationxslt); saxon.api.xdmnode input = processor.newdocumentbuilder().build(document); saxon.api.xsltcompiler xsltcompiler = processor.newxsltcompiler(); saxon.api.xsltexecutable xsltexecutable = xsltcompiler.compile(input); saxon.api.xslttransformer xslttransformer = xsltexecutable.load(); xslttransformers.add(transformation.name, xslttransformer); return xslttransformer; suppose have dozen or more xslt templates want able call any xslt. how can make them available resulting saxon.api.xslttransformer object. suppose have this: string commonxslt = "<xsl:param name="use_this_in_every_xslt">foo!</xsl:param>"; how can make "common" xslt available transformer? the usual way xslt write stylesheet modules not depending o...

Access values of object from within a javascript closure -

i can't how access value, code: function filters() { this.filters = ["filter_1", "filter_2", "filter_3"]; this.somedata = "test"; this.draw = draw; function draw(){ for(var i=0; i<this.filters.length;i++) { var filter = this.filters[i]; $("#" + filter).click(function(){ dosomething(); }); } } function dosomething(){ alert(this.somedata); } } i aware of fact since dosomething() called within closure, this. refer jquery object being worked on. how go being able use somedata object in function/closure ? can't seem figure out. :) no, this inside dosomething global object. need keep reference this in separate variable: function filters() { var = this; // reference this.filters = ["filter_1", "filter_2", "filter_3"]; this.somedata = "test"; ...

ruby on rails - Rake db:create fails on Library not loaded -

i running postgresql 9.1, installed postgres (/library/postgresql/9.1) - ie not homebrew etc , on mac osx leopard. i upgraded snow leopard , mountain lion , had mass of problems gems failing build etc, got them fixed rails server crashed on startup pg issues & tried find not fix prob - fixes included links etc, may still persist (hence background info might inform solution) i uninstalled postgresql 9.1 , installed postgres app now on rake db:create following: rake aborted! dlopen(/users/mitch/.rvm/gems/ruby-1.9.2-p320@tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle, 9): library not loaded: @loader_path/../lib/libpq.5.dylib referenced from: /users/mitch/.rvm/gems/ruby-1.9.2-p320@tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle reason: no suitable image found. did find: /usr/local/lib/libpq.5.dylib: mach-o, wrong architecture - /users/mitch/.rvm/gems/ruby-1.9.2-p320@tme-3.2.11-mltest/gems/pg-0.17.0/lib/pg_ext.bundle i'm running rvm (as u can see) , after os ...

compare columns of two unsorted file in python....specific output required -

i have 2 pipe delimited files large data...need compare columns..i column primary key...... eg. one.dat 123|ny|aa|500 569|ny|a|450 777|ok|b|250 899|ok|c|100 two.dat 569|ny|a+|500 777|ok|a|350 899|ok|b|150 output should like: ny column3 1 ny column4 1 ok column3 2 ok column3 2 it means ny records... column iii has 1 difference matched records..for ok records...column 3 has 2 differennces matched records.... i want join 2 files on column primary key , compare columns. please me out :) if files sorted, bits of example show are, can in way similar merge phase of merge sort: you start simultaneously @ beginning of 2 files , read row each. if primary keys match, compare them , output difference rows want. if not, see of them has lesser key , move on next row in file. repeat 2 or 3 until you've reached end of 1 of files. if files aren't sorted, sort them primary key first.

javascript - On first time visit- popup a div asking user name, then store it and the date on local storage -

the problem here never goes else statement; tried creating flag check when goes if , changing didn't work var ouser = {}; // add name js if (!ouser.name) { ouser.name = prompt("enter name: ") // add name js localstorage.name = ouser.name // time ouser.date = new date().toutcstring(); localstorage.date = ouser.date; } else { var msgdis = document.getelementbyid('msgdisplay'); msgdis.innerhtml = "hi " + localstorage.name + " welcome back!" + " -->date: " + localstorage.date; } ouser.name undefined, !ouser.name pass. you're creating ouser empty object ( var ouser = {}; ), checking data member never defined. you should checking if localstorage set: // declare ouser in global scope, empty object var ouser = {}; // check browser support of localstorage if(typeof(localstorage) == 'undefined') { // check failed, alert user alert('your browser not support localstorage...

html - Box-shadow over image? -

fiddle: http://jsfiddle.net/g5faq/ i have image contained in div. div next said image has box shadow. want box-shadow of div overlap image, looks image part of div in, rather appearing hover strangely on it. tried z-index, you'll see in fiddle, seems have failed. html: <body> <nav id="navigation"> <img src="http://web.fildred.com/media/images/blank_logo.jpg" height="150px" width="250px" alt="logo"> </nav> <div id="content_wrapper"> <!-- instancebegineditable name="content" --> <section id="content"> content. </section> <!-- instanceendeditable --> </div> </div> </body> css: body { background: #ffd288; } /*nav*/ #navigation { width:100%; z-index: 10; } .logo { z-index: 1; } /*content section*/ #content { background: #393951; height: 2000px; z-index: 10; -webkit-box-s...

.htaccess - htaccess rewrite query string nothing works -

the problem after looking @ 50+ stackoverflow posts , trying many permutations of htaccess file, nothing still. what have tried using website generate htaccess file: http://www.generateit.net/mod-rewrite/ setting allowoverride in httpd.conf file , restarting apache. my current htaccess file lives in root directory. rewriteengine on rewritebase / rewriterule ^find-a-local-doctor/([^/]*)/([^/]*)$ /find-a-local-doctor/?state=$1&city=$2 [l] what want accomplish change url: http://www.md1network.com/find-a-local-doctor/?state=fl&city=tampa to this: http://www.md1network.com/find-a-local-doctor/fl/tampa additionally since actual file doing work is: http://www.md1network.com/find-a-local-doctor/index.php , need able parse query string php. hopefully, still able state , city. please help. thanks. your existing rule looks alright need additional external redirection rule reverse. put rule before existing rule (just below rewritebase / ). # exter...

java - Assign a double value to a TextView? -

how assign double value textview? code: if(condition()) { tv=(textview)view.findviewbyid(r.id.textview); tv.settext(html.fromhtml("<b>text 01 </b>")); } else { tv=(textview)view.findviewbyid(r.id.textview); tv.settext(html.fromhtml("<b>text 02</b>")); } if(condition) { tv=(textview)view.findviewbyid(r.id.textview); tv.settext(html.fromhtml("text 03")); } else { tv=(textview)view.findviewbyid(r.id.textview); tv.settext(html.fromhtml("text 04")); } if run application , both conditions true return visualize last written words text 03. how view text 01? you using same textview . need create second textview or append string want. if(condition()) { tv=(textview)view.findviewbyid(r.id.textview); // each time call reintializ // textview set new text // ...

javascript - Meteor.js: how to pass the data context of one helper to another helper? -

so if have template: <template name="mytemplate"> {{foo}} </template> and template helper: template.mytemplate.foo = function() { blah = session.get('blah'); // code stuff blah return blah; }; and have template: <template name="myothertemplate"> {{foo}} </template> and want data context of template same previous template do? it first occurred me using {{#with}} might right approach seems work if scope of second template inside first. ultimately able use helpers defined 1 template within template , know how that. seems asking 1 of 2 questions: if using myothertemplate inside mytemplate , context of other template same one, unless explicitly pass else second argument of partial. <template name="mytemplate"> {{> myothertemplate foo}} </template> if want use helper across more 1 template, declare in global helper. make {{foo}} available in templates: handlebar...

LoadRunner "Cannot start recording" for SAP -

i attempting create loadrunner vuser script of sap. however, consistently getting error stating recording not started. below steps following attempt create recording. appreciated new sap , loadrunner. using hp virtual user generator 11.00.0.0 , sap netweaver v7200.3.11.1074 steps: 1) select sapgui protocal , click 'create' 2) set program record , working directory click 'ok' application type: win32 applications program record: sap logon program arguments: working directory: c:\program files (x86)\sap\frontend\sapgui record action: action result: window appears stating application being launched recording followed error stating recoding not started 1 know potentially causing type of issue? there log file can watch more specific information regarding cause of issue? other troubleshooting steps take? time go installation requirements, including credentials on box. 95% ++ of time when cannot record reason due 1 or more of installation requirem...

vb.net - End of statement expected - defining a variable -

i error "end of statement expected" when try , declare variable vram dim vram string if vramt.value = 1 vram = 256m vramt.value = 2 vram = 512m vramt.value = 3 vram = 768m vramt.value = 4 vram = 1024m vramt.value = 5 vram = 1280m vramt.value = 6 vram = 1636m vramt.value = 7 vram = 1792m vramt.value = 8 vram = 2048m end if thanks help. easy, can't seem work out :( you need use elseif on each subsequent line after first if , or use select case instead. if vramt.value = 1 vram = 256m elseif vramt.value = 2 vram = 512m ... end if here's how select case select case vramt.value case 1 vram = 256m case 2 vram = 512m ... end select

linux - Move newly created file -

i have following code , after transcode finishes wish move newly created file. after, don't want write other folder trancodes. why presume using exec better processed if previous exec read true. note there maybe more 1 file in current folder. #!/bin/bash # # change specify different handbrake preset. can list them running: "handbrakecli --preset-list" # preset="appletv 2" if [ -z "$1" ] ; transcodedir="/path/to/folder" else transcodedir="$1" fi find "$transcodedir"/* -type f -exec bash -c 'handbrakecli -i "$1" -o "${1%.*}".mp4 -- preset="$preset"' __ {} \; -exec rm {} \; my little knowledge of linux thought maybe: #!/bin/bash # # change specify different handbrake preset. can list them running: "handbrakecli --preset-list" # preset="appletv 2" if [ -z "$1" ] ; transcodedir="/path/to/folder" else transcodedir="$1" fi...

Changing javascript to jQuery first time Struts 1.3 application -

i changing javascript in project jquery. first time im using jquery , expect me making silly mistakes please. placed simple jq alert function in .js file looks below. $(document).ready(function(){ $("#stt").change(function(){ alert("hi"); }); }); so aim throw alert msg when value of td element id="stt" changed. <tr id="stttr"> <td id="stt"> <html:text property="stt" size="20" maxlength="20" style="height:12px; width: 180px;" /></td></tr> and how im referencing jquery between head tags of jsp. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js"></script> <script src="javascript/searchpaneljq.js"></script> <script src="javascript/calendarpopup.js"></script> the calendarpop.js older javascript file dont want replace (it works fine on browsers). when visit page ...

eclipse - No Mylyn change sets in team>synchronize view (JIRA connector, Kepler, egit) -

this appears similar eclipse juno/mylyn not show change sets in synchronization view , answer doesn't seem apply me, , can't find other relevant hits google or here i have kepler , following installed: eclipse git (3.0.3...) mylyn context connector: team support (3.9.1....) mylyn versions connector: git (1.1.1...) task focused interface eclipse git team provider (3.0.3..) atlassian connector eclipse (3.0.8...) (+ default mylyn stuff @ 3.9.1...) in team>synchronize have models enabled (including change sets) i connect jira happily , can activate tasks, attach files context etc (ie mylyn seems work fine) egit works fine standalone (connecting bitbucket). i followed instructions here: http://wiki.eclipse.org/mylyn/user_guide#task-focused_change_sets but in synchronize view/perspective. never have change set option available. (eg activate task, add files context, modify them, show "modified") the other models seem work fine (eg can select p...

ios7 - iOS 7: detect if App autoupdating is enabled? -

Image
is there api or hack detect whether or not automatic updating has been enabled globally on ios 7? this setting may impact whether or not developers want notify user available app upgrades. example, don't want bug user if running old version of our app, auto-update allowed. thank you! no, there no api. stop developers bugging users don't want upgrade.

sql server 2000 - I have a field in a table with IDs seperated by the | symbol -

i have table userid , licensed_state. data looks like: userid licensed_state 1 |10|11|51|56|73| the values within | | ids states in table tbllicensedstates (id, statename). data looks like: id statename 10 az 11 ca 51 nv 56 or 73 wa i want create view has userid , licensed state list. below. userid licensed states 1 az, ca, nv, or, wa i can not figure out how in create view statement. suggestions? this inherited problem. can not remodel database. have work there. running sqlserver 2000.

Android: Bound Service or Singleton -

im creating offline chatbot , wondering if practice use bound service or singleton parsing/response engine? service , singleton 2 different concepts. we use singleton pattern initiate , use 1 instance only. service component longer-running operation runs in background. bound service : a bound service server in client-server interface. service binds several applications or activities. im creating offline chatbot .. if think develop program talks other application, bear in mind on android, 1 process cannot access memory of process. offer use aidl (android interface definition language)

Eclipse/STS Java editor background color forces white -

i'm new sts (coming intellij). wanted dark theme, installed eclipse color themes plugin , applied theme (obsidian). looks great jsp, xml, html, javascript, properties files... etc. but, when open java file white background. every other color correctly changed (and largely unreadable on white background). it looks (cropped screenshot): http://i.imgur.com/arry0zz.png the dark color on left defined in general --> editors --> text editors: background color searching "background" in preferences, cannot find other place background colors defined java files. i'm using spring tool suite version 3.3.0.release. opened eclipse juno , same thing. please go help->eclipse market place and in find bar, search color. you'll getting "eclipse color theme nodeeclipse...." click install button in under search result. just follow install procedure , complete installation. now go preferences -> general -> appearance -> color...

cocoa touch - How do I change the color of my text in my UINavigationBar on iOS 7? -

Image
how change color of text in uinavigationbar on ios 7? want white instead of black: if you're ok global change, can put in app delegate: nsdictionary *attributes = [nsdictionary dictionarywithobjectsandkeys:[uicolor whitecolor], uitextattributetextcolor, nil]; [[uinavigationbar appearance] settitletextattributes:attributes];

php - Display only specific array elements in a foreach loop -

i have page contains ordering form, on form lists vendor information , each of products vendor underneath , in front of product input field allows user input quantity of each product want. upon submit information goes confirm page need able show order information. on form on order page have hidden field contains vendor id. , vendor id put once each vendor. need able not echo out quantity echo out vendor id specific each order. code below. first block order page , block below confirm page. stands right underneath every quantity displays vendor ids opposed 1 need. <?php defined('c5_execute') or die("access denied."); ?> <div class="ccm-ui"><?php $db= loader::db(); //this loads database helper. loader::model('user'); //this loads user model. $u = new user(); $ui = userinfo::getbyid($u->getuserid()); //this gets user info current user. $usercostcenter = $ui->getattribute('cost_center'); //this sets variable equal ...