Posts

Showing posts from May, 2015

spring - InterceptorDataWrapper createInterceptor No interceptor data for class -

does know why problem when deploying ejb project websphere 8? 0000001e annotations e interceptordatawrapper createinterceptor no interceptor data class [ org.springframework.ejb.interceptor.springbeanautowiringinterceptor ] the spring dependencies visible in ear , ejb classloader , located in lib folder of ear module. edit: this might have post posted: deployment of ejb maven project eclipse

Rails URL helper for sorting filters -

i have table companies field city_id . need in sorting companies cities. next: # companies_controller.rb def sort_by_city @cities = city.joins(:company).uniq @companies = company.where("city_id = ?", params[:city_id]) render 'index' end # routes.rb: '/companies/city/:city_id', to: 'companies#sort_by_city' and in index.html.erb try make links filter: <% @cities.each |city| %> <li><%= link_to city.name, unknown_path(city.id) %> (<%= city.companies_count %>) <% end %> i want links this: " www.site.com/companies/city/23 " must write instead of unknown_path? or wrong before (in controller or in routes.rb)? you can give name route as option : for example : get '/companies/city/:city_id', to: 'companies#sort_by_city', as: 'companies_city_sort' and use companies_city_sort_path also, have @ resourceful routing , may more adapted.

c# - make a structure for generating custom form -

i developing learning management system asp.net c# want make structure generating university forms , these forms may change in future or need new forms , want make structure admin of website generate custom forms without coding, admin add name of feilds , type of ( text box or checkbox , ... ) , should printable , admin can add explanation in diffrent part of form... dont know how should ? is there api or idea ? you make clases form controls like: inputbox, textbox, checkbox, radiobutton. form class contain lists of input controls. class forminputcontrol { public string description { get; set; } //every form input has description user, link, want form input control instance describe public abstract object value { get; set; } } class inputbox : forminputcontrol { public string text { get; set; } public overwrite object value { { return text; } set { text = value string; } } } class form { public ilist<forminpu...

javascript - AJAX stop working on loading same site different PHP id -

so have website i'm doing school project. it's supposed pastebin. on right theres different div (uued koodid) shows newest pastes. on click, supposed show include using ajax refresh left div. works 4 times , stops, url still changing. after refresh changes again , works again 4 more times. in main.js have ... $.ajaxsetup({ cache: false }); ... $(".uuedkoodid").click(function () { $(".left-content").load(document.location.hash.substr(1)); }); ... edit: other ajax functions work. if log in, can switch between settings , profile still cannot watch new codes when replace right menu new code (from ajax call) don't attach click event again on .uuedkoodid items don't anything. need attach event again or attach this: $(document).on('click', '.uuedkoodid', function () { $(".left-content").load(document.location.hash.substr(1)); }); edit: noticed cause small problem. onclick event run before browser run...

Enable bluetooth tethering android programmatically -

