Posts

Showing posts from January, 2012

jquery - Trying to show the total price of a grouped product in view page simultaneously on selection of qty in Magento -

i'm try display total price of grouped product on selection of quantities, simultaneously updates price in total shown in picture. issue i'm facing is, i'm able see updated total price. price value not appropriate. , considering 1 item price i.e; price remains same , and calculating total price. please me, how can this. in advance:) and code below; <table class="data-table grouped-items-table" id="super-product-table"> <col /> <col /> <col width="1" /> <thead> <tr> <th><?php echo $this->__('product name') ?></th> <?php if ($this->getcanshowproductprice($_product)): ?> <th class="a-right"><?php echo $this->__('price') ?></th> <?php endif; ?> <?php if ($_product->issaleable()): ?> <th class="a-center"><?php echo $this->__('qty') ?...

jquery - Need help finding what is blocking text selection in script -

i using following mobile-me script can seen here: http://lokeshdhakar.com/projects/mobileme-particles/ i have noticed blocking ability select text on site. example if use mouse select “created by: lokesh dhakar” @ footer of page, cannot done. here github repository: https://github.com/lokesh/mobileme-particles i need finding blocking text being selected in project. assistance appreciated. i'll start words of wisdom : disabling text selection bad. don't use this. from http://api.jqueryui.com/disableselection/ .disableselection() otherwise can change background of text selection match other background ::selection { background: #ffb7b7; } or : how disable text selection using jquery? (function($){ $.fn.disableselection = function() { return .attr('unselectable', 'on') .css('user-select', 'none') .on('selectstart', false); }; })(jquery); edit : (f...

ios - Keep expanded UITableViewCell fixed on top -

i have implemented skstableview , used command: [tableview scrolltorowatindexpath:indexpath atscrollposition:uitableviewscrollpositiontop animated:yes]; when press cell expandable, , goes on top. i'd when scroll expanded cell went top stay fixed there until it's closed. can that? in uitableview have uiscrollview methods. can this: -(void)scrollviewdidscroll:(uiscrollview *)scrollview { uitableviewcell *cell =[self.mytableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; cgrect cellframe = [cell convertrect:cell.frame toview:self.view]; if (self.issticktotop) { self.cell.frame = cgrectmake(0, 0, self.cellframe.width, cellframe.size.height); } else { self.cell.frame = cgrectmake(0, scrollview.contentoffset.y, self.cellframe.width, cellframe.size.height); } } the issticktotop your maintenance bool variable indicate if cell stick top or not. don't u don't know ;)

php - Laravel : BadMethodCallException Method [store] does not exist -

