Posts

Showing posts from January, 2014

lotus domino - Querying the users directory via the Java API -

i trying access/querying domino directory using domino java api , have question regarding same - here setup - i creating application uses java domino api interface domino server my java application resides on own server , uses java api (via diiop) talk domino server the domino server version in environment 9.0 there multiple domino servers in environment , user mailboxes distributed across these domino servers my application receives email address , message id external source input. based on input application needs delete message user's mailbox. what stuck @ - want query domino directory server identify mail server name , mail file name user (using email address) application can open user's mail file , delete corresponding message user's mailbox file. as researching found class/method directory.lookupnames() method can used query directory users. will method allow searching users based on email address or search based on user's name? i tried test...

Copy network file from a Linux host to my Linux server using PHP -

i trying retrieve network file opensuse 13.1 host opensuse 13.2 webserver, don't seem have success. first check if target directory directory: $path = "\\\\192.168.xxx.xxx\\public"; if(is_dir($path)){ // returns false every time. return true; } in case function is_dir() returns false, although folder exists , has 777 permisions, ip correct, , computer turned on. have tried combinations of formatting network path, including $path = "smb://192.168.xxx.xxx/public"; witch returns error unable find wrapper "smb" - did forget enable when configured php? could tell me missing? would work same through openvpn centos 6 webserver , ubuntu 14 host? php has no built-in samba support on linux platform. need mount remote share (requires superuser-equivalent access) , access contents local filesystem.

excel - SUMIFS OR criterion -

i'm working rainfall precipitation data , want find total rainfall months of april, may, june, july each year. columns follows: a: rainfall each day b: month c: year d: day e: number indicating reliability of rainfall observation (0,1,2 or 9) i want exclude unreliable observations. find total rainfall 4 months in 1923, example, following correct? sumifs(a1:a100,b1:b100,{"4","5","6","7"},c1:c100,"1923",e1:e100,"<>9") your current formula returns array. example, if highlight formula , press f9 key, see formula returning 4 different values. correct result, going need wrap formula sum function. =sum(sumifs(a1:a100,b1:b100,{"4","5","6","7"},c1:c100,"1923",e1:e100,"<>9"))

eclipse - websphere 8.5.5.6 server having java 6 and 7 but i need java 8 how to add java sdk to existing websphere server -

i installed 8.5.5.6 in system. when trying add in eclipse showing jre run-time environment web sphere application server java 1.6, 64 bit , web sphere application server java 1.7, 64 bit but need work on java 1.8 installed server jre not there default java 1.7 there question how add or upgrade java 1.8 in web sphere when tried run server showing below error: websphere application server error websphere application server error the xxxxxx project built java sdk 8, not compatible server running @ java sdk 7. try publishing application on later version of websphere application server. or try increasing jre of server, if using websphere application server v8.5. xxxx project built java sdk 1.8, not compatible server running @ java sdk 7. try publishing application on later version of websphere application server. or try increasing jre of server, if using websphere application server v8.5. xxxxxx project built java sdk 1.8, not compatible server run...

java - Drawing vector images on PDF with PDFBox -

i draw vector image on pdf apache pdfbox. this code use draw regular images pdpage page = (pdpage) document.getdocumentcatalog().getallpages().get(1); pdpagecontentstream contentstream = new pdpagecontentstream(document, page, true, true); bufferedimage _previmage = imageio.read(new fileinputstream("path/to/image.png")); pdpixelmap previmage = new pdpixelmap(document, _previmage); contentstream.drawxobject(previmage, prevx, prevy, imagewidth, imageheight); if use svg or wmf image instead of png, resulting pdf document comes corrupted. the main reason want image vector image png or jpg image looks horrible, think gets somehow compressed looks bad. vector images shouldn't happen (well, when export svg paths pdf in inkscape doesn't happen, vector paths preserved). is there way draw svg or wmf (or other vector) pdf using apache pdfbox? i'm using pdfbox 1.8, if matters. i this, not directly. in first transform svg documents in pdf documents ...

php - shopping cart issues while adding color option -

please check demo . here 1 product different color not added cart updated same product different color not right way. here code add product . if(isset($_post["product_code"]) && isset($_post["product_color"])) { foreach($_post $key => $value){ $new_product[$key] = filter_var($value, filter_sanitize_string); //create new product array } //we need product name , price database. $statement = $mysqli_conn->prepare("select product_name, product_price products_list product_code=? limit 1"); $statement->bind_param('s', $new_product['product_code']); $statement->execute(); $statement->bind_result($product_name, $product_price); while($statement->fetch()){ $new_product["product_name"] = $product_name; //fetch product name database $new_product["product_price"] = $product_price; //fetch product price database $new_product[...

ios - Transitioning from a TableView to Webview in Xcode 6.4 using Objective-C -

im new coding in xcode , im struggling transition between above mentioned scenes. can create , use each scene separately since cells in tableview aren't created till build initiated, dont know how connect separate rows webview. grateful you'll need more web view; you'll need uiviewcontroller subclass (a scene) contains web view. now have 2 scenes: uitableviewcontroller, , view controller containing web view. control-drag prototype cell in first scene second scene. means: when cell tapped, trigger segue.

jsf - View scope: java.io.NotSerializableException: javax.faces.component.html.HtmlInputText -

there error each time button calls action backing-bean. applies beans view scope , haven't found way fix without regression on other modules in code. defaultfacele e exiting serializeview - not serialize state: javax.faces.component.html.htmlinputtext java.io.notserializableexception: javax.faces.component.html.htmlinputtext @ java.io.objectoutputstream.writeobject0(objectoutputstream.java:1184) or also: com.ibm.ws.webcontainer.servlet.servletwrapper service srve0014e: uncaught service() exception root cause faces servlet: servletexception: /jspfiles/jsf/deployments/editqueue.faces no saved view state found view identifier /jspfiles/jsf/deployments/editqueue.faces @ javax.faces.webapp.facesservlet.service(facesservlet.java:205) caused by: javax.faces.application.viewexpiredexception: /jspfiles/jsf/deployments/editqueue.faces no saved view state found view identifier: /jspfiles/jsf/deployments/editqueue.faces @ org.apache.myfaces.lifecycle.restoreviewex...

Receive Gmail push notification only when a new message arrives -

i trying make app find out if recipient replied email using gmail's push notification. working well, problem is, receiving notification changes on gmail. here code used request = { 'labelids': ['unread'], 'topicname': topic, 'labelfilteraction': 'include' } service.users().watch(userid=user.google_id, body=request).execute() then tried using 'labelfilteraction': 'exclude' system_labels = ['category_updates', 'unread', 'draft', 'category_promotions', 'inbox', 'category_social', 'category_personal', 'category_forums', 'trash', 'chat', 'important', 'sent', 'starred', 'spam'] system_labels.remove('unread') request = { 'labelids': system_labels, 'topicname': topic, 'labelfilteraction': 'exclude' } service.users().wa...

javascript - How do I make the thumbnails appear below the "Add File" button? -

Image
i have code show thumbnail preview of file user chooses upload. however, want more this: i trying accomplish few things thumbnail part: to show thumbnail previews below "add file" button to show image smaller image image, file preset image of file, , video thumbnail video play symbol on (see link above examples) to set maximum of 5 possible files uploaded. <script type="text/javascript"> $(function() { $("#uploadfile").on("change", function() { var files = !!this.files ? this.files : []; if (!files.length || !window.filereader) return; // no file selected, or no filereader support if (/^image/.test( files[0].type)){ // image file var reader = new filereader(); // instance of filereader reader.readasdataurl(files[0]); // read local file reader.onloadend = function(){ // set image data background of div $("#imagepreview").css(...

facebook - Why am I getting KeyError in the following python code? -

i wanna execute code. this error i'm getting in terminal after running code traceback (most recent call last): file "/private/var/folders/6j/n37bd5r92sj8wfkn3k_k9k580000gp/t/cleanup @ startup/bday-459934533.707.py", line 68, in <module> print 'total='+str(process_posts(url)) file "/private/var/folders/6j/n37bd5r92sj8wfkn3k_k9k580000gp/t/cleanup @ startup/bday-459934533.707.py", line 32, in process_posts posts=res_obj["data"] keyerror: 'data' the code - import httplib, urllib bs4 import beautifulsoup import os import json import time import calendar access_token='value' dob='2015-07-30' conn = httplib.httpsconnection("graph.facebook.com") print 'requesting...' #conn.request("get",path,urllib.urlencode(data),{}) has_more=false def convert_to_local(s): t=time.strptime(s[:19],"%y-%m-%dt%h:%m:%s") t=time.localtime(calendar.timegm(t)) t=time.strf...

angular - How to create a new Observable which is subscribed to Observable returned by http.post method in angular2 -

i creating service angular2. have used http.post method return eventemmiter , per documentation have passed next , return lambdas. https://angular.io/docs/js/latest/api/http/http-class.html next lambda working expected return lambda not @ called. when try return this.user. null since post operation not yet complete. should wait before auth response back. and if choose reactive programming , want return rx.observable return of method. how can create rx.observable subscribe http post observable complete event. @injectable() export class loginservice { http:http; headers:headers; user:user; constructor(http: http) { this.http=http; this.headers=new headers(); this.headers.set('content-type','application/json'); this.user = new user(); } authenticateuser(credential:credential) { credential.type = 'normal'; this.http.post('http://localhost:8000/api/v1/auth', json.stringify(credential), { h...

php - Why TTFB on IE is slower than Chrome / Firefox like 10 times? -

Image
i have crazy couple day, same domain, same page, load on chrome / firefox max 4 seconds. ie, ttfb 12 seconds: http://www.webpagetest.org/result/150718_7g_10s/ http://www.webpagetest.org/result/150718_z5_148/ url is: http://appraisals.wintrustmortgage.com/tandem/login/ ? anyone can give me recommend ? what ttfb ( time first byte ) includes time server spends processing request after received time server spends sending first byte of response client what ttfb not include time spent negotiating domain name resolution (i.e. dns ) time client takes connect server time spent negotiating ssl connection time spent between end points sending packets (i.e. network latency ) time server spends receiving request time spent consuming response client (i.e. client read time ) time client spends parsing/rendering/executing response or making/waiting-on subsequent requests to/from server differences between chrome/firefox , ie ie not measure ttfb. measures ttlb ...

Python random colors flickering on object -

the following function defines rectangles, x/y location, width , height, , color. color randomly chosen every time . def things(thingx, thingy, thingw, thingh, color): rand_color = (random.randrange(0,255),random.randrange(0,255),random.randrange(0,255)) pygame.draw.rect(gamedisplay, rand_color, [thingx, thingy, thingw, thingh]) the current code causing program flicker through every different color. if change rand_color variation of choosing between black , white, rectangle flickers between black , white. what's happening here? as said in comment, function generates different color each time it's called , flickering problem result of calling often. fix making rand_color global , define value outside function before it's ever called. however think idea in john rodger's answer of using class one, implement differently , try take advantage of object-oriented programming instead of reinventing whole wheel. below runnable example of mean. every t...

CAKEPHP3 REST API point to a different controller? -

i believe missing here. trying point route custom controller: router::scope('/myapi/', function ($routes) { $routes->extensions(['json', 'xml']); $routes->resources('some_value', [ 'controller'=>'somevalue', 'only' => ['index', 'create', 'update', 'delete'], 'id'=>'[0-9]+' ]); }); therefore url wanting ~mydomain~/myapi/some_value . i want point somevaluecontroller instead of looking some_valuecontroller. controller definition ignored in case , instead cakephp3 looks some_valuecontroller instead rather avoid try , keep cakephp's naming conventions (and make use of cake bake console create lot of controllers models me) specify custom url. what have missed here? thanks, nevermind, if titlecase name works: $routes->resources( 'somevalue', [ ...

GIT error while push: error: RPC failed; result=7, HTTP code = 401 -

while trying push commits remote server, response (after waiting 5 minutes): git.exe push --progress "origin" events_devel:events_devel counting objects: 195, done. delta compression using 2 threads. compressing objects: 100% (41/41), done. writing objects: 100% (47/47), 475.15 kib | 0 bytes/s, done. total 47 (delta 32), reused 0 (delta 0) fatal: remote end hung unexpectedly fatal: remote end hung unexpectedly error: rpc failed; result=7, http code = 401 up-to-date i try this: https://stackoverflow.com/a/6849424 , same result. remote server not github... corporate server. pulling works should. there problem stable git windows (1.9.5) updating using http , windows or basic auth. try upgrade 2.4.6-release candidate version. can find here source

php - How to refresh a database query using jQuery -

i'm working on real basic chat php powered. i'd use jquery check new messages , update #cbox div every few seconds. far have tried accomplishing using code below. frame of reference, first time including jquery of scripts, problem simple error overlooking in newbishness. the problem i'm running #cbox div displays blank, doesn't seem calling chat_post.php @ all. post code well, in case problem , not jquery. fix, tried including <div id='cbox'> in chat_post.php , yielded no results. @ point, i'm pretty grasping @ straws. <div id='sb_content'> <center><div id='chat'> <div id='ribbon' style='position: relative; margin-top:-50px; margin-left:-32px;'><center><span class='ribbon'>chat box</span></center></div> <div style='margin-top: -20px;'><center><span style='text-shadow: 0 0 0.2em #000;' class='a...

php - Symfony voter: how do I check a user's role? -

i have posts owned specific user. i've created voter check if user owns post, want admins (ie, role_admin , above) able access posts. i've followed instructions (and copied code) on how use voters check user permissions cookbook entry. i'm wondering how check. ideas: pass service voter...not sure one. do vote method. don't check in voter, inside controller (ie, don't call voter check if they're admin). using $token , passed in vote method, can retrieve $user . check role $user->getroles() method. <?php $user = $token->getuser(); $user->getroles();

Simple End-of-input Error - Rails Form -

i'm getting syntax error, unexpected keyword_ensure, expecting end-of-input error. checked other posts had same problem have no if or conditional statement needs closing. simple form_tag believe closed field tags sporadically spread throughout code. great appreciated! thank you! <%= render 'partials/header' %> <%= render :partial => "partials/feature", locals: {type: @full_feature} %> <div id="fineart-full-page"> <div id="search-panel"> <% form_tag('/fineart', method: :get) %> <div id="top-round"> </div> <div id="main-row"> <div id="column-1"> <div id="row-1"> power search </div> <div id="row-2"> <%= text_field_tag 'q' %> ...

plsql - Sql Return Statment Getting encountered symbol error -

this store procedure returning error cant see find problem: error(20,1): pls-00103: encountered symbol "end" when expecting 1 of following: . ( * @ % & = - + ; < / > @ in mod remainder not rem <> or != or ~= >= <= <> , or like2 like4 likec between || multiset member submultiset create or replace procedure sp_currancyofproject(v_assyid number) temp number := 0; begin select scope_id temp tbl_revisions assy_u_id = v_assyid; select project_id temp tbl_scope scope_u_id = temp; select currancy_multipier temp tbl_currancy project_id = temp; return temp; end; you cannot return value procedure. you should use function return value. create or replace function fn_currancyofproject(v_assyid number) return number temp number := 0; begin -- code logic substituting temp variable. return temp; end;

mysql - PHP Mysqli trigger a query one after other -

i trying fetch first id 1 table , later after ids fetched trying fetch number of id's. my problem as want select value of first query completion result i unable trigger second query after first query completed both triggerid @ time first query $query ="select * abc xyz='xyz' , standard='xyz' "; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $id = array(); while($row=mysqli_fetch_array($data)){ $id[] = $row['id']; } $idall = "'" . implode("','", $id) . "'"; second query $query="select mobno euser userid in ($idall)" ; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $mobiles = array(); while($row=mysqli_fetch_array($data)){ $mobiles[] = $row['mobilenum']; } $mobil...

c++ - How to iterate an array in Python pointer-likely and efficiently? -

i quite new in python, iterate array calculate next element based on previous elements. can think of in c++ manner how achieve in python using numpy or pandas? know similar method using shifting way seems not efficient. the following simple fibonacci example: int arr[10]; arr[0] = 1; arr[1] = 1; int* pt = &arr[2]; <--get iterator moving pointer int count = 8; while (count > 0) { *pt = pt[-1] + pt[-2]; <--access previous k element based on current index count--; pt++; <--point next element } (int = 0; < 10; i++) cout << arr[i] << endl; list: l = [1, 1] while len(l) != 10: l.append(l[-1] + l[-2]) <--but have append element every time print l the direct numpy immitation of c++ is arr=np.ones((10,)) in range(2,arr.shape[0]): arr[i]=arr[i-1]+arr[i-2] producing: array([ 1., 1., 2., 3., 5., 8., 13., 21., 34., 55.]) this isn't efficient way of doing in numpy , i...

eclipse - How to resolve LinkageError with JasperReports (6.*)? -

Image
e.g. got: net.sf.jasperreports.engine.jrexception: ... caused by: net.sf.jasperreports.engine.fill.jrexpressionevalexception: error evaluating expression source text: $p{report_scriptlet}.settestraw_logon_tstmsgon(true, true) caused by: java.lang.linkageerror: loader constraint violation: loader (instance of java/net/factoryurlclassloader) initiated loading different type name "org/slf4j/logger" running in eclipse (kepler) preview jr plugin v6.1.0 , not eclipse running 5.5.1.final obviously using build-path-referenced custom report scriptlet using slf4j api logging. it seems conflicting different version of same class (for same underlying class loading isolation). i got same problem , solved adding jars in build path in project: slf4j-api-1.7.12.jar slf4j-log4j12-1.7.12.jar slf4j-simple-1.7.12.jar and add jasperreports library , jasperreports library dependencies project with these steps right click in project build cath >...

How do I escape values in Splunk? -

splunk best practices use key/value pairs. says wrap values in quotes if contain spaces. so, let's have raw value of fred smith : my_key=name my_value="fred smith" that's fine, i've added quotes. if have raw value of " fred smith" (note quotes present , presence of space @ start) - yield: my_key=name my_value="" fred smith"" this treated as: my_key=name my_value="" my_key=fred my_value=smith"" what best practices escaping quotes in splunk values? if control data format, appears do, options include: add single quotes around everything. use double-quotes, escape inner ones backslashes use json represent data instead of flat string of kv pairs. json syntax handles quoting case (without adding quote marks), plus can add nested structure if want. you can control search-time field extraction behavior setting kv_mode . may find auto_escaped trick. see setting kv_mode search-time data...

c++ - What can we return as an "NaN" when writing template algorithm for "most frequent value"? -

i write simple template function range-based , container-based search of "most frequent value", ' generic ' i'm wondering should return if container or range empty. in 1st draft below used numeric_limits return quiet_nan or signaling_nan , if std::iterator_traits::value_type string ... default ctor idea or pratice ? struct comp_by_second { template <typename pair> bool operator()(const pair& a, const pair& b) { return a.second < b.second; } }; template <typename fwd> typename std::iterator_traits<fwd>::value_type most_frequent_element(fwd begin, fwd end) { std::map<typename std::iterator_traits<fwd>::value_type, int> count; (fwd = begin; != end; ++it) ++count[*it]; if(count.size() == 0) { if(std::numeric_limits<typename std::iterator_traits<fwd>::value_type >::has_quiet_nan) return std::numeric_limits<typename std::iterator_traits<fwd>::value_type>::quiet_nan(); els...

c++ - Boolean function problems -

having trouble boolean function. when compile program runs fine, yet when type in "no" still says "what can with?". #include <iostream> #include <string> //size() #include <cctype> //isdigit() using namespace std; //(xxx)xxx-xxxx bool verification(string yesorno) { if(yesorno == "yes")return(true); else return(false); } int main() { string yesorno; cout <<"do need more help\n"; cin >> yesorno; if(!verification(yesorno))cout <<"what can with?\n"; return(0); } your logic backwards - verification returns false isn't "yes" . since "no" isn't "yes" , verification("no") returns false , , in main function print out message if !verification("no") , evaluates true . seems should drop ! operator if statement.

knockout.js - Cannot map function in view model with json data knockout mapping -

my viewmodel this: var viewmodel = function(){ var self = this; self.title = ko.observable('hello world'); self.rows = ko.observablearray(); self.on_click = function(){ alert('hello world'); var data = [ { id : 1, x : 1, y : 2, z : 3, }, { id : 2, x : 4, y : 5, z : 6, }, { id : 3, x : 7, y : 8, z : 9, } ]; self.rows(ko.unwrap(ko.mapping.fromjs(data, viewmodelrow))); alert(self.rows()); }; }; var viewmodelrow = function(){ var self = this; self.id = ko.observable(); self.x = ko.observable(); self.y = ko.observable(); self.z = ko.observable(); self.mthd = function(){ alert('just clicked'); }; }; vm = new viewmodel(); ko.applybindings(vm); my html this: <body> <h1 data-bind="text:title">...

c++ - Getting link error when using kernel object -

i'm developing on ubuntu 14.04. i'm trying use kernel object got (.ko developed other department in company). ko loaded (i can see via lsmod). i'm building c++ program use api of ko. added include path of ko headers. i'm getting link error (undefined reference) ko functions. what need add compilation, in order use ko?

C# SQL output code issue -

i having issue code below, keep getting "procedure or function 'insertfile' expects parameter '@id', not supplied" i must doing wrong in returning of id. alter procedure [dbo].[insertfile] -- add parameters stored procedure here --@assetid int, @computername varchar(max), @filepath varchar(max), @owner varchar(100), @size int, @extension varchar(50), @creationdate datetime, @modifieddate datetime, @accesseddate datetime, @id int output begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; if not exists (select * dc_files computername = @computername , filepath = @filepath) begin insert dc_files (computername, filepath, owner, size, extension, creationdate, modifieddate, accesseddate) values (@computername, @filepath, @owner, @size, @extension, @creationdate, @modifieddate, @accesseddate) end else begin update dc_files set owner = @owne...

ruby - Not able to start the rails server -

i new ruby, trying setup ruby jruby , ruby on rails. i installed bundler , using "rails server -e qa" command in command prompt. getting: pageant.rb:1:in `require': cannot load such file -- dl/import (loaderror). ruby22-x64/lib/ruby/gems/2.2.0/gems/activesupport-3.2.21/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - ruby22-x64/lib/ruby/gems/2.2.0/gems/mongoid-3.1.6/lib/mongoid/persistence/atomic/operation.rb:74: warning: circular argument reference - field ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `require': cannot load such file -- dl/import (loader c:/ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:1:in `<top (required)>' c:/ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:5:in `require' c:/ruby22-x64/lib/ruby/gems/2.2.0/gems/net-ssh-2.9.2/lib/net/ssh/a...

Parsing json in iOS NULL -

trying parse json http://sec.kimonolabs.com/companies jsonmodel framework problem values logged come out null. i trying output name , cik of companies sec api on table view there no output because values null. the .m files below code default no custom code. any appreciated! loanmodel.h #import "jsonmodel.h" //#import "locationmodel.h" @protocol loanmodel @end @interface loanmodel : jsonmodel @property (strong, nonatomic) nsstring* cik; @property (strong, nonatomic) nsstring* display_name; @property (strong, nonatomic) nsstring* name; //@property (strong, nonatomic) locationmodel* location; @end kivafeed.h #import "jsonmodel.h" #import "loanmodel.h" @interface kivafeed : jsonmodel @property (strong, nonatomic) nsarray<loanmodel>* company; @end masterviewcontroller.h #import "masterviewcontroller.h" #import "jsonmodellib.h" #import "kivafeed.h" @interface masterviewcontroller () { ...

ios - iPhone 6 viewcontroller unnecessary resetting -

i fixing quite old application written objc & storyboard. code & storyboard not have sign of auto-layout or size classes & images.xcassets empty well, have splash 2x & retina 4 , app icons, all images put folder 1x , 2x sizes. but amazingly screens resized automatically both iphone 6 , 6 plus. issue current code when screen loads, reset left right in bottom i.e. more toward bottom-right-corner of screen. i wondering these 2 things first: why , how can work without assets iphone 6 & 6 plus (except default / splash) second: why each screen resetting toward right corner in bottom, after load?

javascript - How to show a row number column in slickgrid? -

i displaying data in slickgrid using ajax call looks similar this. india 564 usa 45454 japan 5454 there no column called 'number' have row number values,in data table fetching. how can set column called 'number' , set values? want similar this. 1 india 564 2 usa 45454 3 japan 5454 to display row number, don't need specific field/property it. can define column , specify formatter column option return value based on underlying indexing of grid function receives it's first argument. since grid 0 index based, adjust accordingly. var grid; var dataview = new slick.data.dataview(); var data = [{country: "usa", number: "123"}, {country: "japan", number: "456"}, {country: "india", number: "789"}]; var options = { editable: false, enablecellnavigation: true }; var columns = [{name: "row no", formatter: function(row){return row+1}}, ...

javascript - Internet Explorer 11 : Object doesn't support property or method 'isInteger' -

i have error in internet explorer console ' object doesn't support property or method 'isinteger' ' how can resolve ? code: function verificanota(nota){ if (nota.length>0){ var arr = []; if( nota.indexof(".") != -1 ){ return ferificarearraynote(nota.split('.')); }else if( nota.indexof(",") != -1 ){ ferificarearraynote(nota.split(',')); }else if( nota.length<=2 && number.isinteger(number(nota)) && number(nota)<=10 && number(nota) > 0){ return true; }else { return false; } } return true; } and yes, pass number not char; as stated @andreas, number.isnumber part of es6 not supported ie11 you can add following polyfill javasript number.isinteger = number.isinteger || function(value) { return typeof value === "number" && ...

ios - Prepare for segue is autocalled -

Image
i have view crontroller called "subcateory2", viewcontroller has uicollectionview wit custom cell. need 2 segues app. 1 of called "to_videostable" viewcontroller other view controller , other calles "reload_collection" cell same viewcontroller(because subcategory can have n-level of subcategories). problem prepareforsegue(i check in function identifier , defined in " func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath)",and execute different actions). when select cell should happen: first: go "func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath)", check condition , define identifier segue. second: go prepareforsegue, check condition , execute actions. but happen: first: in ios simulator select cell. second: code go prepareforsegue , go segue called "reload_collection"(before going func collectionview(...)), , c...

angularjs - Angular, get a template and populate it in a service -

i've got printing service, has function gets passed template url , data template. i need somehow populate template data provided , open in new window. here's pseudo code idea: printwindow.printmodal = function(data, template) { get(template).success(function(data) { populatedtemplate = populate(template) var mywindow = window.open('', '_blank'); mywindow.document.write('<html><head>'); mywindow.document.write('</head><body>'); mywindow.document.write(populatedtemplate); mywindow.document.write('</body></html>'); }); return true; }; how achieve this? figured out: $http.get(template).success(function(data) { var templateelement = angular.element('<div></div>'); templateelement.append(data); var clonedelement = $compile(templateelement)($scope.data); $timeout(function() { var printwindow = window.open('', ...

c - binary search pointers dynamic memory allocation recursion -

i'm doing implementation of binary search pointers , dynamic memory allocation. first sort list of elements , perform search. sorting part works search isn't working properly. know algorithm correct have no idea how go syntax.could me out?? ps first question on stack overflow, btw. :) #include <stdio.h> #include <stdlib.h> int binary_search(int x,int start,int end, int *array) { int q; q=(start+end)/2; if(x==*(array+q)) { return q; } else if (x>*(array+q)) { binary_search(x,q+1,end,array); } else if (x<*(array+q)) { binary_search(x,start,q-1,array); } else if(start>=end) return -1; } int main() { int n,*a,tmp,i,j,search,pos; printf("enter n"); scanf("%d",&n); a=malloc(sizeof(int)*n); for(i=0;i<n;i++) { scanf("%d",&tmp); *(a+i)=tmp; } for(i=0;i<n-1;i++) { for(j=0;j<n-1;j++) { if(*(a...

java - POI: not iterating through all excel row while inserting values to database -

i have written code reads data excel sheet inserts data database. can read data when comes posting values database 1 row being posted. here code wrote please help. private void addbtnactionperformed(java.awt.event.actionevent evt) { try { fileinputstream file = new fileinputstream(new file("new.xls")); org.apache.poi.ss.usermodel.workbook workbook = workbookfactory.create(file); org.apache.poi.ss.usermodel.sheet sheet = workbook.getsheetat(0); iterator<row> rowiterator = sheet.iterator(); rowiterator.next(); while(rowiterator.hasnext()) { row row = rowiterator.next(); //for each row, iterate through each columns iterator<cell> celliterator = row.celliterator(); while(celliterator.hasnext()) { cell cell = celliterator.next(); //this change cell types string cell.setcelltype(cell.cell_type_string); ...

Difference in variable declarations - objective c -

my question conceptual - difference between following 2 snippets of code? 1) @implementation person { nsstring *name; // other variables } - (void) somemethod @end 2) @implementation person nsstring *name; //other variables - (void) somemethod @end the reason ask able compile code followed format #2 not format #1, , curious difference between two. the first declares instance variable. name belongs person object. the second declare global variable.

django - how to login a user using forms? -

forms.py: from django import forms django.contrib.auth import authenticate, get_user_model django.contrib.auth.models import user django.forms import modelform django.utils.text import capfirst .models import classname, sectionname, teachername, attendancename class authenticationform(forms.form): username = forms.charfield(max_length=20) password = forms.charfield(widget=forms.passwordinput) error_messages = { 'invalid_login': ("please enter correct %(username)s , password." "note both fields may case-sensitive."), 'inactive': ("this account inactive"), } def clean(self): username = self.cleaned_data.get('username') password = self.cleaned_data.get('password') if username , password: self.user_cache = authenticate(username=username, password=password) if self.user_cache none: raise forms.va...