## javascript – Topbar Fixed sai da tela em dispositivos menores

``````var position = \$(window).scrollTop();

\$(function() {

if (window.matchMedia('(max-width: 768px)').matches) {

document.getElementsByClassName('social')(0).remove();

}

})

\$(document).on("scroll", function() {

var scroll = \$(window).scrollTop();

if (window.matchMedia('(max-width: 768px)').matches) {
if (scroll > 300) {
\$('.navbar-collapse').css("display", "none");
\$('.navbar').css({
'background': 'rgba(255,255,255,.8)',
'box-shadow': '-2px 1.5px 20px black',
});
\$('.nav-active').css('color', 'var(--complementar-1)');
} else {
\$('.navbar').css({
'background': 'transparent',
'background-image': ' linear-gradient(to bottom, var(--secondary-color), var(--primary-color))',
});
\$('.nav-item').removeClass("scrolled");
\$('.nav-active').css('color', 'rgba(0,0,0,.9)');
}
}

if (window.matchMedia('(min-width: 769px)').matches) {
if (scroll > 300) {
\$('.navbar').css({
'background': 'rgba(255,255,255,.8)',
'box-shadow': '-2px 1.5px 20px black',
'height': '50px',
});
\$('.img-logo').css({
"height": "0",
"width": "0"
});

\$('.nav-active').css('color', 'var(--complementar-1)');

} else {
\$('.navbar').css({
'background': 'transparent',
'background-image': ' linear-gradient(to bottom, var(--secondary-color), var(--primary-color))',
'height': '68px',
});
\$('.img-logo').css({
"height": "52px",
"width": "52px"
});

\$('.nav-item').removeClass("scrolled");
\$('.nav-active').css('color', 'rgba(0,0,0,.9)');

}
}

if (scroll < position || scroll <= 300) {
\$('.navbar-collapse').css("display", "block");
}

position = scroll;

});``````
``````@media(min-width: 769px) {
.nav-items {
margin-left: 65px;
}
.nav-item {
margin-left: 25px;
}
.social-item {
margin-left: 2px;
}
.social {
margin-left: 12%;
}
display: flex;
}
#navbarNavAltMarkup {
justify-content: center;
}
}

@media(max-width: 768px) {
nav {
top: 0;
}
#navbarNavAltMarkup {
margin: -5px -4%;
}
.nav-item {
display: inline-block !important;
}
display: flex;
justify-content: space-evenly;
}
.navbar-brand {
text-align: center;
width: 100%;
}
.navbar-brand img {
float: left;
}
}

* {
margin: 0;
box-sizing: border-box;
/*font-family: 'Montserrat', sans-serif;*/
--primary-color: #D62A2F;
--secondary-color: #262626;
--complementar-1: #931F1D;
--complementar-2: #6D7275;
--last-color: #FFFBDB;
}

body {
background-color: whitesmoke;
overflow-x: hidden;
height: 200vh;
}

nav a h2 {
display: inline-block;
line-height: 47px;
margin-left: 12px;
}

nav {
background-image: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
/*box-shadow: -2px 1.5px 20px var(--complementar-2);*/
position: fixed !important;
width: 100%;
font-size: 13.5pt;
z-index: 99;
}

.nav-item {
color: var(--last-color);
transition: .2s;
}

.nav-item:hover {
color: rgba(0, 0, 0, .8);
transform: scale(1.05);
}

.nav-active {
color: rgba(0, 0, 0, .9);
}

.scrolled {
color: black;
font-weight: bold;
}``````
``````<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.4.1.min.js" crossorigin="anonymous"></script>
<nav class="navbar navbar-expand-lg navbar-light" style="position: fixed;" <a href="https://pt.stackoverflow.com/#" class="navbar-brand">
<img src="sources/Only logo transparante.png" width="52" height="52" class="d-inline-block align-top img-logo" alt="Bower">
<h2 class="brand-name">Fantin & Imhoff</h2>
</a>

<div class="navbar-collapse nav-items" id="navbarNavAltMarkup">
<a class="nav-item nav-link nav-active nav-home" href="javascript:void(0)">Início <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link nav-features" href="javascript:void(0)">Contato</a>
<a class="nav-item nav-link nav-pricing" href="javascript:void(0)">Legislação</a>
<a class="nav-item nav-link nav-contact" href="javascript:void(0)">Nós</a>
</div>
</div>

<div class="social nav-items navbar-collapse">
<a class="nav-item nav-link social-item" id="facebook" href="https://pt.stackoverflow.com/#"><img src="sources/face-icon.png" width="25" height="25" alt="Facebook"></a>
<a class="nav-item nav-link social-item" id="instagram" href="https://pt.stackoverflow.com/#"><img src="sources/insta-icon.png" width="25" height="25" alt="Instagram"></a>
</div>
</nav>``````

## mac – I want to write a script to open a fixed URL + whats in the clipboard. Ex: Open Safari to Url+clipboard contents “https://site.com/clipboard contents”

Will this applescript work?

``````Tell Application "Safari" to open location
"http://www.site.com/"
end tell

Tell Process "Safari"
Keystroke "l" using command down

Tell application "System Events" to key code
124 using command down

Tell Process "Safari"
Keystroke "v" using command down
Keystroke return
end tell
``````

## dnd 3.5e – Is the Planeshifter’s “portal under their control” a fixed location or no?

The prestige class planeshifter gains at level 10 the natural ability demiplane seed (Manual of the Planes (Sept. 2001) 31–2). Over the course of the demiplane seed ability’s 300-word description, only this sentence mentions the portal that connects the planeshifter’s demiplane to elsewhere: The planeshifter’s demiplane “has a single portal entry, which the planeshifter may control for access” (32). The class just doesn’t offer any more details.

By default, this means that the portal to the planeshifter’s demiplane is the same as any other Manual of the Planes-style portal (that are slightly different from, for example, Forgotten Realms-style and Stronghold Builder’s Guide-style portals). Manual of the Planes on Magic Portals says that the word portal “is a general term for a stationary interplanar connection. Portals… open at one location on the originating plane and at one location on the destination plane (or planes)” (21 and emphasis mine).

This means that when the planeshifter finishes the 100-day process that’s required to create her personal demiplane, the planeshifter’s player talks to the DM about where the portal that leads to her demiplane is, and that’s where that portal stays. Forever. And, to be clear, the planeshifter can’t use again her demiplane seed ability until all portals that lead to that demiplane are destroyed. And, moreover, so far as I can tell, Manual of the Planes contains no information on how to destroy its portals. For example, from the same book, even the 6th-level Sor/Wiz spell seal portal (abjur) (MP 39), only prevents a portal from being used instead of destroying it (or instead of creating a portal that’s only accessible by pinnipeds like it should).

Were information included about destroying these kinds of portals in Manual or even in the Planar Handbook that was published after the 3.5 revision, it’d be a thing for a planeshifter to employ the demiplane seed ability, cast divinations to learn the demiplane’s tuning fork material and frequency (see here), destroy the portal that leads to the planeshifter’s demiplane, then make another demiplane. Through such a convoluted process the planeshifter could accumulate—ever so slowly (we’re talkin’ years)—a series of extradimensional safe houses that only the planeshifter could conveniently access. Except that there just aren’t any rules for destroying these kinds of portals. So. Um. Yeah.

## What that means and what you may want to do about it

I’m pretty sure that readers familiar with the evolution of Dungeons & Dragons, Third Edition will agree that the demiplane seed ability is—in almost every way—totally horrible, inferior to almost every other way of creating one’s own demiplane (e.g. here). Further, the prestige class planeshifter is itself not a particularly well-balanced class as a creature that takes it is typically at least level 9 (because of the entry requirement that she be able to cast 5th-level spells) who then gives up 3 levels of spellcasting advancement (therefore typically delaying her 9th-level spells until character level 20) for class features that are—for the most part—just toys, and, really, the ability demiplane seed is, here, just a toy, and it’s not even a very fun one like her 100-ft.-radius telepathy and her at-will spell-like ability plane shift.

However, readers should keep in mind that Manual of the Planes was published only shortly after the much-maligned Psionics Handbook and its 9th-level power genesis (metacreativity) (77 with the link to the updated version of the power from the Expanded Psionics Handbook)—it bearing a passing resemblance to the ability demiplane seed—that was at the time the only means available for most creatures to create their own demiplanes (excluding, of course, extradimensional containers and the like; see here).

Manual was also published only shortly after the Forgotten Realms Campaign Setting (June 2001) and—maybe because work was conducted on both books simultaneously?— Manual doesn’t include Forgotten‘s coverage of the oops?-they’re-slightly-different Forgotten-style portals. In addition, Manual dates to well before both Deities and Demigods (Apr. 2002) and the Epic Level Handbook (July 2002) that both include the much more useful, palatable, and–above all—convenient 9th-level spell genesis (conj) (DD 216 and EL 117, respectively, with the linked description having been drawn from the latter) that just allows a caster—still with some effort, of course—to toss off a spell that makes a demiplane, no prestige class capstone ability or psionics required.

With all this in mind, the Dungeon Master’s Guide on Why a Revision? says that the 3.5 revision “is compatible with existing products (like Manual of the Planes), and these products can be used with the revision with only minor adjustments” (4), and one of the minor adjustments the DM should make is to the prestige class planeshifter and especially to its demiplane seed ability.

What exactly those adjustments should be will depend mightily on the campaign, but I suspect lowering the entry requirements alone wouldn’t be enough. For example, in this DM’s campaigns, access to a relatively secret and generally habitable demiplane remains an ability suitable only for mid- to high-level PCs (e.g. about level 10 or later), so were one of this DM’s players to express an interest in the prestige class planeshifter, this DM might just lower the ability demiplane seed to level 1, allow multiple demiplanes at level 3, allow the creation of new portals to her demiplanes at level 5, and so on to make that feature the class’s centerpiece. As is, if the demiplane seed ability is why the player’s looking at the prestige class planeshifter, she’s better off at level 9 or higher just buying an attuned gem of genesis (33,100 gp; 0 lbs.) (Magic of Faerûn 14, 21), crushing it on the Ethereal Plane, then continuing doing what she’s doing.

## opengl – How do I render to a resizable window from a large fixed size back buffer in current graphics APIs?

I have some code that uses DirectX 9 with Windows native window management, that I would like to port to newer graphics APIs, but this code has a fairly unusual approach to window resizing, and it doesn’t seem obvious how to achieve the same things with newer graphics APIs.

The code I want to port allocates a back buffer large enough for a full screen window which remains the same size across window maximised, minimised, and resize events. When the window is smaller than the back buffer, only part of the back buffer is shown.

In order to render from this large back buffer, in DirectX 9, I’m specifying regions with the pSourceRect and pDestRect in IDirect3DDevice9::Present and using D3DSWAPEFFECT_COPY.

The advantages of this, as I see it, are as follows:

• There’s no need to free and reallocate any resources in response to window size changes.
• Not reallocating resources reduces code complexity significantly.
• Not reallocating resources makes the application more responsive in the case of windows size changes.
• The rendered scene continues to be drawn, smoothly, as the application window is being resized, without any need for potentially tricky and complicated attempts to update rendering settings in response to resize events.

(As the code is written, the application is essentially paused during window resize. The user nevertheless gets a smoothly updated view of the relevant part of the current static rendered scene during window resize.)

How do I do the same thing with newer graphics APIs?

In newer DirectX versions it seems like the ‘BitBlt model’ described on this page roughly corresponds to D3DSWAPEFFECT_COPY in DirectX 9:
https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/dxgi-flip-model

However, when I try setting the swap effect to DXGI_SWAP_EFFECT_DISCARD, in DirectX 12, I get the following error:
IDXGIFactory::CreateSwapChain: This D3D API version requires the swap effect to be one of DXGI_SWAP_EFFECT_FLIP_*.

So I guess the BitBlit model is no longer supported. 🙁

I guess a logical alternative would then be to do something equivalent ‘manually’, but it seems like doing something like this would lose one of the advantages of the trick, as it works out in DirectX 9, which is the smooth update during resizing without needing to intercept resize events and update stuff in response to these, in the application code.

What I’d like to see, ideally, are links to working code that does something equivalent to what I’m doing in DirectX 9, in DirectX 12, OpenGL, or Vulkan.

If it helps to see the code in action, and the resulting resize behaviour, you can see this in the PathEngine graphical testbed, which can be downloaded here: https://pathengine.com/downloads
(And I could also look at stripping out and posting source code for a minimal example application that demonstrates this behaviour, if this would help.)

## An example such that the continuous function defined on the sequences space dose not have a fixed point.

I want to find an example such that in this space:

$$l^2 = ((x_n):x_n in R, sum^infty_nx_n^2 with the $$L^2$$ norm,

a continuous function $$f(x_n)$$ maps the closed unit ball $$B$$ to itself does not have a fixed point.

I tried to define mapping $$(x_n)rightarrow (y_n)$$ and show that it does not have a fixed point. I tried to define $$y_1=(1-||x||)^.5$$, but I stuck here.

Could please anyone give me some hint about how to give this example and how to prove it well-defined?

## Could Bitcoin have a fixed difficulty?

Could Bitcoin have a fixed difficulty, how to implement it for a test and what would that mean in terms of exploitation? Would it make a difference if you were mining with a large platform or just with a wallet?

## c ++ – Division protected from overflow for fixed point

So I was looking at the overflow security division for a class that uses an int64 member with a given RESOLUTION (10000) for the fractional part. To maintain the accuracy of the fractional part during easy division, you would first multiply by the resolution, which, if the number is large enough, results in an overflow. I found an algorithm to divide without overflow, but I think it could probably be optimized better, I just don't see at first glance how:

``````int64 divideOverflowSafe( const int64 Lhs, const int64 Rhs ) const
{
// The idea here is simple, split Lhs * RESOLUTION / Rhs into two separate divisions to avoid the multiplication by RESOLUTION and thus avoid the overflow
const int64 FracPart = m_nVal % RESOLUTION;
const int64 DecPart = m_nVal - FracPart;

// Just dividing the integral part means there's already an inherent resolution buffer for precision. We then need to also calculate the remainder, which is small enough that it can be multiplied by RESOLUTION ( and needs to be, to maintain precision )
const int64 Res1 = DecPart / b.m_nVal;
const int64 Res1Remainder = ( DecPart % b.m_nVal ) * RESOLUTION / b.m_nVal;

// The fractional part is small enough to be multiplied by RESOLUTION, again for precision reasons
const int64 Res2 = FracPart * RESOLUTION / b.m_nVal;

// At the end we add everything back together to obtain the result
const int64 Res = Res1 * RESOLUTION + Res1Remainder + Res2;
return Res;
}
``````

## Fixed CSS / JS problem

Hello,

I have a CSS and / or JS problem on a page template / whmcs – the desktop / mobile menu doesn't work.
Please PM. Thank you.

## Display of the drop-down menu on a fixed notification

I am designing an intranet application for a client in which notifications are displayed via a fixed flyout template in combination with a “ notfication '' icon. in the header menu. The picture says more than the words;)
Notifications should stay focused as they must be read by users. However, when the user wants to add something using the icon and in the same menu (in this case, the "+" icon), another drop-down menu appears at the – above fixed notifications. It seems a little strange to me and I can't really find a better way. Anyone have experience with this or better ideas?

THX

## geometry – Isosceles triangle between two perpendicular lines and a given fixed line

Lines $$ax ^ 2 + 2hxy-ay ^ 2 = 0$$ and $$5x + 12y = 13$$ forms an isosceles triangle, finds the area of ​​the triangle.

My approach is as follows. Lines
$$ax ^ 2 + 2hxy-ay ^ 2 = 0$$ represent two perpendicular lines namely y = mx and y = -x / m when these lines cross 5x + 12y = 13, we obtain coordinates as $$( frac {13} {5 + 12m}, frac {13m} {5 + 12m})$$ and
$$( frac {13m} {5m-12}, frac {-13} {5m-12})$$. After that, I am not able to approach