Daily Archives

Articles indexed Monday March 22 2010

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

  • Sending html data via $post fails

    - by Neil
    I am using the code below which is fine but when I use the code below that in an attempt to send an html fragment to a processing page to save it as a file but I get nothing. I have tried using ajax with processData set to false ads dataTypes of html, text and xml but nothing works. I can't find anything on this so I guess I must be missing something fairly trivial but I've been at it for 3 hours now. This works $.post("SaveFile.aspx", {f: "test4.htm", c: "This is a test"}, function(data){ alert(data); }, "text"); This fails $.post("SaveFile.aspx", {f: "test4.htm", c: "<h1>This is a test</h1>"}, function(data){ alert(data); }, "text");

    Read the article

  • Learning HTML - The Process.

    - by Gabe
    So, as recommended, I did the W3Schools HTML and XML tutorials this weekend. I understand the basics. Now should I look to get more depth in HTML, or go straight into learning CSS (and try to keep learning html at the same time)? If the first, where should I go for more advanced HTML tutorials?

    Read the article

  • Why is my Lucene index getting locked?

    - by Andrew Bullock
    I had an issue with my search not return the results I expect. I tried to run Luke on my index, but it said it was locked and I needed to Force Unlock it (I'm not a Jedi/Sith though) I tried to delete the index folder and run my recreate-indicies application but the folder was locked. Using unlocker I've found that there are about 100 entries of w3wp.exe (same PID, different Handle) with a lock on the index. Whats going on? I'm doing this in my NHibernate configuration: c.SetListener(ListenerType.PostUpdate, new FullTextIndexEventListener()); c.SetListener(ListenerType.PostInsert, new FullTextIndexEventListener()); c.SetListener(ListenerType.PostDelete, new FullTextIndexEventListener()); And here is the only place i query the index: var fullTextSession = NHibernate.Search.Search.CreateFullTextSession(this.unitOfWork.Session); var fullTextQuery = fullTextSession.CreateFullTextQuery(query, typeof (Person)); fullTextQuery.SetMaxResults(100); return fullTextQuery.List<Person>(); Whats going on? What am i doing wrong? Thanks

    Read the article

  • passing user from UITableView to UIWebView based on selection

    - by ct2k7
    Hello, I'm trying to pass the user on to the interface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView. UIWebView then displays local file, cell1.html. Currently, I've manage to get placeholder using: selectedCellText.text = selectedCell; to display the name of the cell selected. How do I get it to directly pass to the UIWebView, stick UIWebView in the interface and link it using: UIWebView *myWebView = [[UIWebView alloc] initWithFrame:frame]; NSBundle *mainBundle = [NSBundle mainBundle]; NSString *stringUrl = [mainBundle pathForResource:@"selectedCell" ofType:@"html"]; NSURL *baseUrl = [NSURL fileURLWithPath:stringUrl]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:baseUrl]; [myWebView loadRequest:urlRequest]; My other issue is that some of the cell names have spaces in them, and for simplicity, I'd like to ensure that there are no spaces (actually, will it even work with spaces in the name, I assume with %20 ? Thanks

    Read the article

  • Nice Generic Example that implements an interface.

    - by mbcrump
    I created this quick generic example after noticing that several people were asking questions about it. If you have any questions then let me know. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Globalization; namespace ConsoleApplication4 { //New class where Type implements IConvertible interface (interface = contract) class Calculate<T> where T : IConvertible { //Setup fields public T X; NumberFormatInfo fmt = NumberFormatInfo.CurrentInfo; //Constructor 1 public Calculate() { X = default(T); } //Constructor 2 public Calculate (T x) { X = x; } //Method that we know will return a double public double DistanceTo (Calculate<T> cal) { //Remove the.ToDouble if you want to see the methods available for IConvertible return (X.ToDouble(fmt) - cal.X.ToDouble(fmt)); } } class Program { static void Main(string[] args) { //Pass value type and call DistanceTo with an Int. Calculate<int> cal = new Calculate<int>(); Calculate<int> cal2 = new Calculate<int>(10); Console.WriteLine("Int : " + cal.DistanceTo(cal2)); //Pass value type and call DistanceTo with an Double. Calculate<double> cal3 = new Calculate<double>(); Calculate<double> cal4 = new Calculate<double>(10.6); Console.WriteLine("Double : " + cal3.DistanceTo(cal4)); //Pass reference type and call DistanceTo with an String. Calculate<string> cal5 = new Calculate<string>("0"); Calculate<string> cal6 = new Calculate<string>("345"); Console.WriteLine("String : " + cal5.DistanceTo(cal6)); } } }

    Read the article

  • Passenger, Apache and avoiding page caching

    - by user38382
    I'm hosting a rack application with passenger and apache. The application is setup to cache the content of each request to the public directory after each request. This allows apache to serve the content directly as a static page for future requests. I would like to tell Apache, presumably through some rewrite rules that any requests with query parameters should not be cached, but instead passed down to the rack application. With a mongrel setup I would just redirect it to the balancer if it meets my rewrite conditions. How do you do the same with passenger?

    Read the article

  • Slower than expected 802.11n wireless network speeds

    - by Ian
    I have two ASUS laptops running Windows 7 connected wirelessly via 802.11n at 150 Mbit, as reported by Task Manager. The router is Netgear WNDR3700. When testing the wireless connection speed using iperf, I'm not getting nearly 150 Mbit: C:\>iperf -c 10.0.0.123 -t 30 ------------------------------------------------------------ Client connecting to 10.0.0.123, TCP port 5001 TCP window size: 8.00 KByte (default) ------------------------------------------------------------ [148] local 10.0.0.116 port 53819 connected with 10.0.0.123 port 5001 [ ID] Interval Transfer Bandwidth [148] 0.0-30.0 sec 41.2 MBytes 11.5 Mbits/sec That's a typical result. Running parallel client threads does not increase the overall total speed. Why would I only be getting 11.5 Mbit on a 150 Mbit connection?

    Read the article

  • setting up multi-mon windows + mac

    - by psychotik
    Ok this is a stretch, but I know of some Windows only software that does this so curious if there is something that does it on the mac too. I have 2 monitors and 2 development machines - a PC and a Mac Mini. I want to be able to view/control both concurrently (one on each monitor). The Mac only has DVI out, the PC has both and my monitors have both. Any suggestions on how I can do it? A solution involving KVM or software (VNC/remoting) is OK... Thanks!

    Read the article

  • Forcing fputcsv to Use Enclosure For *all* Fields

    - by Alan Storm
    When I use fputcsv to write out a line to an open file handle, PHP will add an enclosing character to any column that it believes needs it, but will leave other columns without the enclosures. For example, you might end up with a line like this 11,"Bob ",Jenkins,"200 main st. USA ",etc Short of appending a bogus space to the end of every field, is there any way to force fputcsv to always enclose columns with the enclosure (defaults to a ") character?

    Read the article

  • How does JVM handles dynamic allocation

    - by Nile
    I want to understand how JVM manages heap for the dynamic allocations. Since every java program is invoked as a thread, when does JVM's garbage collector come into play. Also, how things work for javascript's dynamic allocation ?

    Read the article

  • Easiest way to create drop down with database generated options

    - by aarontb
    I'm trying to build a multi-level "game". A randomly generated option (Option1) will trigger other options in a drop down (Option2)...the options in the new drop down will be directly related the to Option1. Option2 will then trigger another drop down with info directly related to Option2 and so forth until reaching OptionEnd...any suggestions, preferably SQL and PHP. Thanks...yeah, I'm a n00b.

    Read the article

  • What would be the safest way to store objects of classes derived from a common interface in a common

    - by Svenstaro
    I'd like to manage a bunch of objects of classes derived from a shared interface class in a common container. To illustrate the problem, let's say I'm building a game which will contain different actors. Let's call the interface IActor and derive Enemy and Civilian from it. Now, the idea is to have my game main loop be able to do this: // somewhere during init std::vector<IActor> ActorList; Enemy EvilGuy; Civilian CoolGuy; ActorList.push_back(EvilGuy); ActorList.push_back(CoolGuy); and // main loop while(!done) { BOOST_FOREACH(IActor CurrentActor, ActorList) { CurrentActor.Update(); CurrentActor.Draw(); } } ... or something along those lines. This example obviously won't work but that is pretty much the reason I'm asking here. I'd like to know: What would be the best, safest, highest-level way to manage those objects in a common heterogeneous container? I know about a variety of approaches (Boost::Any, void*, handler class with boost::shared_ptr, Boost.Pointer Container, dynamic_cast) but I can't decide which would be the way to go here. Also I'd like to emphasize that I want to stay away as far as possible from manual memory management or nested pointers. Help much appreciated :).

    Read the article

  • ASP.NET MVC & Web Services

    - by ANaimi
    Hello, Does adding a Web Service to my ASP.NET MVC project break the whole concept of MVC? That Web Service (WCF) depends on the Model layer from my MVC project to communicate with the back-end (so it looks to me like it needs to be part of the MVC solution). Should I add this to the Controller or Model layer?

    Read the article

  • How do I dynamically create a document for download in Javascript?

    - by Nelson
    I'm writing some Javascript code that generates an XML document in the client (via Google Earth plugin). I'd like the user to be able to click a button on the page and be prompted to save that XML to a new file. If I were generating the XML server-side this would be easy, just make the button open the link. But the XML is generated client-side. I've come up with a couple of hacks that half-work, inspired in part by this StackOverflow question. But neither completely work. Here's a demo HTML with embedded code: <html><head><script> function getData() { return '<?xml version="1.0" encoding="UTF-8"?><doc>Hello</doc>'; } function dlDataURI() { window.open("data:text/xml;charset=utf-8," + getData()); } function dlWindow() { var w = window.open(); w.document.open(); w.document.write(getData()); w.document.close(); } </script><body> <div onclick="dlDataURI()">Click for Data URL</div> <div onclick="dlWindow()">Click for Window</div> </body></html> The dlDataURI() version works great in Firefox, poorly in Chrome (can't save), and not at all in IE. The Window() version works OK in Firefox and IE, and not well in Chrome (can't save, XML embedded inside HTML). Neither version ever prompts a user download, it always opens a new window trying to display the XML. Is there a good way to do what I want in client side Javascript? I'd like this to work in today's browsers, ideally Firefox, MSIE 8, and Chrome.

    Read the article

  • What linux permissions are need for www?

    - by Xeoncross
    I know that 777 is full read/write/execute permission for owner/group/other. So this doesn't seem to be needed as it leaves random users full permissions. What permissions are need to be used on /var/www so that... Source control like git or svn Normal users in a group like "websites" or added to "www-data" Servers like apache or lighthttpd And PHP/Perl/Ruby can all read, create, and run files there? If I'm correct, Ruby and PHP scripts are not "executed" directly - but passed to an interpreter. So there is no need for execute permission on files in /var/www. Therefore, it seems like the correct permission would be chmod -R 1660 which would make all files shareable by these four entities all files non-executable by mistake block everyone else from the directory entirely set the permission mode to "sticky" for all future files Is this correct? Update: I just realized that files and directories might need different permissions - I was talking about files above so i'm not sure what the directory permissions would need to be.

    Read the article

  • implementing ioctl() commands in FreeBSD

    - by thecoffman
    I am adding some code to an existing FreeBSD device driver and I am trying to pass a char* from user space to the driver. I've implemented a custom ioctl() command using the _IOW macro like so: #define TIBLOOMFILTER _IOW(0,253,char*) My call looks something like this: int file_desc = open("/dev/ti0", O_RDWR); ioctl(file_desc, TIBLOOMFILTER, (*filter).getBitArray()); close(file_desc); When I call ioctl() I get: Inappropriate ioctl for device as an error message. Any guess as to what may be doing wrong? I've defined the same macro in my device driver, and added it to the case statement.

    Read the article

  • Git: Can I commit my working directory to a new branch without commiting it to a current branch?

    - by Noli
    Somewhat new at Git.. I am working on a project, and had all of my tests passing on the master branch. I then made some changes, and when everything started failing, I realized that maybe I should have made those changes in a different branch. Is there I way I can commit the changes to a new branch without commiting them to my master branch, so that the master still has my passing tests?

    Read the article

  • Do WordPress widget (or sidebar) hooks exist?

    - by Jeff
    I'm trying to filter ALL widget output through a simple filter, but can't find any hooks and was hoping to be pointed in the right direction. Or possibly my efforts are not even possible? My simple filter is something like this: function clean_widget_output( $input ) { return str_replace( array( "\t", "\n", "\r" ), '', $input ); } add_[FILTER OR ACTION]( 'need_a_hook', 'clean_widget_output', 99 ); Any ideas? I'm pretty new to PHP, but I can get around.

    Read the article

  • Maintain denormalized data with NHibernate EventListener

    - by Michael Valenty
    I have one bit of denormalized data used for performance reasons and I'm trying to maintain the data with an NHibernate event listener rather than a trigger. I'm not convinced this is the best approach, but I'm neck deep into it and I want to figure this out before moving on. I'm getting following error: System.InvalidOperationException : Collection was modified; enumeration operation may not execute. System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) System.Collections.Generic.List`1.Enumerator.MoveNextRare() System.Collections.Generic.List`1.Enumerator.MoveNext() NHibernate.Engine.ActionQueue.ExecuteActions(IList list) NHibernate.Engine.ActionQueue.ExecuteActions() NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions (IEventSource session) NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) NHibernate.Impl.SessionImpl.Flush() NHibernate.Transaction.AdoTransaction.Commit() Here's the code to make happen: using (var tx = session.BeginTransaction()) { var business = session .Get<Business>(1234) .ChangeZipCodeTo("92011"); session.Update(business); tx.Commit(); // error happens here } and the event listener: public void OnPostUpdate(PostUpdateEvent @event) { var business = @event.Entity as Business; if (business != null) { var links = @event.Session .CreateQuery("select l from BusinessCategoryLink as l where l.Business.BusinessId = :businessId") .SetParameter("businessId", business.BusinessId) .List<BusinessCategoryLink>(); foreach (var link in links) { link.Location = business.Location; @event.Session.Update(link); } } }

    Read the article

  • Traversing/Manipulating new window from parent window with jquery

    - by Anthony
    I found a question already with a possible solution, but I had already tried the method suggested before reading it, and it even says it's inconsistent. So I guess I'm wondering why this doesn't work: $("img").click(function() { var imgwindow = window.open('imgwin.html','','width=460,height=345'); alert(imgwindow.find("img").attr("src")); }); The goal is to set the new window's img to the same src as the image that the user clicked to open the new window. But in the above scenario, I'm just trying to tap into the new window to get what it's already-set src. I have imgwin.html already written with a default src for the image, so it should alert that url. Instead I just get undefined. I also tried the following (which should be identical on the back end), but with the same results: $("img").click(function() { var imgwindow = window.open('imgwin.html','','width=460,height=345'); alert($("img",imgwindow).attr("src")); }); I even tried variations of wrapping the imgwindow variable in $() in case somehow jquery wasn't picking up on the variable as a DOM element. The only thing I can guess is that since window.open() is a method, jquery doesn't treat it like a DOM element, even though all documentation from basic javascript tutorials treat the variable as both a method to open the window and the pointer to the window's inner DOM.

    Read the article

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