Search Results

Search found 1506 results on 61 pages for 'ben rokah'.

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

  • Traceroute comparison and statistics

    - by ben-casey
    I have a number of traceroutes that i need to compare against each other but i dont know the best way to do it, ive been told that hash maps are a good technique but i dont know how to implement them on my code. so far i have: FileInputStream fstream = new FileInputStream("traceroute.log"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; // reads lines in while ((strLine = br.readLine()) != null) { System.out.println(strLine); } and the output looks like this: Wed Mar 31 01:00:03 BST 2010 traceroute to www.bbc.co.uk (212.58.251.195), 30 hops max, 40 byte packets 1 139.222.0.1 (139.222.0.1) 0.873 ms 1.074 ms 1.162 ms 2 core-from-cmp.uea.ac.uk (10.0.0.1) 0.312 ms 0.350 ms 0.463 ms 3 ueaha1btm-from-uea1 (172.16.0.34) 0.791 ms 0.772 ms 1.238 ms 4 bound-from-ueahatop.uea.ac.uk (193.62.92.71) 5.094 ms 4.451 ms 4.441 ms 5 gi0-3.norw-rbr1.eastnet.ja.net (193.60.0.21) 4.426 ms 5.014 ms 4.389 ms 6 gi3-0-2.chel-rbr1.eastnet.ja.net (193.63.107.114) 6.055 ms 6.039 ms * 7 lond-sbr1.ja.net (146.97.40.45) 6.994 ms 7.493 ms 7.457 ms 8 so-6-0-0.lond-sbr4.ja.net (146.97.33.154) 8.206 ms 8.187 ms 8.234 ms 9 po1.lond-ban4.ja.net (146.97.35.110) 8.673 ms 6.294 ms 7.668 ms 10 bbc.lond-sbr4.ja.net (193.62.157.178) 6.303 ms 8.118 ms 8.107 ms 11 212.58.238.153 (212.58.238.153) 6.245 ms 8.066 ms 6.541 ms 12 212.58.239.62 (212.58.239.62) 7.023 ms 8.419 ms 7.068 ms what i need to do is compare this trace against another one just like it and look for the changes and time differences etc, then print a stats page.

    Read the article

  • Has anyone noticed that a WPF file dialog will pass a click through to the UI when double clicking t

    - by Ben
    I have some buttons on my WPF UI and I also need to choose files from time to time. I kept noticing strange problems where when I double-click an item in the file dialog, a button on the main UI would also get clicked. After experimenting, it seems that if you line up an item in the file dialog with a button behind it on the main UI and double click to select the file, it will single-click the button behind it as well. Has anyone else noticed this, or is it just a freak bug with the way I have my UI laid out?

    Read the article

  • What do you think is the best language for Bioinformatics?

    - by Ben Fossen
    I have done a couple research jobs in Bio-informatics and I have used Matlab for them. Matlab had a lot of powerful tools and was easy to use. I did thinks with genome sequencing and predicting metabolic pathways. I am wondering what other people think is best? or there might not be one specific language but a few that lend themselves best to Bio-informatics work that is math heavy and deals with a large amount of data.

    Read the article

  • Resizing a UIButton programmatically by maintaining a margin

    - by Oscar Del Ben
    Hello, I'm adding a UIButton to a tableView footer programmatically. This button has a left and right margin that is equal to the tableView margin: UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; deleteButton.frame = CGRectMake(10, 60, 300, 34); deleteButton.autoresizingMask = UIViewAutoresizingFlexibleWidth I'm adding autoresizingMask because I want to support rotation. However, it does not work as I want, as the button stretches all the way down to the right, as shown by the image below. Any idea how to fix it? If I remove the autosizing property then the margin is correct.

    Read the article

  • Playing Multiple Sounds at Once in Qt

    - by Ben
    I'm trying to play background music along with sound effects using Qt. However, I can't get more than one sound to play at once. For example: QSound::play("Music.wav"); QSound::play("Effect.wav"); When this code is run (on Windows), you can hear Music.wav just start to play, but then it stops and Effect.wav plays. Is there any way to get the two sounds to play at once?

    Read the article

  • Undefined variable error when parsing json

    - by Ben Shelock
    I'm trying to parse the json grabbed from here. Basically what I do is iterate over the items, sort them, then display them. But I get an error saying data.data.children[i] is undefined. I can't think why it's doing it though? var json = 'http://www.reddit.com/reddits/mine/.json'; GM_xmlhttpRequest({ method: "GET", url: json, onload: reddits }); function reddits(response){ var txt = response.responseText; var data; var suggested = document.getElementById('suggested-reddits'); if(window.JSON && JSON.parse){ data = JSON.parse(txt); } else{ data = eval("("+txt+")"); } suggested.innerHTML += '<span>reddits you\'re subscribed to </span> <ul id="rsub"></ul>'; GM_addStyle('#rsub{width: 500px;}'); var reddits = new Array(); var rsub = document.getElementById('rsub'); for(i = 0; i <= data.data.children.length; i++){ var r = data.data.children[i].data.display_name; reddits.push(r); } sort(reddits); for(i = 0; i <= reddits.length; i++){ rsub.innerHTML += '<li><a href="#" onclick="set_sr_name(this); return false">' + reddits[i] + '</a></li>'; } }

    Read the article

  • Mathematica equivalent of Ruby's inject

    - by Ben Alpert
    Is there a Mathematica function like inject in Ruby? For example, if I want the product of the elements in a list, in Ruby I can write: list.inject(1) { |prod,el| prod * el } I found I can just use Product in Mathematica: Apply[Product, list] However, this isn't general enough for me (like, if I don't just want the product or sum of the numbers). What's the closest equivalent to inject?

    Read the article

  • Regexp to extract sources from different video embeds

    - by Ben
    My SMF forum contains posts with video and I want to extract them to show on the Wordpress main page. My current regexp (thanks to SO!) extracts the url of the videos, which I embed using AutoEmbed. Everything works up until a post looks like this: <embed height="600" width="600" allowscriptaccess="never" quality="high" loop="true" play="true" src="http://mmavlog.net/embed/player.swf?file=http://video.ufc.tv/CSG/UFC113/20100507_ufc113_weigh_in_400k.flv" type="application/x-shockwave-flash"> Here is my current regexp: $regexp = "/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i"; Since the posts can contain <embed> or <object> I realize that looking for the url by the "http" might be inaccurate. How can I use the regexp to look for "src=" for <embed> and "data=" for <object>?

    Read the article

  • Default content editor in list form doesn't allow image alignment

    - by Ben Collins
    I need to be able to adjust the alignment of an image in an "Enhanced Rich Text Field" in an announcements list in MOSS 2007. However, the default content editor in the edit form for the list doesn't provide a way to do that. What's the fastest way for me to make sure users can align images? My first thought was to customize the DispForm.aspx and EditForm.aspx pages, but they just have the ListForm web part in the content region and as far as I know, you can't customize the ListForm web part from the designer.

    Read the article

  • The height and width properties on my Flex 4 app arn't working

    - by ben
    In the opening application tag of my Flex 4 app, I set the width and height properties as follows: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()" backgroundColor.mainState="0x303030" xmlns:components="components.*" width="798" height="240"> What I go into Design mode in Flash Builder 4, the app is the correct size. But when I embed the .swf file into a HTML page, the application's background color covers the whole screen, and when the Flash Player Settings message box pops up it is outside of the area I defined in the code above. What am I doing wrong? Thanks for reading.

    Read the article

  • Is READ UNCOMMITTED / NOLOCK safe in this situation?

    - by Ben Challenor
    I know that snapshot isolation would fix this problem, but I'm wondering if NOLOCK is safe in this specific case so that I can avoid the overhead. I have a table that looks something like this: drop table Data create table Data ( Id BIGINT NOT NULL, Date BIGINT NOT NULL, Value BIGINT, constraint Cx primary key (Date, Id) ) create nonclustered index Ix on Data (Id, Date) There are no updates to the table, ever. Deletes can occur but they should never contend with the SELECT because they affect the other, older end of the table. Inserts are regular and page splits to the (Id, Date) index are extremely common. I have a deadlock situation between a standard INSERT and a SELECT that looks like this: select top 1 Date, Value from Data where Id = @p0 order by Date desc because the INSERT acquires a lock on Cx (Date, Id; Value) and then Ix (Id, Date), but the SELECT acquires a lock on Ix (Id, Date) and then Cx (Date, Id; Value). This is because the SELECT first seeks on Ix and then joins to a seek on Cx. Swapping the clustered and non-clustered index would break this cycle, but it is not an acceptable solution because it would introduce cycles with other (more complex) SELECTs. If I add NOLOCK to the SELECT, can it go wrong in this case? Can it return: More than one row, even though I asked for TOP 1? No rows, even though one exists and has been committed? Worst of all, a row that doesn't satisfy the WHERE clause? I've done a lot of reading about this online, but the only reproductions of over- or under-count anomalies I've seen (one, two) involve a scan. This involves only seeks. Jeff Atwood has a post about using NOLOCK that generated a good discussion. I was particularly interested in a comment by Rick Townsend: Secondly, if you read dirty data, the risk you run is of reading the entirely wrong row. For example, if your select reads an index to find your row, then the update changes the location of the rows (e.g.: due to a page split or an update to the clustered index), when your select goes to read the actual data row, it's either no longer there, or a different row altogether! Is this possible with inserts only, and no updates? If so, then I guess even my seeks on an insert-only table could be dangerous. Update: I'm trying to figure out how snapshot isolation works. It seems to be row-based, where transactions read the table (with no shared lock!), find the row they are interested in, and then see if they need to get an old version of the row from the version store in tempdb. But in my case, no row will have more than one version, so the version store seems rather pointless. And if the row was found with no shared lock, how is it different to just using NOLOCK?

    Read the article

  • Android multiple screen sizes and density problems

    - by Ben Mc
    I'm having a real problem with my drawables that I just can't seem to figure out. The problem is this: There are screen sizes at approximately 320x480, 480x800, 480x854 Then there are most commonly densities at 1.0 (160) and 1.5 (240) Now, on a Droid, the screen size is 480x800 and the density is reporting using DisplayMetrics as 1.5 On the G1, it's 320x480 and reporting back at a density of 1.0 BUT tablet devices are reporting back at 480x800 with a density of 1.0 (160) So, I'm going mad because I can put 320x480 images in the drawables-mdpi folder and 480x800 images in the drawables-hdpi folder, but on Tablet computers, no matter what it's not resizing up anything to a full screen. Any help would be greatly appreciated. I just want all of my 320x480 images to scale up regardless of the device.

    Read the article

  • iPhone: scroll view with arbitrary page/"settling" boundaries?

    - by Ben
    Hi all, I'm trying to figure out if I can get what I want out of UIScrollView through some trickery or whether I need to roll my own scroll view: I have a series of items in row that I want to scroll through. One item should always be centered in the view, but other items should be visible to either side. In other words, I want normal scrolling and edge bouncing, but I want the deceleration when the user ends a touch to naturally settle at some specified stop point. (Actually now that I think of it, this behavior is similar to coverflow in this respect.) I know UIScrollView doesn't do this out of the box, but does anyone have suggestions for how it might be made to do this, or if anyone's spotted any code that accomplishes something similar (I'm loathe to reimplement all the math for deceleration and edge bounce) Thanks!

    Read the article

  • Consecutive 'if' statements

    - by Ben Packard
    How can I check one thing AND THEN another, if the first is true? For example, say I have a shopping basket object, and I only want to do something if the basket has been created AND it isn't empty. I've tried: if (basket && [basket numberOfItems >0])... But the second condition is evaluated even if the first fails, resulting in a crash (presumably because i'm calling numberOfItems on an object that doesn't exist). I can nest them, but this seems a bit ugly, and more to the point is problematic. Say I want to do one thing if the basket exists AND isn't empty, but another if either isn't true. That doesn't really work well in nested if statements.

    Read the article

  • (Not So) Silly Objective-C inheritance problem when using property - GCC Bug?

    - by Ben Packard
    Update 2 - Many people are insisting I need to declare an iVar for the property. Some are saying not so, as I am using Modern Runtime (64 bit). I can confirm that I have been successfully using @property without iVars for months now. Therefore, I think the 'correct' answer is an explanation as to why on 64bit I suddenly have to explicitly declare the iVar when (and only when) i'm going to access it from a child class. The only one I've seen so far is a possible GCC bug (thanks Yuji). Not so simple after all... Update - I messed up one line of the original copy and paste - corrected. The @property call was missing (nonatomic, retain) but is a red herring - STILL NEED AN ANSWER! Thanks. I've been scratching my head with this for a couple of hours - I haven't used inheritance much. Here I have set up a simple Test B class that inherits from Test A, where an ivar is declared. But I get the compilation error that the variable is undeclared. This only happens when I add the property and synthesize declarations - works fine without them. TestA Header: #import <Cocoa/Cocoa.h> @interface TestA : NSObject { NSString *testString; } @end TestA Implementation is empty: #import "TestA.h" @implementation TestA @end TestB Header: #import <Cocoa/Cocoa.h> #import "TestA.h" @interface TestB : TestA { } @property (nonatomic, retain) NSString *testProp; @end TestB Implementation (Error - 'testString' is undeclared) #import "TestB.h" @implementation TestB @synthesize testProp; - (void)testing{ NSLog(@"test ivar is %@", testString); } @end

    Read the article

  • A hooked DirectX 9 program crashes on window resize, texture related.

    - by Ben
    I'm using EasyHook and SlimDX to overlay some graphics using SlimDX's Sprite and Texture classes. When I resize windows some programs fine, but others will crash - Winamp's MilkDrop 2 gives me an ambiguous memory error for example. I expect this is due to the after market Texture I created. The question is what VTable function should I hook and/or how/when do I dispose and recreate the Texture? Reset perhaps? If it isn't obvious I don't know much about DirectX.

    Read the article

  • In JSF - What is the correct way to do this? Two dropdown lists with dependency.

    - by Ben
    Hi, I'm making two dropdown lists in JSF which are dependent. Specifically, one list has all the languages and the second list contains values that are displayed in the currently selected language. I've implemented this by having the second list use information from a Hash and rebuilding that Hash in the setter of the currently selected language. JSF Code Bit: <rich:dropDownMenu value="#{bean.currentlySelectedLanguage}" id="languageSelector"> ... (binding to languages hash) ... <rich:dropDownMenu value="#{bean.currentlySelectedScript}" id="ScriptPullDown"> ... (binding to scripts hash) ... Backing Bean Code Bit: setCurrentlySelectedLanguage(String lang){ this.currentlySelectedLanguage = lang; rebuildScriptNames(lang); } I'm wondering if that's a good way of doing this or if theres a better method that I am not aware of. Thank you! EDIT - Adding info.. I used a a4j:support that with event="onchange" and ReRender="ScriptPullDown" to rerender the script pull down. I could probably add an action expression to run a method when the value changes. But is there a benefit to doing this over using code in the setter function?

    Read the article

  • Scala and the Java Memory Model

    - by Ben Lings
    The Java Memory Model (since 1.5) treats final fields differently to non-final fields. In particular, provided the this reference doesn't escape during construction, writes to final fields in the constructor are guaranteed to be visible on other threads even if the object is made available to the other thread via a data race. (Writes to non-final fields aren't guaranteed to be visible, so if you improperly publish them, another thread could see them in a partially constructed state.) Is there any documentation on how/if the Scala compiler creates final (rather than non-final) backing fields for classes? I've looked through the language specification and searched the web but can't find any definitive answers. (In comparison the @scala.volatile annotation is documented to mark a field as volatile)

    Read the article

  • Avoiding secondary selects or joins with Hibernate Criteria or HQL query

    - by Ben Benson
    I am having trouble optimizing Hibernate queries to avoid performing joins or secondary selects. When a Hibernate query is performed (criteria or hql), such as the following: return getSession().createQuery(("from GiftCard as card where card.recipientNotificationRequested=1").list(); ... and the where clause examines properties that do not require any joins with other tables... but Hibernate still performs a full join with other tables (or secondary selects depending on how I set the fetchMode). The object in question (GiftCard) has a couple ManyToOne associations that I would prefer to be lazily loaded in this case (but not necessarily all cases). I want a solution that I can control what is lazily loaded when I perform the query. Here's what the GiftCard Entity looks like: @Entity @Table(name = "giftCards") public class GiftCard implements Serializable { private static final long serialVersionUID = 1L; private String id_; private User buyer_; private boolean isRecipientNotificationRequested_; @Id public String getId() { return this.id_; } public void setId(String id) { this.id_ = id; } @ManyToOne @JoinColumn(name = "buyerUserId") @NotFound(action = NotFoundAction.IGNORE) public User getBuyer() { return this.buyer_; } public void setBuyer(User buyer) { this.buyer_ = buyer; } @Column(name="isRecipientNotificationRequested", nullable=false, columnDefinition="tinyint") public boolean isRecipientNotificationRequested() { return this.isRecipientNotificationRequested_; } public void setRecipientNotificationRequested(boolean isRecipientNotificationRequested) { this.isRecipientNotificationRequested_ = isRecipientNotificationRequested; } }

    Read the article

  • SilverLight WebApp Calling Webservice in the same solution

    - by Ben
    Hi, I have a website solution that is composed of a SilverLight Project and an ASP Site that contains an asmx Webservice. The SilverLight project calls various methods in the Webservice, and this works fine on my home PC. When i publish the site (using 123-Reg if that makes a difference), it appears that the SilverLight app is no longer able to call the webservice. I have tried debugging the app by pointing my local version of the site to my published webservice and i get a "policy" issue. I know that 123 Reg have .Net 3.5 running on their servers, so i would assume that the site should "just work" when i publish it. Am i making a hugely stupid assumption there? Is there anything that i can do to change the "policies" within my app? Or is there another way around what i am trying to do ( i need to keep the webservice, as i want for it to be used from other places, and dont really want to duplicate code and create the same methods within the SilverLight project). Thanks

    Read the article

  • margin between content and div overflow scrollbar

    - by ben
    I am using the following bits of code to keep my menu items fixed while allowing for the scrolling of content because it seems to be the most stable method across all browsers. body { overflow: hidden; } div.content { height: 100%; overflow: auto; } My problem is simple, and yet I can not seem to figure it out, the content inside the tag butts up against the scrollbar for the div area and it makes reading much more difficult. How can I get a margin between them (apart from floating a transparent image to the right to create space, there HAS to be a better way)?

    Read the article

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