Posts

Showing posts from May, 2012

jquery - Knockout JS - Value of span -

my application mvc5; trying value of knockout span using following: <span id="total" data-bind="text: allimages().length"> </span> i see 10 on screen correct value. tried use: var total = $('.total').text(); alert(total); don't value, tried .val(). edit can value if use function: function getvalue() { var total = $('#total').text(); $('#mytext').val(total); alert(total); } is there way value onchange of span text? you need $('#total') , not $('.total') #total finds element id, correct html span id; .total means classname, , there no div in code class, it's correctly matching no elements.

Testing using a real android device inside a virtual box -

my android project development environment set inside virtual box machine windows vista 32 bit. windows virtual box lies on mac os. i'm trying use android phone test code changes in virtual box. though windows(virtual box) sees phone, recognizes phone usb device. hence device doesn't appear under "other devices" in "device manager". i downloaded device driver samsung usb composite device installation fails "error code 10". tried "google usb driver" system doesn't accept same, saying "your system has installed best device driver - samsung composite device driver". query: is possible connect android device through host machine (mac os) , use testing in virtual box (windows vista 32 bit)? if so, can please shed light on i'm missing configure?

Creating System.Windows.Controls and adding Two Way Binding of a Field to a UserControle in WPF -

what want following create usercontrole this: public partial class myusercontrole : usercontrol with wrappanel inside add controls , stuff to <wrappanel margin="0,0,0,41" name="wrappanel1" /> this class has 2 buttons cancel or apply settings in window. window later gets open this window w = new window(); w.sizetocontent = system.windows.sizetocontent.widthandheight; w.content = myclass.getmyusercontrole(); bool? t = w.showdialog(); where myclass special class creates usercontrole , adds stuff wants changed in wrappanel now in myclass have simple point system.drawing.point mypoint = new point(10,15); and getmyusercontrole() looks like public myusercontrole getmyusercontrole(){ myusercontrole uc = new myusercontrole(); wpf.textbox x1 = new wpf.textbox(); system.windows.data.binding bindingx = new system.windows.data.binding("x"); bindingx.source = mypoint; bindingx.mode = system.win...

javascript - fast way to get value of keyup / keydown event -

i'm using string.fromcharcode(e.keycode) to value of keyup / keydown event. result lags when keeping key down (key sequence). there faster way value of keyup / keydown event ? note; need plain javascript way.thanks in advance fromcharkeycode not idea values of characters, check value of numbers? see you're getting 1, b 2 etc. function checking if returned value correct makes more slower getting last character of input value.

eclipse - PHP Function Parameter types - Simultaneous usage of the contentType and type attributes is not supported -

i new php , battling resolve issue between function parameters of type , contenttype. i have following code {0} i'm trying pass through id function, however, following error returned {1} {0} /** * @path("/getlist") * @param(string, query,'string') * @return(string,'text/plain') */ public function getlist($id) { .... } {1} simultaneous usage of contenttype , type attributes not supported , produce error since type attribute implicitly declares application/json mime type. i've changed following * @param(string,query,'text/plain') * @param(string,query,'string') but change value of parameter, , not type of it. how go in doing that? regards remove brace { . have given 2 braces after method /** * @path("/getlist") * @param(string, query,'string') * @return(string,'text/plain') */ public function getlist($id) { .... }

ubuntu - How Limit memory usage for a single Linux process and not kill the process -

how limit memory usage single linux process , not kill process. i know ulimit can limit memory usage, if exceed limit, kill process. is there other command or shell can limit memory usage , not kill process? another way besides setrlimit , can set using ulimit utility: $ ulimit -sv 500000 # set ~500 mb limit is use linux's control groups , because limits process's (or group of processes') allocation of physical memory distinctly virtual memory. example: $ cgcreate -g memory:/mygroup $ echo $(( 500 * 1024 * 1024 )) > /sys/fs/cgroup/memory/mygroup/memory.limit_in_bytes $ echo $(( 5000 * 1024 * 1024 )) > /sys/fs/cgroup/memory/mygroupmemory.memsw.limit_in_bytes will create control group named "mygroup", cap set of processes run under mygroup 500 mb of physical memory , 5000 mb of swap. run process under control group: $ cgexec -g memory:mygroup command note: can understand setrlimit limit virtual memory, althoug...

javascript - How to get all rows from the table except header row? -

Image
i have table created dynamically in javascript. i have table: here way how rows table above: var trows = table.rows; this way rows table above including header row. question there way rows table except header row? put rows inside <tbody> , put header inside <thead> do var trows = document.getelementbyid('tableid').getelementsbytagname('tbody')[0].rows;

How to install, load CUDA driver and set Matlab to do GPU processing on my Apple Macbook Pro Retina running OS X 10.10 Yosemite? -

i use parallel computing function using gpu. tried use gpuarray function have got following error message: there problem cuda driver or gpu device. sure have supported gpu , latest driver installed. caused by: the cuda driver not loaded. the library name used '/usr/local/cuda/lib/libcuda.dylib'. the error was: dlopen(/usr/local/cuda/lib/libcuda.dylib, 10): image not found therefore know how install, load cuda driver , set matlab gpu processing on apple macbook pro retina running os x 10.10 yosemite ? my gpu nvidia geforce 750m. macbook pro retina (15") late 2013 generation. i'm running matlab 2014b thank , support, best, adrien edit: thank robert c., followed these instructions , matlab gpu seems work fine :) i succeeded following instructions in cuda getting started guide mac os robert.

javascript - White space and background moves -

there faq on website school project created javascript animations. the problem is: 1; background moves when 2 or more faqs opened. 2; there white space beneath background. the faq on website (click image) the javascript var main = function() { $('.article').click(function() { $('.article').removeclass('current'); $('.description').hide(); $(this).addclass('current'); $(this).children('.description').show(); }); $(document).keypress(function(event) { if(event.which === 111) { $('.current').children('.description').toggle(); } else if(event.which === 110) { var currentarticle = $('.current'); var nextarticle = currentarticle.next(); currentarticle.removeclass('current'); nextarticle.addclass('current'); } }); }; $(document).ready(main); the css body { background: url('http://s3.amazonaws.com/co...

c - NULL pointer comparison to zero segfaults -

so, have piece of c code: 226 if (!pair) 227 return; 228 if (!pair->index) 229 free(pair->index); i running through non-null 'pair' pointer has null (0) member 'index'. works wonderfully, 1 might expect. on other hand, this 226 if (!pair) 227 return; 228 if (pair->index!=null) 229 free(pair->index); generates segmentation fault (on line 228, if is). seems weird, since 2 should identical, right? (the second makes more sense me first, that's why used in first place) i fine using negative expression works, want understand why second segfaults. ideas? :) (i building gcc (debian 4.7.2-5) 4.7.2 ) thanks! first thing note, standard c has null check built free ought not check again yourself. in first snippet, line if (!pair->index) free(pair->index); benign due typo: free called if pair->index null, , free pass on i've said. have errant ! in if statement. program unl...

php - Key/Value Search in Multidimensional Array -

in building out google feed, needing way return key in multidimensional array age groups based on sizes: $sizearray = array("newborn" => "0-3m", "infant" => array("3-6m", "6-12m"), "toddler" => array("12-18m", "18-24m", "2t", "3t", "4t", "5"), "kids" => array("6", "7", "8") ); i'm hoping similar this: findkey("18-24m", $sizearray); which return: toddler if there better way this, i'm ears. in advance! you can this: $sizearray = array("newborn" => "0-3m", "infant" => array("3-6m", "6-12m"), "toddler" => array("12-18m", "18-24m", "2t", "3t", "4t", ...

python - mocking subprocess Process terminate -

i couldn't find question one. i'm having difficulty understanding how mock out returned value of subprocess.popen can validate terminate called when try stop it. server.py class looks this: import os import subprocess class server(object): def start(self): devnull = open(os.devnull, 'w') self.proc = subprocess.popen(['python', '-c', 'import time; time.sleep(10);print "this message should not appear"'], stdout=devnull, stderr=devnull) def stop(self): if self.proc: self.proc.terminate() my test class looks this. want know terminate called when stop called when run test nose says terminate called 0 times. understanding of patch replaces implementation of subprocess.popen , available methods. from unittest import testcase server import server mock import patch, magicmock, mock class servertest(testcase): @patch("subprocess.popen") @patch('__builtin__.open')...

ios - put CLLocationCoordinate2D into CLLocation for Swift -

i have method want call when center of map, in cllocationcoordinate2d type. how put results of cllocationcoordinate2d cllocation? figured out. when mapview changes region, lat , lon cllocationcoordinate2d , create cllocation variable lat , lon passed in. func mapview(mapview: mkmapview!, regiondidchangeanimated animated: bool){ var centre = mapview.centercoordinate cllocationcoordinate2d var getlat: cllocationdegrees = centre.latitude var getlon: cllocationdegrees = centre.longitude var getmovedmapcenter: cllocation = cllocation(latitude: getlat, longitude: getlon) self.lastlocation = getmovedmapcenter self.fetchcafesaroundlocation(getmovedmapcenter) }

jquery - Adjusting image description bar of resizable image with CSS -

i need responsive image resizes maximum of given area. works fine code below. need show description of image @ bottom of image. want description bar fill bottom of image , animated bottom when hover on image. i'm adding picture of want achieve better understanding. think placing , sizing of description bar should possible using html , css don't know how. goal description i suppose animation of description bar need use javascript animation great if knew solution css animation transform trick. html, body { width: 100%; height: 100%; } img { max-width: 100%; max-height: 100%; } .description { border: #093 medium solid; width: 100%; height: 40px; overflow: hidden; position: absolute; bottom: 0px; } .imagecontainer { height: 100%; width: 100%; position: relative; } <div class="imagecontainer"> <img src=".."> <div class="description"> inserted description ...

java - How adjust tolerance level for OpenCV detection false positives? -

i'm developing system using opencv, detects objects haarcascades xml files. however, there many false detections. there way minimize false detections? part of code: private void detecta(string arquivo) { cascadeclassifier bodydetector = new cascadeclassifier(path+arquivo); matofrect facedetections = new matofrect(); bodydetector.detectmultiscale(webcam_image, facedetections); // bodydetector.detectmultiscale(webcam_image, facedetections); (rect rect : facedetections.toarray()) { core.rectangle(webcam_image, new point(rect.x, rect.y), new point(rect.x + rect.width, rect.y + rect.height), new scalar(0, 255, 0));// mat2buf, mat2buf); } if (facedetections.toarray().length == 0) { toc.getlblsaida().settext(""); } else { //java.awt.toolkit.getdefaulttoolkit().beep(); toc.getlblsaida().settext(+facedetections.toarray().length + "objetos detectados"); try { playsound(); } catch (ioexcepti...

How to enable/disable components in XForms or XSLTForms? -

i want know if there "right way" enable/ disable controls; triggers. in this wiki-book authors suggests delete control, need visible not working (and style looking disabled): <xf:trigger ref="self::node()[count(../name) &gt; 1]"> <xf:label>delete classifier</xf:label> <xf:delete ev:event="domactivate" nodeset="instance('save-data')/name" at="index('name-repeat')"/> </xf:trigger> i looking everywhere coudn't find anything. idea? in advance, i can't guarantee working every xforms implementation, way implemented in our xforms developments : 1- bind trigger element in instance. 2- define binding element relevant property. when binding non relevant, trigger not displayed. this working orbeon 6.2.

Compass & Autoprefixer Gem install -

using guide, still unable install auto-prefixer using gem compass: https://github.com/postcss/autoprefixer#compass gem install autoprefixer-rails , add post-compile hook config.rb: require 'autoprefixer-rails' on_stylesheet_saved |file| css = file.read(file) file.open(file, 'w') |io| io << autoprefixerrails.process(css) end end does matter directory in when type 'gem install autoprefixer-rails? should in directory call 'compass watch'? i added function config.rb compass still not compiling autoprefixer. try in config.rb project file: require 'autoprefixer-rails' on_stylesheet_saved |file| css = file.read(file) map = file + '.map' if file.exists? map result = autoprefixerrails.process(css, from: file, to: file, map: { prev: file.read(map), inline: false }) file.open(file, 'w') { |io| io << result.css } file.open(map, 'w') { |io| io <<...

python - Flatten dictionaries of list? -

using python 2.6.5, trying flatten lists attach each dictionary key , put them 1 list if possible 1 unique set. tried 2 different functions , not sure need do. the problem i'm having it's not returning list of values list of keys. for example: dict = {'alpha': [[], ['dg1']], 'beta': [[], ['dg2'], ['dg3'], ['dg4'], ['dg1']], 'charlie': [[], ['dg1']], 'delta': [[], ['dg4']]} new_list = flatten(dict) results in [alpha,beta,charile,delta] , want [dg1,dg2,dg3,dg4] . what havve tried: def flatten(a): b = [] c in a: if isinstance(c, list) , any(isinstance(i, list) in c): b.extend(flatten(c)) else: b.append(c) return b def flatten_list(lst): """ utility flatten list of list. if outer list not list or none, returns original object. return none none. """ i...

php - Importing 500 000 categories with Nested set Model with left and right. -

i have 500 000 categories below mysql table structure create table nested_category ( category_id int auto_increment primary key, name varchar(20) not null, lft int not null, rgt int not null ); here how following left , right http://mikehillyer.com/media//numbered_tree.png i have table getting row data has below structure. create table if not exists tbl_categories ( id int(111) not null, category_id int(111) not null, category_path varchar(255) not null, category_name varchar(255) not null, status int(1) not null, tdate datetime not null ) engine=myisam auto_increment=498013 default charset=latin1; which has data this id category_id category_path category_name status tdate 1 381773 top/arts arts 0 2014-10-07 11:11:05 2 423945 top/arts/animation animation 0 2014-10-07 11:11:21 3 425085 top/arts/animation/anime anime 0 2014-10-07 11:1...

What is the LibGit2Sharp equivalent of 'git checkout --ours'? -

when having content conflict when merging 2 branches, solution we'd adopt take our files or files instead of using merge tool. in git command, can use --ours , theirs git checkout --ours -- git checkout --theirs -- does know libgit2sharp equivalent of it? when having content conflict when merging 2 branches, solution we'd adopt take our files or files instead of using merge tool. know libgit2sharp equivalent of it? the merge() method accepts mergeoptions parameter exposes fileconflictstrategy get/setter. see test shows how leverage it. in git command, can use --ours , theirs git checkout --ours -- git checkout --theirs -- surprisingly, although option available cherrypick , merge , revert , not available yet in libgit2sharp checkout() method. to purpose up-for-grabs feature request #868 has been created.

javascript - Include HTML as part of a JSON object -

i need include html , javascript value string member in json object. has got js code handy necessary escaping html can included? alternatively convert base64 still need escaping. so if has got js escape html (which may contain javascript) escaped, appreciative. no point rolling own if there out there already. { "my_object": { "html": "<<div class=\"ad_box\"><img class=\"banner\" src=\"some_ad.png\"\/><h3>&quot;hot&quot; items<ul \/><\/div>", "item_id": 1234, "click_action":"/logaction?id=1234&type=click&info=blah", "icon":"http://my.images.com/icons/icon.png" } } this question seems consequence of confusion appearing in "json object" expression. there 2 different concepts : javascript object json string there's nothing can legitimately called "json ob...

html - Height of a DIV-container -

i've got problem div-containers. .inner-teaser { width: 100%; max-width: 1000px; margin: 0 auto; padding: 20px; } .bg-blue { background: blue; } .teaser-image { background-position: center; background-size: 350px; width: 250px; height: 250px; border-radius: 150px; } .image-left { float: left; margin-right: 50px; } <div class="outer-teaser bg-blue"> <div class="inner-teaser"> <div class="teaser-image image-left" style="background-image: url(http://lorempixel.com/output/abstract-q-c-640-480-5.jpg);">image</div> <div class="teaser-text">lorem ipsum dolor...</div> </div> </div> the inner-teaser should have height teaser-image (250px) + 20px padding. inner-teaser has height of 40px (2 * 20px padding). add overflow: hidden .inner-teaser force take floating-childre...

jquery - QUERY versus PHP -

i trying understand medium use fetch data mysql database using php. what better "speed" wise, jquery or php fetch data form mysql on page load? with jquery alone can't fetch data mysql. if question load page or data php after loading, can say, loading page better, because text standing on page when load , jquery have delay display data. $.ajax({url: 'ajax.php', success: function(data){$('#name').text(data.name)}});

Could not find method include() for arguments [:app] on root project Android Studio -

i trying import android project android studio,after importing , clicking on green run button : failure: build failed exception. where: build file '/home/myusername/prjcts/nomadx/settings.gradle' line: 1 what went wrong: problem occurred evaluating root project 'nomadx'. could not find method include() arguments [:app] on root project 'nomadx'. the content of file settings.gradle include ':app' i solved problem ; have same issue : should build gradle terminal/console not android studio : ./gradlew assemblerelease

java - Using a common buffer to read from inputstream and to write to outputstream -

Image
i read network socket's input stream buffer count = input.read(buffer) then in next line, i'm printing read contents using str = new string(buffer,0,count); log.e("str",str); then try write pipedoutputstream of pipedinputstream pipedoutputstream .write(buffer); where, pipedoutputstream = new pipedoutputstream(pipedinputstream) the problem thread blocking @ pipedoutputstream .write(buffer); below confirm that, taken thread debugging tool of ddms, @ java.lang.object.wait(native method) @ java.lang.object.wait(object.java:401) @ java.io.pipedinputstream.receive(pipedinputstream.java:394) @ java.io.pipedoutputstream.write(pipedoutputstream.java:176) @ java.io.outputstream.write(outputstream.java:106) @ java.io.pipedoutputstream.write(pipedoutputstream.java:147) @ java.io.outputstream.write(outputstream.java:82) @ com.example.receiver.run(drcreceiver.java:104) can 1 tell me, why following not working( blocki...

r - Remove white space from levelplot plotting Google map -

Image
i'm trying rid of white space produced levelplot in rastervis package. i'm using dismo package google map, using levelplot plot it. however, there thin strip of white around map. how remove white space? library(dismo) library(rastervis) g_map = gmap(extent(c(-79,-58,36,50)),type="satellite",zoom=7,lonlat=true,scale=1) g_map_lv = levelplot(g_map,maxpixel=ncell(g_map),col.regions=g_map@legend@colortable,at=0:255,panel=panel.levelplot.raster,interpolate=true,colorkey=false,margin=false,scales="sliced") the outer rows , columns of g_map object na . example: g_map[1,1] you can remove them trim before plotting: g_map <- trim(g_map)

javascript - How can I retrieve HTTP status codes using Angular's $q promises? -

i have within code makes $http.post end, , of course things can go wrong. if use below syntax within angular: $http.post(url).success(function(data, status, headers, config)) .error(function(data, status, headers, config)); if there error, can retrieve error code using status , handle within function defined in error() . however, if instead take approach (which 1 in fact using): var deferred = $q.defer(); $http.post(url).success(deferred.resolve).error(deferred.reject); return deferred.promise; with second syntax, have of ajax calls within separate servicejs directory, , can handle successes or errors on case case basis. instance, if second snippet service.myfunction() in code need would: service.myfunction().then(function() {}, function(data, status, headers, config) {}); however, if use code block, status , headers , config undefined. question how can retain syntax still retrieve error code? as added reference, end c# web api project, return errors usin...

Highlighting text to speech in c# windows form -

how highlight text while speaking in c# windows form? tried : public void highlightwordinrichtextbox(system.windows.forms.richtextbox richtextbox,string word, solidcolorbrush color) { //clear formatings //system.windows.controls.richtextbox rt= (system.windows.controls.richtextbox.ichtextbox; textrange textrange = new textrange(richtextbox.selectionstart, richtextbox.document.contentend); textrange.applypropertyvalue(textelement.backgroundproperty, null); //current word @ pointer textrange tr = findwordfromposition(textpointer,word); if (!object.equals(tr, null)) { //set pointer end of "word" textpointer = tr.end; //apply highlight color tr.applypropertyvalue(textelement.backgroundproperty, color); } } public textrange findwordfromposition(textpointer position, string word) { while (position != null) { if (position.getpointercontext(logicaldirection.forward) == textpointercontext.text)...

android - Unfortunately button has stopped-search dialog? -

this question has answer here: runtimeexception: content must have listview id attribute 'android.r.id.list' 7 answers i follow tutorial search dialog ( http://devmobapps.blogspot.com/2011/10/using-android-search-dialog-part-3.html ). in eclipse there no red errors, when try run application unfortunately button has stopped. logcat 11-12 23:31:26.499: d/androidruntime(668): checkjni on 11-12 23:31:26.573: d/dalvikvm(668): trying load lib libjavacore.so 0x0 11-12 23:31:26.593: d/dalvikvm(668): added shared lib libjavacore.so 0x0 11-12 23:31:26.663: d/dalvikvm(668): trying load lib libnativehelper.so 0x0 11-12 23:31:26.663: d/dalvikvm(668): added shared lib libnativehelper.so 0x0 11-12 23:31:27.772: d/androidruntime(668): calling main entry com.android.commands.am.am 11-12 23:31:27.823: i/activitymanager(150): start {act=android.intent.action.main cat=[a...

jquery code I am unable to understand -

the following piece of code https://github.com/tsi/inlinedisqussions/blob/master/inlinedisqussions.js what piece of code doing please? i'd appreciate plain english translation. student here. // hide discussion. $('html').click(function(event) { if($(event.target).parents('#disqussions_wrapper, .main-disqussion-link-wrp').length === 0) { hidedisqussion(); } }); what code register mouse button click event on whole of page. if clicks on page, function called. function passed event (which click event). within event there property called "target" html element clicked. ask if clicked element has parent ancestor element either element "id" of "disqussion_wrapper" or has class of "main-disquission-link-wrp". if neither of these true, call function called hidedisqussion().

scope - Mechanics Fortran Preprocessor -

i happened come across preprocessing option fortran compilers support these days (as explained e.g. in fortran wiki ) . coming c background, better understand mechanics , caveats related (fortran-)preprocessor's #include directive. to avoid confusion right beginning: there 2 include directives in fortran (see e.g. f77 reference ) include "foo" compiler directive, i.e. foo can contain fortran statements #include "bar" preprocessor directive, i.e. bar can contain #defines , like i aware of difference , interested in second case (my question therefore not duplicate of this post ). i'll explain questions using example: assume have 2 files, header file (macro.h) , source file (display.f): macro.h #define msg() say_hello() display.f #include "macro.h" program display call msg() call another_message() end subroutine say_hello() write(*,*) 'hello.' end subroutine another_message() c...

c# - Listbox cannot display in WP8 Emulator -

it's wired. i'm developing wp8 app. xaml code is: <phone:phoneapplicationpage x:class="wptestservice4dotnet.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:microsoft.phone.controls;assembly=microsoft.phone" xmlns:shell="clr-namespace:microsoft.phone.shell;assembly=microsoft.phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" fontfamily="{staticresource phonefontfamilynormal}" fontsize="{staticresource phonefontsizenormal}" foreground="{staticresource phoneforegroundbrush}" supportedorientations="portrait" orientation="portrait" shell:systemtray.isvisible="true"> ...

smartcard - EMV Smart Card TLV Format Error? -

i developing smartcard reader reading emv cards. working on mastercard card, , trying read specific record. result showed reading fine, when parse results, not seem follow tlv standard, results come in tag/template-length-value format. sample of results returned is: 70 - read record response tag 81 - should indicate length e0 - should tag/template...? 8f -should indicate length of prev. tag...? 01 05 9f 32 ... 90 00 problem first few bytes. first byte indicates read record template, second byte should indicate length, , third should value, beginning of next tag. there no emv tag labelled e0, translating results wrongly or there missing. have read previous record using same command , results came out fine: 70 - tag 27 61 - tag/template indicator e.t.c. 25 4f 07 ... 90 00 what doing wrong? or how these results translated? the length here coded in ber format. means 81 indicates there 1 length byte following (only lengths upto 7f can coded directly in 1 byte), e0 length , ...

C++ Allocate dynamic array inside a function -

so need allocate array of int inside function. array declared before calling function (i need use array outside function) , size determined inside function. possible ? have been trying lot of thing nothing worked far. thanks guys ! here code : void fillarray(int *array) { int size = ...//calculate size here allocate(array, size); //.... } void alloc(int * &p, int size) { p = new int[size]; } int main() { //do stuff here int *array = null; fillarray(array); // stuff filled array } if have understood correctly did not declare array before calling function. seems declared pointer int instead of array. otherwise if indeed declared array may not change size , allocate memory in function. there @ least 3 approaches task. first 1 looks like int *f() { size_t n = 10; int *p = new int[n]; return p; } and functionn called like int *p = f(); the other approach declare parameter of function having type of pointer pointer int. example ...

Kohana Route setup for different actions -

i have route (kohana 3.3) route::set('project', 'project(/<action>(/<id>(/<idfile>)))') now possible querys this localhost/kohana/project/edit/16 localhost/kohana/project/list/ i want use pagination on action list - need change "id" "page" in route on action do should use regulars or theres stock approach ? solved next route route::set('project', 'project(/<action>(/page/<page>)(/<id>(/<idfile>)))')

android - Where does the NDK look for libraries? -

suppose want compile ndk c++ function in body calls function in library (like stl, etc). how tell ndk in pc library when compiling c++ function ndk make jump when function in library called ? you have specify libraries in android.mk file. for standard library, have specify in application.mk 1 want use, i.e.: app_stl=gnustl_shared for gcc standard library. for other libraries, have put in android.mk file library want use, , tell ndk build them if necessary. for build library, put include $(clear_vars) local_module=<give name lib want link> local_export_c_includes=<path lib include directory> local_src_file=<path library binary file> include $(prebuilt_shared_library) #or static if lib static for library must build, put include $(clear_vars) local_module=<give name lib want link> local_src_file=<list files necessary build lib> local_export_c_includes=<path lib include directory> include $(build_shared_library) #or s...

reporting services - SSRS personal paper size issue -

i have label meassures heigth = 8cm width = 10cm and need print in portrait mode , problem report builder allways change landscape mode how can force report builder accept meassures without changhing orientation? a page has top edge longer left edge landscape; longer left edge top edge portrait - that's way definition. what want rotate output of table when peel off label, text on oriented if portrait. given on 2008 r2 can set table cell's writingmode property rotate270 . you'll need resize cell dimensions accommodate text , have data in columns rather rows. detail row 8cm high , 10cm wide number of thin, high columns data text rotated 270 degrees. ensure report project's targetserverversion property set sql server 2008 r2 or won't support rotate270 option. should give result after. failing this, create table single detail cell size of label, place image in cell fill , draw text on image in orientation want using custom code. here example...