[Solved] WLAN (wifi...
 
Notifications
Clear all

[Solved] WLAN (wifionice) @ deutsche Bahn not working with docker installed

0 Posts
1 Users
0 Likes
7 Views
0
Topic starter
Mutzmann Asks: WLAN (wifionice) @ deutsche Bahn not working with docker installed
I was travelling by train with german railroad company "deutsche Bahn" and wanted to use their provided onboard wlan. I connected to their wlan, and wanted to visit a website in my browser, but redirection to their captive portal was not working.

I was also connected with my mobile and everything was working as it should, so I assume that there was no problem with their wlan.

I have a HP elitebook 840G5 running Manjaro Linux Gnome edition and docker installed.

I was wondering how to figure out what was wrong and how to solve this issue?

After investigating a bit I found the solution by myself, but I wanted to share my solution to help others running into the same problem.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Unreplied Posts

[Solved] How to set my custom view as Default view admin grid Magento 2

kanidhaya Asks: How to set my custom view as Default view admin grid Magento 2
I want to set my custom view as Default view the admin grid section. I tried by saving the view but that is only per user. I want to set it for all the users.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.
 
 
 

[Solved] How do I use API versioning?

Matt Korostoff Asks: How do I use API versioning?
I’m using the Services module to produce a REST API. According to the official documentation, there is a way to version services resources. I believe version here means supplying a single API (e.g. example.com/api) and allowing clients to specify which version they want per resource with headers.

So I think that means that these two requests would return different results, despite living at the same URL:

Version 1.0:

Code:
POST /api/v1/system/set_variable HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json

Version 1.2:

Code:
POST /api/v1/system/set_variable HTTP/1.1
Host: example.com
Accept: application/json
Content-Type: application/json
services_system_set_variable_version: 1.2

I cannot make this work for the life of me. Here are the steps I took:

  1. Enabled the system/set_variable service

    {
    “lightbox_close”: “Close”,
    “lightbox_next”: “Next”,
    “lightbox_previous”: “Previous”,
    “lightbox_error”: “The requested content cannot be loaded. Please try again later.”,
    “lightbox_start_slideshow”: “Start slideshow”,
    “lightbox_stop_slideshow”: “Stop slideshow”,
    “lightbox_full_screen”: “Full screen”,
    “lightbox_thumbnails”: “Thumbnails”,
    “lightbox_download”: “Download”,
    “lightbox_share”: “Share”,
    “lightbox_zoom”: “Zoom”,
    “lightbox_new_window”: “New window”,
    “lightbox_toggle_sidebar”: “Toggle sidebar”
    }

    system
  2. Added the following code to mymodule.module (cribbed directly from services.versions.api.php)

.

Code:
function _system_resource_set_variable_update_1_1() {
  $new_set = array(
    'help' => 'Create a node with an nid test',
  );
  return $new_set;
}

function _system_resource_set_variable_update_1_2() {
  $new_set = array(
    'help' => 'Create a node with an nid optional prams.',
    'args' => array(
      array(
        'name' => 'name',
        'optional' => TRUE,
        'source' => array('data' => 'name'),
        'description' => t('The name of the variable to set.'),
        'type' => 'string',
      ),
      array(
        'name' => 'value',
        'optional' => TRUE,
        'source' => array('data' => 'value'),
        'description' => t('The value to set.'),
        'type' => 'string',
      ),
    ),
  );
  return $new_set;
}

  1. Cleared cache
  2. Attempted to use the system/set_variable service with postman.
  3. Saw that the system/set_variable service was working

    postman
  4. Attempted to use the system/set_variable service without arguments, per _system_resource_set_variable_update_1_2

  5. Saw that arguments were still required
    postman1

So what am I doing wrong here? I’m pretty sure I followed all the instructions.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] ssis control flow loop

gdw Asks: ssis control flow loop

enter image description here

I need an SSIS package that loops back to the initial execute task after the wait for delay block is executed. here is the logic for the below package: execute SQL task executes a set of commands and after that if a condition is met, the second process(preparation sql task 1 and so on) will be executed. if the condition is not met, it will wait for some time and re-run the first task(execute sql task). I am stuck here and cannot go any further. please help

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Recalculate and replace large table without interrupting table reads

