Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 43/96 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • Menu item ID is not recognized

    - by Alex Farber
    menu/activity_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_settings" android:title="@string/menu_settings" android:showAsAction="never" /> <item android:id="@+id/menu_save_log" android:title="@string/menu_save_log" android:showAsAction="never" /> </menu> MainActivity.java: //@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_settings: // OK break; case R.id.menu_save_log: // menu_save_log cannot be resolved or is not a field break; } return true; } Why menu_save_log is not recognized?

    Read the article

  • VB.NET - Removing a number from a random number generator

    - by Alex
    I am trying to create a lottery simulator. The lottery has 6 numbers, the number generated must be between 1 - 49 and cannot be in the next number generated. I have tried using the OR function but I'm not entirely sure if I am using it properly. Any help would be great. Thanks. Public Class Form1 Private Sub cmdRun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRun.Click 'Creates a new Random class in VB.NET Dim RandomClass As New Random() '#################################### Dim RandomNumber1 As Integer RandomNumber1 = RandomClass.Next(1, 49) 'Displays first number generated txtFirst.Text = (RandomNumber1) '#################################### Dim RandomNumber2 As Integer RandomNumber2 = RandomClass.Next(1, 49) If RandomNumber2 = RandomNumber1 Then RandomNumber2 = RandomClass.Next(1, 49) End If 'Displays second number generated txtSecond.Text = (RandomNumber2) '#################################### Dim RandomNumber3 As Integer RandomNumber3 = RandomClass.Next(1, 49) If RandomNumber3 = RandomNumber2 Or RandomNumber2 Then RandomNumber3 = RandomClass.Next(1, 49) End If 'Displays third number generated txtThird.Text = (RandomNumber3) '#################################### Dim RandomNumber4 As Integer RandomNumber4 = RandomClass.Next(1, 49) If RandomNumber4 = RandomNumber3 Or RandomNumber2 Or RandomNumber1 Then RandomNumber4 = RandomClass.Next(1, 49) End If 'Displays fourth number generated txtFourth.Text = (RandomNumber4) '#################################### Dim RandomNumber5 As Integer RandomNumber5 = RandomClass.Next(1, 49) If RandomNumber5 = RandomNumber4 Or RandomNumber3 Or RandomNumber2 Or RandomNumber1 Then RandomNumber5 = RandomClass.Next(1, 49) End If 'Displays fifth number generated txtFifth.Text = (RandomNumber5) '#################################### Dim RandomNumber6 As Integer RandomNumber6 = RandomClass.Next(1, 49) If RandomNumber6 = RandomNumber5, RandomNumber4, RandomNumber3, RandomNumber2, RandomNumber1 Then RandomNumber6 = RandomClass.Next(1, 49) End If 'Displays sixth number generated txtSixth.Text = (RandomNumber6) End Sub

    Read the article

  • How to change a div's innerHTML after redirecting?

    - by Alex
    I am trying to change the innerHTML of a div on the page that I am loading. This is my JavaScript code: function redirect(titleName){ window.location = "pageToLoad.php"; document.getElementById("title").innerHTML = titleName; } It doesn't seem to be working, please help me!!

    Read the article

  • Passing string with (accidental) escape character loses character even though it's a raw string

    - by Steen
    I have a function with a python doctest that fails because one of the test input strings has a backslash that's treated like an escape character even though I've encoded the string as a raw string. My doctest looks like this: >>> infile = [ "Todo: fix me", "/** todo: fix", "* me", "*/", r"""//\todo stuff to fix""", "TODO fix me too", "toDo bug 4663" ] >>> find_todos( infile ) ['fix me', 'fix', 'stuff to fix', 'fix me too', 'bug 4663'] And the function, which is intended to extract the todo texts from a single line following some variation over a todo specification, looks like this: todos = list() for line in infile: print line if todo_match_obj.search( line ): todos.append( todo_match_obj.search( line ).group( 'todo' ) ) And the regular expression called todo_match_obj is: r"""(?:/{0,2}\**\s?todo):?\s*(?P<todo>.+)""" A quick conversation with my ipython shell gives me: In [35]: print "//\todo" // odo In [36]: print r"""//\todo""" //\todo And, just in case the doctest implementation uses stdout (I haven't checked, sorry): In [37]: sys.stdout.write( r"""//\todo""" ) //\todo My regex-foo is not high by any standards, and I realize that I could be missing something here. EDIT: Following Alex Martellis answer, I would like suggestions on what regular expression would actually match the blasted r"""//\todo fix me""". I know that I did not originally ask for someone to do my homework, and I will accept Alex's answer as it really did answer my question (or confirm my fears). But I promise to upvote any good solutions to my problem here :) I'm using Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) Thank you for reading this far (If you skipped directly down here, I understand)

    Read the article

  • Problems with Acitivity LifeCycle with VideoView playback.

    - by Alex Volovoy
    Hi all i've ran into another problems with VideoView. Then video is playing, and i put device asleep, using hard button, onPause is called. But it followed by 03-17 11:26:33.779: WARN/ActivityManager(884): Activity pause timeout for HistoryRecord{4359f620 com.package/com.package.VideoViewActivity} And then i have onStart/onResume again and Video starts playing. I've try to move code around onStart/onStop - doesn't seems to make difference. sample code : public class VideoViewActivity extends Activity { private String path = ""; private VideoView mVideoView; private static final String MEDIA_URL = "media_url"; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.videoview); mVideoView = (VideoView)findViewById(R.id.surface_view); path = getIntent().getStringExtra(MEDIA_URL); } @Override public void onResume() { super.onResume(); mVideoView.setVideoPath(path); mVideoView.setMediaController(new MediaController(this)); mVideoView.requestFocus(); mVideoView.start(); } @Override public void onPause() { super.onPause(); mVideoView.stopPlayback(); mVideoView.setMediaController(null); } }

    Read the article

  • My Core Animation block isn't working as I'd expect

    - by Alex Reynolds
    I have a UIView called activityView, which contains two subviews activityIndicator and cancelOperationsButton. These views are embedded in a XIB and wired up to my view controller. I have two methods that deal with activating (showing) and deactivating (hiding) these two subviews: - (void) enableActivityIndicator { [activityIndicator startAnimating]; [cancelOperationsButton setHidden:NO]; } - (void) disableActivityIndicator { [activityIndicator stopAnimating]; [cancelOperationsButton setHidden:YES]; } By themselves, these two methods work fine. To give this a bit of polish, I'd like to add an animation that fades these subviews in and out: - (void) enableActivityIndicator { [activityIndicator startAnimating]; [cancelOperationsButton setHidden:NO]; [UIView beginAnimations:@"fadeIn" context:nil]; [UIView setAnimationDelay:0.0f]; [UIView setAnimationDuration:1.0f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; activityView.alpha = 1.0f; [UIView commitAnimations]; } - (void) disableActivityIndicator { [UIView beginAnimations:@"fadeOut" context:nil]; [UIView setAnimationDelay:0.0f]; [UIView setAnimationDuration:1.0f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; activityView.alpha = 0.0f; [UIView commitAnimations]; [activityIndicator stopAnimating]; [cancelOperationsButton setHidden:YES]; } But the animations are not working — the subviews just show up or disappear without the parent view's alpha property having an effect on transparency. How should I write these methods to get the fade-in, fade-out effect I am after?

    Read the article

  • Dashcode code translation

    - by Alex Mcp
    Hi, a quick, probably easy question whose answer is probably "best practice" I'm following a tutorial for a custom-template mobile Safari webapp, and to change views around this code is used: function btnSave_ClickHandler(event) { var views = document.getElementById('stackLayout'); var front = document.getElementById('mainScreen'); if (views && views.object && front) { views.object.setCurrentView(front, true); } } My question is just about the if conditional statement. What is this triplet saying, and why do each of those things need to be verified before the view can be changed? Does views.object just test to see if the views variable responds to the object method? Why is this important? EDIT - This is/was the main point of this question, and it regards not Javascript as a language and how if loops work, but rather WHY these 3 things specifically need to be checked: Under what scenarios might views and front not exist? I don't typically write my code so redundantly. If the name of my MySQL table isn't changing, I'll just say UPDATE 'mytable' WHERE... instead of the much more verbose (and in my view, redundant) $mytable = "TheSQLTableName"; if ($mytable == an actual table && $mytable exists && entries can be updated){ UPDATE $mytable; } Whereas if the table's name (or in the JS example, the view's names) ARE NOT "hard coded" but are instead a user input or otherwise mutable, I might right my code as the DashCode example has it. So tell me, can these values "go wrong" anyhow? Thanks!

    Read the article

  • MySql: Problem when using a temporary table

    - by Alex
    Hi, I'm trying to use a temporary tables to store some values I need for a query. The reason of using a temporary table is that I don't want to store the data permanently so different users can modify it at the same time. That data is just stored for a second, so I think a temporary table is the best approach for this. The thing is that it seems that the way I'm trying to use it is not right (the query works if I use a permanent one). This is an example of query: CREATE TEMPORARY TABLE SearchMatches (PatternID int not null primary key, Matches int not null) INSERT INTO SearchMatches (PatternID, Matches) VALUES ('12605','1'),('12503','1'),('12587','2'),('12456','1'), ('12457','2'),('12486','2'),('12704','1'),(' 12686','1'), ('12531','2'),('12549','1'),('12604','1'),('12504','1'), ('12586','1'),('12548','1'),('12 530','1'),('12687','2'), ('12485','1'),('12705','1') SELECT pat.id, signatures.signature, products.product, versions.version, builds.build, pat.log_file, sig_types.sig_type, pat.notes, pat.kb FROM patterns AS pat INNER JOIN signatures ON pat.signature = signatures.id INNER JOIN products ON pat.product = products.id INNER JOIN versions ON pat.version = versions.id INNER JOIN builds ON pat.build = builds.id INNER JOIN sig_types ON pat.sig_type = sig_types.id, SearchMatches AS sm INNER JOIN patterns ON patterns.id = sm.PatternID WHERE sm.Matches <> 0 ORDER BY sm.Matches DESC, products.product, versions.version, builds.build LIMIT 0 , 50 Any suggestion? Thanks.

    Read the article

  • SQL Query that can return intersecting data

    - by Alex
    I have a hard time finding a good question title - let me just show you what I have and what the desired outcome is. I hope this can be done in SQL (I have SQL Server 2008). 1) I have a table called Contacts and in that table I have fields like these: FirstName, LastName, CompanyName 2) Some demo data: FirstName LastName CompanyName John Smith Smith Corp Paul Wade Marc Andrews Microsoft Bill Gates Microsoft Steve Gibbs Smith Corp Diane Rowe ABC Inc. 3) I want to get an intersecting list of people and companies, but companies only once. This would look like this: Name ABC Inc. Bill Gates Diane Rowe John Smith Marc Andrews Microsoft Smith Corp Steve Gibbs Paul Wade Can I do this with SQL? How?

    Read the article

  • Java Crossword Application - what package to use?

    - by Alex
    Hi guys, I'm about to create a java crossword application but I am unsure of what packages to use to draw the crossword grid. I know you can manually draw grids with Graphics2D etc. but I'm not sure if this is the easiest way to do it as I'll need text fields in the grid squares. Anyone have any suggestions as to creating the crossword grid.

    Read the article

  • Where can I find docs for PrestaShop?

    - by alex
    I have downloaded and am using PrestaShop - but can not seem to find any docs. The official ones are apparently 'coming soon'. I imagine there should be some 3rd party ones elsewhere.. but can not find with Google myself. Does anyone know of any? thanks

    Read the article

  • Validating User Input? C#

    - by Alex
    Hi, in an assignment, I have designed a input validation loop in C#, and I would like it to be able to check for the correct input format. I'm not for sure, but I think my designed loop is not checking the type of input, just what char is entered. I know I could use a try-catch block, but shouldn't you only use exceptions for exceptional situations? This is not an exceptional situation, because I expect that the user would enter an incorrect value. Input validation is not part of my assignment, so the loop is in a homework assignment, but is not part of the homework assignment. Question: Is there a way I could redesign this loop so that it checks for valid input type as well? Code: do { Console.Write("Do you wish to enter another complex number?: (Y or N)"); response = char.Parse(Console.ReadLine()); response = char.ToUpper(response); if (response != 'Y' && response != 'N') Console.WriteLine("You must respond Y or N!"); } while (response != 'Y' && response != 'N'); Thanks!!

    Read the article

  • sending USSD in C#?

    - by Alex
    Hi, I want to write a simple c# application runs on windows mobile 6 which can send USSD messages Is there any library that could help me in doing this?? or is there any examples that explains how to use lineSendUSSD thanks

    Read the article

  • ModalPopupExtender + ASP.NET AJAX: Can't page grid

    - by Alex
    I'm trying to page and sort my datagrid wich is inside a modalpopupextender but I can't page it in any way, already tried with , put the updatepanel inside, outside, in the middle (loL) and it does NOT work. modal popup does not get closed but the grid just dissapear. Code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then BindData() End If End Sub Private Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click SqlServerDS.SelectCommand = "SELECT * FROM emp WHERE name LIKE '%" & txtSearchName.Text & "%'" BindData() End Sub Private Sub BindData() grdSearch.DataSource = SqlServerDS grdSearch.DataBind() End Sub Private Sub grdBuscaPaciente_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdSearch.PageIndexChanging grdSearch.PageIndex = e.NewPageIndex BindData() End Sub Inside the Designer, this is the code h: <modalpopupextender> </modalpopupextender> <panel> <updatepanel> <gridview> </gridview> </updatepanel> </panel>

    Read the article

  • BorderLayout problem with JSplitPane after adding JToolbar (Java)

    - by Alex Cheng
    Hello all. Problem: My program layout is fine, as below before I add JToolbar to BorderLayout.PAGE_START Here's a screenshot before JToolbar is added: Here's how it looked like after adding JToolbar: May I know what did I do wrong? Here's the code I used: //Create the text pane and configure it. textPane = new JTextPane(); -snipped code- JScrollPane scrollPane = new JScrollPane(textPane); scrollPane.setPreferredSize(new Dimension(300, 300)); //Create the text area for the status log and configure it. changeLog = new JTextArea(5, 30); changeLog.setEditable(false); JScrollPane scrollPaneForLog = new JScrollPane(changeLog); //Create a split pane for the change log and the text area. JSplitPane splitPane = new JSplitPane( JSplitPane.VERTICAL_SPLIT, scrollPane, scrollPaneForLog); splitPane.setOneTouchExpandable(true); //Create the status area. JPanel statusPane = new JPanel(new GridLayout(1, 1)); CaretListenerLabel caretListenerLabel = new CaretListenerLabel("Caret Status"); statusPane.add(caretListenerLabel); //Create the toolbar JToolBar toolBar = new JToolBar(); -snipped code- //Add the components. getContentPane().add(toolBar, BorderLayout.PAGE_START); getContentPane().add(splitPane, BorderLayout.CENTER); getContentPane().add(statusPane, BorderLayout.PAGE_END); //Set up the menu bar. actions = createActionTable(textPane); JMenu editMenu = createEditMenu(); JMenu styleMenu = createStyleMenu(); JMenuBar mb = new JMenuBar(); mb.add(editMenu); mb.add(styleMenu); setJMenuBar(mb); Please help, I'm new to GUI Building, and I don't feel like using Netbeans to drag and drop the UI for me... Thank you in advance.

    Read the article

  • Fuzzy match two hash tables?

    - by alex
    Hi, I'm looking for ideas on how to best match two hash tables containing string key/value pairs. Here's the actual problem I'm facing: I have structured data coming in which is imported into the database. I need to UPDATE records which are already in the DB, however, it's possible that ANY value in the source can change, therefore I don't have a reliable ID. I'm thinking of fuzzy matching two rows, source and DB and make an "educated" guess if it should be updated and inserted. Any ideas would be greatly appreciated.

    Read the article

  • How hard is it to modify the Django Models?

    - by alex
    I am doing geolocation, and Django does not have a PointField. So, I am forced to writing in RAW SQL. GeoDjango, the Django library, does not support the following query for MYSQL databases (can someone verify that for me?) cursor.execute("SELECT id FROM l_tag WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm),asbinary(PointFromWKB(point(%s, %s)))))) < %s + accuracy + %s)\ I don't nkow why GeoDjango library cannot do this in MYSQL database. I hate writing RAW SQL for calculating distances between two points. Is there a way I can create my own library for Django that can handle this? If so, how hard is it?

    Read the article

  • When sending headers to download a PDF, Safari appends .html

    - by alex
    Here is the request and response headers http://www.example.com/get/pdf GET /~get/pdf HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://www.example.com Cookie: etc HTTP/1.1 200 OK Date: Thu, 29 Apr 2010 02:20:43 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 X-Powered-By: Me Expires: Thu, 19 Nov 1981 08:52:00 GMT Pragma: no-cache Cache-Control: private Content-Disposition: attachment; filename="File #1.pdf" Content-Length: 18776 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 ---------------------------------------------------------- Basically, the response headers are sent by DOMPDF's stream() method. In Firefox, the file is prompted as File #1.pdf. However, in Safari, the file is saved as File #1.pdf.html. Does anyone know why Safari is appending the html extension to the filename?

    Read the article

  • Vista 64-bits development tools

    - by Workshop Alex
    Well, okay. There's Visual Studio 2008 and Embarcadero Delphi/Studio that are both able to create 64-bits .NET applications for Vista. And of course a lot of 32-bits applications will run on 64-bits Vista. If not, it's always possible to install VMWare to create a virtual 32-bits Windows XP system to run 32-bits applications. So, plenty of options. But what I would like to see is a list of true 64-bits applications for Windows Vista and better. So if you know any useful 64-bits product, please share! (Especially compilers that generate native 64-bits code.) Tools would basically be anything that would make development a bit easier. Thus, debugging tools, image processing tools to create icons and bitmaps, hex editors to check the contents of binary files, XML editors to change XML files, etc. The tools from SysInternals, for example, seem to provide 64-bits versions or even support 64-bits systems natively. But how about all those other editors, viewers, browsers and other tools that we developers like to use? A 64-bits version of the Norton Commander/Midnight Commander or other file managers would be nice too. And with compilers, how about COBOL/ForTran/ADA/SmallTalk/Lisp/Whatever compiler/languages for Vista? I would just like to see a complete list of anything useful for 64-bits development.

    Read the article

  • Lombok with Play 2

    - by Alex Povar
    What about Lombok integration with Play Framework 2? I really like Lombok it make my code more readable and less boilerplate. And Play Framework is wonderful too. But there is a great trouble in case if you going to mixup them. Main reason is that scala temlates in play project compiled before domain classes. So Lombok, which itself is compiler's hack do not generate accessors for that time. The question is: if it any ways to make it work? I found some discussions in Google Groups, but they do not provide any reasonable solution. So have you got any success with it? And.. why guys from Play Framework project do not provide some Lombok-like solution? Anyway Play is full of code-generation magic and shadow compiling... so, why not?

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >