Posts

Showing posts from September, 2013

html - Grid alignment in Bootstrap on small devices -

i have 3 column row 3 images using bootstrap. below. |         |        |        | |         |        |        | |         |        |        | |         |        |        | |--------------------- | |         |        |        | |         |        |        | |         |        |        | |         |        |        | in smaller devices, have problem see 2 column , 1 column empty content. there anyway can join these 2 rows , 2x2 2x2 2x2 schema on smaller devices? my markup <div class="row"> <div class="col-md-4 col-sm-4 col-xs-12"></div> <div class="col-md-4 col-sm-4 col-xs-12"></div> <div class="col-md-4 col-sm-4 col-xs-12"></div> </div> <div class="row"> <div class="col-md-4 col-sm-4 col-xs-12"></div> <div class="col-md-4 col-sm-4 col-xs-12"></div> <div class="col-md-4 col-sm-4 col-xs-12"></div&g

visual c++ - How to convert C++/CLI array to String or standard C array -

i have managed array: array<unsigned char>^ mygcarray; assume array null terminated. want display contents using console::writeline() . what's easiest way convert mygcarray string ? one of constructors string has parameter of const char* , if can convert mygcarray that, work too. how should that? i can copy contents of mygcarray regular unsigned char myarray[] , best way? thank you. you have use proper encoding. if have no idea started string^ str = system::text::encoding::default->getstring(mygcarray); by hans passant

css - text-decoration:none formatting not working when sending HTML emails with Outlook 2007 -

if attempt send following html email outlook 2007 hyperlink shows when receive in gmail. however, sending online test service hyperlink not show. if reply gmail outlook 2007 client, outlook shows email without hyperlink, intended. it seems me on outgoing email outlook attaching own stylesheet overriding this. there way add code stop this? i've tried important! trick no avail. <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <div> <a style="text-decoration:none;" href="www.example.com"><font color="#e4480d"><span style='text-decoration:none;text-underline:none'>www.example.com</span></font></a> </div> </body> </html> outlook processes html before sending out, alter code pretty heavily in fact. if inspect element in chrome on the email in gmail should see there sorts of

qt - C++ doesn't compile my custom data type including a vector in it -

i tried custom list, has intern private vector. yet allways error-message, , have no idea start problem. use qt, windows , "config += c++11" within project. ...mypath\c++\bits\stl_construct.h:75: error: call of overloaded 'mydatatype()' ambiguous { ::new(static_cast<void*>(__p)) _t1(std::forward<_args>(__args)...); } ^ what errormessage tries tell me here? should start look? thanks hint. edit: constructors lists: /*********************************************************************** * constructors , destructor * *********************************************************************/ datatype_collection::datatype_collection(){ std::vector<datatype> erg (0); m_datatype_list = erg; } datatype_collection::~datatype_collection(){ } for datatype: /*********************************************************************** * constructors , destructor - implemented because of rule of 3 * *************************************

ruby - In Rails, is map.resources now obsolete? -

i viewing episode in railscasts , looking @ source code episode 145. this code routes.rb file actioncontroller::routing::routes.draw |map| map.resources :orders map.current_cart 'cart', :controller => 'carts', :action => 'show', :id => 'current' map.resources :line_items map.resources :carts map.resources :products map.resources :categories map.root :products end i thrown off. looked entirely different syntax. realized source code published in 2010. i'm wondering if it's obsolete, because copied , pasted code rails application , isn't working. usually, is resources 'orders' root 'products' i don't know how rewrite map.current_cart . this error message get nameerror at/orders/new undefined local variable or method 'map' #<actiondispatch::routing::mapper::0x4d90868> this line highlighted map.current_cart 'cart', :controller => 'carts', :acti

java - Mule outbound HTTP endpoints via proxy -

i have mule application deployed on linux (rhel 6) box talks twilio api , gmail api. server mule application deployed has go out via proxy. i have modified /usr/local/mule-standalone-3.5.0/conf/wrapper.conf , added additional java property proxy settings (using wrapper.java.additional.4 ) and when search mule process, here see $ ps -ef | grep mule root 12940 12938 0 dec04 ? 00:04:24 java -dmule.home=/usr/local/mule-standalone-3.5.0 -dmule.base=/usr/local/mule-standalone-3.5.0 -djava.net.preferipv4stack=true **-dhttp.proxyhost=http://<proxy> -dhttp.proxyport=80 -dhttps.proxyhost=http://<proxy> -dhttps.proxyport=80** i still not able hit outbound http/ https urls. is there different way of setting outbound proxy in mule? please try configuring proxy in connector.

browserify - Jest and Bower Module loading in jest tests -

lets have project uses bower, grunt, bowerify(with shim) , since love jest want test that. how in world jest see browserify shim modules when runs tests. use grunt, kick off npm test command. here package.json file. "browser": { "jquery": "./bower_components/jquery/dist/jquery.js", "foundation": "./bower_components/foundation/js/foundation/foundation.js", "fastclick": "./bower_components/fastclick/lib/fastclick.js", "greensock-tm": "./bower_components/gsap/src/uncompressed/tweenmax.js", "greensock-css": "./bower_components/gsap/src/uncompressed/plugins/cssplugin.js", "greensock-time": "./bower_components/gsap/src/uncompressed/timelinemax.js", "scrollmagic": "./bower_components/scrollmagic/js/jquery.scrollmagic.js", "handlebars": "./bower_components/handlebars/handlebars.runtime.js"

SAS: how to properly use intck() in proc sql -

i have following codes in sas: proc sql; create table play2 select a.anndats,a.amaskcd,count(b.amaskcd) experience test1 a, test1 b a.amaskcd = b.amaskcd , intck('day', b.anndats, a.anndats)>0 group a.amaskcd, a.anndats; quit; the data test1 has 32 distinct obs, while play2 returns 22 obs. want each obs, count number of appearance same amaskcd in history. best way solve this? thanks. the reason return 22 observations - might not 22 distinct 32 - comma join, in case ends being inner join. given row a if there no rows b have later anndats same amaskcd , a not returned. what want here left join, returns rows a once. create table play2 select ... test1 left join test1 b on a.amaskcd=b.amaskcd intck(...)>0 group ... ; i write differently, i'm not sure above want. create table play2 select a.anndats, a.amaskcd, (select count(1) test1 b b.amaskcd=a.amaskcd , b.anndats>a.anndats /* intck('day') pointle

c++ - A function return different object based on its parameter? -

i have bunch of functions this: void business::convertdatatolistentityoftypex() // x = a,b,c..... { qbytearray tmp = getdata(); bool ok; qvariantlist result = parse (tmp,&ok); if (ok) { (int = 0; < result.size(); ++i) { typexentity e; convertvarianttotypexentity(result[i],e); typexentitylist.push_back(e);//typexentitylist private variables in business } } } i want group them 1 function this enum type{typea, typeb}; void business::convertdatatolistentity(type tp) { qbytearray tmp = getdata(); bool ok; qvariantlist result = parse (tmp,&ok); if (ok) { (int = 0; < result.size(); ++i) { typexentity e;// need magic function map enum typexentity convertvarianttotypexentity(result[i],e); typexentitylist.push_back(e);//need magic function map enum typexentitylist } } } so there possible way qt or boost (qt pref

ios - gotoAndPlay not finding Frame Label AS3 -

i'm trying build simple flash game user drags sombrero onto cactus. i've got when drag sombrero anywhere cactus, snaps it's original position. had when drag onto cactus, stays there. what want when user drags sombrero onto cactus, takes screen says "yay! play again?" put gotoandplay() inside if statement: if(droptarget.parent.name == "cactus") { //scalex = scaley = 0.2; //alpha = 0.2; //y = stage.stageheight - height - -100; //buttonmode = false; //removeeventlistener(mouseevent.mouse_down, down); gotoandplay("playagain"); trace("dropped on cactus"); } else { returntooriginalposition(); } i labeled second frame "playagain." error saying: argument

vbscript - Open Excel and pass file password through -

i have excel files refresh nightly i want password protect them in order modify data them, when script opens file prompts password, how pass password script? heres use(have tried) set fs = createobject("scripting.filesystemobject") set rootfolder = fs.getfolder(fs.getparentfoldername(wscript.scriptfullname)) set oexcel = createobject("excel.application") oexcel.visible = true oexcel.displayalerts = false oexcel.asktoupdatelinks = false oexcel.alertbeforeoverwriting = false each file in rootfolder.files if instr(file.type, "script") = 0 set oworkbook = oexcel.workbooks.open(file.path) dim wsh set wsh = createobject("wscript.shell") wsh.sleep(25000) wsh.sendkeys "?" wsh.sendkeys "{enter}" oworkbook.refreshall oworkbook.save oworkbook.close set oworkbook = nothing end if next oexcel.quit set oexcel = nothing any help? dont use vbs much(at all) edit, code works in openin

is there a way to dynamic include a bean in spring? -

i have scheduling process in spring run every 5 mins. more interesting upgrade make switch choose schedule process or web service. sure can make work properties setting , java, there few beans defined in application context have take care of <bean class="org.springframework.scheduling.quartz.schedulerfactorybean"> <property name="triggers"> <list> <!-- keep a,b,c,e --> <ref bean="triggera" /> <ref bean="triggerb" /> <ref bean="triggerc" /> <!-- sort of condition enable ref or not --> <ref bean="triggerd_i_want_an_option_to_disable_ahhhhhhhhhh" enabled="false"/> <ref bean="triggere" /> </list> </property> </bean> i know fantasy have such switch spring bean collections, please let me know if there way can make bean tur

angularjs - Event being triggered even though form field is $pristine -

my form has 2 input fields below: <input type="password" name="password" ng-model="password" placeholder="enter password" class="form-control" /> <input type="password" name="password_confirm" ng-model="password_confirm" placeholder="confirm password" class="form-control" validate-equals="password" /> please match passwords expected: error below second input should trigger if second input field $dirty , not matching first field however behavior not achieved. app.directive('validateequals', function(){ return { require: "ngmodel", link: function(scope, element, attrs, ngmodelctrl) { function validateequal(value) { var valid = (value === scope.$eval(attrs.validateequals)); ngmodelctrl.$setvalidity('equal', valid); return valid ? value : undefined; } ngmodelctrl.$parsers.p

php - How to orderedBy your table when users click on table header in Laravel 4? -

Image
i have table users header : username, name, email, type, group, status. right now, set them orderedby group in controller function. i want take next level improve table ux. i want orderedby username if user clicked on username on table header. i want orderedby email if user clicked on email on table header... on .. basically, orderedby whatever table header user click on. if can without refresh page, awesome. need know ajax, or jquery in order done ? possible in php ? using laravel 4. huge thanks users contribute in question. usercontroller.php public function index() { //get users database $users = user::where('type','!=','distributor') ->orderby('group', 'asc') ->paginate(20); // return view , give title return view::make('users.index') ->with('users',$users); } edit my table view <table class="table tab

python - Where does uWSGI define what the envion variable are? -

the normal wsgi environ variables defined here , definitions special uwsgi variables such 'x-wsgiorg.fdevent.readable'? well, found specific extension's spec is: http://wsgi.readthedocs.org/en/latest/specifications/fdevent.html?highlight=fdevent

How to use POINT mysql type with mysqli - php -

this question has answer here: how prepare sql statement point using mysqli when using insert 1 answer based on this table php .net : type specification chars character description corresponding variable has type integer d corresponding variable has type double s corresponding variable has type string b corresponding variable blob , sent in packets i write code: $stmt = $this->conn->prepare("insert days(day,startlocation) values(?,?)"); $stmt->bind_param("ss", $day, $startlocation); but problem becouse startlocation field in database use type point , how can make bind_param point datatype in mysql? you should use mysql function point in order convert latitude/longitude $stmt = $this->conn->prepare("insert days(day,point(lat,lon)) values(?,?,?)"); $stmt->bind_param("s

javascript - Button Only Works on Second Click After Reload -

i'm creating board tiles can clicked change colors. have "clear board" button clears board tiles white again, reason button works on second click after each page reload. i've tried wrapping javascript in document ready function didn't help. how can work on first click after reload? html: <h1 class="title">wacky painter</h1> <div class="easel"> </div> <form class="clear_board"> <button type="button" id="clear_button" class="btn" onclick="clearboard()">clear board</button> </form> css: body { font-family: sans-serif; color: #ff757a; } .easel { width: 300px; outline: #c8c8c8 5px solid; margin: 0 auto; } .square { width: 20px; height: 20px; outline: thin solid #c8c8c8; display: inline-block; margin-top:-2px; } form { margin: 10px auto; } .title { margin: 0 auto; text-align: center; pad

ubuntu - How to change Grive folder location? -

i have ubuntu 14.04 , know how change grive's default folder location? so far know when create grive via terminal can tell folder following instruction : cd /your-folder/grive -a but don't know how setup grive's interface exact folder location. any appresiated. if type 'grive -h' show help. the command want is: grive -p /your-folder/grive -a

Searching through an array using Ruby's array.index() method using wildcards -

i have created array of tiles game board. each element of array hash following format: {'x' => x, 'y' => y, 'base' => "base"} the value of 'base' may string no spaces. i find index of particular tile based on x/y values of tile, regardless of tile's base value. my first thought on how accomplish search contents of array using index() method, this: active_tile = tile.index({'x' => 3, ''y' => 2, 'base' => "wildcard_here" }) however, have no idea how implement wildcard this. suggestions appreciated. i appreciate suggestions better methods of storing , retrieving tiles if knows method i'm using not effective one. for completeness, here entire piece of code i'm working right now: class map attr_reader :max_ns # maximum north-south size attr_reader :max_ew # maximum east-west size attr_reader :tile # array of tiles def initialize(tall, wide)

javascript - Google Apps Script, fastest way to retrieve data from external spreadsheets -

Image
i'm trying load data multiple spreadsheets(~100) single spreadsheet, when try script times out. appears opening each spreadsheet takes long time. there way can speed or work around? here's use open each spreadsheet // set current spreadsheet master , current date. var master = spreadsheetapp.getactive(); var mastersheet = master.getsheetbyname('master'); var users = master.geteditors(); var today = new date(); // adds menu spreadsheet function onopen() { var spreadsheet = spreadsheetapp.getactivespreadsheet(); var entries = [{ name : "update data", functionname : "retrievepartnerdata" }]; spreadsheet.addmenu("submissions menu", entries); }; // first data partner sheets function retrievepartnerdata() { mastersheet.getrange(2, 1, mastersheet.getlastrow(), mastersheet.getlastcolumn()).clear(); //clear our master sheet aka sheet mastersheet.hidesheet(); //get's promo outline internal sheet , store it's

java - Main class run with exception in thread error with JUnit -

Image
i'm using crimson editor along command prompt console compiling , running programs. i've installed , new junit. currently, i'm following basic tutorial tutorialspoint.com , have followed steps setting classpath. the link tutorial available here: http://www.tutorialspoint.com/junit/junit_environment_setup.htm from tutorial, there's ending part whereby asked create class files test junit. eventually, after compiling, tried run main class presented long series of errors hoping guys can me out here. import org.junit.test; import static org.junit.assert.assertequals; public class testjunit { @test public void testadd() { string str= "junit working fine"; assertequals("junit working fine",str); } } main class: import org.junit.runner.junitcore; import org.junit.runner.result; import org.junit.runner.notification.failure; public class testrunner { public static void main(string[] args) { result result = junitc

s.replace() calls having no effect in Python -

s = input() s.lower() in range (0, len(s)): if(s[i] in "aoyeui"): s.replace(s[i], '') in range(0, len(s)): s.replace(s[i], '.' + s[i]) print(s) this code should remove vowels , split string '.' lets comment line line: s = input () #wrong indentation s.lower() # have assign s. in range (0, len(s)): # range(0, x) same range(x) if (s[i] in "aoyeui"): # ok s.replace(s[i], '') # strings not mutable replace not modify string. have assign s # splitting can done easier :) in range(0, len(s)): s.replace(s[i], '.' + s[i]) # again have assign print(s) # ok also have noticed there 1 more problem code. when replace vowels string length changes , can cause multiple problems. should not in general iterate index when length changes. correct code should like: s = input () s = s.lower() vowel in "aoyeui": s = s.replace(vowel, '') s = '.'.

try catch - Best way to write "try elsetry" in python? -

i know 'tryelse' not real thing, question best way write out logic. given following example, foo , bar functions break. i want aa foo() , if breaks, want become bar() , if 1 breaks too, set aa 0 default. try: aa = foo() elsetry: aa = bar() except e: aa = 0 restating question, best real way write out logic in python? the nested approach still best: try: aa = foo() except exception: try: aa = bar() except exception: aa = 0 despite trying less nesting, above expresses wish , it's clear reader. if try nest more becomes awkward write , that's time rethink approach. nesting 2 try/excepts fine. you can write: try: aa = foo() except exception: aa = none if aa none: try: aa = bar() except exception: aa = 0 but somehow doesn't right (to me @ least). incorrect in case foo() can return none valid value aa .

ruby on rails - How do I eliminate multiple joins of the same table in a has_many through association with multiple scopes? -

given following models , associations: class employee has_many :positions has_many :titles, :through => :positions scope :is_active, -> { joins(:positions).merge(position.is_active) } scope :title_is, ->(name) { joins(:titles).merge(title.id_or_name_is(name)) } end class position belongs_to :employee belongs_to :title # bool 'active' indicate whether position active or not scope :is_active, -> { where("active = true") } end class title has_many :positions has_many :employees, :through => :positions scope :id_or_name_is, ->(id_or_name) { where("titles.id = ? or titles.name = ?", id_or_name, id_or_name) if id_or_name} end employee.is_active returns correct number of results , generates correct query. however, when attempt employee.title_is(123).is_active (which want return employees title_id 123 , active, results in multiple joins position. no problem except active check applies 1 of position join

php - Cannot define stable composer package -

i cannot tell whether it's composer.json or dependencies cause composer project not stable. packagist points 1.0 branch @ github. heart of composer.json appears below. the way can composer create-project truckee/volunteer work add argument --stability=dev . edit #2: i owner of package, not being required other. edit: without argument following error occurs: [invalidargumentexception] not find package truckee/volunteer stability stable. is possible make stable? composer.json { ... "repositories": [ { "type": "package", "package": { "name": "jquery/jquery", "version": "1.11.1", "dist": { "url": "http://code.jquery.com/jquery-1.11.1.js", "type": "file" } } } ],

racket - Modifying the interpreter in Scheme -

i'm totally new in scheme , interpreters. job modifying following code. if run (run "sub1(12,2,3,4)") in drracket, returns 11. need modify interpreter behaves correctly single numeric argument, returns 0 otherwise (that is, whenever number of arguments different 1, or argument of incompatible type) understand different modules of code, i'm totally confused how modify it. great if can me or give me pointer similar things. #lang eopl ;;;;;;;;;;;;;;;; top level , tests ;;;;;;;;;;;;;;;; (define run (lambda (string) (eval-program (scan&parse string)))) ;; needed testing (define equal-external-reps? equal?) ;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;; (define the-lexical-spec '((whitespace (whitespace) skip) (comment ("%" (arbno (not #\newline))) skip) (identifier (letter (arbno (or letter digit "_" "-" "?"))) symbol) (number (digit (arbno digit)) number))) (defin

shuffle - Shuffling algorithm which is commutative on element deletion? -

for application i'm writing (in functional language), i'd implement deterministic shuffling algorithm given same seed, return same shuffled array element @ position x removed had element had not been in array in first place. example: if shuffle([1,2,3,4,5], seed) = [4,2,3,1,5] shuffle([1,3,4,5], seed) should return [4,3,1,5] . before try reinvent wheel, must ask: such algorithm exist? (also wondering if property has name). input. if shuffle yields either original list or list reversed (depending on seed), have property describe. else, , not of sublists, when matched corresponding shuffling, have elements move same way. example, consider shuffle([1,2,3]) . in table below, each column different shuffle; each case, 1 of 3 sub-lists has shuffle moves elements differently other two. shuffle([1,2,3]) = [1,3,2] [2,1,3] [2,3,1] [3,1,2] shuffle([1,2]) = [1,2] [2,1]* [2,1] [1,2]* shuffle([1,3]) = [1,3] [1,3] [3,1] [3,1] shuffle([2,3]) = [

javascript - Remove the previous value and update the array -

having problem removing previous value array , updating remaining data. for example, in code jsfiddle have 4 values in array: bmw, nissan, volvo , saab. var cars = ["saab", "volvo", "bmw" , "nissan"]; shuffle(cars); document.getelementbyid("demo").innerhtml = cars[0]; so, once "press button" shows "bmw" or other value, next time reloading should randomize within rest of value i.e. nissan, volvo , saab. var cars = ["saab", "volvo", **"bmw"** , "nissan"]; until ends , shows "no more value shown" function shuffle(array) { return array.splice(math.random() * array.length, 1).pop(); } var cars = ["saab", "volvo", "bmw" , "nissan"]; var car = shuffle(cars); document.getelementbyid("demo").innerhtml = car; update also note jsfiddle reloading whole js each time, ie. reloading initialization of ca

gridgain - primaryValues behave not as expected -

in our poc, have cache in partioned mode, 2 backups, , started 3 nodes. 100 entries loaded cache , did below steps retrive it. public void perform () throws gridexception { final gridcache<long, entity> cache= g.cache("cache"); gridprojection proj= g.forcache("cache"); collection< collection<entity>> list= proj .compute().broadcast( new gridcallable< collection<entity>>() { @override public collection<entity> call() throws exception { collection<entity> values= cache.primaryvalues(); system.out.println("list size on each node: "+ values.size()); // console each node shows 28,38,34 respectively, correct return values; } }).get(); (collection<entity> e: list){ system.out.println("list size when arrives on main node :"+ e.si

html - Scrape a page with JavaScript from R -

i new web scraping in r , have ran problem sites reference javascript. attempting scrape data web page below , have been unsuccessful. believe javascript links prevent me accessing table. result r package "xml" function "readhtmltable" comes null. library(xml) library(rcurl) url <- "http://votingrights.news21.com/interactive/movement-voter-id/index.html" tabs <- geturl(url) tabs <- htmlparse(url) tabs <- readhtmltable(tabs, stringsasfactors = false) how can access javascript links data? or possible? when using direct link data (below) , r package "rjson" still unable read in data. library("rjson") json_file <- "http://votingrights.news21.com/static/interactives/movement/data/fulldata.js" lines <- readlines(json_file) json_data <- fromjson(lines, collapse="") the file reference javascript file containing json rather json. in case can manually scrub contents data: library(&quo

objective c - Reset Core Data driven treeController content -

Image
i run program creates core data content displayed in nsoutlineview using nstreecontroller . second time run program want clean content of nstreecontroller , run method pasted below. method either hangs long time (600 seconds) before finishes or crashes. if have few entities (500-1000) in nstreecontroller takes less time compared if have lot (200,000) entities pass method, if passes @ all. need know if there better way clear/refresh/reset content of nstreecontroller clear nsoutlineview before re-run program , fill nstreecontroller again. specifically, nsoutlineview respond changes contents of nstreecontroller , , need content of core data driven nstreecontroller able reset. -(void) cleansdrdfileobjects { __weak __typeof__(self) weakself = self; dispatch_async(dispatch_get_main_queue(), ^{ [weakself.outlineview collapseitem:nil collapsechildren:yes]; [weakself.coredatacontroller._coredatahelper.context performblockandwait:^{ nsenti

python - Unicode int to char, leading zero -

Image
i have integer representing unicode character want transform actual character can print out. however function unichr() gives me different behaviour depending on whether there leading 0 or not. (see screenshot below better explanation) however, when integer stored in variable first behavior whilst want achieve second. how can this?

Insert char array to char array in c -

i insert char array in char array char test[100]="www.bing.com "; char headers[256] = "get /index http/1.1\r\nhost: www.bing.com\r\nuser-agent: mozilla/5.0 (compatible; msie 8.0; windows nt 6.0)\r\nreferer: \r\nconnection: close\r\n\r\n"; as can see, insert www.bing.com in 2nd array char headers[256] = "get /index http/1.1\r\nhost: "+test[100]+"\r\nuser-agent: mozilla/5.0 (compatible; msie 8.0; windows nt 6.0)\r\nreferer: \r\nconnection: close\r\n\r\n"; how possible? char buffer[512]; sprintf(buffer, "get /index http/1.1\r\nhost: %s\r\nuser-agent: mozilla/5.0 (compatible; msie 8.0; windows nt 6.0)\r\nreferer: \r\nconnection: close\r\n\r\n", test); buffer contains result want (note how used %s in format string embed test inside http request string)

jquery - JS Fiddle JSON/ECHO returning empty object -

i learning ajax, jquery , json. i have following js fiddle sending request json/echo , response empty object. can tell me doing wrong? http://jsfiddle.net/deandalby/7a2t0eb5/3/ var saveurl = "http://fiddle.jshell.net/echo/json/"; $(document).ready(function () { $("#savebutton").click(function () { save(); }); }); function getpersondetails() { var arrayx = $(":input").serializearray(); var json = {}; jquery.each(arrayx, function () { json[this.name] = this.value; }); writetodom('formatted json', json.stringify(json, null, 4)); return json; } function save() { var data = getpersondetails(); $.ajax({ url: saveurl, datatype: "json", data: data, type: "post", cache: false, success: function (response) { writetodom('plain response', json.stringify(response)); writetodom('formatted response', j

java - How to config logstash to listening on multiple tcp port? -

i use logstash collect logs other component in project. log divided 2 type, app_log , sys_log, app_log sent tcp port 5000 , sys_log sent 5001. following logstash input config: input { tcp { port => 5000 type => app_log } tcp { port => 5001 type => sys_log } } after started logstash, port 5000 , 5001 both activated. tcp6 0 0 :::5000 :::* listen 7650/java tcp6 0 0 :::5001 :::* listen 7650/java but receive log port 5000 normally.when sending log port 5001, log not collected, there configured wrongly?

sql - MYSQL ERROR: unknown table `airports` -

i trying run following query: select `aalv_test`.`aircraft`.*, `aalv_test`.`airports`.*, `aalv_test`.`bids`.* `bids` left join `aalv_test`.`pilots` on `bids`.`pid` = `pilots`.`id` left join `aalv_test`.`schedules` on `bids`.`fid` = `schedules`.`id` left join `aalv_test`.`aircraft` on `schedules`.`aircraft` = `aircraft`.`id` left join `aalv_test`.`airports` `arr` on `schedules`.`arricao` = `arr`.`icao` left join `aalv_test`.`airports` `dep` on `schedules`.`depicao` = `dep`.`icao` `pilots`.`id` = 419 however, mysql returns error #1051 - table airports not exist. don't know issue , google hasn't helped. ideas? also, if use 1 alias, 1 airport need both. , data in table airports according query, not exist. also, if try throwing section in select clause, error 1064: syntax error near as. edit: database name aalv_test , .* @ end specifies use fields in table, , middle part table name, yes chaining fields. try this: select a.*, arr.*, dep.*, b.* bids b lef

android - Display "Download failed" message when application is cleared from the recent apps in mobile -

i developing project using services aws s3 client (amazon web services) . view contents respective bucket. if content file, use object of transfermanager , download file. download class of aws itself. have written fragment downloading. problem facing is, when clear app recent applications in phone while download running, file isnt downloaded. how , display toast message :download failed", when application cleared recent apps? thank in advance. you should use service this. when download in progress can show ongoing notification. nice example given here

c++ - 3D FFT Using Intel MKL with Zero Padding -

i want compute 3d fft using intel mkl of array has about 300×200×200 elements. 3d array stored 1d array of type double in columnwise fashion: for( int k = 0; k < nk; k++ ) // loop through height. for( int j = 0; j < nj; j++ ) // loop through rows. for( int = 0; < ni; i++ ) // loop through columns. { ijk = + ni * j + ni * nj * k; my3darray[ ijk ] = 1.0; } i want perform not-in-place fft on input array , prevent getting modified (i need use later in code) , backward computation in-place . want have 0 padding. my questions are: how can perform zero-padding? how should deal size of arrays used fft functions when 0 padding included in computation? how can take out 0 padded results , actual result? here attempt problem, absolutely thankful comment, suggestion, or hint. #include <stdio.h> #include "mkl.h" int max(int a, int b, int c) { int m = a; (m < b) && (m = b);

php - show all columns in zend framework -

here zend phtml file : <?php foreach ($this ->books $key =>$value) { echo $value->title.'by'.$value->author.'<br>'; } and result : first titleby first book second titleby second book third titleby third book fourth titleby fourth book " title " , " author " 2 columns of table,my table has 4 columns, want iterate on columns without knowing names inside table. maybe can use refection . try this: class a{ public $prop1 = null; public $prop2 = null; public $prop3 = null; public $prop4 = null; } $a1 = new a(); $a1->prop1 = "prop11"; $a1->prop2 = "prop12"; $a1->prop3 = "prop13"; $a1->prop4 = "prop14"; $a2 = new a(); $a2->prop1 = "prop21"; $a2->prop2 = "prop22"; $a2->prop3 = "prop23"; $a2->prop4 = "prop24"; $tab = array($a1,$a2); foreach($tab $key => $value){ $reflector = new

php - how to configure your server to send email using cpanel -

this question has answer here: php mail function doesn't complete sending of e-mail 24 answers i trying send email using php. mail returning true. receiving email. guessing maybe there problem server. there tutorial saying how configure server send email using cpanel. please me. stuck hours. if want see code code given below. in advance. <?php $msg = "first line of text\nsecond line of text"; $msg = wordwrap($msg,70); $headers = "from: test1@islamerkotha.com"; mail("erfan.bashar.13@gmail.com", "my subject", $msg, $headers); hi might want make sure first hosting provider allows send emails, try see if smtp server available, hosting provider available default here's tutorial setting smtp using phpmailer send mail using phpmailer

android - Parse.com query getFirst() exception -

what query.getfirst() returns? retrieves @ 1 parseobject satisfies query. uses network and/or cache, depending on cache policy. mutates parsequery. returns: parseobject obeying conditions set in query, or null if none found. throws: parseexception - throws parseexception if no object found. first saying returns null of object not found. after says there exception of object not found.. what does? thanks. method throws parseexception , tested on parse-1.7.1 sdk e = {com.parse.parseexception@831697061768}"com.parse.parseexception: no results found query" code = 101 cause = {com.parse.parseexception@831697061768}"com.parse.parseexception: no results found query" detailmessage = {java.lang.string@831697061808}"no results found query" stackstate = {int[266]@831697061912} stacktrace = {java.lang.stacktraceelement[0]@831693444272} suppressedexceptions = {java.util.collections$emptylist@831693442224} size = 0

Detecting csv files in newly sub-folder in PowerShell -

i have folder called c:\2014-15 , new sub folders created every month contain csv files i.e c:\2014-15\month 1\ltc c:\2014-15\month 2\ltc c:\2014-15\month 3\ltc how write script detect when ltc sub folder created every month , move csv files n:\test? updated: $folder = 'c:\2014-15' $filter = '*.*' $destination = 'n:test\' $fsw = new-object io.filesystemwatcher $folder, $filter -property @{ includesubdirectories = $true notifyfilter = [io.notifyfilters]'filename, lastwrite' } $oncreated = register-objectevent $fsw created -sourceidentifier filecreated -action { $path = $event.sourceeventargs.fullpath $name = $event.sourceeventargs.name $changetype = $event.sourceeventargs.changetype $timestamp = $event.timegenerated write-host copy-item -path $path -destination $destination } the error is: register-objectevent : cannot subscribe event. subscriber source identifier 'filecreated' exists. @ line:8 char:34 + $oncreated = re