TopMiniSite
-
4 min readTo filter data in a list of pandas dataframes, you can use the .loc[] method along with conditional statements to extract the desired data. You can specify the conditions inside the square brackets of .loc[] to filter rows based on specific criteria. For example, you can filter rows where a certain column has values greater than a certain threshold or where multiple conditions are met simultaneously. By applying the .
-
5 min readTo truncate the format yyyy/mm/dd hh:mm:ss.sss to mm/dd/yyyy in Oracle, you can use the TO_CHAR function to convert the date to the desired format. Here is an example query to achieve this:SELECT TO_CHAR(TO_DATE('2022/01/15 15:30:45.123', 'YYYY/MM/DD HH24:MI:SS.FF'), 'MM/DD/YYYY') AS truncated_date FROM dual;This query will take a date in the format yyyy/mm/dd hh:mm:ss.sss, convert it to the mm/dd/yyyy format, and return the truncated date.
-
4 min readTo join two tables from two columns in Oracle, you can use the JOIN keyword in your SQL query. The syntax for joining two tables on two columns is as follows:SELECT * FROM table1 INNER JOIN table2 ON table1.column1 = table2.column1 AND table1.column2 = table2.column2;In this example, table1 and table2 are the names of the tables you want to join, column1 and column2 are the names of the columns you want to join on.
-
2 min readTo concatenate two strings from two queries in Oracle, you can use the concatenation operator (||). Here is an example: SELECT query1.column1 || query2.column2 AS concatenated_string FROM query1, query2 WHERE query1.id = query2.id; This will concatenate the values of column1 from query1 and column2 from query2 into a single string and display it as concatenated_string in the result set.[rating:dc3bb8f1-bf14-46f8-a39b-16fc925c6a8c]How to concatenate strings from different columns in Oracle.
-
4 min readTo check the month and year of a procedure in Oracle, you can use the EXTRACT function to extract the month and year from a date column in your procedure.
-
5 min readIn Elixir, you can share data between worker processes by using the various built-in features of the language, such as message passing and process linking. One common way to share data between worker processes is by sending messages between them using the send/2 and receive/1 functions. You can also use the spawn_link/1 function to link processes together, so that if one process crashes, the other processes linked to it will also be terminated.
-
4 min readIn Oracle, you can execute dynamic SQL into a cursor by using the OPEN-FOR statement. This allows you to dynamically generate and execute a SQL statement and fetch the results into a cursor variable.To do this, you first declare a cursor variable using the CURSOR or REF CURSOR type. Then, you use the OPEN-FOR statement to dynamically assign a SQL string to the cursor variable and execute the query. Finally, you use the FETCH statement to retrieve the results from the cursor.
-
2 min readTo get the root directory of an Elixir project, you can use the Mix.Project.config() function to get the project's configuration. Inside the configuration, you can access the :project key to get the root directory. This key will give you a path to the root directory of the Elixir project. With this path, you can then access files and folders within the project directory as needed for your application.
-
3 min readIn Elixir, you can set the application name for Postgres connections by using the :ecto_repos configuration in your project's config.exs file. You can set the application name by adding an entry for each Ecto repo in the configuration. An example configuration for setting the application name for a Postgres connection in Elixir looks like this: config :my_app, MyApp.Repo, adapter: Ecto.Adapters.
-
4 min readIn Elixir, you can get the number of available processors by calling System.schedulers_online/0 function. This function returns the total number of schedulers that are currently online and available for running processes. By using this information, you can optimize and distribute your workload among the available processors effectively.[rating:7ad7e33a-903a-4d89-adf8-87cf278eb88d]How to dynamically adjust the number of processors used by an Elixir application.
-
3 min readIn Elixir, functions are defined using the def keyword followed by the function name and parameters. Functions can have multiple clauses, which allows for pattern matching based on different inputs. When calling a function, Elixir will try each clause sequentially until it finds a match.Functions can also be defined anonymously using the fn keyword, which is commonly used in higher-order functions and passing functions as arguments to other functions.