Search Results

Search found 1574 results on 63 pages for 'eye of hell'.

Page 53/63 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • Custom UIView using CALayers disappears after 180º rotation or navigation controller pop

    - by Steve Madsen
    I have a created a custom UIView subclass that is exhibiting some strange behavior. It is a spinning wheel selector, and for performance reasons it is drawn entirely into two CALayer instances. The bottom layer is the wheel itself, which is rotated using setAffineTransform: according to touches. The top layer is eye candy. drawRect: is fairly simple. If the control hasn't been drawn yet (or it's been invalidated), it calls a method that creates the images and assigns them to the layer contents property. - (void) drawRect:(CGRect)rect { if (imageLayer == nil) { [self drawIntoImageLayer]; } [self updateWheelRotation]; } When the view controller using this view first appears, everything is fine. There are two instances where the view completely disappears, however: If the device is rotated a full 180°. After a view controller is popped off the navigation stack and the view becomes visible again. drawRect: is not called either time. Interestingly enough, it IS called after a 90° orientation change, and that causes the view to re-appear. How can I ensure that a custom view using CALayers is redrawn properly in these situations?

    Read the article

  • With regards to urllib AttributeError: 'module' object has no attribute 'urlopen'

    - by Matt
    import re import string import shutil import os import os.path import time import datetime import math import urllib from array import array import random filehandle = urllib.urlopen('http://www.google.com/') #open webpage s = filehandle.read() #read print s #display #what i plan to do with it once i get the first part working #results = re.findall('[<td style="font-weight:bold;" nowrap>$][0-9][0-9][0-9][.][0-9][0-9][</td></tr></tfoot></table>]',s) #earnings = '$ ' #for money in results: #earnings = earnings + money[1]+money[2]+money[3]+'.'+money[5]+money[6] #print earnings #raw_input() this is the code that i have so far. now i have looked at all the other forums that give solutions such as the name of the script, which is parse_Money.py, and i have tried doing it with urllib.request.urlopen AND i have tried running it on python 2.5, 2.6, and 2.7. If anybody has any suggestions it would be really welcome, thanks everyone!! --Matt ---EDIT--- I also tried this code and it worked, so im thinking its some kind of syntax error, so if anybody with a sharp eye can point it out, i would be very appreciative. import shutil import os import os.path import time import datetime import math import urllib from array import array import random b = 3 #find URL URL = raw_input('Type the URL you would like to read from[Example: http://www.google.com/] :') while b == 3: #get file name file1 = raw_input('Enter a file name for the downloaded code:') filepath = file1 + '.txt' if os.path.isfile(filepath): print 'File already exists' b = 3 else: print 'Filename accepted' b = 4 file_path = filepath #open file FileWrite = open(file_path, 'a') #acces URL filehandle = urllib.urlopen(URL) #display souce code for lines in filehandle.readlines(): FileWrite.write(lines) print lines print 'The above has been saved in both a text and html file' #close files filehandle.close() FileWrite.close()

    Read the article

  • AJAX vs ActiveX/Flash for browser-based game

    - by iconiK
    I have been following the usage of JavaScript for the past few years, and with the release of extremely fast scripting engines (V8, SquirrelFish Extrene, TraceMonkey, etc.) the possibilities of JavaScript have increased dramatically. However, the usage share of Internet Explorer coupled with it's total lack of support for recent standards makes me want to drop a bomb on Microsoft's HQ, as it creates a huge amount of problems for any website. The game will need to be pretty dynamic client-side, with animations and other eye-candy things, but not a full-blown game like those that run directly in the OS using DirectX or OpenGL. However, this might be a little stretch for JavaScript and will certainly feel extremely slow in Internet Explorer (given that the current IE engine can be hundreds of times slower than SFX; gotta see what IE9 will bring), would it be better to just do the whole thing in Flash? I know this means requiring the plug-in AND I have no experience whatsoever with Flash (other than browsing YouTube :P). It also means I can't just output directly from PHP, I would have to use XML or some other format to pass data to it (JSON is directly integrated in JS and PHP can deal with it easily). Another idea would be to provide an alternative interface just for IE, though I don't know how (ActiveX maybe? or with Flash, then why not just provide it to all browsers) or totally not supporting it and requiring the use of other browsers, although this is plain stupid from a business perspective. So here am I, wondering what approach to take and thus asking for your advice. How should I build the client-side? AJAX in all browsers, Flash in all browsers or a mix (AJAX for "modern" browsers and something else for the "grandpa": IE).

    Read the article

  • Synchronizing screencasting (ffmpeg) and capturing from the webcam (OpenCV)

    - by lyuba
    As from my previous questions, I am trying to build a simple eye tracker. Decided to start from a Linux version (run Ubuntu). To complete this task one should organize screencasting and webcam capturing in such way that frames from both streams exactly match each other and there is the same number of frames in each of them totally. Screencasting fsp fully depends on the camera's fsp, so each time we get the image from the webcam we can potentially grab a screen frame and stay happy. However, all the tools for the fast screencasting, like ffmpeg, for example, return the .avi file as the result and require the fsp already known to be started. From the other side, tools like Java+Robot or ImageMagick seem to require around 20ms to return the .jpg screenshot, which is pretty slow for the task. But they may be requested right after each time the webcam frame is grabbed and provide the needed synchronization. So the sub-questions are: 1. Does the USD camera's frame rate vary during a single session? 2. Are there any tools which provide fast screencasting frame by frame? 3. Is there any way to make ffmpeg push a new frame to the .avi file only when program initiates this request? For my task I may either use C++ or Java. I am, actually, an interface designer, not the driver programmer, and this task seems to be pretty low-level. I would be grateful for any suggestion and tip!

    Read the article

  • Auto complete from database using CodeIgniter (Active Record)

    - by Ralph David Abernathy
    I have a form on my website in which one is able to submit a cat. The form contains inputs such as "Name" and "Gender", but I am just trying to get the auto completion to work with the "Name" field. Here is what my jquery looks like : $(document).ready(function() { $( "#tags" ).autocomplete({ source: '/Anish/auto_cat' }); }); Here is what my model looks like: public function auto_cat($search_term) { $this->db->like('name', $search_term); $response = $this->db->get('anish_cats')->result_array(); // var_dump($response);die; return $response; } } Here is my controller: public function auto_cat(){ $search_term = $this->input->get('term'); $cats = $this->Anish_m->auto_cat($search_term); } And here is my view: <head> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css" /> </head> <h1>Anish's Page</h1> <form action="/Anish/create" method="POST"> <div class="ui-widget"> <label for="tags">Name</label><input id="tags" type="text" name="name"> </div> <div> <label>Age</label><input type="text" name="age"> </div> <div> <label>Gender</label><input type="text" name="gender"> </div> <div> <label>Species</label><input type="text" name="species"> </div> <div> <label>Eye Color</label><input type="text" name="eye_color"> </div> <div> <label>Color</label><input type="text" name="color"> </div> <div> <label>Description</label><input type="text" name="description"> </div> <div> <label>marital status</label><input type="text" name="marital_status"> </div> <br> <button type="submit" class="btn btn-block btn-primary span1">Add cat</button> </form> <br/><br/><br/><br/> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Name</th> <th>Gender</th> <th>Age</th> <th>Species</th> <th>Eye Color</th> <th>Color</th> <th>Description</th> <th>Marital Status</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php foreach ($cats as $cat):?> <tr> <td> <?php echo ($cat['name']);?><br/> </td> <td> <?php echo ($cat['gender']);?><br/> </td> <td> <?php echo ($cat['age']);?><br/> </td> <td> <?php echo ($cat['species']);?><br/> </td> <td> <?php echo ($cat['eye_color']);?><br/> </td> <td> <?php echo ($cat['color']);?><br/> </td> <td> <?php echo ($cat['description']);?><br/> </td> <td> <?php echo ($cat['marital_status']);?><br/> </td> <td> <form action="/Anish/edit" method="post"> <input type="hidden" value="<?php echo ($cat['id']);?>" name="Anish_id_edit"> <button class="btn btn-block btn-info">Edit</button> </form> </td> <td> <form action="/Anish/delete" method="post"> <input type="hidden" value="<?php echo ($cat['id']);?>" name="Anish_id"> <button class="btn btn-block btn-danger">Delete</button> </form> </td> </tr> <?php endforeach;?> </tbody> </table> I am stuck. In my console, I am able to see this output when I type the letter 'a' if I uncomment the var_dump in my model: array(4) { [0]=> array(9) { ["id"]=> string(2) "13" ["name"]=> string(5) "Anish" ["gender"]=> string(4) "Male" ["age"]=> string(2) "20" ["species"]=> string(3) "Cat" ["eye_color"]=> string(5) "Brown" ["color"]=> string(5) "Black" ["description"]=> string(7) "Awesome" ["marital_status"]=> string(1) "0" } [1]=> array(9) { ["id"]=> string(2) "16" ["name"]=> string(5) "Anish" ["gender"]=> string(2) "fe" ["age"]=> string(2) "23" ["species"]=> string(2) "fe" ["eye_color"]=> string(2) "fe" ["color"]=> string(2) "fe" ["description"]=> string(2) "fe" ["marital_status"]=> string(1) "1" } [2]=> array(9) { ["id"]=> string(2) "17" ["name"]=> string(1) "a" ["gender"]=> string(1) "a" ["age"]=> string(1) "4" ["species"]=> string(1) "a" ["eye_color"]=> string(1) "a" ["color"]=> string(1) "a" ["description"]=> string(1) "a" ["marital_status"]=> string(1) "0" } [3]=> array(9) { ["id"]=> string(2) "18" ["name"]=> string(4) "Matt" ["gender"]=> string(6) "Female" ["age"]=> string(2) "80" ["species"]=> string(6) "ferret" ["eye_color"]=> string(4) "blue" ["color"]=> string(4) "pink" ["description"]=> string(5) "Chill" ["marital_status"]=> string(1) "0" } }

    Read the article

  • Why are compilers so stupid?

    - by martinus
    I always wonder why compilers can't figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit complex. For example, this code takes about 6 seconds on my computer to print the value zero (using java 1.6): int x = 0; for (int i = 0; i < 100 * 1000 * 1000 * 1000; ++i) { x += x + x + x + x + x; } System.out.println(x); It is totally obvious that x is never changed so no matter how often you add 0 to itself it stays zero. So the compiler could in theory replace this with System.out.println(0). Or even better, this takes 23 seconds: public int slow() { String s = "x"; for (int i = 0; i < 100000; ++i) { s += "x"; } return 10; } First the compiler could notice that I am actually creating a string s of 100000 "x" so it could automatically use s StringBuilder instead, or even better directly replace it with the resulting string as it is always the same. Second, It does not recognize that I do not actually use the string at all, so the whole loop could be discarded! Why, after so much manpower is going into fast compilers, are they still so relatively dumb? EDIT: Of course these are stupid examples that should never be used anywhere. But whenever I have to rewrite a beautiful and very readable code into something unreadable so that the compiler is happy and produces fast code, I wonder why compilers or some other automated tool can't do this work for me.

    Read the article

  • A dynamic array of a class, inside another separate class?

    - by pinnacler
    I'm working on a robot localization simulator and I created a class called "landmark". The end result is going to be a robot that is always centered and always faces the top of the screen. As it turns, the birds eye view map will rotate around the robot. To accomplish this, I'm assuming I can rotate one class and have all elements inside rotate as well. So, the landmark class has properties x,y, label, and radius. This is suppose to simulate a tree location in a forest. To test everything, I need "forest data," and I wrote a script to generate 100 trees in a 100m x 100m area. The script automatically generates values within an acceptable range for x,y, radius. The generated data is stored in an object called tempForest and is 100x3. Ideally, I want to create a class called "landmarks" (plural) that has 100 landmark instances inside. How would I instantiate 100 instances of landmark in one instance of landmarks using that randomly generated data? Ideally, I'd just type treeBeacons = landmarks(); and it would randomly populate 100 (user definable, set in config file) instances with x, y, radius data. I'm not sure how to deal with a dynamic array of class "Landmark", inside another single class "landmarks." Any ideas?

    Read the article

  • Do you know a date picker to quickly pick one day of the current week?

    - by Murmelschlurmel
    Most date pickers allow you to pick the date from a tine calendar or enter the date by hand. For example http://jqueryui.com/demos/datepicker/ This requires - two clicks (one to display the calendar and one to select the correct date) - good eyesight (usually the pop-up calendar is very small) - and good hand-eye coordination to pick the correct date in the tiny calendar with your mouse. That's no problem for power users, but a hassle for older people and computer beginners. I found a website with a different approach. It seems like their users mostly select dates of the current week. So they listed all the days of the week in a bar together with the weekday. The current day is marked in another color. There is a tiny calender icon on the right hand that opens up a regular date picker. That gives you access to all regular date picker functionality. Here is a screenshot: http://mite.yo.lk/assets/img/tour/de/zeiten-erfassen.png Do you know of any jquery plugin which has a similar feature? If not, do you any other plugin or widget which would help me speed up development ? Thank you!

    Read the article

  • Javascript "Match" Function Not Returning Proper Results in Safari or IE (but yes in FF)

    - by Jascha
    Forgive me as this is a time sensitive issue and I will have to switch the site back in a few hours so the link will be bad... but: I am simply comparing two strings looking for a match with this function... I have an array of objects called linkArray and I need to match the .src of each object to a .src I send it (the src of the clicked image). if the the src of the image I clicked matches the src of an object in my array, I set a variable to the link string of that object and return true, letting my page know that the link is available. Now, this works great in FF. But not in any other browser and I can't figure out for the life of me why. I have set up a dialogue box to literally compare, by eye, the two strings that should at the very least throw the message "match". Can anyone see what I am missing here??? here is the link... http://7thart.com/Jewish-History-and-Culture/Jews-and-Baseball-An-American-Love-Story If you click any of the thumbnails on the left, you will activate the function. Again, I apologize as after a few hours I have to switch back to the original site and this link will be invalid. Thanks in advance for your help. (function below)... function matchLink(a){ for(var i=0;i<linkArray.length;i++){ var fixLink = '../' + linkArray[i]['src']; alert(fixLink + '\n = \n' + a); if(fixLink == a){ alert('match'); newLink = linkArray[i]['link']; return true; } } return false; } Note: The "match" will return on two of the images.. the initial image, and the first thumbnail on the left. The second thumbnail SHOULD match, and the third one SHOULD NOT match.

    Read the article

  • How to display panels with component in frame

    - by terence6
    Why my JFrame 'frame' is diplaying empty window, when it should give me 3 menu buttons and my own painted JComponent below ? What am I missing here ? import java.awt.*; import javax.swing.*; public class Eyes extends JFrame { public static void main(String[] args) { final JFrame frame = new JFrame("Eyes"); frame.setPreferredSize(new Dimension(450, 300)); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel players = new JPanel(new GridLayout(1, 3)); players.add(new JButton("Eyes color")); players.add(new JButton("Eye pupil")); players.add(new JButton("Background color")); JPanel eyes = new JPanel(); eyes.add(new MyComponent()); JPanel content = new JPanel(); content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS)); content.add(players); content.add(eyes); frame.getContentPane(); frame.pack(); frame.setVisible(true); } } class MyComponent extends JComponent { public MyComponent(){ } @Override public void paint(Graphics g) { int height = 120; int width = 120; Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); BasicStroke bs = new BasicStroke(3.0f); g2d.setStroke(bs); g2d.setColor(Color.yellow); g2d.fillOval(200, 200, height, width); g2d.setColor(Color.black); g2d.drawOval(60, 60, height, width); } }

    Read the article

  • jquery ajaxstart ajaxstop show hide

    - by user1630583
    As usually seemingly simple things take days to resolve, maybe someone could point me to a solution but after 2 days I give up on the following problem; In html, in a form I have a button that is supposed to trigger loading of data through ajax call: <button type="" class="btn" onclick="getData(); return false;">Show Data</button> in javascript: $(document).ajaxStart(function() { $("#qloader").show(); }).ajaxStop(function() { $("#qloader").hide('slow'); });? and in html div with id qloader is defined with 100% width and height and spinner centered as the background, z-index above other: <div id="qloader" class="myLoader" >&nbsp;</div> Now, when page loads, ajax call is executed to get initial data, qloader div is brought up and it shows the spinner - animated, after ajax call finishes, qloader is hidden by ajaxStop. Next, when I click on a button (show data) to initiate another ajax call, ajaxStart is triggered, but it does not show qloader, it waits until ajaxStop is triggered and then in a blink of eye it shows qloader and hides it. I suspected that ajaxStart is not executed, so I put alert before $("#qloader").show(), then alert would be displayed and after that qloader WOULD be displayed BUT spinner animation would be suspended - no spinning, and after ajaxStop it would get hidden. Without alert in ajaxStart trigger, in subsequent ajax calls div is not shown until just before ajaxStop is triggered. It works fine for the first ajax call, but for subsequent ajax call triggered by click on form button it does not work. Any idea what is wrong with this setup?

    Read the article

  • Why does Android allocate more memory than needed when loading images

    - by Simon
    Folks, I don't think that this is a duplicate and is NOT one of those how do I avoid OOMs questions. This is a genuine quest for knowledge so hold off on those down votes please... Imagine I have a JPEG of 500x500 pixels. I load it as ARGB_8888 which is as "bad as it gets". I would expect Android to allocate 500x500x4 bytes = a little under 1MB however, look at a heap dump and you will see that Android allocates significantly more, often factors of 5-10 times greater. You frequently see questions on here about OOMS where the stack trace shows a heap request of say 15MB and it is ALWAYS much larger than is required simply to hold the bytes of the image. The OP usually catches some downvotes then is bombarded with stock answers and comments about using less memory (thanks Romain!) and in scaling. I think there is more than meets the eye here. Anybody know why this is? If there is no apparent answer, I will put together an SSCCE if it helps. PS. I assume that JPEG vs PNG etc is irrelevant since we're talking about the memory usage of the backing bitmap which is simply x times y times BPP - or am I being slow?

    Read the article

  • Advantage of WPF app vs Winform for business apps?

    - by Abdu
    I know asp.net and winform development. I am not the type of developer who jumps into a new technology just because it's new. It needs to give me extra benefits like higher productivity. What are the advantages of WPF over Winforms for pure business apps? I am not interested in the extra eye candy, animation, gradients, image display effects and so on which WPF provides. The business apps are for data entry, data reporting and maybe some charts and static display of photos. How will WPF help in these apps? Better richer data binding? WinForm is a mature proven technology and I like the fact I can do everything in Visual Studio vs multiple IDE's for WPF (VS & Blend family). Plus I think WPF doesn't have as rich data binding controls like their Winform counterparts (DataGridView..etc). AFAIK, Microsoft will still support Winforms for many years. Try to convince someone like me to switch.

    Read the article

  • Solving quadratic programming using R

    - by user702846
    I would like to solve the following quadratic programming equation using ipop function from kernlab : min 0.5*x'*H*x + f'*x subject to: A*x <= b Aeq*x = beq LB <= x <= UB where in our example H 3x3 matrix, f is 3x1, A is 2x3, b is 2x1, LB and UB are both 3x1. edit 1 My R code is : library(kernlab) H <- rbind(c(1,0,0),c(0,1,0),c(0,0,1)) f = rbind(0,0,0) A = rbind(c(1,1,1), c(-1,-1,-1)) b = rbind(4.26, -1.73) LB = rbind(0,0,0) UB = rbind(100,100,100) > ipop(f,H,A,b,LB,UB,0) Error in crossprod(r, q) : non-conformable arguments I know from matlab that is something like this : H = eye(3); f = [0,0,0]; nsamples=3; eps = (sqrt(nsamples)-1)/sqrt(nsamples); A=ones(1,nsamples); A(2,:)=-ones(1,nsamples); b=[nsamples*(eps+1); nsamples*(eps-1)]; Aeq = []; beq = []; LB = zeros(nsamples,1); UB = ones(nsamples,1).*1000; [beta,FVAL,EXITFLAG] = quadprog(H,f,A,b,Aeq,beq,LB,UB); and the answer is a vector of 3x1 equals to [0.57,0.57,0.57]; However when I try it on R, using ipop function from kernlab library ipop(f,H,A,b,LB,UB,0)) and I am facing Error in crossprod(r, q) : non-conformable arguments I appreciate any comment

    Read the article

  • Looking for an issue tracker / project management software that automatically manages start/completion dates based on priority/relationships

    - by user361910
    So, a little background. We are a small company with a half-dozen developers. We have been evaluating many project management / issue tracking software packages (TRAC, Redmine, FogBugz, etc) and trying to create a decent process/workflow for managing projects, adding features, fixing bugs, etc. I'd like to think our requirements are similar to most other companies our size. Essentially, what this comes down to is 1) An easy way for the PM and developers to track projects, issues, bugs, etc 2) An easy way for the PM and admin/executives to get a birds-eye view of progress and easily manage timelines, schedules, and priorities. After trying TRAC, we moved to Redmine. We found Redmine to be easier than track to administer and the ability to have sub-projects and sub-tickets is great. However, the big problem we ran into is the fact that it is very difficult to manage schedules and timelines. It seems like it would be incredibly time-intensive to manage because you have to manually enter a start date, estimated time, and end date for each ticket, project, etc. So if you setup a month's schedule based on priorities, what are you supposed to do when a particular ticket/issue/subproject takes up more time than was estimated. Right now, it appears I would have to go back in and MANUALLY change the start/end date of every single item. What would be ideal is to be able to set priorities/dependencies and estimated time on tickets/milestones, and have the software automatically manage the start/end dates. Does anyone know how to get Redmine to do this, or recommend a different software package that can do something like this!

    Read the article

  • Scientific Data processing(Graph comparison and interpretation)

    - by pinkynobrain
    Hi stackoverflow friends, I'm trying to write a program to automate one of my more boring and repetative work tasks. I have some programming experience but none with processing or interpreting large volumes of data so i am seeking your advice(both suggestions of techneques to try and also things to read to learn more about doing this stuff). I have a piece of equipment that monitors an experiment by taking repeated samples and displays the readings on its screen as a graph. The input of experiment can be altered and one of these changes should produce a change in a section of the graph which i currently identify by eye and is what im looking for in the experiment. I want to automate it so that a computer looks at a set of results and spots the experiment input that causes the change. I can already extract the results from the machine. Currently they results for a run are in the form of an integer array with the index being the sample number and the corresponding value being the measurement. The overall shape of the graph will be similar for each experiment run. The change im looking for will be roughly the same and will occur in approximatly the same place every time for the correct experiment input. Unfortunatly there are a few gotcha's that make this problem more difficult. There is some noise in the measuring process which mean there is some random variation in the measured values between different runs. Although the overall shape of the graph remains the same. The time the experiment takes varies slightly each run causing two effects. First, the a whole graph may be shifted slightly on the x axis relative to another runs graph. Second, individual features may appear slightly wider or narrower in different runs. In both these cases the variation isn't particularly large and you can assume that the only non random variation is caused by the correct input being found. Thank you for your time, Pinky

    Read the article

  • Update table instantly or “Bulk” Update in database later? And is it advisable?

    - by Mestika
    Hi, I have a question regarding a semi-constant update in a database. In short it is regarding a checkout function on a web page, which each time the checkout function is evoked it do five steps. I want to try to optimize this function and have my eye on a step where I update a table each time the checkout is performed. I take the information retrieved from the shopping cart and then update the table in question. I do have some indexes on the table, the gain from those are greater than leaving them so this is a cost I’m willing to take. Now, my question is. Could it in some way regarding to performance be better to not update the table instantly but collect every checkout items and save them in some way (maybe in a file) and then at a specific time (or several times) at day take this file and then update the table with the new information. Then I started thinking about if there was a possibility to use some sort of Bulk Update to take a file, hashmap, array (or?) and then update it. And I’m using IBM DB2 version 9.7 Mestika

    Read the article

  • How do I split ONE array to two separate arrays based on magnitude size and a threshold?

    - by youhaveaBigego
    I have an array which has BIG numbers and small numbers in it. I got it from after running a log from WireShark. It is the total number of Bytes of TCP traffic. But Wireshark does not discriminate(it would actually try, and hence it will tell you the traffic stats of ALL types of traffic, but since This is how the Array look like : @Array=qw(10912980 10924534 10913356 10910304 10920426 10900658 10911266 10912088 10928972 10914718 10920770 10897774 10934258 10882186 10874126 8531 8217 3876 8147 8019 68157 3432 3350 3338 3280 3280 7845 7869 3072 3002 2828 8397 1328 1280 1240 1194 1193 1192 1194 6440 1148 1218 4236 1161 1100 1102 1148 1172 6305 1010 5437 3534 4623 4669 3617 4234 959 1121 1121 1075 3122 3076 1020 3030 628 2938 2938 1611 1611 1541 1541 1541 1541 1541 1541 1541 1541 1541 1541 1541 1541 583 370 178) When you look at these this array carefully, one thing is obvious to the human eye. There are really BIG numbers and small numbers. (Basically what I am saying is, there is the 1% class and low income class, no middle class). I want to split the array to two different arrays. That would require me to set a threshold. Array 1 should be ONLY the BIG numbers (10924534-10874126), and array 2 should be the smaller numbers (68157-178). Btw, the array is not sorted. User will NOT input the threshold, and hence should be determined smartly.

    Read the article

  • Scientific Data processing (Graph comparison and interpretation)

    - by pinkynobrain
    Hi stackoverflow friends, I'm trying to write a program to automate one of my more boring and repetitive work tasks. I have some programming experience but none with processing or interpreting large volumes of data so I am seeking your advice (both suggestions of techniques to try and also things to read to learn more about doing this stuff). I have a piece of equipment that monitors an experiment by taking repeated samples and displays the readings on its screen as a graph. The input of experiment can be altered and one of these changes should produce a change in a section of the graph which I currently identify by eye and is what I'm looking for in the experiment. I want to automate it so that a computer looks at a set of results and spots the experiment input that causes the change. I can already extract the results from the machine. Currently they results for a run are in the form of an integer array with the index being the sample number and the corresponding value being the measurement. The overall shape of the graph will be similar for each experiment run. The change I'm looking for will be roughly the same and will occur in approximately the same place every time for the correct experiment input. Unfortunately there are a few gotchas that make this problem more difficult. There is some noise in the measuring process which mean there is some random variation in the measured values between different runs. Although the overall shape of the graph remains the same. The time the experiment takes varies slightly each run causing two effects. First, the a whole graph may be shifted slightly on the x axis relative to another run's graph. Second, individual features may appear slightly wider or narrower in different runs. In both these cases the variation isn't particularly large and you can assume that the only non random variation is caused by the correct input being found. Thank you for your time, Pinky

    Read the article

  • 3D coordinate of 2D point given camera and view plane

    - by Myx
    I wish to generate rays from the camera through the viewing plane. In order to do this, I need my camera position ("eye"), the up, right, and towards vectors (where towards is the vector from the camera in the direction of the object that the camera is looking at) and P, the point on the viewing plane. Once I have these, the ray that's generated is: ray = camera_eye + t*(P-camera_eye); where t is the distance along the ray (assume t = 1 for now). My question is, how do I obtain the 3D coordinates of point P given that it is located at position (i,j) on the viewing plane? Assume that the upper left and lower right corners of the viewing plane are given. NOTE: The viewing plane is not actually a plane in the sense that it doesn't extend infinitely in all directions. Rather, one may think of this plane as a widthxheight image. In the x direction, the range is 0--width and in the y direction the range is 0--height. I wish to find the 3D coordinate of the (i,j)th element, 0

    Read the article

  • An alternative to Google Talk, AIM, MSN, et al [closed]

    - by mkaito
    I'm not entirely sure whether this part of stack exchange is the most adequate for my question, but it would seem to me that people sharing this kind of concern would converge either here, or possibly on a more unix-specific sub site. Either way, here goes. Background Feel free to skip to The Question, below. This should, however, help those interested understand where I'm coming from, and where I expect to get, messaging-wise. My online talking place-to-go has been IRC for the last fifteen years. I think it's a great protocol, and clients out there are very good. I still use, and will always continue to use IRC for most of my chat needs. But then, there is private instant messaging. While IRC can solve this with queries and DCC chats, the protocol just isn't meant to work too well on intermittent connections, such as a mobile device, where you can often walk around places with low signal. I used MSN for a while, but didn't like it. The concept was awesome, but I think Microsoft didn't get the implementation quite right. When they started adding all that eye candy, and my buddies started flooding me with custom icons and buzzing my screen to it's knees, I shut my account and told folks that missed me to just email or call me. Much whining happened, I got called many weird things for not using MSN, but folks eventually got over it. Next, Google Talk came along, and seemed to be a lot better than MSN ever was. The protocol was open, so I could use whatever client I felt a fancy for. With the advent of smart phones, I just got myself a gtalk client on the phone, and have had a really decent integrated mostly-universal IM solution. Over the last few months, all Google services have been feeling flaky. IMs will often arrive anywhere between twenty minutes and one hour after being sent, clients will randomly disconnect, client priorities seem to work sometimes, and sometimes just a random device of those connected will get an IM. I think the time has come to look for greener grass. The Question It's rather hard to put what I'm looking for into precise words. I guess I just want something that is kind of like MSN/Gtalk, but that doesn't let me down when I need it. IRC is pretty much perfect, but the protocol just isn't designed to work well on mobile devices. Really, at this point I'm considering sticking to IRC for desktop messaging, and SMS/email on the phone, but I hope that in this day and age there is something better out there.

    Read the article

  • Can't install new database in OpenLDAP 2.4 with BDB on Debian

    - by Timothy High
    I'm trying to install an openldap server (slapd) on a Debian EC2 instance. I have followed all the instructions I can find, and am using the recommended slapd-config approach to configuration. It all seems to be just fine, except that for some reason it can't create my new database. ldap.conf.bak (renamed to ensure it's not being used): ########## # Basics # ########## include /etc/ldap/schema/core.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/inetorgperson.schema pidfile /var/run/slapd/slapd.pid argsfile /var/run/slapd/slapd.args loglevel none modulepath /usr/lib/ldap # modulepath /usr/local/libexec/openldap moduleload back_bdb.la database config #rootdn "cn=admin,cn=config" rootpw secret database bdb suffix "dc=example,dc=com" rootdn "cn=manager,dc=example,dc=com" rootpw secret directory /usr/local/var/openldap-data ######## # ACLs # ######## access to attrs=userPassword by anonymous auth by self write by * none access to * by self write by * none When I run slaptest on it, it complains that it couldn't find the id2entry.bdb file: root@server:/etc/ldap# slaptest -f ldap.conf.bak -F slapd.d bdb_db_open: database "dc=example,dc=com": db_open(/usr/local/var/openldap-data/id2entry.bdb) failed: No such file or directory (2). backend_startup_one (type=bdb, suffix="dc=example,dc=com"): bi_db_open failed! (2) slap_startup failed (test would succeed using the -u switch) Using the -u switch it works, of course. But that merely creates the configuration. It doesn't resolve the underlying problem: root@server:/etc/ldap# slaptest -f ldap.conf.bak -F slapd.d -u config file testing succeeded Looking in the database directory, the basic files are there (with right ownership, after a manual chown), but the dbd file wasn't created: root@server:/etc/ldap# ls -al /usr/local/var/openldap-data total 4328 drwxr-sr-x 2 openldap openldap 4096 Mar 1 15:23 . drwxr-sr-x 4 root staff 4096 Mar 1 13:50 .. -rw-r--r-- 1 openldap openldap 3080 Mar 1 14:35 DB_CONFIG -rw------- 1 openldap openldap 24576 Mar 1 15:23 __db.001 -rw------- 1 openldap openldap 843776 Mar 1 15:23 __db.002 -rw------- 1 openldap openldap 2629632 Mar 1 15:23 __db.003 -rw------- 1 openldap openldap 655360 Mar 1 14:35 __db.004 -rw------- 1 openldap openldap 4431872 Mar 1 15:23 __db.005 -rw------- 1 openldap openldap 32768 Mar 1 15:23 __db.006 -rw-r--r-- 1 openldap openldap 2048 Mar 1 15:23 alock (note that, because I'm doing this as root, I had to also change ownership of some of the files created by slaptest) Finally, I can start the slapd service, but it dies in the attempt (text from syslog): Mar 1 15:06:23 server slapd[21160]: @(#) $OpenLDAP: slapd 2.4.23 (Jun 15 2011 13:31:57) $#012#011@incagijs:/home/thijs/debian/p-u/openldap-2.4.23/debian/build/servers/slapd Mar 1 15:06:23 server slapd[21160]: config error processing olcDatabase={1}bdb,cn=config: Mar 1 15:06:23 server slapd[21160]: slapd stopped. Mar 1 15:06:23 server slapd[21160]: connections_destroy: nothing to destroy. I manually checked the olcDatabase={1}bdb file, and it looks fine to my amateur eye. All my specific configs are there. Unfortunately, syslog isn't reporting a specific error in this case (if it were a file permission error, it would say). I've tried uninstalling and reinstalling slapd, changing permissions, Googling my wits out, but I'm tapped out. Any OpenLDAP genius out there would be greatly appreciated!

    Read the article

  • How to make a 100% UNIQUE dvd? [closed]

    - by sajawikio
    Is it possible to make a DVD which would be next to impossible to replicate exactly even with special equipment? To be clear, not in the sense of making the data itself resistant to piracy - nothing like that. More like as an analogy to antiques - a reproduction of a furniture would be able to be spotted to a trained eye, that it is not the original. Is it possible to do this for a dvd? Like, say a dvd is copied, even by someone who is trying to use even special equipment and is hypothetically dying to copy the dvd exactly for whatever reason - even such copied dvd would be detectable that it is not exactly the original dvd somehow (as if it were a reproduction of an original antique, but not the original), and would be almost or even preferably impossible to actually copy 100% exact the dvd ever again. Just some ideas below on the sort of thing i might go about doing to do this, but really am not sure how or what programs, media, hardware, etc. would do the trick Not sure what would do the trick -- but for instance do there exist any blank dvd's that already come pre-recorded with some sort of serial number or bar code, or other metadata, or an encrypted hash, or something like that? Maybe any blank dvd will do but i should get a special software to extract hardcoded metadata? If so which software? Or special hardware even maybe? Such dvd which the "secret" can be: Well, to know what the "secret" is and if it is present on the disk, it probably should be readable by some software or maybe a particular hardware (i guess preferably only if some sort of key is known and input into the software, even better, only then such secret data on disk can be read, otherwise nothing shows up and it looks like just a regular disk with no secret on it), and Would be impossible to actually replicate, especially not with regular burning hardware and preferably not at all. Other idea: Is there any special software that can direct the write head of laser to physically "mar" the dvd in such a way that, when played in dvd player, makes a particular visual pattern or something like that, also say the mar itself shows up as faint scratch on disk, but would be impossible for someone to do themselves exactly? EDIT: Also to clarify suppose the dvd contains video and music that should be playable on dvd players, maybe a menu too (i.e not a dvd containing software), and also to clarify the question is about how to make dvd 100% unique, not how to make the actual content of dvd protected from "piracy".

    Read the article

  • Using OpenVPN, yet netflix.com blocks access

    - by user837848
    I have set up an OpenVPN server on a VPS in the USA and configured it to route all clients traffic through it. Everything seems to work fine regarding the VPN connection in gerneral. All ip lookup sites show me the us server's ip address and even hulu.com works(it won't work if you are not in the usa). But for some reason netflix.com says "Sorry, Netflix is not available in your country yet.". So I thought that netflix probably uses some more sophisticated ways to determine your location beyond just your ip address. But I could not find a way to get it to work until I dropped the idea of using a VPN and instead connected to the server via a simple socks tunnel with ssh by running: ssh -D 9999 user@serverip All I had to do was changing the key network.proxy.socks_remote_dns in Firefox from false to true to prevent DNS leaks and setting up the socks proxy. Then I could finally watch netflix.com. As a result I concluded that there is nothing in the browser(or something like system timezone) that tells netflix the location, so it has to have something to do with the OpenVPN config. After that I used tcpdump to log all the traffic on the server's network interface venet0 (OpenVZ VPS), visited netflix.com on the client while first connected to the VPN and then connected via socks tunnel and afterwards compared both outputs. The only thing that caught my eye was that while using the socks tunnel the server mainly used ipv6 to connect to netflix whereas it only used ipv4 when the client was connected to the OpenVPN server. But I don't get how that could make such a difference. So what am I missing? Is there a way to configure OpenVPN to also use ipv6 to connect to a website although there is only an ipv4 connection between the VPS and the client? Here is the server.conf of the OpenVPN server (OpenVZ VPS) local serverip port 443 proto tcp dev tun ca ./easy-rsa2/keys/ca.crt cert ./easy-rsa2/keys/vps1.crt key ./easy-rsa2/keys/vps1.key # This file should be kept secret dh ./easy-rsa2/keys/dh1024.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" client-to-client keepalive 10 120 tls-auth ta.key 0 # This file is secret cipher AES-256-CBC comp-lzo max-clients 4 user nobody group nogroup persist-key persist-tun status openvpn-status.log log-append openvpn.log verb 3 iptables forwarding iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o venet0 -j SNAT --to-source serverip (enabled ipv4 forwarding) I have tried everything always on a Win7 and a Debian client with only ipv4 connections and always made sure that they use the correct DNS server (tested with ipleak.net and tcpdump / wireshark). client.conf: client dev tun proto tcp remote serverip 443 resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert client.crt key client.key ns-cert-type server tls-auth ta.key 1 cipher AES-256-CBC comb-lzo verb 3

    Read the article

  • External hard drive FAT32 to NTFS conversion fails

    - by Pieter
    I'm trying to convert the FAT32 file system of an external hard drive to NTFS. Here's what happened: C:\Windows\system32>chkdsk G: The type of the file system is FAT32. Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. C:\Windows\system32>cd \ C:\>convert g: /fs:ntfs The type of the file system is FAT32. Enter current volume label for drive G: PIETEREXT Volume PIETEREXT created 3/19/2008 12:43 Volume Serial Number is 1806-2E30 Windows is verifying files and folders... File and folder verification is complete. Windows has scanned the file system and found no problems. No further action is required. 488,264,768 KB total disk space. 72,192 KB in 1,503 hidden files. 1,281,792 KB in 40,029 folders. 309,235,168 KB in 199,915 files. 177,675,584 KB are available. 32,768 bytes in each allocation unit. 15,258,274 total allocation units on disk. 5,552,362 allocation units available on disk. Determining disk space required for file system conversion... Total disk space: 488384001 KB Free space on volume: 177675584 KB Space required for conversion: 975155 KB Converting file system The conversion failed. G: was not converted to NTFS I looked at the TechNet page for my error, but after closing every app the conversion was still failing halfway through. Why does it keep failing? I kept an eye on Task Manager but it didn't look like my system resources were near depletion. I'm using Windows 8.

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >