Search Results

Search found 1586 results on 64 pages for 'adam winter'.

Page 6/64 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Pythonic reading from config files

    - by Adam Matan
    Hi, I have a python class which reads a config file using ConfigParser: Config file: [geography] Xmin=6.6 Xmax=18.6 Ymin=36.6 YMax=47.1 Python code: class Slicer: def __init__(self, config_file_name): config = ConfigParser.ConfigParser() config.read(config_file_name) # Rad the lines from the file self.x_min = config.getfloat('geography', 'xmin') self.x_max = config.getfloat('geography', 'xmax') self.y_min = config.getfloat('geography', 'ymin') self.y_max = config.getfloat('geography', 'ymax') I feel that the last four lines are repetitive, and should somehow be compressed to one Pythonic line that would create a self.item variable for each item in the section. Any ideas? Adam

    Read the article

  • ASP.NET MVC framework port for Java EE?

    - by Adam Asham
    So I've played some with the new, not yet final release of ASP.NET MVC framework and I find it to be very nice and elegant. However at work we are tied to Java for the time being, so I'm wondering this: is there a port of the framework out there for Java people like myself? I realize that webforms isn't going to be available unfortunately but what about the routing framework? /Adam

    Read the article

  • Python: using doctests for classes

    - by Adam Matan
    Hi, Is it possible to use Python's doctest concept for classes, not just functions? If so, where shall I put the doctests - at the class' docstring, or at the constructor's docstring? To clarify, I'm looking for something like: class Test: """ >>> a=Test(5) >>> a.multiply_by_2() 10 """ def __init__(self, number): self._number=number def multiply_by_2(self): return self._number*2 Thanks in advance, Adam

    Read the article

  • Changing IIS URL Rewrite config location

    - by adam
    Hi When used at site level, the IIS7 URL Rewrite 2 module saves its configuration in the web.config file of that site. I'm using Sitecore CMS, and best practice is to store any web.config customisations in a separate config file for ease of upgrading, staging/production setups etc. Is there any way to specify a different config file for IIS7 redirects? I know that application-level rewrites are stored in ApplicationHost.config, but I have several sites running on the server and would like to keep them separated. Thanks, Adam

    Read the article

  • eclipse+bzr (Or: DVCS + IDE)

    - by Adam Matan
    Hi, I have some projects on bzr code repositories shared with colleagues. Problem is, I really want to switch to eclipse in some projects, but I don't want to pollute the repository with the unnecessary metadata eclipse creates in its Workspaces. Any idea how to keep Eclipse's metadata outside my bzr repo? Adam

    Read the article

  • Google Maps iPhone API Terrain View

    - by Adam
    We're using MapKit on an iPhone app to display a Google Map with terrain view. However, the terrain view only shows when the user has an active Internet connection, the moment the user's Internet is off, the terrain on the map disappears and it appears flat. Is there any way to keep the terrain view on even when the user isn't on an active internet connection? Thanks! Adam

    Read the article

  • Programatically find common European street names

    - by Adam Matan
    Hi, I am in the middle of designing a web form for German and French users. Within this form, the users would have to type street names several times. I want to minimize the annoyance to the user, and offer autocomplete feature based on common French and German street names. Any idea where I can a royalty-free list? Thanks a bunch, Adam

    Read the article

  • PostgreSQL: SELECT all fields, filter some

    - by Adam Matan
    Hi, In one of our databases, there is a table with dozens of columns, one of which is a geometry column. I want to SELECT rows from the table, with the geometry transformed to another SRID. I want to use something like: `SELECT *` in order to avoid: SELECT col_a, col_b, col_c, col_d, col_e, col_f, col_g, col_h, transform(the_geom, NEW_SRID), ..., col_z Any ideas? Adam

    Read the article

  • Win32: How do I get the listbox for a combobox

    - by Adam Tegen
    I'm writing some code and I need to get the window handle of the listbox associated with a combo box. When looking in spy++, it looks like the parent of the listbox is the desktop, not the combo box. How can I programmatically find the listbox window handle? I know I'd be looking for a window class of ComboLBox that belongs to my process, but how do I narrow that down to the specific one I am looking for? Adam

    Read the article

  • When learning C, should one only refer to resources published from 2007 onward?

    - by Adam Siddhi
    I ask this question because the international standardization subcommittee for programming languages, or ISO/IEC JTC1/SC22 Programming languages, states on this page: http://www.open-std.org/JTC1/SC22/WG14/www/standards that Technical Corrigendum 3, the latest one, was published in 2007. Now I take it that this means the C language it self was changed and that the books and tutorials pre-2007 may contain outdated information. Please correct me if I am wrong. Thanks, Adam

    Read the article

  • ColdFusion 9 Cluster with IIS7.5

    - by Adam Winter
    Does anyone know of a step by step process of setting up a ColdFusion 9 cluster using IIS 7.5? Either failover or network load balance would be nice. Without IIS being clusterable in Windows 2008 R2, I'm not sure of the best means to configure the web server and ColdFusion service. Some of the things I'm looking for are..... With load balancing, what do you use out in front of the servers as a load balancer? If you're using a network share on a clustered file server for the website data files, how do you configure the ColdFusion service to run so that it has network access instead of running as Local System?

    Read the article

  • save a cfdocument as an excel file

    - by Winter
    is there a workaround to use the cfdocument tag to save a page/file as an excel sheet instead of a PDF file? I already have a process set up to make pdf files and email them out and would like to give my customers the option of getting an excel file instead. It would be nice if I could reuse the code I already have instead of having to rewrite it in POI or something like that.

    Read the article

  • Double-Escaped Unicode Javascript Issue

    - by Jeffrey Winter
    I am having a problem displaying a Javascript string with embedded Unicode character escape sequences (\uXXXX) where the initial "\" character is itself escaped as "&#92;" What do I need to do to transform the string so that it properly evaluates the escape sequences and produces output with the correct Unicode character? For example, I am dealing with input such as: "this is a &#92;u201ctest&#92;u201d"; attempting to decode the "&#92;" using a regex expression, e.g.: var out = text.replace('/&#92;/g','\'); results in the output text: "this is a \u201ctest\u201d"; that is, the Unicode escape sequences are displayed as actual escape sequences, not the double quote characters I would like.

    Read the article

  • ruby on rails-Problem with the selection form helper

    - by winter sun
    Hello I have a form in witch users can add their working hours view them and edit them (All in one page). When adding working hours the user must select a project from a dropdown list. In case the action is adding a new hour record the dropdown field should remain empty (not selected) in case the action is edit the dropdown field should be selected with the appropriate value. In order to overcome this challenge I wrote the following code <% if params[:id].blank?%> <select name="hour[project_id]" id="hour_project_id"> <option value="nil">Select Project</option> <% @projects.each do|project|%> <option value="<%=project.id %>"><%=project.name%></option> <% end%> </select> <% else %> <%= select('hour','project_id', @projects.collect{|project|[project.name,project.id]},{:prompt => 'Select Project'})%> <% end %> So in case of save action I did the dropdown list only with html, and in case of edit action I did it with the collect method. It works fine until I tried to code the errors. The problem is that when I use the error method: validates_presence_of :project_id it didn't recognize it in the html form of the dropdown list and don’t display the error message (its working only for the dropdown with the collect method). I will deeply appreciate your instructions and help in this matter

    Read the article

  • ruby on rails group by with null values problem

    - by winter sun
    I have an hour table in witch I store user time tracking information, the table consists from the following cells project_id task_id (optional can be null) worker_id reported_date working_hours each worker enters sevral records per day so generally the table is looking like this id project_id worker_id task_id reported_date working hours; == =========== ========= ========= ============= ============== 1 1 1 1 10/10/2011 4 2 1 1 1 10/10/2011 14 3 1 1 10/10/2011 4 4 1 1 10/10/2011 14 the task_id is not a must field so there can be times when the user is not selecting it and ther task_id cell is empty now i need to display the data by using group by clouse so the resualt will be somthing like this project_id worker_id task_id working hours ========== ========= ========= ============== 1 1 1 18 1 1 18 I did the folowing group by condition @group_hours=Hour.group('project_id,worker_id,task_id)').select('project_id, task_id ,worker_id,sum(working_hours)as working_hours_sum') My view looks like this <% @group_hours.each do |b| % <%= b.project.name if b.project % <%= b.worker.First_name if b.worker % <%= b.task.name if b.task % <%= b.working_hours_sum % <%end% This it is working but only if the task_id is not null when task id is null it present all the records without grouping them like this project_id worker_id task_id working hours =========== ========= ========= ============== 1 1 1 18 1 1 4 1 1 14 I will appreciate any kind of solution to this problem

    Read the article

  • Commutative (operational transform) diffs for databases

    - by barrycarter
    What Unix program generates "diff"s between text files (or INSERT/UPDATE/DELETEs for databases) in such a way that the order that the "diff"s are applied in is irrelevant, and the result is the same regardless of order. Etherpad used to do something like this. Example (for a given document or database): % Adam makes a change X, then Bob makes a change Y, then Adam makes another change Z. % However, because of network latency, Adam sees the changes in this order: XZY, while Bob sees them in this order: YXZ. % However, the code/changes are written so that XYZ and YXZ yield the same result. Note: ideally, this can be done without having to do X/Y/Z inverse at any point. I have read http://stackoverflow.com/questions/2043165/operational-transformation-library but I'm not sure this really does what I want.

    Read the article

  • Move websites from IIS7 to IIS 7.5

    - by Adam Winter
    Can anyone suggest the best way of moving websites on server1 with IIS7 to server2 with IIS 7.5 on it? I've read some articles which suggest copying the applicationHost.config file while preserving the configProtectedData node, but I'm concerned there may be settings in the IIS 7.5 config that don't exist in the current IIS7 config which would be lost. I've also seen suggestions of moving each site individually by using a command like this: AppCmd.exe LIST SITE "My Site" /config /XML mysite.xml This method just takes too long to do this for dozens of sites. There must be a better way of moving all the sites at once to the new platform.

    Read the article

  • Problem with writing a file to excel with spreadsheet

    - by winter sun
    I am trying to write excel file by using ruby 1.9 spreadsheet version 0.6.4.1 on windows. Everything is going ok, until I get to the book.write statement when I write book.write "c:/spreadsheet/excel-file.xls I keep getting the following error No such file or directory - c:/spreadsheet/excel-file.xls Can anyone tell me what I should change in this path name?

    Read the article

  • Testing the load factor in my lab [closed]

    - by Ami Winter
    I am a system admin in a lab, I have ~90 computers in the lab and I want to check the load factor on them.. meaning, to check how many people are working on the computers hourly.. To see if I need to buy more computers or not. I am looking for a way to build a script to check if a computer is logged on or not.. (0 for log off - 1 for log on) After I will have this data, I know how to build a script to build me the graphs. All the computers are linked via a domain and most of them have windows XP (few windows 7) I'll be happy to get some help. Amihay

    Read the article

  • Buffering db inserts in multithreaded program

    - by Winter
    I have a system which breaks a large taks into small tasks using about 30 threads as a time. As each individual thread finishes it persists its calculated results to the database. What I want to achieve is to have each thread pass its results to a new persisance class that will perform a type of double buffering and data persistance while running in its own thread. For example, after 100 threads have moved their data to the buffer the persistance class then the persistance class swaps the buffers and persists all 100 entries to the database. This would allow utilization of prepared statements and thus cut way down on the I/O between the program and the database. Is there a pattern or good example of this type of multithreading double buffering?

    Read the article

  • Persistance Queue Implementation

    - by Winter
    I was reading an article on Batch Processing in java over at JDJ http://java.sys-con.com/node/415321 . The article mentioned using a persistence queue as a Batch Updater instead of immediately sending an individual insert or update to the database. The author doesn't give a concrete example of this concept so I googled Persistence Queue but that didn't come up with much. Does anyone know of a good example of this?

    Read the article

  • Finding records when using has_many through associations

    - by winter sun
    I have two models, Worker and Project, and they are connected with has_many through association. I manage to find all the projects which are related to a specific worker by writing the following code: worker=Worker.find_by_id("some_id") worker.projects but I want the projects that I get to be only active projects (in the project model I have a status field) I tried to do something like worker.projects(:status_id=>'active') but it didn’t work for me. Can somebody tell me how I can do this?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >