Posts

Showing posts from January, 2010

sharepoint - Where to store value in Outlook 2013 C# -

i developing addin outlook 2013. for that, have specific requirement , have data sharepoint list , display in pane. i have created addin , working fine. right , have written sharepoint url, username, password, domain directly. now scenario, have give user configure sharepoint url, username, password, domain. so can store information. when have data sp list, need use details user has configured can please me.? outlook stores data in hidden (associated) message in 1 of default folders. can see existing data in outlookspy - click imapifolder button, go "associated contents" tab. outlook object model lets access data through mapifolder.getstorage - see http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mapifolder.getstorage(v=office.14).aspx

java - javax.validation.ValidationException: Type interface org.hibernate.validator.method.MethodValidator not supported -

am using spring 3.1 , hibernate validator 4.2. have custom traversal resolver , registered spring bean after have create vlaidaton factory using below code <bean id="validatorfactory" class="org.springframework.validation.beanvalidation.localvalidatorfactorybean" > <property name="traversableresolver" ref="traversableresolver"/> <property name="validationpropertymap"> <util:map> <entry key="hibernate.validator.fail_fast" value="false" /> </util:map> </property> </bean> <bean id="traversableresolver" class="org.hibernate.validator.engine.resolver.singlethreadcachedtraversableresolver" > <constructor-arg ref="delegate"/> </bean> <bean id="methodvalidatoradvice" class="common.validator.methodvalidationaspect"> <constructor-arg ref="v...

java - Is it required to add org.apache.catalina.startup.VersionLoggerListener for tomcat 8 server.xml? -

i upgrading tomcat 8 7. required add listener? <listener classname="org.apache.catalina.startup.versionloggerlistener" /> as far know listener prints application server , os informations. should first on list of listeners included in <server> element can ommited .

Find duplicate rows in SQL Server by multiple conditions -

my fields are id | name | starttime | endtime | date | description i looking way select rows same entries in fields except id. i not familiar sql tried this approach there 1 field relevant not (as in case) five. my first idea try like: select * table order name, date, starttime, endtime, description if through entries @ least find duplicates not best way solve problem. this should need: select name, date, starttime, endtime, description table group name, date, starttime, endtime, description having count(*) > 1

nginx - Why use gunicorn with a reverse-proxy? -

from gunicorn's documentation : deploying gunicorn we recommend use gunicorn behind proxy server. nginx configuration although there many http proxies available, advise use nginx. if choose proxy server need make sure buffers slow clients when use default gunicorn workers. without buffering gunicorn susceptible denial-of-service attacks. can use slowloris check if proxy behaving properly. why recommended use proxy server, , how buffering prevent dos attacks? according nginx documentation , reverse proxy can used provide load balancing, provide web acceleration through caching or compressing inbound , outbound data, , provide layer of security intercepting requests headed back-end servers. gunicorn designed application server sits behind reverse proxy server handles load balancing, caching, , preventing direct access internal resources. by exposing gunicorn's synchronous workers directly internet, dos attack performed creating load trickles data serv...

objective c - iOS: Unrecognized selector error — but I never call that method and it doesn’t exist -

so pretty weird one. first of — doesn’t happen when running app via xcode. when app running standalone on device (deployed via testflight or itunes). i use class called rmlstarreceiptprinter interface portable, bluetooth receipt printer. works fine while running in debug mode while device (iphone/ipad) connected xcode on dev machine. if run in standalone mode, -[rmlstarreceiptprinter th:]: unrecognized selector sent instance error. but , th: method doesn’t exist in rmlstarreceiptprinter , never called! time when ran it, errored same message selector ex: , doesn’t exist either. there methods contain th , ex substrings in name, tells me kind of weird memory leak or form of corruption makes app send wrong selector name. possible? bonus : thought when compile in release mode (which in case), package doesn’t contain symbol tables, how come in error logs there class , selector names? i can answer bonus part of question, , not actual problem. objective-c uses dyna...

java - How to control parsing xml using xStream? -

now using xstream parse object xml-format string. hope when parse xml can want according different fileds, if encounter filed a, add cdata block before it, when encounter filed b, make upper case, this, , here doing now. public static string textmessagetoxml(responsetextmessage textmsg){ xstream.alias("xml", textmsg.getclass()); return xstream.toxml(textmsg); } private static xstream xstream = new xstream(new xppdriver() { @override public hierarchicalstreamwriter createwriter(writer out) { return new prettyprintwriter(out) { // add cdata block boolean cdata = ...;//i need add cdata fields boolean isneedupper=...;//only need protected void writetext(quickwriter writer, string text) { if (cdata) { writer.write("<![cdata["); writer.write(text); write...

Add Tabs inside a fragment in android -

i want show 2 tabs inside fragment. tabs fragments too. whats best way. i tried ( android fragment tab host + viewpager swipe? ) method, when go fragment first, both tabs seems work fine. when go , load fragment again, tabs empty. how can improve or other methods there? thanks

Delete all the columns except 1st column and 1st row in all the csv file in a folder using batch file -

Image
i have hundreds of csv files in 1 folder, having 9 columns ,wherein want delete last 8 columns , 1st row files. file looks also not sure if can overwrite the same file edited. considering possible. , if overwriting not possible should save same file name may in different directory please suggest any appreciated. this code assumes you've put batch file in same directory csv files. @echo off /f %%a in ('dir /b *.csv') ( /f "skip=1 tokens=1,2* delims=," %%b in (%%a) ( echo %%b>>newdata.csv ) copy /y newdata.csv %%a del newdata.csv ) and code makes no assumptions location of script, source csv files, or target folder: @echo off set source_folder=c:\path\to\your\csv\files set target_folder=c:\path\to\your\output\folder if not exist %target_folder% mkdir %target_folder% /f %%a in ('dir /b %source_folder%\*.csv') ( /f "skip=1 tokens=1,2* delims=," %%b in (%source_folder%\%%a) ( echo %...

c# - How do you supply a type that's defined in a web service to another web service (share types)? -

i've got 2 wcf services. service contains definition of type myentity. service b contains service reference service , therefore can use type myentity. have method looks this: protected void update (servicea.myentity entity) { //do stuff } now want use method in service a, added service reference service b , tried: protected updateserviceb(myentity entity) { using(serviceb.serviceclient client = new serviceb.serviceclient()) { client.update(entity); } } this didn't work , complained types not same, though service b using type defined in service a. how can solve this? update i avoided issue due time constraints , passed guid of myentity service service b instead. used existing method called 'getmyentity(guid entityid)' in service retrieve entity in service b: protected void update (guid entityid) { myentity entity = new myentity(); using (serviceaclient client = new serviceaclient()) { entity = client...

ios - Strange SpriteKit Texture Atlas Generator Error -- Texture Atlas Failure With Exit Code 11 -

i have repeated, strange error. i'm working distributed team through github, , developer added .atlas folder our project. none of other atlases have issues, 1 touchy. the error spritekit texture atlas generator error: command /applications/xcode.app/contents/developer/tools/../usr/bin/textureatlas failed exit code 11 we error after pulling repo, it's relatively random. i'm dealing error runs on simulator fails on device. can fixed combination of: changing target (we have 2), cleaning build , derived data, or changing atlas in way. this question has similar issue, none of answers have worked us, nor feel should. for reference, we're running xcode 6.1, 10.9.5. error didn't exist before upgraded 6.1, nor before new atlas existed. full error: generating texture atlas edify\ testing/supporting\ files/images/octopusanimation.atlas cd /users/rl/desktop/new-sas-ios-pull-post-recursive-instruments/sas-ios/sasl export path="/applications/xcode....

asp.net mvc - Unable to display MultiSelectList.SelectedValues on MVC view -

Image
i working mvc application legacy code. far, changes made 2 calls retrieve lists of accountdivisionmodel objects. original code called stored procedures , returned objectresult , contained data. public class accountdivisionmodel { int divisionid; string divisionname; int accountid; bool isactive; } i'm making 2 calls retrieve list of divisions belong account , list of (selected) divisions belong contact of account. var adivs = account.getdivisionbyaccountid(c.accountid).toarray(); var cdivs = contact.getdivisionbycontactid(c.contactid).toarray(); viewbag.accountdivisions = new multiselectlist(adivs, "divisionid", "divisionname", cdivs); in edit view @html.dropdownlist("accountdivisions", null, htmlattributes: new { @class = "form-control", @multiple = "multiple", @placeholder = "select division(s)" }) i don't know why selectedvalues not showing though when click on text box (@placehold...

linux - makeself startup script Permission denied -

i created package.bin file makeself on centos. created successfully.however, when run bin file on same machine, got permission denied error. i granted 777 , a+x package.bin file still got same error. makeself --gzip ./target/package ./target/package.bin "package" ./install.sh verifying archive integrity... good. uncompressing package............................. ./xxx.bin: line 392: ./install.sh: permission denied try changing permissions of installation directory. chmod -r 777 /target

android - Saving the state of a button onSaveInstanceState -

ok, 1 tricky me. idea of time log ems. press button action taken, , logs time later use. managed figure out how save textview string. now, how on earth save logtime1.setenabled(false); on rotation or on leaving activity, restores disabled? have button beside allow edit unlock button. here code. public class timelog extends activity{ boolean logtimedis1=true; button logtime1; string time1; textview ivtimestamp; int counter=0; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.time_log); logtime1 = (button) findviewbyid(r.id.logtime1); ivtimestamp = (textview) findviewbyid(r.id.ivtimestamp); if(savedinstancestate != null) logtime1.setenabled(savedinstancestate.getboolean("logtimedis1", true)); logtime1.setonlongclicklistener(new view.onlongclicklistener() { @override public boolean onlongclick(view v) { // ...

jquery - Jcrop error: undefined method 'sub' -

rails 4.0.10: i've been following jcrop tutorial: ( http://railscasts.com/episodes/182-cropping-images ), , i've gotten far submitting cropped image. when press submit button, error: nomethoderror in thingscontroller#update undefined method `sub' ["-auto-orient", "-resize", "\"500x500\""]:array i saw question same error, fixed changing super.sub(/ -crop... in lib/paperclip_processor/cropper " super.first.sub(/ -c... , returned same exact error in case. has else run issue jcrop? lib/paperclip_processors/cropper (i put asterisks around line highlighted on error page) module paperclip class cropper < thumbnail def transformation_command if crop_command ***crop_command + super.sub(/ -crop \s+/, '')*** else super end end def crop_command target = @attachment.instance if target.cropping? " -crop '#{target.crop_w}x#{target.crop_h}+#{...

ajax - Angular $http jsonp: how to parse through data -

i'm starting learn angular , want play around $http call function. want make request external api: angular.module('pokedexapp') .controller('mainctrl', function ($scope, $http) { var response; $http.jsonp("http://pokeapi.co/api/v1/pokemon/1/").success(function(response) { response = response; }) $scope.pokemon = response; }); i'm wrong how works. want {{ pokemon }} out response test it. i'm getting uncaught syntaxerror: unexpected token : error , can't tell if it's because return data isn't formatted or what. the error because in angular try parse response in json type. , failed parse, throw error: uncaught syntaxerror: unexpected token : seems in angularjs you'd better handler jsonp response self. $scope.triggerjsonp = function(){ $http.jsonp("http://pokeapi.co/api/v1/pokemon/1/", {params: {'callback':'eqfeed_callback'}}); }; win...

sql - Retrieving data from multiple tables in phpmyadmin -

i have 3 tables, of them linked pk , fk. tables acc_details , acc_info , acc_bill table : acc_info id | acc_no | rate ______________________________________ 1 | 00001 | 0 2 | 00002 | 21 3 | 00003 | 21 4 | 00004 | 21 table : acc_details id_dls | acc_type | address | **id** ________________________________________________________ 1 | store | pekan | 1 2 | water plant | kuantan | 2 3 | store | kuantan | 2 4 | pump house | kuantan | 4 table : acc_bill id_bill | acc_no | charge_1 | charge_2 ________________________________________________________ 1 | 00001 | 20.00 | 12.00 2 | 00002 | 15.00 | 16.00 3 | 00004 | 200.00 | 22.00 pk ---> id , acc_no acc_info fk ...

javascript - What is causing my visualizer to not move at all even the microphone is captured? -

Image
i have code green visualizer should moving moment microphone captured. causing not move @ all? <!doctype html> <html> <head> <style> body { background-color: white; } img { width: 12px; height: 12px; } </style> </head> <body > <div id="select_media" style="padding:2px;background-color: black;color:white; width: 250px;"> <table> <tr> <td valign="top"> <div class='select'> <table> <tr> <td> <img src="/images/camera.png" /> </td> <td> <video muted autoplay style="width: 208px;height: 200px;"></video> <select id='videosource' style="width: 208px;"></select> </td> </tr> ...

How I call a library defined globally in a particuler page , not in every page : Laravel -

excuse me, defined library in app/start/global.php classloader::adddirectories(array( app_path().'/commands', app_path().'/controllers', app_path().'/models', app_path().'/database/seeds', app_path().'/trunk/index.php', <----- custom library )); i want load or call library in particular page. working every page. need .. yes !! found solution in little bit different approach. i add in routes.php instead of global.php route::get('/calender', function() { $c = require app_path().'/trunk/index.php'; return view::make('calender')->with('c', $c); }); and add in calender.blade.php <h1><?php echo "{$c}"; ?></h1>

image processing - In Android Camera parameters, What is the relation between PictureSize() , PreviewSize and display size? -

consider want picture of size 400*400 , camera supports picture size of 320*240 , 640*480 , 1024*768 etc... my 1st question: which gives me better quality image in below 2 options setpicturesize 640*480 . once picture taken crop 480*480 scale 400*400 setpicturesize 1024*768 . once picture taken crop 768*768 scale 400*400 my 2nd question: i tested output of getsupportedpreviewsize in many android devices , in devices returns display resolution 1 of valid supported preview size. true android devices? my 3rd question does preview size affects quality of image? my 4th question consider using framelayout preview camera, relation between preview size , framelyout size. should change dimension of framelyout based on size of preview thanks in advance. sorry asking lengthy question. why can't crop 400x400? there no way tell scaledown turn out worse , lot of factors apply. less scaling better. the getsupportedpreviewsizes return @ least 1 resolut...

c++ - Qt QCursor::setPos() does nothing -

i've created minimal class demonstrate problem. i'm trying set cursor position, shows no effect. in example class try center cursor widget. here class: class testwidget : public qwidget { q_object public: testwidget(); protected: virtual void mousemoveevent(qmouseevent* event); }; and here implementation: testwidget::testwidget() { setminimumsize(800,600); show(); } void testwidget::mousemoveevent(qmouseevent *event) { qpoint before(mapfromglobal(qcursor::pos())); qpoint center = maptoglobal(qpoint(width()/2,height()/2)); qcursor::setpos(center); qdebug()<<"before:"<<before<<"after:"<<mapfromglobal(qcursor::pos()); } when moving mouse cursor while pressing mouse button following output (exmaple): before: qpoint(754,48) after: qpoint(400,300) this means before called qcursor::setpos(center) cursor @ position 754;48 in top-right corner of widget. after set cursor-position qcursor...

php - Show Jwplayer preview image from video without image -

i using jwplayer 6.10, having multiple video getting uploaded dynamically. to show image preview jwplayer need use below in setup image: "myimage.jpg", is there way make jwplayer preview images without using image: "myimage.jpg", i trying avoid creating preview image server side using video if last option let me know how so have 2 questions is possible image preview video source in jwplayer ? if not possible, how create thumbnails video the answer question number 1 "no." jw player steering script - doesn't touch video file @ all, nor include utilities manipulating it. probably best bet extracting thumbnails server-side ffmpeg: https://trac.ffmpeg.org/wiki/create%20a%20thumbnail%20image%20every%20x%20seconds%20of%20the%20video

bash - Python executable that uses third party module -

i writing python script leverage installation of big project. make single executable .py script, once called, needed (it wrapper bash commands, added error handling , user input). however, need third party modules (such envoy )...how can include them in order usable within script? assuming 3rd party modules not installed, , don't want include them python script, use urllib2 download modules when user runs script: how download file on http using python?

HTTP: 301-Permanently Moved redirects me to original address? -

i'm using telnet first time , trying connect webpage: http://net.cs.uni-bonn.de/de/wg/cs/lehre/ws-201415/sysprog . that, i've given following input on command line: telnet net.cs.uni-bonn.de 80 telnet connects , put in following request: get /de/wg/cs/lehre/ws-201415/sysprog http/1.1 host: 127.0.0.1 then, telnet returns following: http/1.1 301 moved permanently date: wed, 12 nov 2014 13:37:06 gmt server: apache/2.2.3 (centos) location: http://net.cs.uni-bonn.de/de/wg/cs/lehre/ws-201415/sysprog cache-control: max-age=360 expires: wed, 12 nov 2014 13:43:06 gmt content-length: 388 content-type: text/html; charset=iso-8859-1 <!doctype html public "-//ietf//dtd html 2.0//en"> <html><head> <title>301 moved permanently</title> </head><body> <h1>moved permanently</h1> <p>the document has moved <a href="http://net.cs.uni-bonn.de/de/wg/cs/lehre/ws-201415/sysprog">here</a>.</p>...

php - Laravel Swapping interface dependancies -

i've been learning lot coding interface instead of coding concrete class. i'm wondering if following approach practice. let's have notifier class using following structure -app --acme notifiers - mailnotifier -mailnotifier.php - notifierinterface.php - notifierserviceprovider.php is practice if later want add different sort of notifier? text notifier example. thank you! yes, that's example use of interfaces. if future class has functionality can described same function names , structure go it.

maya - how can I change the geometry name in abc file by python -

Image
i export animation alembic file in maya 2014. then, want import , connect render model abcimport. but,the render model's shape not same such : abc model's shape : aaashapedeformed render model's shape : aaashape and namespace not same so abcimport -connect not work how can do.. can use pyalembic change model name in abc file? you don't have that. when import abc file maya, creates abc node in maya scene. if object name doesn't match scene's object name, can connect manually. the way follows. the alembic node has bunch of output plug arrays, outpolymesh , outnsurface etc. these contain outputs. if render object mesh, able find corresponding output plug inside outpolymesh array. in connections editor, connect corresponding outpolymesh[i] plug inmesh plug of render model's shape node.

triggers - Transactions - Oracle Vs PostgreSQL -

postgresql not have feature insert save points in trigger functions , when there exception ( exception no_data_found) entire transaction rolled back. instead of rolling entire transaction , wanted roll last saved point. is there other aternative way can have multiple save points within trigger functions in postgresql. here code : create or replace function func_ex() returns trigger $func_ex$ declare var_name name; begin insert log_table (empid, empname) values (100, 'name'); -- savepoint my_savepoint; "cannot have savepoints in triggers select empname strict var_name emp_table1 empid = 3232332; exception when no_data_found raise notice 'no data found'; return new; end; return new $func_ex$ language plpgsql; -- end of function -- creation of trigger create trigger insert_trigger1 after update of empname on emp_table1 execute procedure func_ex(); postgresql not...

c# - File.Delete the process cannot access the file because it is being used by another process -

public bool downloadmp3file (downloadedmp3 mp3) { webclient client = new webclient (); string filepath = ""; bool wasdownload = false; try { string song = mp3.songname; filepath = @"mp3\" + song + ".mp3"; if (file.exists (filepath)) { file.delete (filepath); } datetime trycountnow = datetime.now; client = new webclient (); client.downloadfileasync (new uri (mp3.url), filepath); client.downloadprogresschanged += client_downloadprogresschanged; client.downloadfilecompleted += client_downloadfilecompleted; datetime start = datetime.now; bool notdownload = false; downloadcomplete = false; while (!downloadcomplete) { datetime = datetime.now; timespan ts = - start; int min = ts.minutes; int ...

java - Updating a TextView in a ViewPager Fragment -

in android app, i'm having trouble setting textview located in fragment parent activity. using viewpager follows: in main activity's oncreate(): list<fragment> fragments = new vector<fragment>(); fragments.add(fragment.instantiate(this, mainpageprofilefragment.class.getname())); fragments.add(fragment.instantiate(this, mainpageotherfragment.class.getname())); mainpageradapter = new viewpageradapter(this.getsupportfragmentmanager(), fragments); viewpager pager = (viewpager)findviewbyid(r.id.viewpager); pager.setadapter(mainpageradapter); with viewpageradapter: public class viewpageradapter extends fragmentpageradapter{ private list<fragment> fragments; public viewpageradapter(fragmentmanager fm, list<fragment> fragments) { super (fm); this.fragments = fragments; } @override public fragment getitem(int arg0) { return this.fragments.get(arg0); } } and mainpageprofilefragment below. fragment provi...

java - Launching Dialog from non-activity -

Image
i have dialog works, until added code try , launch dialog , crashes dialogfragment.class error. popup.show error occurs. public class processlocation extends dialogfragment { context context; sharedpreferences domaintoname; sharedpreferences nametodomain; sharedpreferences defaults; popupmessage popup; int locationtally; // constructor processlocation(context context) { this.context = context; } public void processlocation(string domain, string name, string password) { domaintoname = context.getsharedpreferences("domaintoname", context.mode_private); //domain name = friendly name nametodomain = context.getsharedpreferences("nametodomain", context.mode_private); //friendly name = domain name/password/acm defaults = context.getsharedpreferences("defaults", context.mode_private); //friendly name = domain name/password/acm string checkname = nametodomain.getstring(name,null); locationtally = default...

osx - Could not symlink share/git-core/contrib /usr/local/share/git-core is not writable -

i've tried , used suggestion repairing, on uninstalling everything, reinstalling, etc. no solution works. i'm stuck , need find solution! in advance, christoph macbook-2:~ myusername$ brew install git warning: git-2.1.3 installed, it's not linked macbook-2:~ myusername$ brew destroy git error: unknown command: destroy macbook-2:~ myusername$ brew uninstall git uninstalling /usr/local/cellar/git/2.1.3... macbook-2:~ myusername$ brew install git ==> downloading https://downloads.sf.net/project/machomebrew/bottles/git- 2.1.3.yosemite.bottle.tar.gz downloaded: /library/caches/homebrew/git-2.1.3.yosemite.bottle.tar.gz ==> pouring git-2.1.3.yosemite.bottle.tar.gz ==> caveats os x keychain credential helper has been installed to: /usr/local/bin/git-credential-osxkeychain 'contrib' directory has been installed to: /usr/local/share/git-core/contrib bash completion has been installed to: /usr/local/etc/bash_completion.d zsh completion has been installe...

java - Get median values from sorted data -

i have set of sorted (ascending) data in format below: | category | value | s.d. | | | 0.1 | 0.1 | | | 0.2 | 0.05 | | | 1.3 | 0.08 | | b | 0.1 | 0.01 | | b | 0.2 | 0.08 | | b | 0.6 | 0.9 | | b | 0.7 | 0.01 | | b | 0.9 | 0.05 | | b | 1.1 | 0.6 | | c | 0.5 | 0.3 | | c | 0.9 | 0.04 | | c | 1.0 | 0.14 | | c | 2.1 | 0.1 | etc... there 300 rows of this. have imported csv , have sorted list . example data.get(1).getcategory() results in "a", , data.get(2).getvalue() results in "0.2" (it string using library.) the data subject change. need calculate median value each category, , print each median value it's category name. there number of entries, middle value smallest s.d. should used. example, using above data: "a: 0.2" "b: 0.7" "c: 0.9" here single pass on sorted list solution: import java.uti...

javascript - Tweening Object3D towards camera in Three.js - this works, need to set new screen position -

i have code tweens object towards camera , fits half screen var vfov = camera.fov * math.pi / 180; var ratio = 2 * math.tan( vfov / 2 ); var screen = ratio * (window.innerwidth * 0.6 / window.innerheight * 0.6) ; var size = getcompoundboundingbox( object ).max.y; var width = getcompoundboundingbox( object ).max.x; var dist = (size/screen) * (object.scale.x * 2); //get final position in front of camera var plocal = new three.vector3( 0, 0, -dist ); //apply direction camera facing var target = plocal.applymatrix4( camera.matrixworld ); //tween object towards camera var tweenmove = new tween.tween(object.position).to(target, 1500).easing(tween.easing.cubic.inout); the next thing need able able move either left or up, other ui on screen , responsive element. i.e. move left 3rd, or top third. needs still square onto camera. i've tried changing plocal value (1, 0, - dist) rotates object when tweens up. any ideas how can...

angularjs - npm gives an error TypeError: Cannot read property '$valid' of undefined at Object.$scope.save -

my angular controller is: myapp.controller('newconsultant', ['$scope', '$http', '$location', function($scope, $http, $location) { $scope.save = function(data) { console.log("assignment data is:" + data); $scope.input = data; if ($scope.assignment.$valid) { $http.post('./ccs/enrollment/save', $scope.input).success(function(data) { $location.path('/ldp/lem/el'); }); } }; }]); my controller spec is: describe('controller: newconsultant', function() { beforeeach(inject(function($controller){ scope={}; $controller('newconsultant',{$scope:scope}); })); it('check save function defined or not',function(){ expect('save').tobedefined(); }); it('check save function defined or not', function() { scope.save(2); expect(scope.input).toe...

c++ - Illegal instruction (core dumped) upon compiling with SSE and -O3 options using latest g++ with a custom alignment allocator implementation -

when using g++ (gcc) 4.8.3 20140911 (red hat 4.8.3-7) compile following piece of code using compiling command "g++ -g -fno-omit-frame-pointer -msse2 -mssse3 -o3 memory.cpp", executable raises "illegal instruction (core dumped)" upon execution. it compiles , runs without problems using same exact compiler flags using older g++ version. compiles , runs without problems when compiler flags "-mssse3 -o3" dropped or replaced lower optimization level such "-o2". if usage both old , newer g++ compiler, having compiler flags "-msse2 -mssse3 -o3", , having portable aligned memory allocator requirement, options exist? there simple mistake in following piece of code fixed? finally, why did error exist? when using gdb, line triggers error is: "memory[i] = (unsigned char)i;". thanks in advance. #include <iostream> using std::cerr; using std::cout; using std::endl; using std::flush; #include <stdlib.h> void *al...

Can I get the python call stack with the linux perf? -

for example, def test(): print "test" i used perf record -g -p $pid , result pyeval_evalframeex . how can real name "test" or if can not using perf? you won't able perf, that's built interface linux process model, decode stack frames, etc. it's doing it's supposed telling executing function pyeval_evalframeex. have extended python-specific information able decode python's frame information, isn't going happen. unfortunately haven't found way debug both python , c/c++ modules easily. it's pdb 1 , gdb other.

php - insert array element into database -

i have function : it's work correctly, function ms_get_did_detail($id) { global $link; $q2="select dest,priority destpr id='$id'"; if($res2=mssql_query($q2)) { while($row2[]=mssql_fetch_array($res2,mssql_assoc)) { return $row2; } return 0; } return 0; } i want insert every element (every dest & priority) mysql if($info=ms_get_did_detail($value)) { print_r($info); $destination = $info['dest']; $priority = $info['priority']; my_did_destination ($priority , $dest , $active , $did_voip , $cc_id); } it returns array : [0]=> array ( [dest] => 100 [priority] => 1 ) [1]=> array ( [dest] => 200 [priority] => 3 ) [2] => ( ) also , have function insert value in database : function my_did_destination($priority="",$destination="") { global $link_voip; $sql=...

c# - how to turn off the single sign on of two mvc application running on the same browser -

i have 2 mvc applications deployed on same server. if run 2 applications on same browser(ie, chrome, firefox,...etc.) , logout out first application, second application logout automatically. i want allow user turn off first application , continue working on second application without signing in again , vice versa any highly appreciated

Not able to configure load balancer for Vm in azure -

i want add traffic manager azure virtual machine.i created total 4 virtual machine .2 in east region , 2 in north europe region.but when want add both 2nd machine in availability set respectively didn't find other machine want add. me configure this availability sets , traffic manager not related subjects in azure. when create 2 virtual machines in each region make sure add them same cloud service. enable load balancing , enforce availability set behaviour across 2 vms. repeat in second region. then use traffic manager route traffic using failover strategy (if appropriate) public interfaces of cloud services. while using web roles might find blog series useful: http://blog.kloud.com.au/2014/11/03/deploy-an-ultra-high-availablity-mvc-web-app-on-microsoft-azure-part-1/

SVG gaussian blur on text under Google Chrome -

Image
i'm trying make text effect drop shadow gaussian blur on svg. under firefox it's good, under chrome it's horrible, can see below. what strange taht when zooming (ctrl + mousewheel) @ max level possible, it's looks good, @ intermediate zooming level, it's still horrible. my code generate example is: <html> <head> </head> <body> <svg width="200px" heigth="200px"> <filter id="dropshadow" height="130%"> <fegaussianblur in="sourcealpha" stddeviation="3" /> <feoffset dx="2" dy="2" result="offsetblur" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <text x="50" y="50" style="filter:url(#dropshadow)">this test</text> </svg> </body>...

php - Symfony custom constraint to Reset Password function form -

i have implemented password reset page project. working, try use best practices , reusable code. here problem. have formtype password reset form , resetting controller. know validating means mapping fields of form type object of class , having validation rules on properties of object. password reset, think using "non mapped" fields required. now, submit form , values in resettingcontroller. there check myself if user email, birthday , security answer exists. working think not implemented right way. possible add custom constraint whole resetformtype , when submitting form, should call constraint checks if user exists. want use symfony validation system, not "if, else , if..." wrote in controller. here code: resetpwformtype: public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('username', null, array( 'label' => 'resetting.request.username', ...

shell - Bash: Directory does not exist -

this question has answer here: echo >&2 “some text” mean in shell scripting 3 answers what little code snippet do? understand test command. question is: >&2 mean? if test ! -d "$1" ; echo "directory not exist" >&2 ; exit 6 fi thanks in advance! it redirects stdout stderr . when do: echo "directory not exist" the message goes standard output(1) . >&2 redirects standard error (2). useful when want capture stdout , stderr separately. for example, if in script my_scr.sh running as: bash my_scr.sh > out_file 2> err_file will ensure errors captured in err_file , other output goes out_file .

sql - Non Equality Join on Hive -

Image
i trying emulate sql query on hive, grab data 2 tables do not have common field. the 2 tables geometric (geohive) , 1 contains bunch of points (one each record) , other 1 grid (one cell each record). objective count how many points fit inside each cell. the join condition between 2 tables geometric function itself. how in postgis: select g.geom, count(t.geom) cnt grid g, points t st_contains(g.geom,t.geom) group g.geom hive not accept multiple select, have perform join. thought work: select count(1) grid join points st_contains(grid.geom,points.geom) group grid.geom; , hive silently ignores condition : "hive not support join conditions not equality conditions difficult express such conditions map/reduce job" anyone has ideas of how refactor such query on hive? i'll answer own question, state query attempt correct: failing other reasons, have nothing syntax. select count(grid.geom) ptcnt grid join points st_contains(grid.geom,points...

java - Compare 2 lists with different objects to find equals object attribute -

i'm looking elegant , efficient way in java: public class object1{ string name; int age; } public class object2{ string name; string adress; } list<object1> list1; list<object2> list2; i want find out every object1 in list1 if there object2 in list2 same name. there better way wrote below? for (object1 element1 : list1) { (object2 element2 : list2) { if (element2.name.equals(element1.name)){ // stuff } } } if implement comparator on names in classes could, sort them. having lists sorted, allow binary search on them. each element in object1, binary search in object2. this make code faster, o(n * m) complexity, o(n * log(m)) complexity.

Displaying a form with fields stored within a ArrayList<Object> using JSF and Primefaces -

i've struggling issue few days now. i need display form. fields of form generated dynamically , stored within arraylist (by object mean instance of class attribute, simple class 2 string fields: label , value). in other words, have no direct , set methods access them. this not problem when involved fields "flat" fields, such text fields, textareas, etc. whole thing gets painful when comes diplaying data selectboxes, or other dynamic fields (since value of fields not updated). i didn't find on www this, each example found uses backingbean fields value of components, , works charm. i've been coding while now, using jsf , primefaces, i've tried add jstl, can't seem on problem. not think posting code necessary @ time (i'm avaiable give further information though), know if had same problem, or if looking @ problem wrong point of view. there accepted approach kind of scenario? update (code): here (simplified) xhtml page (please notice object...

OneDrive - Wrong size for PNG files -

when uploading png files size incorrectly reported on onedrive website , in photo object returned rest api. can reproduced using following png file: http://www2.zippyshare.com/v/11270772/file.html the file size 20.3 kb , onedrive displays 38.4 kb it seems happens png files downsized/converted when downsize_photo_uploads query param absent or set true. problem not limited uploads using rest api. the problem has been been reported here . ryan onedrive here. looked , have understanding of what's going wrong size. onedrive computes "space" file takes in our system using size of largest data stream associated file. when image uploaded onedrive, create thumbnails images can show various views in our clients , website. in case of particular file, 1 of jpg thumbnails create png file larger original file (due jpg compression not being effective png image). result, thumbnail largest stream on file. can imagine, doesn't happen often, image (and others it) ...