Posts

Showing posts from June, 2011

How do you know which parameters to set for a javascript function? -

coming java, javascript can frustrating. i'm hoping can put simple terms me. i'm struggling understand how javascript programmers know parameters pass method they're calling - when method being called callback (which in eyes seems added level of complexity). for example , take function addeventlistener . in function, typical use looks like mydomitem.addeventlistener("click", function(e){...}, false); in documentation function (hyperlinked name above) don't see mention of option. whereas in java can know if parameters match type ide, in javascript seems huge guessing game or requires serious in-depth knowledge of each function. how javascript programmers it? the documentation linked show form in example: target.addeventlistener(type, listener[, usecapture]); the type parameter string "click" , listener function object, , usecapture false .

Twitter bootstrap 3 carousel with fixed background image -

my feeling scrolling background image not pleasant tried fixed background banner , transparent foreground cycling images. tried following solution in case, foreground images hidden right after cycling animation: idea working? <html> <header id="mycarousel" class="carousel slide"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#mycarousel" data-slide-to="0" class="active"></li> <li data-target="#mycarousel" data-slide-to="1"></li> <li data-target="#mycarousel" data-slide-to="2"></li> </ol> <!-- wrapper slides --> <div class="carousel-inner"> <div class="fill" style="background-image:url('banniere2000x400.jpg');"></div> <div class="item active"> <

c# - Publishing Azure Mobile Service doesn't work -

i have azure mobile service works locally , has been thoroughly tested using fiddler. setup reference handling avoid self referencing loops webapiconfig.cs public static class webapiconfig { public static void register() { // use class set configuration options mobile service configoptions options = new configoptions(); // use class set webapi configuration options httpconfiguration config = serviceconfig.initialize(new configbuilder(options)); jsonconvert.defaultsettings = () => new jsonserializersettings { formatting = newtonsoft.json.formatting.indented, referenceloophandling = referenceloophandling.ignore }; config.includeerrordetailpolicy = includeerrordetailpolicy.always; // display errors in browser during development, uncomment following // line. comment out again when deploy service production use. // config.includeerrordetailp

php - Laravel How to Isset _GET -

i'm still new @ laravel. i got problem how can use isset($_get) ? how example: http://virtualhost.com/flytrap/public/location?city=25 ? usually when @ pure php, use: if (isset($_get["submit"])) { $location = $_get["city"]; } to city value. can use query @ database. if use core php method got error. you can use below code $location = request::query('city', false); //insed of $_get['city'];

c - Why getAsyncKeyState() doesn't work well in cmd with quick edit mode -

int getmouseclicked()//if mouse_l_button clicked -> return 1; { if (getasynckeystate(vk_lbutton) < 0) { return 1; } return 0; } when using getasynckeystate() input mouse left button, in test, cmd change select mode after clicked mouse left button. , doesn't print out message called printf() or puts() until press enter or esc . after turn off quick edit mode, print out message after clicked. why doesn't work in quick edit mode when use getasynckeystate() ?

asp.net mvc - @Html.ActionLink is not linking to current area by default -

i have 2 areas admin , frontend (in order). when in view in frontend area, actionlink points admin area: @html.actionlink("checkout", "address", "checkout") will http://localhost:53600/admin/checkout/address checkout controller in frontend area. i know can solve specifying routedata object in action link , setting area = "frontend" don't want to. want actionlink helper default current route. is possible? all questions i've read on actionlink people asking how link area indicates defaults current area them. alone issue? edit, these routes can see tied correct namespace: admin public void registerroutes(routecollection routes) { routes.maproute( "administration_default", "admin/{controller}/{action}/{id}", new { controller = "home", action = "index", area = "administration", id = urlparameter.optional }, new[] { "cc.web.ar

vsto - Getting error when adding programmatically a custom smartart shape in PowerPoint -

i created 3 smartart shapes, , put them folder: "c:\users...\appdata\roaming\microsoft\templates\smartart graphics", , powerpoint load them successfully. can call them ui, if @ beginning once powerpoint opened, , add smartart shape slide programmatically, following error: "the index specified collection out of bounds" however if add smartart shape ui first, there no error if want add smartart shape code after that. my smartart shapes: smartart resources my code is: microsoft.office.core.smartartlayout mylayout = null; try { mylayout = powerpointapp.smartartlayouts["smartartabs3"]; } catch (exception ex) { messagebox.show(ex.message); questionlayout = null; } if (questionlayout != null) { powerpoint.shape smshape = allshapes.addsmartart(mylayout, left, top, width, height); //..... } note: using vs ultimate 2013, powerpoint 2013, c#, add-in-express pretty sure cannot use name index

mysql - How to add data dynamically in a json -

i have form write data , send via ajax 'post' mysql. in same page i've ajax it's 'get', retrieve data , put on table. question is: i've add dynamically data in table when submit form, without have reload page. possible? if yes how? much, here code (without 2 php files -too short lol- if need can post it) <!doctype html> <html ng-app> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title>hey boss</title> <!-- bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!-- warning: respond.js doesn't work if view

android - ResumeTag not working (V2.4.0) -

i exciting use tags , priority property picasso, can't seem make work. got activity loading images and, when conditions met, semi-transparent activity comes in front of activity , load image. when set priority on high second image loading, still downloads first activity's images before loading "main" one. so put tag on first images loading, pause when load other one, , resume when leaving second activity. never resumes. in first activity i've got code : final static string tag_picasso = "com.sien.ur.urstore_firstactivity_fragment"; if (!textutils.isempty(resource)) { picasso.with(parent.getcontext()) .load(resource) .tag(tag_picasso) .resize(wcol, wcol) .centercrop() .placeholder(r.drawable.default_loader_wallpapers) .error(r.drawable.default_loader_wallpapers) .into(holder.imageview); } else { holder.imageview.setimageresource(r.drawable.ur_icons_wp); } here code second activity : public clas

python 2.7 - Web2py 3rd party authentication -

i have made webapp in python using web2py has 3rd party authentication using janrain recommended. on local server worked absolutely fine, when deployed on pythonanywhere , authentication giving me following error "class 'urllib2.urlerror' urlopen error tunnel connection failed: 403 forbidden" stack =========== file "/usr/lib/python2.7/urllib2.py", line 127, in urlopen return _opener.open(url, data, timeout) file "/usr/lib/python2.7/urllib2.py", line 404, in open response = self._open(req, data) file "/usr/lib/python2.7/urllib2.py", line 422, in _open '_open', req) file "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain result = func(*args) file "/usr/lib/python2.7/urllib2.py", line 1222, in https_open return self.do_open(httplib.httpsconnection, req) file "/usr/lib/python2.7/urllib2.py", line 1184, in do_open raise urlerror(err) urlerror: <url

reporting services - SSRS expression with missing column not working -

i'm trying create expression missing column. in column not returned query exist in list of fields. the problem i'm having every time expression , 1 of parameters field doesn't have return query query fails silently. following example looking @ field "test" that, said, exists in list of fields not returned query, how can have statement send "alert"?? =iif(fields!test.ismissing,"alert",fields!test.value) the reason don't return field columns dependent on parameters enter in procedure (so used or not depending on user asking) thank you from reading question think, have dynamic columns returns conditionally should is, 1) create parameter in parameter list , set internal , assign field value parameter, suppose parameter dyanmicfiledvalue 2) change expression as, =iif(isnothing(parameters!dyanmicfiledvalue.value),"alert", parameters!dyanmicfiledvalue.value ) that should it. let me know in case of

r - shiny app gets '400 Bad Request' trying to get data from google api -

as part of shiny app call geocode() ggmap r package. data geocoded , gets result - can see console trying run app locally , log on shinyapps.io dash board. after end of geocode next message: .warning in readlines(connect) : cannot open: http status '400 bad request' error in readlines(connect) : cannot open connection have clue? so turns out has nothing shiny problam sending data google's geocode. when read in data used read.table() . of addresses had apostrophe ' in them, read new line in same cell (i don't know why). i changed data reading use read.csv() , worked fine.

c# - Validation not worked on kendoUI multiselect -

i creating form using mvc4. here used kendo multiselect , try validate through model annotation. my code : @model webapp._2012.models.deviceinventory.devicetechnologymodel <script src="~/scripts/jquery.validate.unobtrusive.min.js"></script> @using (ajax.beginform("create", "device_technologyinventory", new ajaxoptions { httpmethod = "post", onsuccess = "onsuccessaddtechnology" })) { @html.validationsummary(true) <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <@html.labelfor(model=>model.name)</td> <td class="editor-field" width="160px;"> @html.editorfor(model => model.name) @html.validationmessagefor(model => model.name) </td> </tr> <tr> <td>@html.labelfor(model => model.alias)</td> <td class="editor-field&q

Apple Push Notification : Can we remove some text from notification message before it has to be displayed to user on iphone -

i'm using apple push notification service , working fine. want remove text message before has displayed on device. is there way that? the payload data send apns server going display on device. if have remove text must have remove before sending apns server. can not manage notification text message.

multithreading - Nginx with multiple thread FCGI -

could me explain situation using nginx: nginx config: worker_processes 1; worker_rlimit_nofile 1000; // ... worker_connections 1024; multi_accept on; use epoll; location /test_nginx { module_test_nginx; } location /test_fcgi { fastcgi_pass 127.0.0.1:8080; include fastcgi_params; } module_test_nginx module sleep few seconds if request having parameter return "hello world" i make 2 concurrent connections (1 firefox, 1 chrome) 1st request firefox: localhost/test_nginx?sleep=5 -> browser display "hello world" after 5 seconds 2nd request chrome: localhost/test_nginx?sleep=1 -> browser display "hello world" after 5 seconds waitting 1st request , 1 second sleep parameter i changed worker_processes 2, then: 1st request firefox: localhost/test_nginx?sleep=5 -> browser display "hello world" after 5 seconds 2nd request chrome: localhost/test_nginx?sleep=1 -> browser display

r - End of previous quarter / last day of previous quarter -

using lubridate , how calculate last day of previous quarter given date? below formula doesn't seem work nov 3rd, 2014 (other dates work) library(lubridate) date = as.posixct("2014-11-03") date - days(day(date)) - months(month(date) %% 3 - 1) # na interesting enough, changing order works: date - months(month(date) %% 3 - 1) - days(day(date)) # "2014-09-30 utc" here possibilities functions packages zoo , timedate , , base r. zoo code improved @g.grothendieck, , suggested base alternative (thanks lot!). leave lubridate solution(s) else. first, use class yearqtr in package zoo represent quarterly data. may use as.date.yearqtr , frac argument "which number between 0 , 1 inclusive indicates fraction of way through period result represents. default 0 means beginning of period" (see ?yearqtr , , ?yearmon frac ). step step: library(zoo) date <- as.date("2014-11-03") # current quarter current_q <- as.yearqtr

php - How post to facebook fun page by api? -

hi have problem facebook api. use graph api method /page-id/feed [message] => '' posted not in timeline, , account name. need post name of fun page name. you'll need use page access token in order perform actions on behalf of page. using user access token , why post created account

ios7 - Prepareforsegue vs Storing in Dictionary. Using Swift, Xcode 6. Best practice? -

i'd know why use prepareforsegue if can store data in dictionary? it seems easier if initialize dictionary in first view controller , add/edit/remove in subsequent view controllers. i'd know if bad practice or either work fine? i'm using dictionary pass data forward , backwards view controllers. thanks in advance response.

html - CSS Overlow doesn't appear to be honored -

i have read number of questions on here pertaining overflow property. seems straightforward enough, basic expectations not getting met. consider code below. i've got tall div specified this: <div class="blue fixed-height1000">big</div> it appears inside div should clipping it: <div class="cell yellow overflow-hidden fixed-height100"> but tall div not clipping. why? my understanding that, since parent 100 pixels tall no overflow allowed, child, 100 pixels tall, not appear onscreen 1000 pixels tall. but not happening. entire 1000 pixels visible, causing page scroll. here guesses why happening: the parent overflow property display:table-cell , overflow works on display:block? or, parent flexibly height because part of table fits page, , overflow works on fixed sizes? (even though experimentation tried force height on table cell anyway see if force overflow work) .fixed-width100 {width:100px;} .fixed-height75 {height

performance - Java ReplaceAll vs For loop with Replace in it -

i have string holds data , need remove of special characters , tokenise data. which of following 2 methods should preferred better performance: string data = "random data (for performance) waiting reply?" data=data.replaceall("?", ""); data=data.replaceall(".", ""); data=data.replaceall(",", ""); data=data.replaceall("(", ""); data=data.replaceall(")", ""); string[] tokens = data.split("\\s+"); for(int j = 0; j < tokens.length; j++){ //logic on tokens } or string data = "random data (for performance) waiting reply?" string[] tokens = data.split("\\s+"); for(int j = 0; j < tokens.length; j++){ tokens[j]=tokens[j].replace("?", ""); tokens[j]=tokens[j].replace(".", ""); tokens[j]=tokens[j].replace(",", ""); tokens[j]=tokens[j].replace("(&qu

javascript - in wordpress request.open('GET', 'data.json',true); not working. why? -

hi making wordpress plugin can bring names of products json file if writes products name search bar. think data.json not getting ajax in wordpress. path defining syntax error guess. $.getjson('data.json', function(data) following complete scripting code , working fine in php website not in wordpress.: `jquery('#search').keyup(function(){ var searchfield = jquery('#search').val(); var myexp = regexp(searchfield,"i"); jquery.getjson('data.json', function(data){ var output= '<ul class="searchresult">'; jquery.each(data, function(key, val){ if((val.name.search(myexp) != -1) || (val.category.search(myexp) != -1)){ output += '<li>'; output += '<h2>' + val.name + '</h2>'; output += '<img src="images/'+val.image+'.jpg" alt="sorry image"/>'; output += '<p>'

ajax - Rails: return only json -

in app there list of items can upvote. want make these votes ajax calls. this view: <ul class="list-groups"> <% @questions.each |question| %> <li class="list-group-item"> <%= link_to question.description, question_path(question) %> <%= form_for(question, :url => url_for(:controller => 'vote', :action => 'vote'), method: :post, html: { class: 'form-inline' }) |f| %> <%= f.submit 'up vote', class: "btn btn-default" %> <%= f.hidden_field :id, :value => question.id %> <% end %> </li> <% end %> </ul> and method it: class votecontroller < applicationcontroller respond_to :json def vote question_id = params[:question][:id] user_id = current_user.id vote = vote.where(["question_id = :q", { q: question_id }]).where(["user_id = :u", { u: user_id }]) respond_

jpa - How to handle CURRENT_DATE in Where clause -

can me implement following query in jpa. select * location create_tmstp < sysdate - 10; it throwing following error while converting this. exception description: syntax error parsing [select l location l l.createtmstp < (current_time - 100) ]. left expression not arithmetic expression.

excel - Web API 2 and OData Security -

i have web application exposing rest api using web api 2. i need expose odata feeds specific entities. excel 2013 needs supported using odata feed, have use odata v3 i can't find how secure odata endpoints properly. using authorize attribute, excel says feed not valid while can still data in browser. any clue? various authentication methods can found@ http://blogs.msdn.com/b/odatateam/archive/tags/authentication/ , please check out.

javascript - Sorting Observable Array in Knockouts JS -

ok... i'm using twitter bootstrap. have observable array represents set of groups. in ui, observablearray being used render "tab" , "tab-pane" each group. can sort , display these groups name property, no probs, doddle right! <ul data-bind="foreach: myarray().sort(function (l, r) { return l.name() > r.name() ? 1 : -1 })" class="nav nav-tabs" role="tablist"> <li data-bind="text: name"></li> </ul> that's great... however, have 'all' object in same array needs @ beginning of set of tabs being displayed. tabs looks this... | | b | c | d need this... | | b | c | d any ideas? :-/ tweak sort function. in oo fashion, "all" object have property indicates should ordered @ top. alternatively, quick , dirty way go tweak sort function this: function (l, r) { if (l.name === "all") return 1; if (r.name === "all") return -1; ret

mysqli - SQL get number of hours on previous rows -

i working on query extracts information store opening , close time. resultset: rtl_loc_id trans_typcode begin_datetime ---------- ------------------------------ --------------------------- 2390 workstation_open 14.10.01 09:53:43,121000000 2390 workstation_close 14.10.01 23:51:49,729000000 2390 workstation_open 14.10.02 09:57:47,768000000 2390 workstation_close 14.10.02 23:47:00,120000000 2390 workstation_open 14.10.03 09:47:38,949000000 2390 workstation_close 14.10.03 23:45:42,602000000 6 rows selected this query: select rtl_loc_id,trans_typcode, begin_datetime trn_trans where(trans_typcode = 'workstation_open' or trans_typcode='workstation_close') , business_date between '14.10.01 00:00:00' , '14.10.03 00:00:00' order business_date, begin_datetime asc; so need calculate number of hours betw

javascript - All click event handlers firing when a single click event triggered -

i've tried organize javascript using iifes make things more modular. however, i'm getting strange behaviour can't explain. i have 2 divs: <div id="one">foo</div> <div id="two">bar</div> i have iifes to: lazy-load , cache elements define event listeners bind event listeners handle initialization i try assign click handler each div , when click on either div , handlers fire. why? http://jsfiddle.net/u61vet1g/ (function(foobar) { foobar.elements = (function() { var one, two; return{ one: function(){ return 1 || (one = $('#one')); }, two: function(){ return 2 || (two = $('#two')); } } })(); foobar.eventlisteners = (function(elems){ return { oneonclick: function(e) { alert('1'); }, twoonclick: function(e

how to add a CSS class inside a JavaScript setup code? -

i need javascript help. i have slider script : stepcarousel.setup({ galleryid: 'mygallery', //id of carousel div beltclass: 'belt', //class of inner "belt" div containing panel divs panelclass: 'panel', //class of panel divs each holding content autostep: { enable:true, moveby:1, pause:3000 }, panelbehavior: { speed:500, wraparound:false, wrapbehavior:'slide', persist:true }, defaultbuttons: { enable: true, moveby: 1, leftnav: ['arl.png', -5, 80], rightnav: ['arr.png', -20, 80] }, statusvars: ['statusa', 'statusb', 'statusc'], //register 3 variables contain current panel (start), current panel (last), , total panels contenttype: ['inline'] //content setting ['inline'] or ['ajax', 'path_to_external_file'] }) and want defaultbut

php - Slow Paypal IPN by 3 seconds -

i have paypal ipn system in place. payment system works well, takes t required amount of money fine, ipn slightly off. i've done timestamps on time ipn connects site , time load /shop/thanks page - , here data: ipn: [1416406186 // 14:09:46 19-11-14] papypal.php runtime: 1 seconds. (start time: 1416406185 / end time: 1416406186) /shop/thanks error: [1416406183 // 14:09:43 19-11-14] /shop/thanks error - not display thank message. three seconds . if go straight through paypal process website 3 seconds before paypal updates me via ipn. if go through correct thank you page. i haven't encountered problem before. can sort out? runtime of paypal.php script 1 second, it's not taking long update database. you can't. ipn supposed asynchronous. supposed "thank payment, notify when payment complete." but why? because let's decide pay echeque, ie. directly bank account through paypal. echeques may take six ten days clear. ipn may s

html - Looking for a way to position block elements in a line, but design falls apart at 25% zoom -

i designing page, , run problem, can not solve on own. on zooming out, items in header moving vertically, @ 25%, elements in wrong position. using block display, because want menu items move center on zoomout(like on facebook, twitter or here), inline , inline-block not solving problem. same reason on relative positioning. is there way achive same effect instead of relative positioning? any ideas how make right? cheers andrew html: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css" media="screen"> </style> <title>layout</title> <link href="../content/layout.css" rel="stylesheet" /> </head> <body> <div id="menucontainer"> <div id="wrapper"> <a href="http://www.google.com" class="lc"> <p class="l"> </p>

eclipse - Android Build - Select app name and icon at compile time -

i have developed stock control app in android used many people. each of them have same app in core different icon , different name. so have decided have 1 project in eclipse (stock control) , when x person needs app build apk based on eclipse project @ same time deciding specific icon , specific app name. so thing change between compiled apks app name (strings.xml?) , icon (drawable-?dpi/ic_launcher). i need command line console or like: makeapk projectname scenario: we have the android (eclipse) project: stock folders stocknorth , stocksouth, each 2 folders inside: values , drawable so when run magic command makeapk stocknorth compiles stock project except values , drawable folders, because picks them stocknorth folder. then apk custom icon , strings . is possible? edit: should follow this? eclipse building android app: how can create 2 versions/editions @ compile-time? edit 2: idea have 1 project , not create 1 each time nee

Change bash file path to root dir - in Ubuntu 11.10 -

i have bash file located in "/media/enigma2/bin" named "enigma2". when run bash file, in application logically shown path: "/media/enigma2" base path. (inside "/media/enigma2" usr,share etc. folders) because of plugin incompatibility inside application need rename path (but seemingly) root dirname, base path called "/" inside application. i absolute beginner linux , sorry bad english.

c - using a method from another file without including it -

this question has answer here: why #include <stdio.h> not required use printf()? 3 answers i have 2 .c files compile on makefile. foo.c: void foo() { printf("this foo"); } main.c: #include <stdio.h> int main() { printf("this main\n"); foo(); } the makefile looks that: all: main.o foo.o gcc -o prog foo.o main.o main.o: main.c gcc -c main.c foo.o: foo.c gcc -c foo.c so question is: how can foo.c use printf() without me including stdio.h , how can main.c use method foo() without me including foo.c. my guess/research makefile works linker. dont have prove , want understand how works excactly. correct me if misunderstood something. in compilation phase, compiler checks function calls against prototypes. function lacks prototype assumed return int , accept number of arguments. if turn

mysql - grails - Downloading PDF getting empty file -

i'm storing files within mysql database. corresponding domain class looks follows: import org.springframework.web.multipart.commons.commonsmultipartfile import grails.persistence.entity @entity class document extends baseclass { string documentreference commonsmultipartfile cmffile static constraints = { documentreference nullable: true, maxsize: 500 } static mapping = { cmffile sqltype: "mediumblob" } } i managed store different files within table in database. want enable user download of these files using following action: def download(document documentinstance) { if (documentinstance == null) { notfound() return } response.setcontenttype(documentinstance?.cmffile?.contenttype) response.setheader("content-disposition", "attachment;filename=${documentinstance?.cmffile?.originalfilename}") response.outputstream << documentinstance?.cmffile?.getbytes() r

select - PostgreSQL query not working via ODBC (invalid object name) -

i'm stuck @ irritating message postgresql. can connect server correctly through odbc, attempt of runnig common select query ends message "invalid object name 'some_view'" (where 'some_view' view should able read data). what's interesting, query works fine when executed via pgadmin. [edit] the project in mfc. use crecordset . tried using options crecordset::executedirect , crecordset::nodirtyfieldcheck , no success. seems problem caused mfc and/or crecordset class. when tried connect , execute same query using same dsn .net app, works fine. [edit2] pasted content of both postgres logs: 1) mfc app: [0.000]conn=05e711f8, pgapi_driverconnect( in)='dsn=mpk_local;uid=my_uid;pwd=my_pwd;', fdrivercompletion=1 [0.000]dsn info: dsn='mpk_local',server='localhost',port='5432',dbase='mpk_sql',user='my_uid',passwd='xxxxx' [0.000] onlyread='0',protocol='7.4',showoid=&#

Dropbear SSH Tunnel disconnected if upload a file -

i newbie here. want create ssh tunnel application, have problem application. if trying upload file (>500kb) trough ssh tunnel, internet connection getting not responding , after i'm disconnected server. problem? ssh server have limit upload connection? *i use dropbear ssh server

ruby on rails - ActiveModel Serializer sending all records instead of specified limited amount -

i have controller looks this: class metricscontroller < applicationcontroller def index org = current_user.organization metrics = metric.where(organization: org).last(100) render json: metrics, status: 200, include: [:organization] end end metrics model: class metric < activerecord::base belongs_to :organization end organization: class organization < activerecord::base has_many :metrics end metricserializer: class metricserializer < activemodel::serializer embed :ids attributes :id, :provisioned_users, :connected_users, :created_at has_one :organization end organizationserializer: class organizationserializer < activemodel::serializer attributes :id, :name, :org_id, :gauth_enabled has_many :metrics end the json though gets returned organizations: [ { id: 1, name: "acme", org_id: "org_id232323", gauth_enabled: "f", metric_ids: [ 1, 2, 3, .

php - How to include comments under posts in a clean build template? -

i new wordpress theme development , building building first 1 scratch, have hit issue adding comments blog posts. i have loop returns each post: <div class="eachpost"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <article <?php post_class(); ?> id="post-<?php the_id(); ?>"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title_attribute(); ?>"><?php the_title();?></a></h2> <p class="entry-meta">by <?php the_author_meta('first_name'); ?> <?php the_author_meta('last_name'); ?> in <?php the_category(", ") ?></p> <p class='right'><a class='comments-count' href='<?php the_permalink() ?>'><?php comments_number('0', '1', '%') ?

jquery - Select2js does not work with multiselect and data array -

i have spent hours trying make work does! able select first item; not 2nd item or more. here code. $(document).ready(function() { function format(item) { return item.fullname; } $("#mytest1").select2({ data: { results: [ { memberid: 1, fullname: "user1 last" }, { memberid: 2, fullname: "user2 last" }, { memberid: 3, fullname: "user3 last" }, { memberid: 4, fullname: "user4 last" } ], text: 'fullname' }, id: function (obj) { return '#mytest1'; }, formatselection: format, maximumselectionsize: 3, initselection: function (element, callback) { console.log("init selection", element); var data = []; $(element.val().split(",")).each(function () { data.push({id: this, text: this}); }); callback(data); }, //minimuminputlength: 1, multiple: true,

database - Find the points using Oracle spatial directly in front of a polgon -

i have many polygons , many points , want find point such when line drawn between point , polygon not intersect other polygon. need point close polygon , no other polygon between them. i tried following query , gives me points whether or not being intersected polygon or not. select p.pointloc pointtable p not mdsys.sdo_overlapbdyintersect(p.pointloc," + "mdsys.sdo_geometry(2003,null,null,mdsys.sdo_elem_info_array(1,1003,1)," + "mdsys.sdo_ordinate_array(4, 226, 150, 254, 164, 240, 191, 212, 176,4,226))) = 'true'"; tried query , gives correct points miss few correct points: select p.pointloc pointtable p mdsys.sdo_within_distance(p.pointloc," + "mdsys.sdo_geometry(2003,null,null,mdsys.sdo_elem_info_array(1,1003,1)," + "mdsys.sdo_ordinate_array(4, 226, 150, 254, 164, 240, 191, 212, 176,4,226)),'distance = 40') = 'true'"; can 1 point out oracle spatial operator best suited s

soap - How to expose an existing wsdl in Switchyard -

i have wsdl , want expose service soap binding in switchyard. can 1 tell how expose wsdl in switchyard. also want know how expose multiple wsdls in switchyard. in order expose wsdl in switchyard, can follow below steps : 1) need drag service icon palett. 2) select interface type wsdl. 3) browse location of wsdl , click finish. that's it. 4) exposing service soap binding, drag soap icon palett service icon. you may refer below link on how expose multiple wsdls : https://developer.jboss.org/message/910909#910909

jquery - have to shift tabindex between two HTML elements -

<div class=" yellow" data-name="notes" title="view notes"> <div class="title"> <h3 id="notesid" >notes</h3> <div class="info"> <a href="#" id="clear-notes" title="clear notes">clear</a> </div> </div> <div class="body"> <div class="content-area notes-area resizeble" style="height: 130px;"> <textarea title="notes" id="notes-textarea" rows="5" cols="15">notes</textarea> </div> </div> </div> in code, have div 2 focusable elements---- anchor element , text area. default focus first on anchor , on textarea need exchange focus. according me , textarea wud first element focus , anchor element second. can

If statement in Bash creates weird 0 file -

when run following command: if [ $(vboxmanage list vms | grep -c "all-in-one-1.2.7-wizard") > 0 ]; echo 'yes' else echo 'no' fi a 0 file created in current directory: $ ll ... -rw-rw-r-- 1 abc abc 0 nov 19 17:33 0 any idea why happening? you not doing integer comparison, redirecting output of command $() 0 , file 0 name created. also, current "resolution" of if-condition based on result of execution of condition. if successful, executes condition. instead, use -gt ( g reater t han): if [ $(vboxmanage list vms | grep -c "all-in-one-1.2.7-wizard") -gt 0 ]; ^^ echo 'yes' else echo 'no' fi you can make sure behaviour doing >7 or whatever , see file 7 (or whatever) gets created. when else condition executed? if couldn't redirect: $ [ $(ls /root) > 3 ] && echo "yes" || echo &

rally - Tree Grid with Portfolio Items -

is possible build rallytreegrid xtype using portfolio item models through treestorebuilder? able build rallyportfolio tree portfolio items, have had trouble building tree grid type of object. the following code not render tree grid or produce error. same code, 'user story' instead of 'portfolioitem/area' work correctly: launch: function() { ext.create('rally.data.wsapi.treestorebuilder').build({ models: ['portfolioitem/area'], autoload: true, enablehierarchy: true }).then({ success: this._onstorebuilt, scope: }); }, _onstorebuilt: function(store) { this.add({ xtype: 'rallytreegrid', context: this.getcontext(), store: store, columncfgs: [ 'name', 'owner', 'description' ] }); }

xml namespaces - How do I have the .NET framework parse a double empty xmlns element? -

i have webservice connecting (asmx) reason spits out looks this: <somerecord xmlns="" xmlns=""> ... </somerecord> the parser seems puke on double empty xmlns in soapclient itself. note capitalization of 1 element (which can confirm ilspy of code hard constructing element). how can parse programmatically without blowing up? need interrupt stream , kill double xmlns myself? how ...

lambda - scheme chicken implementation, subenvironment script loading -

background i using scheme chicken implementation. latest version (4.9.0.1). i trying implement generic arithmetic system on rational, complex , fix-precision numbers in file called arithmetic.scm . but complex numbers, designed generic arithmetic system both rectangular , polar representations, decide write code complex number in file called complex.scm . problem so when try load complex.scm file arithmetic.scm , found functions have same name in both files, want use lambda wrap former sub environment , register operators there using property list. however, load command can load script global environment no matter writen. wonder, other renaming functions or copy code complex.scm lambda function, other options have. lot! you should indeed use module system such situations, chris jester-young indicated. however, have seen numbers egg ? adds full numeric tower support (including rational numbers, arbitrarily large integers , complex numbers). extension can inst

javascript - Mongo 2.6 isMaster() result after setting readPref to secondary -

we upgraded mongo 2.4 2.6 , have noticed our connection code staying primary host instead of connecting secondaries. despite following commands. var connecthost = "rscomplex/complex0,complex1,complex2/data"; var maindb = connect(connecthost); maindb.getmongo().setreadpref("secondary"); maindb.ismaster() produces master { "setname" : "rscomplex", "setversion" : 77003, "ismaster" : true, "secondary" : false, "hosts" : [ "complex1:27017", "complex0:27017", "complex2:27017" ], "primary" : "complex1:27017", "me" : "complex1:27017", "maxbsonobjectsize" : 16777216, "maxmessagesizebytes" : 48000000, "maxwritebatchsize" : 1000, "localtime" : isodate("2014-11-19t16:23:21.612z"), "maxwireversion"

javascript - How can I check if an API token is still valid -

i'm using token api, problem when token invalid (time live < 0) there's no way know it, go on , fill out form , when submit message "invalid token" annoyin. idea write script checks token's time live every 10sec example , if it's invalid can disable forms example or display box force user reload page. maybe guys have better ideas , please don't hesitate share. you can in simple way, guess have "expiration time" set on server side token. can return time , have js function check value every x seconds or on every required action (open pop/form/etc). probably when return token json can like { token:"1234567890", expire: "1427484624" //timestamp in seconds, easier compare } then js function can simple as: function isvalidtoken(token){ cts=math.floor(date.now() / 1000); return (token>=cts); } and way can know easily.

java - What is the "correct" way to have a Spring MVC controller return an excel xslx spreadsheet -

i have come @ least 3 different ways handle this. 1) use @responsebody , return string csv: @requestmapping(value = "googlestorereport", produces = "text/csv") @responsebody public string googlestorereport(httpservletrequest request, httpservletresponse response, model model) { list<store> stores = storeservice.getactivestores(); list<sapstore> sapstores = sapstoreservice.getallsapstores(); response.setheader("content-disposition", "attachment; filename=\"google_places_bulk_store_upload.csv\""); response.setcontenttype("text/csv"); stringbuilder sb = new stringbuilder(); .... create file contents .... return sb.tostring(); } 2) use view described here: (i have create own version of spring abstractexcelview) http://www.technicalkeeda.com/spring-tutorials/generate-excel-using-spring-mvc approach here have controller return modelandview object list of objects containing row data. h