w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

How to make matlab repeat a procedure independently?
Your original A is changing every time because of the last line in your loop A(A_ones_change) = 0;. Change it to some copy of A (say, A1 = A) you make in the beginning of the loop.

Categories : Matlab

Running Stored Procedure from Matlab Only Returns 1 row
Strangely, it the code started working again. All I did was write some diagnostic code to count the number of records in the tables that latest_hl_tradables() queries. Initially those only returned 1 row. Then when they started returning all the rows. I don't know what changed.

Categories : Mysql

What's with the declare a class and declare a protocol with the same name?
No. It's just that: the Foundation framework is overly popular and NSObject dominates the field when it comes to root classes. That's why people are used to its name and the messages and methods it implements. For example, an Objective-C developer generally expects a class to implement + alloc and - init, but this only happens to be a common convention, a class does not necessarily does so. But when NSObjectis not a root class of a hierarchy (just think about NSProxy, for example), it's still convenient to have it respond to all the messages NSObject implements so one does not have to learn a completely different, new set of names and conventions. That's why Apple opted to extract these common methods into a separate protocol called NSObject, which the NSObject class implements - and doe

Categories : Objective C

I want to execute a procedure by passing input parameters of another procedure name
You can pass the procedure call you want as a string and then execute it using EXECUTE IMMEDIATE. CREATE OR REPLACE PROCEDURE PROC_TIME_CAPTURE( p_procedure_call VARCHAR2 ) IS before_procedure timestamp; after_procedure timestamp; actual_time number; rpt_dt date; BEGIN select systimestamp into before_procedure from dual; dbms_output.put_line (before_procedure ); EXECUTE IMMEDIATE p_procedure_call; select systimestamp into after_procedure from dual; dbms_output.put_line (after_procedure); select extract (second from (after_procedure-before_procedure)) into actual_time from dual; dbms_output.put_line (actual_time); END PROC_TIME_CAPTURE; You could pass the full procedure call including parameters. Etc... BEGIN PROC_TIME_CAPTURE( 'proc_load( ''20/10/2010''

Categories : Oracle

Wrapping system procedure in View or Stored Procedure
To supply column metadata from the stored procedure consumable by Entity Framework you could do CREATE PROCEDURE dbo.GetHardDriveFreeSpaceInMegabytes AS BEGIN SET NOCOUNT ON; DECLARE @xp_fixeddrives TABLE ( drive nvarchar(1), [MB free] int ) INSERT INTO @xp_fixeddrives EXEC master..xp_fixeddrives SELECT * FROM @xp_fixeddrives END

Categories : Dotnet

Error: Pass Returned Date From One Procedure To Next Procedure
You have to declare a parameter in the stored procedure with the Output keyword to get the return value from the procedure. CREATE PROCEDURE s_One @Returndate Date OUTPUT AS BEGIN Also, to save the value of the parameter in a variable that can be used in the calling program, the calling program must use the OUTPUT keyword when executing the procedure. Exec s_One @Returndate Output

Categories : Sql Server

Get mysql other stored procedure to new store procedure data
Unfortunately you still can't do that in Mysql. A possible solution is to insert into a temporary table from the first stored procedure and use it in the second. CREATE TEMPORARY TABLE tmp_result (`ID` int, `NAME` varchar(1), `SEX` varchar(1)); CREATE PROCEDURE sp_one() INSERT INTO tmp_result SELECT 1 id, 'A' name, 'M' sex UNION ALL SELECT 2, 'B', 'F' UNION ALL SELECT 3, 'C', 'M'; CREATE PROCEDURE sp_two() SELECT * FROM tmp_result; CALL sp_one(); CALL sp_two(); DROP TEMPORARY TABLE tmp_result;

Categories : Mysql

MySQL stored procedure return result before end of procedure
what kind of stuff are you wanting to keep doing after the select? Maybe you could insert the select query into a temp table, continue doing other stuff, then finally select at the very end? The temp table values would still be as if they were returned mid routine but you could still continue doing the "other stuff." Edit from below comment: To me this should be handled from the application doing the following -Break the current stored procedure up into 2 parts Call the 1st Insert Stored Procedure from the code that takes the first part of the string and inserts it into the database. Return the Id to the application The application takes the id it received back, and calls the second stored procedure(time consuming one) and passes 2 parameters. The id and the rest of the string. T

Categories : Mysql

mysql calling another procedure(of another schema) from procedure
You can do this simply, just mention schema name in prefix. For instance : CREATE DEFINER=`root`@`localhost` PROCEDURE `db1`.`sp1`() BEGIN select 'I am procedure from another db'; END Next, CREATE DEFINER=`root`@`localhost` PROCEDURE `db2`.`sp2`() BEGIN call db1.sp1(); END And call that like so : use db2; call `db2`.sp2();

Categories : Mysql

Returning a cursor , calling a procedure from other procedure
Sure you can. You can declare out parameters of type SYS_REFCURSOR and use them in your procedures, here is an example: CREATE OR REPLACE PROCEDURE QOT_LST_M_QOT_PRE (i_qot_id IN NUMBER, THE_CURSOR OUT SYS_REFCURSOR) --Declare a sys_refcursor to be an out parameter, so it can be used outside AS BEGIN OPEN THE_CURSOR FOR SELECT * FROM THE_TABLE WHERE X=i_qot_id;--Open the cursor END; CREATE OR REPLACE PROCEDURE QOT_LST_M_SEC_EXC_PRE (i_sec_id IN NUMBER, i_exc_id IN NUMBER) AS x_qot_id NUMBER(10); --Test param RESULT_CURSOR SYS_REFCURSOR;--The cursor that will hold the opened cursor in QOT_LST_M_QOT_PRE procedure SOMEVARIABLE VARCHAR2(10);--Test variables to hold results of cursor BEGIN QOT_LST_M_QOT_PRE(1,RESULT_CURSOR);--Procedure will open RESULT_CURSOR LOOP --Loop cursor FETCH R

Categories : SQL

How to Call in stored procedure another procedure with if statement
It is possible to do this without a cursor. But it still uses looping. declare @t table as (id int identity(1, 1) primary key, FirstName varchar(255), LastName varchar(255), Age int ); insert into @t(FirstName, LastName, Age) select FirstName, LastName, Age from dbo.users; declare @maxi int = (select max(id) from @t); declare @i = 0, @FirstName varchar(255), @LastName varchar(255), @Age int; while @i <= maxi begin select @FirstName = FirstName, @LastName = LastName, @Age = age from @t where id = @i; if @age = 20 exec myProc1 @firstname, @LastName; if @age = 21 exec myProc2 @firstname, @LastName; if @age = 22 exec myProc3 @firstname, @LastName;

Categories : SQL

Call a procedure(by an event) whose name is set by another procedure
If your procedure is an ordinary procedure without arguments: Type TForm1 = Class(TForm) .. private FMyProc : TProcedure; public procedure SetEventProc(aProc : TProcedure); procedure TheEvent( Sender : TObject); end; procedure Test; begin // Do something end; procedure TForm1.SetEventProc(aProc: TProcedure); begin Self.FMyProc := aProc; end; procedure TForm1.TheEvent(Sender: TObject); begin if Assigned(FMyProc) then FMyProc; end; // to set the callback to procedure "Test" Form1.SetEventProc(Test); If your procedure has arguments, declare a procedure type: Type MyProcedure = procedure( aString : String); And if your procedure is a method : Type MyMethod = procedure( aString : String) of Object; See also documentation about Procedura

Categories : Delphi

identify a procedure and replace it with a different procedure
These are called automated refactoring tools and are common for other languages. For Perl though you may well be in a really bad way because parsing Perl to find all the references is going to be virtually impossible.

Categories : Perl

Read Oracle stored procedure interface by procedure name using Oracle's .NET client
All relevant information about procedure/function parameters is located in the metadata view ALL_ARGUMENTS. For example: SQL> CREATE PACKAGE somePackage AS 2 PROCEDURE someProc (p_arg1 NUMBER, p_arg2 OUT VARCHAR2); 3 END; 4 / Package created SQL> SELECT package_name, object_name, position, argument_name, data_type, in_out 2 FROM user_arguments 3 WHERE package_name='SOMEPACKAGE'; PACKAGE_NAME OBJECT_NAME POSITION ARGUMENT_NAME DATA_TYPE IN_OUT ------------- ------------ --------- -------------- ---------- --------- SOMEPACKAGE SOMEPROC 1 P_ARG1 NUMBER IN SOMEPACKAGE SOMEPROC 2 P_ARG2 VARCHAR2 OUT

Categories : Dotnet

Matlab: Improper index matrix reference (or outsmarting matlab)
In the latest versions of MATLAB (13a/13b) there's a unit testing framework built in that looks very similar to what you're attempting. Instead of expect(myfibonacci(0)).toBe(0); you would write import matlab.unittest.constraints.IsEqualTo testCase.verifyThat(myfibonacci(0), IsEqualTo(0)) (You could also/instead have assumeThat, assertThat, or fatalAssertThat). If for some reason you wish to implement your own framework, note the small difference in your syntaxes - you have a dot whereas MathWorks have a comma between myfibonacci(0) and the test condition. In MATLAB you can't index into the result of a subscripted expression like that (well, you could, but you would have to overload subsref, and that's a world of pain, trust me). So the way they've done it is to introduce the test

Categories : Matlab

How to apply a trained Matlab neural network from C++ without call to Matlab?
Of course it is possible - neural networks are clear mathematical models. All you need is a compatible representation, where you have stored: network topology (number of neurons in particuluar layers) network weights (between all neurons) network activation functions (for each neuron) And that's all. The exact solution depends on what matlab library you are using for neural networks. There is a "standard" for prediction models called PMML, which can be loaded by for example Weka libraries. Either way - it is easy operation, so you can also implement it by hand by simply storing all the numbers in the text file and simulating network in the C++ (as the "forward" phase of the neural network is just few lines of code - the training part is the long one).

Categories : C++

Will Matlab standalone be faster than Matlab from UI for long execution code?
Applications built with MATLAB Compiler should execute at pretty much exactly the same speed as within MATLAB. MATLAB Compiler does not convert your MATLAB code into machine code in the same way as a C compiler does for C. What it does is to archive and encrypt your MATLAB code (note, it properly encrypts it, not just pcodes it as a comment suggests), create a thin executable wrapper and package them together, possibly also with MATLAB Compiler Runtime (MCR). MCR is very similar to MATLAB itself, without a graphical user interface, and is freely redistibutable. When you run the executable, it dearchives and decrypts your MATLAB code and runs it against the MCR. It should run exactly the same, both in terms of results and speed. Very old versions of MATLAB Compiler (pre-version 4.0) work

Categories : Matlab

Launching Matlab from java ProcessBuilder, Matlab console doesn't appear in Mac OS 10.8
You need to specify that MATLAB is to run with a visible UI by making use of the -desktop flag. I don't believe this is documented. So the command you need to run is matlab -desktop -r "initMatlab;runJavaUI;" I've created a Java library called matlabcontrol that can abstract all of this away from you. It can launch MATLAB while running on Windows, OS X, and Linux and then allow you to interact with MATLAB via eval and feval commands. matlabcontrol's code to launch MATLAB is located in matlabcontrol.RemoteMatlabProxyFactory's createProcess(...) method. If you make use of matlabcontrol as a Java library you won't directly interact with either this class or this method.

Categories : Java

Run Matlab executable file with MATLAB Compiler Runtime (MCR)
It simply means that you don't have rights to run PROGRAM. What is the output of the command: ls -l PROGRAM ? Maybe you've compiled this program as a root? Try to change the access using chmod.

Categories : Matlab

MATLAB - What are the units of Matlab Camera Calibration Toolbox
I know next to nothing about matlabs (not entirely true but i avoid matlab wherever I can, and that would be almost always possible) tracking utilities but here's some general info. Pixel dimension on the sensor has nothing to do with the size of the pixel on screen, or in model space. For all purposes a camera produces a picture that has no meaningful units. A tracking process is unaware of the scale of the scene. (the perspective projection takes care of that). You can re insert a scale by taking 2 tracked points and measuring the distance between those points. This is the solver spaces distance is pretty much arbitrary. Now if you know the real distance between these points you can get a conversion factor. By doing: real distance / solver space distance. There's really now way to kno

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

MATLAB: checkmark in MATLAB figure with LaTeX interpreter
it's not pretty, but might be good enough: xlabel('$surd$','interpreter','latex') or look here for other things that look like a tick http://detexify.kirelabs.org

Categories : Matlab

Matlab density plot, Heat map, Matlab
You can control the colour of each point like so: scatter(x1, y1, [], C) where C is the same size as your x1 and y1 matrices. Now if you describe the rules of how you want this heatmap colour modulation to happen, we can help you construct C from x1 and y1...

Categories : Matlab

How to get the Matlab workspace associated with the current Matlab project in C#?
I have already the solution, the way is the next: Create a .m file (for example SaveWorskpace.m) con this information: save test.mat Add SaveWorskpace.m at the project with Matlab Compiler Deployment Tool. Compile the project with Matlab Compiler Deployment Tool Add reference at the c# project Call function SaveWorkspace() Ready, you have variables save in the workspace test.mat

Categories : C#

Call matlab from c++ using VS2010 and matlab 2007a
This is probably very late reply but this sample code of mine may help you. #include<iostream> #include<math.h> #include<engine.h> #pragma comment (lib, "libmat.lib") #pragma comment (lib, "libmx.lib") #pragma comment (lib, "libmex.lib") #pragma comment (lib, "libeng.lib") using namespace std; const int N = 9; //Number of grid points int main() { // start matlab engine Engine *ep = engOpen(NULL); if (!(ep = engOpen(""))) { fprintf(stderr, " Can't start MATLAB engine "); return EXIT_FAILURE; } int i, j; // Grid creation with aspect ratio r double sum_r = 0, r = 1; for (i = 0; i < N-1; i++){ sum_r += pow(r,i); } double dx0 = 1 / sum_r; // calculate first dx double dy0 =

Categories : C++

function/procedure to update (ALTER) another function/procedure
While you can retrieve function source from pg_proc, trying to retrieve it, edit it and update the function is a recipe for pain and suffering. Instead, write a PL/PgSQL procedure that generates the function text in its entirety. Use a query against the information_schema or pg_catalog.pg_class to get the required table list, constraints, inheritance, etc. Loop over the query results, generating the body of the function, then join it all into a single block of text and pass it to EXECUTE. Here's a toy example of one function generating another: CREATE OR REPLACE FUNCTION very_meta(func_name text, message text) RETURNS void AS $$ DECLARE func_lines text; BEGIN -- In reality you'd build this iteratively, or preferably use `string_agg` over -- a query, but I'm just going to su

Categories : Function

Calling a stored procedure from an insert in a stored procedure
I ended up using a cursor to execute the SP for each row. There will only ever be one or two rows executed at a time - so this solution works (even if it isn't exactly beautiful). ALTER PROCEDURE Lead_CopySecuritiesToOppo -- Add the parameters for the stored procedure here @lead_leadID int, @oppo_opportunityID int, @user_userID int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; declare @secu_SecurityID char( 11 ) declare @newsecu_SecurityID int set rowcount 0 select * into #mytemp from Security where secu_LeadId = @lead_leadID set rowcount 1 select @secu_SecurityID = secu_SecurityID from #mytemp --Cursor through all the returned security rows while @

Categories : Sql Server

write stored procedure inside the other stored procedure
You could cahnge your Procedure to a Function like this Create FUNCTION [dbo].[test] (@dec NUMERIC(18, 2)) RETURNS Varchar(50) AS BEGIN DECLARE @Mns DECIMAL DECLARE @Average Varchar(50) SELECT @Mns = @dec % 60; SELECT @Average = CONVERT(VARCHAR(10), (CONVERT(DECIMAL(10), @dec / 60))) + ':' + CONVERT(VARCHAR, @Mns) RETURN @Average END And use ist like .... SELECT l.LocName ,v.Vtype ,SUM(DATEDIFF(MI, t.Paydate, t.DelDate)) AS TotalDiff ,[dbo].[test]( CONVERT(DECIMAL(10, 1), AVG(CONVERT(NUMERIC(18, 2), DATEDIFF(MI, t.Paydate, t.DelDate)))) ) AS Average FROM Transaction_tbl t ....

Categories : Sql Server

How to use Matlab from JAVA without using the Matlab Compiler
If you have Matlab (but you don't have builderJA) then you can use matlabcontrol for using matlab functions in java.(There might be other alternatives too, but I don't know) If you don't have Matlab at all then you can "create the java version of the matlab function" in some other computer having Matlab and builderJA installed, and use the jar files in your own computer. You only need to have MCR (Matlab Compiler Runtime- Its FREE) installed on your computer. Strickly answering your question: Is there a way to do use Matlab from JAVA, but without the need to have the Matlab Compiler? The answer is: Yes, you can use it. Using matlabcontrol (A java API to interact with Matlab).

Categories : Java

compile a matlab gui for win 32 system using 64 bit win and MATLAB
As far as I know you cannot actually use 64 bit matlab to build a 32 bit program. When I faced the same situation, Mathworks recommended me to (also) install 32 bit matlab on my 64 bit windows. I did not try it, but that should allow you to build 32 bit programs again.

Categories : Matlab

MATLAB Compiler vs MATLAB Coder
I'm not an expert, but the Coder is described as generating standalone C/C++ code, making no mention of the MCR. I notice however that it says that it only supports a "subset" of the Matlab language, which you can read more about here. The Compiler appears to just package up your Matlab code as you suggested, so probably supports most features.

Categories : Matlab

How come this != self when I declare this = self?
The self global variable refers to window.self Try to change the code: var self = this;

Categories : Javascript

Converting MATLAB 'imagesc' function to work with R's 'imagesc' from R's 'matlab' library
As I read the question and the linked material and some other material found with Google, you want the combined capacities of the image and axis functions in R. Some of the other material said that imagesc really only relabels the axis annotation. (And it has some additional color scaling capacity that you don't seem to be requesting.) Reading images in from files may take some extra packages. There is a grImport package with useful capabilities for pdf. There are also packages that specialize in particular formats, eg. tiff or rtiff. If you have a modes sized matrix to plot, you should offer dput(mat). In the absence of an example and specific directions can offer this adaptation of an example in the middle of the Examples section of ?image. > image(t(volcano)[ncol(volcano):1,]) #

Categories : R

how to declare a variable in pl sql the right way?
Err ... Are you saying that You used to have a code snippet that "worked": vJS := 'var gMaxDays = 366;'||CHR(10)|| 'function checkfields() {' ||CHR(13) || ' // Setting the target here' ||CHR(13) || ' document.frmInvSelect.target="_top"' ||CHR(13) || When you modified the snippet to be: vJS := ' gMaxDays;'||CHR(10)|| 'function checkfields() {' ||CHR(13) || ' // Setting the target here' ||CHR(13) || ' document.frmInvSelect.target="_top"' ||CHR(13) || It "works" no more ? I guess you're trying to generate a JavaScript code snippet. Maybe this is what you're looking for: declare vJS VARCHAR2(3500); gMaxDays s_criteria%rowtype := get_criteria_rec('MAX_DAYS_BOOKING'); begin -- here you have to call the correct field fro

Categories : Oracle

declare a n-pointer in C
Although doing this is a bad idea, it can be done, so here's one way. You can in fact loop in the preprocessor, and define recursive macros, if you use a suitably powerful metaprogramming library like Order (as mentioned above Boost is another possible candidate). Order lets you program in a functional style familiar to anyone who knows Scheme or ML. To loop, use a for_each construct. To simply create a given number of something you can use for_each_in_range with 1, N+1: ORDER_PP( // within this block Order code runs 8for_each_in_range(8fn(8_, 8print( (*) ) ), 1, 8) ) The above will print 7 stars. You can wrap up metaprogram blocks inside conventional macros, which follow normal preprocessor rules: // print COUNT stars #define STARS(COUNT) ORDER_PP(

Categories : C

Declare delegate when using ARC
Heres a pattern to follow. The delegate is properly declared weak (an object but with no transfer of ownership or increase in retain count). @protocol MyClassDelegate; @interface MyClass : NSObject @property(weak, nonatomic) id<MyClassDelegate>delegate; @end @protocol MyClassDelegate <NSObject> - (void)myClass:(MyClass *)myClass didSomethingAtTime:(NSDate *)time; - (CGSize)sizeofSomethingNeededByMyClass:(MyClass *)myClass; // and so on @end

Categories : Iphone

How to declare std::unique_ptr and what is the use of it?
Unique pointers are guaranteed to be destroyed when you go out of scope. http://en.cppreference.com/w/cpp/memory/unique_ptr In the case: unique_ptr<double> uptr2 (pd); pd will be destroyed when you go out of scope. THis facilitates memory management by automatic deletion. then case of unique_ptr<int> uptr (new int(3)); is not different except that raw pointer is not assigned to any variable here

Categories : C++

AS3: How do declare button?
Maybe this code will be useful, if you are using a property from a class, then you must declare as property. For example, put this in your class (and replace your function hitButtA) : public function get hitButtA():void{ return null; } public function set hitButtA(value:Object):void{ display.text=String(++counter); } Note: this is an example to solve your problem, this is not a correct use for getter/setter function. Therefore, you should use a setter, for set a property from a class, for example: objectFromMyClass.hitButtA = value; or using a getter: var value:Object = objectFromMyClass.hitButtA; Check this link for more explanation link. You have an error because, you must declare a property hitButtA in the class, so, you must declare a public variable or a getter/setter

Categories : Actionscript

How to declare an array in C#?
I think a List<int> would be better suited for your purpose. It will automatically extend itself as needed. List<int> fibNums = new List<int> {0, 0, 0, 0, 0};

Categories : C#



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