Search Results

Search found 151 results on 7 pages for 'pratik patel'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • How to install Oracle Weblogic Server using OS-specific Package installer?(Linux/Solaris)

    - by PratikS -- Oracle
    Note: OS-specific Package installer As the name suggests the installer is platform specific. It is meant for installation with a 32bit JVM only. Both SUN and JROCKIT 32 bit JDKs come bundled with "OS-specific Package installer", so no need to install the JDK in advance. There are three different ways of installing Oracle Weblogic Server: Graphical mode Console mode Silent mode For Linux/Solaris: Steps to install OS-specific Package .bin installer(for Linux/Solaris) are almost same as windows except for the way we launch the installation.Installer: wls_<version>_<linux/solaris>32.bin (E.g. wls1036_linux32.bin/wls1036_solaris32.bin) 1) Graphical mode: Log in to the target UNIX system. Go to the directory that contains the installation program.(Make sure GUI is enabled or else it will default to console mode) Launch the installation by entering the following commands: [weblogic@pratik ~]$ pwd/home/oracle[weblogic@pratik ~]$ cd WLSInstallers/[weblogic@pratik WLSInstallers]$ ls -ltrtotal 851512-rw-rw-r-- 1 oracle oracle 871091023 Dec 22  2011 wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ chmod a+x wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ ls -ltrtotal 851512-rwxrwxr-x 1 oracle oracle 871091023 Dec 22  2011 wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ ./wls1036_linux32.bin As soon as you run ./wls1036_linux32.bin with GUI enabled you would see the following screen: Rest of the screens and steps are similar to that of Graphical mode installation on windows, refer: How to install Oracle Weblogic Server using OS-specific Package installer?(Windows) 2) Console mode: Log in to the target UNIX system. Go to the directory that contains the installation program. Launch the installation by entering the following commands: [weblogic@pratik ~]$ pwd/home/oracle[weblogic@pratik ~]$ cd WLSInstallers/[weblogic@pratik WLSInstallers]$ ls -ltrtotal 851512-rw-rw-r-- 1 weblogic weblogic 871091023 Dec 22  2011 wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ chmod a+x wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ ls -ltrtotal 851512-rwxrwxr-x 1 weblogic weblogic 871091023 Dec 22  2011 wls1036_linux32.bin [weblogic@pratik WLSInstallers]$ ./wls1036_linux32.bin -mode=consoleExtracting 0%....................................................................................................100%<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Welcome:--------This installer will guide you through the installation of WebLogic 10.3.6.0.Type "Next" or enter to proceed to the next prompt.  If you want to change data entered previously, type "Previous".  You may quit the installer at any time by typing "Exit".Enter [Exit][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Choose Middleware Home Directory:--------------------------------- ->1|* Create a new Middleware Home   2|/home/oracle/wls_12cEnter index number to select OR [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Choose Middleware Home Directory:---------------------------------    "Middleware Home" = [Enter new value or use default"/home/oracle/Oracle/Middleware"]Enter new Middleware Home OR [Exit][Previous][Next]> /home/oracle/WLS1036<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Choose Middleware Home Directory:---------------------------------    "Middleware Home" = [/home/oracle/WLS1036]Use above value or select another option:    1 - Enter new Middleware Home    2 - Change to default [/home/oracle/Oracle/Middleware]Enter option number to select OR [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Register for Security Updates:------------------------------Provide your email address for security updates and  to initiate configuration manager.   1|Email:[]   2|Support Password:[]   3|Receive Security Update:[Yes]Enter index number to select OR [Exit][Previous][Next]> 3<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Register for Security Updates:------------------------------Provide your email address for security updates and  to initiate configuration manager.    "Receive Security Update:" = [Enter new value or use default "Yes"]Enter [Yes][No]? No<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Register for Security Updates:------------------------------Provide your email address for security updates and  to initiate configuration manager.    "Receive Security Update:" = [Enter new value or use default "Yes"]    ** Do you wish to bypass initiation of the configuration manager and    **  remain uninformed of critical security issues in your configuration?Enter [Yes][No]? Yes<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Register for Security Updates:------------------------------Provide your email address for security updates and  to initiate configuration manager.   1|Email:[]   2|Support Password:[]   3|Receive Security Update:[No]Enter index number to select OR [Exit][Previous][Next]>Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Register for Security Updates:------------------------------Provide your email address for security updates and  to initiate configuration manager.   1|Email:[]   2|Support Password:[]   3|Receive Security Update:[No]Enter index number to select OR [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Choose Install Type:--------------------Select the type of installation you wish to perform. ->1|Typical    |  Install the following product(s) and component(s):    | - WebLogic Server    | - Oracle Coherence   2|Custom    |  Choose software products and components to install and perform optional    |configuration.Enter index number to select OR [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Choose Product Installation Directories:----------------------------------------Middleware Home Directory: [/home/oracle/WLS1036]Product Installation Directories:   1|WebLogic Server: [/home/oracle/WLS1036/wlserver_10.3]   2|Oracle Coherence: [/home/oracle/WLS1036/coherence_3.7]Enter index number to select OR [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->The following Products and JDKs will be installed:--------------------------------------------------    WebLogic Platform 10.3.6.0    |_____WebLogic Server    |    |_____Core Application Server    |    |_____Administration Console    |    |_____Configuration Wizard and Upgrade Framework    |    |_____Web 2.0 HTTP Pub-Sub Server    |    |_____WebLogic SCA    |    |_____WebLogic JDBC Drivers    |    |_____Third Party JDBC Drivers    |    |_____WebLogic Server Clients    |    |_____WebLogic Web Server Plugins    |    |_____UDDI and Xquery Support    |    |_____Evaluation Database    |_____Oracle Coherence    |    |_____Coherence Product Files    |_____JDKs         |_____SUN SDK 1.6.0_29         |_____Oracle JRockit 1.6.0_29 SDK    *Estimated size of installation: 1,276.0 MBEnter [Exit][Previous][Next]> Next<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Installing files..0%          25%          50%          75%          100%[------------|------------|------------|------------][***************************************************]<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Installing JDK....0%          25%          50%          75%          100%[------------|------------|------------|------------][***************************************************]Performing String Substitutions...<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Configuring OCM...0%          25%          50%          75%          100%[------------|------------|------------|------------][***************************************************]Creating Domains...<-------------------- Oracle Installer - WebLogic 10.3.6.0 ------------------->Installation CompleteCongratulations! Installation is complete.Press [Enter] to continue or type [Exit]> [weblogic@pratik ~]$ Note: All the inputs are in Bold 3) Silent mode:              1) Log in to the target Unix system.             2) Create a silent.xml file that defines the configuration settings normally entered by a user during an interactive installation process, such as graphical-mode or console-mode installation. <?xml version="1.0" encoding="UTF-8"?><bea-installer>     <input-fields>        <data-value name="BEAHOME" value="/home/oracle/WLS1036" />        <data-value name="WLS_INSTALL_DIR" value="/home/oracle/WLS1036/wlserver_10.3" />        <data-value name="COMPONENT_PATHS" value="WebLogic Server|Oracle Coherence" />    </input-fields></bea-installer> <!-- Note: This sample silent.xml file is used to install all the components of WebLogic Server and Oracle Coherence. All the values in Bold are the variables. -->               3) Place the silent.xml file in the same directory as where the WebLogic Server Package installer is located.              4) Go to the directory that contains the installation program.              5) Start the installer as follows: [weblogic@pratik WLSInstallers]$ chmod a+x wls1036_linux32.bin[weblogic@pratik WLSInstallers]$ ls -ltrtotal 851516-rwxrwxr-x 1 weblogic weblogic 871091023 Dec 22  2011 wls1036_linux32.bin-rw-rw-r-- 1 weblogic weblogic       331 Jul  5 03:48 silent.xml[weblogic@pratik WLSInstallers]$ cat silent.xml<?xml version="1.0" encoding="UTF-8"?><bea-installer>        <input-fields>                <data-value name="BEAHOME" value="/home/oracle/WLS1036" />                <data-value name="WLS_INSTALL_DIR" value="/home/oracle/WLS1036/wlserver_10.3" />                <data-value name="COMPONENT_PATHS" value="WebLogic Server|Oracle Coherence" />        </input-fields></bea-installer>[weblogic@pratik WLSInstallers]$ ./wls1036_linux32.bin -mode=silenlent.xml -log=/home/oracle/WLSInstallers/install.logExtracting 0%....................................................................................................100%[weblogic@pratik WLSInstallers]$ -log=/home/oracle/WLSInstallers/install.log creates a installation log(install.log) under "/home/oracle/WLSInstallers/", when installation completes you will see the following printed in the log file: 2012-07-05 03:59:36,788 INFO  [WizardController] com.bea.plateng.wizard.silent.tasks.LogTask - The installation was successfull! For other configurable values in silent.xml refer: Values for the Sample silent.xml File for WebLogic Server Important links to Refer: Running the Installation Program in Graphical Mode Running the Installation Program in Console Mode Running the Installation Program in Silent Mode

    Read the article

  • Why eclipse is hanging while in debug mode ?

    - by Pratik
    We are developing our web application using JAVA GWT framework. We are using Eclipse Indigo as a development GUI. We are facing problems while debugging the JAVA gwt application in eclipse. Most of the time, Eclipse hangs while debugging. We tried to increase the memory buffer size in eclipse but no luck. We had tried to run the eclipse in various environment like Windows, Fedora 16, Cent OS. but some how not getting positive results. Can anyone help me out to decide which OS, and eclipse or version should we have to use so can able to resolve the hanging issue? Thanks in advance. Pratik

    Read the article

  • Error while installing vmware tools v8.8.2 in Ubuntu 12.04 beta

    - by Dipen Patel
    I just upgraded to Ubuntu 12.04 from 11.10 using update manager. I use it as virtual machine on VMWare Player 4.xx. As usual I installed vmware tools to enable full screen mode and shared folder functionality. But while installing I got an error while building modules for shared folder and fast networking utilities for vmware tools. Error is ============================================== /tmp/vmware-root/modules/vmhgfs-only/fsutil.c: In function ‘HgfsChangeFileAttributes’: /tmp/vmware-root/modules/vmhgfs-only/fsutil.c:610:4: error: assignment of read-only member ‘i_nlink’ make[2]: *** [/tmp/vmware-root/modules/vmhgfs-only/fsutil.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: initialization from incompatible pointer type [enabled by default] /tmp/vmware-root/modules/vmhgfs-only/file.c:128:4: warning: (near initialization for ‘HgfsFileFileOperations.fsync’) [enabled by default] /tmp/vmware-root/modules/vmhgfs-only/tcp.c:53:30: error: expected ‘)’ before numeric constant /tmp/vmware-root/modules/vmhgfs-only/tcp.c:56:25: error: expected ‘)’ before ‘int’ /tmp/vmware-root/modules/vmhgfs-only/tcp.c:59:33: error: expected ‘)’ before ‘int’ make[2]: *** [/tmp/vmware-root/modules/vmhgfs-only/tcp.o] Error 1 make[1]: *** [_module_/tmp/vmware-root/modules/vmhgfs-only] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-22-generic' make: *** [vmhgfs.ko] Error 2 make: Leaving directory `/tmp/vmware-root/modules/vmhgfs-only' The filesystem driver (vmhgfs module) is used only for the shared folder feature. The rest of the software provided by VMware Tools is designed to work independently of this feature. Let me know if anyone has encountered and solved this problem. Regards, Dipen Patel

    Read the article

  • SQL SERVER – Solution – Puzzle – Challenge – Error While Converting Money to Decimal

    - by pinaldave
    Earlier I had posted quick puzzle and I had received wonderful response to the same. Today we will go over the solution. The puzzle was posted here: SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal Run following code in SSMS: DECLARE @mymoney MONEY; SET @mymoney = 12345.67; SELECT CAST(@mymoney AS DECIMAL(5,2)) MoneyInt; GO Above code will give following error: Msg 8115, Level 16, State 8, Line 3 Arithmetic overflow error converting money to data type numeric. Why and what is the solution? Solution is as following: DECLARE @mymoney MONEY; SET @mymoney = 12345.67; SELECT CAST(@mymoney AS DECIMAL(7,2)) MoneyInt; GO There were more than 20 valid answers. Here is the reason. Decimal data type is defined as Decimal (Precision, Scale), in other words Decimal (Total digits, Digits after decimal point).. Precision includes Scale. So Decimal (5,2) actually means, we can have 3 digits before decimal and 2 digits after decimal. To accommodate 12345.67 one need higher precision. The correct answer would be DECIMAL (7,2) as it can hold all the seven digits. Here are the list of the experts who have got correct answer and I encourage all of you to read the same over hear. Fbncs Piyush Srivastava Dheeraj Abhishek Anil Gurjar Keval Patel Rajan Patel Himanshu Patel Anurodh Srivastava aasim abdullah Paulo R. Pereira Chintak Chhapia Scott Humphrey Alok Chandra Shahi Imran Mohammed SHIVSHANKER The very first answer was provided by Fbncs and Dheeraj had very interesting comment. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Pinal Dave, Readers Contribution, Readers Question, SQL, SQL Authority, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • iPhone SDK 3.2 beta and iPhone SDK 3.1.2

    - by pratik
    Hello, Currently I am using iPhone SDK 3.1.2 for developing iPhone apps. Apple has recently released iPhone SDK 3.2 beta and I want to try my hands with it. But my problem is that I want to use both versions of SDKs, 3.1.2 since I am currently developing apps and uploading on app store, 3.2 beta to start trying the new version (but Apple will not accept apps on App Store, if developed using 3.2 beta) Please guide me. Regards, Pratik

    Read the article

  • asp.net application + single sign on

    - by pratik
    Hello, I want to implement single sign on in my asp.net web application. Scenario is something like below: user will get registered / sign up at "account.example.com" there will a link to "professional.example.com" when user goes to this link (step 2), they must remain logged in over here. Please suggest me the best solution for this. Regards, Pratik

    Read the article

  • Why DB constraints are not added during table creation.

    - by Pratik
    Hi All, What is the difference between these to ways of table creation. CREATE TABLE TABLENAME( field1.... field2... add constraint constraint1; add constraint constraint2; ) AND CREATE TABLE TABLENAME( field1.... field2... ) ALTER TABLE TABLENAME add constaint1 ALTER TABLE TABLENAME add constaint2 Moreover the first scripts fails on the SQL+ but they pass on sqldeveloper Thanks! Pratik

    Read the article

  • Noftification between J2EE components.

    - by Pratik
    Hi There! I have a design problem . My application has multiple J2EE components ,In simple terms one acts as a service provider(Non UI) and others are consumers(UI webapp) . The consumer gets the configuration data from the service provider(this basically reads the data from DB) during the start up and stores it in the Cache. The cache gets refreshed after periodic time to reflect any changes done at the database. The Problem Apart from the cache refresh ,I also want to notify the consumers when someone changes the DB . that configuration has been changed please reload it. What notification mechanism's can I use to achieve this. Thanks! Pratik

    Read the article

  • Notification between J2EE components.

    - by Pratik
    Hi There! I have a design problem . My application has multiple J2EE components ,In simple terms one acts as a service provider(Non UI) and others are consumers(UI webapp) . The consumer gets the configuration data from the service provider(this basically reads the data from DB) during the start up and stores it in the Cache. The cache gets refreshed after periodic time to reflect any changes done at the database. The Problem Apart from the cache refresh ,I also want to notify the consumers when someone changes the DB . that configuration has been changed please reload it. What notification mechanism's can I use to achieve this. Thanks! Pratik

    Read the article

  • Common way to compare timestamp in oracle, postgres and mssql

    - by Pratik
    Hi There! I am writing a sql query which involves finding if timestamp falls in particular range of days . I have written that in the postgres but it doesn't works in oracle and msssql. Is there are common way to compare the timestamp across different database. My postgres sql looks something like this ... AND creation_date < (CURRENT_TIMESTAMP - interval '5 days') AND creation_date >= (CURRENT_TIMESTAMP - interval '15 days') ... Thanks! Pratik

    Read the article

  • iPhone + AdMob + remove the Ad view

    - by pratik
    Hello, I have integrated AdMob in my iPhone application. I am adding an Ad view in of my UIViewController as follows: ProgrammaticAdViewController *temp = [[ProgrammaticAdViewController alloc] init]; temp = [[ProgrammaticAdViewController alloc] initWithNibName:nil bundle:nil]; [self.view addSubview:temp.view]; So, I will be able to see an Ad view on top of my UIViewController. Now I have two problems: I am not able to tap on certain buttons of my UIViewController on which I have added the Ad View. So, for temporary purpose I adding the Ad view as: [self.view insertSubView:temp.view atIndex:1]; I want to remove the Ad view after sometime so I am using: [temp.view removeFromSuperView]; But my Ad view is not being removed. Please help me. Regards, Pratik

    Read the article

  • iPhone native app + payment gateway

    - by pratik
    Hello, I want to implement payment gateway for iPhone native app. I have read in few of the sites that I can integrate apple payment gateway for this through In App Purchase. But if I want to do through In App Purchase then, I have register each of my product with AppStore and set a price margin for each. Rather I am building something like shopping cart where prices of products are different. Please guide how should I proceed, is there any other payment gateway that I can integrate with my iPhone native app. Regards, Pratik

    Read the article

  • iPhone + alternative to drop downs

    - by pratik
    Hello, I am developing native iPhone app. I have one requirement that, there are 5 drop downs in the screen, where user will select each value and based on that there will be a graph generated on screen. Also the drop downs are cascading, meaning that depending on value selected in upper drop down, the values in lower drop downs will change. If it was a web app than, I had no problem as we have drop downs available. But it is a native iPhone app and we don't have drop down in iPhone SDK. Please suggest me some other alternative to achieve the same. Regards, Pratik

    Read the article

  • iPhone + upgrade existing paid application on app store to free application with In App purchase + w

    - by pratik
    Hello, I have implemented In App purchase in my existing application. This application is currently available on app store as paid application, I want to update this paid application to free application with this In App purchase feature, where users can download it freely and have to pay for few features to unlock them. But the problem is that, if I update the existing paid application as free application (with few features locked and user has to buy it to unlock it), what about the users who have already purchased this application. Because when they will update to new free application, few features will be locked and they have to pay again to unlock them (why should they pay, if they have already purchased whole application previously). Regards, Pratik

    Read the article

  • iPhone + selecting a portion of UIImage using some rectangular frame and than cropping it

    - by pratik
    Hello, I have requirement of selecting a portion of UIImage displayed on iPhone screen (for e.g. selecting the face from the image of some human being) using some rectangular type of frame. It means a rectangular type of frame can be moved across the image to place it at portion that we want. After placing it, I need to resize the frame in order to have that portion completely fit in the frame. Finally, the UIImage should be cropped so that I have a UIImage only displaying the portion that I selected using the frame. Please help me. Regards, Pratik

    Read the article

  • How to enable SMART?

    - by Pratik Koirala
    I want to conduct a SMART test on my drive but it was disabled. So, i used sudo smartctl -s on /dev/sda but the result was smartctl 5.41 2011-06-09 r3365 [i686-linux-3.2.0-26-generic] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF ENABLE/DISABLE COMMANDS SECTION === Error SMART Enable failed: scsi error aborted command Smartctl: SMART Enable Failed. A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options. How to overcome this problem?

    Read the article

  • Why do large IT projects tend to fail or have big cost/schedule overruns?

    - by Pratik
    I always read about large scale transformation or integration project that are total or almost total disaster. Even if they somehow manage to succeed the cost and schedule blow out is enormous. What is the real reason behind large projects being more prone to failure. Can agile be used in these sort of projects or traditional approach is still the best. One example from Australia is the Queensland Payroll project where they changed test success criteria to deliver the project. See some more failed projects in this SO question Have you got any personal experience to share?

    Read the article

  • Is it correct to fix bugs without adding new features when releasing software for system testing?

    - by Pratik
    This question is to experienced testers or test leads. This is a scenario from a software project: Say the dev team have completed the first iteration of 10 features and released it to system testing. The test team has created test cases for these 10 features and estimated 5 days for testing. The dev team of course cannot sit idle for 5 days and they start creating 10 new features for next iteration. During this time the test team found defects and raised some bugs. The bugs are prioritised and some of them have to be fixed before next iteration. The catch is that they would not accept the new release with any new features or changes to existing features until all those bugs fixed. The test team says that's how can we guarantee a stable release for testing if we also introduce new features along with the bug fix. They also cannot do regression tests of all their test cases each iteration. Apparently this is proper testing process according to ISQTB. This means the dev team has to create a branch of code solely for bug fixing and another branch where they continue development. There is more merging overhead specially with refactoring and architectural changes. Can you agree if this is a common testing principle. Is the test team's concern valid. Have you encountered this in practice in your project.

    Read the article

  • In .net what are the difference between Eventlog and ManagementObject for retriving logs from remote

    - by Mitesh Patel
    I have found out following two ways for getting Application Event log entries from remote server. 1. Using EventLog object string logType = "Application"; EventLog ev = new EventLog(logType,"rspl200"); EventLogEntryCollection evColl = ev.Entries 2. Using ManagementObjectSearcher object ConnectionOptions co = new ConnectionOptions(); co.Username = "testA"; co.Password = "testA"; ManagementScope scope = new ManagementScope(@"\" + "machineName"+ @"\root\cimv2", co); scope.Connect(); SelectQuery query = new SelectQuery(@"select * from Win32_NtLogEvent"); EnumerationOptions opt = new EnumerationOptions(); opt.BlockSize = 1000; using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query,opt)) { foreach (ManagementObject mo in searcher.Get()) { // write down log entries Console.Writeline(mo["EventCode"]); } } I can easily get remote eventlog using method #1 (Using EventLog object) without any security access denied exception. But using method #2 (Using ManagementObjectSearcher object) i get access denied exception. Actually I want remote event log (only application and also latest log not all application logs) to be displayed in treeview like below - ServerName - Logs + Error + Information + Warning Can anybody help me in this to find out best way from this or any other? Also the main thing is that user who reads remote logs may be in different domain than server. Thanks Mitesh Patel

    Read the article

  • Printing Pdf using AirPrint causes cut-off content

    - by Jatin Patel
    Here i am printing pdf with size 'pageSize = CGSizeMake(640, 832);'. this size is larget then A4 size page aspected. so i will cut-off some text(means it will not print whole page). while printing same pdf using MAC, it will print whole page with help of option (scale to fit). so can any one help me to come out from this problem.. is there any option in IOS sdk for scale to fit. here is my code.. -(void)printItem { NSArray *aArrPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ; NSString *aStr = [[aArrPaths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"PropertyReport_%d.pdf",self.propertyId]]; // NSString *aStr = [[NSBundle mainBundle] pathForResource:@"TRADUZIONE HELP SECTIONS REV2" ofType:@"pdf"]; NSURL *url=[[NSURL alloc] initFileURLWithPath:aStr]; NSData *data=[[NSData alloc] initWithContentsOfURL:url]; printController = [UIPrintInteractionController sharedPrintController]; if(printController && [UIPrintInteractionController canPrintData:data]) { printController.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; //printInfo.jobName = [NSString stringWithFormat:@"New Image"]; printInfo.duplex = UIPrintInfoDuplexLongEdge; printController.printInfo = printInfo; printController.showsPageRange = YES; printController.printingItem = data; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { if (!completed && error) { //NSLog(@"FAILED! due to error in domain %@ with error code %u", error.domain, error.code); } }; // aWebViewPDF.hidden=FALSE; [printController presentAnimated:YES completionHandler:completionHandler]; } } Thanks Jatin Patel

    Read the article

  • How to calculate checksum?

    - by Patel Rikin
    I m developing instrument driver and i want to know how to calculate checksum of frame. Explanation: Expressed by characters [0-9] and [A-F]. Characters beginning from the character after [STX] and until [ETB] or [ETX] (including [ETB] or [ETX]) are added in binary. The 2-digit numbers, which represent the least significant 8 bits in hexadecimal code, are converted to ASCII characters [0-9] and [A-F]. The most significant digit is stored in CHK1 and the least significant digit in CHK2. This is sample frame : <STX>2Q|1|2^1||||20011001153000<CR><ETX><CHK1><CHK2><CR><LF> and i want to know what is value of chk1 and chk2 and i am new in this so i m totally blank about how to calculate checksum i am not getting above 3rd and 4th point. can any one provide sample code for c#. Please help me.

    Read the article

  • Error while running bash script that moves files

    - by K.K Patel
    I am new to bash scripting and want to create bash script that moves some days old files between source and destination as per days defined in script. When I run this script I get error line 16: syntax error near unexpected token `do' #!/bin/bash echo "Enter Your Source Directory" read soure echo "Enter Your Destination Directory" read destination echo "Enter Days" read days do find $soure -mtime +$days mv $soure $destination {} \; echo "Files $days old moved from $soure to $destination" done please help me to create this script.

    Read the article

  • A simple Dynamic Proxy

    - by Abhijeet Patel
    Frameworks such as EF4 and MOQ do what most developers consider "dark magic". For instance in EF4, when you use a POCO for an entity you can opt-in to get behaviors such as "lazy-loading" and "change tracking" at runtime merely by ensuring that your type has the following characteristics: The class must be public and not sealed. The class must have a public or protected parameter-less constructor. The class must have public or protected properties Adhere to this and your type is magically endowed with these behaviors without any additional programming on your part. Behind the scenes the framework subclasses your type at runtime and creates a "dynamic proxy" which has these additional behaviors and when you navigate properties of your POCO, the framework replaces the POCO type with derived type instances. The MOQ framework does simlar magic. Let's say you have a simple interface:   public interface IFoo      {          int GetNum();      }   We can verify that the GetNum() was invoked on a mock like so:   var mock = new Mock<IFoo>(MockBehavior.Default);   mock.Setup(f => f.GetNum());   var num = mock.Object.GetNum();   mock.Verify(f => f.GetNum());   Beind the scenes the MOQ framework is generating a dynamic proxy by implementing IFoo at runtime. the call to moq.Object returns the dynamic proxy on which we then call "GetNum" and then verify that this method was invoked. No dark magic at all, just clever programming is what's going on here, just not visible and hence appears magical! Let's create a simple dynamic proxy generator which accepts an interface type and dynamically creates a proxy implementing the interface type specified at runtime.     public static class DynamicProxyGenerator   {       public static T GetInstanceFor<T>()       {           Type typeOfT = typeof(T);           var methodInfos = typeOfT.GetMethods();           AssemblyName assName = new AssemblyName("testAssembly");           var assBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assName, AssemblyBuilderAccess.RunAndSave);           var moduleBuilder = assBuilder.DefineDynamicModule("testModule", "test.dll");           var typeBuilder = moduleBuilder.DefineType(typeOfT.Name + "Proxy", TypeAttributes.Public);              typeBuilder.AddInterfaceImplementation(typeOfT);           var ctorBuilder = typeBuilder.DefineConstructor(                     MethodAttributes.Public,                     CallingConventions.Standard,                     new Type[] { });           var ilGenerator = ctorBuilder.GetILGenerator();           ilGenerator.EmitWriteLine("Creating Proxy instance");           ilGenerator.Emit(OpCodes.Ret);           foreach (var methodInfo in methodInfos)           {               var methodBuilder = typeBuilder.DefineMethod(                   methodInfo.Name,                   MethodAttributes.Public | MethodAttributes.Virtual,                   methodInfo.ReturnType,                   methodInfo.GetParameters().Select(p => p.GetType()).ToArray()                   );               var methodILGen = methodBuilder.GetILGenerator();               methodILGen.EmitWriteLine("I'm a proxy");               if (methodInfo.ReturnType == typeof(void))               {                   methodILGen.Emit(OpCodes.Ret);               }               else               {                   if (methodInfo.ReturnType.IsValueType || methodInfo.ReturnType.IsEnum)                   {                       MethodInfo getMethod = typeof(Activator).GetMethod(/span>"CreateInstance",new Type[]{typeof((Type)});                                               LocalBuilder lb = methodILGen.DeclareLocal(methodInfo.ReturnType);                       methodILGen.Emit(OpCodes.Ldtoken, lb.LocalType);                       methodILGen.Emit(OpCodes.Call, typeofype).GetMethod("GetTypeFromHandle"));  ));                       methodILGen.Emit(OpCodes.Callvirt, getMethod);                       methodILGen.Emit(OpCodes.Unbox_Any, lb.LocalType);                                                              }                 else                   {                       methodILGen.Emit(OpCodes.Ldnull);                   }                   methodILGen.Emit(OpCodes.Ret);               }               typeBuilder.DefineMethodOverride(methodBuilder, methodInfo);           }                     Type constructedType = typeBuilder.CreateType();           var instance = Activator.CreateInstance(constructedType);           return (T)instance;       }   }   Dynamic proxies are created by calling into the following main types: AssemblyBuilder, TypeBuilder, Modulebuilder and ILGenerator. These types enable dynamically creating an assembly and emitting .NET modules and types in that assembly, all using IL instructions. Let's break down the code above a bit and examine it piece by piece                Type typeOfT = typeof(T);              var methodInfos = typeOfT.GetMethods();              AssemblyName assName = new AssemblyName("testAssembly");              var assBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(assName, AssemblyBuilderAccess.RunAndSave);              var moduleBuilder = assBuilder.DefineDynamicModule("testModule", "test.dll");              var typeBuilder = moduleBuilder.DefineType(typeOfT.Name + "Proxy", TypeAttributes.Public);   We are instructing the runtime to create an assembly caled "test.dll"and in this assembly we then emit a new module called "testModule". We then emit a new type definition of name "typeName"Proxy into this new module. This is the definition for the "dynamic proxy" for type T                 typeBuilder.AddInterfaceImplementation(typeOfT);               var ctorBuilder = typeBuilder.DefineConstructor(                         MethodAttributes.Public,                         CallingConventions.Standard,                         new Type[] { });               var ilGenerator = ctorBuilder.GetILGenerator();               ilGenerator.EmitWriteLine("Creating Proxy instance");               ilGenerator.Emit(OpCodes.Ret);   The newly created type implements type T and defines a default parameterless constructor in which we emit a call to Console.WriteLine. This call is not necessary but we do this so that we can see first hand that when the proxy is constructed, when our default constructor is invoked.   var methodBuilder = typeBuilder.DefineMethod(                      methodInfo.Name,                      MethodAttributes.Public | MethodAttributes.Virtual,                      methodInfo.ReturnType,                      methodInfo.GetParameters().Select(p => p.GetType()).ToArray()                      );   We then iterate over each method declared on type T and add a method definition of the same name into our "dynamic proxy" definition     if (methodInfo.ReturnType == typeof(void))   {       methodILGen.Emit(OpCodes.Ret);   }   If the return type specified in the method declaration of T is void we simply return.     if (methodInfo.ReturnType.IsValueType || methodInfo.ReturnType.IsEnum)   {                               MethodInfo getMethod = typeof(Activator).GetMethod("CreateInstance",                                                         new Type[]{typeof(Type)});                               LocalBuilder lb = methodILGen.DeclareLocal(methodInfo.ReturnType);                                                     methodILGen.Emit(OpCodes.Ldtoken, lb.LocalType);       methodILGen.Emit(OpCodes.Call, typeof(Type).GetMethod("GetTypeFromHandle"));       methodILGen.Emit(OpCodes.Callvirt, getMethod);       methodILGen.Emit(OpCodes.Unbox_Any, lb.LocalType);   }   If the return type in the method declaration of T is either a value type or an enum, then we need to create an instance of the value type and return that instance the caller. In order to accomplish that we need to do the following: 1) Get a handle to the Activator.CreateInstance method 2) Declare a local variable which represents the Type of the return type(i.e the type object of the return type) specified on the method declaration of T(obtained from the MethodInfo) and push this Type object onto the evaluation stack. In reality a RuntimeTypeHandle is what is pushed onto the stack. 3) Invoke the "GetTypeFromHandle" method(a static method in the Type class) passing in the RuntimeTypeHandle pushed onto the stack previously as an argument, the result of this invocation is a Type object (representing the method's return type) which is pushed onto the top of the evaluation stack. 4) Invoke Activator.CreateInstance passing in the Type object from step 3, the result of this invocation is an instance of the value type boxed as a reference type and pushed onto the top of the evaluation stack. 5) Unbox the result and place it into the local variable of the return type defined in step 2   methodILGen.Emit(OpCodes.Ldnull);   If the return type is a reference type then we just load a null onto the evaluation stack   methodILGen.Emit(OpCodes.Ret);   Emit a a return statement to return whatever is on top of the evaluation stack(null or an instance of a value type) back to the caller     Type constructedType = typeBuilder.CreateType();   var instance = Activator.CreateInstance(constructedType);   return (T)instance;   Now that we have a definition of the "dynamic proxy" implementing all the methods declared on T, we can now create an instance of the proxy type and return that out typed as T. The caller can now invoke the generator and request a dynamic proxy for any type T. In our example when the client invokes GetNum() we get back "0". Lets add a new method on the interface called DayOfWeek GetDay()   public interface IFoo      {          int GetNum();          DayOfWeek GetDay();      }   When GetDay() is invoked, the "dynamic proxy" returns "Sunday" since that is the default value for the DayOfWeek enum This is a very trivial example of dynammic proxies, frameworks like MOQ have a way more sophisticated implementation of this paradigm where in you can instruct the framework to create proxies which return specified values for a method implementation.

    Read the article

  • Chunking a List - .NET vs Python

    - by Abhijeet Patel
    Chunking a List As I mentioned last time, I'm knee deep in python these days. I come from a statically typed background so it's definitely a mental adjustment. List comprehensions is BIG in Python and having worked with a few of them I can see why. Let's say we need to chunk a list into sublists of a specified size. Here is how we'd do it in C#  static class Extensions   {       public static IEnumerable<List<T>> Chunk<T>(this List<T> l, int chunkSize)       {           if (chunkSize <0)           {               throw new ArgumentException("chunkSize cannot be negative", "chunkSize");           }           for (int i = 0; i < l.Count; i += chunkSize)           {               yield return new List<T>(l.Skip(i).Take(chunkSize));           }       }    }    static void Main(string[] args)  {           var l = new List<string> { "a", "b", "c", "d", "e", "f","g" };             foreach (var list in l.Chunk(7))           {               string str = list.Aggregate((s1, s2) => s1 + "," + s2);               Console.WriteLine(str);           }   }   A little wordy but still pretty concise thanks to LINQ.We skip the iteration number plus chunkSize elements and yield out a new List of chunkSize elements on each iteration. The python implementation is a bit more terse. def chunkIterable(iter, chunkSize):      '''Chunks an iterable         object into a list of the specified chunkSize     '''        assert hasattr(iter, "__iter__"), "iter is not an iterable"      for i in xrange(0, len(iter), chunkSize):          yield iter[i:i + chunkSize]    if __name__ == '__main__':      l = ['a', 'b', 'c', 'd', 'e', 'f']      generator = chunkIterable(l,2)      try:          while(1):              print generator.next()      except StopIteration:          pass   xrange generates elements in the specified range taking in a seed and returning a generator. which can be used in a for loop(much like using a C# iterator in a foreach loop) Since chunkIterable has a yield statement, it turns this method into a generator as well. iter[i:i + chunkSize] essentially slices the list based on the current iteration index and chunksize and creates a new list that we yield out to the caller one at a time. A generator much like an iterator is a state machine and each subsequent call to it remembers the state at which the last call left off and resumes execution from that point. The caveat to keep in mind is that since variables are not explicitly typed we need to ensure that the object passed in is iterable using hasattr(iter, "__iter__").This way we can perform chunking on any object which is an "iterable", very similar to accepting an IEnumerable in the .NET land

    Read the article

  • Want to create dynamic subdomain in codeigniter?

    - by Nilay Patel
    In my site i want to add an functionality for user to use their username with domain. Like in codeigniter right now i want to give the user to use their own url to login in site and do other stuff. For eg: i Want www.username.mysite.com/login or www.username.mysite.com/category so here the user can login with their credential and add the category. so i have two controller in my site with login and category. So how to do this with the routes Or .htaccess.

    Read the article

1 2 3 4 5 6 7  | Next Page >