Posts

Showing posts from January, 2014

Religious Violence as a Means for Achieving Justice

Religious Violence as a Means for Achieving Justice 1.Violence & Justice: Religious Violence as a Means for ... Description:Violence & Justice: Religious Violence as a Means for Achieving Justice Is Religious Violence Caused by the Pursuit of Religious Justice? By Austin Cline 2.Violence & Justice: Religious Violence as a Means for ... Description:02-01-2012 · ... Religious Violence as a Means for Achieving Justice. Comments (2) See All Posts; Share; Prev; ... Religious Violence as a Means for Achieving Justice ... 3.Religion and Peace - Christianity (Summary Points) Description:peace expressed through sacred texts from TWO religious ... That the world cannot expect to achieve peace without first achieving justice and ... means of achieving ... 4.Violence not a means for achieving respect for human rights ... Description:12-12-2006 · Violence not a means for achieving ... If we do not have justice and respect...

Biography: Chief Albert Luthuli

Biography: Chief Albert Luthuli 1.Biography: Chief Albert Luthuli - About.com African History Description:A biography of Chief Albert Luthuli, Africa's first winner of the Nobel Prize for Peace and president of the ANC until his death (under mysterious circumstances) in 1967. 2.Albert Lutuli - Wikipedia, the free encyclopedia Description:Inkosi Albert John Lutuli (commonly spelled Luthuli c. 1898 – 21 July 1967), also known by his Zulu name Mvumbi, was a South African teacher and … 3.Albert Lutuli - Biographical - Nobel Peace Prize Description:Albert Lutuli - Biographical. Chief of his tribe and president-general of the African National Congress, Albert John Lutuli 1 (1898?-July 21, 1967) was the leader of ... 4.Chief Albert John Luthuli | South African History Online Description:Chief Albert Luthuli, who became Africa's first Nobel Peace Prize Laureate in 1960, was President-General of the African National Congress (A...

The Rwandan Genocide -- Part 1 Background to the Rwandan Genocide

The Rwandan Genocide -- Part 1 Background to the Rwandan Genocide 1.The Rwandan Genocide -- Part 1 Background to the Rwandan Genocide Description:The Rwandan Genocide -- Part 1 How did the hatred between Hutu and Tutsi which led to the Genocide develop? By Alistair Boddy-Evans 2.Rwandan Genocide - Wikipedia, the free encyclopedia Description:1 Background. 1.1 Precolonial Rwanda and origins of Hutu, Tutsi and Twa; 1.2 Colonial era; ... Recognized sexual violence as a fundamental part of the Rwandan Genocide 3.The Rwandan Genocide -- Part 2 The 1994 Genocide in Rwanda Description:Previous > Part 1: Background to the Genocide. The Start of the Genocide On 6 April 1994, after a meeting with the Tutsi-backed FPR, President Habyarimana's plane was ... 4.Rwanda Genocide - A Short History of the Rwanda Genocide Description:The Rwandan Genocide -- Part 1 Background to the Rwandan Genocide; Hutu - Definition of Hutu; Hotel Rwanda; Jennifer Ros...

A Brief History of Guinea-Bissau

A Brief History of Guinea-Bissau 1.A Brief History of Guinea-Bissau - Part 1 Description:A brief introduction to the history of Guinea-Bissau from the time of early humans to the present day. ... Next: A Brief History of Guinea-Bissau - Part 2 2.A Brief History of Guinea-Bissau - Part 2 Description:A brief introduction to the history of Guinea-Bissau from the time of ... fiscal discipline in the Government of Guinea-Bissau. Previous: A Brief History of ... 3.HISTORY OF GUINEA-BISSAU Description:HISTORY OF GUINEA-BISSAU The Slave Coast Colonial rule ... For a brief period in the 1790s the British attempt to establish a rival foothold on an ... 4.Guinea-Bissau - Wikipedia, the free encyclopedia Description:Guinea-Bissau, officially the ... Main articles: History of Guinea-Bissau and Portuguese Guinea. ... For a brief period in the 1790s, ... 5.History of Guinea-Bissau - Wikipedia, the free encyclopedia Description: bing.com/videos...
1.#EANF# Description:#EANF# 2.#EANF# Description:#EANF# 3.#EANF# Description:#EANF# 4.#EANF# Description:#EANF# 5.#EANF# Description:#EANF# 6.#EANF# Description:#EANF# 7.#EANF# Description:#EANF# 8.#EANF# Description:#EANF# 9.#EANF# Description:#EANF# 10.#EANF# Description:#EANF#

elasticsearch - How do I deal with timestamp in bosun configuration? -

i'm trying insert alert in elasticsearch bosun don't know how fill variable $timestamp (have @ example) present time. can use functions in bosun.conf ? i'd now() . can me, please? this extract of example configuration: macro m1 { $timestamp = **???** } notification http_crit { macro = m1 post = http://xxxxxxx:9200/alerts/http/ body = {"@timestamp":$timestamp,"level":"critical","alert_name":"my_alert"} next = http_crit timeout = 1m } alert http { template = elastic $testhttp = lscount("logstash", "", "_type:stat_http,http_response:200", "1m", "5m", "") $testavghttp = avg($testhttp) crit = $testavghttp < 100 critnotification = http_crit } we use .state.touched.format renamed .last.time.format in master branch. format string go time format , , have print correct format elastic expecting. template el...

angular - Angular2 Routerlink: add query parameters -

how can add query parameters routerlink ? @routeconfig { {path: '/search', name: 'search', component: searchcmp} } let' want route /search?q=asdf , <a [routerlink]= " [ '/search' , {q= 'asdf'}] ">link 1</a> this resolves /search . is there way add query parameters without using: this.router.navigate( ['search', { q: 'asdf'}]); or <a href="/search?a=asdf"> link 2 </a> ? if u need /search?q=asdf can use: @routeconfig { {path: '/search', name: 'search', component: searchcmp} } //and generate router links use: <a [routerlink]="['/search']" [queryparams]="{q:'asdf'}"></a> this generate href tag <a href="/search" on clicking anchor tag lead url /search?q=asdf . [queryparams] let add query params "?", otherwise appended ";". can parameter in searchcm...

wikipedia - How build the URL to request the Name of Person in Wikiquote and Chose a Quote (maybe at random) ? -

i'm writing npm module wikiquote quote choosing famous person, i'm looking https://en.wikiquote.org/w/api.php?action=help&modules=query build url right request ! can't right solution ! someone can explanation of properties use in request ? unfortunately, wikiquote api not have structured data quotes , people. all of data stored in pages, grouped author , places , or more . can fetch html version ( for example ) or wikitext version ( for example ) of wikiquote page, , try parse it. looks pages regularly use bulleted list quotes, may provide parsable regularity.

ip - WCF service binds at 0:0:0:0 instead of dns alias -

we have cluster wcf services running resource each in separated resource group. these groups have dns alias named there cap name e.g. appqa en appprod each ip's 10.110.250.1 , 10.110.250.2. actually it's same wcf service running on baseadresss, example of our baseadress: <add baseadress="net.tcp://appqa.domain.com:4504/.... , <add baseadress="net.tcp://appprod.domain.com:4504/.... but when running these services on same node noticed getting errors there address in use. we found weird because added our alias in base address section nslookup of both our aliases , gave both right ip address. when running prod service, did telnet command ip address of qa , 4504 port. able make connection means running on both ip adresses (or addresses , port 0:0:0:0:4504). as test changed our baseadresses <add baseadress="net.tcp://10.110.250.1:4504/.... <add baseadress="net.tcp://10.110.250.2:4504/.... and can run both services next each...

javascript - how to create a list-view using angularjs? -

display list of popular movies[10 title per page] url : http://api.themoviedb.org/3/discover/movie?sort_by=popularity.desc display details of movie on click data previous used. fields should mandatory : overview, release_date, vote_average any example code there please share me. helpful me thanks in advanced your question little bit vague can provide information ng-repeat. in controller, have array like: $scope.movies = [{title: "avatar"}, {title: "spectre"}, {title: "teletubbies"}] then, in html create list this: <ul> <li ng-repeat="movies in movies">{{movie.title}}</li> </ul> in list item can later add ng-click attribute, second part of question. first, make sure populate list using api!

jquery - MVC View returns only json formated data using jqGrid -

Image
using jqgrid in mvc showing json formated text view. new mvc , razor please in detail. find code below. using system.collections.generic; using system.data; using system.linq; using system.web; using system.web.mvc; using system.data.sqlclient; using system.reflection; namespace jgridsample.controllers { public class homecontroller : controller { public actionresult index() { return view(); } [httpget] public actionresult getjqgriddata(string page, string rows, string sidx, string sord) { var jqgriddata = new jqgridobject() { data = getloggingdetails(), page = page, pagesize = 3, sortcolumn = sidx, sortorder = sord }; return json(jqgriddata, jsonrequestbehavior.allowget); } public list<goalogging> getloggingdetails() { string connstring = "server=6.15.265.23;database=act2_ol_igp;uid=s_user;pwd=password;pooling=true;connect...

sql server - Select old records in a table -

i want oldest row date each distinct number. created script problem keep on getting newest record. select* [data].[dbo].[iapt] t1 [last contact date] in (select max([last contact date]) [data].[dbo].[iapt] t1.[number] = [data].[dbo].[iapt].[number] , [last contact date] not in (select max([last contact date]) [data].[dbo].[iapt] t1.[pseudo] = [data].[dbo].[iapt].[pseudo])) the table: pseudo number last contact date 0x1 18 17/06/2013 0x1 18 16/04/2013 0x2 19 25/04/2013 0x2 19 16/07/2013 desired result: number last contact date 1 16/04/2013 2 25/04/2013 any appreciated. thank you you should use min function instead of max function select* [data].[dbo]....

Folder monitor Java code prints report twice -

using answers site created small folder monitor app in java. supposed check changes specific folder , output changes text file. unfortunately prints report twice every change. problem cannot figure out first line of report comes from. please me understand doing wrong. please find code below. removed part of code not affect q&a. import java.io.file; import java.io.bufferedwriter; import java.io.filewriter; import java.io.ioexception; import java.util.calendar; import java.util.gregoriancalendar; import java.text.simpledateformat; import java.util.date; import org.apache.commons.io.monitor.filealterationlistener; import org.apache.commons.io.monitor.filealterationlisteneradaptor; import org.apache.commons.io.monitor.filealterationmonitor; import org.apache.commons.io.monitor.filealterationobserver; public class foldermonitor { public foldermonitor() {} //path folder monitoring public static final string folder = "d:\\watcheddir"; public static vo...

oracle - SQL select statement union all with itself -

hi have complicated sql statement returns results. of results in table same id. have result set first plus duplicate of rows belong other table. the code below wrong shows trying achieve: select myrules.* (complicated sql statement) myrules union select myrules inner join table2 on myrules.id =table2.id; is possible? ps1. don't want touch complicated sql statement. ps2. error myrules table or view not exist edit: based on answers try create procedure returns cursor got error in line open cursor: procedure get_rules(in_id in tablea.reconciliation_id%type, io_cursor in out t_ref_cursor) begin myrules ( complicated sql statement) open io_cursor -- errors here: missing select keyword select * myrules union select * myrules inner join table2 on myrules.id = table2.id; end get_rules; yes, valid union all query query on same table. better use with in case: with myrules ( complicated sql statement ) select * ...

virtualbox - packer - cannot shutdown virtual machine -

i trying close virtual machine using command "shutdown_command": "echo 'packer' | sudo -s shutdown -p now" but returns: virtualbox-ovf: sudo: shutdown: command not found how shutdown vm ? i not sure how created packer user (btw, vagrant user, not packer) user not able find shutdown command, path variable might have been unset. shutdown under /sbin or /usr/sbin (depending distros) fix issue should able run "shutdown_command": "echo 'packer' | sudo -s /sbin/shutdown -p now" if not, check shutdown installed ( whereis shutdown ) , replaced location

Interface in TypeScript -

i reading typescript handbook, in chapter of interface, found question: interface labelledvalue { label: string; } function printlabel(labelledobj: labelledvalue) { console.log(labelledobj.label); } let myobj = {size: 10, label: "size 10 object"}; printlabel(myobj); the printlabel need object label:string property, object passed has property called size . ok cause compiler checks @ least ones required present , match types required. but, call printlabel in way: printlabel({size: 10, label: "size 10 object"}); the compile throws exception. so why? the documentation outdated , an issue exists fix it . from what's new in typescript page : typescript 1.6 enforces stricter object literal assignment checks purpose of catching excess or misspelled properties. specifically, when fresh object literal assigned variable or passed argument non-empty target type, error object literal specify properties don't exist in target type. ...

javascript - d3.js - Text position based on text width -

i'm working d3.js generate visualization represents different hypotheses. since hypotheses made of different parts , each word / part gets own text element. i want base x-position of each text element on text width of previous word including offset. having hypothesis "if x y" need 4 text elements "if" having x=0, , since "if" has width of 10 , use offset of 5 "x" x=15 , on. i'm using json data this: {[ {"id" : "id0", "elements" : [ { "text" : "if", "type" : "conditional" }, { "text" : "x", "type" : "variable" }, { "text" : "then", "type" : "conditional"}, { "text" : "y", "type" : "variable" } ]}, {"id" : ...

javascript - MediaElement.js and FireFox -

i have simple code: html <head> <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> <script src="https://code.jquery.com/jquery-migrate-1.3.0.min.js"></script> <script src="build/mediaelement-and-player.js"></script> <link href="build/mediaelementplayer.css" rel="stylesheet"> <script src="main.js"></script> </head> <body> <video id="video-player" preload="preload" autoplay="autoplay"> <source type="video/youtube" src="https://www.youtube.com/watch?v=q7o7r5bgwdy" /> </video> </body> js $(function() { $('video').mediaelementplayer(); }); i have uploaded on server files http://mediaelementjs.com/ in build directory. mediaelement files inside build directory, while index , js file in root. in chrome runs without p...

jquery - In Javascript, How to detect the character case (upper/lower) in keydown & keyup events? -

i need detect case of characters in event keydown , keyup here's code: $('body').keydown( function(event) { var charcode = (event.which) ? event.which : event.keycode; var char = string.fromcharcode(charcode); console.log(char + " down pressed"); } ); $('body').keyup( function(event) { var charcode = (event.which) ? event.which : event.keycode; var char = string.fromcharcode(charcode); console.log(char + " pressed"); } ); you may try here: http://jsfiddle.net/8dqww/ it's returning upper case letter if no caps lock pressed. how detect letter pressed case, either upper or lower in 2 events ? keyup , keydown cannot detect upper/lower case. only keypress can !

ios - Request on php script with nsurlconnection -

i try send value server code have error on line: let reply = nsurlconnection.sendsynchronousrequest(request, returningresponse:&response, error: &error) the error : argument in call "error" var yoururl="mylink" let url = nsurl(string:yoururl) let cachepolicy = nsurlrequestcachepolicy.reloadignoringlocalcachedata var request = nsmutableurlrequest(url: url!, cachepolicy: cachepolicy, timeoutinterval: 2.0) request.httpmethod = "post" // set content-type in http header let boundaryconstant = " v2ymhfg03esomerandomstuffhbqgzcako6jy"; let contenttype = "multipart/form-data; boundary=" + boundaryconstant nsurlprotocol.setproperty(contenttype, forkey: "content-type", inrequest: request) // set data var datastring = "my value" let requestbodydata = (datastring nsstring).datausingencoding(nsutf8stringencoding) request.httpbody = requestbodydata var response: nsurlresponse? = nil var error: nserror? = nil...

python - Simple recursion with yield? -

if put this, see combinations in all_items. however, if not want store combinations , put yield instead, not work. idea? all_items = [] def get_val(n,last): if n < 5: k in range(-1,1+1,1): get_val(n+1,last+[k]) else: get_val(0,[]) all_items += [last] if understand correctly, should work: def get_val(n, last): if n < 5: k in range(-1, 1+1, 1): yield get_val(n+1, last+[k]) else: yield last get_val(0, []) works in python 3.3+, below can replace yield get_val(n+1, last+[k]) with: for thing in get_val(n+1, last+[k]): yield thing

command line interface - php cli custom ini not loading -

a script called command line using : /fullpath/php -q -c /fullpath/php.ini /fullpath/script.php i want use normal php.ini , not 1 cli, -c flag not working. what cause ? you can check configuration files loaded --ini switch. here's normal configuration looks like: krakjoe@fiji:/usr/src/php-src$ php --ini yields: configuration file (php.ini) path: /etc loaded configuration file: /etc/php-cli.ini scan additional .ini files in: /etc/php.d additional .ini files parsed: /etc/php.d/apcu.ini, /etc/php.d/auto.ini, /etc/php.d/autostrict.ini, /etc/php.d/ds.ini, /etc/php.d/inspector.ini, /etc/php.d/memcached.ini, /etc/php.d/mongodb.ini, /etc/php.d/mysql.ini, /etc/php.d/opcache.ini, /etc/php.d/pdo.ini, /etc/php.d/uopz.ini, /etc/php.d/xdebug.ini, /etc/php.d/yaml.ini note that, loads php-cli.ini , because exists , in cli . if this: krakjoe@fiji:/usr/src/php-src$ php -c php.ini-development --ini we get: configuration file (php.ini) path: /etc load...

excel - VBA macro to delete a row -

hey created macro added headers deleted info , got data formatted noticed when ran file deleted data in exact cell need same delete row phrase sits on imagine had cell a1 in other versions of document phrase in a2 macro delete whats in a1 the phrase zfd , whatever cell in need macro delete entire row phrase sits on helppppp sub umr() ' ' umr macro ' ' range("a1").select activecell.formular1c1 = "transaction_type" range("b1").select activecell.formular1c1 = "meter_point_ref" range("c1").select activecell.formular1c1 = "actual_read_date" range("d1").select activecell.formular1c1 = "meter_reading_source" range("e1").select activecell.formular1c1 = "meter_reading_reason" range("f1").select activecell.formular1c1 = "meter_serial_number" range("g1").select activecell.formular1c1 = "meter_reading" range("h1").s...

shell - Transform PHP script into executable -

i trying create script upload file google drive. when run it, works perfectly. here's working code: public function uploadtodrive() { $client = new google_client(); $client->setclientid(mage::getstoreconfig('mtm_google/drive/client_id')); $client->setclientsecret(mage::getstoreconfig('mtm_google/drive/client_secret')); $client->setredirecturi(mage::getstoreconfig('mtm_google/drive/redirect_uri')); $client->setscopes(array('https://www.googleapis.com/auth/drive.file')); session_start(); if (isset($_get['code']) || (isset($_session['access_token']) && $_session['access_token'])) { if (isset($_get['code'])) { $client->authenticate($_get['code']); $_session['access_token'] = $client->getaccesstoken(); } else { $client->setaccesstoken($_session['access_token']); } $ser...

ios - PKPaymentAuthorizationViewController not nil but not showing -

i'm trying display pkpaymentauthorizationviewcontroller not nil isn't showing. worked before doesn't anymore. entitlement , merchant id seems good. here init code (without useless code) pkpaymentrequest *request = [pkpaymentrequest new]; request.merchantidentifier = kapplepaymerchantid; request.merchantcapabilities = pkmerchantcapability3ds; request.supportednetworks = self.class.supportednetworks; request.countrycode = _countrycode; request.currencycode = _currencycode; request.requiredshippingaddressfields = pkaddressfieldall; request.requiredbillingaddressfields = pkaddressfieldname | pkaddressfieldpostaladdress; request.paymentsummaryitems = summaryitems; pkpaymentauthorizationviewcontroller *paymentvc = [[pkpaymentauthorizationviewcontroller alloc] initwithpaymentrequest:request]; paymentvc.delegate = self; return paymentvc; then display using - (void)presentviewcontroller:(uiviewcontroller *)viewcontrollertopresent animated: (bool)flag completion:(void (^ ...

angularjs - ng-blur event does not work on ui-grid cell template -

here sample code. have cell template (text box) within ui-grid. use ng-blur event when value of text box changes event not fire. { name: "amount", displayname: "amount", enablefiltering: false, celltemplate: '<input type="text" ng-model="row.entity.amount" ng-blur="updateentity(row.entity)"></input>' } has cross scenario or used ng-blur within ui-grid's cell template. thank you. u can use native api that: $scope.gridoptions.onregisterapi = function(gridapi){ //set gridapi on scope $scope.gridapi = gridapi; gridapi.rowedit.on.saverow($scope, $scope.saverow); }; $scope.saverow = function( rowentity ) { // create fake promise - you'd use promise returned $http or $resource var promise = $q.defer(); $scope.gridapi.rowedit.setsavepromise( rowentity, promise.promise ); // or call logics here returning promise.reject() - on error or promise.resolve() - on success // fa...

php - Laravel where to put code that can be accessed from anywhere? -

i have following in controller, gets user's avatar s3, , if have avatar return s3 url otherwise return default. public function getavatar(request $request){ $userid = auth::user() ? auth::user()->id : 0; $url = url('/cdn/avatar/default.png'); if($userid > 0){ $md5 = md5($userid); $disk = storage::disk('s3'); $exists = $disk->has('avatars/' . $md5 . '.png'); if($exists){ $url = env('url_avatars') . $md5 . '.png'; } } return response()->json($url); } i don't want have write every time, want move centralized location can call anywhere. still new laravel, not sure put code. do make service provider ? middleware ? else? how access new method? just create helper file in apps folder. <?php //helper.php function makeavatar() { // avatar function // return avatar } now can call function anywhere in application long auto-l...

jquery - Ajax $.ajax is not a function -

i have jquery ajax call this: function testindustry() { $.ajax({ type: "get", async: false, url: "url inserted here", contenttype: "application/json", datatype: 'jsonp', success: function(datajsonp) { if (datajsonp.industry.indexof('manufacturing') >= 0){ //do } } }); } but keep getting error typeerror: $.ajax not function (in function testindustry, line 6, col 5) i read on stackoverflow , seems happens when ajax function called this $.ajax()({}); with pair of opening , closing brackets, not using. appreciated.

java - Branching efficiency -

the couple weeks ago submit function code review looked this. function{ if (condition) else if (condition) else if (condition) else return value } my lead giving code review said "i hate else if," didn't why or should have done instead. gave me go ahead upload function. my question alternatives bunch of "else ifs" make code more elegant , maybe perform better? i tried pulling code idea of have done , noticed several times did if (condition) if (condition) if (condition) should avoid writing "else"? going ask him no longer works here. thank you i try avoid "else", "else if" , "if" , "for". in point of view, branching , looping add complexity code. it's everytime depends on want do. examples: if thing like: if fruit.isbanana() fruit.eatbanana() else if fruit.isorange() fruit.eatorange() ... instead of this, can use inheritance: class banana extends fruit { function eat() ...

php - Call method in external class -

how reference method inside external php file? external-file.php class ourexternalclient { public function getsomedata($variable) { $somecode = new code(); $somecode->variable = $variable; [...] } } current-file.php include_once("external-file.php"); $morecode = ourexternalclient::getsomedata($variable); ...i figure how access external method, i'm not sure. when that, afterwards breaks. example quite vague, i'm hoping can point in right direction. how creating instance of class? include_once("external-file.php"); $ourexternalclient = new ourexternalclient(); $morecode = $ourexternalclient->getsomedata($variable);

c++ - Specialize template member function with already-deduced template parameter -

i want specialize member function of template struct based on type-traits of already-deduced struct template parameter. want 1 version of function when template parameter signed , when it's unsigned. not sure how go this. the struct simple. represents size -- that's no doubt been written thousand times. here's simple version use types, guess: template<class t> struct size { t cx; t cy; // ... bunch of functions might expect. // normalize function -- avoid negative sizes. make sure size @ least 0, 0 void normalize() { cx = std::min(cx, 0); cy = std::min(cy, 0); } }; but of course processing function pointless unsigned types. i'd make no-op types. for second, thought might try using enable_if along return type. typename std::enable_if<std::is_signed<t>::value, size&>::type normalize() { cx = std::max(cx, 0); cy = std::max(cy, 0); return *this; } typename std::enab...

why my C# json Deserialization failed? -

i fighting against decoding json file popular historical methods mentioned in stackoverflow.com site. however, none of them worked in case. here little piece of json file dealing with: [{ "lat": [ [-19.1415329], [-18.822279], [-18.672287] ], "lon": [ [135.673416], [135.547226], [135.566849] ] }] you can see complete json file here: ftp://ftp.star.nesdis.noaa.gov/pub/smcd/spb/xjin/icvs/json/npp/2016/20160124_cris.fsr.json using system.net; using system.io; using system.runtime.serialization; using system.runtime.serialization.json; using system.web.script.serialization; string jsonftp = @"ftp://ftp.star.nesdis.noaa.gov/pub/smcd/spb/xjin/icvs/json/npp/2016/20160124_cris.fsr.json"; getjson(jsonftp); private void getjson(string url) { var req = (ftpwebrequest)webrequest.create(url); using (stream stream = req.getresponse().getresponsestream()) { streamreader reader = new streamreader(stream); string jsont...

idl - Thrift syntax error -

thrift 0.9.2 here. here simple led.thrift file: namespace c_glib com.example.led namespace java com.example.led typedef i32 int enum ledstate { off = 0, on = 1 } struct ledtogglecommand { 1: required int ledid; 2: required ledstate state; } exception ledunavailableexception { 1: message; 2: cause; } service ledservice { oneway void toggle(1: ledtogglecommand cmd) throws (1: ledunavailableexception luex); } when run thrift --gen java led.thrift following error: [error:/users/myuser/tmp/thrift_samples/samples/led.thrift:17] (last token ';') syntax error [failure:/users/myuser/tmp/thrift_samples/samples/led.thrift:17] parser error during include pass. what's going on here? you need add data types. exception ledunavailableexception { 1: string message; 2: string cause; } additionally, (at least) newer versions tell ... [failure:test.thrift:22] oneway methods can't throw exceptions.

How to upload an image in php mysql -

hi iam trying upload image database inserting tmp_name in database.can me . here code <?php $connection = mysql_connect("localhost", "root", "") or die(mysql_error()); $db = mysql_select_db("accountant", $connection); $title=$_post['blog_title']; $description=$_post['blog_description']; $name=$_files["image"]["tmp_name"]; $type=$_files["image"]["type"]; $size=$_files["image"]["size"]; $temp=$_files["image"]["tmp_name"]; $error=$_files["image"]["error"]; if($error>0) die("error while uploading"); else { if($type == "image/png" || $type == "image/jpeg" ||$type == "image/jpg" || $type == "image/svg" || $size >2000000) { move_uploaded_file($temp,"upload/".$name); $sql=mysql_query("insert blogs(image,blog_title,blog_description)values('$name'...

render - LaTeX not rendering in webpage -

why latex not rendering in this page? the page doesn't recognizes latex. make recognize, add following cdn mathjax script: <script type="text/x-mathjax-config"> mathjax.hub.config({tex2jax: {inlinemath: [['$','$'], ['\\(','\\)']]}}); </script> <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/mathjax.js?config=tex-ams_chtml"> </script> also, add $ before latex statement in page.

javascript - Get value from console.log and display/print/return in a input field -

how values printed in console.log, , set them values in input field? here jsfiddle, containing have far - https://jsfiddle.net/ubo1heru/ the code through values put in console.log: $("button").click(function() { var dishkomap = {}; $("select[name='diskho'] > option:selected").each(function() { var value = this.value; if (dishkomap[value]) { // if value exists increase 1 dishkomap[value] += 1; } else { dishkomap[value] = 1; } }); // dishkomap dictionary object won't see in alert. // open browser console , can see counts corresponding // each selected option console.log(dishkomap); }); just create function besides printing in browser console updates value of input field: var printtodishkomap = function (data) { // stringifying data is json $('input.diskhoval').val(json.stringify(data)); console.log(data); } $("button").click(...

jquery - Generate .ics from json -

i'm trying export calendar outlook json data stream. i'm pretty sure sort of thing in .net rendering response following header definitions: response.contenttype = "text/calendar"; response.addheader("content-disposition", "attachment; filename=calendarevent1.ics"); i'm using following jquery retrieve data , i've verified data coming properly, i'm stuck on how proceed rendering output such open calendar in outlook. i'm sure it's i'd need add success: function(data){} block, i'm not sure what. think can figure out how iterate through json elements , pull necessary data (title, start, end, etc.), don't know where/how set header information , how ensure stream output in new window guess (so existing screen isn't affected)? want user click on "export calendar" link , new calendar open in outlook event dates json response. thanks. $('#exportcal').click(function() { var jdata = {offi...

ios - What's the difference between playbackLikelyToKeepUp and AVPlayerItemStatusReadyToPlay? -

i'm trying understand how detect when player item can play again. see below observer logic: if (object == playeritem && [keypath isequaltostring:@"playbackbufferempty"]) { if (playeritem.playbackbufferempty) { // show loading indicator } } if (object == playeritem && [keypath isequaltostring:@"playbacklikelytokeepup"]) { if (playeritem.playbacklikelytokeepup) { // hide loading indicator if (playeritem.status == avplayeritemstatusreadytoplay) { // start playing } else if (playeritem.status == avplayerstatusfailed) { // handle failed } else if (playeritem.status == avplayerstatusunknown) { // handle unknown } } } is checking avplayeritemstatusreadytoplay underneath playbacklikelytokeepup overkill? or should listen status change on player item instead of bothering playbacklikelytokeepup ? the 2 prop...

java - Intellij Idea incorrect encoding in console output -

it seems crazy, can't broken encoding in console of intellij idea. things made overcome this: set -dfile.encoding=utf-8 , -dfile.encoding=utf-8 in both idea.exe.vmoptions , idea64.exe.vmoptions (i use 64 bit version though). added -dfile.encoding=utf-8 , -dfile.encoding=utf-8 run/debug configuration of application. changed settings > editor > file encodings ide encoding/project encoding/default encoding property files utf-8. having done there still no luck , symbols not shown correctly in console. tried debug java.io.printstream#println(java.lang.string) method , found out system.out.textout.out.se.cs equals windows-1251. no idea value coming from. this issue have been bothering me long period of time , unable find in web me. thanks in advance help. the reason why not work can found placing breakpoint on system.out.print() call. when breakpoint hits, can add system.out watches, , can see system.out.textout.out.se.cs set windows-1252 or unsuitable....

SQL Server : incrementing non identity int column by procedure call -

i have column in db table has increment when let's item selected. can selected parallel , records has start 0. solution increment value db procedure, can sure first procedure manages increment value before procedure want load value increment? mean: t0 value 10 t1 procedure1 valuetoinc = value t2 procedure2 valuetoinc = value t3 procedure1 valuetoinc ++ t4 procedure2 valuetoinc ++ t5 value = 11 t6 value = 11 value written procedure1 11 procedure2 11 (need secure 12 there). i have checked identity (property) , sequence (transact-sql) nothing seems suitable me. edit what i´m trying solve have console application - tcp server , mssql database, have user table. each time single user wants login, have increment users logincount field. parallelization here should not possible or manageable code, know, told me have hande parallel acces database, not use update query. have job interview project... i wanted make understanding easier first explanation, won´t work. you...

r - Scraping first two columns of web tables with xml2 -

i have struggled use xml package in r , need scraping well-formatted tables xml2. the url first page of tables i'd scrape here . on pages want second , third tables, on others want first , second. common thread want tables 'caption' tag includes text 'that meet' scraped , stored in 1 list, , tables 'caption' tag inclues text 'that not meet any'. don't know how @ that. code working follows. can imagine there must sort way make regexp condition select whole table. hope code works. #define urls urls<-lapply(seq(1,12, 1), function(x) paste('http://www.chemicalsubstanceschimiques.gc.ca/challenge-defi/batch-lot-',x,'/index-eng.php', sep='')) #scrap text batches<-lapply(urls, function(x) read_html(x)) #return tables each batches_tables<-lapply(batches, function(x) xml_find_all(x, './/table')) #get table first out<-batches[[1]] #inspect out[[1]] #do not want table out[[2]] #want table pasted in 1 l...

go - Golang check if string is valid path -

the golang filepath module ( https://golang.org/pkg/path/filepath/ ) contains few functions manipulating paths , os.stat can used check if file exists. there way check if string forms valid path @ (regardless of whether there's file @ path or not)? this problem sounds simple, not. here 2 possible solutions found : solution 1 - academic the idea here check given filepath based on rules. problems operating system (unix / windows) filesystem reserved keywords operating system the first 1 easiest. go provides various tools os-specific filenames/separators/... example in os package: const ( pathseparator = '/' // os-specific path separator pathlistseparator = ':' // os-specific path list separator ) another 1 in filepath package: // volumename returns leading volume name. // given "c:\foo\bar" returns "c:" on windows. // given "\\host\share\foo" returns "\\host\share". // on other...

visual studio extensions - Analogue of background thread in VSIX project? -

basically, i'm trying carry out number of tasks while visual studio instance running. i have not been able find yet in visual studio sdk reference analogous background thread or isrunning or that. can far respond specific events such view changing or cursor being moved. i don't understand event fires when visual studio instance finishes loading. surely there must pretty big i'm missing here? manages lifecycle of visual studio instance? so nothing prevents launching background thread , doing work there. sorts of components time. there ways can register package load in various scenarios , , there launch thread. be careful of course of these -- if did "i'll run background thread once vs loads", cpu cores very, busy! there's older concept in vs called "idle loop" code can registered run whenever ui thread doesn't have message pump, , internal joke idle loop never idle.

python - Is there a way to select which types of HTTP requests are logged by pyramid_debugtoolbar? -

i trying check performance on app hosted behind haproxy load balancer. load balancer checking service health sending head query root uri / . because happens once second, legitimate requests scroll off list pretty quickly. is there way can selectively disable logging of head requests?

How to configure Meteor build and run for a Cordova build through NGINX + SSL? -

i have web application used build cordova android app. application built ubuntu server running nginx ssl (mongo hosted on mongolab). on production use nodejs 0.12.x, in dev still use meteor shell. when build application run command : meteor build ../../build/mercanet/ --mobile-settings settings.json --server=https://myip when run application on server here command (on prod server use node : meteor --settings settings.json --mobile-server https://myip --port 3000 if open browser https://myip can check websocket works nginx configured. if open application in android emulator, fails connect : https://myip/sockjs/info?cb=x3i8q_or0y (cancelled) i tried without ssl , replace https http in meteor shell , worked, i'm wondering should use https meteorjs , cordova. for information here content of meteor_runtime_config on cordova : {"meteorrelease":"meteor@1.2.1", "root_url":"https://myip/", "root_url_path_prefix":...

mysql - Why does Cucumber drop tables if schema.rb is not present? -

i have rails 4 app uses external db don't control. there no schema or migration. anyway, create model , use db setting table_name in model. when run cucumber drops db tables!? idea why , how avoid it? $ bundle exec cucumber running via spring preloader in process 18865 .../db/schema.rb doesn't exist yet. run `rake db:migrate` create it, try again. if not intend use database, should instead alter .../config/application.rb limit frameworks loaded. after db empty, no tables. you should still able dump schema locally if activerecord connecting db. rake db:schema:dump

javascript - Update an angular treeview directive when a new object is added to the collection -

Image
i have treeview directive credit http://codepen.io/bachly/pen/kwwrzg being starting block. trying update when add objects collection. can update object , insert new objects treeview directive never called once $scoped item updated. data used come service @ point testing mock data. the original collection looks this $scope.mylist = { children: [ { name: "event", children: [ { name: "event date", parent:"event", children: [ { name: "2008", filtertype: '_eventstartdate', parent: 'event' }, { name: "2009", filtertype: '_eventstartdate...