Posts

Showing posts from 2011

c - Memory allocation of variable -

suppose don't have os , write c , compile program run on computer without os. program has line int = 0; question variable stored , how program determine store variable? it depends on , how declared it. if it's global variable, or static variable declared inside function, linker decides put (typically in .data or .bss section, initialized or uninitialized data, respectively). executable loader (or, if don't have os under it, bootloader) decide in ram goes. if it's local variable, compiler put on call stack or in register.

Javascript join(), i want to join some of them in array -

in case example, have array : var myarr = ["red", "green", "blue", "yellow"]; question: how join "myarr", except "red" or 1 of them, or want join of them (example). example, becomes below: greenblueyellow advice.. you can use array.prototype.filter() var filterval = 'green'; var joinedstring = myarr.filter(function(item){ return item !== filterval; }).join(); alert(joinedstring); demo

filenotfoundexception - External properties files in Webshpere Application server -

i placed properties file in profile_root/properties folder of server. when application searches file filenotfound exception. on other hand, able search existing properties file. should changed in server once property file has been added. properties properties = new properties(); properties.load(new fileinputstream(new file("c:\\websphere\\appserver\\profiles\\appsrv01\\properties\\example.properties"))); system.out.println(properties.getproperty("en"));

github - Configure Local Git Repo that Updates Two Different Remote Repositories -

i have local repository contains public directories , private directories. push entire local repository internal server. i want push directories public-ally accessible git server. how set correctly? the best practice to: split repo in 2 separate repos see atlassian tutorial see github tutorial push public 1 public git server. trying keep in 1 repo dangerous , end mistakenly push don't want.

Xpages: error trapping in LotusScript Agent called from SSJS -

i calling lotusscript agent postsave event of xpage (taken ibm wiki template). add error trapping if happens (i had cases of "attachments missing... run compact fix this" error), application @ least warn user went wrong. do need put error trapping code in agent? belong in postsave event of xpages? the agent called way: <xp:this.data> <xp:dominodocument var="pagedocument" formname="fpage" action="opendocument" ignorerequestparams="false" computewithform="onsave"> <xp:this.postsavedocument><![cdata[#{javascript:var agent = database.getagent("xpsavepage"); agent.runonserver(pagedocument.getdocument().getnoteid());}]]> </xp:this.postsavedocument> </xp:dominodocument> <xp:this.data> the agent working great, on documents, have missing attachments error, due conversion errors , other cases (persitence related, probably). have no...

javascript - Does JQuery have a "move" function? Or is there a more compact way of doing this? -

when using jquery in conjunction content management system, find myself writing snippets of code such $(document).ready(function() { var thishtml = $('#some-element')[0].outerhtml; $('#some-element').remove(); $('#hmpg-btm-box-holder').prepend(thishtml); }); does jquery have functionality accomplish in more compact fashion? this should suffice: $(document).ready(function() { $('#hmpg-btm-box-holder').prepend($('#some-element')); }); i'd avoid using outerhtml whenever possible (and preferably innerhtml also, unless e.g. receive html trusted server via ajax , want include in document). converting element element string (html) representation , element can cause unwanted effects removing event handlers attached it.

javascript - Change order of data with jQuery two-way data binding -

i'm trying use 2 way data binding have score changes on fixtures move league position of team depending on result. i've given try not sure why it's not working. have no idea i'm doing. i've used tinysort try , order them when points attribute changes don't know how dynamically add points attribute , change order of league changing fixture result. can help? getremainingfixtures = function(){ $.ajax({ type: 'get', url: '/fixtures/later_fixtures', datatype: 'json' }).done(function(data){ data = _.groupby(data,'matchday'); $.each(data, function(index, day){ var matchdatediv = $('<div id="days">').css({ 'margin-left': '20px', 'max-width': '80%', 'display': 'block', 'text-overflow': 'ellipsis', 'white-space': 'nowrap', 'float': 'left...

Fiddler Proxy Not Working with Android Lollipop Emulator -

i'm attempting view network traffic lollipop emulator. i've followed directions here , able navigate computer's ip fiddler port , install root certificate (i.e. :8888/fiddlerroot.cer) i'm not seeing traffic in fiddler browser app. i installed kitkat emulator , followed same instructions success. why doesn't lollipop emulator work? what's changed in android 5.0.1? enable air-plane mode , disable! worked me!

python 2.7 - Why this dynamodb query failed with 'Requested resource not found'? -

Image
i have doubled checked item exists in dynamodb table. id default hash key. i want retrieve content using main function in code: import boto.dynamodb2 boto.dynamodb2 import table table='doc' region='us-west-2' aws_access_key_id='yyy' aws_secret_access_key='xxx' def get_db_conn(): return boto.dynamodb2.connect_to_region( region, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key) def get_table(): return table.table(table, get_db_conn()) def main(): tbl = get_table() doc = tbl.get_item(id='4d7a73b6-2121-46c8-8fc2-54cd4ceb2a30') print doc.keys() however exception instead: file "scripts/support/find_doc.py", line 31, in <module> main() file "scripts/support/find_doc.py", line 33, in main doc = tbl.get_item(id='4d7a73b6-2121-46c8-8fc2-54cd4ceb2a30') file "/users/antkong/project-ve/lib/python2.7/site-packag...

c# - Draw 2 pictureboxes in one bitmap -

i'm c# beginner , i'm wondering if there way draw 2 images 2 different pictureboxes , save 1 image using method drawtobitmap. i can preview nice in program (it looks good), main problem when save picture, it's showing picturebox1 blank-alike icon of picturebox2 in middle :/ here's part of code , it's not working should picturebox2.imagelocation = potdoslike; bitmap bmp = new bitmap(picturebox1.width, picturebox1.height); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\asd.jpg"); i figured out! problem didn't save picturebox.image , couldn't draw nothing out... here's code! picturebox2.parent = picturebox1; picturebox2.imagelocation = potdoslike; picturebox2.image = image.fromfile(potdoslike); bitmap bmp = new bitmap(picturebox1.image); picturebox1.drawtobitmap(bmp, picturebox1.bounds); picturebox2.drawtobitmap(bmp, picturebox2.bounds); bmp.save(@"d:\as...

java - Checking for normal distribution hypothesis of discrete dataset -

i newbie in statistics topic, guess might obvious missing here. basically examine if double array of integer values (histogram) conforms normal distribution (mean , standard deviation specified) significance level, basing on statistical tests apache commons math. what understand common way calculate p-value , decide if null hypothesis true or not. my first "baby" step check if 2 arrays coming same distribution using one-way anova test (second part taken example in documentation): double samples1[] = new double[100]; double samples2[] = new double[100]; random rand = new random(); (int = 0; < 100000; i++) { int index1 = (int) (rand.nextgaussian()*5 + 50); int index2 = (int) (rand.nextgaussian()*5 + 50); try { samples1[index1-1]++; } catch (arrayindexoutofboundsexception e) {} try { samples2[index2-1]++; } catch (arrayindexoutofboundsexception e) {} } list classes = new arraylist<>(); classes.add(sample...

How to carry data from one controller to another in angularJS? -

i have 2 controllers , 2 models in angular. in first view controller combines data provided 2 models , creates combined view. not want merge data again in second controller(if want use again). how carry combined data first controller second?

How to declare an array in a function and call the function in C -

i have assignment , cannot figure out part. the assignment requires create 2 separate functions , call them in main. question syntax calling pointer array , how call function in main program? example, int function_1(int x, *array); how call function_1 ? or lost here? i should add anytime try , call function array, error: [warning] assignment makes pointer integer without cast [enabled default] int function(int x, char *array) { //do work return 0; } and in main int main() { char arr[5] = {'a', 'b', 'c', 'd'}; int x = 5; function(x, &arr[0]); return 0; }

Split Matrix into several depending on value matlab -

i trying split nx3 matrix submatrices in matlab. matrix c of shape c = 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 it either has rows of zeros or rows of ones. want split matrix keep matrices of ones. here instance there's 3 'groups' of ones. want get c1 = 1 1 1 c2 = 1 1 1 1 1 1 1 1 1 c3 = 1 1 1 1 1 1 however real matrix n 3, don't know ones are. edit 1: now, need split x1 , y1 (individual row vectors same length c ) x(1), x(2),.. (similarly y vector) based on how matrix c split sample input: x1 = (1:9)'; y1 = (2:2:18)'; desired output: x(1)=[1], x(2)=[4 5 6]' , x(3)=[8 9]' y(1)=[2], y(2) =[8 10 12]' , y(3)=[16 18]' input: c = [1 1 1; 0 0 0; 0 0 0; 1 1 1; 1 1 1; 1 1 1; 0 0 0; ...

node.js - Simple VOIP programming concept -

when install voip software such kphone or vock (with nodejs), specify server-side , client-side installation. if both voip chat users know target ip client address each other, why still need install software on server-side ? or since phone or website voip users' ip dynamic ip not static , need place voip user's information such dynamic ip talk communcation both 2 voip client on server-side. corect in concept ? developer, can write client-side voip software if both client ip , port used fixed or static , no need server-side assist, correct. server-side bridge purpose between 2 client if thier ip dynamic , right ? please advise you answered question correctly. one of main purpose of voip server (among routing/billing/ivr/voicemail/others) registrar functionality. means softphones can register server, , peer can contact softphone via server since solves dynamic/private ip issues. in sip can make calls directly between 2 endpoints specifying exact location, so: -i...

html - Two Columns layout in CSS - text and image changing order in each row -

can me , tell me what's wrong in css code? looks this: body { font-family: open sans, sans-serif; padding: 5rem 1.25rem; /* 80 20 */ } .container { width: 100%; max-width: 60rem; /* 960 */ margin: 0 auto; } .item { width: 100%; overflow: hidden; margin-bottom: 5rem; /* 80 */ } } .item { color: #666; } .item__info, .item__img { width: 50%; float: left; } .item:nth-child( ) .item__info { float: right; padding-left: 1.25rem; /* 20 */ } .item:nth-child( ) .item__img { padding-right: 1.25rem; /* 2...

Why aren't variable-length arrays part of the C++ standard? -

i haven't used c in last few years. when read this question today came across c syntax wasn't familiar with. apparently in c99 following syntax valid: void foo(int n) { int values[n]; //declare variable length array } this seems pretty useful feature. there ever discussion adding c++ standard, , if so, why omitted? some potential reasons: hairy compiler vendors implement incompatible other part of standard functionality can emulated other c++ constructs the c++ standard states array size must constant expression (8.3.4.1). yes, of course realize in toy example 1 use std::vector<int> values(m); , allocates memory heap , not stack. , if want multidimensional array like: void foo(int x, int y, int z) { int values[x][y][z]; // declare variable length array } the vector version becomes pretty clumsy: void foo(int x, int y, int z) { vector< vector< vector<int> > > values( /* painful expression here. */); } the slice...

https - Don't know how to add SSL certificate on Windows Phone 8.1 Portable Class Library -

i tried in many ways access https server using windows.web.http.httpclient on portable class library windows phone 8.1 app i need portable class library , install ssl certificate on library whithout action of user. is possible , if yes, how ? you can load certificate application file , install it: uri uri = new uri("ms-appx:///assets/temprootca.cer"); storagefile file = await storagefile.getfilefromapplicationuriasync(uri); ibuffer buffer = await fileio.readbufferasync(file); certificate rootcert = new certificate(buffer); certificatestore rootstore = certificatestores.trustedrootcertificationauthorities; rootstore.add(rootcert);

c# - SharpSsh Command Execution -

Image
i trying create ssh client using c#. using tamir.sharpssh library. having issues sending command , getting appropriate response server. the way have been testing sending on ls command, followed cd.. command, followed ls command again -- see whether or not cd.. command being executed properly. however, there no difference between first ls command , second ls command. not entirely sure doing wrong. perhaps using wrong ssh type. have provided code , output getting. have added output expect. using tamir.sharpssh; namespace sshnetexample { class program { static void main(string[] args) { sshexec ssh = null; try { console.write("-connecting..."); ssh = new sshexec(host, username, password); ssh.connect(); console.writeline("ok ({0}/{1})", ssh.cipher, ssh.mac); console.writeline("server version={0}, client versio...

python - Pyodbc Connection Error -

code this code have entered using python 2.6 in linux red hat 64bit import pyodbc print pyodbc.datasources() print "connecting via odbc" conn = pyodbc.connect("driver={netezzasql};server=localhost;port=5480;database=database;uid=santiago;pwd=ha123;") error this true error received when running pyodbc. don't know language or means? {'odbc': '', 'netezzasql': '/usr/local/nz_7.2.0.3/lib64/libnzodbc.so'} connecting via odbc traceback (most recent call last): file "connect.py", line 41, in <module> conn = pyodbc.connect("driver{netezzasql};server=localhost;port=5480;database=database;uid=santiago;pwd=ha123;") pyodbc.error: ('h00', '[h00] [unixodbc]sre n/rpr trbtsaeepy\xc8 (33) (sqldriverconnectw)') obdcinst.ini this obdcinst file used [odbc drivers] netezzasql = installed [netezzasql] driver = /usr/local/nz_7.2.0.3/lib64/libnzodbc.so setup = /usr/...

mongodb - Moongose - how to customize a field in a scheme ? string and array in the same field -

i know how can customize field can use array , string eg: var postingschema = new schema({ created: { type: date, default: date.now }, title: { type: string, required: true, trim: true }, images: array, categorie: array, ubication:[{ type: number, ref: 'place'}], agg:[{ agg :{ type: string, ref: 'agg' }, value : string, make :[{ type: number, ref: 'make'}] }] }); in field agg value, have problem can of type string , can of type array , should of array type populate scheme. how can that? i made field called "value ->string" , "make->array" if there better way?

VBA IE call a javascript containing 'this' keyword -

i attempting call javascript function on webpage contains 'this' keyword referring <input> textbox on webpage. function looks this: functiondostuff('hdnattribute',this,'key') using js = "functiondostuff('hdnattribute',this,'key')" call ie.document.parentwindow.execscript(js) doesn't throw error not produce results of function since this cannot identified. stepping through website this = [object disphtmlinputelement] instead of element name while function running. have ideas? good morning, adding more issue. there seems 2 problems, 1st setting window.event, functiondostuff begins with: if (window.event && window.event.keycode == 13) , when function called exits out due event being null. there way pass event 13 website? second issue submitting "this" htmlinputobject. does know method fire 'onkeypress' event? @ point of trying sendkeys avoid calling function have not been a...

Make SQL Server database read only except for one stored procedure -

i have stored procedure migrate data database another. exclude error, want make database read every transaction except mine. use sqlconnection , sqlcommand run script. there way this? set database single-user mode . when put in single-user mode, have connection available. long don't relinquish connection, no 1 else can connect. be warned, close existing connections other users. prevent other connections being made. more information: https://msdn.microsoft.com/en-us/library/ms345598.aspx

algorithm - Merging sorted lists without comparison key -

say have following lists: list 1: x, y, z list 2: w, x list 3: u and want merge them such order among each individual list respected. solution above problem might w, x, y, z, u . this problem easy if have comparison key (e.g. string comparison; < z), gives reference element's position relative other elements in combined list. case when don't have key? above problem, restate problem follows: x < y , y < z , w < x x, y, z, w, u in {0, 1, 2, 3, 4} the way i'm solving type of problem model problem constraint satisfaction problem -- run ac3 arc consistency algorithm eliminate inconsistent values, , run recursive backtracking algorithm make assignments. works fine, seems overkill. is there general algorithm or simpler approach confront type of problem? construct graph node every letter in lists. x y z w u add directed edge letter x letter y every pair of consecutive letters in list. x -> y -> z ^ | w u topologically...

javascript - TypeError: t(...).on is not a function on fullcalendar -

fullcalendar throwing error: typeerror: t(...).on not function fullcalendar.min.js:8:11264 this script/css includes: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script> <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.min.js"></script> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <link href="http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.3.1/fullcalendar.min.css" rel="stylesheet" type="text/css"/> <link href="...

Offset + match with a variable vba -

i'm trying use variable in offset() , match() function. doesn't work. for each valid_type in valid_sec_type_range 'test = valid_sec_type_range.cells(1, valid_type_index).value 'test1 = chr(34) & valid_type & chr(34) new_range = [offset(market_value_range,match(valid_type,sec_type,0)-1,0,countif(sec_type,valid_type),1)] and when use works, seems function match , offset not recognize valid_type string. for each valid_type in valid_sec_type_range 'test = valid_sec_type_range.cells(1, valid_type_index).value 'test1 = chr(34) & valid_type & chr(34) new_range = [offset(market_value_range,match("asset backed",sec_type,0)-1,0,countif(sec_type,"asset backed"),1)] new_range = [offset(...)] syntactic sugar this: new_range.value = application.evaluate("[offset(...)]") so yes, variable name understood literal string, understood range name, , don't have range of name. if using vba, in vba way: ...

excel - Index Match query with if statement in the Match -

i'm trying index match statement between 2 different worksheets. need add condition on sheet match. effectively, have list of vessel names in sheet 1 (col c), , in sheet two, vessel name (col c)the contract end dates (col q) , contract status (col al) in sheet 1 need return contract end date. however, there potential duplicates in sheet 2 want return date if contract status on row not 'completed' it's condition seems not work, appreciated thanks! =if('infield vessel contracts'!al:al<>"complete",index('infield vessel contracts'!q:q,match(c162,'infield vessel contracts'!c:c,0)),"no contract") you might try: =--('infield vessel contracts'!al:al="completed")*index('infield vessel contracts'!q:q,match(c162,'infield vessel contracts'!c:c,0))

excel - Putting Labels and Error Handler in the right place -

i using error handler in vba , want use in error handler in code suggested many experts on here. sub test() =1 100 on error goto errhand: filename=dir() folder= workbooks.open(folder & filename) label1: code code close file errhand: application.getopenfilename() goto label1 next end sub i finding difficulties in running code in normal way. try pen file , if fails, call error handler , throw prompt select file , close file , same thing next files. 1 difficulty facing opened file never closes. in advance. in addition jeeped's excellent suggestion: sub test() on error goto errhand: =1 100 filename=dir() set folder= workbooks.open(folder & filename) 'label1: code code folder.close 'based on using 'folder', above next exit sub 'if don't this, code execution go right error handler errhand: if err.number = <something> application.getopenfilename() 'goto label1 resume next 'this simpler ver...

remote desktop - RDWeb asking for credentials on only one of two servers -

i customizing rdweb application remote desktop service windows server 2012. i have configured 2 separate servers rdweb, , rdweb application generated both servers. access remote app of second server using rdweb application of first server through single ui. remote apps both servers coming single ui. suppose have 2 calculator applications both servers, let's call them cal1 , cal2 . when click on cal1 , calculator application runs first server without asking credentials. when click on cal2 ask credentials, , if provide credentials calculator application second server runs. when click on cal2 , should not ask credentials. rdweb application auto-generated , uses form authentication. this, need share cookies between both servers. have use same machine key in web config of both applications, not working.

responsive design - How to disable devices supported from Android Studio -

how can disable unsupported devices categories? example, want application available phones, don't need take screenshots of tv , tablets , etc. converting comment answer: in application manifest describe capabilities needed application. may use screen characteristics distinguish between tablets, phones, etc. this information used limit devices on application can installed. honored in google play, in development environment, etc. won't have option of installing application on device on not work.

java - Asynctask and Handler class - can't share variable -

i have service includes asynctask , handler classes. asynctask , handler should share variable. use static volatile variable issendmessage because think there 2 threads, i'm not sure. problem variable in while loop doesn't change. don't know mistake is. here snippet of code. public class services extends service { static volatile boolean issendmessage = false; @override public ibinder onbind(intent intent) { return null; } @override public int onstartcommand (intent intent, int flags, int startid) { new connectionserverasynctask().execute(); return service.start_sticky; } public class connectionserverasynctask extends asynctask<void, result, void> { private boolean finish = false; @override protected void onpreexecute() { super.onpreexecute(); } @override protected void doinbackground(void... params) { while(!finish){ l...

php - htaccess error when dealing with non-english characters in url, but working without it -

if article title in url written in full english, displayed correctly. if title written in greek, 404 page. without using htaccess rewrite rule, displays page. my question how can make work htaccess? htaccess error when dealing rewriteengine on rewritecond %{request_filename} !-f rewriterule ^article/([a-za-z0-9]+)/?$ article.php?title=$1 [nc,qsa,l] rewriterule ^([^\.]+)$ $1.php [nc,l] 3 scenarios: first (english chars): title: hello url: example.com/article/hello opens page second (greek chars): title: γειά url: example.com/article/γειά requested url article/ÃŽ³ÃŽÂµÃŽ¹ÃŽ¬.php not found on server. third (without using htaccess): /article.php?title=γειά opens page [a-za-z0-9] match english text , numbers. change article rewrite rule to: rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^article/([^/]+)/?$ index.php?title=$1 [nc,qsa,l] [^/]+ match 1 , more of character till next / matched or end of string reached matchin...

html - substring in python 3 given line number and offset -

i'm trying parsing html page htmlparser library in python 3. function htmlparser. getpos () return line number , offset of last tag parsed. for example know "string" want starts in line number 10 offset 5 , ends in line number 30 offset 10 how can substring line 10 offset 5 line 30 offset 10 ? thanks. html = 'this holds entire html code' myparser.feed(html) #now parser works magic start = (10,5) #this returned htmlparser.getpos(), 10 line number , 5 offset of line end = (30,10) #same here #i want (i know invalid python code) substring = html.substring(start,end) #return html code string line 10 offset 5 line 30 offset 10 better explanation: i'm trying substring string. i understand in python 3 it's called slice: string[a:b] if wanted substring 'jonny' form string 'hello jonny smith' this: substring = 'hello jonny smith'[6:11] problem htmlparser.getpos() returns tuple (line number, offset of line) can't do: sub...

ios - Foursquare API: Consider close proximity as check-in -

i've been looking foursquare api on ios (through das-quadrat ). i'd figure out if user is at specific location. know how find , can it. works. how can tell if user close enough location consider close proximity check-in (i'm not interested in checking him in foursquare way)? it's want know user @ venue of category i'm monitoring. know can calculate distance between user's location , venue's location , consider every distance less than, say, 15 meters check-in wondering if there's more elegant solution, maybe api endpoint i'm missing. i guess real time api best suited: https://developer.foursquare.com/overview/realtime allows register notifications, foursquare heavy lifting you.

Python - How to return the indice value of a list? -

currently have element in initialstring: if element == word: print(element.index(initialstring)) where initialstring list , word called variable. however, returning typeerror telling me cannot convert 'list' object str implicity . you'd use initialstring.index(element) (so reversed) instead; list can tell index has element stored in; element has no knowledge of list. you should use enumerate() here however, add indices loop: i, element in enumerate(initialstring): if element == word: print(i) if wanted know index of word , however, simpler still use: print(initialstring.index(word))

javascript - How To Reinitialize tinyMCE with fresh data after an AJAX Call? -

i have page used both create , update. when user writes name , if name doesn't exist in database added along newly created description (through tinymce plugin) (this part works perfectly). when user selects existing name, ajax request fired pull description. able pull description correctly response (text) not shown in tinymce. using latest version of tinymce. my question how can reinitialize tinymce control has been initialize on page load, or there other way achieve this, want existing description updated you don't need perform re-initialize editor, using below command tinymce.activeeditor.setcontent('some content here') instead. can try this?

spring - Which template engine i have to use? -

i developing website spring mvc , hibernate sql database. colleagues suggested me use free marker or velocity template engine i'm using jsp template engine .i'm totally confused. so, can please tell me jsp best or not , why go jsp or?. each 1 of them have advantages use if need them, kind of questions answers depends on want achieve , how template engine you. for example, if want use generated html pages working mockups (because need show them), go thymeleaf . document shows key differences between thymeleaf , jsp.

asp.net - AngularJS using Webservice -

using system; using system.collections.generic; using system.linq; using system.web; using system.web.services; /// <summary> /// summary description webservice /// </summary> [webservice(namespace = "http://tempuri.org/")] [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)] // allow web service called script, using asp.net ajax, uncomment following line. // [system.web.script.services.scriptservice] public class webservice : system.web.services.webservice { public webservice () { //uncomment following line if using designed components //initializecomponent(); } public string firstname { get; set; } public string lastname { get; set; } [webmethod] public string helloworld() { return "hello world"; } } how create example of angularjs using webservice in asp.net? how create webservice in angularjs? i have created simple example of angularjs how create angularjs webservice? ...

sas - Loop through list -

i have following macro: rsubmit; data indexsecid; input secid 1-6; datalines; 108105 109764 102456 102480 101499 102434 107880 run; %let endyear = 2014; %macro getvols1; * first extract secids options given date , expiry date; %do yearnum = 1996 %to &endyear; proc sql; create table volsurface1&yearnum select a.secid, a.date, a.days, a.delta, a.impl_volatility, a.impl_strike, a.cp_flag optionm.vsurfd&yearnum a, indexsecid b a.secid=b , a.impl_strike ne -99.99 order a.date, a.secid, a.impl_strike; quit; %if &yearnum > 1996 %then %do; proc append base= volsurface11996 data=volsurface1&yearnum; run; %end; %end; %mend; %getvols1; proc download data=volsurface11996; run; endrsubmit; data _null_; set work.volsurface11996; length fv $ 200; fv = "c:\users\user\desktop\" || trim(put(indexsecid,4.)) || ".csv"; file write filevar=fv dsd dlm=',' lrecl=32000 ; put ...

android - Is Fragment.onStop() guaranteed to be called? -

from table @ link: http://developer.android.com/reference/android/app/activity.html#activitylifecycle we can see android activity not killable until after onstop() has been called (for honeycomb , beyond). do have same (documented) guarantee fragments? would appreciate pointing me @ documentation stated. edit: has been pointed out [fragment.onstop] generally tied activity.onstop of containing activity's lifecycle. http://developer.android.com/reference/android/app/fragment.html#onstop() but doesn't tell me fragment's onstop() guaranteed (at least not same level of clarity activity documentation gives.) there anywhere fragment.onstop() guarantee explicitly stated? edit 2: based on discussion below, debating whether activity.onstop() guaranteed (it seems safe assume if not, neither fragment.onstop guaranteed). have moved question activity.onstop new thread: is activity.onstop() guaranteed called (api 11 +) . it seems me necessary, not sufficient, activity...

cookies in smarty tpl(probably syntax errors) -

i got code: ... {assign var="name" value="some_value"} {if $smarty.cookies.$name eq 'joc' } {assign var="test" value="`$product.total - 20`"} {assign var="test2" value="`$product.total_wt - 20`"} {assign var="var2" value="$smarty.cookies.$name"} {else} {assign var="test" value="`$product.total`"} {assign var="test2" value="`$product.total_wt`"} {/if} ... please me fix errors , make code work. i'm newbie smarty syntax. var2 empty, "if" condition return false try adding <pre>{$smarty.cookies|@print_r}</pre> template. debug why if condition not being met. may not have set cookie correctly in first place. alternatively try http://www.smarty.net/docsv2/en/chapter.debugging.console.tpl investigate smarty variables state.

javascript - i tried a html code for next and previous 5 years in a drop down.. i got next 5 years properly.. how can i get previous 5 years -

i tried html code next , previous 5 years in drop down.. got next 5 years properly.. how can previous 5 years please he;p me code function populatedropdown(yearfield){ var today=new date() var yearfield=document.getelementbyid(yearfield) var thisyear=today.getfullyear() (var y=0; y<5; y++){ yearfield.options[y]=new option(thisyear, thisyear) thisyear+=1 } yearfield.options[0]=new option(today.getfullyear(), today.getfullyear(), true, true) //select today's year } </script> </head> <body> <form action="" name="someform"> <select id="yeardropdown"> </select> </form> <script type="text/javascript"> //populatedropdown(id_of_day_select, id_of_month_select, id_of_year_select) window.onload=function(){ populatedropdown("yeardropdown") } </script> </body> </html> try this function populatedropdown(yearfield) { var today = ...

html - Rails' Devise Edit Profile Page -

i'm trying place form field partial '_form.html.slim' when , render partial in 'edit.html.slim', form not being rendered. browser's inspector, says form element (not including input tags , submit button) being rendered in modified 'edit.html.slim'. here original 'edit.html.slim' .row .small-8.columns.small-centered .form-panel p.welcome | edit = resource_name.to_s.humanize = form_for(resource, as: resource_name, \ url: registration_path(resource_name), html: {method: :put}) |f| = devise_error_messages! .row .small-3.columns = f.label :username, class: 'right' .small-9.columns = f.text_field :username, autofocus: true .row .small-3.columns = f.label :email, class: 'right' .small-9.columns = f.text_field :email .row .small-3.columns = f.label :name, class: 'right' .small-9.colum...

json - Pass dynamic values to rest easy web service in java -

my web service in net beans , want pass dynamic values method android studio my json url : http://192.168.1.31:8084/adminwebservice/mywebservice/showselectedcategory/bar my webservice class is: @get @path("/showselectedcategory/{strrestrotypes}") @produces(mediatype.application_json) public list<categorytypes> showselectedcategory(@pathparam("strrestrotypes")string[] strrestrotypes) { } my entity file contains @xmlrootelement(name="restaurant") @xmltype(proporder = {"restroid","restroname"}) public class restauranttypes { private int restroid; private string restroname; //getter , setter } through code can pass 1 parameter, , not more in advance , suggestions

vb.net - Process cannot access it is being used by another process -

i got solution 3 separated windows services. 1 services download files, second taking files , third 1 loading db. during downlading files, second process starting play during still downloading, or third process wants load file still parsing. heard mutex resolution in case not sure how in situation use other processes waits on files untill "free". below i'll present code: downlading process part of code file download doing: (in case each file downloading specific location folder) each item in remotefiles try session.getfiles(item, downloadfolder, true, transferoptions).check() catch ex exception end try next parsing win service process part of code parsing downloaded files: dim columnfound boolean = false using myreader new fileio.textfieldparser(filetobeparsedpath) dim currentrecord string() ...

How to create a text file using a bamboo task -

i started on old project using maven, , move bamboo ci. executing tests, needs local configuration file. moment, these files stored in our git not optimal. know if there tasks creating text file in local build repository. content of text file must editable in task configuration panel. as workaround, use script task, not optimal... so if understand correctly, you're trying inject runtime values needed testing within bamboo plan configuration. if you're trying do, why not pass needed runtime values bamboo variables , access them usual environment variable. hope helps,

javascript - How can I use tweenJS make bitmap move to some points -

i meet question this: i want make bitmap move points, stored in array. how can use tweenjs this? i try first method this: var points = [{x:0, y:0}, {x:100, y:100},{x:200, y:200}]; //the points come other method, , data points. for( var i=0; < points.length; i++ ) { createjs.tween.get( target ) .to( { x: points[i].x, y: points[i].y }, 600, createjs.ease.easein); } running code, target move first point.so give up. then try second method : var str = 'createjs.tween.get( target )'; for( var i=0; < points.length; i++ ) { str += '.to( { x: points[' + + '].x, y: points[' + + '].y }, 600, createjs.ease.easein)' } eval( str ); it works perfect, worry "eval" , not safe. can give me tips ? big hug. just tween once, , add each to in loop. sample creates multiple tweens run concurrently: var points = [{x:0, y:0}, {x:100, y:100},{x:200, y:200}]; var tween = createjs.t...

java - Spring social - Implicit sign up is not working -

i spring social along spring mvc connect twitter . want achieve implicit sign up, if user new following spring social docs . getting following error, when application deployed error: org.springframework.web.context.contextloader - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'springsecurityfilterchain' defined in class org.springframework.security.config.annotation.web.configuration.websecurityconfiguration: instantiation of bean failed; nested exception org.springframework.beans.factory.beandefinitionstoreexception: factory method [public javax.servlet.filter org.springframework.security.config.annotation.web.configuration.websecurityconfiguration.springsecurityfilterchain() throws java.lang.exception] threw exception; nested exception java.lang.illegalstateexception: springsocialconfigurer depends on org.springframework.social.security.socialauthenticationservicelocator. no single bean of type found i...

javascript - Issues with CORS, Jquery and Coldfusion. Headers -

i using following code handle jquery stuff: var data = $('#loginform').serialize(); alert(data); $.ajax({ url: 'https://devport.mywebsite.com/login.cfm?method=login', crossdomain: true, type: "post", data: data, cache: false, beforesend: function (xhr) { xhr.setrequestheader("access-control-allow-origin", "*"); }, success: function (data) { alert(data); }, error: function (xhr, teststatus, error) { alert(teststatus + " " + error); } }); it time going error, not sure why problem is. error is: sec7123: request header access-control-allow-origin not present in access-control-allow-headers list. script7002: xmlhttprequest: network error 0x80070005, access denied. the coldfusion side this: <cfcontent type='text/html; charset=utf-8'> <cfheader name="access-control-allow-origin" value="*"> <cfheader name="acc...

java - JavaFX Timeline control -

Image
i want create scrollable timeline controller circles connected baseline filled number ( size of circle corresponding containing number) , trailing icon. since new javafx have no idea how start. in swing e.g. use jpanel , ovverride onpaint() method draw circles, lines , icons... in javafx thought using horizontal listview custom listcell , not sure if baseline possible it. looking ideas how implementiert such controll... try using hbox wrapped inside scrollpane . you can add elements hbox using getchildren.add(node) . elements automatically shown on scene , scrollpane adjust scrollbar you.

Submitting a Watchkit App to the Appstore - do I create a new App or is it somehow part of my iPhone App -

Image
i tried load app itunesconnect today got error during build re. no provisioning profile found (when run iphone app works fine , has been fine while now). assume because have added watchkit app. how resolve ? do need create new app in itunesconnect watchkit app ? thanks. you don't need create new app watch app. it's part of main app extension . you resolve problem just signing out account settings in xcode , signing in again . worked me. first of click onto accounts tab. then select apple-id , click minus. then click onto plus button , add apple-id once again.

hadoop - How to implement WritableComparable interface? -

i need use method setgroupingcomparatorclass in job , takes argument of type writablecomparable . i unable implement writablecomparable class. please me solve this. regards, bidyut setgroupingcomparatorclass(class<? extends rawcomparator> cls) define comparator controls keys grouped single call reducer.reduce(object, iterable, org.apache.hadoop.mapreduce.reducer.context) job.setgroupingcomparatorclass(customkey.groupcomparator.class); in customkey class can write static method. add below code in custom key class. public class customkey implements writablecomparable<indexerkey> { public static class groupcomparator extends writablecomparator implements serializable { private static final long serialversionuid = -3385728040072507941l; public groupcomparator() { super(customkey .class, true); } @suppresswarnings("rawtypes") public int compare(writablecomparab...