Search Results

Search found 412 results on 17 pages for 'shawn wang'.

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

  • Android: MediaPlayer gapless or seamless Video Playing

    - by John Wang
    I can play the videos fine back to back by implementing the OnCompletionListener to set the data source to a different file. No problems there. I call reset() and prepare() just fine. What I haven't been able to figure out, is how to get rid of the 1-2 second gap screen flicker between the data source change and the new video starting. The gap shows a black screen, and I haven't found any way to get around it. I've tried setting the background of the parent view to an image, but it manages to bypass that. Even if the SurfaceView is transparent (which it is by default.) I've also tried to have the multiple video files played at the same time, and switching mediaplayer's display when one ends and the other is supposed to start. The last thing I tried, was to have a second view in the background that I show temporarily while the video is "preparing" and removing it when the video is ready to start. That also wasn't very seamless. Is there any way to get rid of that gap. Running a video in a loop works wonderfully and does exactly what I want with the exception that it's looking through the same video instead of playing a different one that I pick. main.xml <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:background="@drawable/background" android:layout_height="fill_parent"> <SurfaceView android:id="@+id/surface" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center"> </SurfaceView> </FrameLayout> Player.java public class Player extends Activity implements OnCompletionListener, MediaPlayer.OnPreparedListener, SurfaceHolder.Callback { private MediaPlayer player; private SurfaceView surface; private SurfaceHolder holder; public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main); surface = (SurfaceView)findViewById(R.id.surface); holder = surface.getHolder(); holder.addCallback(this); holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void onCompletion(MediaPlayer arg0) { File clip = new File(Environment.getExternalStorageDirectory(),"file2.mp4"); playVideo(clip.getAbsolutePath()); } public void onPrepared(MediaPlayer mediaplayer) { holder.setFixedSize(player.getVideoWidth(), player.getVideoHeight()); player.start(); } private void playVideo(String url) { try { File clip = new File(Environment.getExternalStorageDirectory(),"file1.mp4"); if (player == null) { player = new MediaPlayer(); player.setScreenOnWhilePlaying(true); } else { player.stop(); player.reset(); } player.setDataSource(url); player.setDisplay(holder); player.setOnPreparedListener(this); player.prepare(); player.setOnCompletionListener(this); } catch (Throwable t) { Log.e("ERROR", "Exception Error", t); } }

    Read the article

  • How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice.

    - by Eric Wang
    How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice. If not use Ajax, it maybe much easier, just return View, but if use AJAX, what data structure should return?I just use Json to return the data, but i found each JSON data model return to the client browser, the JS have to use different code to parse it, remove the originally table rows, add the new data rows(because the column is different) etc. It make me crazy, is there any better way to do that? Thank you for any advice.

    Read the article

  • dynamically change bitmap in imageView, android

    - by Junfei Wang
    All, I have a problem related to imageView, android. I have array which contains of 10 bitmap objects, called bm. I have a imageView, called im. Now I wanna show the bitmaps in the array in im one by one, so I did the following: new Thread(new Runnable() { public void run() { for(int j=0;j<10;j++){ im.setImageBitmap(bm[j]); } } }).start(); But the result only shows the last bitmap in the array. Can someone tell me what to do with this issue? Millions of thanks!

    Read the article

  • Eclipse autocomplete (content assist) with jsf2.0, xhtml and primefaces 2.2.RC1

    - by Keating Wang
    I use windows 7. I set the ClassPath like this: D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-api.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\jsf-impl.jar;D:\EclipseProjects\DLFWD_NEW\WebContent\WEB-INF\lib\primefaces-2.2.RC1.jar And I alse do this: Window Preferences General Content Types Text JSP Add (xhtml) But, it doesn't works. When I use netbeans. I do nothing, but the autocomplete function works well.

    Read the article

  • How can I get JUnit test (driven from Ant script) to dump the stack of exception that causes failure

    - by Matt Wang
    We run JUnit test from Ant script, as follows. When the test failed, I expect it to output the stack dump of the exception that casuses the failure, but it doesn't. Is there any trick to get it dumped? <target description="Run JUnit tests" name="run-junit" depends="build-junit"> <copy file="./AegisLicense.txt" tofile="test/junit/classes/AegisLicense.txt" overwrite="true"/> <junit printsummary="yes" haltonfailure="no" fork="yes" forkmode="once" failureproperty="run-aegis-junit-failed" showoutput="yes" filtertrace="off"> <classpath refid="Aegisoft.testsupport.classpath"/> <classpath> <pathelement location="test/junit/classes"/> </classpath> <batchtest> <fileset dir="test/junit/src"> <include name="**"/> </fileset> </batchtest> </junit> <fail

    Read the article

  • What is the "task" in twitter Storm parallelism

    - by John Wang
    I'm trying to learn twitter storm by following the great article "Understanding the parallelism of a Storm topology" However I'm a bit confused by the concept of "task". Is a task an running instance of the component(spout or bolt) ? A executor having multiple tasks actually is saying the same component is executed for multiple times by the executor, am I correct ? Moreover in a general parallelism sense, Storm will spawn a dedicated thread(executor) for a spout or bolt, but what is contributed to the parallelism by an executor(thread) having multiple tasks ? I think having multiple tasks in a thread, since a thread executes sequentially, only make the thread a kind of "cached" resource, which avoids spawning new thread for next task run. Am I correct? I may clear those confusion by myself after taking more time to investigate, but you know, we both love stackoverflow ;-) Thanks in advance.

    Read the article

  • Can I force WPF rendering tier?

    - by Kai Wang
    Is there any way I can force WPF rendering tiers mentioned here? http://msdn.microsoft.com/en-us/library/ms742196.aspx For example I am on tier 2, but I want to simulate the application in tier 1 or 0 scenario.

    Read the article

  • idiomatic way to take groups of n items from a list in Python?

    - by Wang
    Given a list A = [1 2 3 4 5 6] Is there any idiomatic (Pythonic) way to iterate over it as though it were B = [(1, 2) (3, 4) (5, 6)] other than indexing? That feels like a holdover from C: for a1,a2 in [ (A[i], A[i+1]) for i in range(0, len(A), 2) ]: I can't help but feel there should be some clever hack using itertools or slicing or something. (Of course, two at a time is just an example; I'd like a solution that works for any n.) Edit: related http://stackoverflow.com/questions/1162592/iterate-over-a-string-2-or-n-characters-at-a-time-in-python but even the cleanest solution (accepted, using zip) doesn't generalize well to higher n without a list comprehension and *-notation.

    Read the article

  • Threads are blocked in malloc and free, virtual size

    - by Albert Wang
    Hi, I'm running a 64-bit multi-threaded program on the windows server 2003 server (X64), It run into a case that some of the threads seem to be blocked in the malloc or free function forever. The stack trace is like follows: ntdll.dll!NtWaitForSingleObject() + 0xa bytes ntdll.dll!RtlpWaitOnCriticalSection() - 0x1aa bytes ntdll.dll!RtlEnterCriticalSection() + 0xb040 bytes ntdll.dll!RtlpDebugPageHeapAllocate() + 0x2f6 bytes ntdll.dll!RtlDebugAllocateHeap() + 0x40 bytes ntdll.dll!RtlAllocateHeapSlowly() + 0x5e898 bytes ntdll.dll!RtlAllocateHeap() - 0x1711a bytes MyProg.exe!malloc(unsigned __int64 size=0) Line 168 C MyProg.exe!operator new(unsigned __int64 size=1) Line 59 + 0x5 bytes C++ ntdll.dll!NtWaitForSingleObject() ntdll.dll!RtlpWaitOnCriticalSection() ntdll.dll!RtlEnterCriticalSection() ntdll.dll!RtlpDebugPageHeapFree() ntdll.dll!RtlDebugFreeHeap() ntdll.dll!RtlFreeHeapSlowly() ntdll.dll!RtlFreeHeap() MyProg.exe!free(void * pBlock=0x000000007e8e4fe0) C BTW, the param values passed to the new operator is not correct here maybe due to optimization. Also, at the same time, I found in the process Explorer, the virtual size of this program is 10GB, but the private bytes and working set is very small (<2GB). We did have some threads using virtualalloc but in a way that commit the memory in the call, and these threads are not blocked. m_pBuf = VirtualAlloc(NULL, m_size, MEM_COMMIT, PAGE_READWRITE); ...... VirtualFree(m_pBuf, 0, MEM_RELEASE); This looks strange to me, seems a lot of virtual space is reserved but not committed, and malloc/free is blocked by lock. I'm guessing if there's any corruptions in the memory/object, so plan to turn on gflag with pageheap to troubleshoot this. Does anyone has similar experience on this before? Could you share with me so I may get more hints? Thanks a lot!

    Read the article

  • Does it mean JVM Suspended?

    - by Joe.wang
    When my application run . I got a message says : Ping: Timed out waiting for signal from JVM. The JVM was launched with debug options so this may be because the JVM is currently suspended by a debugger. Any future timeouts during this JVM invocation will be silently ignored. What does that mean? It seems it will block any web request from outside? because when I upload a file to it, it failed. help me .

    Read the article

  • what changes when your input is giga/terabyte sized?

    - by Wang
    I just took my first baby step today into real scientific computing today when I was shown a data set where the smallest file is 48000 fields by 1600 rows (haplotypes for several people, for chromosome 22). And this is considered tiny. I write Python, so I've spent the last few hours reading about HDF5, and Numpy, and PyTable, but I still feel like I'm not really grokking what a terabyte-sized data set actually means for me as a programmer. For example, someone pointed out that with larger data sets, it becomes impossible to read the whole thing into memory, not because the machine has insufficient RAM, but because the architecture has insufficient address space! It blew my mind. What other assumptions have I been relying in the classroom that just don't work with input this big? What kinds of things do I need to start doing or thinking about differently? (This doesn't have to be Python specific.)

    Read the article

  • Proper usage of Java Weak Reference in case of nested collections

    - by Tong Wang
    I need to define a weak reference Map, whose value is a Set. I use Google collections' MapMaker, like this: Map<Class<? extends Object>, Set<Foo>> map = new MapMaker().weakKeys().weakValues().makeMap(); So, for Set<Foo>, can I use a normal HashSet? Or, do I have to create a weak HashSet, like this: Collections.newSetFromMap(new WeakHashMap<Foo, Boolean>()); And why? Another question, the key of my map is Class objects, when will a Class object become weakly reachable? In other words, what is the lifetime of a Class object? Thanks.

    Read the article

  • Remove trailing letters at the end of string

    - by wang
    I have some strings like below: ffffffffcfdeee^dddcdeffffffffdddcecffffc^cbcb^cb`cdaba`eeeeeefeba[NNZZcccYccaccBBBBBBBBBBBBBBBBBBBBBB eedeedffcc^bb^bccccbadddba^cc^e`eeedddda`deca_^^\```a```^b^`I^aa^bb^`_b\a^b```Y_\`b^`aba`cM[SS\ZY^BBB Each string MAY (or may not) end with a stretch of trailing "B" of varied length. I'm just wondering if we can simply use bash code to remove the "B" stretch? thx

    Read the article

  • Flex: Scale an Image so that its width matches contentWidth?

    - by Tong Wang
    I have a dynamic layout, where an image is loaded into an HBox: <mx:HBox ...> <mx:Image height="100%" .../> </mx:HBox> only the image's height is set on the image, so that it can take all the vertical space available, while its width is left undefined and I expect the width to scale accordingly with its height. It turns out that the image's height is equal to its contentHeight, i.e. height scales properly; however, the image's width is still the same as measuredWidth (the image's original width), and is not scaled accordingly. For example, if the image's original size is 800x600 and if the HBox is 300 in height, then image height will scale down to 300, however its width doesn't scale down to 400, instead it stays at 800. I tried to add an event listener to explicitly set the image width: <mx:Image id="img" height="100%" updateComplete="img.width=img.contentWidth;" .../> It works only the first time the image is loaded, after that, if I use Image.load() to dynamically load different images, it stops working - the image width is set to 0. Any help/advice will be highly appreciated.

    Read the article

  • how is a macro expanded in clojure?

    - by john wang
    In the book Programming Clojure(Stuart), when read how macros are expanded I got confused. user=> (defmacro chain ([x form] (list '. x form)) ([x form & more] (concat (list 'chain (list '. x form)) more))) #'user/chain The above macro can be expanded as: user=> (macroexpand '(chain a b c)) (. (. a b) c) But the following is only expanded to the first level: user=> (macroexpand '(and a b c)) (let* [and__3822__auto__ a] (if and__3822__auto__ (clojure.core/and b c) and__3822__auto__)) The and macro source: user=> (source and) (defmacro and([] true) ([x] x) ([x & next] `(let [and# ~x] (if and# (and ~@next) and#)))) Why is the chain macro expanded all the way but the and not ? Why is it not expanded to something like the following: user=> (macroexpand '(chain a b c d)) (. (chain a b c) d)

    Read the article

  • What is the best way to use Unicode in C++ on iPhone?

    - by Olli Wang
    Hi, I want to create my C++ libraries with Unicode support so they can be reused on other platforms. I have found the ICU (International Components for Unicode) project but I also found a discuss about Apple rejecting for using ICU (see http://tinyurl.com/y86phfb). So how do you guys use Unicode in C++ on iPhone? Thanks.

    Read the article

  • Movie Library on Windows Media Center Extender

    - by Shawn Miller
    I have a share setup on a NAS server with ripped versions of my DVDs. I pointed the Windows 7 version of the Windows Media Center Movie Library feature to the network share and it's able to find and play all my movies when running Windows Media Center from the local computer. When I try this on my Xbox 360 extender it never discovers any of my movies. Anyone able to get this to work?

    Read the article

  • mysql spitting lots of "table marked as crashed" errors

    - by Shawn
    Hi, I have a mysql server(version: 5.5.3-m3-log Source distribution ) and it keeps showing lots of 110214 3:01:48 [ERROR] /usr/local/mysql/libexec/mysqld: Table './mydb/tablename' is marked as crashed and should be repaired 110214 3:01:48 [Warning] Checking table: './mydb/tablename' I'm wondering what can be the possible casues and how to fix it. Here is a full list mysql configuration : connect_errors = 6000 table_cache = 614 external-locking = FALSE max_allowed_packet = 32M sort_buffer_size = 2G max_length_for_sort_data = 2G join_buffer_size = 256M thread_cache_size = 300 #thread_concurrency = 8 query_cache_size = 512M query_cache_limit = 2M query_cache_min_res_unit = 2k default-storage-engine = MyISAM thread_stack = 192K transaction_isolation = READ-COMMITTED tmp_table_size = 246M max_heap_table_size = 246M long_query_time = 3 log-slave-updates = 1 log-bin = /data/mysql/3306/binlog/binlog binlog_cache_size = 4M binlog_format = MIXED max_binlog_cache_size = 8M max_binlog_si ze = 1G relay-log-index = /data/mysql/3306/relaylog/relaylog relay-log-info-file = /data/mysql/3306/relaylog/relaylog relay-log = /data/mysql/3306/relaylog/relaylog expire_logs_days = 30 key_buffer_size = 1G read_buffer_size = 1M read_rnd_buffer_size = 16M bulk_insert_buffer_size = 64M myisam_sort_buffer_size = 2G myisam_max_sort_file_size = 5G myisam_repair_threads = 1 max_binlog_size = 1G interactive_timeout = 64 wait_timeout = 64 skip-name-resolve slave-skip-errors = 1032,1062,126,1114,1146,1048,1396 The box is running on centos-5.5. Thanks for your help.

    Read the article

  • Is it possible to load balance requests from a single source?

    - by Shawn
    In our application, Server A establishes a TCP connection with Server B, then it sends a large amount of requests to Server B over the TCP connection. The request message is XML-based. Server B needs to respond within a very short period, and it takes time to process the requests. So we hope a load balancer can be introduced and we can expedite the processing by using multiple Server B's. This is not a web application. I did some research but failed to find a similar application of load balancer. Can anyone tell me if there's a load balancer can help in our application?

    Read the article

  • Acer aspire 5520 power light blinks no boot

    - by Shawn Mclean
    My laptop was working fine last night, I hibernated it and went to sleep. Got up, pressed the power button. The power light comes on for 4 seconds and the hdd light blinked a few times, then it turned off for a second then repeats the process. The only way to stop this process/power down is to remove the AC and take out the battery. It does not even reach a boot screen, nothing shows up on the screen, fan does not start. People on this forum has the same problem but they suggest to put the laptop in a oven and heat it (reflow). What could be the problem? Is there another solution other than a reflow? I dont feel like putting my motherboard in the oven.

    Read the article

  • VirtualHost not using correct SSL certificate file

    - by Shawn Welch
    I got a doozy of a setup with my virtual hosts and SSL. I found the problem, I need a solution. The problem is, the way I have my virtual hosts and server names setup, the LAST VirtualHost directive is associating the SSL certificate file with the ServerName regardless of IP address or ServerAlias. In this case, SSL on www.site1.com is using the cert file that is established on the last VirtualHost; www.site2.com. Is this how it is supposed to work? This seems to be happening because both of them are using the same ServerName; but I wouldn't think this would be a problem. I am specifically using the same ServerName for a purpose and I really can't change that. So I need a good fix for this. Yes, I could buy another UCC SSL and have them both on it but I have already done that; these are actually UCC SSLs already. They just so happen to be two different UCC SSLs. <VirtualHost 11.22.33.44:80> ServerName somename ServerAlias www.site1.com UseCanonicalName On RewriteEngine On RewriteOptions Inherit </VirtualHost> <VirtualHost 11.22.33.44:443> ServerName somename ServerAlias www.site1.com UseCanonicalName On SSLEngine on SSLCertificateFile /usr/local/apache/conf/ssl.crt/cert1.crt SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/cert1.key SSLCertificateChainFile /usr/local/apache/conf/chain/gd_bundle.crt RewriteEngine On RewriteOptions Inherit </VirtualHost> <VirtualHost 55.66.77.88:80> ServerName somename ServerAlias www.site2.com UseCanonicalName On RewriteEngine On RewriteOptions Inherit </VirtualHost> <VirtualHost 55.66.77.88:443> ServerName somename ServerAlias www.site2.com UseCanonicalName On SSLEngine on SSLCertificateFile /usr/local/apache/conf/ssl.crt/cert2.crt SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/cert2.key SSLCertificateChainFile /usr/local/apache/conf/chain/gd_bundle.crt RewriteEngine On RewriteOptions Inherit </VirtualHost>

    Read the article

  • httpd memory could not be written on winxp

    - by Shawn
    I have a apache server on a winxp box, ocassionaly I got a "httpd error, memory could not be written" error, here is what I found in the apache error-log `[Sat Sep 12 10:58:34 2009] [error] [client 113.68.84.79] Invalid URI in request ;\xece\r\xd5m\xed{\xbcf\xbf\xffq\bZNB\xf0a\xf9\x13\xf3[\x06Y\x02G\xca\xc5\xf3\x9ft\x89b\xed\xb5m\x9f\x1c\xa6\x03\x10\xee\xe9G\xb5\xe0glLf\xd4eFT\x8f.{Ysl\x89\x05\x18\x0f\x0fp\xdd\xaf\x11G\xbe\xbf\x96/Pr\x9e\xf4\x89\xf2\xd4^mA\x13y2\xe3\x95\xaeD\x02\xa7*G\xe4\x1d\x07r^\xaf_J\xf7\xbc\x90\x17\xda\x90\x17\xec\xd4\xe8\xe4\xfcU\x04\xbc2V\xe1\x170\xeb Error in my_thread_global_end(): 66 threads didn't exit [Sat Sep 12 11:08:43 2009] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Sat Sep 12 11:08:51 2009] [notice] Apache/2.2.4 (Win32) PHP/5.2.3 configured -- resuming normal operations` Anybody can tell what this means and where the problem is ? Thanks.

    Read the article

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