How can I get the relative path of the folders in my project (using code)?
I created new folder in my project and I want its relative path so no matter where is the app the path will be correct.
Maybe this can be useful:
I trying to do it not inside any function just inside the class and I want to init with it a final variable. the app is android and the class is "extends Activity"
thanks
I have setAttribute(Qt::WA_OpaquePaintEvent,true) on a widget. From a mouseMoveEvent, I scroll the widget. Now what I need to do is to update the newly exposed area, but it seems that doing this from the paintevent function create an artifact because there is a delay created when the user keeps scrolling. In other words, the widget seems to have scrolled again between the call to scrool and the call or end of paintevent.
For example, while the paint event is trying to draw the desired area, the widget is still scrolling
I have a contact form that can be hidden using .slideToggle() but I want the tab used to Toggle the form to change text based on wether the form is in view or hidden.
Here is the jQuery:
$("#slider").click(function() {
$("#form_wrap").animate({ opacity: 1.0 },200).slideToggle();
});
I want the text of #form_wrap to read 'Hide' then 'Show'.
Any help appreciated!
I have a C++ program that takes user input for fopen in order to initiate a file write. Could someone help me find a function which will return a FILE* and use the Windows specific version of mkdir in order to create the folder structure for fopen to never fail to open a new file in the specified location because one of the folders does not exist. Thanks a bunch!
I'm using a macro and I think it works fine -
#define CStrNullLastNL(str) {char* nl=strrchr(str,'\n'); if(nl){*nl=0;}}
So it works to zero out the last newline in a string, really its used to chop off the linebreak when it gets left on by fgets.
So, I'm wondering if I can "return" a value from the macro, so it can be called like
func( CStrNullLastNL( cstr ) ) ;
Or will I have to write a function
Say I have a dataframe df with two or more columns, is there an easy way to use unique() or other R function to create a subset of unique combinations of two or more columns?
I know I can use sqldf() and write an easy "SELECT DISTINCT var1, var2, ... varN" query, but I am looking for an R way of doing this.
It occurred to me to try ftable coerced to a dataframe and use the field names, but I also get the cross tabulations of combinations that don't exist in the dataset:
uniques <-
as.data.frame(ftable(df$var1,
df$var2))
I have a C++ string. I need to pass this string to a function accepting char* parameter,
for example - strchr().
a) How do I get that pointer?
b) Is there some funtion equivalent to strschr() that works for C++ strings?
link text
I want to make page-flip animation for iPhone. I know that iPhone has curlUp and curlDown animation function. But I'm not use. How to do page-flip animation for iPhone. Advice for me.
Hello, I have an easy script, that works in all browsers, except IE(8, haven't tryed lower versions yet).
$('.deleteItemIcon').click(function() {
var deleteConfirm = confirm('Do you really wanna delete that item?')
if (!deleteConfirm) {
return false;
}
});
Can you see a reason, why that shouldn't be working, if yes, how to make it work?
Is there a method to detect the value of a image rgb that is blury?
I simply want to store the blury value of my image in a variable called blury value? Is there a dedicated function?
%image1 which is rgb is stored in variable img1
img1 = imread('102.jpg');
% conversion to grayscale stored in img1_grey variable
img1_grey = rgb2gray(img1);
blury_value = function_matlab(img1)
im using netbeans to code a web application with symfony.
it seems that netbeans doesnt support symfony in auto completion.
could one fix this problem.
cause i want to be able to click on symfony's functions and get to the source, eg helper function and model methods and classes.
Please let me know when a call to shmat function can raise a signal 11.
if ((shmId=shmget(shmKey, 0, 0)) <= 0) {
printf( "shmget(0x%x)", shmKey);
return 0;
}
printf( "queueOpen - Key 0x%x gives ID %d", shmKey, shmId);
qh = shmat(shmId, 0, SHM_RND);
I am getting a signal 11 by the code above. Please help
I want to use dup2 to read from input file and redirect it to the input of exec function. but my problem is i have three running process all of them have to open same input file but they do different jobs. what your suggest in such case? i don't know if it is possible to use "cat data.txt" to feed the input for the three other process but i don't know the way to do that.
I start to learn class in PHP. According to my experience with other language, i can tell class is different then function. So, how we spot if our class start to be too much and too important and how we minimize its impact ?
0 down vote
hi,
I have problem in showing $date="2011-02-10 15:26:20"; in the format of Thursday 10th of February 2011 03:26:20 PM in php.
i know there is one date function in php and can be done in one line for example: but via this it will flash today date or so.
i want to do it when user check any date and want that date in the format which i mention earlier.
please revert me back as soon as posib....
thanks
i have a parent window and a child window. in javascript, i want a function in child window to be called whenever the parent window loads a new page. i'd like to use something similar to jQuery's $(document).ready() so that I don't have to worry about whether the parent is done loading yet - but ready() only appears to fire when the window loads the first page - but not when, say, a link is clicked in the parent and it loads a second page.
any suggestions? thanks.
{"paging": {"pageNum":2,"action":"Next","type":"","availableCacheName":"getAllFunds","selectedCacheName":"","showFrom":101,"showTo":200,"totalRec":289,"pageSize":100},
"Data":[{"sourceCodeId":0,"radio_fund":"individua
l","availableFunds":[],"fundId":288,"searchName":[],"fundName":"Asian Equity Fund A Class Income","srcFundGrpId":"PGI","firstElement":0,"las
tElement":0,"totalElements":0,"pageList":[],"standardExtract":true}]
I have json file with above format with two fileds,one paging and one is Data array.
I able to retrieve values of paging,but i am not able to retrieve the values of data array with .each function of jquery.
Any suggestions or inputs really appreciated.
hello,
GOOGLE has yet to find an answer for me, so here goes:
In FORTRAN, is there a way to determine the TYPE of a variable? E.G., pass the variable type as an argument in a function, to then be able to call type-specific code with that fuction; eliminating the need to have seperate similar functions for each data type. thanks.
this is how we use MPI_Init function
int main(int argc, char **argv)
{
MPI_Init(&argc, &argv);
…
}
why does MPI_Init use pointers to argc and argv instead of values of argv?
Lets say I have something like...
void foo()
{
char c[100];
printf("this function does nothing useful");
}
When foo is called, it creates the array on the stack, and when it goes out of scope, is the memory deallocated automatically? Or is c destroyed, but the memory remains allocated, with no way to access it/get it back except restarting the computer?
This seems to work on everything but explorer:
NextButJar.addEvent("click", function() {
if (this.disabled == true) {
alert("Please view all tabs first!");
return;
}
});
Any help welcome
I have a column defined like this:
<DataGridTextColumn Binding="{Binding Path=FileSizeBytes, Mode=OneWay}" Header="Size" IsReadOnly="True" />
But instead of displaying the file size as a big number, I'd like to display units, but still have it sort by the actual FileSizeBytes. Is there some way I can run it through a function or something before displaying it?
I need a log function in my javascript but it needs to be base 10, I can't see any listing for this so I'm assuming it's not possible... any math wizards out there know of an approach for this? Or maybe I'm missing something and there is a way?
if i do this in a worksheet:
=RAND()
i also specified that i want only 2 decimal places
and for example let's say that rand() = 0.07
what is the probability that when i call this function again i will get 0.07 ??
i know that ideally if we assume 100% randomness, the answer would be 1/ (10 * 10) because there are only 100 possible combinations, but what would it be according to the way excel generates a random number?