Search Results

Search found 101 results on 5 pages for 'kiran kulkarni'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Repeated Squaring - Matrix Multiplication using NEWMAT

    - by Dinakar Kulkarni
    I'm trying to use the repeated squaring algorithm (using recursion) to perform matrix exponentiation. I've included header files from the NEWMAT library instead of using arrays. The original matrix has elements in the range (-5,5), all numbers being of type float. # include "C:\User\newmat10\newmat.h" # include "C:\User\newmat10\newmatio.h" # include "C:\User\newmat10\newmatap.h" # include <iostream> # include <time.h> # include <ctime> # include <cstdlib> # include <iomanip> using namespace std; Matrix repeated_squaring(Matrix A, int exponent, int n) //Recursive function { A(n,n); IdentityMatrix I(n); if (exponent == 0) //Matrix raised to zero returns an Identity Matrix return I; else { if ( exponent%2 == 1 ) // if exponent is odd return (A * repeated_squaring (A*A, (exponent-1)/2, n)); else //if exponent is even return (A * repeated_squaring( A*A, exponent/2, n)); } } Matrix direct_squaring(Matrix B, int k, int no) //Brute Force Multiplication { B(no,no); Matrix C = B; for (int i = 1; i <= k; i++) C = B*C; return C; } //----Creating a matrix with elements b/w (-5,5)---- float unifRandom() { int a = -5; int b = 5; float temp = (float)((b-a)*( rand()/RAND_MAX) + a); return temp; } Matrix initialize_mat(Matrix H, int ord) { H(ord,ord); for (int y = 1; y <= ord; y++) for(int z = 1; z<= ord; z++) H(y,z) = unifRandom(); return(H); } //--------------------------------------------------- void main() { int exponent, dimension; cout<<"Insert exponent:"<<endl; cin>>exponent; cout<< "Insert dimension:"<<endl; cin>>dimension; cout<<"The number of rows/columns in the square matrix is: "<<dimension<<endl; cout<<"The exponent is: "<<exponent<<endl; Matrix A(dimension,dimension),B(dimension,dimension); Matrix C(dimension,dimension),D(dimension,dimension); B= initialize_mat(A,dimension); cout<<"Initial Matrix: "<<endl; cout<<setw(5)<<setprecision(2)<<B<<endl; //----------------------------------------------------------------------------- cout<<"Repeated Squaring Result: "<<endl; clock_t time_before1 = clock(); C = repeated_squaring (B, exponent , dimension); cout<< setw(5) <<setprecision(2) <<C; clock_t time_after1 = clock(); float diff1 = ((float) time_after1 - (float) time_before1); cout << "It took " << diff1/CLOCKS_PER_SEC << " seconds to complete" << endl<<endl; //--------------------------------------------------------------------------------- cout<<"Direct Squaring Result:"<<endl; clock_t time_before2 = clock(); D = direct_squaring (B, exponent , dimension); cout<<setw(5)<<setprecision(2)<<D; clock_t time_after2 = clock(); float diff2 = ((float) time_after2 - (float) time_before2); cout << "It took " << diff2/CLOCKS_PER_SEC << " seconds to complete" << endl<<endl; } I face the following problems: The random number generator returns only "-5" as each element in the output. The Matrix multiplication yield different results with brute force multiplication and using the repeated squaring algorithm. I'm timing the execution time of my code to compare the times taken by brute force multiplication and by repeated squaring. Could someone please find out what's wrong with the recursion and with the matrix initialization? NOTE: While compiling this program, make sure you've imported the NEWMAT library. Thanks in advance!

    Read the article

  • System.Data.OracleClient requires Oracle client software version 8.1.7 or greater

    - by sachin kulkarni
    I have installed Oracle client version 10g on my PC(Registry ORACLE_BASE-D:\oracle\product\10.2.0). I have added below references. System.Data.OracleClient. I am getting above mentioned error. Below is the Code Snippet . public static OracleConnection getConnection() { try { dataSource = new SqlDataSource(); dataSource.ConnectionString = System.Configuration.ConfigurationManager.AppSettings.Get("conn"); OracleConnection connection = new OracleConnection(); if (dataSource == null) { // Error during initialization of InitialContext or Datasource throw new Exception("###### Fatal Exception ###### - DataSource is not initialized.Pls check the stdout/logs."); } else { connection.ConnectionString = dataSource.ConnectionString; connection.Open(); } return connection; }catch (Exception ex) { throw ex; } } Please let me know what are the areas of Concern and where Iam missing.I am new for the combination of Oracle and Asp.Net.

    Read the article

  • Tweet's xml format

    - by Anand Kulkarni
    I get ' top tweets ' from twitter as an RSS feed in xml format . There is a guid field in that xml format. There is a long 11 digit number at the end of guid field , is it unique for every tweet ?

    Read the article

  • Get a value of checked checkbox into a button from a Gridview

    - by Nimish Kulkarni
    I have a Gridview Generated as follows : <asp:GridView ID="Cash_GridView" runat="server" CssClass="Grid" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="MemberCheck" runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="Loan_Acno" HeaderText="Loan A/C number" /> </Columns> </asp:Gridview> <asp:Button ID="CashPayButton" runat="server" Text="Pay Dividend" CssClass="bluesome" OnClick="CashPayButton_Click" /> And also having the above button click event now when i click checkbox on particular row i want that whole row to be get caluclated in the Button click event in the code behind protected void CashPayButton_Click(object sender, EventArgs e) { }

    Read the article

  • Facebook Like plugin gives 'could not be reached' due to redirect headers?

    - by Kiran Kulkarni
    I am trying on http://developers.facebook.com/docs/reference/plugins/like/ A. If I like this tinyurl that redirects to my page, it works fine - http://tinyurl.com/7qxuvr5 B. But if I try this page that redirects to my page, it FAILs with Error could not be reached - ri=X0Gzc2X%3DWQpglLjHJlTQGsyk7oNL0UB7Bt6zdElRzdUocTR3zgnTzd3BMOVXtpKX%3DSUSWY&ei=EllxcGK7968SUmYSYUrLBBomgA-Y"http://rsp3.rsys2.net/pub/cc?ri=X0Gzc2X%3DWQpglLjHJlTQGsyk7oNL0UB7Bt6zdElRzdUocTR3zgnTzd3BMOVXtpKX%3DSUSWY&ei=EllxcGK7968SUmYSYUrLBBomgA-Y Pages on both A and B have same layout and structure. Final page on [B] can be reached fine from browser. Could you please guide why this may be issue? Thanks in advance

    Read the article

  • How to solve "Warning: mail() [function.mail]: SMTP server response: 530 Relaying not allowed - sender domain not local in D:\\... " Error?

    - by Kiran Rs
    I have a contact page where users can contact me via that form. But I'm getting this error, Warning: mail() [function.mail]: SMTP server response: 530 Relaying not allowed - sender domain not local in D:\INETPUB\VHOSTS\nextoption.in\httpdocs\auto-replay\contact.php on line 33 My Php code is, if(isset($_POST['send'])) //if "email" is filled out, send email { //send email $email1=$_POST['email']; $headers = "From: My site\r\n"; $headers .= "Reply-To: [email protected]\r\n"; $headers .= "Return-Path: [email protected]\r\n"; $headers .= "X-Mailer: Drupal\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $to = "[email protected]"; $subject = "Test mail"; $message = "Hello!This is a simple email message $from = $email1; mail($to,$subject,$message,$headers); ? alert ("Enquiry form submited successfully ! We'll get back you soon "); What will be my fault..... What is the Fault in SMTP Server?

    Read the article

  • Internet speed showing high value but never felt that speed [closed]

    - by Kiran D Pillai
    I use Reliance Netconnect+ in my Toshiba Satellite laptop. My OS is Windows 7 Ultimate. I've seen speeds up to 1500 kbps when travelling and have an average speed of 400 kbps at my room premises. I'm sorry, I've never felt that much speed while browsing or downloading. Sometimes I think some other programs are also sharing the same network. It is just showing 200 or 500 kbps but I feel 25 or 50 kbps. Is there any way to prevent them? I use Google Chrome downloaded from Google site. Please suggest me some solutions.

    Read the article

  • Enabling a trace spec on Glassfish v2

    - by Kiran
    Hi Guys, I guess this might be answered previously but I dont seem to find one answered . Can anyone please lemme know hot to add a trace spec in Glassfish v2. Am very much new to this so not much aware of this. I need to enable a security trace string and orb trace string on Glassfish v2 .On Glassfish v3 I see a file called logging.properties where all the trace string been given , is there any such file on v2 to work with or we need to add a property to domain.xml. Thanks in advance.

    Read the article

  • "Error: Phone reports generic communication error or syntax error. (GsmComm.GsmCommunication.CommEx

    - by kiran
    hey guys, i was checking the sample code with gsmComm library, my modem is nokia 5130 Xpressmusic modem and the connection was done successfuly but when i tried to send a SMS .. i got this message "Error: Phone reports generic communication error or syntax error. (GsmComm.GsmCommunication.CommException)" what's the problem ?http://www.codeproject.com/KB/cs/SMS.aspx is ther any other codes ...

    Read the article

  • Yii , show tooltip in cgridview( table ) value

    - by Kiran
    I want to show tooltip in cgridview value as on hover on column it have to show whole contant stored in variable. I want to show contant in variable $data["comment"] as a tooltip ( title ), and currently it shows whole string as - $data["comment"]. array( 'name'=>'Comment', 'header'=>'Comment', 'value'=>'(strlen($data["comment"])>35)?substr($data["comment"], 0, 35)."..":$data["comment"];', 'htmlOptions'=>array('title'=>'$data["comment"]'), // this what i have do ),

    Read the article

  • Windows GUI Automation

    - by Kiran
    Hello, I am planning to automate some of the functionality of the GUI developed in Microsoft Visual C#. I am new to Automation with GUI. Would be glad if you share your experience regarding GUI Automation and some of the tools available for the automation. I plan to develop some programms / scripts in order to realise some of the functionality of the GUI

    Read the article

  • Enabling a trace spec on Glassfish v2

    - by Kiran
    Hi Guys, I guess this might be answered previously but I dont seem to find one answered . Can anyone please lemme know hot to add a trace spec in Glassfish v2. Am very much new to this so not much aware of this. I need to enable a security trace string and orb trace string on Glassfish v2 .On Glassfish v3 I see a file called logging.properties where all the trace string been given , is there any such file on v2 to work with or we need to add a property to domain.xml. Thanks in advance.

    Read the article

  • .NET SerialPort DataReceived event thread interference with main thread

    - by Kiran
    I am writing a serial communication program using the SerialPort class in C# to interact with a strip machine connected via a RS232 cable. When i send the command to the machine it responds with some bytes depending on the command. Like when i send a "\D" command, i am expecting to download the machine program data of 180 bytes as a continous string. As per the machine's manual, it suggests as a best practice to send an unreognized characters like comma (,) character to make sure the machine is initialized before sending the first command in the cycle. My serial communication code is as follows: public class SerialHelper { SerialPort commPort = null; string currentReceived = string.Empty; string receivedStr = string.Empty; private bool CommInitialized() { try { commPort = new SerialPort(); commPort.PortName = "COM1"; if (!commPort.IsOpen) commPort.Open(); commPort.BaudRate = 9600; commPort.Parity = System.IO.Ports.Parity.None; commPort.StopBits = StopBits.One; commPort.DataBits = 8; commPort.RtsEnable = true; commPort.DtrEnable = true; commPort.DataReceived += new SerialDataReceivedEventHandler(commPort_DataReceived); return true; } catch (Exception ex) { return false; } } void commPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { SerialPort currentPort = (SerialPort)sender; currentReceived = currentPort.ReadExisting(); receivedStr += currentReceived; } internal int CommIO(string outString, int outLen, ref string inBuffer, int inLen) { receivedStr = string.Empty; inBuffer = string.Empty; if (CommInitialized()) { commPort.Write(outString); } System.Threading.Thread.Sleep(1500); int i = 0; while ((receivedStr.Length < inLen) && i < 10) { System.Threading.Thread.Sleep(500); i += 1; } if (!string.IsNullOrEmpty(receivedStr)) { inBuffer = receivedStr; } commPort.Close(); return inBuffer.Length; } } I am calling this code from a windows form as follows: len = SerialHelperObj.CommIO(",",1,ref inBuffer, 4) len = SerialHelperObj.CommIO(",",1,ref inBuffer, 4) If(inBuffer == "!?*O") { len = SerialHelperObj.CommIO("\D",2,ref inBuffer, 180) } A valid return value from the serial port looks like this: \D00000010000000000010 550 3250 0000256000 and so on ... I am getting some thing like this: \D00000010D,, 000 550 D,, and so on... I feel that my comm calls are getting interferred with the one when i send commands. But i am trying to make sure the result of the comma command then initiating the actual command. but the received thread is inserting the bytes from the previous communication cycle. Can any one please shed some light into this...? I lost quite some hair just trying to get this work. I am not sure where i am doing wrong

    Read the article

  • Why can't we have a single programming Language ? [closed]

    - by Kiran
    I am no expert in Programming Languages. But whenever I change the project, I am faced with Herculean challenge of learning the new programming language which takes weeks to master if not months.. With the previous experience of programming in different languages, I believe it takes few months of continuous programming to understand the amazing features the prog.language has to offer and to exploit. It makes me wonder, why cannot we have a single programming language which boasts all the amazing features from the existing programming language and make it mandatory for all the programmers to learn it.

    Read the article

  • How do I extract data from a FoxPro memo field using .NET?

    - by Madhu kiran
    Hi, I'm writing a C# program to get FoxPro database into datatable everything works except the memo field is blank or some strange character. I'm using C# .Net 2.0. I tried the code posted by Jonathan Demarks dated Jan 12. I am able to get the index but i don't know how to use this index to fetch the data from memo file. Pleaese help me. Thanks Madhu

    Read the article

  • Updating multiple tables at the same time in Linq-to-SQL

    - by kiran
    How do I update two tables at the same time using Linq-to-SQL? var z = from a in db.Products join b in db.ProductSubcategories on a.ProductSubcategoryID equals b.ProductSubcategoryID join d in db.ProductCategories on b.ProductCategoryID equals d.ProductCategoryID select new { ProductName = a.Name, ProductCategory = d.Name, ProductSubCategory = b.Name, Cost = a.StandardCost, discontinuedDate = a.DiscontinuedDate, ProductId=a.ProductID };

    Read the article

  • iphone webview dynamic font support

    - by Kiran
    Friends, I am trying to build a simple iphone application to view a local webpage that uses dynamic fonts. The url is www.eenadu.net. I have just a single view based application and inserted a webview into the view and implementing the webviewdelegate in viewcontroller. The site uses ttf/eot fonts that are dynamically downloadable by browser from http://www.eenadu.net/eenadu.ttf or http://www.eenadu.net/EENADU0.eot. Here is what I am doing in the code by doing some research: Code: ( void ) loadFont { NSString *fontPath = [[NSBundle mainBundle] pathForResource:@"eenadu" ofType:@"ttf"]; CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); // Create the font with the data provider, then release the data provider. customFont = CGFontCreateWithDataProvider(fontDataProvider); CGDataProviderRelease(fontDataProvider); fontPath = [[NSBundle mainBundle] pathForResource:@"eenadu" ofType:@"eot"]; fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]); // Create the font with the data provider, then release the data provider. customFont = CGFontCreateWithDataProvider(fontDataProvider); CGDataProviderRelease(fontDataProvider); } (void) viewDidLoad { [super viewDidLoad]; [self loadFont]; [webView setBackgroundColor:[UIColor whiteColor]]; NSString *urlAddress = @"http://www.eenadu.net/"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; } I see that the page loads however doesn't display the font. Please help. Also, For loadFont, I have included the fonts in the build with right names and took care of the case as well.

    Read the article

  • Update local sqlite database from Adobe AIR application

    - by Kiran
    I have a local sqlite database which is created by an IE addon. The sqlite database cannot be updated from a Adobe AIR application which I use as a frontend. The exception is as follows SQLError:'Error #3132:Datatype type mismatch.',details:'could not convert floating point value to integer without loss of data.',operation:'execute',detailID:'2302'

    Read the article

  • Search and Highlight search text in items in the Listview in WPF

    - by kiran-k
    Hi, I am using MVVM to show the database records in a gridview (ListView view). i have a textbox where we can enter the text to be searched in the results listed in the gridview. i tried many ways to highlight the search text (Not the entire row only the text matches in the record) in the records displayed in the list view but unable to highlight. i am able to find the starting and ending indexes. i tried to created rectangles using those indexes on the text block but unable to highlight. Can anyone have solution for this. Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >