Posts

Showing posts from April, 2013

html - Responsive Form on top of Responsive Image? - Bootstrap -

i trying place form on top of responsive image, , want form responsive , resize in relation image currently image responsive cannot form stick in 1 place on image , resize in same position is possible? current code: http://www.codeply.com/go/ffgsrfictx the following correspond form section of page have provided. i have removed image element , used resource link background-image of form element. form fields wrapped bootstrap classes. a min-height has been set on form element prevent distortion of background image. html: <!--- bootstrap style sheet --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> <!-- form section --> <section id="contact class" class="container content-section text-center"> <h1 class="brand-heading">contact</h1> <div class="container-fluid"> <div class="row">...

ruby on rails - undefined method `popups_path' for # -

i create model, view , controller when added form code on new.html.haml file. started showing error. routes defined follows model popups.rb class popups < activerecord::base attr_accessible :title, :body, :slug, :pipelinetype end controller popups_controller.rb class popupscontroller < applicationcontroller def new @popups = popups.new end def create @popups = popups.new(params[:url]) if @popups.save flash[:popups] = @popups.id redirect_to new_popups_url else render :action => "new" end end def show @popups = popups.find(params[:id]) redirect_to @popups.url end end views popups - new.html.haml = simple_form_for @popups |f| = f.input :title = f.input :body = f.input :pipelinetype = f.input :slug = f.submit routes.rb resources :popups, :only => [:show, :new, :create] migrate file create_table :popups |t| t.string :title t.text :body t.string :slug ...

javascript - Angularjs issue $http.get not loading image -

i'm trying create ionic application uses gallery. i'm unsure why image isn't being loaded application. what i'm trying develop gallery loads images json file. here's html <ion-view view-title="gallery" align-title="center"> <ion-content ng-controller="photoctrl" ng-init="getimages()"> <div class="row" ng-repeat="image in images" ng-if="$index % 4 === 0"> <div class="col col-25" ng-if="$index < images.length"> <img ng-src="{{data.images[$index].src}}" width="100%" /> </div> <div class="col col-25" ng-if="$index + 1 < images.length"> <img ng-src="{{data.images[$index + 1].src}}" width="100%" /> </div> <div class="col col-25" ng-if="$index + 2 < images.length"...

ruby on rails - API test writes in dev db but reads in test db -

i'm trying test api airborne the call api works , create user, in dev db : there no log of creation , find using rails c. but when user.find in test, searches test db : there logs , doesn't find user. here's test : require 'rails_helper' describe 'register#create' 'should create new user' post '/register', { email: 'mail@mail.fr', password: '12345678', password_confirmation: '12345678' } puts response.body expect_status 200 expect(user.find_by_email('mail@mail.fr')).to exist end end here's method i'm trying test : class registrationscontroller < devise::registrationscontroller respond_to :json skip_before_filter :verify_authenticity_token acts_as_token_authentication_handler_for user skip_before_filter :authenticate_entity_from_token!, only: [:create] skip_before_filter :authenticate_entity!, only: [:create]...

jquery - How do i edit a Javascript / Bootbox/ Bootstrap confirm window? -

i have simple bootbox / javascript confirm window at: https://www.guard-gate.com/test2/index.html how make success button link google, danger button link yahoo.com , click me button close box? how change position of window in middle of page? you try setting modal in middle: var windowheightcalc = $(window).height() / 2, modalheightcalc = $('.modal-content').height(); $('.modal').css({ 'margin-top': [windowheightcalc - modalheightcalc, 'px'].join('') }); you don't need bootbox making modal use default bootstrap modal - http://getbootstrap.com/javascript/#modals you can modify , change links wish. open run: $('#mymodal').modal('show'); and hide it: $('#mymodal').modal('hide');

Visual Studio C++ project - Can't find std lib -

sorry dumb question i'm new using visual studio c++ ... i have custom c++ project in visual studio 2013 (it's example project developing reason rack extensions) , works have resharper installed , shows me lot of errors in code pointing out std files , types aren't found (e.g. stddef.h , cmath , null , among others). how tell project (or resharper?) find them?

Is there a way to optimize this x86 assembly code? -

assume given values in eax,ecx. write piece of code calculates 5*eax + 3*ecx + 1, , stores result inside eax. (* means multiplication here). my code : ;initialize values in eax , ecx mov eax,3 mov ecx,4 ;compute 3*ecx mov ebx,eax mov eax,ecx mov edx,3 mul edx ; compute 5*eax mov ecx,eax mov eax,ebx mov edx,5 mul edx ; compute 5*eax + 3*ecx + 1 lea eax,[ecx + eax] inc eax if "optimize" mean optimize instruction count, sure, use lea more: ;initialize values in eax , ecx mov eax,3 mov ecx,4 ;compute 3*ecx lea ecx,[ecx*2 + ecx] ; compute 5*eax lea eax,[eax*4 + eax] ; compute 5*eax + 3*ecx + 1 lea eax,[ecx + eax + 1] this 16 bytes less in machine code size if eyes serve me right. the rules governing can compute lea listed in section specifying offset in intel's manuals .

Sed insert back reference into command -

can use matched group sed command, command, generates replacement. that: sed -e 's/\(<regex>\)/$(<command using \1 reference , generating replacement>)/g' i need replacement in first file, according file contents (replacement not constant , based on concrete replaced line). as @etanreisner mentions, possible gnu sed -- , still tricky. also, potentially dangerous, , should use if input comes trustworthy source. anyway, e modifier s/// command treats contents of pattern space after substitution made shell command, runs it, , replaces pattern space output of command, means output have shunted place manually. general pattern is sed '/regex/ { h; s//\n/; x; s//\n&\n/; s/.*\n\(.*\)\n.*/command \1/e; x; g; s/\([^\n]*\)\n\([^\n]*\)\n\(.*\)/\1\3\2/ }' filename let's go through top: /regex/ { # when find seek: h # make copy of current line in ...

javascript - Isotope v2 responsive layout behaving strangely -

i'm trying make fitrows grid isotope v2. single grid items have percent width of 50% adapts screen size making responsive. layout works good, when filter or resize window width manually, single grid elements move strangely. in particular external right ones shift right , came back. suggestion on how can fix problem? update: on chrome , firefox seems work fine, on safari broken. can't test on internet explorer. the full code on jsfiddle . html <body> <div id="filters" class="button-group"> <button class="button is-checked" data-filter="*">all</button> <button class="button" data-filter="semantics">semantics</button> <button class="button" data-filter="ai">ai</button> <button class="button" data-filter="text">text</button> <button class="button" data-filt...

actionscript 3 - php bloack as3 after trying load variables in setinterval loop -

php bloack as3 after trying load variables in setinterval loop. guess title explain all. have flash widget use urlloader grab php variables , works perfect urlloader in setinterval loop happens every 2 mins problem work several times after php blocks ip loading variables (using flash widget) , gives no response. tried search subject found nothing flash outdated using flash in place dont support except flash no js... idk problem got huge feeling server side issue , idk how fix it. thought share issue here maybe can help. btw blocks ip of user been using flash long not after 2-3 mins unblocks ip again , works again btw when ip blocked php error return flash: 2101: string passed urlvariables.decode() must url-encoded query string containing name/value pairs. and searching found means flash got nothing php request. the as3 code simple that: submit_btn.addeventlistener(mouseevent.click, btndown); function btndown(event:mouseevent):void { var variables:urlvaria...

r - ggvis tooltip with layer_paths -

this simple example of data: df1 <- structure( list( x = c(1250, 2500, 3750, 5000, 6250, 7500, 8750, 10000), y = c( 0.112151039933887, 0.0792717402389768, 0.064716676038453, 0.0560426379617912, 0.0501241024200681, 0.0457556453076907, 0.0423607088430516, 0.0396242625334144 ) ), .names = c("x", "y"), row.names = c(na,-8l), class = "data.frame" ) i want create smooth line tooltip shows values x , y. i'm doing right now library(ggvis) library(dplyr) all_values <- function(x) { if(is.null(x)) return(null) row <- smoothed[smoothed$id == x$id, ] paste0(names(row), ": ", format(row), collapse = "<br />") } smoothed <- df1 %>% compute_smooth(y ~ x) %>% rename(x=pred_ , y=resp_) smoothed$id <- 1:nrow(smoothed) smoothed %>% ggvis(~x, ~y, key:= ~id, stroke := "red", strokewidth := 5) %>% layer_paths() %>% add_tooltip(...

node.js - Correspondence between curl command and node's request -

how can execute curl shell command curl --data "{\"obj\" : \"1234556\"}" --digest "https://username:password@www.someurl.com/rest-api/v0/objectpost" correctly returns expected values using node's request package? tried post options got no success: var request = require('request'); var body = {"obj" : "1234556"}; var post_options = { url: url, method: 'post', auth: { 'user': 'username', 'pass': 'password', 'sendimmediately': false }, headers: { 'content-type': 'text/json', 'content-length': json.stringify(body).length, 'accept': "text/json", 'cache-control': "no-cache", 'pragma': "no-cache" }, timeout: 4500000, body: json.stringify(body) } request(post_options, callback); this way body no...

shell - Why are there duplicate files when extracting tar.gz archive -

i have strange problem tar.gz archives not understand. i create archive on linux server tar -czf when extract them on windows machine using 7z x , notifications (not all) files exist. (they extracted empty directory.) the files wants replace have todays date, ones there have original (modified on) date had on server. since want preserve original timestamps can use -aos option 7z, understand why happening , make sure have identical mirror of files on server after unpacking locally. :d problem derelict duplicate directory exists both uppercase , lowercase on linux server - of course can 1 directory when extracted on windows system ( \mydir\ , \mydir\ ) problem solved. :) thanks help!

facebook - Why Social metrics are different for orginal url and utm_source tagged url? -

recently want boost particular webpage in facebook. tracking purpose added utm code using google url builder. since our post received ans shares. next moment realized mistake adding utm webpage. check below images likes & shares original blog post http://sharetally.co/147697/ likes & shares blog post tagged utm code http://sharetally.co/147698/ i thought receive likes , shares original blog post mistake?

javascript - Angular transclude/replace equivalent in UI-Router -

i have started using angular ui-router . i wanted know, when specifying templateurl , can see template injected element of ui-view , example: <div ui-view="mystate"></div> .state('mystate', { url: '/mystate', templateurl: 'partials/my-state.html' }) results in: <div ui-view="mystate"> <section class"ex1 exa"> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> </section> </div> when after is: <section class"ex1 exa"> <p>lorem ipsum lorem ipsum</p> <p>lorem ipsum lorem ipsum</p> ...

html - Overlapping elements - Form in front, but cursor goes behind -

i have form input field. while input field comes in front, text cursor seems go behind. have tried various z-index combinations, don't help, object in front. how cursor in front? know i'm doing trivially wrong, i'm not able place it code snippet: .searchbox { background-color: #7e7e7e; border: medium none; color: #fff; font-family: arial; font-size: 12px; font-style: italic; font-weight: 600; height: 24px; padding-left: 10px; position: absolute; width: 38.7%; z-index: 3000; } .searchiconbox { background-color: #7e7e7e; height: 24px; margin-top: 0; padding-left: 5px; padding-top: 3px; width: 5%; } <div style="width:49%;"> <form style="width:94%;" class="pull-left"> <input type="text" class="searchbox" placeholder="search"></input> </form> <div class="pull-right searchiconbox"> ...

.htaccess - Change Dynamic Url using htaccess in codeigniter -

i have following url structure: www.mysite.com/temporary/articles.php/artid=1 i change with: www.mysite.com/temporary/articles/article-title-here. where article-title should based on artid . can tell me how can that? no .htaccess needed. create controller method , add routes. use following approach: you submit following url: www.mysite.com/temporary/articles.php/artid=1 ci catches , reroutes such: in routes.php: $route['temporary/articles.php/artid=(:any)'] = "temporary/articles/search_by_id/$1"; in controller: class articles extends ci_controller { public function index($title){ //load model //from model, query database article info title //send results view. } public function search_by_id($id){ //load model //from model, query database article title id. set = $title redirect("temporary/articles/$title") } }

date - Converting from Milliseconds to UTC Time in Java -

i'm trying convert millisecond time (milliseconds since jan 1 1970) time in utc in java. i've seen lot of other questions utilize simpledateformat change timezone, i'm not sure how time simpledateformat, far i've figured out how string or date. so instance if initial time value 1427723278405, can mon mar 30 09:48:45 edt using either string date = new simpledateformat("mmm dd hh:mm:ss z yyyy", locale.english).format(new date (epoch)); or date d = new date(epoch); whenever try change simpledateformat this encounter issues because i'm not sure of way convert date or string dateformat , change timezone. if has way appreciate help, thanks! try below.. package com.example; import java.text.simpledateformat; import java.util.date; import java.util.timezone; public class testclient { /** * @param args */ public static void main(string[] args) { long time = 1427723278405l; simpledateformat sdf = new simpledateformat(); sdf.set...

java - How to call write() function of ConnectedThread class of android bluetooth from main activity -

i want know how call write function of connectedthread class main activity java file public static class connectedthread extends thread { public final bluetoothsocket mmsocket; private final inputstream mminstream; private final outputstream mmoutstream; public connectedthread(bluetoothsocket socket) { mmsocket = socket; inputstream tmpin = null; outputstream tmpout = null; // input , output streams, using temp objects because // member streams final try { tmpin = socket.getinputstream(); tmpout = socket.getoutputstream(); } catch (ioexception e) { } mminstream = tmpin; mmoutstream = tmpout; } public void run() { byte[] buffer = new byte[1024]; // buffer store stream int bytes; // bytes returned read() // keep listening inputstream until exception occurs while (true) { try { // read inputstream ...

javascript - Pushing into JSON suddenly not working [RESOLVED] -

i'm beginner in angularjs, , have problem pushing array inside json. (i hope i'm using correct terminology) //i have json looks var items = [ {name:[ {names: 'john', msg:[""]}, {names: 'dolly', msg:[""]} ]} ]; below code inside controller: $rootscope.items = people.list(); $rootscope.name = "john"; for(var i=0;i<$rootscope.items.name.length;i++) { if (name== $rootscope.items.name[i].names) { people.addcomment(user.comment,i); } } below code in service called 'people': this.addcomment = function(comment,x) { items[0].name[x].msg.push(comment); } this.list = function () { return items[0]; } the json declared in service. html code below: <textarea placeholder="enter comment" ng-model="user.comment"></textarea> <button ng-repeat = "x in items.name" ng-if="name==x.names" ng-cl...

onresume - android unfortunately stopped after resuming activity for a long time -

i creating simple application. while using application, when click home , go app , work time 10 15 minutes. when app, show "unfortunately app stopped" message. , app closes suddenly. exception throws : make sure class name exists, public, , has empty constructor public @ android.app.fragment.instantiate(fragment.java:601) fragmentstate.instantiate(fragment.java:98) fragmentmanagerimpl.restoreallstate(fragmentmanager.java:1759) @ ndroid.app.instrumentation.callactivityoncreate(instrumentation.java:1088) @ android.app.activitythread.performlaunchactivity(activitythread.java:2302)

How to make selecatable false in kendo ui grid using jQuery -

please let me know if possible make selectable attribute of kendo ui grid false using jquery. i have 2 grids 1st grid selectable true when make changes 1st grid 2nd grid selectable functionality should change accordingly suppose there 2 category in grid rows 1 of row admin , other row normal user if normal user 2nd grid selectable should true using jquery outside grid... `jquery("#usersmatterlist").kendogrid({ datasource: usersmatterdatasource, autobind:false, filterable: true, sortable: true, pageable: false, resizable: true, selectable : true, scrollable: true, change : function(e){ var selecteditem = this.dataitem(this.select()); if(selecteditem.id != null){ globalcaseid = selecteditem.id; update...

domdocument - Scraping html using Domdoc + PHP -

i scrape following html <div class="venue-event-list " rel="gb"> <div class="tracks-list"> <div class="single-track"> <a href="//livevideo.betfair.com/default.do?mi=119408124" target="_blank" class="live-video-link"><div class="bf-icon-live-video tag-i13n i13n-ltxt-lvid i13n-sec-gb i13n-tab-today" title="watch on betfair live video"></div></a> <div class="info-container"> <span class="track-name"> <a class="tag-i13n i13n-ltxt-meeting i13n-sec-gb i13n-tab-today" href="/exchange/plus/#/horse-racing/market/1.119408124">lingfield</a> </span> <div class="races-list"> <div class="single-race" id="m-1_119408124"> <span class="race-time link-text"...

java - Call subclasses with static methods -

i need behavior of calling subclass methods statically. in example have group of messengers . need call once or twice in each implementation, not feel keeping variables of super interface since need have 1 method description all, or several obliged overwrite. , not static. i want able messenger.messageerrormessage.send(param) or messenger.messagedefaultmessage , etc... need bind them superclass, still keep static behavior when calling subclass methods. so i've done below: interface has public innerclasses call subclass static methods change in name being messageerrormessages (actual subclass) messageerrormessage (inner class) need change name plural name singular name. interface messenger{ public static final class messageerrormessage{ public static void send(message message){ messageerrormessages.send(message); } } public static final class messagedefaultmessage{ public static void send(message message){ me...

html - Django image isn't uploaded by using javascript node from markup string -

i created django dynamic forms work on click, don't why image isn't uploaded. i didn't have request.files , added that. added enctype="multipart/form-data" didn't too. so template code: {% load staticfiles %} <link rel="stylesheet" type="text/css" href="{% static 'vote/style.css' %}" /> <fieldset id="fieldset"> <form method = 'post' action = '' enctype="multipart/form-data">{%csrf_token %} <p>{{ votetypeform }}</p> <div id="placeholder"> </div> <p> <button type="button" name="submit" onclick="add();">+</button> </p> <input type = 'submit' value="create"/> </form> </fieldset> <script type='text/javascript'> {# document.write(code);#} var _counter ...

node.js - Install node dependencies for Cordova plugin -

i'm writing cordova plugin, has node dependency 1 of hook scripts. ideally when plugin installed: $ cordova plugin add my-cordova-plugin i run npm install if package.json has dependencies listed. does cordova support feature in way? have missed something? my current solution hook runs after_plugin_install : module.exports = function (context) { var shell = context.requirecordovamodule('shelljs'); shell.cd(context.opts.plugin.dir); shell.exec('npm install'); };

cordova - How to delete .csv file using phoneGap -

we can create .csv file , write & read data form .csv file we flowed file api documentation now need delete .csv file.please guide us.we have person.csv file in mobile memory. need deleted person.csv file we tried function ondeviceready() { window.plugins.orientationlock.lock("portrait"); window.requestfilesystem(localfilesystem.persistent, 0, gotfs, fail); } function gotfs(filesystem) { filesystem.root.getfile("ccil/settlement/routesalesdispatchedheader"+namebranchit+""+lastfour+""+numberofcountvist+".csv", {create: true, exclusive: false}, gotfileentry, fail); // filesystem.root.getfile("ccil/settlement/routesalesdispatchedheader.csv", {create: true, exclusive: false}, gotfileentry, fail); } function gotfileentry(fileentry) { //alert("seeeeee32"); fileentry.createwriter(gotfilewriter, fail); } we need deleted before write file sdcard .please guide us

java - Custom ListView won't show up in the Activity -

i trying create listview custom row layout , adapter in android studio. followed this tutorial attempted simpler version familiarize myself it. not fill data in listview data in json format or use imageloader, trying use similar format set strings' content manually. i created row.xml simple textfield "name". created simple listmodel create , set methods string name. tried create , use custom adapter listmodel place content in listviewactivity. finally, in listviewactivity tried define content of string name , show in view. i have no errors when running application, listview won't show in activity. expected output single row "hiiiii" init. doing wrong? list_view.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="matc...

php - Setup cakephp in subfolder on AWS -

i had shifted cakephp website subfolder on aws ubuntu machine. site working css, images , js not loading. getting 404 not found error. not found requested url /demo/css/mscrollar/jquery.mcustomscrollbar.min.css not found on server. urls working index.php. here htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritebase /demo rewriterule ^media/(.*) http://%{http_host}/files/timthumb.php?src=http://%{http_host}/app/webroot/files/$1 [l,r=301] rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] </ifmodule> please help you need create 2 htaccess files. 1 in webroot , 1 in root path. 1 in root (./.htaccess) should (replace your_path): <ifmodule mod_rewrite.c> rewriteengine on rewritebase /your_path rewriterule ^$ app/webroot/ [l] rewriterule (.*) app/webroot/$1 [l] </ifmodule> the 1 in webroot folder (./app/webroot/.htaccess) should this: <ifmodule mod_rewrite.c> rewriteen...

python - getting error while using queryset Q in django view -

i creating dynamic queryset using q while printing build_query[:-1] i getting output q(owner_id=1)|q(assigned_to=1) but when using in consultants = consultant.objects.filter(*build_query[:-1]) getting error many values unpack tried ** , without * still not working. when check type of print type(build_query[:-1]) i getting string type. main cause? traceback internal server error: /api/consultants/my_consultants/ traceback (most recent call last): file "/home/jagmeet/consultadd_workspace/devenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/home/jagmeet/consultadd_workspace/devenv/local/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 57, in wrapped_view return view_func(*args, **kwargs) file "/home/jagmeet/consultadd_workspace/devenv/local/lib/python2.7/site-packages/rest_framework/view...

convolution - Convolutional Neural Networks, Matrix of Convolutional (Kernel) -

good afternoon! in first stage on input of convolutional neural network (input layer) recieve source image (hence image of handwritten english letter). first of using nxn window goes left right scanning image , multiplication on kernel (convolutional matrix) build feature maps? written exact values kernel should have (in other words on kernel values should multiply data retrieved n*n window ). suitable multiply data on convolutional kernel intended edge detection? there numerous convolutional kernels (emboss, gaussian filter, edge detection, angle detection, etc.)? written exact kernel need multiply data detecting hand written symbols. sample of edge detection 3*3 kernel convolutional operation multiplication on kernel in addition, if size of entire image 30*30, possible use window of 5*5 building feature maps? enough sufficient reaching optimal precision of letter detection? on exact kernel best multiply area of entire image maximum precision of letter recognition? or val...

cordova - Twilio send optional parameters TwiML JavaScript Ajax Phonegap -

is possible send optinal parameters twilio twiml file , use them in php script? because im using generated userid in phonegap app. if call connected want send user id twiml , check in php if call "completed" , set values in mysql db userid. somethinglike: twiml: <response> <dial action="http://blabla.com/dial.php" method="post"> 555-5555 </dial> </response> javascript: $("#dialbutton").click(function() { params = { "userid" : $(userid).val()}; connection = twilio.device.connect(params); }); php: $user = $_post["userid"]; is right way?if not how can solve problemt? here attributes sent action url: https://www.twilio.com/docs/api/twiml/dial#attributes-action-parameters it looks doesn't contain userid (i assume mean accountsid or subaccountsid?). according article ( https://www.twil...

hadoop - How to use OozieClient.doAs -

i'm trying start oozie workflow web service. 1 of actions should delete , create folders. concretely, want empty folder before starting java action (which serves driver mapreduce job). know there "prepare" part in java action can specify path delete,but need delete files in folder, keep folder. that's why i'm using fs action, delete folder , make folder. the problem is, when run using oozieclient.run exception says there problem permissions, since i'm running workflow root user. i found can use oozieclient.doas impersonate specific user, i'm not able use reason. internal oozie exception. can show me how run workflow specific user, or @ least point me example? one way run oozie job specific user secure oozie using kerberos active directory. can authenticate user active directory , run oozie job authenticated user.

javascript - php Filtering multiple tables -

i typing dynamically filter multiple tables using 1 select dropdown box. i have code here -> https://jsfiddle.net/fpa4k2lc/ var props = { sort: true, rows_counter_text: "displayed rows: ", col_number_format: [null,null,'us','us','us','us','us','us','us'], display_all_text: " [ show ] ", status_bar_target_id: 'statusdiv', col_0: "multiple", col_1: "select", col_2: "checklist", col_4: "none", col_8: "none", external_flt_grid: true, external_flt_grid_ids: ['slccountry','slccode','slcyear','inppop'], public_methods: true } setfiltergrid("demo","demo2",props); but can filter 1 of tables , not both.

java - iText : unable to retrieve /Resources from a page -

Image
i'm using itext 5.0.1 manipulate existing pdf. when analyzing existing pdf using rups , can see first page contains /resources : however, when manipulating pdf using following example , i'm getting npe because pagedictionary.get(pdfname.resources) returning null. here pagedictionnary object contains when debugging : unfortunately, because of confidentiality, can't post pdf now, have idea why i'm getting npe ? or have idea how investigate further ? (i'm far being expert itext , pdf structure ... , getting out of idea) thank ! the sample code use assumes page objects immediate kids of dictionary pointed pages catalog key: pdfdictionary pages = (pdfdictionary) pdfreader.getpdfobject(reader.getcatalog().get(pdfname.pages)); pdfarray kids = (pdfarray) pdfreader.getpdfobject(pages.get(pdfname.kids)); pdfdictionary pagedictionary = (pdfdictionary) pdfreader.getpdfobject((pdfobject) kids.getarraylist().get(pagenum - 1)); this assumption ok b...

java - Spring : Autowired bean is null -

Image
i working on spring-mvc application in autowiring field, getting set null. checked solutions on net same problem, describe, should not create new instance of classes when working, rather spring. tried well, complains resource not found. here class : @service @transactional public class googleauthorization{ @autowired private drivequickstart drivequickstart; // guy null public void savecredentials(final string authcode) throws ioexception { googletokenresponse response = flow.newtokenrequest(authcode).setredirecturi(callback_uri).execute(); credential credential = flow.createandstorecredential(response, null); system.out.println(" credential access token "+credential.getaccesstoken()); system.out.println("credential refresh token "+credential.getrefreshtoken()); // fails @ below point. this.drivequickstart.storecredentials(credential); } controller code : @requestmapping(value = "/getgooglel...

logging - How to group logs by "start-point" among a distributed system -

i have distributed system lots of machines, each machine produces logs, , can call services in others machines (that produces logs too). i'm using centralized log service (logentries), , have this: 12:00:00 server1 apache log 12:00:01 server1 application log 12:00:01 server1 apache log 12:00:02 server2 service log 12:00:02 server1 application log 12:00:03 server2 service log but want this: 12:00:00 server1 apache 12:00:01 server1 application log 12:00:02 server2 service log 12:00:01 server1 apache 12:00:02 server1 application log 12:00:03 server2 service log these logs grouped start point (the apache log). there solution that? can stop use logentries , use other log management saas. you don’t have information in logs, can’t group it. generate id, guid , log every other message. way you’d know execution path. i’m not sure how logs being sent centralized system, if asynchronously, you’d need provide logical clock (lamport clock) if jump between dif...

Android application using lowest density drawable -

i created res drawable directories different densities, application use lowest density. created drawable-mdpi, drawable-hdpi, drawable-xhdpi , drawable-xxhdpi in phone xxhdpi app using mdpi, if delete mdpi app using hdpi etc. in device testing application? if device suitable hppi automatically fetch images them , suitable mdpi automatically fetch images respective folder. a set of 6 generalized densities: ldpi (low) ~120dpi mdpi (medium) ~160dpi hdpi (high) ~240dpi xhdpi (extra-high) ~320dpi xxhdpi (extra-extra-high) ~480dpi xxxhdpi (extra-extra-extra-high) ~640dpi

python - AppEngine urlfetch broken on SDK 1.9.23 ? -

the following code (see below) returns following http codes different versions of appengine sdk: 1.9.19: 200 1.9.20: 200 1.9.21: 200 1.9.22: [not tested, sdk not found in deprecated sdk directory] 1.9.23: 404 all sdks tested near- simultaneously, verified manually page exists. ?? from google.appengine.api import urlfetch google.appengine.ext import testbed tb=testbed.testbed() tb.activate() tb.init_urlfetch_stub() http=urlfetch.fetch(method="get", url="http://sports.coral.co.uk/football/outrights") print http.status_code upgrade 1.9.24. had problems 1.9.23 , narrowed down http request urlfetch looked proxy requests: invalid request using 1.9.23: get http://example.com:80/ http/1.1 host: example.com valid request using 1.9.24: get / http/1.1 host: example.com some http-servers accept both kinds of requests (the devapp server example) don't (elasticsearch example).

arrays - jquery map an object with key and value -

i trying map json object array values associated keys. need keep keys , values associated because sort on created array after. object : {"178":"05hy24","179":"1hy12","292":"1hy24","180":"3hy12"} i have tryed array function : value=$.map(value, function(value, key) { return key,value; }); but keys not associated values. keys 0,1,2,3 , not 178,179,292,180. try lot of things don't know how that. var myhashmap = json.parse('{"178":"05hy24","179":"1hy12","292":"1hy24","180":"3hy12"}'); console.log(myhashmap[178]); // => "05hy24" // map array.. var myarray = $.map(myhashmap, function(value, index) { return [value]; }); console.log(myarray);

javascript - Scaling mouse co-ordintates for different resolutions -

i working on heatmaps , have different resolutions [1920x953], [953x502]. gathering points resolutions , want draw heatmap on [1280x768]. getting problems scaling not working properly. i have got mouse co-ordinates(1160,35) in [1920x953], (704,35) in [953x502] , want draw these points on [1280x768] resolutions. so, points must scaled up/down regarding target resolution. have used these formulas, not getting correct value. way, (839, 35) value of [1280x768]. targetscreenpoint = (capturedscreenpoint/captured screen resolution) * target screen resolution tsp = (1160/1920) * 1280 = 773 and target screen point = (target screen resolution - captured screen resolution)/2 + captured screen point tsp = (1280 - 1920)/2 + 1160 = 840 the first 1 method giving wrong value 773. second 1 giving correct value 840. but want use generic formula scaling. please in regard. thanks!

fiware - WireCloud does not access marketplace -

i manage install fiware instance cannot retrieve data fiware marketplace. i have been following this: forge.fiware.org wirecloud says : connection error: no resources retrieved. i'm using url : https://marketplace.lab.fiware.org mentioned in tutorial, notice when use in browser, need login first. wirecloud instance, have not been prompted enter login/password, cause of problem ? how can solve ? thanks. use http://130.206.81.113/fiwaremarketplace/v1/ , old instance of marketplace-ri (although 1 used mashup & store portal in fiware lab). in https://marketplace.lab.fiware.org can find recent instance of wmarket (currently v4.3.3). wmarket has replaced marketplace-ri, wirecloud has not been updated support wmarket yet. we have updated installation guide, :).

c# - timer application not running properly -

i writing simple c# application, in program counts 15 seconds , outputs "15" 15 seconds have passed. although, program works fine first few trials, starts freeze instead. know why? , how can improve it? public void timer() { time.text = "restart"; int = 0; datetime st1 = datetime.now; string time1 = st1.second.tostring(); int timef = convert.toint32(time1); int timef2; while (i < 15) { datetime st2 = datetime.now; string time2 = st2.second.tostring(); timef2 = convert.toint32(time2); = timef2 - timef; } time.text = i.tostring(); = 0; } you need use timer if want application perform actions after specific amount of time . system.timers.timer timer = new system.timers.timer(); timer.interval = 15 * 1000; timer.elapsed += timer_elapsed...

Objective-C: Change iOS headphones buttons actions -

i need bind own actions on ios headphones buttons. for play/pause action found solution: add audio background in .xcodeproj implement method remotecontrolreceivedwithevent set self firstresponder i can't set class first responder, bcs class subclass of uiviewcontroller. method class must subclass of uiresponder. put method in appdelegate , create notifications. 1. there other way put remotecontrolreceivedwithevent in class, without changing superclass or using notifications? 2. can change volume up/down actions? to honest think bit of grey area. think if alter functions of buttons app rejected apple ios app store review process breaching guideline 10.5 . don't believe apple test app headphones unless state headphones required app work. though if app needs headphones access functionality , didn't tell apple didn't test , found out possibly account banned dishonesty. so in honesty based on review guidelines i'd can't possible reason st...

java - use mail-service.xml with Wildfly 8 for sending Mail on server start - IllegalStateException -

i trying use mail-service.xml in wildfly 8. has send mail on server startup. error when start wildfly. file located in deployments folder. this error: 2015-07-08 10:20:22,884 error [org.jboss.msc.service.fail] (msc service thread 1-2) msc000001: failed start service jboss.deployment.unit."mail-service.xml".parse: org.jboss.msc.service.startexception in service jboss.deployment.unit."mail-service.xml".parse: jbas018733: failed process phase parse of deployment "mail-service.xml" @ org.jboss.as.server.deployment.deploymentunitphaseservice.start(deploymentunitphaseservice.java:166) [wildfly-server-8.2.0.final.jar:8.2.0.final] @ org.jboss.msc.service.servicecontrollerimpl$starttask.startservice(servicecontrollerimpl.java:1948) [jboss-msc-1.2.2.final.jar:1.2.2.final] @ org.jboss.msc.service.servicecontrollerimpl$starttask.run(servicecontrollerimpl.java:1881) [jboss-msc-1.2.2.final.jar:1.2.2.final] @ java.util.concurrent.threadpoolexe...