Saturday, 15 September 2012

JavaScript Validation working on Firefox but not Chrome -



JavaScript Validation working on Firefox but not Chrome -

i upset, have been spending hours on this. can guys tell me whats wrong? tried onsubmit @ origin @ end of form. changed onchange , onclick still same issue.

i cant submit button give thanks message if write onclick function because disables onsubmit

<script type="text/javascript"> <!-- // form validation code come here. function validate() { if( document.myform.name.value == "" ) { alert( "please provide name!" ); document.myform.name.focus() ; homecoming false; } if( document.myform.email.value == "" ) { alert( "please provide email!" ); document.myform.email.focus() ; homecoming false; } if( document.myform.phone.value == "" || isnan( document.myform.phone.value ) || document.myform.phone.value.length != 5 ) { alert( "please provide phone number can reach you." ); document.myform.phone.focus() ; homecoming false; } return( true ); } //--> </script> <div class="iphorm-outer"> <form class="iphorm" action="send_contact.php" name="myform" method="post" > <div class="iphorm-wrapper"> <div class="iphorm-inner"> <div class="iphorm-message"></div> <div class="iphorm-container clearfix"> <!-- begin name element --> <div class="element-wrapper name-element-wrapper clearfix"> <label for="name">name <span class="required">(required)</span></label> <div class="input-wrapper name-input-wrapper"> <input class="name-element" id="name" type="text" name="name" /> </div> </div> <!-- end name element --> <!-- begin email element --> <div class="element-wrapper email-element-wrapper clearfix"> <label for="email">email <span class="required">(required)</span></label> <div class="input-wrapper email-input-wrapper"> <input class="email-element" id="email" type="text" name="email" /> </div> </div> <!-- end email element --> <!-- begin phone element --> <div class="element-wrapper phone-element-wrapper clearfix"> <label for="phone">phone</label> <div class="input-wrapper phone-input-wrapper"> <input class="phone-element" id="phone" type="text" name="phone" /> </div> </div> <!-- end phone element --> <!-- begin message element --> <div class="element-wrapper message-element-wrapper clearfix"> <label for="message">message <span class="required">(required)</span></label> <div class="input-wrapper message-input-wrapper clearfix"> <textarea class="message-element" id="message" name="message" rows="7" cols="45"></textarea> </div> </div> <!-- end message element --> <!-- begin submit button --> <div class="button-wrapper submit-button-wrapper clearfix"> <div class="loading-wrapper"><span class="loading">thank you, message sent.</span></div> <div class="button-input-wrapper submit-button-input-wrapper"> <input class="ka-form-submit" type="submit" name="contact" onclick="return(validate())" value="submit"/> </div> </div> <!-- end submit button --> </div> </div> </div> </form>

can please help me write function disable submit button unless function validate true?

everything seems fine. seek refresh page using ctrl + f5 clear browser's cache.

javascript google-chrome firefox cross-browser

php - Different behaviour with and without Symfony's response system -



php - Different behaviour with and without Symfony's response system -

i'd able manage webdav directories (and reimplement way files read , written) in symfony. found sabredav, framework basic classes required.

my problem is, while it's quite easy webdav server running using sabredav alone, doesn't work when utilize symfony.

without symfony, boils downwards to:

$server = new dav\server($rootdirectory);

$server->exec();

and can utilize cadaver access directory.

more here: http://code.google.com/p/sabredav/wiki/gettingstarted

i tried same in controller symfony, using:

return new response($server->exec());

but reason cadaver doesn't have access folder. guess i'm missing way responses work in symfony, what? sabredav uses own scheme of http requests , responses, if (as presume) symfony doesn't mess superglobal variables such $_server, shouldn't issue.

about requests , responses in symfony: http://symfony.com/doc/current/book/http_fundamentals.html#requests-and-responses-in-symfony

here's did; it's bit slow , there must improve way, i'll create moment: controller.php :

$path=(__dir__.'/../../../../web/public/'); $path=realpath($path); $publicdir= new \myclasses\fs\mydirectory($path); $server = new \sabre\dav\server($publicdir); $server->setbaseuri('/symfony/web/app_dev.php/'); { $syrequest = request::createfromglobals(); $_server=$syrequest->server->all(); $_post=$syrequest->request->all(); } { $sarequest=new \myclasses\http\request($_server,$_post); $resourcestream=false; $sarequest->setbody($syrequest->getcontent($resourcestream),$resourcestream); } { $server->httprequest=$sarequest; $saresponse=new \myclasses\http\response(); $server->httpresponse=$saresponse; $server->exec(); } { $content=ob_get_clean(); } { $syresponse=new response($content,http_response_code(),headers_list()); } homecoming $syresponse;

$server->exec();

doesn't homecoming anything. attempts set headers itself, , stream output php://output (indeed, built-in request/response system).

if want embed sabredav symfony, proper way solve subclass both sabre\http\request , sabre\http\response, , set these in server (setting ->httprequest , ->httpresponse properties) before calling ->exec.

your overridden request/response objects should map symfony's equivalents.

i don't know plenty symfony tell if map cleanly , though, , imagine in practice simpler seek work around symfony's scheme (although architectural standpoint, not proper).

php symfony2 symfony-2.1 webdav

html - IE7 position absolute with margin auto bug -



html - IE7 position absolute with margin auto bug -

i have problem positioning , margin in ie7. have got div absolute position , auto margin.

position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: auto;

this div should centered relative position parent. in ie7 not working. here illustration of working code http://jsfiddle.net/3zwka/

vertical centering in css pita, when want ie7 (or ie6) support. there many ways it, each come kind of drawback. method corresponds method 4 in linked article, , known malfunction in ie < 8.

for elements fixed width , height though, more robust method (method 2 in article) consists of positioning @ top: 50%; left: 50% , subtracting half of width top , left margins. works in browsers. here, have fiddle.

html css internet-explorer-7

c# - Get html result from web page -



c# - Get html result from web page -

i planning create movil application (for fun) should utilize result web page (http://consultawebvehiculos.carabineros.cl/index.php). there ways create instance of browser in net code , read result , publish using web service.. like:

var ie= new broswer("http://consultawebvehiculos.carabineros.cl/index.php"); var result=ie.findelementbyid("txtidentitycar").writetext(youridentitycar); publictowebserivce(result);

update: using fiddler can see http post somthing that:

post http://consultawebvehiculos.carabineros.cl/index.php http/1.1 host: consultawebvehiculos.carabineros.cl connection: keep-alive content-length: 61 cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 origin: http://consultawebvehiculos.carabineros.cl user-agent: mozilla/5.0 (windows nt 6.2; wow64) applewebkit/537.17 (khtml, gecko) chrome/24.0.1312.57 safari/537.17 content-type: application/x-www-form-urlencoded referer: http://consultawebvehiculos.carabineros.cl/index.php accept-encoding: gzip,deflate,sdch accept-language: es-es,es;q=0.8 accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.3 accion=buscar&txtletras=cl&txtnumeros1=sk&txtnumeros2=12&vin=

may need .net class webclient in order connect php page...no sure.

update: found solution using fiddler know total parameters , i've used code http://www.hanselman.com/blog/httppostsandhttpgetswithwebclientandcandfakingapostback.aspx

if interested in scraping page, suggest using html agility pack.

if want display page, utilize webbrowser control.

c# .net

Maximum length of WPF .net exe filename -



Maximum length of WPF .net exe filename -

we had situation when file name of wpf .net 4.0 exe exceeds 47(51 including .exe extension) exe not working. says stopped working.

the issue there if set file in side c:\ means not windows limit.

anybody came across situation this.

the issue solved renaming exe file abbreviations. know why happens.

thanks in advance joy

from comments

its normal stopped working dialog.in problem details says:

problem signature: problem event name: bex application name: abcedfghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv.exe application version: 1.0.0.0 application timestamp: 50e559e0 fault module name: igdumd32.dll fault module version: 8.15.10.1995 fault module timestamp: 4af4b4e4 exception offset: 00014fe6 exception code: c0000409 exception data: 00000000 os version: 6.1.7601.2.1.0.256.4 locale id: 1033 additional info 1: 1d75 additional info 2: 1d7537ede8bee0a1d08a5f0d2036cc52

that's stack buffer overflow in igdumd32.dll. congratulations. you've found out hard way intel suck @ writing secure code.

other fact intel graphics accelerator dll graphics card vendor helpfully shoving process , stack overflowing when give long module name, there no limit length of wpf filename, other usual windows restriction of max_path.

.net wpf windows-7

c - Value of char array changes to second iteration value, I want it to be independent -



c - Value of char array changes to second iteration value, I want it to be independent -

i under impression on each run, in strings array, storing @ pos new str since declaring everytime, instead, on 2nd run if addstr become hello, , on first run hi, first run hi becomes hello. want different char array on each run in strings later on each position have different strings. requirements can not utilize malloc, realloc, calloc. thought on 2nd iteration of first loop creating on char str independent of previous one. please help me.

int pos = 0; for(i=0; i<4; i++) { if(file [i]=='a') { char str[5]; int b=0; for(b; b<3; bi++) { str[b]=file[b]; } strings[pos]=str; pos++; } }

when this:

strings[pos]=str;

it simply sets array element buffer pointed 'str'. not re-create string. 'str' buffer never changes, entire array ends pointing same buffer.

rather, @ line need re-create string. if can't utilize malloc, strings array needs have buffers @ each array element (aka 2 dimensional array). maybe declare like:

char strings[5][5];

then instead of using strcpy re-create 'str', re-create string 'strings[pos]';

c

intuit partner platform - Setting IDs for JournalEntry or Invoice -



intuit partner platform - Setting IDs for JournalEntry or Invoice -

i trying insert invoice, credit memo, , invoice using ipp.net. how know accountid, classid, or entityid is? when used web connector write previous interface, able specify these things fullname. need type of query of ids future use? if that, ids ever alter through processes, such re-indexing, or id permanent?

if you're integrating quickbooks online:

yes, ipp apis quickbooks online take id values. have query objects can id values utilize them in future invoice/credit memo add together requests.

if you're integrating quickbooks windows:

the ipp apis quickbooks desktop windows can take either name values, or id values. either query id values, or utilize names in sdk.

a few things worth noting:

the next version of info services intuit releasing (v3) released summer/fall 2013. v3 info services only take id values quickbooks online in v2. so, if want plan ahead future, start querying. :-)

regarding this:

if that, ids ever alter through processes, such re-indexing, or id permanent?

the id values permanent - should never change. the 1 exception this if gets fubar'd on intuit's end , reset someone's sync manager forcefulness quickbooks sync new online realm. shouldn't happen in production.

intuit-partner-platform

Playing multiple videos on smart TV -



Playing multiple videos on smart TV -

i creating samsung smart tv application can play videos playlist. of illustration working fine on browsers not on emulator.

how play multiple videos on samsung smart tv using javascript , html5?

code:

<div id="playlist1" class="sv_playlist"> <div class="video_wrap"> <video id="video1" poster="frame1.jpg" width="640" height="360" preload="none"> <source src="video1.mp4"/> </video> </div> <div class="video_wrap"> <video id="video2" poster="frame2.jpg" width="640" height="360" preload="none"> <source src="video2.mp4" /> </video> </div> <ul class="thumbs"> <li id="thumbnail_v1"> <a href="v1.mp4"> <img alt="thumbnail 1" src="thumbnail1.jpg" width="144" height="81" /> <span class="play"/> </a> </li> <li id="thumbnail_v2"> <a href="v2.mp4"> <img alt="thumbnail 2" src="thumbnail2.jpg" width="144" height="81" /> <span class="play"/> </a> </li> </ul> </div>

samsung back upwards 1 video on page. cant play more 1 video. if want create thumnails, seek animated gifs.

html5-video samsung-smart-tv

How can I declare a local 'matrix' inside a subroutine in FORTRAN? -



How can I declare a local 'matrix' inside a subroutine in FORTRAN? -

i writing subroutine inverse matrix. input matrix (n n), output matrix inva. within subroutine, want declare temporary matrix "temp" dimension (n 2n), declaration caused weird problem. after line (that emphasize below) , declare integer numbers , j , initialise them = 0,j = 0. debug these values of , j, shows = 1572472 ! weird!!!!! if remove line of code " real, dimension (m, m * 2) :: temp " fine. can explain me why ?

thanks in advance. (i programmer in .net , learning fortran - drives me crazy!)

program weird implicit none real, dimension (2,2)::b real, dimension (2,2) ::b_inversed b(1,1) = 0.6 b(1,2) = 0.8 b(2,1) = -0.8 b(2,2) = 0.6 phone call inversematrix(b,b_inversed) contains subroutine inversematrix(a, inva) implicit none real, intent(in), dimension (:,:) :: real, intent(out), dimension (size(a,1),size(a,2)) :: inva real, dimension (size(a,1),2*size(a,2)) :: temp <------this line causes problems integer:: i,j = 0 !<------- j = 0 !<-------debug line stops here, showing = 3734648 !very weird!!!!! inva(1,1) =0.0 inva(1,2) =0.0 inva(2,1) =0.0 inva(2,2) =0.0 end subroutine end programme

this straight forwards fortran code, why didn't right value of 'i' ?

since fortran arrays carry info own sizes improve approach start subroutine bit more this:

subroutine inversematrix(a, inva) ! include next line within scoping unit implicit none real, intent(in), dimension (:,:) :: ! no need tell compilers dims real, intent(out), dimension (size(a,1),size(a,2)) :: inva real, dimension (size(a,1),2*size(a,2)) :: temp

to reply question, can't see why code doesn't work , why variable i doesn't maintain value assign it. wonder whether connected interface of subroutine. in modern fortran it's thought ensure, when technically feasible, compiler generates necessary routine interface. 1 way accomplish set routines modules , use-associate them, write code basic structure

program ! declarations ! executable statements contains subroutine ... end subroutine end programme

rather

subroutine ... end subroutine programme ! declarations ! executable statements end programme

but i'm guessing.

use implicit none , ensure compiler generates routine interfaces; these may not cure immediate problem they're general guidelines , save lot of pain in future.

fortran

c# - How use prnport.dll and ptcprn.dll to print in windows ce -



c# - How use prnport.dll and ptcprn.dll to print in windows ce -

i build windows ce project , trying print study in windows ce device no result.i used functions of prnport.dll , ptcprn.dll,but no result , no exception. utilize visual studio 2008 , windows ce 6.0, pos devise almex.

c# windows-ce

android - Duplicates of thumbnails in GridView -



android - Duplicates of thumbnails in GridView -

i'm looking help solve problem why gridview don't show right number of thumbnails , instead shows lot of duplicates of thumbnails in groups? , when scroll list of thumbnails en downwards , homecoming top, order of images changes time.

anyone knows reason , how solve it? perhaps there improve way create gridview of thumbnails? or phone? utilize samsung young android version 2.3.3. read htc had similar problem.

i preciate help able go on work. thanks!

below code:

public class mainactivity extends activity { cursor cursor; int indexcolumn; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // array columns access string[] projection = {mediastore.images.thumbnails._id}; // cursor object cursor = managedquery(mediastore.images.thumbnails.external_content_uri, projection, null, null, mediastore.images.thumbnails.image_id); // number of columns indexcolumn = cursor.getcolumnindexorthrow(mediastore.images.thumbnails._id); gridview gridview = (gridview) findviewbyid(r.id.gridview); gridview.setadapter(new imageadapter(this)); // send class constructor /* gridview.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { toast.maketext(mainactivity.this, "" + position, toast.length_short).show(); } }); */ gridview.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { // sending image id fullscreenactivity intent = new intent(getapplicationcontext(), fullimageactivity.class); // passing array index i.putextra("id", position); startactivity(i); } }); } // nested class public class imageadapter extends baseadapter { private context mcontext; // constructor public imageadapter(context c) { mcontext = c; } public int getcount() { homecoming cursor.getcount(); } public object getitem(int position) { homecoming position; } public long getitemid(int position) { homecoming position; } // create new imageview each item referenced adapter public view getview(int position, view convertview, viewgroup parent) { imageview imageview; if (convertview == null) { // if it's not recycled, initialize attributes imageview = new imageview(mcontext); // move cursor current position cursor.movetoposition(position); // current value value requested column int imageid = cursor.getint(indexcolumn); // set content of image imageview.setimageuri(uri.withappendedpath(mediastore.images.thumbnails.external_content_uri, "" + imageid)); imageview.setlayoutparams(new gridview.layoutparams(85, 85)); imageview.setscaletype(imageview.scaletype.center_crop); imageview.setpadding(8, 8, 8, 8); } else { imageview = (imageview) convertview; } //imageview.setimageresource(mthumbids[position]); homecoming imageview; } } }

replace getview method following:

// create new imageview each item referenced adapter public view getview(int position, view convertview, viewgroup parent) { imageview imageview; if (convertview == null) { // if it's not recycled, initialize attributes imageview = new imageview(mcontext); } else { imageview = (imageview) convertview; } // move cursor current position cursor.movetoposition(position); // current value value requested column int imageid = cursor.getint(indexcolumn); // set content of image imageview.setimageuri(uri.withappendedpath(mediastore.images.thumbnails.external_content_uri, "" + imageid)); imageview.setlayoutparams(new gridview.layoutparams(85, 85)); imageview.setscaletype(imageview.scaletype.center_crop); imageview.setpadding(8, 8, 8, 8); homecoming imageview; }

tell me if works..

android gridview thumbnails

jquery - .get trying to catch length and append to element -



jquery - .get trying to catch length and append to element -

$('.statused tr .tcr').after('<td class="tc2"><span class="views">0</span> users viewing</td>'); var href = $('.statused .hierarchy a.forumtitle').attr('href'); $.get(href , function(data) { var elem = $(data); var count = $('.listeduser a').length; $('.views').html(elem.find()); }, 'html');

ok can see trying length of hrefs on each href. can't figure out how write lastly bit on $('.views').html(elem.find()); guess bit confusing me really. have simple markup

http://jsbin.com/ijidob/1/

easier see there. need count on each href per tr.

someone have ideas how prepare lastly line run code correctly?

jquery get

c++ - Clearing the content of file at startup and then append -



c++ - Clearing the content of file at startup and then append -

i want append text in file std::fstream. wrote this

class foo() { foo() {} void print() { std::fstream fout ("/media/c/tables.txt", std::fstream::app| std::fstream::out); // fout } };

problem construction every time run program, texts appended previous run. illustration @ end of first run size of file 60kb. @ origin of sec run, texts appended 60kb file.

to prepare want initialize fstream in constructor , open in append mode. this

class foo() { std::fstream fout; foo() { fout.open("/media/c/tables.txt", std::fstream::out); } void print() { fout.open("/media/c/tables.txt", std::fstream::app); // fout } };

problem code 0 size file @ during execution , @ end of run!!

you need open file 1 time :

class foo() { std::fstream fout; foo() { fout.open("/media/c/tables.txt", std::fstream::out); } void print() { //write whatever want file } ~foo(){ fout.close() } };

c++ append fstream

c# - Is it possible to create a method that returns one of two possible types? -



c# - Is it possible to create a method that returns one of two possible types? -

i have 2 info structures: dictionary<string, string> , multimap<string, string>. multimap dictionary under hood. took must of code this question. here's class definition:

public class multimap<tkey, tvalue> : dictionary<tkey, hashset<tvalue>> { ... }

both info structures have .add(tkey key, tvalue value) method.

i have class responsible populating these maps files. have next 2 methods:

public dictionary<string, string> populatedictionary(...) { dictionary<string, string> returndictionary = new dictionary<string, string>(); ... foreach (...) { ... returndictionary.add(key, value); } homecoming returndictionary; } public multimap<string, string> populatemultimap(...) { multimap<string, string> returnmultimap = new multimap<string, string>(); ... foreach (...) { ... returnmultimap.add(key, value); } homecoming returnmultimap; }

as can see, they're same, both around 25 lines long, , difference homecoming type. looking condense 1 method. first effort have method

public dictionary<string, object> populategenericdictionary(...) { ... }

where object either string or hashset<string>. didn't have much luck casting dictionary<string, object> multimap<string, string>.

extracting logic out of methods option, it's not great. because of foreach loops, there's going logic within 2 methods. end methods twice small, there's still 2 identical methods, doesn't solve problem.

this ideal method structure:

public dictionary<string, string> populatedictionary(...) { homecoming methodthatdoesallthelogic(...); } public multimap<string, string> populatemultimap(...) { homecoming methodthatdoesallthelogic(...); } public ??? methodthatdoesallthelogic(...) { ... }

i've been fiddling around casting , generics, can't work. ideas?

edit

i have used millimoose's solution. here's code now:

public dictionary<string, string> generatedictionary(...) { dictionary<string, string> returnmap = new dictionary<string, string>(); populatedictionary(returnmap.add, ...); homecoming returnmap; } public multimap<string, string> generatemultimap(...) { multimap<string, string> returnmap = new multimap<string, string>(); populatedictionary(returnmap.add, ...); homecoming returnmap; } private static void populategenericdictionary(action<string, string> addfunc, ...) { ... foreach (...) { addfunc(key, value); } }

much cleaner!

to work around lack of mutual interface, can invent 1 ad-hoc using bunch of delegate type parameters:

void methodthatdoesallthelogic(action<string, string> addfunc) { // ... addfunc(key, value); // ... } public dictionary<...> populatedictionary() { // ... methodthatdoesallthelogic(result.add); }

(adding more parameters necessary.)

c# generics dictionary casting

Obtaining an old REST Session key -



Obtaining an old REST Session key -

because facebook hasn't migrated functions on graph yet, still need create calls via rest. unfortunately, there doesn't seem way obtain rest session key users take application today.

is there way request rest session key facebook? create of calls via graph, until finish migrating features i'm stuck without one....

thanks in advance!

dw

all rest api methods required session key should fine access token.

i tested links.preview method mentioned before:

https://api.facebook.com/method/links.preview?url=http://www.google.com&format=json&access_token=<removed>

response was:

{ "href":"http:\/\/www.google.com\/", "name":"google", "caption":"www.google.com", "description":"search world's information, including webpages, images, videos , more. google has many special features help find you're looking for.", "media":[ { "type":"image", "src":"http:\/\/www.google.com\/intl\/en_all\/images\/srpr\/logo1w.png" }, { "type":"image", "src":"http:\/\/www.google.com\/images\/google_favicon_128.png" } ] }

session facebook-rest-api

ios - CGRect syntax I haven't seen before -



ios - CGRect syntax I haven't seen before -

i saw syntax below in illustration code , not sure understand it.

cgrect imagerect = (cgrect){.size = baseimage.size};

is shorthand way of initializing cgrect equivalent to:

cgrect imagerect = cgrectmake(0,0,baseimage.size.width, baseimage.size.height);

is there benefit syntax aside less typing?

that's c99 initializer syntax. can utilize structure.

the main advantage objective-c gives objective-c syntax, fields close values rather implied positioning. (that's not intentionally similar, or it's advantage. nice.)

it's more typing, utilize everywhere now.

consider:

cgrect = cgrectmake(a+c/2, b+d/2, c, d);

in order understand this, need understand order of parameters. need able grab commas eyes. in case, that's pretty easy, if expressions more complicated you'd storing them in temporary variable first.

the c99 way:

cgrect = (cgrect){ .origin.x = a+c/2, .origin.y = b+d/2, .size.width = c, .size.height = d };

it's longer, it's more explicit. it's easy follow assigned what, no matter how long look are. it's more objective-c method. after all, if cgrect class, this:

cgrect *a = [[cgrect alloc] initwithoriginx:x originy:y width:w height:h];

you can things this:

cgrect = (cgrect){ .origin = myorigin, .size = computedsize };

here, you're building rectangle using cgpoint , cgsize. compiler understands .origin expects cgpoint, , .size expects cgsize. you've provided that. all's gravy.

the equivalent code cgrectmake(myorigin.x, myorigin.y, size.width, size.height). using cgrectmake you're no longer expressing same kind of meaning compiler. can't stop assigning part of size origin. won't stop assigning width height. doesn't give clue x , y; if you've used apis provide vertical coordinates first, you'll wrong.

you can assign part construction , part floats well:

cgrect = (cgrect){ .origin = myorigin, .size.width = c, .size.height = d };

the cgrectmake function predates c99. have no evidence effect, think if c99 had come first cgrectmake wouldn't exist @ all; it's sort of crusty function write when language has no direct way perform initialization. does.

basically, if utilize while, you'll come prefer c99 syntax. it's more explicit, more flexible, more objective-c-like , harder screw up.

unfortunately, of 4.6 xcode not autocomplete construction field names when in c99 field initializer list.

ios core-graphics

ruby - couldn't load "nokogiri" in the IRB -



ruby - couldn't load "nokogiri" in the IRB -

i have installed nokogiri in required ruby lib file below:

c:\ruby193>gem list *** local gems *** addressable (2.3.2) bigdecimal (1.1.0) builder (3.1.4) bundler (1.2.3) childprocess (0.3.6) domain_name (0.5.7) ffi (1.3.1 x86-mingw32) git (1.2.5) hoe (3.4.1) httpclient (2.3.2) io-console (0.3) jar_wrapper (0.1.2) jeweler (1.8.4) json (1.5.4) libwebsocket (0.1.7.1) mechanize (2.5.1) mechanize-downloader (0.0.1) mime-types (1.19) mini_magick (3.2.1) minitest (2.5.1) multi_json (1.5.0) net-http-digest_auth (1.2.1) net-http-persistent (2.8) nokogiri (1.5.6 x86-mingw32) ntlm-http (0.1.1) progressbar (0.12.0) rake (0.9.2.2) rautomation (0.7.3) rdoc (3.9.4) rubyzip (0.9.9) s4t-utils (1.0.4) selenium (0.2.5) selenium-webdriver (2.27.2) subexec (0.0.4) unf (0.0.5) unf_ext (0.0.5 x86-mingw32) user-choices (1.1.6.1) watir-classic (3.4.0) watir-webdriver (0.6.2) webrobots (0.0.13) websocket (1.0.6) win32-api (1.4.8 x86-mingw32) win32-process (0.7.1) win32screenshot (1.0.7) windows-api (0.4.2) windows-pr (1.2.2) xml-simple (1.1.2) zip (2.0.2)

now in below when trying nokogiri,getting error below,whereas installed in desktop.

c:\ruby193>irb irb(main):001:0> require 'nokogiri' loaderror: cannot load such file -- nokogiri c:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i n `require' c:/ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i n `require' (irb):1 c:/ruby193/bin/irb:12:in `<main>' irb(main):002:0> require 'selenium-webdriver' => true irb(main):003:0>

did seek install mswin32-60 version instead of x86-mingw32 one?

gem install nokogiri --platform=x86-mswin32-60

edit

alternatively, seek updating rubygems version gem update --system

ruby nokogiri

JavaScript Unit Test. What to mock? -



JavaScript Unit Test. What to mock? -

i'm trying introduce unit test in development process , i'm not sure how it.

i have big application lot of modules ( separated js files ). example:

videoinfo.js availablevideos.js availablechannels.js networksettings.js .......

there few modules provide services rest:

eventhandler.js i18n.js ajax.js configuration.js auth.js basemodule.js ........

the question is: how test module videoinfo.js uses services modules? see 2 approaches:

i load videoinfo.js , mock internal interfaces. problem won't grab errors if of internal interfaces change. i load modules (the whole app) , test videoinfo real app environment ( except external ajax calls simulated)

what approach when have lot of internal dependencies?

ideally, want both of approaches in test suite.

you want mock of dependencies (in illustration videoinfo.js) can isolate code else , sure working correctly. depending on design of code have, can difficult. code may not have been written testing in mind , won't lend mocking.

you want have entire app level series of tests create sure interactions between parts work correctly. depending on app, these tests can brittle due dependence on info have no command over.

these tests in separate suites can run independently of each of other.

if getting started in writing tests code, write best test can. tests code , should refactored go along. write easiest test can. writing tests legacy code extremely difficult. current design may hard test properly. when making changes can.

javascript unit-testing qunit

dom - Failed to fetch xml data from res in Android 3.0 and above -



dom - Failed to fetch xml data from res in Android 3.0 and above -

similar issue

having few predefined xml kept under res>raw>first.xml fetch @ runtime , displying info below:

nodelist nodes = mainactivity.commonmethod.getdocumentfile(productactivity.this,_introwid).getelementsbytagname("string"); (int = 0; < nodes.getlength(); i++) { element e = (element)nodes.item(i); e.normalize(); _arrproductname.add( mainactivity.commonmethod.getvalue(e, "string")); }

method xml file(plist file) using document

public document getdocumentfile(context context, int rawid) { documentbuilderfactory builderfactory = documentbuilderfactory.newinstance(); builderfactory.setnamespaceaware(true); documentbuilder builder = null; seek { builder = builderfactory.newdocumentbuilder(); document = builder.parse(context.getresources().openrawresource( rawid)); document.getdocumentelement().normalize(); } grab (exception e1) { // todo auto-generated grab block e1.printstacktrace(); } homecoming document; }

getvalue method

public string getvalue(element item, string str) { nodelist n = item.getelementsbytagname(str); seek { stringwriter sw = new stringwriter(); transformer serializer = transformerfactory.newinstance().newtransformer(); serializer.transform(new domsource(n.item(0)), new streamresult(sw)); string result = sw.tostring(); system.out.println("result="+result); } grab (exception e) { e.printstacktrace(); } homecoming commonmethod.getelementvalue(n.item(0)); } public final static string getelementvalue(node elem) { node kid; if (elem != null) { if (elem.haschildnodes()) { (kid = elem.getfirstchild(); kid != null; kid = kid .getnextsibling()) { if (kid.getnodetype() == node.text_node) { homecoming kid.getnodevalue(); } } } } homecoming ""; }

test.xml

<?xml version="1.0" encoding="utf-8"?> <array> <!-- prdocuname --> <string>android ics 4.0™</string> <!-- prdocutdescription --> <string>mobile</string> <!-- prdocuimage --> <string>mobile.png</string> <!-- prdocuaddress --> <string>url</string> <!-- conversion --> <integer>400</integer> <!-- thicknessnames --> <string>skim</string> <!-- thicknessvalues --> <string>1</string> <!-- longdescription --> <string>android market leader in terms of total number of device sold , leader in terms of total number of application available in market.</string> </array>

above entire code work below 4.0 not above 4.0, getelementsbytagname` homecoming null result above 4.0.

result in below 4.0

<?xml version="1.0" encoding="utf-8"?><string>android ics 4.0™</string>

result in above 4.0

<?xml version="1.0" encoding="utf-8"?>

string tag missing while testing in above 4.0,

finally achieved, made changes within getvaluefunction;

change code:

public string getvalue(element item, string str) { string strresponse=""; node kid; if(item!=null) { if(item.haschildnodes()) { for(kid=item.getfirstchild(); kid!=null; kid =kid.getnextsibling()) { if (kid.getnodetype() == node.text_node) { strresponse =kid.getnodevalue(); homecoming strresponse; } } }else { nodelist n = item.getelementsbytagname(str); n = item.getchildnodes(); if(((node) n.item(0))!=null) { if(((node) n.item(0)).getnodevalue() !=null) { strresponse =((node) n.item(0)).getnodevalue(); homecoming strresponse; }else { strresponse =""; } } } } homecoming strresponse; }

its works perfectly!

android dom xml-parsing

Entity framework Invalid Column name, EF adds numer 1 to primary key -



Entity framework Invalid Column name, EF adds numer 1 to primary key -

i have 2 entityes

public partial class suscriptores { public suscriptores() { this.publicacion = new hashset<publicacion>(); } [key] public int idsuscriptor { get; set; } public string logosuscriptor { get; set; } public string identificacion { get; set; } public string nombre { get; set; } public string direccion { get; set; } public string telefono { get; set; } public string email { get; set; } public string fax { get; set; } public string home { get; set; } public virtual icollection<publicacion> publicacion { get; set; } } public partial class publicacion { public publicacion() { this.edictos = new hashset<edictos>(); } [key] public decimal idpublicacion { get; set; } public system.datetime fechapublicacion { get; set; } public string idusuario { get; set; } public system.datetime fechapublicacionhasta { get; set; } public system.datetime fechaarchivohasta { get; set; } public int idsuscriptor { get; set; } public decimal idtipopublicacion { get; set; } [foreignkey("idsuscriptor")] public virtual suscriptores suscriptores { get; set; } }

when seek run query:

public actionresult detailsvsto(string identificacion) { var susq = s in db.suscriptores s.identificacion == identificacion select s; homecoming json(susq.first(), jsonrequestbehavior.allowget); }

it throw message:

system.data.sqlclient.sqlexception: invalid column name 'suscriptores_idsuscriptor1'

trying solve problem add together fluent @ dbcontext

modelbuilder.entity<suscriptores>() .hasmany(x => x.publicacion) .withrequired(x => x.suscriptores) .map(a => a.mapkey("idsuscriptor"));

but problem persist. how can solve this.

try add together many-to-one mapping well. please utilize pure fluent api, , should remove [foreignkey] annotations.

modelbuilder.entity<publicacion>() .hasrequired(x => x.suscriptores) .withmany(x => x.publicacion);

entity-framework entity-framework-4 entity-framework-5

java - Setting the minimum value of yAxes in afreechart android -



java - Setting the minimum value of yAxes in afreechart android -

i using afreechart plot timeseries in example code if chart panned vertically reach areas of negative y axes. want avoid , want set min , max both y , x axes. tried doing below:-

valueaxis yaxes=plot.getrangeaaxis(); yaxes.setrange(0,100);

but not seem work , still able pan chart non-negative y values area.

ok solved myself.. extending class demoview in example. changed values below:-

this.domainmovable=true; this.rangemovable=false;

it might dirty way job

java android jfreechart

zookeeper - How to get data from old offset point in Kafka? -



zookeeper - How to get data from old offset point in Kafka? -

i using zookeeper info kafka. , here info lastly offset point. there way specify time of offset old data?

there 1 alternative autooffset.reset. accepts smallest or largest. can please explain smallest , largest. can autooffset.reset helps in getting info old offset point instead of latest offset point?

the consumers belong grouping and, each partition, zookeeper keeps track of progress of consumer grouping in partition.

to fetch beginning, can delete info associated progress hussain refered

zkutils.maybedeletepath(${zkhost:zkport}", "/consumers/${group.id}");

you can specify offset of partition want, specified in core/src/main/scala/kafka/tools/updateoffsetsinzk.scala

zkutils.updatepersistentpath(zkclient, topicdirs.consumeroffsetdir + "/" + partition, offset.tostring)

however offset not time indexed, know each partition sequence.

if message contains timestamp (and beware timestamp has nil moment kafka received message), can seek indexer attempts retrieve 1 entry in steps incrementing offset n, , store tuple (topic x, part 2, offset 100, timestamp) somewhere.

when want retrieve entries specified moment in time, can apply binary search rough index until find entry want , fetch there.

offset zookeeper apache-kafka

Where can I find an up to date list of Browsers (and Versions) Supported by Selenium Grid? -



Where can I find an up to date list of Browsers (and Versions) Supported by Selenium Grid? -

i maximize stability of grid using supported web browser versions. can find list of browsers on seleniumhq website ...however appears quite out of date, mentioning firefox 7 example.

am missing something?

really appreciate advice, kind regards, luke

that list, whilst out of date, right.

you won't find updated list (since website isn't updated often), have scraped info 1 of selenium mailing lists:

firefox: earliest esr release , upwards, currently firefox 10 , upwards. ie: 6 , upwards. chrome: 12 , upwards

it must said next 2 points:

don't surprised if, go downwards in version numbers (older versions of browser), may end hitting weird issues.

as firefox has quick release schedule, can end latest version of firefox beingness incompatible selenium. can offset disabling firefox's auto-updates altogether (you argue, user's may not updating straight away ui tests may not necessarily need run against latest version).

selenium grid selenium-webdriver

plsql - Is it advantageous using cursor in Oracle for frontend applications? -



plsql - Is it advantageous using cursor in Oracle for frontend applications? -

i have 2 tables in database. each table having 2000 records. have big number of records write optimal code retrieving records. user_details table is:

+---------+-----------+-----------+ | user_id | user_name | join_date | +---------+-----------+-----------+

the sec table refering user_details table is:

+---------+-----------+-----------+ | user_id | fav_color | fav_dish | +---------+-----------+-----------+

i have 2 approaches first one:

select ud.*,fav.fav_color, fav.fav_dish user_details ud, fav_details fav ud.user_id = fav.user_id;

second approach writing pl/sql procedure is:

declare cursor c1(x number) select * user_details user_id = x; cursor c2 select * user_fav; y number := &user_id; begin c in c1(y) loop dbms_output.put_line('user details'); dbms_output.put_line('----------------'); d in c2 loop if c.deptno = d.deptno dbms_output.put_line(rpad(c.user_id,10)||rpad(c.user_name,10)||rpad(d.fav_color,10)); end if; end loop; end loop; end;

which code give improve performance , why? want finish details of user.

if using cursor records form server sga? utilize database in jsp page accessed mobile devices only.

as net in mobile device slow of target users (around 10kb) hence concerned bandwidth. in point of view find performing bring together cartesian product , check matching result take 1 status out of 1000*1000 conditions checking conditions in pl/sql block 1000 + 1000. reduces number of conditions. per knowledge cursor create shadow page in client memory , create table. means fetch info form server , store in client. right @ point?

you can read here tom kyte's mantra:

you should in single sql statement if @ possible. if cannot in single sql statement, in pl/sql. if cannot in pl/sql, seek java stored procedure. if cannot in java, in c external procedure. if cannot in c external routine, might want think why need it…

basically using plsql stored procedure move sql engine plsql engine , forward. more that, if have right indexes , build query right, sql optimizer create things faster you.

here asktom post

oracle plsql cursor

jquery .html() does not reflect actual html; google chrome 24.0.1312.57 -



jquery .html() does not reflect actual html; google chrome 24.0.1312.57 -

jquery 1.9.1 or later, chrome 24 on osx 10.8.2.

i'm having problem getting chrome select given value in select list, , setting obj.val('foo') not working whereas $("option[value='foo']",obj).prop("selected",true) working.

i'm getting mixed results between different browsers (ie, chrome, firefox) running on windows , mac.

obj.val('foo')

is not working on mac chrome only. crazy!

i noticed if @ .html() of object, not show item selected, though reading val() property reports properly. say, i'm expecting (but not) see

<option value="bucket" selected="selected">bucket</option>

http://jsfiddle.net/frumbert/a4rzy/

is bug in chrome's implementation of innerhtml() (which http://api.jquery.com/html/ states beingness used) ?

jquery google-chrome

api - Dropbox Signature issues when downloading file, but account/info works fine -



api - Dropbox Signature issues when downloading file, but account/info works fine -

dropbox signature issues when downloading file, account/info works fine:

this - https://api.dropbox.com/1/account/info?oauth_consumer_key=cy6ymyqsb2yymw1&oauth_signature_method=plaintext&oauth_token=e98gtg5b2wo9o51&oauth_signature=o2jwldqtqfbmqkg%2526ller5vort89ab2r

works perfect time.

this - https://api-content.dropbox.com/1/files/dropbox/test.txt?oauth_consumer_key=cy6ymyqsb2yymw1&oauth_signature_method=plaintext&oauth_token=e98gtg5b2wo9o51&oauth_signature=o2jwldqtqfbmqkg%2526ller5vort89ab2r

produces error:

403 forbidden, {"error": "host: rpc.dropbox.com:443, fe: none, x-dropbox-requestid: none, bad oauth_signature oauth_signature_method 'plaintext'"}

what i'm missing?

i discovered issue.

in request

https://api-content.dropbox.com/1/files/dropbox/test.txt?oauth_consumer_key=cy6ymyqsb2yymw1&oauth_signature_method=plaintext&oauth_token=e98gtg5b2wo9o51&oauth_signature=o2jwldqtqfbmqkg%2526ller5vort89ab2r

%2526 double escaped &. fixing helped.

but interesting first query has same issue, drobpox doesn't complain.

api rest dropbox

How to get artifact from maven repository without maven? -



How to get artifact from maven repository without maven? -

first, not maven user. need library: https://github.com/ansell/jenasesame source code available. readme shows information:

repository http://openjena.org/repo-dev group: org.openjena artifact: jena-sesame

but when browse location 404. how can grab artifact repository? i'm willing install maven if have to it; need compiled library jars.

i have searched maven central repository @ http://search.maven.org , , not there.

any publicly-accessible repository should viewable in browser, , such should able download jar file contained within. url you've listed, http://openjena.org/repo-dev, looks more development repository. there plenty of repositories around world internal repositories, looks 1 hasn't been set public consumption.

it looks have binary releases available download here: http://www.apache.org/dist/jena/ have looked there you're after?

maven maven-3

javascript - Expand div when node is selected -



javascript - Expand div when node is selected -

i have basic p:tree visualize components database. want expand tree way:

when select node want open div layer below component , display additional info component picture. far made jsf code:

<h:form> <p:growl id="growl1" showsummary="true" showdetail="true" cached="true" autoupdate="true"/> <p:tree id="tree" styleclass="treeskin" value="#{treeviewcontroller.root}" var="node" dynamic="true" animate="true" selectionmode="single" selection="#{treeviewcontroller.selectednode}" highlight="true"> <p:ajax event="select" listener="#{treeviewcontroller.onnodeselect}"/> <p:ajax event="expand" listener="#{treeviewcontroller.onnodeexpand}" /> <p:ajax event="collapse" listener="#{treeviewcontroller.onnodecollapse}" /> <p:treenode styleclass="treeskin"> <h:outputtext value="#{node}"/> </p:treenode> </p:tree> </h:form>

is possible?

javascript jsf jsf-2 primefaces

hex - Java bit comparison, bitset? -



hex - Java bit comparison, bitset? -

i've got word 'bitset' stuck in head solution problem think might getting myself confused.

i've got list of hex values indicate conditions, such as:

0x0001 = outside 0x20000000 = blah...

now i'm reading in int, , want compare int against of existing hex conditions see matches. can match zero, one, or many.

is bitset want, or there simpler way of doing it?

i sense bit silly asking this, can't remember sodding thing called! :)

many thanks

are looking bitmasking? each bit in int represents boolean value, set (1, means true) , unset (0, means false). example:

public class maskingexample { private static final int outside_mask = 1; // right-most bit private static final int heated_mask = 1 << 1; // second-to-right-most bit private static final int wet_mask = 1 << 2; // third-to-right-most bit private int value = 0; public boolean isoutside() { homecoming isbitset(outside_mask, value); } public void setoutside(boolean outside) { value = outside ? setbit(outside_mask, value) : unsetbit(outside_mask, value); } // other setters , getters private static int setbit(int mask, int value) { homecoming value | mask; } private static int unsetbit(int mask, int value) { homecoming value & ~mask; } private static boolean isbitset(int mask, int value) { homecoming (value & mask) == mask; } }

if need more 32 conditions, utilize long masks , value, , add together l each of 1 values beingness shifted, , can have 64 conditions, this:

private static final long outside_mask = 1l; // right-most bit private static final long heated_mask = 1l << 1; // second-to-right-most bit private static final long wet_mask = 1l << 2; // third-to-right-most bit private long value = 0;

you can set more 1 bit @ time too, way. combine masks single mask using &:

public void setoutsideandraining(boolean outsideandraining) { int combomask = outside_mask & wet_mask; value = outsideandraining ? setbit(combomask, value) : unsetbit(combomask, value); }

edit: after seeing kaliatech's reply below, utilize bitset. solution similar, math logic encapsulated in bitset object , allows arbitrary number of bits aren't limited 64.

public class maskingexample { private static final int outside_position = 0; private static final int heated_position = 1; private static final int wet_position = 2; private static final int total_conditions = 3; private bitset bitset = new bitset(total_conditions); public boolean isoutside() { homecoming bitset.get(outside_position); } public void setoutside(boolean outside) { bitset.set(outside_position, outside); } // other setters , getters }

java hex logic bits bitset

pdf - Printing in Java to a label printer that is not default printer -



pdf - Printing in Java to a label printer that is not default printer -

i need print label printer. found code below in net , trying modify needs. works fine when label printer default printer in system, when set other printer default doesn't print properly. in image on link below 1 can see result when default (the 1 on right), first effort when not default (the middle one) , sec effort when not default. need print whether printer default or not, since part of software releasing clients. question is: there specific attributes or commands should sent printer in order print when not default printer? or how can set printer default printer within code, before printing, , restore default printer when done printing? image link (https://lh4.googleusercontent.com/-jba7ba77ik0/urplehzyvie/aaaaaaaaqwg/bo4ee3wepjg/s279-c/21213)

the source code

/* * copyright (c) 2004 david flanagan. rights reserved. * code book java examples in nutshell, 3nd edition. * provided as-is, without warranty either expressed or implied. * may study, use, , modify non-commercial purpose, * including teaching , utilize in open-source projects. * may distribute non-commercially long retain notice. * commercial utilize license, or purchase book, * please visit http://www.davidflanagan.com/javaexamples3. */ //package je3.print; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import javax.print.doc; import javax.print.docflavor; import javax.print.docprintjob; import javax.print.printexception; import javax.print.printservice; import javax.print.printservicelookup; import javax.print.simpledoc; import javax.print.streamprintservice; import javax.print.streamprintservicefactory; import javax.print.attribute.attribute; import javax.print.attribute.hashprintrequestattributeset; import javax.print.attribute.printrequestattributeset; import javax.print.attribute.standard.orientationrequested; import javax.print.event.printjobadapter; import javax.print.event.printjobevent; import org.apache.pdfbox.pdmodel.pddocument; /** * utility programme demonstrates javax.print api , allows list * available printers, query named printer, print text , image files * printer, , print postscript files. */ public class print { public static void main(string[] args) throws ioexception { // these values we'll set command-line arguments boolean query = false; string printername = "brother ql-570 le"; string inputfilename = "c:\\dev\\label.pdf"; printrequestattributeset attributes = new hashprintrequestattributeset(); attributes.add(orientationrequested.landscape); if (query) { // named printer can back upwards // attributes , print status queryprinter(printername, attributes); } else { // print named printer, or default // printer otherwise. print(printername, inputfilename, attributes); } // main() method ends here, there may printing thread // operating in background. programme may not terminate // until printing completes. } // list names of printservices can back upwards attributes public static void queryservices(printrequestattributeset attributes) { // find services can back upwards specified attributes printservice[] services = printservicelookup.lookupprintservices(null, attributes); // loop through available services (int = 0; < services.length; i++) { // print service name system.out.print(services[i].getname()); // query , print document types can print docflavor[] flavors = services[i].getsupporteddocflavors(); (int j = 0; j < flavors.length; j++) { // filter out docflavors have representation class other // java.io.inputstream. string repclass = flavors[j].getrepresentationclassname(); if (!repclass.equals("java.io.inputstream")) continue; system.out.println("\t" + flavors[j].getmimetype()); } } } // list details named printer public static void queryprinter(string printername, printrequestattributeset attributes) { // find named printer printservice service = getnamedprinter(printername, attributes); if (service == null) { system.out.println(printername + ": no such printer capable of " + "handling specified attributes"); return; } // print status , other info printer system.out.println(printername + " status:"); attribute[] attrs = service.getattributes().toarray(); (int = 0; < attrs.length; i++) system.out.println("\t" + attrs[i].getname() + ": " + attrs[i]); } // print contents of named file named printer (or // default printer if printername null) requesting specified // attributes. public static void print(string printername, string filename, printrequestattributeset attributes) throws ioexception { // printer can back upwards attributes printservice service = getnamedprinter(printername, attributes); if (service == null) { system.out.println("can't find printer " + "with specified attributes"); return; } // print file printer. see method definition below printtoservice(service, filename, attributes); // allow user know pick printout system.out.println("printed " + filename + " " + service.getname()); } // print output file instead of printer public static void printtofile(string outputfilename, string outputfiletype, string inputfilename, printrequestattributeset attributes) throws ioexception { // determine whether scheme can print specified type, , // mill object if so. // name of static method way long! streamprintservicefactory[] factories = streamprintservicefactory .lookupstreamprintservicefactories(null, outputfiletype); // error message if can't print specified output type if (factories.length == 0) { system.out.println("unable print files of type: " + outputfiletype); return; } // open output file fileoutputstream out = new fileoutputstream(outputfilename); // printservice object print file streamprintservice service = factories[0].getprintservice(out); // print using method below printtoservice(service, inputfilename, attributes); // , remember close output file out.close(); } // print contents of named file specified printservice, // requesting specified attributes. // shared code used print() , printtofile() above. public static void printtoservice(printservice service, string filename, printrequestattributeset attributes) throws ioexception { // figure out type of file we're printing docflavor flavor = getflavorfromfilename(filename); // open file //inputstream in = new fileinputstream(filename); pddocument document = null; seek { document = pddocument.load(filename); } grab (exception e) { system.out.println("unable open pdf file "); } // create doc object print file , flavor. doc doc = new simpledoc(document, flavor, null); // create print job service docprintjob job = service.createprintjob(); // monitor print job listener job.addprintjoblistener(new printjobadapter() { public void printjobcompleted(printjobevent e) { system.out.println("print job complete"); system.exit(0); } public void printdatatransfercompleted(printjobevent e) { system.out.println("document transfered printer"); } public void printjobrequiresattention(printjobevent e) { system.out.println("print job requires attention"); system.out.println("check printer: out of paper?"); } public void printjobfailed(printjobevent e) { system.out.println("print job failed"); system.exit(1); } }); // print document, catching errors seek { job.print(doc, attributes); } grab (printexception e) { system.out.println(e); system.exit(1); } } // utility method printers can back upwards specified // attributes , homecoming 1 matches specified name. public static printservice getnamedprinter(string name, printrequestattributeset attrs) { printservice[] services = printservicelookup.lookupprintservices(null, attrs); if (services.length > 0) { if (name == null) homecoming services[0]; else { (int = 0; < services.length; i++) { if (services[i].getname().equals(name)) homecoming services[i]; } } } homecoming null; } // utility method homecoming docflavor object matching // extension of filename. public static docflavor getflavorfromfilename(string filename) { string extension = filename.substring(filename.lastindexof('.') + 1); extension = extension.tolowercase(); if (extension.equals("gif")) homecoming docflavor.input_stream.gif; else if (extension.equals("jpeg")) homecoming docflavor.input_stream.jpeg; else if (extension.equals("jpg")) homecoming docflavor.input_stream.jpeg; else if (extension.equals("png")) homecoming docflavor.input_stream.png; else if (extension.equals("ps")) homecoming docflavor.input_stream.postscript; else if (extension.equals("txt")) homecoming docflavor.input_stream.text_plain_host; else if (extension.equals("pdf")) homecoming docflavor.service_formatted.pageable; // fallback: seek determine flavor file content else homecoming docflavor.input_stream.autosense; } }

public static void main(string[] args) { seek { fileinputstream fis = new fileinputstream("c:\\n0018902726.pdf"); docflavor flavor = docflavor.input_stream.autosense; docattributeset das = new hashdocattributeset(); doc pdfdoc = new simpledoc(fis, flavor, null); printservice printservice = printservicelookup.lookupdefaultprintservice(); docprintjob printjob = printservice.createprintjob(); printjob.print(pdfdoc, new hashprintrequestattributeset()); fis.close(); } grab (exception e) { system.out.println("exception : " +e.getmessage()); } }

java pdf printing

c - How size allocted by malloc is depends on RAM? -



c - How size allocted by malloc is depends on RAM? -

this question has reply here:

maximum memory malloc can allocate 7 answers while(1){ static int i=1; int *p; if(p=malloc(1024*1024)) //assigning 1 mb space printf("%d.",i++); else exit(0); }

if above programme run in scheme having 1gb ram , in scheme having 4gb ram difference in time , value of ???

we don't know, since it's implementation detail. c standard says nil this.

c memory-management malloc

html5 - Python CGI - UTF-8 doesn't work -



html5 - Python CGI - UTF-8 doesn't work -

for html5 , python cgi:

if write utf-8 meta tag, code doesn't work. if don't write, works.

page encoding utf-8.

print("content-type:text/html") print() print(""" <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> şöğıçü </body> </html> """)

this codes doesn't work.

print("content-type:text/html") print() print(""" <!doctype html> <html> <head></head> <body> şöğıçü </body> </html> """)

but codes works.

for cgi, using print() requires right codec has been set output. print() writes sys.stdout , sys.stdout has been opened specific encoding , how determined platform dependent and can differ based on how script run. running script cgi script means pretty much not know encoding used.

in case, web server has set locale text output fixed encoding other utf-8. python uses locale setting produce output in in encoding, , without <meta> header browser correctly guesses encoding (or server has communicated in content-type header), <meta> header telling utilize different encoding, 1 wrong info produced.

you can write straight sys.stdout.buffer, after explicitly encoding utf-8. create helper function create easier:

import sys def enc_print(string='', encoding='utf8'): sys.stdout.buffer.write(string.encode(encoding) + b'\n') enc_print("content-type:text/html") enc_print() enc_print(""" <!doctype html> <html> <head> <meta charset="utf-8"> </head> <body> şöğıçü </body> </html> """)

another approach replace sys.stdout new io.textiowrapper() object uses codec need:

import sys import io def set_output_encoding(codec, errors='strict'): sys.stdout = io.textiowrapper( sys.stdout.detach(), errors=errors, line_buffering=sys.stdout.line_buffering) set_output_encoding('utf8') print("content-type:text/html") print() print(""" <!doctype html> <html> <head></head> <body> şöğıçü </body> </html> """)

python html5 utf-8 python-3.x cgi

css - google maps in black & white html code -



css - google maps in black & white html code -

can help me out? i'm trying create google maps in black , white can't find way found website has implemented http://www.creuna.com/contact/find-us/. clue?

i haven't used before, looks google's maps api has styling section allows customize , sense of maps:

https://developers.google.com/maps/documentation/javascript/styling

there lot of examples included should able help.

css google-maps css3 design google-maps-api-3

html - I am not sure how to convert my webpages Table over to divs instead -



html - I am not sure how to convert my webpages Table over to divs instead -

i have table on website , wanting switch on utilize divs instead still working on studying html , not sure how go it. have css called theme.css , know somthing goes in cause work.

<table> <tr> <td> <table> <tr> <td class="cellwidth"> <img src="4-cute-cats.jpg" class="centerimage" width="300" height="300" /> <p class="centertext">they hunt in packs.</p> </td> <td> <img src="cat_sniping.jpg" class="centerimage" width="256" height="192" /> <p class="centertext">sniper cat</p></a> </td> <td class="cellwidth"> <img src="lol1.jpg" class="centerimage" width="300" height="298" /> <p class="centertext">sneaking cat</p> </td> <td class="cellwidth"> <img src="hammercat.jpg" class="centerimage" width="300" height="163" /> <p class="centertext">80s cat</p> </td> </tr> <tr> <td class="cellwidth"> <img src="kittytrap.jpg" class="centerimage" width="200" height=492 /> <p class="centertext">it's trap!</p> </td> <td class="cellwidth"> <img src="chop-cats.jpg" class="centerimage" width="300" height="140" /> <p class="centertext">they can strip auto frame in under 2:00 minutes.</p> </td> <td class="cellwidth"> <img src="smartkat.jpg" class="centerimage" width="200" height="338" /> <p class="centertext">intelligent cat.</p></a> </td> <td class="cellwidth"> <img src="narniacat.jpg" class="centerimage" width="200" height="337" /> <p class="centertext">once cat of narnia cat of narnia.</p> </td> </tr> <tr> <td class="cellwidth"> <img src="lolcats3.jpg" class="centerimage" width="300" height="108" /> <p class="centertext">tired cat.</p> </td> <td class="cellwidth"> <img src="lol_cats_1.jpg" class="centerimage" width="300" height="142" /> <p class="centertext">gollum cat.</p> </td> <td class="cellwidth"> <img src="magical-kitty.png" class="centerimage" width="300" height="180" /> <p class="centertext">super cat.</p> </td> <td class="cellwidth"> <img src="sad-kitty.jpg" class="centerimage" width="300" height="188" /> <p class="centertext">sad kitty.</p> </td> </tr> <tr> <td class="cellwidth"> <img src="cat-in-your-wallpaper.jpg" class="centerimage" width="300" height="200" /> <p class="centertext">wallpaper cat. </td> <td class="cellwidth"> <img src="thinking-cat.jpg" class="centerimage" width="300" height="475" /> <p class="centertext">thinking cat.</p> </td> <td class="cellwidth"> <img src="http://3.bp.blogspot.com/_znunebehigk/tsoor5duoqi/aaaaaaaabfy/-rpe8s1uro8/s1600/000.jpg&w=823&h=618&ei=_a4vufp7l4gy2qxj-ohidq&zoom=1&ved=1t:3588,r:79,s:0,i:354&iact=rc&dur=2621&sig=108293906633680688065&page=3&tbnh=172&tbnw=231&start=67&ndsp=38&tx=64&ty=72" class="centerimage" width="300" height="225" /> <p class="centertext">gamer kitty.</p> </td> <td class="cellwidth"> <img src="http://www.dumpaday.com/wp-content/uploads/2013/01/funny-lol-cats-playing-with-toilet-paper1.jpg" class="centerimage" width="300" height="504" /> <p class="centertext">couch cat.</p> </td> </tr> </table> </td> </tr> <tr> <td align="center"> <a href="morekitties.html">more kitties</a> </td> </tr> </table>

demo: http://jsfiddle.net/klmpv/

here starting point. see if can understand this, , convert table layout similar.

html

<div class="wrapper"> <article> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </article> <article> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </article> <article> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </article> <article> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </article> <article> <div class="item"></div> <div class="item"></div> <div class="item"></div> <div class="item"></div> </article> </div>

css

.wrapper { margin: 1%; background: #f5f5f5; overflow: hidden; } .item { height: 200px; float: left; display: inline-block; width: 23%; position: relative; background: pink; margin: 1%; }

html css

image - php cannot be displayed because it contains errors -



image - php cannot be displayed because it contains errors -

i getting next error when run script php cannot displayed because contains errors

the script, takes file, resizes outputs screen , file.

url_example: localhost/testimage.php?img=img_592_121_200.jpg

i have read posts , tried proposed solutions. failed

the file not output screen/browser can gets save file.

here code, stripped white space off , empty lines. , hard-coded file name within script

**am starting suspect setup, not sure how/where start looking

edit : simplified go output screen only

testimage.php

<?php //session_start(); //ob_start(); ini_set("display_errors", "1"); error_reporting(e_all); header('content-type:image/jpeg'); //$cachefile="mypicxxx.jpg"; //$cache_dir="cache/1/592/"; $img_dir="webspace/1/592/"; $img="img_592_121.jpg"; $id="$img_dir$img"; $src=imagecreatefromjpeg($id); $new_width=200; $new_height=77; $width=600; $height=1001; $w_src=600; $h_src=1001; $img=imagecreatetruecolor($new_width,$new_height); imagecopyresampled($img,$src,0,0,0,0,$new_width,$new_height,$w_src,$h_src); imagejpeg($img,null,45); //$cachefile=$cache_dir.$cachefile; //imagejpeg($img,$cachefile,45); imagedestroy($src); imagedestroy($img); //ob_end_flush(); ?>

have checked no output sent before header? couple of things can try:

move header() function top. remove caching (ob_start) , see if can create work without first. as utilize ob_start, guess want utilize ob_end_flush(); @ end? try utilize null sec param imagejpeg() raw output instead of writing file. (could related write permissions)

update sure checked file pointing exists/or path valid? works on localhost, running default xamp installation (php3.5.1)

ini_set("display_errors", "1"); error_reporting(e_all); header('content-type:image/jpeg'); //$cachefile="mypicxxx.jpg"; //$cache_dir="cache/1/592/"; $img_dir="webspace/1/592/"; $img="test.jpg"; $src=imagecreatefromjpeg($img); $new_width=200; $new_height=77; $width=600; $height=1001; $w_src=600; $h_src=1001; $img=imagecreatetruecolor($new_width,$new_height); imagecopyresampled($img,$src,0,0,0,0,$new_width,$new_height,$w_src,$h_src); imagejpeg($img,null,45); //$cachefile=$cache_dir.$cachefile; //imagejpeg($img,$cachefile,45); imagedestroy($src); imagedestroy($img);

php image gd dynamic-image-generation

c# - Extending a class and one of its properites -



c# - Extending a class and one of its properites -

there class design issue maintain running on , on , i've come realize must doing wrong. thought class b : a. these classes using configuration objects , bconfig : aconfig. issue can't come way create properties in bconfig accessible.

here's simplified illustration of issue.

public class request{ public virtual requestconfiguration config{ { if(config == null) config= configurationmanager.getsection("requestconfig") requestconfiguration; homecoming config; } } public virtual string dosomething(){ homecoming "url:" + config.url; } } public class authrequest : request { public override requestconfiguration config { if(config == null) config= configurationmanager.getsection("requestconfig") authrequestconfiguration; homecoming config; } } public override string dosomething(){ homecoming string.format("url:{0} u:{1} p:{2}",config.url,config.user,config.pass); } } /*---- configuration classes ----*/ public class requestconfiguration : configurationsection { [configurationproperty("requesthost", isrequired = true)] public string requesthost { { homecoming (string)base["requesthost"]; } } } public class authrequestconfiguration : requestconfiguration { [configurationproperty("user", isrequired = true)] public string user { { homecoming (string)base["user"]; } } [configurationproperty("pass", isrequired = true)] public string pass { { homecoming (string)base["pass"]; } } }

obviously code doesn't compile. is there little changes code made accomplish same principle? or need take whole different approach together?

the goal can utilize simple dependency injection set in configuration file determine type of request make.

what making request generic; request<tconfig> tconfig : requestconfiguration:

class="lang-cs prettyprint-override">public class request<tconfig> tconfig : requestconfiguration { private tconfig _config; public virtual tconfig config { { homecoming _config ?? (_config = configurationmanager.getsection("requestconfig") tconfig); } } public virtual string dosomething() { homecoming "url:" + config.url; } } public class authrequest : request<authrequestconfiguration> { public override string dosomething() { homecoming string.format("url:{0} u:{1} p:{2}", config.url, config.user, config.pass); } } public class requestconfiguration : configurationsection { [configurationproperty("url", isrequired = true)] public string url { { homecoming (string) this["url"]; } } } public class authrequestconfiguration : requestconfiguration { [configurationproperty("user", isrequired = true)] public string user { { homecoming (string) this["user"]; } } [configurationproperty("pass", isrequired = true)] public string pass { { homecoming (string) this["pass"]; } } }

would solve problem? @ to the lowest degree code builds :)

c# dependency-injection software-engineering

Detect browser close in jquery/javascript for cross browser -



Detect browser close in jquery/javascript for cross browser -

this question has reply here:

want observe browser close event? 3 answers

window.onbeforeunload / window.onunload not working in chrome detecting browser close event. need help!

check http://help.dottoro.com/ljhtbtum.php

example http://help.dottoro.com/external/examples/ljhtbtum/onbeforeunload_1.htm

code

<head> <script type="text/javascript"> function onbeforeunload () { homecoming "all info have entered lost!"; } </script> </head> <body onbeforeunload="return onbeforeunload ()"> <b>close window or press f5 reload page.</b> <br /><br /> <form> user name: <input type="text" name="username" /> <br /> city: <input type="text" name="city" /> </form> </body>

javascript jquery asp.net

javascript: overriding (not just defining) a function in if statement -



javascript: overriding (not just defining) a function in if statement -

i have next javascript.

var f = function() { ... }; if (x === 1) { // redefine f. f = function() { ... }; }

is code valid ? in other words can redefine javascript function within if statement write code.

i worried because of this: function declarations within if/else statements?

yes can that.

f = function() { ... };

is not function declaration, function expression (assigned f), problems mentioned in other question don't apply here.

only variable , function declarations hoisted.

javascript

c# - Add parameter in SqlDataSource from code-behind -



c# - Add parameter in SqlDataSource from code-behind -

i have grid on page want fill info provided stored procedure has parameter read cookie. don't know how can add together parameter sqldatasource dynamically , assign grid?

</telerik:radscriptmanager> <telerik:radajaxpanel id="radajaxpanel1" runat="server" height="200px" width="715px"> <telerik:radgrid id="radgrid1" runat="server" allowpaging="true" allowsorting="true" cellspacing="0" gridlines="none" height="533px" pagesize="7" allowfilteringbycolumn="true" filteritemstyle-width="400px" datasourceid="dsnew"> <clientsettings> <selecting cellselectionmode="none" /> <scrolling allowscroll="true" usestaticheaders="true" /> </clientsettings> <alternatingitemstyle backcolor="#cccccc" /> <mastertableview datasourceid="dsnew"> <commanditemsettings exporttopdftext="export pdf" /> <rowindicatorcolumn filtercontrolalttext="filter rowindicator column" visible="true"> </rowindicatorcolumn> <expandcollapsecolumn filtercontrolalttext="filter expandcolumn column" visible="true"> </expandcollapsecolumn> <editformsettings> <editcolumn filtercontrolalttext="filter editcommandcolumn column"> </editcolumn> </editformsettings> </mastertableview> <filteritemstyle width="400px" /> <filtermenu enableimagesprites="false"> </filtermenu> </telerik:radgrid> <asp:sqldatasource id="dsnew" runat="server" connectionstring="<%$ connectionstrings:db_banksafedepositboxesconnectionstring %>" selectcommand="s_boxes_statusreport" selectcommandtype="storedprocedure"> <selectparameters> <asp:cookieparameter name="branchid" cookiename="userauth" /> </selectparameters> </asp:sqldatasource>

you can utilize follows:-

<selectparameters> <asp:cookieparameter name="email" cookiename="email_id" /> </selectparameters>

msdn link http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.cookieparameter.aspx

c# asp.net

.net - VB.NET Static Constructor Not Called in DLL -



.net - VB.NET Static Constructor Not Called in DLL -

i've got vb.net project has 2 classes this. 1 base of operations , 1 derived contained in seperate project dll.

public class baseclass public shared label_ string end class public class derived inherits baseclass shared sub new() baseclass.label_ = "some label" end sub public shared sub dump() end sub end class

and test code i've created

sub main() 'shared label nil here? console.writeline(derived.label_) 'shared label assigned here shared constructor called derived.dump() console.writeline(derived.label_) end sub

i finding shared constructor in derived class called when phone call instance method or phone call other static method?

my understanding shared constructor called when application run?

a static constructor called automatically initialize class before first instance created or static members referenced, not when application run.

you can't know exact moment in shared constructor called, , should'nt create assumptions it, msdn ensures points:

shared constructors run before instance of class type created. shared constructors run before instance members of construction type accessed, or before constructor of structure.type explicitly called. calling implicit parameterless constructor created structures not cause shared constructor run. shared constructors run before of type's shared members referenced. shared constructors run before types derive thetype loaded. a shared constructor not run more 1 time during single execution of program.

.net vb.net oop inheritance

c++ - Working with WinAPI functions which use C style strings as OUT parameters -



c++ - Working with WinAPI functions which use C style strings as OUT parameters -

given winapi function returns it's result via c style string out parameter e.g.:

int winapi getwindowtextw( _in_ hwnd hwnd, _out_ lptstr lpstring, _in_ int nmaxcount );

is there improve way of using function i'm doing below?

hwnd handle; // assume initialised contain real window handle std::wstring title; wchar_t buffer[512]; getwindowtextw(handle, buffer, sizeof(buffer)); title = buffer;

the above code works, have next issues it:

the buffer size arbitrary since have no way know length of string function might return. "feels" wrong me - have tried avoid magic numbers in code.

if function returns string larger buffer, truncated - bad!

whenever function returns string smaller buffer, wasting memory. not bad (2), i'm not thrilled thought of setting aside big chunks of memory (e.g. 1024 bytes in illustration above) might need few bytes in practice.

are there other alternatives?

call function multiple times temporary buffers of different sizes. begin buffer of, say, 8. double buffer size , phone call again. repeat until returns same count lastly time. can allocate exact size buffer , re-create you've got there. there number of win32 functions similar behavior.

you may utilize getwindowtextlength(), won't help much if there race conditions (you may end truncated text because of them).

c++ winapi cstring out

IsBranch in tfs api is alway false -



IsBranch in tfs api is alway false -

i'm using tfs api , have need check if provide path tfs branch

i'll spare total code gets downwards to

m_versioncontrolserver.getitem(source).isbranch

for whatever reason returns false. missing or broken

you need phone call 1 of overload's of getitem() has getitemsoptions parameter , pass in getitemsoptions.includebranchinfo.

for example:

var isbranch = m_versioncontrolserver.getitem( path: source version: versionspec.latest, deletedstate: deletedstate.nondeleted, options: getitemsoptions.includebranchinfo).isbranch;

tfs

libgosu - I want to have objects interact each other. (Ruby) -



libgosu - I want to have objects interact each other. (Ruby) -

i making game pong in ruby using library gosu. right now, trying create ball interacts board.

class window < gosu::window # board size 30 x 298 def initialize super 1440,720,false self.caption = "pong" @ball = ball.new(self) @ball.warp(720,360) @board1 = board.new(self,15,360) @board2 = board.new(self,1425,360) end def update @ball.draw @ball.move @ball.bounceoffboard(@board1,@board2) ........

at lastly line, tried pass field @board1 downwards class @ball knows cordinate of board see whether should jump off. maintain throwing me mistakes

pong.rb:105: formal argument cannot constant def bounceoffboard(board1,board2)

what should do?

for start, don't name instance variables capital letters:

@ball = ball.new(self) @board1 = board.new(self,15,360) @board2 = board.new(self,1425,360)

should be:

@ball = ball.new(self) @board1 = board.new(self,15,360) @board2 = board.new(self,1425,360)

and:

def bounceoffboard(board1,board2)

should be:

def bounceoffboard(board1, board2)

ruby libgosu

Jquery and galleriffic -



Jquery and galleriffic -

this longshot but, i'm using galleriffic jquery plugin, , i'm changing images on fly javascript using appending , replacing img src:

$.each(paths,function(index, value) { if(size > 0) { var src = $('.thumbs li:nth-child('+index+')').find('img').attr('src', value); var str = value; var big_img=str.replace("_s","_b"); var src = $('.thumbs li:nth-child('+index+')').find('a').attr('href', big_img); size -- ; }

the problem i'm having somehow uses hash function convert image url display fullsize image, , since alter img src after dom loaded changed images not beingness displayed in viewer.

you can see effect here http://www.riskycode.com/wordpress/#

click on design focuses.

that's because of way plugin binding events

so before changing images attributes you'll have destroy gallerific instance;

then re-instantiate 1 time alter of images attribute finished

nb: old plugin whatever

go through code; replace this name of instance; depending on options part of script may unecesary;

start gallery.initializethumbs(); plenty (but won't trigger preload think)

// initialize thumbails this.initializethumbs(); if (this.maxpagestoshow < 3) this.maxpagestoshow = 3; this.displayedpage = -1; this.currentimage = this.data[0]; var gallery = this; // hide loadingcontainer if (this.$loadingcontainer) this.$loadingcontainer.hide(); // setup controls if (this.controlscontainersel) { this.$controlscontainer = $(this.controlscontainersel).empty(); if (this.rendersscontrols) { if (this.autostart) { this.$controlscontainer .append('<div class="ss-controls"><a href="#pause" class="pause" title="'+this.pauselinktext+'">'+this.pauselinktext+'</a></div>'); } else { this.$controlscontainer .append('<div class="ss-controls"><a href="#play" class="play" title="'+this.playlinktext+'">'+this.playlinktext+'</a></div>'); } this.$controlscontainer.find('div.ss-controls a') .click(function(e) { gallery.toggleslideshow(); e.preventdefault(); homecoming false; }); } if (this.rendernavcontrols) { this.$controlscontainer .append('<div class="nav-controls"><a class="prev" rel="history" title="'+this.prevlinktext+'">'+this.prevlinktext+'</a><a class="next" rel="history" title="'+this.nextlinktext+'">'+this.nextlinktext+'</a></div>') .find('div.nav-controls a') .click(function(e) { gallery.clickhandler(e, this); }); } } var initfirstimage = !this.enablehistory || !location.hash; if (this.enablehistory && location.hash) { var hash = $.galleriffic.normalizehash(location.hash); var imagedata = allimages[hash]; if (!imagedata) initfirstimage = true; } // setup gallery show first image if (initfirstimage) this.gotoindex(0, false, true); // setup keyboard navigation if (this.enablekeyboardnavigation) { $(document).keydown(function(e) { var key = e.charcode ? e.charcode : e.keycode ? e.keycode : 0; switch(key) { case 32: // space gallery.next(); e.preventdefault(); break; case 33: // page gallery.previouspage(); e.preventdefault(); break; case 34: // page downwards gallery.nextpage(); e.preventdefault(); break; case 35: // end gallery.gotoindex(gallery.data.length-1); e.preventdefault(); break; case 36: // home gallery.gotoindex(0); e.preventdefault(); break; case 37: // left arrow gallery.previous(); e.preventdefault(); break; case 39: // right arrow gallery.next(); e.preventdefault(); break; } }); } // auto start slideshow if (this.autostart) this.play(); // kickoff image preloader after 1 sec settimeout(function() { gallery.preloadinit(); }, 1000);

otherwise add/remove images shown there : http://www.twospy.com/galleriffic/example-4.html

jquery

.htaccess - Apache alias issue with zend when accessed with other than index controller -



.htaccess - Apache alias issue with zend when accessed with other than index controller -

i have created apache alias http://www.domain.com/xyz pointing public folder nowadays in zend application. c:/wamp/www/xyz/public/

it working fine when accessed index controller, when accessed new controller showing server misconfiguration.

working : http://www.domain.com/xyz/ (here alias pointing public folder)

server misconfiguration : http://www.domain.com/xyz/controller2

this error controller2: file c:/wamp/www/xyz/public/controller2.php doesn't exist..

this htaccess code:

rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l]

i tried rewriterule ^.*$ index.php [nc,l,qsa] , other rewrite rules.

can help me..

do have line in application.ini file?

resources.frontcontroller.baseurl = "/xyz"

apache .htaccess zend-framework