text
stringlengths 3
1.74M
| label
class label 2
classes | source
stringclasses 3
values |
---|---|---|
For travel inspiration in the new year I have compiled photo galleries of all 1007 UNESCO World Heritage Sites, specific countries and links in the comments.
| 0non-cybersec
|
Reddit
|
Why docker (with overlay2 driver storage) change the reported size of a mount point. <p>I'm having this in my <code>/etc/sysconfig/docker-storage</code></p>
<pre><code>DOCKER_STORAGE_OPTIONS="--storage-driver=overlay2"
</code></pre>
<p>Then I mount <code>/dev/xdvcz</code> to <code>/var/lib/docker/overlay2</code>.
Then I do a <code>df -h</code>:</p>
<pre><code># df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 938G 72M 888G 1% /var/lib/docker/overlay2
</code></pre>
<p>That's correct, I have 1000G EBS device.
Now I start docker with <code>service docker start</code>.</p>
<p><code>df -h</code> report is now changing to:</p>
<pre><code># df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 7.8G 7.8G 0 100% /var/lib/docker/overlay2
</code></pre>
<p>Okay, stop docker: <code>service docker stop</code></p>
<p><code>df -h</code> report is now changing back to:</p>
<pre><code># df -h /dev/xvdcz
Filesystem Size Used Avail Use% Mounted on
/dev/nvme1n1 938G 72M 888G 1% /var/lib/docker/overlay2
</code></pre>
| 0non-cybersec
|
Stackexchange
|
How to change Notepad ++ cursor. <p>I was playing around with a friend of mine and accidentally hit a bunch of keyboards on my Windows 7 laptop. I had Notepad ++ open at the time and when I came back to see what I was typing, the cursor had changed! Instead of being a blinking "I", it became a blinking blue underline, which I find very annoying. I have tried to change it in the settings menu as well as the styles menu, but I could not find anything relating to it. The text-editor pointer is still a blue-underline instead of a bar. I have the most up-to-date stable release of Notepad ++. </p>
<p>I could post a screen image if necessary.</p>
| 0non-cybersec
|
Stackexchange
|
String as html in reactjs. <p>I have a function which returns several lines of html, like so:</p>
<pre><code>render: function() {
var badges = user.get('achievements').badges.map(function(badge) {
var str = '<h3><span className="fa fa-fw '
switch(badge.id) {
case '0':
str += ('fa-briefcase"></span><small>' + badge.text + '</small></h3>')
break;
case '1':
str += ('fa-shopping-cart"></span><small>' + badge.text + '</small></h3>')
break;
...
}
return str;
});
return (
<div className="pull-right">
{badges}
</div>
);
}
</code></pre>
<p>On doing this the string is rendered as it is on the page, as text:</p>
<p><code><h3><span className="fa fa-fw fa-briefcase"></span><small>Visionary</small></h3><h3><span className="fa fa-fw fa-shopping-cart"></span><small>Active</small></h3><h3><span className="fa fa-fw fa-sitemap"></span><small>Lorem</small></h3><h3><span className="fa fa-fw fa-tasks"></span><small>Ipsum</small></h3><h3><span className="fa fa-fw fa-signal"></span><small>Dolor</small></h3><h3><span className="fa fa-fw fa-check-square"></span><small>Amet;</small></h3></code></p>
<p>How do I render it as proper HTML ?</p>
| 0non-cybersec
|
Stackexchange
|
AdMob: "activity has leaked ServiceConnection" and "AdvertisingIdClient unbindService failed.". <p>I'm using AdMob in my app. I followed implementation guidelines, and the banner is correctly showing and loading the ads. My MainActivity is responsible of creating references, building the AdRequest and showing the banner, as well as pausing, resuming, and destroying the AdView. Everytime the AdRequest has been loaded, when the Activity's onStop() is called, the following Exception is created:</p>
<pre><code>6706-6706/com.rocca.controlloSpese E/ActivityThread﹕ Activity com.rocca.controlloSpese.MainActivity has leaked ServiceConnection com.google.android.gms.common.b@52b1cc3c that was originally bound here
android.app.ServiceConnectionLeaked: Activity com.rocca.controlloSpese.MainActivity has leaked ServiceConnection com.google.android.gms.common.b@52b1cc3c that was originally bound here
at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:970)
at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:864)
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1577)
at android.app.ContextImpl.bindService(ContextImpl.java:1560)
at android.content.ContextWrapper.bindService(ContextWrapper.java:517)
at com.google.android.gms.ads.identifier.a.b(SourceFile:330)
at com.google.android.gms.ads.identifier.a.a(SourceFile:187)
at com.google.android.gms.ads.identifier.a.b(SourceFile:239)
at com.google.android.a.t.f(SourceFile:132)
at com.google.android.a.t.b(SourceFile:182)
at com.google.android.a.q.a(SourceFile:258)
at com.google.android.a.q.a(SourceFile:195)
at com.google.android.gms.ads.internal.m.a(SourceFile:107)
at com.google.android.gms.ads.internal.request.c.a(SourceFile:99)
at com.google.android.gms.ads.internal.util.b.run(SourceFile:17)
at com.google.android.gms.ads.internal.util.d.call(SourceFile:29)
at com.google.android.gms.ads.internal.util.e.call(SourceFile:49)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
</code></pre>
<p>followed by this info:</p>
<pre><code>6706-6781/com.rocca.controlloSpese I/AdvertisingIdClient﹕ AdvertisingIdClient unbindService failed.
java.lang.IllegalArgumentException: Service not registered: com.google.android.gms.common.b@52b1cc3c
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:922)
at android.app.ContextImpl.unbindService(ContextImpl.java:1611)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:529)
at com.google.android.gms.ads.identifier.a.c(SourceFile:275)
at com.google.android.gms.ads.identifier.b.c(SourceFile:100)
at com.google.android.gms.ads.identifier.b.run(SourceFile:110)
</code></pre>
<p>This doesn't happen if the AdRequest is not built and loaded. I set up my IABHelper in onCreate(), and if the user didn't buy my "remove-ads" sku, ads are shown. This is the code I use to load the ads:</p>
<pre><code>private void showAds() {
int adresult = GooglePlayServicesUtil.isGooglePlayServicesAvailable(MainActivity.this);
if (adresult == ConnectionResult.SUCCESS) {
//if possible, show ads
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("C144E9DA02EA7B26F74ED2C231F31D38")
.addTestDevice("93BABD84466B8C1EF529D2FB39D1ACE8")
.addTestDevice("BEAA738068664AE9BBF673E37A782E03")
.addTestDevice("E51508081F77DF84C129EE471DE67141")
.build();
adView.setVisibility(View.VISIBLE);
adView.loadAd(adRequest);
} else {
//if there's a problem, show error and close app
GooglePlayServicesUtil.getErrorDialog(adresult, MainActivity.this, 0, new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
finish();
}
}).show();
}
}
</code></pre>
<p>adView's <code>pause()</code>, <code>resume()</code> and <code>destroy()</code> are called in the respective activity's methods. Practically, the app's performance isn't affected, but I'd rather avoid memory leaks. How do I avoid that exception?</p>
<p>EDIT: the Manifest.xml</p>
<pre><code><manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.rocca.controlloSpese" >
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="com.rocca.controlloSpese.BROADCAST_PERMISSION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:finishOnCloseSystemDialogs="true"
android:label="@string/app_name"
android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
</code></pre>
<p></p>
| 0non-cybersec
|
Stackexchange
|
Finding a Closed Form for $\int_0^\infty A\sin(\frac{2\pi}{T}x) \exp(-bx)dx$. <p>I'm struggling in finding a closed form for, </p>
<blockquote>
<p>$$ \int_0^\infty Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right) \,dx $$</p>
</blockquote>
<p><em>My Attempt:</em> Let $H = \int Ae^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx$. First I integrate by parts, splitting $f=e^{-bx}$ and $dg=\sin\left(\frac{2\pi}{T}x\right)\,dx$. Then another IBP using $u=e^{-bx}$ and $dv = \cos\left(\frac{2\pi}{T}x\right)\,dx$ and simplify,</p>
<p>\begin{align}
\frac{2\pi}{A\cdot T} H &= -e^{-bx}\cos\left(\frac{2\pi}{T}x\right) - \frac 1 b \int \cos\left(\frac{2\pi}{T}x\right)e^{-bx}\,dx \\
\frac{2\pi}{A\cdot T} H &= -e^{-bx}\cos\left(\frac{2\pi}{T}x\right) - \frac 1 b \left[ e^{-bx}\frac{T}{2\pi}\sin\left(\frac{2\pi}{T}x\right) + \frac{T}{2\pi b}\int e^{-bx}\sin\left(\frac{2\pi}{T}x\right)\,dx \right] \\
\left(\frac{2\pi}{A\cdot T} - \frac{T}{2\pi b^2}\right)H &= e^{-bx}\cos\left(\frac{2\pi}{T}x\right) - \frac{T}{2\pi b} e^{-bx} \sin\left(\frac{2\pi}{T}x\right) \\
H &= -e^{-bx} \left(\cos\left(\frac{2\pi}{T}x\right) + \frac{T}{2\pi b}\sin\left(\frac{2\pi}{T}x\right) \right) \cdot \left( \frac{A\cdot T 2\pi b^2}{(2\pi b)^2 - A\cdot T^2}\right) + c\\
\end{align}</p>
<p>First off, is this horrid looking expression correct? If so, can it be simplified further?</p>
<p>Now I come to evaluate $H|_0^\infty$. $H$ appears to be defined at $x=0$, so I really just need to find $\lim_{x\to \infty^+} H$. Here is where I'm stuck. The denominator grows exponentially for $b\ge 1$, and $T$ and $A$ don't seem to have any effect on the limit. How should I evaluate this limit?</p>
| 0non-cybersec
|
Stackexchange
|
Evaluate $\frac{\binom{n}{0}}{m!}+n\cdot\frac{\binom{n}{1}}{(m+1)!}+n(n-1)\cdot\frac{\binom{n}{2}}{(m+2)!}+\ldots$. <blockquote>
<p>Evaluate <span class="math-container">$$\dfrac{\binom{n}{0}}{m!}+n\cdot\dfrac{\binom{n}{1}}{(m+1)!}+n(n-1)\cdot\dfrac{\binom{n}{2}}{(m+2)!}+\ldots (n \, \, \text{terms})$$</span></p>
</blockquote>
<p>I tried to integrate <span class="math-container">$x^{m!-1}(1+x)^n$</span> from <span class="math-container">$0$</span> to <span class="math-container">$1$</span>. But I won't get product of <span class="math-container">$n$</span>'s in numerator. Any hint?</p>
| 0non-cybersec
|
Stackexchange
|
Rob Roy Glacier Wanaka, NZ [OC] [1836x3264].
| 0non-cybersec
|
Reddit
|
Find all occurrence of keys in nested python dict. <p>I have a dictionary like this:</p>
<pre><code>a = {'compatibility': {'schema': ['attribute_variables/evar44',
'event42',
'container_visitors'],
'status': 'valid',
'supported_features': ['function_and',
'function_attr',
'function_container',
'function_event',
'function_event-exists',
'function_streq'],
'supported_products': ['o', 'data_warehouse', 'discover'],
'supported_schema': ['warehouse', 'n'],
'validator_version': '1.1.11'},
'definition': {'container': {'context': 'visitors',
'func': 'container',
'pred': {'func': 'and',
'preds': [{'description': 'e42',
'evt': {'func': 'event', 'name': 'metrics/event42'},
'func': 'event-exists'},
{'description': 'v44',
'func': 'streq',
'str': '544',
'val': {'func': 'attr', 'name': 'variables/evar44'}}]}},
'func': 'segment',
'version': [1, 0, 0]},
'description': '',
'id': 's2165c30c946ebceb',
'modified': '12',
'name': 'Apop',
'owner': {'id': 84699, 'login': 'max', 'name': 'Max'},
'reportSuiteName': 'App',
'rsid': 'test',
'siteTitle': 'App',
'tags': []}
</code></pre>
<p>I would like to extract the values of every key "description", "func", and "str"/"num" and return these values in one DataFrame of these dict.</p>
<p>I tried it with this code, but I wasn´t able to get every value und struggeld to put the values in one DataFrame.</p>
<pre><code>def findkeys(node, kv):
if isinstance(node, list):
for i in node:
for x in findkeys(i, kv):
yield x
elif isinstance(node, dict):
if kv in node:
yield node[kv]
for j in node.values():
for x in findkeys(j, kv):
yield x
</code></pre>
<p>For my example the output I would like to have:</p>
<pre><code>pd.DataFrame(np.array([['e42', 'event', 'NaN'], ['v44', 'streq', '544']]),
columns=['description', 'funk', 'str/num'])
</code></pre>
| 0non-cybersec
|
Stackexchange
|
sed query for pattern matching. <p>My file looks like</p>
<p><code>cat new</code>:</p>
<pre><code>ALL ALLOFTHEM ALL1
OPS BE2A OPS1
ABE ABE ABE1
</code></pre>
<p>sed query below gives me the result as 1st line
<code>sed -n '/\([A-Z]\{1,\}\)\1/p' new</code>:</p>
<pre><code>ALL ALLOFTHEM ALL1
</code></pre>
<p>I guessed that 2nd line would also match as OPS is also a character length more than 1.</p>
<p>Any ideas?</p>
| 0non-cybersec
|
Stackexchange
|
Found behind a caravan wall in Australia.
| 1cybersec
|
Reddit
|
What configuration would allow me to keep my MySQL server(s) updated while keeping the service consistently available?. <p>I have several Centos 5 web hosting servers with local instances of MySQL that I am looking to segment so that all servers connect to a central MySQL instance. These are web applications doing more reads than writes, and I would like to keep the databases available as much as possible while also keeping the host servers updated. I've been reading the docs at <a href="http://dev.mysql.com/doc/refman/5.0/en/ha-overview.html" rel="nofollow noreferrer">http://dev.mysql.com/doc/refman/5.0/en/ha-overview.html</a> which are informative, but I'd like to know what others have done in practice that have worked for them. </p>
| 0non-cybersec
|
Stackexchange
|
I can't activate Wifi or Bluetooth on a Toshiba Satellite Laptop. <p>I'm new to Ubuntu and i installed Ubuntu 13.10 to my Toshiba Satellite L500D laptop. But wifi and Bluetooth are not working, although wireless connectivity light is always on. How can I activate wifi and connect with a device over Bluetooth. Please be so kind and give me an easy to follow answer. On the connectivity tab it says,that wifi is disabled by the hardware switch.</p>
| 0non-cybersec
|
Stackexchange
|
backup postgres database password issue. <p>I've got a postgres database that I want to backup regularly. For that, I'd like to use the automated backup script <a href="https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux" rel="nofollow noreferrer">here</a></p>
<p>Usually I to proceed admin tasks I use these command:</p>
<pre><code>> sudo -i -u postgres
> psql
</code></pre>
<p>No password is requested and I can dump manually my database. It's not too bad.</p>
<p>Using the automated script I face a password issue. It asks me for <code>postgres</code> password. I've never set it up and I thought I shouldn't need to set it up as the example given above showed.</p>
<p>Here is how is configured my <code>pg_hba.conf</code>.</p>
<pre><code># Database administrative login by Unix domain socket
local all postgres peer
TYPE DATABASE USER ADDRESS METHOD
"local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
</code></pre>
<p>Do I really need to set a <code>postgres</code> password for running my script? </p>
| 0non-cybersec
|
Stackexchange
|
Europe, Equipopulous (xpost from /r/MapPorn).
| 0non-cybersec
|
Reddit
|
Can I move HDD to another machine and continue using same Win 8.1 installation?. <p>I bought a laptop (new) with Win 8.1 installed. I removed the hard drive and want to sell it on eBay, but want to know if I can advertise it as an HDD with Windows 8.1 installed? Thanks.</p>
| 0non-cybersec
|
Stackexchange
|
Is it the rails way to use singular or plural controller names?. <p>Should I use /article or /articles ?</p>
| 0non-cybersec
|
Stackexchange
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
[COMC] Husband & Wife Gamers, 2.5 Years Into the Hobby. Hello, fellow gamers!
While my wife and I both grew up with board games, we never really branched out past the "standard classics", things like Monopoly, Set, Phase 10, Clue, etc.
A few Christmas gatherings ago, we were introduced to the wider range of quality, newer boardgames, as most of her expansive list of cousins play games. A few Christmas & wedding presents later, and we are knee deep in this wonderful hobby! Considering we are about to celebrate our 2nd wedding anniversary, we thought we would post our growing collection.
**PLAYING AREA**
[Imgur](http://i.imgur.com/fWnS3be.jpg)
Our main playing area is in the back corner of the basement, dubbed the "Hobby Area", where not only are all our board games, but all of my miniatures & painting area.
We are currently using a folding table for the playing surface, but we recently backed the BoardGameTables.com Kickstarter and will be utilizing that once it arrives in February (hopefully.)
Our current playing group usually consists of between 2-6 people, so we try to have a variety of games and sizes to accommodate all. However, most of the time it is just us playing together.
**WHOLE COLLECTION**
[Imgur](http://i.imgur.com/ZZEPJp0.jpg)
Board Game Geek Collection Link: https://boardgamegeek.com/collection/user/Smurny85
WARNING: We haven't organized thoroughly, yet. So feel free to rage against our haphazard distribution of games. Storage space is currently on three of the Better Home & Gardens 8-Cube Shelves from Walmart. They were the best option for us because the closest IKEA is 3 hours away, and shipping sucks. :/
**SHELF ONE**
[Imgur](http://i.imgur.com/6IVMvqR.jpg)
This shelf holds most of our smaller format games, as well as some of the games that just don't fit well in the shelves without causing an absolute mess in box, (I'm looking at you, BLOKUS.)
* Blokus
* Pathfinder: Adventure Card Game
* Cards Against Humanity (and all expansions)
* Friday
* Onirim
* Paperback
* Pit
* Timeline (various)
* We Didn't Playtest This At All + Chaos Pack
* Fluxx: Zombies
* Superfight
* The Contender
* One Night: Ultimate Werewolf
* Rat-A-Tat Cat
* Unexploded Cow
* Love Letter
* Dungeon Roll
* Sushi Go!
* Zombies!!!
* Munchkin + expansions
* Boss Monster
* Codenames
* Bang! The Dice Game
* Exploding Kittens: NSFW
* Coup
* Splendor
* Race For The Galaxy
* Ascension + Expansion
* Eldritch Horror
* Sentinels of the Multiverse + Expansions
**SHELF TWO**
[Imgur](http://i.imgur.com/8ou0YaS.jpg)
This shelf seems to contain most of our frequently played games. Ignore my Imperial Guard army on top of the shelf; it is just temporary storage while I attempt to auction it off. Nothing like liquidating one hobby to support another!
* Quarriors + Quartifacts
* Marvel Dicemasters: Civil War
* Machi Koro + both expansions
* Diamonsters
* King of Tokyo
* Elf Quest: Adventure Game
* Carcassonne + Inns & Cathedrals + mini expansions
* Ticket to Ride
* Lords of Waterdeep
* Settlers of Catan
* Forbidden Desert
* Forbidden Island
* Pandemic
* Pandemic Legacy
* Magic: Arena of the Planeswalkers
* Risk: Legacy
* Mage Knight
* Castles of Mad King Ludwig + Secrets
* Castles of Burgundy
* Smallworld
* Mysterium
**SHELF THREE**
[Imgur](http://i.imgur.com/eS6uKxN.jpg)
This shelf contains most of the "classic" games that don't see a lot of play, as well as games that we have inherited and/or just haven't gotten around to purging/trading/donating.
**FAVORITES & INFO**
Our current favorite games are: Pandemic Legacy (just finished June!), Machi Koro, Castles of Mad King Ludwig, Ticket to Ride, & Lords of Waterdeep.
Our least favorite/least played games are: Zombies!!!, Diamonsters, most of Shelf Three.
We are slowly getting in to heavier games, as we just picked up Castles of Burgundy and absolutely love it! Our thirst grows...
I have a few games backed on Kickstarter, which will be arriving later this year and early next year: Scuttle!, Masmorra, Dresden Files Card Game, & Sentinels of the Multiverse: ObliVAeon.
Thoughts? Concerns? Suggestions? Questions? Hit us with them!
Cheers!
| 0non-cybersec
|
Reddit
|
Git. Rebase local branch atop local master. How do I ignore a single files changes?. <p>With Git I am on a branch. I am rebasing the branch atop master. There is a conflict that I want to resolve by ignoring the branches version and accepting master's version. How do I indicate I want to use master's version of the file during the rebase-ing.</p>
<p>Thanks,<br>
Doug</p>
| 0non-cybersec
|
Stackexchange
|
Apache and Kerberos SSO with multiple vhosts and multiple SPNs. <p>I would like to do single sign-on of a website in my windows box.
I am using the Kerberos Authentication module of apache.
This is working pretty fine when having just one web site.</p>
<p>This is the current configuration:</p>
<p><strong>.htaccess file:</strong></p>
<pre><code>RewriteEngine On
AuthType Kerberos
AuthName "Login"
KrbAuthRealms MY.DOMAIN.NAME
KrbServiceName HTTP/[email protected]
Krb5Keytab /etc/mykeytab.keytab
KrbMethodK5Passwd on
KrbAuthoritative on
KrbMethodNegotiate on
Require valid-user
</code></pre>
<p>In order to get that working, I needed to create a keytab file on my Active Directory Controller using the following command:</p>
<pre><code>ktpass -out c:\temp\mykeytab.keytab
-princ HTTP/[email protected]
-mapUser user1
-mapOp set
-pass secret
-crypto AES256-SHA1
-pType KRB5_NT_PRINCIPAL
</code></pre>
<p>As said, up to this point everything is working pretty fine.
Now for the tricky part:</p>
<p>I would like to have a 2nd web site (vhost) on the same physical machine which is using the same Active Directory user (user1). I don't care if I need to use a different Service Principal name (SPN) or if I can use the same one as before.</p>
<p>The new site is named:</p>
<pre><code>sub2.domain.com
</code></pre>
<p>and the <code>.htaccess</code> file is</p>
<p><strong>.htaccess file:</strong></p>
<pre><code>RewriteEngine On
AuthType Kerberos
AuthName "Login"
KrbAuthRealms MY.DOMAIN.NAME
KrbServiceName HTTP/[email protected]
Krb5Keytab /etc/mykeytab2.keytab
KrbMethodK5Passwd on
KrbAuthoritative on
KrbMethodNegotiate on
Require valid-user
</code></pre>
<p>I also created a new keytab file like this:</p>
<pre><code>ktpass -out c:\temp\mykeytab2.keytab
-princ HTTP/[email protected]
-mapUser user1
-mapOp add
-pass secret
-crypto AES256-SHA1
-pType KRB5_NT_PRINCIPAL
-in c:\temp\mykeytab1.keytab
</code></pre>
<p>This keytab file now contains both SPNs mapped to user1.</p>
<p>When opening both web sites, only sub1 is still working, sub2 is giving a login prompt, i.e. SSO does not work with sub2.</p>
<p>Unfortunately, the apache2 log files do not contain any related information, although I used <code>LogLevel debug</code>.</p>
<p>In the meantime I found out that one of my problems is the key version number (kvno) which is different in both keytabs and also in the merged keytab file. (Both entries keep their original kvno with the older one becoming invalid as soon as the newer one is active...)
Is there a way to have the same kvno on both keytabs (or on both entries of the combined keytab?).
Btw, the corresponding error log message is:</p>
<p><code>[auth_kerb:error] [pid 8222] [client 10.10.10.10:59840] gss_accept_sec_context() failed: Unspecified GSS failure. Minor code may provide more information (, Key version number for principal in key table is incorrect)</code></p>
<p>Does anyone know why sub2 is not working correctly and sub1 does?
... and what I can do to have the same kvnos?</p>
<p>Best,
TomS</p>
| 0non-cybersec
|
Stackexchange
|
I hope Meck. Co. Register of Deeds got their money back..
| 0non-cybersec
|
Reddit
|
Scratching sound on Windows 7. <p>My audio in Windows 7 is not working properly lately. When I am playing a song/movie sometimes in between I hear really bad scratching sound.</p>
<p>I wondered If my speakers were the problem, so I hooked up a pair of headphones and checked but the scratching sound was there too.</p>
<p>Then I switched to Linux to see if the problem remained there to, but the audio was playing just fine.</p>
<p>Then I came back to Windows, removed the driver and re-installed it but the problem remains.</p>
<p>Any idea how to fix this?</p>
| 0non-cybersec
|
Stackexchange
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
An Amish joke..
An Amish boy and his father were visiting a mall. They were amazed by almost everything they saw, but especially by two shiny, silver walls that could move apart and back together again.
The boy asked his father, "What is this father?" The father (never having seen an elevator) responded, "Son, I have never seen anything like this in my life, I don't know what it is."
While the boy and his father were watching wide-eyed, an old lady limping slightly with a cane slowly walks up to the moving walls and pressed a button. The walls opened and the lady walks between them and into a small room. The walls closed and the boy and his father watched, small circles of light with numbers above the wall light up.
They continued to watch the circles light up in the reverse direction.
The walls opened up again and a beautiful 24-year-old woman stepped out.
The father said to his son, "Go get your Mother."
| 0non-cybersec
|
Reddit
|
Kadison's Theorem for operator subsystems of commutative $C^*$-algebras. <p>By a result of Kadison, every operator subsystem of a commutative <span class="math-container">$C^*$</span>-algebra is isomorphic to the space of continuous affine functions on its state space.</p>
<p>In other words, if <span class="math-container">$X$</span> is a compact Hausdorff space and <span class="math-container">$E\subseteq C(X)$</span> is an operator system, then <span class="math-container">$Aff(S(E))$</span> is isomorphic to <span class="math-container">$E$</span> (as operator systems- complete order isomorphism), where <span class="math-container">$S(E)$</span> denotes the state space.</p>
<p>This seems to be a generalisation of Gelfand Duality for commutative <span class="math-container">$C^*$</span>-algebras.</p>
<p>I would be happy to get a recommended reference for a proof.</p>
<p>Moreover, I could not see why in the case that <span class="math-container">$E$</span> is a unital, commutative <span class="math-container">$C^*$</span>-algebra, i.e. <span class="math-container">$E=C(X)$</span>, then we actually get <span class="math-container">$A(S(C(X)))=C(X)$</span> as expected? Since <span class="math-container">$S(C(X))$</span> can be identified with the space of Radon probability measures on <span class="math-container">$X$</span>, <span class="math-container">$P(X)$</span>, my question reduces to the question:
Why the continuous affine functions on <span class="math-container">$P(X)$</span> are isomorphic to <span class="math-container">$C(X)$</span>?</p>
<p>Thanks!</p>
| 0non-cybersec
|
Stackexchange
|
Ouch.
| 0non-cybersec
|
Reddit
|
Why is the distributive property so pervasive in mathematics?. <p>I just read this post which gives a geometric argument for the distributive law for real numbers, which I liked: <a href="https://math.stackexchange.com/a/466397/241685">https://math.stackexchange.com/a/466397/241685</a></p>
<p>However the distributive law comes up everywhere, not just for numbers. Set intersection distributes over union, inner products distribute over vector addition, wedge products distribute over vector addition, ring multiplication distributes over ring addition, matrix multiplication distributes over matrix addition, etc.</p>
<p>Is it that we are intentionally studying systems which generalize the distributive law for numbers, or is it that the systems we study which are interesting happen to generalize the distributive law? And either way, why is this the case?</p>
| 0non-cybersec
|
Stackexchange
|
Whats a good price for an oil change?. I have a 2001 chrysler sebring and im running on about 3700 miles without an oil change. I keep putting it off. Whats a good price and a general good place to get it(dealership,gas station)
| 0non-cybersec
|
Reddit
|
Time Flies it really does. Dad; 'What day is it ?"
Kid ; "It is the first of January 2020"
Dad; "Shesh it felt like yesterday it like it was 2019"
| 0non-cybersec
|
Reddit
|
This is what I believe literally everyone can do after 18 months of practice: at least one wall that you can be proud of. I get it, they're not very good overall, but consider that I never drew anything before 35..
| 0non-cybersec
|
Reddit
|
How to conditionally blur video using FFMPG. <p>I want to conditionally blur video
Like for a 30 second video form 2-10 second blur different area than 12-20 second.</p>
<p>But I am only able to blur it 1 time only so far,Following is the command I tried to achieve the goal.
Using <a href="https://ffmpeg.org/ffmpeg-utils.html#Expression-Evaluation" rel="nofollow noreferrer">Arithematic Expressions</a> </p>
<p><code>ffmpeg -y -i with_out_sound.mp4
filter_complex [0:v]boxblur=10:enable='between(t,2,10)'[bg],[0:v]crop=206:169:3
2:121[fg],[bg][fg]overlay=32:121:enable='between(t,2,10)'[tmp];[0:v]boxblur=10:
enable='between(t,12,20)'[bg],[0:v]crop=206:169:42:100[fg],[bg][fg]overlay=42:100
:enable='between(t,12,20)'[tmp2];[tmp][tmp2]concat[tmp3] -map [tmp3] with_out_sou
ndd.mp4</code></p>
<p>but above command first blur(2-10) complete video and then concat complete video again with blur (12-20) so I get 60 second video instead of 30 second.</p>
<p><code>ffmpeg -y -i with_out_sound.mp4 -filter_complex [0:v]boxblur=10:enable='between(t,2,10)'[bg];[bg]crop=206:169:32:121[fg];[bg][fg]overlay=32:121:enable='between(t,2,10)'[tmp],[tmp]b
oxblur=10:enable='between(t,12,20)'[tbg],[tmp]crop=206:169:42:100[tfg],[tbg][tfg]overlay=42:100:enable='between(t,12,20)'[tmp2] -map
"[tmp2]" with_out_soundd.mp4</code></p>
<p>But in this case I start receiving error
Stream specifier 'tmp' in filtergraph description matches no stream.</p>
<p>I am using ffmpeg latest version on windows.</p>
| 0non-cybersec
|
Stackexchange
|
exchangelib - How to send attachment with email reply. <p>I am using exchangelib to connect to exchange and reply to emails. But while sending reply it doesn't support attachments.</p>
<p>As per <a href="https://stackoverflow.com/a/52665116/2118215">this answer</a> I have to " create a normal Message item that has a 'Re: some subject' title, contains the attachment, and quotes the original message, if that's needed."</p>
<p>but i am not sure how to "quote" the original message</p>
<p>I am using following code to reply:</p>
<p>from pathlib import Path
from exchangelib import Message, Account, FileAttachment</p>
<pre><code>account = Account(...)
item = ...
file_to_attach = Path('/file/to/attach.txt')
message = Message(
account=account,
subject="Re: " + item.subject,
body="This is reply by code",
cc_recipients=item.cc_recipients,
to_recipients=[item.sender],
in_reply_to=item.id,
conversation_id=item.conversation_id,
)
with file_to_attach.open('rb') as f:
content = f.read()
message.attach(FileAttachment(name=file_to_attach.name, content=content))
message.send_and_save()
</code></pre>
<p>It sends the email with attachment but it doesn't maintain text from original mail in reply and appears to be a new mail instead of a reply. also doesn't appear as conversation in gmail</p>
<p>I may be missing something small here. please suggest how to fix this</p>
| 0non-cybersec
|
Stackexchange
|
Does the change of system language and/or keyboard region get logged in windows 10 system logs and where to find it?. <p>Someone changed the system language via taskbar button on our win10 machine, which lead to several subsequent problems with custom software.</p>
<p>Does this event get logged in win10 and where would I be able to see it and find out when this exactly happened?</p>
| 0non-cybersec
|
Stackexchange
|
Windows 2008 R2 AD-FS 2.0 Configure Error (.NET Framework). <p>I have been trying to configure my Windows server 2008 R2 machine for the last 3 days now just so that mobile clients can access an in-house installation of MS Dynamics CRM 2013 !</p>
<p>After MUCH reading and many fall downs I now know I have to install and setup AD-FS and then ultimately IFD.</p>
<p>I have added the AD-FS role from the server manager but could never get this to work with the CRM. I later found out that the AD-FS version that ships with 2008 R2 is 1.0, which apparently is no good. I need 2.0 !</p>
<p>I downloaded and installed AD-FS 2, it seemed to install without problem (this is where the problems start).</p>
<p>I open the AD-FS tool and click the link to configure and BOOM, I get an error stating it need .NET Framework 3.5 installed... wtf !?! I know this is already installed on this machine by default, by anyway I check in the features... sure enough, its there. I have ran other tools to check the installation and all seems fine.</p>
<p>I am now pulling out may hair after 3 days of this crap. I just cant figure out whats wrong and I only found one result on google which basically just has one follow up to a guys post which asks him to check his .NET Framework installation.</p>
<p>I have tried to un-install and install many times, but same problem.</p>
<p>I was hoping someone here could help me out of this jam.</p>
<p>Thanks guys !</p>
| 0non-cybersec
|
Stackexchange
|
Reinstalling windows from repair disk using 64 instead of 32. <p>I have a Lenovo Thinkpad W510 running Windows 7 Ultimate. Before my warranty ran out, I sent it in to have some repairs done which included replacing my hard drive and reinstalling Windows.
I had been running 64 bits, but they mistakenly installed 32 bits. At the time, I needed my pc, and didn't need the extra processing power, so I didn't bother with it.<br>
Now I am about to reinstall Windows because it's full of junk, and I want a clean slate.
I have several possible routes:
1. Can I reinstall Windows 7 using the repair disk, but opt for a 64 bit os at install time?<br>
2. I have another install disk for Windows 7 Pro. Can I install this and use the product key for ultimate that is on the bottom of my pc?
3. Should I just install Linux and say 'F it!' to all the complexity involved in Operating System monopolization and deliberate consumer confusion? (This is tongue and cheek. I know that the myth of the Microsoft boogie-men was written by grumpy children - I just feel like a grumpy child about this right now).</p>
| 0non-cybersec
|
Stackexchange
|
Ubuntu 16.04 doesn't suspend when idle. <p>On my laptop Asus the system doesn't go to sleep when inactive. In settings, the sleep is set to 10 minutes for battery and AC power when inactive.
Yet, Ubuntu can into suspend when closing the lid ; the command <code>systemctl suspend</code> work without root and the updates are up to date. Only the suspend when idle doesn't work.</p>
<p>Kernel version and others data to help :
<a href="https://pastebin.com/1bzCCZJe" rel="nofollow noreferrer">https://pastebin.com/1bzCCZJe</a></p>
| 0non-cybersec
|
Stackexchange
|
Little sis doesn't like the fireworks.
| 0non-cybersec
|
Reddit
|
How to properly use lang in HTML. <p>I want to ask you how to properly use lang in HTML code.
Im trying to have website in 2 langs en, pl.</p>
<pre><code><html lang="en">
<html lang="pl">
</code></pre>
<p>Is this way correct?</p>
| 0non-cybersec
|
Stackexchange
|
LocalDate interval in Joda-time. <p>Joda-time has an <a href="http://www.jarvana.com/jarvana/view/joda-time/joda-time/1.5.1/joda-time-1.5.1-javadoc.jar!/org/joda/time/Interval.html" rel="noreferrer">Interval</a> class, which is a range between <a href="http://www.jarvana.com/jarvana/view/joda-time/joda-time/1.5.1/joda-time-1.5.1-javadoc.jar!/org/joda/time/DateTime.html" rel="noreferrer">DateTime</a>s. What can be used for a range of <a href="http://www.jarvana.com/jarvana/view/joda-time/joda-time/1.5.1/joda-time-1.5.1-javadoc.jar!/org/joda/time/LocalDate.html" rel="noreferrer">LocalDate</a>s?</p>
<p>I want an object that represents, for example "from 1/1/2011 to 10/1/2011", without the time (or timezones) ever coming into the picture.</p>
<p>As far as I see, joda-time doesn't have anything built in for that.
If there doesn't exist anything for it, and we'd create it, what should it look like? Most importantly, which interfaces from joda-time could it implement to best integrate into the other types, staying consistent with the joda-time design?
Would it make sense for it to implement <code>ReadableInterval</code>, where <code>getStart</code> and <code>getEnd</code> return <code>DateMidnight</code>?</p>
| 0non-cybersec
|
Stackexchange
|
I hope this works with the new pistons.
| 0non-cybersec
|
Reddit
|
ar
X
iv
:1
20
9.
63
85
v1
[
q-
fi
n.
P
M
]
2
7
S
ep
2
01
2
Maximising Survival, Growth, and Goal Reaching Under
Borrowing Constraints
Haluk Yener ∗
Istanbul Bilgi University
Dept. of Business Administration, Santral Campus
34060, Eyup, Istanbul, TURKEY
This version: November 19, 2011
Keywords: Hamilton-Jacobi-Bellman Equations; Stochastic control; Dynamic Programming;
Portfolio selection; Martingale; Diffusion processes; Borrowing constraints; Proportional net
cash flow; Fictitious assets; Auxiliary Market.
MSCcodes: Primary: 93E20, 60H10, ; Secondary: 60G40, 60J60.
ORMScodes: Primary: Probability, Dynamic Programming/Optimal Control; Secondary: Fi-
nance.
Abstract
In this paper, we consider three problems related to survival, growth, and goal reaching
maximization of an investment portfolio with proportional net cash flow. We solve the
problems in a market constrained due to borrowing prohibition. To solve the problems, we
first construct an auxiliary market and then apply the dynamic programming approach. Via
our solutions, an alternative approach is introduced in order to solve the problems defined
under an auxiliary market.
1 Introduction.
The paper involves the application of stochastic modelling to portfolio optimization in an aux-
iliary market. Portfolio optimization is related to finding optimal investment strategies within
a portfolio composed of dynamically traded risky assets. The optimality of these strategies de-
pend on the specification of an objective function that is related to the aim of an investor and
to any possible constraints (i.e. investment, borrowing, and short-selling constraints) that may
exist in the market. The objective function, in turn, is generally given by a subjective utility
function and involves either the maximization or the minimization of it. By the application of
the dynamic programming or martingale approach, it is then possible to find the optimal results.
∗Email. [email protected]
1
http://arxiv.org/abs/1209.6385v1
In the continuous time finance literature, the dynamic programming approach to a general
class of utility functions was first applied by the pioneering work of Merton (1971). The applica-
tion of martingale approach, on the other hand, was introduced by Pliska (1986). Extensions to
both approaches involve vast amount of studies. Notable ones are the work of Davis and Norman
(1990), Zariphopoulou (1992), Shreve and Soner (1994), and Cvitanic and Karatzas (1996) on
optimal consumption and portfolio selection under transaction costs. The works of Fleming and Zariphopoulou
(1991), and Zariphopoulou (1994) involve optimal portfolio selection when borrowing rate is
higher than the lending rate and trading constraints respectively. Constraints on trading
are also considered by the works of Shreve and Xu (1990), Cvitanic and Karatzas (1992), and
Karatzas and Kou (1998). Furthermore,Cuoco and Cvitanic (1998) studies the optimal con-
sumption problem of a large investor whose actions affect the market. See Karatzas and Shreve
(1998) and Cvitanic (1997) for more details on the extensions.
In this paper, we add to the extensions by considering borrowing constraints for problems
concerning survival, growth, and goal reaching maximization in terms of probability, time, and
expected discounted reward. A previous application of these problems was done by Browne
(1999) to find the optimal investment strategies for outperforming a benchmark strategy. He
considered infinite time approach and the market is in a sense incomplete because the benchmark
satisfies a stochastic process that is not perfectly correlated with the investment opportunities.
Under this scenario, he first solves the probability maximization problem for beating a bench-
mark. After solving this problem, Browne finds the optimal investment strategy that minimises
the expected time to beat a benchmark. He also solves the time maximization problem for
staying above the lower boundary. Finally, Browne considers maximising or minimising the
expected discounted reward. The maximization is relevant when there is a reward for achieving
a goal and minimization is relevant when there is a penalty to pay.
In the current paper, the analysis of Browne (1999) is applied without considering any
benchmark process. In this form, the approach is a different version of the work by Browne
(1997) that solves the optimal investment strategy of an investor who is constantly withdrawing
money from an account. In that paper, Browne divides the investment region into two parts via
creating a boundary level from the perpetual value of the cash withdrawals. If the wealth level
is below the perpetual value, then, the investor is said to be in the danger zone because initial
cash value is not large enough to cover the perpetual withdrawals. As a result, she may go
into bankruptcy. Under this scenario, the goal of the investor is to find the optimal investment
strategy that maximises her survival. Browne shows that when in the danger zone there is no
optimal investment that eliminates the possibility of bankruptcy. On the other hand, if the
wealth level is above the perpetual cash withdrawals, the investor is said to be in the safe zone.
Then, bankruptcy will be avoided with certainty, and the investor will aim to find the strategy
that maximises the growth for reaching a goal.
The case considered in this paper differs from the one considered above, because it applies
a constant proportional net cash flow rate. In addition, the wealth process is formed under the
constrained market scenario. As mentioned previously constraints happen due to borrowing
prohibition. This is the case analysed by Bayraktar and Young (2007) for the minimization of
lifetime ruin. First, they consider the restriction of borrowing and short selling. Then, they
proceed to the problem where the investor is allowed to borrow money only at a rate that is
higher than the rate earned on the riskless rate. To this end, they consider, as in Young (2004)
2
(which only considers minimising the probability of lifetime ruin), constant consumption and
constant proportional consumption rate. The wealth portfolio consists of investment in a risky
and a riskless asset. They find the solution by rescaling the objective function. This work, on
the other hand, involves investment into multiple risky assets. In addition, an auxiliary market
is constructed and a dynamic programming approach is used in order to solve the problems.
Details on the use of an auxiliary market can also be seen in Karatzas and Shreve (1998) and
Cvitanic (1997). To solve the problems they consider a stochastic duality argument under the
martingale approach. Our approach, however, contributes to the literature by applying the
dynamic programming method to three problems related to survival, growth, and goal reaching.
In order to show the results, the assets and the model are introduced in section 2 first. Then,
the problems are solved. The first results are provided in section 3. There, the optimal value
function and the investment strategy for reaching a goal without first hitting a lower barrier
is found. Next, the solutions for maximising the time to survive and minimising the time to
achieve a goal are provided in section 4 . Finally, the solutions to the problem of maximising
and minimising the expected discounted reward are provided in section 5. In all problems, the
verifications are done by using a variation of the method in Björk (2004).
2 The Assets and The Model.
In this section we introduce the market model along with the processes and the financial assets
that we use to create an investor’s wealth process. We first give the background on the market
model, then, we complete the markets by creating an auxiliary market with fictitious assets.
We consider infinite time horizon and assume that the market is modelled under a filtered
probability space (Ω,F, {Ft}0≤t<∞,P). The market filtration is spanned by a N -dimensional
standard Brownian motion B(t) := (B1(t), . . . , BN (t); t < ∞) which is defined on our complete
probability space (Ω,F, {Ft}0≤t<∞,P). Here, P is the real measure and {Ft}0≤t<∞ is the P-
augmentation of the natural filtration FBt := σ{B(u) | u ≤ t}.
On the other hand, we assume that there is an investor who trades continuously in a Black-
Scholes type frictionless financial market. The traded assets are risky stocks and a riskless asset.
We denote the riskless asset by creating a bank account process of the form
dV0(t) = rV0(t)dt, (1)
where the riskless rate r is a constant. On the other hand, the stocks are given by
dSi(t) = Si(t)
µidt+
N
∑
j=1
σijdBj(t)
for i = 1, . . . , N, (2)
where µi and σij, for i, j = 1, . . . , N , are constants. Moreover, we assume that there is a net
cash flow process which is proportional to the wealth process. That is, the net cash flow amount
at time t is given by Cnet(t,Xw(t)) = cnetXw(t), where cnet is a negative constant that denotes
the net cash flow rate, and Xw(t) is the wealth process value at time t.
We express the wealth process by using a vector of control processesw(t) := (w1(t), . . . , wN (t))
′
that represents the proportions of wealth invested in the risky assets at time t. We call w(t) an
3
investment strategy and say that the strategy is admissible for a initial capital amount x, that
is w ∈ A(x), if w(t) is {Ft}-progressively measurable, satisfies
∫ t
0
‖w(s)‖2ds < ∞ almost surely
for t < ∞. Therefore, the self-financing wealth process associated to an admissible strategy is
the solution of the stochastic differential equation
dXw(t) = Xw(t)
[
(
r + cnet
)
dt+w
′
(t)(µ − r1N )dt+w
′
(t)σdB(t)
]
;
X(0) = x (3)
with 1N := (1, . . . , 1)
′
, µ := (µ1, . . . , µN )
′
, σ := (σ1, . . . , σN ) and σi := (σi1, . . . , σiN )
′
for
i = 1, . . . , N .
In order to solve the problem when borrowing is prohibited, we create an auxiliary market
as outlined in Karatzas and Shreve (1998). We let K 6= ∅, K ∈ RN be a closed convex set in
which the proportional investment strategies are constrained.
We denote by Ac(x) the set of admissible strategies of the constrained market, and define
for a given K, the support function of the convex set −K by
δ(ν) = sup
w∈K
(−w′ν), ν ∈ RN .
The support function is finite on its effective domain
K̃ := {ν ∈ RN | δ(ν) < ∞},
which is also the corresponding barrier cone of −K. We assume that K̃ contains the origin on
R
N , and set δ(ν) ≥ 0 ∀ν ∈ RN with δ(0) = 0. We also have δ(ν) +w′ν ≥ 0, ∀ν ∈ K̃ if and only
if w ∈ K.
Because we are considering borrowing prohibition as the constraint, we let δ(ν) = −ν1 on K̃
for some scalar ν1 ≤ 0, and define the constraint set by
K := {w ∈ RN |
N
∑
i=1
wi ≤ 1}.
Then, the corresponding barrier cone is
K̃ := {ν ∈ RN | ν1 = . . . = νN ≤ 0}.
Next, we express the assets of the auxiliary market by
dV0(t) = V0(t) (r + δ(ν)) dt; (4)
dSνi (t) = S
ν
i (t)
(µi + νi + δ(ν)) dt+
N
∑
j=1
σijdBj(t)
for i = 1, . . . , N. (5)
In this market, the wealth process is the solution of the stochastic differential equation for ν ∈ K̃
dXwν (t) = X
w
ν (t)
[
(
r + δ(ν) + cnet
)
dt+w
′
(t) (µ+ ν − r1N ) dt+w
′
(t)σdB(t)
]
. (6)
4
On the other hand, the market price of risk under the fictitious market is
ζν = σ
−1(µ+ ν − r1N )
= ζ + σ−1ν, ν ∈ K̃, (7)
where ζ = σ−1(µ− r1N ) is the market price of risk under the constrained market.
Finally, the generator of Xwν (·) for every open set O ∈ R, for functions Γν(x) ∈ C2(O), and
for every control process w ∈ RN is given for ν ∈ K̃ by
L
wΓν(x) =
(
(
r + δ(ν) + cnet
)
+w
′
(µ+ ν − r1N )
)
x
∂
∂x
Γν(x) +
1
2
w
′
Σwx2
∂2
∂x2
Γν(x). (8)
where Σ = σσ
′
. We also let Ex [·] = E [· | X(0) = x] throughout the text.
3 Maximising The Probability of Hitting a Target Before De-
fault.
In this subsection, we provide the formulation for the optimal value and the optimal strategy
for reaching a target level before hitting a default boundary. To do this, we start by expressing
for ν ∈ K̃ the drift and the volatility of the equation (6) by
m(x,w(x)) =
(
r + δ(ν) + cnet
)
x+w
′
(x) (µ+ ν − r1N )x;
v(x,w(x)) = w
′
(x)Σw(x)x2. (9)
We see that the wealth can diminish towards undesired levels due to the presence of a negative
net cash flow rate cnet. Especially, when r+ δ(ν) + cnet is negative the investor has to take risk
so that her wealth can be kept from falling into undesired levels. If the investor doesn’t take
any risk, her wealth process has the form
Xν(t) = xe
(r+δ(ν)+cnet)t.
However, when the term r+δ(ν)+cnet is negative, Xν(t) eventually approaches zero as the time
progresses.
In addition, if there is a target greater than x, it can only be reached without taking risk if
the term r+δ(ν)+cnet is positive. However, with r+δ(ν)+cnet < 0, reaching a target by staying
above an undesired level cannot solely be realised by simply investing in the bank account. In
this case, our investor must take risk and look for strategies that will increase her chances to hit
an upper barrier level without first hitting a lower barrier level. In other words, if the investor
manages to reach a target level U before hitting the default barrier L, for 0 < L < x < U , she
will realize her objective. To model the objective, we let
τwU = inf{t > 0 | Xwν (t) ≥ U}
be the first time the portfolio process crosses the upper barrier, and
τwL = inf{t > 0 | Xwν (t) ≤ L}
be the first time the portfolio process crosses the lower barrier.
5
Remark 3.1. By using the log-optimal strategy wo = σ
−1ζν for ν ∈ K̃ in the auxiliary market,
the wealth process of an investor can be expressed by
Xwoν (t) = x exp {βνt+ ζνB(t)} (10)
where
βν = (r + c
net + δ(ν)) +
1
2
‖ζν‖2. (11)
We name βν as the market favourability parameter. When βν < 0, we say that the markets
are unfavourable and when βν > 0 we say that the markets are favourable. Hitting the lower
barrier level L as the time passes is more likely under the unfavourable markets than it is under
the favourable markets. That is, the time is to the disadvantage of the investor in unfavourable
markets. To see it more clearly, we write
P (Xwoν (t) ≤ L) = Φ
(
ln
(
L
x
)
− βνt
√
‖ζν‖2t
)
(12)
where Φ(.) is the normal cdf. We see that P (Xwoν (t) ≤ L) → 1 as t → ∞ when βν < 0. On
the other hand, when the markets are favourable the situation is reversed and the time is to the
advantage of the investor.
As we see from the above remark, in an unfavourable market, we would expect the investor
to try harder in order to achieve her objective since the time is to her disadvantage. In any
case, she will always seek for strategies which will increase the probability that the first barrier
reached is the upper barrier. Therefore, the objective is given by
Fν(x) = sup
w∈Aν
Px (τ
w
U < τ
w
L ) , (13)
where Px (·) = P (· | X(0) = x) and Aν(x) is the set of admissible strategies in the auxiliary
market.
Remark 3.2. The goal of the investor is to find a strategy that maximises the probability of
hitting U without first hitting L. From the way we specified the problem, we had both stopping
times finite since the wealth process is expected to hit a barrier eventually. Log-optimal strategy
maximises the growth rate of the portfolio process. Another strategy will cause the growth rate
to decline. However, it might change the volatility of the portfolio in a way that leads to an
increase in the objective. But, this change will not make both stopping times infinite, since the
market conditions will dominate as the time goes on.
Remark 3.3. The specifications we provide hold for ν ∈ K̃. However, we need to find the
optimal fictitious parameter ν∗ so that the results of the constrained market can be specified as
well . As shown in the appendix, the specification for ν∗ is the one that minimises the value
function of the auxiliary market over all ν ∈ K̃. That is, we have
Fc(x) = Fν∗(x) = inf
ν∈K̃
Fν(x),
6
where Fc(x) is the optimal value function in the constrained market, and is given by
Fc(x) = sup
w∈Ac
Px (τ
w
U < τ
w
L ) (14)
Furthermore, as mentioned in the appendix, the above argument can also be utilised in other
problems considered in this paper.
Proposition 3.1. Let the wealth process {Xwν (t), 0 ≤ t < ∞} be the solution to the stochastic
differential equation given in (6). Let also ν∗1 be the minimizer of the term
1
2α
‖ζ + ν1σ−11N‖2 + ν1,
where α ∈ (−∞, 0) \ {−1} is1
α =
{
‖ζ‖2
2(r+cnet)
if − 1
α
1
′
Nwo < 1;
−2
(
K(r + cnet) +D
)
if − 1
α
1
′
Nwo ≥ 1.
(15)
Then, the optimal fictitious parameter is
ν∗ =
{
0N if − 1α1
′
Nwo < 1;
−α+D
K
1N if − 1α1
′
Nwo ≥ 1,
(16)
where 0N is the N -dimensional vector of zeros, D = ζ
′
σ−11N , K = 1
′
NΣ
−11N , and the optimal
value function is given by
Fν∗(x) =
L1+α − x1+α
L1+α − U1+α for x ∈ [L,U ] . (17)
Then, the optimal investment strategy for L < x < U is equal to
w
∗(x) =
{
− 1
α
wo if − 1α1
′
Nwo < 1;
− 1
α
(σ
′
)−1
(
ζ − α+D
K
σ−11N
)
if − 1
α
1
′
Nwo ≥ 1,
(18)
where wo = Σ
−1(µ − r1N ). Given the optimal investment strategy, the optimal wealth process
for t < τw
∗
L ∧ τw
∗
U is
X∗ν∗(t) =
X(0) exp
{
[
(r + cnet)
(
− 1
α
− 1
)]
t− 1
α
ζ
′
B(t)
}
if − 1
α
1
′
Nwo < 1;
X(0) exp
{
[
cnet + r + D
K
− 1
2K
]
t− 1
α
ζ
′
ν∗B(t)
}
if − 1
α
1
′
Nwo ≥ 1
(19)
with ζν∗ = ζ − α+DK σ
−11N .
1Notice that we state the cases by using the value of the optimal investment strategy given by the first line in
(18). That is, α in − 1
α
1
′
Nwo ≥ 1 is given by the first line of the specification (15).
7
From the results we see that when α = −1, the optimal strategy becomes log-optimal
strategy. For α > −1 (< −1) the investor takes more (less) risk than the log-optimal strategy.
On the other hand, we can see that the optimal investment strategy is a constant proportional
strategy that is independent of the current wealth level and the barriers L and U . However, it
is dependent on all other parameters of the model. Furthermore, the favourable case in the first
problem happens when α < −1, while the unfavourable case happens when −1 < α < 0. Thus,
under the unfavourable condition, the investor takes more risk to maximise the probability of
hitting a target before default.
Proof. We assume that Fν : [L,U ] → [0, 1] and Fν(x) is C2((L,U)) with ∂∂xFν > 0,
∂2
∂x2
Fν < 0
2.
Then, the HJB equation over all strategies is for ν ∈ K̃
(
r + cnet + δ(ν)
)
x
∂
∂x
Fν + sup
w
{
w
′
(µ+ ν − r1N )x
∂
∂x
Fν +
1
2
w
′
Σwx2
∂2
∂x2
Fν
}
= 0 (20)
subject to the boundary conditions Fν(U) = 1 and Fν(L) = 0. From (20), the maximizer w
∗
can be specified as
w
∗(x) = −(σ′)−1ζν
∂
∂x
Fν
x ∂
2
∂x2
Fν
. (21)
Substituting (21) into (20) gives the non-linear partial differential equation
(
r + cnet + δ(ν)
)
x
∂
∂x
Fν −
1
2
‖ζ + σ−1ν‖2
(
∂
∂x
Fν
)2
∂2
∂x2
Fν
= 0. (22)
Now, we guess a solution of the form A1 − A2x1+α with constants A1 and A2. By using the
boundary conditions, its specification can be given more explicitly by
Fν(x) =
L1+α − x1+α
L1+α − U1+α for x ∈ [L,U ] . (23)
Fν(x) is an increasing function of the wealth process X
w
ν (·). Therefore, ∀ν ∈ K̃, the inequality
Fν∗(x) ≤ Fν(x) holds. We proceed by substituting (23) into (22), and obtain
− (1 + α) x
1+α
L1+α − U1+α
[
(
r + cnet
)
− 1
2α
‖ζ + σ−1ν‖2 + δ(ν)
]
= 0. (24)
The optimal fictitious parameter is ν∗ = ν∗11N with ν
∗
1 minimising the term
1
2α
‖ζ + ν1σ−11N‖2 + ν1. (25)
From the above term we can find the values of ν∗1 as
ν∗1 =
{
0 if 1
′
Nw
∗(x) < 1;
−α+D
K
if 1
′
Nw
∗(x) ≥ 1,
(26)
2The arguments of the value functions are hidden in the rest of the paper when necessary to simplify the
notation.
8
where D = ζ
′
σ−11N and K = 1
′
NΣ1N . By using the term in the second case of (26), we obtain
− 1
2α
‖ζ + ν∗1σ−11N‖2 = −
α
2K
.
Then, the values of α are
α =
{
‖ζ‖2
2(r+cnet)
if 1
′
Nw
∗(x) < 1;
−2
(
K(r + cnet) +D
)
if 1
′
Nw
∗(x) ≥ 1,
(27)
and the maximizer is
w
∗(x) =
{
− 1
α
wo if − 1α1
′
Nwo < 1;
− 1
α
(σ
′
)−1
(
ζ − α+D
K
σ−11N
)
if − 1
α
1
′
Nwo ≥ 1.
(28)
Now, we verify that (23) and (28) are optimal. First, we check if w∗ ∈ K. We have when
− 1
α
1
′
Nwo ≥ 1
1
′
Nw
∗(x) = − 1
α
1
′
N (σ
′
)−1
(
ζ − α+D
K
σ−11N
)
= − 1
α
(D − α+D) = 1.
In addition, when − 1
α
1
′
Nwo < 1, we have ν
∗ = 0 giving us the first term in (28). Therefore,
w
∗ ∈ K. For such w∗, we have
−ν∗1 + 1
′
Nw
∗ν∗1 = 0.
From the above result, we see that ν∗ ∈ K̃. On the other hand, we see that Fν∗ : [L,U ] → [0, 1]
and Fν∗(x) is C
2((L,U)). Remember that we assumed cnet + r + δ(ν) < 0 ∀ν ∈ K̃. Therefore,
when the value of ν∗ is given by (26), we have −r > cnet > −D
K
− r and, consequently, α < 0.
This, in turn, gives ∂
∂x
Fν∗ > 0,
∂2
∂x2
Fν∗ < 0.
Next, we substitute the maximizer into the wealth process. As a result, we obtain, after rear-
ranging the terms, for t < τw
∗
L ∧ τw
∗
U
X∗ν∗(t) =
X(0) exp
{
[
(r + cnet)
(
− 1
α
− 1
)]
t− 1
α
ζ
′
B(t)
}
if − 1
α
1
′
Nwo < 1;
X(0) exp
{
[
cnet + r + D
K
− 1
2K
]
t− 1
α
ζ
′
ν∗B(t)
}
if − 1
α
1
′
Nwo ≥ 1.
(29)
Notice that the value of α is different based on the value of the investment strategy. As we
showed previously, we have
α =
{
‖ζ‖2
2(r+cnet)
if − 1
α
1
′
Nwo < 1;
−2(K(r + cnet) +D) if − 1
α
1
′
Nwo ≥ 1.
(30)
By using (29) we write
P (X∗ν∗(t) ≥ U) =
Φ
(
ln( x
U
)+[(r+cnet)(− 1
α
−1)]t
√
1
α2
‖ζ‖2t
)
if − 1
α
1
′
Nwo < 1;
Φ
(
ln( x
U
)+[cnet+r+D
K
− 1
2K
]t
√
1
α2
‖ζν∗‖
2t
)
if − 1
α
1
′
Nwo ≥ 1.
(31)
9
When − 1
α
1
′
Nwo < 1, the drift of the stochastic differential equation corresponding to Xν∗(·)
is positive if α < −1. Then, P (X∗ν∗(t) ≥ U) → 1 as t → ∞, and when −1 < α < 0,
P (X∗ν∗(t) ≥ U) → 0 as t → ∞. The same arguments hold for the term in the second case
as well. That is, since we are considering the case − 1
α
1
′
Nwo ≥ 1, the value of α is equal
to −2(K(r + cnet) + D). If α < −1, then −2(K(r + cnet) + D). This in turn implies that
cnet + r + D
K
− 1
2K
< 0. Therefore, the drift of the term in the second case of (31) is negative.
On the other hand, when −1 < α < 0 the drift of . As a result, we have τw∗U < ∞ or τw
∗
L < ∞
almost surely. Then, we can write
∫ τw
∗
L
∧τw
∗
U
0
‖w∗(X∗ν∗(s))‖2ds =
{
1
α2
‖wo‖2(τw
∗
L ∧ τw
∗
U ) < ∞ if − 1α1
′
Nwo < 1;
1
K
Σ−1(τw
∗
L ∧ τw
∗
U ) < ∞ if − 1α1
′
Nwo ≥ 1
(32)
almost surely, giving us w∗ ∈ Ac(x). Next, we fix a point x ∈ (0, L) and introduce
τ∗ = τwL ∧ τwU
along with
τwn = τ
∗ ∧ inf{t > 0 |
∫ t
0
‖w(Xwν∗(s))‖2ds = n} for n ∈ N.
Then, we choose an arbitrary strategy w ∈ Ac(x), and from Itô’s formula we write by inserting
Xwν∗(·) into the function Fν∗
Fν∗ (X
w
ν∗(τ
w
n )) = Fν∗ (x)+
∫ τw
n
0
{LwFν∗ (Xwν∗(s))}ds+
∫ τw
n
0
Xwν∗(s)w
′
(Xwν∗(s))σ
∂Fν∗
∂x
(Xwν∗(s))dB(s).
(33)
When we take the expectation of the above term, the stochastic integral vanishes. We can see
this by substituting the value function in (23) to the following:
Ex
[
∫ τw
n
0
∥
∥
∥
∥
Xwν∗(s)w
′
(Xwν∗(s))σ
∂Fν∗
∂x
(Xwν∗(s))
∥
∥
∥
∥
2
ds
]
≤ Σ(1 + α)2 U
2α+2
(L1+α − U1+α)2Ex
[
∫ τwn
0
‖w′(Xwν∗(s))‖2ds
]
≤ Σ(1 + α)2 U
2α+2
(L1+α − U1+α)2n < ∞. (34)
On the other hand, notice that the function Fν∗(x) solves the HJB equation. Thus, we have,
∀w ∈ RN and for each s and P-a.s., the inequality
{LwFν∗ (Xwν∗(s))} ≤ 0. (35)
From (34) and (35), we obtain the inequality
Fν∗ (x) ≥ Ex [Fν∗ (Xwν∗(τwn ))] . (36)
10
Notice that Fν∗(x) is a probability function. That is, Fν∗(x) ∈ [0, 1] for x ∈ [L,U ]. In addition,
we have as n → ∞, τwn → τ∗. Therefore, from the dominated convergence theorem, we have as
n → ∞
Ex [Fν∗ (X
w
ν∗(τ
w
n ))] → Ex [Fν∗ (Xwν∗(τ∗))] .
We can then write the inequality
Fν∗ (x) ≥ Ex [Fν∗ (Xwν∗(τ∗))]
= Px (τ
w
U < τ
w
L ) , (37)
where we used the boundary conditions for the last line. When we take the supremum over
admissible strategies, we have
Fν∗ (x) ≥ sup
w∈Ac
Px (τ
w
U < τ
w
L ) = Fν∗ (x) ,
showing us that w∗(x) is the optimal portfolio strategy, X∗ν∗(t) is the optimal wealth process,
and Fν∗(x) is the optimal value function. In fact, with w
∗(X∗ν∗(s)) the supremum of the term
{LwF (Xwν∗(s))} is attained. In addition, we can show as we did in (34) that the stochastic
integral vanishes. Then, the inequality in (36) becomes an equality and the results follow
similarly proving the optimality of the results. �
4 Maximising/Minimising The Expected Time.
In addition to the strategy that maximises the probability of hitting a target, the investor may
follow a strategy that maximises the time to hit the lower barrier L when U = ∞, or minimises
the time to reach the upper barrier U when L = 0.
We know that the log-optimal growth strategy is the strategy that maximises the drift value
of the investor’s portfolio process. Then, by investing more or less than the log-optimal amount,
an investor can have the chance to increase the probability of hitting an upper barrier U without
first hitting the lower barrier L. However, we wonder whether an investor can also maximise the
time to survive or minimise the time to achieve a goal by investing in amounts different than
the log-optimal strategy. To this end, we define the objective to maximise the time to hit the
lower boundary L with
Fν(x) = sup
w∈Aν
Ex [τ
w
L ]
and the objective to minimise the time to reach the upper boundary U with
F̄ν(x) = inf
w∈Aν
Ex [τ
w
U ]
Proposition 4.1. Let βν ∈ R\{0} be given by (11) and the portfolio process {Xwν (t), 0 ≤ t < ∞}
be the solution to the stochastic differential equation given in (6). Let also the optimal fictitious
parameter be given by ν∗ = ν∗11N , and ν
∗
1 minimises
1
2
‖ζ + ν1σ−11N‖2 − ν1,
11
and is equal to3
ν∗ =
{
0N if D < 1;
1−D
K
1N if D ≥ 1
(38)
with D = ζ
′
σ−11N , K = 1
′
NΣ
−11N . Then, βν∗ is
βν∗ =
{
r + cnet +
‖ζ‖2
2
if D < 1;
r + cnet − 1
2K
+ D
K
if D ≥ 1.
(39)
(i) Suppose that βν∗ < 0. Then, the optimal value function for this problem is given by
Fν∗ (x) =
1
|βν∗ |
ln
(x
L
)
for x ∈ [L,∞). (40)
(ii) Next, suppose that βν∗ > 0. Then, the optimal value function for this problem is given by
F̄ν∗ (x) =
1
βν∗
ln
(
U
x
)
for x ∈ (0, U ] . (41)
The optimal investment strategy in both cases when L < x < U is
w
∗(x) =
{
wo if D < 1;
(σ
′
)−1
(
ζ + 1−D
K
σ−11N
)
if D ≥ 1,
(42)
and the optimal wealth process satisfies for t < τw
∗
L ∧ τw
∗
U
X∗ν∗(t) =
X(0) exp
{
βν∗t+ ζ
′
B(t)
}
if D < 1;
X(0) exp
{
βν∗t+ ζ
′
ν∗B(t)
}
if D ≥ 1,
(43)
with ζν∗ = ζ +
1−D
K
σ−11N .
We see that the log-optimal strategy is optimal for maximising the survival time and for
minimising the time to reach a goal. As explained in Browne (1999) this is due to the fact that the
optimal growth strategy is the strategy that maximises the mean rate of return of the investment
portfolio. This, in turn, maximises the compounding rate and lead to the minimization of
reaching a goal and to the maximization of survival. However, the existence of the results depend
on the sign of the favourability parameter βν∗ . Notice that when βν∗ < 0 (unfavourable), log-
optimal strategy is the investment strategy that maximises survival. On the other hand, when
βν∗ > 0 (favourable), log-optimal strategy is the investment strategy that minimises the time to
reach a goal.
3We use D when specifying the cases. Notice that by the definition of D we have ζ
′
σ
−11N = w
′
o1N . Therefore,
D < 1 is equivalent to w
′
o1N .
12
Remark 4.1. Given the specification of α in (15), we are in the favourable market when α < −1,
and in the unfavourable market when −1 < α < 0. Therefore, under the unfavourable condition
the investor takes more risk to maximise the probability of hitting a target before default compared
to the risk that she takes to maximise the expected time to hit the lower boundary. The situation is
reversed when the conditions are favourable. That is, the investor takes less risk to minimise the
probability of ruin than the risk she takes to achieve a goal. These claims are equivalent to those
given in Browne (1999) for benchmarked strategies; in unfavourable games bold play maximises
the probability of success and timid play maximises the expected time to play. However, in
favourable games timid play minimises the probability of ruin and bold play minimises the time
to achieve a goal.
Proof. We let Fν(x) be the function given by (40) with ν instead of ν
∗. We see that Fν(x) is
continuous on [L,∞) and a C2 ((L,∞)) function with ∂
∂x
Fν > 0,
∂2
∂x2
Fν < 0. In addition, it
satisfies the boundary condition Fν(L) = 0. Then, the HJB equation over all strategies is for
ν ∈ K̃
1 +
(
r + cnet + δ(ν)
)
x
∂
∂x
Fν + sup
w
{
w
′
(µ + ν − r1N )x
∂
∂x
Fν +
1
2
w
′
Σwx2
∂2
∂x2
Fν
}
= 0. (44)
By using (44), we give the maximising w∗ by
w
∗(x) = −(σ′)−1ζν
∂
∂x
Fν
x ∂
2
∂x2
Fν
. (45)
After substituting (44) into (45), we get the non-linear partial differential equation
1 +
(
r + cnet + δ(ν)
)
x
∂
∂x
Fν −
1
2
‖ζ + σ−1ν‖2
(
∂
∂x
Fν
)2
∂2
∂x2
Fν
= 0. (46)
When we substitute the value function Fν(x) into (46), we observe that the equality is satisfied.
Then, the maximizer is given by
w
∗(x) =
{
wo if D < 1;
(σ
′
)−1ζν if D ≥ 1.
(47)
Next, we write by the application of Itô’s formula
Fν(X
w
ν (t)) = Fν(X(0)) − t−
1
βν
w
′
oσB(t) when t ≤ τwL . (48)
Notice that βν is an increasing function of ν. Therefore, ν
∗ is the minimizer for (48) because
Fν∗(x) ≤ Fν(x) ∀ν ∈ K̃. As a result, we find the optimal fictitious parameter by minimising βν .
In other words, we aim to find ν∗ = ν∗11N that minimises the term
1
2
‖ζ + ν1σ−11N‖2 − ν1.
13
So ν∗1 is given by
ν∗1 =
{
0 if D < 1;
1−D
K
if D ≥ 1.
(49)
When we substitute (1−D)/K into ‖ζ + ν1σ−11N‖2, we have
1
2
‖ζ + 1−D
K
σ−11N‖2 =
1
2K
.
Therefore, the favourability parameter βν∗ under the constrained market scenario is given by
(39), and the maximizer is specified as
w
∗(x) =
{
wo if D < 1;
(σ
′
)−1
(
ζ + 1−D
K
σ−11N
)
if D ≥ 1.
(50)
Next, we verify that (40) is the optimal value function, and (50) is the optimal investment
strategy. To do this, we first check if w∗ ∈ K. We have, when D ≥ 1
1
′
Nw
∗(x) = 1
′
N (σ
′
)−1
(
ζ +
1−D
K
σ−11N
)
= D + 1−D = 1. (51)
The maximising strategy is wo when D < 1. Thus, w
∗ ∈ K. Then, we can see that −ν∗1 +
1
′
Nw
∗ν∗1 = 0, giving us ν
∗ ∈ K̃. On the other hand, when the maximizer is substituted into the
wealth process, we obtain
X∗ν∗(t) =
X(0) exp
{
βν∗t+ ζ
′
B(t)
}
if D < 1;
X(0) exp
{
βν∗t+ ζ
′
ν∗B(t)
}
if D ≥ 1,
(52)
where βν∗ is given by
βν∗ =
{
r + cnet +
‖ζ‖2
2
if D < 1;
r + cnet − 1
2K
+ D
K
if D ≥ 1.
(53)
We are in unfavourable markets. Therefore, βν∗ < 0 and P(X
∗
ν∗(t) ≥ L) → 0 as t → ∞. This
gives τw
∗
L < ∞ almost surely. It follows that
∫ τw
∗
L
0
‖w∗(X∗ν∗(s))‖2ds =
{
‖wo‖2τw
∗
L < ∞ if D < 1;
1
K
Σ−1τw
∗
L < ∞ if D ≥ 1
(54)
almost surely. As a result, w∗ ∈ Ac(x). Next, we fix x ∈ (L,∞) and introduce the function
Mν∗ (t,X
w
ν∗(t)) = Fν∗ (X
w
ν∗(t)) + t (55)
along with the stopping time
τwn = τ
w
L ∧ inf{t > 0 |
∫ t
0
‖w(Xwν∗(s))‖2ds = n} for n ∈ N
14
Then, we choose an arbitrary strategy w ∈ Ac(x), and from Itô’s formula we write by inserting
Xwν∗(·) into the function Fν∗
Mν∗ (τ
w
n ,X
w
ν∗(τ
w
n )) = Fν∗ (x) + τ
w
n +
∫ τwn
0
{LwFν∗ (Xwν∗(s))}ds
+
∫ τwn
0
Xwν∗(s)w
′
(Xwν∗(s))σ
∂Fν∗
∂x
(Xwν∗(s))dB(s).
(56)
When the expectation of the above terms is taken, the stochastic integral vanishes. This can be
observed by using the value function Fν∗(X
w
ν∗(t)) in the following:
Ex
[
∫ τw
n
0
∥
∥
∥
∥
Xwν∗(s)w
′
(Xwν∗(s))σ
∂Fν∗
∂x
(Xwν∗(s))
∥
∥
∥
∥
2
ds
]
≤ Σ 1
β2ν∗
Ex
[
∫ τw
n
0
∥
∥
∥
w
′
(Xwν∗(s))
∥
∥
∥
2
ds
]
≤ Σ 1
β2ν∗
n < ∞. (57)
We know that Fν∗ (x) solves the HJB equation. Then, ∀w ∈ RN , we have for each s and P-a.s.
1 + LwFν∗ (X
w
ν∗(s)) ≤ 0. (58)
By using (57) and (58), we obtain the inequality
Fν∗ (x) ≥ Ex [Mν∗ (τwn ,Xwν∗(τwn ))] . (59)
We have Fν∗ (x) ≤ 1|βν∗ | ln(x/L) + C < ∞ for some constant C ≥ 0. In addition, observe that as
n → ∞, τwn → τwL . Therefore, from the dominated convergence theorem, we have as n → ∞
Ex [Mν∗ (τ
w
n ,X
w
ν∗(τ
w
n ))] → Ex [Mν∗ (τwL ,Xwν∗(τwL ))] .
Thus, the inequality in (59) becomes
Fν∗ (x) ≥ Ex [Mν∗ (τwL ,Xwν∗(τwL ))]
= Ex [τ
w
L ] . (60)
When the supremum is taken over all admissible strategies we obtain
Fν∗ (x) ≥ sup
w∈Ac
Ex [τ
w
L ] = Fν∗ (x) .
In fact, when the maximising strategy w∗(X∗ν∗(s)) is chosen, we have for each s and P-a.s.
1 + Lw
∗
Fν∗ (X
∗
ν∗(s)) = 0 (61)
15
In addition, we can show similarly as we did in (57) that the stochastic integral vanishes with
w
∗(X∗ν∗(s)). Thus, the inequality in (59) becomes an equality and we obtain
Fν∗ (x) = Ex
[
τw
∗
L
]
(62)
showing that w∗(x) is the optimal strategy, X∗ν∗(t) is the optimal wealth process, and Fν∗(x) is
the optimal value function.
Notice that the minimization problem can be written as F̄ (x) = − sup
w∈A E [−τwU | X(0) = x].
Then, we can apply the approach of the maximization problem to the function F̂ (x) = −F̄ (x)
for the proof of the results. �
5 Maximising and Minimising The Expected Discounted Re-
ward.
In the previous sections we aimed to find the optimal investment strategies that maximise the
probability of hitting an upper barrier before default and strategies that either maximise the
time to hit the lower barrier or minimise the time to reach the upper barrier. This section
is related to finding the optimal investment strategy of an investor expecting a cash inflow or
outflow in the future when her wealth reaches a certain level. For example, when the wealth
of the investor reaches an upper level U she may be paid a fixed amount. In this case, the
investor will seek to invest optimally in order to maximise the discounted value of the amount
that she expects to receive when U is reached. On the other hand, the minimization problem
is related to the penalty that the investor is supposed to pay when her wealth level will reach
a lower boundary L. In this case, the investor would seek to find a strategy that minimises the
expected discounted value of the penalty she is expected to pay when the wealth level hits the
lower barrier L.
Given the aims of the investor above, we define the objective to maximise the expected
discounted reward from reaching the upper barrier by
Ḡν(x) = sup
w∈Aν
Ex
[
e−ρτ
w
U
]
,
where ρ > 0 is the constant discount rate. On the other hand, the objective to minimise the
expected discounted reward from hitting the lower barrier is defined by
Gν(x) = inf
w∈Aν
Ex
[
e−ρτ
w
L
]
.
We then present our solutions in the next proposition.
Proposition 5.1. Let the portfolio process {Xwν (t), 0 ≤ t < ∞} be the solution to the stochastic
differential equation given in (6). Let also ν∗1 be the minimizer of the term
d
2(d + 1)
‖ζ + ν1σ−11N‖2 − dν1.
16
(i) For the maximization problem, the optimal fictitious parameter is4
ν∗ =
{
0N if
1
1+d−
1
′
Nwo < 1;
d−+1−D
K
1N if
1
1+d−
1
′
Nwo ≥ 1
(63)
with D = ζ
′
σ−11N , K = 1
′
NΣ
−11N , and −1 < d− < 0 is given by, for k = ‖ζ‖2/2,
d− =
1
2(r+cnet)
[
−
(
r + cnet + k + ρ
)
+
√
(r + cnet + k + ρ)
2 − 4(r + cnet)ρ
]
if 1
1+d−
1
′
Nwo < 1;
1
2
[
−
[
1− 2
(
K(r + cnet) +D
)]
−
√
[1− 2 (K(r + cnet) +D)]2 + 8Kρ
]
if 1
1+d−
1
′
Nwo ≥ 1,
(64)
If r + cnet + D
K
− 1
2K
> 0 and the condition
[
(
r + cnet
)
+
‖ζ‖2
1 + d−
(
1− 1
2(1 + d−)
)]
> 0 (65)
holds then, we are in the favourable markets, and the optimal value function is equal to
Ḡν∗(x) =
( x
U
)−d−
for x ∈ [0, U ] . (66)
Furthermore, the optimal investment strategy for 0 < x < U is
w
∗(x) =
{
1
1+d−
wo if
1
1+d−
1
′
Nwo < 1;
1
1+d−
(σ
′
)−1
(
ζ + d
−+1−D
K
σ−11N
)
if 1
1+d−
1
′
Nwo ≥ 1,
(67)
and the optimal wealth process for t < τw
∗
U is
X∗ν∗(t) =
X(0) exp
{[
(
r + cnet
)
+
‖ζ‖2
1+d−
(
1− 1
2(1+d−)
)]
t+ 1
1+d−
ζ
′
B(t)
}
if 1
1+d−
1
′
Nwo < 1;
X(0) exp
{
βν∗t+
1
1+d−
ζ
′
ν∗B(t)
}
if 1
1+d−
1
′
Nwo ≥ 1
(68)
with ζν∗ = ζ +
d−+1−D
K
σ−11N .
(ii) For the minimization problem, we consider the unfavourable markets. Thus, βν < 0 ∀ν ∈ K̃.
In this case, the optimal fictitious parameter is
ν∗ =
{
0N if
1
1+d−
1
′
Nwo < 1;
d++1−D
K
1N if
1
1+d+
1
′
Nwo ≥ 1,
(69)
where d+ > 0 is given by
d+ =
1
2(r+cnet)
[
−
(
r + cnet + k + ρ
)
−
√
(r + cnet + k + ρ)
2 − 4(r + cnet)ρ
]
if 1
1+d+
1
′
Nwo < 1;
1
2
[
−
[
1− 2
(
K(r + cnet) +D
)]
+
√
[1− 2 (K(r + cnet) +D)]2 + 8Kρ
]
if 1
1+d+
1
′
Nwo ≥ 1,
(70)
4As in the first problem, we state the cases by using the value of the optimal investment strategy given by the
first line in (67). That is, d− in 1
1+d−
1
′
Nwo ≥ 1 is given by the first line of (64). The same argument holds for
the minimization problem as well.
17
Then, the optimal value function is equal to
Gν∗(x) =
(x
L
)−d+
for x ∈ [L,∞) . (71)
Furthermore, the optimal investment strategy satisfies for L < x < ∞
w
∗(x) =
{
1
1+d+
wo if
1
1+d+
1
′
Nwo < 1;
1
1+d+
(σ
′
)−1
(
ζ + d
++1−D
K
σ−11N
)
if 1
1+d+
1
′
Nwo ≥ 1,
(72)
and the optimal wealth process t < τw
∗
L is
X∗ν∗(t) =
X(0) exp
{[
(
r + cnet
)
+
‖ζ‖2
1+d+
(
1− 1
2(1+d+)
)]
t+ 1
1+d+
ζ
′
B(t)
}
if 1
1+d+
1
′
Nwo < 1;
X(0) exp
{
βν∗t+
1
1+d+
ζ
′
ν∗B(t)
}
if 1
1+d+
1
′
Nwo ≥ 1
(73)
with ζν∗ = ζ +
d++1−D
K
1Nσ
−11N .
Here as well, the optimal investment strategies are independent of the current wealth level
and the barriers U and L. As in the first problem, it is proportional to the log-optimal investment
strategy. In addition, we observe that the reward maximization happens in the favourable
markets and the penalty minimization happens in the unfavourable one. That is, under the
favourable market an investor can find a reward maximising strategy. However, under the
unfavourable market, the same investor should look for penalty minimising strategies instead.
Therefore, when the markets are favourable there is no penalty to pay and when unfavourable
there is no reward to gain.
Furthermore, because −1 < d− < 0 and we are in the favourable market, we see that the
investor takes more risk than she would with the log-optimal strategy when maximising the
expected discounted reward. The situation is different under the minimization problem since
d+ > 0, and we are in unfavourable market. In this case, the investor takes less risk in order
to diminish the expected discounted value of the penalty. Therefore, in favourable games bold
play maximises the reward and in unfavourable games timid play minimises the penalty.
Proof. We start by assuming that Ḡν : [0, U ] → [0, 1] and Ḡν(x) is C2((0, U)) with ∂∂xḠν > 0,
∂2
∂x2
Ḡν < 0. Then, the HJB equation over all strategies is for ν ∈ K̃
−ρḠν+
(
r + cnet + δ(ν)
)
x
∂
∂x
Ḡν+sup
w
{
w
′
(µ + ν − r1N )x
∂
∂x
Ḡν +
1
2
w
′
Σwx2
∂2
∂x2
Ḡν
}
= 0 (74)
subject to the boundary condition Ḡν(U) = 1. From (74), we find the maximizer w
∗ as
w
∗(x) = −(σ′)−1ζν
∂
∂x
Ḡν
x ∂
2
∂x2
Ḡν
. (75)
By substituting (75) into (74), we obtain the non-linear partial differential equation
− ρḠν +
(
r + cnet + δ(ν)
)
x
∂
∂x
Ḡν −
1
2
‖ζ + σ−1ν‖2
(
∂
∂x
Ḡν
)2
∂2
∂x2
Ḡν
= 0. (76)
18
To solve the above equation we use a solution of the form Ax−d where A is a constant. By
substituting this function into (76) we obtain
Ax−d
(
ρ+
(
r + cnet
)
d+
[
d
2(d + 1)
‖ζ + σ−1ν‖2 + dδ(ν)
])
= 0. (77)
The optimal fictitious parameter is ν∗ = ν∗11N , where ν
∗
1 is the minimizer of the term
d
2(d + 1)
‖ζ + ν1σ−11N‖2 − dν1. (78)
Then, the values of ν∗1 are
ν∗1 =
{
0 if 1
′
Nw
∗(x) < 1;
d+1−D
K
if 1
′
Nw
∗(x) ≥ 1.
(79)
Furthermore,
‖ζ + ν∗1σ−11N‖2 =
(d+ 1)2
K
.
By substituting the values in (79) and the above into (77), we find the quadratic equations as
d2
(
r + cnet
)
+ d
[
r + cnet + k + ρ
]
+ ρ = 0 if 1
′
Nw
∗(x) < 1;
d2 + d
[
1− 2
(
K(r + cnet) +D
)]
− 2Kρ = 0 if 1′Nw∗(x) ≥ 1. (80)
The quadratic equations have two roots; d+ and d−. Therefore, the equation (77) admits two
solutions A1x
−d+ and A2x
−d− , where A1, A2 are two constants. The roots are given by
d+ =
{
1
2(r+cnet)
[
−
(
r + cnet + k + ρ
)
−
√
∆
]
if 1
′
Nw
∗(x) < 1;
1
2
[
−
[
1− 2
(
K(r + cnet) +D
)]
+
√
∆b
]
if 1
′
Nw
∗(x) ≥ 1,
(81)
and
d− =
{
1
2(r+cnet)
[
−
(
r + cnet + k + ρ
)
+
√
∆
]
if 1
′
Nw
∗(x) < 1;
1
2
[
−
[
1− 2
(
K(r + cnet) +D
)]
−
√
∆b
]
if 1
′
Nw
∗(x) ≥ 1,
(82)
where the discriminants are given by
∆ =
(
r + cnet + k + ρ
)2 − 4(r + cnet)ρ; (83)
∆b =
[
1− 2
(
K(r + cnet) +D
)]2
+ 8Kρ. (84)
We can check that d+d− < 0. Therefore, the signs of the roots are different. We have d− < 0.
In order to use it for the maximization problem, we need to check that d− > −1. We can
see from the first term in (82) that this is the case. On the other hand, we assumed that
r + δ(ν) + cnet < 0. By substituting the value of ν∗1 given in the second line of (79) into the
aforementioned assumption and using cnet > −(r+D/K) from the first problem5 we can confirm
5Remember that α ∈ (−∞, 0) \ −1 and α = −2(K(r + cnet) + D) when − 1
α
1
′
Nwo ≥ 1. It follows that
c
net
> −
(
r + D
K
)
.
19
that the value of d− given by the second term in (82) is larger than −1 as well. Therefore, the
value function for the maximization problem can be specified as
Ḡν∗(x) =
( x
U
)−d−
Notice that Ḡν∗(x) ≤ Ḡν(x) ∀ν ∈ K̃, confirming the minimization of the term (78) in order to
find ν∗. Then, we write the maximising strategy as
w
∗(x) =
{
1
1+d−
wo if
1
1+d−
1
′
Nwo < 1;
1
1+d−
(σ
′
)−1
(
ζ + d
−+1−D
K
σ−11N
)
if 1
1+d−
1
′
Nwo ≥ 1.
(85)
Now, we show that the above results are optimal. First, we check if w∗ ∈ K. We start by
specifying when 1
1+d−
1
′
Nwo ≥ 1
1
′
Nw
∗(x) = 1
′
N
1
1 + d−
(σ
′
)−1
(
ζ +
d− + 1−D
K
σ−11N
)
=
1
1 + d−
(
D + d− + 1−D
)
= 1. (86)
On the other hand, when 1
1+d−
1
′
Nwo < 1, we have the first term in (85) with ν
∗ = 0. Therefore,
w
∗ ∈ K. For such w∗ we can write
δ(ν∗) + 1
′
Nw
∗ν∗1 = 0,
making ν∗ ∈ K̃. Next, we see that Ḡν∗(x) is continuous on [0, U ] and is a C2((0, U)) function.
In addition the boundary condition Ḡν∗(U) = 1 is satisfied as well. We have already shown that
−1 < d− < 0, and that ∂
∂x
Ḡν∗ > 0,
∂2
∂x2
Ḡν∗ < 0. Then, by substituting the maximizer into the
wealth process we obtain for t < τw
∗
U
X∗ν∗(t) =
X(0) exp
{[
(
r + cnet
)
+
‖ζ‖2
1+d−
(
1− 1
2(1+d−)
)]
t+ 1
1+d−
ζ
′
B(t)
}
if 1
1+d−
1
′
Nwo < 1;
X(0) exp
{
βν∗t+
1
1+d−
ζ
′
ν∗B(t)
}
if 1
1+d−
1
′
Nwo ≥ 1.
(87)
When the condition (65) holds and βν∗ > 0, the drift of X
∗
ν∗(·) is positive. Especially, by using
the condition (65), we see for the first term in (87) that
r + cnet > − ‖ζ‖
2
1 + d−
(
1− 1
2(1 + d−)
)
> −‖ζ‖
2
2
.
Therefore, the markets are favourable and P (X∗ν∗(t) ≥ U) → 1 as t → ∞. This, in turn gives
τw
∗
U < ∞ almost surely. It follows that
∫ τw
∗
U
∧τw
∗
0
0
‖w∗(X∗ν∗(s))‖2ds =
{
1
(1+d−)2
‖wo‖2τw
∗
U < ∞ if 11+d− 1
′
Nwo < 1;
1
K
Σ−1τw
∗
U < ∞ if 11+d− 1
′
Nwo ≥ 1
(88)
20
almost surely. This gives w∗ ∈ Ac(x) for the maximization problem. Next, we introduce the
function
Mν∗ (t,X
w
ν∗(t)) = e
−ρtḠ (Xwν∗(t)) . (89)
Then, we define the stopping time
τwn = τ
w
U ∧ inf{t > 0 |
∫ t
0
‖w(Xwν∗(s))‖2ds = n} for n ∈ N,
and fix x ∈ (0, U). We choose a strategy w ∈ Ac(x) and write by Itô’s formula
Mν∗ (τ
w
n ,X
w
ν∗(τ
w
n )) = Ḡν∗ (x) +
∫ τwn
0
e−ρs{−ρḠν∗ (Xwν∗(s)) + LwḠν∗ (Xwν∗(s))}ds
+
∫ τwn
0
Xwν∗(s)w
′
(Xwν∗(s))σ
∂Ḡν∗
∂x
(Xwν∗(s)) dB(s).
(90)
By using the value function Ḡν∗ (X
w
ν∗(s)) we can show that the stochastic integral above vanishes
when its expectation is taken. That is, we have
Ex
[
∫ τw
n
0
‖Xwν∗(s)w
′
(Xwν∗(s))σ
∂Ḡν∗
∂x
(Xwν∗(s)) ‖2ds
]
≤ Σ(−d−)2n < ∞. (91)
On the other hand, because Ḡν∗(x) solves the HJB equation, we have ∀w ∈ RN , and for each s
and P-a.s., the inequality
− ρḠν∗ (Xwν∗(s)) + LwḠν∗ (Xwν∗(s)) ≤ 0. (92)
As a result, we obtain the inequality
Ḡν∗ (x) ≥ Ex [Mν∗ (τwn ,Xwν∗(τwn ))] . (93)
Because Ḡν∗(x) ∈ [0, 1] and τwn → τwU as n → ∞, from the dominated convergence theorem, we
have as n → ∞
Ex [Mν∗(τ
w
n ,X
w
ν∗(τ
w
n ))] → Ex [Mν∗(τwU ,Xwν∗(τwU ))] .
Thus, the inequality in (93) becomes
Ḡν∗ (x) ≥ Ex [Mν∗ (τwU ,Xwν∗(τwU ))] . (94)
We have Ḡν∗(U) = 1. Therefore, we write from (94)
Ḡν∗(x) ≥ Ex [Mν∗ (τwU ,Xwν∗(τwU ))]
= Ex
[
e−ρτ
w
U
]
. (95)
When we take the supremum over admissible strategies, we have
Ḡν∗ (x) ≥ sup
w∈Ac
Ex
[
e−ρτ
w
U
]
= Ḡν∗ (x) .
21
Therefore, w∗(x) is the optimal portfolio strategy, X∗ν∗(t) is the optimal wealth process, and
Ḡν∗(x) is the optimal value function. In fact, when we choose the strategy w
∗(X∗ν∗(t)), we can
see from (91) that the stochastic integral vanishes, the inequality in (92) becomes an equality
making (93) equal and showing the optimality of our results again.
For the minimization problem we write G(x) = − sup
w∈Aν
Ex
[
−e−ρτwL
]
. Then, we apply the
approach above to Ĝ(x) = −G(x) for the proof of the results. However, notice that when the
minimising strategy is substituted into the wealth process we obtain
X∗ν∗(t) =
X(0) exp
{[
(
r + cnet
)
+
‖ζ‖2
1+d+
(
1− 1
2(1+d+)
)]
t+ 1
1+d+
ζ
′
B(t)
}
if 1
1+d+
1
′
Nwo < 1;
X(0) exp
{
βν∗t+
1
1+d+
ζ
′
ν∗B(t)
}
if 1
1+d+
1
′
Nwo ≥ 1.
(96)
This time, we are under the unfavourable markets. Therefore, we have βν < 0 ∀ν ∈ K̃. From
this, we see that the drift of the wealth process in the second case above is negative. For the
first case, we have
r + cnet < −‖ζ‖
2
2
< − ‖ζ‖
2
1 + d+
(
1− 1
2(1 + d+)
)
< 0.
Therefore, P (X∗ν∗(t) > L) → 0 as t → ∞. This gives τw
∗
L < ∞ almost surely. From this, we can
show similarly that the minimising strategy w∗(x) ∈ Ac(x) as well. The rest follows similarly.
�
6 Conclusion.
We provided examples concerning survival, growth, and goal reaching maximization under in-
finite time approach and borrowing constraints. In order to solve these problems, an auxiliary
market is constructed and a dynamic programming approach is used. We can see in all problems
that the optimal investment strategy is a constant proportional strategy that is independent of
barrier levels and current wealth. Furthermore, the optimal investment strategy of the proba-
bility maximization and expected discounted reward maximization/minimization problems are
proportional to log-optimal investment strategy. On the other hand, the survival time maximis-
ing strategy turned out to be the log-optimal investment strategy. Especially, when the market
conditions are unfavourable, log-optimal strategy is the investment strategy that maximises
survival time, and when the market conditions are favourable the log-optimal strategy is the
investment strategy that minimises the time to reach a goal. When compared with the strategy
of the probability maximization problem, we found that, under the unfavourable condition, the
investor would take more risk to maximise the probability of hitting a target before hitting a
lower boundary, compared to the risk she takes to maximise the expected time to hit the lower
boundary. The situation is reversed when the conditions are favourable. The investor would
take less risk to minimise the probability of ruin than the risk she takes to reach a higher target.
Finally, when the markets are favourable there is no penalty to pay, and when unfavourable there
is no reward to gain. In addition, under the favourable market conditions, a reward maximising
22
investor would take more risk than she would with the log-optimal strategy. However, under the
unfavourable markets a penalty minimising investor would take less risk than she would with
the log-optimal strategy.
Acknowledgments
For the paper, I used the results of my doctoral dissertation at Imperial College London. I would
like to thank Mark H.A. Davis at Imperial College London for his supervision throughout my
research. I also thank to Antoine Jacquier at Imperial College London for his helpful suggestions,
and to Ege Yazgan at Istanbul Bilgi University for his support.
References
Bayraktar, E., Young, V., 2007. Minimizing the probability of lifetime ruin under borrowing
constraints. Ins.: Mathematics Econ., 196–221.
Björk, T., 2004. Arbitrage Theory in Continous Time. Oxford University Press, New York, NY.
Browne, S., 1997. Survival and growth with a liability: Optimal portfolios in continous time.
Math. Oper. Res. 22, 468–493.
Browne, S., 1999. Beating a moving target: Optimal portfolio strategies for outperforming a
stochastic benchmark. Finance and Stochastics 3, 275–294.
Cuoco, D., Cvitanic, J., 1998. Optimal consumption choices for a ”large” investor. J. Econ.
Dynam. Control 22, 401–436.
Cvitanic, J., 1997. Lecture Notes in Mathematics. Vol. 1656. Springer-Verlag, Berlin, pp. 123–
190.
Cvitanic, J., Karatzas, I., 1992. Convex duality in constrained portfolio optimization. Ann. Appl.
Prob. 2, 767–818.
Cvitanic, J., Karatzas, I., 1996. Hedging and portfolio optimization under transaction costs: A
martingale approach. Math. Finance 6, 113–165.
Davis, M. H. A., Norman, A. R., 1990. Portfolio selection with transaction costs. Math. Oper.
Res. 15, 676–713.
Fleming, W. H., Zariphopoulou, T., 1991. An optimal investment/consumption model with
borrowing. Math. Oper. Res. 16, 802–822.
Karatzas, I., Kou, S. G., 1998. Hedging american contingent claims with constrained portfolios.
Finance and Stochastics 2, 215–258.
Karatzas, I., Shreve, S., 1998. Methods of Mathematical Finance. Springer, New York, NY.
23
Merton, R. C., 1971. Optimum consumption and portfolio rules in a continuous-time model. J.
Economic Theory 3, 373–413.
Pliska, S. R., 1986. A stochastic calculus model of continuous trading: Optimal portfolios. Math.
Oper. Res. 11, 371–382.
Shreve, S. E., Soner, H. M., 1994. Optimal investment and consumption with transaction costs.
Ann. Appl. Prob. 4, 609–692.
Shreve, S. E., Xu, G.-L., 1990. A duality method for optimal consumption and investment under
short-selling prohibition: I, General market coefficients; and II, Constant market coefficients.
Ann. Appl. Prob. 2, 59–85 and 314–328.
Yener, H., 2011. Portfolio optimisation for distance to barrier and survival time maximisation.
Ph.D. thesis, Imperial College London.
Young, V., 2004. Optimal investment strategy to minimize the probability of lifetime ruin. N.
Amer. Actuarial J. 8, 105–126.
Zariphopoulou, T., 1992. Investment/consumption model with transaction costs and Markov-
chain parameters. SIAM J. Control and Optimization 30, 613–636.
Zariphopoulou, T., 1994. Consumption/investment models with constraints. SIAM J. Control
and Optimization 32, 59–85.
A Appendix
The following is outlined from Karatzas and Shreve (1998). Notice that Xwν (t) ≥ Xw(t) ∀ν ∈ K̃
Lebesgue-a.e. t ∈ [0, τwL ∧ τwU ]. To see why this holds, let for t ≤ τwL ∧ τwU
χ(t) = X̃wν (t)− X̃w(t),
where ˜ over the portfolio processes denotes the discounted value. Then, we can write
χ(t) =
∫ t
0
χ(s)
(
cnet + δ(ν)
)
ds +
∫ t
0
χ(s)w
′
(s) (µ− r1N + ν) ds
+
∫ t
0
χ(s)w
′
(s)σdB(s) +
∫ t
0
X̃w(s)
(
δ(ν) +w
′
(s)ν
)
ds. (97)
Next, we define the non-negative process
M(t) = exp
{
−
∫ t
0
(
cnet + δ(ν)
)
ds−
∫ t
0
w
′
(s)σdB(s)
+
1
2
∫ t
0
‖σ′w(s)‖2ds−
∫ t
0
w
′
(s) (µ− r1N + ν) ds
}
, (98)
24
and compute the differential
d (χ(t)M(t)) = M(t)X̃w
(
δ(ν) +w
′
(t)ν
)
dt. (99)
As a result, from the fact that w
′
(t)ν + δ(ν) ≥ 0 ∀ν ∈ K̃ Lebesgue-almost-every t ∈ [0, τwL ∧ τwU ]
and that χ(0) = 0, the value in (99) is non-negative. Therefore, we have Xwν (t) ≥ Xw(t).
However, whenever w
′
(t)ν+δ(ν) = 0 for Lebesgue-almost-every t ∈ [0, τwL ∧ τwU ], Xwν (t) = Xw(t)
almost surely.
The above result implies that Ac(x) ⊆ Aν(x). This gives Fc(x) ≤ Fν(x) ∀ν ∈ K̃. Therefore,
when we find ν∗ ∈ K̃ making w′(t)ν∗ + δ(ν∗) = 0 for Lebesgue-almost-every t ∈ [0, τwL ∧ τwU ], we
have
Fc(x) = Fν∗(x) = inf
ν∈K̃
Γν(x),
and w ∈ K.
Remark A.1. The above can also be applied to other problems we consider in this paper. Mainly,
it can be applied similarly to F(x) and Ḡ(x). On the other hand, as we showed previously we
can write F̄ (x) = − sup
w∈Aν
Ex [−τwU ] and G(x) = − supw∈Aν Ex
[
−e−ρτwL
]
. Then, the above
argument can be applied to the functions F̂ (x) = −F̄ (x) and Ĝ(x) = −G(x).
25
1 Introduction.
2 The Assets and The Model.
3 Maximising The Probability of Hitting a Target Before Default.
4 Maximising/Minimising The Expected Time.
5 Maximising and Minimising The Expected Discounted Reward.
6 Conclusion.
A Appendix
| 0non-cybersec
|
arXiv
|
How to kill a process tree in Windows. <p>Hi i have this process tree:</p>
<p><img src="https://i.stack.imgur.com/CNWom.png" alt="enter image description here"></p>
<p>The above screenshot shows a process tree. In my Perl script i know the PID of dscli. I have written the following code to kill a single PID:</p>
<pre><code>use Win32::Process;
use strict;
use warnings;
if(defined($ARGV[0])){
my $pid = "$ARGV[0]";
my $exitcode = 0;
Win32::Process::KillProcess($pid, $exitcode);
}else{
print "No argument provided :(\n";
}
</code></pre>
<p>The problem is that in my script i don't know the java process' PID. I have to get the dscli's child PID which is the java process. If i kill the dscli's PID using the above code then the child(java) don't die with it. </p>
<p>So my question is, how can i kill the java process which is the child of dscli using perl?</p>
| 0non-cybersec
|
Stackexchange
|
[meta] Thank you.. I would like to applaud everyone who posts in and browses this subreddit.
For the poster, to have the courage to ask about various issues surrounding your life.
For the myriad of generous commenters, offering diverse and helpful advice.
-
That an educational, positive forum such as this exists is truly amazing. There are few subreddits which contribute so directly and tangibly to improving peoples' lives.
Thank you all.
| 0non-cybersec
|
Reddit
|
This generation is lost.
| 0non-cybersec
|
Reddit
|
Arquillian JPA tutorial: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor. <p>I finished following the JPA tutorial at <a href="http://arquillian.org/guides/testing_java_persistence/">http://arquillian.org/guides/testing_java_persistence/</a> , but when I try to run the test ("Run the Test on GlassFish" section of the guide) as JUnit I obtain the following messages in Eclipse's console:</p>
<pre><code>java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:160)
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111)
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97)
at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:93)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)
... 10 more
Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container glassfish-embedded
at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:85)
at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.ManagerImpl.bindAndFire(ManagerImpl.java:236)
at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)
at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:261)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)
... 15 more
Caused by: java.lang.IllegalArgumentException: DeployableContainer must be specified
at org.jboss.arquillian.core.spi.Validate.notNull(Validate.java:44)
at org.jboss.arquillian.container.impl.ContainerImpl.<init>(ContainerImpl.java:71)
at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:76)
... 39 more
</code></pre>
<p><b>pom.xml</b></p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.arquillian.example</groupId>
<artifactId>arquillian-tutorial</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>arquillian-tutorial</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-integration</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>net.avh4.util</groupId>
<artifactId>imagecomparison</artifactId>
<version>0.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<!--<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
<version>1.0.0.CR3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>1.1.5.Final</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>1.2.0.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
<profile>
<id>arquillian-glassfish-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-glassfish-embedded-3.1</artifactId>
<version>1.0.0.CR3</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-web</artifactId>
<version>3.1.2</version>
</dependency>
</dependencies>
<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
<testResource>
<directory>src/test/resources-glassfish-embedded</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.config.file>
${project.build.testOutputDirectory}/logging.properties
</java.util.logging.config.file>
<derby.stream.error.file>
${project.build.directory}/derby.log
</derby.stream.error.file>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</project>
</code></pre>
<p><strong>arquillian.xml</strong></p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="glassfish-embedded" default="true">
<configuration>
<property name="resourcesXml">
src/test/resources-glassfish-embedded/glassfish-resources.xml
</property>
</configuration>
</container>
</arquillian>
</code></pre>
<p><strong>Game.java</strong></p>
<pre><code>package org.arquillian.example;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
@Entity
public class Game implements Serializable {
private Long id;
private String title;
public Game() {}
public Game(String title) {
this.title = title;
}
@Id @GeneratedValue
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
@NotNull
@Size(min = 3, max = 50)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
return "Game@" + hashCode() + "[id = " + id + "; title = " + title + "]";
}
}
</code></pre>
<p><strong>GamePersistenceTest.java</strong></p>
<pre><code>package org.arquillian.example;
import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.UserTransaction;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.runner.RunWith;
import org.junit.Before;
import org.junit.After;
import java.util.List;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.junit.Assert;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
@RunWith(Arquillian.class)
public class GamePersistenceTest {
@Deployment
public static Archive<?> createDeployment() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addPackage(Game.class.getPackage())
.addAsResource("test-persistence.xml", "META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
private static final String[] GAME_TITLES = {
"Super Mario Brothers",
"Mario Kart",
"F-Zero"
};
@PersistenceContext
EntityManager em;
@Inject
UserTransaction utx;
// tests go here
@Before
public void preparePersistenceTest() throws Exception {
clearData();
insertData();
startTransaction();
}
private void clearData() throws Exception {
utx.begin();
em.joinTransaction();
System.out.println("Dumping old records...");
em.createQuery("delete from Game").executeUpdate();
utx.commit();
}
private void insertData() throws Exception {
utx.begin();
em.joinTransaction();
System.out.println("Inserting records...");
for (String title : GAME_TITLES) {
Game game = new Game(title);
em.persist(game);
}
utx.commit();
// clear the persistence context (first-level cache)
em.clear();
}
private void startTransaction() throws Exception {
utx.begin();
em.joinTransaction();
}
@After
public void commitTransaction() throws Exception {
utx.commit();
}
private static void assertContainsAllGames(Collection<Game> retrievedGames) {
Assert.assertEquals(GAME_TITLES.length, retrievedGames.size());
final Set<String> retrievedGameTitles = new HashSet<String>();
for (Game game : retrievedGames) {
System.out.println("* " + game);
retrievedGameTitles.add(game.getTitle());
}
Assert.assertTrue(retrievedGameTitles.containsAll(Arrays.asList(GAME_TITLES)));
}
@Test
public void shouldFindAllGamesUsingCriteriaApi() throws Exception {
// given
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Game> criteria = builder.createQuery(Game.class);
Root<Game> game = criteria.from(Game.class);
criteria.select(game);
// TIP: If you don't want to use the JPA 2 Metamodel,
// you can change the get() method call to get("id")
criteria.orderBy(builder.asc(game.get(Game_.id)));
// No WHERE clause, which implies select all
// when
System.out.println("Selecting (using Criteria)...");
List<Game> games = em.createQuery(criteria).getResultList();
// then
System.out.println("Found " + games.size() + " games (using Criteria):");
assertContainsAllGames(games);
}
}
</code></pre>
| 0non-cybersec
|
Stackexchange
|
Moderncv does not compile. <p>I just wanted to try out the moderncv class, and when I try to compile any of the examples, I get the following errors:</p>
<pre><code>! Undefined control sequence.
l.16 \@initializecommand
{\moderncvstyleheadoptions}{}
! Undefined control sequence.
l.16 \@initializecommand{\moderncvstyleheadoptions
}{}
! Undefined control sequence.
\ds@left ...eadoptions {\moderncvstyleheadoptions
,left}
l.21 \ExecuteOptions{left}
</code></pre>
<p>I have moderncv installed, I also tried putting it in the same folder as the project (in fact, I am prompted to the line of code </p>
<pre><code>\@initializecommand{\moderncvstyleheadoptions}{}
</code></pre>
<p>for the first error, if I click through the errors in the editor (TeXnicCenter). Any ideas?</p>
<p>EDIT: Using MikTex 2.9, Windows 7, moderncv version 2.0.0 (28 Jul 2015)</p>
<p>and for the .tex code, just copied one of the standard examples. After deleting some lines it looks like this:</p>
<pre><code>\documentclass[11pt,a4paper]{moderncv}
\moderncvtheme[blue]{classic}
\firstname {name} % Your name
\lastname {Last name} % Your last name
\title {Title} % Your title (optional)
\address{street and number}{post code and city} % Your current address
\mobile {number} % Your mobile phone number
\phone {number} % Your phone number
\email {email} % Your email address
\homepage {link} % Your website
\extrainfo {information} % Possible extra information e.g. website
\photo[64pt][0.4pt]{picture} % Your photo (optional)
\quote {quote} % Life motto or something like that (optional)
\begin{document}
\maketitle
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}
\cvlanguage{Language 1}{Skill level}{Comment}
\cvcomputer{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvline{hobby 1}{\small Description}
\end{document}
</code></pre>
<p>EDIT II: Requested List files</p>
<pre><code> *File List*
moderncv.cls 2013/04/29 v1.5.1 modern curriculum vitae and letter document class
size11.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
etoolbox.sty 2015/08/02 v2.2a e-TeX tools for LaTeX (JAW)
ifthen.sty 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty 2010/04/08 v1.3 Providing info/warning/error messages (HO)
ltxcmds.sty 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lmodern.sty 2009/10/30 v1.6 Latin Modern Fonts
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
graphicx.sty 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
graphics.sty 2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
trig.sty 1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg 2007/01/18 v1.5 graphics configuration of teTeX/TeXLive
fancyhdr.sty
tweaklist.sty
calc.sty 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
xparse.sty 2016/01/19 v6377 L3 Experimental document command parser
expl3.sty 2016/01/19 v6377 L3 programming layer (loader)
expl3-code.tex 2016/01/19 v6377 L3 programming layer
l3pdfmode.def 2015/11/11 v6250 L3 Experimental driver: PDF mode
microtype.sty 2013/05/23 v2.5a Micro-typographical refinements (RS)
microtype-pdftex.def 2013/05/23 v2.5a Definitions specific to pdftex (RS)
microtype.cfg 2013/05/23 v2.5a microtype main configuration file (RS)
moderncvcollection.sty 2015/07/28 v2.0.0 moderncv collections
moderncvcompatibility.sty 2013/04/29 v1.5.1 modern curriculum vitae and letter compatibility patches
moderncvcolorblue.sty 2015/07/28 v2.0.0 modern curriculum vitae and letter color scheme: blue
moderncvstyleclassic.sty 2015/07/28 v2.0.0 modern curriculum vitae and letter style scheme: classic
moderncviconsmarvosym.sty 2015/07/28 v2.0.0 modern curriculum vitae and letter icons: marvosym
tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151)
pgf.sty 2015/08/07 v3.0.1a (rcs-revision 1.15)
pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7)
pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48)
pgfsys.code.tex
pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
pgfcore.code.tex
pgfcomp-version-0-65.sty 2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty 2007/07/23 v3.0.1a (rcs-revision 1.1)
pgffor.sty 2013/12/13 v3.0.1a (rcs-revision 1.25)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
hyperref.sty 2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty 2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
hobsub.sty 2012/04/25 v1.12 Construct package bundles (HO)
ifvtex.sty 2010/03/01 v1.5 Detect VTeX and its facilities (HO)
intcalc.sty 2007/09/27 v1.1 Expandable calculations with integers (HO)
ifpdf.sty 2011/01/30 v2.3 Provides the ifpdf switch (HO)
etexcmds.sty 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty 2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty 2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty 2012/04/08 v1.3 Expandable calculations on big integers (HO)
bitset.sty 2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty 2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty 2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
hopatch.sty 2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty 2011/01/30 xcolor patch
atveryend.sty 2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty 2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty 2011/10/16 v3.4 Data extraction from label references (HO)
hycolor.sty 2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
auxhook.sty 2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty 2011/06/30 v3.11 Key value format for package options (HO)
pd1enc.def 2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
puenc.def 2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
hpdftex.def 2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty 2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
supp-pdf.mkii
mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS)
nameref.sty 2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty 2010/12/03 v1.4 Cleanup title references (HO)
ModernCV.out
ModernCV.out
***********
</code></pre>
| 0non-cybersec
|
Stackexchange
|
How to Make Organic Pesticides and Fungicides for Your Garden.
| 0non-cybersec
|
Reddit
|
Daylight - New Horror Game! | Pretty Damn Scary!.
| 0non-cybersec
|
Reddit
|
Realizing he is too fat after all his buddies succeeded.
| 0non-cybersec
|
Reddit
|
First time posting! Grilled Teriyaki Chicken with Fried Rice & Steamed Broccoli.
| 0non-cybersec
|
Reddit
|
Where did it go?.
| 0non-cybersec
|
Reddit
|
Mobile hotspot: How to increase number of devices?. <p>I set up a mobile hotspot:</p>
<p><a href="https://i.stack.imgur.com/IO8GD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IO8GD.png" alt="Screenshot of mobile hotspot settings"></a></p>
<p><em>How do I increase the maximum number of connected devices from eight to twenty?</em></p>
| 0non-cybersec
|
Stackexchange
|
Ruh roh,
Police investigating leaked Iphone may charge finder with theft and Gizmodo with receipt of stolen property..
| 0non-cybersec
|
Reddit
|
Find principal part of Laurent expansion of $f(z) = \frac{1}{(z^2+1)^2}$ about $z=i$.. <p>Find principal part of Laurent expansion of $f(z) = \frac{1}{(z^2+1)^2}$ about $z=i$.</p>
<p>My attempt at a solution:
First, I noticed that if I plug in $z=i$, I get a zero in the denominator. This leads me to think that it is an isolated singularity. If I look at the classification of singularities, I believe it is a pole since $\lim_{z \to z_0} \vert f(z_0) \vert = \infty$ for $z_0 = i$.
By recalling the definition of the <em>principal part</em> of $f$, I am looking for the series containing all negative powers of $(z-z_0)$ in the Laurent expansion $\sum_{k=-\infty}^{\infty} a_k(z-z_0)^k$. </p>
<p>Based on what I have seen, I need to find the partial fraction decomposition of $f$. If so, then I have $\frac{1}{(z^2+1)^2} = \frac{A}{z^2+1}+\frac{B}{(z^2+1)^2}$. However, I think I am doing something wrong. From here, I believe I am supposed to use a geometric series. </p>
<p>I am using the textbook <em>Complex Analysis, Third Edition</em> by Joseph Bak and Donald J. Newman. </p>
<p>Any assistance and clarification would be greatly appreciated. </p>
| 0non-cybersec
|
Stackexchange
|
Why email on one address was received but not on another address. <p>I recently moved my website from <code>xyz hosting</code> company to <code>AWS</code>, I also made few changes in <code>NS</code> records. and created an email address (that was previously there but previous developer some how manged to delete or some thing not sure).</p>
<p>for <code>mail.mysite.com</code>, I was pointing to <strong>old</strong> server's ip address. I was still able to receive emails on another address <code>[email protected]</code> but not on new email address <code>[email protected]</code>.</p>
<p>Then I made a <code>MX record lookup</code>, it returned <strong>nothing</strong>... strange but at the same time I was reciving emails on support@ address.</p>
<p>Some how I manged to find history of MX record, and made same <strong>MX</strong> entry on <code>AWS</code> Route 53. Now I am able to recive emails on new address as well.</p>
<blockquote>
<p>My Questions is why I was receiving emails on one address but not on
another address?</p>
</blockquote>
| 0non-cybersec
|
Stackexchange
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
How would you assign read-only permissions to run ls -l /proc/{pid}/fd for processes you don't own. <p>How would you assign read-only permissions to run </p>
<pre><code>ls -l /proc/{PID}/fd
</code></pre>
<p>for PIDs (processes) you running as another user.</p>
<p>Ideally, you wouldn't be able to do anything else and you would not have any additional privileges other than be able to read these paths for all other users on the machine -- </p>
<p>I'm guessing this isn't possible unless you are root.</p>
| 0non-cybersec
|
Stackexchange
|
New data not persisting to Rails array column on Postgres. <p>I have a user model with a friends column of type text. This migration was ran to use the array feature with postgres:</p>
<pre><code>add_column :users, :friends, :text, array: true
</code></pre>
<p>The user model has this method:</p>
<pre><code>def add_friend(target)
#target would be a value like "1234"
self.friends = [] if self.friends == nil
update_attributes friends: self.friends.push(target)
end
</code></pre>
<p>The following spec passes until I add <code>user.reload</code> after calling <code>#add_friend</code>:</p>
<pre><code>it "adds a friend to the list of friends" do
user = create(:user, friends: ["123","456"])
stranger = create(:user, uid: "789")
user.add_friend(stranger.uid)
user.reload #turns the spec red
user.friends.should include("789")
user.friends.should include("123")
end
</code></pre>
<p>This happens in development as well. The model instance is updated and has the new uid in the array, but once reloaded or reloading the user in a different action, it reverts to what it was before the <code>add_friend</code> method was called.</p>
<p>Using Rails 4.0.0.rc2 and pg 0.15.1</p>
<p>What could this be?</p>
| 0non-cybersec
|
Stackexchange
|
WiFi suddenly not working. <p>I brought my Dell Latitude E6410 running Ubuntu 15.04 to a place where there was public WiFi. I'm using i3-gaps WM,so I attempted to connect via the terminal. However when I ran<code>
sudo dhclient wlan0</code>
I got the error
<code>/sbin/dhclient-script: 7: [: =: unexpected operator
</code>
Now that I am back at my house, I cannot connect tomy WiFi network, even through GUI. I am able to connect via Ethernet however. Is there something I am doing wrong here?</p>
| 0non-cybersec
|
Stackexchange
|
Loop to apply command to 300 files in a directory and rename the output including the original input file name plus new text. <p>I have a code that is svr_vars. I have a directory with 300 different files. I want to loop it and to run the code on each file in the directory. The svr_vars code outputs a generic filename of svr_vars.txt. Therefore, every time the code is run, it overwrites the svr_vars.txt filename. So, it needs to be renamed after every run of the code.</p>
<p>1995051200_72259.txt <= what one file in the directory looks like</p>
<p>I want the output to be renamed from svr_vars.txt to svr.1995051200_72259.txt </p>
| 0non-cybersec
|
Stackexchange
|
Steam Blog: Top Releases of April 2020.
| 0non-cybersec
|
Reddit
|
Most effective and simple way to hide a dank smell after smoking indoors!.
| 0non-cybersec
|
Reddit
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
Loot boxes have reached a new low with Forza 7’s “pay to earn” option.
| 0non-cybersec
|
Reddit
|
Scrollview with navigation bar + auto layout. <p>I have a ViewController embedded in NavigationController. I placed ScrollView inside it, then content view covering the full area (to set ScrollView's content size) and some labels. I tried to set constraints for all of the controls but I failed.</p>
<p>This is how it looks in Xcode:</p>
<p><a href="https://i.stack.imgur.com/cjxpf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cjxpf.png" alt="Xcode view"></a></p>
<p>And this is in Simulator:</p>
<p><a href="https://i.stack.imgur.com/sEtoh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/sEtoh.png" alt="Simulator view"></a></p>
<p>Red color is scroll view, green – content view. Of course I can scroll the view to get the bottom label on screen.</p>
<p>What I did wrong? What are the proper constraints? I want of course the ScrollView to cover the entire usable area of window (from bottom of navigation bar to bottom of screen).</p>
<p>For full reference you can <a href="https://www.dropbox.com/s/jy23vu2r0vtvscs/ios-ScrollTest.zip?dl=0" rel="noreferrer">download the project</a>.</p>
| 0non-cybersec
|
Stackexchange
|
This horrifying statue of Conor McGregor.
| 0non-cybersec
|
Reddit
|
What is the HD proximity sensor in a 2009 iMac?. <p>iStat Menus 5 is displaying a dash after this sensor - HD proximity sensor.</p>
<p>I'm getting a temp reading from the HD.</p>
<p>I've opened this iMac several times and have never seen a connection for the HD proximity sensor. Is it part of the HD temp sensor?</p>
| 0non-cybersec
|
Stackexchange
|
Physicists find best evidence yet for long-sought 2D structures.
| 0non-cybersec
|
Reddit
|
Laplace-Beltrami on a sphere. <p>I'm trying to compute the Laplace-Beltrami of the function $u(r,\varphi,\theta) = 12\sin(3\varphi)\sin^3(\theta)$ on a unit sphere. Note that $\varphi$ is the azimuth, i.e. $\varphi \in [0,2\pi]$ and $\theta$ the inclination, i.e. $\theta \in [-\frac{\pi}{2},\frac{\pi}{2}]$. For instructive purposes, I'd like to do this step by step. </p>
<p>The <a href="http://en.wikipedia.org/wiki/Laplace%E2%80%93Beltrami_operator" rel="nofollow">Laplace-Beltrami</a> of $u$ is defined as </p>
<p>$$\Delta u := \mathrm{div} (\mathrm{grad} \; u).$$</p>
<p>Since we're talking about a surface (the sphere), I assume that we should use the <a href="http://en.wikipedia.org/wiki/Surface_gradient" rel="nofollow"><em>surface gradient</em></a> of $u$, defined as</p>
<p>$$\nabla_S u := \nabla u - \vec{n}(\vec{n} \cdot \nabla u).$$</p>
<p>The gradient operator in spherical coordinates is defined as </p>
<p>$$\nabla := \frac{\partial }{\partial r} \vec{e_r} + \frac{1}{r} \frac{\partial }{\partial \theta} \vec{e_\theta} + \frac{1}{r\;\sin(\theta)} \frac{\partial }{\partial \varphi} \vec{e_\varphi},$$</p>
<p>which results in </p>
<p>$$\nabla u = 0 \vec{e_r} + \frac{1}{r} 36 \sin(3\varphi) \sin^2(\theta) \cos(\theta) \vec{e_\theta} + \frac{1}{r} 36 \cos(3\varphi) \sin^2(\theta) \vec{e_\varphi}.$$</p>
<p>Now, I'm not quite sure about the unit normal $\vec{n}$ on the sphere. I thought it would just be $\vec{e_r}$, but that cannot be right since in that case the inner product $\vec{n} \cdot \nabla u$ is zero (and hence the surface gradient would be equal to the regular gradient). Just to be sure, the inner product for a spherical coordinate setting is defined as $a \cdot b = g_{ij} a^i b^j$ — using Einstein notation — with the metric $g$ defined as</p>
<p>$$\left(\begin{array}{ccc}1 & 0 & 0 \\ 0 & r^2 & 0\\ 0 & 0 & r^2 \sin^2(\theta) \end{array}\right),$$</p>
<p>correct? Since the spherical coordinate system is right-handed, taking the cross product of the tangent vectors $\vec{e_\varphi}$ and $\vec{e_\theta}$ again results in $\vec{e_r}$. Could someone point out where I'm going wrong?</p>
<p>Next up is the divergence. I assume there is something like the <em>surface divergence</em>, but I couldn't find much about it (any references are most welcome). This would result in $\Delta_S u = \mathrm{div}_S (\nabla_S u)$.</p>
<p>It would be great if somebody could help to complete this elaboration. The eventual result of $\Delta_S u$ should be $-12 u$.</p>
<p><strong>[Edit]</strong></p>
<p>Using the <em>regular</em> divergence operator for a spherical coordinate setting, defined as</p>
<p>$$\nabla \cdot := \frac{1}{r^2} \frac{\partial}{\partial r} r^2 \vec{e_r} + \frac{1}{r \sin(\theta)} \frac{\partial}{\partial \theta} \sin(\theta) \vec{e_\theta} + \frac{1}{r \sin(\theta)} \frac{\partial}{\partial \varphi} \vec{e_\varphi},$$</p>
<p>we get (without using the metric $g$ as defined above)</p>
<p>$$\frac{1}{r^2 \sin(\theta)} \left( 36 \sin(3\varphi) \left\{ 3 \sin^2(\theta) \cos^2(\theta) - \sin^4(\theta) \right\} \right) + \frac{1}{r^2 \sin(\theta)} \left( -108 \sin(3\varphi) \sin^2(\theta) \right).$$</p>
<p>In case the metric should be used (I'm not sure about this), the result is</p>
<p>$$\left( 36 \sin(3\varphi) \left\{ 3 \sin(\theta) \cos^2(\theta) - \sin^3(\theta) \right\} \right) + \left( -108 \sin(3\varphi) \sin^3(\theta) \right).$$</p>
<p>Since the solution should be $-12u = -144 \sin(3\varphi) \sin^3(\theta)$, I'm not sure how I should get rid of the term $108 \sin(3 \varphi) \sin(\theta) \cos^2(\theta)$. Anyone?</p>
| 0non-cybersec
|
Stackexchange
|
Grass 3D. Sheep art.
| 0non-cybersec
|
Reddit
|
China approves DNA-sequencing devices to detect genetic defects in unborn babies.
| 0non-cybersec
|
Reddit
|
eclipse-cdt how to link with static library. <p>Fist i am confused should i set libraries under Linker/Libraries or to set them under "path and symbol". i think that they are the same. am i correct?</p>
<p>any way for my question - i need to link static library , so i tried few things:</p>
<p><strong>First try</strong> I try to add gtest (this is the library) and gtest path in the link library.
in this way its compiled and linked correct , but failed in runtime , because when it tried to load shared library (<strong>i want static library !</strong>) error is </p>
<blockquote>
<p>error while loading shared libraries: libgtest.so.0</p>
</blockquote>
<p><strong>Second try</strong> - I try do define it in path and symbol add to libraries the complete path '/root/workspace/gmock/gtest/lib/.lib/libgtest.a' . in this case i got error in the linkage :</p>
<pre><code>g++ -L/root/workspace/gmock/lib/.libs -L/root/workspace/gmock/gtest/lib/.libs -o "playground" ./src/p.o ./src/playground.o -lpthread -l/root/workspace/gmock/gtest/lib/.lib/libgtest.a -l/root/workspace/gmock/lib/.lib/libgmock.a
/usr/bin/ld: cannot find -l/root/workspace/gmock/gtest/lib/.lib/libgtest.a
</code></pre>
<p><a href="https://stackoverflow.com/questions/8332460/how-do-i-include-a-statically-linked-library-in-my-eclipse-c-project">This post</a> dosnt give an answer and not explain how you define differently linked against static vs shared.</p>
<p>Thank you</p>
| 0non-cybersec
|
Stackexchange
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
Prove that $X=\{(x,y,z,t) | x^2+6y^2+4z^2+t^2=1 \}$ is compact and connected. <p>Let be $X=\{(x,y,z,t) | x^2+6y^2+4z^2+t^2=1 \}$.
I have proved that $X$ is a submanifold of $\mathbb{R}^4$ of dimension $3$. I have to prove that $X$ is compact and connected.</p>
<p>My idea, thinking of the ellipsoid in dimension $2$, is to prove that $X$ is homeomorphic to the sphere $S^3$. </p>
<p>The candidate homeomorphism that I tried to write down is: $$\varphi: S^3 \rightarrow X$$
$$ (x,y,z,t) \rightarrow \frac{1}{\sqrt{x^2+6y^2+4z^2+t^2}} (x,y,z,t)=\frac{1}{\sqrt{1+5y^2+3z^2}} (x,y,z,t).$$</p>
<p>(obtained from associating a point $\bar x$ on $R^3$ to the point given by the intersection between $X$ and line throuhg $\bar x $ and the origin).</p>
<p>The problem is that the inverse is : $$ (x,y,z,t) \rightarrow \frac{1}{\sqrt{1-3z^2-5^2}} (x,y,z,t),$$ that have problems with the denominator.</p>
<p>Is this way of proceeding incorrect? How else can I do?</p>
<p>Thanks for the help!</p>
| 0non-cybersec
|
Stackexchange
|
Border Height on CSS. <p>I have a table TD and on the right of it I want to add a 1 pixel border, so I've done this:</p>
<pre><code>table td {
border-right:1px solid #000;
}
</code></pre>
<p>It works fine but the problem is that the border's height takes the total TD's height.</p>
<p>Is there a way to set the height of the border?</p>
| 0non-cybersec
|
Stackexchange
|
Psychologically Impaired.
| 0non-cybersec
|
Reddit
|
How to implement responsive, independently scrolling panes in Bootstrap 3?. <p>I'm working on a web app for which I want to have two independently scrollable areas on larger screens: a main content area on the left, and a smaller sidebar on the right.</p>
<p>I've managed to implement such a layout in CSS using <code>absolute</code> positioning and <code>overflow</code> properties, see this JSFiddle: <a href="http://jsfiddle.net/XLceP/">http://jsfiddle.net/XLceP/</a></p>
<p>This is great, however I'm also attempting to make use of Bootstrap (3.1.1) in order to make the site responsive and for the components/styling. However I'm at a loss at how to do so.</p>
<p>Basically, I'd ideally like to use Bootstrap conventions (the column classes etc.) to make it so that on mobile screens the right pane collapses below the left pane (or disappears entirely) for a conventional vertical layout, with both taking up the full width. However it seems impossible to do this while using <code>absolute</code> positioning for the larger screen layout.</p>
<p>How can I attempt to tackle this problem?</p>
| 0non-cybersec
|
Stackexchange
|
Spring Data Rest JPA - Can't lazy load OneToMany bidirectional relationship. <p>I have two entities, Company and Job, with an OneToMany bidirectional relationship. My problem is that i can't lazy load the Company's <code>List<Job> jobs</code>. </p>
<p>For example when i do:</p>
<p>GET <code>/api/companies/1</code> this is the JSON response:</p>
<pre><code>{
"id": 1,
"name": "foo",
...
"_embedded": {
"jobs": [
{...},
...
{...}
],
"employees": [
{...},
{...}
]
},
"_links": {
"self": {
"href": "http://localhost:8080/api/companies/1"
},
"jobs": {
"href": "http://localhost:8080/api/companies/1/jobs"
},
"employees": {
"href": "http://localhost:8080/api/companies/1/employees"
}
}
}
</code></pre>
<p>I don't want to have the <code>_embedded</code> since i didn't set the FetchType=EAGER.
Here are my models:</p>
<p><strong>Company.java</strong></p>
<pre><code>@Entity
public class Company {
@Column(nullable = false, unique = true)
private String name;
@OneToMany(mappedBy = "company", fetch = FetchType.LAZY)
private List<Job> jobs;
...
public Company() {
}
...
}
</code></pre>
<p><strong>Job.java</strong></p>
<pre><code>@Entity
public class Job {
@Column(nullable = false)
public String title;
@Column(length = 10000)
public String description;
@ManyToOne(fetch=FetchType.LAZY)
private Company company;
...
public Job() {
}
...
}
</code></pre>
<p>As you can see the same thing happens for other OneToMany relationships (employees). Can i avoid returning the whole list of job openings or employees every time?</p>
<p>EDIT: from the Job side the lazy load works fine! I don't get in the response the company that is related with a Job. I have to explicitly do <code>/api/jobs/123/company</code> in order to get the company.</p>
<p>EDIT2: Projections only work for collections. In this case it's not what i need. Excerpts could work, but i want to avoid them. I don't want to explicilty do <code>/api/companies/1?projection=MyProjection</code> since i won't use more than one. I want to change the default behavior, just like the projections do in collections.</p>
<p>EDIT3: i tried this</p>
<pre><code>@RestResource(exported = false)
@OneToMany(mappedBy = "company")
private List<Job> jobs;
</code></pre>
<p>and i get the error <code>Detected multiple association links with same relation type! Disambiguate association</code>.</p>
<p><strong>it's really annoying. I just need to get rid of <code>_embedded</code>. Anything?</strong></p>
| 0non-cybersec
|
Stackexchange
|
Book PDF's on e-readers. Has anyone put pdf sourcebooks on an e-reader? How does it work (is it actually usable)?
I have a e-ink nook touch, I was thinking about throwing the Pathfinder PDF's I have onto it for a game tomorrow.
Edit: I tried loading the Pathfinder core book onto my nook, it doesn't seem to be able to handle it. It's either super slow or just locks up.
| 0non-cybersec
|
Reddit
|
Proof: The inverse of the inverse matrix is the matrix.. <p>If $A$ is a square matrix such that it is not singular, then $(A^{-1})^{-1} = A$
How can I prove this property? I would appreciate it if somebody can help me.</p>
| 0non-cybersec
|
Stackexchange
|
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application.
I need to scale my app adding some spot instances that EB do not support.</p>
<p>So I create a second autoscaling from a launch configuration with spot instances.
The autoscaling use the same load balancer created by beanstalk.</p>
<p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p>
<p>This work fine, but:</p>
<ol>
<li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p>
</li>
<li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p>
</li>
</ol>
<p><strong>UPDATE</strong></p>
<p>Elastic Beanstalk add support to spot instance since 2019... see:
<a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
| 0non-cybersec
|
Stackexchange
|
Trying to load a gun in vr.
| 0non-cybersec
|
Reddit
|
Can GDB debug itself?. <p>Can GDB be run on itself? How or why not?
I see something about it <a href="http://www.math.utah.edu/docs/info/gdbint_3.html" rel="nofollow">http://www.math.utah.edu/docs/info/gdbint_3.html</a>
But GDB might not be written in a language that it can debug?</p>
| 0non-cybersec
|
Stackexchange
|
Create a High Avaiebily cluster Centos in NON-Geograpical regions. <p>I have been looking to create an Extreme High available cluster in Centos 7.6. They have to be at least</p>
<ul>
<li>2 in same data center</li>
<li>3 or more different Non- geographical locations</li>
<li>Ability to expand cluster</li>
<li>Sync directly, independent of location where new content is created (WordPress login)</li>
</ul>
<p>I have been looking into MariaDB Enterprise galera cluster and rsync, together with Cloudflare Load Balancing. (rsyns has delay/time interval cron)</p>
<p>I also had a look at Corosync and Pacemaker together with Cloudflare Load Balancing.</p>
<p>But for both methods I have my doubts and there are not exactly manuals to follow that suits my needs. </p>
<p>Also, I need to know how to transform an existing server into a cluster without losing any data.</p>
<p>As far as I can see now Corosync and Pacemaker is the best option. </p>
<p>Can anybody give a push into the correct direction and provide a workout / workaround for this?</p>
| 0non-cybersec
|
Stackexchange
|
Need help with meals for 2 1/2, I usually spend 100$ a week.. I spent 100 almost every Thursday on food and I want to cut that down so we can put more into savings. I also spent 150 this last week and was very upset lol.
But basically I need some cheap healthy meals for 2 adults and a toddler! My tot is lactose intolerant, and I'm vegeterian. The tot and my SO eat meat, so in most meals I pick it out.
I'm good at cooking so that's not a problem.. but I would just like to save.
I know I want fruits and veggies for smoothies, and bread for the tots sandwiches at daycare but I'm open to anything else. :)
| 0non-cybersec
|
Reddit
|
Website Localization And The Impact On User Experience!.
| 0non-cybersec
|
Reddit
|
Game Wave: Canada's Game Console (2019) - The story of the only video console to ever be created by a Canadian company, the corruption surrounding it, and how both it and its creators faded into obscurity. (27:30).
| 0non-cybersec
|
Reddit
|
How To Remove Stg-234i23r9-sph.com - [Solved Method].
| 1cybersec
|
Reddit
|
Table was deleted during ALTER, how to recover?. <p>I tried to <code>ALTER</code> a table to add a <code>FOREIGN KEY</code> as:</p>
<pre><code>ALTER TABLE artists ADD
FOREIGN KEY(country_id) REFERENCES countries(country_id) ON DELETE CASCADE;
</code></pre>
<p>and I received an error of</p>
<pre><code>ERROR 2013 (HY000): Lost connection to MySQL server during query
</code></pre>
<p>I tried twice and the same error. The third time, my table was gone. How can I recover the dropped table? MySQL server (Ver 14.14 Distrib 5.7.21, for Linux (x86_64)) is on localhost.</p>
<p>The entries in other tables which have FK to this table still exist. Thus, I believe the table has not been deleted, but InnoDB map is damaged.</p>
<p>I checked the files, <code>table_name.ibd</code> exists but <code>table_name.frm</code> is missing. I cannot <code>CREATE</code> the table as the <code>TABLESPACE</code> already exists. How can I recover or create the table schema to use the available data? My concern is about the <code>FOREIGN KEYS</code>, which still exist in other tables.</p>
<p>I had a backup, but it is too old to restore the backup. I have to keep the current version. And it is a huge database. The table has about 1 million rows. The <code>ibd</code> file is over 100MB.</p>
| 0non-cybersec
|
Stackexchange
|
Security researchers feel it is time to change the way malware is cataloged... as the malware threat grows larger over time, it is evident traditional strategies may not be successful in the long run.
| 1cybersec
|
Reddit
|
PHP API for Hotmail?. <p>Is there a way to retrieve EMAIL (not contacts) using a Hotmail PHP Api? Is there EVEN one?</p>
| 0non-cybersec
|
Stackexchange
|
I [29/M] am married, 10 years, to a narcissistic /BPD wife [30/F], affecting the family and I'm in a major dilemma.. Sorry for the wall of text, but the details need to be said.
Where do I even start? My wife of 10 years has been displaying emotional abuse towards me and our oldest daughter for 10 years now. It use to be rare, enough where it wouldn't impact us, but the past year has been dreadful. Our daughter is becoming a teenager, and she isn't taking her shit anymore, I often have to get involved and stand up for my daughter to calm my wife down. But then I'm the bad guy.
I'm depressed as fuck. I can't stand my wife anymore, I'm to the point now where the only reason why I'm in this marriage is because of the kids. I often have to lie to her to avoid confrontation. Whats worse, is that our fights. They're long, I am criticized if I stand up for myself, and they are frequent, 4 times a week lately. So I just don't even try with that anymore, my opinion doesn't matter. So I lie about how I feel, etc, etc. Sometimes she'll yell at me for stuff that needs to be done that she doesn't think needs to be done. Example, today there was an kitchen electronic in the sink. She put it there. She needed my help for something else, but I had to get the electronic out of the sink in case one of the kids turned the water on. She didn't like that, said it was stupid for paying attention to something not her, said I don't know how to respect people. Forget about the safety of our children and possessions. That brings me to another point.
Her breaking our stuff during fights. When I did stand up to her, she will just start throwing stuff. Anything, t.v. remotes, pictures, frames, drywall, dishes. Over a year ago she broke a 42 inch T.V. She use to blame me for getting her that mad, but I retaliated and told her that I didn't throw it, it isn't my fault.
Most of the fights with her and us (me and daughter) are about us not helping out enough around the house. Forget about me having a full time job, 45 Hrs a week, being a part-time student, and studying to get promoted in the military. What sucks is that even if I follow her lead to the 't', I get yelled at because I took too long or I don't have my priorities right. If I do stuff without her telling me to, it doesn't meet her standards, etc, etc. Her method and timing of arguments is so flawed. Today, she made me late for work just to argue with me. If this were a civilian job, I would get fired. When I do tell her that I have to leave to avoid being late, she usually says "You're work is always more important than me!". No, it's not, its a job that provides for this family and providing for this family is more important than your 7 am argument. I feel like I'm the only one who cares about the family as a whole, not just my wife.
My daughter always stays away from my wife as much as possible, but it is hard for her to because of all the family interaction. We are trying to teach her responsibility so she has a few chores. When they don't get done, her mother gets abuses her, sometime worse than she does me, this is where I step in. Our daughter's emotional health is going downhill, her doctor says its ADHD, but I know better. Its her lack of motivation. She needs to see a psychiatrist and get away from he mother.
It only gets worse from here. Our youngest is starting to have daytime wetting accidents. I have concluded that they're related to the psychological stress that she is causing. Since he is a boy, I would find it hard to be a UTI.
Oh yeah, and I'm likely taking a civilian job and moving to our home state by the end of the year, wife plans to take the kids with.
As for the efforts to fix this, I've tried. I try making her happy, be romantic, never pay attention to anything but her, but it doesn't work. She knows that she has a problem, especially the throwing objects part, but she refuses to see a psychiatrist. I know she won't get fixed if she doesn't see one.
So this is where I need your help, what power do I, a man, have over my wife to get me and the kids out of her abusive household. I do plan on divorcing her within the next year and a half, and I want to make every effort possible to get my kids out of this situation so that they can live a mentally healthy lifestyle. If you think there is no chance of me getting custody, let me know.
edit1: TL;DR: Wife's abusive behavior is affecting kids psychologically, planning a divorce but need evidence to prove abuse.
| 0non-cybersec
|
Reddit
|
TIL rainbows can be formed at night. They are called 'Moonbows'.
| 0non-cybersec
|
Reddit
|
ITAP of a vampire.
| 0non-cybersec
|
Reddit
|
Is Kim Jong Un the only fat North Korean?.
| 0non-cybersec
|
Reddit
|
Umm...i suppose in this case it could be argued that it was well worth it?.
| 0non-cybersec
|
Reddit
|
Ubuntu cannot detect Windows 7 so I cannot dual-boot. <p>I wanted to dual boot my Windows 7 (x64) with Ubuntu 13.10 (x64). When I get to the stage when I select a partition, it says that Ubuntu does not detect any other operating system in my computer. I chose 'Something else' and the only partition that came up was 'free space' with 500 GB free space (my hard drive space). I set two partitions before installing Ubuntu. 414 GB for Windows 7 and 50 GB for Ubuntu.
My disk is not Dynamic.</p>
| 0non-cybersec
|
Stackexchange
|
The KKK attends the 1986 Chicago gay pride parade [1180x769].
| 0non-cybersec
|
Reddit
|
Dryset Vacuum.
| 0non-cybersec
|
Reddit
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.