We have some "theme colors" that are reused in our CSS sheet.
Is there a way to set a variable and then reuse it?
E.g.,
.css
OurColor: Blue
{ H1
color:OurColor;
}
I'm typesetting in LaTeX, and I'd like to display a "variable" (in my case, a reference \ref{blah} to an item number in list) in roman rather than the default arabic. Is there an easy way to do this? Thanks for any pointers!
void someFunc()
{
int stackInt = 4;
someOtherFunc(&stackInt);
}
Is it the case that stackInt's address space could be reallocated after someFunc ends, making it unsafe to assume that the value passed to someOtherFunc represents the stackInt variable with value 4 that was passed to it? In other words, should I avoid passing stack variables around by address and expecting them to still be alive after the function they were initialised in has ended?
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, etc. I also wanted to preserve the ability to stack graphs. Thank you so much guys.
Adam
The Compiler claims an error saying: "initializer element is not constant", when I try to initialize a static variable inside a method with a call to a static method (with + in its definition).
Anyway I can tell him that this method always returns the same value. I know this is not the same as static method, but there seems to be no constant methods in Objective-C (other than macros which won't work here because I am calling UI_USER_INTERFACE_IDIOM() from inside the method).
Let's assume I have a class called MyClass with an attribute called MyAttribute and a method called MyMethod(). Inside that method I'd like to have a variable called MyVariable. I'd like to set the value of MyVariable to "MyVariable" and MyAttribute to "MyAttribute" inside the call to MyMethod(). How can I do this in a Collaboration Diagram?
I can't find any info of this kind on the internet and the book I'm studying from (Applying UML and Patterns) is very vague in the details.
Thanks
Hey all,
I'm trying to figure out how to know what has been done to a variable.
Here's an example:
function a($hello) {
$out .= strtoupper(ucwords(strtolower($hello)));
return $out;
}
echo function_trace('$hello') // returns array(strtoupper,ucwords,strtolower)
Thanks!
Matt
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.
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!
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
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
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 localvariable 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?
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
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.
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!