Daily Archives

Articles indexed Friday March 19 2010

Page 8/124 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Instantiating a System.Threading.Thread object in Jscript

    - by user297029
    I'm trying to create a new System.Threading.Thread object using Jscript, but I can't get the constructor to work. If I just do the following, var thread = new Thread( threadFunc ); function threadFunc() { // do stuff } then I get error JS1184: More than one constructor matches this argument list. However, if I try to coerce threadFunc to System.Threading.ThreadStart via var thread = new Thread( ThreadStart(threadFunc) ) I get error JS1208: The specified conversion or coercion is not possible Anyone know how to do this? It seems like it should be trivial.

    Read the article

  • Class initialization issues loading java.util.logging.LogManager in Android Dalvik VM

    - by Freddy B. Rose
    I've done changes in an Android native library and installed a new system.img file but am now getting an unrelated Error on startup. I can get past it by swallowing the error but I wanted to know if anyone can explain what the issue is. The Android implementation of Logger.java claims that it is Forcing the LogManager to be initialized since its class init code performs necessary one-time setup. But this forced initialization results in a NoClassDefFoundError. I'm thinking that it has something to do with the class not having been preloaded by Zygote yet but am not that familiar with the whole class loaders and VM business. If anyone has some insight it would be greatly appreciated. Thanks. I/Zygote ( 1253): Preloading classes... D/skia ( 1253): ------ build_power_table 1.4 D/skia ( 1253): ------ build_power_table 0.714286 W/dalvikvm( 1253): Exception Ljava/lang/StackOverflowError; thrown during Ljava/util/logging/LogManager;. W/dalvikvm( 1253): Exception Ljava/lang/NoClassDefFoundError; thrown during Ljava/security/Security;. W/dalvikvm( 1253): Exception Ljava/lang/ExceptionInInitializerError; thrown during Landroid/net/http/HttpsConnection;. E/Zygote ( 1253): Error preloading android.net.http.HttpsConnection. E/Zygote ( 1253): java.lang.ExceptionInInitializerError E/Zygote ( 1253): at java.lang.Class.classForName(Native Method) E/Zygote ( 1253): at java.lang.Class.forName(Class.java:237) E/Zygote ( 1253): at java.lang.Class.forName(Class.java:183) E/Zygote ( 1253): at com.android.internal.os.ZygoteInit.preloadClasses(ZygoteInit.java:295) E/Zygote ( 1253): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590) E/Zygote ( 1253): at dalvik.system.NativeStart.main(Native Method) E/Zygote ( 1253): Caused by: java.lang.ExceptionInInitializerError E/Zygote ( 1253): at javax.net.ssl.KeyManagerFactory$1.run(KeyManagerFactory.java:57) E/Zygote ( 1253): at javax.net.ssl.KeyManagerFactory$1.run(KeyManagerFactory.java:56) E/Zygote ( 1253): at java.security.AccessController.doPrivilegedImpl(AccessController.java:264) E/Zygote ( 1253): at java.security.AccessController.doPrivileged(AccessController.java:84) E/Zygote ( 1253): at javax.net.ssl.KeyManagerFactory.getDefaultAlgorithm(KeyManagerFactory.java:55) E/Zygote ( 1253): at org.apache.harmony.xnet.provider.jsse.SSLParameters.(SSLParameters.java:142) E/Zygote ( 1253): at org.apache.harmony.xnet.provider.jsse.SSLContextImpl.engineInit(SSLContextImpl.java:82) E/Zygote ( 1253): at android.net.http.HttpsConnection.initializeEngine(HttpsConnection.java:101) E/Zygote ( 1253): at android.net.http.HttpsConnection.(HttpsConnection.java:65) E/Zygote ( 1253): ... 6 more E/Zygote ( 1253): Caused by: java.lang.NoClassDefFoundError: java.util.logging.LogManager E/Zygote ( 1253): at java.util.logging.Logger.initHandler(Logger.java:419) E/Zygote ( 1253): at java.util.logging.Logger.log(Logger.java:1094) E/Zygote ( 1253): at java.util.logging.Logger.warning(Logger.java:906) E/Zygote ( 1253): at org.apache.harmony.luni.util.MsgHelp.loadBundle(MsgHelp.java:61) E/Zygote ( 1253): at org.apache.harmony.luni.util.Msg.getString(Msg.java:60) E/Zygote ( 1253): at java.io.BufferedInputStream.read(BufferedInputStream.java:316) E/Zygote ( 1253): at java.io.FilterInputStream.read(FilterInputStream.java:138) E/Zygote ( 1253): at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:157) E/Zygote ( 1253): at java.io.BufferedInputStream.read(BufferedInputStream.java:243) E/Zygote ( 1253): at java.util.Properties.load(Properties.java:302) E/Zygote ( 1253): at java.security.Security$1.run(Security.java:80) E/Zygote ( 1253): at java.security.Security$1.run(Security.java:67) E/Zygote ( 1253): at java.security.AccessController.doPrivilegedImpl(AccessController.java:264) E/Zygote ( 1253): at java.security.AccessController.doPrivileged(AccessController.java:84) E/Zygote ( 1253): at java.security.Security.(Security.java:66) E/Zygote ( 1253): ... 15 more W/dalvikvm( 1253): threadid=3: thread exiting with uncaught exception (group=0x2aac6170)

    Read the article

  • jQuery element with multiple classes: storing one class as a var

    - by Aaron
    I'm trying to create a standardized show/hide element system, like so: <div class="opener popup_1">Click Me</div> <div class="popup popup_1">I'm usually hidden</div> Clicking on the div with the opener class should show() the div with the popup class. I don't know how many opener/popup combinations I'm going to have on any given page, I don't know where on any given page the opener and the popup are going to be displayed, and I don't know how many popups a given opener should call show() for. Both the opener and the popup have to be able to have more classes than just what's used by jQuery. What I'd like to do is something like this: $(".opener").click(function() { var openerTarget = $(this).attr("class").filter(function() { return this.class.match(/^popup_([a-zA-Z0-9-_\+]*) ?$/); }); $(".popup." + openerTarget).show(); The idea is that when you click on an opener, it filters out "popup_whatever" from opener's classes and stores that as openerTarget. Then anything with class=popup and openerTarget will be shown.

    Read the article

  • Lua - How to use functions from another script

    - by Person
    I'm wondering how to use functions from another script in Lua. For example, say GameObjectUtilities holds functions that many GameObject scripts will use. The Slime (a GameObject) script wants to use a function in GameObjectUtilities. I'm having trouble getting this to work. I've looked here, but I still don't really fully understand. Do I need to create a module or a table to hold the functions in GameObjectUtilities for the functions in it to be used in other scripts? If so, what is the best way to go about this?

    Read the article

  • How do I stop server control attributes being HTML encoded?

    - by Billious
    I'm trying to alter the onmouseover attribute of a HyperLink server control, but when I do so the JavaScript call I'm entering gets HTML encoded. For example: linkBooks.Attributes("onmouseover") = "changeImages(""books"", ""/images/common/books-dark.png""); return true;" Gets converted to: onmouseover="changeImages(&quot;books&quot;, &quot;/images/common/books-dark.png&quot;); return true;" How do I prevent this? The same code worked fine under VS2005 and .NET 2.0, I'm currently using VS2010RC and .NET 4.0.

    Read the article

  • Precomputed Kernels with LibSVM in Python

    - by Lyyli
    I've been searching the net for ~3 hours but I couldn't find a solution yet. I want to give a precomputed kernel to libsvm and classify a dataset, but: How can I generate a precomputed kernel? (for example, what is the basic precomputed kernel for Iris data?) In the libsvm documentation, it is stated that: For precomputed kernels, the first element of each instance must be the ID. For example, samples = [[1, 0, 0, 0, 0], [2, 0, 1, 0, 1], [3, 0, 0, 1, 1], [4, 0, 1, 1, 2]] problem = svm_problem(labels, samples) param = svm_parameter(kernel_type=PRECOMPUTED) What is a ID? There's no further details on that. Can I assign ID's sequentially? Any libsvm help and an example of precomputed kernels really appreciated.

    Read the article

  • How do you efficiently implement a document similarity search system?

    - by Björn Lindqvist
    How do you implement a "similar items" system for items described by a set of tags? In my database, I have three tables, Article, ArticleTag and Tag. Each Article is related to a number of Tags via a many-to-many relationship. For each Article i want to find the five most similar articles to implement a "if you like this article you will like these too" system. I am familiar with Cosine similarity and using that algorithm works very well. But it is way to slow. For each article, I need to iterate over all articles, calculate the cosine similarity for the article pair and then select the five articles with the highest similarity rating. With 200k articles and 30k tags, it takes me half a minute to calculate the similar articles for a single article. So I need another algorithm that produces roughly as good results as cosine similarity but that can be run in realtime and which does not require me to iterate over the whole document corpus each time. Maybe someone can suggest an off-the-shelf solution for this? Most of the search engines I looked at does not enable document similarity searching.

    Read the article

  • How to determine the modulus of a Float in Ada 95

    - by mat_geek
    I need to determine the amount left of a time cycle. To do that in C I would use fmod. But in ada I can find no reference to a similar function. It needs to be accurate and it needs to return a float for precision. So how do I determine the modulus of a Float in Ada 95? elapsed := time_taken mod 10.348; left := 10.348 - elapsed; delay Duration(left);

    Read the article

  • Know any unobstrusive, simple GUI guidelines or design recommendations for notifications?

    - by Vinko Vrsalovic
    Hello again. I'm in the process of designing and testing various ideas for an application whose main functionality will be to notify users of occurring events and offer them with a choice of actions for each. The standard choice would be to create a queue of events showing a popup in the taskbar with the events and actions, but I want this tool to be the less intrusive and disrupting as possible. What I'm after is a good book or papers on studies of how to maximize user productivity in these intrinsically disruptive scenarios (in other words, how to achieve the perfect degree of annoying-ness, not too much, not too little). The user is supposedly interested in these events, they subscribe to them and can choose the actions to perform on each. I prefer books and papers, but the usual StackOverflow wisdom is appreciated as well. I'm after things like: Don't use popups, use instead X Show popups at most 3 seconds Show them in the left corner Use color X because it improves readability and disrupts less That is, cognitive aspects of GUI design that would help users in such a scenario.

    Read the article

  • Create A Java Variable (String) of a specific size (MB's)

    - by Bernie Perez
    I am trying to benchmark some code. I am sending a String msg over sockets. I want to send 100KB, 2MB, and 10MB String variables. Is there an easy way to create a variable of these sizes? Currently I am doing this. private static String createDataSize(int msgSize) { String data = "a"; while(data.length() < (msgSize*1024)-6) { data += "a"; } return data; } But this takes a very long time. Is there a better way?

    Read the article

  • Best way to play wav files in the browser?

    - by Splatzone
    I have no choice but to play wav files directly in the browser (serverside encoding to mp3 isn't an option, unfortunately.) What's the best way to do this? I'd really like to take advantage of the HTML 5 audio tag but my target audience includes many, many teens using IE6. As far as I'm aware flash isn't an option, but speedy playback really is critical. Thanks.

    Read the article

  • Recommendations OutSourcing .NET Work To Indian Team [closed]

    - by MT
    hi there, I've been asked to research outsourcing some of our C# winform development work. The aim is to employ a dedicated Indian team of around 5 developers reporting to myself. A google search provides a plethora of different companies, none of which I have ever heard of before. I'm a little skeptical about this plan at the moment but remain open minded. I was hoping some of you guys had some general advice about how to approach this. Or even better recommendations for companies to contact based upon your experiences? Many thanks

    Read the article

  • CLOB WRITE WITH OO4O

    - by Maagne Larsen
    I get the error : OIP-04908: This operation is not permitted on a Null LOB when Set MyClOB_0 = lOraDynaset_0.Fields("FILE_BODY").Value lOraDynaset_0.Edit amount_written = MyClOB_0.Write(buffer, chunksize, ORALOB_FIRST_PIECE)

    Read the article

  • Help to understand and recode javascript function to deal with special characters.

    - by Cesar Lopez
    Hi all, I am trying to rewrite a javascript function since I was told this function its a bit nasty peace of code and it could be nicely written by a very kind user from here. I have been trying to understand what the function does, therefore I could rewrite it properly, but since I dont fully understand how it works its a very difficult task. Therefore I am looking for help and directions (NOT THE SOLUTION AS I WANT TO LEARN MYSELF) to understand and rewrite this function in a nicer way. The function its been made for dealing with special characters, and I know that it loops through the string sent to it, search for special characters, and add what it needs to the string to make it a valid string. I have been trying to use value.replace(/"/gi,"/""), but surely I am doing it wrong as it crashes. Could anybody tell me where to start to recode function? Any help would be appreciated. My comments on the function are in capital letters. Code <script type="text/javascript"> function convertString(value){ for(var z=0; z <= value.length -1; z++) { //if current character is a backslash||WHY IS IT CHECKING FOR \\,\\r\\n,and \\n? if(value.substring(z, z + 1)=="\\" && (value.substring(z, z + 4)!="\\r\\n" && value.substring(z, z + 2)!="\\n")) {//WHY IS IT ADDING \\\\ TO THE STRING? value = value.substring(0, z) + "\\\\" + value.substring(z + 1, value.length); z++; } if(value.substring(z, z + 1)=="\\" && value.substring(z, z + 4)=="\\r\\n") {//WHY IS IT ADDING 4 TO Z IN THIS CASE? z = z+4; } if(value.substring(z, z + 1)=="\\" && value.substring(z, z + 2)=="\\n") {//WHY IS IT ADDING 2 TO Z IN THIS CASE? z = z+2; } } //replace " with \" //loop through each character for(var x = 0; x <= value.length -1; x++){ //if current character is a quote if(value.substring(x, x + 1)=="\""){//THIS IS TO FIND \, BUT HAVENT THIS BEEN DONE BEFFORE? //concatenate: value up to the quote + \" + value AFTER the quote||WHY IS IT ADDING \\ BEFORE \"? value = value.substring(0, x) + "\\\"" + value.substring(x + 1, value.length); //account for extra character x++; } } //return the modified string return(value); } <script> Comments within the code on capital letters are my questions about the function as I mention above. I would appreciate any help, orientation, advise, BUT NOT THE SOLUTION PLEASE AS I DO WANT TO LEARN.

    Read the article

  • Constructor invocation returned null: what to do?

    - by strager
    I have code which looks like: private static DirectiveNode CreateInstance(Type nodeType, DirectiveInfo info) { var ctor = nodeType.GetConstructor(new[] { typeof(DirectiveInfo) }); if(ctor == null) { throw new MissingMethodException(nodeType.FullName, "ctor"); } var node = ctor.Invoke(new[] { info }) as DirectiveNode; if(node == null) { // ???; } return node; } I am looking for what to do (e.g. what type of exception to throw) when the Invoke method returns something which isn't a DirectiveNode or when it returns null (indicated by // ??? above). (By the method's contract, nodeType will always describe a subclass of DirectiveNode.) I am not sure when calling a constructor would return null, so I am not sure if I should handle anything at all, but I still want to be on the safe side and throw an exception if something goes wrong.

    Read the article

  • How do DotNetOpenAuth whitelist and blacklists work?

    - by Jeff
    Does anyone have any documentation on DotNetOpenAuth and the way it handles while lists and black lists? My config <untrustedWebRequest> <blacklistHosts> <add name="*" /> </blacklistHosts> <whitelistHosts> <add name="www.mysite.ca" /> <add name="mysite.ca" /> <add name="devel.mysite.ca" /> <add name="devel.mysite.com" /> <add name="mysite.com" /> <add name="www.mysite.com" /> </whitelistHosts> </untrustedWebRequest> What I want is to have it cancel the request if it's any site not in the whilelist. I'm currently running version 2.5.49045 but plan to update soon. using <blacklistHostsRegex> <add name=".*" /> </blacklistHostsRegex> blocked ever site even ones in the whitelist.

    Read the article

  • get rotation direction of UIView on touchesMoved

    - by mlecho
    this may sound funny, but i spent hours trying to recreate a knob with a realistic rotation using UIView and some trig. I achieved the goal, but now i can not figure out how to know if the knob is rotating left or right. The most pertinent part of the math is here: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint pt = [touch locationInView:self]; float dx = pt.x - iv.center.x; float dy = pt.y - iv.center.y; float ang = atan2(dy,dx); //do the rotation if (deltaAngle == 0.0) { deltaAngle = ang; initialTransform = iv.transform; }else { float angleDif = deltaAngle - ang; CGAffineTransform newTrans = CGAffineTransformRotate(initialTransform, -angleDif); iv.transform = newTrans; currentValue = [self goodDegrees:radiansToDegrees(angleDif)]; } } ideally, i could leverage a numeric value to tell me if the rotation is positive or negative.

    Read the article

  • Virtual PC on Windows 7 - Hardware-assisted virtualization is disabled

    - by DLux
    I am running a Lenovo Thinkpad T61 with an Intel Core 2 Duo T7300 processor. When I run Virtual PC in Windows 7, I get the following error: Unable to start Windows Virtual PC because hardware-assisted virtualization is disabled. When running the Hardware-Assisted Virtualization Detection Tool from Microsoft says: Hardware-assited virtualization is not enabled on this computer. Now, in the BIOS, I do have virtualization enabled and according to Intel this processor supports Intel-VT. What am I missing here?

    Read the article

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