How to render JPEG/PNG file data contained in Javascript variable? Is it possible ? What javascript libraries needed ? Browser in use is FF / IE.
Thanks
I'm trying to load an external JavaScript using jQuery's getScript(), like this:
$.getScript("http://api.recaptcha.net/js/recaptcha_ajax.js", function(data) {
window.alert(data);
});
but as the alert window shows, the data variable in the callback function is undefined, unlike promised in http://docs.jquery.com/Ajax/jQuery.getScript#urlcallback.
Anyone know why this might be?
Thanks.
Is there a way to store the font-size/line-height in a Sass variable like this:
$font-normal: 14px/21px;
Using this declaration I get a division as described in the documentation. Is there a way to avoid the division?
Note: I use the scss syntax.
Trying a bit of AJAX, and I find that much of my data is littered with underscores!
Documentation confirms that this is working as intended. Any way to pass my form information to PHP intact? I'm using CodeIgniter, so my pass looks like /controller/function/variable,
receiving controller:
controller{
function($v=0){#what once was hello world is now hello_world...}
}
I can't very well do an undo, data might contain an underscore.
Thanks,
Brandon
Hello,
I'm trying to create a stacked bar graph with variable coloring in each stacked bar; that is, one bar has say blue on top of red, the next one red on top of purple, ect. I also wanted to preserve the ability to stack graphs. Thank you so much guys.
Adam
hello,
i'm currently looking at a little 3rd-party javascript library and i see a lot of "sign-prefixed" variables in it:
function_call(+value);
i know, that you can swap the sign, if you prefix a variable with '-', but why to prefix something with a '+' -- it doesn't do anything to the value, no?
thanks in advance!
I have the following variable which creates problem when i use multiples instance of the same web form. Could you please let me know how i could what variables other than shared i can use to achieve this purpose?
Public strRoleType As String = String.Empty
Protected Shared isAreaSelected As Integer = 0
Protected Shared isStoreSelected As Integer = 0
Protected Shared isHeadOfficeSelected As Integer = 0
Protected Shared isRegionSelected As Integer = 0
Hi Folks,
Is there any problem with keeping member variable pointer refernces to COM objects and reussing the reference through out the class in C++.
Is anybody aware of a reason why you would want to call .CreateInstance every time you wanted a to use the COM object i.e. you were getting a fresh instance each time.
I cannot see any reason who you would want to do this,
Thanks,
(No is an acceptable answer!!!)
In the following code snippet, if I leave out the line of code that is surrounded by the /////'s, I get an error that reads: "Use of unassigned local variable CurrentDate". It seems a bit silly for me to just give CurrentDate an arbitrary value, is there a better way around this?
DateTime CurrentDate;
///////////////////////////
CurrentDate = DateTime.Now;
///////////////////////////
if(1==1)
{
CurrentDate = DateTime.Now.AddDays(1);
}
if(CurrentDate == DateTime.Now)
{
...
}
Is there any way to override the setting of instance variables in Ruby?
Lets say I set an instance variable:
@foo = "bar"
Can I intercept that and do something (like record it or puts, for instance)
uninitialized class variable @@configuration in Rails
/usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:19:in `configuration'
/usr/lib/ruby/gems/1.8/gems/thoughtbot-factory_girl-1.2.2/lib/factory_girl.rb:24
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
This is the initial part of the enviroment.rb:
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
config.gem "oauth", :version => "0.2.7", :lib => "oauth"
How do I determine if variable is 'undefined' or 'null'. My code is as follows:
EmpName = $("div#esd-names div#name").attr('class');
if(EmpName == 'undefined'){
///DO SOMETHING/////
};
Here is the typical way to use a condition variable:
// The reader(s)
lock(some_mutex);
if(protected_by_mutex_var != desired_value)
some_condition.wait(some_mutex);
unlock(some_mutex);
// The writer
lock(some_mutex);
protected_by_mutex_var = desired_value;
unlock(some_mutex);
some_condition.notify_all();
But if protected_by_mutex_var is set atomically by say, a compare-and-swap instruction, does the mutex serve any purpose (other than that pthreads and other APIs require you to pass in a mutex)? Is it protecting state used to implement the condition? If not, is it safe then to do this?:
// The writer
protected_by_mutex_var = desired_value;
some_condition.notify_all();
With the writer never directly interacting with the reader's mutex? If so, is it even necessary that different readers use the same mutex?
In C++:
On stack, a simple variable is assigned a memory address so that we can use pointer to contain this memory to point to it;
then is a pointer also assigned a memory address?
if yes, we can have pointer of pointers now?
Thanks!
Here's an easy one straight from the text book I can't seem to find.
I have a javascript function. I want it to contain a private variable which remembers its value between invocations.
Can someone jog my memory please.
Hi,
I need a way to store the current user's SID in a variable, I tried a lot of variants of:
setlocal enableextensions
for /f "tokens=*" %%a in (
'"wmic path win32_useraccount where name='%UserName%' get sid"'
) do (
if not "%%a"==""
set myvar=%%a
echo/%%myvar%%=%myvar%
pause
endlocal
None are working
wmic path win32_useraccount where name='%UserName%' get sid
should be returning 3 lines, i need the second one stored in a variabel
Can someone fix my script?
edit
btw; I am using a .cmd file
I am having a problem getting a RegExp with a variable to work in IE. It works fine in firefox:
wordChar = word[i]
var expr = new RegExp(wordChar,"i")
var hold = expr.test(input[i])
Not sure how to go about fixing this.
Is there a way to define a function in PHP that lets you define a variable amount of parameters?
in the language I am more familiar with it is like so:
function myFunction(...rest){ /* rest == array of params */ return rest.length; }
myFunction("foo","bar"); // returns 2;
Thanks!
I was looking at this post, and it is close to what I need:
http://stackoverflow.com/questions/1669165/php-how-to-count-60-days-from-the-add-date
However, in that post, the calculation is performed by adding 60 days to the current date. What I need to do is calculate the date based on a variable date (and not the current date).
Something like this:
$my_date = $some_row_from_a_database;
$date_plus_10_days = ???;
Anyone know how to do that?
Thanks
Trying a bit of AJAX, and I find that much of my data is littered with underscores!
Documentation confirms that this is working as intended. Any way to pass my form information to PHP in tact? I'm using code igniter, so my pass looks like /controller/function/variable,
receiving controller:
controller{
function($v=0){#what once was hello world is now hello_world...}
}
I can't very well do an undo, data might contain an underscore.
Thanks,
Brandon
i,
I have posted query previously and i am repeating same I want to modify igmpv3 (Linux)
which is inbuilt in kernel2.6.-- such that it reads a value from a file and appropriately decides reserved(res 1) value inside the igmpv3 paket which is sent by a host.
I want to add more to above question by saying that this is more a generic question of changing variable
of kernel space from user space.
Thanks in advance for your help.
Regards,
Bhavin
I have a java program that fires off an executable using the Runtime.exec() method. I'm using the variant that takes in a set of command line params as one argument, and some environment variables as another argument.
The environment variable I'm tryign to set is path, so i'm passing in "PATH=C:\some\path". This does not work. Is there some trick to this or any alternatives. I am stuck to Java 1.4 unfortunately.
I am passing variable to template in web.py and have the same condition in some places. Like this:
$if myvar=="string1":
$passed argument1
............
$if myvar =="striung2":
$passed argument2
If say myvar is "string1" and I pass passed = "AAA" then I have AAA argument1 on my page, but the other if statements get replaced by empty string?
How to avoid that? I.e. how to leave other statements intact?
When reading some FreeBSD source code (See: radix.h lines 158-173), I found variable declarations that followed the "function heading" in the definition.
Is this valid in ISO C (C99)? when should this be done in production code instead of just declaring the variables within the "function heading?" Why is it being done here?
I refer to the function heading the string that looks like this: int someFunction(int i, int b) {