Posts

integer - JAVA: [-255...255] int to 2 bytes array -

i have integer can contains values between - 255 , 255. know can represented 2 bytes (i'm right?) how can convert int 2 bytes array? many rather store in 2 distinct bytes , implement own custom encoding , decoding, easiest store these values in short . 16 bit signed integer sufficient range values.

Apply a function multiple times in Haskell -

this question has answer here: how call same function 'n' times? [duplicate] 4 answers library function compose function n times 8 answers learn haskell great good (section "higher order functions", subsection "some higher-orderism in order" ) describes example function applytwice calls function on argument twice: applytwice :: (a -> a) -> -> applytwice f x = f (f x) but need function applies function on argument arbitrary amount of times. example applyn 3 f x equivalent f $ f $ f x . how write function of repeated application in haskell? please post possible solutions, using recursion, higher-order functions or else. i did iterate f x !! n .

debugging - Is there a Python 3.x debugger for embedded interpreter? -

i've embedded python in c++ application. there graphical debugger can attach debug scrips run in embedded console python 3.4? previously (when using python 2.7) i've used winpdb , attached debugger with import rpdb2; rpdb2.start_embedded_debugger(password) but winpdb doesn't work wxpython phoenix needed python 3.x. i must load debugger inside embedded interpreter since lot of modules available there, scripts can't run outside environment. what alternatives there winpdb embedded debugging gui? or there updated version of winpdb works wxpython phoenix? thanks! you can use ptvs (python tools visual studio) or pydev on eclipse remote debugging.

jquery - Adding scripts in MVC -

i starting first mvc application. here have basic confusion. default _layout.cshtml file created below <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@viewbag.title</title> @styles.render("~/content/css") @scripts.render("~/bundles/modernizr") </head> <body> <script> </script> @renderbody() @scripts.render("~/bundles/jquery") @rendersection("scripts", required: false) </body> </html> i used basic template not have template. check '@scripts.render("~/bundles/jquery")' line. after @renderbody(). adds after body section. i think best practice. if add $.(document).ready shows following error microsoft jscript runtime error: '$' undefined based on error, because of script tag. moved '@script...

rest - SoapUI WADL authentication -

in order view wadl file server in internet browser it's necessary authenticate. test webservices using soapui when add new project , in initial wadl/wsdl enter path wadl file on server project created operations not listed. how authenticate user , password in order valid wadl? if using soapui version 4.6.4, there bug importing authentication protected wsdl provokes basic credentials prompt not showed up. can see more details here . there maintenance build soapui pro bug solved: http://www.soapui.org/downloads/soapui-pro-nightly-builds.html .

Update destination directory with new files (if modified) using ant -

i'm facing problem ant "copy". here requirement: want sync 2 dirs(dir1 , dir2) want keep files/dirs present in dir2. aim want copy dir1 contents(if modified ) dir2 want keep additional files/dirs present in dir2. i tried ant's sync task, trying keep both dirs in sync ie., deleting contents present in dir2. don't find flag disable feature: <sync todir="dir2" failonerror="true" verbose="true"> <fileset dir="dir1" excludes="*.svn" /> </sync> i tried ant's copy "modified" selector, doing same: :( <copy todir="dir2" failonerror="true"> <fileset dir="dir1" excludes="*.svn" > <modified/> <!-- copies modified files --> </fileset> can 1 suggest, how can achieve requirement ant? by default, ant copy task not overwrite files: <copy t...

html - How to pointing skrollr-menu from other site? -

i have 2 sites: main-site , blog site. both of them have same navigation. main-site parallax site using skrollr , skrollr-menu. blog, used wordpress. the code in main-site navigation , related div : <ul> <li> <a href="#about" data-menu-top="2114">about us</a> <ul class="clearfix"> <li><a href="#lin" data-menu-top="2334">lin</a></li> <li><a href="#young" data-menu-top="5080">young</a></li> </ul> </li> </ul> <div class="clearfix" id="about scroll-3"> <div class="about-us"> <h2 data-500-top="opacity:1;" data-anchor-target="#scroll-3 .about-us h2" data-top="opacity: 1">about us</h2> <div class="col-3" data-436-top="opacity:0;top:-100px...