Posts

Showing posts from April, 2010

Wicket page is refreshed if use ajax after form is submitted with target=_blank -

i have preview button. when user press preview, form submitted on new tab show pdf file have data in form. use custom submitlink submitresourcelink public abstract class submitresourcelink extends submitlink implements iresourcelistener { private final iresource resource; @override public final void onresourcerequested() { attributes = new attributes(requestcycle.get().getrequest(), requestcycle.get().getresponse(), null); resource.respond(a); } implement on form new submitresourcelink("previewbtn", form, new jasperreportsresource() { private static final long serialversionuid = -2596569027102924489l; @override public byte[] getdata(attributes attributes) { return control.getexportpreviewbytestream(estimatemodel.getobject()); } }) { private static final long serialversionuid = 1l; @override protected string gettriggerjavascript() { string js = super.gettriggerjavascript();...

javascript - Parse Uncaught TypeError: Cannot read property 'get' of undefined -

this code: var images = new parse.query("images"); var bunny_data = []; images.equalto("indeximg","t"); images.find({ success: function(objects) { for(var = 0;i<=objects.length;i++){ var object = objects[i]; object.get('imgurl'); }; }, error: function(error) { console.log("an error occured :("); } }); console.log(bunny_data); the console is: [] myjs.js:65 uncaught typeerror: cannot read property 'get' of undefined for(var = 0;i<=objects.length;i++){ the <= means loops 0 objects.length inclusive, length exclusive upper bound on array’s indices. use < instead.

vim - Fortran Error fmt: read unexpected error. Possible Hidden Characters? -

i running fortran code, compiling using g77 version 3.4.0 on mac osx 10.9.4. running following error in code: fmt: read unexpected character apparent state: unit 4 named p_resids_inversion last format: (6(i3,x,f7.2,x,i2,x)) lately reading sequential formatted external io i understand error must have formatting of input requires (6(i3,x,f7.2,x,i2,x)) format. have located formatting in script, , have checked input. above formatting corresponds following lines of sample data: 27 -0.23 1 26 -0.03 1 28 0.52 1 17 1.09 1 29 0.07 1 25 0.14 1 30 0.09 1 24 -0.13 1 4 -0.01 1 35 -0.48 1 23 -0.28 1 22 -0.08 1 21 -0.66 1 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 i have compared input file input file work fortran code no issues formatting -- i've checked spacing many times , found no discrepancies. here hypothesis why error occurring, though spacing correct: i created input...

sonarqube - Sonar Runner default logging level -

is possible change default logging level of sonar runner info warn or similar? our nightly sonarqube analysis blowing team city logs out huge amounts of entries. according source, logging standard slf4j when i've tried reconfigure it, doesn't work. according docs, least verbose level supported info; can overridden? http://docs.sonarqube.org/display/sonar/server+log+management thanks m short answer no refer: reduce log level in sonar 2.1.x but other if see logging of other sonar plugins might, may have log level set warn.

Bootstrap Navigation Active Not Working For Links -

i used navigation bar bootstrap template, , template one-page layout navigation sliding down rather linking different page. i tried changing links link different pages, when active class not work stuck on new page without knowing page on (unless read content) because navigation doesn't tell you. the active class works when link "#services" example, scrolls down , active class works, when put such "index.php" or "index.html", active class no longer work. anyone know how can fix this? this navigation bar html: <nav id="mainnav" class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- brand , toggle grouped better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"...

mysql - Selecting many items, which themselves have many items, in a single query? -

i have database representing book collection. looks this: books table id | title | year | author_id -------------------------------------------------------- 1 how read 1985 7 2 dream of spring 2041 14 3 tour guide 2010 40 tags table id | tagname ------------------- 1 nonfiction 2 fiction 3 poetry 4 sci-fi 5 magical realism 6 detective books_tags_links table book | tag ------------------ 8 4 10 1 10 4 10 5 8 2 there one-to-many relationship between books , tags: book can have multiple tags, 'fiction, detective, sci-fi'. what i'd know is: possible me select books, and tags associated each book, in single query? don't know result -- jagged array, suppose, each book having different number of tags? my ultimate aim output html table each r...

ruby - How do I write Slim helpers in Sinatra? -

i'm using sinatra , slim. i'm trying work out how write helper slim can dry-up templates. (in case helper small , away in-line ruby, in future more complex things). i have following helper (expanded debugging) in file lib/slim_helpers.rb: module slimhelpers # foo converts strings 'aws::autoscaling::autoscalinggroup' # 'auto scaling group' def foo(input, &block) last = input.split('::')[-1] result = last.gsub(/([a-z])/, ' \1').lstrip puts "result: #{result}" yield result end end i have following (simplified) sinatra app: require 'sinatra/base' require 'slim' require_relative 'lib/slim_helpers.rb' class sinatraapp < sinatra::base include slimhelpers '/' puts '==> in /' @result = bar.bar('dev') slim :qux end end in template, have following piece of code: - result.resources.each |r| div class="list-group" ...

tomcat - Simple Websocket Client in Java - Connection issue -

i'm trying write simple websocket client in java connect 3rd party websocket server (i have no access server). i can connect , communicate websocket server using javascript in browser, when try , same thing using java client fails connect. with same java client can connect tomcat websocket server have running, think it's sort of compatibility issue between client , server. (i'm using tomcat 7.0.56 libraries websocket client). this error get... error javax.websocket.deploymentexception: http request initiate websocket connection failed @ org.apache.tomcat.websocket.wswebsocketcontainer.connecttoserver(wswebsocketcontainer.java:344) @ org.apache.tomcat.websocket.wswebsocketcontainer.connecttoserver(wswebsocketcontainer.java:166) @ com.cvr.instant.ws.websocketclient.connect(websocketclient.java:44) @ com.cvr.instant.ws.testws.start(testws.java:17) @ com.cvr.instant.ws.testws.main(testws.java:37) caused by: java.io.eofexception @ org.apach...

html - get background image or text to fill width, not repeat, but not stretch vertically -

just title says. how can background image, or text fill width wise, not stretch/squash vertically, , show once? can't seem figure out. thank you. edit: want height scale width of picture proportionally, not skewed scaled width. if want background img fill width without taking account height can do: .element-with-back-img{ background-repeat: no-repeat; background-size: 100%; } but img doesn't fill height of element-with-back-img because height set "auto" by doing this: .element-with-back-img{ background-repeat: no-repeat; background-size: 100% 100%; } the img fills height if element-with-back-img has different proportions img, 1 change proportions fill element-with-back-img i recommend u to: .element-with-back-img{ background-repeat: no-repeat; background-size: cover; } this scale background image large possible background area covered background image. parts of background image may not in view within background...

c++ - Convert CWnd* to myControl* -

i trying convert cwnd* pointer custom control pointer. custom control extends cedit . below have. pwnd passed in. cwnd* . caledit* test = (caledit*)pwnd->getdlgitem(pwnd->getdlgctrlid()); when try debug , see value of test is, none of members can evaluated. cwnd* not problem. to sure cwnd* pointing control want, did pwnd->getdlgctrlid() , , id matches expected control. try use cedit *pedit = dynamic_cast<cedit*>(pwnd)

Php PDO OCI Driver installation using pecl -

i'm trying install pdo driver oci. when searching google pdo_oci find following url: https://pecl.php.net/package/pdo_oci it displays message @ top of page: this package not maintained anymore , has been superseded. package has moved channel http://www.php.net/pdo_oci , package ext/pdo_oci. what message mean, how add channel using pecl? i've attempted add channel using pear channel-discover php.net/pdo_oci , doesn't seem work. can't find channel.xml file php.net/pdo_oci try pear channel-add channel.xml . edit if have php installed (from repository example), can compile pdo_oci php source (you need instantclient installed) download php source same version have installed; unzip; change directory php-your-version/ext/pdo_oci inside pdo_oci folder, run these commands: $ phpize $ ./configure --with-pdo-oci=instantclient,/usr,12.1 $ make && make install $ echo "extension=pdo_oci.so" > /etc/php.d/pdo...

500 Error: Failed to establish a backside connection deploying from DevOps Services to Bluemix -

i deploying application devops services bluemix. got 500 error: failed establish backside connection deployment. i've never gotten error before. log button on devops services runbar grayed out, i'm not sure on devops services side more information. application created in bluemix, when try in logs on bluemix side, there no logs since application isn't started, i'm not sure how debug on bluemix side. the application forked alchemyapplication. uses python buildpack. project owner told me got deploy work. seeing recent commits, possible there changes went in since broke this. on begin looking debug appreciated. by chance , application has database dependency ? faced issue database instance not valid , front end application throw error of "failed establish backside connection"

DMA PCIe read transfer from PC to FPGA -

i'm trying dma transfer working between fpga , x86_64 linux machine. on pc side i'm doing initialization: //driver probe ... pci_set_master(dev); //set endpoint master result = pci_set_dma_mask(dev, 0xffffffffffffffff); //set 64bit capable ... //read pagepointer = __get_free_page(__gfp_highmem); //get 1 page temp_addr = dma_map_page(&mypcidev->dev,pagepointer,0,page_size,dma_to_device); printk(kern_warning "[%s]page address: 0x%lx bus address: 0x%lx\n",device_name,pagepointer,temp_addr); writeq(cpu_to_be64(temp_addr),bar0addr); //send address fpga wmb(); writeq(cpu_to_be64(1),bar1addr); //start trasnfer wmb(); the bus address 64bits address. on fpga side tlp i'm sending out read of 1 dw: fmt: "001" type: "00000" r|tc|r|attr|r|th : "00000000" td|ep|attr|at : "000000" length : "0000000001" requester id tag : "00000000" byte enable : "00001111"; address : (address dma map page...

git - how to use include.path on Windows -

[master +0 ~1 -0]> git --version git version 1.9.5.msysgit.1 i found answer -- https://stackoverflow.com/a/28520596/107037 -- can't work me. in ~/.gitconfig, have [user] name = cb email = cb@gmail.com [include] path = "c:/common/git/commonconfig" then running > git config --global -l produces user.name=cb user.email=cb@gmail.com include.path=c:/common/git/commonconfig i have tried forward slashes, backslashes, quoting path, not quoting path.... 1 combination haven't tried 1 works, apparently. hints, powerful feature sharing settings across computers. if you're using git config -l check whether include working expected, you'll need ensure you're providing --includes argument, otherwise doesn't perform include processing. the documentation states defaults on, doesn't seem case on windows. --[no-]includes respect include.* directives in config files when looking values. defaults on.

How list States of a Country in ODOO v8 -

i'm trying list states of country. in openerp v7, suppose work: _columns = { 'country_id': fields.many2one('res.country', 'country'), 'state_id': fields.related('country_id', 'state_id', type="many2one", relation="res.country.state", string="state"), } how can in odoo-v8? tried: country_id = fields.many2one('res.country', 'country') state_id = fields.related('country_id', 'state_id', type="many2one", relation="res.country.state", string="state") but got, in 'module' not defined 'related' the official documentation relational fields not clear. i think maybe need onchange method: @api.onchange('country_id') def: _onchange_country(self): #i don’t how list states, inside method do have solution? in odoo 8.0 new api field use related attribute in fields. hear there have no fa...

asp.net - Binding datatable values into a checkbox that's placed inside GridView -

i binding datatable gridview has checkbox in 1 of fields. have trouble getting checkbox checked according datatable. this have far: <asp:templatefield headertext="approved" sortexpression="approved"> <itemtemplate> <asp:checkbox id="checkbox1" runat="server" checked='<%# eval("approved").tostring() == "y" ? true : false %>' enabled="false" /> </itemtemplate> <itemstyle horizontalalign="center" /> </asp:templatefield> code behind: dim adp sqldataadapter = new sqldataadapter(sqlcmd) dim ds dataset = new dataset() adp.fill(ds, "table_name") dt = new datatable() dt = ds.tables("table_name") gridview1.datasource = dt gridview1.databind() edit: getting error bc30201: expression expected. on particular line: <asp:checkbox id="checkbox1" runat="server...

python - For line in file not working with try/except -

i'm running in issue trying replace pipes commas in text file. try: replacement except nameerror: line in datatable: newdata = line.replace("|", ",") output.write(newdata) print "no commas found in " + tableloc + "." the print statement works fine, when try "for line in file" loop itself, works well, i'm not able work how have set above. any ideas or additional information can provide? there nothing special exception handler code block. file reading not impaired. else wrong. i suspect read file , left file pointer @ end of file. if read file object, cannot read again , hope see same data, need rewind file first: datatable.seek(0) line in datatable: newdata = line.replace("|", ",") output.write(newdata)

php - MySQL to Laravel query -

i have query: select concat(firstname, ' ', lastname), email users id in( select user_id company_user company_id in ( select id companies id in ( select company_id activities created_at between date_sub(curdate(), interval 8 day) , date_sub(curdate(), interval 6 day) ) ) ); and i'd make more "laravel-friendly". i did models (and relations on it) each table: activity (who belongs company) company (who has n-to-n relationship user) user (who has n-to-n relationship company) i think covers everything. ask me missing details. thanks. or joins equal spencer7593 response: user::select(db::raw('concat(users.firstname, ' ', users.lastname)'), 'users.email') ->join('company_user', ...

android - How to set the gravity of the content drawable in a TextView -

i've tried change gravity using method setgravity(gravity.top). changes gravity of text, not content drawable. content drawable displayed @ center. update: added code snippet textview textview = new textview(context); textview.settextappearance(context, r.style.somestyle); final layoutparams layoutparams = new layoutparams(layoutparams.match_parent, layoutparams.wrap_content); layoutparams.setmargins(margindeep, margintop, margindeep, 0); textview.setlayoutparams(layoutparams); textview.setcompounddrawablepadding(margindefault); textview.settext(hugetext); textview.setcompounddrawableswithintrinsicbounds(drawable, 0, 0, 0); textview.setgravity(gravity.top); check documentation can use drawableright, drawablebottom etc... in xml

vb.net - Showing a specific result within a loop -

Image
i'm trying create program able encode using rsa encrypt system. i've created code able calculate using euclidean algorithm . here's code: private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click number1 = textbox1.text number2 = textbox2.text while answer <> 0 answer = number1 mod number2 number2 = number1 , answer = number2 loop messagebox.show(answer) end sub so, that's nothing difficult, right? problem show 0 answer, makes sense. want have answer of loop before last one. here [example] if don't understand i'm trying say. i hope able me :) private sub button2_click(byval sender system.object, byval e system.eventargs) handles button2.click dim prevanswer integer number1 = textbox1.text numb...

qt5 - Is it possible to remove Weston toolbar? -

Image
is possible have weston run without toolbar @ top , change background black. when have script in init.d calls weston first qt5 app? such as: weston & /home/root/app -platform wayland you can change background settings in weston.ini. toolbar have return 0 in want_panel function in clients/desktop_shell.c

javascript - Selenium WebdriverJS Promise Loop -

i'm trying "more" link in container keep clicking on until link no longer there. i'm creating deferred , returning fulfill call happening once there no longer "more" link available. .then(function (previousresults) { var deferred = webdriver.promise.defer(); // more link, keep clicking till it's no longer available browser.wait(function() { // see if have "more" click on browser.findelements(bymorelinkxpath) .then(function (morelinks) { if (morelinks[0]) { console.log('has more'); morelinks[0].click() .then(function() { // check spinner go away browser.wait(pagedoneloading, configsetting.settings.testtimeoutmillis); }); } else { console.log('no more'); deferred.fulfill(t...

Matlab - memory usage after solving a large system -

i'm trying calculate memory used matlab process before , after solving large sparse matrix. i'm using memory , direct solver a\b . what want mesaure monitoring in way memory used matlab , calculate difference between memory used after loading file containing sparse matrix , memory used after solving sparse system. here code i'm using % load , store sparse matrix a = load('very_large_sparse_matrix.mat'); % store memory used after loading usr = memory; memory_after_load = usr.memusedmatlab; % solve system % no matter b comes x = a\b % store memory used after solving usr = memory; memory_after_solve = usr.memusedmatlab; % print difference disp(memory_after_solve - memory_after_load); but difference 0 or negative integer. think because matlab pre-allocates memory before running code (am wrong?) , doesn't change allocation dinamically if not emergency. i expect increase of memory used, because through direct solvers fill-in increase number of non-...

sml - Zip and unzip lists in Standard ML -

how create function zip , unzip 2 lists tupled lists in standard ml? example: unzip [[1,4],[2,5],[3,6]] -> [1,2,3] [4,5,6] zip [1,2,3] [0,2,4] -> [[1,0],[2,2],[3,4]] it not idea use head , tail , instead use pattern matching. can encode unzip bit more elegantly follows: fun unzip l = case l of nil => (nil, nil) | (a,b)::tl => let val (l1, l2) = unzip tl in (a::l1, b::l2) end also 1 of commenters above mentioned, zip , unzip typically work on pairs of lists, , lists of pairs respectively.

php - Custom error page not showing on Laravel 5 -

i trying display custom error page instead of default laravel 5 message : "whoops...looks went wrong" i made lot of search before posting here, tried solution, should work on laravel 5 had no luck : https://laracasts.com/discuss/channels/laravel/change-whoops-looks-like-something-went-wrong-page here exact code have in app/exceptions/handler.php file : <?php namespace app\exceptions; use exception; use view; use bugsnag\bugsnaglaravel\bugsnagexceptionhandler exceptionhandler; class handler extends exceptionhandler { protected $dontreport = [ 'symfony\component\httpkernel\exception\httpexception' ]; public function report(exception $e) { return parent::report($e); } public function render($request, exception $e) { return response()->view('errors.defaulterror'); } } but, instead of displaying custom view, blank page showing. tried code inside render() function return "...

php - SUBMIT button not working with AJAX form -

i have had 2 static select boxes 1 of populated mysql database. these sending via ajax php script add items on list. form included submit button , of working fine. i replaced box b ajax run dependant select box (select box b populated based on result select box a). in running fine too. but...... now submit button won't work , don't know why ? can show me ? (there lots of stray id's , classes have been playing around, please excuse these) thankyou! ajax populate dropdown select box b based on result select a <script> $(document).ready(function($) { var list_select_id = 'a'; var list_target_id = 'b'; var initial_target_html = '<option value="">please select ...</option>'; //initial prompt target select $('#'+list_target_id).html(initial_target_html); //give target select prompt option $('#'+list_select_id).change(function(e) { //grab chosen value on first select list change var ...

inheritance - How can I provide methods in a base web api controller that can be accessed via attribute routing -

base class: public class dataapicontrollerbase<t> : apicontroller { public list<validationresult> validate(t input) { ... } } derived class: public class customercontroller: dataapicontrollerbase<customer> { [route("api/customer/{id}")] public customer get([fromuri] guid id) { } } what route resolve "validate" endpoint on each derived controller endpoint? right way go this? i'd use method override solve this base class public class dataapicontrollerbase<t> : apicontroller { public virtual list<validationresult> validate(t input) { ... } } derived class public class customercontroller: dataapicontrollerbase<customer> { route("api/customer/validate")] [httppost] public override list<validationresult> validate(customer input) { base.validate(input); } ...

ubuntu - Docker error : no space left on device -

i installed docker on debian 7 machine in following way echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list sudo apt-get update curl -ssl https://get.docker.com/ubuntu/ | sudo sh after when first tried creating image failed following error time="2015-06-02t14:26:37-04:00" level=info msg="[8] system error: write /sys/fs/cgroup/docker/01f5670fbee1f6687f58f3a943b1e1bdaec2630197fa4da1b19cc3db7e3d3883/cgroup.procs: no space left on device" here docker info containers: 2 images: 21 storage driver: aufs root dir: /var/lib/docker/aufs backing filesystem: extfs dirs: 25 dirperm1 supported: true execution driver: native-0.2 kernel version: 3.16.0-0.bpo.4-amd64 operating system: debian gnu/linux 7 (wheezy) cpus: 2 total memory: 15.7 gib warning: no memory limit support warning: no swap limit support how can increase memory? system configurations stored? from kal's suggestions: when got rid of images , con...

c - Traversing `vm_area_struct`'s of a process -

as extension of answer traversing physical pages of process , data here http://www.makelinux.net/ldd3/chp-15-sect-1 , had small question. in first answer suggested traverse physical pages of process, struct vm_area_struct *vma = 0; unsigned long vpage; if (task->mm && task->mm->mmap) (vma = task->mm->mmap; vma; vma = vma->vm_next) (vpage = vma->vm_start; vpage < vma->vm_end; vpage += page_size) unsigned long phys = virt2phys(task->mm, vpage); and referring example given in second link under heading " 15.1.6. virtual memory areas ", # cat /proc/1/maps @ init 08048000-0804e000 r-xp 00000000 03:01 64652 /sbin/init text 0804e000-0804f000 rw-p 00006000 03:01 64652 /sbin/init data 0804f000-08053000 rwxp 00000000 00:00 0 zero-mapped bss 40000000-40015000 r-xp 00000000 03:01 96278 /lib/ld-2.3.2.so text 40015000-40016000 rw-p 00014000 03:01 96278 /lib/ld-2.3.2.so data n...

html - CSS Pseudo Selector "Blocking" Angular Ng-Click? -

i have css table-card layout uses :before pseudo selector insert header name. also in table, created button fires alert when pressed. the problem button not work in plunkr: http://plnkr.co/edit/zkwekp but when take css out, buttons work expected. here's css: .cards tr:nth-of-type(odd) { background: #eee; } .cards th { background: #333; color: white; } .cards td, .cards th { padding: 6px; border: 1px solid #ccc; text-align: left; } /* force table not tables anymore */ .cards table, .cards thead, .cards tbody, .cards th, .cards td, .cards tr { display: block; } /* hide table headers (but not display: none; accessibility) */ .cards th { position: absolute; top: -9999px; left: -9999px; } .cards tr { border: 1px solid #ccc; } .cards td { /* behave "row" */ border: none; border-bottom: 1px solid #eee; position: relative; padding-left: 20%; } .cards td:before { /* table head...

windows - Getting started with Android Studio: configuration issues -

Image
so, i've downloaded studio , tried run blank app. it's built right, when try run it, error running java occurs also, there couple of corrupt packages in sdk. okay? if not, how fix it? on screenshot you must change in build.gradle file string: buildtoolsversion "23.0.0 rc1" buildtoolsversion "22.0.1".

url - PHP : How to set array Value with $_GET -

i tried set value of $_get[] array object this code $x=array( 'status_1'=>'"'.$_get['hasil_1'].'"', 'status_2'=>'"'.$_get['hasil_2'].'"', 'status_3'=>'"'.$_get['hasil_3'].'"', . . 'status_17'=>'"'.$_get['hasil_17'].'"'); //faktor klasifikasi $n = 'derajat'; //nama tabel $table='tabel'; classify($x,$n,$table); it's not working . this url http://localhost:8080/tugas/sispak/hasil.php?hasil_1=1&hasil_2=1&hasil_3=1&hasil_4=1&hasil_5=1&hasil_6=0&hasil_7=1&hasil_8=1&hasil_9=0&hasil_10=1&hasil_11=1&hasil_12=1&hasil_13=1&hasil_14=1&hasil_15=1&hasil_16=1&hasil_17=1 but , if write manualy like $y=array( 'status_1'=>'1', 'status_2'=>'1', 'status_3'=>'1', . . ...

java - Client ECC SSL Certificate contains "unknown named curve" -

question precontext: working in existing library uses ssl netty framework on remote server. running ssl/tls handshake error. error follows: javax.net.ssl.sslprotocolexception: java.io.ioexception: unknown named curve: 1.2.840.10045.3.1.1 @ sun.security.ssl.handshaker.checkthrown(handshaker.java:1345) ~[na:1.7.0_79] @ sun.security.ssl.sslengineimpl.checktaskthrown(sslengineimpl.java:519) ~[na:1.7.0_79] @ sun.security.ssl.sslengineimpl.readnetrecord(sslengineimpl.java:799) ~[na:1.7.0_79] @ sun.security.ssl.sslengineimpl.unwrap(sslengineimpl.java:767) ~[na:1.7.0_79] @ javax.net.ssl.sslengine.unwrap(sslengine.java:624) ~[na:1.7.0_79] @ io.netty.handler.ssl.sslhandler.unwrap(sslhandler.java:982) ~[netty-all-4.0.23.final.jar:4.0.23.final] @ io.netty.handler.ssl.sslhandler.unwrap(sslhandler.java:908) ~[netty-all-4.0.23.final.jar:4.0.23.final] @ io.netty.handler.ssl.sslhandler.decode(sslhandler.java:854) ~[netty-all-4.0.23.final.jar:4.0.23.final] @ i...

c++ - How to avoid SEGMENTATION ERROR for the code below? -

i'm getting segmentation error code below. solution the spoj problem "coins" . i went through how avoid sigsegv? , made sure not use uninitialized pointers, not access out of memory etc (given n &leq; 10 9 ). i know array a[1000000000] lead stack overflow, used std::map . std::map ever lead stack overflow? wrong code? #include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <cmath> #include <map> using namespace std; map<unsigned long long int, unsigned long long int> a; unsigned long long int dp(unsigned long long int n) { if (a.find(n) == a.end()) a[n] = dp(n/2) + dp(n/3) + dp(n/4); return a[n]; } int main() { (unsigned long long int = 1; <= 24; i++) { a[i] = i; if (i == 12 || == 24) a[i] = + 1; } unsigned long long int n = 0; cin >> n; while (!feof(stdin)) { printf("%llu\n", dp(n)); ...

php 5.4 - php -- fetching data from a table and matching with another table to get data -

i have 2 tables; dashboard_map_items , device_data_current. in dashboard_map_items have 2 field, id , command , in device_data_current have 3 field id, commands, current_value. based on id , commands in dashboard_map_items need current_data device_data_current. now dont know start. before able hard-code id , command , fetch current_data device_data_current not working me anymore, because id , commands changed in future. $currentvalues = devicedatacurrent::where('map_id', 1) ->where('system_id', $system_id) ->where('command', 1)->where('id', 64) ->orderby('datetime', 'desc')->take(1)->get(); this doing data. if using laravel 4.2 framework dont know has laravel. pure php. appreciated. i found solution $currentvalues = dashboardmapitem::where('system_id', $system_id) ->select()->join('device_data_current', function($join){ $join->...

ios - Apple Watchkit app and extension not installing on local watch -

i have watchkit app, everytime try installing keep getting failed install error. have followed of apples docs , tech sheets , looked answer. provisioning profile appears correct. idea? jun 2 12:27:51 sausagekings-iphone streaming_zip_conduit[304] <warning>: launchservices: installing app existing placeholder <lsapplicationproxy: 0x12d52e9f0> com.devglasses.iris jun 2 12:27:51 sausagekings-iphone streaming_zip_conduit[304] <warning>: launchservices: not creating progress <lsapplicationproxy: 0x12d52e9f0> com.devglasses.iris since not placeholder. jun 2 12:27:51 sausagekings-iphone pkd[147] <warning>: uninstalled:com.devglasses.iris.watchkitextension com.devglasses.iris.watchkitextension(2.1.0) e2342d5f-e5fc-470e-ba39-dda796cbe5e3 /private/var/mobile/containers/bundle/application/dcee58b5-78c8-471c-b5ab-2d6679934757/iris.app/plugins/iris watchkit extension.appex jun 2 12:27:51 sausagekings-iphone installd[47] <notice>: 0x10050c000 -[miclientc...

How can I use spaces in a form input's user entered value with jQuery .serializeArray and PHP? -

i have form element , use (abbreviated), var dataarray = $(this).serializearray(), dataobj = {}; $(dataarray).each(function(i, field){ dataobj[field.name] = field.value; }); i use data ajax, sending php page (abbreviated). url: '/api/controller/name/' + dataobj['guys-name'] if enter (minus quotes), the lazy brown fox it submitting this, understand because has spaces %20, the%20lazy%20brown%20fox but when use print_r() this, array ( [0] => thelazybrownfox ) i need can enter name in 1 line smith john. can make 2 form inputs, not want do. url strings browser transform using punycode . right way correct way use or post parameters. $.post( "/api/controller/name/", { name: dataobj['guys-name'] } ); or decode string "the%20lazy%20brown%20fox" punycode.

xna - Invisible geometry in DX11 -

after struggling many hours understand , compensate microsoft's deprecation of d3dx in windows 8, i've run problem can't shake off. the first time started program, became immortal because of access violation. after having restarted computer , recompiling , running same code, doesn't crash, cube should seeing isn't there. i'm getting warning "object declared on heap may not aligned 16". afaik research, occurs because of xna math. so, after finding this discussion litteraly tried being suggested. except xmfloat4x4 solution worked, cube still invisible. here's part of code think relevant: class iegame : public dx11infernalenginebase { public: //... bool loadcontent() { //... vertex vertices[] = { { xmfloat3(-1.0f, 1.0f, -1.0f), xmfloat2(0.0f, 0.0f) }, { xmfloat3(1.0f, 1.0f, -1.0f), xmfloat2(1.0f, 0.0f) }, { xmfloat3(1.0f, 1.0f, 1.0f), xmfloat2(1.0f, 1.0f) }, { xmfloat3(-1.0f, 1.0f, 1.0f), xmfl...

excel - How to verify if cell address falls within a specified range -

i trying check if specific cell address falls within range have specified. example , have range("c10:c50") . pick cell address c15 . want check if cell address c15 within range c10:c50 . not sure how write code this. sub worksheet_calculate() dim s shape r = range("d8:d21,d52:d64,d107:d117") findshape = "not found" each s in me.shapes if s.topleftcell.address = r.address findshape = s.name msgbox findshape, vbokonly 'exit 'no need keep going end if next

mysql - Cannot connect to local databse using php -

i having trouble connecting localhost database php. feels have followed every tutorial there is. current php code: <?php //enter database connection info below: $hostname="localhost"; $database="webutvshop"; $username="dbconnect"; $password="password"; //do not edit below line $link = mysql_connect($hostname, $username, $password); if (!$link) { die('connection failed: ' . mysql_error()); } else{ echo "connection mysql server " .$hostname . " successful! " . php_eol; } $db_selected = mysql_select_db($database, $link); if (!$db_selected) { die ('can\'t select database: ' . mysql_error()); } else { echo 'database ' . $database . ' selected!'; } mysql_close($link); ?> the issue stands, when acess file locally on computer not answer @ it. i've tried many other, yet not answers them! i need in order keep working on schoolproject, thanks. stop using...