Search Results

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

Page 131/199 | < Previous Page | 127 128 129 130 131 132 133 134 135 136 137 138  | Next Page >

  • What are some exciting, fun, and educational Computer Science activities for students?

    - by Nixuz
    I am a volunteer for Let's Talk Science, an organization which places science graduate students into elementary school and high school classrooms to present short, fun, yet educational demonstrations or experiments related to their particular field. Physics, Chemistry, and Biology have an abundance of such demonstrations, however as a computer scientist, I have no good ideas of what I can present to these students which will demonstrate computer programming and computers in an understandable yet inspiring way in only a 1 - 3 hour presentation. So I am turning to SO for suggestions. Thanks. Presentation Requirements Length: 1 - 3 hours. Explainable in a single sitting. Captivates elementary school and high school audiences. Educational. Please Note Computer's are available at the schools. Please, indicate the suitable age range for your suggestion in your answer.

    Read the article

  • Webcombo return error when trying to populate based on another WebCombo

    - by mattgcon
    I have a few webcombo boxes that are hierachial: Continent Country When the form loads everything works fine, when I change the continent the first time, the country repopulates correctly. However if I change the continent a second time I receive an error: Specified argument was out of the range of valid values.Parameter name: The DataValueField of ValueField was not found in the Columns collection. Can anyone tell me why? P.S. This is all I have in the Page_Load event if (!IsPostBack) { this.Load_AreaList(); this.Load_AreasOfInterest(); this.Load_Degrees(); this.Load_GenderList(); this.Load_ParticipationDateModifiers(); this.Load_ProgramCategories(nEventID); this.Load_YesNoList(); this.Load_ParticipantInformation(nParticipantID); }

    Read the article

  • Creating lib file from java jar using mingw/gcj

    - by Xinus
    I am trying to convert jar file to native lib file using mingw-gcj under windows platform it is thrown me the error as C:\testDir\libs>gcj -o glassfish-embedded-all-3.1-SNAPSHOT.lib glassfish-embedde d-all-3.1-SNAPSHOT.jar com/sun/codemodel/JAnonymousClass.java: In class 'com.sun.codemodel.JAnonymousCl ass': com/sun/codemodel/JAnonymousClass.java: In constructor '(com.sun.codemodel.JClas s,com.sun.codemodel.JCodeModel)': In file included from com/sun/codemodel/CodeWriter.java:15, from <built-in>:3: com/sun/codemodel/JAnonymousClass.java:21: error: verification failed at PC=3: c onstant pool index out of range com/sun/codemodel/JAnonymousClass.java:21: confused by earlier errors, bailing o ut Is it related to some java 1.6 issue or bug in gcj /

    Read the article

  • Create a rich text control field in VBA for Word 2010

    - by mkn
    I have a control field where I dynamically add certain text. That works well so far. The problem is that in one text I have an input field where the user can type in text. I need to hardcode the form text input field into the VBA code. How is this achieved? Or can someone point me in the right direction? In the following code snippet I need to replace the [InputField] by a VBA input field. ActiveDocument.SelectContentControlsByTitle("Bottom").Item(1).Range.Text = _ "Some Text" & vbNewLine & _ "Some Text" & vbNewLine & _ "Some Text" & vbNewLine & _ "Text [InputField] Text"

    Read the article

  • How do i put this chunk of code into a php variable?

    - by Theron Chong
    if (isset($_SESSION['name'])){ //select BID and duedates which are between the range of 1-3 days // before due date from current date $query = "SELECT DueDate FROM item WHERE DueDate BETWEEN '$warning2' and '$warning' and user='$_SESSION[name]' ORDER BY DueDate DESC"; $find = mysql_query($query); $alert = mysql_num_rows($find); if ($alert>=1){ echo "You have got " .$alert. " item(s) due on: </br >"; while ($item = mysql_fetch_array($find)){ echo $item['DueDate']; echo "<br />"; } } echo "Success!"; } Question: How do i input all this code into a single php variable, say $alert. I am not clear of where to put single quotes or double quotes to make it work. At the end of the day, I will be using the variable for a javascript alert box.

    Read the article

  • Python and hebrew encoding/decoding error

    - by user340495
    Hey, I have sqlite database which I would like to insert values in Hebrew to I am keep getting the following error : UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 0: ordinal not in range(128) my code is as following : runsql(u'INSERT into personal values(%(ID)d,%(name)s)' % {'ID':1,'name':fabricate_hebrew_name()}) def fabricate_hebrew_name(): hebrew_names = [u'????',u'???',u'???',u'???',u'????',u'???',u'????',u'???',u'????',u'?????',u'????',u'???',u'????'] return random.sample(names,1)[0].encode('utf-8') note: runsql executing the query on the sqlite database fabricate_hebrew_name() should return a string which could be used in my SQL query. any help is much appreciated.

    Read the article

  • Pass dynamic data to mvc controller with AJAX

    - by Yustme
    How can I pass dynamic data with an AJAX call to an MVC Controller? Controller: public JsonResult ApplyFilters(dynamic filters){ return null; } The AJAX call: $(':checkbox').click(function (event) { var serviceIds = $('input[type="checkbox"]:checked').map(function () { return $(this).val(); }).toArray(); //alert(serviceIds); $.ajax({ type: 'GET', url: '/home/ApplyFilters', data: JSON.stringify({ name: serviceIds }), contentType: 'application/json', success: function (data) { alert("succeeded"); }, error: function (err, data) { alert("Error " + err.responseText); } }); //return false; }); Ideally would be that the filters would contain the serviceIds as a property For example like this: filters.ServiceIds. I got another filter for a date range and that one would be added like so: filters.DateRange. And server side get the filter as a dynamic object in the ApplyFilters()

    Read the article

  • Jquery .Filter Function Question

    - by Matias
    Hi Guys, This is kindof a simple question, however, I don´t seem to figure out how to do it: I´ve got a slider filtering some stuff $("#price").slider( { range: true, step: 5, change: function(e,ui) { $('total').filter(function(index) { return ( ($("#price").slider("values", 0)) <= $(this).text() <= ($("#price").slider("values", 1))); }).parents('div.item').hide(); } }); Basically, I want an array with index of each of elements which have been filtered so I can reuse them for other purpose. I was thinking of editing filter function to something like: $('total').filter(function(index) { var matches = ( ($("#price").slider("values", 0)) <= $(this).text() <= ($("#price").slider("values", 1))); return matches; }.myFunction(matches){ //do some stuff here with matched elements } This is not correct, your help is greatly appreciated.

    Read the article

  • Express highest floating point quantity that is less than 1

    - by edA-qa mort-ora-y
    I was doing some rounding calculations and happened upon a question. How can I express the highest quantity less than 1 for a given floating point type? That is, how I write/represent value x such that x < 1, x + y >= 1 for any y > 0. In fractions this would be x = (q-1)/q where q is the precision of the type. For example, if you are counting in 1/999 increments then x = 998/999. For a given type (float, double, long double), how could one express the value x in code? I also wonder if such a value actually exists for all values of y. That is, as y's exponent gets smaller perhaps the relation doesn't hold anymore. So an answer with some range restriction on y is also acceptable. (The value of x I want still does exist, the relationship may just not properly express it.)

    Read the article

  • data type mismatch when comparing dates in MS-Access

    - by jonos
    I have dates stored in an MS-Access table in the 'General Date' format. I'm trying to create a query that returns records between a specific date range (all records from March 2010) however I encounter a 'data type mismatch in critera expression' message. Here is my statement; SELECT Loan.loan_datetimeLeant, product_name, [product_artist/director], product_category, loanItem_cost FROM Loan INNER JOIN ((Product INNER JOIN Item ON Product.[product_id] = Item.[product_id]) INNER JOIN Loan_Items ON Item.[item_id] = Loan_Items.[item_id]) ON (Loan.[cust_id] = Loan_Items.[cust_id]) AND (Loan.[loan_datetimeLeant] = Loan_Items.[loan_datetimeLeant]) WHERE Loan.loan_datetimeLeant = '01/03/2010' AND Loan.loan_datetimeLeant <= '31/03/2010' ORDER BY Loan.loan_datetimeLeant ; I have tried variations on the date format (mm/dd/yyyy, dd/mm/yyyy 00:00:00)

    Read the article

  • Excel VBA pass array of arrays to a function

    - by user429400
    I have one function that creates an array of arrays, and one function that should get the resulting array and write it to the spreadsheet. I don't find the syntax which will allow me to pass the array of arrays to the second function... Could you please help? Here is my code: The function that creates the array of arrays: Function GetCellDetails(dict1 As Dictionary, dict2 As Dictionary) As Variant Dim arr1, arr2 arr1 = dict1.Items arr2 = dict2.Items GetCellDetails = Array(arr1, arr2) End Function the function that writes it to the spreadsheet: Sub WriteCellDataToMemory(arr As Variant, day As Integer, cellId As Integer, nCells As Integer) row = CellIdToMemRow(cellId, nCells) col = DayToMemCol(day) arrSize = UBound(arr, 2) Range(Cells(row, col), Cells(row + arrSize , col + 2)) = Application.Transpose(arr) End Sub The code that calls the functions: Dim CellDetails CellDetails = GetCellDetails(dict1, dict2) WriteCellDataToMemory CellDetails, day, cellId, nCells Thanks, Li

    Read the article

  • getting the heading of a selected text in word

    - by Thunder
    Hi, I am working With Microsoft Word VBA,macros. My question : Is there way to get sub-topic and master-topic that precedes a selected body text ? Here is an example: Master topic (level 1) sub-topic 1 (level 2) body text a body text b body text c sub-topic 2 (level 2) body text d body text e Other MISC topics (level 2) body text f body text g body text h Here if 'bodytext e' is selected I would like to run a macro and get the result as 'Master topic:sub-topic 1' I have tried with range,parent ,Scope.Information(wdActiveEndSectionNumber) etc but nothing seem to work!!! Thanks in Advance

    Read the article

  • pipelined function

    - by user289429
    Can someone provide an example of how to use parallel table function in oracle pl/sql. We need to run massive queries for 15 years and combine the result. SELECT * FROM Table(TableFunction(cursor(SELECT * FROM year_table))) ...is what we want effectively. The innermost select will give all the years, and the table function will take each year and run massive query and returns a collection. The problem we have is that all years are being fed to one table function itself, we would rather prefer the table function being called in parallel for each of the year. We tried all sort of partitioning by hash and range and it didn't help. Also, can we drop the keyword PIPELINED from the function declaration? because we are not performing any transformation and just need the aggregate of the resultset.

    Read the article

  • A Good Final High School AP Computer Science Programming Project?

    - by user297663
    Hey guys this question might seem very specific but I am in need of some ideas for a project to do for my last month or so in my AP Computer Science class. I've been looking at some college final ideas and a lot of them just seem plain boring. At first I thought about writing a IRC client in JAVA but I wouldn't really be learning anything "new" that would help me in the future. Then I thought about doing IPhone/touch apps (I don't have an adroid phone and I can easily get my hands on an itouch) but I would need ideas to make apps for that. I want to do something that is going to feel trivial and need some explanation but will also help me in the long run learning new concepts in computer science. If you guys could help out I would greatly appreciate it. I really only have a month to do this project so try to keep the project inside of that range. Also, I don't mind learning new languages. Thanks :)

    Read the article

  • C typedef struct uncertainty.

    - by Emanuel Ey
    Consider the following typedef struct in C: 21:typedef struct source{ 22: double ds; //ray step 23: double rx,zx; //source coords 24: double rbox1, rbox2; //the box that limits the range of the rays 25: double freqx; //source frequency 26: int64_t nThetas; //number of launching angles 27: double theta1, thetaN; //first and last launching angle 28:}source_t; I get the error: globals.h:21: error: redefinition of 'struct source' globals.h:28: error: conflicting types for 'source_t' globals.h:28: note: previous declaration of 'source_t' was here I've tried using other formats for this definition: struct source{ ... }; typedef struct source source_t; and typedef struct{ ... }source_t; Which both return the same error. Why does this happen? it looks perfectly right to me.

    Read the article

  • How to detect when UITextField become empty

    - by Jakub
    Hello, I would like to perform a certain action when UITextField becomes empty (user deletes everything one sign after another or uses the clear option). I thought about using two methods - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; and - (BOOL)textFieldShouldClear:(UITextField *)textField; from UITextFieldDelegate I'm not sure how to detect the situation when the text field becomes empty? I tried with: if ([textField.text length] == 0) but it does't work as the fisrt of the above methods is called before the sign is deleted from the text field. Any ideas?

    Read the article

  • Calculating holidays

    - by Ralph Shillington
    A number of holidays move around from year to year. For example, in Canada Victoria day (aka the May two-four weekend) is the Monday before May 25th, or Thanksgiving is the 2nd Monday of October (in Canada). I've been using variations on this Linq query to get the date of a holiday for a given year: var year = 2011; var month = 10; var dow = DayOfWeek.Monday; var instance = 2; var day = (from d in Enumerable.Range(1,DateTime.DaysInMonth(year,month)) let sample = new DateTime(year,month,d) where sample.DayOfWeek == dow select sample).Skip(instance-1).Take(1); While this works, and is easy enough to understand, I can imagine there is a more elegant way of making this calculation versus this brute force approach. Of course this doesn't touch on holidays such as Easter and the many other lunar based dates.

    Read the article

  • Python or matplotlib limitation error

    - by Werner
    Hi, I wrote an algorithm using python and matplotlib that generates histograms from some text input data. When the number of data input is approx. greater than 15000, I get in the (append) line of my code: mydata = [] for i in range(len(data)): mydata.append(string.atof(data[i])) the error: Traceback (most recent call last): File "get_histogram_picture.py", line 25, in <module> mydata.append(string.atof(data[i])) File "/usr/lib/python2.6/string.py", line 388, in atof return _float(s) ValueError: invalid literal for float(): -a can it be an error in python ? What is the solution ? Thanks

    Read the article

  • python multiprocess update dictionary synchronously

    - by user1050325
    I am trying to update one common dictionary through multiple processes. Could you please help me find out what is the problem with this code? I get the following output: inside function {1: 1, 2: -1} comes here inside function {1: 0, 2: 2} comes here {1: 0, 2: -1} Thanks. from multiprocessing import Lock, Process, Manager l= Lock() def computeCopyNum(test,val): l.acquire() test[val]=val print "inside function" print test l.release() return a=dict({1: 0, 2: -1}) procs=list() for i in range(1,3): p = Process(target=computeCopyNum, args=(a,i)) procs.append(p) p.start() for p in procs: p.join() print "comes here" print a

    Read the article

  • Python problem with resize animate GIF

    - by gigimon
    Hello! I'm want to resize animated GIF with save animate. I'm try use PIL and PythonMagickWand (ImageMagick) and with some GIF's get bad frame. When I'm use PIL, it mar frame in read frame. For test, I'm use this code: from PIL import Image im = Image.open('d:/box_opens_closes.gif') im.seek(im.tell()+1) im.seek(im.tell()+1) im.seek(im.tell()+1) im.show() When I'm use MagickWand with this code: wand = NewMagickWand() MagickReadImage(wand, 'd:/Box_opens_closes.gif') MagickSetLastIterator(wand) length = MagickGetIteratorIndex(wand) MagickSetFirstIterator(wand) for i in range(0, length+1): MagickSetIteratorIndex(wand,i) MagickScaleImage(wand, 87, 58) MagickWriteImages(wand, 'path', 1) My GIF where I'm get bad frame this: test gif In GIF editor software, all freme is ok. Where problem? Thx

    Read the article

  • How to index a date column with null values?

    - by Heinz Z.
    How should I index a date column when some rows has null values? We have to select rows between a date range and rows with null dates. We use Oracle 9.2 and higher. Options I found Using a bitmap index on the date column Using an index on date column and an index on a state field which value is 1 when the date is null Using an index on date column and an other granted not null column My thoughts to the options are: to 1: the table have to many different values to use an bitmap index to 2: I have to add an field only for this purpose and to change the query when I want to retrieve the null date rows to 3: locks tricky to add an field to an index which is not really needed What is the best practice for this case? Thanks in advance Some infos I have read: Oracle Date Index When does Oracle index null column values?

    Read the article

  • Does the number of busy worker threads in the CLR ThreadPool affect performance of I/O threads?

    - by andrej351
    We have a Windows Service which hosts a number of WCF services and, in an unrelated part of the app, makes extensive use of the TPL Task class to asynchronously do relatively short bits of work. It is my understanding that WCF uses managed I/O threads from the ThreadPool to execute requests. I noticed that after deploying a feature which significantly raised the applications use of Tasks, and as such the use of ThreadPool worker threads as well, performance of a couple of web services has become very slow. We're talking minutes instead of less than a second. The number of Tasks actually trying to run at any one time can range between 20 and 1000, which makes me think that any new (last in) work needing some CPU time could be forced to wait for quite some time. Does the (in my case extremely large) number of busy ThreadPool worker threads affect the ThreadPool's managed I/O threads? Or could these two be connected in any way? Thanks!

    Read the article

  • Images to video - converting to IplImage makes video blue

    - by user891908
    I want to create a video from images using opencv. The strange problem is that if i will write image (bmp) to disk and then load (cv.LoadImage) it it renders fine, but when i try to load image from StringIO and convert it to IplImage, it turns video to blue. Heres the code: import StringIO output = StringIO.StringIO() FOREGROUND = (0, 0, 0) TEXT = 'MY TEXT' font_path = 'arial.ttf' font = ImageFont.truetype(font_path, 18, encoding='unic') text = TEXT.decode('utf-8') (width, height) = font.getsize(text) # Create with background with place for text w,h=(600,600) contentimage=Image.open('0.jpg') background=Image.open('background.bmp') x, y = contentimage.size # put content onto background background.paste(contentimage,(((w-x)/2),0)) draw = ImageDraw.Draw(background) draw.text((0,0), text, font=font, fill=FOREGROUND) pi = background pi.save(output, "bmp") #pi.show() #shows image in full color output.seek(0) pi= Image.open(output) print pi, pi.format, "%dx%d" % pi.size, pi.mode cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 3) cv.SetData(cv_im, pi.tostring()) print pi.size, cv.GetSize(cv_im) w = cv.CreateVideoWriter("2.avi", cv.CV_FOURCC('M','J','P','G'), 1,(cv.GetSize(cv_im)[0],cv.GetSize(cv_im)[1]), is_color=1) for i in range(1,5): cv.WriteFrame(w, cv_im) del w

    Read the article

  • Typical text encoding and EOL behavior on mobile devices

    - by Dan W
    Typical things to worry about when dealing with text are the BOM/signature, encoding, and the end of line (EOL) char/chars. I know that Windows often favours \r\n (CR+LF) and Mac/Linux favours \n (LF), but how about popular mobile devices such as the iPhone and Android? Do typical apps on those platforms favour one or the other (or maybe even \r for iOS)? I'll supply both types to the user just in case, but I'd like to choose one as default. Also, which text encodings are mobiles most likely to use - UTF-8, iso-8859-1, Windows 1252 (or other default codepage) or maybe even UTF-16? And if they use UTF-8/16, are they likely to need (or require not having) a BOM/signature? What is the typical behavior here? Once again, I'll supply a range of encodings to the user just in case, but I'd like to prioritize or use certain encodings as default if it's appropriate.

    Read the article

  • Bash Nested Loops, mixture of dates and numbers

    - by Saleh
    Hi, I am trying to output a range of commands with different dates and numbers associated. for each hour eg. Output im trying to do in a loop is: shell.sh filename<number e.g. between 1-24> <date e.g. 20100928> <number e.g. between 1-24> <id> So basically the the above will generate an output done 24 times for each particular day with a unique 4 digit id. I was thinking of having a nested loop, as the batch number needs to be unique. can anyone help?

    Read the article

< Previous Page | 127 128 129 130 131 132 133 134 135 136 137 138  | Next Page >