excel issue - calculating formulas are not happening automatically
I am using Microsoft excel 2010. Values are getting downloaded from
database and I am writing them on to excel. I have some formulas written
in excel itself. So, my formulas would be using the values downloaded from
excel and showing the value of formula in one cell. But for some reason,
the value is not showing automatically and I need to press ALT+CTRL+F9 to
see the value (calculated using formula of that cell).
Can anyone tell me is there any other way to avoid pressing ALT+CTRL+F9 ?
downloading all the values and writing in excel is happening through java,
hibernate.
Thanks in Advance,
Thursday, 3 October 2013
Wednesday, 2 October 2013
Handling unknown structs imported from dll
Handling unknown structs imported from dll
I have tried to streamline this, but if you need more detail or code, let
me know.
First, some background: I am making a module for a program using exported
functions from a .dll to communicate with it. I do not have support from
the original developer, so I do not have access to the source code,
headers, .lib, or anything else. I used dependency walker to get a list of
function names, and explicitly linked using getProcAddress with success on
most functions. (Here is the solution I used to get this far.)
Now the problem I have run into is how to handle unknown structs. For
example, I have access to the following equations:
foo::bar::bar(void)
struct foo::bar magic(void)
foo::baz::baz(struct foo::bar const &)
int foo::baz::qux(void)
So the top function is a constructor that makes an object with the same
name as the struct. The second function is a magic function that outputs
the struct with all the data in it. The third function is another
constructor that makes a new object with that struct as an input. The
final function outputs an integer value (what I really care about) with
the object just created.
As you can see, I don't know, nor do I care what is in the struct. It just
gets magically created and immediately passed to another function that
deals with it. So here is how I attempted to handle it (look at the
solution linked in the first paragraph if this doesn't make sense):
struct barStruct {
void** unknown1[1024];
void** unknown2[1024];
void** unknown3[1024];
};
typedef barStruct (*_magic) (char *);
typedef void (*_bazConstructor) (char *, struct barStruct const &);
typedef int (*_qux) (char *);
I think I figured out how many elements there are in barStruct because
bazConstructor will crash if there are too many. The problem is, no matter
what I have tried, qux will crash. I am guessing this has something to do
with how I am handling barStruct. Is it necessary to define the struct
like this? Is there a way to pass it directly from magic to the
bazconstructor without trying to say what is in it?
Basically: How should I handle a struct if I have no idea what it is
supposed to contain?
I have tried to streamline this, but if you need more detail or code, let
me know.
First, some background: I am making a module for a program using exported
functions from a .dll to communicate with it. I do not have support from
the original developer, so I do not have access to the source code,
headers, .lib, or anything else. I used dependency walker to get a list of
function names, and explicitly linked using getProcAddress with success on
most functions. (Here is the solution I used to get this far.)
Now the problem I have run into is how to handle unknown structs. For
example, I have access to the following equations:
foo::bar::bar(void)
struct foo::bar magic(void)
foo::baz::baz(struct foo::bar const &)
int foo::baz::qux(void)
So the top function is a constructor that makes an object with the same
name as the struct. The second function is a magic function that outputs
the struct with all the data in it. The third function is another
constructor that makes a new object with that struct as an input. The
final function outputs an integer value (what I really care about) with
the object just created.
As you can see, I don't know, nor do I care what is in the struct. It just
gets magically created and immediately passed to another function that
deals with it. So here is how I attempted to handle it (look at the
solution linked in the first paragraph if this doesn't make sense):
struct barStruct {
void** unknown1[1024];
void** unknown2[1024];
void** unknown3[1024];
};
typedef barStruct (*_magic) (char *);
typedef void (*_bazConstructor) (char *, struct barStruct const &);
typedef int (*_qux) (char *);
I think I figured out how many elements there are in barStruct because
bazConstructor will crash if there are too many. The problem is, no matter
what I have tried, qux will crash. I am guessing this has something to do
with how I am handling barStruct. Is it necessary to define the struct
like this? Is there a way to pass it directly from magic to the
bazconstructor without trying to say what is in it?
Basically: How should I handle a struct if I have no idea what it is
supposed to contain?
Remove a single space character from a long string of spaces
Remove a single space character from a long string of spaces
I am trying to remove a single space character from a long string of let's
say 10 spaces. Example (first row is before, second row is after, dots
used instead of single spaces for better understanding):
".........."
"........."
Just one space removal at a time.
I am trying to remove a single space character from a long string of let's
say 10 spaces. Example (first row is before, second row is after, dots
used instead of single spaces for better understanding):
".........."
"........."
Just one space removal at a time.
Rcpp First Compilation trouble
Rcpp First Compilation trouble
I recently downloaded the 2013 Rcpp book off amazon to learn how to use
C++ with my R code better and I'm trying the first compilation example
with the first fibonacci recursion function and wrapper to see if I can do
it. I'm on Ubuntu with the latest R.
First my C++:
/* Cpp based recurive function */
int fibonacci(const int x){
if(x == 0) return(0);
if(x == 1) return(1);
return(fibonacci(x - 1) + fibonacci(x - 2));
}
/* Wrapper */
extern "C" SEXP fibWrapper(SEXP xs) {
int x = Rcpp::as<int>(xs);
int fib = fibonacci(x);
return(Rcpp::wrap(fib));
}
Then I start sh and type in:
PKG_CXXFLAGS=`Rscript -e 'Rcpp:::CxxFlags()'`
PKG_LIBS=`Rscript -e 'Rcpp:::LdFlags()'`
R CMD SHLIB Fibonacci.cpp
But I get:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c
Fibonacci.cpp -o Fibonacci.o
Fibbonacci.cpp:10:12: error: 'SEXP' does not name a type
make: *** [Fibonacci.o] Error 1
I figure maybe I need the include directive in my C++ code, so I do it
again, but this time with #include<Rcpp.h> at the top of the C++ file, and
do the same commands in sh again, but still no joy:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c
Fibonacci.cpp -o Fibonacci.o
Fibonacci.cpp:1:18: fatal error: Rcpp.h: No such file or directory
compilation terminated.
make: *** [Fibbonacci.o] Error 1
What have I done wrong? If I query the values I've set in sh:
$PKG_CXXFLAGS
sh: 9: -I/local/yrq12edu/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include:
not found
$PKG_LIBS
sh: 10: -L/local/yrq12edu/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/lib: not
found
But I think the not found messages are just because of the -L flag since
the files are there if I cd to the directory.
Thanks, Ben.
I recently downloaded the 2013 Rcpp book off amazon to learn how to use
C++ with my R code better and I'm trying the first compilation example
with the first fibonacci recursion function and wrapper to see if I can do
it. I'm on Ubuntu with the latest R.
First my C++:
/* Cpp based recurive function */
int fibonacci(const int x){
if(x == 0) return(0);
if(x == 1) return(1);
return(fibonacci(x - 1) + fibonacci(x - 2));
}
/* Wrapper */
extern "C" SEXP fibWrapper(SEXP xs) {
int x = Rcpp::as<int>(xs);
int fib = fibonacci(x);
return(Rcpp::wrap(fib));
}
Then I start sh and type in:
PKG_CXXFLAGS=`Rscript -e 'Rcpp:::CxxFlags()'`
PKG_LIBS=`Rscript -e 'Rcpp:::LdFlags()'`
R CMD SHLIB Fibonacci.cpp
But I get:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c
Fibonacci.cpp -o Fibonacci.o
Fibbonacci.cpp:10:12: error: 'SEXP' does not name a type
make: *** [Fibonacci.o] Error 1
I figure maybe I need the include directive in my C++ code, so I do it
again, but this time with #include<Rcpp.h> at the top of the C++ file, and
do the same commands in sh again, but still no joy:
g++ -I/usr/share/R/include -DNDEBUG -fpic -O3 -pipe -g -c
Fibonacci.cpp -o Fibonacci.o
Fibonacci.cpp:1:18: fatal error: Rcpp.h: No such file or directory
compilation terminated.
make: *** [Fibbonacci.o] Error 1
What have I done wrong? If I query the values I've set in sh:
$PKG_CXXFLAGS
sh: 9: -I/local/yrq12edu/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/include:
not found
$PKG_LIBS
sh: 10: -L/local/yrq12edu/R/x86_64-pc-linux-gnu-library/3.0/Rcpp/lib: not
found
But I think the not found messages are just because of the -L flag since
the files are there if I cd to the directory.
Thanks, Ben.
Why this equation returns zero even though it should not?
Why this equation returns zero even though it should not?
So, I'm doing a fighting game in java and I have this equation that always
returns zero.
int x = 90/100*300;
It should be 270 but it returns zero. :|
So, I'm doing a fighting game in java and I have this equation that always
returns zero.
int x = 90/100*300;
It should be 270 but it returns zero. :|
Tuesday, 1 October 2013
Browser will not display images - PHP
Browser will not display images - PHP
It would be great if someone could help me figure out why the browser
cannot load the images (error 404). The code works, and the image source
is correct, but I cannot figure out what is wrong. (using localhost)
<?php
$dir = '/home/user/Pictures';
$file_display = array('jpg', 'jpeg', 'png', 'gif');
if (file_exists($dir) == false) {
echo 'Directory \'', $dir, '\' not found!';
} else {
$dir_contents = scandir($dir);
foreach ($dir_contents as $file) {
$file_type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($file_type,
$file_display) == true)
{
echo '<img src="', $dir, '/', $file, '" alt="', $file, '" />';
}
}
}
?>
It would be great if someone could help me figure out why the browser
cannot load the images (error 404). The code works, and the image source
is correct, but I cannot figure out what is wrong. (using localhost)
<?php
$dir = '/home/user/Pictures';
$file_display = array('jpg', 'jpeg', 'png', 'gif');
if (file_exists($dir) == false) {
echo 'Directory \'', $dir, '\' not found!';
} else {
$dir_contents = scandir($dir);
foreach ($dir_contents as $file) {
$file_type = strtolower(end(explode('.', $file)));
if ($file !== '.' && $file !== '..' && in_array($file_type,
$file_display) == true)
{
echo '<img src="', $dir, '/', $file, '" alt="', $file, '" />';
}
}
}
?>
handling posted images using asp.net mvc
handling posted images using asp.net mvc
I want to save multiple images at once using asp.net mvc4. At view side I
have 5 browse button and I'm successf. getting those file at the
controller side as parameter at post action
IEnumerable<HttpPostedFileBase> postedPhotos.
I want to know if postedPhotos[0] was sent, if so save it to the db.
iterate trough remaining postedPhotos collection and take further action
only to those which actually contains photo (user can send only one or two
image instead of five)
so I tried with
if(postedPhotos.First() != null)
foreach(var photo in postedPhotos.Where(x=>x.ContentLength>0))
{....}
but this doesn't work since I'm touching postedPhoto null value and I'm
getting exception
Object reference not set to an instance of an object.
ofcourse everything works if I send all five photos but I'm interesting
how to handle this situation.
THanks
I want to save multiple images at once using asp.net mvc4. At view side I
have 5 browse button and I'm successf. getting those file at the
controller side as parameter at post action
IEnumerable<HttpPostedFileBase> postedPhotos.
I want to know if postedPhotos[0] was sent, if so save it to the db.
iterate trough remaining postedPhotos collection and take further action
only to those which actually contains photo (user can send only one or two
image instead of five)
so I tried with
if(postedPhotos.First() != null)
foreach(var photo in postedPhotos.Where(x=>x.ContentLength>0))
{....}
but this doesn't work since I'm touching postedPhoto null value and I'm
getting exception
Object reference not set to an instance of an object.
ofcourse everything works if I send all five photos but I'm interesting
how to handle this situation.
THanks
Wait command usage in linux=?iso-8859-1?Q?=3F_=96_unix.stackexchange.com?=
Wait command usage in linux? – unix.stackexchange.com
#!/bin/bash function back() { sleep $1 exit $2 } back $1 $2 & b=$! if
`wait $!`;then echo success else echo failure fi bash-3.00# ./back 300 0
failure bash-3.00# ./back 300 1 …
#!/bin/bash function back() { sleep $1 exit $2 } back $1 $2 & b=$! if
`wait $!`;then echo success else echo failure fi bash-3.00# ./back 300 0
failure bash-3.00# ./back 300 1 …
Where can I download the dhcpd3-server source code?
Where can I download the dhcpd3-server source code?
could you tell me where I can find the source code for dhcpd3-server? I
know I can find the ready packages for Ubuntu/Fedora but I need to
download the source code so I can..study it
Thanx in advance
could you tell me where I can find the source code for dhcpd3-server? I
know I can find the ready packages for Ubuntu/Fedora but I need to
download the source code so I can..study it
Thanx in advance
Subscribe to:
Comments (Atom)