Search Results

Search found 661 results on 27 pages for 'steven jeuris'.

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

  • Given an array of arguments, how do I send those arguments to a particular function in Ruby?

    - by Steven Xu
    Forgive the beginner question, but say I have an array: a = [1,2,3] And a function somewhere; let's say it's an instance function: class Ilike def turtles(*args) puts args.inspect end end How do I invoke Ilike.turtles with a as if I were calling (Ilike.new).turtles(1,2,3). I'm familiar with send, but this doesn't seem to translate an array into an argument list. A parallel of what I'm looking for is the Javascript apply, which is equivalent to call but converts the array into an argument list.

    Read the article

  • Hit external url from code-behind

    - by Steven
    I have a form on my site. The user enters their e-mail and selects a location from a dropdown. I then need to post that data to an external site by hitting a url with the user's location and e-mail in the query string. I'm doing this like so: string url = "http://www.site.com/page.aspx?location=" + location.Text + "&email=" + email.Text; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); My client says that I am not hitting their server, but when going through the debugger, I'm getting a response from their server. I also tried tracking what was happening by using Firebug, and I noticed that there was no POST made to that external site. What am I doing wrong here?

    Read the article

  • How can I join 3 tables with mysql & php?

    - by steven
    check out the page [url]http://www.mujak.com/test/test3.php[/url] It pulls the users Post,username,xbc/xlk tags etc which is perfect... BUT since I am pulling information from a MyBB bulletin board system, its quite different. When replying, people are are allowed to change the "Thread Subject" by simplying replying and changing it. I dont want it to SHOW the changed subject title, just the original title of all posts in that thread. By default it repies with "RE:thread title". They can easily edit this and it will show up in the "Subject" cell & people wont know which thread it was posted in because they changed their thread to when replying to the post. So I just want to keep the orginial thread title when they are replying. Make sense~?? Tables:mybb_users Fields:uid,username Tables:mybb_userfields Fields:ufid Tables:mybb_posts Fields:pid,tid,replyto,subject,ufid,username,uid,message Tables:mybb_threads Fields:tid,fid,subject,uid,username,lastpost,lastposter,lastposteruid I haev tried multiple queries with no success: $result = mysql_query(" SELECT * FROM mybb_users LEFT JOIN (mybb_posts, mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid AND mybb_users.uid=mybb_userfields.ufid ) WHERE mybb_posts.fid=42"); $result = mysql_query(" SELECT * FROM mybb_users LEFT JOIN (mybb_posts, mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid AND mybb_users.uid=mybb_posts.uid ) WHERE mybb_threads.fid=42"); $result = mysql_query(" SELECT * FROM mybb_posts LEFT JOIN (mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid ) WHERE mybb_posts.fid=42");

    Read the article

  • Rewrite URL in PHP with mod_rewrite

    - by Steven
    The web server is Apache. I want to rewrite URL so a user won't know the actual directory. For example: The original URL: www.mydomainname.com/en/piecework/piecework.php?piecework_id=11 Expected URL: piecework.mydomainname.com/en/11 How to achieve it with mod_rewrite?

    Read the article

  • Using unions to simplify casts

    - by Steven Lu
    I realize that what I am trying to do isn't safe. But I am just doing some testing and image processing so my focus here is on speed. Right now this code gives me the corresponding bytes for a 32-bit pixel value type. struct Pixel { unsigned char b,g,r,a; }; I wanted to check if I have a pixel that is under a certain value (e.g. r, g, b <= 0x10). I figured I wanted to just conditional-test the bit-and of the bits of the pixel with 0x00E0E0E0 (I could have wrong endianness here) to get the dark pixels. Rather than using this ugly mess (*((uint32_t*)&pixel)) to get the 32-bit unsigned int value, i figured there should be a way for me to set it up so I can just use pixel.i, while keeping the ability to reference the green byte using pixel.g. Can I do this? This won't work: struct Pixel { unsigned char b,g,r,a; }; union Pixel_u { Pixel p; uint32_t bits; }; I would need to edit my existing code to say pixel.p.g to get the green color byte. Same happens if I do this: union Pixel { unsigned char c[4]; uint32_t bits; }; This would work too but I still need to change everything to index into c, which is a bit ugly but I can make it work with a macro if i really needed to.

    Read the article

  • How do I center align horizontal <UL> menu?

    - by Steven
    I need to centre align a horizontal menu. I've tried various solutions, including the mix of inline-block / block / center-align etc., but not being successful. Can someone help me please? :) Here is my code: <div class="topmenu-design"> <!-- Top menu content: START --> <ul id="topmenu firstlevel"> <li class="firstli" id="node_id_64"><div><a href="#"><span>Om kampanjen</span></a></div></li> <li id="node_id_65"><div><a href="#"><span>Fakta om inneklima</span></a></div></li> <li class="lastli" id="node_id_66"><div><a href="#"><span>Statistikk</span></a></div></li> </ul> <!-- Top menu content: END --> </div> UPDATE I know how to center align the UL within the DIV. That can be accomplished using Sarfraz's suggestion. But the list items are still floated left within the UL. Do I smell javascript to accomplish this?

    Read the article

  • Keeping a window always on top -- including menus (win32)

    - by Steven Lu
    I would like to have a layered window that is always-on-top, which I can accomplish, but there are certain screen elements that still get drawn over it, such as menus (including the start menu). Is there any way to make a window or child window of my application have a high enough top-ness property that it will draw over another application's menus? Or is there something built in to windows that ensures that menus in the currently active application are always drawn on top? In fact, I don't really understand all that well how menus work. So it might not even make any sense for me to try to make my window "act like a menu" in hopes of making it cover more things.

    Read the article

  • Is it possible to build this type of program in PHP?

    - by Steven
    I want to build a QA program that will crawl all the pages of a site (all files under a specified domain name), and it will return all external links on the site that doesn't open in a new window (does not have the target="_blank" attribute in the href). I can make a php or javascript to open external links in new windows or to report all problem links that don't open in new windows of a single page (the same page the script is in) but what I want is for the QA tool to go and search all pages of a website and report back to me what it finds. This "spidering" is what I have no idea how to do, and am not sure if it's even possible to do with a language like PHP. If it's possible how can I go about it?

    Read the article

  • Batch To Bash Conversion

    - by Steven
    I need to know this Batch Script into Bash : @echo off set /p name= Name? findstr /m "%name%" ndatabase.txt if %errorlevel%==0 ( cls echo The name is found in the database! pause >nul exit ) cls echo. echo Name not found in database. pause >nul exit I am new to the Linux Kernel, so starting off with an easy distro - Ubuntu 12.10. My problem is that I do not really know much of Bash Script, since I am very accustomed to the Batch Script format; which is obviously a bad habit for my C++.

    Read the article

  • Sources from referenced projects are not deployed to Tomcat in Eclipse

    - by Steven De Groote
    Hi, I have setup a dynamic web project in eclipse with JSF in which I trust on code from another project (framework). Therefore, I added the framework project to the build path of the website project. So far so good, Eclipse recognises every class and the project builds without errors. Problem is though that when I do "run on server" to test it on tomcat 6.0.24, the application fails. I get ClassNotFoundException on every class from the framework project. Is this a bug or is some specific configuration necessary for this?

    Read the article

  • How to ensure structures are completly initialized (by name) in GCC?

    - by Steven Spark
    How do I ensure each and every field of my structures are initialized in GCC when using designated initializers? (I'm especially interested in function pointers.) (I'm using C not C++.) Here is an example: typedef struct { int a; int b; } foo_t; typedef struct { void (*Start)(void); void (*Stop)(void); } bar_t; foo_t fooo = { 5 }; foo_t food = { .b=4 }; bar_t baro = { NULL }; bar_t bard = { .Start = NULL }; -Wmissing-field-initializers does not help at all. It works for fooo only in GCC (mingw 4.7.3, 4.8.1), and clang does only marginally better (no warnings for food and bard). I'm sure there is a reason for not producing warnings for designated initializer (even when I explicitly ask for them) but I want/need them. I do not want to initialize structures based on order/position because that is more error prone (for example swapping Start and Stop won't even give any warning). And neither gcc nor clang will give any warning that I failed to explicitly initialize a field (when initializing by name). I also don't want to litter my code with if(x.y==NULL) lines for multiple reasons, one of which is I want compile time warnings and not runtime errors. At least splint will give me warnings on all 4 cases, but unfortunately I cannot use splint all the time (it chokes on some of the code (fails to parse some C99, GCC extensions)). Note: If I'm using a real function instead of NULL GCC will also show a warning for baro (but not bard). I searched google and stack overflow but only found related questions and have not found answer for this specific problem. The best match I have found is 'Ensure that all elements in a structure are initialized' Ensure that all elements in a structure are initialized Which asks pretty much the same question, but has no satisfying answer. Is there a better way dealing with this that I have not mentioned? (Maybe other code analysis tool? Preferably something (free) that can be integrated into Eclipse or Visual Studio...)

    Read the article

  • Adobe popping out of the browser

    - by Steven
    Hi, Im building a web application that displays a xfdf document. When we are testing in adobe 5 and we can't stop adobe opening outside the webpage. The user clicks the report and it should open in the browser but instead it opens in adobe it appears to work in everything but adobe 5. We have previously done this with out any problems. Any ideas? This is a snippet of the xfdf <?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"> <fields> <field name="fld_AccomAttic"> <value>0</value> </field> <field name="fld_AccomBathroom"> <value>1</value> </field> <field name="fld_AccomBedrooms"> <value>3</value> </field> <field name="fld_AccomCellars"> <value>0</value> </field> <field name="fld_AccomGarages"> <value>Off</value> </field><f href="{report name}"/></xfdf> Any help would be great Sp

    Read the article

  • php - How do I get rid of this strange "empty delimiter" message

    - by Steven
    I have some code that uses the stristr function to extract data I need. It works, in that it gives me the results I'm looking for. BUT (you knew there was a but), it gives me this error message for every iteration of the loop: Warning: stristr() [function.stristr]: Empty delimiter in ... line 55 Like I said, the code works apart from this error. Can anyone suggest how i could amend this code to get rid of the message? Thanks in advance $data = stristr("$text", "$key"); $result = string_limit_words($data,2); print "$result<BR>";

    Read the article

  • Why doesn't Google OpenID provider work with PHP-OpenId on my server?

    - by Steven Devijver
    Hey, I'm using PHP-OpenId 2.1.3 which I've unzipped on my server here (this is the consumer example that comes with PHP-OpenId). When I enter the Google OpenId url (https://www.google.com/accounts/o8/id) and submit I get a blank screen. When I try the exact same example code on the PHP-OpenId website here with the same URL it works fine. I don't understand what I'm doing wrong. The only thing I can think of is that somehow Google does not want to work with my server. Any ideas how to make this work? Thanks

    Read the article

  • Where can I find good collaboration tool?

    - by Steven
    I'm working on a project where I'm using mindmeister.com as a tool when brainstorming new ideas. Now I need a tool where I can define roles and what responsibilities they have, and link this to a person / persons. It would also be nice if I could add tasks with a due date for each person. Are there any open source websites which has this?

    Read the article

  • Three 1D Arrays to One 2D Array

    - by Steven
    I have a function which accepts a 2D array, but my data is in three 1D arrays. How do I create a 2D array consisting of the three arrays to pass to the subroutine? Dim Y0(32) As Double Dim Y1(32) As Double Dim Y2(32) As Double 'Code to fill arrays' 'Attempting to call:' Sub PlotYMult(YData(,) as Double)

    Read the article

  • DataBind DataSource Result to ASP Labels

    - by Steven
    I have an AccessDataSource TestSummaryADS. I can easily view the results in a GridView or DropDownList by setting its DataSourceID property. How do I bind a value from the results TestSummaryADS to the text of a label? I'm just trying to populate labels on my page with results from the DB entry. C# or VB.NET answers okay.

    Read the article

  • SQL 2000 xp_sendmail

    - by Steven
    Hi Guys, I have a trigger that sends an email once a value has been changed. It works when i make any amendments but when the users make the changes it fails. I have figured out the users havnt got permission to send mails in master.dbo.xp_sendmail The way the DB was originally setup wis shocking!! (each user has a network login rather than being part of a network group) Is there anyway i can allow a role in customerDb to access the xp_sendmail proc in the mater db? Thanks Sp

    Read the article

  • Regular expression to match text that doesn't start with substring?

    - by Steven
    I have text with file names scattered throughout. The filenames appear in the text like this: |test.txt| |usr01.txt| |usr02.txt| |foo.txt| I want to match the filenames that don't start with usr. I came up with (?<=\|).*\.txt(?=\|) to match the filenames, but it doesn't exclude the ones starting with usr. Is this possible with regular expressions?

    Read the article

  • SQL Convert Nvarchar(255) to DateTime problem

    - by steven
    Hi, I'm using SQL server 2008. I have 2 Tables: Table 1 and Table 2. Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null Example data in Table 1: 26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03 When i try CAST(OldDate as datetime) I get this error: Arithmetic overflow error converting expression to data type datetime. I need to insert OldDate into NewDate with no errors. I can't skip some rows. Anyhelp would be appreciated.

    Read the article

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