Daily Archives

Articles indexed Tuesday June 8 2010

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

  • Bookmarklet, js injection and popup issue

    - by Neewok
    I'm currently writing a bookmarklet that loads and executes a remote js file by appending a new <script> tag in the current window, like so : javascript:(function() { if(typeof __bml_main != "undefined") return __bml_main.init(); var s= document.createElement('script'); s.type= 'text/javascript'; s.src= 'http://127.0.0.1:8000/media/bookmarklet.js'; void(document.body.appendChild(s)); })(); My bookmarklet needs to perform some dom manipulations in order to extract data from the page being viewed, and then to open a new popup to list them. The thing is : if I want to bypass pop-up blockers, I can't open my new window from the injected script. I need to open it right from the beginning in the bookmarklet code, and to access it later when needed. I've tried to do somehting like this : javascript:var my_popup = window.open('http://127.0.0.1:8000/resources/manage/new/', 'newResourcePopup',config='height=200,width=400,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no'); (function() { // script injection (...) })(); but if I then try to access my_popup from my remotely loaded script, most browsers will throw a security warning and won't let me access the Window object. This is understandable since the script is not from the same domain than the displayed page, but I'm kind of stuck... A solution would be to use a div overlay, but I'd really prefer to open a window in this case. Any hints ?

    Read the article

  • Return caret postion or range of a div in IE8

    - by Robin
    I am wanting to return the start and end range or the caret postion inside a div. The div will have the attribute contentEditable. typically I would use document.selection.createRange(); but the createRange function is broken in IE8 is there a way to get around this?

    Read the article

  • PHP: How to forward on $_FILES using cURL

    - by Toby
    Hi. I'm trying to use cURL to forward on a http request from a form in a web application I'm developing. Essentially I need to submit the same form twice on different servers, for the second server I'm adding some security measures to the post data. I can receive $_POST information on the second form perfectly fine, however I'm having major troubles with my $_FILES - I've tried separating the two so there's a separate request for post and files data but still no luck. Is this possible?

    Read the article

  • Numbered list in Report Builder export to word

    - by Daniel
    I have created a SQL Server Reporting Services Report Builder 3 report that contains a list of several items from a SharePoint list. I would like the list on the report to be a numbered list, so that when exported to Word, if a user adds another item to the document, the numbering is updated automatically. I can simulate a numbered list by creating a table and using 'RowNumber' in one of the columns, however this does not get rendered as a true numbered list. Is there any way to create a true numbered list in Report Builder 3

    Read the article

  • getting started with SMS developement

    - by I__
    i will have the following set up: people will be sending text messages to a server, and that server will be forwarding the messages to other phone numbers i am not sure what kind of framework i should use. should i develop an SMS gateway and use AT commands? should i just try to somehow use AIM or GCHAT to capture and send SMS messages? would there be a different more suitable configuration? are there already developed frameworks that are free which i can use? for example i know that i can send an SMS to almost anyone through gchat or aim by sending a message to "+" and the number of the person. is this scalable and can i use it for my own benefit? any sms developers out there?

    Read the article

  • C++: sizeof for array length

    - by Rosarch
    Let's say I have a macro called LengthOf(array): sizeof array / sizeof array[0] When I make a new array of size 23, shouldn't I get 23 back for LengthOf? WCHAR* str = new WCHAR[23]; str[22] = '\0'; size_t len = LengthOf(str); // len == 4 Why does len == 4? UPDATE: I made a typo, it's a WCHAR*, not a WCHAR**.

    Read the article

  • "Intercepting" user input into text box and removing it

    - by James P
    I have a text box that I would like to do some validation on. At the moment I have this code: function updateChanger() { // Validate input var likeMessage = validateInput($("#like").val()); alert(likeMessage); } function validateInput(input) { input = input.replace(/[^a-zA-Z0-9:\(\/\)\s\.,!~]/g, ""); return input; } This successfully trims out unwanted characters in the likeMessage variable, but the character still gets entered into the text box. I would like to stop that from happening. I know it will have something to do with $("#like").val() but the only thing I can think of is just chopping off the end character from the text box value, would this suffice? Thanks for any help!

    Read the article

  • Learn About HTML5 and the Future of the Web

    Learn About HTML5 and the Future of the Web San Francisco Java, PHP, and HTML5 user groups hosted an event on May 11th, 2010 on HTML5 with three amazing speakers: Brad Neuberg from Google, Giorgio Sardo from Microsoft, and Peter Lubbers from Kaazing. In this first of the three videos, Brad Neuberg from Google (formerly an HTML5 advocate and currently a Software Engineer on the Google Buzz team) explains why HTML5 matters - to consumers as well as developers! His overview of HTML5 included SVG/Canvas rendering, CSS transforms, app-cache, local databases, web workers, and much more. He also identified the scope and practical implications of the changes that are coming along with HTML5 support in modern browsers. This event was organized by Marakana, Michael Tougeron from Gamespot, and Bruno Terkaly from Microsoft. Microsoft was the host and Marakana, Gamespot, Medallia, TEKsystems, and Guidewire Software sponsored the event. marakana.com From: GoogleDevelopers Views: 177 6 ratings Time: 50:44 More in Science & Technology

    Read the article

  • CEO Is the New CRM

    - by andrea.mulder
    Danny Rippon launched his blogging career last week with The Marketer outlining how CRM has evolved from managing customer data to 'CEM' - Customer Experience Management, and for true market leaders it is moving towards 'CEO' - Customer Experience Optimisation. Or as we like to say here in the states Customer Experience Optimization (with a "z"). Click here to hear Danny's thought on why CEO Is the New CRM.

    Read the article

  • Can you open a form or window in an Outlook Addin (VSTO)

    - by dontpanic
    Hi, I am new to VSTO programming. I have created a basic addin for Outlook 2007 that monitors a folder containing XML text files which it opens and then sends them as an email, then deletes them. this all works fine. I want the user to be able to configure certain settings for the way the addin/program will operate, such as the folder that it will monitor, and other things. The logical way to do this is to create a menu item in the addin (which I have also done) that opens a windows form (or XAML window) that allows them to enter the parameters. In my addin I added a new item Windows Form, which worked, and the designer opened. However, in my addin code I cannot open the form. The Show() method normally associated with form objects is not available. Is this simply something you cannot do, or am I just doing it the wrong way? I have read about Outlook form regions, but these seemed to be attached to outlook items such as a new email, task, appointment etc... there doesnt seem to be a way to create a form region that can be opened in the main window of Outlook. Ideally, I would like to go with my original method of opening a new window from a menu item, but if this isnt possible I would like to hear other solutions. Thanks, Will.

    Read the article

  • Automatically CONCATENATE text on data entry

    - by Bill T
    I am a newbie and need help. I have a table called "Employees". It has 2 fields [number] and [encode]. I want to automatically take whatever number is entered into [number] and store it in [encode] so that it is preceded by the appropriate amount of 0's to always make 12 digits. Example: user enters '123' into [number], '000000000123' is automatically stored in [encode] user enters '123456789' into [number], '000123456789' is automatically stored in [encode] I think i want to write a trigger to accomplish this. I think that would make it happen at the time of data entry. is that right? The main idea is would be something like this: variable1 = LENGTH [number] variable2 = REPEAT (0,12-variable1) variable3 = CONCATENATE (variable2, [number]) [encode] = variable3 I just don't know enough to make this happen ANY help would be FANTASTIC. I have SQL-SERVER 2005 and both fields are text

    Read the article

  • .NET - Very strange NullReferenceException?

    - by ropstah
    How can I get a NullReferenceException in the following scenario? Dim langs As IEnumerable(Of SomeCustomObject) = //some LINQ query If langs Is Nothing Then Return Nothing If langs.Count = 1 Then //NullReferenceException here What am I missing here? Debug shows that langs is really just a LINQ queryresult without any results...

    Read the article

  • linux pthread_suspend

    - by johnnycrash
    Looks like linux doesnt implement pthread_suspend and continue, but I really need em. I have tried cond_wait, but it is too slow. The work being threaded mostly executes in 50us but occasionally executes upwards of 500ms. The problem with cond_wait is two-fold. The mutex locking is taking comparable times to the micro second executions and I don't need locking. Second, I have many worker threads and I don't really want to make N condition variables when they need to be woken up. I know exactly which thread is waiting for which work and could just pthread_continue that thread. A thread knows when there is no more work and can easily pthread_suspend itself. This would use no locking, avoid the stampede, and be faster. Problem is....no pthread_suspend or _continue. Any ideas?

    Read the article

  • Drupal Views Bonus Pack export issue

    - by evanmcd
    Hi, In trying to solve the problem of getting data from Drupal into XML, I found the Views Bonus Pack module, which with a little figuring out works great. Except... When setting the Style property in the Basic settings of Feed view to XML file no items show up unless I am authenticated. If I log in, I see all the entries. If I log out, I see only <xml> <node/> </xml> The Access setting is set to unrestricted in both the Defaults and the Feed view. Anybody have any ideas as to how to fix this? Thanks a lot.

    Read the article

  • markdown to HTML with customised WMD editor

    - by spirytus
    For my application I customized slightly the way WMD behaves so when user enters empty lines, these are reflected in HTML output as <br />'s. Now I came to a point when I should store it somewhere at backend and so after going thru SO posts for a while I'm not sure what is the best way to do it. I have few options and if you could point out which their pros/cons that would be much appreciated. send to server and store as markdown rather than HTML. To me obvious advantage would be keeping exactly same formatting as user originally entered. But then how can I convert it back to HTML for display to a client? It seems very troublesome to convert it on client side as even if it would be possible what would happen if JS would be disabled? If I wanted to do it on the server, then standard server side implementations of markup to HTML might be resource expensive. Would that be an issue in your opinion? Even if it wouldn't be the case then as I mentioned my WMD implementation is customised and those server side solutions wouldn't probably do the right conversion to markdown anyway and there always would be a risk that something would convert wrong. Send to server as converted HTML. Same as above.. conversion on client side would be difficult, server side same with possibility of getting it wrong. send original markdown and converted HTML and store both. No performance issues related to converting markdown to HTML on client side, nor on server side. Users would have always same markdown they originally entered and same HTML they originally saw in preview (possibly sanitized in php though). It would have to take twice that much storage space though and that is my biggest worry. I tend to lean towards 3rd solution as it seems simplest, but there is a worry of doubled storage space needed for this solution. Please bear in mind that my implementation of WMD is slightly modified and also I'm going with PHP/MySql server side implementation. So apart from 3 options I listed above, are there any other possible solutions to my problem? Did I miss anything important that would make one of the options above better then the rest? And what other pros/cons would apply to each solution I listed? Also how is it implemented on SO? I read somwhere that they using option 3, and so if its good enough for SO would be good enough for me :) but not sure if its true anyway, so how is it done? Also please forgive me, but at least for once I got to say that StackOverflow IS THE BEST DAMN RESOURCE ON THE WEB and I truly appreciate all the people trying to help others here! The site and users here are simply amazing!

    Read the article

  • Why is TRest in Tuple<T1... TRest> not constrained?

    - by Anthony Pegram
    In a Tuple, if you have more than 7 items, you can provide an 8th item that is another tuple and define up to 7 items, and then another tuple as the 8th and on and on down the line. However, there is no constraint on the 8th item at compile time. For example, this is legal code for the compiler: var tuple = new Tuple<int, int, int, int, int, int, int, double> (1, 1, 1, 1, 1, 1, 1, 1d); Even though the intellisense documentation says that TRest must be a Tuple. You do not get any error when writing or building the code, it does not manifest until runtime in the form of an ArgumentException. You can roughly implement a Tuple in a few minutes, complete with a Tuple-constrained 8th item. I just wonder why it was left off the current implementation? Is it possibly a forward-compatibility issue where they could add more elements with a hypothetical C# 5? Short version of rough implementation interface IMyTuple { } class MyTuple<T1> : IMyTuple { public T1 Item1 { get; private set; } public MyTuple(T1 item1) { Item1 = item1; } } class MyTuple<T1, T2> : MyTuple<T1> { public T2 Item2 { get; private set; } public MyTuple(T1 item1, T2 item2) : base(item1) { Item2 = item2; } } class MyTuple<T1, T2, TRest> : MyTuple<T1, T2> where TRest : IMyTuple { public TRest Rest { get; private set; } public MyTuple(T1 item1, T2 item2, TRest rest) : base(item1, item2) { Rest = rest; } } ... var mytuple = new MyTuple<int, int, MyTuple<int>>(1, 1, new MyTuple<int>(1)); // legal var mytuple2 = new MyTuple<int, int, int>(1, 2, 3); // illegal

    Read the article

  • How to accommodate for the different screen resolution of iPhone 4?

    - by mystify
    This is a programming question! Read on before you vote to close! According to Apple, iPhone 4 has a new screen resolution: 3.5-inch (diagonal) widescreen Multi-Touch display 960-by-640-pixel resolution at 326 ppi This little detail affects our apps in a heavy way. Most of the demo apps on the net have one thing in common: They position views in the believe that the screen has a fixed size of 320 x 480 pixels. So what most -if not all- developers do is: They designed everything in such a way, that a touchable area is -for example- 50 x 50 pixels big. Just enough to tap it. Things have been positioned relative to the upper left, to reach a specific position on screen - let's say the center, or somewhere at the bottom. Edit: It seems Apple has integrated an switch that allows to tell if an app is highRes or not. Nice. When we develop high-resolution apps, probably they won't work on older devices. And if they did, they would suffer a lot from 4-times the size of any image, having to scale them down in memory. This is community wiki. Just add anything that you think is relevant to this huge problem (constant screen res was one of the main reasons why I didn't go for Android!!).

    Read the article

  • Wordpress - related posts by custom taxonomy problem

    - by Nordin
    Hello, I'm trying to display related posts based on a custum taxonomy. I found a query at wordpress.org that kind of works. However the original post gets duplicated in the results multiple times. (words is the name of the custom taxonomy I use) What seems to happen is that the single post gets duplicated according to what amount showpost is set. Any idea's what could cause this? The code: <?php //for in the loop, display all "content", regardless of post_type, //that have the same custom taxonomy (e.g. words) terms as the current post $backup = $post; // backup the current object $found_none = '<h2>No related posts found!</h2>'; $taxonomy = 'words';// e.g. post_tag, category, custom taxonomy $param_type = 'words'; // e.g. tag__in, category__in, but genre__in will NOT work $post_types = get_post_types( array('public' => true), 'names' ); $tax_args=array('orderby' => 'none'); $tags = wp_get_post_terms( $post->ID , $taxonomy, $tax_args); if ($tags) { foreach ($tags as $tag) { $args=array( "$param_type" => $tag->slug, 'post__not_in' => array($post->ID), 'post_type' => $post_types, 'showposts'=>5, 'caller_get_posts'=>1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3> <?php $found_none = ''; endwhile; } } } if ($found_none) { echo $found_none; } $post = $backup; // copy it back wp_reset_query(); // to use the original query again ?>

    Read the article

  • What is the best XPS WYSIWYG Editor that will output XAML?

    - by Simon
    I am looking for a WYSIWYG for XPS that will ouput the raw XAML. My intentions is use the tool for a way to quickly generate and test the XAML (of XPS documents) with the intention of then generating the same xaml in code and programmatically generating an XPS document. The same approach that many people use for generating html. Can anyone recommend any of the below products or suggest any others? Better yet does anyone know of a free XPS editor? NiXPS Edit $300USD http://www.nixps.com/nixps_edit_20.html XamlPad is free but also quite limited and does not really target XPS. Office System Power Tools is not WYSIWYG http://blogs.msdn.com/adrianford/archive/2008/07/03/visual-studio-and-xps-files.aspx XPS eXaminer 1.0 $399USD http://storefront.qualitylogic.com/p-16-qualitylogic-xps-examiner.aspx

    Read the article

  • Server IP Release Time

    - by DanSpd
    Hello, With router IP Address does not change at all as long as you do not touch modem. If computer is connected to modem directly IP changes every hour or so. Whats causing it and how to fix. P.S. I am talking about WAN IP and not LAN IP

    Read the article

  • Flash movie randomly freeze the browser

    - by Erick
    Just recently it seems that my flash player have had some troubles to display flash videos (youtube/dailymotions and others like this). This issue was supposed to be fixed with Flash Player 10 beta if I remember correctly. My flash player is currently at the lastest version available (10.0.45.2) I'm currently on Windows 7 x64. I tried to uninstall it and reboot and reinstall it, didn't work. Sometimes when it freeze and I reboot it "fixes" temporary the problem. The freeze problem is each and every browser. If one fails and freeze, every browsers using the plugin or ActiveX (Opera 10.5/Chrome 5/Safari 4/IE 8/FF 3.7 all installed) will freeze upon playing. I'm quite out of inspirations for fixing this up now I dare say.

    Read the article

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