Search Results

Search found 3130 results on 126 pages for 'half duplex'.

Page 106/126 | < Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >

  • Eclipse > Javascript > Code highlighting not working with Object Notation

    - by Redsandro
    I am using Eclipse Helios with PDT, and when I am editing JavaScript files with the default JavaScript Editor (JSDT), code highlighting (Mark Occurrences) is not working for half of the code, for example JSON-style (or Object Literal if you will) declarations. Little example: Foo = {}; Foo.Bar = Foo.Bar || {}; Foo.Bar = { bar: function(str) { alert(str) }, baz: function(str) { this.bar(str); // This bar *is* highlighted though } }; Foo.Bar.baz('text'); No Bar, bar or baz is highlighted. For now, I humbly edit the JavaScript part of projects in Notepad++ because it just highlights every occurrence of whatever is currently selected. Is there a common practice for Eclipse JavaScript developers to get code highlighting work correctly, using the popular Object Literal notation? An option or update I missed? -update- I have found that code highlighting depends on the code being properly outlined. Altough commonly used, Object Literal outlining still seems rare in javascript editors. the Spket Javascript Editor does partial Object Literal outlining, and the Aptana Javascript Editor does full Object Literal outlining. But both loses other important functionality. A quest for the editor with the least loss of functionality is currently in progress in this question.

    Read the article

  • Browser timing out attempting to load images

    - by notJim
    I've got a page on a webapp that has about 13 images that are generated by my application, which is written in the Kohana PHP framework. The images are actually graphs. They are cached so they are only generated once, but the first time the user visits the page, and the images all have to be generated, about half of the images don't load in the browser. Once the page has been requested once and images are cached, they all load successfully. Doing some ad-hoc testing, if I load an individual image in the browser, it takes from 450-700 ms to load with an empty cache (I checked this using Google Chrome's resource tracking feature). For reference, it takes around 90-150 ms to load a cached image. Even if the image cache is empty, I have the data and some of the application's startup tasks cached, so that after the first request, none of that data needs to be fetched. My questions are: Why are the images failing to load? It seems like the browser just decides not to download the image after a certain point, rather than waiting for them all to finish loading. What can I do to get them to load the first time, with an empty cache? Obviously one option is to decrease the load times, and I could figure out how to do that by profiling the app, but are there other options? As I mentioned, the app is in the Kohana PHP framework, and it's running on Apache. As an aside, I've solved this problem for now by fetching the page as soon as the data is available (it comes from a batch process), so that the images are always cached by the time the user sees them. That feels like a kludgey solution to me, though, and I'm curious about what's actually going on.

    Read the article

  • Arrays not counting correctly

    - by Nick Gibson
    I know I was just asking a question earlier facepalm This is in Java coding by the way. Well after everyones VERY VERY helpful advice (thank you guys alot) I managed to get over half of the program running how I wanted. Everything is pointing in the arrays where I want them to go. Now I just need to access the arrays so that It prints the correct information randomly. This is the current code that im using: http://pastebin.org/301483 The specific code giving me problems is this: long aa; int abc; for (int i = 0; i < x; i++) { aa = Math.round(Math.random()*10); String str = Long.toString(aa); abc = Integer.parseInt(str); String[] userAnswer = new String[x]; if(abc > x) { JOptionPane.showMessageDialog(null,"Number is too high. \nNumber Generator will reset."); break; } userAnswer[i] = JOptionPane.showInputDialog(null,"Question "+quesNum+"\n"+questions[abc]+"\n\nA: "+a[abc]+"\nB: "+b[abc]+"\nC: "+c[abc]+"\nD: "+d[abc]); answer = userAnswer[i].compareTo(answers[i]); if(answer == 0) { JOptionPane.showMessageDialog(null,"Correct. \nThe Correct Answer is "+answers[abc]+""+i); } else { JOptionPane.showMessageDialog(null,"Wrong. \n The Correct Answer is "+answers[abc]+""+i); }//else

    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

  • LINQ - Splitting up a string with maximum length, but not chopping words apart.

    - by Stacey
    I have a simple LINQ Extension Method... public static IEnumerable<string> SplitOnLength(this string input, int length) { int index = 0; while (index < input.Length) { if (index + length < input.Length) yield return input.Substring(index, length); else yield return input.Substring(index); index += length; } } This takes a string, and it chops it up into a collection of strings that do not exceed the given length. This works well - however I'd like to go further. It chops words in half. I don't need it to understand anything complicated, I just want it to be able to chop a string off 'early' if cutting it at the length would be cutting in the middle of text (basically anything that isn't whitespace). However I suck at LINQ, so I was wondering if anyone had an idea on how to go about this. I know what I am trying to do, but I'm not sure how to approach it. So let's say I have the following text. This is a sample block of text that I would pass through the string splitter. I call this method SplitOnLength(6) I would get the following. This i s a sa mple b lock o f text that I would pass t hrough the s tring splitt er. I would rather it be smart enough to stop and look more like .. This is a sample // bad example, since the single word exceeds maximum length, but the length would be larger numbers in real scenarios, closer to 200. Can anyone help me?

    Read the article

  • ProgressDialog won't show, even in onPreExecute of AsyncTask

    - by Geltrude
    In my class, Main extends Activity, I've this: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case ... case CREDENTIAL_VIEW: new SetStatusProgressBar(this).execute(); And there is this nested class: private class SetStatusProgressBar extends AsyncTask<String, Void, Boolean> { private ProgressDialog dialog; private Main ctx; public SetStatusProgressBar(Main ctx) { this.ctx = ctx; dialog = new ProgressDialog(ctx); } // progress dialog to show user that contacting server. protected void onPreExecute() { this.dialog = ProgressDialog.show(ctx, null, "Refreshing data from server...", true, false); } @Override protected void onPostExecute(final Boolean success) { //... //statements that refresh UI //... if (dialog.isShowing()) { dialog.dismiss(); timerProgressBarStop(); } } protected Boolean doInBackground(final String... args) { //... //statements to download data from server //... return true; } } In the Main class I open a second Activity, in this way: Intent myIntent = new Intent(Main.this, Credentials.class); startActivityForResult(myIntent, CREDENTIAL_VIEW); That second Activity returns to the Main activity in this way: Intent intent = new Intent(); setResult(RESULT_OK, intent); finish(); I don't understand why when I navigate from the second Activity to the Main, the ProgressDialog will show ONLY AFTER that the UI refreshes... In this way the Progress Dialog stays on the screen only for half second... and then hides! :( I'd like to see the ProgressDialog on top during all the download time! Help, please. Thank you all

    Read the article

  • Help renaming svn repository

    - by rascher
    Here is the deal: I created an SVN repository, say, foo. It is at http://www.example.com/foo. Then I did an svn checkout. I made some updates and changes to my local copy of the code over the week. I haven't committed yet. I realized that I wanted to rename the repository. So I did this: svn copy http://example.com/foo http://example.com/bar svn delete http://example.com/foo I finish my changes (and local svn still thinks I'm working under "foo".) svn commit fails because the repo has been renamed. I try to use svn switch --relocate but it yells at me because svn is awful. I try using the script here to replace "foo" with "bar" in my billion .svn/ folders. This replace is taking a long time. I wonder if something hung? Or maybe sshfs failed? I kill it. Ctrl-C. I look and see that half my files have "foo" and the others have "bar" in the URLs in the sundry .svn/ folders. All I want to do is commit my files with the new name. I could re-checkout the branch, but then I have no way to remember which files I changed, which is why I was using version control in the first place, and svn is so godawful at moving and renaming things. What do I need to do to: Have a "clean" copy of my "bar" svn branch? and, most importantly: Commit the changes I made?

    Read the article

  • In the meantime, to be or not to be ... productive!

    - by Jan Kuboschek
    I just moved back to Europe from the US after living there for 7 years. Apart from major adjustment issues, I'm currently looking for a job over here. I'm mainly interested in (IT) Consulting and, since these jobs typically require programming knowledge, such as Java, I'm trying to think of something productive to write (perhaps to demo my skills) while I'm waiting for my interviews (starting in two weeks. Folks here are a bit slower than in the US apparently...). I graduated from college about a year and a half ago and have a 4 year degree in international management/economics and about 3/4 of a 2 year degree in computer science finished. I've written my fair share of web software over the years, but nothing concrete that I could show, especially not in Java. Now, I've never had the problem of not having any idea what to write. Basic games I could write, but I'm not sure how well that'll come over when I walk into my interview and say "hey, I was bored. Take a look at my multiplayer space invaders game! Wanna try beating me??". Any thoughts? I browsed SourceForge the other day to find a nice little project to contribute to, but decided that I don't want to commit to someone else's project at this time. Any ideas, perhaps from someone who has been, or currently is, in a similar position would be much appreciated. Oh, and lastly: Instead of developing a program or two to demonstrate my skills, I could spend my time brushing up on UML and Perl. Any suggestions regarding that? Writing a demo vs. learning something new?

    Read the article

  • How do I efficiently parse a CSV file in Perl?

    - by Mike
    I'm working on a project that involves parsing a large csv formatted file in Perl and am looking to make things more efficient. My approach has been to split() the file by lines first, and then split() each line again by commas to get the fields. But this suboptimal since at least two passes on the data are required. (once to split by lines, then once again for each line). This is a very large file, so cutting processing in half would be a significant improvement to the entire application. My question is, what is the most time efficient means of parsing a large CSV file using only built in tools? note: Each line has a varying number of tokens, so we can't just ignore lines and split by commas only. Also we can assume fields will contain only alphanumeric ascii data (no special characters or other tricks). Also, i don't want to get into parallel processing, although it might work effectively. edit It can only involve built-in tools that ship with Perl 5.8. For bureaucratic reasons, I cannot use any third party modules (even if hosted on cpan) another edit Let's assume that our solution is only allowed to deal with the file data once it is entirely loaded into memory. yet another edit I just grasped how stupid this question is. Sorry for wasting your time. Voting to close.

    Read the article

  • git submodule pull and commit automatically on webserver

    - by Lukas Oppermann
    I have the following setup, I am working on a project project with the submodule submodule. Whenever I push changes to github it sends a post request to update.php on the server. This php file executes a git command. Without submodules I can just do a git pull and everything is fine but with submodules it is much more difficult. I have this at the moment, but it does not do what I want. I should git pull the repo and update and pull the latest version of each submodule. <?php echo `git submodule foreach 'git checkout master; git pull; git submodule update --init --recursive; git commit -m "updating"' && git pull && git submodule foreach 'git add -A .' && git commit -m "updating to latest version including submodules" 2>&1s`; EDIT// Okay, I got it half way done. <?php echo `git submodule foreach 'git checkout master; git pull; git submodule update --init --recursive; git commit -am "updating"; echo "updated"' && git pull && git commit -am "updating to latest version including submodules" && echo 'updated'`; The echo prevents the script to stop because of non-zero returned. It works 100% fine when I run it from the console using php update.php. When github initialized the file, or I run it from the browser it still does not work. Any ideas?

    Read the article

  • Why "Content-Length: 0" in POST requests?

    - by stesch
    A customer sometimes sends POST requests with Content-Length: 0 when submitting a form (10 to over 40 fields). We tested it with different browsers and from different locations but couldn't reproduce the error. The customer is using Internet Explorer 7 and a proxy. We asked them to let their system administrator see into the problem from their side. Running some tests without the proxy, etc.. In the meantime (half a year later and still no answer) I'm curious if somebody else knows of similar problems with a Content-Length: 0 request. Maybe from inside some Windows network with a special proxy for big companies. Is there a known problem with Internet Explorer 7? With a proxy system? The Windows network itself? Google only showed something in the context of NTLM (and such) authentication, but we aren't using this in the web application. Maybe it's in the way the proxy operates in the customer's network with Windows logins? (I'm no Windows expert. Just guessing.) I have no further information about the infrastructure.

    Read the article

  • append text to lines in a CSV file

    - by MichaelMcCabe
    This question seems to have been asked a million times around the web, but I cannot find an answer which will work for me. Basically, I have a CSV file which has a number of columns (say two). The program goes through each row in the CSV file, taking the first column value, then asks the user for the value to be placed in the second column. This is done on a handheld running Windows 6. I am developing using C#. It seems a simple thing to do. But I cant seem to add text to a line. I cant use OleDb, as System.Data.Oledb isnt in the .Net version I am using. I could use another CSV file, and when they complete each line, it writes it to another CSV file. But the problems with that are - The file thats produced at the end needs to contain EVERY line (so what if they pull the batterys out half way). And what if they go back, to continue doing this another time, how will the program know where to start back from.

    Read the article

  • Vectorize matrix operation in R

    - by Fernando
    I have a R x C matrix filled to the k-th row and empty below this row. What i need to do is to fill the remaining rows. In order to do this, i have a function that takes 2 entire rows as arguments, do some calculations and output 2 fresh rows (these outputs will fill the matrix). I have a list of all 'pairs' of rows to be processed, but my for loop is not helping performance: # M is the matrix # nrow(M) and k are even, so nLeft is even M = matrix(1:48, ncol = 3) # half to fill k = nrow(M)/2 # simulate empty rows to be filled M[-(1:k), ] = 0 cat('before fill') print(M) # number of empty rows to fill nLeft = nrow(M) - k nextRow = k + 1 # list of rows to process (could be any order of non-empty rows) idxList = matrix(1:k, ncol = 2) for ( i in 1 : (nLeft / 2)) { row1 = M[idxList[i, 1],] row2 = M[idxList[i, 2],] # the two columns in 'results' will become 2 rows in M # fake result, return 2*row1 and 3*row2 results = matrix(c(2*row1, 3*row2), ncol = 2) # fill the matrix M[nextRow, ] = results[, 1] nextRow = nextRow + 1 M[nextRow, ] = results[, 2] nextRow = nextRow + 1 } cat('after fill') print(M) I tried to vectorize this, but failed... appreciate any help on improving this code, thanks!

    Read the article

  • merging two tables, while applying aggregates on the duplicates (max,min and sum)

    - by cloudraven
    I have a table (let's call it log) with a few millions of records. Among the fields I have Id, Count, FirstHit, LastHit. Id - The record id Count - number of times this Id has been reported FirstHit - earliest timestamp with which this Id was reported LastHit - latest timestamp with which this Id was reported This table only has one record for any given Id Everyday I get into another table (let's call it feed) with around half a million records with these fields among many others: Id Timestamp - Entry date and time. This table can have many records for the same id What I want to do is to update log in the following way. Count - log count value, plus the count() of records for that id found in feed FirstHit - the earliest of the current value in log or the minimum value in feed for that id LastHit - the latest of the current value in log or the maximum value in feed for that id. It should be noticed that many of the ids in feed are already in log. The simple thing that worked is to create a temporary table and insert into it the union of both as in Select Id, Min(Timestamp) As FirstHit, MAX(Timestamp) as LastHit, Count(*) as Count FROM feed GROUP BY Id UNION ALL Select Id, FirstHit,LastHit,Count FROM log; From that temporary table I do a select that aggregates Min(firsthit), max(lasthit) and sum(Count) Select Id, Min(FirstHit),Max(LastHit),Sum(Count) FROM @temp GROUP BY Id; and that gives me the end result. I could then delete everything from log and replace it with everything with temp, or craft an update for the common records and insert the new ones. However, I think both are highly inefficient. Is there a more efficient way of doing this. Perhaps doing the update in place in the log table?

    Read the article

  • Audio Streaming Latency

    - by killianmcc
    I'm writing a UDP local area network video chat system and have got the video and audio streams working. However I'm experiencing a little latency (about half a second) in the audio and was wondering what codecs would provide the least latency. I'm using NAudio (http://naudio.codeplex.com/) which provides me access to the following codecs for streaming; Speex Narrow Band (VBR) Speex Wide Band (16kHz)(VBR) Speex Ultra Wide Band (32kHz)(VBR) DSP Group TrueSpeech (8.5kbps) GSM 6.10 (13kbps) Microsoft ADPCM (32.8kbps) G.711 a-law (64kbps) G.722 16kHz (64kbps) G.711 mu-law (64kbps) PCM 8kHz 16 bit uncompressed (128kbps) I've tried them out and I'm not noticing much difference. Is there any others that I should download and try to reduce latency? I'm only going to be sending voice over the connection but I'm not really worried about quality or background noises too much. UPDATE I'm sending the audio in blocks like so; waveIn = new WaveIn(); waveIn.BufferMilliseconds = 50; waveIn.DeviceNumber = inputDeviceNumber; waveIn.WaveFormat = codec.RecordFormat; waveIn.DataAvailable += waveIn_DataAvailable; void waveIn_DataAvailable(object sender, WaveInEventArgs e) { if (connected) { byte[] encoded = codec.Encode(e.Buffer, 0, e.BytesRecorded); udpSender.Send(encoded, encoded.Length); } }

    Read the article

  • C# Sql Connection Best Practises 2013

    - by Pete Petersen
    With the new year approaching I'm drawing up a development plan for 2013. I won't bore you with the details but I started thinking about whether the way I do things is actually the 'correct' way. In particular how I'm interfacing with SQL. I create predominantly create WPF desktop applications and often some Silverlight Web Applications. All of my programs are very Data-Centric. When connecting to SQL from WPF I tend to use Stored Procedures stored on the server and fetch them using ADO.NET (e.g. SQLConnection(), .ExecuteQuery()). However with Silverlight I have a WCF service and use LINQ to SQL (and I'm using LINQ much more in WPF). My question is really is am I doing anything wrong in a sense that it's a little old fashioned? I've tried to look this up online but could find anything useful after about 2010 and of those half were 'LINQ is dead!' and the other 'Always use LINQ' Just want to make sure going forward I'm doing the right things the right way, or at least the advised way :). What principles are you using when connecting to SQL? Is it the same for WPF and Silverlight/WCF?

    Read the article

  • Detect that the onscreen keyboard has been displayed on Windows Phone 7

    - by David_001
    Simple question: How do I detect that the onscreen keyboard has been displayed on windows mobile 7? Is there an event I can add a listener to? It takes up about half the screen and I want to scroll the view up when it gets displayed... EDIT: A comment below indicates more clearly what I'm trying to do: I have a textbox input, and as the user types into it an autocomplete dropdown appears below it (like google suggest). By default, the active control (the textbox) scrolls into view when focussed, and the onscreen keyboard is directly below it. The onscreen keyboard appears in front of my autocomplete dropdown - what I want to do is make the screen scroll a little further up, so there's some room for my dropdown to be shown. The windows phone UI design guidelines say: "When the keyboard is deployed, the application should scroll to ensure the active edit control and the caret are in view". This happens fine, it's just the non-active dropdown gets hidden behind the onscreen keyboard. The guidelines also say that an application can choose to show the onscreen keyboard, and can also choose to close it. At the moment i'm stuck, and I don't think (based on my research and the replies to this question) that it's possible to detect that the onscreen keyboard has been displayed. I'm moving my investigation to see if it's possible to determine the "visible area" of the page (width & height in pixels for example), and combine this with an onfocus for the textbox... not sure if this will prove fruitful though.

    Read the article

  • Sys. engineer has decided to dynamically transform all XSLs into DLLs on website build process. DLL

    - by John Sullivan
    Hello, OS: Win XP. Here is my situation. I have a browser based application. It is "wrapped" in a Visual Basic application. Our "Systems Engineer Senior" has decided to spawn DLL files from all of our XSL pages (many of which have duplicate names) upon building a new instance of the website and have the active server pages (ASPX) use the DLL instead. This has created a "known issue" in which ~200 DLL naming conflicts occur and, thus, half of our application is broken. I think a solution to this problem is that, thankfully, we're generating the names of the DLLs and linking them up with our application dynamically. Therefore we can do something kludgy like generate a hash and append it to the end of the DLL file name when we build our website, then always reference the DLL that had some kind of random string / hash appended to its name. Aside from outright renaming the DLLs, is there another way to have multiple DLLs with the same name register for one application? I think the answer is "No, only between different applications using a special technique." Please confirm. Another question I have on my mind is whether this whole idea is a good practice -- converting our XSL pages (which we use in mass -- every time a response from our web app occurs) into DLL functions that call a "function" to do what the XSL page did via an active server page (ASPX), when we were before just sending an XML response to an XSL page via aspx.

    Read the article

  • Structuring iPhone/iPad application views

    - by Mark
    I have an idea about an application that I want to build and Im new to iPhone/iPad development (but not new to development in other languages/frameworks such as .NET and Java). I want to layout some views on the screen so that they animate (slide in) from different directions into their places. The question is about the strucuture of the application, if I have say 4 rectanglular areas on the screen that contain business data, such as contacts (name, photo, etc...) and they all take up different widths of the screen (say the first contact takes up one row of the screen, but the next 2 take up half the width of the next row each, and so on). Should I create a custom view for the different sized contact views, (i.e. LargeCustomView and SmallCustomView, and any other special type that I make) or should it all be one type, say, CustomerDetailsView which could be stretched to fit at design time? Also, if there were, say, 3 different instances of the same custom view on the one screen, are there 3 instances of the view controller also? Im a little confused about powering the data behind a view, can someone shed some light on this for me? Do I just set the properties (say an instance variable ContactForView) on the view controller for each instance? Thanks for any help you can give Cheers, Mark

    Read the article

  • How do I simplify my code?

    - by Mitchell Skurnik
    I just finished creating my first major application in C#/Silverlight. In the end the total line count came out to over 12,000 lines of code. Considering this was a rewrite of a php/javascript application I created 2 years that was over 28,000 lines I am actually quite proud of my accomplishment. After reading many questions and answers here on stackoverflow and other sites online, I followed many posters advice: I created classes, procedures, and such for things that I would have a year ago copied and pasted; I created logic charts to figure out complex functions; making sure there are no crazy hidden characters (used tabs instead of spaces); and a few others things; place comments where necessary (I have lots of comments). My application consists of 4 tiles laid out horizontally that have user controls loaded into each slice. You can have between one and four slices loaded at anytime. If you have once slice loaded, the slice takes up the entire artboard...if you have 2 loaded, each take up half, 3 a third, 4 a quarter. Each one of these slices represent (for the sake of this example) a light control. Each slice has 3 slider controls in it. Now when I coded the functionality of the sliders, I used a switch/case statement inside of a public function that would run the command on the specified slice/slider. The made for some duplicate code but I saw no way around it as each slice was named differently. So I would do slice1.my.commands(); slice2.my.commands(); etc. My question to you is how do I clean up my code even futher? (Sadly I cannot post any of my code). Is there any way to take this repetion out of my code?

    Read the article

  • C Population Count of unsigned 64-bit integer with a maximum value of 15

    - by BitTwiddler1011
    I use a population count (hamming weight) function intensively in a windows c application and have to optimize it as much as possible in order to boost performance. More than half the cases where I use the function I only need to know the value to a maximum of 15. The software will run on a wide range of processors, both old and new. I already make use of the POPCNT instruction when Intel's SSE4.2 or AMD's SSE4a is present, but would like to optimize the software implementation (used as a fall back if no SSE4 is present) as much as possible. Currently I have the following software implementation of the function: inline int population_count64(unsigned __int64 w) { w -= (w 1) & 0x5555555555555555ULL; w = (w & 0x3333333333333333ULL) + ((w 2) & 0x3333333333333333ULL); w = (w + (w 4)) & 0x0f0f0f0f0f0f0f0fULL; return int(w * 0x0101010101010101ULL) 56; } So to summarize: (1) I would like to know if it is possible to optimize this for the case when I only want to know the value to a maximum of 15. (2) Is there a faster software implementation (for both Intel and AMD CPU's) than the function above?

    Read the article

  • Python Webkit browser's inspector is missing a few things

    - by NoBugs
    I'm using a Webkit browser inspector like this. When I run it in Ubuntu 12.10, I'm getting errors when using the inspector. For example: ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Go to line" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Filter" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Search Previous" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Search Next" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "a:" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "%d of %d" not found. (geany:2487): Gdk-CRITICAL **: IA__gdk_error_trap_pop: assertion `gdk_error_traps != NULL' failed ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Sources Panel" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Toggle breakpoint" not found. ** Message: console message: file:///usr/share/webkitgtk-1.0/webinspector/UIString.js @42: Localized string "Painting" not found. I also noticed the breadcrumb/slider bar doesn't show when you have the console in the lower half: I don't remember this in earlier versions, and when I use the GTK3 version (from gi.repository import WebKit etc) it has similar problem, and is even worse, scrollbars don't have arrows at top and bottom. Am I missing a step on initializing the Webkit inspector or English locale for it? I would like to debug this issue, but since the inspector object isn't a webview object, I'm not sure I can add an inspector to the inspector? (like how you can use F12 when inspector is its own window in Chrome/Chromium, which lets you debug that inspector). It should be possible, but maybe not with pyGTK?

    Read the article

  • JavaScript array random index insertion and deletion

    - by Tomi
    I'm inserting some items into array with randomly created indexes, for example like this: var myArray = new Array(); myArray[123] = "foo"; myArray[456] = "bar"; myArray[789] = "baz"; ... In other words array indexes do not start with zero and there will be "numeric gaps" between them. My questions are: Will these numeric gaps be somehow allocated (and therefore take some memory) even when they do not have assigned values? When I delete myArray[456] from upper example, would items below this item be relocated? EDIT: Regarding my question/concern about relocation of items after insertion/deletion - I want to know what happens with the memory and not indexes. More information from wikipedia article: Linked lists have several advantages over dynamic arrays. Insertion of an element at a specific point of a list is a constant-time operation, whereas insertion in a dynamic array at random locations will require moving half of the elements on average, and all the elements in the worst case. While one can "delete" an element from an array in constant time by somehow marking its slot as "vacant", this causes fragmentation that impedes the performance of iteration.

    Read the article

  • Fill lower matrix with vector by row, not column

    - by mhermans
    I am trying to read in a variance-covariance matrix written out by LISREL in the following format in a plain text, whitespace separated file: 0.23675E+01 0.86752E+00 0.28675E+01 -0.36190E+00 -0.36190E+00 0.25381E+01 -0.32571E+00 -0.32571E+00 0.84425E+00 0.25598E+01 -0.37680E+00 -0.37680E+00 0.53136E+00 0.47822E+00 0.21120E+01 -0.37680E+00 -0.37680E+00 0.53136E+00 0.47822E+00 0.91200E+00 0.21120E+01 This is actually a lower diagonal matrix (including diagonal): 0.23675E+01 0.86752E+00 0.28675E+01 -0.36190E+00 -0.36190E+00 0.25381E+01 -0.32571E+00 -0.32571E+00 0.84425E+00 0.25598E+01 -0.37680E+00 -0.37680E+00 0.53136E+00 0.47822E+00 0.21120E+01 -0.37680E+00 -0.37680E+00 0.53136E+00 0.47822E+00 0.91200E+00 0.21120E+01 I can read in the values correctly with scan() or read.table(fill=T). I am however not able to correctly store the read-in vector in a matrix. The following code S <- diag(6) S[lower.tri(S,diag=T)] <- d fills the lower matrix by column, while it should fill it by row. Using matrix() does allow for the option byrow=TRUE, but this will fill in the whole matrix, not just the lower half (with diagonal). Is it possible to have both: only fill the lower matrix (with diagonal) and do it by row? (separate issue I'm having: LISREL uses 'D+01' while R only recognises 'E+01' for scientific notation. Can you change this in R to accept also 'D'?)

    Read the article

  • C++ map performance - Linux (30 sec) vs Windows (30 mins) !!!

    - by sonofdelphi
    I need to process a list of files. The processing action should not be repeated for the same file. The code I am using for this is - using namespace std; vector<File*> gInputFileList; //Can contain duplicates, File has member sFilename map<string, File*> gProcessedFileList; //Using map to avoid linear search costs void processFile(File* pFile) { File* pProcessedFile = gProcessedFileList[pFile->sFilename]; if(pProcessedFile != NULL) return; //Already processed foo(pFile); //foo() is the action to do for each file gProcessedFileList[pFile->sFilename] = pFile; } void main() { size_t n= gInputFileList.size(); //Using array syntax (iterator syntax also gives identical performance) for(size_t i=0; i<n; i++){ processFile(gInputFileList[i]); } } The code works correctly, but... My problem is that when the input size is 1000, it takes 30 minutes - HALF AN HOUR - on Windows/Visual Studio 2008 Express (both Debug and Release builds). For the same input, it takes only 40 seconds to run on Linux/gcc! What could be the problem? The action foo() takes only a very short time to execute, when used separately. Should I be using something like vector::reserve for the map?

    Read the article

< Previous Page | 102 103 104 105 106 107 108 109 110 111 112 113  | Next Page >