i downloaded , started new project latest laravel 4.2. when trying submit form following error : badmethodcallexception method [store] not exist here files : controller - admin/admincontroller <?php namespace admin; use illuminate\support\facades\view; use app\services\validators\articlevalidator; use input, notification, redirect, sentry, str; class admincontroller extends \basecontroller { public function index() { if (input::has('login')) { $rules = array( 'email' => 'required', 'password' => 'required|min:3', 'email' => 'required|email|unique:users' ); $validator = validator::make(input::all(), $rules); if ($validator->fails()) { return redirect::to('admin\admincontroller')->witherrors($validator); } else { ...

java - Little Confusion Over Hashing -

consider ther following code : public class carequalstestagain { string model; public carequalstestagain(string x) { this.model=x; } @override public int hashcode(){ //bad hashcode system.out.println("__hash__"); return 1; } @override public boolean equals(object o){ system.out.println("in equals"); if((o instanceof carequalstestagain) && ((carequalstestagain)o).model==this.model){ return true; } else return false; } public static void main(string[] args) { map map=new hashmap(); carequalstestagain car1=new carequalstestagain("8"); map.put(car1, "red"); system.out.println("key1 : "+map.get(car1)); //line 1 carequalstestagain car2=new carequalstestagain("8"); system.out.println("key2 : "+map.get(car2)); //...

string - Working with vector output of a function (python) -

i need work different folder paths wrote function create them. unfortunately not able call result vector. gives me "none". uncommenting "#" can see function works fine. guess mistakes lies somewhere in last 2 lines, found searching how store result of function. any ideas doing wrong? there special consider when saving output of function supposed return vector multiple strings? i'm using python idle version 2.6.5 if helps... thank in advance help! >>> def path_generator(path1,path2,path3): #res = [] in path1: first_string = j in path2: second_string = first_string+"\\"+j k in path3: end_string = second_string+"\\"+k #res.append(end_string) #print res del i,j,k,first_string,second_string >>> origin = ["c:\\one","c:\\two"] >>> subfolders = ["subfolder1...

ms access - MSAccess - Conditional Formatting in Adjacent Rows [Solved] -

i trying add conditional formatting msaccess datasheet. want highlight following condition: number description ====== ============== 1111 same desc 1111 same desc 2222 different desc 1 2222 different desc 2 2222 different desc 3 for adjacent rows, number matches, compare adjacent descriptions (note: datasheet sorted number & description when presented user in subform): when descriptions match, nothing. when descriptions mismatch, highlight description in example above, i'd highlight 3 rows number 2222. i can work in xls using , and or formulas. not sure how accomplish in msaccess. any ideas? thanks! i have solution, essentially: compare qty (dcount) of rows containing current "number" alone number of rows containing current "number" , "desc". if qty of rows of "number" > qty rows of "number & desc", there variation in desc - apply highlight. conditional formatting crite...

html - How to center vertically a multiline div? -

this question has answer here: css vertical centering 10 answers i want center vertically these lines. tried line-height method, lines don't adjusts on holder .item . i have html: <li><a href="#" class="item"> <span>line 1</span><br> <span>line 2</span><br> <span>line 3</span> </a> </li> and css: .item { text-align: center; display: block; height: 125px; padding: 10px 0; border-radius: 2px; margin-bottom: 10px; color: #fff; } you use same padding on top on bottom, way text within element "centered" vertically. this: .item { text-align: center; display: block; padding: 60px 0px; border-radius: 2px; margin-bottom: 10px; color: #fff; } an other method using line-height, works i...

Textbox to display function JavaScript -

i'm having issue first project semester. using javascript i'm supposed create magic 8 ball simulator. simulator needs button that says "shake it" which, when clicked, displays random saying getsaying() function in read textbox. little lost. how go specifying textbox saying displayed in? <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>magic 8 ball!</title> <style type="text/css"> /*styles go here*/ </style> </head> <body> <button type="button" onclick="show()">shake it!</button> <script type="text/javascript"> function show() { document.write(getsaying()); } function getsaying() { var pool = ["it certain", "it decidedly so", "without doubt", "yes definitely", "you may rely on it", ...

javascript - Lightswitch 2013 - HTML Client -> commitChanges() and showOtherPage() in union -

just thought id ask on here driving me insane... im trying commitchanges() or applychanges() , followed myapp.showbrowseotherscreen() this way im trying it: var result = confirm("send parcel?"); if (result == true) { screen.projectfinance.sendparcel = true; myapp.showbrowseinvoices(); } else { msls.showmessagebox("application not sent", { title: "aborted" }); myapp.cancelchanges(); screen.projectfinance.sendparcel = false; } }; what displays message "send parcel", if click ok, then brings option, sendparcel has been set true, there unsaved changes on page... i need save , navigate im not sure try next, or advice save(), savechanges(), , commitchanges() asynchronous. starts save operation, tries navigate away before save completed. myapp.commitchanges().then(function () { myapp.showbrowseinvoices(); } the .then method takes 2 parameters. both functions, can defined in line example above, or calls f...

c# - Linq to Entities error when comparing int? to a values -

i trying write recursive function traverse tree. have entity 'folder' 2 properties of parentfolderid , folderid. if folder @ root level, parentfolderid null. created recursive function accepts paramater id , adds returns folder entities same parentfolderid id, i'm getting error of 'unable create constant value of type 'system.object'. primitive types or enumeration types supported in context.'. here function: private list<folder> getfolderchildren(int? folderid) { var childfolders = new list<folder>(); // finallist list<> returned var finallist = new list<folder>(); // looking @ root level folder if (folderid == null) { childfolders = documententities.folders.where(x => x.parentfolderid.equals(folderid)).tolist(); } else { childfolders = documententities.folders.where(x => x.parentfolderid == folderid).tolist();...

mysql - How come doing a find/replace on sql dump and importing it gives error #2006? -

i have sql dump wordpress install lives on domain. need make changes site have set localhost using mamp. if import sql dump "as-is" imports without problem. need change url's in sql dump point localhost instead. when use aptana replace on sql file http://example.com http://localhost/example , try import modified file mysql error "#2006 - mysql server has gone away" what problem here? have temporarily fixed overriding hosts file example.com point localhost not long term viable option. i aware error occurs files large or server not responding able import non-modified version of sql. there 9538 replaces being done cannot go through 1 1 find culprit. thank you (just realized doesn't relate directly problem, still need info if doing search , replace in mysql dump). data in wp database serialized. can't search , replace. you can't change data without re-serializing it. there scripts , services allow proper search , replace. ...

maven - Java CDI not kicking in -

so, first attempt @ cdi kind of went dogs. i've read ton of articles , tried variety of simple complex examples without success. here current, simple example. doing wrong? maven project: beans.xml (located in src/main/resources/meta-inf) <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" version="1.1" bean-discovery-mode="all"> </beans> printer.java import javax.inject.inject; public class printer { @inject greeting greeting; } greeting.java import javax.enterprise.inject.default; @default public class greeting { public void saystuff(){ system.out.println("stuff"); } } main.java public class main { ...

matrix - Declaring two matrices in one line of code? Matlab 2014 -

,a simple question 1 have yet concrete answer. if have 2 matrices, , b , want make them both same size, 1x2 matrix of zeros. there way declare them both in 1 line of code? ask because in situation have on 10 matrices of same size want easier way declare them. so @ first might think following (which not valid): a,b = zeros(1,2) the deal() -function looking for. can distribute either 1 input several output-variables or distribute several input values several output values. need first case: [a, b] = deal(zeros(1,2));

javascript - gapi.auth.authorize() not calling its callback method -

i trying implement google calendar usin "google apis client library javascript". code provided here: https://code.google.com/p/google-api-javascript-client/source/browse/samples/authsample.html however, method gapi.auth.authorize never calling callback method handleauthresult . please take note have generated client id , api key android. scope provided in code https://www.googleapis.com/auth/calendar please let me know how overcome problem.

Creating Matrix with a loop in Matlab -

i want create matrix of following form y = [1 x x.^2 x.^3 x.^4 x.^5 ... x.^100] let x column vector. or more variants such y = [1 x1 x2 x3 (x1).^2 (x2).^2 (x3).^2 (x1.x2) (x2.x3) (x3.x1)] let x1,x2 , x3 column vectors let consider first one. tried using like y = [1 : x : x.^100] but didn't work because means take y = [1 x 2.*x 3.*x ... x.^100] ? (ie values between 1 x.^100 difference x) so, cannot used generate such matrix. please consider x = [1; 2; 3; 4]; , suggest way generate matrix y = [1 1 1 1 1; 1 2 4 8 16; 1 3 9 27 81; 1 4 16 64 256]; without manually having write y = [ones(size(x,1)) x x.^2 x.^3 x.^4] use bsxfun technique - n = 5; %// number of columns needed in output x = [1; 2; 3; 4]; %// or [1:4]' y = bsxfun(@power,x,[0:n-1]) output - y = 1 1 1 1 1 1 2 4 8 16 1 3 9 27 81 1 4 16 64 256 if have x = [1 2; ...

algorithm - Top n elements in queue -

i have implemented queue using 2 stacks , want find top n percent elements in queue. for example: queue takes element in order {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20} top 10% elements means 10% of 20 = 2 hence answer should 19 , 20 there 2 ways can think of sort queue, claculate number of items (x) n% , grab top x elements. selection algorithm . (i came across algorithm , based on idea of quicksort. have copy entire queue array , apply algorithm) is there better way solve this? a queue isn't best data structure that, should not access elements inside (most of queue implementations don't provide access operator) shouldn't sort it. so, if don't need queue due other requirements, suggest use plain array. sorting time consuming process. read/insert queue elements can compute sum. based on known sum, number of elements , percent required, can compute threshold. then, need iterate through elements (if using queue, can extract them 1...

Rails 4 activeadmin - undefined local variable or method `view_factory' for :Arbre::Context -

i using activeadmin gem admin interface,now created new controller , added layout 'acitveadmin' am getting below error nameerror in meetingrooms#index showing /home/amp/.rvm/gems/ruby-2.1.1@rails4.1/bundler/gems/active_admin-41d5176f3682/app/views/layouts/active_admin.html.arb where line #2 raised: undefined local variable or method `view_factory' :arbre::context my controller is app/controllers/meeting_rooms_controller.rb class meetingroomscontroller < applicationcontroller layout 'active_admin' def index @meeting_rooms = meetingroom.all #render :layout => "active_admin" end end can 1 please me. i think should use controller block define actions. https://github.com/activeadmin/activeadmin/blob/master/docs/8-custom-actions.md#modifying-the-controller activeadmin.register meetingroom controller # code evaluated within controller class def define_a_method # instance method end...

regex - Checking for a pure string using regexp_like -

i need check "substring of first 6 characters" of input string pure string. declare p_str varchar2(30) := 'abcd1240'; l_result varchar2(20); begin if regexp_like(substr(p_str,1,6), '[[:alpha:]]') dbms_output.put_line('it pure string'); else dbms_output.put_line('it alphanumeric'); end if; end; / i can see first 6 characters of string abcd1290 alphanumeric contains 12. but, output printed says otherwise. am doing wrong "alpha" in regexp_like ? thought alpha supposed pure characters , not numbers. here, abcd1290 should give me: alphanumeric output. abcdxy90 should : pure string try this: declare l_res varchar2(100); begin in (select 'abcdef123' val dual union select '123abc123' dual union select '123456abc' dual) loop if regexp_like(i.val, '^\d{6}') l_res := 'alpha'; else l_res := 'numeric'; ...

intellij idea - "Add semicolon and goto new line" hotkey -

i'm beginner in android programing. use android studio (v0.8.9) here problem tackled with: ctrl+shift+enter - adds semicolon , moves caret end of line shift enter - not add semicolon , moves caret new line question how make intelij idea add semicolon end of current line , move caret new line pressing, say, shift+enter ? pressing ctrl+shift+enter twice should job. can record keyboard macro it, , assign custom shortcut it.

php - Using Test Mail Server Tool with WAMP? -

i'm attempting send test mail myself while working on php script. i've researched other questions , led me tool: http://www.toolheap.com/test-mail-server-tool/ others have said works i'm having trouble using myself. php.ini files should reset default values tried change smtp values @ 1 point, "smtp.wlink.com.np". for has used tool, how work? have send e-mail to? $to = "localhost"; ? set php.ini smtp settings 127.0.0.1 , port 25 . send email anyone, address (i.e., send obama@whitehouse.gov). the tool "intercept" email, , show you. email never leave system.

c - Initializing the stack with up to 10 values -

i'm trying make sure if initialization stack function gets values enter user, right codes print out different values original values enter. use %d. also, i'm working on different functions work stack such pop, push, goes top of stack, etc. work in while loop? however, here initialization stack function typedef struct stack { int* darr; int size; int top; }stack; stack * initstack(int elements) { stack *s; s = (stack *)malloc(sizeof(stack)); s->darr = (int *)malloc(sizeof(int)*elements); s->size = 0; s->top = elements; return s; } in main () int main() { stack s; int i; printf("hello user, please enter 10 different values build stack: \n"); for(i = 0; < 10; i++) { scanf("%d", initstack(i)); } printf("\nyou entered: \n%d\n\n", initstack(i)); return 0; } #include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef...

ios - Should I save my images in Core Data or should I use SDWebImage -

i have been developing app cloud/server data source. naturally process 1 thing @ time. @ present, fill tables, query server returns array. array contains urls images , urls load images using sdwebimage. now entering stage of development need implement core data data in tables (i.e. texts , images). far considering following approaches: i can load array server core data (imagine properties as: firstname, lastname, photourl, shortbio) , pass photo url core data sdwebimage display image in table cells. or i can load array , image core data (i.e. load array core data in background , each row, load image core data) of course point here if use sdwebimage save image in own caching system, limited understanding may or may not entirely consistent in core data. on other hand don't understand core data enough know if handles saving images in terms of performance (i.e. knows it's image , therefore handle file linking). so best way this? can sdwebimage work in harmony core da...

php - Twitter access token request returns "Invalid or expired token" -

i using custom code connect twitter , request access token. reason when trying post "access_token" on api returns "invalid or expired token". code follows (apart few external function calls , properties should sufficient replicate error): public function authenticate($get,$return = false) { session_start(); if (!isset($get['oauth_verifier'])){ // step 1 - request token $step1 = $this->processrequest('oauth/request_token',0,$this->pobj->getredirecturl().'?process=true'); parse_str($step1,$parts); if ($parts['oauth_callback_confirmed'] !== 'true'){ die('error process'); } $_session['tw_secret'] = $parts['oauth_token_secret']; // step 2 ...

stm32 - How to protect reading flash of stm32f10x -

i working on project using stm32f103 , have finished development of firmware. use st-link utility downloading stuff microcontroller. when activate read out protection on chip, stops working. , need protect firmware. problem? you have unlock flash first. there should call in stm32 stdperiph library. code looks this: /* read protect flash. never ever set level 2. can't * write chip ever again after that. */ flash_ob_unlock(); flash_ob_rdpconfig( ob_rdp_level_1 ); if (flash_ob_launch() != flash_complete) { err_printf("error enabling rdp\n"); } flash_ob_lock();

javascript - window resize function randomly not working -

i'm working on responsive menu, using js/jquery. menu works, if resize window within 'mobile' area (1024px), function dropdown tabs toggle randomly stop working.. here script: $(document).ready(function(){ function mobile(){ $('.menu-toggle').click(function(){ $('#menum').toggle(); }); } $(window).resize(mobile); mobile(); function resmenu() { var stest = $('#sizetest').css('float'); $('#sizetesttext').text("current sizetest = " + stest); if (stest === 'left') { $('nav').attr('id', 'menum'); $('#menum').hide(); $('#menum .has-sub').click(function(e) { e.preventdefault(); $('#menum ul li').not($(this).parent()).removeclass('tap'); $(this).parent().toggleclass('tap'); }); } else { $('nav').attr('id', 'menu...

java - 0 test class found in package ‘<default package>’ -

i have installed intellij idea 13.1.4 , jrebel plugin. have licensed ok , created , added configurations in catalina.bat file. when running jrebel within intellij, seems monitoring correct directories following message: 0 test class found in package ‘’ this tells me has failed start. does know might need change work? this can fixed invalidating cache . on main menu, choose file -> invalidate caches/restart . source

python - Take out punctuation within a word -

i have function takes parameters punctuation symbol , list of words. function looks in each word , splits punctuation. example: ["i...love", "you"] ---> ["i","love","you"] the problem using so-called "incomprehensible list comprehension" it, , exhibiting strange behaviour: def take_out(symbol, word_list): word in word_list: if symbol in word , "http" not in word : word_list[word_list.index(word)] = (" ".join([x x in word.split(symbol)])).split() word_list = [[item] if isinstance(item, str) else item item in word_list] word_list = [item sublist in word_list item in sublist] return word_list can suggest way of accomplishing task without using nebulous approach have. if understand question correctly, try this: z = [] in ["i...love","you"]: j in i.split("..."): z.append(j) print(z) h...

audio - How do I connect to a Dedicated Server aside from using RDC? -

i'm in bit of pickle. i need connect dedicated server have purchased stream video/audio content. the server has on-board sound card, confirmed before purchasing , i've installed virtual audio cable in attempt change inputs. the problem cannot see devices , change audio input/output when i'm logged in through rdc session. understanding because "local computer" audio device takes on when i'm connected , result blocks me seeing inputs. my question is.. how connect dedicated server in way allow me control audio devices. thank you

php - Get number of rows in Laravel's Eloquent before using "take" and "skip" -

i want query laravel model using eloquent results may need match clauses, take , skip predefined numbers. this isn't problem in itself, need know number of rows found in query before reducing result set take , skip - original number of matches every row in table if no clauses used or few if either used. what want accomplished making query twice, first omitting " ->take($idisplaylength)->skip($idisplaystart) " @ end , counting that, seems messy. any thoughts? $contacts = contact::where(function($query) use ($request) { if (!empty($request['firstname'])) { $query->where(function($query) use ($request) { $query->where('firstname', 'like', "%{$request['firstname']}%"); }); } if (!empty($request['lastname'])) { $query->where(function($query) use ($request) { $query->where('lastname', 'like', "%{...

web services - Java - How to show Soap Fault -

i have kind of response when having soap fault calling java web service <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <soap:fault> <faultcode>soap:server</faultcode> <faultstring>fault occurred while processing.</faultstring> <detail> <ns1:waybillregistrationfault xmlns:ns1="http://pod.waybillmanagement.ws.industrysystem.com.ar/"> <errors xmlns:ns2="http://pod.waybillmanagement.ws.industrysystem.com.ar/"> <code>80000</code> <description>el número de ctg 20140904 ya existe</description> </errors> <errors xmlns:ns2="http://pod.waybillmanagement.ws.industrysystem.com.ar/"> <code>1000</code> ...

MATLAB / Datafeed compiled code with Bloomberg APIv3 / Java library: Java Exception -

am trying compile matlab code employs bloomberg's apiv3 via datafeed toolbox. code runs fine within matlab. compiler works fine on code without java. javaclasspath references api via: dynamic java path c:\blpv3\api\apiv3\javaapi\v3.7.1.1\lib\blpapi3.jar i several compilation errors relating java (stacktrace below) on compilation : mcc -m -r -startmsg -r -completemsg -v my_prog.m i suppose need tell mcc link blpapi3.jar more explicitly, how? need set static java path? any appreciated! warning: java exception occurred getting method description java.util.locale class: java exception occurred: java.lang.noclassdeffounderror: com/bloomberglp/blpapi/session @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source) @ java.lang.class.privategetpublicmethods(unknown source) @ java.lang.class.getmethods(unknown source) @ com.mathworks.jmi.opaquejavainterface.doesmethodexist(opaquejavainterface.j...

SAML 2.0 SP metadata: Purpose and the use of certificate -

here part of sp metadata. reference: metadata oasis security assertion markup language (saml) v2.0 ... <md:keydescriptor use="signing"> <ds:keyinfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:x509data> <ds:x509certificate> </ds:x509certificate> </ds:x509data> </ds:keyinfo> </md:keydescriptor> <md:keydescriptor use="encryption"> <ds:keyinfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:x509data> <ds:x509certificate> </ds:x509certificate> </ds:x509data> </ds:keyinfo> </md:keydescriptor> ... are there benefits choose same (or different) certificate in both signing , encryption certificate ? what purpose of including signing certificate here ? if message sent through https, transport layer encryption provided. still need include encryption certificate here ? in saml 2.0 w...

java - running multiple threads simultaneously -

help me please. run threads array in 1 time public class main { public static void main(string[] args) { string [] folders = (new counter()).readfile(); thread[] threads = new thread[folders.length]; (int = 0; < folders.length; i++) { threads[i] = new thread(new mythread(folders[i])); } startthreads(threads); } private static void startthreads(thread[] threads) { (thread t : threads) t.start(); } } other executors,but in case have n threader, wait each other. http://joxi.ru/b6aqvp3jtjbmfbw41ma string [] folders = (new counter()).readfile(); thread[] threads = new thread[folders.length]; int size= folders.length; (int = 0; < folders.length; i++) { threads[i] = new thread(new mythread(folders[i])); } executorservice executor = executors.newfixedthreadpool(folders.length); (int = 0; < size; i++) { runnable worker = new mythread(folders[i])...

java - Vertex Locations are off when using Mesa Core Profile -

Image
i using mesa 10.1.3 able use opengl 3.3 on linux computer. request core profile when create window since core profile has opengl 3.3. when tried write simple program display triangle on screen, got nothing. thought screwed somewhere in code rechecked , correct. test this, tried running program in windows , working should. experimented little bit more code; multiplied vertex location in vertex shader 0.001 , able see triangle, then, not working should. triangle see right angle triangle whereas intended equilateral 1 (in windows see equilateral triangle). guess vertex location somehow different when using opengl core profile, don't quite know how fix this. doing wrong , should doing? by way, vertex shader looks like: #version 330 in vec3 position; void main() { gl_position = vec4(0.001*position, 1.0); } fragment shader: #version 330 out vec4 fragcolor; void main() { fragcolor = vec4(0.0, 1.0, 1.0, 1.0); } shader class: public shader() { program = glcre...

json - Jersey and MOXy, mapping variable properties -

using jersey , moxy build restful client, i'm stuck on how handle mapping entity/class json message has variable , unpredictable properties in it. i love if have entity how framework documentum's dfc had idftypedobject. boy that'd nice work with. or way suck map of maps or something... i've been searching around, either don't understand i've found, or maybe specific thing doesn't happen much...? if point me right terminology , direction, i'd super grateful! a possible response body may come in follows...any number, , type of properties possible under "properties": { "response": "all good, darling", "properties": { "property1": { "stuff": [], "goodies": [] }, "property4": 63473, "property5": "draft", "property6": [ "1341340696280", ...

fork - C - named pipe for multiple forked children -

if have multiple children created fork(), , method of communication parent "named pipes", need multiple named pipes? 1 each child? or can make 1 , have parent read that? basically, there else need do? understand if several children write same named pipe @ same time, might cause problem reading whole message single child. there way make sure writes atomic? you can have several writers single pipe. however, communication between fork()ed children , parent, might not need named pipes @ all. named pipes visible in file system , can used communication between processes not parent/child. about atomicity: if write less pipe_buf (no less 512 bytes, 4096 bytes on linux, limits.h), write atomic , there no mixing of messages different writers. if write more pipe_buf, don't rely on writes being atomic. the pipe(7) manual page says that: pipe_buf posix.1-2001 says write(2)s of less pipe_buf bytes must atomic: output data written pipe contiguous s...

R: Make this loop faster using sapply -

i'm new in r , i'm trying figure out how make function faster using sapply, help? x <- c(0.0, 1.0, 2.0, 3.0, 4.0, 5.7) y <- c(10.0, 7.0, 5.5, 4.5, 3.2, na) z <- c(as.data.frame(cbind(x,y)) vcub=function(y, x, z) { vol<-vector() for(i in 1:dim(z)[1]){ if(is.na(y[i])) { vol[i]<-(((pi*y[i-1]^2)/40000)/3)*(x[i]-x[i-1]) }else{ vol[i]<-(((pi*y[i-1]^2) + (pi*y[i]^2))/80000)*(x[i]-x[i-1]) } } return(as.data.frame(vol)) } you can vectorize code replacing if , else statements in loop ifelse statement , using vectorized arithmetic in r: data.frame(vol=ifelse(is.na(y), pi*c(na, head(y, -1)^2)/120000*c(na, diff(x)), pi*(y^2 + c(na, head(y, -1)^2))/80000*c(na, diff(x)))) # vol # 1 na # 2 0.0058512163 # 3 0.0031121402 # 4 0.0019831304 # 5 0.0011973395 # 6 0.0004557404 in general, it's easy vectorize computation when can compute i^th ...

How to fix "Headers already sent" error in PHP -

Image
when running script, getting several errors this: warning: cannot modify header information - headers sent ( output started @ /some/file.php:12 ) in /some/file.php on line 23 the lines mentioned in error messages contain header() , setcookie() calls. what reason this? , how fix it? no output before sending headers! functions send/modify http headers must invoked before output made . summary ⇊ otherwise call fails: warning: cannot modify header information - headers sent (output started @ script:line ) some functions modifying http header are: header / header_remove session_start / session_regenerate_id setcookie / setrawcookie output can be: unintentional: whitespace before <?php or after ?> the utf-8 byte order mark specifically previous error messages or notices intentional: print , echo , other functions producing output raw <html> sections prior <?php code. why happen? to understand why hea...

java - Uknown XML file into pojo -

is there way take unknown schema xml file , convert values, tags, etc xml file pojo? looked @ jaxb , seems best way use if know xml schema. basically, want able parse tags xml put each own object maybe through use of arraylist. did not understand jaxb can or there better tool can this, or hard implement? in hope helps understand situation! public static void dumpallnodes( string path ) throws exception { documentbuilder parser = documentbuilderfactory.newinstance().newdocumentbuilder(); document doc = parser.parse(new file(path)); nodelist nodes = doc.getelementsbytagnamens( "*", "*" ); for( int = 0; < nodes.getlength(); i++ ){ node node = nodes.item( ); system.out.println( node.getnodetype() + " " + node.getnodename() ); } } the nodelist nodes contains element nodes, in document order (opening tag). thus, elements contained within elements in list, alike. obtain attributes of node, call nam...

asp.net - Win32Exception (0x80004005): Access is denied -

i hosting application using windows azure servers, working fine since 1 week , when user or either me trying login application giving access denied error. if can happening application? my connectionstring: connectionstring="data source=129.123.144.41;initial catalog=tear;persist security info=true;user id=tearconn;password=whyyou" stacktrace: [win32exception (0x80004005): access denied] [sqlexception (0x80131904): network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)] system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) +5341687 system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean...