How do I reorder the jobs on my Hudson dashboard? - hudson

I have a number of jobs on my Hudson dashboard. But they aren't in the order that I'd like them to be -- they are all jumbled relative to the order that they run and that I'd like to see them. They appear to be in alphabetical order by default, but I don't want that.
How can I reorder them to my liking? I don't want to have to force the issue by giving them numbers, letters at the start, etc.

I don't think you can. Hudson just sorts jobs based on their names.
You can create your own views, though, and use them to group your jobs. These views, however, are listed in alphabetical order, too.

You can click on the column headers and sort by Status, Last Failure, etc.
It's not a great solution though, since that preference isn't persisted anywhere and there is no URL you can use to automatically get it.

Related

Change sorting order arrow in SSRS from ascending to descending

I have Interactive sorting on each column in my report, but when i want to sort (first click on the sort arrow) i get by default ascending sorting. How can i change this so when i click interactive sorting to get by default descending order on all my columns.
For now i have just added interactive sorting on each column but by default sorting is ascending.
Somehow i think this can be changed in rs config , but i don't know how.
I've actually found multiple solutions that could be helpful, so I'll go ahead and submit as an answer and hopefully one of my suggestions will solve your issue.
As I mentioned in the comments, it is possible to sort the data on report generation if that is a suitable option for your report. To do this, select the column that you wish to sort in descending order, right click to open the "Tablix Properties", switch to the "Sorting" tab, add the field that you want sorted, and switch the sort order to "Z-A". This will sort the report initially in descending order.
If you prefer to leave the report sorted until a click on the interactive sorting, the simple solution to this is to change the expression for the interactive sort to =Fields!Month.Value * -1. This will simply reverse the order that it sorts by, though the arrows do not change. Additionally, I should note -- this only works on numeric fields. You'll receive an error if attempting this with any text fields.
I found a segment of a book on advanced SSRS techniques that may be useful... or may not. It looks like the SSRS report renders as HTML and generates an onclick event. The default image that is rendered is called unsorted.gif and changes to sortAsc.gif or sortDesc.gif. It may be possible to insert some custom HTML that would sort correctly? I'm not sure if the tags included are supported within SSRS, but it's potentially useful for your purposes.
Right click the row group month, select group properties, select sorting, click on order and select Z to A.
When report is first run it will be in descending order with available interactive sorting.

Insert a separator into a dropdown list in SSRS

I have a report that pulls information on tools. I have a multi-value parameter setup in SSRS that pulls a tool name and GUID and then passes the GUIDs to a stored proc for results.
The tools have in addition to name and GUID a value of active. I want to display a list of tools with active items first, then inactive. Easy enough that's just an order, however I'd like to put a visual separator between active and inactive tools. I can achieve this by creating an order value based on active status, and then using union to attach a dummy line between them.
However this means its possible to select the separator line. I can handle that line in my stored procedure so it doesn't cause a problem, but I'd like to make that line unselectable or to have a separator similar to what you see in a dropdown menu.
Does anyone know of any functionality that will achieve this?
I main project is currently help in 2008R2, but I may be able to upgrade if there is a good solution to this.
Many thanks in advance.
OK - have found there seems to be no way of showing a separator as such short of coding in a separator line in the data set. Final solution was close to my original plan. I now download two datasets, one of all tools (Active, separator, inactive) and attach this to my available values, and one of active only, which I then attach to my default values.
This means that both are available, but default is active only. Not a solution to the exact question, but best that I could come up with and is close enough to fit for purpose.
If anyone does come across better solutions, I'd love to here them.

Find('first'), Find('count'), or Field('id')...Which is faster?

What is better in terms of speed…
I am trying to determine whether or not a user has added a certain URL to their list of shortcuts. If they have added the URL there will be a link on the page to remove the page from the shortcuts otherwise they can add it to their shortcuts for quick access via a dropdown menu. Unfortunately I need to make this check at every page load so the code is in my AppController. I would like to do whatever I can to speed this up. I don't want this cached.
Would it be faster to do a find('first') while limiting the "fields" to just “id”, a find('count'), or a field('id') where the conditions of either statement would be 'URL' => $this->here. Only 1 or 0 results should be returned.
Assuming your table is indexed correctly you will likely not see a difference. Per #mark's comment, use whichever one suites your needs.
The logic of which one to use should be your main concern.
If you're only trying to see IF there is one, then using field makes the most sense, since it's limit 1 and only returns a single field.
If you want to know how many there are, then you'll need count.
And if you want to know IF there is one, and retrieve it's data, then first or exists is the way to go.

Extract Distinct Record in SSIS

I am writing the SSIS package to import the data from *.csv files to the SQL 2008 DB. The problem is that one of the file contains the duplicate records in the csv file and I want to extract only the distinct values from that source. Please see the image below.
Unfortunately, the generated files are not under my control and it is owned by the third party and I could not change the way they generated.
I did use the LookUp Component. But it only checks the existing data against the incoming data. It does not check the duplicate records in the incoming data.
I believe the sort component gives an option to remove duplicate rows.
Depends on how serious you want to get about the duplicates. Do you need a record of what was duplicated or is it enough to just get rid of them? Sort component will get rid of dups on the sort field. However, the dups may have different data in the other fields and then you want a differnt strategy. Usually I load all to staging tables and clean up from there. I send the dupes removed to an exception table (we have to answer a lot of questions from our customers about why things don't match what they sent) and I often use a set of business rules (and use either an execute SQl or data flow tasks to enforce the rules) to determine which one to pick if there are duplicates in one area but not another (say two business addresses when we can only store 1). I also make sure the client is aware of how we determine which of the two to pick.
Use SORT tool for that from Toolbox, then click on it. You will get all available input columns.
Check the column and change sortType direction and then check "remove rows with duplicate sort value".
Bring in the data from the csv file the way it is, then dedup it after it's loaded.
It'll be easier to debug, too.
I used Aggregate Component and Group By both QualificationID and UnitID. If you want, you can also use Sort Component too. Perhaps, my information might help others.

Save and get arbitrary sort order in SQL Server

My client wants to sort products by drag & drop. The drag & drop part is easy with javascript.
My problem is how do I save and get the sort order?
I'm using .net c# and SQL Server 2008.
When I move a product and drop it in a new position I get the id of the product that's moved, product in front and product behind. With this data I want to update the sort order of products.
I was thinking of adding a field with position, but then I guess I have to update every item when position changes.
In general adding an additional position field is the only thing you can do, to get truly arbitrary ordering.
But you can implement it in several ways. Here are two ways I've implemented myself some time ago.
1. Method: Update all position values, by looping over your items and performing an UPDATE statement for every position.
This is easy to implement, but because of the many updates, it's not good for many items and/or large tables. Especially if you do it via Ajax and perform a complete re-ordering on every change in the list.
2. Method: Do a smart update of only the affected rows.
SELECT all items in the current sort order (The "old list") (Usually fast compared to an UPDATE statement)
Iterate over all items from the "new list" and compare each item to the item from the old list at the same position/index. If the items are the same, don't do anything
If the items are different find that item from the old list, which should actually be at that position and update its position value accordingly (Some lookup data structure might be useful here)
That way you only have to perform minimal database updates, but you'll have more complex code.
Personally I'd go with the first way, until the database updates actually become a performance problem.
We have a sort column but yes we have to re-index all rows as things change. You could mitigate this by assigning sort's in large enough increments to allow some level of movability before you have to do this, such as in 10's or 100's but that's not the best solution and I'd be interested to see what other ideas people have.
If you can capture each move programatically (with up and down buttons for example) then you can just swap the position numbers of the row moving and the row being moved. Make sure that you add new rows at the max position + 1.