Dear Python coders, I am new to python programming and I am trying to solve an assignment. The question is stated below; Create a function that does the following 1. Accepts as the first parameter a string specifying the data structure to be used "list", "set" or "dictionary" 2. Accepts as the second parameter the data to be manipulated based on the data structure specified e.g [1, 4, 9, 16, 25] for a list data structure 3. Based off the first parameter return the reverse of a list or add items `"ANDELA"`, `"TIA"` and `"AFRICA"` to the set and return …

Member Avatar
Member Avatar
+0 forum 1

http://i.stack.imgur.com/nJGPy.png A physical memory/cache system has the above properties. I need to make a diagram showing how a 12‐bit main memory address is partitioned into the block offset, set index, and tag fields for addressing the cache. Show clearly the bit positions of the 12‐bit address occupied by each field. I have no idea how to even start this, so some guidance would be great.

Member Avatar
Member Avatar
+0 forum 1

Are these two instructions equivalent, i.e do they both do the exact same thing? `addi $s0,$s0,0` and `add $s0, $s0, $zero`

Member Avatar
Member Avatar
+0 forum 3

Hi, I am getting below error after executing below code. **Error**: In function `main': undefined reference to `Point2D::Point2D(int, int)' class Point2D { public: Point2D(int,int); int getX(); int getY(); void setX(int); void setY(int); double getScalarValue(); bool operator< (const Point2D &right) const { return x < right.x; } protected: int x; int y; double distFrOrigin; void setDistFrOrigin(); }; int main() { Point2D abc(2,3); set<Point2D> P2D; P2D.insert(abc); // i am getting error here ,i dont know why return 1; }

Member Avatar
Member Avatar
+0 forum 3

I want to find all the subset of a set.Can sumone plz help me through this.I have a array which would consisting ={1,4,5,6,7} i want all subsets.. {1,4} {1,5}...{1,4,5,6} {1,5,6,7} {1,4,6,7}..etc.

Member Avatar
Member Avatar
+0 forum 1

I have this code which finds the duplicate rows .I want to check if the top row has weight greater than given minimum support..If true then generate its subsets. If row 1 i.e 11110011 wight>min_sup then generate subsets....if not then jump to next row here 1 represents presence of items and 0 represents absence... so row one has 1,2,3,4,9,12 so subsets i need is {1,2,3},{1,3,4},{1,4,9},{1,9,12} {1,2},{1,3}....etc Can anyone help */ package javaapplication42; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Smalldataset { public static void main(String[] args) { BufferedReader br = null; String[] line=new String[55]; int n, c, d, swap,i=0,j=0,min_suport,row=0,col=0,no_of_selected_item=0; …

Member Avatar
Member Avatar
+0 forum 2

I understand the concept of using get and set with instance variables, but I am confused about using get and set by themselves For example `public string random {get; set;}` what is the purpose of this, and how can I use this in my code. I am a beginning programmer any help would be great help. Thanks

Member Avatar
Member Avatar
+0 forum 2

I'm quite new to python and am trying to make a kind of 20Q thing, but am struggling - anybody know how to delete a list from a set, or if not a list from a list? Thanks :)

Member Avatar
Member Avatar
+0 forum 5

I have been asked to build a group of functions that carry out set theory operations such as intersection and union. The functions below that I must complete are set_intersectWith, set_unionWith, set_minusWith, set_powerset, where: > set_intersectWith = A ∩ B > set_unionWith = A ∪ B > set_minusWith = complement = A \ B > set_powerset = P(S) The following file is what I am working on, *set.c*: #include <assert.h> #include <stdlib.h> #include <stdio.h> #include "clist.h" #include "set.h" struct set_implementation { clist * items; printer item_printer; equals item_compare; }; set * new_set(printer item_printer, equals item_compare) { set * s = …

Member Avatar
Member Avatar
+0 forum 1

Hello. I have a function that checks the internet connection. I need to set a timeout to it. I have tried without success to do that. Please help. Here is the function: function isOnline() { if(navigator.onLine){ var uri = baseUrl+'ping'; var xhr = new XMLHttpRequest(); xhr.open('GET',uri,false); try{ xhr.send(); return true; }catch(err){ return false; } }else{ return false; } }

Member Avatar
Member Avatar
+0 forum 1

I'm in a class and we discussed what set /p does, but I wasn't paying close attention, I was wondering if anyone could explain to me what set /p does and an example of how I can use it in a batch file for dos

Member Avatar
Member Avatar
+0 forum 3

Hello Everyone, I am trying to compute the subscription next due date. For example, these are the subscription dates: 1/28/13 1/29/13 1/30/13 1/31/13 When I used the php function strtotime( "+1 month", <date> ) the next month due date will be: 1/28/13 due date is 2/28/13 1/29/13 due date is 3/1/13 1/30/13 due date is 3/2/13 1/31/13 due date is 3/3/13 With this, it will change the due date of the subscriber even though other months have the 29th, 30th and 31st. Can you please provide any suggestions or options on how to handle this? Thanks in advance

Member Avatar
Member Avatar
+0 forum 5

Dim table As DataTable = New DataTable table.Columns.Clear() Chart1.DataSource = Nothing Chart1.Series.Clear() table.Columns.Add("Color", GetType(System.String)) table.Columns.Add("Data", GetType(System.Int32)) table.Rows.Add("Green", Integer.Parse(txtgreen.Text)) table.Rows.Add("Red", Integer.Parse(txtred.Text)) table.Rows.Add("Blue", Integer.Parse(txtblue.Text)) table.Rows.Add("Yellow", Integer.Parse(txtyellow.Text)) table.Rows.Add("Brown", Integer.Parse(txtnothing.Text)) Dim IEtable = CType(table, System.ComponentModel.IListSource).GetList Chart1.DataBindTable(IEtable, "Color") Chart1.DataBindTable(IEtable, "Data")

Member Avatar
Member Avatar
+0 forum 1

A simple way to find duplicate words in a text. In this case the text is preprocessed to eliminate punctuation marks and set all words to lower case.

Member Avatar
Member Avatar
+2 forum 1

I need help writing a program in c++ where i have to write 3 different programs, a webcounter.cpp,webcounter.h, and test_prgm.cpp.So then i have to creat a makefile to compile them together, and the result of the program is "When I create the the counter, I would like to be able to set the value of the counter. Second, I need to be able to tell it "hit" and have it increment. Finally, I should be able to "reset" the counter, and "get" the current number of hits from it." it has to be a header file, and webcounter.cpp has my …

Member Avatar
Member Avatar
+0 forum 10

I have an image view in my android application. I want to set the picture dynamically from a link. Example: The user has an id number of 0920305 The image from http://teachers.usls.edu.ph/student_pics/0920305 will appear on the image view.

Member Avatar
Member Avatar
+0 forum 2

Hi, I have one form with multiple controls (e.g. Button,Textbox, RadioButton, ComboBox, etc.). I want to set the focus dynamically on a control using key F4 to highlight that control. Scenario: 1.Suppose the user clicks on any control 2.Press Key F4 to highlight that control so that the user will know which control was clicked before. Appreciate your suggestions. Thank you.

Member Avatar
Member Avatar
+0 forum 14

Hey everyone I was programing a small game and I am trying to figure out how to send an int value to a class and return a String from it. This is my code: This is my main.java class public class GamGUI { /** * @param args */ public static void main(String[] args) { int char1; String Playername; System.out.println("Welcome to Finaly Fantsy XXVIIV"); System.out.print("Please enter your name: "); Scanner scan = new Scanner(System.in); Playername = scan.nextLine(); System.out.println("Please select the Character you want to be"); System.out.println("Enter 1 for WARRIOR"); System.out.println("Enter 2 for BLACK MAGE"); System.out.println("Enter 3 for MONK RANGER"); char1 = …

Member Avatar
Member Avatar
+0 forum 6

I have this problem of moving my codes around in my external drive. Everytime I plug the external drive to a new PC, a different drive is assigned and I would have path not found error in my program. I only knew about set_path=app.path which is actually referring to the path where VB6 is installed and not directory of the VB project file that I saved in. Is there any any to set the path to the local path of .vbp or .frm?

Member Avatar
Member Avatar
+0 forum 3

And the microprocessor? I want to know exactly how this all works. Wikipedia claims that an instruction set architecture determines the data, registers, addressing modes, memory, etc. It also claims that it dictates the opcodes on a microprocessor. Wikipedia says "Microarchitecture" is the way a given ISA is implemented on the chip itself. But if the ISA dictates the specifications of the chip implemented on the micro side, what is the ISA? And how does it differ than the microarchitecture on the chip exactly? This is unclear to me. Like, let's say I want to develop for the chip in …

Member Avatar
Member Avatar
+0 forum 3

//compute percentage for Parent1 DecimalFormat df = new DecimalFormat("#.##%"); rs = s.executeQuery("SELECT " + "(SELECT COUNT(*) FROM genetic.blood_type where diseases = '" + disease1 + "')" + "/COUNT(*) AS rowcount FROM genetic.blood_type where btype = '" + btype1 + "'"); rs.next(); int result = rs.getInt("rowcount"); rs.close(); out.println(disease1 + " is " + df.format(result) +" "+ result);

Member Avatar
Member Avatar
+0 forum 2

Hi. Nice to meet you. I'd like to know if I'm doing the allocation of memory from data to new_data correctly and why new_data only has one value since the memory of data was copied before to new_data. set size: 10 set[000] = 000 set[001] = 001 set[002] = 002 set[003] = 003 set[004] = 004 set[005] = 005 set[006] = 006 set[007] = 007 set[008] = 008 set[009] = 009 set size: 1 set[000] = 009 ==3827== ==3827== HEAP SUMMARY: ==3827== in use at exit: 40 bytes in 1 blocks ==3827== total heap usage: 22 allocs, 21 frees, 256 …

Member Avatar
Member Avatar
+0 forum 2

Hello, I need a code that checks if a button is pressed to change the BackGround Image of Picture Box So when the button is pressed,a backgroundimage of a picturebox must be changed I tried to use PictureBox1.BackgroundImage.FromFile("IMAGE.bmp") *THE IMAGE IS IN THE PROJECT,IT'S NOT ON THE HARD DRIVE ANYMORE**but didn't work,Please Help ME !

Member Avatar
Member Avatar
+0 forum 1

Consider a hospital scenario. Design classes for: Patients. The class might have fields like unique ID for the patient, name, male or female, age, address, phone number, date of birth, height, and weight. I need help with this problem

Member Avatar
Member Avatar
+0 forum 10

package hospitalclient; public class Person { static int idnumber= 1500; private String name; private String telephoneno; private char gender; private String nationality; //No Parameter constructor public Person() { name="unassigned"; telephoneno = ""; gender = 'M'; nationality = "Saudi"; } public int getid() { return idnumber; } // Accessor Methods public String getname() { return name; } public String gettelephoneno() { return telephoneno; } public char getgender() { return gender; } public String getnationality() { return nationality; } //Mutator Methods public void setname(String Name) { this.name = Name; } public void settelephoneno(String telephoneno) { this.telephoneno = telephoneno; } public void setgender(char …

Member Avatar
Member Avatar
+0 forum 2

I think this simple example might ask the question a lot more clearly. I have an input file with multiple products. There are different types of product (2 types with 2 product IDs is fine enough for this example), but the input will have many more. I only want to output the info for the first product of each type that I encounter in the for each Product loop. (I'm outputting info for the lowest priced product, so the first one will be the lowest price because I sort by Rate first.) So I want to read in each product, …

Member Avatar
Member Avatar
+0 forum 3

For anyone who likes to do something with sets in C#, this can be a starting point. The full project (VS 2010) is also included. Have fun with programming!

Member Avatar
+0 forum 0

Hi everyone, I have 3 forms: main, AdvancedSearchMenu, and FacilitySearch. When the user clicks the AdvancedSearchMenu button on the main form, a new form appears in the style of a popup. This form contains a few different controls, including a button for FacilitySearch. I want the form to change from AdvancedSearchMenu to FacilitySearch when the user clicks the FacilitySearch button, but I don't know how to set focus to this FacilitySearch form when the switch happens. Here is my code: Public Class advSearchMenu Private Sub FacilityButton_Click(sender As System.Object, e As System.EventArgs) Handles FacilityButton.Click Me.Visible = False FacilityAdvSearch.Show() End Sub End …

Member Avatar
Member Avatar
+0 forum 1

Button1.DoDragDrop(BackgroundImage, DragDropEffects.None) Throws an error ' Object reference not set to an instance of an object. ' First time I've used DoDragDrop, and first time with 2012 :)

Member Avatar
+0 forum 0

I'm quite new to Javascript but thought that I should challenge myself to use it to solve an old problem of mine. I'm trying to set the height of a div to the same as the width of it. Example: The width is set to 50% and the screen is 1000px wide, the element will be 500px wide. I want the height to be the same; 500px. I tried to achieve this using this Javascript code: var layer=document.getElementById('layer'); var layer_width=layer.width(); layer.style.height=layer_width; The width of 'layer' has been set to 50% in CSS. The height is unaffected however. What am I …

Member Avatar
Member Avatar
+0 forum 1

The End.