Search Results

Search found 6 results on 1 pages for 'binoy'.

Page 1/1 | 1 

  • In php, how to detect the execution is from CLI mode or through browser ?

    - by binoy
    Hi, I have a common script which Im including in my php cron files and the files which are accessing through the browser. Some part of the code, I need only for non cron files. How can I detect whether the execution is from CLI or through browser (I know it can be done by passing some arguments with the cron files but I dont have access to crontab). Is there any other way ? Regards Binoy

    Read the article

  • Unable to import Eclipse project to Android studio

    - by Binoy Babu
    Whenever I try to import my Eclipse project to Android Studio I get the following error : You are using an old, unsupported version of Gradle. Please use version 1.8 or greater. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.) Consult IDE log for more details (Help | Show Log) Im using Android Studio 0.3 and Ubuntu, I also tried it on a Windows 8 box with fresh install but getting the same error. I'm using default gradle wrapper and I tried checking and unchecking auto import option. Is this a bug? How can I get around it. How do I update gradle to 1.8 or check the current gradle version? My build.gradle is given below. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.3' // I also tried using 0.6.1 and 0.5.+ } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 18 buildToolsVersion "18.0.1" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } // Move the tests to tests/java, tests/res, etc... instrumentTest.setRoot('tests') // Move the build types to build-types/<type> // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... // This moves them out of them default location under src/<type>/... which would // conflict with src/ being used by the main source set. // Adding new build types or product flavors should be accompanied // by a similar customization. debug.setRoot('build-types/debug') release.setRoot('build-types/release') } }

    Read the article

  • Search and replace with sed

    - by Binoy Babu
    Last week I accidently externalized all my strings of my eclipse project. I need to revert this and my only hope is sed. I tried to create scripts but failed pathetically because I'm new with sed and this would be a very complicated operation. What I need to do is this: Strings in class.java file is currently in the following format(method) Messages.getString(<key>). Example : if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.89") + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + Messages.getString("VSDataSource.90") + i; //$NON-NLS-1$ break; } } } The key and matching Strings are in messages.properties file in the following format. VSDataSource.92=No of rows in db = VSDataSource.93=Verifying db entry : VSDataSource.94=DB is open VSDataSource.95=DB is closed VSDataSource.96=Invalid db entry for VSDataSource.97=\ removed. So I need the java file back in this format: if (new File(DataSource.DEFAULT_VS_PATH).exists()) { for (int i = 1; i <= c; i++) { if (!new File(DataSource.DEFAULT_VS_PATH + "String 2" + i).exists()) { //$NON-NLS-1$ getnewvfspath = DataSource.DEFAULT_VS_PATH + "String 1" + i; //$NON-NLS-1$ break; } } } How can I accomplish this with sed? Or is there an easier way?

    Read the article

  • Cakephp session is not setting in pages controller

    - by binoy
    Hi, I am using cakephp1.2 . I have override the pages controller. While login from my application, Im setting the session and redirecting to pages controller, but there I could not able to get the session. If I redirect to some other controller, Im getting the session over there. I have a table with name "pages", and when the user clicks on the links (passing page name), Im taking data from that table and displaying using pages_controller. Can I not use "pages" as table name ? Or session won't work in pages_controller ?

    Read the article

  • Where will this AsyncTask run?

    - by Binoy Babu
    Say I have this code in the AlertDialog.Builder(context) of my application. The question is in which Thread will it run? final Thread myPrettyOperation = new Thread() { @Override public void run() { //Do some really long operation. } }; class MyPrettyTask extends AsyncTask<Void, Integer, Boolean> { protected Boolean doInBackground( Void... voids) { myPrettyOperation.start(); return true; } protected void onProgressUpdate( Integer... progress) { } protected void onPostExecute(Boolean result) { } } new MyPrettyTask().execute();

    Read the article

  • Implode and remove empty values

    - by binoy
    Hi, I have an array like this $arr = array('name' => 'John', 'address' => 'IInd Street', 'state' => '', 'country' => 'US'); I want to display the values as John, IInd Street, US (ie, If any value is empty, I don't want to display comma and break over there) I could able to display this with the following code $values = implode(',', $arr); echo $str = implode(',<br />',array_filter(explode(',', $values))); Is there any better way to do this ?

    Read the article

1