Search Results

Search found 4955 results on 199 pages for 'range'.

Page 39/199 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • remote desktop access

    - by pnp
    I have my work system on the ip range 172.16.xx.yy, and I have my personal system on the ip range 10.0.xx.yy. Both of them, however, are on the same network of my University, but on different LANs/VLANs (i hope i used the right word here). How can I remotely connect to my work system from my PC, given that both use private IP addresses? If such a thing is not possible with current set up, what minimal changes are required for it?

    Read the article

  • Is an average RAM usage per Apache process of 43 MB "normal" for a Social Networking site? [closed]

    - by Programmer
    I have a Social Networking site that runs on a single LAMP Server that handles everything. The average RAM usage per Apache process is 43 MB. Is that amount roughly within the expected range for a Social Networking site, or is it too high? If it's too high, where and how can I look to bring that average number down? (If you need more details to determine whether it's within the expected range or not, just let me know and I'll edit my question to provide them as best I can.)

    Read the article

  • Moving files within an ext4 filesystem?

    - by HT74
    I'd like to decrease the access-time for some files by moving them to the beginning of the fs. Task 1: Clear a certain block range at the beginning of the fs (moving existing files to free space elsewhere). Task 2: Move the files in question to that block range (should be able to grow a bit). How would I do that?

    Read the article

  • Disk Search / Sort Algorithm

    - by AlgoMan
    Given a Range of numbers say 1 to 10,000, Input is in random order. Constraint: At any point only 1000 numbers can be loaded to memory. Assumption: Assuming unique numbers. I propose the following efficient , "When-Required-sort Algorithm". We write the numbers into files which are designated to hold particular range of numbers. For example, File1 will have 0 - 999 , File2 will have 1000 - 1999 and so on in random order. If a particular number which is say "2535" is being searched for then we know that the number is in the file3 (Binary search over range to find the file). Then file3 is loaded to memory and sorted using say Quick sort (which is optimized to add insertion sort when the array size is small ) and then we search the number in this sorted array using Binary search. And when search is done we write back the sorted file. So in long run all the numbers will be sorted. Please comment on this proposal.

    Read the article

  • Python: divisors of a number [closed]

    - by kame
    Possible Duplicate: What is the best way to get all the divisors of a number? The most part of this code was written by an other programmer, but I cant run his code. Please show me where the mistake is. I was searching a long time. I get the error 'NoneType' object is not iterable (in divisorGen(n)). from __future__ import division #calculate the divisors #this is fast-working-code from: #http://stackoverflow.com/questions/171765/what-is-the-best-way-to-get-all-the-divisors-of-a-number def factorGenerator(n): for x in range(1,n): n = n * 1.0 r = n / x if r % 1 == 0: yield x # edited def divisorGen(n): factors = list(factorGenerator(n)) nfactors = len(factors) f = [0] * nfactors while True: yield reduce(lambda x, y: x*y, [factors[x][0]**f[x] for x in range(nfactors)], 1) i = 0 while True: f[i] += 1 if f[i] <= factors[i][1]: break f[i] = 0 i += 1 if i >= nfactors: return for n in range(100): for i in divisorGen(n): print i

    Read the article

  • Set caret position in contenteditable div layer in Chrome/webkit

    - by Alex
    Hello, I'm trying to set the caret position in a contenteditable div layer, and after a bit of searching the web and experimenting I got it to work in firefox using this: function set(element,position){ element.focus(); var range= window.getSelection().getRangeAt(0); range.setStart(element.firstChild,position); range.setEnd(element.firstChild,position); } [...] set(document.getElementById("test"),3); But in Chrome/webkit it selects all of the content in the div. Is this a bug with webkit or am I doing something wrong? Thank you in advance.

    Read the article

  • Sharing WPF RichTextBox content with Silverlight RichTextBox

    - by Stewart Armbrecht
    Has anyone figured out the best way to persist a WPF and Silverlight RichTextBox content so that it can be shared between the two? I haven't had the time to test through this so I wanted to see if anyone else has. I currently have a WPF applicaiton that saves the content of a RichTextBox as a blob in the database using the following code: byte[] result = null; TextRange range = new TextRange(flowDocument.ContentStart, flowDocument.ContentEnd); if (range.IsEmpty == false) { using (MemoryStream strm = new MemoryStream()) { range.Save(strm, DataFormats.XamlPackage, true); result = strm.ToArray(); strm.Close(); } } return result; I am building a silverlight version of the application and want to know how I can load (and save) this content using the Silverlight RichTextBox so that it can still be using in the WPF application.

    Read the article

  • Excel / VB - How do I loop through each row/column and do formatting based on the value?

    - by Johnny 5
    Here's what I need to do: 1) Loop through every cell in a worksheet 2) Make formatting changes (bold, etc) to fields relative to each field based on the value What I mean is that if a field has a value of "foo", I want to make the field that is (-1, -3) from it bold, etc. I tried to do this with the following script with no luck. Thanks Johnny Pseudo Code to Explain: For Each Cell in WorkSheet If Value of Cell is 'Subtotal' Make the cell 2 cells to the left and 1 cell up from here bold and underlined End If End ForEach The Failed Macro (I don't really know VB at all): Sub Macro2() ' ' ' Dim rnArea As Range Dim rnCell As Range Set rnArea = Range("J1:J2000") For Each rnCell In rnArea With rnCell If Not IsError(rnCell.Value) Then Select Case .Value Case "000 Total" ActiveCell.Offset(-1, -3).Select ActiveCell.Font.Underline = XlUnderlineStyle.xlUnderlineStyleSingleAccounting End Select End If End With Next End Sub

    Read the article

  • C# How to communicate between 2 servers

    - by Chau
    I have a website running ASP.NET (C#) on server A. I need my website to access a webservice on server B. server B will only accept incoming requests if the requestee is located within a certain IP range and server A is not within this range. I have a server server C which is located within the IP range and the only thing blocking server A from server C is a firewall (which I have access to). It must be possible to create a hole in the firewall between server A and server C, but my question is: How do I relay the request from server A to server B via server C? I need the response from server B to get back to server A also :) Thanks in advance.

    Read the article

  • Zipping Rx IObservable with infinite number set

    - by Toni Kielo
    I have a IObservable [named rows in the sample below] from Reactive extensions framework and I want to add index numbers to each object it observes. I've tried to implement this using Zip function: rows.Zip(Enumerable.Range(1, int.MaxValue), (row, index) => new { Row = row, Index = index }) .Subscribe(a => ProcessRow(a.Row, a.Index), () => Completed()); .. but unfortunately this throws ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: disposables Am I understanding the Zip function wrong or is there a problem with my code? The Range part of the code doesn't seem to be the problem and the IObservable isn't yet receiving any events.

    Read the article

  • PySide / PyQt QStyledItemDelegate list in table

    - by danodonovan
    Dear All, I'm trying to create a table of lists in Python with Qt (PySide/PyQt - matters not) and my lists are squashed into the table cells. Is there a way to get the list delegates to 'pop out' of their cells? I've attached a simple code snippet - replace 'PySide' with 'PyQt4' depending on your preference from PySide import QtCore, QtGui class ListDelegate(QtGui.QStyledItemDelegate): def createEditor(self, parent, option, index): editor = QtGui.QListWidget(parent) for i in range( 12 ): editor.addItem('list item %d' % i) return editor if __name__ == '__main__': import sys app = QtGui.QApplication(sys.argv) model = QtGui.QStandardItemModel(2, 2) tableView = QtGui.QTableView() delegate = ListDelegate() tableView.setItemDelegate(delegate) tableView.setModel(model) for row in range(2): for column in range(2): item = QtGui.QStandardItem( 'None' ) model.setItem(row, column, item) tableView.setWindowTitle('example') tableView.show() sys.exit(app.exec_()) If you hadn't guessed I'm pretty new to this Qt lark Thanks in advance, Dan

    Read the article

  • How do I get the cell value from a formula in Excel using VBA?

    - by Simon
    I have a formula in a range of cells in a worksheet which evaluate to numerical values. How do I get the numerical values in VBA from a range passed into a function? Let's say the first 10 rows of column A in a worksheet contain rand() and I am passing that as an argument to my function... public Function X(data as Range) as double for c in data.Cells c.Value 'This is always Empty c.Value2 'This is always Empty c.Formula 'This contains RAND() next end Function I call the function from a cell... =X(a1:a10) How do I get at the cell value, e.g. 0.62933645? Excel 2003, VB6

    Read the article

  • "cannot concatenate 'str' and 'list' objects" keeps coming up :(

    - by ratce003
    I'm writing a python program and passing in a html template but an error keeps coming up, "cannot concatenate 'str' and 'list' objects" here is is the program: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgi import cgitb cgitb.enable() def template(file, **vars): return open(file, 'r').read() % vars print "Content-type: text/html\n" print form = cgi.FieldStorage() # instantiate only once! num_1 = form.getfirst('num_1') num_2 = form.getfirst('num_2') int1r = str(num_1) int2r = str(num_2) def calc_range(int2r, int1r): start = range(int2r, int1r + 1) end = range(1, int2r) return start+end int1 = int(int1r) int2 = int(int2r) out_str = '' for i in range(0, int1): first_line_num = (int2 + i) % int1 if first_line_num == 0: first_line_num = int1 line = calc_range(first_line_num, int1) out_str += line print template('results.html', output=out_str, title="Latin Squares")

    Read the article

  • Unchecked_Conversion in ada

    - by maddy
    Hi all, Can anyone please make me clear about the use of unchecked conversion in ada language.I had tried the pdf and net but all doesnt give me a clear picture to me. Now i have a small piece of code shown below: subtype Element4_Range is integer range 1..4; subtype Element3_Range is integer range 1..3; subtype Myarr_Range is integer range 1..10; type Myarr3_Type is array (Myarr_Range) of Element3_Range; type Myarr4_Type is array (Myarr_Range) of Element4_Range; Myarr3 : Myarr3_Type; Myarr4 : Myarr4_Type := (1,2,3,3,1,3,2,1,2,1); Count_1 : Integer := 0; Count_2 : Integer := 0; Count_3 : Integer := 0; *function To_Myarr3 is new Unchecked_Conversion(Myarr4_type,Myarr3_type);* Now my doubt here is what does the function Myarr3 exactly do? Thanks and regards maddy

    Read the article

  • Resuming File Downloads in Ruby on Rails

    - by jaycode
    Hi, this has been asked here: http://stackoverflow.com/questions/1840413/resuming-file-downloads-in-ruby-on-rails-range-header-support But there was no answer. I am having similar problem, could anybody help, please? Thanks before. Alright I am getting close. Seems like I need to setup header Content-Length or Content-Range, as described here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13. Haven't got an idea how. Anybody knows? Jay response.header["Content-Range"] = "20000-#{size}" send_file "#{Dir.pwd}/products/filename.zip", :type => 'application/zip', :size => (size - 20000) doesn't work

    Read the article

  • Merging columns in a JTable

    - by Harish
    I am working in JTable and I have a requirement like this. Say There are 4 columns namely 10,20,30,40 Now the value usually comes like 10-20 20-30 and 30-40 So it was easy for us to display the name for this range. But recently the values have started to come randomly like 15-25 10-25,25-30 In this case our JTable should dynamically adjust the size of the row such that it represents that range only meaning it should not disturb the existing cells and only rows which diverge from the normal range. TO be more precise I should be able to merge and split cells based on the content of the cell.

    Read the article

  • OpenCV in Python can't scan through pixels

    - by Marco L.
    Hi everyone, I'm stuck with a problem of the python wrapper for OpenCv. I have this function that returns 1 if the number of black pixels is greater than treshold def checkBlackPixels( img, threshold ): width = img.width height = img.height nchannels = img.nChannels step = img.widthStep dimtot = width * height data = img.imageData black = 0 for i in range( 0, height ): for j in range( 0, width ): r = data[i*step + j*nchannels + 0] g = data[i*step + j*nchannels + 1] b = data[i*step + j*nchannels + 2] if r == 0 and g == 0 and b == 0: black = black + 1 if black >= threshold * dimtot: return 1 else: return 0 The loop (scan each pixel of a given image) works good when the input is an RGB image...but if the input is a single channel image I get this error: for j in range( width ): TypeError: Nested sequences should have 2 or 3 dimensions The input single channel image (called 'rg' in the next example) is taken from an RGB image called 'src' processed with cvSplit and then cvAbsDiff cvSplit( src, r, g, b, 'NULL' ) rg = cvCreateImage( cvGetSize(src), src.depth, 1 ) # R - G cvAbsDiff( r, g, rg ) I've also already noticed that the problem comes from the difference image got from cvSplit... Anyone can help me? Thank you

    Read the article

  • Greasemonkey: load url using GM_xmlhttpRequest and createContextualFragment

    - by Dave
    I have the following GreaseMonkey Script: GM_xmlhttpRequest({ method: 'GET', url: "http://www.testurl.com", headers: { 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3', }, onload: function(responseDetails) { var tagString = responseDetails.responseText; var range = document.createRange(); range.selectNode(document.body); var documentFragment = range.createContextualFragment(tagString); How do I now extract stuff from documentFragment? documentFragment.getElementById(''), document.body etc all returns undefined. I suspect this is due to the createContextualFragment method returning a XPCNativeWrapper object, but how do I work around this to access the underlying DOM? Thanks

    Read the article

  • Could the assign function for containers possibly overflow?

    - by Kristo
    I ran into this question today and thought I should post it for the community's reference and/or opinions. The standard C++ containers vector, deque, list, and string provide an assign member function. There are two versions; I'm primarily interested in the one accepting an iterator range. The Josuttis book is a little ambiguous with its description. From p. 237... Assigns all elements of the range [beg,end); this is, is replaces all existing elements with copies of the elements of [beg,end). It doesn't say what happens if the size of the assignee container is different from the range being assigned. Does it truncate? Does it automagically expand? Is it undefined behavior?

    Read the article

  • Is it possible to return a list of all ranges from all worksheets in an Excel 2002 workbook?

    - by generalt
    Hello all. I want to extract "special" data from an Excel 2002 (client requirement, cannot change) workbook and worksheets contained therein. I have classified ranges in this "special" data category. I would like to acquire a list of all ranges in, ideally, all worksheets in a workbook. The attributes I'm interested in are the range name, and the range address. I have been googling for a while now, and have not found anything relevant. I was assuming the Excel 2002 API would expose something like this: ApplicationClass app = new ApplicationClass(); Workbook workbook = app.Workbooks.Open(@"c:\file.xls", ...); Worksheet worksheet = workbook.Worksheets["sheet1"] as Worksheet; Range[] ranges = worksheet.GetAllRanges(); or something similar. However, I am sadly mistaken. Is this possible with Excel 2002?

    Read the article

  • Ember multiple property changes but want to trigger single event

    - by Ankur Agarwal
    I have a ArrayController for date picker with properties to and from. Now when user selects a new date range from the UI both to and from value changes. So a function which observers on to and from is trigger twice for a single change in date range. I want to trigger the function only one every date range change. Any suggestions how to do that with ember app = Ember.Application.create(); app.Time = Ember.ArrayController.create({ to: null, from: null, rootElement: "#time", debug1: function() { this.set('to', 1); this.set('from', 2); }, debug2: function() { this.setProperties( { 'to': 3, 'from': 4 }); }, debug3: function() { this.beginPropertyChanges(); this.set('to', 5); this.set('from', 6); this.endPropertyChanges(); }, search: function() { alert('called'); }.observes('to', 'from') }); View in JS Fiddle

    Read the article

  • Redimming arrays in VBA

    - by Mike
    I have 3 arrays of data, that are filled by reading off of an excel sheet, some of the points of data are missing and as such have just been entered into excel as "NA" so I want to look through my array and find each instance of these NA's and remove them from the array since the information is useless. I need to update all three arrays at the same time. Sub group_data() Dim country(), roe(), iCap() As String Dim i As Integer For i = 1 To 3357 country(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("C1").Offset(i, 0) roe(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("AP1").Offset(i, 0) iCap(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("BM1").Offset(i, 0) Next i End Sub So if I find a "NA" as one of the values in roe or iCap I want to get rid of that piece of data in all there arrays.

    Read the article

  • Dynamic "OR" conditions in Rails 3

    - by Ryan Foster
    I am working on a carpool application where people can search for lifts. They should be able to select the city from which they would liked to be picked up and choose a radius which will then add the cities in range to the query. However the way it is so far is that i can only chain a bunch of "AND" conditions together where it would be right to say "WHERE start_city = city_from OR start_city = a_city_in_range OR start_city = another_city_in_range" Does anyone know how to achive this? Thanks very much in advance. class Search < ActiveRecord::Base def find_lifts scope = Lift.where('city_from_id = ?', self.city_from) #returns id of cities which are in range of given radius @cities_in_range_from = City.location_ids_in_range(self.city_from, self.radius_from) #adds where condition based on cities in range for city in @cities_in_range_from scope = scope.where('city_from_id = ?', city) #something like scope.or('city_from_id = ?', city) would be nice.. end end

    Read the article

  • Python beginner, strange output problem

    - by Protean
    I'm having a weird problem with the following piece of code. from math import sqrt def Permute(array): result1 = [] result2 = [] if len(array) <= 1: return array for subarray in Permute(array[1:]): for i in range(len(array)): temp1 = subarray[:i]+array[0]+subarray[i:] temp2 = [0] for num in range(len(array)-1): temp2[0] += (sqrt(pow((temp1[num+1][1][0]-temp1[num][1][0]),2) + pow((temp1[num+1][1][1]-temp1[num][1][1]),2))) result1.append(temp1+temp2) return result1 a = [['A',[50,1]]] b = [['B',[1,1]]] c = [['C',[100,1]]] array = [a,b,c] result1 = Permute(array) for i in range(len(result1)): print (result1[i]) print (len(result1)) What it does is find all the permutations of the points abc and then returns them along with the sum of the distances between each ordered point. It does this; however, it also seems to report a strange additional value, 99. I figure that the 99 is coming from the computation of the distance between point a and c but I don't understand why it is appearing in the final output as it does.

    Read the article

  • How do I use Some/None Options in this F# example?

    - by Phobis
    I am new to F# and I have this code: if s.Contains("-") then let x,y = match s.Split [|'-'|] with | [|a;b|] -> int a, int b | _ -> 0,0 Notice that we validate that there is a '-' in the string before we split the string, so the match is really unnecessary. Can I rewrite this with Options? I changed this code, it was originally this (but I was getting a warning): if s.Contains("-") then let [|a;b|] = s.Split [|'-'|] let x,y = int a, int b NOTE: I am splitting a range of numbers (range is expressed in a string) and then creating the integer values that represent the range's minimum and maximum.

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >