Hi all,
If I have .flv files on my server at some location like http://www.example.com/archive/test.flv. In HTML page how can I tell the browser to use Flash player to play this video like youtube videos are played.
Can someone tell me how to do this?
Regards,
Microkernel
PS: I am noober than noob in web dev, so please give some code snippet or answers that beginners like me can understand. Thank you
I was wondering if anyone has come up with an ASP.net server tag for the HTML5 canvas? I was thinking of something where I could declaritively define paths, curves; etc in the aspx markup, and the control would deliver the js to do this (perhaps with support for browser detection, and delivery of an emulation script for IE browsers.)
Maybe a good idea for a Codeplex project for me to start up?
UPDATE
I tried using the internal wordpress rewrite. What I have to do is an address like this:
http://example.com/galleria/artist-name
sent to the gallery.php page with a variable containing the artist-name.
I used these rules as per Wordpress' documentation:
// REWRITE RULES (per gallery) {{{
add_filter('rewrite_rules_array','wp_insertMyRewriteRules');
add_filter('query_vars','wp_insertMyRewriteQueryVars');
add_filter('init','flushRules');
// Remember to flush_rules() when adding rules
function flushRules(){
global $wp_rewrite;
$wp_rewrite->flush_rules();
}
// Adding a new rule
function wp_insertMyRewriteRules($rules)
{
$newrules = array();
$newrules['(galleria)/(.*)$'] = 'index.php?pagename=gallery&galleryname=$matches[2]';
return $newrules + $rules;
}
// Adding the id var so that WP recognizes it
function wp_insertMyRewriteQueryVars($vars)
{
array_push($vars, 'galleryname');
return $vars;
}
what's weird now is that on my local wordpress test install, that works fine: the gallery page is called and the galleryname variable is passed. On the real site, on the other hand, the initial URL is accepted (as in it doesn't go into a 404) BUT it changes to http://example.com/gallery (I mean it actually changes in the browser's address bar) and the variable is not defined in gallery.php.
Any idea what could possibly cause this different behavior?
Alternatively, any other way I couldn't think of which could achieve the same effect described in the first three lines is perfectly fine.
Old question
What I need to do is rewriting this address:
(1) http://localhost/wordpress/fake/text-value
to
(2) http://localhost/wordpress/gallery?somevar=text-value
Notes:
the remapping must be transparent: the user always has to see address (1)
gallery is a permalink to a wordpress page, not a real address
I basically need to rewrite the address first (to modify it) and then feed it back to mod rewrite again (to let wordpress parse it its own way).
Problems
if I simply do
RewriteRule ^fake$ http://localhost/wordpress/gallery [L]
it works but the address in the browser changes, which is no good, if I do
RewriteRule ^fake$ /wordpress/gallery [L]
I get a 404. I tried different flags instead of [L] but to no avail. How can I get this to work?
EDIT: full .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^fake$ /wordpress/gallery [R]
RewriteBase /wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
I am trying to generate tree with fasta file input and Alignment with MuscleCommandline
import sys,os, subprocess
from Bio import AlignIO
from Bio.Align.Applications import MuscleCommandline
cline = MuscleCommandline(input="c:\Python26\opuntia.fasta")
child= subprocess.Popen(str(cline),
stdout = subprocess.PIPE,
stderr=subprocess.PIPE,
shell=(sys.platform!="win32"))
align=AlignIO.read(child.stdout,"fasta")
outfile=open('c:\Python26\opuntia.phy','w')
AlignIO.write([align],outfile,'phylip')
outfile.close()
I always encounter with these problems
Traceback (most recent call last):
File "", line 244, in run_nodebug
File "C:\Python26\muscleIO.py", line 11, in
align=AlignIO.read(child.stdout,"fasta")
File "C:\Python26\Lib\site-packages\Bio\AlignIO_init_.py", line 423, in read
raise ValueError("No records found in handle")
ValueError: No records found in handle
I follow this tutorial here to create RESTful web service on Netbean 6.8. However, when I right click on the project node and select Test RESTful Web Service, the browser pop up, and supposedly my project would be listed on the left, and supposedly I would be able to select it, and test against various function that listed on the right. However, I dont see any of that. Any idea why?
Hi,
I would like to open a webpage and run a javascript function from within a java app.
For example I would like to open the page www.mytestpage.com and run the following javascript code:document.getElementById("txtEmail").value="[email protected]";submit();void(0);
This works in a browser...how can I do it programatically?
Thanks!
I try to play with sockets a bit. For that I wrote very simple "client" and "server" applications.
Client:
import java.net.*;
public class client {
public static void main(String[] args) throws Exception {
InetAddress localhost = InetAddress.getLocalHost();
System.out.println("before");
Socket clientSideSocket = null;
try {
clientSideSocket = new Socket(localhost,12345,localhost,54321);
} catch (ConnectException e) {
System.out.println("Connection Refused");
}
System.out.println("after");
if (clientSideSocket != null) {
clientSideSocket.close();
}
}
}
Server:
import java.net.*;
public class server {
public static void main(String[] args) throws Exception {
ServerSocket listener = new ServerSocket(12345);
while (true) {
Socket serverSideSocket = listener.accept();
System.out.println("A client-request is accepted.");
}
}
}
And I found a behavior that I cannot explain:
I start a server, than I start a client. Connection is successfully established (client stops running and server is running). Then I close the server and start it again in a second. After that I start a client and it writes "Connection Refused". It seems to me that the server "remember" the old connection and does not want to open the second connection twice. But I do not understand how it is possible. Because I killed the previous server and started a new one!
I do not start the server immediately after the previous one was killed (I wait like 20 seconds). In this case the server "forget" the socket from the previous server and accepts the request from the client.
I start the server and then I start the client. Connection is established (server writes: "A client-request is accepted"). Then I wait a minute and start the client again. And server (which was running the whole time) accept the request again! Why? The server should not accept the request from the same client-IP and client-port but it does!
Guys, I have a basic WPF application. Contains App.xaml as always and a Mainwindows.xaml.
I've created also some pages like page1/2/3. I want to load for example page1.xaml in mainwindows.xaml. Is this possible? And also want to close it so the content of mainwindow.xaml will stay in there.
I dont want this to be a navigation application with the left/right arrpws at the top.
Hi,
In one of my application I'm using the WebClient class to download files from a web server. Depending on the web server sometimes the application download millions of documents. It seems to be when there are lot of documents, performance vise the WebClient doesn't scale up well.
Also it seems to be the WebClient doesn't immediately close the connection it opened for the WebServer even after it successfully download the particular document.
I would like to know what other alternatives I have.
Thanks,
Shamika
I am trying to read in a pgm file (512x512 array) and when I read in a larger file I get the error: java.util.NoSuchElementException on reading element (3,97).
I have created a much smaller file to read (23x23) and it reads fine. Is there a size limit? I have checked the file and confirmed that there is an int for the value:
This appears to be the line it crashes at:
fileArray[row][col] = scan.nextInt();
Here is the file:
import java.util.Scanner;
import java.io.*;
public class FileReader
{
public static void main(String[] args) throws IOException
{
String fileName = "lena.pgma";
int width, height, maxValue;
FileInputStream fileInputStream = null;
fileInputStream = new FileInputStream(fileName);
Scanner scan = new Scanner(fileInputStream);
// Discard the magic number
scan.nextLine();
// Discard the comment line
scan.nextLine();
// Read pic width, height and max value
width = scan.nextInt();
System.out.println("Width: " + width);
height = scan.nextInt();
System.out.println("Heigth: " + height);
maxValue = scan.nextInt();
fileInputStream.close();
// Now parse the file as binary data
FileInputStream fin = new FileInputStream(fileName);
DataInputStream dis = new DataInputStream(fin);
// look for 4 lines (i.e.: the header) and discard them
int numnewlines = 4;
while (numnewlines > 0) {
char c;
do {
c = (char)(dis.readUnsignedByte());
} while (c != '\n');
numnewlines--;
}
// read the image data
int[][] fileArray = new int[height][width];
for (int row = 0; row < height; row++) {
for (int col = 0; col < width; col++) {
fileArray[row][col] = scan.nextInt();
System.out.print("(" + row + " ," + col +"): " + fileArray[row][col]+ " ");
}
System.out.println();
}
dis.close();
}
}
any advise would be appreciated.
Is there a way to allow a user, after he has created a vector graph on a javascript svg canvas using a browser, to download this file to their local filesystem?
SVG is a total new field for me so please be patient if my wording is not accurate.
kind regards,
Jeroen.
I'm trying to get YUIs DataTable to work using Inline Cell Editing that can Auto Complete.
In this thread:
http://yuilibrary.com/projects/yui2/ticket/2528064
Somebody provides a non-working solution, that seems close.
Has anybody tried to get this to work?
I am looking for ways to store data in a windows form application in C#.
I want to make the input data of a system persistent, so when I close my program and open it again, the data is retrieved.
Which ways are of doing this besides creating a linked database?
Examples are gladly appreciated
regards
I see something strange like:
http://github.com/zoul/Finch.git
Now I'm not that CVS / SVN / etc. dude. When I open that in the browser it tells me that I did something wrong. So I bet I need some hacker-style tool? Some client?
(i mean... why not just provide a zip? isn't the world complex enough?)
When putting a favicon on your site, you can apparently use an animated gif, just by changing the gif file’s extension to .ico.
http://www.k-director.com/blog/how-to-add-an-animated-faviconico/
Have you encountered any problems doing this? Have you seen a browser get confused by a gif file with a .ico extension?
I am in late testing phase of my web application. The application will be tested at a larger scale now.
During this time I want to try and hack my own system and application with some tools, scripts, etc. Mostly some code I can try and execute in the browser. I have backups for the whole system so even down to the kernel can be hacked.
My system is nginx,apache,php,mysql on Linux CentOS.
My requirement is to send a link message to mobile via bluetooth in C#. The message should contain some hyperlink. And when the user opens the message it should directly open the link in browser.
It should work without installing any other application on mobile device.
I am working on a browser plug-in for Firefox, and I would like to be able to do some automated testing to make sure that it's handling a variety of different HTML/JavaScript features correctly. Does anyone know of a good downloadable corpus of HTML and/or JavaScript pages that could be used for this type of testing?
Hi, I have been creating a cross browser compatible ( = ie 6 + standards complaint browsers ) Online Instant Messenger
What I would like to know is what licensing would I need to protect my code? how would i go about getting a license and where from?
My code is in PHP, and jQuery.
Regards,
Phil
Hey
I am connecting a MYSQL database through hibernate and i seem to have processes that are not being killed after they are finished in the session. I have called flush and close on each session but when i check the server the last processes are still there with a sleep command. This is a new problem which i am having and was not the case yesterday. Is there any way i can ensure the killng of theses processes when i am done with a session.
Below is an example of one of my classes.
public JSONObject check()
{
//creates a new session needed to add elements to a database
Session session = null;
//holds the result of the check in the database
JSONObject check = new JSONObject();
try{
//creates a new session needed to add elements to a database
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session = sessionFactory.openSession();
if (justusername){
//query created to select a username from user table
String hquery = "Select username from User user Where username = ? ";
//query created
Query query = session.createQuery(hquery);
//sets the username of the query the values JSONObject contents
query.setString(0, username);
// executes query and adds username string variable
String user = (String) query.uniqueResult();
//checks to see if result is found (null if not found)
if (user == null)
{
//adds false to Jobject if not found
check.put("indatabase", "false");
}
else
{
check.put("indatabase", "true");
}
//adds check to Jobject to say just to check username
check.put("justusername", true);
}
else
{
//query created to select a username and password from user table
String hquery = "Select username from User user Where username = :user and password = :pass ";
Query query = session.createQuery(hquery);
query.setString("user", username);
query.setString("pass", password);
String user = (String) query.uniqueResult();
if(user ==null)
{
check.put("indatabase", false);
}
else
{
check.put("indatabase", true);
}
check.put("justusername", false);
}
}catch(Exception e){
System.out.println(e.getMessage());
//logg.log(Level.WARNING, " Exception", e.getMessage());
}finally{
// Actual contact insertion will happen at this step
session.flush();
session.close();
}
//returns Jobject
return check;
}
I have tried to do the following, but the web-service is NOT REST and does not take multi-part. What do I do in order to POST the image?
@response = RestClient.post('http://www.postful.com/service/upload',
{:upload => {
:file => File.new("#{@postalcard.postalimage.path}",'rb')
}
},
{"Content-Type" => @postalcard.postalimage.content_type,
"Content-Length" => @postalcard.postalimage.size,
"Authorization" => 'Basic xxxxxx'
} # end headers
) #close arguments to Restclient.post
Hi,
I am trying to call an Activity from another instance of the activity. The code is supposed to be a simple file browser (part of a larger application). I am using a ListActivity, and when an item (such as a folder) is selected, it is supposed to open it up in the new Activity. I have a feeling it is a problem with the AndroidManifest (which just has the basic tag). Any assistance would be appreciated.
Thanks,
Steve
Hello all
i need to operate smell web server in my application play flash swf files in my embedded browser , this application will be distributed to local users to desktop users
what is the best way to implement it in desktop application i mean ports / local host ?