Search Results

Search found 2312 results on 93 pages for 'whats your favourite'.

Page 61/93 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • Variable might not have been initialized error

    - by David
    When i try to compile this: public static Rand searchCount (int[] x) { int a ; int b ; ... for (int l= 0; l<x.length; l++) { if (x[l] == 0) a++ ; else if (x[l] == 1) b++ ; } ... } I get these errors: Rand.java:72: variable a might not have been initialized a++ ; ^ Rand.java:74: variable b might not have been initialized b++ ; ^ 2 errors it seems to me that i initialized them at the top of the method. Whats going wrong?

    Read the article

  • google maps plot route between two points

    - by amarsh-anand
    I have written this innocent javascript code, which lets the user create two markers and plot the route between them. It doesnt work, instead, it gives a weird error: Uncaught TypeError: Cannot read property 'ya' of undefined Can someone suggest me whats wrong here: // called upon a click GEvent.addListener(map, "click", function(overlay,point) { if (isCreateHeadPoint) { // add the head marker headMarker = new GMarker(point,{icon:redIcon,title:'Head'}); map.addOverlay(headMarker); isCreateHeadPoint = false; } else { // add the tail marker tailMarker = new GMarker(point,{icon:greenIcon,title:'Tail'}); map.addOverlay(tailMarker); isCreateHeadPoint = true; // create a path from head to tail direction.load("from:" + headMarker.getPoint().lat()+ ", " + headMarker.getPoint().lng()+ " to:" + tailMarker.getPoint().lat() + "," + tailMarker.getPoint().lng(), { getPolyline: true, getSteps: true }); // display the path map.addOverlay(direction.getPolyline()); } });

    Read the article

  • Zend Framework - Not Connecting to IMAP mail server - instead dumps empty php file

    - by Ali
    Hi guys I'm trying to connect to an imap mail server using zend frameworks Zend_Mail_Storage_Imap function. Its working with some accounts but with most accounts it just dies out. I'm connecting using: $mail = new Zend_Mail_Storage_Imap(array('host' =>$current_dept->incoming_server, 'ssl' =>$current_dept->ssl, 'port'=>$current_dept->incoming_port, 'folder'=>$mbox_name, 'user' =>$current_dept->email, 'password' =>$current_dept->email_psd)); WIth some email accounts teh code doesn't go past this statement - and instead I'm prompted to 'download' the php file being run. Whats happening here - the mail server details are correct.

    Read the article

  • Storing users in a database

    - by EMcKenna
    Im wondering whats the best way of storing different types of users in my database. I am writing an application that has 4 main user types (admin, school, teacher, student). At the moment I have a table for each of these but i'm not sure thats the best way of storing user information. For instance... Allowing students to PM other student is simple (store sender and receiver student_id) but enabling teachers to PM students requires another table (sender teacher_id, sender student_id). Should all users be stored in one users table with a user_type field? If so, the teacher / student specific information will still have to be stored in another table. users user_id, password_hash, user_type students user_id, student_specific_stuff... teachers user_id, teacher_specific_stuff... How do I stop a user who has a user_type = student from being accidentally being entered into the teachers table (as both have a user_id) Just want to make sure I get the database correct before i go any further. Thanks...

    Read the article

  • HTTP POSTed files automatically uploaded to root directory

    - by Baddie
    I just inherited an ASP.NET WebForms web application that I was tasked with refactoring. One of the features is a file upload and while debugging I noticed that as soon as a file is posted to a certain page/handler, it is automatically uploaded to the root directory of the application. The file is then moved to the proper location. I can't seem to figure out whats causing this automatic upload of the file. Is there something I'am overlooking in ASP.NET WebForms that allows this to happen? Is it an IIS configuration or something?

    Read the article

  • How to lowercase every element of a collection efficiently?

    - by Chris
    Whats the most efficient way to lower case every element of a list or set? My idea for a List: final List<String> strings = new ArrayList<String>(); strings.add("HELLO"); strings.add("WORLD"); for(int i=0,l=strings.size();i<l;++i) { strings.add(strings.remove(0).toLowerCase()); } is there a better, faster way? How would this exmaple look like for a set? As there is currently no method for applying an operation to each element of a set (or list) can it be done without creating an additional temporary set? Something like this would be nice: Set<String> strings = new HashSet<String>(); strings.apply( function (element) { this.replace(element, element.toLowerCase();) } ); Thanks,

    Read the article

  • What's Your favorite f# use? where does f# makes life (a lot) easier (compared to c#)?

    - by luckyluke
    I've skimmed the stack and did not get the overflow as there is probably no such question. I'm just learning f# and I am A seasoned c# and .net dev. I am into financial apps and currently F# helps me a lot with maths calcs like zero finding or minimum finding (although I still want some good maths library there). I see that processing multiple items (files or smth) tends to be easier, but my GUI (web, win) are still c# based. I am in the team of 5 devs and we know that the new tool is out, we are learning it after hours (to pimp ourselves up) but maybe we shouldn't bash the door somebody already opened. So in business apps, whats Your first killer part of soft You would code in F# (if You could and would know IT would be easier, faster, more testable, easier to maintain etc.? Business rules? ImageProcessing? Data processing? hope it's not to subjective. luke

    Read the article

  • relating data stored in NoSQL DB to data stored in SQL DB

    - by seanbrant
    Whats the best way to use a SQL DB along side a NoSQL DB? I want to keep my users and other data in postgres but have some data that would be better suited for a NoSQL DB like redis. I see a lot of talk about switching to NoSQL but little talk on integrating it with existing systems. I think it would be foolish to throw the baby out with the bath water and ditch SQL all together, unless it makes things easier to maintain and develop. I'm wondering what the best approach is for relating data stored in SQL to my data in redis. I was thinking of something along the line of this. User object stored in SQL Book object in redis, key sh1 hash of value, value is a JSON string Relations stored in redis, key User.pk:books, value redis set of sha1's Anyone have experience, tips, better ways?

    Read the article

  • soap response to xml (simple_xml)

    - by ntan
    Hi i am trying to convert a soap response to XML. Soap has an envelop and a body <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> When try to convert $responseXML = simplexml_load_string($string); I get object(SimpleXMLElement)#20 (0) { } If i edit the $string as soap-Envelope and soap-Body i can get the XML Whats wrong with : and can not get XML I hope its clear. Anyone

    Read the article

  • Apache server-side files caching via .htaccess?

    - by purpler
    Hi, I'm starting new website and gonna include several JS libs and would like to know how .htaccess file template should look like with caching of media and JS files on? Whats better for compression, GZip or Deflate? Is it better/faster solution to serve those JS libs of the Google CDN perhaps then locally? I'm asking CDN question since some of scripts served off GoogleCDN are potentially going to update and eventually break the website layout so i thought it would be better for me to host them locally and cache via webserver if its going to work with same/near-same speed.

    Read the article

  • Php code works on guest os but doesn't work on host os

    - by Ieyasu Sawada
    Can you give me some guide on how to determine whats the problem if the same piece of code works on guest os. And doesn't work on the host os? I've created the project on Windows 7 but now it seems to be working on XP only. Here's what I have installed on the host os(Windows 7): And here's what I got on the guest os: And here's the screenshot. The guest os and host os side by side: Other things which are the same: php version mysql version apache same data stored on the database Here's the code of checkout.php: http://cu.pastebin.com/YeBR9rTs Forgive me if its messy.

    Read the article

  • frame by frame animation not running

    - by abc
    well,i am a newbie to android..and i dont know whats wrong in my code.. this is my xml file <?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" id="selected" android:oneshot="false"> <item android:drawable="@drawable/w1" android:duration="50" /> <item android:drawable="@drawable/w2" android:duration="50" /> </animation-list> my java file ImageView img = (ImageView)findViewById(R.id.s); img.setBackgroundResource(R.anim.shape_animation); // Get the background, which has been compiled to an AnimationDrawable object. AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground(); // Start the animation (looped playback by default). frameAnimation.start();

    Read the article

  • PHP, manipulating images and thumbnails?

    - by learner.php
    I am using php and mysql. I allow my registered users to upload photos, the photos are store in filesystem format, then I will keep the original/max size of : width: 1600px and heigh: 1200px. In the user profile page, I would like to display the image, it maybe one of the 5 types of thumnails: 500x500, 300x300, 200x200, 100x100 or 50x50. What is the best way to create the thumbnails, here are my current solutions: I am thinking of create 1 thumbnail, then from that thumbnail, i will resize in [img src="" width="XX"] tag, alternatively, store the different thumbnails size in database, then get and display it Create 5 thumbnails for each photos? (I am afraid this is a bad way) Whats the best practices?

    Read the article

  • Why are developers proud to say our application is XXX lines of code? [closed]

    - by mbcrump
    I admit, I used to do it. I was proud to tell a fellow developer my application is 10K+ lines of code. I thought it was a "Look at me, I'm smart" statement. Time passed and I realized that a experienced developer would be constantly refactoring all of his code. Not only for the sake of remembering what it was doing, but because he realizes he is smarter today than he was yesterday. No longer was it cool to have multiple nested if statements or completely ignoring generics/lambdas. So, whats your take on this? Do you do it and why?

    Read the article

  • sound loop breaks after some time in background music in iphone app

    - by amy
    I am playing sounds in loop in my app. So it should continue playing through out the app. but sometimes it stops after playing sound for 3/4 times.I don't understand whats happening. I am using audio-toolbox framework for playing sound. creating audio queue and then playing sounds in loop. I am also playing sound from ipod library using mediaplayer. Same thing happening with song from ipod. I have set [musicPlayer setRepeatMode: MPMusicRepeatModeOne]; but still it stops after 3/4 times.

    Read the article

  • Shift operator in Java bizarre program output

    - by Umesh Kacha
    I came across the following program and it behaving in unexpected manner. public class ShiftProgram { public static void main(String[] args) { int i = 0; while(-1 << i != 0) i++; System.out.println(i); } } If we think about this program output, when it reaches 32 while loop condition should return false and terminate and it should print 32. If you ran this program, it does not print anything but goes into an infinite loop. Any idea whats going on? Thank you in advance.

    Read the article

  • Jquery Javascript function, simple error, can't find it!

    - by CodingIsAwesome
    When my page loads it calls the function like below: <body onLoad='changeTDNodes()'> And the code it calls is below: enter code here <script src='jquery-1.4.2.min.js' type='text/javascript'></script> <script> function changeTDNodes() { var threshValue = 10; $(".threshold").each(function(elem) { if($("b",elem).innerText > threshValue) { elem.addClass("overThreshold"); } }); }); } I have the class setup correctly in CSS .overThreshold { td{font-size:72px;} th{font-size:72px;} } But no classes are being changed, whats going on? Thanks for all your help!

    Read the article

  • SslStream.ReadByte() blocks thread?

    - by alex
    I'm trying to write an Imap4 client. For that I use a SslStream to Connect to the Server. Everything's fine until I send the "Login" command. When I try to get an Answer to it, SslStream.ReadByte() block the thread. The result is that my programm crashes always. Whats happening here?? Code: if (ssl) { s = stream; } int cc = 0; MessageBox.Show("entered"); while (true) { int xs = s.ReadByte(); MessageBox.Show(xs.ToString()); if (xs > 0) { buf.Add((byte)xs); cc++; if (xs == '\n') { break; } if (cc > 10) MessageBox.Show(en.GetString(buf.ToArray())); } else { break; } } MessageBox.Show("left");

    Read the article

  • How can I kill a Perl system call after a timeout?

    - by Fergal
    I've got a Perl script I'm using for running a file processing tool which is started using backticks. The problem is that occasionally the tool hangs and It needs to be killed in order for the rest of the files to be processed. Whats the best way best way to apply a timeout after which the parent script will kill the hung process? At the moment I'm using: foreach $file (@FILES) { $runResult = `mytool $file >> $file.log`; } But when mytool hangs after n seconds I'd like to be able to kill it and continue to the next file.

    Read the article

  • Why wont my .NET 3.5 app run on fresh installation of windows7?

    - by acidzombie24
    In C:\Program Files\Reference Assemblies\Microsoft\Framework i see v3.0 and v3.5. I found that path in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\InstallRoot which also has that path. In C:\Windows\Microsoft.NET\Framework i see versions from 1 to 3.5 My app was built in msvs2010rc1 targeting 3.5. In fact in my project files i see v3.5. So whats with this? Why cant i run it? -edit- The application crashes on double click. With no exception dialog. Ok i see the problem. Sorry guys :$. I hope this post serves as a reference to someone else. I completely forgot that my app uses SDL.NET and i am use to C++ telling me i have forgotten a DLL.

    Read the article

  • ASP.NET MVC: trying out a script injection hangs Visual Studio 2010 completely?

    - by Mark Redman
    Wondering if anyone has an idea of whats going on: I am new to ASP.NET MVC and am trying out a few things with jquery/ajax. The basic scenario is a dropdownlist with an add button next to it. Clicking the add button launches a jquery ui dialog with a textbox form, entering a value saves the item to the database and refreshes the drop-downlist. The dropdownlist is re-populated using a JSON result. This all works ok. I thought I would try a script injetion attack, ie add the text: alert("oh dear") to seee what would happen and to check if I need to encode anything. When I try and save this item (similar to the same process of adding a plain text entry) Visual Studio 2010 Beta 2 hangs completely. Any ideas? UPDATE: It happens when posting: "</"

    Read the article

  • How to use parameter variable in xslt

    - by Abbi
    Hi I am new to xslt so please let me know whats wrong with my syntax here. If I compare with a Constant value of '880.50' I get the desired result. But if I try to do the samething with parameter being passed I get nothing. The code snippet is as under. <xsl:template name="ShowJourneyLegs" > <xsl:param name="TotalFare" /> <Key4><xsl:value-of select='$TotalFare'/></Key4> <JourneyLegKeys><xsl:value-of select="/FareSearchResponse/CompleteItineraryFares/AirFare[@Total = '880.50']/JourneyLegKeys/Key[1]"/></JourneyLegKeys> <JourneyLeg><xsl:value-of select="/FareSearchResponse/CompleteItineraryFares/AirFare[@Total = '$TotalFare']/JourneyLegKeys/Key[1]"/></JourneyLeg> </xsl:template>

    Read the article

  • Method not returning string value c# <List>

    - by Santii20
    public List<string> Test_IsDataLoaded() { try { if (GRIDTest.Rows.Count != 0) { int countvalue = GRIDTest.Rows.Count; GRIDTest.Rows[0].WaitForControlReady(); List<string> ReleaseIDList = new List<string>(); int nCellCount = GRIDTest.Cells.Count; for(int nCount = 0;nCount<nCellCount ;nCount++) { if(nCount %5==0) ReleaseIDList.Add((GRIDTest.Cells[0].GetProperty("Value").ToString())); } return ReleaseIDList; } } catch (Exception) { } } Method throws me error = Not all code path return a value. Whats wrong in code.

    Read the article

  • COUNT issue across multiple tables

    - by Kim
    I am trying to count across 2 tables and I dont see whats wrong with my query yet I get a wrong result. User 2 does not exist in table_two, so the zero is correct. SELECT t1.creator_user_id, COUNT(t1.creator_user_id), COUNT(t2.user_id) FROM table_one AS t1 LEFT JOIN table_two AS t2 ON t2.user_id = t1.creator_user_id GROUP BY t1.creator_user_id, t2.user_id Actual result 1 192 192 2 9 0 Expected result 1 16 12 2 9 0 The result indicate a missing group by condition, but I already got both fields used. Where am I wrong ? Also, can I sum up all users that doesnt exist in table_two for t1 ? Like user 3 exists 21 times in t1, then the results would be: 1 16 12 (users with > 0 in t2 will need their own row) 2 30 0 (user 2=9 + user 3=21 => 30) Its okay for the user Id to be wrong for sum of t1 for all users with 0 in t2. If not possible, then I'll just do two queries.

    Read the article

  • UrlRewriteFilter Direct to https

    - by adi
    I am using UrlRewriteFilter to redirect to SSL. I am running Glassfishv2. My rule looks something like this now. It's in my urlrewrite.xml in WEB-INF of my war folder. Is there any other glassfish setting that needs to be set? <rule> <condition name="host" operator="notequal">https://abc.def.com</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to type="permanent-redirect" last="true">https://abc.def.com/ghi/$1</to> </rule> But FF keeps saying that the URL redirect rule is in a way that it will never complete. I am not exactly sure whats happening here. any ideas?

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >