Daily Archives

Articles indexed Sunday June 6 2010

Page 19/76 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • svn working copy spanning 2 physical drives?

    - by ronenosity
    I have a large repository hosted on dreamhost that I backup daily on a remote machine using a windows scheduled task which updates the working copy located on an external USB 300GB drive connected to the remote machine. The 300GB drive is nearly full with only 26GB of free space remaining. Recently I added a second USB external 1TB drive to increase storage capacity. I would like to ask: what is the best way to use the new 1TB drive? Is it possible to span the working copy across both drives (ex: somehow create a 1.3 TB drive)? If I copied the working copy from the 300GB to the 1TB would svn continue form do I need to retarget the update working copy script to the new 1TB drive and start downloading everything again (least desired option) thanks

    Read the article

  • ASP.Net: Writing chunks of file..HTTP File upload with resume..

    - by Manish
    Please refer to question: http://stackoverflow.com/questions/2062852/resume-in-upload-file-control Now to find a solution for the above question, I want to work on it and develop a user control which can resume a HTTP File Upload process. For this, I'm going to create a temporary file on server until the upload is complete. Once the uploading is done completely then will just save it to the desired location. The procedure I have thought of is: Create a temporary file with a unique name (may be GUID) on the server. Read a chunk of file and append it to this temp file on the server. Continue step 1 to 3 until EOF is reached. Now if the connection is lost or user clicks on pause button, the writing of file is stopped and the temporary file is not deleted. Clicking on resume again or uploading the same file again will check on the server if the file exists and user whether to resume or to overwrite. (Not sure how to check if it's the same file. Also, how to step sending the chunks from client to server.) Clicking on resume will start from where it is required to be uploaded and will append that to the file on the server. (Again not sure how to do this.) Questions: Are these steps correct to achieve the goal? Or need some modifications? I'm not sure how to implement all these steps. :-( Need ideas, links... Any help appreciated...

    Read the article

  • How do you get log4j to roll files based on date and size?

    - by Jose Chavez
    So log4j comes with two existing log rollers: RollingFileAppender, and DailyRollingFileAppender. Has anyone heard of an appender that does both of what the former do? I need an appender that will roll log files based on filesize, but also append the current date to it. I've been thinking about creating my own appender, but if there is already one that has been created, why not save the time and use that one?

    Read the article

  • Enterprise Architect Communication Diagrams question

    - by devoured elysium
    I want to achieve something like this in Enterprise Architect's Communication Diagrams: start() ---------------- 1. create() ------------ ------------> | RGController | ---------------> | U : User | ---------------- ------------ But I am facing 2 problems: a) it seems I have to always make a connection between 2 objects (I can't have the start() message just come out of nowhere, like I'd want). b) I can't control the numbering as I'd want. Is there any way I could just set the numbering by myself?

    Read the article

  • Trouble with copying dictionaries and using deepcopy on an SQLAlchemy ORM object

    - by Az
    Hi there, I'm doing a Simulated Annealing algorithm to optimise a given allocation of students and projects. This is language-agnostic pseudocode from Wikipedia: s ? s0; e ? E(s) // Initial state, energy. sbest ? s; ebest ? e // Initial "best" solution k ? 0 // Energy evaluation count. while k < kmax and e > emax // While time left & not good enough: snew ? neighbour(s) // Pick some neighbour. enew ? E(snew) // Compute its energy. if enew < ebest then // Is this a new best? sbest ? snew; ebest ? enew // Save 'new neighbour' to 'best found'. if P(e, enew, temp(k/kmax)) > random() then // Should we move to it? s ? snew; e ? enew // Yes, change state. k ? k + 1 // One more evaluation done return sbest // Return the best solution found. The following is an adaptation of the technique. My supervisor said the idea is fine in theory. First I pick up some allocation (i.e. an entire dictionary of students and their allocated projects, including the ranks for the projects) from entire set of randomised allocations, copy it and pass it to my function. Let's call this allocation aOld (it is a dictionary). aOld has a weight related to it called wOld. The weighting is described below. The function does the following: Let this allocation, aOld be the best_node From all the students, pick a random number of students and stick in a list Strip (DEALLOCATE) them of their projects ++ reflect the changes for projects (allocated parameter is now False) and lecturers (free up slots if one or more of their projects are no longer allocated) Randomise that list Try assigning (REALLOCATE) everyone in that list projects again Calculate the weight (add up ranks, rank 1 = 1, rank 2 = 2... and no project rank = 101) For this new allocation aNew, if the weight wNew is smaller than the allocation weight wOld I picked up at the beginning, then this is the best_node (as defined by the Simulated Annealing algorithm above). Apply the algorithm to aNew and continue. If wOld < wNew, then apply the algorithm to aOld again and continue. The allocations/data-points are expressed as "nodes" such that a node = (weight, allocation_dict, projects_dict, lecturers_dict) Right now, I can only perform this algorithm once, but I'll need to try for a number N (denoted by kmax in the Wikipedia snippet) and make sure I always have with me, the previous node and the best_node. So that I don't modify my original dictionaries (which I might want to reset to), I've done a shallow copy of the dictionaries. From what I've read in the docs, it seems that it only copies the references and since my dictionaries contain objects, changing the copied dictionary ends up changing the objects anyway. So I tried to use copy.deepcopy().These dictionaries refer to objects that have been mapped with SQLA. Questions: I've been given some solutions to the problems faced but due to my über green-ness with using Python, they all sound rather cryptic to me. Deepcopy isn't playing nicely with SQLA. I've been told thatdeepcopy on ORM objects probably has issues that prevent it from working as you'd expect. Apparently I'd be better off "building copy constructors, i.e. def copy(self): return FooBar(....)." Can someone please explain what that means? I checked and found out that deepcopy has issues because SQLAlchemy places extra information on your objects, i.e. an _sa_instance_state attribute, that I wouldn't want in the copy but is necessary for the object to have. I've been told: "There are ways to manually blow away the old _sa_instance_state and put a new one on the object, but the most straightforward is to make a new object with __init__() and set up the attributes that are significant, instead of doing a full deep copy." What exactly does that mean? Do I create a new, unmapped class similar to the old, mapped one? An alternate solution is that I'd have to "implement __deepcopy__() on your objects and ensure that a new _sa_instance_state is set up, there are functions in sqlalchemy.orm.attributes which can help with that." Once again this is beyond me so could someone kindly explain what it means? A more general question: given the above information are there any suggestions on how I can maintain the information/state for the best_node (which must always persist through my while loop) and the previous_node, if my actual objects (referenced by the dictionaries, therefore the nodes) are changing due to the deallocation/reallocation taking place? That is, without using copy?

    Read the article

  • Do Managers in Python Multiprocessing module lock the shared data?

    - by AnonProcess
    This Question has been asked before: http://stackoverflow.com/questions/2936626/how-to-share-a-dictionary-between-multiple-processes-in-python-without-locking However I have several doubts regarding the program given in the answer: The issue is that the following step isn't atomic d['blah'] += 1 Even with locking the answer provided in that question would lead to random results. Since Process 1 read value of d['blah'] saves it on the stack increments it and again writes it. In Between a Process 2 can read the d['blah'] as well. Locking means that while d['blah'] is being written or read no other process can access it. Can someone clarify my doubts?

    Read the article

  • create table from another table in different database in sql server 2005

    - by Greg
    Hi, I have a database "temp" with table "A". I created new database "temp2". I want to copy table "A" from "temp" to a new table in "temp2" . I tried this statement but it says I have incorrect syntax, here is the statement: CREATE TABLE B IN 'temp2' AS (SELECT * FROM A IN 'temp'); Here is the error: Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'IN'. Msg 156, Level 15, State 1, Line 3 Incorrect syntax near the keyword 'IN'. Anyone knows whats the problem? Thanks in advance, Greg

    Read the article

  • Wordpress rewrite image path

    - by Brad
    I've got a website that is running WordPress. It has several pictures that I am retrieving from a datafeed. The images from the datafeed are at locations like: http://image4.example.com/640/examples/example.jpg http://image4.example.com/640/example.jpg The image4 and 640 locations can change. I want to rewrite the images to where they show as from my website. I've tried: rewritecond %{HTTP_HOST} !^image4.example.com$ rewriterule ^([^/]+)$ http://image4.mywebsite.com/$1 [L,R=301] but it doesn't work. I don't know much about Mod Rewrite. any help would be appreciated, and no I'm not hijacking the images, i have permission to use them and the bandwidth. Thanks -Brad

    Read the article

  • Ruby on rails link_to syntax

    - by mizipzor
    After following a tutorial Ive found. Im now redoing it again, without the scaffolding part, to learn it better. However, editing my \app\views\home\index.html.erb to contain: <h1>Rails test project</h1> <%= link_to "my blog", posts_path> I get an error: undefined local variable or method `posts_path' for #<ActionView::Base:0x4e1d954> Before I did this, I ran rake db:create, defined a migration class and ran rake db:migrate, everything without a problem. So the database should contain a posts table. But that link_to command cant seem to find posts_path. That variable (or is it even a function?) is probably defined through the scaffold routine. My question now is; how do I do that manually myself, define posts_path?

    Read the article

  • Visual Studio confused by server code inside javascript

    - by Felix
    I ran into an annoying problem: the following code gives a warning in Visual Studio. <script type="text/javascript"> var x = <%: ViewData["param"] %>; </script> The warning is "Expected expression". Visual Studion gets confused, and all the javascript code after that is giving tons of warnings. Granted, it's all warnings, and it works perfectly fine in runtime - but it is very easy to miss real warnings among dozen of false positives. It was working the same way in VS2008, and it wasn't fixed in VS2010. Does anybody know if there is a workaround, or a patch?

    Read the article

  • Crystal Report print functionlity doesn't work after deployment?

    - by Ahmed
    I'm using crystal reports to build reports, everything is ok while development. But after deployment of website, print functionality doesn't work. I use _rptDocument.PrintToPrinter(1, false, 0, 0); to print report. I've tried two methods to deploy website Normal Publish option. Web Deployment Project. But I got the same output, print functionality doesn't work. Also, I tried to set default printer, this also doesn't work. Any ideas?

    Read the article

  • submit remote form with prototype

    - by badnaam
    I have a remote form like this and a checkbox in it. When I select or deselect the checkbox I would like to 1 - set the value of a hidden field 2 - ajax submit this form to its designated url. I tried $('search_form').onsubmit(), but I get an error saying onsubmit is not a function. Using prototype. Whats the best way to do this? <form onsubmit="new Ajax.Request('/searches/search_set?stype=1', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" method="post" id="new_search" class="new_search" action="/searches/search_set?stype=1"><div style="margin: 0pt; padding: 0pt; display: inline;"><input type="hidden" value="3TWSyMsZXI0nltz7zHAxuj1KX=" name="authenticity_token"></div> <a onclick="setSubmit(this);" href="#" class="submit-link-button fg-button ui-state-default fg-button-icon-left ui-corner-all" id="search_submit"><span class="ui-icon ui-icon-search"></span>'Search'</a> </div> <input type="checkbox" value="Energy" onclick="refreshResults(this);" name="search[conditions][article_tag][0]" id="search_conditions_article_tag_0">

    Read the article

  • Using MOA to classify new examples?

    - by Sam Zetoloth
    I'm trying to use the java machine learning library MOA to train on a training data stream, then predict classes for a test data stream. The first part works fine, using (for example) java -cp .:moa.jar:weka.jar -javaagent:sizeofag.jar moa.DoTask "LearnModel -l MajorityClass -s (ArffFileStream -f atrain.arff -c -1) -O amodel.moa" But then I cannot figure out how to use the trained model (amodel.moa) on another stream (atest.arff) to predict the classes. Has anyone done this before?

    Read the article

  • XCode and Instruments for memory leaks

    - by coure06
    I have tested my iphone app using XCode and instrument. I am watching the memory allocation tables, its showing me that every things is increasing i.e Bytes, Live Bytes and so on. What does it means? Am i not deallocating the objects? Can i find which objects are not deallocating using instruments?

    Read the article

  • DataList Control in vb.net windows application forms

    - by KoolKabin
    Hi guys, I am upgrading my application from vb6 to vb.net. I used to populate my data in datalist control in vb6 forms. I am not finding it in vb.net windows form application. Which one control is the equivalent to it? How can i list my data in that control? just like: I had a table with data like id, name I want the name should be the displayed column and id the bound column? how can i do that

    Read the article

  • Understanding “Dispatcher” in WPF

    - by Pawan_Mishra
    Level : Beginner to intermediate Consider the following program MainWindow.xaml 1: < Window x:Class ="DispatcherTrial.MainWindow" 2: xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3: xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml" 4: Title ="MainWindow" Height ="350" Width ="525" > 5: < Grid > 6: < Grid.RowDefinitions > 7: < RowDefinition /> 8: < RowDefinition /> 9: </ Grid.RowDefinitions...(read more)

    Read the article

  • What are the different file permission codes and what do they mean?

    - by zeckdude
    I am working with a file upload script. I am currently uploading a file and then trying to echo out an anchor linking to that file, but since I used mkdir() with 0700 permissions to upload the file, it won't allow me access to view the file. I am pretty sure the problem I am experiencing is because of the file permission code I used. The problem is I just don't know what all the different file permission codes are and what they mean. Can somebody please list out all the different file permissions and what they each do?

    Read the article

  • OpenStreetMap Proximity search using mySQL

    - by Chris
    Hi, I'm just playing around with a dataset of my region generated by JOSM. I moved it into a mySQL DB with the 0.6 API scheme using Osmosis and now I'm desperately trying the following: I want to get all streets of a city. AFAIK there is no tag/relation in the OSM data to determine this so I tried it using a proximity search to get all nodes in a radius around a node representing the city center. Most of the time I looked at the approaches here: http://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula What I got is the following SQL code that should get me the closest 100 nodes around the node with id 36187002 and within a radius of 10km. set @nodeid = 36187002; set @dist = 10; select longitude, latitude into @mylon, @mylat from nodes where id=@nodeid limit 1; SELECT id, ( 6371 * acos( cos( radians(@mylon) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(@mylat) ) + sin( radians(@mylon) ) * sin( radians( latitude ) ) ) ) AS distance FROM nodes HAVING distance < @dist ORDER BY distance LIMIT 0 , 100; Well.. it doesn't work. :( I guess the main problem is that OSM lats/lons are multiplied by 10.000.000 and I don't know how I can correct this function to make it work. Any ideas about this? All solutions/alternatives are very welcome! Have a nice weekend! Chris

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >