Daily Archives

Articles indexed Wednesday May 19 2010

Page 5/122 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Casting problem cant convert from void to float C++

    - by Makenshi
    as i said i get this horrible error i dont really know what to do anymore float n= xAxis[i].Normalize(); thats where i get the error and i get it cuz normalize is a void function this is it void CVector::normalize() { float len=Magnitude(); this->x /= len; this->y /= len; } i need normalize to stay as void tho i tried normal casting like this float n= (float)xAxis[i].Normalize(); and it doesnt work also with static,dynamic cast,reinterpret,const cast and cant make it work any help would be really apreciated... thank you .<

    Read the article

  • How can I log into gmail in a script/program using HTTPS?

    - by master chief
    My teacher has given me as an assignment to log into gmail and then send one e-mail or read the list of unread e-mails, but I can't use IMAP/POP3/SMTP or anything that isn't HTTP or HTTPS. I've tried looking for libraries in Ruby/Java to do it but nothing really worked for me. I tried looking at the gmail source code page but I couldn't really understand what was going on. The page seems to call a post method on a link, but sniffing the packets what I saw was a GET apparently using a session generated using the info I send. So sending it "raw" didn't work either. I've no idea what to do now.

    Read the article

  • What exactly is REST architecture and how is it implemented in Rails?

    - by Jagira
    This is what I think of REST architecture. For every resource, there is an unique URI. We can manipulate that object using its URI and HTTP actions [POST, GET, PUT and DELETE]. The HTTP request transfers the representation of the state of that object. In all the texts I have read, REST is explained in a weird and confusing manner. One more thing, RESTFUL implementation in rails produces different urls for different purposes. Like /teams - for 'index' method... /teams/new - for 'new' method and so on. Ain't this moving away from rest, which defines that each resource has one unique URI???

    Read the article

  • two independent dropdowns with xml binded data - cakephp - best method?

    - by gudinne
    What's best method within cakephp site for- two dropdowns one listing cds, one listing artists on select of either cd or artist I need my additional text to appear below dropdowns I have been searching through tutorials and manual - with no success. I am looking to learn by basic example - from form/view and controller. latest try was something along this example to get dropdown [http://stackoverflow.com/questions/1450457/cakephp-make-select-dropdown]

    Read the article

  • Storing multiple inputs with the same name in a CodeIgniter session

    - by Joshua Cody
    I've posted this in the CodeIgniter forum and exhausted the forum search engine as well, so apologies if cross-posting is frowned upon. Essentially, I've got a single input, set up as <input type="text" name="goal">. At a user's request, they may add another goal, which throws a duplicate to the DOM. What I need to do is grab these values in my CodeIgniter controller and store them in a session variable. My controller is currently constructed thusly: function goalsAdd(){ $meeting_title = $this->input->post('topic'); $meeting_hours = $this->input->post('hours'); $meeting_minutes = $this->input->post('minutes'); $meeting_goals = $this->input->post('goal'); $meeting_time = $meeting_hours . ":" . $meeting_minutes; $sessionData = array( 'totaltime' => $meeting_time, 'title' => $meeting_title, 'goals' => $meeting_goals ); $this->session->set_userdata($sessionData); $this->load->view('test', $sessionData); } Currently, obviously, my controller gets the value of each input, writing over previous values in its wake, leaving only a string of the final value. I need to store these, however, so I can print them on a subsequent page. What I imagine I'd love to do is extend the input class to be able to call $this-input-posts('goal'). Eventually I will need to store other arrays to session values. But I'm totally open to implementation suggestion. Thanks so much for any help you can give.

    Read the article

  • Is Spring.Threading.Helpers still supported?

    - by Paul Morrison
    I am converting some old C# code, and it has a CountDownLatch using a package called Spring.Threading.Helpers. The odd thing is that I can't find this package on Google - so a) is it still supported? And, if so, where is it documented? b) What I really want to do is wait for a count to get to zero, but interrupt every so many msecs. Would it just be simpler to set up another thread, and do WaitOnes on an Event specifying an interval? TIA

    Read the article

  • Des applications fleurissent sur la toile pour gérer la confidentialité sur Facebook, afin de protég

    Mise à jour du 18.05.2010 par Katleen Des applications fleurissent sur la toile pour gérer la confidentialité sur Facebook, afin de protéger facilement ses données personnelles Avec de plus en plus de changements dans ses paramètres de confidentialité, Facebook devient un site Internet compliqué à paramétrer pour certains. En effet, le réseau social offre pas moins de 50 paramètres assortis à plus de 70 options, pour contrôler ce que le Net peut voir de vous... Pour preuve, ce graphique publié la semaine dernière par le New York Times illustrant toutes les configurations disponibles : [IMG]http://graphics8.nytimes.com/packages/images/newsgraphics/2010/0512-facebook/gif1.jpg[/IMG]...

    Read the article

  • Help with POCO library (Shared memory)

    - by sevaxx
    I was advised to use the POCO library for inter-process communication (IPC). Looks like a powerful library and there is some documentation in the code, but I would prefer a working example , since I am not very familiar with the IPC stuff. I 've been searching for some time now and I'm out of luck. If anyone has used POCO Shared Memory successfully in the past, I would love to see some sample code !

    Read the article

  • What are your favorite extension methods for C#? (codeplex.com/extensionoverflow)

    - by bovium
    Let's make a list of answers where you post your excellent and favorite extension methods. The requirement is that the full code must be posted and a example and an explanation on how to use it. Based on the high interest in this topic I have setup an Open Source Project called extensionoverflow on Codeplex. Please mark your answers with an acceptance to put the code in the Codeplex project. Please post the full sourcecode and not a link. Codeplex News: 11.11.2008 XmlSerialize / XmlDeserialize is now Implemented and Unit Tested. 11.11.2008 There is still room for more developers. ;-) Join NOW! 11.11.2008 Third contributer joined ExtensionOverflow, welcome to BKristensen 11.11.2008 FormatWith is now Implemented and Unit Tested. 09.11.2008 Second contributer joined ExtensionOverflow. welcome to chakrit. 09.11.2008 We need more developers. ;-) 09.11.2008 ThrowIfArgumentIsNull in now Implemented and Unit Tested on Codeplex.

    Read the article

  • cancelPreviousPerformRequestWithTarget is not canceling my previously delayed thread started with pe

    - by jmurphy
    Hello, I've launched a delayed thread using performSelector but the user still has the ability to hit the back button on the current view causing dealloc to be called. When this happens my thread still seems to be called which causes my app to crash because the properties that thread is trying to write to have been released. To solve this I am trying to call cancelPreviousPerformRequestsWithTarget to cancel the previous request but it doesn't seem to be working. Below are some code snippets. - (void) viewDidLoad { [self performSelector:@selector(myStopUpdatingLocation) withObject:nil afterDelay:6]; } (void)viewWillDisappear:(BOOL)animated { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(myStopUpdatingLocation) object:nil]; } Am I doing something incorrect here? The method myStopUpdatingLocation is defined in the same class that I'm calling the perform requests. A little more background. The function that I'm trying to implement is to find a users location, search google for some locations around that location and display several annotations on the map. On viewDidLoad I start updating the location with CLLocationManager. I've build in a timeout after 6 seconds if I don't get my desired accuracy within the timeout and I'm using a performSelector to do this. What can happen is the user clicks the back button in the view and this thread will still execute even though all my properties have been released causing a crash. Thanks in advance! James

    Read the article

  • Multiple sections on landing page only

    - by RDRAO
    Hi every one, I am very much new to Drupal but am loving it to start with. I got struck at a point with respect to theaming. I have a region called 'footer-teaser' just above footer. Its width is 800px. its been split into 3 equal size columns. Each column has the following. Image of size 120x120 Some teaser text Link to 'read more' The design requirement is all the above should be editable by the admin from the admin interface. If its static i would have hardcoded this but since the requirement is dynamic, i am not aware of how to achieve this. I have customised page.tpl for other sections of the page except this. I am sure someone else would have faced this issue before and was wondering if anyone can direct me in the right direction? Even better if an example is provided. Cheers RD

    Read the article

  • XSLT-Looping and recursion based on parameter passed

    - by contactkx
    I have an XML organized like below- <section name="Parent 1 Text here" ID="1" > <section name="Child 1 Text here" ID="11"> </section> <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 1 Text here" ID="22"> </section> <section name="Child 2 Text here" ID="23"> <section name="GrandChild Text here" ID="232" > </section> </section> </section> I have to produce the below output XML - <section name="Parent 1 Text here" ID="1" > <section name="Child 2 Text here" ID="12"> <section name="GrandChild Text here" ID="121" > </section> </section> </section> <section name="Parent 2 Text here" ID="2" > <section name="Child 2 Text here" ID="23"> </section> </section> I have to achive above using XSLT 1.0 transformation. I was planning to pass a comma separated string as a parameter with value= "1,12,121,2,23" My question- How to loop the comma separated parameter in XSLT 1.0 ? Is there a simpler way to achieve the above. Please remember I have to do this in XSLT 1.0 Your help is appreciated.

    Read the article

  • Compiling for older versions of Mac OS X

    - by Tristan
    I have recently started producing applications for the Mac, on my most recent release I got overwhelming suggestions to get the app working on OSX 10.5 as I'm working in and compiling for 10.6. I tried looking for the 10.5 SDK but couldn't find it anywhere to download! How can I go about compiling my app for older versions of Mac OS X using Xcode 2.2 and developing in 10.6? EDIT: ------ I will mention I don't have the to option to select different SDKs as I don't have any others installed and my problem is more not being able to find where to get those sdks from? then actually not know how to go about compiling for the older sdks

    Read the article

  • Returning a C++ reference in a const member functionasses

    - by Chris Kaminski
    A have a class hierarchy that looks somethign like this: class AbstractDataType { public: virtual int getInfo() = 0; }; class DataType: public AbstractDataType { public: virtual int getInfo() { }; } class Accessor { DataType data; public: const AbstractDataType& getData() const { return(data); } } Well, GCC 4.4 reports: In member function ‘const AbstractDataType& Accessor::getData() const’: error: invalid initialization of reference of type ‘const AbstractDataType&’ from expression of type ‘const DataType’ Where am I going wrong - is this a case where I MUST use a pointer?

    Read the article

  • PHP PDO: Fetching data as objects - properties assigned BEFORE __construct is called. Is this correc

    - by Erik
    The full question should be "Is this correct or is it some bug I can't count on?" I've been working with PDO more and in particular playing with fetching data directly into objects. While doing so I discovered this: If I fetch data directly into an object like this: $STH = $DBH->prepare('SELECT first_name, address from people WHERE 1'); $obj = $STH->fetchAll(PDO::FETCH_CLASS, 'person'); and have an object like this: class person { public $first_name; public $address; function __construct() { $this->first_name = $this->first_name . " is the name"; } } It shows me that the properties are being assigned before the __construct is being called -- because the names all have " is the name" appended. Is this some bug (in which case I can't/won't count on it) or is this The Way It Should Be. Because it's really quite a nice thing the way it works currently.

    Read the article

  • How to log messages passing through ejabberd

    - by Adil
    I would like to log when a stanza (message and presence only) was received by the ejabberd server,a nd when it was sent to the other party (or broardcast). Whats important for me is to log the stanza and the times they are sent & received. Thanks.

    Read the article

  • customized StringFormat in WPF DataGrid

    - by Boris Lipschitz
    What would be the most efficient way to set customized formatting of the column in DataGrid. I can't use the following StringFormat, as my sophisticated formatting also depends on some other property of this ViewModel. (e.g Price formatting has some complicated formatting logic based on different markets.) Binding ="{Binding Price, StringFormat='{}{0:#,##0.0##}'}"

    Read the article

  • How do I send an email with embedded images AND regular attachments in JavaMail?

    - by Chris
    Hi, I'd like to know how to build an SMTP multipart message in the correct order so that it will render correctly on the iPhone mail client (rendering correctly in GMail). I'm using Javamail to build up an email containing the following parts: A body part with content type "text/html; UTF-8" An embedded image attachment. A file attachment I am sending the mail via GMail SMTP (via SSL) and the mail is sent and rendered correctly using a GMail account, however, the mail does not render correctly on the iPhone mail client. On the iPhone mail client, the image is rendered before the "Before Image" text when it should be rendered afterwards. After the "Before Image" text there is an icon with a question mark (I assume it means it couldn't find the referenced CID). I'm not sure if this is a limitation of the iPhone mail client or a bug in my mail sending code (I strongly assume the latter). I think that perhaps the headers on my parts might by incorrect or perhaps I am providing the multiparts in the wrong order. I include the text of the received mail as output by gmail (which renders the file correc Message-ID: <[email protected]> Subject: =?UTF-8?Q?Test_from_=E3=82=AF=E3=83=AA=E3=82=B9?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_0_20870565.1274154021755" ------=_Part_0_20870565.1274154021755 Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-ID: <20100518124021763_368238_0> iVBORw0K ----- TRIMMED FOR CONCISENESS 6p1VVy4alAAAAABJRU5ErkJggg== ------=_Part_0_20870565.1274154021755 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit <html><head><title>Employees Favourite Foods</title> <style> body { font: normal 8pt arial; } th { font: bold 8pt arial; white-space: nowrap; } td { font: normal 8pt arial; white-space: nowrap; } </style></head><body> Before Image<br><img src="cid:20100518124021763_368238_0"> After Image<br><table border="0"> <tr> <th colspan="4">Employees Favourite Foods</th> </tr> <tr> <th align="left">Name</th><th align="left">Age</th><th align="left">Tel.No</th><th align="left">Fav.Food</th> </tr> <tr style="background-color:#e0e0e0"> <td>Chris</td><td>34</td><td>555-123-4567</td><td>Pancakes</td> </tr> </table></body></html> ------=_Part_0_20870565.1274154021755 Content-Type: text/plain; charset=us-ascii; name=textfile.txt Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=textfile.txt This is a textfile with numbers counting from one to ten beneath this line: one two three four five six seven eight nine ten(no trailing carriage return) ------=_Part_0_20870565.1274154021755-- Even if you can't assist me with this, I would appreciate it if any members of the forum could forward me a (non-personal) mail that includes inline images (not external hyperlinked images though). I just need to find a working sample then I can move past this. Thanks, Chris.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >