Search Results

Search found 29841 results on 1194 pages for 'random number generator'.

Page 36/1194 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • jQuery compatible JavaScript documentation generator

    - by clyfe
    I need to choose a documentation generator (similar to jdoc in java or rdoc in ruby) for my javascript project that (built with jquery, underscore and backbone) Candidates: jsdoc toolkit pdoc natural docs docco YUI doc doctool http://jquery.bassistance.de/docTool/docTool.html other ? Requirements should work with jquery, underscore and backbone. that means object-literal methods etc I really like pdoc but its too centered around prototype, poorly documented, and I don't want to make extra files (sections?) to make it work (not sure about this) docco is nice but I want structured output (as in menu + class/func structure like jdoc) must be command line/makefile compatible (not web pastie) Tips, tricks, tutorials, success stories, advice greatly welcomed. Why Doesn't jQuery use JSDoc?

    Read the article

  • Generator speed in python 3

    - by Will
    Hello all, I am going through a link about generators that someone posted. In the beginning he compares the two functions below. On his setup he showed a speed increase of 5% with the generator. I'm running windows XP, python 3.1.1, and cannot seem to duplicate the results. I keep showing the "old way"(logs1) as being slightly faster when tested with the provided logs and up to 1GB of duplicated data. Can someone help me understand whats happening differently? Thanks! def logs1(): wwwlog = open("big-access-log") total = 0 for line in wwwlog: bytestr = line.rsplit(None,1)[1] if bytestr != '-': total += int(bytestr) return total def logs2(): wwwlog = open("big-access-log") bytecolumn = (line.rsplit(None,1)[1] for line in wwwlog) getbytes = (int(x) for x in bytecolumn if x != '-') return sum(getbytes)

    Read the article

  • [Symfony] Admin generator and i18n

    - by David
    I have read lots of questions about i18n, but I haven't found any about performance. I have a simple backend app listing the contents of an ads table. These ads have a category, that is translated in some languages (it's defined as i18n in the Doctrine schema). So, when I add a "table_method" in my generator.yml to include de Category table, it reduces the number of queries, but there are yet some of them referencing i18n translation tables. So, if I add the category Translation table to the query, it reduces even more the queries BUT it increases the processing time considerably. Why this time penalty? Just because of the translation table? And why isn't the filter using this method to avoid so many translation queries as well? I mean, if I want to filter by category, it is making one query per category to include the translation table. Why??

    Read the article

  • how do i round/trucate a number without using methods like math.round or %3f?

    - by user2923875
    So far I need to round a number that I inputted and get it to 3 decimal places without those methods. if(number !=(int)number){ number*=1000; number=(int)number; number=(double)number; number/=1000; System.out.println("-"+ number); } if(number ==(int)number){ System.out.println("-"+ number + "00"); } With that above, it will work for any input except the ones with 2 decimal places, like 12.34 . How do I make it work if i type 12.34 and displays 12.340?

    Read the article

  • Show random string.

    - by zaid
    i am trying to display a random string each time a button is pressed from a set of strings defined in strings.xml . this is an example of the strings ID's <string name="q0"> <string name="q1"> <string name="q2"> <string name="q3"> <string name="q4"> java code for getting a random string. private static final Random rgenerator = null; int RandomQ = R.string.q0 (rgenerator.nextInt(5) + 1); String q = getString(RandomQ); if i try to use this java code i get an error at "q0" in R.string.q0 which is The method q0(int) is undefined for the type R.string if i try to use the quick fix and create a method, it works. but it wont let me save or run the app because it replaces my create method and shows this message R.java was modified manually! Reverting to generated version! thanks for reading.

    Read the article

  • Gathering entropy in web apps to create (more) secure random numbers

    - by H M
    after several days of research and discussion i came up with this method to gather entropy from visitors (u can see the history of my research here) when a user visits i run this code: $entropy=sha1(microtime().$pepper.$_SERVER['REMOTE_ADDR'].$_SERVER['REMOTE_PORT']. $_SERVER['HTTP_USER_AGENT'].serialize($_POST).serialize($_GET).serialize($_COOKIE)); note: pepper is a per site/setup random string set by hand. then i execute the following (My)SQL query: $query="update `crypto` set `value`=sha1(concat(`value`, '$entropy')) where name='entropy'"; that means we combine the entropy of the visitor's request with the others' gathered already. that's all. then when we want to generate random numbers we combine the gathered entropy with the output: $query="select `value` from `crypto` where `name`='entropy'"; //... extract(unpack('Nrandom', pack('H*', sha1(mt_rand(0, 0x7FFFFFFF).$entropy.microtime())))); note: the last line is a part of a modified version of the crypt_rand function of the phpseclib. please tell me your opinion about the scheme and other ideas/info regarding entropy gathering/random number generation. ps: i know about randomness sources like /dev/urandom. this system is just an auxiliary system or (when we don't have (access to) these sources) a fallback scheme.

    Read the article

  • R Random Data Sets within loops

    - by jugossery
    Here is what I want to do: I have a time series data frame with let us say 100 time-series of length 600 - each in one column of the data frame. I want to pick up 4 of the time-series randomly and then assign them random weights that sum up to one (ie 0.1, 0.5, 0.3, 0.1). Using those I want to compute the mean of the sum of the 4 weighted time series variables (e.g. convex combination). I want to do this let us say 100k times and store each result in the form ts1.name, ts2.name, ts3.name, ts4.name, weight1, weight2, weight3, weight4, mean so that I get a 9*100k df. I tried some things already but R is very bad with loops and I know vector oriented solutions are better because of R design. Thanks Here is what I did and I know it is horrible The df is in the form v1,v2,v2.....v100 1,5,6,.......9 2,4,6,.......10 3,5,8,.......6 2,2,8,.......2 etc e=NULL for (x in 1:100000) { s=sample(1:100,4)#pick 4 variables randomly a=sample(seq(0,1,0.01),1) b=sample(seq(0,1-a,0.01),1) c=sample(seq(0,(1-a-b),0.01),1) d=1-a-b-c e=c(a,b,c,d)#4 random weights average=mean(timeseries.df[,s]%*%t(e)) e=rbind(e,s,average)#in the end i get the 9*100k df } The procedure runs way to slow. EDIT: Thanks for the help i had,i am not used to think R and i am not very used to translate every problem into a matrix algebra equation which is what you need in R. Then the problem becomes a little bit complex if i want to calculate the standard deviation. i need the covariance matrix and i am not sure i can if/how i can pick random elements for each sample from the original timeseries.df covariance matrix then compute the sample variance (t(sampleweights)%*%sample_cov.mat%*%sampleweights) to get in the end the ts.weighted_standard_dev matrix Last question what is the best way to proceed if i want to bootstrap the original df x times and then apply the same computations to test the robustness of my datas thanks

    Read the article

  • Objective C : UIButton image with NSArray in a random order

    - by Sarah
    Brief Idea about the flow : I have say minimum 1 and maximum 18 records in my database with a text and an image from which I have to fetch images and place any 3 of the same randomly to 3 UIButtons among which one image should match with my question. i.e. 1 is the answer and other 2 are the distractors. For Example : Question is : where is Apple? Now among the bunch of images, I want to place any 3 images on the 3 UIButtons(1 answer i.e. An Apple and 2 distractors) in a random order and on selecting the UIButton it should prompt me if it's a right answer or not. I am implementing below code for placing the UIImages in a random order : -(void) placeImages { NSMutableArray *images = [NSMutableArray arrayWithArray:arrImg]; NSArray *buttons = [NSArray arrayWithObjects:btn1,btn2,btn3, nil]; for (UIButton *btn in buttons) { int randomIndex= random() % images.count; UIImage *img = [images objectAtIndex:randomIndex]; [btn setImage:img forState:UIControlStateNormal]; [images removeObjectAtIndex:randomIndex]; } } But I am stuck at a point that how should I get 1 UIButton image with an answer and other as distractors also that how should i maintain the index of the image from the NSArray? Kindly guide me. Thank you.

    Read the article

  • Are random packets normal?

    - by TheLQ
    About a month ago on one of my servers I started receiving random packets from IPs all over the world. So I did the smart thing and stopped putting off installing an IDS. This IDS is a ClearOS Gateway which comes with Snort and SnortSam. I enabled it, checked There is a total of 4 ports open, two of which forward to the server I'm talking about. These ports are 3724 and 8085, so they aren't going to be easily detected in a port scan. However checking some logs of this server I found that the attack is resuming. I found this ... Accepting connection from '75.166.155.122' [Auth] got unknown packet from '75.166.155.122' Accepting connection from '98.164.154.93' [Auth] got unknown packet from '98.164.154.93' Ping MySQL to keep connection alive Accepting connection from '70.241.195.129' [Auth] got unknown packet from '70.241.195.129' Accepting connection from '67.182.229.169' [Auth] got unknown packet from '67.182.229.169' Accepting connection from '69.137.140.38' [Auth] got unknown packet from '69.137.140.38' Accepting connection from '76.31.72.55' [Auth] got unknown packet from '76.31.72.55' Accepting connection from '97.88.139.39' [Auth] got unknown packet from '97.88.139.39' Accepting connection from '173.35.62.112' [Auth] got unknown packet from '173.35.62.112' Accepting connection from '187.15.10.73' [Auth] got unknown packet from '187.15.10.73' Accepting connection from '66.66.94.124' [Auth] got unknown packet from '66.66.94.124' Accepting connection from '75.159.219.124' [Auth] got unknown packet from '75.159.219.124' Accepting connection from '99.102.100.82' [Auth] got unknown packet from '99.102.100.82' Accepting connection from '24.128.240.45' [Auth] got unknown packet from '24.128.240.45' Accepting connection from '99.231.7.39' [Auth] got unknown packet from '99.231.7.39' Accepting connection from '206.255.79.56' [Auth] got unknown packet from '206.255.79.56' Accepting connection from '68.97.106.235' [Auth] got unknown packet from '68.97.106.235' Accepting connection from '69.134.67.251' [Auth] got unknown packet from '69.134.67.251' Accepting connection from '63.228.138.186' [Auth] got unknown packet from '63.228.138.186' Accepting connection from '184.39.146.193' [Auth] got unknown packet from '184.39.146.193' Accepting connection from '69.171.161.102' [Auth] got unknown packet from '69.171.161.102' Accepting connection from '76.0.47.228' [Auth] got unknown packet from '76.0.47.228' Ping MySQL to keep connection alive Accepting connection from '126.112.201.14' [Auth] got unknown packet from '126.112.201.14' Ping MySQL to keep connection alive Now that scares me. Why isn't Snort detecting this? How were they able to find this specific port? More importantly, what normally would these packets contain? Is this something I should be worried about? How can I stop this?

    Read the article

  • How to store data on a machine whose power gets cut at random

    - by Sevas
    I have a virtual machine (Debian) running on a physical machine host. The virtual machine acts as a buffer for data that it frequently receives over the local network (the period for this data is 0.5s, so a fairly high throughput). Any data received is stored on the virtual machine and repeatedly forwarded to an external server over UDP. Once the external server acknowledges (over UDP) that it has received a data packet, the original data is deleted from the virtual machine and not sent to the external server again. The internet connection that connects the VM and the external server is unreliable, meaning it could be down for days at a time. The physical machine that hosts the VM gets its power cut several times per day at random. There is no way to tell when this is about to happen and it is not possible to add a UPS, a battery, or a similar solution to the system. Originally, the data was stored on a file-based HSQLDB database on the virtual machine. However, the frequent power cuts eventually cause the database script file to become corrupted (not at the file system level, i.e. it is readable, but HSQLDB can't make sense of it), which leads to my question: How should data be stored in an environment where power cuts can and do happen frequently? One option I can think of is using flat files, saving each packet of data as a file on the file system. This way if a file is corrupted due to loss of power, it can be ignored and the rest of the data remains intact. This poses a few issues however, mainly related to the amount of data likely being stored on the virtual machine. At 0.5s between each piece of data, 1,728,000 files will be generated in 10 days. This at least means using a file system with an increased number of inodes to store this data (the current file system setup ran out of inodes at ~250,000 messages and 30% disk space used). Also, it is hard (not impossible) to manage. Are there any other options? Are there database engines that run on Debian that would not get corrupted by power cuts? Also, what file system should be used for this? ext3 is what is used at the moment. The software that runs on the virtual machine is written using Java 6, so hopefully the solution would not be incompatible.

    Read the article

  • Need help in filtering the data with various condition and filling in scroll window GP

    - by Rahul
    Hi all, I am filtering the data and displaying in scroll window. There are many combination to display this data by customer id, customer id and itemnumber, customer id, itemnumber, work and history condition. And from date and To date condition. My query is when I am selecting the customer id and work or history table it should display the corresponding data. Like select * from price history where customerid=’custid’ and name=’Work’. It should display in scroll only these values none other it the same way history condition should work. Work and History are in check box. In my case whatever range I am selecting whether Work and History always loading with entire data, so it’s not filtering properly. My second problem is if I select from date and keep empty to date …in this case all the data should display from selected from date to end of table data. But I am not getting….pls somebody help me here is my entire coding: if empty('Customer Number') then warning "Select Customer ID"; focus 'Customer Number'; abort script; end if; if '(L) RadioGroup4' of window Window1 of form 'Customer Pricing Inquiry'=1 then if empty(Date) then abort script; focus Date; end if; end if; if not empty('(L) Date') then if '(L) Date' {if not empty(Date) and empty('(L) Date') then warning"Please enter To Date"; focus field '(L) Date'; abort script; end if;} range clear table Display_Pricing_Temp; clear field 'Customer Number' of table Display_Pricing_Temp; range start table Display_Pricing_Temp; fill field 'Customer Number' of table Display_Pricing_Temp; range end table Display_Pricing_Temp; remove range table Display_Pricing_Temp; range clear table Display_Pricing; if '(L) Checkbox0' =true and '(L) Checkbox2'=true and empty('Item Code' of window Window1 of form 'Customer Pricing Inquiry') and str(Date of window Window1 of form 'Customer Pricing Inquiry')="0/0/0000" then {range clear table Display_Pricing;} range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='History' or "+ physicalname(Name of table Display_Pricing)+ "='Work')"; {range clear table Display_Pricing;} end if; if '(L) Checkbox0' =true or '(L) Checkbox2'=true then {{Only Item No is there} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=false and str('(L) Date')="0/0/0000" then range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"'"; end if; } if empty('(L) Date') and not empty(Date) then {date work hist item} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date work hist } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date,work,item code} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date history item code} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; {date,work} if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and not empty(Date) then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) "; range clear table Display_Pricing; end if; {date history } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102)" ; range clear table Display_Pricing; end if; end if; if not empty('(L) Date') and not empty(Date) then {Only Item No is there and work} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work'"; range clear table Display_Pricing; end if; if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')"; range clear table Display_Pricing; end if; {date work hist item} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date work hist } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and ("+ physicalname(Name of table Display_Pricing)+ "='Work' or " +physicalname(Name of table Display_Pricing)+ "='History')and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date,work,item code} if not empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date history item code} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date work} {date,work} if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and not empty(Date) then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; {date history } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)<"0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History' and convert(datetime,convert(varchar(20)," +physicalname(Date of table Display_Pricing)+"),102) between convert(datetime,convert(varchar(20),'"+ str(Date of window Window1 of form 'Customer Pricing Inquiry')+ "'),102) and convert(datetime,convert(varchar(20),'"+ str('(L) Date' of window Window1 of form 'Customer Pricing Inquiry') +"'),102)"; range clear table Display_Pricing; end if; end if; {Only Item No is there and hist} if not empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname('Item Number' of table Display_Pricing)+ "='"+ str('Item Code')+"' and "+ physicalname(Name of table Display_Pricing)+ "='History'"; range clear table Display_Pricing; end if; {for only work table } if empty('Item Code') and '(L) Checkbox0' =true and '(L) Checkbox2'=false and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='Work'"; range clear table Display_Pricing; end if; {for only hist table } if empty('Item Code') and '(L) Checkbox0' =false and '(L) Checkbox2'=true and str(Date)="0/0/0000" then range clear table Display_Pricing; range table Display_Pricing where physicalname('Customer Number' of table Display_Pricing) + "= '" + str('Customer Number' of window Window1) + "' and "+ physicalname(Name of table Display_Pricing)+ "='History'"; range clear table Display_Pricing; end if; get first table Display_Pricing; if err() = OKAY then repeat copy from table Display_Pricing to table Display_Pricing_Temp; save table Display_Pricing_Temp; get next table Display_Pricing; until err() = EOF; else clear window Price_Scroll of form 'Customer Pricing Inquiry'; end if; else clear window Price_Scroll of form 'Customer Pricing Inquiry'; end if; fill window Price_Scroll table Display_Pricing_Temp by number 1;

    Read the article

  • Configuring trace file size and number in WebCenter Content 11g

    - by Kyle Hatlestad
    Lately I've been doing a lot of debugging using the System Output tracing in WebCenter Content 11g.  This is built-in tracing in the content server which provides a great level of detail on what's happening under the hood.  You can access the settings as well as a view of the tracing by going to Administration -> System Audit Information.  From here, you can select the tracing sections to include.  Some of my personal favorites are searchquery,  systemdatabase, userstorage, and indexer.  Usually I'm trying to find out some information regarding a search, database query, or user information.  Besides debugging, it's also very helpful for performance tuning. One of the nice tricks with the tracing is it honors the wildcard (*) character.  So you can put in 'schema*' and gather all of the schema related tracing.  And you can notice if you select 'all' and update, it changes to just a *.   To view the tracing in real-time, you simply go to the 'View Server Output' page and the latest tracing information will be at the bottom. This works well if you're looking at something pretty discrete and the system isn't getting much activity.  But if you've got a lot of tracing going on, it would be better to go after the trace log file itself.  By default, the log files can be found in the <content server instance directory>/data/trace directory. You'll see it named 'idccs_<managed server name>_current.log.  You may also find previous trace logs that have rolled over.  In this case they will identified by a date/time stamp in the name.  By default, the server will rotate the logs after they reach 1MB in size.  And it will keep the most recent 10 logs before they roll off and get deleted.  If your server is in a cluster, then the trace file should be configured to be local to the node per the recommended configuration settings. If you're doing some extensive tracing and need to capture all of the information, there are a couple of configuration flags you can set to control the logs. #Change log size to 10MB and number of logs to 20FileSizeLimit=10485760FileCountLimit=20 This is set by going to Admin Server -> General Configuration and entering them in the Additional Configuration Variables: section.  Restart the server and it should take on the new logging settings. 

    Read the article

  • Ubuntu server random hangups.

    - by Ebbe
    Hello all. this is my first post to this forum which I found through the superb podcast "It Conversations" from StackOverFlow. I am quite in my role as server administrator for an exhibition center in London. Basically we have a central file and sql server to which roughly 40 stations connects to to upload/download data used/captured by a set of applications. Over the last weeks we have experienced a few random hangups to our applications, and as it always happen to multiple applications simultaneously I do not believe that the applications are the source of the problem. We also monitor the network using Dartware Intermapper which indicates that all switches and stations on the network has been reachable during the downtime. Thus, its all pointing to the server. I have been looking through all log files I can think of and the only thing so far that I have found suspicious is the following lines in the syslog which are from the time of one of the hangups: Feb 6 17:14:27 es named[5582]: client 127.0.0.1#33721: RFC 1918 response from Internet for 150.0.168.192.in-addr.arpa Feb 6 17:14:40 es named[5582]: client 127.0.0.1#32899: RFC 1918 response from Internet for 152.0.168.192.in-addr.arpa Feb 6 17:15:01 es /USR/SBIN/CRON[1956]: (es) CMD (/home/es/apps/es/bin/es_checksum.sh) Feb 6 17:16:06 es /USR/SBIN/CRON[2031]: (es) CMD (/home/es/apps/es/bin/es_checksum.sh) Feb 6 17:21:00 es named[5582]: *** POKED TIMER *** Feb 6 17:21:00 es last message repeated 2 times Feb 6 17:21:07 es named[5582]: client 127.0.0.1#44194: RFC 1918 response from Internet for 143.0.168.192.in-addr.arpa Feb 6 17:21:12 es named[5582]: client 127.0.0.1#59004: RFC 1918 response from Internet for 164.0.168.192.in-addr.arpa I find a few lines of interesting lines here: 1) "RFC 1918 response from Internet for 150.1.168.192.in-addr.arpa". I see this a lot in the syslog. And basically everytime I do a nslookup for any of the computers in the cluster I get a new similar line in the syslog. I understand from google that this has to do with reverse lookup problems. But I do not know how that could effect the systems. Lets say that one of these lines appear every time one of the userstations connects to the server, which may happen several times a second. Could this possible cause a hangup of the entire server? 2) POKED TIMER, I have googled this quite a lot, but not found an explaination that I can relate to. What does this mean? 3) The timestamps, it seems like the entire server has stopped responding for several minutes. Normally there are many printouts to the syslog per minute on this server. Furthermore the CRON job is set to run once every minute. Which according to the log, hasent happened here. OS: Ubuntu 8.04 Kernel: Linux 2.6.24-24-server x86_64 GNU/Linux. Hardware: Dell R710, RAID1, CPU: 2x XEON E5530. 16GB Memory. Average load is very low, and memory should not be a problem. Please let me know if you need any additional information. Best wishes, Ebbe

    Read the article

  • number->string and related procedures in GIMP scheme scripting

    - by dim fish
    I am frustrated with string-to-number and number-to-string conversion in GIMP scripting. I am runnning GIMP 2.6.8 in Windows Vista. I understand that GIMP's internal Scheme implementation changes over the versions and I can't seem to nail down the documentation. From what I can gather GIMP's Scheme is a subset of TinyScheme and/or supports the R5RS standard procedures. In any case, I usually just look in the packaged script directory for examples when I want to try something new, because that should work for sure, right? For example, grid-system.scm comes with the latest GIMP release and has the expression, (string-append (number->string obj) " ") which is exactly what I want. However, if I use number-string in my own script, or even type it into GIMP's script console (which is how I usually test out new stuff I want to do) it tells me number-string is an unbound variable: > (number->string 3) Error: eval: unbound variable: number->string Other standard procedures from, say R5RS, work just fine: > (string-append "frust" "rated") "frustrated" So, 1) Is there some lurking documentation for current GIMP Scheme scripting other than something drastic like searching GIMP's source code? 2) Can I use the GIMP console to spit out a list of all defined procedures to find something I need? 3) Anyone else confirm that number-string is not defined for the current Windows build, even though it appears in the packaged scripts? My web searches haven't turned up any related problems, and a complete uninstall of all GIMP versions, back to latest puts me in the same scrape.

    Read the article

  • Excel: count number of unique/distinct row in range with condition

    - by Bertvan
    I have a an excel sheet with: in Col A: week numbers in Col B: dates (timesheet entries) I need to know the number of days worked for each week, so I need to the number of unique date entries per week number. I found formula's (both array as non-array) that handle this for a fixed range, but I want to have the results in another column per week number. So, the result of the added dataset below would be (the colon is just for clarity): 14: 2 15: 3 17: 6 20: 2 21: 3 If this is the source data: 14: 4/04/2012 14: 4/04/2012 15: 10/04/2012 15: 10/04/2012 15: 11/04/2012 17: 26/04/2012 17: 26/04/2012 17: 26/04/2012 17: 26/04/2012 17: 27/04/2012 17: 27/04/2012 20: 14/05/2012 20: 14/05/2012 21: 23/05/2012 21: 23/05/2012 21: 25/05/2012

    Read the article

  • How to define and use Python generators appropriately

    - by Morlock
    I want to define a generator from a list that will output the elements one at a time, then use this generator object in an appropriate manner. a = ["Hello", "world", "!"] b = (x for x in a) c = next(b, None) while c != None: print c, c = next(b, None) Is there anything wrong or improvable with the while approach here? Is there a way to avoid having to assign 'c' before the loop? Thanks!

    Read the article

  • Nicely representing a floating-point number in python

    - by dln385
    I want to represent a floating-point number as a string rounded to some number of significant digits, and never using the exponential format. Essentially, I want to display any floating-point number and make sure it “looks nice”. There are several parts to this problem: I need to be able to specify the number of significant digits. The number of significant digits needs to be variable, which can't be done with with the string formatting operator. I need it to be rounded the way a person would expect, not something like 1.999999999999 I've figured out one way of doing this, though it looks like a work-round and it's not quite perfect. (The maximum precision is 15 significant digits.) >>> def f(number, sigfig): return ("%.15f" % (round(number, int(-1 * floor(log10(number)) + (sigfig - 1))))).rstrip("0").rstrip(".") >>> print f(0.1, 1) 0.1 >>> print f(0.0000000000368568, 2) 0.000000000037 >>> print f(756867, 3) 757000 Is there a better way to do this? Why doesn't Python have a built-in function for this?

    Read the article

  • Best way to store list of numbers and to retrieve them

    - by bingoNumbers
    Hi. What is the best way to store a list of random numbers (like lotto/bingo numbers) and retrieve them? I'd like to store on a Database a number of rows, where each row contains 5-10 numbers ranging from 0 to 90. I will store a big number of those rows. What I'd like to be able is to retrieve the rows that have at least X number in common to a newly generated row. Example: [3,4,33,67,85,99] [55,56,77,89,98,99] [3,4,23,47,85,91] Those are on the DB I will generate this: [1,2,11,45,47,88] and now I want to get the rows that have at least 1 number in common with this one. The easiest (and dumbest?) way is to make 6 select and check for similar results. I thought to store numbers with a large binary string like 000000000000000000000100000000010010110000000000000000000000000 with 99 numbers where each number represent a number from 1 to 99, so if I have 1 at the 44th position, it means that I have 44 on that row. This method is probably shifting the difficult tasks to the Db but it's again not very smart. Any suggestion?

    Read the article

  • maximum number of connections Squid

    - by Isaac
    I have a Squid proxy server that controls all internet traffic for my network. I need a way to stop users from downloading big files (say 50MB) in my network. I banned some famous ports (e.g. torrent) but some downloads are possible by HTTP port. Obviously I cannot ban port 80! A simple solution is limiting maxmimum number of the simultaneous connections for each IP (e.g. 3 connections). It's possible in Squid with this config: acl ACCOUNTSDEPT 192.168.5.0/24 acl limitusercon maxconn 3 http_access deny ACCOUNTSDEPT limitusercon But this solution has really bad impact in web browsing, because any smart browser get different parts of a website by several connections simultaneously to speedup web browsing. But if we have a maximum number of connections, the browsers will fail to get some parts and the website will be shown partially and some parts/images/frames will not be shown. So, can we limit maximum number of persist connections? I think this policy will works: Specify Maximum number of connections that is alive for 10 seconds But Number of simultaneous connections for every IP is unlimited But how can we implement this policy when Squid? With which config? UPDATE: artifex and Tom Newton offered using a bandwidth-limiting approach to fight against downloaders. But bandwidth-limiting in Squid has a shortcoming: It's static and cannot dynamically change. So a person has a limited bandwidth not matter how many people are using internet (maybe nobody!) Also, this solution cannot help to stop people from downloading. They still can download but in a lower speed. But if we find a way to terminate persist connections (or any connection that is alive more than a specific time), downloading big files will be almost impossible (always there is some way!)

    Read the article

  • iPhone SpeakHere example produces different number of samples

    - by pion
    I am looking at the SpeakHere example and added the following: // Overriding the output audio route UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride); assert(status == noErr); // Changing the default output route. The new output route remains in effect unless you change the audio session category. This option is available starting in iPhone OS 3.1. UInt32 doChangeDefaultRoute = 1; status = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &doChangeDefaultRoute); assert(status == noErr); // Enable Bluetooth. See audioRouteOverride & doChangeDefaultRoute above // http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW2 UInt32 allowBluetoothInput = 1; status = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof(allowBluetoothInput), &allowBluetoothInput); assert(status == noErr); Also, void AQRecorder::handleInputBufferCallback(void *aqData, ... ... if (inNumPackets > 0) { NSLog(@"Number of samples = %d", inBuffer->mAudioDataByteSize/2); // print out the number of sample status = AudioFileWritePackets(aqr->mAudioFile, FALSE, inBuffer->mAudioDataByteSize, inPacketDesc, aqr->mCurrentPacket, &inNumPackets, inBuffer->mAudioData); assert(status == noErr); aqr->mCurrentPacket += inNumPackets; } ... Notice the "NSLog(@"Number of samples = %d", inBuffer-mAudioDataByteSize/2); // print out the number of sample" statement above. I am using iPhone SDK 3.1.3. I got the following results The number of samples is around 44,100 on Simulator The number of samples is around 22,000 on iPhone The number of samples is around 4,000 on iPhone using Jawbone Bluetooth I am new on this. Why did itproduce different number of samples? Thanks in advance for your help.

    Read the article

  • latex page number position

    - by anton
    I am working on a long document in latex with documentclass book. I need the page number to always be in the upper right corner of each page, even if that page is the first page of a chapter (right now on 1st pages of chatpers, the page number is bottom-centered, on all other pages it's top-right). I control the position of the page number with fancyheader: \usepackage{fancyhdr} \pagestyle{fancy} \lhead{} \chead{} \rhead{\thepage} \lfoot{} \cfoot{} \rfoot{} \renewcommand{\headrulewidth}{0pt} Also, I don;t know if the problem is realted but my chapters do not start from the top of the page. There is a white area, then comes chapter X, then a newline with the chapter line. What I also want is the chapter to start from the top of the page. The main question here is how I can get the page number to always appear in the upper right corner, I mention the thing with the chapter title position only in case that might be related. Thanks.

    Read the article

  • Gizmo5 mobile with wifi and callin number

    - by Mark
    I want to buy a Nokia 5530 and run Gizmo5 on it in order to receive and make calls. I want to get a call in number based in England and was wondering if receiving calls via the call in number on my mobile via wifi would use any of my callout credit? I ask because the Skype lite version uses your callout credit if you receive a call on it using your online number (it doesn't if you use the desktop version). Thanks!

    Read the article

  • Grammar/own-written parser?

    - by wvd
    Hello all, I'm doing some small projects which involve having different syntaxis for something, however sometimes these syntaxis are so easy that using a parser generator might be overkill. Now, when should I use a own-made parser, and when should I use a parser generator? Thanks, William van Doorn

    Read the article

  • Random “Lost connection to MySQL server at 'reading initial communication packet', system error: 0”

    - by user1606545
    Sometimes I get the error from MYSQL server: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 I cannot find the cause, since most of the time it works, but every week for some hours I get this error. I googled, but there seem to be only users which have this error permanently. But in this case, it only occurs sometimes. I checked hosts.allow and hosts.deny, but the host is allowed and not denied. Also sometimes I get the error: File './database/table.MYD' not found (Errcode: 24) It occurs very rarely. But it occurs for some hours once a week, sometimes on multiple days, but suddenly the problem disappears again. I have checked the open files limit. It's 2048 and should be absolutely enough. I also tried to increase the number of open files nevertheless, but no effect. I thought, perhaps the process does not close some tables. But this is impossible, because after a while everythings o.k. again and the process opens maximum 100 tables at once. I also checked the MySQL-runtime-environment, and there were 930 opened files. I cannot explain that. After a while it's 129. I am running a MySQL-Server on a SUSE-Linux machine. I connect to the MySQL-Server from another host by the command line tool "mysql" and by MySQL-C-connector. The MySQL-Server is version 5.0.67.

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >