Regex: (?P\d+)
url(r'^questions/(?P\d+)/$', views.question_details, name='question_details'),
Match
|URL |Captures |
#!/usr/bin/env python | |
import sys | |
import pyperclip | |
import subprocess | |
################################################################################### | |
# transfer.desktop file uses %f and gives full path and we only need the filename # | |
################################################################################### | |
########################################################################## |
#include <cstddef> // for std::size_t | |
#include <cstring> | |
#include <iostream> | |
template< class T, size_t N > | |
std::size_t length(const T (&)[N] ) | |
{ | |
return N; | |
}; | |
int main(){ | |
using namespace std; |
// string constructor | |
#include <iostream> | |
#include <string> | |
std::string teste(std::string nums[]){ | |
int b = nums.length(); | |
for(int a=0; a < b; a++) | |
std::cout << nums[a] << " "; | |
} |
#include <iostream> | |
int main() | |
{ | |
using namespace std; | |
string s("Hello World!!!"); | |
// convert s to uppercase | |
for (auto &reference_to_s : s) // for every char in s (note: reference_to_s is a reference) | |
reference_to_s = toupper(reference_to_s); // reference_to_s is a reference, so the assignment changes the char | |
cout << s << endl; | |
} |
#include <iostream> | |
std::string safada(std::string input) { | |
return input; | |
} | |
int main() { | |
using namespace std; | |
cout << "eae manel já cherou uma hoje?" << endl; | |
string oi; |
#include <iostream> | |
int main(){ | |
using namespace std; | |
short things[] = {1,2,3,4,5}; | |
int num_elements = sizeof things / sizeof (short); | |
cout << num_elements; | |
} |
#!/usr/bin/env python3 | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
def sort_dict(d): | |
return dict(sorted(d.items(), key=operator.itemgetter(1))) |
def get_pid(name): | |
outputCMD = subprocess.Popen( | |
['pidof', 'vivaldi-bin'], stdout=subprocess.PIPE) | |
return outputCMD.stdout.readlines() |