Search Results

Search found 9082 results on 364 pages for 'c functions'.

Page 225/364 | < Previous Page | 221 222 223 224 225 226 227 228 229 230 231 232  | Next Page >

  • Microsoft _stprintf warning

    - by mnh
    Why I get the following warning for the following code :) Code: _stprintf(m_szFileNamePath,_T("%s"),strFileName); warning C4996: '_swprintf': swprintf has been changed to conform with the ISO C standard, adding an extra character count parameter. To use traditional Microsoft swprintf, set _CRT_NON_CONFORMING_SWPRINTFS. I know _strprintf is a macro which if _UNICODE is defined will evaluate to _swprintf else it will be sprintf. Now what is this _swprintf. There is a function swprintf, but why is _stprintf evaluating to _swprintf instead of swprintf. What is the difference b/w the _xxx and xxx functions? EDIT: Okay there are two definitions for the UNICODE version of _stprintf, which one is included? The one in tchar.h or strsafe.h?

    Read the article

  • How to retrieve email from GMail account using PHP?

    - by Tatu Ulmanen
    Hi, I'm trying to automatically retrieve some email from my GMail account for further parsing, but I can't get my head around on how to do that. I've searched the internets and it suggested that I use PHP's imap functions, like this: $server = '{imap.gmail.com:993/ssl}'; $connection = imap_open($server, '[email protected]', 'password'); But using that code, I get: Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/ssl} Any idea what I am doing wrong? Any server setting that might be preventing me from making a connection to GMail (I'm using a shared service)? Is the address even right? Has anyone ever managed to do something like this? I've found tons of examples on how to send email via GMail, but very little of retrieving. Any help is much appreciated.

    Read the article

  • Compile a shared library statically

    - by Simon Walker
    I've got a shared library with some homemade functions, which I compile into my other programs, but I have to link the end program with all the libraries I have used to compile the static library. Here is an example: I have function foo in the library which requires a function from another library libbar.so. In my main program to use function foo I have to compile it with the -lbar flag. Is there a way I can compile my library statically so it includes all the required code from the other libraries, and I can compile my end program without needing the -lbar flag? Cheers

    Read the article

  • How to organize code using an optional assembly reference?

    - by apoorv020
    I am working on a project and want to optionally use an assembly if available. This assembly is only available on WS 2008 R2, and my ideal product whould be a common binary for both computers with and without the assembly. However, I'm primarily developing on a Windows 7 machine, where I cannot install the assembly. How can I organize my code so that I can (with minimum changes) build my code on a machine without the assembly and secondly, how do I ensure that I call the assembly functions only when it is present. (NOTE : The only use of the optional assembly is to instantiate a class in the library and repeatedly call a (single) function of the class, which returns a boolean. The assembly is fsrmlib, which exposes advanced file system management operations on WS08R2.) I'm currently thinking of writing a wrapper class, which will always return true if the assembly is not present. Is this the right way to go about doing this?

    Read the article

  • Using table-of-contents in code?

    - by AareP
    Do you use table-of-contents for listing all the functions (and maybe variables) of a class in the beginning of big source code file? I know that alternative to that kind of listing would be to split up big files into smaller classes/files, so that their class declaration would be self-explanatory enough.. but some complex tasks require a lot of code. I'm not sure is it really worth it spending your time subdividing implementation into multiple of files? Or is it ok to create an index-listing additionally to the class/interface declaration?

    Read the article

  • How to create Master/Detail view with two datagrids in ColdFusion

    - by Maklar
    In Coldfusion, I have Master and Detail data that I need to display in two separate cfgrids; like the typical Customers/Orders scenario. My cfgrids are bound to cfc functions which populate the cfgrids. In my current dataset, only one Customer has Orders and when I click on this record in the Master datagrid the Detail datagrid displays the related records. But when I click on a record in the Master datagrid that has no related detail records, the Detail datagrid does not refresh but maintains display of the previous data. Also the search icon within the datagrid's control panel indicates it is searching for values rather than displaying the Refresh icon. Can you please show me how to establish Master and Detail cfgrids where I can see Orders of Customers as I navigate through the Master datagrid? Any and all help will be greatly appreciated! Maklar

    Read the article

  • How to get current date and time from DB using SQLAlchemy

    - by bluish
    I need to retrieve what's the current date and time for the database I'm connected with SQLAlchemy (not date and time of the machine where I'm running Python code). I've seen this functions, but they don't seem to do what they say: >>> from sqlalchemy import * >>> print func.current_date() CURRENT_DATE >>> print func.current_timestamp() CURRENT_TIMESTAMP Moreover it seems they don't need to be binded to any SQLAlchemy session or engine. It makes no sense... Thanks!

    Read the article

  • PHP pass associative array from one function to another wihle keeping keys intact

    - by veronica
    I have two functions and one array function A { $segments = array(); $segments['word']=$var1; $segments['word2']=$var2; $segments['word3']=$var3; return $segments; } function B { $someVar=$segments['word']; $someVar1=$segments['word']; $someVar2=$segments['word']; $vars['other_stuff']... return $vars; } but I am not passing $segments['word']...word3'] to the second function. I am passing $segments[0]; $segments[1]; etc... How can I pass the keys to second function $segments['word'] $segments['word1'] $segments['word2'] Thank you,

    Read the article

  • Are multiline tooltips possible using CWnd::EnableTooltips()?

    - by ctoneal
    I'm attempting to make my tooltips multiline, but I don't seem to be having much luck with it. I call CWnd::EnableTooltips() directly after creation (in this case, an edit box) and I handle the TTN_NEEDTEXT message. My tooltips display correctly, but only display as a single line. I've tried adding '\n' to the string I pass when handling TTN_NEEDTEXT, and also tried '\r\n'. No luck. It just displays them as normal text in the tooltip string. I then tried manually inserting 0x0D0A, but this just displays as boxes. I've been digging a bit, and have found a few offhand references on the web saying that multiline behavior may not work when using tooltips through the CWnd functions. I'd prefer not to have to replace with CToolTipCtrl (since it's a rather large project). Has anyone ran into this before? If so, is there any way around it?

    Read the article

  • SEARCHING AND REPLACING BRACKETS IN A STRING IN ORACLE 10G

    - by Tunde
    hello, Thanks as usual for your prompt and kind suggestions. i am currently developing a function that is meant to execute dynamically created SQL statements. this is done by concatenating the columns and fetching them via cursors. the problem is that when there is a function with a comma between its arguments, the concat concatenates the contents of the functions inclusive. Is it possible to skip contents of every bracket found in a string using REGEXP_SUBTR or REGEXP_REPLACE? Many thanks for the anticipated response.

    Read the article

  • Implementing password hashing/salting algorithm from crackstation.net

    - by Mason240
    I am trying to implement a password hashing/salting algorithm from crackstation.net, but I am unsure how implement it. Storing the password upon user registration seems to be as simple as passing the password into create_hash(). $password = create_hash($_POST['Password']; I'm not following how to validate upon user login. validate_password($password, $good_hash) returns either true or false, and takes $password as parameter, so it seems like a no brainer except for the second parameter $good_hash. Where does this param come from? It is my understanding that password is turned into a hash value every time its used, and that the hash value is what is stored and compared. So why would I have both the $password and $good_hash values? Quick overview of the functions: function create_hash($password){ calls pbkdf2() } function validate_password($password, $good_hash){ calls pbkdf2() calls slow_equals() } function slow_equals($a, $b){ } function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false){ } Of course a different, better method for this would also be just as helpful. Thank you

    Read the article

  • clear html webpage?

    - by noname
    i am currently developing a crawler that crawls all links on the web and displays them in the web browser (and saving it of course). but after some hours there will be a huge list displayed on the web browser and i want to only display lets say 1000 links at the same time. then i clear the html and display another 1000 links. this is also good for the RAM or it will eat up all memory. how do i clear the web browser screen? EDIT: i have seen some scripts using some flush buffer functions. has this anything to do with my case?

    Read the article

  • Type patterns and generic classes in Haskell

    - by finnsson
    I'm trying to understand type patterns and generic classes in Haskell but can't seem to get it. Could someone explain it in laymen's terms? In [1] I've read that "To apply functions generically to all data types, we view data types in a uniform manner: except for basic predefined types such as Float, IO, and ?, every Haskell data type can be viewed as a labeled sum of possibly labeled products." and then Unit, :*: and :+: are mentioned. Are all data types in Haskell automatically versions of the above mentioned and if so how do I figure out how a specific data type is represented in terms of :*:, etc? The users guide for generic classes (ch. 7.16) at haskell.org doesn't mention the predefined types but shouldn't they be handled in every function if the type patterns should be exhaustive? [1] Comparing Approaches to Generic Programming in Haskell, Ralf Hinze, Johan Jeuring, and Andres Löh

    Read the article

  • Small Python optional arguments question

    - by ooboo
    I have two functions: def f(a,b,c=g(b)): blabla def g(n): blabla c is an optional argument in function f. If the user does not specify its value, the program should compute g(b) and that would be the value of c. But the code does not compile - it says name 'b' is not defined. How to fix that? Someone suggested: def g(b): blabla def f(a,b,c=None): if c is None: c = g(b) blabla But this doesn't work, because maybe the user intended c to be None and then c will have another value.

    Read the article

  • How do I pass custom variables to javascript events?

    - by RoboShop
    I have a user control with a javascript function which references some controls within the user control. This user control works perfectly when there is only one instance of it, but I'm now building a page where I have two instances of the user control. In IE7, it works fine, but in FireFox, it is getting confused that there is two functions of the exact same name and signature. So on UserControl1, it'll be running the function in UserControl2 and modifying that content. I'm thinking my best solution would be to pass the clientID of the components I need TO the function instead of just directly referencing it in the function. How would I do that? The signature of the javascript function is like this function nodeClicking(sender, args) and I'm calling it in an event like this <telerik:RadTreeView runat="server" ID="OrgUnitTreeView" OnInit="TreeViewLoad" OnClientNodeClicking="**nodeClicking**" EnableViewState="true" DataTextField = "OrganisationUnitName" DataValueField = "OrganisationUnitCode" DataFieldParentID = "ParentOrganisationUnitCode" DataFieldID = "OrganisationUnitCode"> How do I add extra variables to the function signature.

    Read the article

  • tracing a linux kernel, function-by function (biggest only) with us timer

    - by osgx
    Hello I want to know, how does the linux kernel do some stuff (receiving a tcp packet). In what order main tcp functions are called. I want to see both interrupt handler (top half), bottom half and even work done by kernel after user calls "read()". How can I get a function trace from kernel with some linear time scale? I want to get a trace from single packet, not the profile of kernel when receiving 1000th of packets. Kernel is 2.6.18 or 2.6.23 (supported in my debian). I can add some patches to it.

    Read the article

  • How to run Javascript code before document is completely loaded (using jQuery)

    - by eliza sahoo
    Hi all, I am sahring atip with you all.Please add on to this discussion. JQuery helps faster page load than javascript. JQuery functions are fired when the related elements are loaded, instead of complete pageload. This is a common practice to call a javascript function when page is loaded like window.onload = function(){ alert("Mindfire") } or Inside of which is the code that we want to run right when the page is loaded. Problematically, however, the Javascript code isn't run until all images are finished downloading (this includes banner ads). The reason for using window.onload in the first place is due to the fact that the HTML 'document' isn't finished loading yet, when you first try to run your code. To circumvent both problems, jQuery has a simple statement that checks the document and waits until it's ready to be manipulated, known as the ready event $(document).ready(function() { // Your code here });

    Read the article

  • How would you parse the location text from Twitter to get the latitude/longitude in Objective-C?

    - by Brennan
    The location text from Twitter could be just about anything. Sometimes Twitter clients set the location with the user's latitude and longitude in the following format. "\U00dcT: 43.05948,-87.908409" Since there is no built-in support for Regular Expressions in Objective-C I am considering using the NSString functions like rangeOfString to pull the float values out of this string. For my current purpose I know the values with start with 43 and 87 so I can key off those values this time but I would prefer to do better than that. What would you do to parse the latitude/longitude from this string?

    Read the article

  • Interpolating 1D Gaussian into 2D Gaussian

    - by Drazick
    Let's say I have a 1D Gaussian function. Its length is 600 for that matter. I want to Interpolate it into 2D Gaussian of the size 600 X 600. This is the code I wrote (OTFx is the Gaussian Function, OTF - 2d Interpolated Function): [x, y] = meshgrid([-300:299], [-300:299]); r = sqrt((x .^ 2) + (y .^ 2)); OTF = interp1([-300:299], OTFx, r(:), 'spline'); OTF = reshape(OTF, [600, 600]); The problem is I get Overshoot at the end: How can I prevent it? Is there better Interpolating algorithm for Monotonic Descending Functions?

    Read the article

  • Mobile Specific Site Development. Where to start?

    - by Andy
    I'm beginning the process of learning the ins and outs of developing sites for mobile web browsers. Are there any good resources/communities online that discuss mobile specific site development issues? My initial understanding is that to cover different phones you need to build one site that is enabled for browsers with the webkit engine (iphone, android, etc.) and another more basic site for other older browsers, is this assumption correct? Also what does developing for webkit mean exactly? How is it different than just using javascript/css/html? Is it the same except that you limit yourself to webkit specific functions and css? I looked on the webkit site, but it didn't explain it in those terms. Are there any other snafus I need to watch out for when developing for mobile browsers?

    Read the article

  • How to make scipy.interpolate give a an extrapolated result beyond the input range?

    - by Salim Fadhley
    I'm trying to port a program which uses a hand-rolled interpolator (developed by a mathematitian colleage) over to use the interpolators provided by scipy. I'd like to use or wrap the scipy interpolator so that it has as close as possible behavior to the old interpolator. A key difference between the two functions is that in our original interpolator - if the input value is above or below the input range, our original interpolator will extrapolate the result. If you try this with the scipy interpolator it raises a ValueError. Consider this program as an example: import numpy as np from scipy import interpolate x = np.arange(0,10) y = np.exp(-x/3.0) f = interpolate.interp1d(x, y) print f(9) print f(11) # Causes ValueError, because it's greater than max(x) Is there a sensible way to make it so that instead of crashing, the final line will simply do a linear extrapolate, continuing the gradients defined by the first and last two pouints to infinity. Note, that in the real software I'm not actually using the exp function - that's here for illustration only!

    Read the article

  • car and cdr in scheme is driving me crazy ...

    - by kristian Roger
    Hi Im facing a probem with the car and cdr functions for example: first I defined a list caled it x (define x (a (bc) d ( (ef) g ) )) so x now is equal to (a (bc) d ( (ef) g ) now for example I need to get the g from this list using only car and cdr (!! noshortcuts as caddr cddr !!) the correct answer is: (car(cdr(car(cdr(cdr(cdr x)))))) BUT how ? :-( I work according to the rule (the car gives the head of list and cdr gives the tail) and instead of getting the answer above I keep reaching wronge answers can any one help me in understanding this ... give me step or a way to solve it step by step thanx in advance Im really sick of scheme language.

    Read the article

  • Problem about python import with error

    - by xiao
    Hello, I have write a small python module with one class and two functions. The skeleton of the module is as following: #file name: test_module.py class TestClass: @classmethod def method1(cls, param1): #to do something pass def __init__(self, param1): #to do something ... def fun1(*params): #to do something ... def fun2(*params): #to do something ... Another py file is a small script which imports function and class from the module, as following: import sys from test_module import TestClass, fun1, fun2 def main(sys_argv): li = range(5) inst1 = TestClass(li) fun1(inst1) fun2(inst1) return if __name__ == "__main__": main(sys.argv) But when I execute the script, it is broken with following message: ./script.py: line 4: syntax error near unexpected token `(' ./script.py: line 4: `def main(sys_argv):' I am not sure what the problem is. Is it a problem with import? But when I try to import the module in ipython, everything is just ok.

    Read the article

  • Javascript: window.onload problem

    - by Matrym
    This isn't working in IE (although it does work in FFX). Why? Using HTML in the header: <script type="application/javascript"> // And finally, let's call the code ourselves. window.onload = lbp.init; </script> And then the script: // lbp is the script's universal variable, which retains everything var lbp = {}; // The sequence of functions to trigger lbp.init = function() { alert('hi'); } Thanks in advance for your help =)

    Read the article

  • Unix tree convert to recursive php array

    - by Fordnox
    I have a response from remote server like this: /home/computer/Downloads |-- /home/computer/Downloads/Apple | `-- /home/computer/Downloads/Apple/Pad |-- /home/computer/Downloads/Empty_Folder `-- /home/computer/Downloads/Subfolder |-- /home/computer/Downloads/Subfolder/Empty `-- /home/computer/Downloads/Subfolder/SubSubFolder `-- /home/computer/Downloads/Subfolder/SubSubFolder/Test this is the output for command computer@athome:$ tree -df --noreport -L 5 /home/computer/Downloads/ I would like to parse this string to recursive php array or object, something like this. I would show only part of result to get the idea. array( 'title' => '/home/computer/Downloads', 'children' => array( 0 => array( 'title' => '/home/computer/Downloads/Apple', 'children' => array( ... ) ) ); Response from server can change according to scanned directory. Can someone help me write this function. Please note that this is response from remote server and php functions can not scan any remote dir.

    Read the article

< Previous Page | 221 222 223 224 225 226 227 228 229 230 231 232  | Next Page >