How to specify the SSL port with command line curl?
I'm trying to test the SSL connexion on one of my servers. The server is
behind a LB so it's listening for SSL connexions on the port 8090.
I have use the --resolve option to test when talking to the LB which
listens on port 443.
curl --resolve 'myservice.com:443:1.1.1.1' 'https://myservice.com'
but when I do:
curl --resolve 'myservice.com:8090:2.2.2.2' 'https://myservice.com:8090'
curl simply ignores the port and goes with 443. Of-course, this causes the
DNS cache to miss and I end-up using the public DNS IP...
* Added myservice.com:8090:2.2.2.2 to DNS cache
* About to connect() to myservice.com port 443 (#0)
* Trying 3.3.3.3...
* Connected to myservice.com (3.3.3.3) port 443 (#0)
How can I force curl to use the port 8090 for an SSL connexion?
Thanks.
Monday, 30 September 2013
$m ( \{ x : f(x) > 0 \} ) = 0 \implies f = 0 $ almost everywhere
$m ( \{ x : f(x) > 0 \} ) = 0 \implies f = 0 $ almost everywhere
Suppose $f$ is non-negative measurable function. Put $E = \{ x : f(x) > 0
\} $.
Say $m(E) = 0$. In other words, $E$ is null set. Then does it follow that
$f = 0 $ almost everywhere ?
Suppose $f$ is non-negative measurable function. Put $E = \{ x : f(x) > 0
\} $.
Say $m(E) = 0$. In other words, $E$ is null set. Then does it follow that
$f = 0 $ almost everywhere ?
App crashes when switching between fragments - both have a GoogleMap
App crashes when switching between fragments - both have a GoogleMap
I managed to make it work, but when I switch the fragments the app crashes.
another thing that I want, Is to make the fragment show exactly in the
state the user left it.
What I mean is that I don't want to make a new instance of the fragment
every single time the user clicks the button that switches to it.
the FragmentActivity:
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
public class Fragments extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragments);
Add fragment = new Add();
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.add(R.id.fragment_place, fragment);
transaction.commit();
}
public void onSelectFragment(View view) {
Fragment newFragment;
if (view == findViewById(R.id.add)) {
newFragment = new Add();
} else if (view == findViewById(R.id.map)) {
newFragment = new MainActivity();
} else {
newFragment = new Add();
}
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.replace(R.id.fragment_place, newFragment);
transaction.addToBackStack(null);
transaction.commit();
}
}
The Logcat:
09-30 18:41:09.918: W/dalvikvm(18931): threadid=1: thread exiting with
uncaught exception (group=0x40ed5300)
09-30 18:41:09.968: E/AndroidRuntime(18931): FATAL EXCEPTION: main
09-30 18:41:09.968: E/AndroidRuntime(18931):
android.view.InflateException: Binary XML file line #255: Error inflating
class fragment
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.example.free.Add.onCreateView(Add.java:141)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Handler.handleCallback(Handler.java:615)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Handler.dispatchMessage(Handler.java:92)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Looper.loop(Looper.java:137)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.app.ActivityThread.main(ActivityThread.java:4931)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
java.lang.reflect.Method.invokeNative(Native Method)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
java.lang.reflect.Method.invoke(Method.java:511)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
dalvik.system.NativeStart.main(Native Method)
09-30 18:41:09.968: E/AndroidRuntime(18931): Caused by:
java.lang.IllegalArgumentException: Binary XML file line #255: Duplicate
id 0x7f07001d, tag null, or parent id 0x0 with another fragment for
com.google.android.gms.maps.SupportMapFragment
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:290)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
09-30 18:41:09.968: E/AndroidRuntime(18931): ... 21 more
What's the problem here?
I managed to make it work, but when I switch the fragments the app crashes.
another thing that I want, Is to make the fragment show exactly in the
state the user left it.
What I mean is that I don't want to make a new instance of the fragment
every single time the user clicks the button that switches to it.
the FragmentActivity:
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
public class Fragments extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragments);
Add fragment = new Add();
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.add(R.id.fragment_place, fragment);
transaction.commit();
}
public void onSelectFragment(View view) {
Fragment newFragment;
if (view == findViewById(R.id.add)) {
newFragment = new Add();
} else if (view == findViewById(R.id.map)) {
newFragment = new MainActivity();
} else {
newFragment = new Add();
}
FragmentTransaction transaction = getSupportFragmentManager()
.beginTransaction();
transaction.replace(R.id.fragment_place, newFragment);
transaction.addToBackStack(null);
transaction.commit();
}
}
The Logcat:
09-30 18:41:09.918: W/dalvikvm(18931): threadid=1: thread exiting with
uncaught exception (group=0x40ed5300)
09-30 18:41:09.968: E/AndroidRuntime(18931): FATAL EXCEPTION: main
09-30 18:41:09.968: E/AndroidRuntime(18931):
android.view.InflateException: Binary XML file line #255: Error inflating
class fragment
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.inflate(LayoutInflater.java:489)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.inflate(LayoutInflater.java:396)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.example.free.Add.onCreateView(Add.java:141)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.Fragment.performCreateView(Fragment.java:1478)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1460)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Handler.handleCallback(Handler.java:615)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Handler.dispatchMessage(Handler.java:92)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.os.Looper.loop(Looper.java:137)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.app.ActivityThread.main(ActivityThread.java:4931)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
java.lang.reflect.Method.invokeNative(Native Method)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
java.lang.reflect.Method.invoke(Method.java:511)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
dalvik.system.NativeStart.main(Native Method)
09-30 18:41:09.968: E/AndroidRuntime(18931): Caused by:
java.lang.IllegalArgumentException: Binary XML file line #255: Duplicate
id 0x7f07001d, tag null, or parent id 0x0 with another fragment for
com.google.android.gms.maps.SupportMapFragment
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:290)
09-30 18:41:09.968: E/AndroidRuntime(18931): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
09-30 18:41:09.968: E/AndroidRuntime(18931): ... 21 more
What's the problem here?
Javascript using xml in ckeditor
Javascript using xml in ckeditor
xml file: Common glossary sense would*7*having students read and write
blogs,suggest that the abundance of digital texts
My cursor points sense would7. 1) i want to take the length of para from
starting point(common) to sense would7. 2)i also have to take next paras
content and append to the previous onehaving students read and write
blogs,
Like This: Common glossary sense would7 having students read and write
blogs,suggest that the abundance of digital texts
xml file: Common glossary sense would*7*having students read and write
blogs,suggest that the abundance of digital texts
My cursor points sense would7. 1) i want to take the length of para from
starting point(common) to sense would7. 2)i also have to take next paras
content and append to the previous onehaving students read and write
blogs,
Like This: Common glossary sense would7 having students read and write
blogs,suggest that the abundance of digital texts
Sunday, 29 September 2013
Centering navmenu within a div
Centering navmenu within a div
I have a drop down nav menu that I need to be centered within a div but
text-align: center isn't working for me.
The site is at http://www.joekellywebdesign.com/churchsample1/index.html
<div id="navmenudiv">
`<ul id="navmenu">`
`<li><a href="index.html">Home</a></li>`
`<li><a href="about.html">About Us</a>`
`<ul class="sub1">`
`<li><a href="introduction.html">Introduction</a></li>`
` <li><a href="whoweare.html">Who We Are</a></li>`
`<li><a href="staff.html">Staff</a></li>`
`</ul>`
`</li>`
`<li><a href="services.html">Services</a>`
`<ul class="sub1">`
`<li><a href="sundaymorning.html">Sunday
Morning</a></li>`
`<li><a href="sundayevening.html">Sunday
Evening</a></li>`
`<li><a href="wednesday.html">Wednesday Evening</a></li>`
`</ul> `
`</li>`
`<li><a href="resources.html">Resources</a></li>`
`<li><a href="contact.html">Contact Us</a></li>`
`<li><a href="news.html">News and Events</a></li>`
`</ul>`
`</div>`
The css is at http://www.joekellywebdesign.com/churchsample1/css/styles.css
navmenudiv {
z-index:60;
margin: -30px 0;
height:50px;
background-color:#5340BF;
top:40;position:
relative;
text-align:center;
}
I have a drop down nav menu that I need to be centered within a div but
text-align: center isn't working for me.
The site is at http://www.joekellywebdesign.com/churchsample1/index.html
<div id="navmenudiv">
`<ul id="navmenu">`
`<li><a href="index.html">Home</a></li>`
`<li><a href="about.html">About Us</a>`
`<ul class="sub1">`
`<li><a href="introduction.html">Introduction</a></li>`
` <li><a href="whoweare.html">Who We Are</a></li>`
`<li><a href="staff.html">Staff</a></li>`
`</ul>`
`</li>`
`<li><a href="services.html">Services</a>`
`<ul class="sub1">`
`<li><a href="sundaymorning.html">Sunday
Morning</a></li>`
`<li><a href="sundayevening.html">Sunday
Evening</a></li>`
`<li><a href="wednesday.html">Wednesday Evening</a></li>`
`</ul> `
`</li>`
`<li><a href="resources.html">Resources</a></li>`
`<li><a href="contact.html">Contact Us</a></li>`
`<li><a href="news.html">News and Events</a></li>`
`</ul>`
`</div>`
The css is at http://www.joekellywebdesign.com/churchsample1/css/styles.css
navmenudiv {
z-index:60;
margin: -30px 0;
height:50px;
background-color:#5340BF;
top:40;position:
relative;
text-align:center;
}
Java syntax issues
Java syntax issues
I would like to say I'm new to Java, so I'm wallowing in a lot of suck.
I'm trying to do a Josephus problem, but I'm not allowed to use code
snippets from other people. With this in mind, I have 27 errors in my
code, but can't figure out how to fix it. Would you wonderful people
explain to me why it won't compile. I want to see if my logic is flawed,
but I can't test it because it won't compile. Any other tips to make me
not suck so bad are more than welcome! Here is my code: import
java.util.*;
public class Josephus
{
public class Link
{
public int num;
public Link next;
public Link (int d)
{
num = d;
next = null;
}
}
public class Main
{
Scanner in = new Scanner(System.in);
System.out.println("How many players");
int numPlayers = in.nextInt();
Link first, last;
first = last = new Link (1);
for(int k=2; k<=numPlayers; k++)
{
last.next = new Link(k);
last = last.next;
}
last.next = first;
System.out.println("How many skips");
int m = in.nextInt();
for (int g=0; g<numPlayers; g++)
{
for (int k=0; k<=m; k++);
{
last = last.next;
}
last.next;
last = last.next;
}
}
}
I would like to say I'm new to Java, so I'm wallowing in a lot of suck.
I'm trying to do a Josephus problem, but I'm not allowed to use code
snippets from other people. With this in mind, I have 27 errors in my
code, but can't figure out how to fix it. Would you wonderful people
explain to me why it won't compile. I want to see if my logic is flawed,
but I can't test it because it won't compile. Any other tips to make me
not suck so bad are more than welcome! Here is my code: import
java.util.*;
public class Josephus
{
public class Link
{
public int num;
public Link next;
public Link (int d)
{
num = d;
next = null;
}
}
public class Main
{
Scanner in = new Scanner(System.in);
System.out.println("How many players");
int numPlayers = in.nextInt();
Link first, last;
first = last = new Link (1);
for(int k=2; k<=numPlayers; k++)
{
last.next = new Link(k);
last = last.next;
}
last.next = first;
System.out.println("How many skips");
int m = in.nextInt();
for (int g=0; g<numPlayers; g++)
{
for (int k=0; k<=m; k++);
{
last = last.next;
}
last.next;
last = last.next;
}
}
}
techniques in low latency financial softwares
techniques in low latency financial softwares
Coming from a video game industry background, I just wondered about common
techniques those are being used in low latency ( as processing time , not
network latency or distributed time ) softwares for financial / HFT
softwares.
Yes , I know that definitely premature optimisation is devil, however in
particular , I wondered whether techniques used in AAA game engines are
being utilised , those are :
Multithreaded software architecture & multiprocessors ( for ex OpenMP or
SPUs ) & usage of SIMD for base 3d maths libraries
CPU cache friendly programmig against cache misses , load hit store etc ->
fitting data struct size to cache , organising datastructures as either
SoA or AoS , pre-fecthing data to your cache
data alignment for fast CPU fetchs
implementing a memory pool/pre allocated custom heap system to avoid OS
heap manager costs also things like memory fragmentation
minimising file system access etc, for instance if there is a need for
database using an in-memory system like SQLite etc
Are things like these being used there as well ?
Coming from a video game industry background, I just wondered about common
techniques those are being used in low latency ( as processing time , not
network latency or distributed time ) softwares for financial / HFT
softwares.
Yes , I know that definitely premature optimisation is devil, however in
particular , I wondered whether techniques used in AAA game engines are
being utilised , those are :
Multithreaded software architecture & multiprocessors ( for ex OpenMP or
SPUs ) & usage of SIMD for base 3d maths libraries
CPU cache friendly programmig against cache misses , load hit store etc ->
fitting data struct size to cache , organising datastructures as either
SoA or AoS , pre-fecthing data to your cache
data alignment for fast CPU fetchs
implementing a memory pool/pre allocated custom heap system to avoid OS
heap manager costs also things like memory fragmentation
minimising file system access etc, for instance if there is a need for
database using an in-memory system like SQLite etc
Are things like these being used there as well ?
Subscribe to:
Posts (Atom)