Error “cannot convert ‘std::basic_string’ to ‘const char*’ for argument ‘1’ to ‘int system(const char*)'”

The type of expression ” quickscan.exe resolution 300 selectscanner jpg showui showprogress filename ‘”+name+”.jpg'” is std::string. However function system has declaration int system(const char *s); that is it accepts an argumnet of type const char * There is no conversion operator that would convert implicitly an object of type std::string to object of type const …

Read more

Why fork() before setsid()

First of all: setsid() will make your process a process group leader, but it will also make you the leader of a new session. If you are just interested in getting your own process group, then use setpgid(0,0). Now for understanding the actual reason why setsid() returns EPERM if you already are process group leader …

Read more

How to list out all Foreign Keys with “WITH NOCHECK” in SQL Server

The following will return the name of the foreign keys in the current database that are disabled i.e. WITH NOCHECK For SQL Server 2005/2008: select * from sys.foreign_keys where is_disabled=1 There was some discussion in the answer about the difference between disabled & not trusted. What’s below explains the differnce Here’s some code to clarify …

Read more

How do I check if an app is a non-system app in Android?

PackageManager pm = mcontext.getPackageManager(); List<PackageInfo> list = pm.getInstalledPackages(0); for(PackageInfo pi : list) { ApplicationInfo ai = pm.getApplicationInfo(pi.packageName, 0); System.out.println(“>>>>>>packages is<<<<<<<<” + ai.publicSourceDir); if ((ai.flags & ApplicationInfo.FLAG_SYSTEM) != 0) { System.out.println(“>>>>>>packages is system package”+pi.packageName); } }