Search Results

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

Page 122/199 | < Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >

  • how to open Excel sheet with full access in c#

    - by Lalit
    open Excel sheet with full privileged in c#. it is not allowing me to read. asking for uname and pwd when i deploye my c# application in iis. i have write this code for open Excel : please review Excel.ApplicationClass app = new Excel.ApplicationClass(); Excel.Workbook workbook = app.Workbooks.Open( strSheetPath, 0, true, 5, "", "", true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0 ); Excel.Worksheet worksheet = (Excel.Worksheet)workbook.ActiveSheet; Excel.Range rng = null; Excel.CellFormat format; rng = worksheet.get_Range("A2", Missing.Value); rng = rng.get_End(Excel.XlDirection.xlToRight); rng = rng.get_End(Excel.XlDirection.xlDown);

    Read the article

  • Milliseconds in DateTime.Now on .NET Compact Framework always zero?

    - by Marcel
    Hi all, i want to have a time stamp for logs on a Windows Mobile project. The accuracy must be in the range a hundred milliseconds at least. However my call to DateTime.Now returns a DateTime object with the Millisecond property set to zero. Also the Ticks property is rounded accordingly. How to get better time accuracy? Remember, that my code runs on on the Compact Framework, version 3.5. I use a HTC touch Pro 2 device.

    Read the article

  • Accessing Bluetooth virtual COM port on Windows without manual pairing

    - by oo_olo_oo
    I need to connect to a Bluetooth device through virtual COM port created in Windows. It's easy when the port has been already created during manual pairing procedure. But I would like my application to relieve an user from the manual pairing of a device. I would like to present all devices in the range, allow user to chose one, and then create virtual COM port connected with the selected device. I'm not trying to avoid the pairing procedure itself, but rather I would like to invoke it by my application. I started getting familiar with Microsoft Bluetooth API. And then some doubts arose. I've been wondering what happen if some user would use different (than Microsoft's) Bluetooth stack? Is the Microsoft's API the real Bluetooth API, which have to be implemented by any other Bluetooth stack provider? Or rather each provider has its own API, and the Microsoft's is only one of many other?

    Read the article

  • C# VSTO: Coloring pivottable cells

    - by tomboz
    HI, I'm trying to make some code color a PivotTable. It works just fine coloring the cells it's supposed to, but if I refresh the table, all the colors disappear, as if the colors haven't been properly attached to the PivotTable. I have the following code (this is a snip from a larger code): myPivotTable.PivotSelect("'" + item["Name"].ToString() + "'[All;Total]", XlPTSelectionMode.xlDataAndLabel, true); ((Range)Globals.ThisWorkbook.Application.Selection).Interior.Color = 15962653; I've tried doing a macro in Excel in VB, and when it runs, it work works perfectly, so I don't understand why the C# VSTO won't work... ActiveSheet.PivotTables("PivotTable1").PivotSelect "'ItemName'[All;Total]", xlDataAndLabel, True Selection.Interior.Color = 15962653 Help is much appreciated :)

    Read the article

  • asp.net rangevalidator for calendar extender entries gives problems in safari

    - by Robin Baralla
    Hi there, I have the following scenario: arrival and departure dates have to be selected on a form, through 2 textboxes with a calendar extender each. I validate the entries to check that no date before today is selected and to check that the departure is after the arrival. I used a rangevalidator and a comparevalidator. In IE, Firefox and Opera it is working fine, in Safari (on windows) however both the validators go off even on entries that should be accepted. It makes me suspect that the date format dd/MM/yyyy causes trouble for Safari. (the dd/MMMM/yyyy also gave the same troubles in the other browsers, probably due to the dependency on UIculture) The code is:   The range validator gets its values in code behind on Page_load RangeValidator1.MinimumValue = DateTime.Now.AddDays(1).ToShortDateString(); RangeValidator1.MaximumValue = DateTime.Now.AddMonths(12).ToShortDateString(); Does anybody have any suggestions on how to solve this problem with safari? best regards, Robin

    Read the article

  • parallel-python error: RuntimeError("Socket connection is broken")

    - by user288558
    I am using a simple program to send a function: import pp nodes=('mosura02','mosura03','mosura04','mosura05','mosura06', 'mosura09','mosura10','mosura11','mosura12') nodes=('miner:60001',) def pptester(): js=pp.Server(ppservers=nodes) js.set_ncpus(0) tmp=[] for i in range(200): tmp.append(js.submit(ppworktest,(),(),('os',))) return tmp def ppworktest(): import os return os.system("uname -a") the result is: wkerzend@mosura:/home/wkerzend/tmp/ppython_test>ssh miner "source ~/coala_python_setup.sh;ppserver.py -d -p 60001" 2010-04-12 00:50:48,162 - pp - INFO - Creating server instance (pp-1.6.0) 2010-04-12 00:50:52,732 - pp - INFO - pp local server started with 32 workers 2010-04-12 00:50:52,732 - pp - DEBUG - Strarting network server interface=0.0.0.0 port=60001 Exception in thread client_socket: Traceback (most recent call last): File "/usr/lib64/python2.6/threading.py", line 525, in __bootstrap_inner self.run() File "/usr/lib64/python2.6/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/wkerzend/python_coala/bin/ppserver.py", line 161, in crun ctype = mysocket.receive() File "/home/wkerzend/python_coala/lib/python2.6/site-packages/pptransport.py", line 178, in receive raise RuntimeError("Socket connection is broken") RuntimeError: Socket connection is broken

    Read the article

  • How do I make this simple list comprehension?

    - by Carson Myers
    I'm new to python, and I'm trying to get to know the list comprehensions better. I'm not even really sure if list comprehension is the word I'm looking for, since I'm not generating a list. But I am doing something similar. This is what I am trying to do: I have a list of numbers, the length of which is divisible by three. So say I have nums = [1, 2, 3, 4, 5, 6] I want to iterate over the list and get the sum of each group of three digits. Currently I am doing this: for i in range(0, len(nums), 3): nsum = a + b + c for a, b, c in nums[i, i+3] print(nsum) I know this is wrong, but is there a way to do this? I'm sure I've overlooked something probably very simple... But I can't think of another way to do this.

    Read the article

  • Python 3.1.1 Problem With Tuples

    - by Protean
    This piece of code is supposed to go through a list and preform some formatting to the items, such as removing quotations, and then saving it to another list. class process: def rchr(string_i, asciivalue): string_o = () for i in range(len(string_i)): if ord(string_i[i]) != asciivalue: string_o += string_i[i] return string_o def flist(self, list_i): cache = () cache_list = [] for line in list_i: cache = line.split('\t') cacbe[0] = process.rchr(str(cache[0]), 34) cache_list.append(cache[0]) cache_list[index] = cache index += 1 cache_list.sort() return cache_list p = process() list1a = ['cow', 'dog', '"sheep"'] list1 = p.flist(list1a) print (country_list) However; it chokes at 'string_o += string_i[i]' and gives the following error: Traceback (most recent call last): File "/Projects/Python/safafa.py", line 23, in <module> list1 = p.flist(list1a) File "/Projects/Python/safafa.py", line 14, in flist cacbe[0] = process.rchr(str(cache[0]), 34) File "/Projects/Python/safafa.py", line 7, in rchr string_o += string_i[i] TypeError: can only concatenate tuple (not "str") to tuple

    Read the article

  • Using python to play two sine tones at once

    - by Alex
    I'm using python to play a sine tone. The tone is based off the computer's internal time in minutes, but I'd like to simultaneously play one based off the second for a harmonized or dualing sound. This is what I have so far; can someone point me in the right direction? from struct import pack from math import sin, pi import time def au_file(name, freq, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) fout.write(pack('b', vol * 127 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if __name__ == '__main__': au_file(name='timeSound1.au', freq = tim, dur=1000, vol=1.0) import os os.startfile('timeSound1.au')

    Read the article

  • address representation in ada

    - by maddy
    Hi all, I have pasted a code below which is in ada language.I need some clarification on some implementations. C : character; Char : character; type Myarr_Type is array (character range 'A'..'K') of character; Myarr : Myarr_Type := ('A','B','C','D','E','F','G','H','I','J','K'); Next_Address := Myarr'address Last_Address := Next_Address + Storage_Offset'(40); my_func(int P1,int P2) { return P2 + Storage_Offset'(4); } Last_Address := Next_Address + Storage_Offset'(4); Now my doubt is 1)what does P2 + Storage_Offset'(4) actually mean.Does that mean that its returning the address of the next element in the array which is 'B'.Storage_Offset'(4) in ada --does this mean 4 bits or 4 bytes of memory. 2) If i assume that Last_Address points to last element of the array which is 'K',how does the arithmentic Storage_Offset'(40) satisfies the actual implementation? Please get back to me if u need any more clarifications. Thanks Maddy

    Read the article

  • Getting Started with Python: Attribute Error

    - by Nacari
    I am new to python and just downloaded it today. I am using it to work on a web spider, so to test it out and make sure everything was working, I downloaded a sample code. Unfortunately, it does not work and gives me the error: "AttributeError: 'MyShell' object has no attribute 'loaded' " I am not sure if the code its self has an error or I failed to do something correctly when installing python. Is there anything you have to do when installing python like adding environmental variables, etc.? And what does that error generally mean? Here is the sample code I used with imported spider class: import chilkat spider = chilkat.CkSpider() spider.Initialize("www.chilkatsoft.com") spider.AddUnspidered("http://www.chilkatsoft.com/") for i in range(0,10): success = spider.CrawlNext() if (success == True): print spider.lastUrl() else: if (spider.get_NumUnspidered() == 0): print "No more URLs to spider" else: print spider.lastErrorText() # Sleep 1 second before spidering the next URL. spider.SleepMs(1000)

    Read the article

  • Serializing Python bytestrings to JSON, preserving ordinal character values

    - by Doctor J
    I have some binary data produced as base-256 bytestrings in Python (2.x). I need to read these into JavaScript, preserving the ordinal value of each byte (char) in the string. If you'll allow me to mix languages, I want to encode a string s in Python such that ord(s[i]) == s.charCodeAt(i) after I've read it back into JavaScript. The cleanest way to do this seems to be to serialize my Python strings to JSON. However, json.dump doesn't like my bytestrings, despite fiddling with the ensure_ascii and encoding parameters. Is there a way to encode bytestrings to Unicode strings that preserves ordinal character values? Otherwise I think I need to encode the characters above the ASCII range into JSON-style \u1234 escapes; but a codec like this does not seem to be among Python's codecs. Is there an easy way to serialize Python bytestrings to JSON, preserving char values, or do I need to write my own encoder?

    Read the article

  • How do I retrieve the values entered in a nested control added dynamically to a webform?

    - by Front Runner
    I have a date range user control with two calendar controls: DateRange.ascx public partial class DateRange { public string FromDate { get { return calFromDate.Text; } set { calFromDate.Text = value; } } public string ToDate { get { return calToDate.Date; } set { calToDate.Text = value; } } } I have another user control in which DateRange control is loaded dynamically: ParamViewer.ascx public partial class ParamViewer { public void Setup(string sControlName) { //Load parameter control Control control = LoadControl("DateRange.ascx"); Controls.Add(control); DateRange dteFrom = (DateRange)control.FindControl("calFromDate"); DateRange dteTo = (DateRange)control.FindControl("calToDate"); } } I have a main page webForm1.aspx where ParamViewer.ascx is added When user enter the dates, they're set correctly in DateRange control. My question is how how do I retrieve the values entered in DateRange (FromDate and ToDate)control from btnSubmit_Click event in webForm1? Please advise. Thank you in advance.

    Read the article

  • Replace letters in a secret text

    - by kame
    Hello! I want to change every letter in a text to after next following letter. But this program doesnt work. Does anyone know why. Thanks in advance. There is also a minor problem with y and z. import string letters = string.ascii_lowercase text=("g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj. ") for x in range(1,24): text.replace(letters[x],letters[x+2]) print(text)

    Read the article

  • Python: x-y-plot with matplotlib

    - by kame
    I want to plot some data. The first column contains the x-data. But matplotlib doesnt plot this. Where is my mistake? #fresnel formula import numpy as np from numpy import cos from scipy import * from pylab import plot, show, ylim, yticks from matplotlib import * from pprint import pprint n1 = 1.0 n2 = 1.5 #alpha, beta, intensity data = [ [10, 22, 4.3], [20, 42, 4.2], [30, 62, 3.6], [40, 83, 1.3], [45, 102, 2.8], [50, 123, 3.0], [60, 143, 3.2], [70, 163, 3.8], ] for i in range(len(data)): rhotang1 = (n1 * cos(data[i][0]) - n2 * cos(data[i][1])) rhotang2 = (n1 * cos(data[i][0]) + n2 * cos(data[i][1])) rhotang = rhotang1 / rhotang2 data[i].append(rhotang) #append 4th value pprint(data) x = data[:][0] y1 = data[:][2] y3 = data[:][3] plot(x, y1, x, y3) show() EDIT: http://paste.pocoo.org/show/205534/ But it doesnt work.

    Read the article

  • Winforms control that works like ajax tag-completion

    - by Sargola
    Heya, I want to create a winforms app where you can assign tags to an entity. ofc I want the customer to re-use existing tags a lot. That's why I want to show them the list of tags while they are typing (similar to intellisense in VS and the tags-dropdown even here in stackoverflow ;)) do you have any control(s) in mind that offers this functionality? can I reuse a ComboBox for this? (here I need to drop it down programatically - how?) I want to have the taglist getting input-focus but not lose the mainform-focus, and I want it to be on top over all windows and even range out of the mainform-area (like intellisense in vs) thx!

    Read the article

  • Using python to play two sin tones at once

    - by Alex
    Im using python to a sine tone. the tone is based off the computers internal time in minutes, but id like to simultaneously play one based off the second for a harmonized or dualing sound. This is what I have so far can someone point me in the right direction. from struct import pack from math import sin, pi import time def au_file(name, freq, dur, vol): fout = open(name, 'wb') # header needs size, encoding=2, sampling_rate=8000, channel=1 fout.write('.snd' + pack('>5L', 24, 8*dur, 2, 8000, 1)) factor = 2 * pi * freq/8000 # write data for seg in range(8 * dur): # sine wave calculations sin_seg = sin(seg * factor) fout.write(pack('b', vol * 127 * sin_seg)) fout.close() t = time.strftime("%S", time.localtime()) ti = time.strftime("%M", time.localtime()) tis = float(t) tis = tis * 100 tim = float(ti) tim = tim * 100 if name == 'main': au_file(name='timeSound1.au', freq = tim, dur=1000, vol=1.0) import os os.startfile('timeSound1.au')

    Read the article

  • Horizontal scroll winforms listview

    - by tempy
    Anyone know if its possible to enable horizontal scrolling ONLY in a windows forms listview (viewmode set to large icons). What I want to do is make a listview whose height is sufficient to only show one row of icons, and I don't want to have multiple rows. Just one very long row that a user would have to scroll horizontally to get to out-of-range icons. If I make the listview scrollable then it automatically makes multiple rows and puts in a vertical scrollbar, which I don't want. Thanks in advance!

    Read the article

  • Python Random Question

    - by coson
    Good Day, I am using Python 2.6 and am trying to run a simple random number generator program (random.py): import random for i in range(5): # random float: 0.0 <= number < 1.0 print random.random(), # random float: 10 <= number < 20 print random.uniform(10, 20), # random integer: 100 <= number <= 1000 print random.randint(100, 1000), # random integer: even numbers in 100 <= number < 1000 print random.randrange(100, 1000, 2) I'm now receiving the following error: C:\Users\Developer\Documents\PythonDemo>python random.py Traceback (most recent call last): File "random.py", line 3, in <module> import random File "C:\Users\Developer\Documents\PythonDemo\random.py", line 8, in <module> print random.random(), TypeError: 'module' object is not callable C:\Users\Developer\Documents\PythonDemo> I've looked at the Python docs and this version of Python supports random. Is there something else I'm missing? TIA, coson

    Read the article

  • [IOS SDK] retrieving scores from game center

    - by Sam
    I got this code from apple's developer site. How do i process the score information to be viewed in a like a UITableView or something? (void) retrieveTopTenScores { GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init]; if (leaderboardRequest != nil) { leaderboardRequest.playerScope = GKLeaderboardPlayerScopeGlobal; leaderboardRequest.timeScope = GKLeaderboardTimeScopeAllTime; leaderboardRequest.range = NSMakeRange(1,10); [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error) { if (error != nil) { // handle the error. } if (scores != nil) { // process the score information. } }]; } }

    Read the article

  • getSelection & surroundContents across multiple tags

    - by lethalbody
    Hi, I've got a script that changes the background colour of text that has been selected. However i'm encountering an issue when the text is selected across multiple elements/tags. The code that i've got is: var text = window.getSelection().getRangeAt(0); var colour = document.createElement("hlight"); colour.style.backgroundColor = "Yellow"; text.surroundContents(colour); And the error being output is: Error: The boundary-points of a range does not meet specific requirements. = NS_ERROR_DOM_RANGE_BAD_BOUNDARYPOINTS_ERR Line: 7 I believe this is to do with the getRange() function though i'm not too sure how to proceed since I am a beginner at javascript. Is there any other way I can replicate what I am trying to achieve? Many thanks.

    Read the article

  • google maps, cellid to location

    - by Dels
    According to this sample: http://www.codeproject.com/KB/mobile/DeepCast.aspx It's possible to request a gps coordinate (longitude & latitude) including range when sending cellid information (MCC, MNC, towerid, etc) Can someone tell me the actual parameter to request/post to this address? http://www.google.com/glm/mmap It could be something like this http://www.google.com/glm/mmap?mcc=xxx&mnc=xxx&towerid=xxx And i would like to know what response we would get. I have observe OpenCellid website and they provide some nice API to begin with, but i want to know about that in google map too (since they have more completed database). OpenCellID API

    Read the article

  • SQL: Need to SUM on results that meet a HAVING statement

    - by Wasauce
    I have a table where we record per user values like money_spent, money_spent_on_candy and the date. So the columns in this table (let's call it MoneyTable) would be: UserId Money_Spent Money_Spent_On_Candy Date My goal is to SUM the total amount of money_spent -- but only for those users where they have spent more than 10% of their total money spent for the date range on candy. What would that query be? I know how to select the Users that have this -- and then I can output the data and sum that by hand but I would like to do this in one single query. Here would be the query to pull the sum of Spend per user for only the users that have spent 10% of their money on candy. SELECT UserId, SUM(Money_Spent), SUM(Money_Spent_On_Candy) / SUM(Money_Spent) AS PercentCandySpend FROM MoneyTable WHERE DATE >= '2010-01-01' HAVING PercentCandySpend > 0.1;

    Read the article

  • What alternatives are there to Google App Engine?

    - by Chris Marasti-Georg
    What alternatives are there to GAE, given that I already have a good bit of code working that I would like to keep. In other words, I'm digging python. However, my use case is more of a low number of requests, higher CPU usage type use case, and I'm worried that I may not be able to stay with App Engine forever. I have heard a lot of people talking about Amazon Web Services and other sorts of cloud providers, but I am having a hard time seeing where most of these other offerings provide the range of services (data querying, user authentication, automatic scaling) that App Engine provides. What are my options here?

    Read the article

  • Passing dynamic CSS to jQuery.animate

    - by harpo
    The documentation of jQuery.animate states that The only required parameter is a map of CSS properties. This map is similar to the one that can be sent to the .css() method, except that the range of properties is more restrictive. So, why does this work $('#con div').css( { top : function(i) { console.log(i); return (i * 500) + 'px'; } } ); and this doesn't? $('#con div').animate( { top : function(i) { console.log(i); return (i * 500) + 'px'; } } ); The console shows that the function is being evaluated for css, but not for animate. Am I missing something? By the way, I'm using 1.4.2.

    Read the article

< Previous Page | 118 119 120 121 122 123 124 125 126 127 128 129  | Next Page >