Daily Archives

Articles indexed Wednesday June 11 2014

Page 2/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • EM12c: Using the LIST verb in emcli

    - by SubinDaniVarughese
    Many of us who use EM CLI to write scripts and automate our daily tasks should not miss out on the new list verb released with Oracle Enterprise Manager 12.1.0.3.0. The combination of list and Jython based scripting support in EM CLI makes it easier to achieve automation for complex tasks with just a few lines of code. Before I jump into a script, let me highlight the key attributes of the list verb and why it’s simply excellent! 1. Multiple resources under a single verb:A resource can be set of users or targets, etc. Using the list verb, you can retrieve information about a resource from the repository database.Here is an example which retrieves the list of administrators within EM.Standard mode$ emcli list -resource="Administrators" Interactive modeemcli>list(resource="Administrators")The output will be the same as standard mode.Standard mode$ emcli @myAdmin.pyEnter password :  ******The output will be the same as standard mode.Contents of myAdmin.py scriptlogin()print list(resource="Administrators",jsonout=False).out()To get a list of all available resources use$ emcli list -helpWith every release of EM, more resources are being added to the list verb. If you have a resource which you feel would be valuable then go ahead and contact Oracle Support to log an enhancement request with product development. Be sure to say how the resource is going to help improve your daily tasks. 2. Consistent Formatting:It is possible to format the output of any resource consistently using these options:  –column  This option is used to specify which columns should be shown in the output. Here is an example which shows the list of administrators and their account status$ emcli list -resource="Administrators" -columns="USER_NAME,REPOS_ACCOUNT_STATUS" To get a list of columns in a resource use:$ emcli list -resource="Administrators" -help You can also specify the width of the each column. For example, here the column width of user_type is set to 20 and department to 30. $ emcli list -resource=Administrators -columns="USER_NAME,USER_TYPE:20,COST_CENTER,CONTACT,DEPARTMENT:30"This is useful if your terminal is too small or you need to fine tune a list of specific columns for your quick use or improved readability.  –colsize  This option is used to resize column widths.Here is the same example as above, but using -colsize to define the width of user_type to 20 and department to 30.$ emcli list -resource=Administrators -columns="USER_NAME,USER_TYPE,COST_CENTER,CONTACT,DEPARTMENT" -colsize="USER_TYPE:20,DEPARTMENT:30" The existing standard EMCLI formatting options are also available in list verb. They are: -format="name:pretty" | -format="name:script” | -format="name:csv" | -noheader | -scriptThere are so many uses depending on your needs. Have a look at the resources and columns in each resource. Refer to the EMCLI book in EM documentation for more information.3. Search:Using the -search option in the list verb makes it is possible to search for a specific row in a specific column within a resource. This is similar to the sqlplus where clause. The following operators are supported:           =           !=           >           <           >=           <=           like           is (Must be followed by null or not null)Here is an example which searches for all EM administrators in the marketing department located in the USA.$emcli list -resource="Administrators" -search="DEPARTMENT ='Marketing'" -search="LOCATION='USA'" Here is another example which shows all the named credentials created since a specific date.  $emcli list -resource=NamedCredentials -search="CredCreatedDate > '11-Nov-2013 12:37:20 PM'"Note that the timestamp has to be in the format DD-MON-YYYY HH:MI:SS AM/PM Some resources need a bind variable to be passed to get output. A bind variable is created in the resource and then referenced in the command. For example, this command will list all the default preferred credentials for target type oracle_database.Here is an example$ emcli list -resource="PreferredCredentialsDefault" -bind="TargetType='oracle_database'" -colsize="SetName:15,TargetType:15" You can provide multiple bind variables. To verify if a column is searchable or requires a bind variable, use the –help option. Here is an example:$ emcli list -resource="PreferredCredentialsDefault" -help 4. Secure accessWhen list verb collects the data, it only displays content for which the administrator currently logged into emcli, has access. For example consider this usecase:AdminA has access only to TargetA. AdminA logs into EM CLIExecuting the list verb to get the list of all targets will only show TargetA.5. User defined SQLUsing the –sql option, user defined sql can be executed. The SQL provided in the -sql option is executed as the EM user MGMT_VIEW, which has read-only access to the EM published MGMT$ database views in the SYSMAN schema. To get the list of EM published MGMT$ database views, go to the Extensibility Programmer's Reference book in EM documentation. There is a chapter about Using Management Repository Views. It’s always recommended to reference the documentation for the supported MGMT$ database views.  Consider you are using the MGMT$ABC view which is not in the chapter. During upgrade, it is possible, since the view was not in the book and not supported, it is likely the view might undergo a change in its structure or the data in it. Using a supported view ensures that your scripts using -sql will continue working after upgrade.Here’s an example  $ emcli list -sql='select * from mgmt$target' 6. JSON output support    JSON (JavaScript Object Notation) enables data to be displayed in a collection of name/value pairs. There is lot of reading material about JSON on line for more information.As an example, we had a requirement where an EM administrator had many 11.2 databases in their test environment and the developers had requested an Administrator to change the lifecycle status from Test to Production which meant the admin had to go to the EM “All targets” page and identify the set of 11.2 databases and then to go into each target database page and manually changes the property to Production. Sounds easy to say, but this Administrator had numerous targets and this task is repeated for every release cycle.We told him there is an easier way to do this with a script and he can reuse the script whenever anyone wanted to change a set of targets to a different Lifecycle status. Here is a jython script which uses list and JSON to change all 11.2 database target’s LifeCycle Property value.If you are new to scripting and Jython, I would suggest visiting the basic chapters in any Jython tutorials. Understanding Jython is important to write the logic depending on your usecase.If you are already writing scripts like perl or shell or know a programming language like java, then you can easily understand the logic.Disclaimer: The scripts in this post are subject to the Oracle Terms of Use located here.  1 from emcli import *  2  search_list = ['PROPERTY_NAME=\'DBVersion\'','TARGET_TYPE= \'oracle_database\'','PROPERTY_VALUE LIKE \'11.2%\'']  3 if len(sys.argv) == 2:  4    print login(username=sys.argv[0])  5    l_prop_val_to_set = sys.argv[1]  6      l_targets = list(resource="TargetProperties", search=search_list,   columns="TARGET_NAME,TARGET_TYPE,PROPERTY_NAME")  7    for target in l_targets.out()['data']:  8       t_pn = 'LifeCycle Status'  9      print "INFO: Setting Property name " + t_pn + " to value " +       l_prop_val_to_set + " for " + target['TARGET_NAME']  10      print  set_target_property_value(property_records=      target['TARGET_NAME']+":"+target['TARGET_TYPE']+":"+      t_pn+":"+l_prop_val_to_set)  11  else:  12   print "\n ERROR: Property value argument is missing"  13   print "\n INFO: Format to run this file is filename.py <username>   <Database Target LifeCycle Status Property Value>" You can download the script from here. I could not upload the file with .py extension so you need to rename the file to myScript.py before executing it using emcli.A line by line explanation for beginners: Line  1 Imports the emcli verbs as functions  2 search_list is a variable to pass to the search option in list verb. I am using escape character for the single quotes. In list verb to pass more than one value for the same option, you should define as above comma separated values, surrounded by square brackets.  3 This is an “if” condition to ensure the user does provide two arguments with the script, else in line #15, it prints an error message.  4 Logging into EM. You can remove this if you have setup emcli with autologin. For more details about setup and autologin, please go the EM CLI book in EM documentation.  5 l_prop_val_to_set is another variable. This is the property value to be set. Remember we are changing the value from Test to Production. The benefit of this variable is you can reuse the script to change the property value from and to any other values.  6 Here the output of the list verb is stored in l_targets. In the list verb I am passing the resource as TargetProperties, search as the search_list variable and I only need these three columns – target_name, target_type and property_name. I don’t need the other columns for my task.  7 This is a for loop. The data in l_targets is available in JSON format. Using the for loop, each pair will now be available in the ‘target’ variable.  8 t_pn is the “LifeCycle Status” variable. If required, I can have this also as an input and then use my script to change any target property. In this example, I just wanted to change the “LifeCycle Status”.  9 This a message informing the user the script is setting the property value for dbxyz.  10 This line shows the set_target_property_value verb which sets the value using the property_records option. Once it is set for a target pair, it moves to the next one. In my example, I am just showing three dbs, but the real use is when you have 20 or 50 targets. The script is executed as:$ emcli @myScript.py subin Production The recommendation is to first test the scripts before running it on a production system. We tested on a small set of targets and optimizing the script for fewer lines of code and better messaging.For your quick reference, the resources available in Enterprise Manager 12.1.0.4.0 with list verb are:$ emcli list -helpWatch this space for more blog posts using the list verb and EM CLI Scripting use cases. I hope you enjoyed reading this blog post and it has helped you gain more information about the list verb. Happy Scripting!!Disclaimer: The scripts in this post are subject to the Oracle Terms of Use located here. Stay Connected: Twitter | Facebook | YouTube | Linkedin | Newsletter mt=8">Download the Oracle Enterprise Manager 12c Mobile app

    Read the article

  • Oracle GoldenGate Active-Active Part 1

    - by Nick_W
    My name is Nick Wagner, and I'm a recent addition to the Oracle Maximum Availability Architecture (MAA) product management team.  I've spent the last 15+ years working on database replication products, and I've spent the last 10 years working on the Oracle GoldenGate product.  So most of my posting will probably be focused on OGG.  One question that comes up all the time is around active-active replication with Oracle GoldenGate.  How do I know if my application is a good fit for active-active replication with GoldenGate?   To answer that, it really comes down to how you plan on handling conflict resolution.  I will delve into topology and deployment in a later blog, but here is a simple architecture: The two most common resolution routines are host based resolution and timestamp based resolution. Host based resolution is used less often, but works with the fewest application changes.  Think of it like this: any transactions from SystemA always take precedence over any transactions from SystemB.  If there is a conflict on SystemB, then the record from SystemA will overwrite it.  If there is a conflict on SystemA, then it will be ignored.  It is quite a bit less restrictive, and in most cases, as long as all the tables have primary keys, host based resolution will work just fine.  Timestamp based resolution, on the other hand, is a little trickier. In this case, you can decide which record is overwritten based on timestamps. For example, does the older record get overwritten with the newer record?  Or vice-versa?  This method not only requires primary keys on every table, but it also requires every table to have a timestamp/date column that is updated each time a record is inserted or updated on the table.  Most homegrown applications can always be customized to include these requirements, but it's a little more difficult with 3rd party applications, and might even be impossible for large ERP type applications.  If your database has these features - whether it’s primary keys for host based resolution, or primary keys and timestamp columns for timestamp based resolution - then your application could be a great candidate for active-active replication.  But table structure is not the only requirement.  The other consideration applies when there is a conflict; i.e., do I need to perform any notification or track down the user that had their data overwritten?  In most cases, I don't think it's necessary, but if it is required, OGG can always create an exceptions table that contains all of the overwritten transactions so that people can be notified. It's a bit of extra work to implement this type of option, but if the business requires it, then it can be done. Unless someone is constantly monitoring this exception table or has an automated process in dealing with exceptions, there will be a delay in getting a response back to the end user. Ideally, when setting up active-active resolution we can include some simple procedural steps or configuration options that can reduce, or in some cases eliminate the potential for conflicts.  This makes the whole implementation that much easier and foolproof.  And I'll cover these in my next blog. 

    Read the article

  • Oracle Unveils Breakthrough Technology: Database In-Memory

    - by Mala Narasimharajan
    Missed Larry Ellison's big announcement this morning? Today, Oracle announced . Oracle Database In-Memory.  Oracle Database In-Memory  transparently extends the power of Oracle Database 12c to enable organizations to discover business insights in real-time while simultaneously increasing transactional performance. Here's why you should care - this new breakthrough technology enables enterprises to get faster answers to business questions ultimately leading to faster business action. Oracle Database In-Memory delivers leading-edge in-memory performance without the need to restrict functionality or accept compromises, complexity and risk. Deploying Oracle Database In-Memory with virtually any existing Oracle Database-compatible application is as easy as flipping a switch--no application changes are required.  For more information on Oracle Database In-Memory go to http://www.oracle.com/us/corporate/press/2215795

    Read the article

  • Fosfor EPUB Reader

    - by Geertjan
    Instead of creating a fullblown NetBeans Platform application for doing WYSIWYG editing for EPUB, similar to Sigil, I decided to focus purely on the very narrow scope of EPUB reading. The scope is narrower and, since the application will be a lot less ambitious and smaller, a pure JavaFX implementation makes sense. When you somehow get, e.g., buy, an EPUB file, you typically read it on a tablet or mobile device. However, some people in the world, e.g., me, still have laptops. Therefore, I'm creating a small JavaFX application that unzips EPUB files, into a temp directory, and then loads them into a JavaFX WebView. Arabic support: For an application like this, simplicity is the most important thing. Very few buttons, very few options, preferably no configuration of anything. Just let the user open the EPUB file and read it, that's it, nothing fancy. CSS stylesheets and images are correctly read. It's exactly what it looks like, a reader for EPUB files. The back and forward buttons are working and you can also switch to the table of contents. When it is complete, which it pretty much is right now, publishers of EPUB files can make this small app available from their site, to simplify life for their readers, since it will run easily and well on all operating systems.

    Read the article

  • OPN Solutions Catalog Goes Mobile

    - by Meghan Fritz-Oracle
    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} Good news for our partners on this sunny Tuesday! Oracle PartnerNetwork is pleased to announce the launch of a mobile-ready OPN Solutions Catalog. Features include: A fluid search and browse experience regardless of device (phone, tablet, or desktop) Streamlined design and reorganized search facets, making it easier for customers to search and browse for partner profiles and their solutions The OPN Solutions Catalog is a free marketing tool for all active Oracle PartnerNetwork members. If you are an OPN partner… take advantage of it! To learn more about the new catalog, watch the Solutions Catalog Training which includes best practices and a demo on how to update your profile. Spend a few minutes with our experts to learn how you can expand your market reach and showcase your offerings to our customers, partners, and Oracle employees worldwide.Questions? Visit the Solutions Catalog Resource page or contact the Partner Business Center.

    Read the article

  • CVE-2014-0591 Buffer Errors vulnerability in Bind

    - by Ritwik Ghoshal
    CVE DescriptionCVSSv2 Base ScoreComponentProduct and Resolution CVE-2014-0591 Buffer Errors vulnerability 2.6 Bind Solaris 10 Patches planned but not yet available Solaris 11.1 11.1.19.6.0 Solaris 8 Patches planned but not yet available Solaris 9 Patches planned but not yet available Please Note: The patches mentioned above will upgrade Bind to 9.6-ESV-R11. The fix for CVE-2014-0591 was initially distributed via 9.6-ESV-R10-P2 as described at our previous blog post. This notification describes vulnerabilities fixed in third-party components that are included in Oracle's product distributions.Information about vulnerabilities affecting Oracle products can be found on Oracle Critical Patch Updates and Security Alerts page.

    Read the article

  • CVE-2014-0591 Buffer Errors vulnerability in Bind

    - by Ritwik Ghoshal
    CVE DescriptionCVSSv2 Base ScoreComponentProduct and Resolution CVE-2014-0591 Buffer Errors vulnerability 2.6 Bind Solaris 10 SPARC: 119783-28 X86: 119784-28 Solaris 11.1 11.1.16.5.0 Solaris 9 SPARC: 112837-30 X86: 114265-29 Please Note: The patches mentioned above will upgrade Bind to 9.6-ESV-R10-P2. This notification describes vulnerabilities fixed in third-party components that are included in Oracle's product distributions.Information about vulnerabilities affecting Oracle products can be found on Oracle Critical Patch Updates and Security Alerts page.

    Read the article

  • Managing Scripts in Oracle SQL Developer

    - by thatjeffsmith
    You backup your databases, right? You backup you home computer – your media collection, tax documents, bank accounts, etc, right? You backup your handy-dandy SQL scripts, right? Ok, now that I’ve got your head nodding, I want to answer a question I get every so often: How can I manage my scripts in SQL Developer? This is an interesting question. First, it assumes that one SHOULD manage their scripts in their IDE. Now, what I think the question generally gets around to is, how can we: Navigate to our scripts Open them Execute them What a good IDE should have is an interface to your existing Version Control System (VCS.) SQL Developer supports out-of-the-box both Subversion and Git. You can also download an extension via check-for-updates to get support for CVS. Now, what I’m about to show you COULD be done without versioning and controlling your scripts – but I want to ask you why you wouldn’t want to do this? So, I’m going to proceed and assume that you do INDEED version your scripts already. Seeing what scripts you’ve already got in your repository This is very straightforward – just open the Team Versions panel. Then connect to your repository. Shows you the files in your source control system. Now, I could ‘preview’ said file right away. If I open the file from here, we get a temp file copy down from the server to the local machine. This is a local temp copy of the controlled script – I can read/execute, but not write to it. And that might be all you need. But, if your script calls other scripts, then you’re going to want to check out the server copy of your stuff down your local SVN working copy directory. That way when your script calls another script – you’re executing the PRODUCTION APPROVED copies of said scripts. And if you do SPOOL or other file I/O stuff, it will work as expected. To get to those said client copies of your scripts… Enter the Files Panel The Files panel is accessible from the View menu. You can get to your files, one of two ways. If you’ve touched the file recently, you can see it under the Recent tree. Otherwise, you can navigate to your local ‘checked out’ copies of your script(s). Open your local copies, see what’s changed, etc. And I can access the change history and see what’s been touched… What changes am I going to ‘push out’ if I commit this back to the server? Most of us work on teams, yes? This panel also gives me a heads up if someone else is making changes to the same file. I can see the ‘incoming’ changes as well. To Sum It Up… If I want to get a script to run: do a full get to your local directory open the script(s) The files panel will tell you if your local copy is out of date from the server and if you have made local changes you’ve forgotten to commit back up to the server and your fellow teammates. Now, if you’re the selfish type and don’t want to share, that’s fine. But you should still be backing up your scripts, and you can still use the Files panel to manage your scripts.

    Read the article

  • SQL Server 2012 Service Pack 2 is available - but there's a catch!

    - by AaronBertrand
    Service Pack 2 is available: http://www.microsoft.com/en-us/download/details.aspx?id=43340 The build number is 11.0.5058, and this includes fixes up to and including SQL Server 2012 SP1 CU #9. (The complete list of fixes is exhaustive, including all fixes from SP1 CU #1 -> #9, but the post-CU #9 fixes are listed here: http://support.microsoft.com/KB/2958429 However, if you may be affected by the regression bug I talked about earlier today , which could lead to data loss or corruption during online...(read more)

    Read the article

  • Data Modeling Resources

    - by Dejan Sarka
    You can find many different data modeling resources. It is impossible to list all of them. I selected only the most valuable ones for me, and, of course, the ones I contributed to. Books Chris J. Date: An Introduction to Database Systems – IMO a “must” to understand the relational model correctly. Terry Halpin, Tony Morgan: Information Modeling and Relational Databases – meet the object-role modeling leaders. Chris J. Date, Nikos Lorentzos and Hugh Darwen: Time and Relational Theory, Second Edition: Temporal Databases in the Relational Model and SQL – all theory needed to manage temporal data. Louis Davidson, Jessica M. Moss: Pro SQL Server 2012 Relational Database Design and Implementation – the best SQL Server focused data modeling book I know by two of my friends. Dejan Sarka, et al.: MCITP Self-Paced Training Kit (Exam 70-441): Designing Database Solutions by Using Microsoft® SQL Server™ 2005 – SQL Server 2005 data modeling training kit. Most of the text is still valid for SQL Server 2008, 2008 R2, 2012 and 2014. Itzik Ben-Gan, Lubor Kollar, Dejan Sarka, Steve Kass: Inside Microsoft SQL Server 2008 T-SQL Querying – Steve wrote a chapter with mathematical background, and I added a chapter with theoretical introduction to the relational model. Itzik Ben-Gan, Dejan Sarka, Roger Wolter, Greg Low, Ed Katibah, Isaac Kunen: Inside Microsoft SQL Server 2008 T-SQL Programming – I added three chapters with theoretical introduction and practical solutions for the user-defined data types, dynamic schema and temporal data. Dejan Sarka, Matija Lah, Grega Jerkic: Training Kit (Exam 70-463): Implementing a Data Warehouse with Microsoft SQL Server 2012 – my first two chapters are about data warehouse design and implementation. Courses Data Modeling Essentials – I wrote a 3-day course for SolidQ. If you are interested in this course, which I could also deliver in a shorter seminar way, you can contact your closes SolidQ subsidiary, or, of course, me directly on addresses [email protected] or [email protected]. This course could also complement the existing courseware portfolio of training providers, which are welcome to contact me as well. Logical and Physical Modeling for Analytical Applications – online course I wrote for Pluralsight. Working with Temporal data in SQL Server – my latest Pluralsight course, where besides theory and implementation I introduce many original ways how to optimize temporal queries. Forthcoming presentations SQL Bits 12, July 17th – 19th, Telford, UK – I have a full-day pre-conference seminar Advanced Data Modeling Topics there.

    Read the article

  • Maintaining Two Separate Software Versions From the Same Codebase in Version Control

    - by Joseph
    Let's say that I am writing two different versions of the same software/program/app/script and storing them under version control. The first version is a free "Basic" version, while the second is a paid "Premium" version that takes the codebase of the free version and expands upon it with a few extra value-added features. Any new patches, fixes, or features need to find their way into both versions. I am currently considering using master and develop branches for the main codebase (free version) along side master-premium and develop-premium branches for the paid version. When a change is made to the free version and merged to the master branch (after thorough testing on develop of course), it gets copied over to the develop-premium branch via the cherry-pick command for more testing and then merged into master-premium. Is this the best workflow to handle this situation? Are there any potential problems, caveats, or pitfalls to be aware of? Is there a better branching strategy than what I have already come up with? Your feedback is highly appreciated! P.S. This is for a PHP script stored in Git, but the answers should apply to any language or VCS.

    Read the article

  • How realistic is it to find remote jobs? [on hold]

    - by user3728220
    I just started teaching myself Python and so far I'm really enjoying it. One of my goals in life is to find a job that I can do remotely from anywhere in the world (that has reliable internet). I know that for some programming career paths this would be impossible to do, so I'm looking for comments or advice about the best way to achieve this. Whether there's certain types of companies or industries to look for, any particular languages that would be best-suited for this, anything else I should know, etc. Thanks!

    Read the article

  • Creating PHP Forms with show/hide functionality [migrated]

    - by ronquiq
    I want to create two reports and submit the report data to database by using two functions defined in a class: Here I have two buttons: "Create ES" and "Create RP". Rightnow, my forms are working fine, I can insert data successfully, but the problem was when I click on submit after filling the form data, the content is hiding and displays the fist div content "cs_content" and again I need to onclick to submit again. Could anyone give a solution for this. Requirement : When I click on "Create CS", I should be able to fill the form and submit data successfully with a message within "cs_content" and any form input errors, the errors should display within "cs_content". When I click on "Create RP", I should be able to fill the form and submit data successfully with a message within "rp_content" and any form input errors, the errors should display within "rp_content". home.php <?php require 'classes/class.report.php'; $report = new Report($db); ?> <html> <head> <script src="js/jqueryv1.10.2.js"></script> <script> $ (document).ready(function () { //$("#cs_content").show(); $('#cs').click(function () { $('#cs_content').fadeIn('slow'); $('#rp_content').hide(); }); $('#rp').click(function () { $('#rp_content').fadeIn('slow'); $('#cs_content').hide(); }); }); </script> </head> <body> <div class="container2"> <div style="margin:0px 0px;padding:3px 217px;overflow:hidden;"> <div id="cs" style="float:left;margin:0px 0px;padding:7px;"><input type="button" value="CREATE CS"></div> <div id="rp" style="float:left;margin:0px 0px;padding:7px;"><input type="button" value="CREATE RP"></div><br> </div> <div id="cs_content"> <?php $report->create_cs_report(); ?> </div> <div id="rp_content" style="display:none;"> <?php $report->create_rp_report(); ?> </div> </div> </body> </html> class.report.php <?php class Report { private $db; public function __construct($database){ $this->db = $database; } public function create_cs_report() { if (isset($_POST['create_es_report'])) { $report_name = htmlentities($_POST['report_name']); $from_address = htmlentities($_POST['from_address']); $subject = htmlentities($_POST['subject']); $reply_to = htmlentities($_POST['reply_to']); if (empty($_POST['report_name']) || empty($_POST['from_address']) || empty($_POST['subject']) || empty($_POST['reply_to'])) { $errors[] = '<span class="error">All fields are required.</span>'; } else { if (isset($_POST['report_name']) && empty($_POST['report_name'])) { $errors[] = '<span class="error">Report Name is required</span>'; } else if (!ctype_alnum($_POST['report_name'])) { $errors[] = '<span class="error">Report Name: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['from_address']) && empty($_POST['from_address'])) { $errors[] = '<span class="error">From address is required</span>'; } else if (filter_var($_POST['from_address'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid From address</span>'; } if (isset($_POST['subject']) && empty($_POST['subject'])) { $errors[] = '<span class="error">Subject is required</span>'; } else if (!ctype_alnum($_POST['subject'])) { $errors[] = '<span class="error">Subject: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['reply_to']) && empty($_POST['reply_to'])) { $errors[] = '<span class="error">Reply To is required</span>'; } else if (filter_var($_POST['reply_to'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid Reply-To address</span>'; } } if (empty($errors) === true) { $query = $this->db->prepare("INSERT INTO report(report_name, from_address, subject, reply_to) VALUES (?, ?, ?, ?) "); $query->bindValue(1, $report_name); $query->bindValue(2, $from_address); $query->bindValue(3, $subject); $query->bindValue(4, $reply_to); try { $query->execute(); } catch(PDOException $e) { die($e->getMessage()); } header('Location:home.php?success'); exit(); } } if (isset($_GET['success']) && empty($_GET['success'])) { header('Location:home.php'); echo '<span class="error">Report is succesfully created</span>'; } ?> <form action="" method="POST" accept-charset="UTF-8"> <div style="font-weight:bold;padding:17px 80px;text-decoration:underline;">Section A</div> <table class="create_report"> <tr><td><label>Report Name</label><span style="color:#A60000">*</span></td> <td><input type="text" name="report_name" required placeholder="Name of the report" value="<?php if(isset($_POST["report_name"])) echo $report_name; ?>" size="30" maxlength="30"> </td></tr> <tr><td><label>From</label><span style="color:#A60000">*</span></td> <td><input type="text" name="from_address" required placeholder="From address" value="<?php if(isset($_POST["from_address"])) echo $from_address; ?>" size="30"> </td></tr> <tr><td><label>Subject</label><span style="color:#A60000">*</span></td> <td><input type="text" name="subject" required placeholder="Subject" value="<?php if(isset($_POST["subject"])) echo $subject; ?>" size="30"> </td></tr> <tr><td><label>Reply To</label><span style="color:#A60000">*</span></td> <td><input type="text" name="reply_to" required placeholder="Reply address" value="<?php if(isset($_POST["reply_to"])) echo $reply_to; ?>" size="30"> </td></tr> <tr><td><input type="submit" value="create report" style="background:#8AC007;color:#080808;padding:6px;" name="create_es_report"></td></tr> </table> </form> <?php //IF THERE ARE ERRORS, THEY WOULD BE DISPLAY HERE if (empty($errors) === false) { echo '<div>' . implode('</p><p>', $errors) . '</div>'; } } public function create_rp_report() { if (isset($_POST['create_rp_report'])) { $report_name = htmlentities($_POST['report_name']); $to_address = htmlentities($_POST['to_address']); $subject = htmlentities($_POST['subject']); $reply_to = htmlentities($_POST['reply_to']); if (empty($_POST['report_name']) || empty($_POST['to_address']) || empty($_POST['subject']) || empty($_POST['reply_to'])) { $errors[] = '<span class="error">All fields are required.</span>'; } else { if (isset($_POST['report_name']) && empty($_POST['report_name'])) { $errors[] = '<span class="error">Report Name is required</span>'; } else if (!ctype_alnum($_POST['report_name'])) { $errors[] = '<span class="error">Report Name: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['to_address']) && empty($_POST['to_address'])) { $errors[] = '<span class="error">to address is required</span>'; } else if (filter_var($_POST['to_address'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid to address</span>'; } if (isset($_POST['subject']) && empty($_POST['subject'])) { $errors[] = '<span class="error">Subject is required</span>'; } else if (!ctype_alnum($_POST['subject'])) { $errors[] = '<span class="error">Subject: Whitespace is not allowed, only alphabets and numbers are required</span>'; } if (isset($_POST['reply_to']) && empty($_POST['reply_to'])) { $errors[] = '<span class="error">Reply To is required</span>'; } else if (filter_var($_POST['reply_to'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = '<span class="error">Please enter a valid Reply-To address</span>'; } } if (empty($errors) === true) { $query = $this->db->prepare("INSERT INTO report(report_name, to_address, subject, reply_to) VALUES (?, ?, ?, ?) "); $query->bindValue(1, $report_name); $query->bindValue(2, $to_address); $query->bindValue(3, $subject); $query->bindValue(4, $reply_to); try { $query->execute(); } catch(PDOException $e) { die($e->getMessage()); } header('Location:home.php?success'); exit(); } } if (isset($_GET['success']) && empty($_GET['success'])) { header('Location:home.php'); echo '<span class="error">Report is succesfully created</span>'; } ?> <form action="" method="POST" accept-charset="UTF-8"> <div style="font-weight:bold;padding:17px 80px;text-decoration:underline;">Section A</div> <table class="create_report"> <tr><td><label>Report Name</label><span style="color:#A60000">*</span></td> <td><input type="text" name="report_name" required placeholder="Name of the report" value="<?php if(isset($_POST["report_name"])) echo $report_name; ?>" size="30" maxlength="30"> </td></tr> <tr><td><label>to</label><span style="color:#A60000">*</span></td> <td><input type="text" name="to_address" required placeholder="to address" value="<?php if(isset($_POST["to_address"])) echo $to_address; ?>" size="30"> </td></tr> <tr><td><label>Subject</label><span style="color:#A60000">*</span></td> <td><input type="text" name="subject" required placeholder="Subject" value="<?php if(isset($_POST["subject"])) echo $subject; ?>" size="30"> </td></tr> <tr><td><label>Reply To</label><span style="color:#A60000">*</span></td> <td><input type="text" name="reply_to" required placeholder="Reply address" value="<?php if(isset($_POST["reply_to"])) echo $reply_to; ?>" size="30"> </td></tr> <tr><td><input type="submit" value="create report" style="background:#8AC007;color:#080808;padding:6px;" name="create_rp_report"></td></tr> </table> </form> <?php //IF THERE ARE ERRORS, THEY WOULD BE DISPLAY HERE if (empty($errors) === false) { echo '<div>' . implode('</p><p>', $errors) . '</div>'; } } }//Report CLASS ENDS

    Read the article

  • Modular Web App Network Architecture

    - by nairware
    Assuming that I am dealing with dedicated physical servers or VPSs, is it conceivable and does it make sense to have distinct servers setup with the following roles to host a web application? Reverse Proxy Web server Application server Database server Specific points of interest: I am confused how to even separate the web and application servers. My understanding was that such 3-tier architectures were feasible. It is unclear to me if the app server would reside directly between the web and database server, or if the web server could directly interact with the database as well. The app server could either do the computational heavy-lifting on behalf of the app server or it could do heavy-lifting plus control all of the business logic (as implied in the diagram above, thus denying the web server of direct database access). I am also unsure what role the reverse proxy (ex. nginx) could and should fulfill as a web server, given the above mentioned setup. I know that nginx has web server features. But I do not know if it makes sense to have the reverse proxy be its own VPS, given that the web server–in theory–would be separate from the app server.

    Read the article

  • What are pros and cons of native checkout for an ecommerce app (mobile)?

    - by Raj
    Looking at some of the ecommerce apps, I am guessing that some use native checkout process, and some use webviews. Would request the community to share some guidelines.. is there a security concern using native checkout ? Are Google Wallet and Paypal checkouts worth trying on native ? This is my first application which deals with money, and I am a little scared. I don't want to use in-app billing some reasons.

    Read the article

  • Is my work on a developers test being taken advantage of?

    - by CodeWarrior
    I am looking for a job and have applied to a number of positions. One of them responded, I had a pretty lengthy phone interview (perhaps an hour +) and they then set me up with the developers test. I was told that this test is estimated to take between 6 and 8 hours and that, provided it met with their approval, I could be paid for my work on it. That gave me some pause, but I endeavored. The dev test took place on a VM accessed via RDP. The task was to implement a search page in a web project that requests data from the server, displays it on the screen in a table, has a pretty complicated search filtering scheme (there are about 15 statuses and when sending the search to the server you can search by these statuses) in addition to the string/field search. They want some SVG icons to change color on certain data values, they want some data to be represented differently than how it is in the database, etc. Loooong story short, this took one heck of a lot longer than 6-8 hours. Much of it was due to the very poor VM that I was running on (Visual Studio 2013 took 10 minutes to load, and another 15 minutes to open the 3 GB ginormous solution). After completing, I was told to commit my changes to source control... Hmm, OK. I get an email back that they thought that the SVGs could have their color changed differently, they found a bug in this edge-case, there was an occasional problem with this other thing that I never experienced, etc. So I am 13-14 hours into this thing now and I have to do bug fixes. I do them, and they come back with some more. This is all apparently going into a production application. I noticed some anomalies in the code that was already in there where it looked like other people had coded all of one functionality and not anything else that I could find. Am I just being used for cheap labor? Even if they pay me the promised 50 dollars and hour for 6 hours, I have committed like 18 hours to this thing now. If I bug fix all of the stuff they keep coming up with, I will have worked at least 16 hours for free. I have taken a number of dev tests. I have never taken one where I worked on code that was destined for production. I have never taken one where I implemented a feature that was in the pipeline for development (it was planned for, and I implemented it through the course of the test). And I have never taken one that took 4 rounds and a total of 20+ hours. I get the impression that they are using their dev test to field some of the functionality, that they don't have time for in their normal team, on the cheap. Also, I wouldn't mind a 'devtest' tag.

    Read the article

  • What are the memory-management capabilities of MySQL + JDBC (in light of autonomic computing)?

    - by Adel
    I'm interested in implementing some kind of autonomic-computing functionality using MySQL. By autonomic-computing I mean roughly some failsafe abilities, whereby the application appears to be at least slightly "intelligent" For reference, the main parts of autonomic computing we'd like are the "self-configuring" and "self-healing" features (the other two - "self-optimizing" and "self-protecting", are too abstract/futuristic for us, at this time). Sofor example, if we have a sample Java application that utilizes a MySQL database, we might want to automatically restart the MySQL database if we take up too much memory. Or maybe we want to have the ability to dynamiccally adjust the database memory as needed. So for example, when we start the application the database begins with a 56 Megabyte buffer; but then as we insert so many rows we want to have it automatically jump up to 512 MB, then to 1024, until a max of 4096 MB. Does all of the above suggest that MySQL is too "weak" for the task? Do you suggest using Oracle database? My professor believes that by using Java we can basically make up for any memory-management deficiencies that MySQL has in relation to Oracle DB. I'm new to MySQL , but have experience with Oracle. If all of the above sounds wishy-washy, it is because I'm still fleshing it out. thanks

    Read the article

  • Who owns code if its written by one person with another person directing [on hold]

    - by user136226
    I have an Issue that I need some info on. Basically what Im looking to find out is if I create software,and someone else gives me direction on what they want the software to look like,e.g. an image here,this font of text and it must behave in a certain way. Also some of the code was not developed on my computer and there is no official agreement in place. Not looking to screw anyone over here but need to protect myself if things go sour. Do I own the software or is it jointly owned? Thanks

    Read the article

  • What's the proper way to merge two projects in source control software

    - by Mallow
    I'm using Fossil-SCM to maintain my projects. Since I don't work in a team I usually have just a very linear branch of development: 1.0 - 1.1 - 1.2 I'm wondering what the procedure is when you have one project who's task is about to be given to a related project. And thereby rendering the first project obsolete. Although I tend to rewrite most of my code if I don't remember having already written it, I still would like to keep the code archived. And I'ld rather not have a fossil repo that just is dead. Can I merge it? Is that the proper way of handling this? For example the code was extracting data from an excel file in order to format an HTML page. Now, I've convinced my employer to move their excel spreadsheet into a database to decrease redundancy, increase efficiency and yaddy yadda. Since I can now make logical queries that don't have to jump hoops to preform using the database I won't need the extra vbs files that originally manipulated the excel file. Technically I would be porting part of the existing code into the current new project. Since it already has it's own trunk, would it be advisable to combine the trunk of a different project to this one, and how would I do that exactly?? SO I guess my tree would look like this, and I haven't seen examples of software branching that resemble this inverted tree before so I'm wondering what the norm for a situation like this?

    Read the article

  • Keep user and user profile in different tables?

    - by Andrey
    I have seen in a couple of projects that developers prefer to keep essential user info in one table (email/login, password hash, screen name) and rest of the non essential user profile in another (creation date, country, etc). By non-essential I mean that this data is needed only occasionally. Obvious benefit is that if you are using ORM querying less fields is obviously good. But then you can have two entities mapped to same table and this will save you from querying stuff you don't need (while being more convenient). Does anybody know any other advantage of keeping these things in two tables?

    Read the article

  • Some problem about Compiz and GTK on Ubuntu 14.04

    - by LVHoanh
    I installed Ubuntu 14.04 on my computer : i3/4G/750G/VGA Intel HD3000 & 1GB NVidia with CUDA GT540M. I've some problems with Ubuntu 14.04 : Does Ubuntu 14.04 support Emerald Theme Manager? Emerald Theme Manager is not available in Ubuntu Software Center? I installed Compiz and Compiz Setting Manager, it works ok, but the Windows 3D plugin is not work? The Shutdown/Restart function on Right-Top Panel is not work, is there any solution for this problem? The mouse theme I installed only work in current session, next time i restart computer it change back to default mouse theme? How can i resize the spacing between Desktop Icon? Waiting for everyone respond. Thankyou so much. P/s : My English is not good, expect you understand. :)

    Read the article

  • Configuring network to set wlan0 as primary

    - by Sheed
    I recently had to rebuild my pc and decided to go for ubuntu 14.04. I think the mistake I made was I started from a 12.04 install disk instead of the 12.10 disk I'd used previously and when given the option set my primary connection as ethernet (because the wireless option didn't work). After upgrading to 14.04 etc, I managed to get the wireless working, or more using steps like ifconfig -a and the likes I managed to prove that the wireless card etc. is all installed and working. However every time I boot without a hard wired connection plugged in I get the message "waiting for network configuration". I can then once it's booted without a network get my wirless working using sudo ifconfig wlan0 up iwlist wlan0 scan This seems to kick the wireless module into life and it appears in the GUI and I can then select a network, however all the options like edit network and disconnect etc are all greyed out. What I would like of course is if the WLAN0 was just set as my primary default network so I've been looking for a solution to this and it would seem that I need to adjust the old /etc/network/interfaces file but when I try to do so using the sudo vi /etc/network/interfaces command I, well I simply have no idea what I'm doing. Other than that typing :q! gets me out of there before I do to much damage! As far as I can tell (by navigating to the file in the GUI) the output of my /etc/network/interfaces is as follows: (obviously not including the " in each line that's just to break the heading rule of the #) "# This file describes the network interfaces available on your system "# and how to activate them. For more information, see interfaces(5). "# The loopback network interface auto lo iface lo inet loopback "# The primary network interface auto eth0 iface eth0 inet dhcp If this is the case then this clearly doesn't contain what it should do but I don't how to fix it. Nor do I even know if I'm on the right track. Any help would be appreciated thanks :)

    Read the article

  • Moving from Windows 8.1 to Ubuntu - what can I do to replace OneDrive?

    - by gh0st_h4wk
    That's it - I got tired from the constant problems on and about Windows I'm having. Network issues, performance issues, compatibility issues... But I'll seriously miss OneDrive integration (all my files are there). There is some kind of app that can sync with it? And what is the easiest way to install JDK? Through PPAs? Note that I have no plans to keep Windows, I'll just replace the d*mn thing with Ubuntu (maybe Mint).

    Read the article

  • Why does my system use so much cache?

    - by Dave M G
    Previously, on my desktop computer running Ubuntu 14.04, I had 4GB RAM, which I thought should be plenty. However, after being on for a while, my computer would seem to get slow. I have a system resource monitor app in my Gnome panel, which I assume represents the available RAM (?). It shows a dark green area as being "Memory", and a light green area as "Cache". The "Cache" would slowly grow until it filled the whole graph, and then programs would get slow to load, or it would take a while to switch programs. I could alleviate the problem somewhat with this command, but eventually the computer cache fills up again, so it's only a bandaid: sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" So, I figured I'd get more RAM, so I replaced one 2GB stick with an 8GB stick, and now I have 10 GB ram. And my "cache" still slowly maxes out and my computer slows as a result. Also, sometimes the computer starts out with "cache" maxed when I first boot and log in. Not always though, I don't know if there's a pattern that determines why it happens. Why is Ubuntu using up so much cache? Is 10GB not enough for Ubuntu? Here's what my system monitor looks like in my Gnome panel. The middle square shows RAM usage. The light green area is the "cache": This is my memory and swap history, which doesn't seem to include any information about "cache". I realize at this point I'm not totally clear on the difference between "cache" and "swap":

    Read the article

  • Which Linux OS should I use?

    - by dylan0005
    I have use Ubuntu 10.04 & 12.04 but my problem is disk space, I just have 4GB of HDD! awesome considering all hardware that exists nowadays! Notebook Asus eeePC 900 with 2Gb of ram, intel inside CPU. So, which is the best OS should I use? I need one that have no problems with compatibily also that's not be so old. I've tried some of lightly versions like Puppy, slax, LPS us army OS, Precise.... BUT I don't like any of them. What do you think about Debian or Linux Mint?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >