Say there is a file called 12345.jpg. In C, how can I get the file extension so that I can compare with some file extension? If there are any inbuilt functions, kindly please let me know.
I have a full path to an image, which I am using jquery to read, in the form $('img.my_image').attr('src') however I just want the filename portion (discarding the path).
Are there any built-in functions to do this, or would a regex be the only option?
In NumPy functions, there are often initial lines that do checking of variable types, forcing them to be certain types, etc. Can someone explain the point of these lines? What does subtracting a value from itself do?
t,w = asarray(t), asarray(duty)
w = asarray(w + (t-t))
t = asarray(t + (w-w))
Outside the standard mouse/keyboard combination are there any other peripheals that you use to make you programming more efficient?
One option that I have considered is using AutoHotKey to script the buttons on a Logitech Wingman to run different functions/keystrokes that are not available on the keyboard.
I have a method that effectively takes a string. However, there is a very limited subset of strings I want to use. I was thinking of typedef'ing std::string as some class, and call the functions explicit. I'm not sure that would work, however. Ideas?
I need to write AVL-tree with generic type in C. The best way I know is to use [ void* ] and to write some functions for creating, copying, assignment and destruction. Please, tell me some better way.
After testing on msvc8, I found:
Parse GetCommandLine() to argc and argv
Standard C Library initialization
C++ Constructor of global variables
These three things are called before entering main().
My questions are:
Will this execution order be different when I porting my program to different compiler (gcc or armcc), or different platform?
What stuff does Standard C Library initialization do? So far I know setlocale() is a must.
Is it safe to call standard C functions inside C++ constructor of global variables?
I was wondering why the Vector variable defined within this self executing javascript function doesn't require a var before it? Is this just some other type of syntax for creating a named function? Does this make it so we can't pass Vector as an argument to other functions?
(function() {
Vector = function(x, y) {
this.x = x;
this.y = y;
return this;
};
//...snip
})()
I've bounced around between different wrappers, my own, and using straight php mysql functions over the years but I'm sure there's a really good solution out there. What is it? :)
EDIT: Only needs to connect to MYSQL and it would be nice if it was lightweight.
I have a script that uses ftp_connect() among other FTP PHP functions for uploading a file.
ftp_connect() works when executed on my local development server for connecting to a remote FTP server. The same script, when executed on the remote server does not work for connecting to the exact same FTP server.
Could somebody please point me in the right direction?
Thanks!
Title says it all really. Using only XSLT 1.0's string functions, how would I go about slicing off the end of a url?
So from
http://stackoverflow.com/questions/2981175/is-it-possible-to-slice-the-end-of-a-url-with-xslt-1-0
I would like to extract
is-it-possible-to-slice-the-end-of-a-url-with-xslt-1-0
Is this possible?
I am looking for a way to monitor a Linux mbox email account, when an email arrives I would like to download an attachment from the email and save the attachment (CSV file) so that it may be used by a PHP script. What would be the best way of going about this? I have looked at PHP's IMAP functions but this does not appear to be the most appropriate method when a simple bash script may be all that is required?
Is it safe to read directory entries via readdir() or scandir() while files are being created/deleted in this directory? Should I prefer one over the other?
When I say "safe" I mean entries returned by these functions are valid and can be operated without crushing the program.
Thanks.
I have a class defined called extBlock.
I then make an instance of that class with this
extBlock mainBlock = new extBlock(1, 1024);
I get this error:
error C2440: 'initializing' : cannot convert from 'extBlock *' to 'extBlock'
Can anyone help me with why I am getting this error.
I have seen examples online of declaring it like this with a pointer
extBlock *mainBlock = new extBlock(1, 1024);
But if I do it this way it does not let me call the functions of mainBlock
It seems that every project has an "utility" module with various code snippets used throughout other files and which don't fit any particular pattern.
What utility classes, functions, and macros do you find most useful in your C/C++ projects? Please keep the entries small (under 100 lines) and give only one example per post.
Can I share javascript libraries I've loaded in part of my website, with other components ?
For example, I'm loading a node of my drupal website into a lightbox (rel="lightmodal"), so it is not a frame.
I would like to have access from the content of the lightbox to qtip.js library (at the moment I'm using its functions but it doesn't find the library, so it doesn't work..)
thanks
How do I remove the numbers on the x-axis only not the y-axis?
Is it possible to shift the y-axis without shifting the functions? What I mean is, instead of having the y-axis at x = 0, could I have it at x = -5?
I'm using Masonry and Embedly plugin to display embedded content, I've put together an example in
jsfiddle.net/anir/pBtbb/3/
It appears the Masonry plugin loads first and it causes the overlapping problem (they only show correctly when you resize the result window) I've read that I could use callback functions or retrigger Masonry once embedly has finished rendering content, but I don't know how to do it. Can you help me? Is there any other solution to fix this?
Is there a built in equivalent to the .NET framework's DateAdd or AddMonths functions?
I'm looking for the easiest, cleanest way to add X month to a Javascript date.
I'd rather not handle the rolloing over of the year as done here.
or have to write my own function as done here.
Is there something built in that is as nice as the .NET Date.AddMonths function? Or something close?
How can I find the (x,y) point of the center of the viewable area of the browser?
I am using jQuery, if there are any good jQuery helper functions for this.
I have the web service and generated class for it. I can use this generated class in windows application as it described in Help. The question is: how can I use this generated class in the web project? (the analogous actions - creating object and use its functions -, as it was in windows app, are not worked)
Hello,
Im writing app in haskell and I would like to export some functions and datatypes to other files and then be able to use them in my main file.
How to do this ?
thanks for help