w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Native window hierarchy and class names in C#
Not sure why you have to worry. But yes, these "Button" controls you highlighted in your screenshot are not unique windows. They all look the same and behave the exact same way when you click them. The only difference is that their text "property" is different. So they are therefore the exact same window "class". With "property" and "class" in double-quotes since the winapi is a C api and the C language doesn't support classes or properties. A window class pre-selects a bunch of properties for a window, you can see them back in the WNDCLASSEX structure, the one you fill in before you call RegisterClassEx(). You then create windows from that, you pass the class name in the CreateWindowEx() winapi call. The scheme was designed to make it easy to create windows that are similar, much

Categories : C#

Create variables from array and use them to call a method without knowing the variable names PHP
I'm not quite sure if this is what you are asking for, but you can use ReflectionClass::newInstanceArgs to create an instance of a class and pass it arguments from an array : public static function Create($params) { $class = new ReflectionClass('View'); return $class->newInstanceArgs($params); }

Categories : PHP

Way to skip inheritance hierarchy and call method of super super class
Here Why is super.super.method(); not allowed in Java? They claim you cannot and there's a good discussion of why. edit I'm assuming you have a situation like foo() is defined in X and Y and you want to call it from X in Z

Categories : Java

Call a class in javascript in visual studio
You need to execute $ajax(..) (jquery syntax) request to your controller to pass and get compute information from the server. For this your controller method, that you're going to call, has to be exposed for HTTP access. More details on : How to call controller method from javascript

Categories : C#

"Android Studio" debugging - display variables as hexadecimal
In the debug window, right click on the value you would like to view in hex and choose View as -> Hex. This can be done in the Variables or Watches views.

Categories : Android

C++ Is it correct to call class member variables "attributes"?
A class' attributes would translate to its members. A method is not the same as a member function in general. But "In object-oriented programming, a method is a subroutine (or procedure) associated with a class." - Wikipedia.

Categories : C++

Don't work git in Android Studio
you need to install git on your computer first. in my case on Ubuntu I installed it with: sudo apt-get install git-core in terminal and followed by : git config --global user.name "NewUser" git config --global user.email newuser@example.com for configurations. That's it and now it works perfectly.

Categories : GIT

Assigning class variables via named parameters in constructor call in C++
You can do: Callback* callback = new Callback { src, callbackPtr }; Assuming Callback has fields with the same data types in that order and - big caveat - the fields have to be public.

Categories : C++

Android Studio 0.2.2 + ActionBarSherlock setttings: Could not find class 'android.support.v4.app.FragmentActivity'
As you requested my settings to be shared, I here post my project settings window. Hope that you can help. 1. ActionBarSherlock project. Note that only android-support-v4 is checked to be exported. 2. My personal project settings windows. Nothing special but only ActionBarSherlock project is referenced.

Categories : Android

PHP usort comparator function needs access to class member variables - how to call it
You need to specify the sort function in a callable way: usort($some_array, array($this, "comparator")); Even though the type callable didn't exist prior to PHP 5.4, referencing methods works the same way.

Categories : PHP

Android Studio - Ambiguous method call getClass()
I think it is a bug in Android Studio. As we know, Android Studio is based on the IntelliJ Platform and the existing functionality of IntelliJ IDEA Community Edition. Google has developed it in cooperation with JetBrains. And same bug is reported to happen in IntelliJ as well. Have a look at the Error report The only workaround to this issue is to cast the instance you call getClass() on, to Object as follows: ((Object) this).getClass()

Categories : Android

Variables get cleared in incoming call in android
Problems like this occur, if you do not correctly implement the activity life cycle. In particular you have to override onSaveInstanceState() if you have data that should be preserved when your activity is stopped. Please have a look at the official activity guide for more details.

Categories : Java

Unable to get Robotium to work in Android Studio
As far as I can tell, you can't successfully run any tests from Android Studio yet (see How can I create tests in Android Studio?). You need to do it from the command line (note that you may need to clean first ./gradlew clean): To run the instrumentTests, use ./gradlew connectedInstrumentTest To run your test task, use ./gradlew localTest For future reference when Android Studio works better with test integration, you can set it up to run any given Gradle task. Go to 'Edit Configurations' and click the '+' button to add a new one. Choose 'Gradle' and then configure it to point to the correct gradle.build file and the task you want to run. I'm not sure what you would add in the 'Before launch' section, however, if anything. All that being said, here's how I got my robotium tests to run

