Search Results

Search found 2767 results on 111 pages for 'alex king'.

Page 82/111 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • Why doesn't my javascript work after AJAX filling the HTML?

    - by alex
    $.ajax({ method:"get", url:"/details/", data:"id="+id, beforeSend:function(){ }, success:function(html){ $("#holder").html(html); } }); After I fill a div with a HTML from an AJAX call, this is my javascript at the top of /details/ <script type="text/javascript"> alert('hi'); </script> MY DETAILS HTML CONTENT GOES HERE But it's not working

    Read the article

  • How to call a generic method with an anonymous type involving generics?

    - by Alex Black
    I've got this code that works: def testTypeSpecialization = { class Foo[T] def add[T](obj: Foo[T]): Foo[T] = obj def addInt[X <% Foo[Int]](obj: X): X = { add(obj) obj } val foo = addInt(new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) } But, I'd like to write it like this: def testTypeSpecialization = { class Foo[T] def add[X, T <% Foo[X](obj: T): T = obj val foo = add(new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) } This second one fails to compile: no implicit argument matching parameter type (Foo[Int]{ ... }) = Foo[Nothing] was found. Basically: I'd like to create a new anonymous class/instance on the fly (e.g. new Foo[Int] { ... } ), and pass it into an "add" method which will add it to a list, and then return it The key thing here is that the variable from "val foo = " I'd like its type to be the anonymous class, not Foo[Int], since it adds methods (someMethod in this example) Any ideas? I think the 2nd one fails because the type Int is being erased. I can apparently 'hint' the compiler like this: def testTypeSpecialization = { class Foo[T] def add[X, T <% Foo[X]](dummy: X, obj: T): T = obj val foo = add(2, new Foo[Int] { def someMethod: String = "Hello world" }) assert(true) }

    Read the article

  • How to write specific application for facebook?

    - by alex
    Hi there! Please help me with documentation to write specific application for Facebook. Need to know, what language to choose? is specific facebook API? is documentation for API? is site with samples catalogue? need to know all related info. Some words about app, it would be app, which compare users interests. Thanks in advance.

    Read the article

  • Scan site for images and alt tags

    - by Alex
    We'd like to run an scan on our site that returns a report with the following: each image tag found and a visual representation of that image on the report the alt tag for that image (also identify if an alt tag not found) Is there a simple tool that does this? We're attempting to check for alt tags, and make sure the alt tags accurately describe to the image they represent. That's why the visual representation in the report is important.

    Read the article

  • Access to the path Server.MapPath is denied

    - by Alex
    I created one pdf document var document = new Document(); string path = Server.MapPath("AttachementToMail"); PdfWriter.GetInstance(document, new FileStream(path + "/"+DateTime.Now.ToShortDateString()+".pdf", FileMode.Create)); Now I want to download this document Response.ContentType = "Application/pdf"; Response.AppendHeader("Content-Disposition", "attachment; filename="+ DateTime.Now.ToShortDateString() + ".pdf" + ""); Response.TransmitFile(path); Response.End(); but it gave me error Access to the path '~\AttachementToMail' is denied. read / write access for IIS_IUSRS exists

    Read the article

  • jQuery slideUp and slideDwon issues

    - by Alex
    I need the classes 'two and three' to be hidden as soon as the page load and than be able to click again on the menu to slide it down, I am having probles with the following code: $(document).ready(function() { $('.two, .three').slideUp('slow'); $('.active_wrapper').click(function(){ $('.two, .three').slideDown('slow'); }); }); HTML <div class="nav_wrapper"> <div class="active_wrapper one"><a class="active" href="">home</a></div> <div class="two"><a href="about.html">about</a></div> <div class="three"><a href="project.html">project</a></div> </div>

    Read the article

  • Best Practice for Exporting an App's Data to XML via PHP/MySQL?

    - by Alex Cook
    I have an a business app and I want to give my users the ability to export their data at anytime. I'm aware that I can write an XML file semi-manually by doing something like this: http://www.kirupa.com/web/mysql_xml_php.htm But, I thought I'd ask if this is the best practice? Or is there some framework I can use to do this more easily/quickly? Maybe there isn't - it won't be too hard to do it the above way. Also, less importantly - XML is the best format to export to, right? Thanks in advance.

    Read the article

  • How can I identify an element from a list within another list

    - by Alex
    I have been trying to make a block of code that finds the index of the largest bid for each item. Then I was going to use the index as a way to identify the person who paid that much moneys name. However no matter what i try I can't link the person and what they have gained from the auction together. Here is the code I have been writing: It has to be able to work with any information inputted def sealedBids(): n = int(input('\nHow many people are in the group? ')) z = 0 g = [] s = [] b = [] f = [] w = []#goes by number of items q = [] while z < n: b.append([]) z = z + 1 z = 0 while z < n: g.append(input('Enter a bidders name: ')) z = z + 1 z = 0 i = int(input('How many items are being bid on?')) while z < i: s.append(input('Enter the name of an item: ')) w.append(z) z = z + 1 z = 0 for j in range(n):#specifies which persons bids your taking for k in range(i):#specifies which item is being bid on b[j].append(int(input('How much money has {0} bid on the {1}? '.format(g[j], s[k])))) print(' ') for j in range(n):#calculates fair share f.append(sum(b[j])/n) for j in range(i):#identifies which quantity of money was the largest for each item for k in range(n): if w[j] < b[k][j]: w[j] = b[k][j] q.append(k) any advice is much appreciated.

    Read the article

  • When do you use Java's @Override annotation and why?

    - by Alex B
    What are the best practices for using Java's @Override annotation and why? It seems like it would be overkill to mark every single overridden method with the @Override annotation. Are there certain programming situations that call for using the @Override and others that should never use the @Override?

    Read the article

  • Set the amount of rows JList show (Java)

    - by Alex Cheng
    Hi all. Problem: I have a method that creates a list from the parsed ArrayList. I manage to show the list in the GUI, without scrollbar. However, I am having problem setting it to show only the size of ArrayList. Meaning, say if the size is 6, there should only be 6 rows in the shown List. Below is the code that I am using. I tried setting the visibleRowCount as below but it does not work. I tried printing out the result and it shows that the change is made. private void createSuggestionList(ArrayList<String> str) { int visibleRowCount = str.size(); System.out.println("visibleRowCount " + visibleRowCount); listForSuggestion = new JList(str.toArray()); listForSuggestion.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); listForSuggestion.setSelectedIndex(0); listForSuggestion.setVisibleRowCount(visibleRowCount); System.out.println(listForSuggestion.getVisibleRowCount()); listScrollPane = new JScrollPane(listForSuggestion); MouseListener mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent mouseEvent) { JList theList = (JList) mouseEvent.getSource(); if (mouseEvent.getClickCount() == 2) { int index = theList.locationToIndex(mouseEvent.getPoint()); if (index >= 0) { Object o = theList.getModel().getElementAt(index); System.out.println("Double-clicked on: " + o.toString()); } } } }; listForSuggestion.addMouseListener(mouseListener); textPane.add(listScrollPane); repaint(); } To summarize: I want the JList to show as many rows as the size of the parsed ArrayList, without a scrollbar. Any ideas? Please help. Thanks. Please let me know if a picture of the problem is needed in case I did not phrase my question correctly.

    Read the article

  • How to peform an external request in Kohana 3?

    - by alex
    I've always used cURL for this sort of stuff, but this article got me thinking I could request another page easily using the Request object in Kohana 3. $url = 'http://www.example.com'; $update = Request::factory($url); $update->method = 'POST'; $update->post = array( 'key' => 'value' ); $update->execute(); echo $update->response; However I get the error Accessing static property Request::$method as non static From this I can assume it means that the method method is static, but that doesn't help me much. I also copied and pasted the example from that article and it threw the same error. Basically, I'm trying to POST to a new page on an external server, and do it the Kohana way. So, am I doing this correctly, or should I just use cURL (or file_get_contents() with context)?

    Read the article

  • Using LEFT JOIN to only selection one joined row

    - by Alex
    I'm trying to LEFT JOIN two tables, to get a list of all rows from TABLE_1 and ONE related row from TABLE_2. I have tried LEFT JOIN and GROUP BY c_id, however I wan't the related row from TABLE_2 to be sorted by isHeadOffice DESC. Here are some sample tables TABLE 1 c_id Name ---------------- 1 USA 2 Canada 3 England 4 France 5 Spain TABLE2 o_id c_id Office isHeadOffice ------------------------------------------------ 1 1 New York 1 2 1 Washington 0 3 1 Boston 0 4 2 Toronto 0 5 3 London 0 6 3 Manchester 1 7 4 Paris 1 8 4 Lyon 0 So what I am trying to get from this would be something like: RESULTS c_id Name Office ---------------------------- 1 USA New York 2 Canada Toronto 3 England Manchester 4 France Paris 5 Spain NULL I'm using PHP & MySQL. Any ideas?

    Read the article

  • A Null Reference Exception

    - by Alex
    "Object reference not set to an instance of an object." using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace XNAdev { class Sprite { //The size of the Sprite public Rectangle Size; //Used to size the Sprite up or down from the original image public float Scale = 1.0f; //The current position of the Sprite public Vector2 Position = new Vector2(115, 0); //The texture object used when drawing the sprite private Texture2D mSpriteTexture; //Load the texture for the sprite using the Content Pipeline public void LoadContent(ContentManager theContentManager, string theAssetName) { mSpriteTexture = theContentManager.Load<Texture2D>(theAssetName); Size = new Rectangle(0, 0, (int)(mSpriteTexture.Width * Scale), (int)(mSpriteTexture.Height * Scale)); } //Draw the sprite to the screen public void Draw(SpriteBatch theSpriteBatch) { theSpriteBatch.Draw(mSpriteTexture, Position, new Rectangle(0, 0, mSpriteTexture.Width, mSpriteTexture.Height), Color.White, 0.0f, Vector2.Zero, Scale, SpriteEffects.None, 0); } } } I am very new at this C# so any help would be great. I have no idea what my error is.

    Read the article

  • Removing title from wp_list_cats()

    - by Alex
    I'm trying to remove/replace the title attribute on the category elements used by WordPress. I'm using WordPress 2.9.1, with the following code: <div id="categories"> <h3>Manufacturers</h3> <ul> <?php str_replace("title=\"View all posts filed under ","",wp_list_categories('use_desc_for_title=0&exclude=1,2,3,4,5&title_li=&hierarchical=1')); ?> </ul> </div> From what I had read this method used to work on older versions (I had never tried it though). I really don't want to hack at the interals of WordPress, or have to use a JavaScript hack, for something so straight forward. Any help is appreciated... Update below is what is created from the code above... Manufacturers Featured

    Read the article

  • Linux directories

    - by Alex Farber
    I am writing installation script for my program, which is supposed to run on Linux/Unix OS. What is the default directory for the following files: Executable files (programs). Program should be executed by typing its name from the command line. Shared libraries. Third-party shared libraries (the program is not open source, so I need to redistribute third-party libraries). Read-only program configuration files for all users. Configuration data available for read/write access for all users.

    Read the article

  • "reduce" or "apply" using logical functions in Clojure

    - by Alex B
    I cannot use logical functions on a range of booleans in Clojure (1.2). Neither of the following works due to logical functions being macros: (reduce and [... sequence of bools ...]) (apply or [... sequence of bools ...]) The error saying that I "can't take value of a macro: #'clojure.core/and". How to apply these logical functions (macros) without writing boilerplate code?

    Read the article

  • shell_exec syntax error. running in terminal directly is ok

    - by Alex
    Having this command: $command = "diff -bBdH --ignore-all-space <(echo 'hi') <(echo 'hi1')"; echo $command; $result = shell_exec($command); On the screen I see: sh: 1: Syntax error: "(" unexpected diff -bBdH --ignore-all-space <(echo 'hi') <(echo 'hi1') If I copy-paste the second line from the console output into the terminal, the result would be correct. (Reproduced on another machine too). I'm missing something dead simple here and can't see what it is. besides, why is my output reversed? I'm clearly echoing the command before executing it, thus the syntax error of the shell should appear after the shell_exec

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >