Author Archives: Robins

How to set font color in Latex (3 ways)

1. Use the defined color directly
\usepackage{color}

\textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text}

where textcolor{…} contains the system-defined colors

 

2. Combine the values of red, green and blue to form the color we want
\usepackage{color}

\textcolor[rgb]{r,g,b}{text}

where {r,g,b} represents the combination of red, green and blue colors, and takes values in the range [0-1]

\textcolor[RGB]{R,G,B}{text}

where {R,G,B} represents the combination of red, green and blue colors, and the range of values is [0-255]

 

3. Define a color, call directly
\usepackage{color}

\definecolor{ColorName}{rgb}{r,g,b} This time r/g/b is defined in the range [0-1].

\definecolor{ColorName}{RGB}{R,G,B}, when the domain of R/G/B is defined in [0-255].

Here the name ColorName is defined for the color, and the following can call this color scheme directly

\textcolor{ColorName}{text}

PHP: How to get the total number of data in the MySQL table (total number of rows)

RewCount (): Returns the number of rows affected:

 $sql='select * from '.$_POST['fname'].'_blog_data';
		 $sth=$pdo->query($sql);
		 die('<script>alert('.$sth->rowCount().')</script>');

2

$q = $pdo->query("SELECT count(*) from w_login_record;"); $rows = $q->fetch(); $rowCount = $rows[0];
		 die('alter("'.$rowCount.'")');

3

Use the fetchAll function $q = $db->query("SELECT ..."); $rows = $q->fetchAll(); $rowCount = count($rows);

ValueError: need more than 1 value to unpack

class Person():

def __init__(self, Newname, Newage, Newtype):

self. type = Newtype,self.name = Newname,self. age = Newage,

This is the wrong way to write, not on the same line!

#     def __init__(self, Newname,Newage,Newtype):

#         self.name = Newname,

#         self. age = Newage,

#         self. type = Newtype,

from django. http import  HttpResponse
from django. template import Template ,Context
import datetime
from HelloDjango.Model. Person import *

def Hello(request , offset ):

tempStr = “{{person.name}} {{person. age}} {{person. type}}”
tempAnswer = {“person” : Person(“hjc”, “11”, “man”)}
#
#     tempStr = “{{person.name}} {{person. age}} {{person. type}}”
#     tempAnswer = {“person” : Person(‘hjc’ , ’11’ ,’man’)}

t = Template(tempStr)
c = Context(tempAnswer)
return HttpResponse(t.render(c))

Flutter Xcode Module not found or LibreSSL SSL_connect: SSL_ERROR_SYSCALL

Xcode appears in the Flutter project

The Module ‘qr_code_scanner’ not found

or

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

~/. GitConfig file
can be edited to modify or add proxies, requiring local hanging ladder

[http]
    sslBackend = openssl
    proxy = socks5://127.0.0.1:7890

How to Set latex text Bold & Italic

Show upright text: \textup{text}
italic: \textit{text}
slanted italic: \textsl{text}
Display lowercase uppercase text: \textsc{text}
Medium weight: \textmd{text}
Bold command: \textbf{text}
Default value: \textnormal{text}

Italic: \textit{italic}, or \emph{italic}

Fine font: \textlf{light font}

Use equal-width fonts: \texttt{code}

Use sans-serif font: \textsf{sans-serif}

All letters uppercase: \uppercase{CAPITALS}

All letters uppercase, but lowercase letters are smaller: \textsc{Small Capitals}

How to Hide index.php

 
 

 
 
 

server {
        listen        80;
        server_name  www.mxscs.com;
        root   "D:/develop_soft/daima_mxs/ib_crm_bonus";
        location/{
           if (!-e $request_filename) {  
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }
            index index.php index.html error/index.html;
            error_page 400 /error/400.html;
            error_page 403 /error/403.html;
            error_page 404 /error/404.html;
            error_page 500 /error/500.html;
            error_page 501 /error/501.html;
            error_page 502 /error/502.html;
            error_page 503 /error/503.html;
            error_page 504 /error/504.html;
            error_page 505 /error/505.html;
            error_page 506 /error/506.html;
            error_page 507 /error/507.html;
            error_page 509 /error/509.html;
            error_page 510 /error/510.html;
            include D:/develop_soft/daima_mxs/ib_crm_bonus/nginx.htaccess;
            autoindex  off;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

 

No artifacts package solution for idea to configure Tomcat

I don’t know why my idea is always inexplicably wrong, maybe it is aimed at me
1. At this point you can see that there are no artifacts and there are warnings in the bottom that cause Tomcat to not be successfully configured

2. The solution I found on the Internet is to check this box, but my default is that the box does not solve my problem
 

3. I updated the Maven environment and solved it successfully

Conclusion: Just update the Maven environment
 

The reason and solution of the error of join function: sequence item 0: expected STR instance, int found

When I was writing code the other day, the task was to separate the incoming parameters with “_” and then append them to the file
Direct up code

def operate(file_path, *args):
    f = open(file_path, mode="a", encoding="utf-8")
    s = ""
    s = '_'.join(args)
    f.write(s)
    f.flush()
    f.close()
operate("hhhh.txt", 123, 456, 789)

Receive a string, but I wrote a number by mistake, then reported an error
TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found
Then look for the document, and here’s the original text
Return a string which is the concatenation of the strings in iterable. A TypeError will be raised if there are any non-string values in iterable, including bytes objects. The separator between elements is the string providing this method.
The join function is a string function, and the arguments and inserts are strings
So:
S = ‘_’.join(args) to

s = '_'.join(str(args).strip())

That’s it!
 
 
 

Type error: sequence item 0: expected STR instance, int found

TypeError: sequence item 0: expected STR instance, int found TypeError: sequence item 0: expected STR instance, int found
List1 =[1,’two’,’three’,4]
print(‘ ‘.join(list1))
I thought it would print 1, two, three, four
The result was an error
Traceback (most recent call last):
File “< pyshell#27>” , line 1, in < module>
print(” “.join(list1))
peerror: sequence item 0: expected STR instance, int found
p> (“.join(list1))
TypeError: sequence item 0: expected STR instance, int found
A list of numbers cannot be converted directly to a string.
Print (” “.join(‘%s’ %id for id in list1))
That is, iterating through the elements of the list, converting them to strings. So I can print 1, 2, 3, 4.