// Mesajul tău pentru Lilu
const mesaj = `Eu nu vreau să te am fizic,
dar vreau să te iubesc din tot sufletul,
să te simt alături, chiar dacă nu pot.
Mintea mea spune "nu",
dar inima spune "da".
Știu că-i ceva interzis ce simt pentru tine,
dar nu-mi pot interzice inimii să te adore.
Ești pură, știi ce vrei,
iar eu... te iubesc așa cum sunt.`;
Here I will suggest two thing as per below :
Use using keyword to closed write object before delete.
File.Copy(filename, filename + ".bak");
using (TextWriter writer = new StreamWriter(filename))
{
writer.Write(content);
}
if (File.Exists(filename + ".bak"))
{
try
{
File.Delete(filename + ".bak");
}
catch (IOException ex)
{
Debug.WriteLine("Delete failed: " + ex.Message);
Thread.Sleep(500); // allow file system to catch up
File.Delete(filename + ".bak"); // retry
}
}
Also I faced issue is file corrupted when copy from source like FTP So please check before delete you just copy file on destination folder and check is corrupted or not and able to open if are able to open same location then try delete operation.
Sure it will work..
May be this helps for latest version of iPhone Landscape with larger screen.
@media screen and (max-device-width: 480px) and (orientation:landscape) {
}
May I ask if you have solved it? I want to do pruning for yolo, but I'm pruning for the improved YOLO 11. I'm not very familiar with this aspect. Could you please tell me how to prune yolo after its improvement?
in this example, you can see how do you set label to show when the chart dont detected data, please remember use after section of chart:
chartOptionsDonut:{
chart: {
type: 'donut',
},
noData: {
text: "No data text",
align: "center",
verticalAlign: "middle",
},
When it comes to asking a user for data, I start from the premise that he is not only the dumbest guy in the world, but that his only neuron is used to create problems for me... and you don't want to use external libraries, well, let's make our own chooser:
public class Gui extends JDialog {
Principal principal;
JTextField days[], yearInput;
JComboBox<String> months;
JPanel panel;
JButton button;
JLabel messages;
// "first" and "last" will help us to determine which of the fields
// that make up the grid, we should use
int first = 50, last = 41, year, month, day;
public Gui( Principal pri ) {
principal = pri;
setTitle( "MyDateChooser" );
initializeComponents();
createAndSet();
setFields();
setPositionAndSize();
setComponents();
addListeners();
addToPanel( button, messages, yearInput, months );
add( panel );
setVisible( true );
}
private void setFields() {
int one = 1;
int x = 10;
int y = 30;
for( int i = 0; i < days.length; i ++ ) {
if( i % 7 == 0 ) {
x = 10;
y += 26;
}
if( i < first || i >= last ) {
days[ i ].setVisible( false );
}
else {
days[ i ].setVisible( true );
days[ i ].setText( "" + one ++ );
days[ i ].setBounds( x, y, 30, 24 );
}
x += 30;
}
}
private void initializeComponents() {
panel = new JPanel( null );
button = new JButton( "Done" );
messages = new JLabel( "Enters the year" );
yearInput = new JTextField();
}
private void createAndSet() {
days = new JTextField[ 42 ];
for( int i = 0; i < days.length; i ++ ) {
days[ i ] = new JTextField();
days[ i ].setBackground( new Color( 130, 130, 130 ) );
days[ i ].setHorizontalAlignment( JTextField.RIGHT );
days[ i ].setEditable( false );
panel.add( days[ i ] );
days[ i ].addMouseListener( new MouseAdapter() {
@Override
public void mouseClicked( MouseEvent evt ) {
createDate( evt );
}
} );
}
String m[] = {
"Enero", "Febrero", "Marzo", "Abril",
"Mayo", "Junio", "Julio", "Agosto",
"Septiembre", "Octubre", "Noviembre", "Diciembre" };
months = new JComboBox<>( m );
String[] nameOfDays = "LMMJVSD".split( "" );
JLabel[] daysInitials = new JLabel[ 7 ];
int x = 22;
for( int i = 0; i < 7; i ++ ) {
daysInitials[ i ] = new JLabel( nameOfDays[ i ] );
daysInitials[ i ].setBounds( x, 35, 30, 24 );
daysInitials[ i ].setForeground( Color.yellow );
panel.add( daysInitials[ i ] );
x += 30;
}
}
private void setPositionAndSize() {
setBounds( 10, 10, 240, 258 );
button.setBounds( 150, 10, 70, 24 );
messages.setBounds( 15, 10, 100, 24 );
yearInput.setBounds( 100, 10, 50, 24 );
months.setBounds( 140, 10, 80, 24 );
}
private void setComponents() {
months.setVisible( false );
panel.setBackground( Color.darkGray );
messages.setForeground( Color.LIGHT_GRAY );
yearInput.setBackground( new Color( 170, 170, 170 ) );
requestFocusInWindow();
setFocusable( true );
}
private void addListeners() {
button.addActionListener( ( evt ) -> {
// after entering the year we verify that the string
// is not empty and that it only contains numbers.
String text = yearInput.getText();
if( ! text.isEmpty() && text.matches( "^[1-9]\\d*$" ) ) {
year = Integer.parseInt( text );
messages.setText( "Select month" );
button.setVisible( false );
months.setVisible( true );
yearInput.setVisible( false );
}
} );
months.addActionListener( ( evt ) -> {
// based on the user's selection, we instantiate “month” we create a “LocalDate”
// object of the first day of the month, from it, we obtain the day of the
// week and the number of days of the month, with this data we instantiate
// “first” and ‘last’ and call “setFields” to show the calendar.
month = months.getSelectedIndex() + 1;
LocalDate aux = LocalDate.of( year, month, 1 );
int dayOfWeek = aux.getDayOfWeek().getValue();
int DayOfMonth = aux.lengthOfMonth();
first = dayOfWeek + 1;
last = first + DayOfMonth;
setFields();
} );
}
private void addToPanel( JComponent... comps ) {
for( JComponent comp : comps ) {
panel.add( comp );
}
}
// the listener of the JTextField on which the user clicked, calls this method that
// instantiates “day” with the string of the same and invokes the corresponding
// method of the object that created the ‘chooser’ passing it as a parameter, the
// object “LocalDate”.
void createDate( MouseEvent evt ) { // and send
day = Integer.parseInt( ( (JTextComponent) evt.getSource() ).getText() );
principal.setFecha( LocalDate.of( year, month, day ) );
dispose();
}
}
PS: it is a basic version, some things need to be modified and others implemented (like going backwards), I hope it will serve as an inspiration for you.
Ok the log is only grepping the "service-name" keyword. Once I check the full logs, it shows a bunch of other services have been in the restart loop, many of which are failing, exceeding the 30second default max timeout. monit
does the operations in a synchronous loop, hence there is delay when there are other services.
I found the issue is my file name
though it is late to answer, but may there be another option, like `linkedom`
Make sure your DEBUG = False
, Django stores the static files in the local files instead of uploading to the S3 while in development mode. If this is not the case, please hide your credentials or any private implementations and upload full code to make the problem more clear to understand. Your current implementation looks fine for django 4.2
and later versions.
You also have to bind the address is the my.cnf file. There is a different wildcard for ipv6. It would be ::. So it would like this bind-address = ::
Starting from IntelliJ IDEA version 2025.1, to restore the Intellij-idea commit tab you need to check if you have pre-installed the Modal Commit Interface Plugin and then disable it.
How about I don't know why this suddenly came on don't understand or want it so take it off
As @zivkan answered https://stackoverflow.com/a/77147546/6200917, default msbuild and nuget actions produces flat binary output directory preserving references original names. Renaming files there must be matched with changes in loading those renamed dll's (e.g. by directly using AssemblyLoadContext
). Making this to work seems not so obvious.
But sometimes useful solution could be obvious one, so here it is.
If those required packages are not transitive, creating trivial proxies (perhaps packing them to NuGet
format) and referring them from main project should work (and nicely integrate with default MSBuild/Nuget actions), for example:
LoadedLib.1.0.1
project heaving:
<PackageReference Include="LoadedLib" Version="1.0.1" />
LoadedLib.2.0.1
project heaving:
<PackageReference Include="LoadedLib" Version="2.0.1" />
App
project heaving
<PackageReference Include="LoadedLib" Version="3.0.1" />
<PackageReference Include="LoadedLib.1.0.1" Version="1.0.1" />
<PackageReference Include="LoadedLib.2.0.1" Version="2.0.1" />
I haven't solved the issue itself but found a perfect work around.
I am not quite sure why it works but it does.
Instead of using the Image component (causing issues) I use this :
<img src={e.child('thmbNl_128x128').val()} />
If someone has an explanation, please let us know.
Many answers don't work in some scenarios and some introduce unneeded useEffect
while also not working in all cases.
The defaultValue
doesn't work for cases where the field is controlled, which is often needed when state is controlled and updated by upstream state.
In particular, when typing fast the timeout solutions don't work. (The answers with setTimeout
or useEffect
don't work when the user types quickly)
The Promise
solution in one answer works well, and it is simple and clean.
The minimal code for the Promise solution that works regardless of typing speed using a controlled component:
<input
value={value}
onChange={async (event) => {
const inputElement = event.target;
setValue(inputElement.value);
const { selectionStart, selectionEnd } = inputElement;
/**
* This works correctly, even if the user types quickly. (setTimeout does not)
*/
await Promise.resolve().then(() => {
inputElement.setSelectionRange(selectionStart, selectionEnd);
});
}}
/>
https://codesandbox.io/p/sandbox/qxg8k9?file=%2Fsrc%2FApp.js%3A1%2C1
For the original question, input type="number"
does not support setSelectionRange
, so many solutions to this question don't work if using that type
. The only one that can is defaultValue
, but that doesn't work if other code updates the state. Recommend using type="text"
and convert to number outside of form.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
The element must be of one of the following input types:
password
,search
,tel
,text
, orurl
.
In recent React versions you can just simply add the mappings in the tsconfig.json file:
{
"compilerOptions": {
"paths": {
"@Components": ["./src/components"],
"@Components/*": ["./src/components/*"]
}
}
}
There is no way to use Warp in the integrated terminal. You can create a shortcut key to open Warp in a dedicated window. There is an official guide on how to do this:
For the number of calendar days between two dates (not the number of 24 hour amounts):
$fecha = "13-10-2016 00:00:00";
$dt_epoch_days= floor(date('U',strtotime($fecha))/(60*60*24));
$now_epoch_days= floor(date('U')/(60*60*24));
echo $now_epoch_days-$dt_epoch_days;
Did you find out any more information on this?
(thanks for idea Alan Zeino)
in terminal try
defaults delete com.apple.finder _FXEnableColumnAutoSizing
killall Finder
Maybe you can try installing psycopg2-binary instead of psycopg2. Also make sure you read installation documentation.
If you keep gpg configurations in location different than default one (which is ~/.gnupg/
) then you may need to tell gpg where is that configuration by using gpg --homedir <config-directory>
and setting default key in gpg.conf
by adding default-key 5D89...
I deleted the C:\Users\<myusername>\Documents\IIS Express\config folder, didn't work.
But then I deleted C:\Users\<myusername>\OneDrive\Documents\IIS Express\config folder and iisexpress started right up.
You need to use version 1.31.0 or later of the CloudAMQP provider.
Function composition - compact your opt funcs into a single one, before passing to New (as the 2nd param). You may also be fine with an option struct, do you really need logic in configs?
If you have updated your project to a newer version of React Native and all the API calls stopped working suddenly then update @react-native-community/netinfo library. It also causes problems.
#1 Put the Python formula in A1
=PY("import pandas as pd, numpy as np;
df = pd.DataFrame(np.random.randint(0,3,(3,3)), columns=list('ABC'), index=[1,2,3]);
df.reset_index(names='Index', inplace=True);
return df")
#2 Click the little ↘ icon (or choose **Excel values** in the dropdown)
The DataFrame now *spills* as a normal 4 × 4 grid (index + A B C).
#3 Give that spill a named range
Formulas ► Name Manager ► New →
Name: **DF_Out**
Refers to: `=Sheet1!$A$1#` ← the **#** means “this whole spill, whatever size”.
#4 Insert a PivotTable
Insert ► PivotTable ► *From Table/Range* → type **DF_Out**.
Build the Pivot, then add a PivotChart if you like.
✔ The pivot/chart updates whenever the Python code re-runs; just hit **Data ► Refresh All**.
Limitations
* A spill range itself can’t become an Excel Table (Excel blocks it), so the named-range trick is the workaround.
* If you really need a Table, copy-paste-values the spill elsewhere, press **Ctrl + T**, and use that – but you’ll have to overwrite it each time the DataFrame changes.
I suggest letting husky
go and installing lefthook
.
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.10.1</center>
</body>
</html>
In my case, i had an interface and was trying to instantiate an instance of it in another file.
wrong: let obj = new IMyInterface()
correct: let obj : IMyInterface = {}
There is a ".." in the indicated zip entry.
https://github.com/eclipse-jdt/eclipse.jdt.core/pull/2015
This could be particular to eclipse.buildId=4.31, try with 4.32.
Check the cache headers for the first request for the base page URL. If it is marked as cacheable and you are within the cache period then avoiding the second request is expected and correct behavior
If yoy are looking for good STDIN python code compiler, id recommend OneCompiler, it supports many more languages too. (www.onecompiler.com)
Another answer comes down to the DIFFERENCES between RaisError and Throw ... as RaisError does NOT honor Set Xact_Abort.
Moreover, Microsoft recommends that "new applications should use THROW instead." - Source
Excerpt:
RAISERROR statement | THROW statement |
---|---|
If a msg_id is passed to RAISERROR, the ID must be defined in sys.messages. | The error_number parameter doesn't have to be defined in sys.messages. |
The msg_str parameter can contain printf formatting styles. | The message parameter doesn't accept printf style formatting. |
The severity parameter specifies the severity of the exception. | There's no severity parameter. When THROW is used to initiate the exception, the severity is always set to 16. However, when THROW is used to rethrow an existing exception, the severity is set to that exception's severity level. |
Doesn't honor SET XACT_ABORT. | Transactions are rolled back if SET XACT_ABORT is ON. |
If you need check labels in your nodes, use
$ kubectl get nodes --show-labels
It's better to use a no-code solution for ETL. Choose between Fivetran, Renta ETL or Stitch Data.
My quick advice: if security is your top priority and support for service accounts is important, then Renta is the best choice. It gives you more control.
Also, Google Sheets handles only small volumes of data. The free tier should be sufficient. I don't see any reason to write code.
Following samcarter_is_at_topanswers.xyz's answer, I looked into the moderncv
documentation, and found besides loading \moderncvcolor{}
before \moderncvstyle{}
, we also need to use \colorlet{lastnamecolor}{black}
and \colorlet{firstnamecolor}{black}
(called after \moderncvstyle{}
) to make the color of name looks right.
The Discussions GraphQL API seems only to be for managing discussions; I did not see any way to enable it for a repo for which it has not been enabled manually (or with the gh cli) already.
So I made this: https://github.com/scottvr/gh_discussions_mass_enable which uses a browser, interactive auth (including 2FA), and the ability to specify one or more (or --all) of your repos to enable discussions on.
To properly resolve this issue in Power Apps, where you need a ComboBox on a second form to automatically populate with the same value selected in the ComboBox on the first form, you must use the DefaultSelectedItems property and keep in mind that a ComboBox expects a table (even for a single value), which is why the brackets [] are required.
Consider the following:
ComboBox_Clientes_Form1 → belongs to the first form (it already works and displays customer data).
ComboBox_Clientes_Form2 → must display the same customer in the second form.
Properties
1. Items in both ComboBoxes
Both must have the same list or set of customers as their data source:
Items: ListaClientes
2. DefaultSelectedItems in the ComboBox on the second form
Here's the most important part:
DefaultSelectedItems: [ComboBox_Clientes_Form1.Selected]
If you don't use brackets [], Power Apps throws an error because it expects a table, even if it's a single-record table.
Power Apps treats DefaultSelectedItems as a table of values because a ComboBox can be multi-select. Even if you only want to select one item, you need to encapsulate it in a table (a list of one), hence [ComboBox.Selected].
If the ComboBox is single-select, make sure AllowMultipleSelection is false.
If you're using SubmitForm instead of Patch(), make sure the field is correctly connected to a Lookup DataField field in SharePoint.
You're specifying only the y
scale. Update your options to specify both the x
and y
scales.
options: {
scales: {
x: {
beginAtZero: true,
},
y: {
beginAtZero: true,
},
},
}
Also, put the whole code in the window.onload
, to ensure the script loads before the JS executes.
This post is 14 years old, but answered my question today 6/20/2025.
I don't know if k to the z will see this, as he has not posted here for 9 years.
I liked his answer the best, not that the others were not good.
I began studying HTML in 1998.
At that time I did not use CSS.
I slowly delved in it here from 1999 - 2017.
In 2017 I took an HTML course at a local Community College.
I learned quite a bit, but it was new information and much did not last.
I chiefly use HTML on my local computer to capture information and display it to my liking and it is easy for me to find later. It is a way I take notes chiefly.
I just now created a mystyle.css file and it is working for my local webpage.
I have had my own domain and website but found it cost prohibitive for a poor cheapskate / miser / A.K.A my favorite name for it "frugal".
Should I delve into the somewhat costly world of my own domain.
In this modern 2025 world.
Would you say there is a place for inline stylesheet styling to change the look of different pages, or would you say that the separate stylsheet, like the mystyle.css (which could be changed of course to another name) be almost exlusively used?
I am thankful for this article.
I don't know if my question is helpful here as the post is so old.
But here goes.
Thank you!
equivalent of git show:
git difftool HEAD^
or
git difftool -t meld HEAD^
shows contents of the last commit
To see diff of arbitrary commit, e.g. 4th from HEAD:
git difftool HEAD~3
To see diff of an arbitrary commit, say `deadfeed`:
git difftool deadfeed^ deadfeed
User ngrok to expose your local url so clerk can call it from the internet
I am assuming its a bug, I had the same issue with version 1.101 of vscode, I was able to ssh through my terminal but vscode was failing. It wasn't happening for all of my servers so I am assuming that the problem happens with something specific in those servers which makes the problem more complicate I guess?. I tried many suggestions from github and an older question here but non worked, I even reinstalled vscode from scratch but nothing was working. I installed an earlier version (1.99.3) and that fixed it and I can ssh now with no issue.
Realize this is a preeeetty old question, but for those who are still searching for the same thing, Zest is the solution. (Full disclosure, I work there!) We help brands scale corporate, consumer, and event gifting and the multiship problem is our bread and butter.
If anyone is looking for this in 2025 - check out this control from MESCIUS ComponentOne:
WinForms MultiSelect Control.png
It's called MultiSelect and it works as both a checked listbox and a comma-delimited tag editor. See more here https://developer.mescius.com/componentone/winforms-ui-controls/multiselect-winforms-list-control or get the nuget package called https://www.nuget.org/packages/C1.Win.Input.MultiSelect
Well, in the meantime this question could be found obsolete. If you have to edit other programmers code, you will find classes and methods...
Well, after have been down-voted twice (without knowing why, cause' I tough my question was well made (AND I SEARCHED FOR ANSWERS BEFORE ASKING...))
I finally ended up with a partial answer, that, did nots really answered but at least fixed the problem !
In my code by doing that :
import pygame
import pymunk
import pymunk.pygame_util
class Player:
def __init__(self, space):
self.mass = 3
self.body = pymunk.Body(self.mass, pymunk.moment_for_box(self.mass, (50, 100)))
self.shape = pymunk.Poly.create_box(self.body, (50, 100))
self.shape.friction = 1
self.shape.elasticity = 0.0
space.add(self.body, self.shape)
self.direction = pygame.Vector2(0, 0)
def move(self, dir_vec):
self.direction = dir_vec
def update(self, dt):
if self.direction.length() < 0.2:
return
force = self.direction * 500 # À ajuster selon le poids de l'objet
self.body.apply_force_at_local_point(tuple(force))
pygame.init()
WIDTH, HEIGHT = 1920//2, 1080//2
window = pygame.display.set_mode((WIDTH, HEIGHT))
players = []
def draw(space, window, draw_options):
window.fill("white")
space.debug_draw(draw_options)
pygame.display.update()
def run(window, width, height):
run = True
clock = pygame.time.Clock()
FPS = 120
# Create a pymunk space
space = pymunk.Space()
space.damping = .5
space.iterations = 30
space.collision_slop = 0.1
space.collision_bias = 0.1
players.append(Player(space))
players.append(Player(space))
draw_options = pymunk.pygame_util.DrawOptions(window)
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
break
keys = pygame.key.get_pressed()
dir_p1 = pygame.Vector2(0, 0)
dir_p2 = pygame.Vector2(0, 0)
if keys[pygame.K_z]:
dir_p1.y -= 1
if keys[pygame.K_q]:
dir_p1.x -= 1
if keys[pygame.K_s]:
dir_p1.y += 1
if keys[pygame.K_d]:
dir_p1.x += 1
if keys[pygame.K_UP]:
dir_p2.y -= 1
if keys[pygame.K_DOWN]:
dir_p2.y += 1
if keys[pygame.K_LEFT]:
dir_p2.x -=1
if keys[pygame.K_RIGHT]:
dir_p2.x += 1
players[0].move(dir_p1)
players[1].move(dir_p2)
substeps = 100
for _ in range(substeps):
for player in players:
player.update(1/FPS/substeps)
space.step(1/FPS/substeps)
draw(space, window, draw_options)
clock.tick(FPS)
pygame.quit()
return
if __name__ == "__main__":
run(window, WIDTH, HEIGHT)
Which mean by substeping (a lot) and adding inertia, well, it fixed everything.
I really think that the bug was comming from the player update method because it was moving to strogly and so the detections couldn't be calculated.
Thank's to all the people who juste tried to think about my question!
I may not have been clear, even though the responses have been helpful.
Rather than delving into the world of thread programming if I didn't have to, I did some profiling. Here are the approximate timings:
p = sync_playwright().start() # .4 seconds
browser = p.firefox.launch() # .8 seconds
page = browser.new_page() # .9 seconds
page.goto(url) # 2.5 - 3.2 seconds
So, the start-up overhead is about 40% of the full request time. Definitely worth trying to optimize.
It looks like I want to put:
p = sync_playwright().start()
browser = p.firefox.launch()
page = browser.new_page()
in the "parent" thread, but make p, browser, and page available to each "child" thread.
So, I changed my code to look like:
thread_data = threading.local()
thread_data.p = sync_playwright().start()
@app.route('/fetch/')
def fetch_url():
url = request.args.get('url')
return fetch(url)
def fetch (url, thread_data=thread_data):
p = thread_data.p
browser = p.firefox.launch()
....
When I run this, I get:
File "/home/mdiehl/Development///Checker/./app.py", line 27, in fetch
p = thread_data.p
^^^^^^^^^^^^^
AttributeError: '_thread._local' object has no attribute 'p'
So, I guess I don't understand how threading works in Python. (I've done it in Perl and C)
Any further help would be appreciated.
Mike.
I realize I'm very late to this question, but for anyone else looking for this, the config option CONFIG_CMD_CONFIG
accomplishes this. With this enabled, you can run the config
command in a running U-Boot to see the configs in the image. See this commit in U-Boot. It appears to have first been added in v2017.03.
-- Count related entities per parent
SELECT parent_id, COUNT(*) AS related_count
FROM related_entity
WHERE parent_id IN (...)
GROUP BY parent_id;
-- Average value per parent
SELECT parent_id, AVG(score) AS avg_score
FROM ratings
WHERE parent_id IN (...)
GROUP BY parent_id;
ComponentOne has a more affordable DataGrid for MAUI. It's called FlexGrid - you can just grab it from nuget.org and start working with it. https://www.nuget.org/packages/C1.Maui.Grid
What's nice is that you can customize the grid line visibility so you can achieve a clean, mobile look, or keep the gridlines for a classic datagrid look. The control has star sizing, so the width can always fill your screen and not require horizontal scrolling (not ideal on mobile). See more images here: https://developer.mescius.com/componentone/maui-ui-controls/flexgrid-maui-datagrid
Approaches that always help me to reduce amount of false positives:
1. Rebuilt Pyinstaller Bootloader
to use GCC
compiler instead of MSVC
.
2. Use obfuscation for your code before compilation. I prefer pyarmor
lib and it allows to obfuscate and compile with pyinstaller
straight forward by command like pyarmor gen --pack onefile main.py
3. If you call some CMD
or Powershell
from your code, make sure that these string calls are getting built during runtime. For example if you call CMD like my_command = "wmic csproduct get uuid"
in code better do it like my_command = ''.join(['w', 'm', 'i', 'c', ...])
. I believe there should exist some Python string obfuscators but it is easy to do on your own.
If you use Oh My Zsh, you can use vyper-env:
Vyper-env is a lightweight Oh My Zsh plugin and works like a champ.
I solve de problem. my db cluster has an option called AUTO_ID_CACHE, it make auto_increment skips 30000 numbers. when you create a database, set AUTO_DB_CACHE 1 to avoid that behavior.
ENGINE=InnoDB AUTO_ID_CACHE 1;
<img src="logo.png" alt="Salamat Communication Logo" style="height:80px; margin-top:10px;" />
Is there anything wrong with the following as a short solution?
private object myLock = new object();
if (Monitor.TryEnter(myLock))
{
doWork();
Monitor.Exit(myLock);
}
else
{
lock (myLock){ };
}
from collections import defaultdict
import re
# Cole aqui o conteúdo do edital entre aspas triplas
edital_texto = """
(COLE AQUI TODO O TEXTO DO EDITAL)
"""
# Separar os tópicos principais
def verticalizar_edital(texto):
secoes = re.split(r'\n(?=[A-Z][A-Z\s]+:)', texto)
edital_dict = defaultdict(list)
for secao in secoes:
if ':' in secao:
titulo, conteudo = secao.split(':', 1)
conteudo = conteudo.strip().replace('\n', ' ')
subitens = re.split(r'(?<=\d)\. ', conteudo)
edital_dict[titulo.strip()].extend([item.strip() for item in subitens if item])
return edital_dict
# Gerar e imprimir o edital verticalizado
verticalizado = verticalizar_edital(edital_texto)
for secao, conteudos in verticalizado.items():
print(f"\n{secao}")
for item in conteudos:
print(f" - {item}")
This is a GCC Bug 119714 which has been fixed in trunk.
I was able to solve a similar issue by deleting:
~/Library/Caches/org.swift.swiftpm/repositories/<folder for package>
and
~/Library/org.swift.swiftpm/security/fingerprings/<json file for package>
And then re-adding the package to amy project.
I'm replying to this for future reference.
I hope it helps someone.
There are a number of issues in your code that are causing that error.
1:You're using authenticate
and login
but haven't imported them.
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
from django.contrib.auth import authenticate
from rest_framework.authtoken.models import Token
from django.contrib.auth import get_user_model
from .serializers import AccountSerializer
from .models import Account
User = get_user_model()
class AuthRegister(APIView):
"""
Register a new user.
"""
serializer_class = AccountSerializer
permission_classes = (AllowAny,)
def post(self, request, format=None):
serializer = self.serializer_class(data=request.data)
if serializer.is_valid():
user = serializer.save()
# Create token for the new user
token, created = Token.objects.get_or_create(user=user)
return Response({
'user': serializer.data,
'token': token.key
}, status=status.HTTP_201_CREATED)
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
class AuthLogin(APIView):
"""
Login user and return token
"""
permission_classes = (AllowAny,)
def post(self, request, format=None):
data = request.data
email = data.get('email', None)
password = data.get('password', None)
if email is None or password is None:
return Response({
'error': 'Please provide both email and password.'
}, status=status.HTTP_400_BAD_REQUEST)
# If using custom user model, you might need to get user first
try:
user = Account.objects.get(email=email)
if user.check_password(password):
token, created = Token.objects.get_or_create(user=user)
return Response({
'token': token.key,
'user_id': user.id,
'email': user.email
}, status=status.HTTP_200_OK)
else:
return Response({
'error': 'Invalid credentials.'
}, status=status.HTTP_401_UNAUTHORIZED)
except Account.DoesNotExist:
return Response({
'error': 'Invalid credentials.'
}, status=status.HTTP_401_UNAUTHORIZED)
2:You're using JWT tokens in URLs but session-based login()
in your view.
from django.urls import path
from .views import AuthRegister, AuthLogin
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView,
)
urlpatterns = [
path('register/', AuthRegister.as_view(), name='auth_register'),
path('login/', AuthLogin.as_view(), name='auth_login'),
# JWT endpoints (alternative to your custom login)
path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
path('token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
path('token/verify/', TokenVerifyView.as_view(), name='token_verify'),
]
3:Your AuthLogin
view doesn't generate or return tokens.
# serializers.py
from rest_framework import serializers
from .models import Account
class AccountSerializer(serializers.ModelSerializer):
password = serializers.CharField(write_only=True)
class Meta:
model = Account
fields = ('id', 'email', 'password', 'first_name', 'last_name') # adjust fields as needed
extra_kwargs = {'password': {'write_only': True}}
def create(self, validated_data):
password = validated_data.pop('password')
user = Account.objects.create(**validated_data)
user.set_password(password)
user.save()
return user
4:If you're using a custom Account
model, Django's default authenticate()
might not work properly.
INSTALLED_APPS = [
'rest_framework',
'rest_framework.authtoken',
'rest_framework_simplejwt',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',,
],
}
5:django-rest-framework-jwt
is deprecated. Use djangorestframework-simplejwt
instead.
First, install the correct JWT package:
pip uninstall djangorestframework-jwt
pip install djangorestframework-simplejwt
# Even simpler approach using DRF generics
from rest_framework import generics
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
class CustomAuthToken(ObtainAuthToken):
def post(self, request, *args, **kwargs):
serializer = self.serializer_class(data=request.data,
context={'request': request})
serializer.is_valid(raise_exception=True)
user = serializer.validated_data['user']
token, created = Token.objects.get_or_create(user=user)
return Response({
'token': token.key,
'user_id': user.pk,
'email': user.email
})
class AuthRegister(generics.CreateAPIView):
serializer_class = AccountSerializer
permission_classes = (AllowAny,)
I hope this sorts the issue.
@Rackover
So, what was the solution? All I can see is your questions, and it's like if every answer to your question was erased???
A little late here but here's a solution for posterity:
You can get MapStruct to add a collection using an adder of individual elements rather than the setter of the entire list using the CollectionMappingStrategy.ADDER_PREFERRED
.
@Mapper(collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED)
public interface AuthorMapper {
@Mapping(target = "authorName", source = "request.authorRequestName")
@Mapping(target = "authorBooks", source = "request.authorRequestBooks")
Author map(AuthorRequest request);
// You'd still need to explain how to map an individual book
// This can be done in a separate Mapper as well
public Book map(String bookTitle);
}
Then modify your entity to use adders to add to the list. Here you can reference the parent Author
and the child Book
as they are being mapped and create a relation.
@Entity
class Author {
@Id
private Long id;
private String authorName;
@OneToMany(mappedBy = "author")
private List<Book> authorBooks;
public void addBook(Book book) {
authorBooks.add(book);
book.setAuthor(this);
}
}
This is what the book mapping part of the generated code will look like:
public class AuthorMapperImpl implements AuthorMapper {
...
public Author map(AuthorRequest request) {
Author author = new Author();
author.setAuthorName(request.getAuthorRequestName());
if (request.getAuthorRequestBooks() != null) {
for ( String bookTitle : request.getAuthorRequestBooks() ) {
author.addBook( map( bookTitle ) );
}
}
return author;
}
...
}
This is especially useful when you're dealing with JPA relations like @OneToMany where you need the child as the owner of the relation to point back to the parent object, so you need the add method anyway.
Im using CatBoost on binary dataset HP determined by optuna. Optuna shows high AUC with test on test file, but when test real model on the same data, then there isn't only noticeable difference, AUC there its around 60%+ where optuna reports 99%. There is way to much discrepancy for the same data !? There is something fishy here ? The only explanation is that there for the same data optuna determined HP for chosen ML model, later real ML model with optuna determined HP doesn't handle data the same way !? I tested a lot, AUC newer goes up, what eves principle i may ad to optuna to gain better HP (sampling, SMOTE - different approaches, to handle class imbalance). So even if i use praised optuna i don't gain better AUC ! Why's that ? Neural networks for given train and test data should be able to reproduce data pattern in given confidence level (may not be 100%, but also not 50 or 60% ! I read somewhere that scikit isn't capable solution. And that's why optuna should be incorporated - built in in software (in NN's directly) so u get predefined model with workflows exactly that way in the same way to handle data. It may be very challenging for developers to do so, but its the only way to get end user to desired end results. Recipes for using data mining and mashine learning are worth nothing with such approaches. End user simple doesn't get the end results.
I believe I pinpointed the problem. You have to enable two way communication. This worked like a charm for me.
Note: the update might take a little while to kick in
Try setting
location /static/ {
root /var/www/django/yourdjangoproject;
}
in the /etc/nginx/sites-enabled/yoursite
setup file
My solution was to switch to Windows.Networking.Sockets.StreamSocket. The problem was a single peer to peer connection and it needed to be robust and handle low bandwidths.
I'm one of the contributors of Sourcebot, a modern open source code search tool.
It's a single docker container and indexes repos automatically from a config. It has all of the search functionality you'd expect (regex search, filter by repo/language, goto definition and find all references)
What worked for me is, I've added @react-native-firebase/messaging previously and build my app using eas but got this error. Then I removed this package and rebuilded the app and I got foreground notifications.
a = int(input("a: "))
o = int(input("op: "))
b = int(input("b: "))
def calculate(num1, num2, operator):
result = eval(f"{num1}{operator}{num2}")
return result
print(calculate(a, b, o))
As a complement to the above answer, this is the native powershell equivalent:
docker ps -a -q | ForEach-Object {
$id = $_
$info = docker inspect $id | ConvertFrom-Json
$name = $info[0].Name.TrimStart("/")
$policy = $info[0].HostConfig.RestartPolicy.Name
"$name`t$policy"
}
import pyautogui
import time
time.sleep(5) # Gives you 5 seconds to focus the window
for i in range(100): # Click 100 times
pyautogui.click()
time.sleep(0.01) # 10ms delay between clicks (~100 clicks/sec)
check if you are using function name as def app() if it then change the function name
paste the code at the top of build.gradle
groove
def osName = System.getProperty("os.name").toLowerCase()
def sdkPath
if (osName.contains("windows")) {
sdkPath = "C:\\\\ANDROID_SDK"
} else if (osName.contains("mac")) {
sdkPath = "/Users/web/Library/Android/sdk"
} else {
throw new GradleException("Sistema operacional não suportado: " + osName)
}
def localPropsFile = new File(rootDir, "local.properties")
def localProps = new Properties()
// Cria o arquivo se não existir
if (!localPropsFile.exists()) {
println "Arquivo local.properties não encontrado. Criando..."
localPropsFile.createNewFile()
}
// Carrega as propriedades existentes
localProps.load(localPropsFile.newDataInputStream())
// Atualiza sdk.dir apenas se necessário
if (!localProps.containsKey("sdk.dir") || localProps.getProperty("sdk.dir") != sdkPath) {
localProps.setProperty("sdk.dir", sdkPath)
localProps.store(localPropsFile.newWriter(), null)
println "sdk.dir configurado como: $sdkPath"
} else {
println "sdk.dir já está corretamente definido como: $sdkPath"
}
From one of the CUE developers: Embedding won't catch if the expected field name ("in") was included. With unification, in the example above, if "in" is misspelled, you'll get an error. Otherwise, with embedding, you'd just get a further expansion.
Unification is appropriate for checking. Embedding is for extending/adding more fields.
You can try trimming both directions of the text
Text(
text = "Hello world",
modifier = modifier
.border(
width = 1.dp,
color = Color.Red
).padding(0.dp),
style = MaterialTheme.typography.displaySmall.copy(
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Center,
trim = LineHeightStyle.Trim.Both,
),
platformStyle = PlatformTextStyle(
includeFontPadding = false
),
)
)
I had a similar thing. Tried to install my app to my iPhone using Xcode 26 and it failed. So I switched back to Xcode 16.4 and got the same error as you. I've tried:
In my case I believe the problem was the result of accepting suggested project settings in Xcode 26. I couldn't tell you which ones as I just reverted to the commit right before I applied the changes.
In my case I had an issue on CI runner and I had to re-install setuptools
python3 -m pip install --upgrade pip setuptools
id,first_name,last_name,email,phone_number,registration_date
1,Александр,Иванов,[email protected],"+79123456789",2024-02-29 10:00:00
2,Елена,Петрова,[email protected],"+79234567890",2024-02-29 10:00:00
3,Дмитрий,Сидоров,[email protected],"+79345678901",2024-02-29 10:00:00
4,Ольга,Васильева,[email protected],"+79456789012",2024-02-29 10:00:00
5,Сергей,Николаев,[email protected],"+79567890123",2024-02-29 10:00:00
6,Анна,Кузнецова,[email protected],"+79678901234",2024-02-29 10:00:00
7,Игорь,Смирнов,[email protected],"+79789012345",2024-02-29 10:00:00
8,Наталья,Попова,[email protected],"+79890123456",2024-02-29 10:00:00
9,Андрей,Соколов,[email protected],"+79901234567",2024-02-29 10:00:00
10,Светлана,Лебедева,[email protected],"+79012345678",2024-02-29 10:00:00
11,Роман,Егоров,[email protected],"+79123456790",2024-02-29 10:00:00
12,Татьяна,Волкова,[email protected],"+79234567901",2024-02-29 10:00:00
13,Михаил,Морозов,[email protected],"+79345679012",2024-02-29 10:00:00
14,Юлия,Виноградова,[email protected],"+79456790123",2024-02-29 10:00:00
15,Владимир,Федоров,[email protected],"+79567901234",2024-02-29 10:00:00
16,Екатерина,Андреева,[email protected],"+79679012345",2024-02-29 10:00:00
17,Павел,Данилов,[email protected],"+79789012356",2024-02-29 10:00:00
18,Ксения,Дмитриева,[email protected],"+79890123567",2024-02-29 10:00:00
19,Денис,Жуков,[email protected],"+79901235678",2024-02-29 10:00:00
20,Алина,Зайцева,[email protected],"+79012345689",2024-02-29 10:00:00
21,Артем,Козлов,[email protected],"+79123456801",2024-02-29 10:00:00
has there been any updates with this?
Apologies, allow me to be more clear.
Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.7.4
Language = VB.NET
Shutdown Mode = Shutdown only after last form closes
Private Sub Form1ToolStripMenuItem_Click
Analysis.Show()
End Sub
Private Sub Analysis_Load
Form1.Close()
End Sub
This results in the app ending.
Private Sub Form1ToolStripMenuItem_Click
Analysis.Show()
Me.Hide
End Sub
Private Sub Analysis_Load
Form1.Close()
End Sub
This results in the app continuing to run after Analysis is closed.
Private Sub Form1ToolStripMenuItem_Click
Dim frm2 As New Analysis
frm2.Show()
Close()
End Sub
The above also results in the app ending.
Thank you for your time and help.
Is this happening on the latest stable Maui 9 version?
Your example could be made a bit more clear with some additional context.
I've had issues in the past with the UI not updating for CollectionViews because the binding was being set too soon.
When is LoadDataInternal being called?
Are you adamant on the CommunityToolkit for this? I could not replicate your issue using standard observable properties, but it's also possible this issue is specific to a MAUI version.
If you want to avoid boilerplate you can have a baseviewmodel that inherits from the INotifyPropertyChanged and inherit that
public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
readonly Dictionary<string, object> _fieldValuesDictionary = new();
public void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public bool SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
field = value;
OnPropertyChanged(propertyName);
return true;
}
}
Then your properties will look like this - it's still more code than the CommunityToolkit, but it's neat enough
ObservableCollection<OverallBalance> _monthlyBalances;
public ObservableCollection<OverallBalance> MonthlyBalances
{
get => _monthlyBalances;
set => SetField(ref _monthlyBalances, value);
}
OverallBalance _monthlyBalance;
public OverallBalance MonthlyBalance
{
get => _monthlyBalance;
set => SetField(ref _monthlyBalance, value);
}
The problem lies on using absolute paths instead of relative ones according to this answer on Unity forums. I posted this question there and now I want to share Adrian's answer so we don't have this question on StackOverflow unanswered.
Yes, I think OpenCV is best suited for this task. How about you try using OpenCV to detect the curve, then convert pixel coordinates to actual values. So the key is using cv2.findContours()
to detect the curve, then manually calibrating pixel coordinates to actual graph values using np.interp()
.
Actually, we have to use to PerformanceNavigationTiming to get understanding if a page was achieved by the browser button Back. So the code above or below would be as following:
const [entry] = window.performance.getEntries();
if (entry?.type === 'back_forward') location.reload();
First, your issue is not related to Jotai or NextJS or something. Circular dependency exists in every language.
From wikipedia:
In software engineering, a circular dependency is a relation between two or more modules which either directly or indirectly depend on each other to function properly. Such modules are also known as mutually recursive.
You need think about what circular dependency is, how you should design your state architecture.
Barrel file approach will not fix your issue, instead it will increase possible circular dependency issues. You can read this article to understand more about barrel files and why you shouldn't use them. Its written by creator of react-query.
If you are using NextJS, you can install circular dependency plugin (https://www.npmjs.com/package/circular-dependency-plugin) for webpack to make debugging easier.
It is due to some idiosyncracy of Translatepress with alias domains. The option "Use subdirectory for the default language" must be disabled for aliases to work properly with the plugin , as they suggested here https://wordpress.org/support/topic/alias-domains-are-unsupported
It seems that in order to do the List command using the code I was using the search tags function even though I am not providing any tags.
The bottom of this article (https://learn.microsoft.com/en-us/rest/api/storageservices/list-blobs?tabs=microsoft-entra-id) shows that to do this requires a different permission "Storage Blob Data Owner" rather than just "Storage Blob Data Reader"
Assigning this to the Group my user is in at the top level of the storage account doesn't work, but assigning it to the Service Principle that the code is using for authentication does work.
A relatively simple fix. I had tried rolling back my version of httpuv and R. However just copying the dll file from my laptops Win 10 httpuv library folder was sufficient to get things working.
As noted in the comments, installation was on a firewalled server. Maybe somewhere in the download of the files the dll wasn't formed correctly not sure. There was a handful of issue reports on the github for httpuv with the same problem. So not sure, but fortunately was just able to copy and paste and working copy over and it was resolved.
As stated in the comments, eigenvectors only indicate the correct "direction" but not the correct "orientation". So a solution would be to test all the symmetries and keep the "best one". One possibility is to compute the distance between the bounding boxes of source and destination pointclouds after rotation for all potential rotation matrices (taking symmetries into account) and keep the rotation matrix with the lowest distance.
It would have been easier to give you a proper answer if you had provided some sample code, but here is a Jupyter notebook I created to explain exactly this (funny enough, also using the Stanford bunny as an example).
I faced this issue before, I also tried in company I worked for to send alert based on bigquery database when condition met
I tried Pub Sub, App Script, Collab, but non of them provide simple and comprehensive solution, and you need to create all the flow by yourself, create the email sending code, condition exc' it's taking a lot of time and really hard to scale up.
So, I've simple solution for you, Analytics Model platform ( Disclaimer: I'm working in Analytics Model)
Here you can find tutorial, explain step by step how to set up an automated alert.
Anyway I will explain step by step how to set up an automated alert:
You need to go to Connection, select Bigquery
Add your table
Create your Insight (what you need to be triger), make sure you're using the your Bigquery table
Add to your feed
Go to your feed and schedule the mail and the condition
Hi I was also having the same problem. I was trying to pip install with Python 3.9 (which should work according to the mlx team) but it wasn't working for me and was giving the no distribution found error.
When I switched my python version to 3.11 however it worked fine
I have the same problem. In some cases I was unable to focus in search input of opened select2.
After some debugging I found that jQuery 3.7.1 tries to fix some unexpected behaviour of focusin
/focusout
event. Here is code with that fix. If you curious, and also brave enough, check it.
That code captures focus
related events on #document
a do some magic with them, which unfortunately leads to select2 won't work.
It could be fixed like this:
/**
* Call this in your document.ready function
*/
function fixSelect2SearchInputWontFocus() {
// on select2:open there is fresh .select2-container
$(window).on('select2:open', () => {
// stop propagation of events up to #document
$('.select2-container').on('focus blur focusin focusout', e => {
e.preventDefault();
e.stopPropagation();
});
// off event is not needed, container is removed on close
});
}
I have the same problem, it told me can not find the host, and I solved it by removing the "-" from the "Host" section, and everything works now!
The following is the ssh config file that works well in Windows 10
Host tokyo
HostName 12.23.34.45
User xxyyuser
IdentityFile "D:/download/tokyo.pem"
I'm having the same issue. Did you figure this out?
Yes, if you allow /token/extend
to accept a valid access token and generate a new one indefinitely, a stolen token can be used by an attacker to maintain access forever.Use a Refresh Token mechanism. Access tokens should be short-lived and stateless, while refresh tokens should be securely stored, validated server-side, and rotated to prevent abuse. This ensures that even if an access token is compromised, long-term access is not possible without also stealing the refresh token.
An idea that can be improved:
let min = 1900
let max = 2000
function randomyear() {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
faker.helpers.uniqueArray(randomyear, 10);
you can do this with CSS like that, for a custom post type MY_TYPE
:
.type-MY_TYPE h1.entry-title::after
{
content : "®";
vertical-align : super;
font-size : smaller;
line-height : normal;
}
you can look here for other ways of making superscript : Superscript in CSS only?
You're trying to access coordinate
but it does not exist in the data returned by PlaceAutoComplete.suggestions()
. This happens because the Search SDK for iOS is using the Search Box API behind the scenes, which is a two-step search process. The first step gets suggestions, the second "retrieves" full details about a suggestion after the user selects one. The first call to get suggestions does not include coordinates. You can learn more about the data actually returned by these API calls using the Search Box API playground: https://docs.mapbox.com/playground/search-box/suggest-retrieve/.
You need to call PlaceAutoComplete.select(suggestion: selectedSuggestion)
as outlined in step 4 on this guide: https://docs.mapbox.com/ios/search/guides/search-by-text/
That response will include the coordinates
data you're looking for.