i trying make application "bluetooth auto tethering" on play store. read on forum android security-aware , not enable setting without user interaction. i need explanations how enable bluetooth tethering. thank you i don't know if still issue or not, found using connect method in reflection call works. working off of code pmont used link in lorelorelore 's answer: bluetoothadapter mbluetoothadapter = bluetoothadapter.getdefaultadapter(); class<?> classbluetoothpan = null; constructor<?> btpanctor = null; object btsrvinstance = null; method mbtpanconnect; try { classbluetoothpan = class.forname("android.bluetooth.bluetoothpan"); mbtpanconnect = classbluetoothpan.getdeclaredmethod("connect", bluetoothdevice.class); btpanctor = classbluetoothpan.getdeclaredconstructor(context.class, bluetoothprofile.servicelistener.class); btpanctor.setaccessible(true); btsrvinstance = btpanctor.newinstance(mycontex...

Creating calculations using SQLite and C#/WPF -

i developing small time-management app (so can learn c#/wpf). need know best way return calculations various textblocks on 1 of forms. i have table called "tblactivity" , need calculate how many times values exist. in old days of vba, have used dsum or dcount, i'm not sure the efficient/correct/fastest way return sort of data (the fields indexed way). if want query table whole this: int rowcount = tblactivity.rows.count(); if want count column meets criteria, run select statement datarow[] selectedindexcountrow = tblactivity.select("index = 12 , index2 = 'something'"); what can still if need display data , count int count; foreach row datarow in tblactivity.rows { string valuefromtable = row("column"); //display data if must, count += 1; }

asp.net mvc - Should my View or ViewModel have the DataType assigned -

which approach has better maintainablility , extendability? where limitations/restrictions each approach? put datatype inside viewmodel or put datatype/control type in view? viewmodel [datatype(datatype.multilinetext)] public string longdescription { get; set; } or view @html.textareafor(m => m.longdescription) as far maintainability concerned, defining in view model best. given example suppose had in our vm: [datatype(datatype.multilinetext)] public string longdescription { get; set; } and in our view: @html.editorfor(m => m.longdescription); now lets requirements have changed , simple string no longer cuts longdescription, created special customrichtextformat class store it. change vm following: public customrichtextformat longdescription { get; set; } you can create editortemplate called customrichtextformat.cshtml , put in editortemplates folder in view folder, , since used @html.editorfor(m => m.longdescription); in origina...

xcode - Xcode5: creating new testing target -

i'm trying create first xctestcase within existing ios+mac project. created new test class, , see created new test target me in project, new scheme has none of linked libraries , source code files existing target. shared scheme existing target, none of project details. don't want go add each , every source file , framework library new test target. there way create new test target clone of existing target? or add source files target without being when set correctly, test bundle linked against app. shouldn't put production code test target, test code.

python - XPath string as input -

considering code example below, if 'xpath' in request.args: in = request.args['xpath'] xml = bytesio(open("/file.xml").read()) v, e in etree.iterparse(xml): return e.text the following xml file, <a> <c> <d>content x</d> </c> <c> <d>content y</d> </c> </a> and in variable receives string /a/c[2]/d curl, bellow curl http://localhost:5000/home?xpath=/a/c[2]/d is there way given string (xpath expression) code returns element text (i.e. able understand element i'm referring to)? to return element located in , can call find method on parsed elementtree . return etree.parse(xml).find(in).text note xpath expression must not include root element itself, nor starting slash, c[2]/d should trick.

lua 5.2 - "require" not work in embeded lua -

in code load , run test.lua file int main (){ l = lual_newstate(); lual_openlibs(l); lual_dofile(l, "test.lua"); lua_close(l); return 0; } my test.lua file contents print ("s1"); r=require 'simple'; print ("s2"); the simple module installed before when run ./lua_c ; output only: s1 but when run lua test.lua ; output s1 s2 and r in't nil simple failing load or parse or execute. find problem, use lual_loadfile instead of lual_dofile , check return value. if non zero, there load error, can pop off lua stack , print. if no error, lua_pcall(l, 0, lua_multret, 0)) run chuck created loadfile, , again check return code error, pop off stack , print. somehting this: int main () { l = lual_newstate(); lual_openlibs(l); if (lual_loadfile(l, "test.lua")) { cout << "error: " << lua_tostring(l, -1) << endl; } else if (lua_pcall(l...

FFMPEG to send RTSP encoded stream C++ -

i trying figure out way take encoded h264 image have created in ffmeg , send out via rtsp using ffmpeg, there sample code or tutorial out there shows how this. tried searching web, there nothing find out there. any appreciated. in advance. i made few changes in docs/examples/muxing.c here code transmits audio , video streams using mpeg4 rtsp #include <stdio.h> #include <vector> #include <windows.h> #include <iostream> #include <fstream> #include <time.h> #define _xopen_source 600 /* usleep */ extern "c" { #ifndef __stdc_constant_macros #define __stdc_constant_macros #endif #include <libavcodec\avcodec.h> #include <libavutil/imgutils.h> #include <libavutil/samplefmt.h> //#include <libavutil/timestamp.h> #include <libswscale\swscale.h> #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libavfilter/avfiltergraph.h> #include <libavfilter/avcod...

c - Save int as a char? -

this question has answer here: calculating ranges of data types in c 5 answers i'm trying save integer character. char = 80; printf("0x%x", i); the above code displays 0x50 (1 byte). if value above 128, prints 4 byte value. char = 130; printf("0x%x", i); // prints 0xffffff82 how can store integer value 1 byte if value greater 128 (print 82 instead of ffffff82 in second example) ? this expected behavior on systems char type signed: negative values of char sign-expanded size of int . if print last 8 bits, mask 0xff , this: printf("0x%x", & 0xff); // prints 80 demo on ideone . an alternative approach use unsigned char . avoid sign extension 8-bit numbers significant bit set 1 .

javascript - to know which link is clicked in the previous page using jsp -

jsp code know link clicked in previous page, based on change web page content of second page. me write code this. assuming have 1 jsp links, this: main.jsp: <ul> <li><a href="detail.jsp?link=page1">page 1</a></li> <li><a href="detail.jsp?link=page2">page 2</a></li> </ul> detail.jsp: <h1>i on detail page</h1> <% string link = request.getparameter("link"); %> then use variable per need.

Yeoman angularjs generator broken -

i create empty directory called "assets" php lavarel project folder , issue following command -> yo angular, in terminal, asked include sass/compass, bootstrap etc , start installing generator. somehow, got lots of errors have no ideas cause. need , here errors. npm npm err!http error: enotempty, rmdir 'xxx/app/assets/node_modules/grunt/lib' https://registry.npmjs.org/optimist npm err! if need help, may report *entire* log, npm err! including npm , node versions, at: npm err! <http://github.com/npm/npm/issues> npm err! system darwin 13.1.0 npm err! command "node" "/usr/local/bin/npm" "install" npm err! cwd xxx/app/assets npm err! node -v v0.10.26 npm err! npm -v 1.4.3 npm err! path xxx/app/assets/node_modules/grunt/lib npm err! code enotempty npm err! errno 53 npm err! error: enoent, open 'xxx/app/assets/node_modules/grunt/package.json' npm err! if need help, may report *entire* log, npm err! including npm , ...

PHP: Calculating months and interest rate. Is this solution correct? It does work -

i want calculate how many months have passed since x1 date x2 date, , calculate how have pay given monthly interest rate. the script should: amount of debt (capital), month , year when debt originated , until should calculated. not day, month , year. , output should total generated in interests, , total months between 2 dates. i have these initial variables: $tmonth = $_post['tmes']; $tyear = $_post['tanio']; $interes = $_post['interes']; $fmonth = $_post['fmes']; $fyear = $_post['fanio']; $capital = $_post['capital']; and i've done: if($_server['request_method']=='post') { //i try , obtain how many months have between 2 months $mesesenanios = (($tyear - $fyear) -1) * 12; $mesesscattered = (12 - $fmonth) + $tmonth; $mesestotales = $mesesenanios + $mesesscattered; //then calculate interest i'll have pay $totalcapital = $capital * ($interes * $mesestotales) / 100; echo ...

scala - Getting NullPointerException when running Spark job with naive Bayes implementation -

i trying implement naivebayes on spark, yet does't work well. because of line @ temp function : each_prob.map(_.take(1)) if have idea problem, please me... this main function ; object donaive extends app{ val file_pathes = vector( ("plus","resource/doc1.txt"), ("plus","resource/doc2.txt"), ("plus","resource/doc3.txt"), ("minus","resource/doc4.txt"), ("minus","resource/doc5.txt"), ("minus","resource/doc6.txt") ) val pn = parallelnaive(file_pathes) val cached_rdd = read.rdds("resource/examine.txt") val each_prob : vector[rdd[string]] = pn.allclassnames.map{ class_name => cached_rdd .map { elt => ( pn.eachprobword(elt._1 , class_name ) * elt._2 ).tostring } } val head_prob = each_prob.head print...

scala append to to list of tuples in foldLeft? -

i'm beginner in scala, , i'm wondering how append, or create new list of tuples tuple @ head of tuple. right doing list.foldleft(list[(string, int)]())((ll:list[(string, int)], str:string) => if (str == ll.head._1) (str, ll.head._2 + 1) :: ll.tail.head else (str, 1) :: ll.head) however error there no :: operator tuples. if understand you're trying do, reason you're trying use first element of tail of list rather tail right-hand argument :: . you should able use like: list.foldleft(list[(string, int)]())((ll, str) => if (str == ll.head._1) (str, ll.head._2 + 1) :: ll.tail else (str, 1) :: ll) however you'll hit error trying take head of empty list. full working version like list.foldleft(list[(string, int)]()) { case ((hs, hc) :: tail, str) if hs == str ⇒ (str, hc + 1) :: tail case (ll, str) ⇒ (str, 1) :: ll }

Printing elements of "hash of hash of array" in perl -

i need print elements of following "hash of hash of array"(%partitions). nothing getting printed. also, no error encountered. please help our %partitions; sub partition{ %set; @array; for(my $i=0;$i<$pop_size;$i++) { for(my $j=0;$j<$min_pr;$j++) { @array=(); for(my $k=0;$k<$tot_nodes;$k++) { if($population[$i]{$k} eq $j) { push @array, $k; } } $set{$j} = [@array]; } $partitions{$i} = [%set]; } foreach $p (sort keys %partitions) { print "$p {\n"; while (my ($r, $s) = %{$partitions->{$p}}) # error in line { # not entering loop print "$r {\n"; print "value: @$s \n"; print "}\n"; } } } partition; it...

c# - custom sorting in a bindinglist of keyvaluepairs -

Image
i have bindinglist of keyvaluepair filled dynamicaly. bindinglist<keyvaluepair<int, string>> homelist = new bindinglist<keyvaluepair<int, string>>(); foreach (listitem item in listbox2.items) { homelist.add(new keyvaluepair<int, string>(item.id, item.name)); } the list has key(id) , value(text) shown i want sort first 5 items asc , rest items asc.the sorting must value , not key. example: if have values : 4,5,8,7,6,10,9,3,2,1,22 sorting result must 4,5,6,7,8 ,1,2,3,9,10,22.any idea? solved answer: public int compare(keyvaluepair<int,string> a, keyvaluepair<int,string> b) { return a.value.compareto(b.value); } list<keyvaluepair><int,>> playinglist = new list<keyvaluepair><int,>>(); (int = 0; < 5; ++) { playinglist.add(homelist[i]); } playinglist.sort(compare); list<key...

python order of evaluation with ands in if statements -

it's common put in check none or have similar error catch. need if statement depends on x: if x == none: if x[0]>0: ... # code can safely combine if statements (for code brevity)? if x != none , x[0]>0: ... # code or interpreter not guarantee order of evaluation , stopping after first false? yes safe, because operators and , or short-circuits . note: one recommendation use is if want check if object none : if x not none , x[0] > 0: # ...

android - Combining some service code with mysql -

my goal connect remote mysql db through php make request, find out if there new messages available , if answer yes, send notification device display it. there should working example of this, since it's base of serious app deals updates and/or messaging. php looks this: <?php $con=mysql_connect("localhost","username","password"); if(!$con) die('could not connect: ' .mysql_error()); mysql_select_db("mydatabasename",$con); $result = mysql_query("select count(*) (select * notificari n, notificari_destinatii d n.dest_notif_id=d.id_master) tbl id_user=247 , date(data_notif)=date(now())"); while($row=mysql_fetch_assoc($result)){ $output[]=$row; } print(json_encode($output)); mysql_close($con); ?> so php tells me number of notifications user 247 received today. want number in service, , compare local (sqlite db table) number of notifications. , if remote number greater local number, want display notific...

java - Any simple way to test a @RequestBody method? -

if have @controller method parameter @requestbody param, have write jquery script or similar perform ajax request json object in order call method. if tried calling method via web browser directly, returns error 415 unsupported media type . is there alternative call such method using browser without having write jquery code? perhaps way write json object in url/address bar? code: @requestmapping("testcall") @responsebody public list<testobject> gettestcall (@requestbody testparams testparams) { return stuff; } public class testparams { private integer testnumber; //getter/setter testnumber } i thought maybe do: http://localhost/testcall?testnumber=1 maybe spring auto populate new testparams instance property set 1 didnt work... maybe need that? the whole point of @requestbody annotated parameters spring mvc stack use http request body produce argument bound parameter. such, need provide request body. sending request body atypical ...

square - Dagger scopes in Android -

jake wharton's talk @ devoxx 2013, architecting android applications dagger, talked creating dagger scope logged in users only. sort of thing sounds clean, , want in applications. the code discussed in talk along lines of: public class loggedinactivity extends activity { @inject user user; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_logged_in); daggerscopesapp app = (daggerscopesapp) getapplication(); app.getobjectgraph().plus(new usermodule("exampleusername")).inject(this); findviewbyid(r.id.do_something_button).setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { toast.maketext(loggedinactivity.this, user.username + " : " + user.somevalue++, toast.length_short).show(); } }); } } however, ...

elisp - Emacs call-process as sudo -

update i have accepted @sean answer, small modifications. (defun sudo-shell-command (buffer password command) (let ((proc (start-process-shell-command "*sudo*" buffer (concat "sudo bash -c " (shell-quote-argument command))))) ;;; added @sean answer display passed buffer (display-buffer buffer '((display-buffer . nil)) nil) (process-send-string proc password) (process-send-string proc "\r") (process-send-eof proc))) (defun sudo-bundle-install (password) (interactive (list (read-passwd "sudo password bundle install: "))) (let ((default-directory (concat default-directory "./fixtures/test-kitchen-mode-test-run/")) ;;; added accepted answer below @sean ;;; need buffer display process in. (generated-buffer (generate-new-buffer "*test-kitchen-test-setup*"))) (sudo-shell-command ;;; pass refe...

javascript - How come my image is not displayed in the pop up window? -

i'm newbie coldfushion. i'm trying create page user can view small pictures. once clicks on picture, image show in new pop window. i'm not sure what's missing in code, when click on small picture, new window pop up..there's no image in new pop window set image path. can give me suggestions on how fix this? lot! edit: followed suggestion , made changes code. however, still not working. can tell me i'm missing? thanks! in full_article_view.cfm: <!--- retrieve full article images ---> <cfquery name="myquery1" datasource="mydb" > select articles.article_id, articles.article_title, articles.article_author, articles.article_date, articles.article_content articles inner join article_image_mapping on articles.article_id = article_image_mapping.aim_articleid articles.article_id = #url.id# group article_image_mapping.aim_articleid </cfquery> <cfquery name="myquery2" datasource="mydb...

ios7 - Not able to fetch the gmail address book in iPhone -

from last few days stuck not able access gmail address book in iphone app.i searched lot didn't success. here link refereed i checked link access gmail contacts in above link given can access contacts using url https://www.google.com/m8/feeds/contacts/useremail/full able login using gdata framework didn't find fetch gmail contacts. have access token after successful login , calling method after logging in successfully. - (void)doanauthenticatedapifetch { nsstring *urlstr = @"https://www.google.com/m8/feeds/contacts/myemailid@gmail.com/full"; nsurl *url = [nsurl urlwithstring:urlstr]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url]; [self.authtoken authorizerequest:request completionhandler:^(nserror *error) { nsstring *output = nil; if (error) { output = [error description]; } else { nsurlresponse *response ...

stdvector - vector bad allocation error c++ -

i have been working on avl tree vector based quite time. i'm suppose take inputs file, on 4118 th input gives me bad_alloc error. did research , gathered inputs have reserve space also. when allocate space, still gives same error. parts of code: i call function: void insert(t d, unsigned int c = 1); find(t d) finds position of newnode in vector<node<t>*> myvector ; return position if doesn't find newnode. insert take care of returned integer (shown below) insert is: template<typename t> void binarytree<t>::insert(t d, unsigned int c) //inserts type t count c vector { node<t>* newnode = new node<t>(d,c); if(myvector.empty()) { myvector.push_back(newnode); } else { int r = find(d); total++; //if newnode has same data data in position r if(r < myvector.size() && myvector[r] && *newnode == *myvector[r]) { myvector[r]->data.lo...

tomcat - How to include external files in WAR - java.io.FileNotFoundException -

i'm deploying grails-application (2.3.5) on tomcat (7.0.53) server , deployment without problems. when click on test controller (which uses files in src/data folder), error: error 500: internal server error uri /schedulingapi-0.1/tests class java.io.filenotfoundexception message /home/student/apache-tomcat-7.0.53/bin/src/data/room i know war looks @ tomcat directory whereas should in war itself. tried add src/data folder (properties > add class folder) build path before creating war didn't solve problem. the grails documentation on deployment talks this. 2 configuration options available grails.war.copytowebapp , grails.war.resources. first of these lets customise files included in war file "web-app" directory. second lets processing want before war file created. buildconfig.groovy // closure passed command line arguments used start // war process. grails.war.copytowebapp = { args -> fileset(dir:"web-app") { ...

gitattributes - git smudge/clean filter between branches -

there many related questions involving smudge/clean filters - have spent hours reading them, , trying various options, still failing. hope can ask in way answer works me. specifically, have read page of these answers link to: customizing git - git attributes tl;dr its detailed question, summary is: can store debug = false in file on 1 branch, , debug = true in branch, using smudge/clean filters manage file? , how? background i have various remote repos hosted @ bitbucket. using sourcetree on win8, clone remote repos laptop. create different branches development, features, releases etc (following a successful git branching model better or worse). i have android java class called dbug.java contains boolean turns on/off various debug logging, mocking etc features in code. public static final boolean debug = false; i value false on "production" (master) branch, , true on feature branches. is possible using filters, or have misunderstood us...

network programming - checksum fields in the socket buffer -

i'm trying understand purpose of csum_start , csum_offset fields in struct sk_buff . googling them, came across following definition: csum_start offset address of skb->head address of checksum field. csum_offset offset beginning of address of checksum end. when these fields used? if checksum offloaded device driver via netif_f_hw_csum , how aforementioned values used/interpreted in context? any insight on above highly appreciated! if device's feature set netif_f_hw_csum , network stack not compute transport checksum on transmit path. instead, tells device compute checksum setting ip_summed checksum_partial . the device shall use csum_start (or skb_checksum_start_offset(skb) occasionally) starting position , compute checksum till end of packet ( len field in socket buffer). computed checksum stored @ csum_offset csum_start .

Shell Script - Make directory if it doesn't exist -

i want enter name of directory , check if exists. if doesn't exist want create error mkdir: cannot create directory'./' file exists my code says file exists though doesn't. doing wrong? echo "enter directory name" read dirname if [[ ! -d "$dirname" ]] if [ -l $dirname] echo "file doesn't exist. creating now" mkdir ./$dirname echo "file created" else echo "file exists" fi fi if [ -l $dirname] look @ error message produced line: “[: missing `]'” or such (depending on shell you're using). need space inside brackets. need double quotes around variable expansion unless use double brackets; can either learn rules , or use simple rule: always use double quotes around variable substitution , command substitution — "$foo" , "$(foo)" . if [ -l "$dirname" ] then there's logic error: you're creating directory if there symboli...

android - Touch events double firing on Safari for iOS -

we have webapp built using bootstrap, angular, , mongodb run on nodejs express. there image on 1 part of site responds touch or mouse events on image. there javascript functions called each time touch (or mouse click) begins , ends. code implementing is: <div class="visible-sm visible-md visible-lg"> <div class="col-xs-4 nopadding"> <p class="noheightgap"> <a class="img-responsive"> <img id="1" onmousedown="beginclick(event);" onmouseup="endclick(event);" ontouchstart="begintouch(event);" ontouchend="endtouch(event);" src="../public/img/custom-1.png" class="img-responsive img-rounded"> </a> </p> </div> </div> this code works exp...

android - issue in reading a serialized object -

i trying create client-server android app in want transfer file using udp protocol. till able transfer file , receive acknowledgements packets. now want add sequence numbers data in packet. have tried following: create bytearrayoutputstream. wrap in objectoutputstream write data object using writeobject() serialized class includes: public class message implements serializable { private int seqno; private byte[] data; private boolean ack; public message(int seqno, byte[] data, boolean ack) { this.seqno = seqno; this.data = data; this.ack = ack; } client side byte[] filebytes = new byte[500]; bytearrayoutputstream outstream = new bytearrayoutputstream(); objectoutputstream os = new objectoutputstream(outstream); while((numbytesread = inputbuf.read(filebytes)) != -1) { //datagrampacket packet = new datagrampacket(filebytes, filebytes.length); if (os == null) { os = new objectoutputstream(outstream); } message msg = new message(++seqno, fileby...

c - Incorrect variable value incrementing -

i have following code: #include <stdio.h> #include <ctype.h> int main(int argc, char **argv) { int ch, lower, upper = 0; printf("enter line of text: \n"); while ((ch = getchar()) != eof) { if (islower(ch)) { ch = toupper(ch); ++upper; } else if (isupper(ch)) { ch = tolower(ch); printf("looking @ lower: %d\n", lower); ++lower; printf("looking @ lower: %d\n", lower); } putchar(ch); } printf("hello\n"); printf("\nread %d characters in total. %d converted upper-case, %d lower-case.", upper+lower, upper, lower); } for reason upper variable being set correctly, can't work out why lower giving erroneous value. e.g. if type in 'football' says 4195825 converted lower-case, actual output should 1. i can't see i'm going wrong here....

google map not displaying on my webpage -

here code snippet. please me unable map running on webpage. have tried know that's of no use... the map not displaying on webpage... http://jsfiddle.net/gauravroy142/tz7v2/ <head> <script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> function initialize() { var mylatlng = new google.maps.latlng(-25.363882,131.044922); var mapoptions = { zoom: 12, center: mylatlng } var map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var marker = new google.maps.marker({ position: mylatlng, map: map, title: 'hello world!' }); } google.maps.event.adddomlistener(window, 'load', initialize); </script> </head> <div id="contact-right"> <div class="panel-pane pane-block pane-amazeelabs-google-map" id="map"> <!--<div class="map">--> <div id="m...