Search Results

Search found 4677 results on 188 pages for 'alternative'.

Page 125/188 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Unable to locate using find element by link

    - by First Rock
    Newbie in testing. I generated a test case using Selenium, and then exported it as a Python script. Now, when I try to run that in terminal, I get following error: raise exception_class(message, screen, stacktrace) NoSuchElementException: Message: u'Unable to locate element: {"method":"link text","selector":"delete"}' I am using the command generated by Selenium i.e driver.find_element_by_link_text("delete").click() The reason for the error I believe is that the link "delete" in my web page is seen only when I click on a particular line to be deleted. So I guess it is being unable to locate the link. Please suggest what alternative measure could I use to locate and click on the "delete" link. Thanks in Advance:)

    Read the article

  • Optimal search queries

    - by Macros
    Following on from my last question http://stackoverflow.com/questions/2788082/sql-server-query-performance, and discovering that my method of allowing optional parameters in a search query is sub optimal, does anyone have guidelines on how to approach this? For example, say I have an application table, a customer table and a contact details table, and I want to create an SP which allows searching on some, none or all of surname, homephone, mobile and app ID, I may use something like the following: select * from application a inner join customer c on a.customerid = a.id left join contact hp on (c.id = hp.customerid and hp.contacttype = 'homephone') left join contact mob on (c.id = mob.customerid and mob.contacttype = 'mobile') where (a.ID = @ID or @ID is null) and (c.Surname = @Surname or @Surname is null) and (HP.phonenumber = @Homphone or @Homephone is null) and (MOB.phonenumber = @Mobile or @Mobile is null) The schema used above isn't real, and I wouldn't be using select * in a real world scenario, it is the construction of the where clause I am interested in. Is there a better approach, either dynamic sql or an alternative which can achieve the same result, without the need for many nested conditionals. Some SPs may have 10 - 15 criteria used in this way

    Read the article

  • Thread Suicide on Shutdown?

    - by yar
    I have a java.util.Timer running at a fixed interval. I have added a Runtime#addShutdownHook and it shuts down when the VM ends normally or abnormally. However, it keeps the VM alive when a main terminates, unless I insist by doing a System.exit in the main. Is there any way for me to check if I'm the last Thread standing, or some other way to avoid altering a main that would exit normally on finish? Note: I know a lot of people believe that java.util.Timer is deprecated (it's not), but unless your alternative helps me solve this problem...

    Read the article

  • WebDav alternatives? Win server 2003, win 7.

    - by John
    I have an internal web page that I have an iframe with the source pointing to a webdav folder. This allows the user to drag and drop a number of files on the iframe window which a button on the main page then kicks off a server side task to process the files. I am looking for an alternative that will allow me to drag a group of files and drop them onto a target area of a web page which will then upload them to the web server. Ideally this would be in ASP.Net 2,3 or 4. Any suggestions? TIA J

    Read the article

  • SQL Server Express: Failed to add primary key after creating a database table

    - by Syd
    Scenario: I have created a database table. And when I tried to add a primary key (using the SQL Server Management Studiio) to the table, it failed with an error message "Saving changes is not permitted. The changes you have made requrie the following tables to be dropped and re-created. You have either made changes to a table that can't be recreated or enabled the option Prevent savign changes that require the table to be re-created." The environment is Windows 7. I have earlier installed it on a Windows XP SP2 and it worked. And yes, my table is empty (freshly created). My current workaround is to run the "Drop and Create" script. The other alternative is to create the primary key before I save the table. Is this a bug or a limitation with the Express version?

    Read the article

  • Trying to call JS Code that is passed back from AJAX call....

    - by Dutchie432
    Okay, so I have an javascript function that retrieves some HTML... function updateQuestions(i){ var url = 'getQuestions.php?sys=' + i; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET", url, true); receiveReq.onreadystatechange = handleQuestionsUpdate; receiveReq.send(null); } } function handleQuestionsUpdate() { if (receiveReq.readyState == 4) { var a=receiveReq.responseText; document.getElementById('questions').innerHTML=a; checkSpeakers(); //Error Occurs Here, even though checkSpeakers() is a function in the returned HTML chunk. } } This HTML is not just HTML, but it is more specifically a form and a chunk of javascript. The javascript is hard-coded into the HTML and not referenced by <script src=".."> Is it normal that this retrieved JS code isn't recognized upon call-time? If so, what is my alternative if I need the JS to change every time the div is update? Now

    Read the article

  • getting the stage from a container in kineticjs

    - by seinecle
    I have this stage associated to a container: html: <div id="container"> script 1: var stageInFirstScript = new Kinetic.Stage({ container: document.getElementById('container'), width: this.SKETCH_WIDTH, height: this.SKETCH_HEIGTH }); In a second script, I need to manipulate the shapes on the stage I just created. Is it possible to retrieve stageInFirstScript with something like this? script 2: var stageInSecondScript = document.getElementById('container').RetrieveExistingStage(); //now I have retrieved stageInFirstScript //I can add shapes to it, etc.... Any help or alternative solution would be appreciated!

    Read the article

  • How exactly do you use json_decode to pass a javascript array to php?

    - by Adam
    This is how I got my php array to javascript echo 'var daysofweek = '.json_encode($daysofweek).';'; Now I am aware that json_decode can do the opposite, however the problem is I don't know the syntax to do so. I tried: <script> var array_days = new Array(); array_days[] = "psdfo"; array_days[] = "bsdf"; <?php $array_days = json_decode(?>array_days<?php);?> </script> yes im clueless. I forgot to mention that I want to send an array through post, having all my information regarding all the form values dynamically created by javascript. Otherwise, I wouldn't know which name="" to look for as it will be decided by the user. Unless someone else has an alternative solution...

    Read the article

  • Mysql question about UPDATE

    - by Beck
    UPDATE counter_reports SET `counter`=`counter`+1,`date`=? WHERE report_id IN( (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `year`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `month`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `week`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `day`=1 ORDER BY report_id DESC LIMIT 1) ) Is there any alternative for such sql? I need to update(increment by 1) last counter reports for day,week,month and year. If I'm adding manually, sql works fine, but with subqueries it fails to launch. Thanks. :)

    Read the article

  • C++: Is there a way to limit access to certain methods to certain classes without exposing other pri

    - by dadads
    I have a class with a protected method Zig::punt() and I only want it to be accessible to the class "Avocado". In C++, you'll normally do this using the "friend Avocado" specifier, but this will cause all of the other variables to become accessible to "Avocado" class; I don't want this because this breaks encapsulation. Is what I want impossible, or does there already exist an obscure trick out there that I can use to achieve what I want? Or possibly alternative class design patterns that'll achieve the same thing? Thanks in advance for any ideas!

    Read the article

  • Resize a DIV when its text changes

    - by Antonios
    I wanted to build a custom html button without using any solution like bootstrap etc. but from scratch. I decided to use a div to build my button with very good results. However, when the text changes its length that does not mean the div will change its width as well. Should I approach this using javascript or is there a CSS solution I am missing. Apologies for missing code: div { position: relative; width: 121px; height: 30px; } I need a minimum width and not a dynamic this is why I used a fixed one. In case there is not a CSS alternative then I will use a javascript approach.

    Read the article

  • Why are regular expressions such a complicated, cryptic mess?

    - by steffenj
    Often when I see regular expressions, I only see a total mess of characters. Why does it have to be this way? I guess what I really want to know is: are there alternatives to regular expressions that basically do the same thing but are implemented in a human readable language? [UPDATE] Thanks for all the great responses and inspiration! I wanted to highlight this particular link which shows how a (working) alternative would look like, which may also be a good starting point for learning or "simple" regex expressions. But you also quickly get a feel for the verbosity tradeoff.

    Read the article

  • preg_replace or regex string translation

    - by ccolon
    I found some partial help but cannot seem to fully accomplish what I need. I need to be able to do the following: I need an regular expression to replace any 1 to 3 character words between two words that are longer than 3 characters with a match any expression: For example: walk to the beach == walk(.*)beach If the 1 to 3 character word is not preceded by a word that's longer than 3 characters then I want to translate that 1 to 3 letter word to ' ?' For example: on the beach == on ?the ?beach The simpler the rule the better (of course, if there's an alternative more complicated version that's more performant then I'll take that as well as I eventually anticipate heavy usage eventually). This will be used in a PHP context most likely with preg_replace. Thus, if you can put it in that context then even better!

    Read the article

  • Waiting for a submitted job to finish in Oracle PL/SQL?

    - by vicjugador
    I'm looking for the equivalent of Java's thread.join() in PL/SQL. I.e. I want to kick off a number of jobs (threads), and then wait for them to finish. How is this possible in PL/SQL? I'm thinking of using dbms_job.submit (I know it's deprecated). dbms_scheduler is also an alternative. My code: DECLARE jobno1 number; jobno2 number; BEGIN dbms_job.submit(jobno1,'begin dbms_lock.sleep(10); dbms_output.put_line(''job 1 exit'');end;'); dbms_job.submit(jobno2,'begin dbms_lock.sleep(10); dbms_output.put_line(''job 2 exit'');end;'); dbms_job.run(jobno1); dbms_job.run(jobno2); //Need code to Wait for jobno1 to finish //Need code to Wait for jobno2 to finish END;

    Read the article

  • Display random image when page loads without utilizing onload in the body tag

    - by Peachy
    I'm trying to create a fairly simple piece of JavaScript that displays a random image from an array each time the page loads. I need to figure out a way to get this running without adding code to the body tag. Is there a way to accomplish this without, say, an onload funtion placed in the body tag? Here's what I have that relies on the onLoad: ImageSwitch=new Array(); ImageSwitch[0]='1.jpg'; ImageSwitch[1]='2.jpg'; ImageSwitch[2]='3.jpg'; ImageSwitch[3]='4.jpg'; function swapImage() { document.getElementById("theImage").setAttribute("src", ImageSwitch[ Math.round(Math.random()*3)]) } Any alternative ideas to accomplish this? Thanks.

    Read the article

  • Exception handling pattern

    - by treefrog
    It is a common pattern I see where the error codes associated with an exception are stored as Static final ints. when the exception is created to be thrown, it is constructed with one of these codes along with an error message. This results in the method that is going to catch it having to look at the code and then decide on a course of action. The alternative seems to be- declare a class for EVERY exception error case Is there a middle ground ? what is the recommended method ?

    Read the article

  • Django: Inject errors into already validated form?

    - by Parand
    After my form.Form validates the user input values I pass them to a separate (external) process for further processing. This external process can potentially find further errors in the values. Is there a way to inject these errors into the already validated form so they can be displayed via the usual form error display methods? Or, are there better alternative approaches? One suggestions was to include the external processing in the form validation. I'm not crazy about this since the external process does a lot more than just validate.

    Read the article

  • Java Collections.Rotate with an array doesn't work

    - by steve_72
    I have the following java code: import java.util.Arrays; import java.util.Collections; public class Test { public static void main(String[] args) { int[] test = {1,2,3,4,5}; Collections.rotate(Arrays.asList(test), -1); for(int i = 0; i < test.length; i++) { System.out.println(test[i]); } } } I want the array to be rotated, but the output I get is 1 2 3 4 5 Why is this? And is there an alternative solution?

    Read the article

  • Set timeout on third-party file request with jQuery

    - by markedup
    I'm trying to integrate a script file hosted by a third party into a new web site. Currently, I'm adding a SCRIPT tag to the DOM for that third-party script file on document ready: $(document).ready( function() { var extScript = document.createElement('script'); extScript.type = 'text/javascript'; extScript.src = 'http://third-party.com/scriptfile.js'; $('head').append(extScript); }); function extScriptCallback() { $('#extWidgetContainer').show(); } But sometimes that third-party script file request times out or takes a long time to respond. So, for the sake of best practice, I want to provide alternative content if the external script takes longer than e.g. 10 seconds to load. How do I achieve this? I've looked at JavaScript's native setTimeout(), as well as jQuery's delay() function, but I'm not sure which I should use--or how. Grateful for any suggestions.

    Read the article

  • Java generics: actual class as a generic parameter.

    - by user554916
    What do I write instead of "TheClass" to make this work? Or is there an alternative way to do it (possibly without making WithName and WithAge generic)? class Item { NeigborList<TheClass> neighbors; } class WithName extends Item { // here I want neighbors to be a NeighborList<WithName> String name; void someMethod() { System.out.println(neighbors.nearestTo(this).name); } } class WithAge extends Item { // here I want neighbors to be a NeighborList<WithAge> int age; void someOtherMethod() { System.out.println(neighbors.nearestTo(this).age); } }

    Read the article

  • Deprecated Preference Activity method

    - by Adnan Nazir
    package com.adi.preferencedemotest; i am working on PreferenceActivity but when i call my preference xml(prefs.xml) with the help of addPreferencesFromResource it says this method is deprecated and "This function is not relevant for a modern fragment-based PreferenceActivity" is there any alternative of this method? how i can handle ? public class PrefsActivity extends PreferenceActivity { @SuppressWarnings("deprecation") <------- @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.prefs); <------- } } Note: may be my question rate as duplicated but i didn't find any.

    Read the article

  • jQuery/Tablesorter: maintain secondary alphabetical sort

    - by user460847
    I have a table of names and ages that I want the user to be able to sort. When the page initally loads, sortList lists the rows in order from oldest to youngest, and then secondarily from A to Z. I want the same thing (a SECONDARY alphabetical sort) when the user actually clicks on the age <th>, but sortForce is making the alphabetical sort primary. Is there an alternative? $('#super_results table').tablesorter({ sortForce: [[0,0]], sortList: [[1,1],[0,0]] }); Or am I misunderstanding sortForce? Documentation here.

    Read the article

  • jquery bind an event to a class, or something to the same effect?

    - by mna
    hi, I'd like to bind an event to a class, or any alternative to the redundant code I posted below. Any ideas? thanks, mna (function(){ $( "button", "body" ).button(); var submenu=false; $( "#about" ).click(function() { $( "#content" ).fadeOut(1000); $( "#content" ).load('about.html'); $( "#content" ).fadeIn(1000); }); $( "#community" ).click(function() { $( "#content" ).fadeOut(1000); $( "#content" ).load('community.html'); $( "#content" ).fadeIn(1000); }); $( "#store" ).click(function() { $( "#content" ).fadeOut(1000); $( "#content" ).load('store.html'); $( "#content" ).fadeIn(1000); }); $( "#projects" ).click(function() { $( "#content" ).fadeOut(1000); $( "#content" ).load('projects.html'); $( "#content" ).fadeIn(1000); }); });

    Read the article

  • Is it possible to make an online registration process for a course in Google Docs with a cap on registrations?

    - by user61551
    I am trying to build an online registration form for an institute I intern at that is running a training programme with multiple courses and hundreds of applicants. I've done registration forms with Google Docs Forms before, but the tricky spot this time round is that I'm trying to put a registration cap on each of the courses. Every person needs to register for one course in every timeslot, and there are seven or so timeslots. However, as seating space in every venue is limited, we would like to cap registrations per course (venue) to 200 per course, after which either a) the applicant will be informed that they need to register for another course in that timeslot if they apply to a full course, or b) ideal case scenario, the option will be greyed out. Is this possible using Google Docs Forms at all? If not, is there a free alternative that might do the job properly?

    Read the article

  • Writing a script for reading many .csv files with similar filenames

    - by wahalulu
    I have several .csv files with similar filenames except a numeric month (i.e. 03_data.csv, 04_data.csv, 05_data.csv, etc.) that I'd like to read into R. I have two questions: Is there a function in R similar to MATLAB's varname and assignin that will let me create/declare a variable name within a function or loop that will allow me to read the respective .csv file - i.e. 03_data.csv into 03_data data.frame, etc.? I want to write a quick loop to do this because the filenames are similar. As an alternative, is it better to create one dataframe with the first file and then append the rest using a for loop? How would I do that?

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >