Posts

Testing a non-trivial AngularJS app with Jasmine & Karma -

i'm working on non-trivial application, following folder structure: build (required files such angular.js) gruntfile.js karma.conf.js logs/ node_modules/ src/ - app/ - app.js - module_name/ - module.js - controllers/ - controller1.js - controller2.js - views/ - view1.html - assets/ - 1.jpg - styler.css - components/ (plugged in modules [angular-ui, etc]) - index.html my controllers each attached parent module. module required in app.js file. i have tried writing unit tests, seem keep having trouble dependancies, since controller try test requires it's module, module requires one, etc. my question has few parts: how go structuring karma.conf.js file include necessary files? part of configuration: files: [ 'files_to_be_tested.js', ] using jasmine, how write unit test proper dependancies? example, run following test j...

c# - Modify Compiled .Net Exe -

i have application written in c# (without source of course), needs changed little bit. example, need stop few lines of code create unnecessary menu. think should comment them out. the source code not obfuscated. know can decompile, change, , compile again, using tools reflector/reflexil. knows doing this, many parts of code won't compile again! there way in reflector (or other product) part of disabled/changed without process? thanks. you might want try dnspy. .net assembly editor, decompiler, , debugger forked ilspy. https://github.com/0xd4d/dnspy

c# - Inter-Process communication options -

i need subscribe inside 1 app event exposed app. noticed many people consider using of wcf named pipes best practice. right if choose wcf named pipes i'll have use iis? and way, options have in general? named pipes 1 of fastest way ipc (inter-process communication) on same machine. have existed long while (was nt4 first os?) , not specific wcf. i not use wcf/named pipes through asp.net iis not use named pipes it's communication. means app close if iis have not received http requests while. how should host ipc depends on type of application. if want have server running should host in windows service. otherwise include in desktop app. you not have use wcf, can use named pipes directly (look @ link in beginning of message). depends on how complex communication is.

Confusing with a php variable issue -

in below code, after preg_match , $videoinfo['video']['rendering'] equals "progressive". so, expecting final echo output "rendering: progressive scan". however, doesn't. outputs "rendering: progressive" missing obvious here? thanks help! if(preg_match("/^video field order\s+:(.*)$/im",$output,$matches)){ $videoinfo['video']['rendering'] = $matches[1]; if($videoinfo['video']['rendering'] == "progressive"){ $videoinfo['video']['rendering'] = 'progressive scan'; } echo("rendering: " . $videoinfo['video']['rendering']); } you this echo("rendering: " . $videoinfo['video']['rendering']); and outputs "rendering: progressive." that means $videoinfo['video']['rendering'] contains string pr...

java - Result empty on setting projection for Hibernate criteria -

i have join query want put in programs hibernate criteria. select a.accountname,a.username,b.name account , user b a.id=b.accountid , b.name '%abc%' , a.username '%def%' my criteria : criteria usercriteria = session.createcriteria(user.class); detachedcriteria accountcriteria = detachedcriteria.forclass(account.class); accountcriteria .add(restrictions.like("name", "%" + def+ "%")); accountcriteria.setprojection(projections.property("id")); usercriteria.add(property.forname("accountid").in(accountcriteria)); usercriteria.add(restrictions.eq("username", "%" + abc+ "%")); list tmplist = usercriteria.setprojection(projections.rowcount()).list(); usercriteria.setmaxresults(pagesize); result = usercriteria.list(); list tmplist showing empty. can list data before: list tmplist = usercriteria.setprojection(projections.rowcount()).list(); what problem in l...

jquery - How close other element when clicked using .slideToggle -

i'm trying make accordion menu, how ever, need menus open 1. how close other li when clicked? below code use toggling menu. how target other li close when li clicked. <li class="cat_parent"> <h2 class="head par_title">books</h2> <div class="content">01</div> <div class="content">02</div> </li> <li class="cat_parent"> <h2 class="head par_title">magazine</h2> <div class="content">01</div> <div class="content">02</div> <div class="content">03</div> <div class="content">04</div> </li> $(document).ready(function(){ ('.head').click(function(e){ e.preventdefault(); $(this).closest('li').find('.content').slidetoggle(); }); }); your appreciated! try $('.cat_parent').find('div').hi...

authentication - how to configure multiple users to access multiple ressources with different rights? -

i'm working on project i've multiple ressources , multiple users, need associate different access rignts every user depending on ressource wants access to the problem simple ldap server can't implement kind of situation, an idea use multiple ldap servers, 1 each ressource, how manage them all? or there authentication process can use in case? spring security has special acl module handle such situations. basic idea each domain object / ressource may have separate access control list. need fill list appropriate permissions , add corresponding checks in code. can have parent -> child relations between objects reduce number of permissions. check out .