Denziloe Asks: Recalculate and replace large table without interrupting table reads
There’s a large table in the database containing statistical information. This table must be read frequently (by lookups which return a single row).

This table must be completely recalculated every so often. There’s a procedure which does the calculation. Currently it does this into a temporary table, and then when it’s done it truncates the real table and inserts the data from the temporary table into it.

The problem is that this truncation and insertion takes a while and interrupts lookups during that time. The question is how to do it without interrupting lookups, or only interrupting lookups very briefly.

I’d be happy to hear all options which achieve the desired behaviour; the solution doesn’t necessarily have to involve a temporary table. Sorry if this is an established common problem — I wasn’t sure which terms to search.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Can you bulk upload a file from a remote server to a Azure Managed server

Columbo Asks: Can you bulk upload a file from a remote server to a Azure Managed server
I have a .NET app on a remote server that downloads and processes a file which it then saves to disk, this file is then bulk inserted by SQL and further work carried out. This works a treat when everything is on the same server.

But, we have moved to a cloud based setup. The database is now a SQL Server managed instance and the .NET app is on a separate virtual server. We also have a blob storage instance.

Since the Azure managed instance has no storage or anyway of mapping remote shared folders, I cannot gain access to the file locally.

At the moment my solution is to get .NET to send the file it produces to the blob storage (there’s a library for this (Quickstart: Azure Blob Storage library v12 – .NET) and then use SQL to bulk upload from the blob storage (you can do this in SQL (How to use BULK INSERT to import data locally and in Azure).

This works but seems convoluted, my question is (other than getting a bigger virtual server and putting SQL and the app on it) is there a way to bulk insert from a remote server and so cut out the blob middle man? Or, can anyone think of a simpler way to do this?

Thanks WN

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Query with CASE in subquery join clause is very slow on PostgreSQL but fast on Oracle and MariaDB

Marc Preuss Asks: Query with CASE in subquery join clause is very slow on PostgreSQL but fast on Oracle and MariaDB
We have an attribute-oriented data management system with bitemporality and flexible tenant priorization logic. Deletion of records is done by inserting the same row in DELETED status. Tenants may inherit data from other tenants and change/overwrite it in their own tenant, which won’t affect the original data. The prioriation of tenants can be changed for each tenant. These two features mean we need to eliminate some data based on these priorities, and we solved it with a subquery that has a CASE statement in its join condition:

Code:
SELECT 
 bd.INSTANCE_ID,
 bd.ATTRIBUTE_ID,
 bd.INSERTED,
 bd.MODIFIED_RECORD,
 bd.EFFECTIVE,
 bd.DISCONTINUE,
 bd.STATUS,
 bd.TENANT,
 bd.VALUE 
 FROM MY_DATA bd
  WHERE 1 = 1 
  AND bd.INSERTED <= ?  AND bd.INSTANCE_ID IN 
  (SELECT INSTANCE_ID 
  FROM MY_DATA  
  WHERE STATUS IN (?) 
  AND INSERTED <= ?  AND TENANT IN (?, ?)  ) 
  AND ( bd.STATUS <> 'DELETED' )  AND bd.ATTRIBUTE_ID IN (?, ?, ?, ?, ?, ?, ?, ?)  AND (bd.INSTANCE_ID, bd.ATTRIBUTE_ID, bd.INSERTED) NOT IN 
  (SELECT dc.INSTANCE_ID, dc.ATTRIBUTE_ID, dc.MODIFIED_RECORD 
  FROM MY_DATA dc 
  WHERE dc.STATUS = 'DELETED' 
  AND   dc.MODIFIED_RECORD IS NOT NULL 
   AND dc.INSERTED <= ?  
   AND dc.TENANT IN (?, ?)
   AND CASE WHEN bd.TENANT = 1 THEN 1 WHEN bd.TENANT = 2 THEN 3 ELSE -1 END <= CASE WHEN dc.TENANT = 1 THEN 1 WHEN dc.TENANT = 2 THEN 3 ELSE -1 END
  ) 
  AND bd.TENANT IN (?, ?)
 ORDER BY bd.INSTANCE_ID asc, bd.ATTRIBUTE_ID asc, CASE WHEN bd.TENANT = 1 THEN 1 WHEN bd.TENANT = 2 THEN 3 ELSE -1 END asc, bd.EFFECTIVE asc, bd.INSERTED asc

Now we have a test system with ~120000 rows in it, ~300 rows have DELETED status. All rows belong to the same tenant, so the CASE statement is not really necessary. But since we use generic query building, its presence is determined by entries in another table (the user-definable tenant priorities.) And since the feature is needed, optimizing the query to omit the clause would only be a workaround, not a solution.

When we execute this query on PostgreSQL, it is painfully slow, ~20minutes execution time. When we execute the same query on the same data on Oracle or MariaDB (installed on the same machine), it takes only a few seconds.

This is the result from PostgreSQL EXPLAIN (ANALYZE, BUFFERS):

Code:
QUERY PLAN
Sort  (cost=133536462.09..133536522.26 rows=24068 width=125) (actual time=825446.289..825453.855 rows=47875 loops=1)
 Sort Key: bd.instance_id, bd.attribute_id, (CASE WHEN (bd.tenant = 1) THEN 1 WHEN (bd.tenant = 2) THEN 3 ELSE '-1'::integer END), bd.effective, bd.inserted
 Sort Method: external merge  Disk: 4608kB
 Buffers: shared hit=87702007, temp read=576 written=577
 ->  Nested Loop  (cost=4675.23..133534710.56 rows=24068 width=125) (actual time=125.801..825062.707 rows=47875 loops=1)
       Buffers: shared hit=87702004
       ->  HashAggregate  (cost=4674.81..4787.10 rows=11229 width=8) (actual time=100.839..147.466 rows=11192 loops=1)
             Group Key: my_data.instance_id
             Batches: 1  Memory Usage: 1169kB
             Buffers: shared hit=1822
             ->  Seq Scan on my_data  (cost=0.00..4358.54 rows=126506 width=8) (actual time=0.025..69.096 rows=126525 loops=1)
                   Filter: ((tenant = ANY ('{1,2}'::bigint[])) AND ((status)::text = 'RELEASED'::text) AND (inserted <= CURRENT_TIMESTAMP))
                   Rows Removed by Filter: 302
                   Buffers: shared hit=1822
       ->  Index Scan using my_data_pkey on my_data bd  (cost=0.42..11891.49 rows=2 width=121) (actual time=17.175..73.675 rows=4 loops=11192)
             Index Cond: ((instance_id = my_data.instance_id) AND ((attribute_id)::text = ANY ('{code,title,city,country,att1, att2}'::text[])) AND (inserted <= CURRENT_TIMESTAMP))
             Filter: (((status)::text <> 'DELETED'::text) AND (tenant = ANY ('{1,2}'::bigint[])) AND (NOT (SubPlan 1)))
             Rows Removed by Filter: 0
             Buffers: shared hit=87700182
             SubPlan 1
               ->  Seq Scan on my_data dc  (cost=0.00..5943.88 rows=1 width=25) (actual time=0.078..17.028 rows=301 loops=48177)
                     Filter: ((modified_record IS NOT NULL) AND (tenant = ANY ('{1,2}'::bigint[])) AND ((status)::text = 'DELETED'::text) AND (inserted <= CURRENT_TIMESTAMP) AND (CASE WHEN (bd.tenant = 1) THEN 1 WHEN (bd.tenant = 2) THEN 3 ELSE '-1'::integer END <= CASE WHEN (tenant = 1) THEN 1 WHEN (tenant = 2) THEN 3 ELSE '-1'::integer END))
                     Rows Removed by Filter: 126102
                     Buffers: shared hit=87484942
Planning:
 Buffers: shared hit=108
Planning Time: 1.098 ms
Execution Time: 825476.536 ms

Table and index definition:

Code:
CREATE TABLE "public"."my_data"
(
   instance_id bigint NOT NULL,
   attribute_id varchar(100) NOT NULL,
   inserted timestamp NOT NULL,
   modified_record timestamp,
   effective date NOT NULL,
   discontinue date,
   status varchar(20) NOT NULL,
   tenant bigint NOT NULL,
   value varchar(4000),
   CONSTRAINT my_data_pkey PRIMARY KEY (instance_id,attribute_id,inserted)
)
;
CREATE INDEX my_data_iid ON "public"."my_data"(instance_id)
;
CREATE INDEX my_data_val ON "public"."my_data"
(
  tenant,
  attribute_id,
  value
)
;

My questions are:

  • why is the query so much slower on PostgreSQL than on Oracle or MariaDB?
  • what can we do to improve PostgreSQL performance? (since this is the DBMS we want to focus on)

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Reinstall gapps

user164681 Asks: Reinstall gapps
I am using galaxy grand2 with stock rom(jelly bean,rooted).Day before yesterday i saw a video of modded play store on the you tube. i tried to install that but it didn’t work for me. and i removed it. but my original play store is not working any more(not working in the sense it is opening but when i tried to install any app it crashes). so i want to reinstall the gapps but don’t want to install the whole rom. so is it possible to reinstall just the gapps after using my phone for sometime???? thank you.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Why does an empty message still invoke the code of the contract?

eth Asks: Why does an empty message still invoke the code of the contract?
An empty message still invokes the code of the contract and is the mechanism that allows Solidity to implement a feature of a fallback function per contract.

But when msg.data is empty, why does contract code still need to execute?

If a caller leaves msg.data empty, meaning they don’t want to pass any data or call any functions at all on a contract, why does the contract code still need to run?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] How to use swapExactETHForTokens in smart contract?

gnxvw Asks: How to use swapExactETHForTokens in smart contract?
I want to use use swapExactETHForTokens in my smart contract, always fails transaction with error which is "execution reverted: UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT".

This is my code.

Code:
pragma solidity ^0.6.2;

interface IUniswap {
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function WETH() external pure returns (address);
}

contract MyDefi{
    
    IUniswap uniswap;
    
    constructor(address _uniswap) public {
        uniswap = IUniswap(_uniswap);
    }

    function tastSwapExactETHForTokens(
        uint amountOut,
        address token,
        uint deadline
    ) external payable {
        address[] memory path = new address[](2);
        path[0] = uniswap.WETH();
        path[1] = token;
        uniswap.swapExactETHForTokens(
            amountOut,
            path,
            msg.sender,
            deadline
        );
    }
  
}

I tried to swap DAI token in rinkeby network and I got an amountOut argument from the etherscan website. UniswapV2Router02 | 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D

Does anyone help to solve my problem?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

[Solved] Send Multiple ECR20 Tokens from a Single ETH Address in One Transaction?

S.O.S Asks: Send Multiple ECR20 Tokens from a Single ETH Address in One Transaction?
Is it possible to send multiple ECR20 tokens (i.e, USDT and USDC) from a single Ethereum address (EOA) to another address (EOA) in a single transaction (either with or without a smart contract)? If yes, would this lead to a reduction in gas costs? If it would, how would one go about in calculating the savings?

I’ve read conflicting information on this topic. According to one reddit user:

Without such a wrapper contract, moving several tokens in one transaction is impossible.

Yet, according to another user:

It’d definitely save gas. All transactions have 21k gas and contracts add on top of that depending on the ops used. If you create a contract that combines the work of 2 transactions, you’d save the 21k of one of the transactions

Who’s right? And if it is possible to send two tokens in a single transaction how would I go about in calculating the fee savings?

This question does seem to address (no pun intended) sending eth + other tokens in a single transaction. Would the same answer apply to sending multiple ECR20 tokens without sending eth? Also, it does not address the possibility of sending tokens via smart contract which according to the reddit post above should reduce the cost by 21,000 gas as this fee would be assessed only once.

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.

 

 


 

Share: