Daily Archives

Articles indexed Sunday December 26 2010

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

  • Send a variable to a variable of a function?

    - by J. M
    Let's say I have a function and one of the parameters is for the name of the target variable.. Would it be possible for me to send a variable to the function like this: function otherfunction(input){ ... } function test {target) { var x = 1; target(x); } test(otherfunction); The problem I have is that I'm making a greasemonkey script and one of the variable I need can't be returned from the function due to a limitation.. So this would be the alternative. I just don't know how to get it to work.. Any help would be much appreciated!!

    Read the article

  • Finding the best jquery plugins

    - by Lan
    Is there a resource for finding the "best" jquery plugins, or at least just the most used ones? For example, I wanted to find a menu jquery plugin but when I goto the jquery website there are so many to look through and I don't see a way to see how popular each one is. For ruby there's the http://ruby-toolbox.com/ which lists many plugins, how popular they are, info about them, etc. Is there something similar or at least some way to filter through all the jquery plugins? EDIT 1: To shed some more light on this - the "most popular" link on the jquery page is useless. I can't find a way to search through it but even worse, the ratings don't seem to mean much. Ex - the first item, in other words the most popular plugin in that list has 5 stars and TWO votes. Doesn't seem like a very reliable resource to me.

    Read the article

  • c# open webrowser in many tab

    - by tee
    how can i create tab tab1 open samsung.com tab2 open hp.com ... using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace browsergotosamsung { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { webBrowser1.Navigate("http://www.samsung.com"); webBrowser2.Navigate("http://www.hp.com"); webBrowser3.Navigate("http://www.IBM.com"); } private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { } private void webBrowser3_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { } private void webBrowser2_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { webBrowser2.Size } } }

    Read the article

  • How can i get the entire HTML of an element using regex?

    - by Lucas
    Hello, i'm learning Regex but can't figure it out.... i want to get the entire HTML from a DIV, how to procced? already tried this; /\< td class=\"desc1\"\>(.+)/i it returns; Array ( [0] => < td class="desc1"> [1] => ) the code that i'm matching is this; <table id="profile" cellpadding="1" cellspacing="1"> <thead> <tr> <th colspan="2">Jogador TheInFEcT </th> </tr> <tr> <td>Detalhes</td> <td>Descrição:</td> </tr> </thead><tbody> <tr> <td class="empty"></td><td class="empty"></td> </tr> <tr> <td class="details"> <table cellpadding="0" cellspacing="0"> <tbody><tr> <th>Classificação</th> <td>11056</td> </tr> <tr> <th>Tribo:</th> <td>Teutões</td> </tr> <tr> <th>Aliança:</th> <td>-</td> </tr> <tr> <th>Aldeias:</th> <td>1</td> </tr> <tr> <th>População:</th> <td>2</td> </tr><tr> <td colspan="2" class="empty"></td> </tr> <tr> <td colspan="2"> <a href="spieler.php?s=1">» Alterar perfil</a></td> </tr> </tbody></table> </td> <td class="desc1"> <div>STATUS: OFNAaaaAA</div> </td> </tr> </tbody> </table> i need to get the entire code inside the < td class="desc1", like that; <div >STATUS: OFNAaaaAA< /div> </td> </tr> </tbody> </table> Could someone help me out? Thanks in advance.

    Read the article

  • Grouping rectangles (getting the bounding boxes of rects)

    - by hyn
    What is a good, fast way to get the "final" bounding boxes of a set of random (up to about 40, not many) rectangles? By final I mean that all bounding boxes don't intersect with any other. Brute force way: in a double for loop, for each rect, test for intersection against every other rect. The intersecting rects become a new rect (replaced), indicating the bounding box. Start over and repeat until no intersection is detected. Because the rects are random every time, and the rect count is relatively small, collision detection using spatial hashing seems like overkill. Is there a way to do this more effectively?

    Read the article

  • How do I access the ASP.NET Configuration Tool when a site is live? This is ASP.NET MVC.

    - by Mike Marks
    I was wondering if it's possible to access the ASP.NET Configuration Tool once a site is live. To be able to create and edit users and roles is obviously very important, and from what I've been reading, once a site is deployed, the Configuration Tool is no longer accessible. If this is the case, HOW do I add users, etc.? By the way, I found a User Management plugin which brings a lot of the Configuration Tool's capabilities to the front end of a User Management section of the deployed website, but it DOES NOT offer the capability to add a new user. Help??? Thanks!!

    Read the article

  • How can I implement Unix grep in Perl?

    - by Ankit Rathod
    How can I implement grep of Unix in Perl? I tried to use Perl's built-in grep. Here is the code which is not working: $pattern = @ARGV[0]; $file= @ARGV[1]; open($fp,$file); @arr = <$fp>; @lines = grep $pattern, @arr; close($fp); print @lines; And by the way, i am trying only basic grep functionality not full featured and secondly i don't want to do string parsing myself. I want to use inbuilt grep or some function of Perl. Thanks in advance :)

    Read the article

  • Why doesn't Perl threading work when I call readdir beforehand?

    - by Kevin
    Whenever I call readdir before I create a thread, I get an error that looks like this: perl(2820,0x7fff70c33ca0) malloc: * error for object 0x10082e600: pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug Abort trap What's strange is that it happens when I call readdir before I create a thread (i.e. readdir is not called in any concurrent code). I don't even use the results from readdir, just making the call to it seems to screw things up. When I get rid of it, things seem to work fine. Some example code is below: opendir(DIR, $someDir); my @allFiles = readdir(DIR); close(DIR); my $thread = threads-create(\&sub1); $thread-join(); sub sub1 { print "in thread\n" }

    Read the article

  • Find if a string contains a specific query string and return its value

    - by Ahmad Fouad
    Hello, I have pagination links set-up like this: http://localhost/?page=2 http://localhost/?page=3 They are wrapped in Anchor links as the HREF attribute. I want to know how can I check first if the HREF attribute for a given ANCHOR contains the query string "page" case sensitive, and if it exists return its number the value after page= Please give me a straightforward example on this, much appreciated. :)

    Read the article

  • Does acts-as-taggable-on work on heroku?

    - by Martin
    Hello, I have a question: does the acts-as-taggable-on gem work on Heroku? I'been trying but it doesn't seem to work. In my development machine works okay. I'm wondering if it's maybe because Heroku uses PostgreSQL and my local env SQLite and for some reason postgresql is not supported by the special tagging "magic"? I couldn't find any related info to this, so I would like to know other experiences with this. I guess is pretty rare since both the gem and heroku are very popular. ActionView::Template::Error (undefined method `interests' for "#<About:0x2b35d6125728>":About): <% unless @user.about.interests.empty? %> <p><strong>interests and passions</strong><br /> <% @user.about.interests.each do |tag| %> <%= tag %>, <% end -%></p><% end %> In my about.rb model i have acts_as_taggable_on :interests, :music, :movies, :books, :tvs Thank you in advance!

    Read the article

  • Private API and SMS content URI's on Android

    - by Shadow
    Without accessing private API's to get Content URI's, etc. for SMS, how are we expected to query this data? I am currently in the process of writing my own SMS app and I want to stay as compatible as possible. Without storing the information myself in my own database (such that I can store the text messages so that other programs can access the data when/if they delete my app) and without using private API's how the heck are we suppose to query SMS data?

    Read the article

  • Programmatically Set Proxy Address, Port, User, Password throught Windows Registry

    - by Fábio Antunes
    I'm writing a small C# application that will use Internet Explorer to interact with a couple a websites, with help from WatiN. However, it will also require from time to time to use a proxy. I've came across Programmatically Set Browser Proxy Settings in C#, but this only enables me to enter a proxy address, and I also need to enter a Proxy username and password. How can I do that? Note: It doesn't matter if a solution changes the entire system Internet settings. However, I would prefer to change only IE proxy settings (for any connection). The solution has to work with IE8 and Windows XP SP3 or higher. I'd like to have the possibility to read the Proxy settings first, so that later I can undo my changes. EDIT With the help of the Windows Registry accessible through Microsoft.Win32.RegistryKey, i was able to apply a proxy something like this: RegistryKey registry = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true); registry.SetValue("ProxyEnable", 1); registry.SetValue("ProxyServer", "127.0.0.1:8080"); But how can i specify a username and a password to login at the proxy server? I also noticed that IE doesn't refresh the Proxy details for its connections once the registry was changed how can i order IE to refresh its connection settings from the registry? Thanks

    Read the article

  • show div for a set time, then hide it

    - by Patrick
    Im using jquery for various things on my site, but one thing im not sure how to do, is have it show an element, then wait X seconds, and hide the element. $('#form').ajaxForm(function() { $('#cartcontents').fadeOut("fast").load('cart.php').fadeIn("fast"); }); That's the JavaScript that I'm using now. How could I have it (when the form submits) display the div #notice for 5 seconds, then fadeOut?

    Read the article

  • Is Android (read typical devices) fast enough for a game that requires plotting pixel by pixel rather than blitting

    - by mP
    i have an idea for an Android game which is a little different from the typical game that usually moves sprites(bitmaps) around the screen. Id want to plot lots of little pixels to create my visuals. PROS no bitmaps required pixel plotting of stuff like "fire" can react to wind. no need to scale bitmaps, works w/ any screen res (lets pretend device can handle more drawing because its got a bigger screen). CONS slower to plot pixels than blit bitmaps need lot of animation frames. WISHES id like to update my game in real time, more is better 30fps is good but not essential, 15fps is enough. PERFORMANCE Q... Is the typical Android device fast enough to plot say half a screenful of pixels w/ a default background ? if full screen is not practical what window size should be able to handle such refreshes

    Read the article

  • Entity-attribute-value model using codeigniter / php

    - by John Stewart
    SO I am trying to create a way to structure my database to be able customize forms. I looked into EAV pattern and here is my db structure: Table form - form_id - form_name - form_added_on - form_modified_at Table: form_fields - field_id - form_id - field_type (TEXT, RADIO etc..) - field_default_value - field_required Table: form_data - data_id - field_id - form_id - field_value so now I can store any custom form into the database and if I want to get the values for an individual form I can simply join it by "form_id" .. the problem: I want to be able to search through all the forms for a specific field value. How can I do that with EAV model? Also, I thought about just storing the custom data as a serialized (JSON) object but then I am not sure how can I query that data. Please note that I am using Codeigniter with MYSQL. So if conversation can use Codeigniter libraries if needed.

    Read the article

  • variable being weirdly deleted

    - by calccrypto
    im having a weird problem with one variable: its not being recognized but its still printing. i would post my code, but it is massive. the basic idea is: # pseudocode def function(stuff): <do stuff> # These are the only 2 conditions if tag == 3: pka = <a string> if tag == 4: pka = <a string> print pka # (1) print pka # (2) <do stuff not modifying pka> print pka # (3) if pka == 'RSA': <do stuff> elif pka == 'DSA': <do stuff> my code will error at (2). however, it will print out (1), (2), and (3), all of which are the same. is there any general explanation of why this is happening? if my code is really needed, i will post it, but otherwise, i would rather not due to its size update: now the code will error at the if statement after (3), saying UnboundLocalError: local variable 'pka' referenced before assignment even though (1),(2),(3) just printed

    Read the article

  • Firefox proxy delima

    - by Mike L.
    Any idea why when using system proxy settings in firefox, it can not accept a proxy such as: user:[email protected]:port ??? IE will allow and connect to a proxy in this format. Not only does firefox not work, but it does not prompt for the password, nor attempt to make a connection to the proxy. Basically get a "proxy server not found" error. Anybody know a way around this? I am working on a proxy switching program for IE & Firefox, and I would like to use system-wide proxy settings. If I just store the server:port combination, firefox prompts for the password, as well as IE. Then they can be cached and it will not ask again. Maybe my only option is to programmatically cache the user/pass? Anybody know a way to do this? I am pretty sure IE stores them at HTTP basic authentication passwords and I can add them with AddCredential. After saving a password for a proxy in firefox, it shows up in saved passwords in a format like "moz-proxy://server:port" anybody know how to programmatically add a saved password to firefox? Thanks

    Read the article

  • How to sort data in a table data structure in Java?

    - by rgksugan
    I need to sort data based on the third column of the table data structure. I tried based on the answers for the following question. But my sorting does not work. Please help me in this. Here goes my code. Object[] data = new Object[y]; rst.beforeFirst(); while (rst.next()) { int p_id = Integer.parseInt(rst.getString(1)); String sw2 = "select sum(quantity) from tbl_order_detail where product_id=" + p_id; rst1 = stmt1.executeQuery(sw2); rst1.next(); String sw3 = "select max(order_date) from tbl_order where tbl_order.`Order_ID` in (select tbl_order_detail.`Order_ID` from tbl_order_detail where product_id=" + p_id + ")"; rst2 = stmt2.executeQuery(sw3); rst2.next(); data[i] = new Object[]{new String(rst.getString(2)), new String(rst.getString(3)), new Integer(rst1.getString(1)), new String(rst2.getString(1))}; i++; } ColumnComparator cc = new ColumnComparator(2); Arrays.sort(data, cc); if (i == 0) { table.addCell(""); table.addCell(""); table.addCell(""); table.addCell(""); } else { for (int j = 0; j < y; j++) { Object[] theRow = (Object[]) data[j]; table.addCell((String) theRow[0]); table.addCell((String) theRow[1]); table.addCell((String) theRow[2]); table.addCell((String) theRow[3]); }

    Read the article

  • Different canonical URLs for Facebook and Google?

    - by Victor P
    The following URLs point to the same resource: http://www.domain.com/books/123 http://www.domain.com/books/123-Harry-Potter http://www.domain.com/books/123-Harry-Potter-And-The-Deathly-Hallows I would like to use (1) as the canonical URL for OpenGraph/Facebook, so if you "like" (2) and (3) then will count for (1). But I would like to use (3) as the canonical URL for Google, because of SEO. Is this recommended?

    Read the article

  • Finding partial substrings within a string

    - by Peter Chang
    I have two strings which must be compared for similarity. The algorithm must be designed to find the maximal similarity. In this instance, the ordering matters, but intervening (or missing) characters do not. Edit distance cannot be used in this case for various reasons. The situation is basically as follows: string 1: ABCDEFG string 2: AFENBCDGRDLFG the resulting algorithm would find the substrings A, BCD, FG I currently have a recursive solution, but because this must be run on massive amounts of data, any improvements would be greatly appreciated

    Read the article

  • innerHTML parse for Google Chrome?

    - by user554095
    Hey all. I am adding text to a textArea via Javascript in Chrome (doing it a totally different way in Firefox/IE as Chrome does not support contentWindows). Here is my code: document.getElementById("vB_Editor_001_textarea").value += '<font color="white"><b>' + numberLabel + ':</b> ' + armory + '</font><br/>'; This HTML is getting put directly into the textArea without being parsed. How can I make it parse into regular text with the HTML markup when it hits the textArea? Thanks!

    Read the article

  • Which network performance management software do you use?

    - by Jamie Keeling
    Hello, I am looking at the various options available for network performance management software, some of the solutions I've found so far are: Proprietary: HP - ProCurve Universal: SolarWinds - Orion Open Source: OpenNMS I am trying to discover the benefits of each package over the other and reasons as to why you would go for one (Such as size of the network, overall cost etc..). I'm curious as to which ones other people use and why? Each customer has their own needs and requirements and it would be great to hear some of yours. Thank you for your time.

    Read the article

  • Useless Plesk Error?

    - by Josh Pennington
    I am trying to determine why Plesk on my server won't start and I have no idea where to even start (since my hosting company appears to not want to help me out). Anyways, the error in my Plesk error_log is as follows: 2010-12-25 21:30:28: (log.c.75) server started 2010-12-25 21:30:28: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0) 2010-12-25 21:30:28: (log.c.75) server started 2010-12-25 21:30:28: (network.c.336) SSL: error:00000000:lib(0):func(0):reason(0) It leads me to believe its a problem with the SSL on the server but I am not sure what to make of the error. Can someone lead me in the right direction? Thanks Josh Pennington

    Read the article

  • Virtually adjusting screen size and position

    - by Mishari
    Hi, I'm working on a display piece which is an LCD monitor that is partially covered and needs to be running an application in full screen in the uncovered portion of the screen. I have tried xvidtune on linux which gives me mode errors and switchresx on macosx which only seems to change resolution but not reposition nor resize (it stretches to full screen anyways). I'm wondering if there's anyway to do this? Practically, I have access to any OS.

    Read the article

  • Migrating Windows XP BOOT.INI Settings to Windows 7 Boot-loader

    - by Synetech inc.
    Hi, Two months ago my motherboard died, so I bought a used computer that came with Windows 7. I have since installed my old hard-drive, which had Windows XP on it, in this system. What I am trying to do now is to figure out a way to migrate the settings from XP's BOOT.INI into 7's boot-loader. Below is the BOOT.INI I used in XP (I have reduced the strings and updated the disks to point to the new location of the old HD. Oh and I am not clear on the drive letters. In XP, I could boot the recovery console or MS-DOS from a file in C:\ that contains the boot-sector. I am not sure what drive letter it would be called now—I had to manually change all the drive letters of the old partitions in Windows 7 because it auto-assigned them all wrong/differently). [boot loader] timeout=10 default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="XP" /fastdetect multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="XP (Safe)" /safeboot:network /sos /bootlog /noguiboot C:\CMDCONS\BOOTSECT.DAT="Recovery Console" /cmdcons C:\BOOTSECT.DOS="MS-DOS 7.10" /win95 I have looked around, and have only been able to find some bcdedit commands to add XP to the boot-loader, but none that include information on setting safe-mode for it (or changing any of the XP load options for that matter). Not surprisingly I suppose, I have not found anything on adding the XP recovery console or DOS to the Windows 7 boot-loader. (Yes, I tried EasyBCD, but that did not help; it had no options for XP, and the best I managed was to get a choice of booting 7 or normal-mode XP—choosing XP didn't even give the old XP boot menu.) Can anyone please tell me how to export the entries in XP's boot.ini to 7's boot-loader so that on boot, I can choose to load the following: Windows 7 Windows 7 (Safe-mode) (Windows 7 (The Win7 counterpart of the Recovery Console)) Windows XP Windows XP (Safe-mode) Windows XP (Recovery Console) MS-DOS 7.10

    Read the article

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