w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to compare javascript string that contain numeric in format of XX.XX.XXXX.XXXX
As long as str1 and str2 are guaranteed to be the same length and format, just do str1 > str2. String comparison is lexicographical (compare the first character of both, the second character of both... and return the value of the first difference), and for two equal length numbers/number-like strings that gives you exactly what you want. If they are not guaranteed to be the same, try splitting by ., converting each string part to int and comparing them int-wise one by one until you find a difference.

Categories : Javascript

For each line in several files, extract lines containing "XXXX ms" where XXXX is a number > to a given value
try this line: awk '$4=="ms"&&$3>100' file here the 100 is your value, you can make it better, e.g. get the argument from shell variable, in this way: awk -v va="$value" '$4=="ms"&&$3>va' file

Categories : Regex

Android Studio "Cannot resolve symbol XXX" on basic Android tutorial
so, it turns out that Studio is (understandibly) buggy, and that these errors are false negatives... I can also add the hierarchical parent by hand in the code so the question about the popup is moot too :/

Categories : Android

"cannot resolve symbol R" in Android Studio
Have you updated your SDK tools recently? Launch the android SDK manager and make sure you have the latest SDK tools, which is now separate from the platform tools. I had this same issue when I first updated my SDK manager, the SDK build tools package did not show up for install/update until I closed and reopened the SDK manager.

Categories : Android

Android studio suddenly cannot resolve symbol R
Most of the time it is due to a bad XML file. XML files can be layout files, value files, or the Manifest file. Please check your xml files and try to rebuild the project. Sometimes cleaning the project and rebuilding it also works.

Categories : Android

Android Studio: Unable to resolve Symbol 'requestLocationUpdates'
There is no requestLocationUpdates() function which takes Context as input. Following are the allowed parameters for requestLocationUpdates() function: requestLocationUpdates(long minTime, float minDistance, Criteria criteria, PendingIntent intent) requestLocationUpdates(long minTime, float minDistance, Criteria criteria, LocationListener listener, Looper looper) requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener) requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener, Looper looper) requestLocationUpdates(String provider, long minTime, float minDistance, PendingIntent intent) See LocationManager page as well. Hope this helps. Update Shift the following code inside oncreate(): /* Use the Loca

Categories : Java

Cannot resolve Symbol R (Imported project from Eclipse to Android Studio)
Try to use the new version (0.4.3) of the gradle build plugin, that was released yesterday. More information about this version on g+ here.

Categories : Android

Android studio: getting lots of cannot resolve symbol error after running inspect code
There is a known problem with android studio causing cannot resolve symbol errors right now. Google has suggested turning off Preferences > Compiler > Use external build as a workaround. cannot find symbol in Android Studio without rebuilding project

Categories : Android

cannot resolve android symbol - android app - intelliJ
What you should do is, 1. Select your android project 2. press ctrl +alt + shift + S 3. Select SDK from the project settings 4. Check the files under the class path tab 5. There must be android.jar ,res ,annotations.jar Probably there should be missed one or several files in step 5. Then, 6. Go to Android SDK home path field and add your SDK folder again files even though you have all the jars and still you are getting the error ,then remove all the jars from the class path and add them again ( like in step 6). 7. Build menu -Rebuild your project. Now your errors should disappear.

Categories : Java

Android Studio + Volley = NoClassDefFound?
Exception java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker Found the fix here. Basically, open a command prompt (or terminal) and navigate to your project directory. Use the following command on Windows: gradlew.bat clean Then reload Android Studio and try again!

Categories : Android

Getting My LAN ip address (192.168.xxxx) (IPV4)
public static String getIpAddress() { try { for (Enumeration en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();) { NetworkInterface intf = en.nextElement(); for (Enumeration enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();) { InetAddress inetAddress = enumIpAddr.nextElement(); if (!inetAddress.isLoopbackAddress()&&inetAddress instanceof Inet4Address) { String ipAddress=inetAddress.getHostAddress().toString(); Log.e("IP address",""+ipAddress); return ipAddress; } } } } catch (Soc

Categories : Java

Unknown column XXXX in field_list
Have you tried to use query method? $sql = 'INSERT INTO projects (id, alias, url, domains, progress, total, email) VALUES (?, ?, ?, ?, ?, ?, ?)'; $this->db->query($sql,$proj);

Categories : PHP

Python ImportError: No module named 'xxxx'
You need to use either explicit relative or absolute imports when you use python3, so from wordpress_xmlrpc import base # or from . import base In python3 import base would only import an absolute package base, as implicit relative imports are no longer supported.

Categories : Python

The document "XXXX.xib" could not be opened. Could not read archive
well obviously you created your project prior to the new xcode developer preview. then you tried opening your project with the new DP and boom, it automatically changed everything in your xibs to be able to present your xibs in a higher version. easy to fix. with your xcode 4 ios 6 open the same project, then right click on the name of the xib that is not opening and select source control and from there select discard changes. that should return the xib back to the shape it was before you opened it with the new xcode DP. let me know if you need more help but that should take care of your problem.

Categories : Xcode

How to insert data like XXXX/XX/XX into table field?
You need to wrap that date in single quotes. Without quotes it's interpreted as a mathematical expression (2013 / 10 / 07 = xx.xxxx). $Status = mysqli_query($Link,"Insert into history_data values ('$Separated[0]',$Separated[1],$Separated[2],$Separated[3],$Separated[4],$Separated[5],$Separated[6],$Separated[7],$Separated[8]);"); But that's still wrong. You should use correct mysql data types and for date it's DATETIME. http://dev.mysql.com/doc/refman/5.5/en/datetime.html

Categories : PHP

JAXBWrapperException: JAXB object does not have a XXXX xml property
Turns out the 'fault' response was incorrect. It was missing the <soapEnv:Fault> element. The following response now returns the correct 'exception'. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server</faultcode> <faultstring>SOAP Fault Recieved from server.</faultstring> <detail> <NS1:verify_fault xmlns:NS1="https://www.acme.com"> <Code>RecordNotFound</Code> <Message>No Records Found.</Message> </NS1:verifyCustomer_fault> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>

Categories : Web Services

Import an Android Project from Eclipse to Android Studio and I have this error message "failed to find Build Tools revision 8.0.0"
Your build.gradle is trying to use Android SDK tools 8 which isn't installed on your machine. If you look at your build.gradle file you probably have this line buildToolsVersion "8". You want your build.gradle file to point to the Android SDK tools that you currently have installed (preferably the latest). Just open the Android SDK manager and see which tools you have installed and change the buildToolsVersion "8" to the right version.

Categories : Android

Android Studio: how to import Android library project
Go back to Project Structure window where you added the new module. Click on your main module, go to Dependencies tab, click the plus icon and select Module Dependency.

Categories : Android

Calculate Time Difference, Result in Seconds.ms (xxxx.xxx)
Use the "F" format specifier: MessageBox.Show(u.TotalSeconds.ToString("F3"));

Categories : C#

WCF - There was no endpoint listening at http://xxxxx.xxxx/Service1.svc
You seem to have confused with service endpoint and mex endpoint. They are separate endpoints. Change your config on server to this: <endpoint contract="IService1" binding="wsHttpBinding" address="" /> <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" /> Then recreate proxy.

Categories : C#

Pulling links to all documents that have a column "XXXX" in sharepoint
Do you have any knowledge with JavaScript ? Because you could use it to do this kind of task... For example with SPServices you can get all the sites: $().SPServices({ operation: "GetAllSubWebCollection", completefunc: function(xData, Status) { $(xData.responseXML).find("Webs > Web").each(function() { var $node = $(this); getDocuments( $node.attr("Title") ); }); } }); Then with SharepointPlus (because the syntax is easier but you can still use SPServices) you can get the documents: function getDocuments(site) { $SP().list("My Document List", site).get({fields:"Title",where:"My_x0020_Column = 'XXX'"}, function(data) { for (var i=data.length; i--;) console.log(data[i].getAttribute("Title")) }) } Of course at this point, instead of console.log you s

Categories : Sharepoint

The included urlconf xxxx.urls doesn't have any patterns in it
You are calling the class, not the def method itself in your urls file. Your project seems a little odd, since most files have a *.py ending, but here's an example from a project I'm already using: urls.py ... url(r'^getCustomerData/$', views.getCustomerData), ... and in `views.py, from app.models import Customer def getCustomerData(request): //process and return So for you, I'd suggest changing your url resolver from url(r'^$', views.captcha , name="views_captcha"), url(r'^refresh/$', views.refresh , name="views_refresh_captcha") to url(r'^$', views.captcha.CAPTCHA_HANDLER_DEF , name="views_captcha"), url(r'^refresh/$', views.captcha.refresh , name="views_refresh_captcha") and define those two functions within captcha.

Categories : Python

Properties.Resources.XXXX Namespace or Module not Defined
The namespace or module 'Properties' is not defined. That's because the namespace Properties is not defined. You probably brought the resx file from another project. Open the associated .Designer file, if it doesn't appear in the F# project, open it up in the original project. You will see a namespace with and a bunch of C# code, assuming the original project was in C#. The namespace of this file has to be the same namespace of the project where you are trying to call it. But, since this is C# code, it won't run on a F# project. You have two choices: use a code generator to generate the associated .Designer class in F# code with the Properties namespace, (I don't know if such generator exists); or pre-compile the resx in the original project and reference it as a dll from your F# projec

Categories : F#

SQL error: 1364 Field 'XXXX' doesn't have a default value
If you're sending an INSERT to table courses, there is no field id_teacher (you want teachers_id_teacher). Since you're using a foreign key, that key must exist in table teachers before you INSERT a record into table courses. Also, you should only be using backticks (`) and single quotes (') in all your statements.

Categories : Mysql

(Hibernate) java.sql.SQLException: Field 'xxxx' doesn't have a default value
If you use the same column catVerb_id for @JoinColumn like @JoinColumn(name="catVerb_id", nullable = true) try to change it to @JoinColumn(name="catVerb_id", insertable = false, updatable = false) And it cannot be null because it's primary key in your case.

Categories : Java

How to optimize network-queue-take in android Volley? (Volley Google IO 2013)
network-queue-take is taking time because you have a high number of requests running. If you have (by default) 4 threads running, and 8 requests, say all the first requests take exactly 500ms then the network-queue-take for the remaining requests will be 500ms, as it's waited 500ms to get a spot in the queue. You can "eliminate" it by creating a RequestQueue with a higher than defualt DEFAULT_NETWORK_THREAD_POOL_SIZE, but keep in mind the default is there for a reason. If you for example download 20 images at the same time you can run into OOM conditions. However if you have a large number of low memory, and bad latency requests, increasing it should help your performance without risking oom conditions.

Categories : Android

Spring-JPA(Hibernate): AssertionFailure: null id in `xxxx` entry(don't flush the Session after an exception occurs)
If mappings are correct, probably is a wrong import code like described in org.hibernate.AssertionFailure. Also you can look about Hibernate batch processing best pratices and Stateless session. Last option can be move to spring-batch

Categories : Sql Server

cannot resolve R into variable after Android studio update
You seem to have updated the Android SDK Tools to version 22, but you might not have updated the Android SDK Build-Tools to the latest version. Update it from the sdk manager and restart. See this answer on similar question: Eclipse giving error, missing R.java file after recent update . Hope this helps

Categories : Android

Android Studio Can't resolve Gradle project
I just ran into this problem when moving to a new computer. What I did was choose to import a project (using build.gradle as import file) rather than open a project. When prompted about gradle information I didn't supply a gradle home but selected to use the gradle wrapper.

Categories : Android

android studio cannot find "Activity" symbol
I ran into this problem as well and it was driving me crazy. Here is what worked for me: I noticed that Under File|Project Structure the Classpath for my selected android SDK (Android 4.3 Google APIs) was blank. I changed the Build target to a different SDK, then switched back and the Classpath tab became properly populated. Once I did that, android symbols were resolved in my project. If you don't see pathtosdk/android-##/android.jar listed in the classpath, this could be your solution.

Categories : Java

Can not resolve onCreate method for SherlockFragmentActivity in Android Studio
Try using maven remote dependecies. Local dependencies for support lib and ABS is not needed anymore. Change the dependencies to this in your build.gradle: repositories { mavenCentral() } dependencies { compile 'com.android.support:support-v4:13.0.+' compile 'com.actionbarsherlock:actionbarsherlock:4.4.+@aar' } And press the sync project from gradle button. Then rebuild your project.

Categories : Android

How to resolve UNEPECTED TOP-LEVEL EXCEPTION in Android Studio
After months of fighting this exact problem, I have finally found a solution that works for me. It might not be your case. Make sure, that none of the classes you are using (in your case, it is probably the interface itself, since I don't see any others) is private. The Gradle is not able to handle it and cannot find the methods within the class. Just change it to public (in case of nested classes, you only need to remove the flag to make it default), and you should be good to go.

Categories : Android

cannot find symbol in Android Studio without rebuilding project
Same here. Check this for updates: https://code.google.com/p/android/issues/detail?id=56884&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

Categories : Android

Android Studio: Gradle: error: cannot find symbol variable
You shouldn't be importing android.R. That should be automatically generated and recognized. This question contains a lot of helpful tips if you get some error referring to R after removing the import. Some basic steps after removing the import, if those errors appear: Clean your build, then rebuild Make sure there are no errors or typos in your XML files Make sure your resource names consist of [a-z0-9.]. Capitals or symbols are not allowed for some reason. Perform a Gradle sync (via Tools > Android > Sync Project with Gradle Files)

Categories : Android

Facebook SDK import into Android Studio and add it in my app
It does indeed have to do with Gradle structure. Effectively, you need to create Gradle build files for the Facebook SDK. We wrote up a doc that may be able to help you. Give it a shot and be sure to provide us feedback with anything you found ambiguous or difficult, and I will look into it and modify the doc accordingly. Keep in mind that Android Studio is in its early stages as of this writing, so it's possible that as the project progresses we may need to make changes in the doc accordingly. I also found that sometimes I just had to shut Android Studio down and restart it before things would magically start working again.

Categories : Android

Import project into Android-Studio
Managed to solve on my own. Needed to alter the build.gradle file a bit so the buildscript->dependencies will hold this: classpath 'com.android.tools.build:gradle:0.5.+' and not: classpath 'com.android.tools.build:gradle:0.4' Then used the "local gradle distribution" option with the 1.6 version I downloaded and it worked fine.

Categories : Intellij Idea

Import scribe-1.2.1.jar in Android Studio
Edit your module's build.gradle file, just append one line in the dependencies scope. dependencies { ... compile files('libs/android-support-v4.jar') compile files('libs/scribe-1.2.1.jar') } FYI: at this time Android Studio project setting did not affect the gradle build, so you must edit it yourself. there are a user guide for gradle android plugin.

Categories : Android

How can I import library at android-studio?
Android Studio uses Gradle for building. Version 2.2 should pick up all libraries specified in build.gradle file. However, If you change anything in Project Structure dialog it won't update build.gradle file. Open -project_root -module_root build.gradle This file should NOT be empty. There is another empty build.gradle in the project_root folder so do not confuse them. Add all libraries you need inside dependencies closure. Do not confuse dependencies closure with buildscript.dependencies. apply plugin: 'android' repositories { mavenCentral() } dependencies { compile files('libs/android-support-v4.jar') //here is depenency from Maven Central Repository compile 'org.roboguice:roboguice:2.0' //here is dependency from your local libs folder compile

Categories : Android

Android Studio gradle and libraries import
I don't know how to solve your problem, but when I faced problem of third party library use in Gradle build, I solved by following way. Following is my structure of project. GsonDemoProject    GsonDemo       build       libs           android-support-v4.jar           gson.jar       src           main           build.gradle       build.gradle       settings.gradle I edited my build.gradle file which resides in src directory.

Categories : Android

How to import Android Studio project in Eclipse?
As the others say, a full import is not possible, but just try a manual 'import'. The key files for an Android project are the Java sourcecode (src directory), the resource XML files and the Manifest. Just create a new Android project in Eclipse and simply copy these files over. You may have to create a new package structure, so construct the necessary packages and copy each sourcefile over and refactor the package name if necessary. If you use any additional libraries, you may have to manually import them as well.

Categories : Android



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