Create human task in WSO2 process server
I need to create human task in my BPEL process. But i couldn't find any
tutorial in WSO2 to create human task. Can anyone suggest me some tutorial
for this.
Thursday, 3 October 2013
Wednesday, 2 October 2013
What is the difference between the following c++ constructors?
What is the difference between the following c++ constructors?
I've seen c++ class constructors initialize members in two different ways,
but with the same effect. Suppose we have a simple class:
class myClass
{
public:
myclass();//default constructor
private:
int a;
int b;
bool c;
};
Case 1:
myClass::myClass()
/* Default constructor */
{
a=5;
b=10;
c=true;
//do more here
}
Case 2:
myClass::myClass()
/* Default constructor */
:a(5),
b(10),
c(true)
{
//do more in here
}
What is the difference between the two after it compiles? Even if there is
no difference, is there a "preferred" way of doing it?
I've seen c++ class constructors initialize members in two different ways,
but with the same effect. Suppose we have a simple class:
class myClass
{
public:
myclass();//default constructor
private:
int a;
int b;
bool c;
};
Case 1:
myClass::myClass()
/* Default constructor */
{
a=5;
b=10;
c=true;
//do more here
}
Case 2:
myClass::myClass()
/* Default constructor */
:a(5),
b(10),
c(true)
{
//do more in here
}
What is the difference between the two after it compiles? Even if there is
no difference, is there a "preferred" way of doing it?
ArrayList to toString()
ArrayList to toString()
Im having trouble printing the ArrayList through to the toString. It says
that I can not convert an ArrayList to an String. Here my code if anyone
can help.
package edu.purse.test;
import java.util.ArrayList;
public class Purse
{
ArrayList<String> coins = new ArrayList<String>();
public Purse()
{
}
public void addCoin(String coinName)
{
coins.add(coinName);
}
public String toString()
{
return coins;
}
}
package edu.purse.test;
public class PurseTester {
public static void main(String[] args) {
Purse p = new Purse();
p.addCoin("Quarter");
p.addCoin("Dime");
System.out.println(p.toString());
}
}
Im having trouble printing the ArrayList through to the toString. It says
that I can not convert an ArrayList to an String. Here my code if anyone
can help.
package edu.purse.test;
import java.util.ArrayList;
public class Purse
{
ArrayList<String> coins = new ArrayList<String>();
public Purse()
{
}
public void addCoin(String coinName)
{
coins.add(coinName);
}
public String toString()
{
return coins;
}
}
package edu.purse.test;
public class PurseTester {
public static void main(String[] args) {
Purse p = new Purse();
p.addCoin("Quarter");
p.addCoin("Dime");
System.out.println(p.toString());
}
}
xcode openURL maps.apple.com current location to destination
xcode openURL maps.apple.com current location to destination
As a newbie im finding it fun learning Xcode. I have created a button that
when pushed opens a url which is actually opening the apple.maps and
plotting a route using this code:
-(IBAction)pushButton{
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[NSURL
URLWithString:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino"]];
}
Im looking for the string to use use the users current location for the
starting point and then a specified address for the destination?
As a newbie im finding it fun learning Xcode. I have created a button that
when pushed opens a url which is actually opening the apple.maps and
plotting a route using this code:
-(IBAction)pushButton{
UIApplication *app = [UIApplication sharedApplication];
[app openURL:[NSURL
URLWithString:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino"]];
}
Im looking for the string to use use the users current location for the
starting point and then a specified address for the destination?
Tuesday, 1 October 2013
I am a beginner python programmer. Assistance needed please
I am a beginner python programmer. Assistance needed please
lightcolor=int(input("Enter
Red,Green,Yellow,White,Purple,Blue,Orange,Brown,or Black->"))
if lightcolor=="Red":
print("Red Light-Please stop!!")
elif lightcolor=="Green":
print("Green Light-Please continue")
elif lightcolor=="Yellow":
print("Yellow Light-speed up")
elif lightcolor=="White":
print("White Light-its too bright")
elif lightcolor=="Purple":
print("Purple Light-pretty")
elif lightcolor=="Blue":
print("Blue Light-thats unusual")
elif lightcolor=="Orange":
print("Orange Light-bright as the sun")
elif lightcolor=="Brown":
print("Brown Light-like dirt")
elif lightcolor=="Black":
print("Black Light-very dark")
else: print("Sorry no such color"),lightcolor
strong text Why do i get a invalid literal for int() with base error every
time i input any color?
lightcolor=int(input("Enter
Red,Green,Yellow,White,Purple,Blue,Orange,Brown,or Black->"))
if lightcolor=="Red":
print("Red Light-Please stop!!")
elif lightcolor=="Green":
print("Green Light-Please continue")
elif lightcolor=="Yellow":
print("Yellow Light-speed up")
elif lightcolor=="White":
print("White Light-its too bright")
elif lightcolor=="Purple":
print("Purple Light-pretty")
elif lightcolor=="Blue":
print("Blue Light-thats unusual")
elif lightcolor=="Orange":
print("Orange Light-bright as the sun")
elif lightcolor=="Brown":
print("Brown Light-like dirt")
elif lightcolor=="Black":
print("Black Light-very dark")
else: print("Sorry no such color"),lightcolor
strong text Why do i get a invalid literal for int() with base error every
time i input any color?
Can I easily override an (STL) iterator's category?
Can I easily override an (STL) iterator's category?
Right now, I have a class that can satisfy an API requirement with a
random-access iterator. However, I can envision a situation where the
implementation will change and only a forward iterator can be provided.
Therefore, I would like to restrict callers from using the random-access
functionality. I know I can write my own implementation (e.g.
restricted_bar_iterator), but was wondering if there is anything simpler
(i.e. requiring less coding).
class BAR { ... };
class FOO {
public:
// Bad...clients may expect 'bar_iterator' to be random access...
typedef std::vector<BAR>::iterator bar_iterator;
bar_iterator begin_bar() const;
bar_iterator end_bar() const;
// Possible solution here!
class restricted_bar_iterator :
public std::iterator< std::forward_iterator_tag, BAR > { ... };
};
void baz()
{
FOO foo;
bar_iterator it = foo.begin_bar() + 5; // want a compile time error here!
}
Right now, I have a class that can satisfy an API requirement with a
random-access iterator. However, I can envision a situation where the
implementation will change and only a forward iterator can be provided.
Therefore, I would like to restrict callers from using the random-access
functionality. I know I can write my own implementation (e.g.
restricted_bar_iterator), but was wondering if there is anything simpler
(i.e. requiring less coding).
class BAR { ... };
class FOO {
public:
// Bad...clients may expect 'bar_iterator' to be random access...
typedef std::vector<BAR>::iterator bar_iterator;
bar_iterator begin_bar() const;
bar_iterator end_bar() const;
// Possible solution here!
class restricted_bar_iterator :
public std::iterator< std::forward_iterator_tag, BAR > { ... };
};
void baz()
{
FOO foo;
bar_iterator it = foo.begin_bar() + 5; // want a compile time error here!
}
Ubuntu 12.04 desktop loads pretty slow after password entry
Ubuntu 12.04 desktop loads pretty slow after password entry
Well, I have an Ubuntu 12.04 running on a Core i7 laptop, with an SSD
disk. The laptop is a dual-boot. I experience a very large delay between
the password entry and the Desktop showing up. In general, the process
looks like this:
Grub loads fast.
I choose Ubuntu from the list.
Password prompt loads fast.
I enter the password for my user. The computer kinda hangs. The Wifi is
flashing, but the hard drive light is not flashing a lot. This takes about
30-40 seconds.
The Desktop loads in a flash
I've experienced this issue in the past, with my standard HDD. Then I
removed UbuntuOne as advised in a thread that I've seen. This seems to
have helped for a while. Then I migrated to the SSD. The computer loaded
pretty fast for a while, then this started happening. I don't think that
it is related to the SSD, though.
I'm adding a link to a bootchart image:
http://i.imgur.com/ew97ZO6.png
Thank you for your time.
Well, I have an Ubuntu 12.04 running on a Core i7 laptop, with an SSD
disk. The laptop is a dual-boot. I experience a very large delay between
the password entry and the Desktop showing up. In general, the process
looks like this:
Grub loads fast.
I choose Ubuntu from the list.
Password prompt loads fast.
I enter the password for my user. The computer kinda hangs. The Wifi is
flashing, but the hard drive light is not flashing a lot. This takes about
30-40 seconds.
The Desktop loads in a flash
I've experienced this issue in the past, with my standard HDD. Then I
removed UbuntuOne as advised in a thread that I've seen. This seems to
have helped for a while. Then I migrated to the SSD. The computer loaded
pretty fast for a while, then this started happening. I don't think that
it is related to the SSD, though.
I'm adding a link to a bootchart image:
http://i.imgur.com/ew97ZO6.png
Thank you for your time.
Why does this code not result in a memory leak=?iso-8859-1?Q?=3F_=96_stackoverflow.com?=
Why does this code not result in a memory leak? – stackoverflow.com
I checked the following code in C++ with valgrind with --leak-check=full
and it says no memory leak. Why is that? char *p = new char[256]; delete
p; new[] should be matched by delete[] as far as I …
I checked the following code in C++ with valgrind with --leak-check=full
and it says no memory leak. Why is that? char *p = new char[256]; delete
p; new[] should be matched by delete[] as far as I …
Monday, 30 September 2013
Openvpn, forward packets very slowly
Openvpn, forward packets very slowly
I rebooted my server, and an odd issue just came out. I am running on
ArchLinux, the clients are Ubuntu, Android and Mac.
The problem is that accessing the internet via the clients is slow, about
2ko/s and slowly stop. But downloading something from the server to the
client directly is made at full speed. And, obviously, internet from the
server is at his full speed (40mo/s).
I don't know what happened from the reboot, but this issue is here on all
clients, and is only related to the traffic that openvpn forward to
internet.
EDIT: Tried with tcp, did not solve. EDIT: mtu-test give me 1538, which is
close to the used value by default.
Here are all my confs:
¨q©¤<root@Alduin>-</etc/openvpn>-<1:45:07>-¡ó
¨t©¤➤ cat Alduin.conf ccd/Thunderaan
local 212.83.129.104
port 1194
proto udp
dev tun
;tun-ipv6
;ifconfig-ipv6 2001:bc8:300a:dead::1337:1/64 2001:bc8:300a:dead::1337:0
;ifconfig-ipv6-pool 2001:bc8:300a:dead::1337:42/64
ca keys/ca.crt
cert keys/Alduin.crt
key keys/Alduin.key # This file should be kept secret
dh keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 10.8.0.1"
;push tun-ipv6
client-to-client
keepalive 5 60
ping-timer-rem
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
client-config-dir ccd
topology subnet
ccd from here +++++++++++++++
ifconfig-push 10.8.0.2 255.255.255.0
;ifconfig-ipv6-push 2001:bc8:300a:dead::1337:2/64 2001:bc8:300a:dead::1337:0
push "redirect-gateway def1"
Client conf:
client
dev tun
proto udp
remote 212.83.129.104 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert name.crt
key name.key
ns-cert-type server
comp-lzo
verb 3
and some output that might help you:
¨q©¤<cubox@Alduin>-<~>-<1:49:43>-¡ó
¨t©¤➤ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen
1000
link/ether b8:ac:6f:94:e2:4e brd ff:ff:ff:ff:ff:ff
inet 88.190.15.135/24 scope global eno1
valid_lft forever preferred_lft forever
inet 212.83.129.104/32 scope global eno1
valid_lft forever preferred_lft forever
inet6 2001:bc8:300a:dead::b12d/64 scope global
valid_lft forever preferred_lft forever
inet6 2a01:e0b:1000:15:baac:6fff:fe94:e24e/64 scope global dynamic
valid_lft 2592000sec preferred_lft 604800sec
inet6 fe80::baac:6fff:fe94:e24e/64 scope link
valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether b8:ac:6f:94:e2:4f brd ff:ff:ff:ff:ff:ff
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UNKNOWN qlen 100
link/none
inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
valid_lft forever preferred_lft forever
¨q©¤<cubox@Alduin>-<~>-<1:49:47>-¡ó
¨t©¤➤ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 88-190-15-1.rev 0.0.0.0 UG 0 0 0 eno1
10.8.0.0 * 255.255.255.0 U 0 0 0 tun0
88.190.15.0 * 255.255.255.0 U 0 0 0 eno1
¨q©¤<cubox@Alduin>-<~>-<1:49:51>-¡ó
¨t©¤➤ route -6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
::1/128 :: U 256 0 0 lo
2001:bc8:300a:dead::/64 :: U 256 0 0
eno1
2a01:e0b:1000:15::/64 :: UAe 256 0 0
eno1
fe80::/64 :: U 256 0 0
eno1
::/0 fe80::225:45ff:fef6:947f UGDAe 1024 2
0 eno1
::/0 :: !n -1 1 1891 lo
::1/128 :: Un 0 2 5227 lo
2001:bc8:300a:dead::/128 :: Un 0 1 0 lo
2001:bc8:300a:dead::b12d/128 :: Un 0 1 131 lo
2a01:e0b:1000:15::/128 :: Un 0 1 0 lo
2a01:e0b:1000:15:baac:6fff:fe94:e24e/128 :: Un 0
3 29356 lo
fe80::/128 :: Un 0 1 0 lo
fe80::baac:6fff:fe94:e24e/128 :: Un 0 1 311 lo
ff00::/8 :: U 256 0 0
eno1
::/0 :: !n -1 1 1891 lo
-A POSTROUTING -s 10.8.0.0/24 -o eno1 -j SNAT --to-source 88.190.15.135 #
The iptables rule
The iptables rule here is the only that is active on the server.
¨t©¤➤ tc qd
qdisc mq 0: dev eno1 root
qdisc pfifo_fast 0: dev tun0 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0
0 1 1 1 1 1 1 1 1
EDIT: Here is a tcpdump of the server downloading directly a file:
http://sprunge.us/aaJX Here is the client downloading this ressource:
http://sprunge.us/WUCC and here is a normal client from another openvpn
(working) server: http://www4.slashusr.com/57552.tcpdump
Thanks! A beer for the one who help me to fix this!
I rebooted my server, and an odd issue just came out. I am running on
ArchLinux, the clients are Ubuntu, Android and Mac.
The problem is that accessing the internet via the clients is slow, about
2ko/s and slowly stop. But downloading something from the server to the
client directly is made at full speed. And, obviously, internet from the
server is at his full speed (40mo/s).
I don't know what happened from the reboot, but this issue is here on all
clients, and is only related to the traffic that openvpn forward to
internet.
EDIT: Tried with tcp, did not solve. EDIT: mtu-test give me 1538, which is
close to the used value by default.
Here are all my confs:
¨q©¤<root@Alduin>-</etc/openvpn>-<1:45:07>-¡ó
¨t©¤➤ cat Alduin.conf ccd/Thunderaan
local 212.83.129.104
port 1194
proto udp
dev tun
;tun-ipv6
;ifconfig-ipv6 2001:bc8:300a:dead::1337:1/64 2001:bc8:300a:dead::1337:0
;ifconfig-ipv6-pool 2001:bc8:300a:dead::1337:42/64
ca keys/ca.crt
cert keys/Alduin.crt
key keys/Alduin.key # This file should be kept secret
dh keys/dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 10.8.0.1"
;push tun-ipv6
client-to-client
keepalive 5 60
ping-timer-rem
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
client-config-dir ccd
topology subnet
ccd from here +++++++++++++++
ifconfig-push 10.8.0.2 255.255.255.0
;ifconfig-ipv6-push 2001:bc8:300a:dead::1337:2/64 2001:bc8:300a:dead::1337:0
push "redirect-gateway def1"
Client conf:
client
dev tun
proto udp
remote 212.83.129.104 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert name.crt
key name.key
ns-cert-type server
comp-lzo
verb 3
and some output that might help you:
¨q©¤<cubox@Alduin>-<~>-<1:49:43>-¡ó
¨t©¤➤ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen
1000
link/ether b8:ac:6f:94:e2:4e brd ff:ff:ff:ff:ff:ff
inet 88.190.15.135/24 scope global eno1
valid_lft forever preferred_lft forever
inet 212.83.129.104/32 scope global eno1
valid_lft forever preferred_lft forever
inet6 2001:bc8:300a:dead::b12d/64 scope global
valid_lft forever preferred_lft forever
inet6 2a01:e0b:1000:15:baac:6fff:fe94:e24e/64 scope global dynamic
valid_lft 2592000sec preferred_lft 604800sec
inet6 fe80::baac:6fff:fe94:e24e/64 scope link
valid_lft forever preferred_lft forever
3: eno2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether b8:ac:6f:94:e2:4f brd ff:ff:ff:ff:ff:ff
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc
pfifo_fast state UNKNOWN qlen 100
link/none
inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0
valid_lft forever preferred_lft forever
¨q©¤<cubox@Alduin>-<~>-<1:49:47>-¡ó
¨t©¤➤ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 88-190-15-1.rev 0.0.0.0 UG 0 0 0 eno1
10.8.0.0 * 255.255.255.0 U 0 0 0 tun0
88.190.15.0 * 255.255.255.0 U 0 0 0 eno1
¨q©¤<cubox@Alduin>-<~>-<1:49:51>-¡ó
¨t©¤➤ route -6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
::1/128 :: U 256 0 0 lo
2001:bc8:300a:dead::/64 :: U 256 0 0
eno1
2a01:e0b:1000:15::/64 :: UAe 256 0 0
eno1
fe80::/64 :: U 256 0 0
eno1
::/0 fe80::225:45ff:fef6:947f UGDAe 1024 2
0 eno1
::/0 :: !n -1 1 1891 lo
::1/128 :: Un 0 2 5227 lo
2001:bc8:300a:dead::/128 :: Un 0 1 0 lo
2001:bc8:300a:dead::b12d/128 :: Un 0 1 131 lo
2a01:e0b:1000:15::/128 :: Un 0 1 0 lo
2a01:e0b:1000:15:baac:6fff:fe94:e24e/128 :: Un 0
3 29356 lo
fe80::/128 :: Un 0 1 0 lo
fe80::baac:6fff:fe94:e24e/128 :: Un 0 1 311 lo
ff00::/8 :: U 256 0 0
eno1
::/0 :: !n -1 1 1891 lo
-A POSTROUTING -s 10.8.0.0/24 -o eno1 -j SNAT --to-source 88.190.15.135 #
The iptables rule
The iptables rule here is the only that is active on the server.
¨t©¤➤ tc qd
qdisc mq 0: dev eno1 root
qdisc pfifo_fast 0: dev tun0 root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0
0 1 1 1 1 1 1 1 1
EDIT: Here is a tcpdump of the server downloading directly a file:
http://sprunge.us/aaJX Here is the client downloading this ressource:
http://sprunge.us/WUCC and here is a normal client from another openvpn
(working) server: http://www4.slashusr.com/57552.tcpdump
Thanks! A beer for the one who help me to fix this!
How can I test TSO/LRO functionality ? What are the test cases for this?
How can I test TSO/LRO functionality ? What are the test cases for this?
I want to test tcp offload functionality (segmentation/large receive
offload) on my network.
What are the possible test cases for this? What kind of tools are
available. Are there already any test cases available, and can someone
please provide any reference of that?
Thanks in advance
I want to test tcp offload functionality (segmentation/large receive
offload) on my network.
What are the possible test cases for this? What kind of tools are
available. Are there already any test cases available, and can someone
please provide any reference of that?
Thanks in advance
Given URL is not allowed by the Application configuration Facebook application error
Given URL is not allowed by the Application configuration Facebook
application error
Please see this site here
Given URL is not allowed by the Application configuration.: One or more of
the given URLs is not allowed by the App's settings. It must match the
Website URL or Canvas URL, or the domain must be a subdomain of one of the
App's domains.
I have researched the most popular questions on SO already (Question 1,
Question 2, Question 3, Question 4, and Question 5)... None of them help
with my situation.
I have the application settings laid out like this...
App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com
*App Domains requires that no protocol be identified and Site URL requires
that a protocol be identified.*
I have tried using www.azeverything.com and that didn't work either.
Everything seems to match up. By the way, this is a WP site. I'm not
developing locally either. It's all live.
application error
Please see this site here
Given URL is not allowed by the Application configuration.: One or more of
the given URLs is not allowed by the App's settings. It must match the
Website URL or Canvas URL, or the domain must be a subdomain of one of the
App's domains.
I have researched the most popular questions on SO already (Question 1,
Question 2, Question 3, Question 4, and Question 5)... None of them help
with my situation.
I have the application settings laid out like this...
App Domains: azeverything.com
Sandbox Mode: Disabled
Website with Facebook Login
Site URL: http://azeverything.com
*App Domains requires that no protocol be identified and Site URL requires
that a protocol be identified.*
I have tried using www.azeverything.com and that didn't work either.
Everything seems to match up. By the way, this is a WP site. I'm not
developing locally either. It's all live.
why margin does not work in between div of 'bootstrap col'?
why margin does not work in between div of 'bootstrap col'?
http://bootply.com/84073
<div class"col-lg-12"="">
<header class="clearfix">
<section id="branding">
<a href="index.php"><img
src="https://www.google.com/images/srpr/logo4w.png"
alt=""></a>
</section>
</header></div>
I tried to add #branding{margin: 0 auto} to style the logo to the middle,
but it doesn't work
http://bootply.com/84073
<div class"col-lg-12"="">
<header class="clearfix">
<section id="branding">
<a href="index.php"><img
src="https://www.google.com/images/srpr/logo4w.png"
alt=""></a>
</section>
</header></div>
I tried to add #branding{margin: 0 auto} to style the logo to the middle,
but it doesn't work
Sunday, 29 September 2013
Wildcard subdomain rewrites in nginx
Wildcard subdomain rewrites in nginx
I'm trying to get nginx to rewrite
http://subdomain.example.com
to
http://example.com?username=subdomain
And not having any luck. Its important that the user sees the former URl
in their browser but that nginx interprets it as the latter URL.
Thanks in advance for any help.
I'm trying to get nginx to rewrite
http://subdomain.example.com
to
http://example.com?username=subdomain
And not having any luck. Its important that the user sees the former URl
in their browser but that nginx interprets it as the latter URL.
Thanks in advance for any help.
Whats the point of a move-constructor taking a constans rvalue?
Whats the point of a move-constructor taking a constans rvalue?
According to http://en.cppreference.com/w/cpp/language/move_constructor;
"A class can have multiple move constructors, e.g. both T::T(const T&&)
and T::T(T&&)"
When would one want to pass a constant rvalue to the move-constructor?
According to http://en.cppreference.com/w/cpp/language/move_constructor;
"A class can have multiple move constructors, e.g. both T::T(const T&&)
and T::T(T&&)"
When would one want to pass a constant rvalue to the move-constructor?
Efficient way to combine intersecting bounding rectangles
Efficient way to combine intersecting bounding rectangles
I'm trying to simplify the following image using OpenCV:
What we have here is lots of red shapes. Some of them completely contain
others. Some of them intersect their neighbors. My goal is to unify all
intersecting shapes by replacing any two intersecting shapes with the
bounding box of their union's polygon. (repeating until there are no more
intersecting shapes).
By intersecting I mean also touching. Hope this makes it 100% clear:
I'm trying to do this efficiently using standard morphology operations;
obviously it can be done naively in O(N^2), but that'll be too slow.
Dilation doesn't help because some shapes are only 1px apart and I don't
want them merged if they're not intersecting.
I'm trying to simplify the following image using OpenCV:
What we have here is lots of red shapes. Some of them completely contain
others. Some of them intersect their neighbors. My goal is to unify all
intersecting shapes by replacing any two intersecting shapes with the
bounding box of their union's polygon. (repeating until there are no more
intersecting shapes).
By intersecting I mean also touching. Hope this makes it 100% clear:
I'm trying to do this efficiently using standard morphology operations;
obviously it can be done naively in O(N^2), but that'll be too slow.
Dilation doesn't help because some shapes are only 1px apart and I don't
want them merged if they're not intersecting.
How write linq query for this scenario
How write linq query for this scenario
I have two tables one is datacenter and subnet data center is having
primary key and subnet table having foriegn key values of datacenter id. I
need the result like, different lists for each datacenterid from subnet
table.
Id DatacenterId name xxx 1 1 kishore kumar 2 1 .. .. 3 1 .. .. 4 2 .. .. 5
2 .. .. 6 2 .. ..
I need to get two list one is having datacenterId=1 another is datacenterId=2
I have two tables one is datacenter and subnet data center is having
primary key and subnet table having foriegn key values of datacenter id. I
need the result like, different lists for each datacenterid from subnet
table.
Id DatacenterId name xxx 1 1 kishore kumar 2 1 .. .. 3 1 .. .. 4 2 .. .. 5
2 .. .. 6 2 .. ..
I need to get two list one is having datacenterId=1 another is datacenterId=2
Saturday, 28 September 2013
Recording a link click then saving to local storage
Recording a link click then saving to local storage
Is this the correct code for recording a link click then saving to local
storage and then displaying the image with link in a div?
<script>
var links = [ 'one': 1, 'two': 2, 'three': 3 ];
function saveLink(that){
links[links.length] = that.element.src;
document.getElementById('linkList').innerHTML +=
that.element.src+"<br>";
localStorage.setItem('links', JSON.stringify(testObject));
}
</script>
<img src="http://domain.com/image.png" onclick="saveLink(this);" />
<div id='linkList'>
<script>
var retrievedObject = localStorage.getItem('links');
console.log('retrievedObject: ', JSON.parse(retrievedObject));
</script></div>
Is this the correct code for recording a link click then saving to local
storage and then displaying the image with link in a div?
<script>
var links = [ 'one': 1, 'two': 2, 'three': 3 ];
function saveLink(that){
links[links.length] = that.element.src;
document.getElementById('linkList').innerHTML +=
that.element.src+"<br>";
localStorage.setItem('links', JSON.stringify(testObject));
}
</script>
<img src="http://domain.com/image.png" onclick="saveLink(this);" />
<div id='linkList'>
<script>
var retrievedObject = localStorage.getItem('links');
console.log('retrievedObject: ', JSON.parse(retrievedObject));
</script></div>
Displaying the date an app was opened for the first time
Displaying the date an app was opened for the first time
I want to display the date, the app I make was opened for the first time
in view (which is the only view in the whole app for now).
What kind of object do I use best in my view to display the date and how
do I get it in there?
I want to display the date, the app I make was opened for the first time
in view (which is the only view in the whole app for now).
What kind of object do I use best in my view to display the date and how
do I get it in there?
Crystal Report integrated in Visual Studio 2010
Crystal Report integrated in Visual Studio 2010
I work with crystal report integrated in visual studio 2010 professional.
I want to see my report without running with the preview window.
How can I add the preview window in a report?
I work with crystal report integrated in visual studio 2010 professional.
I want to see my report without running with the preview window.
How can I add the preview window in a report?
Ruby References
Ruby References
When I have the following method:
def n_times(thing)
lambda { |n| thing * n }
end
and I call it like that:
x = [:a]
p1 = n_times(x)
x = [:b]
p p1.call(3) # => [:a, :a, :a]
x will not be changed, the output will be [:a]. Why?
Because when doing something like .pop instead, x will be changed:
x = [:a]
p1 = n_times(x)
x.pop
p p1.call(3) # => []
Is it because [:b] is a new object?
When I have the following method:
def n_times(thing)
lambda { |n| thing * n }
end
and I call it like that:
x = [:a]
p1 = n_times(x)
x = [:b]
p p1.call(3) # => [:a, :a, :a]
x will not be changed, the output will be [:a]. Why?
Because when doing something like .pop instead, x will be changed:
x = [:a]
p1 = n_times(x)
x.pop
p p1.call(3) # => []
Is it because [:b] is a new object?
Subscribe to:
Posts (Atom)