Showing posts with label Tutorials. Show all posts
Showing posts with label Tutorials. Show all posts

DNN Navigate to Specific Page

0

Posted in , ,

To redirect user to a certain page you can use the NavigateURL() Function of the DNN.

To use:


Enjoy!

^_^

Read More

Dynamic PageTitle in ASP.NET

0

Posted in , ,

Recently I came across an issue while developing ASP.NET web application. I want the .aspx page titles to change whenever I browse a certain page on my website. After some research I was able to do this by setting the 'title' as a server control by adding runat="server" inside the tag and utilize the following in your code-behind file:


Protected pageTitle As System.Web.UI.HtmlControls.HtmlGenericControl
'VB
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

pageTitle.InnerText = "Title"

End Sub


If you are using a Masterpage:

use instead Page.Header.Title

Cheers

Read More

SQL SubSelect

0

Posted in ,

I came across this examples online when I am looking for a solution in selecting data from database that starts with numbers only.

SQL Subselect

SQL Subselect Example One

Q: What Harrison Ford movies were made in 1984?

Select Film_Title
From Thespian_Film_Table
Where Thespian_Last_Name = "Ford"
and Thespian_First_Name = "Harrison"
and Film_Title in
(Select Film_Title
From Film_Table
Where Film_Year equals "1984");

Indiana Jones and the Temple of Doom
Note: The first select gets all Harrison Ford movies. The second select gets all movies made in 1984. Combined the selects get all Harrison Ford movies made in 1984.

SQL Subselect Example Two - Not In

Q: What Harrison Ford movies were not made in 1984?

Select Film_Title
From Thespian_Film_Table
Where Thespian_Last_Name = "Ford"
and Thespian_First_Name = "Harrison"
and Film_Title not in
(Select Film_Title
From Film_Table
Where Film_Year equals "1984");


Air Force One
American Graffiti
Apocalypse Now
Blade Runner
Clear and Present Danger
Frantic
Hanover Street
Heroes
Indiana Jones and the Last Crusade
Patriot Games
Presumed Innocent
Raiders of the Lost Ark
Regarding Henry
Return of the Jedi
Six Days Seven Nights
Star Wars
The Empire Strikes Back
The Frisco Kid
The Fugitive
The Mosquito Coast
Working Girl

Note: The first select gets all Harrison Ford movies. The second select gets all movies made in 1984. Combined with a not the selects get all Harrison Ford movies not made in 1984.

SQL Subselect Example Three - A Correlated Subquery

Q: What movies has Harrison Ford acted in with George Lucas directing?

Select Thespian_Film_Table.Film_Title
From Thespian_Film_Table
Where Thespian_Last_Name = "Ford"
and Thespian_First_Name = "Harrison"
and exists
(Select *
From Director_Film_Table
Where Director_Last_Name = "Lucas"
and Director_First_Name = "George"
and Director_Film_Table.Film_Title
= Thespian_Film_Table.Film_Title);

American Graffiti
Star Wars
Note: A correlated subquery directly ties the table nested in the subquery back to a table in the query.
The first select gets all Harrison Ford movies. The second select gets all Harrison Ford movies Directed by George Lucas. The statement "and Director_Film_Table.Film_Title = Thespian_Film_Table.Film_Title" in the subselect is where both tables are "tied together" or correlated.
Read More

Downloading Subtitles Using MPC (Media Player Classic)

0

Posted in , ,

MPC means Media Player Classic (download), it is a little old - latest release is dated to 2006-03-20, but that means nothing. It is still one of the best software players floating around. I will show you in this guide how to download perfectly matched subtitles without opening any website using OpenSubtitles.org ISDb protocol.

At the start of deciding which hash should be used for matching subtitles with movies, I checked, if there is no hash algo for this. I found in MPC, it supports downloading subtitles from website, so I contacted Gabest - coder of MPC. We changed some mails, he gave me access to download database, and I came to conclusion - OS should use this special hash - not the best one - but there were already some thousands of hashes submitted. Currently opensubtitles.org have more than 94.000 hashes.

Problem with MPC is, no subtitle database currently exists, so no one can use its unique features. I grabbed some MPC source codes, and programmed ISDb support. Let’s see how it works, it is really simple, and if you will setup MPC, you will (almost) never use “normal” searching anymore.

Step 1: Open MPC, press “O” - you will get options window

Step 2: Find Playback -> Output, change settings to VMR9 (renderless) or VMR7 (renderless) - if you will not change this, Download will be disabled!

Step 3: In options window set in Subtitles -> Database: “www.opensubtitles.org/isdb”, you can test it if you want

Step 4: Open some movie (drag and drop, CTRL+O), and click File-> Subtitle Database -> Download

Step 5: Select some subtitle in your language, click to Download & Open

Congratulations - you are watching movie with subtitles!

If no subtitles are available - don’t panic, go to File -> Subtitle Database -> Search - browser will open and maybe it finds something :) If this step fails too, you have to search those subtitles manually - if they exists on website it means they are not connected with your movie, so it should be nice, if you upload them again.

Maybe you ask how this works - basically it is simple - every movie is connected to subtitle using special hashes (not filenames!). You can help other people, if you will upload subtitles with movie hashes, so other will be able to download them “in fast way”. For the moment it is not possible (and maybe I will never allow this, because I’m afraid there will be many mistakes in uploads) upload subtitles using MPC. For uploading - and for other cool things - you have to use OSCAR or SubDownloader.

Source: http://blog.opensubtitles.org/opensubtitlesorg/downloading-subtitles-using-mpc

Read More