Daily Archives

Articles indexed Wednesday March 17 2010

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

  • MediaElement fails after several plays.

    - by basilkot
    Hi! I have a problem with MediaElement control. I've put six MediaElements on my form, then I start them and change played files by timer. After several times, these elements stop playing. Here is the sample XAML: <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <MediaElement x:Name="element1" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="0" Grid.Row="0" /> <MediaElement x:Name="element2" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="1" Grid.Row="0" /> <MediaElement x:Name="element3" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="2" Grid.Row="0" /> <MediaElement x:Name="element4" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="0" Grid.Row="1" /> <MediaElement x:Name="element5" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="1" Grid.Row="1" /> <MediaElement x:Name="element6" UnloadedBehavior="Close" LoadedBehavior="Manual" Grid.Column="2" Grid.Row="1" /> Here is the sample code: // The code below repeats for each MediaElement List<string> playlist1 = new List<string>() { @"file1.wmv", @"file2.wmv", @"file3.wmv", @"file4.wmv" }; DispatcherTimer timer1 = null; int index1 = 0; ... void Window1_Loaded(object sender, RoutedEventArgs e) { timer1 = new DispatcherTimer(); timer1.Tick += new EventHandler(timer1_Elapsed); timer1.Interval = TimeSpan.FromSeconds(10); element1.Source = new Uri(playlist1[index1]); timer1.Start(); element1.Play(); ... } void timer1_Elapsed(object sender, EventArgs e) { Dispatcher.BeginInvoke(DispatcherPriority.Normal, (System.Threading.ThreadStart)delegate() { element1.Stop(); element1.Close(); timer1.Stop(); index1++; if (index1 >= playlist1.Count) { index1 = 0; } element1.Source = new Uri(playlist1[index1]); timer1.Start(); element1.Play(); }); } ... Does anybody have similar problems?

    Read the article

  • Blogger (Python) API: How do I retrieve a post by post ID?

    - by larsks
    Having previously obtained a post ID from a call to gdata.blogger.client.add_post()... post = client.add_post(...) post_id = post.get_post_id() ...how do I use that post id to retrieve the post in the future? I thought maybe gdata.blogger.client.Query would be the way to go, but this doesn't support post id as a query term. The example code distributed with the Python gdata module doesn't have an example of this use case, and after poking around gdata.blogger.client.* for a while I'm not making much progress. I could obviously iterate through all the posts in the blog until find the one with the corresponding id, but that would be a terrible, terrible idea.

    Read the article

  • jquery ui tabs major style change

    - by Jonah
    I am using jquery UI tabs and I need to majorly change the styling on it. I need to rempve the background image, the borders, almost everything. I need it to look minimal, and not like it's self contained. What's the best way to do this? I need to use the default UI styling for the calendar widget however, which is on the same page. I've done a lot of research and everyone seems to point to the theme-roller. However, i do not just want to change the colors and border radii. I need to delete crap. theme-roller seems to be just change things like colors (not really useful for the real world) Is it even worth using jquery UI for my tabs?

    Read the article

  • Editing history in bash

    - by nameanyone
    In bash, when I go back in history, edit some command and run it, this edited command is appended to history and the original one is left intact. But every once in a while I somehow manage to affect the original command, i.e. my edit replaces the original command back in history. I can't put my finger on how this happens. Can someone explain? My goal is to avoid this, so any edit to a previous command always gets appended to history and never replaces the original.

    Read the article

  • Multiple INET sockets (mulple IP's too) connected to UNIX sockets

    - by Andrew
    HOST = same host all the time, accepts multiple connection. I have a dedicated server and I will buy extra IP's. Socket 1 connects to HOST:PORT, from IP-1 Socket 2 connects to HOST:PORT, from IP-1 Socket 3 connects to HOST:PORT, from IP-1 Socket 4 connects to HOST:PORT, from IP-2 Socket 5 connects to HOST:PORT, from IP-2 Socket 6 connects to HOST:PORT, from IP-2 After creating all sockets I want to access them easy as UNIX sockets from PHP. /sys/socket1 /sys/socket2 /sys/socket3 /sys/socket4 /sys/socket5 /sys/socket6 I want the sockets to work in background (like daemon) and I want to be able to connect from PHP to any of this sockets and RECV/SEND whatever I want. I saw "socat" and I think that's the solution for me, please tell me how to use socat, or how to do it other way. Thankyou!

    Read the article

  • JNI loses reference to native methods

    - by lhw
    As an example for later use in Android I wrote a simple callback interface. While doing so i ran into the following error or bug or whatever. In C the two commented lines are supposed to be executed resulting in calling the C callback onChange. But instead i get an UnsatisfiedLinkError. Calling the native Method directly in Java works just fine. Calling it directly from C as presented here in the example also produces the UnsatisfiedLinkError. I'm open for any advice concerning this issue or work arounds and so on. The Java Part: import java.util.LinkedList; import java.util.Random; interface Listener { public void onChange(float f); } class Provider { LinkedList<Listener> all; public Provider() { all = new LinkedList<Listener>(); } public void registerChange(Listener lst) { all.add(lst); } public void sendMsg() { Random rnd = new Random(); for(Listener l : all) { try { l.onChange(rnd.nextFloat()); } catch(Exception e) { System.out.println(e); } } } } class Inheritance implements Listener { static public void main(String[] args) { System.load(System.getProperty("user.dir") + "/libinheritance.so"); } public native void onChange(float f); } The C Part: #include "inheritance.h" jint JNI_OnLoad(JavaVM *jvm, void *reserved) { JNIEnv *env; (*jvm)->GetEnv(jvm, (void**)&env, JNI_VERSION_1_4); inheritance = (*env)->FindClass(env, "Inheritance"); o_inheritance = (*env)->NewObject(env, inheritance, (*env)->GetMethodID(env, inheritance, "<init>", "()V")); provider = (*env)->FindClass(env, "Provider"); o_provider = (*env)->NewObject(env, provider, (*env)->GetMethodID(env, provider, "<init>", "()V")); (*env)->CallVoidMethod(env, o_inheritance, (*env)->GetMethodID(env, inheritance, "onChange", "(F)V"), 1.0); //(*env)->CallVoidMethod(env, o_provider, (*env)->GetMethodID(env, provider, "registerChange", "(LListener;)V"), o_inheritance); //(*env)->CallVoidMethod(env, o_provider, (*env)->GetMethodID(env, provider, "sendMsg", "()V")); (*env)->DeleteLocalRef(env, o_inheritance); (*env)->DeleteLocalRef(env, o_provider); return JNI_VERSION_1_4; } JNIEXPORT void JNICALL Java_Inheritance_onChange(JNIEnv *env, jobject self, jfloat f) { printf("[C] %f\n", f); } The header file: #include <jni.h> /* Header for class Inheritance */ #ifndef _Included_Inheritance #define _Included_Inheritance #ifdef __cplusplus extern "C" { #endif jclass inheritance, provider; jobject o_inheritance, o_provider; /* * Class: Inheritance * Method: onChange * Signature: (F)V */ JNIEXPORT void JNICALL Java_Inheritance_onChange(JNIEnv *, jobject, jfloat); jint JNI_OnLoad(JavaVM *, void *); #ifdef __cplusplus } #endif #endif Compilation: gcc -c -fPIC -I /usr/lib/jvm/java-6-openjdk/include -I /usr/lib/jvm/java-6-openjdk/include/linux/inheritance.c inheritance.h gcc -g -o -shared libinheritance.so -shared -Wl,-soname,libinheritance.so -lc inheritance.o

    Read the article

  • Dependency Property not getting updated value via ActivityBind

    - by d h
    I have a Sequence Activity which holds two activities (Activity A and B), the input dependency property for Activity B is bound an output dependency property of Activity A. However, when I run the sequence activity, the Input for activity B is never updated and just uses the default value of activity A's output. My question is: is there a way to enforce an update on activity B's input so that it gets the latest value of activity A's output?

    Read the article

  • JNI: Long-object created with wrong value

    - by Torbjörn Eklund
    Hi! I am writing a c-jni function in Android, and I am having problems with creating a Long-object. I have succeeded in calling the constructor, but when I read the value of the object with longValue, I get the wrong result. jmethodID longConstructor; jmethodID longGetLongValue; jclass cls; jobject obj; // Create a object of type Long. cls = (*env)->FindClass(env,"java/lang/Long"); longConstructor = (*env)->GetMethodID(env,cls,"<init>","(J)V"); obj = (*env)->NewObject(env, cls, longConstructor, 4242); // Get the value by calling the function longValue. longGetLongValue= (*env)->GetMethodID(env,cls,"longValue","()J"); long return_long_value = (*env)->CallLongMethod(env, obj, longGetLongValue); // Log the result. LOGD("%li", return_long_value); I would expect that the above code would print 4242 in the log, however the value that is printed in the log is 1691768. Does anybody have an idea on why 4242 is not written in the log?

    Read the article

  • Possible to have multiple Profiles in ASP.NET for different users?

    - by asple
    My application has a few different user types with their own members. For example, I have the student user as well as the teacher user. I authenticate my users through active directory in my custom MembershipProvider's ValidateUser method. While querying AD, I pull out all their relevant information. I'd like to put that information into a Profile, but from what I've read and the examples I've sen, you can only define a single Profile (like so): <profile defaultProvider="CustomProfileProvider" enabled="true"> <properties> <add name="YearLevel" type="String" /> <add name="Name" type="String" /> <add name="Age" type="String" /> </properties> </profile> The above profile would work for a student, but not for a teacher, who does not have a value for "YearLevel" in AD. Is it possible to have multiple profiles to accomplish this? Or is it easier to add all properties from AD spanning all user types, then in my code, just check what user type they are and then access their specific properties?

    Read the article

  • Install driver and copying files before Installation runs

    - by Kazoom
    I have created installation package for my project, but before or after installation is complete i need to install some drivers and copy some files to target machine, before my software can run. Is it possible for me to do all this action in the MSI installer setup project of visual studio 2005. One option i have explored is using autoITscript, is there a better approach than that? i feel able to do the whole thing in visual studio would be an ideal way? any suggestions? Thanks

    Read the article

  • How do you compare dates in a LINQ query?

    - by Gina
    I am tring to compare a date from a asp calendar control to a date in the table.... here's what i have... it doesn't like the == ? var query = from details in db.TD_TravelCalendar_Details where details.StartDate == calStartDate.SelectedDate && details.EndDate == calEndDate.SelectedDate select details;

    Read the article

  • htaccess mod_rewrite check file/directory existence, else rewrite?

    - by devians
    I have a very heavy htaccess mod_rewrite file that runs my application. As we sometimes take over legacy websites, I sometimes need to support old urls to old files, where my application processes everything post htaccess. My ultimate goal is to have a 'Demilitarized Zone' for old file structures, and use mod rewrite to check for existence there before pushing to the application. This is pretty easy to do with files, by using: RewriteCond %{IS_SUBREQ} true RewriteRule .* - [L] RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L] RewriteCond Public/DMZ/$1 -F [OR] RewriteRule ^(.*)$ Public/DMZ/$1 [QSA,L] This allows pseudo support for relative urls by not hardcoding my base path (I cant assume I will ever be deployed in document root) anywhere and using subrequests to check for file existence. Works fine if you know the file name, ie http://domain.com/path/to/app/legacyfolder/index.html However, my legacy urls are typically http://domain.com/path/to/app/legacyfolder/ Mod_Rewrite will allow me to check for this by using -d, but it needs the complete path to the directory, ie RewriteCond Public/DMZ/$1 -F [OR] RewriteCond /var/www/path/to/app/Public/DMZ/$1 -d RewriteRule ^(.*)$ Public/DMZ/$1 [QSA,L] I want to avoid the hardcoded base path. I can see one possible solutions here, somehow determining my path and attaching it to a variable [E=name:var] and using it in the condition. Another option is using -U, but the tricky part is stopping it from hijacking every other request when they should flow through, since -U is really easy to satisfy. Any implementation that allows me to existence check a directory is more than welcome. I am not interested in using RewriteBase, as that requires my htaccess to have a hardcoded base path.

    Read the article

  • How to render in rails metal?

    - by fursie
    Hi I want to use a custom template file which shoud use the base layout file (app/view/layouts/application.html.erb) in a Rails metal code. Can somebody give me some hints what I need to require or how I can do that?

    Read the article

  • Some F# Features that I would like to see in C# any help?

    - by WeNeedAnswers
    After messing about with F# there are some really nice features that I think I am going to miss when I HAVE to go back to c#, any clues on how I can ween myself off the following, or better still duplicate their functionality: Pattern Matching (esp. with Discriminating Unions) Discriminating Unions Recursive Functions (Heads and Tails on Lists) And last but not least the Erlang inspired Message Processing.

    Read the article

  • Entity Framework - Why does EF use LEFT OUTER JOIN's in a 1-to-1 relationship?

    - by Taylor L
    Why does .NET Entity Framework produce SQL that uses a subquery and left outer join on a simple 1-to-1 relationship? I expected to see a simple join on the two tables. I'm using Devart Dotconnect for Oracle. Any ideas? Below is the output I see courtesy of the EFTracingProvider: SELECT 1 AS C1, "Join1".USER_ID1 AS USER_ID, ... FROM "MY$NAMESPACE".MYTABLE1 "Extent1" INNER JOIN (... FROM "MY$NAMESPACE".MYTABLE2 "Extent2" LEFT OUTER JOIN "MY$NAMESPACE".MYTABLE1 "Extent3" ON "Extent2".OTHER_ID = "Extent3".OTHER_ID ) "Join1" ON "Extent1".OTHER_ID = "Join1".OTHER_ID1 WHERE "Extent1".USER_ID = :EntityKeyValue1 -- EntityKeyValue1 (dbtype=String, size=6, direction=Input) = "000000"

    Read the article

  • Calendar Table - Week number of month

    - by Saif Khan
    I have a calendar table with data from year 2000 to 2012 (2012 wasn't intentional!). I just realize that I don't have the week number of month (e.g In January 1,2,3,4 February 1,2,3,4) How do I go about calculating the week numbers in a month to fill this table? Here is the table schema CREATE TABLE [TCalendar] ( [TimeKey] [int] NOT NULL , [FullDateAlternateKey] [datetime] NOT NULL , [HolidayKey] [tinyint] NULL , [IsWeekDay] [tinyint] NULL , [DayNumberOfWeek] [tinyint] NULL , [EnglishDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [SpanishDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FrenchDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [DayNumberOfMonth] [tinyint] NULL , [DayNumberOfYear] [smallint] NULL , [WeekNumberOfYear] [tinyint] NULL , [EnglishMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [SpanishMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FrenchMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [MonthNumberOfYear] [tinyint] NULL , [CalendarQuarter] [tinyint] NULL , [CalendarYear] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [CalendarSemester] [tinyint] NULL , [FiscalQuarter] [tinyint] NULL , [FiscalYear] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FiscalSemester] [tinyint] NULL , [IsLastDayInMonth] [tinyint] NULL , CONSTRAINT [PK_TCalendar] PRIMARY KEY CLUSTERED ( [TimeKey] ) ON [PRIMARY] ) ON [PRIMARY] GO

    Read the article

  • FIlling a Java Bean tree structure from a csv flat file

    - by Clem
    Hi, I'm currently trying to construct a list of bean classes in Java from a flat description file formatted in csv. Concretely : Here is the structure of the csv file : MES_ID;GRP_PARENT_ID;GRP_ID;ATTR_ID M1 ; ;G1 ;A1 M1 ; ;G1 ;A2 M1 ;G1 ;G2 ;A3 M1 ;G1 ;G2 ;A4 M1 ;G2 ;G3 ;A5 M1 ; ;G4 ;A6 M1 ; ;G4 ;A7 M1 ; ;G4 ;A8 M2 ; ;G1 ;A1 M2 ; ;G1 ;A2 M2 ; ;G2 ;A3 M2 ; ;G2 ;A4 It corresponds to the hierarchical data structure : M1 ---G1 ------A1 ------A2 ------G2 ---------A3 ---------A4 ---------G3 ------------A5 ------G4 ---------A7 ---------A8 M2 ---G1 ------A1 ------A2 ---G2 ------A3 ------A4 Remarks : A message M can have an infinite number of groups G and attributes A A group G can have an infinite number of attributes and an infinite number of under-groups each of them having under-groups too That beeing said, I'm trying to read this flat csv decription to store it in this structure of beans : Map<String, MBean> messages = new HashMap<String, Mbean>(); == public class MBean { private String mes_id; private Map<String, GBean> groups; } public class GBean { private String grp_id; private Map<String, ABean> attributes; private Map<String, GBean> underGroups; } public class ABean { private String attr_id; } Reading the csv file sequentially is ok and I've been investigating how to use recursion to store the description data, but couldn't find a way. Thanks in advance for any of your algorithmic ideas. I hope it will put you in the mood of thinking about this ... I've to admit that I'm out of ideas :s

    Read the article

  • what it is Sharepoint ? Main advantages for programmer

    - by netmajor
    Hey, For some time i see that employers demand from programmers knowing Sharepoint, but I have problem with understand what it is :/ But today I was at IT training, and main guy told something like that:" Sharepoint is platform for commit code for programmer, control of version etc..." It is true? It looks like SVN tool... Can someone explain me what advantages it have for c# programmer? Thanks ;)

    Read the article

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