w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Identifying start of non-periodic cycles in Matlab
I would try filtering the data then looking for sign changes in the derivative, rather than thresholding it. B = fir1(8,0.5); newData = filtfilt(B,1,data); dt = [0 sign(diff(newData))]; ddt = -[0 diff(dt)]; localMaxima = data(ddt>0); idx = find(ddt>0); plot(1:length(data),[data;newData;ddt*max(data)])

Categories : Matlab

MATLAB : identifying the parameters corresponding to the loop variable
Just use 'text' function to mark the arguments nearby the each graph.There is a very simple demo(a is the argument): x=0:100; figure; hold on; for a=1:10 plot(x,a*x); text(100,a*100,sprintf('a=%s',num2str(a))); end Sorry for not pasting picture here because my reputation is not enough.

Categories : Matlab

Component Based Entity System Problems
Ok there seem to be a lot of related questions between this post and the diagrams you linked to. The answer to these questions are 'it depends.' and I am guessing you would like some guidance on the subject of CBSEs rather than one line answers to all of your questions. Rather than try and regurgitate the discussion based on similar queries I will post some links here that should get you thinking more about these issues. First there is the ES wiki. This wiki is still in its infancy, but it holds some great discussion on entity systems. Next, there some really productive discussion over at gamedev stack exchange (maybe this question should be moved there as well). First take a look at this question, it's a good starting point because it explains why there are no clear trends in ES design

Categories : Entity Framework

how to pass data from one component to other component without using events
To question a, you can use callback or observer instead of event callback Assume we have Component A and B, and the instances are a and b. Use callback will make it no context needed. b.callback = a.handler; b.doSth(); // component define Class A { public function handler(param:*):void {//you can have your param here } } class B { private var _callback:Function;//here you can use a array to save multi callbacks. public function set callback(value:Function):void { _callback = value; } public function doSth():void { //do something if (_callback != null) { _callback.apply(null, [some data]); } } } Observer Here is some introduce to Observer, it looks like callback in some way. Observer

Categories : Actionscript

JTransforms FFT DC component different from Matlab
Some real-data-only FFTs only return frequency data up to N/2 bins since the rest is just the mirrored complex conjugate of the first half for strictly real input. But since half the energy is in that second half, the results need to be doubled to account for the N/2 bins of energy that are not returned. The zeroth (DC) does not need to be doubled, as it does not have a complex conjugate bin at negative DC, so has to handled differently somewhere. Check the documentation for your FFT, as you may need to handle this outside of the real-only half-length result FFT.

Categories : Java

Identifying non-app iCloud Key Value data
Julien had it right here. I was not using any frameworks bit forgot that previously I had used MKiCloudSync to sync my NSUserDefaults. I can only assume these keys are added to NSUserDefaults by the system and were propogated to iCloud.

Categories : Iphone

Problems opening xyz.html from root of sdcard using webviewer component
If your sdcard is mounted at /mnt/sdcard then file:///mnt/sdcard/xyz.html is correct. However many devices mount the card(external hardware sdcard) to either extsd or external_sd so then the paths change to file:///mnt/extsd/xyz.html / file:///mnt/external_sd/xyz.html . These devices consider the onboard storage as /mnt/sdcard/. Again these paths might have vendor specific names, but these are what I've seen so far. Check where your sdcard is mounted and post more info

Categories : Android

Principal component analysis with Voxels using Matlab
Well, princomp is the MATLAB PCA function. Using it is a little tricky. I've answered a similar question here: computing PCA matrix for set of sift descriptors Does that help?

Categories : Matlab

MATLAB - Component of array and matrix multiplication
Is this what you want? A=rand(1,7,3); B=rand(3,3); C=reshape(reshape(A,1*7,3)*B,[1,7,3]); or maybe C=reshape(reshape(A,1*7,3)*B',[1,7,3]); %%% with B' instead of B

Categories : Matlab

jQuery - identifying specific form data when there multiple forms
$("body").on("submit", "form", function (event) { var pm = $(this).serialize(); pm[id] = $(this).find('input:hidden[name='+id+']').val(); event.preventDefault(); $.post( 'urota3.php?' + pm )

Categories : Jquery

Matlab, problems with ode15i
you define your function, Step1: function Step1 Which means you define Step1 as not providing outputs or taking inputs, yet in feval, you hand it inputs (and expect outputs). Your function Step2 is defined: function calcul = Step2( t,y,yp) which has output calcu1 and inputs t,y,yp. So reformat your Step1 to have the form of Step2.

Categories : Matlab

matlab compiler installation problems
So, the first thing I checked was the matlab supported compilers page: http://www.mathworks.com/support/compilers/R2013a/index.html I was thinking that SDK 7.1 would not be supported, but clearly it is, and is even at the top of the list. However, one of your errors was complaining about .NET, and on that MATLAB page, there is a caveat about SDK 7.1 needing .NET Framework 4.0 (in table, at the bottom of the SDK 7.1 cell.) Whenever I've done this in windows, I've always just used the Visual Studio compiler. I would suggest trying that first, since I don't remember this mex-setup process taking very long (before success/failure).

Categories : Matlab

Matlab guidata handles problems
The simplest fix is to first get the guidata from hObject function test figure(); but1 = uicontrol('units','normalized','position',[0.2,0.2,0.2,0.2],... 'callback',@but1cb); but2 = uicontrol('units','normalized','position',[0.6,0.6,0.2,0.2],... 'callback',@but2cb); but3 = uicontrol('units','normalized','position',[0.4,0.4,0.2,0.2],... 'callback',@but3cb,'string',' '); function but1cb(hObject,~) a = 1; handles = guidata(hObject); handles.a = 1; guidata(hObject, handles) end function but2cb(hObject,~) handles = guidata(hObject); a = 2; handles.a = 2; guidata(hObject, handles) end function but3cb(hObject,~)

Categories : Matlab

problems with imshow() and rgb2gray() in MATLAB
This is probably an issue with the image you are loading. The input to the rgb2gray function needs to be a 3-channel color image (MxNx3 matrix for the R,G,B channels). If you use a built-in Matlab sample image, you can effectively do: imdata = imread('ngc6543a.jpg'); figure; imshow(imdata) Then: test = rgb2gray(imdata);

Categories : Matlab

Problems populating 3D cell array in MATLAB
I believe the problem is how you are indexing your cell array D. The syntax is D{i,j,k} not D{i}{j}{k} The line giving an error should therefore be written D{i,j,1 + length(D{i,j})} = 1; For more information see Access Data in a Cell Array.

Categories : Matlab

Why does MATLAB/Octave wipe the floor with C++ in Eigenvalue Problems?
In the C++ implementation, there is no need to make the matrix symmetric, because the function only uses the lower triangular part of it. This may not be the case. In the reference, it is stated that: int gsl_eigen_symmv(gsl_matrix *A,gsl_vector *eval, gsl_matrix *evec, gsl_eigen_symmv_workspace * w) This function computes the eigenvalues and eigenvectors of the real symmetric matrix A. Additional workspace of the appropriate size must be provided in w. The diagonal and lower triangular part of A are destroyed during the computation, but the strict upper triangular part is not referenced. The eigenvalues are stored in the vector eval and are unordered. The corresponding eigenvectors are stored in the columns of the matrix evec. For example, the eigenvector in

Categories : C++

Having problems reproducing Matlab results in Python for a coupled system of ODE's
Since this turned out to be the answer: Beware integer arithmetic. If you're porting from a language that does not do this by default, you may be surprised when x=50 y=6 z=5 x*y/z == 60 x*(y/z) == 50 x/y*z == 40 x*z/y == 41 And so on. Try changing all constants to doubles (5 -> 5.0, etc.), and see if that helps. EDIT: @BenDundee pointed out that python will be switching syntax to / meaning "real division", and integer division being specified with the // operator. You can switch to that behaviour now, with the line from __future__ import division, which should also resolve the problem.

Categories : Python

Imagesc ButtonDownFcn problems in MATLAB, using custom toolbar action
Here is a simple example: %% Init fig_h = figure('CloseRequestFcn', 'run = 0; delete(fig_h);'); rgb = imread('peppers.png'); run = 1; t = 0; %% Loop while run t = t + 0.05; imagesc(rgb*sin(t), 'ButtonDownFcn', 'disp(''Clicked'')'); pause(0.01); end Above the 'ButtonDownFcn' of the image is being used so the 'HitTest' property of the image must be 'On'. Below is the case that the 'ButtonDownFcn' of the axes are used and since the image is in front of the axes, 'HitTest' property of the image should be 'Off' or the axes won't be selectable. %% Loop ax = axes; while run t = t + 0.05; imagesc(rgb*sin(t), 'Parent', ax, 'HitTest', 'Off'); set(ax, 'ButtonDownFcn', 'disp(''Clicked'')') pause(0.01); end It's also possible to use the figure 'ButtonDownFcn' and aga

Categories : Matlab

MatLab-->csv: Export data to csv file using dlmwrite in Matlab
I think the problem is that you write the names to a file at the local folder and not the other folder. fldr = fullfile('c:','Data_Analysis'); nomFile=fullfile( fldr, 'Test.csv' ); fid=fopen(nomFile,'w'); fprintf(fid,'%s,',names{:}); fprintf(fid,' '); dlmwrite(nomFile,A,'-append'); fclose(fid);

Categories : Matlab

java parsing data from component
Thanks everyone for the help. The "problem" was that the JPanel that the components were sitting on had a semi-transparent background. And JComponents with transparency get messed up somehow, which made it appear like there are multiple labels being created. But it works fine without transparency.

Categories : Java

How does one make function calls or trigger events from a Native component into a C#/XAML component?
This is because your not able to have your C++ code call into C#. You can only have C# call (and return) into C++. http://social.msdn.microsoft.com/Forums/wpapps/en-us/a850b680-6052-41c5-825a-d764d3369fe9/calling-c-code-from-c-in-windows-phone-8

Categories : C#

prime faces DockMenu component scrolling how to fixed the position of component
With CSS, overriding the top container position rule for the dock-container-top class: .ui-dock-container-top { position: absolute !important; } Hope it helps!

Categories : JSF

Free Pascal use for loop to determine visibility of component based on status of Date Component
You can iterate over the components via FindComponent. In the example below Self as the Form is given as Owner. Procedure SetChecks(AOwner:TComponent); var x:Integer; begin for x:=1 to 5 do TCheckBox(AOwner.FindComponent('check' + IntToStr(x))).Visible := TDateEdit(AOwner.FindComponent('date' + IntToStr(x))).Date <>StrToDateTime('00:00:00'); end; procedure TForm1.Button1Click(Sender: TObject); begin SetChecks(Self); end;

Categories : Delphi

dynamic ui:include with ui:fragment: component with rendered false still make inside component tree
The <ui:include> doesn't extend from UIComponent. It's a tag handler. It does thus not support the rendered attribute at all. It's also nowhere listed in the tag documentation. <ui:fragment> is indeed an UIComponent. So basically you end up with all those 3 include files being included during view build time and thus all 3 physically end up in JSF component tree. It's only the HTML output which is conditionally rendered via <ui:fragment rendered>. You still end up with duplicate component IDs from those includes because they all end up in JSF component tree. You should be using a taghandler like <c:if> instead of <ui:fragment> to conditionally build the JSF component tree. So, theoretically, this should do for each of them: <c:if test="#{filtersPopup.fi

Categories : JSF

How to lay out components so that the middle component gets all the space, but the right-most component is aligned left?
It is very rare that one individual layout manager will meet all your needs. Instead you could use a compound layout approach. That is, separate each individual layout requirement into a separate component, with it's own layout manager. Then added all these to your master component, managing the overall requirements. As an example import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.LineBorder; public class SimpleGridBagLayout { public static void main(String[] args) {

Categories : Java

BorderLayout - child component remains visible after adding another component
You are calling things that affect the UI after setViisble() is called -- a Swing no-no. Put things that affect the UI into an invokeLater call; look it up. While you're at it, I think you're still supposed to get the content pane from the frame for adding components... And I don't think creating things in the constructor is a good idea. import java.awt.BorderLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; public class SwingTest extends JFrame { public void createUI() { setDefaultCloseOperation(DISPOSE_ON_CLOSE); SwingUtilities.invokeLater( new Runnable() { public void run() { getContentPane().setLayout(new BorderLayo

Categories : Java

How to extract character component and numeric component from a variable and mix these components in other one
To extract part of a string, use a regular expression: in R, type help(regex) and help(grep) for instructions. > test=data.frame(ID=1:3,Code=c("101ABC","021DPA","FCA123"),Mixture=c("BD","AA","IO")) > test$v1=gsub("[A-Z]*","",test$Code) # this returns the Code column with capital letters removed > test$v2=gsub("[0-9]*","",test$Code) > test$v3=paste(test$Mixture,test$v2,sep="") > print(test) ID Code Mixture v1 v2 v3 1 1 101ABC BD 101 ABC BDABC 2 2 021DPA AA 021 DPA AADPA 3 3 FCA123 IO 123 FCA IOFCA (There's probably a neater solution using the stringr package, but I haven't used stringr myself.)

Categories : R

joomla component: how to remove all the preloaded data and css
If i didn't understand your question wrong, you can do something like this; <?php if ($this->countModules( 'position-1' )) : ?> <div class="cssforthecomponent"> <jdoc:include type="component" /> </div> <?php else: ?> <?php if ($this->countModules( 'position-2' )) : ?> <div class="cssfortherestofwebsite"> <jdoc:include type="component" /> </div> <?php endif; ?> Assign the component to a menu item with an empty module to position-1 for the same menu item. It will work. You don't need to include or do etc. stuff for that. Peace..

Categories : Joomla

Measure data use of an android app (component-wise)
You can use TrafficStats for this, either to programmatically record the amount of bandwidth before and after some operation (e.g., "download images from the internet"), or to use the tag structure to help show this sort of breakdown in DDMS.

Categories : Android

JSF Backing Component - Composite Component - Stackoverflow Exception
UIComponent#getAttributes() is a very special map. On a given key, say "foo", it first evaluates #{component.foo} as a ValueExpression which implicitly invokes UIComponent#getFoo() method. See also the javadoc. That totally explains the infinite loop. If the getFoo() method was absent, then it'd just have continued to look in the "static" map (which you can control by overriding UIComponent#getValueExpression()). You need to solve your concrete functional requirement differently. I have actually had a hard time in wrapping my head around your concrete functional requirement, but I believe that you actually need to define separate properties with separate getters/setters, all properly delegating to the state helper: public String getLocalName() { return getStateHelper().eval("localNam

Categories : JSF

component.query versus component.getcomponent in performance
While Ext.ComponentQuery queries for all underlying Components (you may define a traversing start as second param after the query string) it also allow you to query by a various set of params, attributes, pseudo classes, functions, etc. Full Reference and always result in a set (array) compinstance.GetComponent('itemId') only queries the direct childs of the calling component for the itemId property and will always return one reference or null. Note that the itemId need only to be unique to all it's siblings. So yes GetComponent() will be a bit faster. I don't think that there are huge pros and cons. GetComponent() cannot be used that often because you may not only looking in level. Take a menu which groups the the buttons, GetComponent() will only find the group but not the anything wit

Categories : Javascript

JSF events not propagating from composite component with backing component
Any relative client ID in <f:ajax render> is evaluated relative to the parent naming container of the component it's been attached to. In this construct, the <f:ajax> ultimately ends up being attached inside the composite component, which is by itself a naming container. However, there's no component with ID out2 inside the composite. That explains your problem. To solve it, you'd need to specify the absolute client ID. For example, when it's actually inside a <h:form id="formId">: <f:ajax execute="@all" render=":formId:out2" /> If it's however more complicated than that, consider binding the component to the view and dynamically referring its client ID: <h:outputText id="out2" binding="#{out2}" ... /> ... <f:ajax execute="@all" render=":#{out2.clientI

Categories : JSF

Plotting coordinates in map component using confidential/sensitive data?
If you use Google Maps, you will post your coordinates to their server. There's no way to prevent that. So I believe you have no choice but to host your own, or find a cheaper maps provider you want to trust with the data.

Categories : Asp Net

Joomla 2.5 component geting data from database on admin
You are directly call your model function getcode into your template without defining the model. Also you already assign the value of getcode function in view.html.php ,so you can directly call that variable into your template like below, <?php // No direct access to this file defined( '_JEXEC' ) or die('Restricted Access'); $document = JFactory::getDocument(); jimport( 'joomla.filter.output' ); //get the value assigned in the view.html.php $tabela = $this->getCode; $code = $tabela[0][0]; ?> <form action="index.php?option=com_sblog&view=statistic_adm" method="post" name="adminForm"> <label>Kod bloga:</label> <input type='text' name='code' value="<?php echo $code; ?>" /> <input type="hidden" name="task" value="" /> </form> Hope

Categories : PHP

Why does the Component Palette change when I open a data module?
The component palette is context sensitive, so that tabs that can't be used aren't displayed. (Visual components make no sense in a datamodule, because you can't put a visual component on a datamodule. There's no point in showing you components you can't use.) A tab that has only visual components on it will be totally hidden; if there is a mix of visual and non-visual components (like the Win32 tab), only the non-visual components will be displayed. Switching to the design window for a form should display both visual and non-visual components, including making those hidden tabs visible again.

Categories : Delphi

Spring-data-mongo: MongoRepository not being wired unless I add @Component annotation
Yes, the @Component or @Repository is necessary. The scan simply indicates that spring should look for classes identified via annotations (@Component, @Repository, @Service) and load them as beans. If you don't use repository or component scan, you would have to manually instantiate all spring-managed beans via XML configuration or Java configuration. You have to tell spring which classes to turn into beans as it doesn't assume everything in the classpath is supposed to be a spring-managed bean, which is why you need to use the annotations.

Categories : Spring

Extract Identifier from Principal Component Analysis with Missing Data in R
This feels like a bit of a hack. There may be a better solution out there somewhere. The method here is to create a new object that is initially full of NAs, and then turn the names of the sparse data into numeric indexes and assign using those. > p1 <- pca_ob$scores[,1] > p1 1 3 5 6 7 4.273146 2.104705 -0.715732 -2.125950 -3.536168 > z<-rep(NA, 7) > z[as.numeric(names(p1))]<-p1 > z [1] 4.273146 NA 2.104705 NA -0.715732 -2.125950 -3.536168

Categories : R

How to find composite component in JSF component tree?
The UIComponent class has a isCompositeComponent() helper method for exactly this purpose. So, this should just do: for (UIComponent child : component.getChildren()) { if (UIComponent.isCompositeComponent(child)) { // It's a composite child! } } For the interested in "under the covers" workings, here's the implementation source code from Mojarra 2.1.25: public static boolean isCompositeComponent(UIComponent component) { if (component == null) { throw new NullPointerException(); } boolean result = false; if (null != component.isCompositeComponent) { result = component.isCompositeComponent.booleanValue(); } else { result = component.isCompositeComponent = (component.getAttributes().containsKey(

Categories : JSF

What is difference in JSF between component.getAttributeName() vs. component.getAttributes().get("name")
Functionally, it doesn't make any difference. Technically, UIComponent#getAttributes() allows the developer to not worry about the exact component type while getting/setting the attributes. Look at your particular example with disabled="true". The UIComponent superclass doesn't have any isDisabled() method at all. You'd need to perform an instanceof check on e.g. HtmlInputText before you can cast it and finally invoke isDisabled() on it. The getAttributes() is then much easier in order to be independent from that. A lot of UIComponent related methods in standard JSF API take or return UIComponent superclass instead of a specific type. In properly designed components, both delegate under the covers ultimately to the same, the UIComponent#getStateHelper().

Categories : JSF

No such component has been registered in the kernel's component container
Most likely you have added Ninject.Extensions.Interception but not any of the concrete implementations Ninject.Extensions.Interception,DynamicProxy or Ninject.Extensions.Interception,LinFu

Categories : C#



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