w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Temporary table in SQL SERVER - error occur if the query takes long time to complete
I assume you are using MSSQL DBMS by the tags against your post. Use a genuine temp table: prefix the name of the table with '#'. Using this method the temp table will exist only in the scope of the procedure within which it was created. select * into #TempTable from MainTable select * from #TempTable No drop actually neccessary but is probably better practice.

Categories : Sql Server

What Product Flavor does Android Studio build by default in build.gradle?
On the lower left of the Studio window there's a docked view called "Build Variants". Open it and choose whichever variant you want to work on. This will impact which variant is built but also the enabled source folders, which will drive completion in code and resources editors.

Categories : Android

Android Studio and Gradle - build fails
I found the problem: I removed that line from the sample gradle file. compile files('libs/android-support-v4.jar') However, I have no idea why this does not work (if I have 2 or 3 external libraries that all depend on the support library, how are we supposed to do, without touching their gradle files?

Categories : Android

Android Studio Gradle Build Flavors
With this build script you are using build types AND flavors. For changing the xml file you only need the flavors. Try to delete buildTypes and use the productFlavor block as child of android. The changing of the res folder of the pro flavor should go into the sourceSets Block right after all the changes of the main sourceSet

Categories : Android

Android Studio / Gradle Build questions
yes yes hmm that's quite a lot. I think there are going to be issues. For instance right now Gradle doesn't let us parallelise the compilation of the variants, so it's going to take forever to build. Also, you might run out of RAM when setting up the internal model that represent all the variants and their associated properties and tasks. I guess you should just try it and see. Using simple groovy code you should be able to dynamically create 2000 flavors in an empty projects and then see if you can compile without problem.

Categories : Android

Android Studio is not using gradle to build my projects
If you import an existing project with no gradle configuration, Android Studio will use the old build system. If you want to use gradle, you should follow the instructions in the documentation : http://developer.android.com/sdk/installing/migrate.html

Categories : Android

Android studio Gradle build speed up
The dev are working on it. Like I posted in this answer the fastest solution right now is to use gradle from the command line and you should switch to binary libs for all modules you do not develop. On g+ there is a discussion with the developers about it.

Categories : Android

How to set up gradle and android studio to do release build?
in the latest version of android studio, you can just do: ./gradlew assembleRelease or aR for short. This will produce an unsigned release apk. Building a signed apk can be done similarly or you can use Build -> Generate Signed Apk in Android Studio. See the docs here Here is my build.gradle for reference: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['

Categories : Android

Android Studio 0.2.7 build exception with Gradle
Not being able to run the application may be because you didn't configure jdk/jre properly. Try making system variable PATH point to your ...Javajdk[version]in and CLASSPATH to ...Javajdk[version]lib. Also, in android studio go to file>other settings> default project structure > sdks and navigate to your jdk install folder.

Categories : Android

Build issues with Gradle Android studio 0.2.1
I finally managed to bring Android Studio back into working state. I gave up on the 0.2.1 update and reverted to 0.2.0, which we all know worked just fine. Here's how I did it: I uninstalled Android Studio ( Add/Remove Programs ), deleted the contents of Androidandroid-studio ( except for sdk folder and SDK Manger.exe ) and then downloaded and installed the more stable version from the bundle right here: http://developer.android.com/sdk/installing/studio.html#Updating After that, you should be able to reopen the projects you were working on, without encountering any other errors. Good luck!

Categories : Android

Android studio add external project to build.gradle
Right click on project - Select "Open Module Settings" - Select "Modules" in left pane - Click on "+" symbol on top - Choose "Import Module". After importing Module. You need to add it as a dependency for your current project. Keep "Modules" Selected in left pane and click on your project - Now Go in dependencies tab and click on "+" symbol that is located at bottom - Choose third option "Module Dependencies" and if you have imported your project correctly, it will show you the all available module that can be added as a dependency to your current project. Hope it would help. Cheers!!

Categories : Android

Android Studio doesn't execute build.gradle
When being run in Android Studio, gradle's stdout where you can find your print statement is the "Gradle Console". Hover over the square in the bottom left of the Android Studio window and you'll see lots of options to select things like Console, Maven, Event Log, etc. Select Gradle Console and you should see the output that you get when running from the command line. If you still don't see your statement being logged, chances are something isn't configured correctly inside your Android Studio project. Try synching your project with the gradle build file by going the top menu bar and (on a mac) Tools > Android > Sync Project with Gradle Files. If there are no errors in this process you should be able to see the output in the Gradle Console.

Categories : Android

How to use opencv in android studio using gradle build tool?
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url 'http://maven2.javacv.googlecode.com/git/' } } dependencies { compile 'com.android.support:support-v4:13.0.+' compile 'com.googlecode.javacv:javacv:0.5' instrumentTestCompile 'junit:junit:4.4' } android { compileSdkVersion 14 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 14 } } This is worked for me :)

Categories : Android

Gradle build errors after updating Android Studio
Try adding a new file in the root of your project called "local.properties" (or modify the existing one). It should contain sdk.dir= followed by the path to the sdk location, in my case sdk.dir=/Applications/Android Studio.app/sdk I think Android Studio normally creates one automatically but says that it shouldn't be added to VCS. I put it in my .gitignore and cloned the project on my Mac which resulted in this error. Strangely before 0.1.5 it worked just fine without the file.

Categories : Android

Android Studio staying on Gradle build using tasks
The real problem is that previous version of Android Studio misconfigured the IDEA file (e.g. MyProject.iml). It added an extra <component name="FacetManager"> XML element that shouldn't be present. In the case above, the solution is to edit MyProject.iml and remove the <component name="FacetManager"> part as shown here: <module external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <component name="FacetManager"> ...remove this element and everything inside such as <facet> elements... </component> <component name="NewModuleRootManager" inherit-compiler-output="true"> ...keep this part... </component> </module> See also Gradle: FAILURE: Could not determine which tasks to execute.

Categories : Android

Facebook SDK for Android - first login is very slow / takes a very long time
The simplest way to add Facebook Login to your app is to add LoginButton from the Facebook sdk

Categories : Android

How to copy or use native libs with Android Studio Gradle build?
Due to security reason, it's not possible to reference a local jar/aar file in an application project with the gradle android plugin. For the support library, with the Android SDK Manager, you have to install the extra named Android Support Repository which will expose the support library inside a maven repository. Then you can add the support library in your project via : dependencies { compile 'com.android.support:support-v4:13.0.0' } For external libraries, you have 2 possibilities : Build an aar file and deploy it to your local maven repository, then reference it in your project like you did with the android support library. Put the library sources beside your application project and create a settings.gradle at root which will define the modules. (see the docs for more in

Categories : Android

Android-Studio upgraded from 0.1.9 to 0.2.0 causing gradle build errors now
Gradle should be updated already, you just need to let your previous projects know gradle has been updated. Source Edit your build.gradle file to show this: dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } This should only be required for projects created with the previous version of Android Studio. New projects you create will have that by default.

Categories : Gradle

best practice for flavored build variants with gradle in android studio
Another solution is to put everything shared (basically the a "vanilla" version of your app) as a libary project, including default resources. Then you can create seperate "brand" projects that use the library project. Any resources you put in these will "overwrite" the library project resources. http://developer.android.com/tools/projects/projects-eclipse.html#SettingUpLibraryProject I've done this for clients and it's worked quite well.

Categories : Android

Android Studio: How to create build.gradle file for use on Jenkins?
I ended up creating these build files from scratch. Here's some guidelines: If you have a project with multiple modules, create a settings.gradle file at the root of your project (at the same level as all the modules). Your settings.gradle file should look something like this: include 'ActionBarSherlock' include ':facebook-android-sdk-3.0.1:facebook' include 'google-play-services_lib' include ':SlidingMenu-master:library' include 'Tinder' include 'ViewPagerIndicator' include 'volley' include 'windowed-seek-bar' Within each module, create a build.gradle file. For library projects, your build.gradle file should look something like this: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } app

Categories : Android

Android Studio Import Module Gradle Build Error
Do not add modules through the Studio interface. Always make the changes directly in build.gradle and then reimport into Studio. Also, update the plugin dependency to com.android.tools.build:gradle:0.4.+ to get the latest 0.4.* version.

Categories : Android

Android Studio: Gradle Build error, can't locate SDK and compile-server
Okay in general problem was caused by the fact that the project was imported from Android-Studio installed on Mac. The slashes were in oposite direction, and somehow program couldn't override default direction because he couldn't understand the path.

Categories : Android

Android Studio: Gradle - build fails -- Execution failed for task ':dexDebug'
Could fix this by adding compile 'com.android.support:support-v4:18.0.0' to the dependencies in the vertretungsplan build.gradle, compile and then remove this line and compile again. now it works

Categories : Android

Failure on build with Gradle on command line with an android studio project : Xlint error
It's a nice warning not error, to see the complete lint report you can add these lines to build.gradle: allprojects { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:deprecation" } } If you really want to get rid of those warnings: Don't use deprecated API Use @SuppressWarnings("deprecation")

Categories : Android

Error: Gradle: Execution failed "Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt failed"
This is because one or more of your asset names have unsupported characters present. Replace all capitals with lowercase letters. Replace all spaces and dashes with an under-bar/underscore. AND to be safe, remove all numbers too. Another suggestion I've seen going around is to make sure your SDK is up to date, but from my own experience it has always been the names of imported assets.

Categories : Gradle

First time Image animation takes long time to animating
You have to do this [self initSingArray]; in viewDidLoad or other place rather then on button click. it will solve your problem. The reason in your case is at first time the image array is created so it takes time.

Categories : Iphone

Sometimes it takes a long time for the app to start
May be you have written a lots of code in your - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ } method which is the first method to be called when application start running.Please check this.

Categories : IOS

BeginGetRequestStream takes a long time for callback in WPF
The reason WPF has slower asp.net web performance than an IIS web application by default is that the default connection limit per host is 2. Whereas in IIS application it defaults to 32k. The fix is to go: ServicePoint myPoint = ServicePointManager.FindServicePoint(new Uri("http://example.com")); // WPF application needs this! myPoint.ConnectionLimit = 10000; This is probably irrelevant to all applications except for load-testing-types that open many connections to the same host.

Categories : Asp Net

PHP ErrorException creation takes a long time
You are using an oldschool lambda function created with a call to create_function(). Is there a reason for this? Because the way that function operates is slow. You pass it a STRING with the code of the function, but that string has to be evaluated during runtime. There is no way the opcode cache could cache that code for you.

Categories : PHP

Magick.NET takes a long time loading PDF
You can specify the pages to read with the FrameIndex and FrameCount properties of the MagickReadSettings object. using (MagickImageCollection collection = new MagickImageCollection()) { MagickReadSettings settings = new MagickReadSettings(); settings.FrameIndex = 0; // First page settings.FrameCount = 1; // Number of pages collection.Read("Snakeware.pdf", settings); } I have also updated the documentation here: https://magick.codeplex.com/wikipage?title=Convert%20PDF

Categories : C#

ios - database storing time takes long
Try starting a SQLite transaction before the loop and ending it afterwards. If you don't manually start/stop transactions, SQLite will do it automatically around every write, which is very slow.

Categories : IOS

After while exits, it takes a long time to continue
In fact, there is exactly a 20-second delay after click(img2). This is because you told it to spend up to 20 seconds looking for img1, which no longer exists. You may want to read the documentation for the functions you're calling (here is exists, where you can read about the timeout parameter). You're also doing some very strange things, like checking if img1 exists twice in a row (once in the while and then in the if), and you say that you tried adding sleep and wait statements to make the code wait less. (??) You may want to get someone to help you out.

Categories : Python

Procedure takes long time under concurrent requests
Question: Has it got to do with configuring MySQL? Probably not. Or my DBCP connection pool? Probably not. What else can be the reason for the behaviour? This sounds like the sort of behaviour would would get if the performance of database server was the bottleneck. Such a bottleneck could be due to the server being CPU-bound or disc IO-bound, or if each query required prolonged exclusive access to the same table or set of rows or something. Another possibility is that the problem is due to a concurrency bottleneck on the client side. For instance if each request did something like this: synchronized (someGlobalLock) { // perform queries, updates } then you are effectively serializing the execution of the database operations for these requests. That will r

Categories : Java

Python grequests takes a long time to finish
Probably it won't help you as it has passed a long time but still.. I was having some issues with Requests, similar to the ones you are having. To me the problem was that Requests took ages to download some pages, but using any other software (browsers, curl, wget, python's urllib) everything worked fine... Afer a LOT of time wasted, I noticed that the server was sending some invalid headers, for example, in one of the "slow" pages, after Content-type: text/html it began to send header in the form Header-name : header-value (notice the space before the colon). This somehow breaks Python's email.header functionality used to parse HTTP headers by Requests so the Transfer-encoding: chunked header wasn't being parsed. Long story short: manually setting the chunked property to True of Respon

Categories : Python

executeUpdate() in java takes long time to execute
Use JDBC PreparedStatement java docs Class.forName("org.apache.derby.jdbc.ClientDriver"); Connection con = DriverManager.getConnection ("jdbc:derby://localhost:1527/testDb","name","pass"); PreparedStatement updateemp = con.prepareStatement ("insert into emp values(?,?,?)"); updateemp.setInt(1,23); updateemp.setString(2,"Roshan"); updateemp.setString(3, "CEO"); updateemp.executeUpdate();

Categories : Java

Local host takes long time to load
I had a similar problem with SQL being very slow. Instead of using "localhost" for connecting to my local database, I changed it to 127.0.0.1. It has something to do with domain name lookup. Went from 30-ish seconds to miliseconds.

Categories : Performance

This program takes a long time to terminate. How can I optimise it?
Assuming you were to re-write your code to be more performant there's still a chance the work you are doing is CPU bound and therefore if it doesn't yield enough so that the main thread can handle it's UI related event processing, you will always experience a so called freeze in your application. There are several techniques to counter this: Use a BackgroundWorker to get the job done Offload to a separate dedicated thread Utilize the Task library Utilize the Thread Pool directly Use Application.DoEvents Better yet, DON'T EVER!. (Most of these techniques are beyond the scope of this answer.) See this article on implementing this technique. The core idea is that if you have CPU or IO bound work and your UI main thread doesn't have enough time to do its event processing this will be a

Categories : C#

Running App with Xcode takes long time to launch
When you run app with XCode, debugger (LLVM or GDB) is attached. Debugger definitely cosumes a lot CPU and memory resource. So it may delay threads starting by the apps. Futhermore debugger may open some extra files, resulting in the log telling you that you used up 25 files.

Categories : Xcode

PHP process takes a long time to finish, how can I farm it off to a worker
PHP cant multi-thread, it can fork - but only when not going through apache! Look at using a Worker system, like PHP-Resque It makes life so much easier :)

Categories : PHP

This programs takes a long time to close after the 'return;' on main()
It takes so long to close because collatzMap is static, thus it will only get freed when the program exits, and it contains a lot of data, so it will take long to get freed (the size is just over 2 million, and, because of how map works, for each of these there's at least one pointer that needs to be freed). That said, on Dev-C++ it takes less than a second to exit. I guess Visual Studio isn't doing a good job.

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.