Add multiple folder in FTPSync ignore - sublimetext2

My folder structure is
Project
|
+--cache
|
+--class
|
+--plugins
|
+--server
I can add a single folder in ignore by \\\\cache\\\\. But how can I add multiple folders like class and server in ignore?

Related

How to create a page for database entries in a html page

At the moment I have this database:
|---------------------|------------------|
| Project | Task |
|---------------------|------------------|
| id | id |
|---------------------|------------------|
| project_name | task_name |
|---------------------|------------------|
| project_id(FK) |
|------------------|
The supplies table, has a list for (name of the item or task) (id) and the project it is assigned to via a foreign key.
I have a simple post HTML form that lets users fill it out, and that in turn updates the database
Now I'm looking to add a sort of "output" that lets me create hyperlinks (or small pages) to each project, so that users can have the option to delete the project/add new tasks into it and so on
The only part I'm struggling on is figuring out how to create a seperate type page, I have tried using this
while($row = mysqli_fetch_assos($result)) {
echo "<li>" . "<a href=clientportal.php?project_id={$row['id']}'>
{$row['name']}</a>" . "</li>";
}
But this creates a HTTP 500 error, which I assume is because I used post and not get in my form.
Is there another way to do what I am looking for? or should I go back to my form and change it to a get method
Ideally I'm looking for a simple list of current projects, with hyperlinks, that take me to a page where I can add some php/sql code to output a few simple SQL query options as mentioned, such as deleting the project, adding a new task etc.
Thank you!

Maintaing test users in cucumber steps

In my tests I have to work with different types of users and environments. At the moment I am manually updating the users since we don't have many features. However we will be adding many new features that will make it very difficult to update all files manually. Most of these are needed in the Given step. Example:
Scenario:
Given I am signed in as "user1#example.com"
I would like to change this to:
Scenario
Given I am signed in as "user1"
"user1" could stored in a csv file or in a db. Can either of these be done? If so which is the recommended method?
The CSV file would have something like:
user1,user1#example.com
user2,user2#example.com
user3,user3#example.com
A table in a db:
| id | user | email |
| 1 | user1 | user1#example.com |
| 2 | user2 | user2#example.com |
Seems using the db might be easier to maintain if it can be done. As always your help is appreciated.
The usual way to abstract test case details in Cucumber is through the use of "Scenario Outlines":
https://github.com/cucumber/cucumber/wiki/Scenario-Outlines
Using a Scenario Outline is equivalent to storing test case data in a CSV file, but it has the advantage of keeping the test case info right there in the .feature file.
If you follow this convention, all parts of the test workflow can be edited in the same place - this actually makes maintenance of the test cases easier than if the test outline and the individual test cases are segregated into separate text files (or segregated between a .feature file and a database instance).

Creating / Appending a Flat File Destination based on date.

The Backstory:
I have a process that loads physician demographic data into our system. This data can come in at any time and at any interval between updates. The data is what we call "Term-by-Exclusion", meaning that the source file takes precedence, and any physician record in the db that is not in the source file is marked as "Termed" or Inactive.
The Problem:
I need to be able to output the data from the source data, into a flat file destination as a daily report to a companion COBOL system. The source data is loaded into an ETL.PhysicianLoad table prior to processing and the ETL table is wiped prior to each new processing transaction, so retaining a full days' records is not possible as it stands now, without the output file.
Example: ProcessOutput_10152013.txt
The output file ideally needs to be a comprehensive of the entire days' processing. Meaning I want to continuously append to that days' file until the end of that day, then email a notification stating the file is ready for pickup. Any data that comes in after the turn of the day should then be placed in newly created file.
Output should look like this (no headers)
BatchID | LastName | FirstName | MiddleInitial | Date
0001 | Smith | John | A | 10/15/13
0001 | Smith | Sue | R | 10/15/13
0001 | Zeller | Frank | L | 10/15/13
0002 | Peters | Paula | D | 10/15/13
0002 | Rivers | Patrick | E | 10/15/13
0002 | Waters | Oliver | G | 10/15/13
What I am thinking:
I am thinking about using a CurrentDate Variable that will hold the current date comparing it to an expression based variable called FileName which will concatenate the current mmddyyyy to "ProcessOutput_.txt". My thinking is that I should be able to locate a file with that name in the destination folder and if it exists, I should be able to write to it. Otherwise I will have to create a new file. I can then set my Flat File Destination via expression to the FileName Variable.
Can anyone see a better way of doing this or any issues that may arise from this solution I am not seeing?
My thought process was in the right place, but flawed.
Here is how I solved the problem.
After trying to build my control/data flows using the logic in the original question, I discovered that I was working myself into a corner.
So that got me thinking again, how can I do this the easiest possible way
First, do I have the correct Variables defined? No..
CurrentDate - has to be there to define the date portion of the file name.
FileName - has to be present for obvious reasons.
So what did I miss?
FileExists (Type: boolean) - Something that will identify the existence of the file.
PlaceholderFile (Type: String) - Generic FileName Variable
Now what to do with it?
Add a VB Script Task to the control flow, that sets the FileExists flag.
'Check to see if ProspectivePhysician_<currentdate>.txt exists.
Dts.Variables("User::FileExists").Value = File.Exists(Dts.Variables("User::FileName").Value.ToString)
Now that we have the existence of the destination file defined, create the data flow object from the source table. Checking the FileExists Variable in a conditional split. Seperating the data flow into two branches. Create two Flat File Destinations called "Existing" and "New", setting them both to the same flat file location for the time being.
If you attempt to run the package at this point, you will receive Validation Errors from one of the two destinations, as the first is holding ownership of the file and will not allow the second to validate the file.
How to fix this...Use Expressions to swap the actual FileName value back and forth.
For the Existing Flat File Connection String Value, use the following Expression:
#[User::FileExists] == True ? #[User::FileName] : #[User::PlaceholderFile]
For the New Flat File Connection String value, use the following Expression:
#[User::FileExists] == True ? #[User::PlaceholderFile] : #[User::FileName]
Finally, Right click on each of the Flat File Destination Objects in the Data Flow and set the Overwrite property to True on the New Flat File Destination, and False on the Existing Destination. This will assure that the Append action is used on the existing file.

What is the best way to transform data read from the database (recordset) to HTML using templates

I have some data in a database which i need to use to generate an HTML file.
The format of the HTML file will always be the same, i.e. it will always look something like this
-----------------------------------------
|
[Header] |
- Advertising banner |
|
[Body] |
|
---------------------------------- |
Content column | content column | |
Content column | content column | |
Content column | content column | |
---------------------------------- |
Content column | content column | |
Content column | content column | |
---------------------------------- |
|
[Footer] |
|
- Copyright information etc |
|
-----------------------------------------
The data i will be reading from the database table will be read using JDBC. I know i can generate the HTML file by manually coding the HTML source with the tags but im sure this is not the correct way of doing it.
Is there some sort of templating mechanism where i have a template for the HTML file which could probably have placeholders for the content sections which i can then update at run time after i have read the content from the database.
I thought that XSLT was specifically created for this purpose but looking at Google it looks like XSLT is for transorming XML to other formats which is not what i want. I could probably convert the data i read from the database into XML and use XSLT but this seems like an additional unessary layer of processing.
What is the usual/common way of approaching this kind of problem?
I would prefer to use Spring/Maven but open to other suggestions.
Thanks
Edit
Also, please note that the HTML file that is generated is not for displaying on the browser/web. It is displayed in an Email. A new HTML file will be generated everyday.
My suggestion would be to use XSLT - many DB can already produce results as XML, or you can write easily code to convert your SQL query results in simple XML:
<table>
<row>
<firstColumn>...</firstColumn>
<secondColumn>...</secondColumn>
. . .
<row>
. . .
</table>
Once you have this XML using XSLT you can generate any HTML - or many other formats - in a way that is standard, well-supported and very very flexible.

Hard-coding URLs vs Nested Set vs Combo in Content System

I've been putting together a database to handle content produced for a site, however, thinking about the long-term, I'm unsure if I have the best system.
At present I'm using the routing method of passing everything via index.php which .htaccess routes as follows index.php?route=example/url (user sees http://www.domain.com/example/url)
At present the database is setup like below:
uid | title | content | category
--------------------------------------------------
/ | Home | aaa | 1
/example | Example | bbb | 2
/example/url | Example: URL | ccc | 2
Though I am not sure if this is the best approach, especially if I wanted to rename example to something - I'd have to rename each URL...
So I've also thought about the Nested Set method (such as http://www.phpclasses.org/package/2547-PHP-Manipulate-database-records-in-hierarchical-trees.html) though this would just show lots of different numbers in the database where I could access everything by it's node. Example below;
node | left | right | name
--------------------------
1 | 1 | 6 | Home
2 | 2 | 5 | Example
3 | 3 | 4 | URL
Then I could use the node as the uid? But I'm unsure how I could translate http://www.domain.com/example/url to the uid equalling 3...
I already do have a category column in my database at the moment, to categorise the content, though I could potentially alter this.
I'm basically looking for suggestions about how to proceed, because as the site gets more content it will be harder to change the setup - so I want to ideally get this right from day one.
Which of the two is better for scalability?
If the second, how to translate the URL to the node?
Could I somehow combine both so that the original database stores the uid as the node number, then do a join of some sort to make the uid be a url (as in 1) - then ]
^ I think I'd prefer this (the third), but unsure how to do in MySQL exactly, with some other benefits:
I could replace my category system with the parent node - which may be better
I could also then in theory store the node ID within a stats system, rather than a URL
If anyone can give some help/suggestions - I'd be grateful!
Well, if you use index.php?route=example/url, you could always do something like this:
$args = explode( '/', $_GET['route'] );
$args = filter_var_array( $_GET['route'], FILTER_SANITIZE_STRING );
Then your values of $args would be:
0 -> example
1 -> url
etc. You could then use these values to determine what template to load, and what content to grab from the database, or whatever else you're doing already.
HTH.
The nested set model probably is a good choice here. That'd result in a table layout like (id,left,right are the fields required by the nested set model, the others contain the respective content):
| id | left | right | uid | title | content | category |
More details on how to perform a particular query can be found here.
However I would not perform the look up on the database but a simple array cache:
new array('/' => array('content' => 'aaa', 'category' => 'bbbb'),
'/example/' => array(),
.....
);
This cache can be build up very easy (though expensive) and queried very easy.
On a side note: i suspect you're trying to model page content here. Maybe you should refactor you database structure then as this table would have two responsibilities (url->content mapping and content).