Member Avatar

How does an array variable indexing expression differ from an array definition size expression?

Member Avatar
+0 forum 2
Member Avatar

Hello Friends Please give me answer.

Member Avatar
+0 forum 1
Member Avatar

I have a nested list, named env, created in the constructor and another method to populate an element of the grid defined as below: ... class Environment(object): def __init__(self,rowCount,columnCount): env = [[ None for i in range(columnCount)] for j in range(rowCount) ] return env def addElement(self, row, column): self[row][column] = 0 ... Later in the code I create an instance of Environment by running: myEnv = createEnvironment(6,6) Then I want to add an element to the environment by running: myEnv.addElement(2,2) So what I expected to happen was that I would receive a new Environment object as a 6x6 grid with …

Member Avatar
+0 forum 2
Member Avatar

Hi, I have a text file in which there are 10000 lines. There are 225 numerical values on each line and each numerical value is followed by a index number and a colon e.g., 1:0.021354 2:0.125432 3:451321 ...... 225:0.001254. Now I want to remove this indexing. I know how to add indexing but could not perform to remove that. Please help me in solving this problem. Thanks Here is the code for adding indexing. static void Main(string[] args) { string[] files = Directory.GetFiles(@"F:\New folder", "*.txt", SearchOption.AllDirectories); StringBuilder strFile = new StringBuilder(); foreach (string file in files) { using (StreamReader sr …

Member Avatar
+0 forum 10
Member Avatar

Hello All, I'm trying to write a function that outputs the reverse of the input. I know that you can use the built-in list.reverse() or S[::-1] methods, but I want to make it using the 'for' loop. My code initially is: def reverse(S) for x in S: print(x, end = " ") the inputs would be >>> reverse(['a','b','c'] ['a','b','c'] #this is output on shell Any ideas on how to reverse it and have the output be like below: >>> reverse(['a','b','c'] ['c','b','a'] Any help would be greatly appreciated. Thanks.

Member Avatar
+0 forum 4
Member Avatar

Hello Guys, My job is to process the text files. following are the steps that i have to do. 1: To combine multiple text files into one text file 2: Add filename (but without extension) in the beginning of each text file. 3: and Finally, index the contents of the file by 1,2,3 i.e., if the contents of the text file are 378456 354789 564876 then index it with 1:378456 2:354789 3:564876 4:56879 ......so on I have written the following code, which is combining the multiple text files into one file and also adds the file name without extension...but i …

Member Avatar
+0 forum 5
Member Avatar

Im trying to find the first element in each nested list: x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] So that I get print a string: "hw ayo iaf" so far I have: def first_letters(): x = [['hey','wassup'],['are','you','ok'],['i','am','fine'] Thanks!

Member Avatar
+0 forum 1
Member Avatar

Im trying to get the last element in each nested list such as double list = [['Hello','how','are','you'],['I','am','fine'],['How','about','yourself']] so that it will print out ['you','fine','yourself] I am also trying to do this all under a function such as def last_words(): #where my double_list is already in this function Thank you!

Member Avatar
+0 forum 1
Member Avatar

I find something strange about Google Indexing. More than half of the products were indexed by Google sometime back. They reduced the indexing pages and after a while (in a week), only 1/4th of the indexed pages were shown as getting indexed. But when I search for a product, even the Newer Product which is not even in the sitemap, is showing in the 1st page of Google. For this product, not even a single link has been created. I don't really understand what it is.

Member Avatar
+0 forum 23
Member Avatar

Hi guys, I need to ping a few hundreds of backlinks as only some actually are indexed. Could you please advise what is the best way of creating an RSS from the multipple URLS (hundreds). I remember in the past trying some site that creates RSS feed from the list, but only 50 at a time or so... That's a hassle in a long run. Any advise?

Member Avatar
+0 forum 3
Member Avatar

I am trying to find the position of the maximum number in a 2D array. i have used .max() to find the max value but how do i find its position?

Member Avatar
+0 forum 4
Member Avatar

Hi everyone! So here's my problem: Given an element, I need to get the index of the array in an array of arrays. For example, I have the following array of arrays: [CODE] my @arrOfArr = ( [ "1023", "1472", "0751651"], [ "1527", "1167", "2496111" ], [ "M167", "1412", "1761683" ], ); [/CODE] Is there any way that when I know the value "1527", I will know its index in the arrays of arrays which is '1'? Thus: '1023' is at index 0; '1527' is at index 1; 'M167' is at index 2; If my question was not clear, I …

Member Avatar
+0 forum 3
Member Avatar

I am trying to generate a new checkbox in a different form. [code] Public Class frmAdd Public Sub btnitemadd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnitemadd.Click Dim chklowerleft As New CheckBox Dim chkhandleft As New CheckBox Dim indexcounter As Integer = 4 If chkleftlowerarm.Checked = True Then frmMain.chklistLA.Items.Add(chklowerleft, False) frmMain.chklistLA.Items.Item(2) = ("Lower Arm Actuator") End If If chkhand.Checked = True Then frmMain.chklistLA.Items.Add(chklowerleft, False) frmMain.chklistLA.Items.Item(2) = ("Lower Arm Actuator") frmMain.chklistLA.Items.Add(chkhandleft, False) frmMain.chklistLA.Items.Item(3) = ("Hand Actuator") End If Me.Close() End Sub End Class [/code] While this is great for things like those added, it may make things a bit difficult …

Member Avatar
+0 forum 11
Member Avatar

what i should do for fast indexing for my website.

Member Avatar
+0 forum 22
Member Avatar

Hello all, I have a table dir_records < SHOW CREATE TABLE dir_records > CREATE TABLE `dir_records` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `TITLE` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `URL_TITLE` varchar(250) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `TXT` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `COMPANY_ID` int(11) NOT NULL, `CATEGORY_ID` int(11) NOT NULL, `PRIORITY` int(5) NOT NULL DEFAULT '0', `STATUS` int(1) NOT NULL DEFAULT '1', PRIMARY KEY (`ID`), UNIQUE KEY `COMPANY_URL_INDEX` (`COMPANY_ID`,`URL_TITLE`), UNIQUE KEY `CATEGORY_URL_INDEX` (`CATEGORY_ID`,`URL_TITLE`), KEY `CATEGORY_STATUS_INDEX` (`CATEGORY_ID`,`STATUS`), KEY `PRIORITY` (`PRIORITY`), KEY `COMPANY_ID` (`COMPANY_ID`) ) ENGINE=MyISAM The index CATEGORY_STATUS_INDEX I created for the following query …

Member Avatar
+0 forum 1
Member Avatar

You guys were so kind in helping me resolve my database connection problem, my web page is up and running with connections to the database working just great. Thank you all. Now I am just having a problem getting the Search to work. My web search requests return the following: "No documents matched the query", however, if I go to the Index Service MMC, and use that query, all my documents are returned. I am running Windows Server 2003 Enterprise with IIS 6.0 on a 64 bit processor. I migrated this web site from the same OS but a 32 …

Member Avatar
+0 forum 1
Member Avatar

I was wondering if someone could help me with a mysql indexing problem. The index of 'username' for this code works fine: [CODE=mysql]EXPLAIN SELECT count( * ) AS num_messages FROM messages, users WHERE messages.username = 'johndoe' AND users.username = 'johndoe' AND messages.sent_date >= users.last_activity[/CODE] Here is the explain: [code] id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE users ref username username 53 const 1 Using where 1 SIMPLE messages ref username username 53 const 195 Using where [/code] But in the following table the index of 'page' which corresponds to the users.id is not working: [CODE]EXPLAIN …

Member Avatar
+0 forum 4
Member Avatar

Hi, I have given around 5 links to a particular page of my website. They were from good PR4 and above Article Websites. But still I find those pages are not indexed by google. It is a Shopping Cart Website. The contents are also good enough. Hence can't blame contents also. Any other reason I could look into. Thanks in advance.

Member Avatar
+0 forum 7
Member Avatar

I have a spreadsheet (roughly 200x200 in size) that is a matrix of 0's and 1's that define rules. These rules cannot be expressed in procedural logic because they need to be easily accessible for change by a user for modification. The first row are header value strings and the values in the first column of each row are key strings for that row. What I need to be able to do is pull back the 0 or 1 value for a cell identified by a particular column string and header string value. This needs to be done using VS2005, …

Member Avatar
+0 forum 1
Member Avatar

I have a complete list of a topics. I have to create a Index for A B C D E ... On Clicking those buttons without navigating to another page it shows only topics wich starts from that letter... How to code it in php???

Member Avatar
+0 forum 17

The End.