Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
18
Posts with Upvotes
18
Upvoting Members
14
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
6 Commented Posts
0 Endorsements
Ranked #464
~34.8K People Reached
Favorite Tags

77 Posted Topics

Member Avatar for mikeandike22

Try using the [icode]:not()[/icode] selector. [code=Javascript] $("img:not([alt])").attr("alt", "some text"); [/code]

Member Avatar for marta.johnsson
0
5K
Member Avatar for judithSampathwa

Is the file that you are trying to open from the code already open in Excel application? I think Excel locks open files and only allows them to be opened in read-only mode while the first instance is open.

Member Avatar for Cameronsmith63
0
382
Member Avatar for GeoBob

Why will simply assigning the return value to a known variable not work in your case? Is there a unique reason you need to create a named dict inside the function? Usually, you know what you are passing into the function, so it should be feasibile to assign the return …

Member Avatar for JoshuaBurleson
0
435
Member Avatar for Salman. S

Commit is a method on the connection object. Try [icode]connection.commit()[/icode]

Member Avatar for sergb
0
212
Member Avatar for MARKAND911

What do you mean by "rotate"? Do you want it to change to some other text in the browser while the user is looking at the page?

Member Avatar for kvprajapati
0
675
Member Avatar for moone009
Member Avatar for Mitja Bonca
0
110
Member Avatar for m_wylie85

Try processing the file line-by-line. You can use System.IO.StreamReader.ReadLine() method to read the next line. [code=c#] StreamReader reader = new StreamReader(file); string line = null; while ((line = reader.ReadLine()) != null) { if (Regex.IsMatch(line, searchText, RegexOptions.IgnoreCase)) { //TODO: append line to the output here } } [/code]

Member Avatar for sergb
0
133
Member Avatar for bruceoz

You can run a whole query that produces a scalar result and have it be returned and one column in the result set. [code=sql] select account_id, firstname, lastname, case when exists(select * from flag_table where account_id = account_table.account_id and flag = 'EV1') then 1 else 0 end EV1, case when …

Member Avatar for bruceoz
0
142
Member Avatar for GothLolita

If your data has be in text files, do what SgtMe suggested. Alternatively, look into [icode]sqlite3[/icode] python module. It would allow you to create a real database and run sql statements against it to add, modify, and delete records.

Member Avatar for techie1991
0
2K
Member Avatar for WildBamaBoy

Check the documentation on [icode]os.path.split[/icode]. I think it returns a tuple [icode](name, extension)[/icode]. [code=python] for fileInArchive in archive.infoiter(): extension = os.path.split(fileInArchive.filename)[1] if extension == "txt": print "This is a text file" [/code]

Member Avatar for Beat_Slayer
0
263
Member Avatar for ariez88

I don't think its feasible to run FileSystemWatcher from a web application. All the callback methods are gone once the page finished processing a web request. The FileSystemWatcher will continue to run in a separate process after your page finished, but will not be able to call any of your …

Member Avatar for kvprajapati
0
177
Member Avatar for andydeans

Try the following (if "S_TaskDueDate" is in your $_GET array): [code=php] $WADbSearch1->addComparisonFromEdit("TaskDueDate",uk_to_us_date($_GET["S_TaskDueDate"]),"AND","=",2); [/code]

Member Avatar for sergb
0
100
Member Avatar for ohgee

This is a syntax error. Why don't you use a hashtable or an array to hold values related to "the name of the day and a number"? I don't really understand what you are trying to do, so I can't really give you any sample code.

Member Avatar for sergb
0
276
Member Avatar for vulcano224

[code=python] class Customer(object): def __init__(self, name): self.name = name self.items = {} def gettotal(self): tot = 0 for price in self.items.values(): tot += price return tot def main(): print "Enter 'quit' when being asked for customer's name to quit the program" print "Enter 'done' when being asked for item name …

Member Avatar for griswolf
0
107
Member Avatar for ohgee

I think its more reliable to use the onclick event handler. [code=html] <!-- The goal is to create the following HTML. --> <a href="#" onclick="addHours('dayDiv'); return false;">Add Hours</a> [/code] [code=javascript] var link = document.createElement("a"); link.setAttribute("href", "#"); link.onclick = function() { addHours('dayDiv'); return false; }; link.innerHTML = "Add Hours"; [/code] Hope …

Member Avatar for ohgee
0
1K
Member Avatar for nertos

[code=javascript] function periodic() { // do something usefull } // schedule a function to run every 5 minutes setInterval(periodic, 5*60*1000); [/code]

Member Avatar for sergb
0
67
Member Avatar for lf.gene

[code=html] <html> <head> <script type="text/javascript"> function makeTable() { var html = "<table border=1><tr><th>Name</th></tr><tr><td>Gene</td></tr></table>"; document.getElementById("target").innerHTML = html; } </script> </head> <body> <div id="target"></div> <input type="button" onclick="makeTable();" value="Create Table" /> </body> </html> [/code] NOTE: The code was not tested.

Member Avatar for sergb
0
65
Member Avatar for iamchamith

You can probably use web server logs to get all requests the web server handled. Then you can analyze those logs (there are tools that do that) and get the number of distinct IP addresses... If that is not what you want, you will need to implement the counting yourself.

Member Avatar for sergb
0
82
Member Avatar for bhavna13

You were getting error on line 19 because you are trying to add an array (variable a) to a HashSet of Strings. Thats why a String is expected, but you are giving it an array. Change it to [icode]if (!s.add(a[i]))[/icode]. Anyway, using [icode]Scanner.nextLine()[/icode] allows users to enter multiple words per …

Member Avatar for bhavna13
0
192
Member Avatar for nertos

I don't think its possible. The client-side code must know the URL to which to send the request. You can assign the URL to a javascript variable, the variable could be loaded in another .js file, and then you can substitute that variable for the raw URL when calling the …

Member Avatar for sergb
0
1K
Member Avatar for rickster11

Try settings the default title in the master page. Then try using the Pre_Render event of the page that needs a different title to overwrite the default title. I think for this to work you need to have your <head> element marked as runat="server". And maybe the title element too. …

Member Avatar for sergb
0
75
Member Avatar for loveforfire33

Here is the javascript code that can send redirect to another page. [code=javascript] var anotherpage = "another.html"; window.location.href = anotherpage; [/code] In your case, while the alert box is visible, no other javascript is executed on the page. This means that you don't need to know when the user clicks …

Member Avatar for loveforfire33
0
149
Member Avatar for pgmarco

You can produce the total of selected items in Javascript, without sending anything to the server or using the database for that. Of course, when the user will submit the form to purchase selected components, your PHP script will have to calculate the final price and store needed info in …

Member Avatar for sergb
0
179
Member Avatar for benhowdle89

I am not good with VB.NET, so please fix any errors you might encounter. Also, substitute your SQL statement and connection string. [code=VB] 'Declare variables Dim connString as String Dim conn as OdbcConnection Dim cmd as OdbcCommand Dim prm as OdbcParameter Private Sub MainForm_Load(ByVal sender as Object, ByVal e as …

Member Avatar for sergb
0
118
Member Avatar for ttboy04

[code=java] int[] groups = {10, 23, 29}; public String toString() { String buffer = ""; for (int i=0; i < groups.length; ++i) buffer += i + "(" + groups[i] + ") "; return buffer.trim(); } [/code]

Member Avatar for ttboy04
0
106
Member Avatar for sdhawan

When you are reading a file, the API maintains a file pointer which points to where you are in the file. You can think of this as the position of the cursor. When you call [icode]ReadToEnd()[/icode], the data is read from the current position to the end of the file. …

Member Avatar for kdcorp87
0
102
Member Avatar for ajwei810192

If you want any help, you are going to have to post the HTML generated by your aspx page and let everyone know what version of IE you have. If someone is able to recreate the problem, they might be able to help.

Member Avatar for ajwei810192
0
314
Member Avatar for i-teq

You need to create an instance of the Currency object before using it and calling its methods. The way you have it done, you are trying to call a static method of the Currency class in the very last line of posted code (and it probably gives you an error …

Member Avatar for i-teq
0
4K
Member Avatar for fawad123

You are generating one [icode]<span id='username_label'>[/icode] for each textarea. Then, when you run [icode]document.getElementById('username_label')[/icode], it returns only the first instance of the element with the given id. You have to assign a different id to all span elements if you want to be able to identify them uniquely. You do …

Member Avatar for fawad123
0
119
Member Avatar for umandajayo

[code=javascript] function Empty() { var element = document.getElementById('file_input'); var sValue = element.value; if (sValue == "") { alert("ERROR: Project Image Should be Uploaded!"); element.focus(); return false; } return true; } [/code] [code=html] <input type="file" name="fileField" id="file_input" /> <input type="submit" value="Send" name="Submit" onclick="return Empty();" /> [/code]

Member Avatar for umandajayo
0
105
Member Avatar for whiteyoh

[code] <html> <head> <script type="text/javascript"> function showHint(str) { // Remove this because you want to allow empty string //if (str.length == 0) //{ // document.getElementById("txtHint").innerHTML = ""; // return; //} if (window.XMLHttpRequest) xmlhttp = new XMLHttpRequest(); else xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && …

Member Avatar for sergb
0
80
Member Avatar for niths

Unchecked checkbox: [code=HTML] <input type="checkbox" /> [/code] Checked checkbox: [code=HTML] <input type="checkbox" checked="checked" /> [/code]

Member Avatar for sergb
0
118
Member Avatar for vlady

Try the following code: [code=python] import string # this function returns a set of distinct words from a file def readwords(filename): res = set() f = open(filename, 'r') # iterate over lines for line in f: line = line.replace('-', ' ') words = line.split() # iterate over words of each …

Member Avatar for vlady
0
81
Member Avatar for Sinha's

How are your primary keys generated? Are you using some SQL code to get a new primary key value? Something like [icode]select max(id) from table[/icode]? Take a look at [icode]identity[/icode] columns in SqlServer. It will generate a unique number for you and the database guarantees that even if two records …

Member Avatar for dnanetwork
0
103
Member Avatar for Lordson60

Here is the general idea of how you can save some values to a file and read them in later. [code=Java] public class Settings { public String s1; public int i1, i2, i3; } public void writeSettings(Settings s, String fileName) { PrintWriter w = new PrintWriter(fileName); w.println(s.s1); w.println(s.i1); w.println(s.i2); w.println(s.i3); …

Member Avatar for jwenting
0
91
Member Avatar for adobe71

The only way that I know to put an image inside a plain textbox is to set the image as the background of the textbox. Then you can handle the focus event on the textbox and remove the background image. You can also handle the blur event to put the …

Member Avatar for sergb
0
83
Member Avatar for iqra123

Each page can periodically poll the server/database for new messages. You can use AJAX calls for that. When a new message is detected, you can use javascript to display the "new message" notification to the user. When a user opens the page, the page should remember who opened it. Say …

Member Avatar for sergb
0
71
Member Avatar for ayesha789

Here is one idea of how you can get this done. You can add a `LastRequest` field to your `members` table that will hold the timestamp of the last request made by the member. You can set it up as an integer field and store the current time in second …

Member Avatar for ayesha789
1
246
Member Avatar for nebyas

You should know the permissions for the current user when the page loads. Now, the easiest thing to do to make the page read-only is to hide the "Save" button or whichever button causes the data to be saved. [code=C#] if (!canEdit) btnSave.Visible = false; [/code] Another way is to …

Member Avatar for sergb
0
59
Member Avatar for niths

Using jQuery javascript library: [code=PHP] <?php // filename: files.php $files = get_uploaded_files(); $i = 1; foreach ($files as $f) { echo "$i) $f<br>"; $i++; } ?> [/code] [code=HTML] <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function getfiles() { var url = "files.php?t=" + (new Date()).getTime(); //kill browser cache // send …

Member Avatar for sergb
0
82
Member Avatar for haribo83

The second option suggested by Manuz should also work. All you have to do is, instead of the "More Updates" button, call a javascript function that does the AJAX call and updates your page. This would be the same function as you would call when the "More Updates" button was …

Member Avatar for sergb
0
136
Member Avatar for ennoil

Here is one approach. Assuming the data file is not very big, you can read the whole thing into memory and manipulate it from there. Otherwise, you may want to read just the second column from the csv file to produce the menu. [code=Python] import csv data = [] #array …

Member Avatar for sergb
0
2K
Member Avatar for jaysean

Here is what your code does: 1) Reads the first line from fn reader in the outer while loop. [icode]while ((s1 = fn.readLine()) != null)[/icode] 2) Reads all lines from the pn reader in the inner while loop (during the first iteration of the outer while loop). [icode]while ((s2 = …

Member Avatar for jaysean
0
149
Member Avatar for veledrom

Any non-abstract child class [B]must[/B] implement [B]all inherited[/B] abstract methods. You are getting the error because the doL class inherited 4 abstract methods from [ICODE]AbstractDatabase[/ICODE] class, but implemented only 2 of them. Because of inheritance, to the compiler it looks like the [ICODE]doL[/ICODE] class still has 2 abstract methods. I …

Member Avatar for sergb
0
87
Member Avatar for kcomeby

The problem is likely to be with the SQL provider installed on the server. It may be the case that SQL provider does not support updating of recordsets. As a workaround, you can simply execute an INSERT statement against the connection and then do [icode]Rs.Open "SELECT * FROM news", Cn, …

Member Avatar for sergb
0
95
Member Avatar for k2k

What you could do is periodically poll the database for list of existing names and use javascript to manipulate HTML in a webpage to display those names. I suggest using some javascript library that simplifies making AJAX requests and DOM manipulation. One such library is the excellent jQuery. That is …

Member Avatar for sergb
0
2K
Member Avatar for Dig

The following code has not been tested very well and lacks input validation. Generics are not used as I am not sure which Java version you have. [code=Java] import java.util.*; class Student { public String name, phone; public int id, age; public String toString() { return "Student " + name …

Member Avatar for Dig
0
143
Member Avatar for abcdabid

That usually means that the parsing failed. Make sure that what you are trying to parse can actually be parsed into a double. [code] Console.WriteLine(System.Text.Encoding.ASCII.GetString(downBuffer, 0, bytesSize)); [/code]

Member Avatar for abcdabid
0
173
Member Avatar for arty.net

You should never update (or touch) the GUI from a non-GUI thread. You can consider the GUI thread to be the same thread on which you called app.MainLoop(). Your calcolo method executes on a different thread, not on your GUI thread. Therefore, you should not touch the GUI elements inside …

Member Avatar for arty.net
0
1K
Member Avatar for !n@k!

[URL="http://en.wikipedia.org/wiki/Interpolation_search"]http://en.wikipedia.org/wiki/Interpolation_search[/URL] explains what it is and gives an example in Java.

Member Avatar for !n@k!
0
69

The End.