I've noticed in git and various scripts, there is a default user email address. This seems to default to user [email protected]. Is there a way for me to set this to my ral email address?
I have been recently experimenting with Chef. I thought I would attempt to rebuild my personal web server using chef-solo. It's an AWS instance running the Amazon 64bit Linux AMI.
My first objective is to install nginx. I have cloned the Opscode cookbook repository, and am using their nginx cookbook.
My problem appears to be that chef-solo cannot find a template after it has started the process.
The command I'm using is
chef-solo -j /etc/chef/dna.json
dna.json
{
"nginx": {
"user": "ec2-user"
},
"recipes": [ "nginx" ]
}
solo.rb
file_cache_path "/var/chef-solo"
cookbook_path "/var/chef-solo/cookbooks"
...the output
[root@ip-10-202-221-135 chef-solo]# chef-solo -j /etc/chef/dna.json
/usr/lib64/ruby/gems/1.9.1/gems/systemu-2.2.0/lib/systemu.rb:29: Use RbConfig instead of obsolete and deprecated Config.
[Fri, 27 Jan 2012 19:41:36 +0000] INFO: *** Chef 0.10.8 ***
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Setting the run_list to ["nginx"] from JSON
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Run List is [recipe[nginx]]
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Run List expands to [nginx]
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Starting Chef Run for ip-10-202-221-135.ec2.internal
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Running start handlers
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Start handlers complete.
[Fri, 27 Jan 2012 19:41:37 +0000] INFO: Missing gem 'mysql'
[Fri, 27 Jan 2012 19:41:38 +0000] INFO: Processing package[nginx] action install (nginx::default line 21)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: Processing directory[/var/log/nginx] action create (nginx::default line 23)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: Processing template[/usr/sbin/nxensite] action create (nginx::default line 30)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: Processing template[/usr/sbin/nxdissite] action create (nginx::default line 30)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: Processing template[nginx.conf] action create (nginx::default line 38)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: Processing template[/etc/nginx/sites-available/default] action create (nginx::default line 46)
[Fri, 27 Jan 2012 19:41:39 +0000] INFO: template[/etc/nginx/sites-available/default] mode changed to 644
[Fri, 27 Jan 2012 19:41:39 +0000] ERROR: template[/etc/nginx/sites-available/default] (nginx::default line 46) has had an error
[Fri, 27 Jan 2012 19:41:39 +0000] ERROR: template[/etc/nginx/sites-available/default] (/var/chef-solo/cookbooks/nginx/recipes/default.rb:46:in `from_file') had an error:
template[/etc/nginx/sites-available/default] (nginx::default line 46) had an error: Errno::ENOENT: No such file or directory - (/tmp/chef-rendered-template20120127-29441-1yp55vz, /etc/nginx/sites-available/default)
/usr/lib64/ruby/1.9.1/fileutils.rb:519:in `rename'
/usr/lib64/ruby/1.9.1/fileutils.rb:519:in `block in mv'
/usr/lib64/ruby/1.9.1/fileutils.rb:1515:in `block in fu_each_src_dest'
/usr/lib64/ruby/1.9.1/fileutils.rb:1531:in `fu_each_src_dest0'
/usr/lib64/ruby/1.9.1/fileutils.rb:1513:in `fu_each_src_dest'
/usr/lib64/ruby/1.9.1/fileutils.rb:508:in `mv'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/provider/template.rb:47:in `block in action_create'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/template.rb:48:in `block in render_template'
/usr/lib64/ruby/1.9.1/tempfile.rb:316:in `open'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/mixin/template.rb:45:in `render_template'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/provider/template.rb:99:in `render_with_context'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/provider/template.rb:39:in `action_create'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource.rb:440:in `run_action'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:45:in `run_action'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `each'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:81:in `block in converge'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/resource_collection.rb:92:in `execute_each_resource'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/runner.rb:76:in `converge'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:312:in `converge'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/client.rb:160:in `run'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:192:in `block in run_application'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `loop'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application/solo.rb:183:in `run_application'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/lib/chef/application.rb:67:in `run'
/usr/lib64/ruby/gems/1.9.1/gems/chef-0.10.8/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:19:in `load'
/usr/bin/chef-solo:19:in `<main>'
[Fri, 27 Jan 2012 19:41:39 +0000] ERROR: Running exception handlers
[Fri, 27 Jan 2012 19:41:39 +0000] ERROR: Exception handlers complete
[Fri, 27 Jan 2012 19:41:39 +0000] FATAL: Stacktrace dumped to /var/chef-solo/chef-stacktrace.out
[Fri, 27 Jan 2012 19:41:39 +0000] FATAL: Errno::ENOENT: template[/etc/nginx/sites-available/default] (nginx::default line 46) had an error: Errno::ENOENT: No such file or directory - (/tmp/chef-rendered-template20120127-29441-1yp55vz, /etc/nginx/sites-available/default)
What am I doing incorrectly?
Yesterday I tried to deploy a Business Data Connectivity Model project created in Visual Studio 2010 to my SharePoint 2010 test server (all RTM versions), but during the deployment of the solution, SharePoint threw my following error:
Add Solution: Adding solution 'BCSDemo2.wsp'... Deploying solution 'BCSDemo2.wsp'...Error occurred in deployment step 'Add Solution': The default web application could not be determined. Set the SiteUrl property in feature BCSDemo2_Feature1 to the URL of the desired site and retry activation.Parameter name: properties
A little bit of searching on the internet taught me that I was not the only one having this issue, actually Paul Andrew describes how to solve it in this post. Although Paul describes what to do, his explanation is not, let’s say, very elaborate. :-) So let’s describe the steps a little bit more in detail:
Create a new Business Data Connectivity Model project in Visual Studio 2010 and (optionally) implement all your code, change the model etc. When you try to deploy you get the error mentioned above.
To fix it, in the Solution Explorer, navigate to and open the Feature1.Template.xml file (the name could be different if you decided to give your feature a different name of course).
Add the following XML in the Feature element that’s already there (replace the Value with the URL of your site of course): <Properties> <Property Key='SiteUrl' Value='http://spf.u2ucourse.com'/> </Properties>The resulting XML should look like:<?xml version="1.0" encoding="utf-8" ?><Feature xmlns="http://schemas.microsoft.com/sharepoint/"> <Properties> <Property Key='SiteUrl' Value='http://spf.u2ucourse.com'/> </Properties></Feature>
Deploy the solution, now without any issues. :-)
What happens now, is that when Visual Studio creates the SharePoint Solution (the WSP file), it will use the Feature template XML to generate the Feature manifest, which will now include the missing property.
On my Ubuntu 9.04 ("Karmic") laptop I suspect grub does not use the /boot/grub/menu.lst file.
What happens on boot is that I see a blank screen and nothing happens. When I press ESC I see a boot list which is different from what I would expect from the menu.lst file. The menu lines are different and when I choose the first entry it does not use the kernel options that are in the first entry in menu.lst.
Where do the entries that grub uses come from? How can I find out what happens, is there a log? I could not find anything in /var/log/syslog or /var/log/dmesg about grub using a menu.lst.
How can I set it to work like expected? Some Files:
$ sudo ls -la /boot/grub/*lst
-rw-r--r-- 1 root root 1558 2009-12-12 15:25 /boot/grub/command.lst
-rw-r--r-- 1 root root 121 2009-12-12 15:25 /boot/grub/fs.lst
-rw-r--r-- 1 root root 272 2009-12-12 15:25 /boot/grub/handler.lst
-rw-r--r-- 1 root root 4576 2010-03-19 11:26 /boot/grub/menu.lst
-rw-r--r-- 1 root root 1657 2009-12-12 15:25 /boot/grub/moddep.lst
-rw-r--r-- 1 root root 62 2009-12-12 15:25 /boot/grub/partmap.lst
-rw-r--r-- 1 root root 22 2009-12-12 15:25 /boot/grub/parttool.lst
$ sudo ls -la /vm*
lrwxrwxrwx 1 root root 30 2009-12-12 16:15 /vmlinuz -> boot/vmlinuz-2.6.31-16-generic
lrwxrwxrwx 1 root root 30 2009-12-12 14:07 /vmlinuz.old -> boot/vmlinuz-2.6.31-14-generic
$ sudo ls -la /init*
lrwxrwxrwx 1 root root 33 2009-12-12 16:15 /initrd.img -> boot/initrd.img-2.6.31-16-generic
lrwxrwxrwx 1 root root 33 2009-12-12 14:07 /initrd.img.old -> boot/initrd.img-2.6.31-14-generic
The only menu.lst that I found:
$ sudo find / -name "menu.lst"
/boot/grub/menu.lst
$ sudo cat /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.
## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0
## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3
## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu
# Pretty colours
color cyan/blue white/blue
## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below
## DO NOT UNCOMMENT THEM, Just edit them to your needs
## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=9b454298-18e1-43f7-a5bc-f56e7ed5f9c6 ro noresume
## default grub root device
## e.g. groot=(hd0,0)
# groot=70fcd2b0-0ee0-4fe6-9acb-322ef74c1cdf
## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true
## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
## defoptions=quiet splash
# defoptions=apm=on acpi=off
## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false
## Xen hypervisor options to use with the default Xen boot option
# xenhopt=
## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single
## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all
## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect
## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true
## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options ##
title Ubuntu 9.10, kernel 2.6.31-14-generic noresume
uuid 70fcd2b0-0ee0-4fe6-9acb-322ef74c1cdf
kernel /vmlinuz-2.6.31-14-generic root=UUID=9b454298-18e1-43f7-a5bc-f56e7ed5f9c6 ro quiet
splash apm=on acpi=off noresume
initrd /initrd.img-2.6.31-14-generic
title Ubuntu 9.10, kernel 2.6.31-14-generic (recovery mode)
uuid 70fcd2b0-0ee0-4fe6-9acb-322ef74c1cdf
kernel /vmlinuz-2.6.31-14-generic root=UUID=9b454298-18e1-43f7-a5bc-f56e7ed5f9c6 ro sing
le
initrd /initrd.img-2.6.31-14-generic
title Ubuntu 9.10, memtest86+
uuid 70fcd2b0-0ee0-4fe6-9acb-322ef74c1cdf
kernel /memtest86+.bin
### END DEBIAN AUTOMAGIC KERNELS LIST
These are the choices that grub displays after i press ESC:
Ubuntu, Linux 2-6-31-16-generic
Ubuntu, Linux 2-6-31-16-generic (recovery mode)
Ubuntu, Linux 2-6-31-14-generic
Ubuntu, Linux 2-6-31-14-generic (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)
I have installed puppet 3.3.1 on a debian 7 machine (test-puppet-master) and the puppet agent on another debian 7 machine (test-puppet-agent/192.11.80.246) acting as a client. I start the master with:
puppet master --verbose --no-daemonize
And I start the agent with:
puppet agent --server=test-puppet-master --no-daemonize --verbose
Notice: Did not receive certificate
which gives the following output on the master:
Notice: Starting Puppet master version 3.3.1
Error: Could not resolve 192.11.80.246: no name for 192.11.80.246
Info: Inserting default '~ ^/catalog/([^/]+)$' (auth true) ACL
Info: Inserting default '~ ^/node/([^/]+)$' (auth true) ACL
Info: Inserting default '/file' (auth ) ACL
Info: Inserting default '/certificate_revocation_list/ca' (auth true) ACL
Info: Inserting default '~ ^/report/([^/]+)$' (auth true) ACL
Info: Inserting default '/certificate/ca' (auth any) ACL
Info: Inserting default '/certificate/' (auth any) ACL
Info: Inserting default '/certificate_request' (auth any) ACL
Info: Inserting default '/status' (auth true) ACL
Info: Not Found: Could not find certificate test-puppet-agent
Error: Could not resolve 192.11.80.246: no name for 192.11.80.246
Info: Not Found: Could not find certificate test-puppet-agent
Error: Could not resolve 192.11.80.246: no name for 192.11.80.246
Info: Not Found: Could not find certificate test-puppet-agent
Any ideas why the agent cannot connect?
I have a custom made Framework (written in PHP). It all works very good, but i have some doubts about a certain thing.
Right now when a user call this url for example:
http://host.com/user/edit/12
Which would resolve to:
user = userController
edit = editAction() in userController
12 = treated as a param
But suppose the controller 'userController' doesn't exist. Then i could throw a 404. But on the other hand, the url could also be used as params for the indexController (which is the default controller). So in that case:
controller = indexController
user = could be an action in indexController, otherwise treated as a param
edit = treated as a param
12 = treated as a param
That is actually how it works right now in my framework. So basically, i never throw a 404.
I could ofcourse say that only params can be given if the controller name is explicitly named in the URL. So if i want the above url:
http://host.com/user/edit/12
To be invoked by the indexController, in the indexAction. Then i specifically have to tell what controller and action it uses in the URL.
So the URL should become:
http://host.com/index/index/user/edit/12
index = indexController
index (2nd one) = the action method
user = treated as a param
edit = treated as a param
12 = treated as a param
That way, when a controller doesn't exist, i don't reroute everything as a param to the index controller and simply throw a 404 error.
Now my question is, which one is more preffered? Should i allow both options to be configurable in a config file? Or should i always use one of them. Simply because that's the only and best way to do it?
I am new to Lubuntu and I have been giving it a good try but confess I am now tempted to go back to Windows. However, I am open to persuasion if I can get a simple answer to two questions.
The first is a hardware question issue. It seems from the forum that many users like me cannot use plug and play hardware such as scanners. Are we doing anything wrong or does Lubuntu (mine is 13.04) not support plug and play or scanners?
I have read lots of previous answers about scanners but they all seem to involve re-writing lines of instructions to various areas of the system - not something an amateur like me can do with ease. Mine is a Packard Belle Diamond 1200 plus and apparently it should work fine on Lubuntu - but can I even get it recognised, let alone working - No?
Secondly is there an easy way in Gnumeric to set the default file location so that I don't have to trawl through my whole tree to locate a file I want to open?
Thanks to anybody who can get me stay with Lubuntu with their wisdom.
Consider the following:
class DirectoryIterator;
namespace detail {
class FileDataProxy;
class DirectoryIteratorImpl
{
friend class DirectoryIterator;
friend class FileDataProxy;
WIN32_FIND_DATAW currentData;
HANDLE hFind;
std::wstring root;
DirectoryIteratorImpl();
explicit DirectoryIteratorImpl(const std::wstring& pathSpec);
void increment();
public:
~DirectoryIteratorImpl() {};
};
class FileDataProxy //Serves as a proxy to the WIN32_FIND_DATA struture inside the iterator.
{
friend class DirectoryIterator;
boost::shared_ptr<DirectoryIteratorImpl> iteratorSource;
FileDataProxy(boost::shared_ptr<DirectoryIteratorImpl> parent) : iteratorSource(parent) {};
public:
std::wstring GetFolderPath() const {
return iteratorSource->root;
}
};
}
class DirectoryIterator : public boost::iterator_facade<DirectoryIterator, detail::FileDataProxy, std::input_iterator_tag>
{
friend class boost::iterator_core_access;
boost::shared_ptr<detail::DirectoryIteratorImpl> impl;
void increment() {
impl->increment();
};
detail::FileDataProxy dereference() const {
return detail::FileDataProxy(impl);
};
public:
DirectoryIterator() {
impl = boost::make_shared<detail::DirectoryIteratorImpl>();
};
};
It seems like DirectoryIterator should be able to call boost::make_shared<DirectoryIteratorImpl>, because it is a friend of DirectoryIteratorImpl. However, this code fails to compile because the constructor for DirectoryIteratorImpl is private.
Since this class is an internal implementation detail that clients of DirectoryIterator should never touch, it would be nice if I could keep the constructor private.
Is this my fundamental misunderstanding around make_shared or do I need to mark some sort of boost piece as friend in order for the call to compile?
This is pretty closely related to another SO question.
Using the example below, could someone explain to me why adding a new List<Foo> where each of Foo's properties are explicitly set causes the ApplicationSettingsBase.Save() method to correctly store the data, whereas adding a new Foo to the list via a constructor (where the constructor sets the property values) does not work? Thanks!
public class Foo
{
public Foo(string blah, string doh)
{
this.Blah = blah;
this.Doh = doh;
}
public Foo() { }
public string Blah { get; set; }
public string Doh { get; set; }
}
public sealed class MySettings : ApplicationSettingsBase
{
[UserScopedSetting]
public List<Foo> MyFoos
{
get { return (List<Foo>)this["MyFoos"]; }
set { this["MyFoos"] = value; }
}
}
// Here's the question...
private void button1_Click(object sender, EventArgs e)
{
MySettings mySettings = new MySettings();
// Adding new Foo's to the list like this doesn't work.
List<Foo> theList = new List<Foo>()
{
new Foo("doesn't","work")
};
// But doing it like this DOES work.
List<Foo> theList = new List<Foo>()
{
new Foo() {Blah = "DOES", Doh = "work"}
};
mySettings.MyFoos = theList;
mySettings.Save();
}
In my design I am using objects that evaluate a data record. The constructor is called with the data record and type of evaluation as parameters and then the constructor calls all of the object's code necessary to evaluate the record. This includes using the type of evaluation to find additional parameter-like data in a text file.
There are in the neighborhood of 250 unique evaluation types that use the same or similar code and unique parameters coming from the text file.
Some of these evaluations use different code so I benefit a lot from this model because I can use inheritance and polymorphism.
Once the object is created there isn't any need to execute additional code on the object (at least for now) and it is used more like a struct; its kept on a list and 3 properties are used later.
I think this design is the easiest to understand, code, and read.
A logical alternative I guess would be using functions that return score structs, but you can't inherit from methods so it would make it kind of sloppy imo.
I am using vb.net and these classes will be used in an asp.net web app as well as in a distributed app.
thanks for your input
Hi folks,
quite recently I read about javascript call usage in MDC
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call
one linke of the example shown below, I still don't understand.
Why are they using inheritance here like this
Prod_dept.prototype = new Product();
is this necessary? Because there is a call to the super-constructor in
Prod_dept()
anyway, like this
Product.call
is this just out of common behaviour? When is it better to use call for the super-constructor or use the prototype chain?
function Product(name, value){
this.name = name;
if(value >= 1000)
this.value = 999;
else
this.value = value;
}
function Prod_dept(name, value, dept){
this.dept = dept;
Product.call(this, name, value);
}
Prod_dept.prototype = new Product();
// since 5 is less than 1000, value is set
cheese = new Prod_dept("feta", 5, "food");
// since 5000 is above 1000, value will be 999
car = new Prod_dept("honda", 5000, "auto");
Thanks for making things clearer
I am migrating a Java RMI application to Java Web Service (school assignment) and I've encountered an issue...
Currently my Java Server creates an instance of the Remote Object, this object has a constructor and takes a parameter (int ID) which tells it which database to load in memory - works like a charm ...
Now, migrating this to Web Services is causing my a problem - first I needed to add a defaultconstructor because it wouldn't deploy without it, and then while doing some reading all these discussions about "stateless web services" kept coming up ...
For example, if I "start" my webservice with parameter(0) it would load from Databse 0 and all requests from Clients would be done using that data... I want this to only happen when I start the WebService and NOT everytime the client connects... Loading from the DB is expensive and takes time, so I want to do it once so that clients when they connect just deal with the data in memory ...
This is how it works with my Java RMI .... but can this also work with Web Services?
Any advice would be much appreciated.
Thanks,
I'm a Wicket newb. This may just be my ignorance of the Wicket lifecycle so please enlighten me! My understanding is that Wicket WebPage objects are instantiated once and then serialized. This has led to a point of confusion for me, see below.
Currently I have a template class which I intend to subclass. I followed the example in the Wicket docs demonstrating how to override the template's behavior in the subclass:
protected void onBeforeRender() {
add(new Label("title", getTitle()));
super.onBeforeRender();
}
protected String getTitle() {
return "template";
}
Subclass:
protected String getTitle() {
return "Home";
}
This works very well. What's not clear to me are the "best practices" for this. It seems like onBeforeRender() is called on every request for the page, no? This seems like there would be substantially more processing done on a page if everything is in onBeforeRender(). I could easily follow the example of the other Wicket examples and add some components in the constructor that I do not want to override, but then I've divided by component logic into two places, something I'm hesitant to do.
If I add a component that I intend to be in all subclasses, should I add it to the constructor or onBeforeRender()?
I am using spring 3.0.1 + spring-security 3.0.2 and I am trying to use features like @PreAuthorize and @PostFilter annotations.
When running in units tests using @RunWith(SpringJUnit4ClassRunner.class) or in a main(String[] args) method my application context fails to start if enable pre-post-annotations and use org.springframework.security.acls.AclPermissionEvaluator :
<!-- Enable method level security-->
<security:global-method-security pre-post-annotations="enabled">
<security:expression-handler ref="expressionHandler"/>
</security:global-method-security>
<bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
<property name="permissionEvaluator" ref="aclPermissionEvaluator"/>
</bean>
<bean id="aclPermissionEvaluator" class="org.springframework.security.acls.AclPermissionEvaluator">
<constructor-arg ref="aclService"/>
</bean>
<!-- Enable stereotype support -->
<context:annotation-config />
<context:component-scan base-package="com.rreps.core" />
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:applicationContext.properties</value>
</list>
</property>
</bean>
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.driver}" />
<property name="jdbcUrl" value="${jdbc.url}" />
<property name="user" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="initialPoolSize" value="10" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="25" />
<property name="acquireRetryAttempts" value="10" />
<property name="acquireIncrement" value="5" />
<property name="idleConnectionTestPeriod" value="3600" />
<property name="maxIdleTime" value="10800" />
<property name="maxConnectionAge" value="14400" />
<property name="preferredTestQuery" value="SELECT 1;" />
<property name="testConnectionOnCheckin" value="false" />
</bean>
<bean id="auditedSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
<property name="hibernateProperties">
<value>
hibernate.dialect=${hibernate.dialect}
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
hibernate.hbm2ddl.auto=update
hibernate.c3p0.acquire_increment=5
hibernate.c3p0.idle_test_period=3600
hibernate.c3p0.timeout=10800
hibernate.c3p0.max_size=25
hibernate.c3p0.min_size=1
hibernate.show_sql=false
hibernate.validator.autoregister_listeners=false
</value>
</property>
<!-- validation is performed by "hand" (see http://opensource.atlassian.com/projects/hibernate/browse/HV-281)
<property name="eventListeners">
<map>
<entry key="pre-insert" value-ref="beanValidationEventListener" />
<entry key="pre-update" value-ref="beanValidationEventListener" />
</map>
</property>
-->
<property name="entityInterceptor">
<bean class="com.rreps.core.dao.hibernate.interceptor.TrackingInterceptor" />
</property>
</bean>
<bean id="simpleSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
<property name="hibernateProperties">
<value>
hibernate.dialect=${hibernate.dialect}
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
hibernate.hbm2ddl.auto=update
hibernate.c3p0.acquire_increment=5
hibernate.c3p0.idle_test_period=3600
hibernate.c3p0.timeout=10800
hibernate.c3p0.max_size=25
hibernate.c3p0.min_size=1
hibernate.show_sql=false
hibernate.validator.autoregister_listeners=false
</value>
</property>
<!-- property name="eventListeners">
<map>
<entry key="pre-insert" value-ref="beanValidationEventListener" />
<entry key="pre-update" value-ref="beanValidationEventListener" />
</map>
</property-->
</bean>
<bean id="sequenceSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:hibernate.cfg.xml" />
<property name="hibernateProperties">
<value>
hibernate.dialect=${hibernate.dialect}
hibernate.query.substitutions=true 'Y', false 'N'
hibernate.cache.use_second_level_cache=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.SingletonEhCacheProvider
hibernate.hbm2ddl.auto=update
hibernate.c3p0.acquire_increment=5
hibernate.c3p0.idle_test_period=3600
hibernate.c3p0.timeout=10800
hibernate.c3p0.max_size=25
hibernate.c3p0.min_size=1
hibernate.show_sql=false
hibernate.validator.autoregister_listeners=false
</value>
</property>
</bean>
<bean id="validationFactory" class="javax.validation.Validation" factory-method="buildDefaultValidatorFactory" />
<!-- bean id="beanValidationEventListener" class="org.hibernate.cfg.beanvalidation.BeanValidationEventListener">
<constructor-arg index="0" ref="validationFactory" />
<constructor-arg index="1">
<props/>
</constructor-arg>
</bean-->
<!-- Enable @Transactional support -->
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="auditedSessionFactory" />
</bean>
<security:authentication-manager alias="authenticationManager">
<security:authentication-provider user-service-ref="userDetailsService" />
</security:authentication-manager>
<bean id="userDetailsService" class="com.rreps.core.service.impl.UserDetailsServiceImpl" />
<!-- ACL stuff -->
<bean id="aclCache" class="org.springframework.security.acls.domain.EhCacheBasedAclCache">
<constructor-arg>
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">
<property name="cacheManager">
<bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
</property>
<property name="cacheName" value="aclCache"/>
</bean>
</constructor-arg>
</bean>
<bean id="lookupStrategy" class="org.springframework.security.acls.jdbc.BasicLookupStrategy">
<constructor-arg ref="dataSource"/>
<constructor-arg ref="aclCache"/>
<constructor-arg>
<bean class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
<constructor-arg>
<list>
<bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
<constructor-arg value="ROLE_ADMINISTRATEUR"/>
</bean>
<bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
<constructor-arg value="ROLE_ADMINISTRATEUR"/>
</bean>
<bean class="org.springframework.security.core.authority.GrantedAuthorityImpl">
<constructor-arg value="ROLE_ADMINISTRATEUR"/>
</bean>
</list>
</constructor-arg>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.springframework.security.acls.domain.ConsoleAuditLogger"/>
</constructor-arg>
</bean>
<bean id="aclService" class="com.rreps.core.service.impl.MysqlJdbcMutableAclService">
<constructor-arg ref="dataSource"/>
<constructor-arg ref="lookupStrategy"/>
<constructor-arg ref="aclCache"/>
</bean>
The strange thing is that the context starts normally when deployed in a webapp and @PreAuthorize and @PostFilter annotations are working fine as well...
Any idea what is wrong?
Here is the end of the stacktrace :
... 55 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [applicationContext-core.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 67 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1308)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:86)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:100)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:86)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:404)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
... 73 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 91 more
Caused by: java.lang.NullPointerException
at org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource.getAttributes(DelegatingMethodSecurityMetadataSource.java:52)
at org.springframework.security.access.intercept.aopalliance.MethodSecurityMetadataSourceAdvisor$MethodSecurityMetadataSourcePointcut.matches(MethodSecurityMetadataSourceAdvisor.java:129)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:215)
at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:252)
at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:284)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:404)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
... 97 more
I have some html files that I'd like to retab that look like this:
<header>
<div class="wrapper">
<img src="images/logo.png">
<div class="userbox">
<div class="welcome">Welcome Andy!</div>
<div class="blackbox">
<ul>
<li><a href="#">Invite Friends</a></li>
<li><a href="#">My Account</a></li>
<li><a href="#">Cart</a></li>
<li><a href="#">Sign Out</a></li>
</ul>
</div>
</div>
</div>
</header>
And I want them to look something like this:
<header>
<div class="wrapper">
<img src="images/logo.png">
<div class="userbox">
<div class="welcome">Welcome Andy!</div>
<div class="blackbox">
<ul>
<li><a href="#">Invite Friends</a></li>
<li><a href="#">My Account</a></li>
<li><a href="#">Cart</a></li>
<li><a href="#">Sign Out</a></li>
</ul>
</div>
</div>
</div>
</header>
Or some sane default. What's the easiest way to go about doing this from the terminal in ubuntu for all of the html files in the current directory?
We are trying to put together a box with dual LAN cards (let's say Outer and Inner), where the Inner LAN card is supposed to act as a default gateway on the network it is connected to.
This box is running Ubuntu. The basic purpose for this box is to take messages generated on the inner network, do some work with them and forward them out the Outer LAN card to a server. The inner network is completely isolated with simply a regular switch connecting the Inner LAN Card with two other boxes.
These other boxes either throw out multi-cast messages (which the Inner LAN Card is listening to), or send out unicast messages meant for the server which is not on this inner network. So, we need the Inner LAN Card to act as a default gateway, where these unicast messages will then be sent, and the code on the dual-LAN Card box can then intercept and forward these messages to the server.
Question:
1. How do we setup the LAN Card to be default gateway (does it need some configuration on Ubuntu)?
2. Once we have this setup, is it a simple matter of listening to the interface to intercept the incoming messages?
Any help (pointers in the right direction) is appreciated.
Thanks.
My laptop has been having some random problems with hibernating properly. That is a whole another topic that I still haven't resolved, but this is a different issue. The issues are connected, I guess, because one time after my computer experienced a failed hibernate, my login screen changed: since then my login screen always appears as the standard one with a prompt to type in a password. I can still use the finger scanner by clicking "other credentials" button. But that's annoying having to do that every time; previously the prompt to use finger scanner was the default one, whereas the typing password access was the alternate. How do I bring this arrangement back? In other words, how to switch the default from the type password prompt to the finger scan prompt?
From online searches, I have only found discussions of turning the biometric access on or off... but clearly it is turned on and working, since I can use it. It's just not the default for some reason...
I've been investigating an issue with a production Classic ASP website running on IIS6 which seems indicative of memory fragmentation.
One of the suggestions of how to ameliorate this came from Stackoverflow: How can I find why some classic asp pages randomly take a real long time to execute?. It suggested flipping a setting in the site's global.asa file to 'turn on' Low Fragmentation Heap (LFH).
The following code (with a registered version of the accompanying DLL) did the trick.
Set LFHObj=CreateObject("TURNONLFH.ObjTurnOnLFH")
LFHObj.TurnOnLFH()
application("TurnOnLFHResult")=CStr(LFHObj.TurnOnLFHResult)
(Really the code isn't that important to the question).
An author of a linked post reported a seemingly magic resolution to this issue, and, reading around a little more, I discovered that this setting is enabled by default on Windows Server 2008.
So, naturally, this left me a little concerned:
Why is this setting not enabled by default on 2003, or
If it works in 2008 why have Microsoft not issued a patch to enable it by default on 2003?
I suspect the answer to the above is the same for both (if there is one).
Obviously, we're testing it in a non-production environment, and doing an array of metrics and comparisons to deem if it does help us. But aside from this I'm really just trying to understand if there's any technical reason why we should do this, or if there are any gotchas that we need to be aware of.
I am on the latest version of Firefox (not beta or anything like that) and currently my keyword.url is stuck on search.google.com (which I don't remember setting even though the about:config says it's a user setting. Can someone tell me how to set it back to default and keep it at default when I reset my browser? I do not want to delete prefs.js as I do not want to go thru setting up all the extension settings I have just to have my location bar search google (if this is the only way then I'll stick with searching from the search bar instead).
I've checked all my extensions that may effect the location bar but could not find anything that says it would change the default search engine for this. I've also tried to open the prefs.js in wordpad or notepad but it just ends up freezing when trying to edit it at all (yes the browser is closed at the time). I also deleted the prefs-1.js (along with 2 others) that were older (after trying to rename those to prefs.js and see if this corrects it. It might have but had such old extension settings I went back to my latest prefs.js with this one issue instead of the issue of setting back up a ton of extensions.
I can give any other info if needed, someone please help me fix this issue if possible.
I have asked this on askubuntu but didn't get a single response in days, so I will try it here.
I have directory structure like this:
/path/dir1 - all users in group1 must have rwx permissions, including subdirs and newly created dirs
/path/dir1/dir2 - also users in group2 must have rwx permissions
So what I tried is that I used ACL.
getfacl /path/dir1
# file: /path/dir1
# owner: root
# group: nogroup
user::rwx
group::---
group:group1:rwx
mask::rwx
other::---
default:user::rwx
default:group::---
default:group:group1:rwx
default:mask::rwx
default:other::---
getfacl /path/dir1/dir2
# file: /path/dir1/dir2
# owner: root
# group: nogroup
user::rwx
group::---
group:group1:rwx
group:group2:rwx
mask::rwx
other::---
default:user::rwx
default:group::---
default:group:group1:rwx
default:group:group2:rwx
default:mask::rwx
default:other::---
That shows that I have granted rwx to group1 in /path/dir1 and rwx to group1 and group2 in /path/dir1/dir2.
Now it gets interesting. Let's assume, that user2 is member of group2.
If I issue commands as user2:
cd /path/dir1/dir2
mkdir foo
Then folder is succesfully created.
However, if I do this:
mkdir /path/dir1/dir2/foo
I get permission denied error.
I have tried extensively to resolve the problem. What I have found is that ACL is to blame. If I add permissions to group2 in /path/dir1 it starts to work. Also if I completely remove /path/dir1 ACL it starts to work.
Obviously I am missing something VERY basic. I don't have much experience with linux, but this is a no-brainer on Windows. I have spent way too many hours to resolve this basic requirement.
If you need more information, I will try to update the question, so feel free to ask!
I'm unable to make Thunderbird open the default browser.
In the browser preferences, Chromium is selected as the default browser. It's also selected in "Default Applications" in System Settings.
In Thunderbird, I read "Chrome (Default)" which is wrong on all levels:
Chrome itself complains that it's not the default browser when I click a link inside Thunderbird.
In all other places, that I could find, Chromium is the default
Here is what I tried:
I used update-alternatives --config x-www-browser to select chromium-browser as well (see How do I change the default browser?).
And even when I select a different browser from the list in the Thunderbird preferences, it still opens Chrome.
My current solution is to create a link from /usr/bin/google-chrome to chromium-browser.
How can I force Thunderbird to use the browser I want???
EDIT I also updated gnome-www-browser (update-alternatives --config gnome-www-browser) after feedback from roadmr but that didn't help. At least sensible-browser opens Chromium, now, but Thunderbird is stubborn.
I'd happily Google this but don't know what to call it to Google it.
I have a piece of code here:
class demo
{
private:
unsigned char len, *dat;
public:
demo(unsigned char le = 5, unsigned char default) : len(le)
{
dat = new char[len];
for (int i = 0; i <= le; i++)
dat[i] = default;
}
void ~demo(void)
{
delete [] *dat;
}
};
class newdemo : public demo
{
private:
int *dat1;
public:
newdemo(void) : demo(0, 0)
{
*dat1 = 0;
return 0;
}
};
(It's from a past exam paper and the question is to correct errors in the code so ignore errors!)
My question is, what are the ": len(le) " and " : demo(0, 0)" called? Something to do with inheritance?
I'm trying to test my form. It will be constructing other objects, so I need a way to mock them. I tried passing them into the constructor...
class Form_Event extends Zend_Form
{
public function __construct($options = null, $regionMapper = null)
{
$this->_regionMapper = $regionMapper;
parent::__construct($options);
}
...but I get an exception:
Zend_Form_Exception: Only form elements and groups may be overloaded; variable of type "Mock_Model_RegionMapper_b19e528a" provided
What am I doing wrong?
I am creating some custom exception classes doing the following
class GXException
{
public:
GXException(LPCWSTR pTxt):pReason(pTxt){};
LPCWSTR pReason;
};
class GXVideoException : GXException
{
public:
GXVideoException(LPCWSTR pTxt):pReason(pTxt){};
LPCWSTR pReason;
};
When I created GXVideoException to extend GXException, I get the following error
1>c:\users\numerical25\desktop\intro todirectx\godfiles\gxrendermanager\gxrendermanager\gxrendermanager\gxexceptions.h(14) : error C2512: 'GXException' : no appropriate defaultconstructor available
I have a problem; I'm using an external library where one particular event has its own custom eventargs; with no constructor. If I want to throw my own event using these eventargs, how can I?
I'll give more detail if asked, but I'm not sure what exactly I should be giving. :)