Articles

Affichage des articles du 2016

odules:ty:compileJavaWARNING

modules:ty:compileJava WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by worker.org.gradle.internal.reflect.JavaMethod (file:/Users/---/.gradle/caches/3.0/workerMain/gradle-worker.jar) to method java.lang.ClassLoader.getPackages() WARNING: Please consider reporting this to the maintainers of worker.org.gradle.internal.reflect.JavaMethod WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

Ternary If Java

from this int a ; if ( i != 0 && k == 7 ){ a = 10 ; } else a = 3 ; } to this nice one int a = ( i != 0 && k == 7 ) ? 10 : 3 ;

org.eclipse.jst.javaee.web.WebApp

An error has occurred. See error log for more details. org.eclipse.jst.javaee.applicationclient.internal.impl.ApplicationClientImpl cannot be cast to org.eclipse.jst.javaee.web.WebApp

XmlBeanFactory is deprecated

Error Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider at springuate.main.main(main.java:22) Caused by: java.lang.ClassNotFoundException: org.springframework.core.OrderComparator$OrderSourceProvider at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more D:\....\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 0 seconds)  Solution You need just to add the latest JAR spring-core-4.3.3.RELEASE spring-beans-4.3.3.RELEASE commons-logging-1.2

The Guide to Java 9 - (the default methods)

In Java 8 , one of the features was the default methods public interface myInterface { default int divByten ( int . . . numbers ) { return sum ( number) /10 ; } } In Java 9 we can simply have a private interface method:  public interface myInterface { private int divByten ( int . . . numbers ) { return sum ( numbers) /10 ; } }

Device 'CLVE8DB2C70' not found

I wanna add data to Tableview javafx without erase the old ones !

use this  productTable . getItems (). clear (); productTable . getItems (). addAll ( data ); instead of this productTable . setItems ( data );

Caused by: android.os.NetworkOnMainThreadException

public ArrayList<InetAddress> getConnectedDevices(String YourPhoneIPAddress) { ArrayList<InetAddress> ret = new ArrayList<InetAddress>(); int LoopCurrentIP = 0 ; String IPAddress = "" ; String[] myIPArray = YourPhoneIPAddress.split( " \\ ." ); InetAddress currentPingAddr; for ( int i = 0 ; i <= 255 ; i++) { try { // build the next IP address currentPingAddr = InetAddress.getByName(myIPArray[ 0 ] + "." + myIPArray[ 1 ] + "." + myIPArray[ 2 ] + "." + Integer.toString(LoopCurrentIP)); String ad = currentPingAddr.toString(); ///////////////// Log.d( "MyApp" ,ad); ////////////// // 50ms Timeout for the "ping" if (currentPingAddr.isReachable( 50 )) { ret. add (currentPingAddr); ad = cur

what does this mean “java.lang.IllegalStateException”?

this simple code ! package itawfik . com . wifi ; import android . os . Bundle ; import android . support . v7 . app . AppCompatActivity ; import android . view . View ; import android . widget . AdapterView ; import android . widget . ArrayAdapter ; import android . widget . ListView ; import android . widget . Toast ; /** * Created by Emin01 on 03/09/2016. */ public class ListWifi extends AppCompatActivity { ListView list ; @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . layout . listwifi ); list = ( ListView ) findViewById ( R . id . listId ); MyTawfik . setUpListView ( list ); String [] values = new String []{ "Android List View" , "Adapter implementation" , "Simple List View In Android" , "Create List View Android"

Activity is not assigned to Android.app.Activity

Just make sure , you extends the same activity . Firstly, you only declare activities in manifest file, not fragments. So remove this line from manifest file < activity android : name = ".FeedbackMain" android : label = "@string/title_activity_feedback_main" > </ activity > Secondly, if you want to use actionbar, you class should extend ActionBarActivity not FragmentActivity. so change your mainactivity from public class MainActivity extends FragmentActivity { to public class MainActivity extends ActionBarActivity { details : http://stackoverflow.com/questions/30486389/activity-is-not-assigned-to-android-app-activity-manifest-xml

Error:svn: E175011

Error:svn: E175011: Repository moved temporarily; please relocate svn: E175002: OPTIONS request failed on '/Alrazihi_Towfik/wifi'

What Makes you a great programmer !

I ask this question on quora.com   , I resume the answers I can make changes safely, and know where to make them. A good programmer also maintains comments in his code to help the other programmer understand easily after him. Striving to learn new things, and repeatedly put myself in situations where I am almost out of my depth Be get strong in one language get deep learning all the concepts in the language give full involvement to this language.

what does this mean (W/ActivityManager: No content provider found for permission revoke: file:///data/local/tmp/...)?

The best response to this : This message may be an indication of insufficient internal storage on the device. There is a certain level at which Android starts complaining and won't install new apps. I saw "No content provider found for permission revoke" accompanied by errors like "insufficient space", or "Installation error code: -20", or "INSTALL_FAILED_MEDIA_UNAVAILABLE", or "Package install status for is -20" -- all meaning the same thing. In my case, the solution was to free up some storage (clear cache/data, uninstall some apps). Add some memory to your Virtual Device and uninstall your app. Reinstall, and voilà! It worked for me, and I wasnt even using storage on my app.

gralloc_module_unmap: find buffer in dequeued status ID=134794

Android monitor errors repeat this Message : ( gralloc_module_unmap: find buffer in dequeued status ID=134794 ) 09-03 15:55:25.142 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43427 09-03 15:55:25.142 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43427 09-03 15:55:25.162 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43425 09-03 15:55:25.162 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43425 09-03 15:55:25.182 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43426 09-03 15:55:25.182 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43426 09-03 15:55:25.192 18681-18695/system_process E/IMGSRV: :0: gralloc_module_unmap: find buffer in dequeued status ID=43427 09-03 15:55:25.192 18

addBatch

Multiple queries executed in java in single statement ? You can use Batch update but queries must be action(i.e. insert,update and delete) queries Statement s = c . createStatement (); String s1 = "update emp set name='abc' where salary=984" ; String s2 = "insert into emp values ('Osama',1420)" ; s . addBatch ( s1 ); s . addBatch ( s2 ); s . executeBatch ();

Snapchat Interview Question :

Consider a scenario where a frog wants cross a river. The river is represented by a 1D array of 0s and 1s where a 0 represents water and a 1 represents a rock. This frog cannot swim but it can jump from stone to stone. In addition there are other constraints on how the frog moves: Frog can jump the same distance as his previous jump Frog can jump one more than his previous jump Frog can jump one less than his previous jump Now, given a river (1d array), can a frog cross the river without drowning? The frog cannot move a negative distance (ie it cannot go from right to left).

java.lang.NullPointerException

java.lang.NullPointerException : This  Exception  occurs when you declare a variable but did not create an object. If you attempt to dereference variable  BEFORE creating the object you get a  NullPointerException . 

setPluginState

 setPluginState(android.webkit.WebSettings.PluginState)' is deprecated less... (Ctrl+F1) This inspection reports where deprecated code is used in the specified inspection scope.    

JAVA 9

 A lightweight JSON API for consuming and generating JSON documents and data streams. A HTTP 2 Client that will bring HTTP 2.0 and web sockets, while replacing the legacy HttpURLConnection. Process API Updates to improve controlling and managing operating-system process (developers were often forced to use native code with the current API). Along with several other smaller features, as well as dozens of proposals already being tracked by the JEP Index, Oracle has also promised another trio of performance features : Improve contended locking, which aims at improving performance when threads compete over access to objects.  Segmented code cache with better performance, shorter sweep times, less fragmentation and further extensions to come. The Smart Java compiler, or sjavac , will be improved to allow default use in the JDK build and general use for building larger projects.