Tag Archives: Problem solving

Solution to MySQL workbench error 1148 unable to load local data

Windows10 workbench 8.0 error code:1148 temporary solution is as follows :
1. In the Workbench, type Show Global variables like ‘local_infile’;
result should be :on. This problem has nothing to do with whether localinfile =1, which is a bug of workbench. 2. Continue to enter show variables like ‘secure_file_priv’;
the result should be C:\ProgramData\MySQL\MySQL Server 5.7\Uploads file; 3. Put the files that need to be imported into the file in step 2;
4. Load data local infile command to remove the local, and combined with step 2 folder path, for example, is as follows:
the load data infile ‘C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/a.c sv into table a’;
Ps: resources: https://bugs.mysql.com/bug.php?Id =91891 Post Catherine S reply, like one!

Under Ubuntu environment, eclipse writes C program, and error starting process is reported

Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI C Project: Hello Word ANSI I checked a lot of places and did what everyone said, but nothing worked. Finally in the inspired by http://stackoverflow.com/questions/11390163/running-ubuntu-eclipse-c-helloworld. I installed a dual system, and I set the default working directory of Eclipse to the E disk under Windows (there is also a Chinese directory inside, I don’t know if this makes a difference). And then you keep reporting this error. I changed the directory under Ubuntu so I didn’t make any mistakes.

【R】【unimplemented type ‘list’ in ‘orderVector1’】

I. Problem description
When using the R language, you want to use the order function for a matrix to sort by a column, and the result is an error

> print(rep_motion)
       [,1]        [,2]         [,3]     
  [1,] NaN         NaN          NaN      
  [2,] 0.0434575   0.01098376   0.9512894
  [3,] 0.001588562 0.001588562  0.99722  
  [4,] 0.004219409 0            0.9978903
  [5,] 0.004721435 0.0006295247 0.9952786
  [6,] 0.008078995 0.000598444  0.9931179
  [7,] 0.01246883  0.009975062  0.9806733
  [8,] 0           0            1        
  [9,] 0.03324361  0.02113055   0.9510094
  [10,] 0.02582149  0.01563      0.9611535
  [11,] 0.006769826 0.005802708  0.9883946
  [12,] 0.001959248 0.0003918495 0.9980408
  [13,] 0.002842524 0.0005685048 0.9971575
  [14,] 0.00748183  0.001710133  0.9910218
  [15,] 0.02713675  0.01901709   0.9626068
  [16,] 0.03195067  0.009529148  0.9646861
  [17,] 0.01386159  0.01799938   0.9778628
  [18,] 0.02140673  0.1569827    0.9006116
  [19,] 0.06902854  0.01588641   0.9190215
  [20,] 0.006300257 0.003150128  0.9912957
  [21,] 0.01619586  0.006779661  0.9777778
  [22,] 0.006226313 0.00351922   0.9910666
  [23,] 0.01170929  0.005552047  0.9836333
> rep_motion[order(rep_motion[,3])]
   Error in order(rep_motion[, 3]) : unimplemented type 'list' in 'orderVector1'

Ii. Problem Solving
Check out the type of REP_motion:

> typeof(rep_motion)
  [1] "list"
> mode(rep_motion)
  [1] "list"
> class(rep_motion)
  [1] "matrix"

The reason is that when you create this matrix, you group each row together as a list, so that when you order, you are ordering the list, not the number. Numbers are sized so they can be sorted, while list is not, so it will report an error.
when your matrix changes to the following type, it will not report an error.

> typeof(evaluated)
  [1] "double"
> mode(evaluated)
  [1] "numeric"
> class(evaluated)
  [1] "matrix"

It depends on how you define it. If you still have not solved, welcome to exchange in the comments section!

Python: How to Fix “Ord() expected string of length 1, but int found”

code as follows:

import base64

def decode(ciphertext):
	plaintext = ''
	ciphertext = base64.b64decode(ciphertext)
	for i in ciphertext:
		s = ord(i)-16 ######################
		s = s^32
		plaintext += chr(s)
	return plaintext

cipher = 'XlNkVmtUI1MgXWBZXCFeKY+AaXNt'
flag = decode(cipher)
print(flag)

In python3, running

with a hash sign will fail and python2 won’t, because in python3 the ord() accepts a string of length 1, whereas in python3 the I is already an integer, and you can just use i-16 to do the operation

Python3 ord() expected string of length 1, but int found