Categories : Android

Android Studio proguard doesn't work
I'm not sure because I didn't use Android Studio to build a release apk yet, but try to look at this http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Running-ProGuard You probably need to configure gradle to use proguard, considering that android studio is using it to build

Categories : Android

Phonegap 3 doesn't work with Android Studio
Upon must digging I found how to get past this: phonegap run android Its as simple as that. [Edit] You need to add platform to work with, whilst the documentation is so very very poor: C:varwwwsexdiaries.co.uksexdiaries>phonegap build android [phonegap] detecting Android SDK environment... [phonegap] using the local environment [phonegap] adding the Android platform... [warning] missing library cordova/android/3.0.0 [phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=snapshot;h=3.0.0;sf=tgz... [phonegap] compiling Android... [phonegap] successfully compiled Android app Then you are good to go, doing an import with Andriod Studio will also work now as you have a project to work with :) Fantastic.

Categories : Android

How to setup Android Studio to work completely offline?
Ok guys finally I overcome to this problem here is the solution. 1: Download the gradle-1.6-bin.zip for offline use. 2: Now paste it in the C:Usersusername.gradle directory. 3: Open the AndroidStudio and click on the Create New Project option and you will not get this error any more while offline. But you can get another error like me or some other erro like this... Don't worry just ignore it. Your new project with your Specified name has been created. So now click on the Import Project and go to the path C:/users/username/AndroidStudioProject and open your project and you are done.

Categories : Android

Matlab label names won't work when decimals are in the names
The problem: You are building a 2D char matrix using ['0';' ';'0.5';' ';'1';' ';'1.5';' ';'2';' ';'2.5';' ';'3';' ';'3.5';' ';'4'] You are trying to define rows with 1 char (e.g., '0') and rows with 3 chars (e.g., '1.5'). Solution 1: Convert all rows to thress chars: [' 0 ';' ';'0.5';' ';' 1 ';' ';'1.5';' ';' 2 ';' ';'2.5';' ';' 3 ';' ';'3.5';' ';' 4 '] Solution 2: Use cell array instead of 2D char matrix (Note the curly braces): {'0';' ';'0.5';' ';'1';' ';'1.5';' ';'2';' ';'2.5';' ';'3';' ';'3.5';' ';'4'} This solution is better in terms of generalization and good practice.

Categories : Matlab

Java - Class hierarchy, child classes containing different object types, and handling them from another class
From your description it seems to me that you have two places where the variety of tasks is visible: The task hierarchy itself and the response processing in the main thread. That means that adding a new task might require changes in those two places, which makes your code less flexible. I wonder if you could encapsulate this variety in one place. One idea is to use Strategy Pattern: A strategy in this case would define the processing logic, which depends on the whole response collection. A specific Task class would just hold a reference to the strategy. That would require also creating an interface like ITask with one method, getProcessingStrategy(). In your case, the strategy interface would need to be able to accommodate your complex processing scenarios (e.g. execute(Collection<IRe

Categories : Java

Android Studio. Problems with R class
This is a known bug in 0.1.6. Google has suggested turning off external builds in Preferences > compiler as a temporary fix @simon this guy is supposed to be able to resolve a known bug in android studio that google hasn't been able to completely track down yet? If you're going to negatively comment on something like this please do your research first. http://code.google.com/p/android/issues/detail?id=56843&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars

Categories : Android

Library projects in Android Studio only work if nested in the project tree?
Every step are here : How do I add a library project to the Android Studio? If you want to more about gradle see the Google I/O conference by Xavier Ducrohet on youtube : http://www.youtube.com/watch?v=LCJAgPkpmR0

Categories : Android

Rename directory names and class names of maagento php files
Magento's autoloader uses class names to determine the path to class files, e.g. Company_Module_Helper_Data must reside in the Company/Module/Helper/Data.php file for it to be properly loaded. So if you change the names of any folders, be sure to change the names of all the classes correspondingly.

Categories : PHP

How to generate Class Diagram (UML) on android studio
type Ctrl+Alt+S (or go to Preferences) go to the Plugins tab, press "Browse repositories" button search: Visual Paradigm SDE for IntellIJ (Community edition) Modelling Case Tool install it. You need to install proper software. Now it should works well. I guess that UML Class Diagram is only available on Ultimate Edition. To show UML diagram click right mouse button on specific class -> Diagrams -> Show diagram... Or you can in editor click Ctrl+Alt+Shift+U. You could append new classes to diagram by drag and drop. On the top of window you could choose more options. To save UML you should just click on save icon.

Categories : Android

Android: Cannot Call "BrightnessPreference" Class (from package com.android.settings)
BrightnessPreference extends Preference Class. According to the docs Preference class provides the View to be displayed in the activity Where as what you are trying to do is open it as an activity using an intent, which according me is not possible. You can set it programmatically as shown here

Categories : Android

java.lang.NoClassDefFoundError, Android Studio 2.6.0, Inner class,
This could be related to eclipse android plugin, something similar on stackoverflow: Android java.lang.NoClassDefFoundError

Categories : Java

Android Studio/Intellij Idea: "Table of Contents" for a class
IDEA has a tab called "Structure", which shows all the methods, fields, etc. of the currently-open class.

Categories : Android

How to store contact details as a class variables android
This looks like a Object-Oriented-Programming question. I suppose you want to have multiple "Contacts" so you are probably talking about member variables, not (static) class variables. You need to create a class that has all the memer variables you need for storing the data. Then write getter and setter methods to add new data to the object or get data from the object. The class you want could for example look like this: MyContact.java public class MyContact { private String name; private ArrayList<String> phoneNumbers; // a list for storing multiple numbers private ArrayList<String> emailIDs; // storing bitmaps permanently is probably not the best solution private Bitmap photo; // BE VERY CAREFUL HERE, Bitmaps use lots of memory so only keep them

Categories : Android

How to pass asp.net webpage variables to android activity class?
Fetch the data using a service into a JSON from the asp.net page and then parse the JSON in the android app. This is how you will be able to exchange data and the store it in a db from android app.

Categories : Android

How to call parent class' method from a subclass in JavaScript so that parent's local variables would be accessible?
No you can't see the parents local variables. You inherit the parents prototype chain, not their local state. In your case you're applying the parent function onto the child object which does not hold the state. apply(this,...) means that you're binding the function to the current value of this. when you call method b from the child object, its then bound to the child, and therefore is not operating within the closure that contains the parents value.

Categories : Javascript

php: call function from class but change variables that function takes in
The cleanest way to do it would be to pass $my_array as an argument to getSignal(), e.g. the method would change to something like public static function getSignal($alert, array $my_array) { $last = array_pop($my_array); $signals = $pop[$alert]; } It's a slightly strange example because $my_array isn't used in the function body. You're also using $this within a static context. Assuming access to all relevant members, you would call this in the 'other' file like this: return moo::getSignal($alert, $this->blah->myFunction1()->bestFunction()); and from within the moo class: return self::getSignal($alert, $this->cow->bestFunction());

Categories : PHP

Android - Call Boolean Value from Another Class
you do not need to use any = signs you can just do if(firstClass.mIsPremium) { } // check for premium or if(!firstClass.mIsPremium) { } // check for not premium

Categories : Java

Android Studio: Unable to generate google cloud endpoint for JDO annotated Entity class
I had created the issue 58410, and there is the following reply: "Sorry, we don't have JDO support yet. We're concentrating on JPA. It is disabled because it doesn't appear to be a "valid" JPA annotated Entity. There is no timeline yet for JDO support."

Categories : Google App Engine

Class hierarchy of shapes
Yes, it seems reasonable to think of a Square as a subclass of Rectangle for which both the width and the height are equal: public Square(double side) { super(side, side); // reference to Rectangle constructor } Similarly, the same can be said for Circle, which is essentially an ellipse for which both the major and minor radii are equal: public Circle(double radius) { super(radius, radius); // reference to Ellipse constructor } Whether or not you want to create concrete subclasses to represent these shapes is up to you, and you should do whichever makes more sense in the context of your program.

Categories : Java

Displaying an object hierarchy within NSOutlineView - cannot get it to work correctly, any tips?
- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item { return item == nil ? project : [item getChildren]; //if I understand it correctly, it return the children of a given node. Not all of them at once! outlineView:child:ofItem: takes an index because it's expected to return the child at that index. It's supposed to return one child at a time. You're telling the outline view that the array of all children of the project is every child of the project. I don't think that's what you meant. You want: return item == nil ? project : item[index]; (By the way, you should not name a variable index. There is a function by that name, so if you forget or misspell the variable's declaration, hilarity will ensue when you then use the index function as a

Categories : Objective C

Ruby metaclasses class hierarchy
I’ve adapted the inheritance extension from the post linked above to Ruby 2.0: inheritance.c #include "ruby.h" VALUE real_super(VALUE self) { return RCLASS_SUPER(RBASIC(self)->klass); } VALUE real_klass(VALUE self) { return RBASIC(self)->klass; } void Init_inheritance() { rb_define_method(rb_cClass,"real_super",real_super,0); rb_define_method(rb_cClass,"real_klass",real_klass,0); } test.rb require_relative 'inheritance' puts "Object real class: #{Object.real_klass}" puts "Object real superclass: #{Object.real_super}" puts "Class real class: #{Class.real_klass}" puts "Class real superclass: #{Class.real_super}" puts "Class metaclass real class: #{Class.singleton_class.real_klass}" puts "Class metaclass real superclass: #{Class.singleton_class.real_super}" puts "O

Categories : Ruby

Parsing a string into a class hierarchy
If this is a legal python expression you can use the ast module, specifically ast.parse: >>> import ast >>> s = ast.parse("2 + 3 * (5 + 2) * -1 - 2") >>> ast.dump(s) 'Module(body=[Expr(value=BinOp(left=BinOp(left=Num(n=2), op=Add(), right=BinOp(l eft=BinOp(left=Num(n=3), op=Mult(), right=BinOp(left=Num(n=5), op=Add(), right=N um(n=2))), op=Mult(), right=Num(n=-1))), op=Sub(), right=Num(n=2)))])' Using ast.Visitor you can walk through this tree.

Categories : Python

Android Studio: disabling "External build" to display error output create duplicate class errors
I've found a question like this that has some replies here: Cannot resolve R.java, duplicate class You can try this: Delete the Build folder generated by Android Studio automatically Also you can try to Rebuild project by clicking Build->Rebuild project after deleting build folder.

Categories : Android

how to call a service method from a non-Activity class in android
By the same way like from Activity just take/pass instance of content Activity Lets say you have MyActivity class and OtherClass class so you run in OtherClass public class OtherClass { Context mContext; public void init(Context context){ mContext = context; } ... mContext.startService(new Intent(mContext, SomeService.class)); [EDIT] In your case: Intent intent = new Intent(mContext, LocalService.class); bindService(intent, mConnection, Context.BIND_AUTO_CREATE); See documentation here

Categories : Java

Cannot call custom draw method from another class in Android
I changed your code with following. public class ShapesView extends View { Paint mypaint; public ShapesView(Context context, AttributeSet attrs) { super(context, attrs); mypaint = new Paint(); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); mypaint.setColor(Color.BLUE); canvas.drawRect(30, 30, 200, 200, mypaint); } } When you want to draw, call shapesview.invalidate();

Categories : Android

Java class not found in a directory hierarchy
The classpath must contain directories or jar files which constitute the root of a package tree (i.e. a directory which constitutes the default package, and which contains the directories of top-level packages). In your cases, it looks like the class is called Gen, and is in the package gensig.gensig. Its name is thus gensig.gensig.Gen. The root of the package tree is the directory classes. So the command should be: java -cp classes gensig.gensig.Gen EDIT: given your comment, your classes are actually in the package gen. The root of the package tree is thus classes/gensig. So the command should be java -cp classes/gensig gen.Gen

Categories : Java

How can I understand the fdump-class-hierarchy output
The size and align are the size and alignment of the class when used as complete type. That is, if you create objects whose complete type is that type (like defining variables of that type, or using that type with new). The size is simply the number of bytes it occupies. So size=16 means when used as complete type, it always occupies 16 bytes. The alignment tells you where the object may be placed: align=8 means the address of the object must be an integer multiple of 8. The base size and base align give the size and alignment in case the class is used as base class. The reason why they are different is that the C++ standard allows objects to use less padding when used as base class. So let's look specifically at your example (I'm assuming that you actually have the int before the doub

Categories : C++



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