Daily Archives

Articles indexed Wednesday April 21 2010

Page 19/126 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • How do I refresh TinyMCE for the code that I add with JavaScript

    - by Sam Kong
    Hi, I need to insert code for flash to TinyMCE with JavaScript. If I insert the same code using HTML menu of TinyMCE, it automatically add flash icon to the editor. But if I insert the code using JavaScript, the actual code is inserted but it shows nothing on the screen. One trick I found is toggle TinyMCE to normal textarea and back to TinyMCE. Then, it shows the flash icon. Is there a better way to do that? Thanks. Sam

    Read the article

  • Query String in javascript

    - by Ajith
    By using document.referrer we will get all the reference of url in javascript.ie,may be output like follows http://localhost/testwordpress/wp-admin/admin.php?page=thesis-options&upgraded=true.From this output how can we differentiate the query string part only ( ie,?page=thesis-options&upgraded=true).Is there any method in javacript?Please help anybody knows........

    Read the article

  • [GWT2] UiBinder work with ToggleButton

    - by EnToutCas
    I'm liking the new GWT2 UiBinder, however, it's not clear whether certain things are achievable using the declarative UI style. For instance, ToggleButton only takes the image instances at construction time (no setters for up/down images). As I understand, UiBinder works in a JavaBean-like reflective way, where the assignable attributes are mapped to corresponding setters. Is this style possible with widgets like ToggleButton, where certain attributes have to be specified at construction time? <g:ToggleButton ui:field="myBtn"></g:ToggleButton>

    Read the article

  • tool for adding parentheses to equations?

    - by jedierikb
    Is there an online tool for adding parentheses to simple math equations? For example, a + b * c into a + (b * c) Those who paid more attention in math class might be able to tackle order of operations for huge equations in their head, but I could often use some help (and verification of my thinking). I often encounter other people's libraries having equations and functions I need for my code, and this would be kind of helpful for debugging and understanding. I was hoping Wolfram Alpha would do this, but the output is not easy to plug back into most programming languages e.g. a + (bc)

    Read the article

  • problem while finding iphone memory programatically

    - by sneha
    I am facing a strange problem with my iphone. It shows available memory as 278 Mb from settings and also in the itunes . But when i find it programatically like this NSDictionary *fileSystemAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error]; double availableSpace = [[fileSystemAttributes objectForKey:NSFileSystemFreeSize] floatValue]; I am getting it as 458.0 Mb. Can any one help me out why i m having so much difference between both the values ?? As both the values should be same Thanks in advance

    Read the article

  • for question about autorotation

    - by user177893
    my superview is UItabelview and my subviews are UITabelview and UIDatePicker. for my subviews didn't able to call (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration why? bcoz this method calls when view rotates and at that time i want to set autoresizingmask method for that view so that when my subview rotates from Portrait to landscape mode it's view resizes automatically?

    Read the article

  • How do I prevent Outlook users voting multiple times

    - by Rick
    Using the voting buttons in Outlook 2007, apparently users can submit votes as many times as they like. (I have just now verified this behaviour.) Is there a way to restrict the uses to just one vote each? I've found a script online which claims to do this, but there's no way I can use a script like that across our company. I'm hoping it's just a configuration setting either in the outbound email, or in the user's Outlook client.

    Read the article

  • Time to Experience the Benefits of SEO

    It is so easy and pleasant to work in company that grows more and more without the hard pressures to employees because of SEO. Benefits are ready for you to experience if you will try to understand how SEO will work for you and your business marketing and sales.

    Read the article

  • How is inheritance implemented at the memory level?

    - by cambr
    Suppose I have class A { public: void print(){cout<<"A"; }}; class B: public A { public: void print(){cout<<"B"; }}; class C: public C { }; How is inheritance implemented at the memory level? Does C copy print() code to itself or does it have a pointer to the it that points somewhere in A part of the code? How does the same thing happen when we override the previous definition, for example in B (at the memory level)?

    Read the article

  • Multithreading in PHP

    - by Jack
    I am working on windows. I am building a twitter application which periodically checks for new tweets as well as allows users to update their status. I have written separate PHP files for reading (reader.php) and writing tweets (writer.php). The only problem is how do I periodically read the tweets. There are a few ways which I can think of - 1) Use a time-based job scheduler (like Cron) to periodically run the reader.php. How do I do this? 2) Use multithreading to run both reader and writer.php and use a timer function in reader.php Suggestions?

    Read the article

  • Running time for Dijkstra's algorithm on a priority queue implemented by sorted list/array

    - by jay
    So I'm curious to know what the running time for the algorithm is on on priority queue implemented by a sorted list/array. I know for an unsorted list/array it is O((n^2+m)) where n is the number of vertices and m the number of edges. Thus that equates to O(n^2) time. But would it be faster if i used an sorted list/array...What would the running time be? I know extractmin would be constant time.

    Read the article

  • Finding intersection of two spheres

    - by Onkar Deshpande
    Hi, Consider the following problem - I am given 2 links of length L0 and L1. P0 is the point that the first link starts at and P1 is the point that I want the end of second link to be at in 3-D space. I am supposed to write a function that should take in these 3-D points (P0 and P1) as inputs and should find all configurations of the links that put the second link's end point at P1. My understanding of how to go about it is - Each link L0 and L1 will create a sphere S0 and S1 around itself. I should find out the intersection of those two spheres (which will be a circle) and print all points that are on the circumference of that circle. I saw gmatt's first reply on the http://stackoverflow.com/questions/1406375/finding-intersection-points-between-3-spheres but could not understand it properly since the images did not show up. I also saw a formula for finding out the intersection at mathworld[dot]wolfram[dot]com/Sphere-SphereIntersection[dot]html . I could find the radius of intersection by the method given on mathworld. Also I can find the center of that circle and then use the parametric equation of circle to find the points. The only doubt that I have is will this method work for the points P0 and P1 mentioned above ? Please comment and let me know your thoughts.

    Read the article

  • IEnumerable<T> ToArray usage, is it a copy or a pointer?

    - by Daniel
    I am parsing an arbitrary length byte array that is going to be passed around to a few different layers of parsing. Each parser creates a Header and a Packet payload just like any ordinary encapsulation. And my problem lies in how the encapsulation holds its packet byte array payload. Say i have a 100 byte array, and it has 3 levels of encapsulation. 3 packet objects will be created and i want to set the payload of these packets to the corresponding position in the byte array of the packet. For example lets say the payload size is 20 for all levels, then imagine it has a public byte[] Payload on each object. However the problem is that this byte[] Payload is a copy of the original 100 bytes. So i'm going to end up with 160 bytes in memory instead of 100. If it were in c++ i could just easily use a pointer however i'm writing this in c#. So i created the following class: public class PayloadSegment<T> : IEnumerable<T> { public readonly T[] Array; public readonly int Offset; public readonly int Count; public PayloadSegment(T[] array, int offset, int count) { this.Array = array; this.Offset = offset; this.Count = count; } public T this[int index] { get { if (index < 0 || index >= this.Count) throw new IndexOutOfRangeException(); else return Array[Offset + index]; } set { if (index < 0 || index >= this.Count) throw new IndexOutOfRangeException(); else Array[Offset + index] = value; } } public IEnumerator<T> GetEnumerator() { for (int i = Offset; i < Offset + Count; i++) yield return Array[i]; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { IEnumerator<T> enumerator = this.GetEnumerator(); while (enumerator.MoveNext()) { yield return enumerator.Current; } } } This way i can simply reference a position inside the original byte array but use positional indexing. However if i do something like: PayloadSegment<byte> something = new PayloadSegment<byte>(someArray, 5, 10); byte[] somethingArray = something.ToArray(); Will the somethingArray be a copy of the bytes, or a reference to the original PayloadSegment which in turn is a reference to the original byte array? Sorry it was hard to word this lol _<

    Read the article

  • Saving data - does work on Simulator, not on Device

    - by Peter Hajas
    I use NSData to persist an image in my application. I save the image like so (in my App Delegate): - (void)applicationWillTerminate:(UIApplication *)application { NSLog(@"Saving data"); NSData *data = UIImagePNGRepresentation([[viewController.myViewController myImage]image]); //Write the file out! NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path_to_file = [documentsDirectory stringByAppendingString:@"lastimage.png"]; [data writeToFile:path_to_file atomically:YES]; NSLog(@"Data saved."); } and then I load it back like so (in my view controller, under viewDidLoad): NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path_to_file = [documentsDirectory stringByAppendingString:@"lastimage.png"]; if([[NSFileManager defaultManager] fileExistsAtPath:path_to_file]) { NSLog(@"Found saved file, loading in image"); NSData *data = [NSData dataWithContentsOfFile:path_to_file]; UIImage *temp = [[UIImage alloc] initWithData:data]; myViewController.myImage.image = temp; NSLog(@"Finished loading in image"); } This code works every time on the simulator, but on the device, it can never seem to load back in the image. I'm pretty sure that it saves out, but I have no view of the filesystem. Am I doing something weird? Does the simulator have a different way to access its directories than the device? Thanks!

    Read the article

  • Django multiple generic_inline_formset in a view

    - by Can Burak Cilingir
    We have a bunch of formsets: EmailAddressInlineFormSet = generic_inlineformset_factory( EmailAddress, extra=1, exclude=["created_by","last_modified_by"]) emailaddressformset = EmailAddressInlineFormSet( instance=person, prefix="emailaddress") # [ more definitions ] and, in the view, we process them as: emailaddressformset = EmailAddressInlineFormSet( request.POST, instance=person, prefix="emailaddress") # [ more definitions ] So, nothing fancy or unordinary. The unfortunate or unordinary fact is, we have 15 of these formsets, one for email addresses, other for phone numbers etc. so the view code is ugly and not-so-manageable. What would be the most unhackish way to handle this number of formsets in a single view? At the end -i guess- I'm looking for a class or a functionality like multiple_generic_inline_formset and open to all kind of suggestions or discussions.

    Read the article

  • How to add 1 to the value of a column of an existing row in mysql

    - by mithun1538
    Hello everyone, I have a table called pollData. It will always contain only 1 row. It has columns option1, option2, option3, option4, option5 each of type int. In the beginning, these columns have 0 as their value. How do I add 1 to any column, say option2? I mean do i retrieve the value of that column first, perform addition, and store back, or is there any auto increment function?

    Read the article

  • Problem with DOMPDF and Kohana 3

    - by alex
    I have used DOMPDF many times before successfully, however outside of the Kohana Framework. I created a module for DOMPDF and called it simply pdf. Here is it's code. class Pdf { private $domPdfInstance; public function __construct($html) { if ( ! class_exists('DOMPDF', FALSE)) { // Load DOMPDF require Kohana::find_file('vendor', 'dompdf/dompdf_config.inc'); } $this->domPdfInstance = new DOMPDF; $this->domPdfInstance->load_html($html); } public function render() { $this->domPdfInstance->render(); return $this; } public function stream($filename) { if (pathinfo($filename, PATHINFO_EXTENSION) !== 'pdf') { $filename .= '.pdf'; } $this->domPdfInstance->stream($filename); return $this; } } For some reason, any PDF I generate using this results in it being corrupt (not opening under Mac OS X's Preview app at least). I have even tried this basic HTML <html> <head> <title>PDF</title> </head> <body> please work </body> </html> Is this a known problem? I have not touched anything in dompdf_config.inc.php except uncomment out the error reporting levels so they now read error_reporting(E_STRICT | E_ALL); PHP is not reporting any errors. Here is a screenshot of the error from Preview (though I think it's probably unhelpful) Some thing I have thought may be a problem Auto loading conflicts Base path conflicts

    Read the article

  • Prevent jQuery Tabs to bind to <ul> elements below the main <ul> element.

    - by Shiki
    Hi, I have this HTML: <div id="mytabs"> <ul id="main-tabs"> <li><a href="">Link</a></li> <li><a href="">Link</a></li> <li class="filter"> <ul id="filter-controls"> <li><a href="">Filter by something</a></li> <li><a href="">Filter by something</a></li> <li><a href="">Filter by something</a></li> </ul> </li> </ul> </div> And I set it to a tabbed control: $('#mytabs').tabs(); My problem is jQuery UI also converts the <li> elements in <ul id="filter-controls"> into tabs. Is there a way to instruct jQuery UI to only set the <li> children of <ul id="main-tabs"> as the tabs? Note: I am currently in no position to change <ul id="filter-controls" into a non-ul element.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >