Search Results

Search found 19796 results on 792 pages for 'bit twiddler'.

Page 141/792 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • C# - .WAV Playback Randomly High Pitch

    - by Nate Shoffner
    For some reason, when a WAV file is played back using the snippet below, it randomly plays back screwy, like a high pitch noise. It doesn't happen all the time, just randomly. It seems to happen more often when it is played back more frequently. The WAV properties are below along with the code snippet I am using. WAV Properties: Bit Rate - 750kbps Audio Sample Size - 16 bit Channels - 1 (mono) Audio Sample Rate - 44kHz Audio Format - PCM Snippet: System.Media.SoundPlayer myPlayer = new System.Media.SoundPlayer(Captcha.Properties.Resources.sound1); myPlayer.Play(); Is this because of the way I am playing the file or the file itself? Thank you.

    Read the article

  • C# Express 2010 Multi-Threading

    - by Chris Evans
    Hi, I have a windows app that I have been running in c# Express 2008 for a year and have been trying to convert it over the last few days to 2010. The problem I am having is it is a multi-threaded application that has to run a series of code every second. What it does is have a main thread, that calls 3 worker threads, waits for them to finish then does some additional processing, sleeps till 1 second and runs again. The problem is part of the code can call a web service that takes 8 seconds to respond, so this bit of code gets called using ThreadPool.QueueUserWorkItem. The problem is when running in 2010 when this part of the code gets called the main thread continues to run but when it awakens the sub threads it hangs until the Threadpool method finishes running. This never happens in 2008. Any suggestions? So far I put that bit of code in it's own thread rather than using Threadpool but same issue.

    Read the article

  • Are upper bounds of indexed ranges always assumed to be exclusive?

    - by polygenelubricants
    So in Java, whenever an indexed range is given, the upper bound is almost always exclusive. From java.lang.String: substring(int beginIndex, int endIndex) Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1 From java.util.Arrays: copyOfRange(T[] original, int from, int to) from - the initial index of the range to be copied, inclusive to - the final index of the range to be copied, exclusive. From java.util.BitSet: set(int fromIndex, int toIndex) fromIndex - index of the first bit to be set. toIndex - index after the last bit to be set. As you can see, it does look like Java tries to make it a consistent convention that upper bounds are exclusive. My questions are: Is this the official authoritative recommendation? Are there notable violations that we should be wary of? Is there a name for this system? (ala "0-based" vs "1-based")

    Read the article

  • Common causes of slow performing jQuery and how to optimize the code?

    - by Polaris878
    Hello, This might be a bit of a vague or general question, but I figure it might be able to serve as a good resource for other jQuery-ers. I'm interested in common causes of slow running jQuery and how to optimize these cases. We have a good amount of jQuery/JavaScript performing actions on our page... and performance can really suffer with a large number off elements. What are some obvious performance pitfalls you know of with jQuery? What are some general optimizations a jQuery-er can do to squeeze every last bit of performance out of his/her scripts? One example: a developer may use a selector to access an element that is slower than some other way. Thanks

    Read the article

  • Safari 4.0.5 will not play any HTML5 (H.264) video

    - by axiomx11
    The html5test.com tells me that my browser does not support the <video> element, and when I try example page, I get the fallback message, usually "Your browser does not support HTML5 video." I know this should work in Safari. I am on Windows 7, 64-bit (running 32-bit Safari). Video works in Safari for everyone else in the office. (Windows 7 setup exactly like mine, Vista, OSX.) I have tries uninstalling, deleting all user preferences, and reinstalling. Anything else I should try?

    Read the article

  • python len calculation

    - by n00bz0r
    I'm currently trying to build a RDP client in python and I came across the following issue with a len check; From: http://msdn.microsoft.com/en-us/library/cc240836%28v=prot.10%29.aspx "81 2a - ConnectData::connectPDU length = 298 bytes Since the most significant bit of the first byte (0x81) is set to 1 and the following bit is set to 0, the length is given by the low six bits of the first byte and the second byte. Hence, the value is 0x12a, which is 298 bytes." This sounds weird. For normal len checks, I'm simply using : struct.pack("h",len(str(PacketLen))) but in this case, I really don't see how I can calculate the len as described above. Any help on this would be greatly appreciated !

    Read the article

  • UseConcMarkSweepGC verbose gc output shows memory drops

    - by user1864747
    I have an application for which I have enabled GC logging. The heap appears to grow then takes a sudden drop, but does not log a Full GC. If there some startup parameter that I can enable that will show me what GC event is reducing the heap size? My environment: Linux 64-Bit, java 1.6.0_31, Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode) VM args: -server -Xms2560m -Xmx2560m -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m -XX:-PrintGC -XX: -PrintGCDetails -XX:-PrintGCTimeStamps -Xloggc:/xxxxx/gc.log -Dsun.rmi.dgc.client.gcInterval=86400000 -Dsun.rmi.dgc.server.gcInterval=86400000 3057.609: [GC 2397254K->2385777K(2619328K), 0.0572310 secs] 3058.898: [GC 2402801K->2391301K(2619328K), 0.0566620 secs] 3059.940: [GC 2408325K->2397156K(2619328K), 0.0534080 secs] 3059.995: [GC 2397265K(2619328K), 0.0069950 secs] 3065.635: [GC 2414180K->2404934K(2619328K), 0.0732700 secs] 3065.849: [GC 2419994K(2619328K), 0.1150630 secs] 3070.248: [GC 1593931K->1591825K(2619328K), 0.1084230 secs] 3072.440: [GC 1608552K->1606431K(2619328K), 0.0533140 secs] 3087.759: [GC 1623455K->1614544K(2619328K), 0.0215850 secs] What event is causing the heap to shrink between the output at 3065.849 and 3070.248? Is there a VM param that will log it? I tried adding -verbose:gc but that does not change the output.

    Read the article

  • e-commerce clothing site in .NET from the scratch or site copy ? suggestions please

    - by pointlesspolitics
    Hi all, I am thinking to create an e-commerce site for a clothing business. I have bit of a development knowledge in c# .net, html, css and other web technologies. Could you please advise on these questions ? Is it a good idea to create a site from the scratch ? I have a running example of such a site, however it is bit old. So can I start with old site and change the html and code behind ? Some people argue that it is better to use MVC for ecommerce site. Any good reasons ? BTW I don't know MVC, but can learn if I have to use it. It is decided to use .NET but if you have any ideas of better technologies, please let me know. Any ideas and issues related to payment system also welcome. Any answer will be appreciated. Thanks Rgds,

    Read the article

  • SQL Server 2008 EF 4 - limiting database records returned using permissions?

    - by Chuck
    In our database all tables are linked back to a single table. This table has a bit column to limit whether the record is displayed. Currently the records are filtered on the code side of the website. Is there any way to set up permission so that userA would never see any record in the database where that common bit column was set to true? We are using SQL Server 2008. Alternatively we are also using entity framework 4.0 in .net 4 (in c#) if you have any ideas how it might be accomplished there? Thanks for your feedback.

    Read the article

  • How do you find the balance between Javascript (jQuery) and code behind in ASP.NET.

    - by PieterG
    Stackoverflow members, How do you currently find the balance between javascript and code behind. I have recently come across some extremely bad (in my eyes) legacy code that lends itself to chaos (someHugeJavafile.js) which contains a lot of the logic used in many of the pages. Let's say for example that you have a Form that you need to complete. 1. Personal Details 2. Address Information 3. Little bit more about yourself You don't want to overload the person with all the fields at once, so you decide to split it up into steps. Do you create separate pages for Personal Details, Address Information and a Little bit more about yourself. Do you create controls for each and hide and show them on a postback or using some update panel? Do you use jQuery and do some checking to ensure that the person has completed the required fields for the step and show the new "section" by using .show()? How do you usually find the balance?

    Read the article

  • Can't insert a number into a C++ custom streambuf/ostream

    - by 0xbe5077ed
    I have written a custom std::basic_streambuf and std::basic_ostream because I want an output stream that I can get a JNI string from in a manner similar to how you can call std::ostringstream::str(). These classes are quite simple. namespace myns { class jni_utf16_streambuf : public std::basic_streambuf<char16_t> { JNIEnv * d_env; std::vector<char16_t> d_buf; virtual int_type overflow(int_type); public: jni_utf16_streambuf(JNIEnv *); jstring jstr() const; }; typedef std::basic_ostream<char16_t, std::char_traits<char16_t>> utf16_ostream; class jni_utf16_ostream : public utf16_ostream { jni_utf16_streambuf d_buf; public: jni_utf16_ostream(JNIEnv *); jstring jstr() const; }; // ... } // namespace myns In addition, I have made four overloads of operator<<, all in the same namespace: namespace myns { // ... utf16_ostream& operator<<(utf16_ostream&, jstring) throw(std::bad_cast); utf16_ostream& operator<<(utf16_ostream&, const char *); utf16_ostream& operator<<(utf16_ostream&, const jni_utf16_string_region&); jni_utf16_ostream& operator<<(jni_utf16_ostream&, jstring); // ... } // namespace myns The implementation of jni_utf16_streambuf::overflow(int_type) is trivial. It just doubles the buffer width, puts the requested character, and sets the base, put, and end pointers correctly. It is tested and I am quite sure it works. The jni_utf16_ostream works fine inserting unicode characters. For example, this works fine and results in the stream containing "hello, world": myns::jni_utf16_ostream o(env); o << u"hello, wor" << u'l' << u'd'; My problem is as soon as I try to insert an integer value, the stream's bad bit gets set, for example: myns::jni_utf16_ostream o(env); if (o.badbit()) throw "bad bit before"; // does not throw int32_t x(5); o << x; if (o.badbit()) throw "bad bit after"; // throws :( I don't understand why this is happening! Is there some other method on std::basic_streambuf I need to be implementing????

    Read the article

  • c++ programming for clusters and HPC

    - by Abruzzo Forte e Gentile
    HI All I need to write a scientific application in C++ doing a lot of computations and using a lot of memory. I have part of the job but due to high requirements in terms of resources I was thinking to start moving to OpenMPI. Before doing that I have a simple curiosity: If I understood the principle of OpenMPI is the developer that has the task of splitting the jobs over different nodes calling SEND and RECEIVE based on node available at that time. Do you know if it does exist some library or OS or whatever that has this capability letting my code reamain as it is now? Basically something that connects all computers and let share as one their memory and CPU? I am a bit confused because of the high material available on the topic. Should I look at cloud computing? or Distributed Shared Memory? Can you help me or address me a bit? Thanks

    Read the article

  • Why does the infobox in my MSN Map not close?

    - by meder
    I'm having a bit of trouble with this map, invoked by the "View our interactive map" button in the middle of the content area. If you double click a point such as 8 which causes a zoom and then afterwards it causes the info box to appear, the hide logic is wrong. If you try to close the x, it will fail. This is probably because the user clicked too fast and the map thinks its in zoom mode when infact it should be in info box mode. Has anyone ran into this issue before? Looks like I have to mess around with window.ero.hide and some other functions.. because map.HideInfoBox doesn't hide the map. EDIT: The script used is here. I did not code it, but the relevant bit has: onclick="EnableEroHide();map.HideInfoBox();changePin();return false;" The map.HideInfoBox() should hide the info box.

    Read the article

  • What is the best way to automated (integration) test with java with OpenId4Java against real OpenIdP

    - by mP
    I would like to do a bit more than manually test my openid glue code which happens to use the openid4java library. My goals would be to be able to run it within my IDE with a bunch of tests using Junit or similar. Selenium & tomcat I was thinking of using selenium and a tomcat but thats not exactly a nice approach as this is a bit heavy and not really lightweight. httpunit A solution with http-unit is incomplete because it doesnt really fit with the redirect to my openid provider, authenticate and redirect back. Perhaps i am wrong but this looks like it could get quite involved just to make sure this works. Mocks My last solution is to mock everything and assume thats its accurate and works. If google or yahoo ever change in some way, then ill have to verify manually. The approach is simple but with a major flaw.

    Read the article

  • The Eclipse Executable Launcher Was Unable To Locate Its Companion Shared Library

    - by Caden Ratcliff
    I am a java beginner and am going through the book "Java In 24 Hours Sixth Edition" by Rogers Cadenhead. I am on chapter 24 "Creating an Android app". The book has told me to download Eclipse and Android SDK on my computer and to unzip the zip files they come in. I have put them both in the same parent file (C:\Documents and Settings\Administrator\My Documents\Downloads). Then the book tells me I can run Eclipse now and I get a message instead saying "The Eclipse Executable Launcher Was Unable To Locate Its Companion Shared Library". Is there a way to fix this? Do I just have to re-install SDK and Eclipse? I have downloaded SDK for windows 64-bit and I have windows 64-bit. Any info on how to fix this would be most appreciated.

    Read the article

  • Strategy for Storing Multiple Nullable Booleans in SQL

    - by Eric J.
    I have an object (happens to be C#) with about 20 properties that are nullable booleans. There will be perhaps a few million such objects persisted to a SQL database (currently SQL Server 2008 R2, but MySQL may need to be supported in the future). The instances themselves are relatively large because they contain about a paragraph of text as well as some other unrelated properties. For a given object instance, most of the properties will be null most of the time. When users search for instances of such objects, they will select perhaps 1-3 of the nullable boolean properties and search for instances where at least one of those 1-3 properties is non-null (OR search). My first thought is to persist the object to a single table with nullable BIT columns representing the nullable boolean properties. However, this strategy will require one index per BIT column to avoid performing a table scan when searching. Further, each index would not be particularly selective since there are only three possible values per index. Is there a better way to approach this problem?

    Read the article

  • Elegantly Handle Repetitive Property Code in C#

    - by Eric J.
    The language shortcut public string Code { get; set; } saves a bit of typing when defining trivial properties in C#. However, I find myself writing highly repetitive, not-quite-as-trivial property code that still follows a clear pattern e.g. public string Code { get { return code; } set { if (code != value) { code = value; NotifyPropertyChanged("Code"); } } } I can certainly define a Visual Studio snippet to reduce typing. However, if I need to add something to my pattern, I have to go back and change quite a bit of existing code. Is there a more elegant approach? Is a snippet the best way to go?

    Read the article

  • Assembly 6800 Looping? Testing specific bits in a word.

    - by Jeremy
    Hi all, Trying to help a friend out with a friend out with some assembly code, but I've run into a small problem. I'm trying to work out how I would loop through a 8 bit binary word and check the value of specific bits. I need to check bits 1, 3, 5 & 7 to see if they are 1. i.e. int count = 1; int bitAdd = 0; foreach (var bit in word) { if (count = 1 || count = 3 || count = 5 || count = 7) { bitAdd += 1; } count += 1; } Help is much appreciated.

    Read the article

  • Styled Javascript Popup that Conncects to Database

    - by user269799
    I want to create a javascript popup box that contains text fields. I want to be able to style this box - using CSS - and I want the textfield entries to be Inserted into a MySQL database. Is this possible? I would be familiar with doing this through web forms and server side scripting but I need it to be a bit more client side this time to make things seem a bit faster. I am thinking I may need to learn some AJAX but any pointers would be a help. GF

    Read the article

  • Forking Multiple Apps Under Python Subprocess

    - by noxtion
    Hello all. I have been looking through Google and SO for something that could help me solve this but I have run into a block. I am a bit new to Python but I am looking for a way to run multiple apps that will continuously run in the background. For example, I need 4 apps to start up with a param -appnum set to a different value. I would like to use python to count up and then start up a new app that will continue to run. I assumed I would use subprocess but I feel a bit overwhelmed by the documentation. I also plan to have the app print out sequences of numbers and would like to redirect this to a file. I noticed some of the SO questions talked about this, but I am a little confused on what to do. -Mike

    Read the article

  • Mass data store with SQL SERVER

    - by Leo
    We need management 10,000 GPS devices, each GPS device upload a GPS data every 30 seconds, these data need to store in the database(MS SQL Server 2005). Each GPS device daily data quantity is: 24 * 60 * 2 = 2,880 10 000 10,000 GPS devices daily data quantity is: 10000 * 2880 = 28,800,000 Each GPS data approximately 160Byte, the amount of data per day is: 28,800,000 * 160 = 4.29GB We need hold at least 3 months of GPS data in the database, My question is: 1, whether SQL Server 2005 can support such a large amount of data store? 2, How to plan data table? (all GPS data storage in one table? Daily table? Each GPS device with a GPS data table?) The GPS data: GPSID varchar(21), RecvTime datetime, GPSTime datetime, IsValid bit, IsNavi bit, Lng float, Lat float, Alt float, Spd smallint, Head smallint, PulseValue bigint, Oil float, TSW1 bigint, TSW1Mask bigint, TSW2 bigint, TSW2Mask, BSW bigint, StateText varchar(200), PosText varchar(200), UploadType tinyint

    Read the article

  • boost scoped_lock mutex crashes

    - by JahSumbar
    hello, I have protected a std::queue's access functions, push, pop, size, with boost::mutexes and boost::mutex::scoped_lock in these functions from time to time it crashes in a scoped lock the call stack is this: 0 0x0040f005 boost::detail::win32::interlocked_bit_test_and_set include/boost/thread/win32/thread_primitives.hpp 361 1 0x0040e879 boost::detail::basic_timed_mutex::timed_lock include/boost/thread/win32/basic_timed_mutex.hpp 68 2 0x0040e9d3 boost::detail::basic_timed_mutex::lock include/boost/thread/win32/basic_timed_mutex.hpp 64 3 0x0040b96b boost::unique_lock<boost::mutex>::lock include/boost/thread/locks.hpp 349 4 0x0040b998 unique_lock include/boost/thread/locks.hpp 227 5 0x00403837 MyClass::inboxSize - this is my inboxSize function that uses this code: MyClass::inboxSize () { boost::mutex::scoped_lock scoped_lock(m_inboxMutex); return m_inbox.size(); } and the mutex is declared like this: boost::mutex m_inboxMutex; it crashes at the last pasted line in this function: inline bool interlocked_bit_test_and_set(long* x,long bit) { long const value=1<<bit; long old=*x; and x has this value: 0xababac17 Thanks for the help

    Read the article

  • Crash when checking BOF property of pessimistic locked ADO recordset

    - by Patrick
    Bit of an odd one for you: I've got two connections to a database, on one I've opened a _RecordsetPtr with a pessimistic lock. I can no longer send an UPDATE command on the other connection. I can send a SELECT command on the second connection and data is returned. If I use a read only lock then there are no problems however when I use a pessimistic lock on the second connection as well I can check the State == adStateOpen but the program hangs when I test the BOF property! If I don't test the BOF property and try to call moveNext on the second connection the software hangs If I do neither of these I am able to access the data via the second connection but trying to access the data from the first connection causes the software to hang. Any one seen anything similar as I'm a bit stuck? EDIT : it wasn't hanging, someone had put a 30 minute timeout on the connection and I wasn't waiting that long while testing...

    Read the article

  • matplotlib plot window won't appear

    - by user1518837
    I'm using Python 2.7.3 in 64-bit. I installed pandas as well as matplotlib 1.1.1, both for 64-bit. Right now, none of my plots are showing. After attempting to plot from several different dataframes, I gave up in frustration and tried the following first example from http://pandas.pydata.org/pandas-docs/dev/visualization.html: INPUT: import matplotlib.pyplot as plt ts = Series(randn(1000), index=date_range ('1/1/2000', periods=1000)) ts = ts.cumsum() ts.plot() pylab.show() OUTPUT: Axes(0.125,0.1;0.775x0.8) And no plot window appeared. Other StackOverflow threads I've read suggested I might be missing DLLs. Any suggestions?

    Read the article

  • What is the best way to connect to an Oracle database to build my own IDE? [closed]

    - by rima
    before answer me plz thinking about the futures of these kind of program and answer me plz. I wanna get some data from oracle server like: 1-get all the function,package,procedure and etc for showing them or drop them & etc... 2-compile my *.sql files,get the result if they have problem & etc... becuz I was beginner in oracle first of all I for solve the second problem I try to connect to sqlPlus by RUN sqlplus and trace the output(I mean,I change the output stream of shell and trace what happend and handle the assigned message to customer. NOW THIS PART SUCCEED. just a little bit I have problem with get all result because the output is asynchronous.any way... [in this case I log in to oracle Server by send argument to the sqlplus by make a process in c#] after that I try to get all function,package or procedure name,but I have problem in speed!so I try to use oracle.DataAccess.dll to connect the database. now I m so confusing about: which way is correct way to build a program that work like Oracle Developer! I do not have any experience for like these program how work. If Your answer is I must use the second way follow this part plz: I search a little bit the Golden,PLedit (Benthic software),I have little bit problem how I must create the connection string?because I thinking about how I can find the host name or port number that oracle work on them?? am I need read the TNSNames.Ora file? IF your answer is I must use the first way follow this part plz: do u have any Idea for how I parse the output?because for example the result of a table is so confusing...[i can handle & program it but I really need someone experience,because the important things to me learn how such software work so nice and with quick response?] All of the has different style in output... If you are not sure Can u help me which book can help me in this way i become expert? becuz for example all the C# write just about how u can connect to DB and the DB books write how u can use this DB program,I looking for a book that give me some Idea how develop an interface for do transaction between these two.not simple send and receive data,for example how write a compiler for them. the language of book is not different for me i know C#,java,VB,sql,Oracle Thanks.

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >