Posts

Showing posts from August, 2013

jQuery - Dynamically added content - Radio on change function -

i using ajax load popup containing different settings, including button ("click" event) , radio buttons ("change" event). while "click" event works fine, (using following function) $("#my_popup").on("click", '.my_button', function() { "use strict"; // things }); ... "change" event not. see corresponding function below: $('#my_popup').on('change', 'input[name=input_name]:radio', function(){ "use strict"; if(condition) { // other things } else { // other things } }); any ideas how make work? according dynamic event binding rules in thread believe should working fine... html: <div id="my_popup"> <input id="radio_1" type="radio" name="input_name"> <input id="radio_2" type="radio" name="input_name"> <!-- [...] --> </div> tha...

php - Generate special JS for each modal Bootstrap 3 -

i'm making shop script got problem. made function show items mysql , add modal don't know how add js each modal can buy item without reloading page, on modal. code of item creating: function create_item($id, $imgid, $title, $desc, $cost, $smscode, $smsnumber) { echo ' <div class="col-sm-12 col-md-3 col-md-offset-1"> <div class="thumbnail"> <span class="pull-right title-itemshop">'. $title .'</span><img class="pull-left"src="id/'. $imgid .'.png"/> <br/><hr class="hr-itemshop"/> <a href="#" class="btn btn-danger form-control" role="button" data-toggle="modal" data-target="#'. $id .'">zobacz więcej &raquo;</a> </div> <div id="'. $id .'" ...

javascript - Node.js: how to request an image only if it changed -

i'm designing node.js app. 1 of tasks regularly download set of images public, external, site. 1 requirement avoid repeating download of images not changed previous download. plan use "request" module, since far more complete , flexible respect other networking modules (please correct me if i'm wrong). this code i'm using (please ignore mistakes, comparing dates > or < operators, consider pseudo-code ...): var request = require('request'); var myresource = { 'url': 'http://www.example.com/image1.jpg', 'last-modified': 'mon, 28 sep 2015 08:44:06 gmt' }; request( myresource.url, { method: 'head'}, function (err, res, body) { if (err) { return console.error('error requesting header:', err); } var lastmodifieddate = res.headers['last-modified']; console.log('last modified date:', lastmodifieddate); if (lastmodifieddate > myresource['la...

package - How do I speed up packaging of my WAR project in Maven 3.3.3? -

i’m using maven 3.3.3. have war project large number of static assets. when building war project (using “mvn clean install”), project take upwards of 15 minutes build, when java files have changed. below war plugin configuration. there way speed building of file? i’m using “in=place” , “usecache” options no avail … <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <usecache>true</usecache> <workdirectory>${user.home}/${project.artifactid}/war/work</workdirectory> </...

Objective C iOS - Crossfade size transition for UILabel -

i trying make custom uiview in label on view starts two-line preview of text, grows size of text when view pulled down make room bigger label. want transition crossfade between 2 sizes. if set frame inside animation block, animates label coming in off-screen @ new size instead of crossfading. if put in completion block, doesn't crossfade animate @ all. i'm sure doing dumb, here. note using transitionwithview in example code below, same thing happens animatewithduration... cgsize newsize = [self.label.text boundingrectwithsize:cgsizemake(self.label.frame.size.width, maxfloat) options:nsstringdrawinguseslinefragmentorigin attributes:@{ nsfontattributename : self.label.font } context:nil].size; cgrect ...

elasticsearch - Notification System on ELK -

i have elk stack. need have notification system query elastic search particular query , trigger email notification if finds one.can suggest such open source notification tool? elastic offers commercial system this, watcher . if want alert on individual events, can use email{} output logstash. assuming logs not first thing you're monitoring, recommend integrating type of check existing monitoring system. can write script these (like nagios, or commercial systems) runs query want. there's more on rational , design ideas here .

angularjs - withFixedColumns property dont work for me using angular datatable -

i using angulardatable. need create table , fixed first column. datatable work fine, when add withfixedcolumns table dissapear. have included libraries. this part of code var app = angular.module('dataview', ['datatables', 'datatables.fixedcolumns']) app.controller('dataviewctrl', function($scope, dtoptionsbuilder,){ $scope.dtoptions = dtoptionsbuilder.newoptions() .withoption('scrolly', '500px') .withoption('scrollx', '100%') .withoption('paging', false) .withoption('scrollcollapse', true) }) <script src="/assets/vendor/jquery/dist/jquery.min.js"></script> <script src="/assets/vendor/bootstrap/dist/js/bootstrap.min.js"></script> <script src="/assets/vendor/angular/angular.min.js"></script> <script src="/assets/vendor/datatables/media/js/jquery.datatables.min.js"></script> ...

office365 - Office Web Apps - Excel Web App causing errors -

i managed office web apps configured sharepoint dev environment , having issue excel documents. when create or edit excel document in browser, error: "we're not able contact server. might not responding, or internet connection may have been interrupted. please try again." vague know. looking @ error event viewer below, have idea causing it? this error in event viewer: event code: 3005 event message: unhandled exception has occurred. event time: 9/29/2015 3:03:19 pm event time (utc): 9/29/2015 10:03:19 pm event id: 65630219f0764564b0a4e52ee555ec99 event sequence: 6 event occurrence: 1 event detail code: 0 application information: application domain: /lm/w3svc/2/root/x-1-130880377864550895 trust level: full application virtual path: /x application path: c:\program files\microsoft office web apps\excelserviceswfe\ machine name: owasrv01 process information: process id: 13108 process name: w3wp.exe account name:...

javascript - How do I remedy Browser CSP errors when using underscore.js -

i have been working on web application past couple of years , have gone make more secure adding content security policy. i have been able remedy of issues have found, have been unable solve 1 remaining issue. csp complains error message whenever templating occurs in underscore.js believe makes use of no-no; being js code "new function(...)". i have seen other recommendations on web, being basically: use engine precompile template, eg grunt-inline-template-compile useful when have template strings inline, mine in actual html in tags, wouldn't possible without drastic content moving around. switch templating engine, option more appealing previous afraid break many lines of templating syntax of underscore , huge job in itself. are there other options people aware of? try setting content-security-policy header unsafe-eval scripts domain temporary workaround. http://content-security-policy.com/ move template engine such handlebars possible. can hav...

c# - WCF and RESTful API: remote server returned bad request 400 on DELETE method -

Image
i checked ton of posts/tutorials/videos still can't working code delete method in 1 specific case: when i'm trying delete id. working sample below. i'm passing whole json string delete method , works (based on dare suggest there no errors in wcf/client configuration files). wcf [operationcontract] [webinvoke(method = "delete", responseformat = webmessageformat.json, requestformat = webmessageformat.json, uritemplate = "delete" )] bool deletenews(news news); client: const string webservice_url = "http://localhost:33873/newsservice.svc/delete"; string jsondata = "{my json string}"; try { var webrequest = webrequest.create(webservice_url); if (webrequest != null) { webrequest.method = "delete"; webrequest.timeout = 20000; webrequest.contenttype = "applicati...

html - What is the space between these elements? -

what spacing (the red section) between <div> elements in my code @ jsfiddle ? have both padding , margin set 0px. don't know what's causing them. have used f12 on chrome , determined .column not include it. that's space between inline-blocks elements. there many ways fix this, including: adding negative margin elements giving font-size of 0 parents removing space between closing , next opening tags comments you can see highlight of these methods here .

javascript - How to have KendoPanel's all the sections expand -

i started using kendopanel , wanting expand segments of panel under condition. using following code achieve that: var panelbar = $("#kendopanel").kendopanelbar(); var kendopanelbar = panelbar.data().kendopanelbar; kendopanelbar.collapse($("li", panelbar.element)); seems contracting segments instead of expanding them. doing wrong? please try below code snippet. <ul id="mypanelbar"> <li class="k-state-active">first item <ul> <li>sub item 1</li> <li>sub item 2</li> <li>sub item 3</li> <li>sub item 4</li> </ul> </li> <li>second item <ul> <li>sub item 1</li> <li>sub item 2</li> <l...

c - How to convert character from an array into a string -

i'm having difficulty appending character value of array onto string (handsorted) . hand[] predefined array of text. char *handsorted = malloc(strlen(hand)+1); strcat(handsorted, hand[2]); for example handsorted string of value of hand[2] , letter 'a'. when dealing c, learn how use manual pages in terminal. here entry strcat. description strcat() , strncat() functions append copy of null-terminated string s2 end of null-terminated string s1, add terminating `\0'. that's 1 problem. need handsorted null terminated. char *handsorted = malloc(strlen(hand)+1); handsorted[0] = '\0'; strcat(handsorted, hand[2]); but there still problem. hand[2] single character, , strcat() expects character pointer, aka string. need pass address of character using 'address-of' operator - &. this. char *handsorted = malloc(strlen(hand)+1); handsorted[0] = '\0'; strcat(handsorted, &hand[2]); i think we're after.

malformed url java selenium while using local picture -

so i'm trying upload image using selenium can test functionality of website. have tried various things , have been unable image upload. i've tried attachfile: selenium.attachfile("id=upload_field", "c:\\bacon.jpg"); i've tried using driver in below code find element: webelement uploadimage = driver.findelement(by.xpath("//input[@type='file']")); uploadimage.sendkeys("c:\\bacon.jpg") i've tried find element button id: webelement uploadimage = driver.findelement(by.id("upload_button")); i've tried using click , upload method errors out when use click , tells me should using attachfile. the website uses modal window upload story. any appreciated. oh, when use attachfile error: com.thoughtworks.selenium.seleniumexception: malformed url:c:\bacon.jpg

javascript - get the background image dimension -

i want make design responsive need background image dimension (width, height) using javascript or jquery. ideas ? <div class="container"> <div id="result" class="result">&nbsp</div> <div class="slot-container"> <div id="slot1" class="slot"></div> <div id="slot2" class="slot"></div> <div id="slot3" class="slot"></div> <div><button id="control" class="btn">start</button></div> <div id="try" class="result try">try 0</div> </div> </div> https://jsfiddle.net/h0fbha33/ $(window).on("load", function () { var img = new image(); img.src = $('.slot').css('background-image').replace(/.*\s?url\([\'\"]?/, '').replace(/[\...

Yadcf with Select2 puts empty selected option -

first of all, lot amazing plugin! have datatable server-side processing. when choose 1 option dropdown, got 2 selected options: 1 choose, , empty. mean got this: <ul class="select2-selection__rendered"> <li class="select2-selection__choice" title=""></li> <li class="select2-selection__choice" title="option1"></li> <li class="select2-search select2-search--inline"></li> </ul> it makes wrong sql query (in operator got '|option1'). can correct query php script, won't remove empty selected option header of table. would appreciated help. you welcome, looks using multi select filter on column, , thats why yadcf sends strings | (or) server. on server side have split of string array/list of string , construct proper sql query. split in java split in php(see code sample in bottom p.s i'm author of yadcf

multithreading - Javascript Worker Thread Options? -

i developing single page application using electron (io.js + chrome). application interfaces sdk requires polling/heartbeat run main/event loop (similar libusb , libusb_handle_events_timeout_completed api). hoping use worker thread , timer seems sandboxing may have made option impossible--unless missing something. i've tested timer functionality within worker thread , works great. however, need require various other modules (ffi, etc) allow me communicate sdk; however, require not available worker threads. are there other options/apis/modules/etc available allow me start new thread can require other modules can make simple call sdk every many milliseconds? long have ipc main thread, new thread can sole communicator sdk, therefore there should no problems corruption. suggestions or further areas research appreciated. after spending more time on problem found node.js clusters best approach me. have ability to: require code. still have nice neat ipc....

ruby - How do I setup Selenium webdriver on RubyMine? -

i have learn how user selenium webdriver in rubymine have no idea how install selenium gem. have downloaded selenium gem, next? how install or bind rubymine ide? used work lot java, ruby , rubymine new tools me. in advance i found it! simple type command in command line gem install selenium-webdriver

javascript - How to get the output of a system command as a returned value from a function? -

the code shown below intended output present working directory console. instead outputs, "undefined". purposes of learning experience, important obtain desired result returned value of system function. ideas on how can make work? #!/usr/bin/node var child_process = require('child_process'); function system(cmd) { child_process.exec(cmd, function (error, stdout, stderr) { return stdout; })}; console.log(system('pwd')); exec executed asynchronously. pass callback function , you're set. #!/usr/bin/node var child_process = require('child_process'); function system(cmd, callback) { child_process.exec(cmd, function (error, stdout, stderr) { //you should handle error or pass callback callback(stdout); }); } system('pwd', function(output){ console.log(output); }); and here's how synchronously, believe looking for. function systemsync(cmd) { return child_process.execsync(cmd).tostring(); } consol...

html - PHP validate executes the IF statement AND the ELSE statement at the same time -

like title says, i'm having problem regarding validation php. it's simple login php, if user inputs wrong information, validation form execute saying return previous login page after 5 seconds countdown. but, if user inputs right username , password, display welcome text on validation php. however, whenever run program executes both welcome text , countdown, regardless of whether inputted information right or wrong. here's first php: <!doctype html public"-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <style> body { margin:0; font-family: calibri} .style1 { color: #ffffff} </style> </head> <body> <h1>getting input user</h1><h2...

In rails 4.2, how to display a form for preview but ensure it cannot be submitted -

i'd have a form view can, depending on circumstances, have submit functionality disabled in bullet-proof way clever user not edit html source (via browser extension) re-add submit button. it seems 1 way might somehow inject invalid authenticity token replaces (valid) rails-generated one, if user somehow re-adds submit button (by editing html via browser extension) still invalid submission. my thought have logic in view: - if @form_disabled # set controller - somehow_invalidate_the_authenticity_token? how might 1 'break' rails form submission? the purpose of doing this, instead of rendering preview in :show action, have exact same view displaying both live-form , dead-form. if you, use pundit . it's pretty simple, , has few lines of code if need know how works. i'd start write code here, realize example @ readme fit needs. at application controller add this at folder app/policies put class postpolicy , of course, must replace ...

MySQL special chars lost when queried in Python. (But works with Django.) -

i have mysql database utf8 encoded. contains row value "sauté". note accent on e. when select data using django application correctly detects é. however, when execute python program information (the special e) seems lost. i've tried various combinations of encode , decode , "from future import unicode_literals" , putting "u" in front of sauté string , putting u in front of query string. no luck. how can info correctly out of database (with python) , test it? # connection when excute .py: (django usual in settings.py) cursor = mysqldb.connect(host='<xxx>',user="<xxx>", passwd="<xxx>", db="<xxx>", unix_socket = 'path/mysql.sock' ).cursor() # same code in django , python execution: cursor.execute(select line my_table id = 27) results = cursor.fetchall() r in results: line = r[0] if re.search("sauté", line): do_something() # sh...

Is HortonWorks Sandbox VM preferred in production environment? -

the hortonworks hdp, implemented in 2 ways: sandbox (vm) manual installation. i understand, whether hdp sandbox, or manual installation preferred in production environment. choice made on obvious reasons performance, understand whether there other considerations? the hortonworks sandbox allows try out features , functionality in hadoop , its' ecosystem of projects. that's all. if want go production, have 3 installation type: automated ambari manual cloud cloudbreak regards, alain

javascript - Calling a function when dropdown toggle is clicked -

i have dropdown-toggle , want call function read(); every time clicked or toggled. there wrong onclick command wherein calling function read(); though toggle not clicked. have tried other commands such ondrop html: <a data-toggle="dropdown" class="dropdown-toggle" onclick="read();"> <i class="fa fa-globe"></i> <span class="badge"> <%=unread%> </span> </a> javascript: function read() { <% notificationdao.read(((user)session.getattribute("user")).getemployeeid()); %> } guessing using bootstrap data-toggle has own events $('#mydropdown').on('show.bs.dropdown', function () { call read method here.. }) hope helps. https://jsbin.com/fayoda/edit?html,js,console,output

apache - Archiva vs artifactory -

i doing research on apache archiva , artifactory. so, not finding exact information apache archiva , artifactory supporting following features or not: 1) load balancing 2) nuget 3) redhat , centos 4) ease of backup , disaster recovery 5) ldap mapping local defined users. so, please tell these features supported apache archiva , artifactory? of great help. a place start binary repository manager feature matrix contains highly detailed comparison of artifactory, archiva , nexus.

c# - Inserting multiple listitems of dropdownlist into multiple rows of the database -

i trying insert multiple selected values of asp.dropdownlist multiple rows of database. using silvio montero bootstrap select css acheive multiple selection. i using foreach() loop first selected item getting inserted database. asp.dropdownlist populated database. <asp:listbox runat="server" cssclass="selectpicker form-control" multiple data-live-search="true" id="dropdownlist1" datatextfield="username" datavaluefield="username" > </asp:listbox> here c# code - protected void page_load(object sender, eventargs e) { if (!ispostback) { binddropdownlist(); } } private void binddropdownlist() { using (sqlconnection con = new sqlconnection(cs)) using (sqlcommand cmd = new sqlcommand("select distinct [username], [email] [login]", con)) { sqldataadapter da = new sqldataadapter(cmd); ...

php - Laravel5.1 Route set all URL to Controller -

i think get/post visit controller route::match(['get','post']. '{controller}/{method}','$controller\$controller_controller@$method'); but error; how localhos/website/user/login ,go find controllers/user/user_controller@login? i thing searching this route::get("/my/path", "mycontroller@mymethod"); route::post("/my/path", "mycontroller@mymethod"); or can use route::resource

mysql - Dynamic variable not working in php -

i cant declare dynamic variable. hardcoded variable working. have code reads .mdb file. working when values hardcoded when make values dynamic doesnt work. using double , single quote working when defining in variable without quotes. working code is $userid = "91"; $sensorid = "1"; $conn = new com("adodb.connection") or die("adodb oops!"); $conn->open("driver={microsoft access driver (*.mdb)};dbq=c:\standard\att2003.mdb"); $data = $conn->execute("select * checkinout userid = '".$userid."' , sensorid = '".$sensorid."' order checktime desc"); it doenst work if declare $userid = $userdetails['fingerprintid']; i can assure im getting right value when using $userdetails['fingerprintid']; this error fatal error: uncaught exception 'com_exception' message ' source: microsoft ole db provider odbc drivers description: [microsoft][odbc ...

xaml - Visual Diagnostic is either disabled or is not supported by the current application -

with vs 2015 enterprise following message on solution while debugging: xaml visual diagnostic either disabled or not supported current application tools - options - debugging - general: enable ui debugging tools xaml enabled preview selected elements in live visual tree enabled i have tried: vs restart clean solution / rebuild fresh checkout curious: if start solution without debugging , attach debugger process, works ... update: if select "enable native code debugging" in project settings - debug, works ! i needed additional debugging option disabled in order tools work projects: tools - options - debugging - general: use managed compatibility mode --> disabled

php - angular-laravel create users gives a query exception -

i'm trying create new users in basic laravel-angularjs app. i'm getting 500 server error , upon looking further there's query exception. i'm passing text value password hashed. error because of this? angular controller: user.saveusers({ "first_name":um.firstname, "last_name":um.lastname, "admin":um.admin, "email":um.email, "password":um.password }).then(function(success) { console.log(success); }, function(error) { console.log(error); }); the laravel controller: public function store(request $request) { // $data = request::all(); $users = new user(); $users->fill($data); $users->save(); } users.php: protected $fillable = ['first_name','last_name','admin', 'email', 'password']; protected $hidden = ['password...

python - How to remove all lines in a file containing a specific character except for the first? -

i trying make script merges files in directory , remove unwanted lines in output file. lines want remove contain same string pattern , want remove first of lines (which first line in file). here how trying it: import glob # merge output files 1 file read_files = glob.glob('/home/user/results/script_tests/testresults/*.output') open('mergedoutput.txt', 'r+b') outfile: file in read_files: open(file, 'r+b') infile: outfile.write(infile.read()) print 'files merged.' # remove header rows except row 1 final_output = open('finalmergedoutput.txt', 'r+b') open('mergedoutput.txt', 'r+b') file: line in file: if line == 0 , line.startswith('file'): final_output.write(line) elif line > 0 , not line.startswith('file'): final_output.write(line) print 'headers removed except on line 1.' the merging part works p...

simpleadapter - button onClick doesn't work second time on listview -

[![the + button doesn't work on second time. value on qty change once. please me. has been 3 weeks.][1]][1] https://drive.google.com/file/d/0b_rgletufbjhelb5tnddemtqu3c/view?usp=sharing (adapter.java)

tomcat - Java Logger not rotating log files -

i'm using tomcat 8.0.21 on rhel 7. in java code i'm logging text file java.util.logging.logger . there 1 log file. if restart tomcat logging starts again moment , previous logs gone. i added %g file name instructed here adds 0 file name , no rotation occurs. here code create filehandler . strfilepath value example "/tmp/mylog.log". logformatter own class. // need set format own formatter class plain text 1 line (default format xml). filehandler file_handler = new filehandler(strfilepath); file_handler.setformatter(new logformatter()); logger.addhandler(file_handler); on windows 7 laptop logs rotate fine using same code , tomcat version. how can enable java logger log file rotation on rhel server? edit: guess add timestamp file name when constructing filehandler . i'm going try that. the filehandler rotates when limit exceeded (or unable lock file). if want rotate files time have code that. if want trigger rotation create throw aw...

django - error: RPC failed; result=22, HTTP code = 413 fatal: The remote end hung up unexpectedly -

i getting error when trying push django code git around 100 mb. error: rpc failed; result=22, http code = 413 fatal: remote end hung unexpectedly i tried http.postbuffer , changed nginx , apache2 settings, added client_max_body_size 500m; . neither using of servers. trying upload git. can 1 give me solution? when 1 error? this error occurs when try push large repository on http. http.postbuffer setting on git client controls maximum size in bytes of buffer used when posting data. default size 1 mib , if try push file greater this, error. some possible solutions: 1. setting higher value http.postbuffer setting you can set higher value http.postbuffer setting on git client. # increase git buffer size largest individual file size of repo git config --global http.postbuffer <size_in_mib> 2. nginx servers: (a) client_max_body_size setting it can occur due default reverse proxy configuration settings. 1 such setting client_max_body_size set...

c# - Trying to edit a text field in MS Access, but it says it needs more parameters -

i'm trying edit textfield in ms access database. i'm able edit number, if try edit textfield asks me more parameters. code looks this: try { ad.updatecommand = new oledbcommand("update tabel1 set navn=" + txt_navn.text.tostring() + " id=" + txt_userid.text + "", conn); ad.updatecommand = new oledbcommand("update tabel1 set niveau=" + txt_niveau.text.tostring() + " id=" + txt_userid.text + "", conn); conn.open(); ad.updatecommand.executenonquery(); conn.close(); } catch(exception ex) { messagebox.show(ex.message); conn.close(); } basically, navn text field won't accept changes , asks more parameters if disable niveau line. i've tried having both within same ad.updatecommand line, gave me error. as doesn't give error, doesn't change 'navn' field in database, 'niveau' field changes fine. guys have idea? navn may reserved, try frame it. also, ...

java - Column_layout does not work in android tablelayout -

mistake in tablelayout in android. issue want move button 1 column in second row using property column_layout in 2 tablerow. have found solution. please,check answer. android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".tablelayoutactivity" android:orientation="vertical" <tablerow> <button android:id="@+id/firstbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/myfirstbtn"/> <button android:id="@+id/thirdbutton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/mythirdbtn"/> <button android:id="@+id/fourthbutton" ...

cryptography - Use of Initialization Vector in DES -

say have encrypt data using des (or triple des). if iv used 8 bytes, set '0' (ie. iv constant byte[], set 0x00), okay? or same using no iv in first place? it no good. hard-coded iv means same plain text encrypt same cipher text. iv intended prevent. if use mode allows iv @ all, approach randomly generate iv, use in encryption on blocks of plain text want encrypt, , prepend iv unencrypted cipher text. many people worry "won't would-be attacker see iv then?" answer yes, doesn't matter. key needs secret. iv not need secret enhance security of encryption dramatically. does, however, need random. note not enough thwart active attacker. enough thwart passive eavesdropper. edit: ok, explain why won't stop active attacker best recall attack. explanation, consider cipher block chaining (cbc) because commonly used. you'll have extrapolate explanation other modes. cipher block chaining xors first block of message iv , encrypts block...

react native - How to overlay Navigator.NavBar? -

Image
how can overlay of navigation.navbar here have but want red 1 should overlay green 1 navbar ? i made using http://facebook.github.io/react-native/docs/modal.html#content add there navigator , works expected

javascript - Average of Numbers in Column If Condition In Different Column Satisfied -

i have data range of first column dates , second column numerical values. there rows second column value blank , not want them counted. i trying find average of second column values if satisfy criteria of being within 3 months ago today (blank values should not counted). but stuck cannot total correct. , not know how proceed further average. the code belows seem give me appended strings instead of summing numbers mathematically. can please? thanks in advance. function average() { // open spreadsheet var spreadsheet = spreadsheetapp.openbyid("spreadsheetid"); // set named sheet active var sheet = spreadsheetapp.setactivesheet(spreadsheet.getsheetbyname("sheetname")); // figure out last row var lastrow = spreadsheet.getsheetbyname("form responses 1").getlastrow(); // rows indexed starting @ 1, , first row headers, start row 2 var startrow = 2; // data range var responsesvalues = spreadsheet.getsheetbyname(...

python - How to access column via index when using iterrows() -

i want know how can access columns using index rather name when using iterrows traverse dataframes. this code find: for index, row in df.iterrows(): print row['date'] this approach took traverse, seems slow: for in df.index: j in range(len(df.columns)): df.ix[i,j] = 0 you can use ix access index: in [67]: df out[67]: b 0 test1 1 1 test2 4 2 test3 1 3 test4 2 in [68]: df.ix[:,1] out[68]: 0 1 1 4 2 1 3 2 name: b, dtype: int64 updating code first column: for index, row in df.iterrows(): row.ix[0]

Single Catch Block for Multiple Methods in a Class java -

i have class static methods handling memcache requests, has different methods different arguments. whenever method called in class,i want increment totalrequest counter , if exception occur in of methods inside class want increment failed counter. there way ? if being static in nature has problems, let me know ? should efficient. i use aop. if use guice or maven it's quite easy put in place around beans. you'll declare interceptor, guice or maven wrap around methods. there aspectj have never used it. finally, wrap calls in caller method. java 8 , lambda, this: protected <t> t callwithtrace(supplier<t> fn) throws exception { //some code before call try { t output=fn.get(); //code after normal exec return output; } catch(exception e) { //code in case of error (increase counter??) throw e; } } void someothermethod() { object ret = callwithtrace({ () -> calltoyourdangerousmethod()}); object ret = call...

azure - Service Fabric API gateway forwarding requests to microservices example required -

we prototyping architecture in azure service fabric, have number of partitioned stateful services. these services implement rest api. implementing api gateway approach public interface our application. microsoft have provided , example of approach in service fabric wordcount sample code. sample code demonstrates forwarding requests , put request no body. does have sample code demonstrates best approach forward post , put requests (with body data) gateway stateful services? thanks in advance. we implemented http gateway service ourselves well. make sure can have 1 http gateway internal protocol, implemented gateway http based internal services (like asp.net webapis) using asp.net 5 middleware. routes requests e.g /service internal service fabric address fabric:/myapp/myservice using servicepartitionclient , retry logic communicationclientfactorybase . we open-sourced middleware , can find here: https://github.com/c3-ls/servicefabric-httpservicegateway there'...

Build failing with Amazon ProfileCredentialsProvider -

// this.s3client = new amazons3client(new profilecredentialsprovider()); this.s3client = new amazons3client(); if uncomment first line, project build failing saying doesn't recognise package ( com.amazonaws.auth.profile) , encountered error @ profilecredentialsprovider(). but if use second line, ok. why happen?

javascript - global error handling for ngResource -

i searching way handle network related errors ngresource based services in 1 place. from answer know can define custom interceptor actions in single resource. possible modify default actions created angularjs , pass custom interceptor there? you can set interceptors on $http provider, documented here (in section "interceptors").

css - Unwanted text size change on scroll on dropdown menu -

i have dropdown menu on links bigger when page scrolled. unfortunately threatens drop bottom-most ones off foot of page result. the site http://www.jswhite.co.uk/ does know how prevent happening? your javascript code adding class "et-fixed-header" @ header tag , in css using below code. @media screen , (min-width: 981px) .et-fixed-header #top-menu li { font-size: 22px; } so after adding et-fixed-header class changing menu text. change css. .et-fixed-header #top-menu li { font-size: 16px; }

Column vs Table Primary Key constraint in a SQLite table -

i'm medling sqlite databases, , documentation : each table in sqlite may have @ 1 primary key. if keywords primary key added column definition, primary key table consists of single column. or, if primary key clause specified table-constraint, primary key of table consists of list of columns specified part of primary key clause. my question when there's single column used primary key , there fundamental difference between 2 following commands ? create table t (x integer, y text , primary key (x)); create table t (x integer primary key, y text); no, there not difference (apart naming text column once y , once t). said in quote, there can difference. if need 2 or more columns primary key must use first command. personal preference use first version because think easier read.

PHP Web Service Using nusoup give error "error on line 1 at column 2: StartTag: invalid element name" -

i'm learning how create web service using c# , php , c# 1 working php 1 giving me error: error on line 1 @ column 2: starttag: invalid element name when click on wsdl, , php client not returning code this: the server (phpwebservice.php): <!doctype html> <html> <head> <meta charset="utf-8"> <title>php web service</title> </head> <body> <?php require "lib/nusoap.php"; function myfunction($name){ return $name; } $server = new nusoap_server(); $server->configurewsdl("myphpwebservice","urn:phpwebservice"); $server->register("myfunction",array("name"=>"xsd:string"),array("return"=>"xsd:string")); if(isset($http_raw_post_data)){ $http_raw_post_data = $http_raw_post_data; }else{ $http_raw_post_data = "no name!"; } $server->service($http_raw_post_d...

php - How can I call server side file of my plugin (wordpress) with menu? -

i have plugin in wordpress contain 2 php files. in main file , added 2 menus , want call second php file when user click on second menu. have public method name list_table_page on second file. add_menu_page( 'tm-plug', 'test.php', 'manage_options', plugins_url( 'tm_plug/test.php' ), 'list_table_page' ); as it's cited in wp code reference , add_menu_page defined as: add_menu_page ( string $page_title, //required string $menu_title, //required string $capability, /required string $menu_slug, //required callback $function = '', //optional string $icon_url = '', //option int $position = null //option ); and example given is: add_menu_page( __( 'custom menu title', 'textdomain' ), 'custom menu', 'manage_options', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 ); ...

asp.net mvc - Transfer item back to list using jquery drag drop -

following code transferring item left list right list. able no issues. how can transfer added list item left hand side list. <style> .ui-drop-hover { border: 2px solid #bbb; } #dragdiv { width: 180px; height: 200px; float: left; } #dropdiv { width: 280px; height: 150px; float: right; margin-right: 10px; background-color: #f9f887; } #dropdiv li { padding-left: 10px; } #maindiv { width: 580px; height: 300px; border: 2px solid #bbb; } </style> <script type="text/javascript"> $(function () { $("#dragdiv li").draggable( { appendto: "body", helper: "clone", cursor: "move", ...

java - Eclipse Mars: Download repository index updates on startup - fails -

eclipse mars m2e plugin fails download repository index updates on startup. run eclipse behind company firewall proxy setting working "check updates", "eclipse marketplace", eclipse inbuilt browser,.... i hv tried following deleting cache directory "\eclipse\p2\org.eclipse.equinox.p2.repository\cache" , refreshing repositories. preferences -> install update -> available software sites => select entry , click "reload" adding "-djava.net.preferipv4stack=true" -vmargs in eclipse.ini edit: proxy configurations correctly set in $home/.m2/settings.xml edit: seems bug. raised bug request eclipse.org. can view here pleasehelp me resolve this. due issue, eclipse fails search , add dependency maven repositories. here error in .metadata/.log eclipse.buildid=4.5.0.i20150603-2000 java.version=1.8.0_60 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86_64, ws=win32, nl=en_in framework arg...

javascript - Mysql UPDATE using PHP and AJAX, can't update database -

after following several examples website think i'm still can't. i have code: html ... <a href="javascript:void(0);" class="button red big" style="font-size:24px;" onclick="update_it(<?=$_request["yeah"]["id"];?>);">pay</a> ... ajax function update_it(n_id){ $.ajax({ type: 'post', url: 'update_yes.php', data: {idd: n_id}, success: function(output) { alert('updated, server says '+n_id); }, error: function() { alert('wrong!'); } }); } php <?php $link = mysqli_connect("localhost", "root", "****", "****"); $sql = "delete stuff id = " .$_post["idd"]; mysqli_query($link,$sql) or die(mysql_error()); ?> and works php (i think). because can see how html works , how ajax function return ...

Collecting row stats from distributed matrix in Spark (Java) -

i trying multiply 2 large matrices , find indexes of biggest 20 or elements each row of resulting large (50000x50000) matrix. hope use spark java this. found can multiply distributed matrices if store them blockmatrices. otherwise there not seem more complex operations available distributed matrices , stuck. best way such operation? simple code have far looks this: javasparkcontext sc = new javasparkcontext(conf); blockmatrix = getblockmatrixa(sc); blockmatrix b = getblockmatrixb(sc); blockmatrix ab = a.multiply(b); something should thing, though have not tested yet: rdd<indexedrow> byrow = ab.toindexedrowmatrix().rows(); javardd<indexedrow> dummyrdd = sc.parallelize(new arraylist<indexedrow>()); javardd<indexedrow> javabyrow = dummyrdd.wraprdd(byrow); javapairrdd<long, list<long>> top20byrow = javabyrow.maptopair( new pairfunction<indexedrow, long, list<long>>() { public tuple2<long, list<long>> call(inde...

wordpress - WP_Query not Working if Taxonomy Term has Single Quotes -

i'm using wp_query retrieve posts based on taxonomy terms . problem wp_query not returning results if term has single quote. here's relevant portion of args passed wp_query: [tax_query] => array ( [0] => array ( [taxonomy] => country [field] => name [terms] => array ( [0] => people's republic of china ) ) ) i tried escaping quote (e.g. people\'s republic of china) still there no results. there no problem code other terms without quote work. , if ask, there posts single quotes validated directly querying database (via phpmyadmin). i know can query using taxonomy id , slug (e.g. 'field'=>'term_id' , 'field'=>'slug' ) hope not may code has been written use term name. thanks

sql server - Get last 5 week range -

i need load info last 5 weeks in 5 seperate lists, no matter date. week, i'll need last 5 weeks before one. next week i'll need last 5 weeks before one, includes one. if makes sense , doesn't confuse you? so basically: ..between '2015-09-21' , '2015-09-27' has replaced with: select dateadd(wk,datediff(wk,7,getdate()),0) , dateadd(wk,datediff(wk,7,getdate()),6) this works fine, same second week: select dateadd(wk,datediff(wk,14,getdate()),0) , dateadd(wk,datediff(wk,14,getdate()),6) but on, doesn't work anymore. different results when add date manually. select dateadd(wk,datediff(wk,21,getdate()),0) , dateadd(wk,datediff(wk,21,getdate()),6) am doing wrong in code? if use between datetime data type should add 7 days beginning of week find end of week dateadd(wk,datediff(wk,21,getdate()),7)

Set i-th of array pointer as variable in c -

i wondering there way set i-th or string in pointer array local variable? for example char = "string"; char b = "string2"; char *args[3]; args[0] = a; args[1] = b; args[2] = null; therefore, agrs = {"string","string2",null}; thanks! yes , can not have right . a , b has declared correctly- char *a = "string"; //string literal (constant) char *b = "string2"; // or write char b[] = "string2"; char *args[3]; args[0] = a; args[1] = b; args[2] = null;

Parsing shapefiles in java without Maven -

i've been looking parsing shapefiles build database, , answer appears everywhere geotools. while understand indeed cut out such tasks, feels overkill project (i don't want complicated i'm still beginner , ending project being 1/10000th of code reading shapefiles). i've tried shapefilereader, reads shp file, wich bit useless if can't link data associated names in dbf file. (also crashes if type isn't same lines...) then i've tried geosense, seems it's been made specific case (byte byt byte reading of files...? maybe missed here can't seem what.) so here am. asking guys if there's better, simpler, more efficient way.

windows - InnoSetup is not restarting the closed applications -

i working on installer using innosetup 5.5.6. application clr windows forms application compiled vs2013. installer , application works succesfully. however, wanted check behaviour of installer when app running. mentioned in innosetup documentation installer warns user running application , says close , attempt restart it. closes application succesfully , completes installation application not restarted! i tried /restartapplications argument has no effect! any suggestions or hints can follow? here log: 2015-09-30 16:12:22.711 log opened. (time zone: utc+03:00) 2015-09-30 16:12:22.711 setup version: inno setup version 5.5.6 (a) 2015-09-30 16:12:22.711 original setup exe: d:\software development\projects\tools\online updater\setup\setup_onlineupdater.exe 2015-09-30 16:12:22.711 setup command line: /sl5="$3d0374,14051236,422400,d:\software development\projects\tools\online updater\setup\setup_onlineupdater.exe" /restartapplications /log="c:\log.txt" ...