Search Results

Search found 3179 results on 128 pages for 'david idev'.

Page 85/128 | < Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >

  • Access Flash Symbol Via Code from an .as Class

    - by David
    Hi, I've got a movie clip symbol in my .fla file that I need to reference in an .as file which is in a subfolder in the project. I select the symbol in the library and edit its properties. Its name is bubble; I Export for ActionScript and Export in frame 1. I give it a class name of Bubble. Now I need to go to my .as class, called SomeClass.as There, I need to reference the symbol, because I want to move it from within related code in that .as file. But if I try bubble.x I get an error. If I try var myBubble:Bubble = new Bubble(); I get 'Access of undefined property myBubble'. I was told that I might try 'importing the document class' but how do you import a class which is in the root directory of your app from within a class that's in a subfolder? (Don't know if this would provide the solution anyway)... Tanks.

    Read the article

  • TSQL - make a literal float value

    - by David B
    I understand the host of issues in comparing floats, and lament their use in this case - but I'm not the table author and have only a small hurdle to climb... Someone has decided to use floats as you'd expect GUIDs to be used. I need to retrieve all the records with a specific float value. sp_help MyTable -- Column_name Type Computed Length Prec -- RandomGrouping float no 8 53 Here's my naive attempt: --yields no results SELECT RandomGrouping FROM MyTable WHERE RandomGrouping = 0.867153569942739 And here's an approximately working attempt: --yields 2 records SELECT RandomGrouping FROM MyTable WHERE RandomGrouping BETWEEN 0.867153569942739 - 0.00000001 AND 0.867153569942739 + 0.00000001 -- 0.867153569942739 -- 0.867153569942739 In my naive attempt, is that literal a floating point literal? Or is it really a decimal literal that gets converted later? If my literal is not a floating point literal, what is the syntax for making a floating point literal? EDIT: Another possibility has occurred to me... it may be that a more precise number than is displayed is stored in this column. It may be impossible to create a literal that represents this number. I will accept answers that demonstrate that this is the case. EDIT: response to DVK. TSQL is MSSQLServer's dialect of SQL. This script works, and so equality can be performed deterministically between float types: DECLARE @X float SELECT top 1 @X = RandomGrouping FROM MyTable WHERE RandomGrouping BETWEEN 0.839110948199148 - 0.000000000001 AND 0.839110948199148 + 0.000000000001 --yields two records SELECT * FROM MyTable WHERE RandomGrouping = @X I said "approximately" because that method tests for a range. With that method I could get values that are not equal to my intended value. The linked article doesn't apply because I'm not (intentionally) trying to straddle the world boundaries between decimal and float. I'm trying to work with only floats. This isn't about the non-convertibility of decimals to floats.

    Read the article

  • Deobfuscating Javascript

    - by David Murdoch
    What is this monstrosity? Anyone know of a way to make it readable? <script type="text/javascript"> //<![CDATA[ <!-- var x="function f(x){var i,o=\"\",l=x.length;for(i=0;i<l;i+=2) {if(i+1<l)o+=" + "x.charAt(i+1);try{o+=x.charAt(i);}catch(e){}}return o;}f(\"ufcnitnof x({)av" + " r,i=o\\\"\\\"o,=l.xelgnhtl,o=;lhwli(e.xhcraoCedtAl(1/)3=!76{)rt{y+xx=l;=+;" + "lc}tahce({)}}of(r=i-l;1>i0=i;--{)+ox=c.ahAr(t)i};erutnro s.buts(r,0lo;)f}\\" + "\"(0),9\\\"\\\\$.;(.34U03\\\\\\\\16\\\\0E\\\\NSCZhC24\\\\03\\\\01\\\\\\\\St" + "DEMPbM02\\\\0C\\\\x#opms58aJ}qb<jb7`17\\\\\\\\hc7s17\\\\\\\\rzEeljdp7m03\\\\"+ "\\\\36\\\\0F\\\\24\\\\06\\\\01\\\\\\\\25\\\\01\\\\02\\\\\\\\26\\\\03\\\\03\\"+ "\\\\\\(W4N02\\\\\\\\24\\\\02\\\\00\\\\\\\\07\\\\0N\\\\14\\\\0P\\\\BI07\\\\0" + "4\\\\00\\\\\\\\02\\\\02\\\\02\\\\\\\\14\\\\06\\\\02\\\\\\\\24\\\\0L\\\\25\\" + "\\06\\\\01\\\\\\\\3:?(>4\\\"\\\\f(;} ornture;}))++(y)^(iAtdeCoarchx.e(odrCh" + "amCro.fngriSt+=;o27=1y%i;+=)y90==(iif){++;i<l;i=0(ior;fthnglex.l=\\\\,\\\\\\"+ "\"=\\\",o iar{vy)x,f(n ioctun\\\"f)\")" ; while(x=eval(x)); //--> //]]> </script>

    Read the article

  • Writing a VM - well formed bytecode?

    - by David Titarenco
    Hi, I'm writing a virtual machine in C just for fun. Lame, I know, but luckily I'm on SO so hopefully no one will make fun :) I wrote a really quick'n'dirty VM that reads lines of (my own) ASM and does stuff. Right now, I only have 3 instructions: add, jmp, end. All is well and it's actually pretty cool being able to feed lines (doing it something like write_line(&prog[1], "jmp", regA, regB, 0); and then running the program: while (machine.code_pointer <= BOUNDS && DONE != true) { run_line(&prog[machine.cp]); } I'm using an opcode lookup table (which may not be efficient but it's elegant) in C and everything seems to be working OK. My question is more of a "best practices" question but I do think there's a correct answer to it. I'm making the VM able to read binary files (storing bytes in unsigned char[]) and execute bytecode. My question is: is it the VM's job to make sure the bytecode is well formed or is it just the compiler's job to make sure the binary file it spits out is well formed? I only ask this because what would happen if someone would edit a binary file and screw stuff up (delete arbitrary parts of it, etc). Clearly, the program would be buggy and probably not functional. Is this even the VM's problem? I'm sure that people much smarter than me have figured out solutions to these problems, I'm just curious what they are!

    Read the article

  • shell_exec & clamav

    - by David
    When i call this: exec("clamscan --no-summary file.php", $out, $int); with good parameters, the script doen't finish. The file is too small and in console it comand duration is 2 seconds. If i put incorrect parameter the script finished and return correcte errorcode. With shell_exec it does the same.

    Read the article

  • How can I delete from a GridView when DataSource is a DataTable?

    - by David
    My DataSource is a DataTable populated from file system data in Page_Load. There is no database. How can I remove rows from the DataTable and rebind? I thought this had to be done in the GridView_RowCommand "Delete" section... if(e.CommandName == "Delete") ... When I try to access the DataRow's within //get the datatable DataTable dt = this.gridCPCP.DataSource as DataTable; // Delete the record foreach (DataRow dr in dt.Rows) { .... dt is null. How do I reference the DataTable when deleting records?

    Read the article

  • iPhone Push Notification Reliablity

    - by David Beck
    How reliable do you find push notification on the iPhone to be? Does it improve when moving from the sandbox to production server? I am testing (with the sandbox of course) and have found that notifications are often delayed or not received at all. I am not talking about sending multiple messages and only the last one arriving, as the documentation indicates, but any notification never showing up. Also, I noticed that if I send a notification with an alert, and then send one with just a badge number, that the second notification will close the alert even after it's already opened. Does this happen between apps as well? For instance, if I send an alert for my app, and then the Facebook app sends a badge, will the Facebook badge close my alert window?

    Read the article

  • Using Constants in Perl

    - by David W.
    I am trying to define constants in Perl using the use Constant pragma: use Constant { FOO => "bar", BAR => "foo" }; I'm running into a bit of trouble, and hoping there's a standard way of handling it. First of all... I am defining a hook script for Subversion. To make things simple, I want to have a single file where the class (package) I'm using is in the same file as my actual script. Most of this package will have constants involved in it: print "This is my program"; package "MyClass"; use constant { FOO => "bar" }; sub new { yaddah, yaddah, yaddah. I would like my constant FOO to be accessible to my main program. I would like to do this without having to refer to it as MyClass::FOO. Normally, when the package is a separate file, I could do this in my main program: use MyClass qw(FOO); but, since my class and program are a single file, I can't do that. What would be the best way for my main program to be able to access my constants defined in my class? The second issue... I would like to use the constant values as hash keys: $myHash{FOO} = "bar"; The problem is that %myHash has the literal string FOO as the key and not the value of the constant. This causes problems when I do things like this: if (defined($myHash{FOO})) { print "Key " . FOO . " does exist!\n"; } I could force the context: if (defined("" . FOO . "")) { I could add parentheses: if (defined(FOO())) { Or, I could use a temporary variable: my $foo = FOO; if (defined($foo)) { None of these are really nice ways of handling this issue. So, what is the best way? Is there one way I'm missing? By the way, I don't want to use Readonly::Scalar because it is 1). slow, and 2). not part of the standard Perl package. I want to define my hook not to require additional Perl packages and to be as simple as possible to work.

    Read the article

  • Why do escape characters break my Telerik call to ResponseScripts.Add(string)?

    - by David
    this displays the expected javascript alert message box: RadAjaxManager1.ResponseScripts.Add("alert('blahblahblah');"); while these does not: RadAjaxManager1.ResponseScripts.Add("alert('blahblah \n blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \r blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \r\n blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \n\t blahblahblah');"); RadAjaxManager1.ResponseScripts.Add(@"alert('blahblah \n blahblahblah');"); string message = "blahblahblah \n blahblahblah"; RadAjaxManager1.ResponseScripts.Add(message); I can't find any documentation on escape characters breaking this. I understand the single string argument to the Add method can be any script. No error is thrown, so my best guess is malformed javascript.

    Read the article

  • Blogger Template not saving after Facebook like changes

    - by David Shellabarger
    I've add the facebook Like button to http://www.goldfishview.com/ and that works great. Its powered by Blogger. Now I want to move it to the end of my posts instead of a the beginning. I move the facebook iframe and the preview looks great, but once I save the template it reverts back to were it was. I've tried in Chrome and Firefox. In Chrome after I click preview the save template button becomes useless and doesn't do anything when I click on it. In Firefox everything looks like it takes, but on page refresh the iFrame goes back to its original position. Am I crazy?

    Read the article

  • Weird camera Intent behavior

    - by David Erosa
    Hi all. I'm invoking the MediaStore.ACTION_IMAGE_CAPTURE intent with the MediaStore.EXTRA_OUTPUT extra so that it does save the image to that file. On the onActivityResult I can check that the image is being saved in the intended file, which is correct. The weird thing is that anyhow, the image is also saved in a file named something like "/sdcard/Pictures/Camera/1298041488657.jpg" (epoch time in which the image was taken). I've checked the Camera app source (froyo-release branch) and I'm almost sure that the code path is correct and wouldn't have to save the image, but I'm a noob and I'm not completly sure. AFAIK, the image saving process starts with this callback (comments are mine): private final class JpegPictureCallback implements PictureCallback { ... public void onPictureTaken(...){ ... // This is where the image is passed back to the invoking activity. mImageCapture.storeImage(jpegData, camera, mLocation); ... public void storeImage(final byte[] data, android.hardware.Camera camera, Location loc) { if (!mIsImageCaptureIntent) { // Am i an intent? int degree = storeImage(data, loc); // THIS SHOULD NOT BE CALLED WITHIN THE CAPTURE INTENT!! ....... // An finally: private int storeImage(byte[] data, Location loc) { try { long dateTaken = System.currentTimeMillis(); String title = createName(dateTaken); String filename = title + ".jpg"; // Eureka, timestamp filename! ... So, I'm receiving the correct data, but it's also being saved in the "storeImage(data, loc);" method call, which should not be called... It'd not be a problem if I could get the newly created filename from the intent result data, but I can't. When I found this out, I found about 20 image files from my tests that I didn't know were on my sdcard :) I'm getting this behavior both with my Nexus One with Froyo and my Huawei U8110 with Eclair. Could please anyone enlight me? Thanks a lot.

    Read the article

  • Hide Column based up Paramater Selected SSRS

    - by David A
    I would like to set the visiblity of columns based upon the value selected in a paramater. The problem is I do not want a specific paramater to do this (i.e Hide column X True/False) My report has several diffrent "departments" who are only intrested in certain columns. What would be the syntax for example to hide the "Sales" column when the "Customer Care" paramater is set?

    Read the article

  • translate ia32 into C

    - by David Lee
    I am trying to translate the following: Action: push %ebp #function prolog mov %esp, %ebp sub $0x10, %esp mov 0x8(%ebp), %eax #first line compiles to these 4 lines imul 0x8(%ebp), %eax sub $0x7, %eax mov %eax, -0x4(%ebp) addl $0x8, 0xc(%ebp) #second line mov -0x4(%ebp), %eax #third line mov 0xc(%ebp), %edx mov (%edx, %eax, 4), %eax add $0x3, %eax movb $0x41, (%eax) leave ret So far I have the following: //What am I missing? void Action(int x, char **y) { int z = x * x - 7; y+=8; //missing third line } What is the best way to translate this?

    Read the article

  • How to use a proprety/value table in MySQL

    - by David
    I inherited a mysql database that has a table with columns like this: object_id, property, value It holds data like this: 1,first_name,Jane 1,last_name,Doe 1,age,10 1,color,red 2,first_name,Mike 2,last_name,Smith 2,age,20 2,color,blue 3,first_name,John 3,last_name,Doe 3,age,20 3,color,red ... Basically what I want to do is treat this table as a regular table. How would I get the id numbers (or all properties) of a person who is age 20 sorted by last and than first name? So far I have: SELECT object_id FROM table WHERE property = 'age' AND value = '20' union SELECT object_id FROM table WHERE property = 'color' AND value = 'red' But I'm not sure how to go about ordering the data. Thanks

    Read the article

  • Creating A Single Threaded Server with AnyEvent (Perl)

    - by David Williams
    I'm working on creating a local service to listen on localhost and provide a basic call and response type interface. What I'd like to start with is a baby server that you can connect to over telnet and echoes what it receives. I've heard AnyEvent is great for this, but the documentation for AnyEvent::Socket does not give a very good example how to do this. I'd like to build this with AnyEvent, AnyEvent::Socket and AnyEvent::Handle. Right now the little server code looks like this: #!/usr/bin/env perl use AnyEvent; use AnyEvent::Handle; use AnyEvent::Socket; my $cv = AnyEvent->condvar; my $host = '127.0.0.1'; my $port = 44244; tcp_server($host, $port, sub { my($fh) = @_; my $cv = AnyEvent->condvar; my $handle; $handle = AnyEvent::Handle->new( fh => $fh, poll => "r", on_read => sub { my($self) = @_; print "Received: " . $self->rbuf . "\n"; $cv->send; } ); $cv->recv; }); print "Listening on $host\n"; $cv->wait; This doesn't work and also if I telnet to localhost:44244 I get this: EV: error in callback (ignoring): AnyEvent::CondVar: recursive blocking wait attempted at server.pl line 29. I think if I understand how to make a mini, single threaded server that simply prints out whatever its given and then waits for more input, I could take it a lot further from there. Any ideas?

    Read the article

  • Incongruity between Eclipse Outline/Package perspective and source code being displayed - Java error generated at runtime

    - by David Daedalus
    I've been debugging a Java application and have encountered something odd. When a particular method is called, Java throws a ClassNotFoundException. Unfortunately, the methods in question (the invoking and the 'missing' one) are inside a JAR file for which I have no documentation or source. To get at the source, I used JD-GUI (a Java JAR reverse engineer-er) and the JD plugin for Eclipse. As far as I can tell, the class in question exists inside the JAR file. This because JD-GUI displays it inside the JAR, and from within Eclipse I can see it listed along with the constructors and methods. My question is why the source being displayed in Eclipse is for a different class (that also exists)? This program was built with Ant - is it possible the problem lies there? Screenshot below for your viewing pleasure - and thanks in advance for your help!

    Read the article

  • video tag in iphone status

    - by David
    Is there any movie that actually works in iPhone/iPad safari using the video tag? We tried so many formats and code snippets. I've heard that mp4/h264 should work, but not for us. Can anyone point me to a working example online? If you know the code or specs/formats for the videotag on iphone, that would be great.

    Read the article

  • Linenumber for Exception thrown in runtime-compiled DotNET code

    - by David Rutten
    Not quite the same as this thread, but pretty close. My program allows people to enter some VB or C# code which gets compiled, loaded and executed at runtime. My CompilerParams are: CompilerParameters params = new CompilerParameters(); params.GenerateExecutable = false; params.GenerateInMemory = true; params.IncludeDebugInformation = false; params.TreatWarningsAsErrors = false; params.WarningLevel = 4; When this code throws an exception I'd like to be able to display a message box that helps users debug their code. The exception message is easy, but the line-number is where I got stuck. I suspect that in order to get at the line number, I may need to drastically change the CompilerParameters and perhaps even the way these dlls get stored/loaded. Does anyone know the least steps needed to get this to work?

    Read the article

  • In .NET, how do I prevent, or handle, tampering with form data of disabled fields before submission?

    - by David
    Hi, If a disabled drop-down list is dynamically rendered to the page, it is still possible to use Firebug, or another tool, to tamper with the submitted value, and to remove the "disabled" HTML attribute. This code: protected override void OnLoad(EventArgs e) { var ddlTest = new DropDownList() {ID="ddlTest", Enabled = false}; ddlTest.Items.AddRange(new [] { new ListItem("Please select", ""), new ListItem("test 1", "1"), new ListItem("test 2", "2") }); Controls.Add(ddlTest); } results in this HTML being rendered: <select disabled="disabled" id="Properties_ddlTest" name="Properties$ddlTest"> <option value="" selected="selected">Please select</option> <option value="1">test 1</option> <option value="2">test 2</option> </select> The problem occurs when I use Firebug to remove the "disabled" attribute, and to change the selected option. On submission of the form, and re-creation of the field, the newly generated control has the correct value by the end of OnLoad, but by OnPreRender, it has assumed the identity of the submitted control and has been given the submitted form value. .NET seems to have no way of detecting the fact that the field was originally created in a disabled state and that the submitted value was faked. This is understandable, as there could be legitimate, client-side functionality that would allow the disabled attribute to be removed. Is there some way, other than a brute force approach, of detecting that this field's value should not have been changed? I see the brute force approach as being something crap, like saving the correct value somewhere while still in OnLoad, and restoring the value in the OnPreRender. As some fields have dependencies on others, that would be unacceptable to me.

    Read the article

  • Moving a Point along a Path in SQL Server 2008

    - by David Pfeffer
    I have a geography field stored in my database, holding a linestring path. I want to move a point n meters along this linestring, and return the destination. For example, I want the destination point 500 meters along the linestring starting from its beginning. Here's an example -- what is the YourFunctionHere? Or, is there another way? DECLARE @g geography; SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656, -122.310 47.690)', 4326); SELECT @g.YourFunctionHere(100).ToString();

    Read the article

  • Can this jQuery code snippet be shortened?

    - by David Vidmar
    I have just stared using jQuery and although following code gets the job done, I have a feeling that it can be shortened. var accountAddress = $(document.createElement("input")).addClass("readOnly").attr("contentEditable", "false").attr("id", "d_accountAddress"); $("#customerid_c").next().next().next().append(accountAddress); If it is not clear - what I'm doing is creating new input tag, assigning class and making it readonly, then positioning new input two TD's to the right of some known text.

    Read the article

  • Optional attribute values in MappedField

    - by David Brooks
    I'm new to Scala and Lift, coming from a slightly odd background in PLT Scheme. I've done a quick search on this topic and found lots of questions but no answers. I'm probably looking in the wrong place. I've been working my way through tutorials on using Mapper to create database-backed objects, and I've hit a stumbling block: what types should be used to stored optional attribute values. For example, a simple ToDo object might comprise a title and an optional deadline (e.g. http://rememberthemilk.com). The former would be a MappedString, but the latter could not be a MappedDateTime since the type constraints on the field require, say, defaultValue to return a Date (rather than a Date or null/false/???). Is an underlying NULL handled by the MappedField subclasses? Or are there optional equivalents to things like MappedInt, MappedString, MappedDateTime that allow the value to be NULL in the database? Or am I approaching this in the wrong way?

    Read the article

< Previous Page | 81 82 83 84 85 86 87 88 89 90 91 92  | Next Page >