Id
int64 1.68k
75.6M
| PostTypeId
int64 1
2
| AcceptedAnswerId
int64 1.7k
75.6M
⌀ | ParentId
int64 1.68k
75.6M
⌀ | Score
int64 -60
3.16k
| ViewCount
int64 8
2.68M
⌀ | Body
stringlengths 1
41.1k
| Title
stringlengths 14
150
⌀ | ContentLicense
stringclasses 3
values | FavoriteCount
int64 0
1
⌀ | CreationDate
stringlengths 23
23
| LastActivityDate
stringlengths 23
23
| LastEditDate
stringlengths 23
23
⌀ | LastEditorUserId
int64 -1
21.3M
⌀ | OwnerUserId
int64 1
21.3M
⌀ | Tags
sequence |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75,068,863 | 2 | null | 33,437,398 | 0 | null | ```
alertDialog.setOnShowListener(OnShowListener { dialog ->
val buttonPositive: Button = alertDialog.getButton(DialogInterface.BUTTON_POSITIVE)
buttonPositive.setTextColor(ContextCompat.getColor(requireContext(), R.color.orange_strong))
val buttonNegative: Button = alertDialog.getButton(DialogInterface.BUTTON_NEGATIVE)
buttonNegative.setTextColor(ContextCompat.getColor(requireContext(), R.color.orange_strong))
})
// show alert dialog
alertDialog.show()
```
| null | CC BY-SA 4.0 | null | 2023-01-10T10:50:46.283 | 2023-01-10T10:50:46.283 | null | null | 19,075,858 | null |
75,069,215 | 2 | null | 75,067,326 | 0 | null | I do not know what's happening since this is a lot of code and quite hard to follow line by line; it's very easy to miss something when reading code on SO, but I do see a few things where you could improve your architecture.
Where I'd start is by looking at parts of your architecture that have "code smells" (A word of caution: )
#### Architecture
When leveraging the power of coroutines, you'd want to benefit from the ability to use suspend functions, and the reactive nature of LiveData (or Flow) to observe and react in your UI. I won't go too much detail into every topic, but I'll mention potential testability issues when I see them, since you'll want to Unit Test your business logic and to do that, you ought to keep some things in consideration.
In general, you'd want to follow the Jetpack architecture ideas (unless you work for Square, in which case ); with that in mind, I'll just to Google recommended practices where applicable because if you don't like it, you can find your own alternatives ;)
### Fragments
I see a of state in the Fragments. Lots of booleans, integers, lists, etc. This is normally a red flag. You have a ViewModel, that's where your state should be coming from, the Fragment rarely has reasons to "store" this state locally.
### ViewModels
I feel like you're using a of LiveData, which is fine, but I believe you'd benefit from a step further by replacing most of that by a combined flow. Each of your internal states is instead a Flow, and you to the fragment one (combined) or a couple if you want to split parts of your reactive code. By using the `combine(flow1, flow2, etc...)` function in your VM, you can then produce a single more cohesive state, and even expose it as a `StateFlow` for even more efficiency, as you'd then observe the flow from your fragment using something like:
```
viewLifecycleOwner.lifecycleScope.launchWhenStarted {
viewModel.yourFlow.collect {...} //or collectLatest, depending on your usecase
}
```
This is optional, but it would be an improvement over having so many liveDatas floating around.
### Fragment - Adapters
I see you have two or three ListView adapters (good), but they don't really need to be lateinit. You're not really adding much, have them created at init:
```
private val adapter1 = SomeAdapter()
private val adapter2 = AnotherAdater()
```
Since they are ListAdapters, once you receive data via (livedata/flow) all you should do is `adapter1.submitList(...)`, since they cannot be null ever. By using lateinit (in something you know you're gonna need anyway) you're not really gaining anything, and are introducing complexity. There are better optimizations you can do than `lateinit` there.
In the end, your fragment should be . You "load it" when you display it, abide by its crazy lifecycle, and then wire the things up so it can observe a livedata/flow and update its UI with the incoming state, that's all it should do. And navigation of course, but mainly because it's part of the plumbing you ought to do in the android framework.
If you add more logic/stuff/state, you're putting yourself in a testing corner and a more complex scenario to manage, as fragments are destroyed, detached, re-added, etc.
### ListAdapters
Good job using List Adapters, but your adapters have a few issues.
- `notifyDataSetChanged`
Take for instance this snippet of your code:
```
fun selectItem(position: Int) {
val item = getItem(position)
item.isSelected = true
statesMap.clear()
statesMap[position] = item.isSelected
notifyItemChanged(position)
}
```
Why do you have a static hashMap to indicate selection?
The Adapter already has a lot of work to do behind the scenes, it shouldn't have this responsibility.
When something is selected, you do something about it (set some boolean to true like `yourItem.isSelected = true` for e.g.) and then produce a new list that will be submitted to the adapter and the diffutil will pick the change.
(this is just an example of an operation that mutates your list, it could be something else, but the principle is, don't keep state where it doesn't belong, instead, react to changes received via the expected channels).
#### ViewHolders/Adapter
This doesn't look bad, but I feel you're not delegating your responsibilities correctly. Your adapter should not have a lot of if statements there. If an item is selected, the ViewHolder should receive this information and act accordingly, not the Adapter. So I'd pass a boolean to your `fun bind` alongside all the info the ViewHolder needs to set its correct appearance. This is all read-only info anyway.
#### Coroutine Scope/Dispatchers
Careful with hardcoding Dispatchers.IO all over the place, this makes it impossible to correctly test, as you cannot override the dispatcher that easily. Instead, inject it, since you're using Dagger already. This way your tests will be able to override them.
In the viewModel always do
```
viewModelScope.launch(injected_dispatcher) {
//call your suspend functions and such
val result = someRepo.getSomething()
someFlow.emit(result)
}
```
(just an example).
When you test your VM, you'll supply a test dispatcher.
### Conclusion
Overall, good job on the architecture, it's better than a huge activity doing all the work ;)
I feel like you could simplify your code a bit, which, in turn, will greatly help you in finding what part is not behaving as expected.
Remember. Activity/Fragment Observes ViewModel, and deals with Android Framework things (as Google calls them "policy delegates") like navigation, intents, etc. They react to data received and pass it along (to an Adapter for e.g.).
A viewModel sits between your source of truth (repos, data layers) and your business logic (split in usecases/interactors or whatever you call them). The ViewModel is there to give your Fragments/Activities, a more stable and longer-living component that will glue your data with your UI.
The Repos/Etc. are all suspend functions that return the data you need from the source, and update it when needed. (e.g. talk to Room DB or an API, or both!) They merely return the data for the VM and higher levels to consume.
UseCase/Interactors are just abstractions to "reuse" the communication between viewmodels and repositories and such (or to some specific logic). They can apply transformations to your data as they see fit, liberating the VM from this resposibility.
E.g. if you have a GetSomethingUseCase, that may, behind the scenes, talk to a repo, wait (suspend), then transform the API/DB Response into something that is needed by the UI, all done without the VM (or the UI) knowing what's going on.
And lastly, make your adapters as small as possible. Remember they already have a lot of responsibilities.
The way I see this working is.
Fragment 1 Starts, VM is init. Fragment observes its state via some livedata/flow when started. Fragment mutates its views to match the state received.
The user goes to Fragment 2 and changes something, this 'something' updates a DB or in-memory data structure.
The user returns to Fragment 1, all is init again or restored, but this time, the liveData/Flow is observed again, and the data comes back (now modified by fragment2). The Fragment updates its UI without thinking much about it, as it's not its responsibility.
I hope this lengthy answer points you in the right direction.
Short of that, I suggest you break down your problem into a smaller one to try to isolate what is not doing what it should. The less "state" you have in random places (Adapters, fragments, etc.) the less the chances of weird problems you're going to have.
Don't fight the framework ;)
Lastly, if you made it this far, if you submit a list to your adapter and it doesn't update, [take a look at this SO question/answer](https://stackoverflow.com/questions/69475903/diff-util-not-updating-items-ui-in-recycler-view/69497345#69497345) as ListAdapter has a "it's not a bug according to google but the documentation doesn't make this clear enough" situation.
| null | CC BY-SA 4.0 | null | 2023-01-10T11:19:59.307 | 2023-01-10T11:19:59.307 | null | null | 2,684 | null |
75,069,493 | 2 | null | 54,236,825 | 0 | null | Also you should make your components data reactive and making sure that childVisibility is set to this instance rather than a direct reference by setting it like this
```
export default {
data() {
return {
childVisibility: false
}
},
methods: {
openTree() {
this.childVisibility = !this.childVisibility;
}
},
props: {
title: String,
content: Array,
}
```
}
| null | CC BY-SA 4.0 | null | 2023-01-10T11:44:33.737 | 2023-01-10T11:44:33.737 | null | null | 1,613,158 | null |
75,069,530 | 2 | null | 75,068,758 | 1 | null | You have two problems:
- [Inno Setup syntax](https://jrsoftware.org/ishelp/index.php?topic=params)- `binPath`[When creating a service with sc.exe how to pass in context parameters?](https://stackoverflow.com/q/3663331/850848)
So your commandline won't work even standalone, let alone in Inno Setup.
The correct syntax is:
```
"create ByTestService start= auto binPath=""\""{app}\{#MyAppExeName}\"" ThisisParameter"""
```
Note: the backslash in `\""` (twice) and the three trailing quotes `"""` (first two for trailing quote in `sc` `binPath` and the third to match the leading quote in `Parameters`).
This ultimately executes:
```
sc create ByTestService start= auto binPath="\"C:\Program Files (x86)\Accenture\Vytelle.DataService.Worker.exe\" ThisisParameter"
```
| null | CC BY-SA 4.0 | null | 2023-01-10T11:48:02.107 | 2023-01-11T13:20:50.453 | 2023-01-11T13:20:50.453 | 850,848 | 850,848 | null |
75,069,568 | 2 | null | 75,069,533 | 1 | null | Only simple variable expressions (like `$Thickness`) is expanded in double-quoted strings - to qualify the boundaries of the expression you want evaluated, use the sub-expression operator `$(...)`:
```
"$PSScriptRoot\$($Thickness[$Counter])\Previous Years"
```
---
Another option is to skip the manual counter altogether and use a `foreach` loop or the `ForEach-Object` cmdlet over the array:
```
foreach($width in $Thickness){
$path = "$PSScriptRoot\$width\Previous Years"
if(!(Test-Path -Path $path)){
New-Item -Path $path -ItemType Directory
}
}
# or
$Thickness |ForEach-Object {
$path = "$PSScriptRoot\$_\Previous Years"
if(!(Test-Path -Path $path)){
New-Item -Path $path -ItemType Directory
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T11:52:03.023 | 2023-01-10T11:59:23.420 | 2023-01-10T11:59:23.420 | 712,649 | 712,649 | null |
75,069,624 | 2 | null | 68,217,725 | 0 | null | The answer is late but this will help others like me. The same situation is required in my project. I have achieved this by the following code
```
binding.bottomNavigation.menu.setGroupCheckable(0, false, true)
binding.bottomNavigation.setOnItemSelectedListener { item ->
when (item.itemId) {
R.id.scoreboardFragment-> {
navController.navigate(R.id.scoreboardFragment)
item.isCheckable = true
return@setOnItemSelectedListener true
}
R.id.settingsFragment-> {
navController.navigate(R.id.settingsFragment)
item.isCheckable = true
return@setOnItemSelectedListener true
}
}
false
}
binding.fabPlayButton.setOnClickListener{
if (navController.currentDestination?.id != R.id.playFragment){
navController.navigate(R.id.playFragment)
binding.bottomNavigation.menu.setGroupCheckable(0, false, true)
}
}
```
In this case, you should navigate manually by id
| null | CC BY-SA 4.0 | null | 2023-01-10T11:57:05.707 | 2023-01-10T11:57:05.707 | null | null | 15,005,298 | null |
75,069,729 | 2 | null | 75,067,443 | 0 | null | Here is the sample code for your question:
```
struct MainView: View {
@StateObject var mainVM = MainViewModel()
@ObservedObject var discoveryVM:DiscoveryViewModel
var body: some View {
ZStack {
ScrollView {
// if data changed in DiscoveryViewModel view will automatically upadte
ForEach(discoveryVM.showProfiles, id: \.self) { profile in
MyView(profile: Profile)
}
}
}
.onReceive(discoveryVM.$toggle) { status in
// change something in MainViewModel when toggle in DiscoveryViewModel
mainVM.toggle = status // change variable(rearly used)
mainVM.doSomething() // call fucntions
}
}
}
class MainViewModel: ObservableObject {
@Published var toggle: Bool = false
func doSomething() {
print("Do something")
}
}
class DiscoveryViewModel: ObservableObject {
@Published var data: [ProfileModel] = []
@Published var toggle: Bool = false
}
```
`ObservableObjects` are mostly used where there is nesting of views
| null | CC BY-SA 4.0 | null | 2023-01-10T12:06:37.360 | 2023-01-10T12:21:16.907 | 2023-01-10T12:21:16.907 | 13,278,922 | 14,398,771 | null |
75,069,773 | 2 | null | 75,043,654 | 1 | null | Definitely not the most efficient, but hopefully quite readable and simple solution.
Start with a simple function that converts the indices into the desired layer bitmaps:
```
def bitmap(indices, side=8):
"""Transform a list of indices to an 8x8 bitmap with those indices turned on"""
indices = set(indices)
return [[int(side*i+j in indices) for j in range(side)] for i in range(side)]
```
For example, for the first row in `massive`, you'd get:
```
[[1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 1, 1, 1, 1, 1]]
```
This matches your illustration of the layers, and can be used to also create them visually with `matplotlib` --
```
plt.imshow(bitmap(massive[0]), cmap='gray_r')
plt.show()
```
[](https://i.stack.imgur.com/zL0dz.png)
Or even as a 3D plot using voxels:
```
cube = np.array([bitmap(layer) for layer in massive])
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
# Use transpose of `cube` to get the direction right
# (bottom->up rather than left->right)
ax.voxels(cube.T, edgecolor='k')
ax.set(xticklabels=[], yticklabels=[], zticklabels=[])
plt.show()
```
[](https://i.stack.imgur.com/RYQvH.png)
Then a small function to add those vertical layers as needed:
```
def hexaize(massive, side=8):
"""Adds the values for each column across vertical layers"""
final_map = [[0] * side for _ in range(side)]
# Reverse-iterate over massive since it's given bottom-up and not top-down
for i, layer in enumerate(reversed(massive)):
for j, row in enumerate(bitmap(layer)):
for k, val in enumerate(row):
final_map[i][j] += val*2**k
# Finally convert the added values to hexadecimal
# Use the f-string formatting to ensure upper case and 2-digits
return [[f"0x{val:02X}" for val in row] for row in final_map]
```
Then calling `hexaize(massive)` returns:
```
[['0xFF', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xFF'],
['0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'],
['0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'],
['0x81', '0x00', '0x00', '0x18', '0x18', '0x00', '0x00', '0x81'],
['0x81', '0x00', '0x00', '0x18', '0x18', '0x00', '0x00', '0x81'],
['0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'],
['0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'],
['0xFF', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xFF']]
```
Finally, if you want the exact output as described above (in C-like notation?), then you can chain several `replace` calls like so:
```
def massive_to_arduino(massive, side=8):
"""Converts a massive to Arduino style input"""
# Get the hexa format of massive
in_hex = hexaize(massive, side=side)
# Replace square brackets with curly ones
in_hex = str(in_hex).replace("[", "{").replace("]", "}")
# Break rows to join them with new lines and indentation
in_hex = "},\n ".join(in_hex.split("},"))
# Add new line, indentation, and semicolon to start and end
return in_hex.replace("{{", "{\n {").replace("}}", "},\n};")
```
And then calling
```
print(massive_to_arduino(massive))
```
produces
```
{
{'0xFF', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xFF'},
{'0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'},
{'0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'},
{'0x81', '0x00', '0x00', '0x18', '0x18', '0x00', '0x00', '0x81'},
{'0x81', '0x00', '0x00', '0x18', '0x18', '0x00', '0x00', '0x81'},
{'0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'},
{'0x81', '0x00', '0x00', '0x00', '0x00', '0x00', '0x00', '0x81'},
{'0xFF', '0x81', '0x81', '0x81', '0x81', '0x81', '0x81', '0xFF'},
};
```
| null | CC BY-SA 4.0 | null | 2023-01-10T12:10:17.453 | 2023-01-12T08:20:22.620 | 2023-01-12T08:20:22.620 | 4,133,131 | 4,133,131 | null |
75,070,224 | 2 | null | 75,069,742 | -2 | null | There are 2 ways of dealing with it. The first method would be allowing cors in your server, if you have a nodejs server then you can add the following code into your server.js file
```
const cors = require("cors")
app.use(cors())
```
if you don't have a nodejs server then you can google how to enable cors in the respective language your server is using. This only works if you have access to the server, if you don't have access to your server you can try the second method.
The second method would be using a proxy server. You can follow this [video](https://www.youtube.com/watch?v=ai2Cx9AjK34) on how to do it or you can read this [post](https://stackoverflow.com/questions/29670703/how-to-use-cors-anywhere-to-reverse-proxy-and-add-cors-headers)
| null | CC BY-SA 4.0 | null | 2023-01-10T12:47:47.333 | 2023-01-10T12:47:47.333 | null | null | 17,212,169 | null |
75,070,343 | 2 | null | 75,064,599 | 0 | null |
1. Does the training and validation accuracy keep dropping - when you would just let it run for let's say 100 epochs? Definitely something I would try.
2. Which optimizer are you using? SGD? ADAM?
3. How large is your dropout, maybe this value is too large. Try without and check whether the behavior is still the same.
It might also be the optimizer
As you do not seem to augment (this could be a potential issue if you do by accident break some label affiliation) your data, each epoch should see similar gradients. Thus I guess, at this point in your optimization process, the learning rate and thus the update step is not adjusted properly - hence not allowing to further progress into that local optimum, and rather overstepping the minimum while at the same time decreasing training and validation performance.
This is an intuitive explanation and the next things I would try are:
- -
| null | CC BY-SA 4.0 | null | 2023-01-10T12:57:31.543 | 2023-01-24T09:37:12.710 | 2023-01-24T09:37:12.710 | 5,763,590 | 5,763,590 | null |
75,070,376 | 2 | null | 59,434,572 | 0 | null | Category Class
```
@Entity
```
public class Category {
```
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
public Long categoryId;
@Column(nullable = false)
public String name;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "parent_category_id")
@JsonIgnore
public Category parentCategory;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "root_category_id")
@JsonIgnore
public Category rootCategory;
@Transient
public List<Category> childrens = new ArrayList<Category>();}
```
Repository
```
@Repository
public interface CategoryRepository extends JpaRepository<Category, Long> {
@Query("SELECT category FROM Category category "
+ " WHERE category.parentCategory.categoryId IS NULL")
public List<Category> findAllRoots();
@Query("SELECT category FROM Category category"
+ " WHERE category.rootCategory.categoryId IN :rootIds ")
public List<Category> findAllSubCategoriesInRoot(@Param("rootIds") List<Long> rootIds);}
```
Service Class
```
@Service
public class CategoryService {
@Autowired
public CategoryRepository categoryRepository;
@GetMapping("/categories")
@Transactional(readOnly = true)
public List<Category> getCategories() {
List<Category> rootCategories = categoryRepository.findAllRoots(); // first db call
// Now Find all the subcategories
List<Long> rootCategoryIds = rootCategories.stream().map(Category::getCategoryId).collect(Collectors.toList());
List<Category> subCategories = categoryRepository.findAllSubCategoriesInRoot(rootCategoryIds); // second db call
subCategories.forEach(subCategory -> {
subCategory.getParentCategory().getChildrens().add(subCategory); // no further db call, because everyone inside the root is in the persistence context.
});
return rootCategories;
}}
```
}
| null | CC BY-SA 4.0 | null | 2023-01-10T12:59:44.120 | 2023-01-10T12:59:44.120 | null | null | 3,303,365 | null |
75,070,847 | 2 | null | 46,833,758 | 0 | null | You can prevent the line breaking with this markup. It doesn't need to include the last word, so you can use it even with a generated content.
#### JSX
```
<div>
{children}
<span className="tail">
{'\u00a0'}
<svg></svg>
</span>
</div>
```
#### HTML
```
<div>
Lorem ipsum dolor sit<span class="tail"> <svg></svg></span>
</div>
```
#### CSS
```
.tail {
white-space: no-wrap;
}
```
[https://jsfiddle.net/radarfox/65h40jt7/](https://jsfiddle.net/radarfox/65h40jt7/)
| null | CC BY-SA 4.0 | null | 2023-01-10T13:42:33.277 | 2023-01-10T14:35:26.723 | 2023-01-10T14:35:26.723 | 8,315,965 | 8,315,965 | null |
75,071,330 | 2 | null | 75,013,603 | 0 | null | It is possible. You have to make use of the scrollbar being a widget of its own.
Here is the method:
1. Change your window in Qt Designer to be: spacer, QScrollArea (that will contain widget A), spacer, widget B, spacer; everything is in a QGridLayout (or QHBoxLayout but please read until the end). It is because widget B is outside the scroll area that it will not move during scrolling.
2. In your widget constructor, after ui->setupUi(); reparent and move the vertical scrollbar of your QScrollArea with these lines of code: scrollArea->verticalScrollBar()->setParent(w);
layout->addWidget(sa->verticalScrollBar()); //Adds the scrollbar to the right of the layout.
Note about the margins:Obviously, you can easily push the scrollbar to the very right of your window by setting the layout right margin to 0.
If you also want it to cover the entire height of your window, while keeping some space between the other widgets and the window's border, that is where a `QHBoxLayout` will not suffice and you need a `QGridLayout` instead, set its top and bottom margin to `0` and add spacers (fixed size) to obtain the same visual result.
The C++ code for such a window would be:
```
QWidget* widget = new QWidget();
QGridLayout* layout = new QGridLayout(widget);
layout->setSpacing(0);
layout->setContentsMargins(9, 0, 0, 0);
widget->setLayout(layout);
QScrollArea* scrollArea = new QScrollArea(widget);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
QWidget* widgetB = new QLabel("Widget B", widget);
//Creates the spacer that will "simulate" the top and bottom margins
QSpacerItem* topSpacer = new QSpacerItem(0, 9, QSizePolicy::Minimum, QSizePolicy::Fixed),
* bottomSpacer = new QSpacerItem(0, 9, QSizePolicy::Minimum, QSizePolicy::Fixed);
layout->addItem(topSpacer, 0, 0);
layout->addWidget(scrollArea, 1, 0);
layout->addItem(bottomSpacer, 2, 0);
layout->addWidget(widgetB, 1, 1);
//Moves the scrollbar outside the scroll area
scrollArea->verticalScrollBar()->setParent(widget);
layout->addWidget(scrollArea->verticalScrollBar(), 0, 2, 3, 1);
QLabel* innerLabel = new QLabel("Some big label to force the scrolling");
scrollArea->setWidget(innerLabel);
innerLabel->setMinimumHeight(500);
widget->show();
```
| null | CC BY-SA 4.0 | null | 2023-01-10T14:21:34.277 | 2023-01-10T14:49:31.990 | 2023-01-10T14:49:31.990 | 20,143,744 | 20,143,744 | null |
75,071,893 | 2 | null | 64,381,297 | 0 | null | Disabling language server works as answered by maxm. This will also disable other features.
Instead, just ignore the warnings and errors of pylance by setting below in settings.json of .vscode.
```
"python.analysis.ignore": [
"*"
]
```
The other features will be present with out disabling pylance.
| null | CC BY-SA 4.0 | null | 2023-01-10T15:04:02.680 | 2023-01-10T15:04:02.680 | null | null | 19,483,429 | null |
75,072,036 | 2 | null | 75,071,923 | 1 | null | When you are trying to fetch multiple documents using a collection reference or query, then you must use `getDocs()`:
```
const finishReservation = async () => {
try {
const freeTimeRef = collection(db, `${barber}`);
const q = query(freeTimeRef);
const querySnap = await getDocs(q);
const updates = [];
querySnap.forEach((d) => {
const radnoVrijeme = d.data().radno_vrijeme;
const index = radnoVrijeme["Mon"].indexOf(hour);
radnoVrijeme["Mon"].splice(index, 1);
const radnoVrijemeMap = new Map(Object.entries(radnoVrijeme));
updates.push(updateDoc(d.ref, { radno_vrijeme: radnoVrijemeMap }))
});
await Promise.all(updates);
console.log("Documents updated")
} catch (error) {
console.log(error);
}
};
```
`getDoc()` is used to fetch a single document using a document reference.
| null | CC BY-SA 4.0 | null | 2023-01-10T15:16:23.870 | 2023-01-10T15:24:39.413 | 2023-01-10T15:24:39.413 | 13,130,697 | 13,130,697 | null |
75,072,606 | 2 | null | 75,071,648 | 0 | null | Try `alpha(0.5)`, either in the `rose2` function or at the bottom of your script to get the transparency you want.
Also, try `polaraxes` to define the font size.
```
ax = polaraxes;
ax.FontSize = 25;
```
| null | CC BY-SA 4.0 | null | 2023-01-10T15:58:15.447 | 2023-01-10T15:58:15.447 | null | null | 2,338,750 | null |
75,072,688 | 2 | null | 75,071,851 | 0 | null | ok, it turns out "sequence" was not getting all the data from the fixedDocument so I used the FixedDocument paginator instead
```
For pageCount As Integer = 0 To fd.DocumentPaginator.PageCount - 1
Dim page As DocumentPage = fd.DocumentPaginator.GetPage(pageCount)
```
| null | CC BY-SA 4.0 | null | 2023-01-10T16:05:16.013 | 2023-01-10T16:05:39.690 | 2023-01-10T16:05:39.690 | 18,272,295 | 18,272,295 | null |
75,073,101 | 2 | null | 75,072,978 | 0 | null | Use:
```
df[df.step<3].set_index(['ref','step']).unstack()
```
output:
```
var_1 var_2 var_3
step 1 2 1 2 1 2
ref
ref1 5 7 11 8 11 8
ref2 12 9 6 9 6 9
```
| null | CC BY-SA 4.0 | null | 2023-01-10T16:35:21.397 | 2023-01-10T16:41:24.817 | 2023-01-10T16:41:24.817 | 13,505,957 | 13,505,957 | null |
75,073,134 | 2 | null | 74,562,929 | 0 | null | Following comment.
Data:
```
data <- structure(list(Anos = c("2021", "2022", "2021", "2022", "2021", "2022"),
Value = c(12539517L, 5418597L, 3827159L, 4457460L, 8712360L, 961152L),
Tipo = c("IN", "IN", "OUT", "OUT", "NET", "NET")),
row.names = c(NA, -6L),
class = c("data.table", "data.frame"))
```
Changing upstream the `Tipo` levels:
```
data$Tipo <- factor(data$Tipo, levels = c("IN", "OUT", "NET"))
```
Plot:
```
hchart(data,type = "column", hcaes(x = Anos , y = Value, group = Tipo )) %>%
hc_xAxis(title = NULL) %>%
hc_yAxis(title = "undefined") %>%
hc_exporting(enabled = TRUE) %>%
hc_colors(c("#336600","#990000","#006666"))
```
[](https://i.stack.imgur.com/XPfYm.png)
| null | CC BY-SA 4.0 | null | 2023-01-10T16:38:11.253 | 2023-01-10T16:38:11.253 | null | null | 20,592,106 | null |
75,073,166 | 2 | null | 75,072,978 | 2 | null | Try this using the new "walrus" operator in a one-liner:
```
(df_new := df.set_index(['ref', 'step']).unstack().sort_index(level=1, axis=1))\
.set_axis([f'step {j} - {i}' for i, j in df_new.columns], axis=1)
```
Output:
```
step 1 - var_1 step 1 - var_2 step 1 - var_3 step 2 - var_1 step 2 - var_2 step 2 - var_3 step 3 - var_1 step 3 - var_2 step 3 - var_3 step 4 - var_1 step 4 - var_2 step 4 - var_3
ref
ref1 5 11 11 7 8 8 7 10 10 9 6 6
ref2 12 6 6 9 9 9 87 12 12 90 9 9
```
Details:
- `set_index`- `unstack`- `sort_index`- `set_axis`
Alternative way with same out put with order as above,
```
df_out = df.pivot(index='ref', columns='step').sort_index(level=1, axis=1)
df_out.columns = [f'step {j} - {i}' for i, j in df_out.columns]
```
| null | CC BY-SA 4.0 | null | 2023-01-10T16:40:20.603 | 2023-01-10T16:49:19.753 | 2023-01-10T16:49:19.753 | 6,361,531 | 6,361,531 | null |
75,073,197 | 2 | null | 75,072,978 | 0 | null | The trick is to use [df.pivot](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.pivot.html?highlight=pivot#pandas.DataFrame.pivot). You can choose the `index='ref'` and `columns='step'`:
```
new = df.pivot(index='ref', columns='step')
```
The resulting table has a multi-index for `ref` and a multi-column. The multi-column has the step and var information, so we can use that to make the new column headers. Finally, we can reset the index:
```
new.columns = [f'step {x[1]} - {x[0]}' for x in new.columns]
new = new.reset_index()
```
| null | CC BY-SA 4.0 | null | 2023-01-10T16:42:33.313 | 2023-01-10T16:42:33.313 | null | null | 5,037,133 | null |
75,073,218 | 2 | null | 75,027,965 | 0 | null | Your recipe supports dlt-system via `PACKAGECONFIG`.
In order to activate that flags in the compilation process, you just need to add `dlt-system` to `PACKAGECONFIG` in `.bb` or `.bbappend` file to the recipe:
```
PACKAGECONFIG_append = " dlt-system"
```
If you want to add it from `local.conf`:
```
PACKAGECONFIG_pn-name_append = " dlt-system"
```
Just change `name` with your recipe name.
This will add `-DWITH_DLT_SYSTEM=ON` to `EXTRA_OECMAKE` which is used in `do_configure` of the `cmake` class.
| null | CC BY-SA 4.0 | null | 2023-01-10T16:44:27.600 | 2023-01-10T16:44:27.600 | null | null | 7,553,704 | null |
75,073,264 | 2 | null | 54,873,109 | 0 | null | I faced this issue. I resolved this using pip instead of pip3 for installation liblaries
| null | CC BY-SA 4.0 | null | 2023-01-10T16:48:04.647 | 2023-01-10T16:48:04.647 | null | null | 12,253,044 | null |
75,073,464 | 2 | null | 75,056,594 | 0 | null | Your issues will remain unless you drop some xticklabels or better use loglog to plot which retains the feature of parabolic data.
Use following lines in your code:
loglog(M, s1, 'ko-', 'LineWidth', 1); hold on; %
You will get this result [1](https://i.stack.imgur.com/fiTO0.jpg)
| null | CC BY-SA 4.0 | null | 2023-01-10T17:06:24.867 | 2023-01-10T17:08:15.910 | 2023-01-10T17:08:15.910 | 19,780,945 | 19,780,945 | null |
75,073,636 | 2 | null | 75,073,467 | 0 | null | This is a little bit trickee since all attributes of that X button element and it parent elements seems to be dynamic. Also that X text is not `x` or `X` letter.
So, I located it saying: "give me a button element containing some text but not containing 'OTP' text". This give an unique locator and the folllowing code works:
```
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
options = Options()
options.add_argument("start-maximized")
webdriver_service = Service('C:\webdrivers\chromedriver.exe')
driver = webdriver.Chrome(options=options, service=webdriver_service)
wait = WebDriverWait(driver, 10)
url = "https://www.flipkart.com/"
driver.get(url)
wait.until(EC.element_to_be_clickable((By.XPATH, "//button[text()][not(contains(.,'OTP'))]"))).click()
```
| null | CC BY-SA 4.0 | null | 2023-01-10T17:19:42.783 | 2023-01-10T17:19:42.783 | null | null | 3,485,434 | null |
75,073,967 | 2 | null | 75,073,467 | 0 | null | Another alternative solution would be issuing a random positioned click to dismiss the login window. For an example
```
driver.execute_script('el = document.elementFromPoint(47, 457); el.click();')
```
| null | CC BY-SA 4.0 | null | 2023-01-10T17:51:53.500 | 2023-01-10T17:51:53.500 | null | null | 7,738,453 | null |
75,074,304 | 2 | null | 75,074,245 | -1 | null | Your list doesn't contain items and you are trying to read the first item ([0]), that not exists.
Try something like this: The validation must be always less than the quantity and the quantity must be greater than zero on Count() property:
```
if(this.cmp < Program.ouvrage.Auteur.Count() && Program.ouvrage.Auteur.Count() >0)
{
textBox3.Text = Program.ouvrage.Auteur[this.cmp];
}
else
{
textBox3.Text = "The list doesn't contain items";
}
```
| null | CC BY-SA 4.0 | null | 2023-01-10T18:25:15.083 | 2023-01-10T18:30:21.780 | 2023-01-10T18:30:21.780 | 13,923,863 | 13,923,863 | null |
75,074,747 | 2 | null | 75,066,721 | 0 | null | The MQTT proxy only sends binary data (bytes or strings), and Control Center can only show strings.
You will want to verify the Kafka producer settings to see if it is truly sending JSON, and not other binary format, or compressed/encrypted bytes.
You can further debug with `kafka-console-consumer`, rather than use any UI tool
| null | CC BY-SA 4.0 | null | 2023-01-10T19:10:28.933 | 2023-01-10T19:10:28.933 | null | null | 2,308,683 | null |
75,074,851 | 2 | null | 75,048,553 | 0 | null | You appear to be querying the `process_open_sockets` table, which is about "Processes which have open network sockets on the system".
I'm not sure what tables, if any, contain the configured information for the network interface. You'd need to peruse [https://osquery.io/schema/](https://osquery.io/schema/) to find something appropriate.
| null | CC BY-SA 4.0 | null | 2023-01-10T19:19:32.453 | 2023-01-10T19:19:32.453 | null | null | 718,270 | null |
75,075,123 | 2 | null | 75,011,617 | 0 | null | Perhaps the second sentence of the Python turtle documentation might answer your question:
> Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an
import turtle, give it the command turtle.forward(15), and it moves
(on-screen!) 15 pixels in the direction it is facing, drawing a line
as it moves.
As far as I know, turtle operates in units of screen pixels:
```
>>> from turtle import *
>>> print(position())
(0.00,0.00)
>>> forward(20)
>>> print(position())
(20.00,0.00)
>>>
```
| null | CC BY-SA 4.0 | null | 2023-01-10T19:49:26.917 | 2023-01-10T19:49:26.917 | null | null | 5,771,269 | null |
75,075,299 | 2 | null | 17,276,571 | 3 | null |
In recent Dymola versions there is user dialog with filter function for all flags. You can find it at
Tools → Options → Variables.
[](https://i.stack.imgur.com/Eqa3C.png)
[](https://i.stack.imgur.com/wFeFD.png)
| null | CC BY-SA 4.0 | null | 2023-01-10T20:08:26.333 | 2023-01-12T08:38:35.417 | 2023-01-12T08:38:35.417 | 874,701 | 11,766,904 | null |
75,075,529 | 2 | null | 74,474,412 | 0 | null | According to [Storm docs](https://storm.apache.org/releases/2.0.0/Metrics.html)
So, it is the time between your rabbitmq-spout emitted tuple and the last bolt acked it.
Storm has an internal queue to make pressure, the maximum size of this queue is defined in topology.max.spout.pending variable in configs. If you set it to a high value your rabbit consumer would read messages from the rabbit to fulfil this queue ahead of real processing with bolts in topology, causing the wrong measure of real latency of your topology.
In the RabbitMQ panel, you see how fast messages are consumed from it, not how they are processed, you compare hot and round.
To measure latency I would recommend running your topology for a couple of days, 202 seconds according to your screenshot is too tight.
| null | CC BY-SA 4.0 | null | 2023-01-10T20:34:07.310 | 2023-01-10T20:34:07.310 | null | null | 6,133,008 | null |
75,075,946 | 2 | null | 75,072,978 | 2 | null | One option is with [pivot_wider](https://pyjanitor-devs.github.io/pyjanitor/api/functions/#janitor.functions.pivot.pivot_wider) from [pyjnanitor](https://pyjanitor-devs.github.io/pyjanitor/), to abstract the column renaming via the `names_glue` parameter:
```
# pip insall pyjanitor
import pandas as pd
import janitor
(df
.pivot_wider(
index='ref',
names_from='step',
values_from = ['var_1', 'var_2', 'var_3'],
names_glue = "step {step} - {_value}")
.sort_index(axis=1)
)
ref step 1 - var_1 step 1 - var_2 step 1 - var_3 ... step 3 - var_3 step 4 - var_1 step 4 - var_2 step 4 - var_3
0 ref1 5 11 11 ... 10 9 6 6
1 ref2 12 6 6 ... 12 90 9 9
[2 rows x 13 columns]
```
`names_glue` allows a combination of the `values_from` and `names_from` parameters - in the code above `{step}` is the names_from argument, while `{_value}` is a placeholder for `values_from`
If we stick strictly to your output, then a filter should be executed on the `step` column for only values less than 3:
```
(df
.loc[df.step < 3]
.pivot_wider(
index='ref',
names_from='step',
names_glue = "step {step} - {_value}")
.sort_index(axis=1)
)
ref step 1 - var_1 step 1 - var_2 step 1 - var_3 step 2 - var_1 step 2 - var_2 step 2 - var_3
0 ref1 5 11 11 7 8 8
1 ref2 12 6 6 9 9 9
```
| null | CC BY-SA 4.0 | null | 2023-01-10T21:16:36.330 | 2023-01-10T21:16:36.330 | null | null | 7,175,713 | null |
75,075,976 | 2 | null | 75,075,336 | 0 | null | Looking at OPs `vertices`, I noticed that there are 24 of them although a cube has 8 corners only. That's not surprising as coordinates for the same corner may correspond to distinct vertex coordinates depending on which face it belongs to.
Hence, it makes sense to define coordinates and corresponding texture coordinates per face, i.e. 6 faces with 4 corners each face -> 24 coordinates.
I enriched OPs code with enumeration:
```
vertices = {
// front face
0.0f, 0.0f, 0.0f, // 0
length, 0.0f, 0.0f, // 1
length, height, 0.0f, // 2
0.0f, height, 0.0f, // 3
// back face
0.0f, 0.0f, width, // 4
length, 0.0f, width, // 5
length, height, width, // 6
0.0f, height, width, // 7
// left face
0.0f, 0.0f, 0.0f, // 8
0.0f, 0.0f, width, // 9
0.0f, height, width, // 10
0.0f, height, 0.0f, // 11
// right face
length, 0.0f, 0.0f, // 12
length, 0.0f, width, // 13
length, height, width, // 14
length, height, 0.0f, // 15
// top face
0.0f, height, 0.0f, // 16
length, height, 0.0f, // 17
length, height, width, // 18
0.0f, height, width, // 29
// bottom face
0.0f, 0.0f, 0.0f, // 20
length, 0.0f, 0.0f, // 21
length, 0.0f, width, // 22
0.0f, 0.0f, width // 23
};
uvs = {
// front face
0.0f, 0.0f, // 0
1.0f, 0.0f, // 1
1.0f, 1.0f, // 2
0.0f, 1.0f, // 3
// back face
0.0f, 0.0f, // 4
1.0f, 0.0f, // 5
1.0f, 1.0f, // 6
0.0f, 1.0f, // 7
// left face
0.0f, 0.0f, // 8
0.0f, 0.0f, // 9
0.0f, 1.0f, // 10
0.0f, 1.0f, // 11
// right face
1.0f, 0.0f, // 12
1.0f, 0.0f, // 13
1.0f, 1.0f, // 14
1.0f, 1.0f, // 15
// top face
0.0f, 1.0f, // 16
1.0f, 1.0f, // 17
1.0f, 1.0f, // 18
0.0f, 1.0f, // 29
// bottom face
0.0f, 0.0f, // 20
1.0f, 0.0f, // 21
1.0f, 0.0f, // 22
0.0f, 0.0f // 23
};
```
But then I took a closer look what the indices look-up:
```
indices = {
// ...
// right face
1, 5, 6, // -> UV: { 1.0f, 0.0f }, { 1.0f, 0.0f }, { 1.0f, 1.0f }
6, 2, 1, // -> UV: { 1.0f, 1.0f }, { 1.0f, 1.0f }, { 1.0f, 0.0f }
// ...
}
```
There are only two distinct values of texture coordinates but there should be four of them. Hence, it's not a surprise if the texture projection of that right face looks strange.
OP noted the wrong indices. This doesn't manifest in the geometry as the wrong indices address coordinates (`vertices`) with identical values. However, concerning the texture coordinates (`uvs`) these indices are just wrong.
According to the added index values, I corrected the indices for the right face:
```
indices = {
// ...
// right face
12, 13, 14,
14, 15, 12,
// ...
}
```
The `indices` of the top face are defined correctly but the other faces have to be checked as well. (I leave this as "homework" to OP. Or, like a colleague of mine used to say: Not to punish just to practice.) ;-)
---
On the second glance, I realized that OP's texture coordinates are wrong as well.
To understand how texture coordinates work:
There is a uv coordinate system applied to the image with
- - -
of the image.
[](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/)
taken from [opengl-tutorial – Tutorial 5: A Textured Cube](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-5-a-textured-cube/)
Hence, using my
```
uvs = {
// ...
// right face
1.0f, 0.0f, // 12
1.0f, 0.0f, // 13
1.0f, 1.0f, // 14
1.0f, 1.0f, // 15
// ...
};
```
provides two times the lower right corner and two times the upper right corner. The result of such texture projection are stripes instead of bricks.
A better result should be achieved by repeating the texture coordinates of the front face 6 times:
```
uvs = {
// ...
// right face
0.0f, 0.0f, // 12
1.0f, 0.0f, // 13
1.0f, 1.0f, // 14
0.0f, 1.0f, // 15
// ...
};
```
| null | CC BY-SA 4.0 | null | 2023-01-10T21:19:00.327 | 2023-01-11T13:42:58.667 | 2023-01-11T13:42:58.667 | 7,478,597 | 7,478,597 | null |
75,076,106 | 2 | null | 75,073,458 | 0 | null | None of that stuff is in Vee-Validate version 4.7.3. You need to use an older version if you want ValidationObserver and ValidationProvider. Try this:
```
"vee-validate": "^3.1.0",
```
| null | CC BY-SA 4.0 | null | 2023-01-10T21:35:24.737 | 2023-01-10T21:35:24.737 | null | null | 312,208 | null |
75,076,976 | 2 | null | 75,076,934 | 0 | null | You could use capture groups here:
```
inp = "08/26 Card Purchase blah blah IL Card 0000 $14.00"
output = re.sub(r'^(\S*)\s+(.*?)\s+(\S*)$', r'\1|\2|\3', inp)
print(output) # 08/26|Card Purchase blah blah IL Card 0000|$14.00
```
This regex approach works by matching:
- `^`- `(\S*)``\1`- `\s+`- `(.*?)``\2`- `\s+`- `(\S*)``\3`- `$`
Essentially the above is using a splicing trick to remove the first and last whitespace.
| null | CC BY-SA 4.0 | null | 2023-01-10T23:43:04.457 | 2023-01-10T23:43:04.457 | null | null | 1,863,229 | null |
75,077,001 | 2 | null | 25,629,933 | 0 | null | This is what I use to exchange RSA keys between multiple hosts (many to many). I have variations that create the user accounts with the key pairs and also to deal with 'one to many' and 'many to one' scenarios.
```
#:TASK: Exchange SSH RSA keys between multiple hosts (many to many)
#:....: RSA keypairs are created as required at play (1)
#:....: authorized_keys updated at play <root user (2a.1 & 2a.2)>, <non root user (2b.1)>
#:....: -- We need a 2a or 2b option becasue there is a 'chicken & egg' issue for the root user!
#:....: known_hosts files are updated at play (3)
#:REQD: *IF* your security policy allows:
#:....: -- Add 'host_key_checking = False' to ansible.cfg
#:....: -- Or use one of the variations of 'StrictHostKeyChecking=no' elsewhere:
#:....: e.g. inventory setting - ansible_ssh_common_args='-o StrictHostKeyChecking=no'
#:....: - or - host variable - ansible_ssh_extra_args='-o StrictHostKeyChecking=no'
#:USER: RUN this as the 'root' user; it hasn't been tested or adapted to be run as any other user
#:EXEC: ansible-playbook <playbook>.yml -e "nodes=<inventory_hosts> user=<username>"
#:VERS: 20230119.01
#
---
- name: Exchange RSA keys and update known_hosts between multiple hosts
hosts: "{{ nodes }}"
vars:
ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
tasks:
- name: (1) Generate an SSH RSA key pair
community.crypto.openssh_keypair:
path: "~{{ user }}/.ssh/id_rsa"
comment: "{{ user }}@{{ ip }}"
size: 2048
- name: (2) Retrieve RSA key/s then exchange it with other hosts
block:
- name: (2a.1) Retrieve client public RSA key/s to a variable
slurp:
src: ".ssh/id_rsa.pub"
register: rsa_key
# Using the debug module here seems to make the slurp above more reliable
# as during testing not all hosts that were slurped worked.
- debug:
msg: "{{ rsa_key['content'] | b64decode }} / {{ ip }} / {{ user }}"
- name: (2a.2) Exchange RSA keys between hosts and update authorized_key files
delegate_to: "{{ item }}"
authorized_key:
user: "{{ user }}"
key: "{{ rsa_key['content'] | b64decode }}"
with_items:
- "{{ ansible_play_hosts }}"
when: item != inventory_hostname
when: user == "root"
- name: (2b.1) Exchange RSA keys between hosts and update authorized_key files
block:
- delegate_to: "{{ item }}"
authorized_key:
user: "{{ user }}"
key: "{{ rsa_key['content'] | b64decode }}"
with_items:
- "{{ ansible_play_hosts }}"
when: item != inventory_hostname
when: user != "root"
- name: (3) Ensure nodes are present in known_hosts file
become: yes
become_user: "{{ user }}"
known_hosts:
name: "{{ item }}"
path: "~{{ user }}/.ssh/known_hosts"
key: "{{ lookup('pipe', 'ssh-keyscan -t rsa {{ item }}') }}"
when: item != inventory_hostname
with_items:
- "{{ ansible_play_hosts }}"
```
| null | CC BY-SA 4.0 | null | 2023-01-10T23:48:16.540 | 2023-01-19T08:21:55.590 | 2023-01-19T08:21:55.590 | 20,712,052 | 20,712,052 | null |
75,077,019 | 2 | null | 75,073,467 | 0 | null | The element opens in a
---
To [click()](https://stackoverflow.com/a/70077251/7429447) on the desired element you need to induce [WebDriverWait](https://stackoverflow.com/a/59130336/7429447) for the [element_to_be_clickable()](https://stackoverflow.com/a/54194511/7429447) and you can use the following [locator strategy](https://stackoverflow.com/a/48056120/7429447):
- Using :```
driver.get('https://www.flipkart.com/')
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//button[text()='✕']"))).click()
```
- : You have to add the following imports :```
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
```
| null | CC BY-SA 4.0 | null | 2023-01-10T23:51:44.023 | 2023-01-10T23:51:44.023 | null | null | 7,429,447 | null |
75,077,137 | 2 | null | 75,064,219 | 0 | null | The [docs](https://docs.github.com/en/pages/setting-up-a-github-pages-site-with-jekyll/creating-a-github-pages-site-with-jekyll) are confusing. Just add a Gemfile to the root of your project with the following content:
```
source "https://rubygems.org"
gem 'github-pages', group: :jekyll_plugins
```
| null | CC BY-SA 4.0 | null | 2023-01-11T00:11:25.377 | 2023-01-11T00:11:25.377 | null | null | 3,842,598 | null |
75,077,267 | 2 | null | 75,077,243 | 0 | null | > [](https://i.stack.imgur.com/AIaEC.png)
use:
```
=VLOOKUP(G4&H3; INDEX(SPLIT(FLATTEN(A3:A10&B2:E2&"×"&B3:E10); "×")); 2; )
```
| null | CC BY-SA 4.0 | null | 2023-01-11T00:36:59.603 | 2023-01-11T01:51:07.723 | 2023-01-11T01:51:07.723 | 5,632,629 | 5,632,629 | null |
75,077,757 | 2 | null | 75,077,184 | 0 | null | You can try adding this dependency to add gif animation:
```
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.25'
```
and use FrameLayout.
As an alternative, consider the using the [MotionLayout widget](https://developer.android.com/develop/ui/views/animations/motionlayout) to manage motion and widget animation.
| null | CC BY-SA 4.0 | null | 2023-01-11T02:28:30.687 | 2023-01-12T00:00:23.960 | 2023-01-12T00:00:23.960 | 238,704 | 12,635,625 | null |
75,078,424 | 2 | null | 75,066,325 | 0 | null | Does this work for you?
```
Option Explicit
Sub WbClkMe()
Dim IE As New SHDocVw.InternetExplorer
Dim HTMLDoc As MSHTML.HTMLDocument
Dim HTMLInput As MSHTML.IHTMLElement
Dim HTMLButton As MSHTML.IHTMLElement
IE.Visible = True
IE.navigate "https://apiweb.biomerieux.com/login"
Do While IE.readyState <> READYSTATE_COMPLETE
Loop
Set HTMLDoc = IE.document
Set HTMLInput = HTMLDoc.getElementById("signupEmail") ' This is based on on your website
HTMLInput.Value = "" 'Put the value of Usernamae
Set HTMLInput = HTMLDoc.getElementById("signupPassword") 'This is based on on your website
HTMLInput.Value = "" 'Put the value of Password
Set HTMLButton = HTMLDoc.getElementById("signupSubmit") 'This is based on on your website
HTMLButton.Click
End Sub
```
Or, maybe this?
```
Sub WebsiteLogin()
Const url As String = "https://login.my_site_here.jsp"
Const userName As String = "Here Your LogIn Name"
Const passWord As String = "Here Your Password"
Dim ie As Object
Dim htmlDoc As Object
Dim nodeInputUserName As Object
Dim nodeInputPassWord As Object
'Initialize Internet Explorer, set visibility,
'call URL and wait until page is fully loaded
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.navigate url
Do Until ie.readyState = 4: DoEvents: Loop
Set htmlDoc = ie.document
'Set the log in name
Set nodeInputUserName = htmlDoc.getElementById("USERID")
nodeInputUserName.Value = userName
Call TriggerEvent(htmlDoc, nodeInputUserName, "onkeypress")
'Set the password
Set nodeInputPassWord = htmlDoc.getElementById("PASSWORD")
nodeInputPassWord.Value = passWord
Call TriggerEvent(htmlDoc, nodeInputPassWord, "onkeypress")
'Click submit button
htmlDoc.querySelector("a[role='button']").Click
End Sub
' This is the procedure to trigger events:
Private Sub TriggerEvent(htmlDocument As Object, htmlElementWithEvent As Object, eventType As String)
Dim theEvent As Object
htmlElementWithEvent.Focus
Set theEvent = htmlDocument.createEvent("HTMLEvents")
theEvent.initEvent eventType, True, False
htmlElementWithEvent.dispatchEvent theEvent
End Sub
```
| null | CC BY-SA 4.0 | null | 2023-01-11T04:42:57.900 | 2023-01-11T04:42:57.900 | null | null | 5,212,614 | null |
75,078,735 | 2 | null | 28,201,613 | 0 | null | I was using bootstraps jQuery tooltip, the one with `data-toggle="tooltip"` and using the selector`.tooltip-inner` worked for me. Followed the bootstrap doc guidelines.
| null | CC BY-SA 4.0 | null | 2023-01-11T05:39:36.567 | 2023-01-11T16:41:01.380 | 2023-01-11T16:41:01.380 | 14,267,427 | 14,679,522 | null |
75,078,810 | 2 | null | 39,617,997 | 1 | null | 
Click on the `...` in the emulator and click on settings -> "" will be switched on. Change it to and browse the location of `adb.exe` under platform tools.
| null | CC BY-SA 4.0 | null | 2023-01-11T05:49:58.450 | 2023-01-13T07:55:17.420 | 2023-01-13T07:55:17.420 | 7,699,617 | 19,524,176 | null |
75,078,858 | 2 | null | 75,063,126 | 0 | null | Put the `changeCurrency()` in your useEffectHook.
This is happening because when you call `setCurrency` to update your state it does not update it instantly, instead it throws it in a queue which will not take effect until you current running stack gets empty. As a result you don't get the currency state updated instantly.
And I would recommend you to take look at this react documentation
Which will describe you why this is happening in details
[React state as a snapshot](https://beta.reactjs.org/learn/state-as-a-snapshot)
| null | CC BY-SA 4.0 | null | 2023-01-11T05:58:01.420 | 2023-01-11T05:58:01.420 | null | null | 11,229,002 | null |
75,079,020 | 2 | null | 75,078,805 | 1 | null | You can make the months a factor as follows:
```
fina_result<- read_csv("my_final_project.csv")
fina_result$months <- factor(fina_result$months, levels = c("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"))
fina_result %>%
ggplot(aes(x = weekday, y = `count of ride_id`, fill = user_type)) +
geom_col(position = "dodge") +
facet_wrap(~months) +
theme(axis.text.x = element_text(angle = 45))
```
This will set the order of the levels to the order you specified.
| null | CC BY-SA 4.0 | null | 2023-01-11T06:19:55.893 | 2023-01-11T06:19:55.893 | null | null | 8,589,078 | null |
75,079,094 | 2 | null | 75,078,612 | 0 | null | your function will not work because you have tried to get elements by id that will pick only the first occurrence of element.
so you can use "this" and "closest" like this
```
function checkRequestType(e){
var element = e;
var target = element.parentElement.nextSibling.firstChild;
if(element.value == "Other"){
target.disabled = true;
}else{
target.disabled = false;
}
}
```
add this function like this
```
<select onchange="checkRequestType(this)">
```
| null | CC BY-SA 4.0 | null | 2023-01-11T06:30:44.233 | 2023-01-11T08:25:17.073 | 2023-01-11T08:25:17.073 | 19,663,148 | 19,663,148 | null |
75,079,134 | 2 | null | 75,057,079 | 0 | null | This may help you, Execute query as below:
```
SELECT *
FROM tickets
GROUP BY device_id
HAVING key_field = MAX(key_field)
ORDER BY device_id ASC
```
Will produce result as you expected:
| Key | ID device | ticket Number |
| --- | --------- | ------------- |
| 212 | 1 | 594 |
| 211 | 2 | 147 |
| null | CC BY-SA 4.0 | null | 2023-01-11T06:35:34.917 | 2023-01-11T06:35:34.917 | null | null | 8,578,193 | null |
75,079,467 | 2 | null | 75,077,243 | 0 | null | Excel provides built-in two-dimensional lookup functionality with the INDEX() function. In this case, what you are trying to find is simply `=INDEX(B3:E10, row, col )`. So all we need is to identify the row number and column number:
- `MATCH(G4, A3:A10, 0)`- `MATCH(H3, B2:E2, 0)`
Thus in cell H4:
`=INDEX(B3:E10, MATCH(G4,A3:A10,0), MATCH(H3,B2:E2,0) )`
| null | CC BY-SA 4.0 | null | 2023-01-11T07:15:52.697 | 2023-01-11T18:08:32.167 | 2023-01-11T18:08:32.167 | 19,662,289 | 19,662,289 | null |
75,079,614 | 2 | null | 75,079,499 | 0 | null | Manual for `OPENJSON()` : [https://learn.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16](https://learn.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16)
```
SELECT
*
FROM
your_table
CROSS APPLY
OPENJSON(your_table.genres)
WITH
(
genre_id INT N'$.id'
genre_name NVARCHAR(MAX) N'$.name'
)
AS genre
```
| null | CC BY-SA 4.0 | null | 2023-01-11T07:33:35.193 | 2023-01-11T07:33:35.193 | null | null | 53,341 | null |
75,079,864 | 2 | null | 75,077,907 | 0 | null | It's not connected with the "asynchronous timer" (whatever it means), it's classic [OutOfMemoryError exception](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/memleaks002.html)
The reason is that JVM asks the underlying operating system to create a new native thread and the process fails somewhere somehow, the reasons could be in:
- - - [/proc/sys/kernel/threads-max](https://sysctl-explorer.net/kernel/threadsmax/)
So you either need to amend your JVM/OS configuration or will have to allocate another machine and switch to [Distributed Testing](https://www.blazemeter.com/blog/distributed-testing-in-jmeter)
More information: [java.lang.OutOfMemoryError: Unable to create new native thread](https://plumbr.io/outofmemoryerror/unable-to-create-new-native-thread)
| null | CC BY-SA 4.0 | null | 2023-01-11T07:59:43.467 | 2023-01-11T07:59:43.467 | null | null | 2,897,748 | null |
75,079,882 | 2 | null | 17,932,929 | 0 | null | In Themes.xml
create a separate style
```
<style name="Theme.AppName.NoActionBar">
<item name="android:theme"> @style/Theme.AppCompat.Light</item>
</style>
```
And
```
android:theme="@style/Theme.AppName.NoActionBar"
```
| null | CC BY-SA 4.0 | null | 2023-01-11T08:01:11.523 | 2023-01-11T15:46:03.327 | 2023-01-11T15:46:03.327 | 3,894,930 | 20,980,847 | null |
75,079,945 | 2 | null | 75,017,110 | 0 | null | I tried to reproduce the same in my environment:
```
resource "azurerm_web_application_firewall_policy" "example" {
name = "example_wafpolicy_name"
location = data.azurerm_resource_group.example.location
resource_group_name = data.azurerm_resource_group.example.name
custom_rules {
name = "Rule1"
priority = 1
rule_type = "MatchRule"
match_conditions {
match_variables {
variable_name = "RemoteAddr"
}
operator = "IPMatch"
negation_condition = true
match_values = ["x.x.x.x"]
}
action = "Block"
}
policy_settings {
....
}
managed_rules {
managed_rule_set {
.....
}
}
}
resource "azurerm_application_gateway" "app_gateway" {
name = "myAppGateway"
location = data.azurerm_resource_group.example.location
resource_group_name = data.azurerm_resource_group.example.name
sku {
name = "WAF_v2"
tier = "WAF_v2"
capacity = 2
}
gateway_ip_configuration {
name = "my-gateway-ip-configuration"
subnet_id = module.agw_subnet.id
}
frontend_port {
name = var.frontend_port_name
port = 80
}
frontend_ip_configuration {
name = var.frontend_ip_configuration_name
public_ip_address_id = module.app_gw_pip.id
}
backend_address_pool {
name = "devBackend"
ip_addresses = ["10.22.40.19"]
}
backend_http_settings {
name = "devHttpSetting"
cookie_based_affinity = "Disabled"
port = 80
protocol = "Http"
request_timeout = 20
host_name = "xxxx.be"
probe_name = "apim-probe"
}
probe {
interval = 30
name = "apim-probe"
path = "/status-0123456789abcdef"
protocol = "Http"
timeout = 30
unhealthy_threshold = 3
pick_host_name_from_backend_http_settings = true
match {
body = ""
status_code = [
"200-399"
]
}
}
http_listener {
name = "devListener"
frontend_ip_configuration_name = var.frontend_ip_configuration_name
frontend_port_name = var.frontend_port_name
protocol = "Http"
host_name = "xxxx.be"
firewall_policy_id = azurerm_web_application_firewall_policy.exampleWAF.id
}
request_routing_rule {
name = "devRule"
rule_type = "Basic"
priority = 25
http_listener_name = "devListener"
backend_address_pool_name = "devBackend"
backend_http_settings_name = "devHttpSetting"
}
............
```
I got some parallel errors :
[](https://i.stack.imgur.com/khQMk.png)
Please note that :
>
For that set up a virtual network for your resource. From that solution, it creates subnets for Application Gateway and API Management.
[](https://i.stack.imgur.com/gXqLD.png)
See [Protect APIs with Azure Application Gateway and Azure API Management - Azure Reference Architectures | Microsoft Learn](https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/apis/protect-apis) .
| null | CC BY-SA 4.0 | null | 2023-01-11T08:07:58.020 | 2023-01-11T08:17:33.940 | 2023-01-11T08:17:33.940 | 15,997,509 | 15,997,509 | null |
75,080,169 | 2 | null | 75,079,258 | 4 | null | You are asking about how to do an match to the option "Numeric", so that the option "AlphaNumeric" is excluded from the search.
To do this, change your `cy.contains()` command to use a regular expression. This allows the `start-of-string` and `end-of-string` tokens to be included in the expression, and therefore gives you and exact match.
`^` is start-of-string and `$` is end-of-string.
```
// cy.contains('[role=option', 'Numeric') //matches two options
cy.contains('[role=option', /^Numeric$/) //matches one option only
```
| null | CC BY-SA 4.0 | null | 2023-01-11T08:29:51.173 | 2023-01-11T08:41:55.990 | 2023-01-11T08:41:55.990 | 20,981,031 | 20,981,031 | null |
75,080,293 | 2 | null | 75,080,130 | 0 | null | You need to set the card's width first of all. For responsiveness, go for `max-width`.
In this example, Im using [flexbox](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) along with `max-with:400px` (change to your needs) for each card. With those few extra lines, your `row` will be responsive. (In my example, they are centered in the middle of the page, you can change that by playing with `justify-content`).
```
.row {
width: 100%;
display: flex;
flex-wrap: wrap;
flex-direction: row;
justify-content: center;
}
.row div {
border: 1px solid black;
max-width: 400px;
padding: 0px;
margin: 10px;
background-color: #FFFFF5;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T08:41:52.670 | 2023-01-11T08:47:44.043 | 2023-01-11T08:47:44.043 | 20,919,260 | 20,919,260 | null |
75,080,299 | 2 | null | 75,079,276 | 0 | null | You can't assign, the types are incompatible. You can use the map constructor that takes a list as argument
```
Map<Id, Account> myMap = new Map<Id, Account>([SELECT Id, Name FROM Account LIMIT 10]);
```
or if you have existing map - you can call `putAll` on it.
```
Map<Id, Account> myMap = new Map<Id, Account>();
// some other code, maybe even adding some items to map manually
// and eventually
myMap.putAll([SELECT Id, Name FROM Account LIMIT 10]);
```
| null | CC BY-SA 4.0 | null | 2023-01-11T08:42:31.767 | 2023-01-11T08:42:31.767 | null | null | 313,628 | null |
75,080,953 | 2 | null | 75,077,032 | 1 | null | You can apply a negative padding on the view that you applied on the VStack, that means if you applied a padding of 16 points to the VStack like this for example `.padding(16)` for all directions which is the default. then you can apply a `.padding(.horizontal,-16)` to the lines and they will stretch to the end of the screen
here is a sample code and a screenshot for the behavior you want.
[](https://i.stack.imgur.com/Hu7Tk.png)
```
struct VStackPadding: View {
var body: some View {
VStack{
RoundedRectangle(cornerRadius: 4)
.frame(width: .infinity,height: 3)
.padding(.horizontal, -16)
.padding(.bottom,16)
RoundedRectangle(cornerRadius: 4)
.frame(width: .infinity,height: 3)
}.padding(16)
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T09:39:59.047 | 2023-01-11T10:13:04.117 | 2023-01-11T10:13:04.117 | 10,297,510 | 10,297,510 | null |
75,080,968 | 2 | null | 70,398,678 | 0 | null | My solution is to using `Craco` module to override the Webpack ModuleScopePlugin and resolving it to use browser-compatible modules.
> You can also use `react-app-rewire` module.
Add other Node.js modules to the `require.resolve` field if you need.
1. Install modules
```
yarn add @craco/craco crypto-browserify path-browserify stream-browserify -D
```
1. Add craco.config.js
```
module.exports = {
webpack: {
configure: webpackConfig => {
const scopePluginIndex = webpackConfig.resolve.plugins.findIndex(
({ constructor }) => constructor && constructor.name === 'ModuleScopePlugin'
);
webpackConfig.resolve.plugins.splice(scopePluginIndex, 1);
webpackConfig['resolve'] = {
fallback: {
path: require.resolve("path-browserify"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
},
}
return webpackConfig;
},
},
};
```
1. Replace scripts fields in package.json
```
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject"
},
```
| null | CC BY-SA 4.0 | null | 2023-01-11T09:40:59.407 | 2023-01-11T09:47:58.503 | 2023-01-11T09:47:58.503 | 4,622,645 | 4,622,645 | null |
75,080,986 | 2 | null | 75,078,805 | 0 | null | Or in case you need to do this again,
```
months <- factor(month.name, levels = month.name[1:12])
```
| null | CC BY-SA 4.0 | null | 2023-01-11T09:42:58.680 | 2023-01-11T09:42:58.680 | null | null | 13,057,055 | null |
75,081,018 | 2 | null | 27,845,139 | 0 | null | This solution is only for those who use the cPanel control panel, and you must test this for other panels like aaPanel, Directadmin and others ...
Be sure to take a snapshot/checkpoint from your server before making changes.
Install the mod_suphp module through Easy Apache.
After installation from the MultiPHP Manager section:
Select suphp from the drop-down menu under the PHP Handler column
And finally, apply the changes.
Test again and if necessary type the following commands:
```
/usr/local/cpanel/bin/rebuild_phpconf –current
```
| null | CC BY-SA 4.0 | null | 2023-01-11T09:44:50.870 | 2023-01-11T09:44:50.870 | null | null | 11,234,147 | null |
75,081,059 | 2 | null | 72,439,001 | -1 | null | In case the above solution does not fix your issues: I got a similar warning together with an SSLError ("DECRYPTION_FAILED_OR_BAD_RECORD_MAC"). When I disconnected my VPN it worked.
| null | CC BY-SA 4.0 | null | 2023-01-11T09:47:38.753 | 2023-03-02T11:50:00.683 | 2023-03-02T11:50:00.683 | 13,197,595 | 12,536,388 | null |
75,081,814 | 2 | null | 75,075,336 | 0 | null | Your texture coordinates are wrong, as commented:
```
// left face
0.0f, 0.0f,
0.0f, 0.0f,
0.0f, 1.0f,
0.0f, 1.0f,
// right face
1.0f, 0.0f,
1.0f, 0.0f,
1.0f, 1.0f,
1.0f, 1.0f,
```
This tells the computer to take a single line of pixels and stretch them across the entire face. The U coordinate is the same for the whole face. It does not advance from left to right across the texture.
Same for the top and bottom faces:
```
// top face
0.0f, 1.0f,
1.0f, 1.0f,
1.0f, 1.0f,
0.0f, 1.0f,
// bottom face
0.0f, 0.0f,
1.0f, 0.0f,
1.0f, 0.0f,
0.0f, 0.0f
```
the V does not advance, so the computer keeps reading the first or last row of the texture over and over. If you want to use the entire texture, then V should be 0 on one side of the texture, and 1 on the other side. Also note the direction where U changes must be different than the direction V changes - i.e. they can't change together - or else the compute only reads the diagonal pixels where U and V are equal.
[](https://i.stack.imgur.com/1fDuX.png)
| null | CC BY-SA 4.0 | null | 2023-01-11T10:46:22.700 | 2023-01-11T10:46:22.700 | null | null | 106,104 | null |
75,082,282 | 2 | null | 75,078,612 | 0 | null | you can use this code i have test this
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
</head>
<body>
<table id="main_table" class="table">
<thead>
<tr>
<td class="border">No.</td>
<td class="border">Name</td>
<td class="border">Request Type</td>
<td class="border">Add. Information / Comment</td>
<td class="border">action</td>
</tr>
</thead>
<tbody>
<tr>
<td class="border">
<center><span id="itemNum" style="font-size: 23px;">0</span></center>
</td>
<td><input type="text" name="" class="form-control" name="requestFor" placeholder="Teacher's name"
id="floatingTextarea1"></td>
<td>
<div class="row">
<div class="col">
<select name="requestType" id="requestType" class="form-control request_type" required>
<option value="Sick leave">Sick leave</option>
<option>Other</option>
</select>
</div>
<div class="col">
<input type="text" name="requestType" id="OtherType" value="" id="school" class="form-control" disabled="disabled"
placeholder="Please Specify">
</div>
</div>
</td>
<td>
<input type="text" name="" class="form-control" name="description"
placeholder="Leave additional information/comment here" id="floatingTextarea2">
</td>
<td>
<button type="button" name="remove" id="remove" class="btn btn-danger"><i class="bi bi-x-lg"></i></button>
</td>
</tr>
</tbody>
</table>
<button class="btn btn-success" type="button" name="add" id="add">ADD</button>
<script type="text/javascript">
//---------------------------------//
//script to add new input fields---//
//---------------------------------//
$(document).ready(function () {
var html = '<tr><td class="border"><center><span id="itemNum" style="font-size: 23px;">0</span></center></td><td><input type="text" name="" class="form-control" name="requestFor" placeholder="Teacher\'s name" id="floatingTextarea1"></td><td><div class="row"><div class="col"><select name="requestType" id="requestType" class="form-control request_type" required><option value="Sick leave">Sick leave</option><option value="Sick leave">Sick leave</option><option value="Sick leave">Sick leave</option><option value="Sick leave">Sick leave</option><option >Other</option></select></div><div class="col"><input type="text" name="requestType" id="OtherType" value="" id="school" class="form-control" disabled placeholder="Please Specify"></div></div></td><td><input type="text" name="" class="form-control" name="description" placeholder="Leave additional information/comment here" id="floatingTextarea2"></td><td><button type="button" name="remove" id="remove" class="btn btn-danger"><i class="bi bi-x-lg"></i></button></td></tr>';
var x = 1;
var num = 1;
$('#add').click(function () {
if (true) {
$("#main_table").append(html);
x++;
}
});
$('#main_table').on('click', '#remove', function () {
$(this).closest('tr').remove();
x--;
});
$('body').on('change', '.request_type',function() {
var element = $(this);
var target = element.parent().parent().next().children();
console.log(target)
if (element.val() == "Other") {
console.log(element.parent().parent().find('#OtherType'))
// target.prop("disabled", false);
element.parent().parent().find('#OtherType').removeAttr("disabled")
} else {
target.attr('disabled', true);
}
})
});
</script>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-01-11T11:25:22.717 | 2023-01-11T11:25:22.717 | null | null | 19,663,148 | null |
75,082,401 | 2 | null | 75,082,108 | 0 | null | Use `ifs()`, like this:
```
=arrayformula(
ifs(
Y2:Y <> "vul", iferror(1/0),
L2:L = "annual", V2:V * 0.03,
L2:L = "quarterly", V2:V > 0,
L2:L = "semi annual", V2:V * AB2:AB,
true, iferror(1/0)
)
)
```
| null | CC BY-SA 4.0 | null | 2023-01-11T11:35:32.063 | 2023-01-11T11:35:32.063 | null | null | 13,045,193 | null |
75,082,483 | 2 | null | 74,191,324 | 1 | null | In order to get over with this. Upgrade to the latest gradle version as well as latest Android Studio.
I was also facing this issue and I followed these steps :
- - - - -
And the project is perfectly working fine now.
| null | CC BY-SA 4.0 | null | 2023-01-11T11:41:47.627 | 2023-01-11T11:41:47.627 | null | null | 17,135,014 | null |
75,082,569 | 2 | null | 74,888,144 | 1 | null |
It seems like the `curl` and `wget` commands were caching in between the client side and the server side somewhere which was the reason why the commands were returning the same repetitive results
I got through this [article](https://www.baeldung.com/linux/curl-without-cache)
then I realized that caching may be the reason for this behavior
I used
```
curl -H 'Cache-Control: no-cache, no-store' -v --silent <WEBSITE GOES HERE> 2>&1 | grep -Po d7c1bd01d1ccdfe9357b534458c9cc59594796af
wget --no-cache <WEBSITE GOES HERE> -q -O - | grep -Po d7c1bd01d1ccdfe9357b534458c9cc59594796af
```
These commands instead of the ones I was using before.
So basically,
You can use `'Cache-Control: no-cache, no-store'` with the `curl` command
and `--no-cache` flag with the `wget` command.
Hopefully, this might help you all if you got stuck in something similar to this problem.
| null | CC BY-SA 4.0 | null | 2023-01-11T11:48:44.997 | 2023-01-11T11:48:44.997 | null | null | 20,837,001 | null |
75,083,043 | 2 | null | 24,966,681 | 0 | null | add this in radio button xml
```
android:minWidth="0dp"
android:minHeight="0dp"
```
all extra padding will be remove. Then you can adjust the margin
| null | CC BY-SA 4.0 | null | 2023-01-11T12:27:06.517 | 2023-01-11T12:27:06.517 | null | null | 8,136,240 | null |
75,083,214 | 2 | null | 75,082,759 | 1 | null | > When I try to acces to vpn, it shows me a 404 error, the requested URL was not found on this server.
If you are getting a "404 Not Found" then it would imply that is not actually on your server (consequently `Options +Indexes` has no effect - although it would seem from your server config that `Indexes` is perhaps already enabled).
mod_autoindex is the module responsible for generating the directory listings.
> I created an `.htaccess` file with the next content in the root:
Personally, I would create an additional `.htaccess` file in the `/vpn` directory instead:
```
DirectoryIndex disabled
Options +Indexes
```
And disable `Indexes` (and set `DirectoryIndex`) in the root `.htaccess` file.
NB: `RewriteEngine` has no place here, unless you are overriding a parent config.
> If I try to access the url "domain/vpn"
Note that you should be requesting `domain/vpn/` (with a trailing slash). If you omit the trailing slash then mod_dir issues a 301 redirect to append it.
| null | CC BY-SA 4.0 | null | 2023-01-11T12:40:18.610 | 2023-01-11T18:09:30.507 | 2023-01-11T18:09:30.507 | 369,434 | 369,434 | null |
75,083,350 | 2 | null | 75,079,315 | 2 | null | A cell with the value `#N/A` will throw an exception when you try to match it with a literal string. There's three ways you can check for an exception.
```
With ThisWorkbook.Sheets("Sales").Range("AT" & rowCycle)
TypeName(.Value) = "Error"
.Value = CVErr(xlErrNA)
IsError(.Value)
End With
```
You'll also need to test this you try your other conditions.
```
With ThisWorkbook.Sheets("Sales").Range("AT" & rowCycle)
If Not .Value = CVErr(xlErrNA) Then
If .NumberFormat = "dd-mm-yyy" And .Value <> "" Then
...
End If
End If
End With
```
| null | CC BY-SA 4.0 | null | 2023-01-11T12:52:35.770 | 2023-01-11T16:38:08.987 | 2023-01-11T16:38:08.987 | 5,928,161 | 5,928,161 | null |
75,083,439 | 2 | null | 65,848,442 | 0 | null | A quick walkaround if you are doing a quick prototype or following a tutorial
`(req as any).user`
| null | CC BY-SA 4.0 | null | 2023-01-11T12:59:13.147 | 2023-01-11T12:59:13.147 | null | null | 10,911,506 | null |
75,083,722 | 2 | null | 30,216,929 | 0 | null | This will give proper smooth triangle on both platform:
[](https://i.stack.imgur.com/m3TFb.png)
As per the requirement and prop can be adjusted for different triangles.
`Sample`
```
<View style={{
width: 0,
height: 0,
borderStyle: 'solid',
overflow: 'hidden',
borderTopWidth: 6,
borderRightWidth: 4,
borderBottomWidth: 0,
borderLeftWidth: 4,
borderTopColor:'blue',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',)}
}} />
```
`Example`
```
const PropertyMarker = () => (
<View style={styles.shadowWrapper}>
<View
style={styles.backgroundMarkerView()}>
<Text
style={styles.selectedText()}>
MARKER_TEXT
</Text>
</View>
<View style={styles.arrowDown()} />
<View
style={styles.arrowDown2()}
/>
</View>
)
const styles = StyleSheet.create({
shadowWrapper: {alignItems: 'center', },
selectedText: (marginStart = 0, color = COLOR_BLACK_100) => ({
color,
...fontSize.fontSizeExtraSmall(),
...fonts.fontFamilyBold(),
lineHeight: 16,
marginStart,
}),
backgroundMarkerView: (backgroundColor = COLOR_SECONDARY) => ({
padding: 4,
borderRadius: 8,
backgroundColor,
borderWidth: 1,
borderColor: COLOR_WHITE,
}),
arrowDown: (borderTopColor = 'blue') => ({
width: 0,
height: 0,
borderStyle: 'solid',
overflow: 'hidden',
borderTopWidth: 6,
borderRightWidth: 4,
borderBottomWidth: 0,
borderLeftWidth: 4,
borderTopColor,
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
}),
arrowDown2: (borderTopColor = 'blue') => ({
width: 0,
height: 0,
borderStyle: 'solid',
overflow: 'hidden',
borderTopWidth: 5,
borderRightWidth: 3,
borderBottomWidth: 0,
borderLeftWidth: 3,
borderTopColor,
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
marginTop: -7,
}),
})
```
| null | CC BY-SA 4.0 | null | 2023-01-11T13:21:01.950 | 2023-01-12T05:23:25.703 | 2023-01-12T05:23:25.703 | 9,377,254 | 9,377,254 | null |
75,083,941 | 2 | null | 28,385,172 | 3 | null | If you are on a Mac, try clicking on File, then click on "Sync project with Gradle files" .... Run button should turn green again in a few seconds.
| null | CC BY-SA 4.0 | null | 2023-01-11T13:39:21.407 | 2023-01-11T13:39:21.407 | null | null | 20,980,826 | null |
75,084,327 | 2 | null | 75,084,223 | 1 | null | Go back to using `[]` for the second argument for useEffect. Then change your setRelatedPetition to `setRelatedPetition([...somePetition])`.
| null | CC BY-SA 4.0 | null | 2023-01-11T14:07:07.947 | 2023-01-11T14:07:07.947 | null | null | 10,188,573 | null |
75,084,361 | 2 | null | 75,084,223 | 0 | null | Hey yashraj this is a common problem with the useEffect hook, can i see the code inside the useEffect? so I can be able to help you more, but then to solve the problem add a variable to the dependency array [] a variable that is directly or indirectly affected by updates from data fetched from the firebase api,
would love to see the code, are you calling the api from useEffect hook?
| null | CC BY-SA 4.0 | null | 2023-01-11T14:09:29.770 | 2023-01-11T14:09:29.770 | null | null | 8,784,980 | null |
75,084,481 | 2 | null | 75,084,223 | 0 | null | It seems to cause infinite rendering. Why not putting the array stringified? See the link below. [https://stackoverflow.com/a/59468261/19622195](https://stackoverflow.com/a/59468261/19622195)
| null | CC BY-SA 4.0 | null | 2023-01-11T14:19:09.703 | 2023-01-11T14:19:09.703 | null | null | 19,622,195 | null |
75,084,565 | 2 | null | 75,067,443 | 0 | null | SwiftUI is a new architecture, old design patterns don't really fit. In SwiftUI the `View` struct isn't the view in the MVC sense, that view layer (e.g. UIView/NSView objects) is generated automatically for us based diffing the `View` structs which are super fast efficient value types. View state is held in property wrappers like `@State` which essentially makes the value behave like an object, e.g. it has a "memory". You can pass this down to sub-Views as `let` for read access or `@Binding var` for write access, SwiftUI will track dependencies and call `body` on the affected `View` structs when necessary.
Normally in SwiftUI we only have a single `ObservableObject` that holds the model structs in `@Published` properties. Usually there are 2 singletons, one `shared` that loads from disk and another `preview` pre-loaded with test data for driving SwiftUI previews. This object is shared across View structs using `.environmentObject`
If you attempt to use multiple `ObservableObject` for view data instead of `@State` you'll run into major problems, actually the kind of consistency problems that SwiftUI's use of value types was designed to eliminate.
| null | CC BY-SA 4.0 | null | 2023-01-11T14:25:26.353 | 2023-01-11T14:25:26.353 | null | null | 259,521 | null |
75,085,330 | 2 | null | 75,083,193 | 0 | null | To load documents from all `postlist` collections, you can use a [collection group query](https://firebase.google.com/docs/firestore/query-data/queries#collection-group-query).
```
FirebaseFirestore.instance
.collectionGroup('postlist')
.snapshots();
```
| null | CC BY-SA 4.0 | null | 2023-01-11T15:23:05.923 | 2023-01-11T15:23:05.923 | null | null | 209,103 | null |
75,085,699 | 2 | null | 75,085,202 | 1 | null | You should loop over each actor and each linked shows to the actor.
Let's say you fetched all the actors in your controller:
```
{% for actor in actors %}
<ul>
{% for spectacle in actor.spectacles %}
<li>{{ spectacle.title }}</li>
{% endfor %}
</ul>
{% endfor %}
```
ps: I advise you to use singular form for naming your entities ;)
| null | CC BY-SA 4.0 | null | 2023-01-11T15:50:22.357 | 2023-01-11T15:50:22.357 | null | null | 1,365,862 | null |
75,085,763 | 2 | null | 75,083,489 | 0 | null | I'm just guessing, but it might be that .NET Framework 4.0 is deprecated and support was removed. You can't even install it via the Visual Studio Installer's Individual Components. The lowest 4.x targeting pack version I could install is 4.6.
Try installing the latest .NET Framework targeting pack and then re-target the project to use that.
| null | CC BY-SA 4.0 | null | 2023-01-11T15:54:50.487 | 2023-01-11T15:54:50.487 | null | null | 421,178 | null |
75,086,388 | 2 | null | 75,085,350 | 5 | null | This isn't natively possible with ggplot, but it is feasible to draw the axes in using `geomtextpath`:
```
library(geomtextpath)
xvals <- seq(-90, -40, 10)
yvals <- c(70, 72, 74)
xaxis <- lapply(xvals, function(x) {
st_linestring(cbind(c(x - 5, x + 5), c(69, 69)))})|>
st_sfc() |>
st_set_crs(4326) |>
st_transform(crs = 3413) |>
st_as_sf() |>
within(label <- as.character(xvals))
yaxis <- lapply(yvals, function(x) {
st_linestring(cbind(c(-93, -91), c(x, x)))})|>
st_sfc() |>
st_set_crs(4326) |>
st_transform(crs = 3413) |>
st_as_sf() |>
within(label <- as.character(yvals))
ggplot() +
geom_sf(data = poly) +
geom_textsf(data = xaxis, aes(label = label), linewidth = NA) +
geom_textsf(data = yaxis, aes(label = label), linewidth = NA) +
coord_sf(crs = 3413) +
theme_void()
```
[](https://i.stack.imgur.com/JaC5T.png)
| null | CC BY-SA 4.0 | null | 2023-01-11T16:44:53.163 | 2023-01-11T16:44:53.163 | null | null | 12,500,315 | null |
75,086,633 | 2 | null | 43,886,576 | 0 | null | One can use \Bbb instead of \mathbbm which is mentioned under "Font control" [in the current documentation](https://docs.mathjax.org/en/latest/input/tex/extensions/textmacros.html). Judging by the question [Obsolete command \Bbb](https://tex.stackexchange.com/questions/51530/obsolete-command-bbb), it is an obsolete TeX command.
I use \Bbb in an align environment using MathJax version 3.2.2 for doxygen.
| null | CC BY-SA 4.0 | null | 2023-01-11T17:05:33.270 | 2023-01-11T17:05:33.270 | null | null | 20,984,888 | null |
75,086,816 | 2 | null | 74,615,448 | 1 | null |
The `StreamBuilder` works like a loop, too. So the for loop was needless here.
So, the code changes to this:
```
if (snapshot.hasData) {
final itemInfo = Map<String, dynamic>.from(
(snapshot.data!).snapshot.value as Map);
itemInfo.forEach((key, value) {
final nextItem = Map<String, dynamic>.from(value);
List<dynamic> item = List.empty(growable: true);
item.add(key.toString());
item.add(nextItem['Descripcion']);
item.add(nextItem['Cant']);
item.add(nextItem['Ubicacion']);
item.add(nextItem['Um']);
item.add(nextItem['X']);
itemsList.add(item);
});
}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T17:21:38.660 | 2023-01-11T17:21:38.660 | null | null | 20,284,530 | null |
75,086,977 | 2 | null | 68,695,611 | 0 | null | ```
.glide * {
margin: 0 auto;
}
```
Add this to your CSS so it will make your content in the center.
| null | CC BY-SA 4.0 | null | 2023-01-11T17:36:57.617 | 2023-01-11T17:36:57.617 | null | null | 9,883,118 | null |
75,087,376 | 2 | null | 75,087,310 | 2 | null | According to your screenshot, your `assets/` directory is in the `androidTest` source set. That needs to be moved to the `main` source set.
| null | CC BY-SA 4.0 | null | 2023-01-11T18:12:15.947 | 2023-01-11T18:12:15.947 | null | null | 115,145 | null |
75,087,442 | 2 | null | 72,712,681 | 0 | null | My solution was to create the payment intent on the back end (not using session/checkout), get the setup intent `client_secret`, and call `confirmCardSetup` with the `client_secret` on the frontend/client-side.
backend:
```
import Stripe from 'stripe';
const stripe = new Stripe(
'sk_test_your_secret_key',
{ apiVersion: '2022-11-15' }
);
const main = async () => {
const setupIntent = await stripe.setupIntents.create({
payment_method_types: ['card'],
customer: 'cus_1234',
});
console.log(setupIntent.client_secret);
// should give you something like 'seti_1MP8Y...'
}
main();
```
For testing I copy/pasted the `setupIntent.client_secret`'s value into the following code:
```
import { CardElement, Elements, useElements, useStripe } from '@stripe/react-stripe-js';
import { loadStripe, StripeCardElement } from '@stripe/stripe-js';
import React, { ReactElement} from 'react';
import { Link } from 'react-router-dom';
const stripePromise = loadStripe('pk_test_your-key');
const Form: React.FC = (): ReactElement => {
const elements = useElements();
const stripe = useStripe();
if (!elements) return <></>;
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!stripe || !elements) return;
const setupIntentClientSecret = 'seti_1MP8Y...'; // <---------------- Copy and pasted from server side
const { error } = await stripe.confirmCardSetup(
setupIntentClientSecret,
{ payment_method: { card: elements.getElement(CardElement) as StripeCardElement } }
);
console.log(error);
};
return (
<section>
<Link to='/service-group/create'>Create Service Group</Link>
<form id="payment-form" onSubmit={handleSubmit}>
<CardElement />
<button id="submit">
<span id="button-text">
Add Payment Method
</span>
</button>
</form>
</section >
);
};
const Dashboard: React.FC = (): ReactElement => {
return (
<Elements stripe={stripePromise}><Form /></Elements>
);
};
export default Dashboard;
```
This will create the payment method and attach it to the setup intent.
## My use case
I need to make sure I have a valid card on file before the user does something, but I charge them at the beginning of every month. I have a stripe customer created at this point in the application's flow so I provide the customer id when creating the setup intent (though I think that's optional).
Obviously in a real application you'd call a back end API endpoint to create the setup intent and retrieve the client_secret, rather than copying and pasting it.
| null | CC BY-SA 4.0 | null | 2023-01-11T18:18:18.840 | 2023-01-11T18:18:18.840 | null | null | 9,942,988 | null |
75,087,453 | 2 | null | 75,076,517 | 0 | null | Here's an option how you can handle this. As commented, abbreviated tz names such as "BST" are ambiguous. You will have to define to which tz the abbreviations map; e.g. "Europe/London" for BST/GMT.
given
```
df
Date and time temp
0 Sun 27 Mar 2022 12:57:03 AM GMT 33.9
1 Sun 27 Mar 2022 12:58:02 AM GMT 33.6
2 Sun 27 Mar 2022 12:59:03 AM GMT 33.6
3 Sun 27 Mar 2022 02:00:02 AM BST 33.9
4 Sun 27 Mar 2022 02:01:03 AM BST 33.6
5 Sun 27 Mar 2022 02:02:02 AM BST 33.6
```
running
```
import pandas as pd
import dateutil
tzmapping = {"GMT": dateutil.tz.gettz("Europe/London"),
"BST": dateutil.tz.gettz("Europe/London")}
df["dt_UTC"] = df["Date and time"].apply(dateutil.parser.parse, tzinfos=tzmapping).dt.tz_convert("UTC")
```
gives
```
df
Date and time temp dt_UTC
0 Sun 27 Mar 2022 12:57:03 AM GMT 33.9 2022-03-27 00:57:03+00:00
1 Sun 27 Mar 2022 12:58:02 AM GMT 33.6 2022-03-27 00:58:02+00:00
2 Sun 27 Mar 2022 12:59:03 AM GMT 33.6 2022-03-27 00:59:03+00:00
3 Sun 27 Mar 2022 02:00:02 AM BST 33.9 2022-03-27 01:00:02+00:00
4 Sun 27 Mar 2022 02:01:03 AM BST 33.6 2022-03-27 01:01:03+00:00
5 Sun 27 Mar 2022 02:02:02 AM BST 33.6 2022-03-27 01:02:02+00:00
```
| null | CC BY-SA 4.0 | null | 2023-01-11T18:18:54.270 | 2023-01-12T16:53:01.113 | 2023-01-12T16:53:01.113 | 10,197,418 | 10,197,418 | null |
75,087,688 | 2 | null | 75,087,483 | 0 | null | I think I got a solution:
```
import minecart
pdffile = open(fn, 'rb')
doc = minecart.Document(pdffile)
page = doc.get_page(page_num) # page_num is 0-based
for shape in page.shapes.iter_in_bbox((0, 0, 612, 792 )):
if shape.fill:
shape_bbox = shape.get_bbox()
shape_color = shape.fill.color.as_rgb()
print(shape_bbox, shape_color)
```
I would then need to filter the color or the shape size...
My earlier failure was due to having used a wrong page number :(
| null | CC BY-SA 4.0 | null | 2023-01-11T18:43:51.797 | 2023-01-11T18:43:51.797 | null | null | 1,294,072 | null |
75,087,702 | 2 | null | 75,087,483 | 0 | null | PyMuPDF lets you extract so-called "line art": the vector drawings on a page.
This is a list of dictionaries of "paths" (as PDF calls interconnected drawings) from which you can sub-select ones of interest for you.
E.g. the following identifies drawings that represent filled rectangles, not too small:
```
page = doc[0] # load some page (here page 0)
paths = page.get_drawings() # extract all vector graphics
filled_rects = [] # filled rectangles without border land here
for path in paths:
if path["type"] != "f" # only consider paths with a fill color
continue
rect = path["rect"]
if rect.width < 20 or rect.height < 20: # only consider sizable rects
continue
filled_rects.append(rect) # hopefully an area coloring a table
# make a visible border around the hits to see success:
for rect in filled_rects:
page.draw_rect(rect, color=fitz.pdfcolor["red"])
doc.save("debug.pdf")
```
| null | CC BY-SA 4.0 | null | 2023-01-11T18:45:09.787 | 2023-01-11T18:45:09.787 | null | null | 4,474,869 | null |
75,087,776 | 2 | null | 75,085,155 | 0 | null | The only way I found is to create your own ScrollView, as shown below.
It might be easier to tackle with UIKit.
[](https://i.stack.imgur.com/F61zI.gif)
```
struct ContentView: View {
@State private var dragAmount = CGFloat.zero
@State private var dragPosition = CGFloat.zero
@State private var dragging = false
var body: some View {
GeometryReader { proxy in
VStack {
RoundedRectangle(cornerRadius: 20)
.fill(.red)
.frame(height: 300)
.overlay(
Text(dragging ? "dragging red ..." : "")
)
.offset(y: dragPosition + dragAmount)
.gesture(DragGesture()
.onChanged { _ in
dragging = true
}
.onEnded { _ in
dragging = false
}
)
ForEach(0..<20) { _ in
RoundedRectangle(cornerRadius: 20)
.fill(.green)
.frame(height: 100)
}
.offset(y: dragPosition + dragAmount)
.gesture(DragGesture()
.onChanged { value in
dragAmount = value.translation.height
}
.onEnded { value in
withAnimation(.easeOut) {
dragPosition += value.predictedEndTranslation.height
dragAmount = 0
dragPosition = min(0, dragPosition)
dragPosition = max(-1750, dragPosition)
}
}
)
}
}
}
}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T18:52:15.827 | 2023-01-11T18:52:15.827 | null | null | 17,896,776 | null |
75,087,953 | 2 | null | 71,267,030 | 0 | null | You will see similar error if you upgrade to .net7. The error shows that you are missing some library components on your server.
If you are using IIS services, in addition to the installing the latest .net runtime (or SDK) on your server, you'll also need to install the web hosting components: [Publish an ASP.NET Core app to IIS | Microsoft Learn](https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-iis?view=aspnetcore-7.0&tabs=visual-studio).
| null | CC BY-SA 4.0 | null | 2023-01-11T19:08:42.833 | 2023-01-11T19:08:42.833 | null | null | 15,975,034 | null |
75,088,566 | 2 | null | 19,099,296 | 0 | null | Kotlin Extension method based on [Abdul Hakim](https://stackoverflow.com/users/5281486/abdul-hakeem-mahmood)'s [Library](https://github.com/AhmMhd/SeeMoreTextView-Android)
```
fun TextView.setSeeMoreOrLessView(msg: String, maxLengthToShowSeeMore: Int){
if (msg.length <= maxLengthToShowSeeMore) {
text = msg
return
}
val seeMoreText = "...See more"
val seeLessText = "...See less"
val spannableTextSeeMore = SpannableString("${msg.take(maxLengthToShowSeeMore)}$seeMoreText")
val spannableTextSeeLess = SpannableString("$msg$seeLessText")
val clickableSpan = object : ClickableSpan(){
override fun onClick(widget: View) {
//change spannable string
val currentTag = tag as? String?
if (currentTag?.equals(seeMoreText) == true){
text = spannableTextSeeLess
tag = seeLessText
} else {
text = spannableTextSeeMore
tag = seeMoreText
}
}
override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.isUnderlineText = false
}
}
spannableTextSeeMore.setSpan(
clickableSpan,
maxLengthToShowSeeMore,
maxLengthToShowSeeMore+seeMoreText.length,
0
)
spannableTextSeeLess.setSpan(
clickableSpan,
msg.length,
msg.length+seeLessText.length,
0
)
text = spannableTextSeeMore // default
tag = seeMoreText
movementMethod = LinkMovementMethod() }
```
| null | CC BY-SA 4.0 | null | 2023-01-11T20:15:23.880 | 2023-01-11T20:15:23.880 | null | null | 14,377,238 | null |
75,088,658 | 2 | null | 75,088,591 | 0 | null | You need to add this code for sidebar2
```
.wrapper .sidebar2 {
position: fixed;
right: 0px;
background: black;
padding: 20px;
height: 100%;
width: 180px;
}
.wrapper .main_content {
width: 100%;
margin-left: 200px;
margin-right: 180px;
}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T20:25:15.300 | 2023-01-11T20:25:15.300 | null | null | 20,883,691 | null |
75,088,692 | 2 | null | 75,088,591 | 0 | null | ```
.sidebar {
display: flex;
position: fixed;
top: 0;
left: 0;
}
```
Do the same for sidebar 2, just change with right: 0;
You may also need to change the flex-direction to your needs.
| null | CC BY-SA 4.0 | null | 2023-01-11T20:29:48.267 | 2023-01-11T21:36:09.857 | 2023-01-11T21:36:09.857 | null | null | null |
75,088,668 | 2 | null | 75,088,591 | 1 | null | `sidebar2` has to be like just like `sidebar` but adding the `right: 0` property:
```
@import url('https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
list-style: none;
text-decoration: none;
font-family: 'Josefin Sans', sans-serif;
}
body {
background-color: #f3f5f9;
}
.wrapper {
display: flex;
position: relative;
}
.wrapper .sidebar {
width: 200px;
height: 100%;
background: #000000;
padding: 30px 0px;
position: fixed;
}
.wrapper h2 {
color: #bdb8d7;
}
.wrapper .sidebar2 {
width: 200px;
height: 100%;
background: #000000;
padding: 30px 0px;
position: fixed;
right: 0;
}
.main_content {
padding: 0 210px;
}
```
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Side Navigation Bar</title>
<link rel="stylesheet" href="styles.css">
<script src="https://kit.fontawesome.com/b99e675b6e.js"></script>
</head>
<body>
<div class="wrapper">
<div class="sidebar">
<h2>Left Nav</h2>
<ul>
<li><a href="#"><i class="fas fa-home"></i>Home</a></li>
<li><a href="#"><i class="fas fa-user"></i>Profile</a></li>
<li><a href="#"><i class="fas fa-address-card"></i>About</a></li>
<li><a href="#"><i class="fas fa-project-diagram"></i>portfolio</a></li>
<li><a href="#"><i class="fas fa-blog"></i>Blogs</a></li>
<li><a href="#"><i class="fas fa-address-book"></i>Contact</a></li>
<li><a href="#"><i class="fas fa-map-pin"></i>Map</a></li>
</ul>
<div class="social_media">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
</div>
</div>
<div class="sidebar2">
<h2>Right Nav</h2>
<ul>
<li><a href="#"><i class="fas fa-home"></i>Home</a></li>
<li><a href="#"><i class="fas fa-user"></i>Profile</a></li>
<li><a href="#"><i class="fas fa-address-card"></i>About</a></li>
<li><a href="#"><i class="fas fa-project-diagram"></i>portfolio</a></li>
<li><a href="#"><i class="fas fa-blog"></i>Blogs</a></li>
<li><a href="#"><i class="fas fa-address-book"></i>Contact</a></li>
<li><a href="#"><i class="fas fa-map-pin"></i>Map</a></li>
</ul>
<div class="social_media">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
</div>
</div>
<div class="main_content">
<div class="header">Welcome!! Have a nice day.</div>
<div class="info">
<div>Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. </div>
<div>Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. </div>
<div>Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different.
Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different.
Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. Trying to design something different. </div>
</div>
</div>
</div>
</body>
</html>
```
| null | CC BY-SA 4.0 | null | 2023-01-11T20:26:29.160 | 2023-01-11T20:26:29.160 | null | null | 5,256,945 | null |
75,088,918 | 2 | null | 75,082,108 | 0 | null | use:
```
=ARRAYFORMULA(IF((Y2:Y="VUL")*(L2:L="ANNUAL"), V2:V*0.03,
IF((Y2:Y="VUL")*(L2:L="QUARTERLY"), V2:V>0,
IF((Y2:Y="VUL")*(L2:L="SEMI ANNUAL"), V2:V*AB2:AB, "0"))))
```
`AND` is `*`
`OR` is `+`
| null | CC BY-SA 4.0 | null | 2023-01-11T20:56:02.837 | 2023-01-11T20:56:02.837 | null | null | 5,632,629 | null |
75,088,917 | 2 | null | 75,088,591 | 0 | null | and then do flex for left and right with flex-direction:column
```
#container {
display: flex;
justify-content: space-between;
height: 100vh;
}
body,
html{
margin: 0;
padding: 0;
}
#left,
#right {
background-color: gray;
width: 15%;
}
```
```
<div id='container'>
<div id='left'></div>
<div id='middle'></div>
<div id='right'></div>
</div>
```
| null | CC BY-SA 4.0 | null | 2023-01-11T20:55:58.260 | 2023-01-11T20:55:58.260 | null | null | 4,398,966 | null |
75,089,087 | 2 | null | 43,342,697 | 0 | null | I don't have any concrete knowledge regarding the answer, but it seems unlikely that this change would be made. Apparently pytables has much [faster write speeds](https://stackoverflow.com/questions/57953554/pytables-writes-much-faster-than-h5py-why) than h5py and would lose that if implemented on top of h5py.
| null | CC BY-SA 4.0 | null | 2023-01-11T21:17:20.897 | 2023-01-11T21:17:20.897 | null | null | 8,773,585 | null |
75,089,099 | 2 | null | 58,613,492 | 0 | null | I needed to do a couple things to get this to work for me
1. Rename my .babelrc to babel.config.js and make a little change:
```
// .babelrc
{
"presets": [
[
"@babel/preset-env",
{
"corejs": "3.26",
"useBuiltIns": "usage"
}
],
"@babel/preset-react"
],
...
}
```
```
// babel.config.js - This still works fine with webpack
module.exports = {
"presets": [
[
"@babel/preset-env",
{
"corejs": "3.26",
"useBuiltIns": "usage"
}
],
"@babel/preset-react"
],
...
}
```
1. Add the following to my jest config file:
```
{
...
"transformIgnorePatterns": [
"node_modules/(?!(react-leaflet-custom-control)/)"
],
...
}
```
Where `react-leaflet-custom-control` was the package causing issues for me.
| null | CC BY-SA 4.0 | null | 2023-01-11T21:19:18.530 | 2023-01-11T21:19:18.530 | null | null | 8,285,811 | null |
75,089,187 | 2 | null | 75,063,314 | 0 | null | Problem is in `return new QAFExtendedWebDriver();` you need to use constructor with capabilities object `return new QAFExtendedWebDriver(capabilities);`.
Assuming that you have set driver name and driver capabilities, the right way is to use `getDriver()` method from test base in one of the following ways:
```
new WebDriverTestBase().getDriver();
new WebDriverTestCase().getDriver();
(QAFExtendedWebDriver)TestBaseProvider.instance().get().getUiDriver();
```
Easiest way to create capability in json format is to create capability object and print. For example:
```
public static void main(String[] args) throws ScriptException {
InternetExplorerOptions iExplorerOptions = new InternetExplorerOptions();
iExplorerOptions.setCapability(InternetExplorerDriver.FORCE_CREATE_PROCESS, true);
iExplorerOptions.setCapability(InternetExplorerDriver.IE_SWITCHES, "-private");
iExplorerOptions.attachToEdgeChrome();
iExplorerOptions.ignoreZoomSettings();
iExplorerOptions.setCapability("ignoreProtectedModeSettings", true);
iExplorerOptions.withEdgeExecutablePath("C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe");
System.out.println(JSONUtil.toString(iExplorerOptions.asMap()));
}
```
this will print
> {"browserName":"internet explorer","ie.browserCommandLineSwitches":"-private","ie.edgechromium":true,"ie.edgepath":"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe","ie.forceCreateProcessApi":true,"ignoreProtectedModeSettings":true,"ignoreZoomSetting":true,"se:ieOptions":{"ie.edgechromium":true,"ie.browserCommandLineSwitches":"-private","ie.forceCreateProcessApi":true,"ignoreZoomSetting":true,"ie.edgepath":"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe","ignoreProtectedModeSettings":true}}
if you have used driver name as `iexplorer` set capability for edge driver from above reference.
```
driver.name=iexplorerDriver
iexplorer.additional.capabilities={"browserName":"internet explorer","ie.browserCommandLineSwitches":"-private","ie.edgechromium":true,"ie.edgepath":"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe","ie.forceCreateProcessApi":true,"ignoreProtectedModeSettings":true,"ignoreZoomSetting":true,"se:ieOptions":{"ie.edgechromium":true,"ie.browserCommandLineSwitches":"-private","ie.forceCreateProcessApi":true,"ignoreZoomSetting":true,"ie.edgepath":"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe","ignoreProtectedModeSettings":true}}
```
| null | CC BY-SA 4.0 | null | 2023-01-11T21:29:17.263 | 2023-01-11T21:29:17.263 | null | null | 861,594 | null |
75,089,308 | 2 | null | 75,079,698 | 1 | null |
## You do not have a branch named "master"
The error
```
error: pathspec 'master' did not match any file(s) known to git
```
is exactly the error you get if you try to check out a commit reference that does not exist, be it a branch name, tag name or commit hash. The wording of the message is misleading to people not familiar with the inner workings of git.
To see the list of branches in your repo:
```
git branch
```
I'll bet you won't see "master" in the output. There are two possibilities for why you don't have a "master" branch.
## Possibility #1: You switched branches before your first commit.
The default branch (usually "master" or "main", see next section) isn't created when you init the repo, but when you make your initial commit. If you switch branches before that initial commit, the default branch ("master") is never created.
In your step 2 you created and staged some files. But then in your step 3 you switched branches before every committing those staged changes. So the default branch (e.g. "master") was not created. If you redo your above steps, but do a `git commit` before step 3, you should get a message that that files were committed to "master" (assuming that's your default branch, see below).
## Possibility #2: Your git is configured to use another default branch name for new repos.
It is possible your git installation is configured to initialize new repos with "main" or some other name instead of "master".
> ℹ️ If you want to understand the background behind switching from "master" to "main", read [Regarding Git and Branch Naming](https://sfconservancy.org/news/2020/jun/23/gitbranchname/)/
You can check what your installation's "default default" branch with:
```
git var GIT_DEFAULT_BRANCH
```
If you want to change the "default default" branch name for new repos, the easiest way is with:
```
git config --global init.defaultBranch <your_name_pref_here>
```
If you want to rename the default branch of an existing repo, say from "main" to "master":
```
git branch -m main master
```
| null | CC BY-SA 4.0 | null | 2023-01-11T21:43:46.627 | 2023-01-11T22:05:41.513 | 2023-01-11T22:05:41.513 | 8,910,547 | 8,910,547 | null |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.