Unable to create database in Codeql [closed] - c

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 days ago.
Improve this question
I'm trying to create a database in Codeql but I'm unable to do it.
My input project is a simple hello.c in "/home/puya/Desktop/test" directory, and its source code is:
#include<stdio.h>
int main(void) {
printf("HELLO World!");
return 0;
}
and my command to create database is:
./codeql database create /home/puya/Desktop/database --language=cpp --source-root /home/puya/Desktop/test
and the output is:
enter image description here
enter image description here
Can anyone help me?

Related

How to use variables in django url path? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am developing and Django website, and I have an array of some str values(parts of url).When user is redirect to:
https://www.example.com/something/name/
how can system system knows that that is part of that arry.
I alredy have this:
urlpatterns = [
path(r'<name1>, views.example')
]
And Array:
arr = [name1,name2,name3, ....namen] # elements of array are assigned to variables in for loop.
Thank you in advance.
So you need to change urlpatterns to:
path('<str:name>,views.example)
str is data type, and other data type for this use are:
int – Matches zero or any positive integer.
str – Matches any non-empty string, excluding the path separator(‘/’).
slug – Matches any slug string, i.e. a string consisting of alphabets, digits, hyphen and under score.
uuid – Matches a UUID(universal unique identifier).
And function call to:
views.example(request, name = "name_n") # for better code reading use name_1, name_2, .. name_n instead of name1,name2 etc.
and that would be it, enjoy in Django.

Covert array date string and decrease 3 hours in Shell Script [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I need from an array decrease 3 hours from it and print in command line again
the output of the array is:
12:29:14
14:10:26
14:30:34
14:35:31
14:35:10
11:57:03
12:49:31
12:57:09
11:04:49
13:06:57
14:35:34
14:30:49
14:34:28
12:58:02
14:28:12
12:29:18
11:33:23
12:27:04
14:35:43
12:58:46
I am trying with this line, but no use.
date2=$(date -d "${array[#]}" "3 hour ago" +"%H:%M:%S")
Could you please help me about it?
try this;
#!/bin/bash
times=( "12:29:14" "14:10:26" "14:30:34" "14:35:31" "14:35:10" "11:57:03" "12:49:31" "12:57:09" "11:04:49" "13:06:57" "14:35:34" "14:30:49" "14:34:28" "12:58:02" "14:28:12" "12:29:18" "11:33:23" "12:27:04" "14:35:43" "12:58:46")
for dateItem in ${times[#]}
do
date2=$(date --date="$dateItem 3 hour ago" +%H:%M:%S)
echo $date2
done
Hi It's worked after doing some changes it works correct,
If you wish todo it without an array
Here it is:
date2=$(date -d "$times 3 hour ago" +"%H:%M:%S")
echo $date2

How to get the Query values? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
SqlDatasource1 :
Table1
-----------
Result_1
-----------
Result_2
I have a query, and I want to get a Result_2 value from the query in code behind, in the BeforePrint event, and I don´t want to put a label in the report, how can I do this?
Thanks
If you want to manually run the Select command on your data source, you could try something like (C#):
var dv = new DataView()
dv = Sqldatasource1.Select(DataSourceSelectArguements.Empty) as DataView;
if (dv.Count > 0)
{
foreach (DataRowView rv in dv)
{
string Result2Val = rv["Result_2"].ToString();
// do something with the result...
}
}
I'm sure VB will follow a similar pattern.
Alternatively, try and capture the OnSelected event, if it's already being triggered by another control.

Can I use while(strstr(name[a],sname)!=NULL) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I'm writing a phonebook application and one of the functions is for searching the phonebook by name.
The program should print out the names the same way as the user entered them (later I will include the numbers and other info). The phonebook has 100 contacts.
sname is the name that user have entered to search.
name[a] is name list. Is there any other code like strstr? Like its operating if its found printing them if not then print("not found any") something like this:
for(a=1; a<101; a++) {
while(strstr(name[a],sname) != NULL) {
printf(strstr(name[a], sname));
}
}
You can do that: it is an infinite loop.
while(strstr(name[a],sname)!=NULL){
printf("%s\n",strstr(name[a],sname));
}
None of a, name[a], sname change in the conditions or body of the while

Data structure: Circular Queue (in C) [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm doing a Uno Card game (in C) and I have a Circular Queue in this following order:
user -> player1 -> player2 -> player3
If any player put in the table a card that change the order of the game, would be in the opposite direction.
For example, if the user put the "reverse" card, I would have to dequeue every player and the, enqueue like that:
enqueue(player3);
enqueue(player2);
enqueue(player1);
enqueue(user);
If player1, dequeue everybody and then:
enqueue(user);
enqueue(player3);
enqueue(player2);
enqueue(player1);
If player2, dequeue everybody and then:
enqueue(player1);
enqueue(user);
enqueue(player3);
enqueue(player2);
If player3, dequeue everybody and then:
enqueue(player2);
enqueue(player1);
enqueue(user);
enqueue(player3);
It's terrible, isn't it? Put it in this way, like, one "if" to any case. I know that when someone put the "reverse" card the first thing to do is to dequeue everybody, but after that, is there a better way to enqueue following the thought above?
Could you not do this with a simple index and a step (+1 or -1)?
index = { player1, player2, player3, user }
step = { clockwise, anticlockwise}
When a reverse card is played, just change the sign of the step?
Start: index=player1, step=clockwise(+1)
Repeat
Player plays card... if reverse, step = !step
Move to next player: index += step
Until end
Obviously, index needs bounds checking etc, but you get the principal

Resources