Search Results

Search found 8083 results on 324 pages for 'total newbie'.

Page 184/324 | < Previous Page | 180 181 182 183 184 185 186 187 188 189 190 191  | Next Page >

  • Alternative to "assign to a function call" in a python

    - by Pythonista's Apprentice
    I'm trying to solve this newbie puzzle: I've created this function: def bucket_loop(htable, key): bucket = hashtable_get_bucket(htable, key) for entry in bucket: if entry[0] == key: return entry[1] else: return None And I have to call it in two other functions (bellow) in the following way: to change the value of the element entry[1] or to append to this list (entry) a new element. But I can't do that calling the function bucket_loop the way I did because "you can't assign to function call" (assigning to a function call is illegal in Python). What is the alternative (most similar to the code I wrote) to do this (bucket_loop(htable, key) = value and hashtable_get_bucket(htable, key).append([key, value]))? def hashtable_update(htable, key, value): if bucket_loop(htable, key) != None: bucket_loop(htable, key) = value else: hashtable_get_bucket(htable, key).append([key, value]) def hashtable_lookup(htable, key): return bucket_loop(htable, key) Thanks, in advance, for any help! This is the rest of the code to make this script works: def make_hashtable(size): table = [] for unused in range(0, size): table.append([]) return table def hash_string(s, size): h = 0 for c in s: h = h + ord(c) return h % size def hashtable_get_bucket(htable, key): return htable[hash_string(key, len(htable))] Similar question (but didn't help me): Python: Cannot Assign Function Call

    Read the article

  • Open table cache in MySQL

    - by vvanscherpenseel
    I have my open table cache set to 1800 and I have a total of 1112 tables. MySQL Tuning Primer reports that 100% of my table cache is used yet my table cache hit rate is 5%. I understand that this happens due to concurrent connections all opening tables. I think I should raise the cache limit. I understand that the cache size is limited by the file descriptor limit of my operating system, but are there any other practical limitations I should be aware of? Searching Google or this very website yields mostly posts explaining the connection-factor or come up with indecisive answers. My question: can I safely increase the open table cache limit? Is there a maximum?

    Read the article

  • Working with Foreign languages

    - by Matt
    My DB needs to hold strings containing foreign language characters such that; User enters string into form, form submitted and string added to DB, string will be displayed on page for viewing. I would like to use UTF8 as this will be able to handle all of the required languages. Currently I believe my DB is set to 'latin1' but webpages are capable of displaying correct charachters anyways. Problems arise when trying to set textareas to hold foreign charachters and when viewing DB via command-line. How can I implement this most effectively? My plan was to blitz the whole site such that:DB Charset is UTF8 and web pages charset is UTF8. Could someone give me the minimal commands on how to do this so I don't end up duplicating things (Having "UTF8" commands everywhere when I really just need one) and making things too difficult to control. Newbie Thanks

    Read the article

  • Confused with objects in Ruby

    - by David
    Ruby Newbie here, I understand that everything is an object in Ruby, one thing that I wasn't sure about was understanding Variables. Variables basically give reference to objects (correct me if I'm wrong). During an instructional video, the teacher did a demonstration which went as below: (irb) a = 100 ==> 100 b = a ==> 100 b ==> 100 This part I get, makes total sense. Then he did a = 50 ==> 50 b ==> 100 If B is supposed to point to what a was set which was a 100, why does b still point to 100 if a has now been set as 50?

    Read the article

  • rails - form to disply non-input type fields in nested form

    - by nktokyo
    Hi, I guess this is a newbie question, but what is the syntax in a form to show contents of fields not as a text box/area, but rather like label would appear. <% form_for @user do |f| %> <% f.fields_for :user_ingreds do |builder| %> <p> <%= builder.??? %> </p> <% end %> <% end%> user has many user_ingreds and accepts_nested_attributes for user_ingreds. Basically I want to make a list of user_ingreds where the user can't edit the data but can remove the record from the list via a button - however the fields_for builder doesn't recognize a direct call to to the fields in user_ingreds model (ie, builder.user_id throws and error.

    Read the article

  • Whats the best to way convert a set of Java objects to another set of objects?

    - by HDave
    Basic Java question here from a real newbie. I have a set of Java objects (of class "MyClass") that implement a certain interface (Interface "MyIfc"). I have a set of these objects stored in a private variable in my class that is declared as follows: protected Set<MyClass> stuff = new HashSet<MyClass>(); I need to provide a public method that returns this set as a collection of objects of type "MyIfc". public Collection<MyIfc> getMyStuff() {...} How do I do the conversion? The following line gives me an error that it can't do the conversion. I would have guessed the compiler knew that objects of class MyClass implemented MyIfc and therefore would have handled it. Collection<MyIfc> newstuff = stuff; Any enlightenment is appreciated.

    Read the article

  • Can anyone recommend free network monitoring tools?

    - by Josamoto
    Hi all I have a machine at home on a 3G internet connection, and my PC is consuming approximately about 200MB per day in uploads & downloads. I'm using an application called Networx to monitor the upload/download usage, but I am on the outlook for the culprit application munching away on my cap. Networx tells me how much my connection uses in total, and I need to know how much each application uploaded / downloaded. Does anyone know of a network connection monitoring utility for Windows 7 that can give me a daily outline of how much data was uploaded & downloaded, and specify this on a PER APPLICATION basis. Thanks in advance!

    Read the article

  • Can anyone recommend free network monitoring tools?

    - by Josamoto
    Hi all I have a machine at home on a 3G internet connection, and my PC is consuming approximately about 200MB per day in uploads & downloads. I'm using an application called Networx to monitor the upload/download usage, but I am on the outlook for the culprit application munching away on my cap. Networx tells me how much my connection uses in total, and I need to know how much each application uploaded / downloaded. Does anyone know of a network connection monitoring utility for Windows 7 that can give me a daily outline of how much data was uploaded & downloaded, and specify this on a PER APPLICATION basis. Thanks in advance!

    Read the article

  • How do I "propagate" my VS2008 Data Sources window with a LINQ query table?

    - by Kent S. Clarkson
    I´m (professionally) creating a SQL Server database client by using Visual Studio 2008, C# - Windows Form(s). And I´m using all the built in stuff, provided by my friend VS Studio, dragging and dropping, creating SQL query tables in DataSet.xsd, and so on... I like that. But! I would like to try out LINQ, as I would like to have something that to me is more intuitive than pure SQL... And (here comes the newbie-problem to be solved)! I don´t know where to put the LINQ code to make a table "pop up" in the Data Sources window - meaning I´m completely stuck! How should I do it?

    Read the article

  • write to xml file using objective c

    - by Mith
    Hi, ok, I managed to read from xml file using NSXMLParser but now i don't know how to write to xml file. I have a xml file , say <?xml version="1.0" encoding="UTF-8"?> <root> <user id="abcd" password="pass1"/> <user id="efg" password="pass2"/> </root> Now when a new user enters details, I want to store them in a new tag.. lets say like, the id is "hhhh" and password is"pass3" I want to add a new tag with attributes as such <user id="hhhh" password="pass3"/> to the xml file. How should I do this. Please explain in an elaborate way . I am a newbie here. Any links to tutorials or examples will be much helpful. Thanks

    Read the article

  • OSGI bundle (or service)- how to register for a given time period?

    - by Alec
    Hello, all! Search did not give me a hint, how can i behave with the following situation: I'd love to have 2 OSGI implementations of the same interface: one is regular, the other should work (be active/present/whatever) on the given time period (f.e for Christmas weeks :)) The main goal is to call the same interface without specifying any flags/properties/without manual switching of ranking. Application should somehow switch implementation for this special period, doing another/regular job before and after :) I'm a newbie, maybe i do not completely understand OSGI concept somewhere, sorry for that of give me a hint or link, sorry for my English. Using Felix/Equinox with Apache Aries.

    Read the article

  • 1024x768 gone (1024x600 availble) on HDMI, yesterday it worked?

    - by Gam Erix
    When I try to play a game called F-22 Total Air War 2.0 I get an error which says that the resolution 1024.768 is unsupported by the harware.. so I look into my desktop options and it looks like there is an option for 800x600, 1024x600, 1152x648 and higher wide screen resolutions but the 1024x768 is gone? I did play the game yezterday, I disconnected the HDMI, got upstairs, played a few more games, came back downstairs, plugged in the HDMI, launched the game and bam I got the error! I have a ATI Radeon Mobility HD5470 and the newest ATI Catalyst Center downloaded 3 days ago. How can I 'enable' the 1024x768 resolution again? Without it I can't play the game on my Big TV and I will be stuck with my little laptop screen.

    Read the article

  • Delphi : What is the best way for passing data between forms?

    - by Flom Enol
    It may seem a little newbie, but I really have got problem with it. I have a form (not the main one)for getting many different data form the user and I want to pass it to a manager class for creating an object with these. The problem is that I can't have this class to use the other unit (getting circle uses) and also it doesn't have access to the manager class instance (which is in main form). So, what shall I do? I've already considered using public variable but I have a bad feeling about it (regarding OOD patterns). Any ideas? thanks in advance.

    Read the article

  • How to removeTrojan PB [duplicate]

    - by user266901
    This question already has an answer here: How do I get rid of malicious spyware, malware, viruses or rootkits from my PC? 15 answers How to remove trojan PB from windows 7 system? previously i had installed Norton 360 antivirus. the subscription was expired two months back. Recently i have purchased quick heal total security. while installing quick heal antivirus i get the message 'system infected by Trojan PB' Their is an option to remove Trojan PB by restarting computer. However the infection does not get removed. Please advice for removal of Trojan PB

    Read the article

  • antlr: Best practice to integrate generated parser into the system

    - by green
    Here is the background, I am trying to create a DSL to allow customer write simple scripts to query into our mongodb based database. I choose antlr to implement the DSL. From my understanding (and pls let me know if it's not correct) there are 2 approaches to integrate antlr generated parser into the system: Embed code into the grammar file so that the generated parser could be used directly to make query to the database and return result in a certain format (e.g. json encoded) Keep the parser purely a parser, after feed the DSL file to it, and construct the query in another class by retrieving the AST from generated parser class So antlrers, which one do you think is the way I as an antlr newbie should go? Can you list the pros and cos of each approach, or you have other way to recommend?

    Read the article

  • collect string in loop and printout all the string outside loop

    - by user1508163
    I'm newbie here and there is some question that I want have some lesson from you guys. For example: #include <stdio.h> #include<stdlib.h> #include<ctype.h> void main() { char name[51],selection; do { printf("Enter name: "); fflush(stdin); gets(name); printf("Enter another name?(Y/N)"); scanf("%c",&selection); selection=toupper(selection); }while (selection=='Y'); //I want to printout the entered name here but dunno the coding printf("END\n"); system("pause"); } As I know when the loops perform will overwrite the variable then how I perform a coding that will printout all the name user entered? I have already ask my tutor and he is ask me to use pointer, can anyone guide me in this case?

    Read the article

  • problem with generating PDF and session_start()

    - by gillian
    Hi All, I've been using PDF class produced by R&OS successfully in a number of recent developments. I'd like to use it in a page that performs a database query before generating a PDF (it's basically a summary of the session, so I'm using session_id() as part of the query) All is fine if I run this in Firefox - not fine in IE. I think the loading of session_start() is doing something with headers that's upsetting IE as it appears unable to load the page (comment off session_start and the page loads fine). I'm getting a little concerned as, on further investigation, it appears that R&OS is not supported ... bad newbie learning experience and I really don't want to have to try adopt another class system this late in the day. Have you any thoughts as to what I could try next? Thankx G

    Read the article

  • Overriding Magento Admin Controller, for Beginners

    - by Knowledge Craving
    In the Magento Admin section, I want to override the "Sales/Order/ShipmentController.php" controller file of the core Mage. I have tried rewriting the URL, using the "from" & "to" tags, but in vain. I don't know what is the actual & correct way of doing this, as I'm a newbie in Magento. Please anybody provide some good fundamental & correct answer, so that at least the concept gets clear. Also, if possible, please tell me, what is the actual purpose of the controller, for both the frontend & the back-end? Any help is greatly appreciated.

    Read the article

  • Help creating a dll for a custom control

    - by Chapso
    I'm going to ask a newbie question here. I need to use a control I found online in my code, but it was written in the wrong language. It is in C# and I am using VB.net for work. I have all of the code for the control which works beautifully in C#, but I had issues with it not working very well in VB. The source code and a demo project are available here, but I am not sure exactly which files I should use to build the dll for VB. It seems a lot to ask, but would someone mind taking a look and pointing me in the right direction? Cheers

    Read the article

  • How to improve the speed of a loop containing a sqlalchemy query statement as conditional

    - by LtPinback
    This loop checks if a record is in the sqlite database and builds a list of dictionaries for those records that are missing and then executes a multiple insert statement with the list. This works but it is very slow (at least i think it is slow) as it takes 5 minutes to loop over 3500 queries. I am a complete newbie in python, sqlite and sqlalchemy so I wonder if there is a faster way of doing this. list_dict = [] session = Session() for data in data_list: if session.query(Class_object).filter(Class_object.column_name_01 == data[2]).filter(Class_object.column_name_00 == an_id).count() == 0: list_dict.append({'column_name_00':a_id, 'column_name_01':data[2]}) conn = engine.connect() conn.execute(prices.insert(),list_dict) conn.close() session.close() edit: I moved session = Session() outside the loop. Did not make a difference.

    Read the article

  • Rails: Link changes one attribute and then goes back

    - by James
    Rails newbie here. I have a list of items which can have a status represented by an integer (right now its just 1=active 0=inactive). What I want is next to each item a link to change the status of that item. So it might look like this: A nice item - Enable Another pretty item - Disable I can't think of how to make the link work. I just want a user to click the link and then the page refreshes and the item get updated. This doesn't work: <%= link_to "Enable", :controller => "items", :action => "update", :status => 1 %>

    Read the article

  • Django shell command to change a value in json data

    - by crozzfire
    I am a django newbie and i was playing around in django's manage.py shell. Here is something i am trying in the shell: >>> data [{'primary_program': False, 'id': 3684}, {'primary_program': True, 'id': 3685}] >>> data[0] {'primary_program': False, 'id': 3684} >>> data[1] {'primary_program': True, 'id': 3685} >>> data[0].values() [False, 3684] >>> data[1].values() [True, 3685] >>> How should i give a command here to update the value of primary_program in data[1] to False and keep the rest of the json the same?

    Read the article

  • Can't delete file from windows 7

    - by r.s.mahanti
    I downloaded a torrent file from internet. The problem is it's size is showing 0 bytes. I tried to scan it with antivirus, upload it to virus total, delete it but it's showing the file is not found. I tried to delete it in safe mode also but no success. Can anybody explain me, what can be reason for this and what is the way to delete this file? Thanks in advance. My operating system is windows 7. EDIT : the name of the file is "[Torrentreactor.to] - Site Translator 4.06.torrent."

    Read the article

  • What are the possible tags of "global" tag in Magento "config.xml" file?

    - by Knowledge Craving
    Can someone professional experienced Magento developer tell me how to accomplish the following in Magento? I want to know what are the possible tags that can fit in the "global" tag of the "config.xml" page of every module's etc folder? I have tried searching for this answer at many places in Internet but in vain. Please provide the full details along with it, because I want at least the users accessing this website find it useful enough, instead of scratching their heads. I really want a detailed explanation, because every newbie like me gets totally confused at this point. From what I know till now, is that in this page, you can set routers, rewrites, cron jobs, admin html, front-end html and many more. But without any strong concepts. So please I want that strong fundamental concept with a detailed explanation about it.

    Read the article

  • Random Connections to MySQL refused (Error 111)

    - by joatis
    A Perl/CGI webapp that has been running fine for almost a year has started to randomly been unable to connect to a remotely hosted MySQL. The Error thrown is : Can't connect to MySQL server on 'xx.x.xxx.xx' (111) Reloading the page often solves the problem The client is using Perl, DBI and SSL to connect to MySQL using the same configuration file each time. MySQL 5.0 Server Running RH EL5 Quad-Core AMD Opteron(tm) Processor 2374 HE, 8 cores Real Memory: 15.73 GB total, 11.81 GB used allows networking in my.cnf max-connections are not being met load is low. The servers firewall is open to the client's subnet. The mysql user has permissions from the client's subnet. I have my host looking into the problem but so far we're all stumped as to way the occasional connection is (increasingly getting refused) Any advice what to check that would cause the random refusal of connections?

    Read the article

< Previous Page | 180 181 182 183 184 185 186 187 188 189 190 191  | Next Page >