Search Results

Search found 7583 results on 304 pages for 'roger guess'.

Page 12/304 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Sort array by two specifics values in PHP

    - by Roger
    The folks have already showed me how to sort an array by a specific value using usort and a fallback function in PHP. What if this specifc value doesn't exist and we have to use two values? in the example bellow the values [4] and [5]... In other words, I want to do this: order all objects numericaly by the fith value of each object from the highest to the lowest, and addicionally, for those objects that have the fifht value is empty (in the examplem '-'), order them by the fourth value. Array( [0] => Array( [0] => links-patrocinados [1] => adwords [2] => 0,5 [3] => R$92,34 [4] => 823000 [5] => 49500 ) [1] => Array( [0] => adwords [1] => google adwords como funciona [2] => 0,38 [3] => R$0,20 [4] => 480 [5] => 480 ) [2] => Array( [0] => links-patrocinados [1] => adword [2] => 0,39 [3] => R$58,77 [4] => 49500 [5] => 2900 ) [3] => Array( [0] => agencia [1] => agencias viagens espanholas [2] => - [3] => R$0,20 [4] => 58 [5] => - ) [4] => Array( [0] => agencia [1] => era agencia imobiliaria [2] => - [3] => R$0,20 [4] => 73 [5] => - ) )

    Read the article

  • iPhone - a question about @property

    - by Roger
    Hi, I am kind of newbie on Objective-C and I was looking at a code, trying to understand a few things, and I come across with this .h file: there was a declaration like that on the @interface section MyVideoClass *contrast_; then below we have @property (nonatomic, retain) MyVideoClass *contrast; @property (nonatomic, retain) FetchClass *fetchMe; The strange part is that the first has an underscrore after the name and the second one, doesn't. The other strange thing is that the guy has a call to these properties like this: FetchClass *fetchOne = [self.fetchMe contrast]; What kind of call is that? This seems pretty insane to me. I simply cannot understand what is going on here, but the code works. pretty insane. Can you guys explain me that? Forgive the stupid question, but I am still learning... thanks

    Read the article

  • What are the rules about using an underscore in a C++ identifier?

    - by Roger Lipscombe
    It's common in C++ to name member variables with some kind of prefix to denote the fact that they're member variables, rather than local variables or parameters. If you've come from an MFC background, you'll probably use "m_foo". I've also seen "myFoo" occasionally. C# (or possibly just .NET) seems to recommend using just an underscore, as in "_foo". Is this allowed by the C++ standard?

    Read the article

  • Is private method in spring service implement class thread safe

    - by Roger Ray
    I got a service in an project using Spring framework. public class MyServiceImpl implements IMyService { public MyObject foo(SomeObject obj) { MyObject myobj = this.mapToMyObject(obj); myobj.setLastUpdatedDate(new Date()); return myobj; } private MyObject mapToMyObject(SomeObject obj){ MyObject myojb = new MyObject(); ConvertUtils.register(new MyNullConvertor(), String.class); ConvertUtils.register(new StringConvertorForDateType(), Date.class); BeanUtils.copyProperties(myojb , obj); ConvertUtils.deregister(Date.class); return myojb; } } Then I got a class to call foo() in multi-thread; There goes the problem. In some of the threads, I got error when calling BeanUtils.copyProperties(myojb , obj); saying Cannot invoke com.my.MyObject.setStartDate - java.lang.ClassCastException@2da93171 obviously, this is caused by ConvertUtils.deregister(Date.class) which is supposed to be called after BeanUtils.copyProperties(myojb , obj);. It looks like one of the threads deregistered the Date class out while another thread was just about to call BeanUtils.copyProperties(myojb , obj);. So My question is how do I make the private method mapToMyObject() thread safe? Or simply make the BeanUtils thread safe when it's used in a private method. And will the problem still be there if I keep the code this way but instead I call this foo() method in sevlet? If many sevlets call at the same time, would this be a multi-thread case as well?

    Read the article

  • Text substitution (reading from file and saving to the same file) on linux with sed...

    - by Roger
    I want to read the file "teste", make some "find&replace" and overwrite "teste" with the results. The closer i got till now is: $cat teste I have to find something This is hard to find... Find it wright now! $sed -n 's/find/replace/w teste1' teste $cat teste1 I have to replace something This is hard to replace... If I try to save to the same file like this: $sed -n 's/find/replace/w teste' teste or: $sed -n 's/find/replace/' teste > teste The result will be a blank file... I know I am missing something very stupid but any help will be welcome. UPDATE: Based on the tips given by the folks and this link: http://idolinux.blogspot.com/2008/08/sed-in-place-edit.html here's my updated code: sed -i -e 's/find/replace/g' teste

    Read the article

  • undefined method `output_data' for #<EventManager:0x007fa4220320c8> (NoMethodError)

    - by Roger Camps
    I keep getting this error: event_manager.rb:83:in': undefined method output_data' for #<EventManager:0x007fc5018320c0> (NoMethodError) I am following the exercise on this website: Here is my code (My error comes towards the end with DEF OUTPUT_DATA ...): # Dependencies require "csv" # Class Definition class EventManager INVALID_PHONE_NUMBER = "0000000000" INVALID_ZIPCODE = "00000" def initialize puts "EventManager Initialized." filename = "event_attendees.csv" @file = CSV.open(filename, {:headers => true, :header_converters => :symbol}) end def print_names @file.each do |line| puts line.inspect puts line[2] + " " + line[3] end end #printing home phone number method def print_numbers @file.each do |line| number = clean_number(line[:homephone]) puts number end end #cleaning numbers method def clean_number(number) cleaner= number.delete('.' + ')' + '(' + '-') if cleaner.length == 10 # Do Nothing elsif cleaner.length == 11 if cleaner.start_with?("1") cleaner = cleaner[1..-1] else cleaner = INVALID_PHONE_NUMBER end else cleaner = INVALID_PHONE_NUMBER end return cleaner end def clean_zipcode(original) if original.nil? zipcode = INVALID_ZIPCODE elsif original.length < 5 while original.length < 5 original = original.insert(0, "0") end else return original end return zipcode end def print_zipcodes @file.each do |line| zipcode = clean_zipcode(line[:zipcode]) puts zipcode end def output_data output = CSV.open("event_attendees_clean.csv", "w") @file.each do |line| output << line end end end end # Script manager = EventManager.new #manager.print_numbers #manager.print_zipcodes manager.output_data I've tried several things, checked all through the internet and I just can't figure it out myself. I will really appreciate any help. Thank you in advance!

    Read the article

  • Can I run Ubuntu directly under Windows 8?

    - by huahsin68
    Text below is extract from the article, Windows 8 Tip: Virtualize with Hyper-V. Better still, Windows Virtual PC offered a feature called XP Mode, free for users of Windows 7 Professional, Enterprise, and Ultimate, which included a full working copy of Windows XP with Service Pack 3. But the big deal here is that as you installed applications in the virtual copy of XP, they would be made available through Windows 7’s Start Menu. And you could run these applications, side-by-side, with Windows 7 applications on the Windows 7 desktop. It was a seamless, integrated experience, ideal for those one-off application compatibility issues. I was thinking to install VirtualBox in Windows 8 and then run Ubuntu as guess OS. Since Hyper-V is a Type-0 hipervisor, may I know does this bring the same benefit if I have Ubuntu Linux install as a virtual guess OS? Meaning, if I turning the Ubuntu on (the guess OS), does the Ubuntu still able to access the hardware information like nVidia display card or processor information? I'm just curious to know can this be done?

    Read the article

  • SQL SERVER – Validating Unique Columnname Across Whole Database

    - by pinaldave
    I sometimes come across very strange requirements and often I do not receive a proper explanation of the same. Here is the one of those examples. Asker: “Our business requirement is when we add new column we want it unique across current database.” Pinal: “Why do you have such requirement?” Asker: “Do you know the solution?” Pinal: “Sure I can come up with the answer but it will help me to come up with an optimal answer if I know the business need.” Asker: “Thanks – what will be the answer in that case.” Pinal: “Honestly I am just curious about the reason why you need your column name to be unique across database.” (Silence) Pinal: “Alright – here is the answer – I guess you do not want to tell me reason.” Option 1: Check if Column Exists in Current Database IF EXISTS (  SELECT * FROM sys.columns WHERE Name = N'NameofColumn') BEGIN SELECT 'Column Exists' -- add other logic END ELSE BEGIN SELECT 'Column Does NOT Exists' -- add other logic END Option 2: Check if Column Exists in Current Database in Specific Table IF EXISTS (  SELECT * FROM sys.columns WHERE Name = N'NameofColumn' AND OBJECT_ID = OBJECT_ID(N'tableName')) BEGIN SELECT 'Column Exists' -- add other logic END ELSE BEGIN SELECT 'Column Does NOT Exists' -- add other logic END I guess user did not want to share the reason why he had a unique requirement of having column name unique across databases. Here is my question back to you – have you faced a similar situation ever where you needed unique column name across a database. If not, can you guess what could be the reason for this kind of requirement?  Additional Reference: SQL SERVER – Query to Find Column From All Tables of Database Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL System Table, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • how to choose a web framework and javascript library?

    - by Trylks
    I've been procrastinating learning some framework for web apps w/ some library for AJAX, something like django with prototype, or turbogears with mootools, or zeta components with dojo, grok, jquery, symfony... The point is to spend some of my spare time, have "fun" and create cool stuff that hopefully is some useful. I think maybe I wouldn't like something like GWT or pyjamas because I wouldn't like to "get married" with some technology, I want to keep my freedom to add another javascript library, and so on. I didn't decide even the language yet, but I think I'd prefer python. PHP could be fine if there is some framework that is nice enough. Besides that, I don't even know where to start. I don't feel like learning a framework to then realize there is something that I cannot comfortably do, switch to another framework then find that a third framework has something really cool, etc. And the same goes for javascript libraries. So, some guidance would be really appreciated. I don't really know why are so many options available and what do they aim for, I guess some of them focus on some aspects and some on others, but I just want to make cool and nice apps that I can easily maintain, without spending too much time on coding or learning and avoiding the "trapped in the framework" feeling, when doing something is awfully complicated (or even impossible) with compared with the rest of things or doing that same thing on a different framework. I guess in the end I'll go for django and jquery since they are the most widely used options, afaik, but if I was going for the most widely used options I guess I should choose Java or PHP (I don't really like Java for my spare time, but php is not so bad), so I preferred to ask first. I think the question has to consider both, framework and library, since sometimes they are coupled. I think this is the place to ask this kind of things, sorry if not, and thank you.

    Read the article

  • Randomly and uniquely iterating over a range

    - by Synetech
    Say you have a range of values (or anything else) and you want to iterate over the range and stop at some indeterminate point. Because the stopping value could be anywhere in the range, iterating sequentially is no good because it causes the early values to be accessed more often than later values (which is bad for things that wear out), and also because it reduces performance since it must traverse extra values. Randomly iterating is better because it will (on average) increase the hit-rate so that fewer values have to be accessed before finding the right one, and also distribute the accesses more evenly (again, on average). The problem is that the standard method of randomly jumping around will result in values being accessed multiple times, and has no automatic way of determining when each value has been checked and thus the whole range has been exhausted. One simplified and contrived solution could be to make a list of each value, pick one at random, then remove it. Each time through the loop, you pick one fromt he set of remaining items. Unfortunately this only works for small lists. As a (forced) example, say you are creating a game where the program tries to guess what number you picked and shows how many guess it took. The range is between 0-255 and instead of asking Is it 0? Is it 1? Is it 2?…, you have it guess randomly. You could create a list of 255 numbers, pick randomly and remove it. But what if the range was between 0-232? You can’t really create a 4-billion item list. I’ve seen a couple of implementations RNGs that are supposed to provide a uniform distribution, but none that area also supposed to be unique, i.e., no repeated values. So is there a practical way to randomly, and uniquely iterate over a range?

    Read the article

  • What is the recommended MongoDB schema for this quiz-engine scenario?

    - by hughesdan
    I'm working on a quiz engine for learning a foreign language. The engine shows users four images simultaneously and then plays an audio file. The user has to match the audio to the correct image. Below is my MongoDB document structure. Each document consists of an image file reference and an array of references to audio files that match that image. To generate a quiz instance I select four documents at random, show the images and then play one audio file from the four documents at random. The next step in my application development is to decide on the best document schema for storing user guesses. There are several requirements to consider: I need to be able to report statistics at a user level. For example, total correct answers, total guesses, mean accuracy, etc) I need to be able to query images based on the user's learning progress. For example, select 4 documents where guess count is 10 and accuracy is <=0.50. The schema needs to be optimized for fast quiz generation. The schema must not cause future scaling issues vis a vis document size. Assume 1mm users who make an average of 1000 guesses. Given all of this as background information, what would be the recommended schema? For example, would you store each guess in the Image document or perhaps in a User document (not shown) or a new document collection created for logging guesses? Would you recommend logging the raw guess data or would you pre-compute statistics by incrementing counters within the relevant document? Schema for Image Collection: _id "505bcc7a45c978be24000005" date 2012-09-21 02:10:02 UTC imageFileName "BD3E134A-C7B3-4405-9004-ED573DF477FE-29879-0000395CF1091601" random 0.26997075392864645 user "2A8761E4-C13A-470E-A759-91432D61B6AF-25982-0000352D853511AF" audioFiles [ 0 { audioFileName "C3669719-9F0A-4EB5-A791-2C00486665ED-30305-000039A3FDA7DCD2" user "2A8761E4-C13A-470E-A759-91432D61B6AF-25982-0000352D853511AF" audioLanguage "English" date 2012-09-22 01:15:04 UTC } 1 { audioFileName "C3669719-9F0A-4EB5-A791-2C00486665ED-30305-000039A3FDA7DCD2" user "2A8761E4-C13A-470E-A759-91432D61B6AF-25982-0000352D853511AF" audioLanguage "Spanish" date 2012-09-22 01:17:04 UTC } ]

    Read the article

  • Pondering New Technology

    - by MOSSLover
    So I have been standing at the end of a fork for a year peering down a corner looking at this way and that way trying to figure out where I fit in.  I was so enthusiastic and excited about Silverlight when it came out.  It was this amazing awesome technology that had this really cool animation and webcam/multimedia piece.  I thought if I put my money on Silverlight it’s going somewhere, then HTML 5 came out and the wind shifted.  I realized times were changing. I have been working with web technologies since I was 15 years old.  Playing with html and javascript and even css back when it first came out.  In tech years 15 years is forever.  Things change so quickly and so often.  So I guess the question is where am I heading?  The answer is mobile technology.  For some reason I was resisting change and I have no idea why.  I guess I really wanted to see more than one player.  I didn’t quite feel that Microsoft was ready with Windows Phone 7.  It was a great start, but it just didn’t feel like they went all the way.  Now with Windows 8 it feels like they are at version 2.0.  It’s like hitting Silverlight 2.0 where they finally added the .Net bits.  The path is paved, but we don’t know where it’s leading.  Then we had 3.0, 4.0, and 5.0 to mature the technology into what it is today (man I’m hoping they are going to roll some of the cool bits into other tech if they don’t exist). Anyway, I’m on board, but I’m not buying a Windows Tablet just yet.  I was hoping for a 7 inch screen from Apple around $300 or just above and a 7 inch screen from the MS side around the same price.  What I got was the Apple side, but nothing from Microsoft.  I was pretty disappointed with the $500 market price on the RT version.  I realized Microsoft is close, but not quite where Apple is today.  Yes the devices have Office that they are offering, but the sticker is just too much for a first generation device.  If you guys remember correctly the first generation iPad was quite expensive.  I guess for a 1st generation device $500 is pretty good. So I guess what I’m trying to say is that I am shifting my focus entirely away from Silverlight and more towards mobile.  I will be doing a lot of postings on iOS, Windows 8, and Windows Phone 8 with SharePoint 2013.  Since I don’t have a tablet and don’t foresee myself buying one just yet it might be mostly on the phones for right now.  I want to do a bunch of testing on various devices on what needs to be done in apps on each device.  I might add a bit on porting code from one to the other.  I think it’s going to be a lot of fun and make things flow a little better for me.  In a way it’s kind of like Star Trek 6 where they talk about the Undiscovered Country.  I’m going to jump forward completely and see where I land. Technorati Tags: SharePoint 2013,Mobile,Windows 8,iOS

    Read the article

  • Best Practices around Oracle VM with RAC: RAC SIG webcast - Thursday, March 18th -

    - by adam.hawley
    The RAC SIG will be hosting an interesting webcast this Thursday, March 18th at 9am pacific time (5pm GMT) on: Best Practices around Oracle VM with RAC The adaptation of virtualization technology has risen tremendously and continues to grow due to the rapid change and growth rate of IT infrastructures. With this in mind, this seminar focuses on configuration best practices, examining how Oracle RAC scales & performs in a virtualized environment, and evaluating Oracle VM Server's ease of use. Roger Lopez from Dell IT will be presenting. This Week's Webcast Connection Info: ==================================== Webcast URL (use Internet Explorer): https://ouweb.webex.com/ouweb/k2/j.php?ED=134103137&UID=1106345812&RT=MiM0 Voice can either be heard via the webconference or via the following dial in: Participant Dial-In 877-671-0452 International Dial-In 706-634-9644 International Dial-In No Link http://www.intercall.com/national/oracleuniversity/gdnam.html Intercall Password 86336

    Read the article

  • 45 % des internautes chinois utiliseraient toujours Internet Explorer 6, comment faire disparaître le logiciel du pays ?

    45.2% des internautes chinois utiliseraient toujours Internet Explorer 6, comment faire disparaître le logiciel du pays ? Mise à jour du 07.12.2010 par Katleen Une étude récente vient de révéler que le vieux navigateur fait de la résistance en Chine. Alors que dans le monde entier, la part de marché de l'ancêtre est de 7.6%, elle atteint presque 50% dans ce pays (ce qui donne alors un total de 14.6% dans le monde, Chine incluse). Un cauchemar pour Microsoft, qui aimerait bien voir ce logiciel disparaître du globe. Roger Capriotti, chef de produit marketing pour Internet Explorer, à en effet pour mission de réduire la part de marché d'IE6 à 0. Malgré tou...

    Read the article

  • SQL Server 2012 content on Channel 9

    - by jamiet
    A mountain of SQL Server 2012 video content featuring Greg Low, Jonathan Kehayias, Joe Sack and Roger Doherty has just been released on Channel 9. Channel 9 has great support for tags and RSS feeds so if you want to automatically download all of that content simply you can add the following RSS feed: http://channel9.msdn.com/Tags/sql+server+2012/RSS to your podcast reader of choice and have fun learning about all the new features in SQL Server 2012 such as: AlwaysOn Power View SSDT SSRS Data Alerts SSAS Tabular Modelling DAX Improvements MDS improvements SSIS improvements DQS StreamInsight improvements Data-Tier Apps (DACs) LocalDB FileTable Spatial improvements T-SQL paging Distributed Replay XEvents improvements ADO.Net Code-first T-SQL improvements Server roles Partitioning improvements ColumnStore Whew, quite a list! @jamiet

    Read the article

  • SQL Server 2012 content on Channel 9

    - by jamiet
    A mountain of SQL Server 2012 video content featuring Greg Low, Jonathan Kehayias, Joe Sack and Roger Doherty has just been released on Channel 9. Channel 9 has great support for tags and RSS feeds so if you want to automatically download all of that content simply you can add the following RSS feed: http://channel9.msdn.com/Tags/sql+server+2012/RSS to your podcast reader of choice and have fun learning about all the new features in SQL Server 2012 such as: AlwaysOn Power View SSDT SSRS Data Alerts SSAS Tabular Modelling DAX Improvements MDS improvements SSIS improvements DQS StreamInsight improvements Data-Tier Apps (DACs) LocalDB FileTable Spatial improvements T-SQL paging Distributed Replay XEvents improvements ADO.Net Code-first T-SQL improvements Server roles Partitioning improvements ColumnStore Whew, quite a list! @jamiet

    Read the article

  • In case you missed our Febrary Oracle Database Webcasts....

    - by jenny.gelhausen
    Click below to register and listen to the February Database Webcast replays: Maximize Availability with Oracle Database 11g with Oracle Database expert Joe Meeks. Think Your Database Applications are Secure? Think Again. with Oracle Security expert Roxana Bradescu. SANS Oracle Database Security: A Defense in Depth Approach with SANS senior instructor Tanya Baccam. Upgrading to Oracle Database 11g with Roger Snowden from Oracle Support's Center of Expertise. Consolidate for Business Advantage: From Storage to Scorecard with Oracle Business Intelligence and Enterprise Performance Management expert Tobin Gilman. Enjoy! var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-13185312-1"); pageTracker._trackPageview(); } catch(err) {}

    Read the article

  • My integer overfloweth

    - by darcy
    While certain classes like java.lang.Integer and java.lang.Math have been in the platform since the beginning, that doesn't mean there aren't more enhancements to be made in such places! For example, earlier in JDK 8, library support was added for unsigned integer arithmetic. More recently, my colleague Roger Riggs pushed a changeset to support integer overflow, that is, to provide methods which throw an ArithmeticException on overflow instead of returning a wrapped result. Besides being helpful for various programming tasks in Java, methods like the those for integer overflow can be used to implement runtimes supporting other languages, as has been requested at a past JVM language summit. This year's language summit is coming up in July and I hope to get some additional suggestions there for helpful library additions as part of the general discussions of the JVM and Java libraries as a platform.

    Read the article

  • On technical talent

    - by Rob Farley
    In honour of the regular T-SQL Tuesday blogging, the UnSQL theme started, looking at topics that were not directly SQL related, but nevertheless quite interesting. This is the brainchild of Jen McCown, who posted the second of these recently. I’m actually a bit late in responding, as I haven’t got it in my head to look for these posts yet. Still, Jen says I can still contribute now, hence this post. The theme this time is on Tech Giants. I could list people all day for those I admire in the SQL Server space, and go on even longer if I branch out to other areas. But I actually want to highlight four guys that I admire so much for their skills, integrity and general awesomeness that I hired them. Yes – the guys that work for me at LobsterPot Solutions, being Ben McNamara, David Gardiner, Roger Noble and Ashley Sewell. I admire them all, and they present the company with a platform on which to grow.

    Read the article

  • Internet Explorer 9 : 36 millions d'utilisateurs pour la RC, mieux que la version finale de Opera 10

    Internet Explorer 9 : 36 millions d'utilisateurs Pour la RC, mieux que la version finale de Opera 10 Mise à jour du 02/03/11 Selon les premières estimations de Microsoft, la Release Candidate de IE9 a été téléchargée 11 millions de fois depuis son lancement le 10 février denier. Au total, explique Roger Capriotti de l'équipe Windows et Internet Explorer, ce sont pas moins de 36 millions d'internautes qui utilisent le navigateur : ceux qui l'ont téléchargé depuis la beta et ceux qui ont essayé avec la RC. La part de marché (PDM) de IE9 est, logiquement, en progression. Elle est crédité de 0.59 % d'utilisateurs par NetMarket. Des...

    Read the article

  • Internet Explorer 9 : 2 millions de téléchargements pour la Release Candidate en moins d'une semaine

    La RC de Internet Explorer 9 a été téléchargée 2 millions de fois En moins d'une semaine Mise à jour du 17/02/11 Microsoft vient d'annoncer les premiers résultats des téléchargements de la Release Candidate d'Internet Explorer 9 sortie la semaine dernière. Avec 2 millions de téléchargements, ces résultats sont particulièrement bons. Cependant, Roger Capriotti veut garder les pieds sur terre. Il sait, comme Stanislas Quastana, architecte infrastructure, "on ne reviendra jamais à 90% de part de marché" mais il se félicite de cet intérêt pour le prochain navigateur de Microsoft. Par comparaison, les betas de IE9 a...

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >