w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
IAR Embedded workbench create library
Briefly. Bring up the Options for the library project. Under the "General Options" selection, choose the "Output" tab. Within the "Output" tab you will find an "Output file" selection that can be either Executable or Library. For the library project, choose library. Within the project that is to link against the library, open the Options for that project. Select the "Linker" options and choose the "Library" tab. Under the Library tab you will find an entry box labeled, "Additional libraries (one per line). Type the path to the library that you created into the entry box. This will work for the ARM flavor. Other targets or versions of the Embedded workbench may vary.

Categories : C

How do I disable app server embedded library(jar) for a particular WAR or EAR?
In JBoss, you can disable container managed libraries with a jboss-deployment-structure.xml descriptor in your WEB-INF directory. <jboss-deployment-structure> <deployment> <!-- Exclusions allow you to prevent the server from automatically adding some dependencies --> <exclusions> <!-- This will cause the JBoss container to not provide your deployed application's log4j dependencies. This way you can use an implementation deployed with your artifact. --> <module name="org.apache.log4j" /> </exclusions> </deployment> </jboss-deployment-structure> The documentation for class loading in JBoss AS 7 can be found here.

Categories : Java

Wrong usage of AES library?
Although I couldn't find the exact function you use in Malbrains code, I believe your problem lies in the difference in array length for message. The algorithm encrypts blocks of 128 bit (16 bytes), but you only allocated 5 bytes. uint8_t message[5] = "test"; vs unsigned char ptext[16] = "test"; Try initialising it with exactly the same data. uint8_t message[16]; memset(message, 0, sizeof(message)); memcpy(message, "test", 5);

Categories : C

MathFP library usage
I've worked on both J2ME and Android apps. Androids are (generally) so much better performing than the old J2ME devices, your stuff should move right over, if you just switch to the Math. library for fancy math functions like atan2, cos, etc. and just use normal operations for * / + - On the old J2ME devices, there was no support at all for floating point, and many devices couldn't perform any floating point basic calculations without the library. That is just not the case on Android.

Categories : Android

Unable to get python embedded to work with zip'd library
Note that windows searches for libraries in the executable's path first and only then starts looking in other places. If your python27.dll is always placed in the executable's path and you use LoadLibrary("python27.dll") or bind to the library directly, you just always use the local python version. If the python27-folder is empty then, your interpreter fails. If the dll is not there, you use the global interpreter. Move the dll into a separate folder so windows will only load it if asked for it by LoadLibrary("p27python27.dll")

Categories : Python

Library similar to aviary for offline usage
Aviary, included as Image Editor in adobe creative sdk works offline, however documentation points out that it tries to get UI updates from network as described in 'Content Delivery System' here: https://creativesdk.adobe.com/docs/android/#/articles/imageediting/index.html. But I turned off internet on phone, run application and app works still. You can try it out using url I mentioned or download sample app project for android.

Categories : Android

is it possible to write c code and library, for multiplatform: embedded or all operating systems?
It depends. If your library use only standard C and the multiplatform you are about to port has a compiler compatiable to standard C, you can always write the library code. But if your library have to call native API of each platform, you have to encapsulate these code seperately.

Categories : C

Optimal Implementation and Usage of Task Parallel Library?
Right now, you're using thread pool threads (each Task.Factory.StartNew call uses a TP thread or a full .NET thread, as in your case, due to the LongRunning hint) for work that is effectively IO bound. If you hadn't specified TaskCreationOptions.LongRunning, you'd have seen a problem very early on, and you'd be experiencing thread pool starvation. As is, you're likely using a very large number of threads, and creating and destroying them very quickly, which is a waste of resources. If you were to make this fully asynchronous, and use the new async/await support, you could perform the same "work" asynchronously, without using threads. This would scale significantly better, as the amount of threads used for a given number of requests would be significantly reduced. As a general rule of

Categories : C#

Custom Java Code Library Usage Tips
You need to write JavaDoc comments in your code and then you can generate JavaDoc html. JavaDoc comments are special comments which are between /** and */ and can be used to generate JavaDoc. e.g. /** * Class description. * <p> * Some more details * * @author Edd */ public class MyClass { /** * Method description. * * @param param * important parameter */ public static void myMethod(String param) { } } This would then look like this as a tooltip: When you release your library for other developers to use, you would typically release it as a jar file. When you package up your jar you should also generate a javadoc.jar file to accompany your jar. This can then be used by other developers to get the usage tips.

Categories : Java

Failed to load Firebird client library: Embedded database with Jaybird
I created a very simple program to connect to Firebird embedded: package pkg; import java.sql.*; public class MainClass { public static void main(String[] args) throws SQLException { try (Connection con = DriverManager .getConnection("jdbc:firebirdsql:embedded:D:/data/db/testdatabase.fdb", "sysdba", "")) { try ( Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * FROM RDB$DATABASE"); ) { while (rs.next()) { System.out.println(rs.getString(2)); } } } } } This is in a layout: src +--pkg +--MainClass.java I opened a command prompt, and went to the src folder and compiled with: javac -cp . pkgMa

Categories : Java

MySQL delete all rows with abandoned IDs
Yes, by using this: DELETE FROM categories_to_words WHERE word_id NOT IN (SELECT word_id FROM words); There are more efficient ways to do it, but that'll work. HOWEVER: you should really investigate using foreign keys, because if you use them, you won't have problems like the one you're solving now.

Categories : Mysql

How to commit the files which were pushed before and abandoned in gerrit
Why did you abandon the change? Gerrit was specifically designed for this purpose that you review your changes, see that file 1 needs to be changed, then you modify your file 1 and submit this again as patch 2 It is correct that the git status shows that only file 1 has changed. It compares to you local repository, not to gerrit. The right way to do this is to make sure you have the commit-msg hook for gerrit in your local git repository hooks folder. This will add a Change-Id to your commit messages. With this gerrit can track which commits are related to the same change. Initial change, commit files 1-3: git commit -a Push to gerrit: git push origin HEAD:refs/for/master Modify file 1 Amend your last commit to update file 1: git commit -a --amend Push again to gerrit: git push origin

Categories : GIT

Any ideas on how to remove small abandoned pixel in a png using OpenCV or other algorithm?
The handiest way to filter objects if you have an a priori knowledge of their size is to use morphological operators. In your case, with opencv, once you've loaded your image (OpenCV supports PNG), you have to do an "openning", that is an erosion followed by a dilation. The small objects (smaller than the size of the structuring element you chose) will disappear with erosion, while the bigger will remain and be restored with the dilation. (reference here, cv::morphologyEx). The shape of the big object might be altered. If you're only doing detection, it is harmless, but if you want your object to avoid transformation you'll need to apply a "top hat" transform.

Categories : Algorithm

Gerrit + Jenkins: how to trigger an action after the merge is complete OR the review is abandoned?
Jenkins has a trigger for "change abandoned" too. There's no problem having more than one Jenkins job per branch/change/commit/push, both with fire (and will return a combined comment on Gerrit so there's no extra email spam). You can create a new global jobs that will just trigger on merge or abandoned (just add both triggers). Your build or post-build action can be a shell script or utility program that will do what you want.

Categories : Jenkins

What slows down Java if CPU usage low, hdd usage low, memory usage low?
You can test what is the bottle neck by taking different parts out of the equation. To take out the CPU, just read the files and don't do anything else. To take out the disk, keep reading the same file again and again, assuming it fits in your file cache. Compare this to the time for everything.

Categories : Java

Ember hasMany embedded: always is not loading embedded data
Your http response is not the format which ember-data expects for sideloaded data. Look at http://emberjs.com/guides/models/the-rest-adapter/#toc_sideloaded-relationships how your response should look like. Maybe there is a way to configure/adapt the RESTAdapter...

Categories : Ember Js

Qt: mingw compiled library does only work with both library.so and library.lib file present
That's weird, I think you should get a *.a and *.dll files when building a shared lib with MinGW on Windows, as said in the documentation: In windows, MinGW will output .a and .dll, MSVC2010 will ouput .lib and .dll. In linux, MinGW will output .so, .so.1, .so.1.0 and .so.1.0.0 – .lib, .a and .so are import libraries. You definitely shouldn't rename your file! Be careful to: not to include the "lib" prefix after "-l" in your project file. put everything after after "-l" in lower case as you're on Windows not adding any extension to your library name after "-l" add and reference the .h file used in your library A real example using QtWebsocket lib: INCLUDEPATH += "$${PWD}/include/" LIBS += -L"$${PWD}/libs/" -lqtwebsocket ... HEADERS += ... $${PWD}/include/QWsSocket.

Categories : Qt

Why does this usage of until in Ruby not work, while another usage does?
In Ruby, the until block doesn't use do, so you should do something like this: def bubble_sort(arr) until arr == arr.sort (arr.count - 1).times do |i| (arr[i], arr[i + 1] = arr[i + 1], arr[i]) if (arr[i] > arr[i + 1]) end end arr end Edit: Expanded the code so it includes the algorithm from the original question. This code works for me on ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0].

Categories : Ruby

How to make my JAR library to be included in the in AndroidManifest.xml and use it as a shared library
<uses-library> is for libraries that are part of device firmware (SDK add-ons). So, unless you are distributing your own hardware or ROM mods, <uses-library> will not be of use to you. Moreover, generally speaking, you want to have independent copies of that library, one per app using it. That way, you can update each app separately. Otherwise, changes to your JAR may necessitate simultaneous changes to all of your apps, and since you are not in charge of installing those app updates (users are), that could be a major problem.

Categories : Android

Is this considered SFINAE?
Yep, you have solved it in the simplest, most idiomatic style of C++11 SFINAE. Note that you didn't check that the return type is void, that it's a nonstatic member, nor that there are no parameters. f is simply callable with no arguments. It could even be a functor. To check for a nullary member nonstatic function returning void, use template <typename T> struct has_f<T, decltype(void( static_cast< void (T::*)( void ) >( &T::f ) )) > : std::true_type {}; template <typename T> struct has_f<T, decltype(void( static_cast< void (T::*)( void ) const >( &T::f ) )) > : std::true_type {};

Categories : C++

Is a Locale considered complete only if
The javadoc for Currency#getInstance explains: Returns the Currency instance for the country of the given locale. The language and variant components of the locale are ignored And if you check the Locale#forLanguageTag javadoc: Returns a locale for the specified IETF BCP 47 language tag string. If finally you refer to how those tags work, you will see that "it" is Italian and "it_IT" is Italian_Italy.

Categories : Java

DBMS_RANDOM considered dangerous?
The reason why DBMS_RANDOM should not be granted to PUBLIC, when using it for crypto key generation, is that an attacker could use it to determine seed values and/or patterns in the key generation, that could be used to determine the key the data is encrypted with. This is why it could lead to compromise of the encrypted data. It certainly is not an easy attack, but it is possible for someone with enough processing power. DBMS_RANDOM should not be used for crypto because it is too predictable. For crypto key generation, only a secure random function should be used. These functions attempt to get as random as possible by measuring things like white noise and producing values off of it.

Categories : Oracle

Which one of theese XOR are considered better in Haskell
Of course it depends on the compiler and the options passed to the compiler. For this particular example, if you compile without optimisations, GHC produces the code as you have written it, so the second version contains a call to id resp. to not. That is slightly less efficient than the first version, which then only contains the call to not: Xors.xor1 :: GHC.Types.Bool -> GHC.Types.Bool -> GHC.Types.Bool [GblId, Arity=2] Xors.xor1 = (ds_dkm :: GHC.Types.Bool) (x_aeI :: GHC.Types.Bool) -> case ds_dkm of _ { GHC.Types.False -> x_aeI; GHC.Types.True -> GHC.Classes.not x_aeI } Xors.xor2 :: GHC.Types.Bool -> GHC.Types.Bool -> GHC.Types.Bool [GblId, Arity=1] Xors.xor2 = (ds_dki :: GHC.Types.Bool) -> case ds_dki of _ { GHC.Types.Fal

Categories : Haskell

When are .Net interfaces considered to be equivalent?
given that the namespace matches and the interface definition is identical, why should it matter which assembly it is found in? The choice of treating these interfaces as equivalent would make it harder to compare interfaces: rather than comparing a fixed set of items (i.e. the qualified name and the assembly) CLR would need to compare the qualified name, and the list of all properties and all methods, along with their argument types, which would be recursive. Doing so would be prohibitively slow, especially if you want to do it consistently and include classes and structs into a similar comparison scheme. Note: when you share a DLL with the developer in another country, make sure that your assembly has a strong name. This would ensure that you both link to the same assembly, and det

Categories : C#

which is faster, or is it just considered bad code
Can you not just use a INSERT .. ON DUPLICATE. That way you dont have to worry if they key already exists? So in your case you can do ON DUPLICATE KEY UPDATE id=id

Categories : Java

Why is merge sort considered to be best
The insertion sort with binary insert has a running time of O(n^2) on an average. Try exploring the wiki page here. Also, check out this SO post.

Categories : Algorithm

What range of RGB is considered "blue"?
Any colour in the hue range from 180 to 300 can be considered blue, since that's the primary colour that is dominant. However, if you want to consider secondary colours too, then your range is 210 to 270. Then you have to factor in things like "it still looks cyan" (since green is far more perceptually bright than blue) and stuff like that, there's really no hard-and-fast definition. So what you could do is say "if( max( red, green, blue) == blue) then it's blue" and nobody can fault you for it.

Categories : Javascript

Why is IN() considered O(logN) operation?
First, this statement is just not true for in with a subquery. For that, either the subquery is run for every row in the data (pre 5.6 MySQL) or a join optimization is used. Second, there are two things going on when calculating the order of the in with a list. Implicit in both your statements is "for each row being process". So, if R rows are being processed, then the actual statement is O(R * logN) versus O(R*N) where N is the size of the list. The creation of the sorted list takes place at compile time an happens once. So, the order statement is O((R * logN) + N * logN)). I believe the assumption is that R >> N, so it dominates the expression. In other words, because the sorting happens once and the algorithm is looked at for each row, the compile effort drops out.

Categories : Mysql

atexit considered harmful?
Secure CERT has an entry about atexit when not used correctly: ENV32-C. All atexit handlers must return normally https://www.securecoding.cert.org/confluence/display/seccode/ENV32-C.+All+atexit+handlers+must+return+normally

Categories : C

Is this considered code duplication?
You might want to put this duplicate code into a method. public void yourFunctionCall() { //Could even pass the value if needed if(something) { //do something; } if(somethingElse) { // do something else; } } Then call this method in your case: switch(value) { case value1: { yourFunctionCall(); //or yourFunctionCall(value1); //unique for value1 } //etc..

Categories : Java

What is considered the parent() of a in an
  • ?
  • Parent of the span is the li in which it is contained:- Here is the working fiddle for this:- http://jsfiddle.net/eH27D/ <ul> <li>text <span id="my-span">more text</span></li> </ul> This is to get the parent and then remove it. console.log($("#my-span").parent()); $("#my-span").parent().remove();

    Categories : Jquery

    e2e: Maxlength is not considered when using input().enter()
    You could extend angular-scenario dsl and use a function similar to this one to inject a value in ngModelController function typeIn(element, str) { var maxlength = parseInt(element.attr('maxlength'), 10); var value = element.val() + str; if (maxlength !== NaN) { value = value.substr(0, maxlength); } element.val(value); element.controller('ngModel').$setViewValue(value); element.scope().$apply(); } http://jsfiddle.net/nxNm9/1/

    Categories : Angularjs

    In Python, are strings considered as lists?
    Strings and lists are both sequences, so for loops can iterate over them, but they are definitely two different types. for c in 'abcd': print c for i in [1,2,3,4]: print i

    Categories : Python

    Why is this function considered to be a constructor by linters?
    Constructors are the only functions in JavaScript that should start with a capital letter. JSLint/JSHint will see that it starts with an uppercase G and assume it is a constructor. This is the only convention we have to make sure people know that the function should be used as a constructor. Some people write defensively to avoid people missing the new keyword: var SomeConstructor = function () { if (!(this instanceof SomeConstructor)) return new SomeConstructor(); }

    Categories : Javascript

    Can local storage ever be considered secure?
    Well, the basic premise here is: no, it is not secure yet. Basically, you can't run crypto in JavaScript: JavaScript Crypto Considered Harmful. The problem is that you can't reliably get the crypto code into the browser, and even if you could, JS isn't designed to let you run it securely. So until browsers have a cryptographic container (which Encrypted Media Extensions provide, but are being rallied against for their DRM purposes), it will not be possible to do securely. As far as a "Better way", there isn't one right now. Your only alternative is to store the data in plain text, and hope for the best. Or don't store the information at all. Either way. Either that, or if you need that sort of security, and you need local storage, create a custom application...

    Categories : HTML

    Why blocking on future considered a bad practice?
    Most of the point of Futures is that they enable you to create non-blocking, concurrent code that can easily be executed in parallel. OK, so wrapping a potentially lengthy function in a future returns immediately, so that you can postpone worrying about the return value until you are actually interested in it. But if the part of the code which does care about the value just blocks until the result is actually available, all you gained was a way to make your code a little tidier (and you know, you can do that without futures - using futures to tidy up your code would be a code smell, I think). Unless the functions being wrapped in futures are absolutely trivial, your code is going to spend much more time blocking than evaluating other expressions. If, on the other hand, you register a c

    Categories : Scala

    Are attributes not considered to be nodes anymore?
    From Attr: Warning: In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in DOM4. In order to bring the implementation of Attr up to specification, work is underway to change it to no longer inherit from Node. You should not be using any Node properties or methods on Attr objects.

    Categories : HTML

    Where should I put a validation method that would be considered best practice?
    Django keeps its built-in validators in the django.core.validators module. If you followed this you could create a validators.py in your app. You'd then import validators and use validators.zipValidate(s) or from validators import zipValidate and use zipValidate(s) as you are. I hope that helps.

    Categories : Python

    Forwarded emails should be considered invalid
    This is a bona-fide e-mail that arrives in someone's gmail inbox or something, I'm assuming? If that's the case, you are going to have to authenticate them one way or another using your system. Some kind of HTML-format email with image/links on it to direct to your site, the links including some kind of unique-key that you can use to look up the user who received the e-mail with said unique-key, prepopulating the user ID field, and them having to supply their password to authenticate. That's about the only way I can imagine it working, unless you are relying on the user having some kind of third-party identity-verification service like uh... what's the Microsoft one called, Passport? I'm very unfamiliar with that.

    Categories : C#

    Why is document.getElementById considered an object in IE8
    IE8 (attempts to) implement ECMAScript 3 where the typeof operator result is implementation defined for host objects regardless if the object implements [[call]]. In ES5, callable host objects must return "function". See the table in ECMAScript 3 Compare to ECMAScript 5.1 http://www.ecma-international.org/ecma-262/5.1/#sec-11.4.3

    Categories : Javascript



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