Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#include <stdio.h> | |
#pragma pack(push) | |
#pragma pack(1) | |
struct { | |
char a; | |
int b; | |
char c; | |
} packed; | |
#pragma pack(pop) |
im=Image.open("1.jpg") | |
#im=im.rotate(1) | |
im.save("e.jpg") | |
im2=im.convert("L") | |
im2.save("b.jpg") | |
threshold = 100 | |
im = im2.point(lambda p: p > threshold and 255) | |
im.save("d.jpg") | |
img="d.jpg" | |
result = tesseract.ProcessPagesWrapper(img,api) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
public async Task<string> GetResponseAsStringAsync(HttpWebRequest webRequest, string post = null) | |
{ | |
if (post != null) | |
{ | |
webRequest.Method = "POST"; | |
using (Stream postStream = await webRequest.GetRequestStreamAsync()) | |
{ | |
byte[] postBytes = Encoding.ASCII.GetBytes(post); | |
await postStream.WriteAsync(postBytes, 0, postBytes.Length); | |
await postStream.FlushAsync(); |
Issue this command to terminal with your device connected : | |
$ adb shell pm list packages | |
If that doesn't work, then: | |
$ adb shell | |
$ su | |
$ pm list packages |
// Intel(R) Core(TM) i7-2600 CPU @ 3.40 GHz 3.40 GHz | |
// 16 GB RAM, Windows 7, 64 bit | |
// | |
//No cast:0.854751600000001 +- 0.182965645566156ms | |
//Cast:0.724137 +- 0.148216330378943ms | |
// Conclusion: Cast is indeed faster, but remember that we are talking here about _miliseconds_ | |
// for 1000 enumerations of an enum with 1000 elements. First verify whether this is really significant in your code, before | |
// proceeding with micro-optimizations. | |
// Context: http://stackoverflow.com/a/105402/2642204 |
#include <curl/curl.h> | |
#include <string> | |
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) { | |
data->append((char*) ptr, size * nmemb); | |
return size * nmemb; | |
} | |
int main(int argc, char** argv) { | |
auto curl = curl_easy_init(); |
https://stackoverflow.com/a/18003462/348146
None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:
Determine the package name of the app, e.g.
com.example.someapp
. Skip this step if you already know the package name.
adb shell pm list packages
Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.
using System; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
namespace NetworkAdaptersUtility | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
import discord | |
from discord.ext import commands | |
from asyncio import sleep | |
me = commands.Bot(command_prefix='.', self_bot=True) | |
@me.event | |
async def on_ready(): |