Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I'd like to perform a mass renaming of all files in the lightroom database
From: xxx_2.nef
To : xxx.nef
I.e, for each image, if the name contains _2, then remove it.
Which tables and columns would be appropriate to hit?
Ended up using sql lite to open up the .lrcat file: Ran this query to fix the issue:
update AgLibraryFile
set basename = substr(basename, 0, length(basename) -1),
idx_filename = substr(basename, 0, length(basename) -1) || '.' || extension,
lc_idx_filename = substr(basename, 0, length(basename) -1) || '.' || extension,
originalFileName = substr(basename, 0, length(basename) -1) || '.' || extension
WHERE basename like '%-2'
Related
Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 days ago.
Improve this question
1752462448 1933193007 1667526190 1684632419 1869767777 1886400099 1869426529 1953784163 1751999854 1953705777 808924214 943272760 825768241 858992688 876162865 808924214 959918133 892810033 825832761 808726350 1162236485 1412330081 1912602624 there is the cipher.
i tried dcode.fr Cipher Identifier and it says this is base36. yes i found something with it like a another cipher. i tried to decode it too but got nothing.
Example in Python for its universal intelligibility:
c = '1752462448 1933193007 1667526190 1684632419 1869767777 1886400099 1869426529 1953784163 1751999854 1953705777 808924214 943272760 825768241 858992688 876162865 808924214 959918133 892810033 825832761 808726350 1162236485 1412330081 1912602624'
b = [bytes.fromhex(
f'{int(a):08x}').decode() for a in c.split()]
print(''.join(b).rstrip('\x00'))
https://cdn.discordapp.com/attachments/1074689381891330049/1074697055731195904/NEFRET.rar
Note that b is the following list (with the last element 'r\x00\x00\x00'):
['http', 's://', 'cdn.', 'disc', 'orda', 'pp.c', 'om/a', 'ttac', 'hmen', 'ts/1', '0746', '8938', '1891', '3300', '49/1', '0746', '9705', '5731', '1959', '04/N', 'EFRE', 'T.ra', 'r\x00\x00\x00']
Therefore, wee need to remove all trailing ␀ (U+0000, Null) characters (see .rstrip('\x00') in the last line of above code snippet).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have recently began to explore the Nim programming language and I was wondering how to connect to a SQLite database. After reading the relevant section of the manual, my confusion has not diminished. If someone would be kind enough to provide a simple example, I would appreciate it.
Thanks.
Nim latest source code provide a good example. Copy the example here:
import db_sqlite, math
let theDb = open("mytest.db", nil, nil, nil) # Open mytest.db
theDb.exec(sql"Drop table if exists myTestTbl")
# Create table
theDb.exec(sql("""create table myTestTbl (
Id INTEGER PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
i INT(11),
f DECIMAL(18,10))"""))
# Insert
theDb.exec(sql"BEGIN")
for i in 1..1000:
theDb.exec(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
"Item#" & $i, i, sqrt(i.float))
theDb.exec(sql"COMMIT")
# Select
for x in theDb.fastRows(sql"select * from myTestTbl"):
echo x
let id = theDb.tryInsertId(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
"Item#1001", 1001, sqrt(1001.0))
echo "Inserted item: ", theDb.getValue(sql"SELECT name FROM myTestTbl WHERE id=?", id)
theDb.close()
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I'm pretty new to r and can't get this if statement to work
if(y==67){
lowermort = 1
} else{
lowermort = sum(tpxoverilower[1:(y-67)]) + 1 )
}
I get this error
Error: unexpected ')' in:
"} else{
lowermort = sum(tpxoverilower[1:(y-67)]) + 1 )"
You have an extra end parentheses at the end of the statement
lowermort = sum(tpxoverilower[1:(y-67)]) + 1 )
it should be
lowermort = sum(tpxoverilower[1:(y-67)]) + 1
When you're new to r, always make sure to double check that your parentheses, equals signs, etc are all in the right place - it will cause a lot of errors starting out. The "unexpected X" error derives from exactly this.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I know this may sound a little stupid, but one of my NGINX config files is a piece of crap when it comes to formatting. It works and all but that's about it.
I tried to find some kind of beautifier or formatter, like http://jsbeautifier.org/ but then for nginx config files instead of javascript, but no luck so far.
I hope anyone would have a suggestion. There are no requirements, as long as it can format quickly / lazily made NGINX config files!
Thanks!
I found a few projects which might suit your needs:
Nginx Formatter (python) by 1connect
you can get it here
Nginx beautifier (js/nodejs) by vasilevich
nginxbeautifier.com which lets you format configs quickly in a web browser.
you can get a command line tool also on the same site to run it locally.
If your block lines end with {'s and }'s, this simple indenter could help you a bit.
It does not format all your configs, it only fixes indentation.
Original in awk (source):
#!/usr/bin/awk -f
{sub(/^[ \t]+/,"");idx=0}
/\{/{ctx++;idx=1}
/\}/{ctx--}
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0}
Or rewritten in python:
INDENT = ' ' * 4
def indent(contents):
lines = map(str.strip, contents.splitlines())
current_indent = 0
for index,line in enumerate(lines):
if (line.endswith('}')):
current_indent -= 1
lines[index] = current_indent * INDENT + line
if (line.endswith('{')):
current_indent += 1
return ('\n').join(lines)
There is a fork of http://jsbeautifier.org/ for nginx here: https://github.com/vasilevich/nginxbeautifier
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have to rename a list of files in a folder so that:
From file named:
> myfile_000.txt
> myfile_001.txt
> ......
to file named:
> myfile_1.txt
> myfile_2.txt
> .......
Total files = 156
I used the following script:
> file.rename(list.files(pattern="myfile_*.txt", paste0("myfile_", 1:156)))
But without success.
Error:
Error in file.rename(list.files(pattern = "myfile_*.txt", paste0("myfile_", :
argument "to" is missing, with no default
The error message tells you, that you didn't specify the new names. It should work if you change the position of one ):
file.rename(list.files(pattern="myfile_*.txt"), paste0("myfile_", 1:156))