Daily Archives

Articles indexed Wednesday September 19 2012

Page 4/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Pitivi video editor (gstreamer errors)

    - by The Programmer
    The error messages are not helpful in diagnosing what's broken here: What can be done to make Pitivi and gstreamer work better together? Should I just give up on Pitivi and go with another tool? ERROR [15963] [0x7fb986aed700] "" pipeline Sep 18 19:31:14 _errorObject: error from /GstPipeline:pipeline1/GstBin:bin1/GnlComposition:gnlcomposition3/GnlSource:gnlsource: AudioTestSourceFactory3/GstBin:bin5/GstAudioTestSrc:real-audiotestsrc (main.GstAudioTestSrc): GStreamer encountered a general stream error. (gstbasesrc.c(2507): gst_base_src_loop (): /GstPipeline:pipeline1/GstBin:bin1/GnlComposition:gnlcomposition3/GnlSource:gnlsource: AudioTestSourceFactory3/GstBin:bin5/GstAudioTestSrc:real-audiotestsrc: streaming task paused, reason not-negotiated (-4)) (/usr/lib/pitivi/python/pitivi/log/loggable.py:30)

    Read the article

  • Ubuntu 12.04 MySQL 5.5 MyODBC 5.1 or 3.1 query hangs

    - by jorgearr
    I have been able to install Ubuntu 12.04 with LAMP MySQL version 5.5.x It works fine within linux, it allows me to connect from myodbc windows vista or windows 7 I have configured networking access and have been able to access from windows vista using putty and other tcp connections like mysql query browser. I have also configured or disabled ufw firewall and apparmor. The connection works fine until I query data from the tables. It lets me query small amounts of data like: SELECT name FROM users limit 20 but if I do a SELECT * FROM users, it goes on a never-ending loop. This happens even on tables with very few records like 5 or even less. The problems occur with windows because I tried ssh from linux mint and it worked fine. I need to be able to work using MyODBC either 3.51 or 5.1 since my client program is made in VB6 and connects to mysql server via tcp/ip. The server is an HP PROLIANT ML350G6 with Intel Xeon 64 bits. I tried several ubuntu server version (12.04 64bit, 10.10 64bit, 11.04 32bit) and none has worked I even tried CentOS 6.3 and the same. As a reference, it works fine with onother ubuntu server version 6.x on HP Proliant 150 and mysql 5.0.x that is like 7 years old and never updated. Help Please.

    Read the article

  • 12.04: Having problem with REISUB

    - by Jerry-bliss
    Often my ubuntu freezes up altogether(only able to move my cursor). So i try to reboot using the keys "ALT+PrntScrn+REISUB", but this is what happens Once i finish hitting the keys RE, my screen goes BLACK and it shows up a few lines of commands (or whatever) which I dont understand. I have no other choice other than manually force shut down (by pressing power button for 3-4 seconds) Here is a screenshot of what my black screen displays as soon as I hit R,E What do these lines mean? Is there anyway I can safely restart my PC? (Since i was unable to use printscreen, i had to manually take a snap of my monitor using my camera. I had taken 3 pictures of the same screen, because I could not capture the entire text displayed on my screen in a single click)

    Read the article

  • Software center and update manager not working

    - by lmnop
    When I run update manager I always get this message "The action would require the installation of packages from not authenticated sources." details "libv4l-0 libv4lconvert0" I also can not get the software center to install anything. I get an error message telling me to check my internet connection but I am connected to the internet, shortly after I get an error message just like the one I get from update manager. How do I fix this?

    Read the article

  • How do I reset a lost administrative password?

    - by user9904
    I'm working on a Ubuntu system using a Panasonic CF-50 Laptop. My Client has completely forgotten his Administrative Password. He doesn't even remember entering one; however it is there. I've tried the suggestions on the WebSite and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Do you have a solution? I look forward to hearing your response.

    Read the article

  • Can´t verify my site on Google (error 403 Forbidden). I have other sites in the same host with no problems whatsoever

    - by Rosamunda Rosamunda
    I can´t verify my site on Google. I´ve done this several times for several sites, all inside the same host. I´ve tried the HTML tag method, HTML upload, Domain Name provider (I canp´t find the options that Google tell me that I should activate...), and Google Analytics. I always get this response: Verification failed for http://www.mysite.com/ using the Google Analytics method (1 minute ago). Your verification file returns a status of 403 (Forbidden) instead of 200 (OK). I´ve checked the server headers, and I get this result: REQUESTING: http://www.mysite.com GET / HTTP/1.1 Connection: Keep-Alive Keep-Alive: 300 Accept:/ Host: www.mysite.com Accept-Language: en-us Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0) SERVER RESPONSE: HTTP/1.1 403 Forbidden Date: Wed, 19 Sep 2012 03:25:22 GMT Server: Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.17 Connection: close Content-Type: text/html; charset=iso-8859-1 Final Destination Page (It shows my actual homepage). What can I do? The hosting is the very same as in my other sites, where I didn´t have any issue at all! Thanks for your help! Note: As I have a Drupal 7 site, I´ve tried a "Drupal solution" first, but haven´t found any that solved this issue... How can it be forbidden when I can access the link perfectly ok? Is there any solution to this? Thanks!

    Read the article

  • How to push changes from Test server to Live server?

    - by anonymous
    As a beginner, I finally noticed the issue with making changes to the live server I've been working on, now that I have a couple users on it, since I bring it down so often. I created an EC2 image of my live server and set up a separate instance on EC2, so now I have 2 EC2 instances, Stage and Production. I set up GitHub and push changes to stage and test my code there, and when it's all done and working, I push it to the production branch, and everything is good. And there is a slight issue here since I name my files config_stage.js and config_production.js and set up .gitignore on each server, and in my code, I would have it read the ENV flags and set up the appropriate configs, is this the correct approach? And my main question is: how do you keep track of non-code changes to the server? For example, I installed HAProxy, Stunnel, Redis, MongoDB and several other things onto the Stage server for testing and now that it's all working and good, how do I deploy them to production? Right now, I'm just keeping track of everything I installed and copying configuration files over, which is very tedious and I'm afraid I may have missed a step somewhere. Is there a better way to port these changes over from my test server to my live server?

    Read the article

  • How to keep google rank and index for a page that changed its url? [closed]

    - by ProSoft
    Possible Duplicate: How to tell Google that I have changed my website URLs? Recently, I changed URL of my web page. Of course, I do it by URL rewriting. And now, I want to keep the rank of this page in Google and Bing. For example: Main address of the page: http://mywebsite.com/page1.php Virtual address by URL rewriting: http://mywebsite.com/page And new address is: http://mywebsite.com/newTitlePage Now, when I open this page by search in Google, I face to 401 error (not found). How should I do it?

    Read the article

  • Should I be using a game engine?

    - by Kyle
    I'm an experienced programmer, but I'm completely new to making games. I'm thinking of making an iPhone game that is similar to a 2d tower defense type game. In the web programming world, it would be a big waste of time to make a website without using some sort of web framework (eg ruby on rails). Is that the same for making games? Do people mostly use some sort of framework/game engine for making a game? If so, what are the popular ones for iOS?

    Read the article

  • Easiest Way to Get Started With 3D?

    - by ryebread761
    I'm looking at getting into 3D game development and am wondering what would be the best, quickest engine to get started with. I need to be able to develop on a Macintosh with it. I know Java, and PHP mainly but have worked in many others. At this point, I feel I can adapt to most languages quite easy. So the programming language doesn't really matter to me. I've sorta kinda tried unity in the past and wasn't all too fond of it, so it's kind of a "I can't find anything better" resort. I'm hoping with how open I am I will find something I like more. Thanks in advance.

    Read the article

  • Struct Method for Loops Problem

    - by Annalyne
    I have tried numerous times how to make a do-while loop using the float constructor for my code but it seems it does not work properly as I wanted. For summary, I am making a TBRPG in C++ and I encountered few problems. But before that, let me post my code. #include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; int char_level = 1; //the starting level of the character. string town; //town string town_name; //the name of the town the character is in. string charname; //holds the character's name upon the start of the game int gems = 0; //holds the value of the games the character has. const int MAX_ITEMS = 15; //max items the character can carry string inventory [MAX_ITEMS]; //the inventory of the character in game int itemnum = 0; //number of items that the character has. bool GameOver = false; //boolean intended for the game over scr. string monsterTroop [] = {"Slime", "Zombie", "Imp", "Sahaguin, Hounds, Vampire"}; //monster name float monsterTroopHealth [] = {5.0f, 10.0f, 15.0f, 20.0f, 25.0f}; // the health of the monsters int monLifeBox; //life carrier of the game's enemy troops int enemNumber; //enemy number //inventory[itemnum++] = "Sword"; class RPG_Game_Enemy { public: void enemyAppear () { srand(time(0)); enemNumber = 1+(rand()%3); if (enemNumber == 1) cout << monsterTroop[1]; //monster troop 1 else if (enemNumber == 2) cout << monsterTroop[2]; //monster troop 2 else if (enemNumber == 3) cout << monsterTroop[3]; //monster troop 3 else if (enemNumber == 4) cout << monsterTroop[4]; //monster troop 4 } void enemDefeat () { cout << "The foe has been defeated. You are victorious." << endl; } void enemyDies() { //if the enemy dies: //collapse declaration cout << "The foe vanished and you are victorious!" << endl; } }; class RPG_Scene_Battle { public: RPG_Scene_Battle(float ini_health) : health (ini_health){}; float getHealth() { return health; } void setHealth(float rpg_val){ health = rpg_val;}; private: float health; }; //---------------------------------------------------------------// // Conduct Damage for the Scene Battle's Damage //---------------------------------------------------------------// float conductDamage(RPG_Scene_Battle rpg_tr, float damage) { rpg_tr.setHealth(rpg_tr.getHealth() - damage); return rpg_tr.getHealth(); }; // ------------------------------------------------------------- // void RPG_Scene_DisplayItem () { cout << "Items: \n"; for (int i=0; i < itemnum; ++i) cout << inventory[i] <<endl; }; In this code I have so far, the problem I have is the battle scene. For example, the player battles a Ghost with 10 HP, when I use a do while loop to subtract the HP of the character and the enemy, it only deducts once in the do while. Some people said I should use a struct, but I have no idea how to make it. Is there a way someone can display a code how to implement it on my game? Edit: I made the do-while by far like this: do RPG_Scene_Battle (player, 20.0f); RPG_Scene_Battle (enemy, 10.0f); cout << "Battle starts!" <<endl; cout << "You used a blade skill and deducted 2 hit points to the enemy!" conductDamage (enemy, 2.0f); while (enemy!=0) also, I made something like this: #include <iostream> using namespace std; int gems = 0; class Entity { public: Entity(float startingHealth) : health(startingHealth){}; // initialize health float getHealth(){return health;} void setHealth(float value){ health = value;}; private: float health; }; float subtractHealthFrom(Entity& ent, float damage) { ent.setHealth(ent.getHealth() - damage); return ent.getHealth(); }; int main () { Entity character(10.0f); Entity enemy(10.0f); cout << "Hero Life: "; cout << subtractHealthFrom(character, 2.0f) <<endl; cout << "Monster Life: "; cout << subtractHealthFrom(enemy, 2.0f) <<endl; cout << "Hero Life: "; cout << subtractHealthFrom(character, 2.0f) <<endl; cout << "Monster Life: "; cout << subtractHealthFrom(enemy, 2.0f) <<endl; }; Struct method, they say, should solve this problem. How can I continously deduct hp from the enemy? Whenever I deduct something, it would return to its original value -_-

    Read the article

  • Implement Negascout Algorithm with stack

    - by Dan
    I'm not familiar with how these stack exchange accounts work so if this is double posting I apologize. I asked the same thing on stackoverflow. I have added an AI routine to a game I am working on using the Negascout algorithm. It works great, but when I set a higher maximum depth it can take a few seconds to complete. The problem is it blocks the main thread, and the framework I am using does not have a way to deal with multi-threading properly across platforms. So I am trying to change this routine from recursively calling itself, to just managing a stack (vector) so that I can progress through the routine at a controlled pace and not lock up the application while the AI is thinking. I am getting hung up on the second recursive call in the loop. It relies on a returned value from the first call, so I don't know how to add these to a stack. My Working c++ Recursive Code: MoveScore abNegascout(vector<vector<char> > &board, int ply, int alpha, int beta, char piece) { if (ply==mMaxPly) { return MoveScore(evaluation.evaluateBoard(board, piece, oppPiece)); } int currentScore; int bestScore = -INFINITY; MoveCoord bestMove; int adaptiveBeta = beta; vector<MoveCoord> moveList = evaluation.genPriorityMoves(board, piece, findValidMove(board, piece, false)); if (moveList.empty()) { return MoveScore(bestScore); } bestMove = moveList[0]; for(int i=0;i<moveList.size();i++) { MoveCoord move = moveList[i]; vector<vector<char> > newBoard; newBoard.insert( newBoard.end(), board.begin(), board.end() ); effectMove(newBoard, piece, move.getRow(), move.getCol()); // First Call ****** MoveScore current = abNegascout(newBoard, ply+1, -adaptiveBeta, -max(alpha,bestScore), oppPiece); currentScore = - current.getScore(); if (currentScore>bestScore){ if (adaptiveBeta == beta || ply>=(mMaxPly-2)){ bestScore = currentScore; bestMove = move; }else { // Second Call ****** current = abNegascout(newBoard, ply+1, -beta, -currentScore, oppPiece); bestScore = - current.getScore(); bestMove = move; } if(bestScore>=beta){ return MoveScore(bestMove,bestScore); } adaptiveBeta = max(alpha, bestScore) + 1; } } return MoveScore(bestMove,bestScore); } If someone can please help by explaining how to get this to work with a simple stack. Example code would be much appreciated. While c++ would be perfect, any language that demonstrates how would be great. Thank You.

    Read the article

  • Collision library for bullet hell in Python

    - by darkfeline
    I am making a bullet hell game in Python and am looking for a suitable collision library, taking the following into consideration: The library should do 2D polygon collision. It should be very fast. As a bullet hell game, I expect to do collision checks between hundreds, likely thousands of objects every frame at a consistent 60fps. Good documentation Permissive license (like MIT, not GPL) I am also considering writing my own library in C/C++ and wrapping with python ctypes in the event that no such library exists, though I do not have experience with collision detection algorithms, so I am not sure if this would be more trouble than it's worth. Could someone provide some guidance on this matter?

    Read the article

  • Android Jelly bean database is locked (code 5)

    - by mtraxdroid
    Im getting a database is locked (code 5) in my ListActivity the code works in the other versions of the Emulator but fails in the 4.1 version of the emulator E/SQLiteLog( 2132): (5) database is locked E/SQLiteDatabase( 2132): Failed to open database '/data/data/id.online.mydroid/databases/geo.db'. E/SQLiteDatabase( 2132): android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5): , while compiling: PRAGMA al_mode E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:882) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.executeForString(SQLiteConnection.java:627) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.setJournalMode(SQLiteConnection.java:313) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.setWalModeFromConfiguration(SQLiteConnection.java:287) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:215) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) E/SQLiteDatabase( 2132): at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:804) E/SQLiteDatabase( 2132): at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224) E/SQLiteDatabase( 2132): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188) E/SQLiteDatabase( 2132): at id.online.mydroid.myDB.openForRead(myDB.java:158) E/SQLiteDatabase( 2132): at id.online.mydroid.mydroid.refreshCount(mydroid.java:207) E/SQLiteDatabase( 2132): at id.online.mydroid.mydroid.onResume(mydroid.java:525) Blockquote

    Read the article

  • I need a program to store the database script for oracle

    - by Hakan Kara
    We are developing a project that has 3 enviroments (development, test, production) So there are 3 databases (actually more than 3, because we have 5 customers so we have more than 10 databases) and they must be synchronised. There are 30 coders working for this project. Everone adds, deletes, and changes procedures, table columns etc. We need a program to store our database scripts like visual studio's team foundation server. See the change history of script file. Everyone must access that program and be able to put their scripts. Recover previous versions of script file. Execute these scripts over a selected database. Compare databases by procedures (not only by name, by content of procedure), functions, table columns, packages etc. I am searching a program like that. Which one do you suggest me?

    Read the article

  • using operators and functions for sql report charts (visual studio 2010)

    - by user1682566
    I want to create some charts using sql reporting services. But i am unable to use a lot of functions and operators in combination with my data-fields the following work(Stroke-data type is decimal): > =Fields!Stroke.Value > =Sum(Fields!Stroke.Value) > =First(Fields!Stroke.Value) > =Last(Fields!Stroke.Value) > =2+2394.12 the following dont work: > =Fields!Stroke.Value + 2 > =CStr(Fields!Stroke.Value) > =CDbl(Fields!Stroke.Value) > =Fields!Stroke.Value / Fields!Stroke.Value > =Sum(Fields!Stroke.Value) * 2 all other operators and functions(using Fields!Stroke.Value) dont work too

    Read the article

  • Android add image to button

    - by Christiaan de Jong
    I want to add an image to a Button (no imagebutton, as the particular button can either contain text or an image; plus the imagebutton has the same problem), while still retaining the original android-style button. So adding android:background in the XML doesn't cut it, as that will remove the android default button with rounded corners etc. (android.R.drawable.btn_default) Is this in any way possible? I think one way is to make a 9patch image for the button pressed (one for up and one for down) and onTouch Action_DOWN make a layered background drawable and put that onto the button, and doing the same thing but with another 9patch for onTouch Action_UP, but I think that will decrease the performance of the application substantially, as that will require quite a lot of resource reading and layer merging for all the button clicks (and for my application, that will be quite a lot). Is what I state above correct?

    Read the article

  • asp.net checkbox in gridview - checked property is missing

    - by Peter PitLock
    In this asp.net gridview control, the checked property is always missing. I need to access the checked property via jquery Gridview source: <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="chkSelected" runat="server" class="chkSummarySelection" /> </ItemTemplate> </asp:TemplateField> </Columns> Renders as : <input type="checkbox" name="ctl00$ContentPlaceHolder1$gv$ctl02$SelectedCheckBox" id="ctl00_ContentPlaceHolder1_gv_ctl02_SelectedCheckBox"> There is no checked property to access. I have tried $(".chkSummarySelection").click(function () { var chk; chk = $(this).prop("checked"); chk = $(this).attr("checked"); chk = $(this).is(":checked"); chk = $(this).attr("value"); chk = $(this).val(); chk = jQuery(this).is(':checked'); }); but nothing is working

    Read the article

  • Does different iVar name change retain count when used with property

    - by russell
    Here is 2 code snapshot- Class A:NSObject { NSMutableArray *a; } @property (retain) NSMutableArray *a; @implementation @synthesize a; -(id)init { if(self=[super init]) { a=[[NSMutableArray alloc] init]; } } @end Class A:NSObject { NSMutableArray *_a; } @property (retain) NSMutableArray *a; @implementation @synthesize a=_a; -(id)init { if(self=[super init]) { _a=[[NSMutableArray alloc] init]; } } @end Now what i need to know, is in both code instance variable assigned value directly rather than using accessor and retain count is 1? Or there is difference between them. Thanks. And one more things, apple recommended not to use accessor in init/dealloc, but at the same time ask not to directly set iVar. So what is the best way to assign value of ivar in init()??

    Read the article

  • Split number and put each digit to separate html element

    - by Seven
    The problem is that I do not know how to break the loop for the first number and start again for the next one. Currently, one span.nNumber has a total digits of the two numbers (123456) and the next span.nNumber contains digits only from another number (456). Goal is to create sequence 123 and 456: <span class='nNumber'> <span>1</span> <span>2</span> <span>3</span> </span> and <span class='nNumber'> <span>4</span> <span>5</span> <span>6</span> </span> Example script: http://jsfiddle.net/PZ8Pt/2/

    Read the article

  • Selective Inheritance Python

    - by user1682595
    I am making a python program which is using classes, I want one class to only selectively inherit from another e.g: class X(object): def __init__(self): self.hello = 'hello' class Y(object): def __init__(self): self.moo = 'moo' class Z(): def __init__(self, mode): if mode == 'Y': # Class will now Inherit from Y elif mode == 'X': # Class will now Inherit for X How can I do this without making another class?

    Read the article

  • Accessing a struct collection property from within another collection

    - by paddyb
    I have a struct that I need to store in a collection. The struct has a property that returns a Dictionary. public struct Item { private IDictionary<string, string> values; public IDictionary<string, string> Values { get { return this.values ?? (this.values = new Dictionary<string, string>()); } } } public class ItemCollection : Collection<Item> {} When testing I've found that if I add the item to the collection and then try to access the dictionary the structs values property is never updated. var collection = new ItemCollection { new Item() }; // pre-loaded with an item collection[0].Values.Add("myKey", "myValue"); Trace.WriteLine(collection[0].Values["myKey"]); // KeyNotFoundException here However if I load up the item first and then add it to a collection the values field is maintained. var collection = new ItemCollection(); var item = new Item(); item.Values.Add("myKey", "myValue"); collection.Add(item); Trace.WriteLine(collection[0].Values["myKey"]); // ok I've already decided that a struct is the wrong option for this type, and when using a class the issue doesn't occur, but I'm curious what's different between the two methods. Can anybody explain what's happening?

    Read the article

  • Android Service setForeground While Display Sleeps

    - by c12
    I have a background Android Service that's purpose is to communicate with another device (non-phone) using a Bluetooth socket. Everything works fine except that the service gets stopped and restarted by the OS when the phone display is sleeping. This restart sometimes leaves a 15-20 minute gaps where there is no communication between the Service and the Bluetooth device and I need to be able to query the device every minute. Is startForeground the proper approach? Attempted to use: startForeground(int, Notification) //still see gaps when phone sleeps Service: public class ForegroundBluetoothService extends Service{ private boolean isStarted = false; @Override public void onDestroy() { super.onDestroy(); stop(); } /** * @see android.app.Service#onBind(android.content.Intent) */ @Override public IBinder onBind(Intent intent) { return null; } /** * @see android.app.Service#onStartCommand(android.content.Intent, int, int) */ @Override public int onStartCommand(Intent intent, int flags, int startId) { loadServiceInForeground(); return(START_STICKY); } private void loadServiceInForeground() { if (!isStarted) { isStarted=true; Notification notification = new Notification(R.drawable.icon, "Service is Running...", System.currentTimeMillis()); Intent notificationIntent = new Intent(this, MainScreen.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); notification.setLatestEventInfo(this, "Notification Title", "Service is Running...", pendingIntent); startForeground(12345, notification); try{ queryTheBluetoothDevice(); } catch(Exception ex){ ex.printStackTrace(); } } } private void stop() { if (isStarted) { isStarted=false; stopForeground(true); } } }

    Read the article

  • Adding JPanel onto another JPanel after button click

    - by user1400650
    I'm using Netbeans IDE to make a gui application. I have a JFrame with a JPanel inside it. After a button click I want to display a different JPanel inside the first. The other JPanel is in a different file. How would I go about doing this? If this is not practical I don't mind replacing the first JPanel with the second one. I've tried the following but it doesn't seem to work. I'm new to Java and Gui programming so I would appreciate any help I can get. private void jButtonActionPerformed(java.awt.event.ActionEvent evt) { JPanel2 jPanel2 = new JPanel2(); JPanel1.add(jPanel2); }

    Read the article

  • One liner for getting a sublist from a Set

    - by yegor256
    Is there a one-liner (maybe from Guava or Apache Collections) that gets a sublist from a set. Internally it should do something like this: public <T> List<T> sublist(Set<T> set, int count) { Iterator<T> iterator = set.iterator(); List<T> sublist = new LinkedList<T>(); int pos = 0; while (iterator.hasNext() && pos++ < count) { sublist.add(iterator.next()); } return sublist; } Obviously, if there are not enough elements it has to return as many as possible.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >