Daily Archives

Articles indexed Saturday January 8 2011

Page 18/30 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Using enums in Java across multiple classes

    - by Richard Mar.
    I have the following class: public class Card { public enum Suit { SPACES, HEARTS, DIAMONDS, CLUBS }; public Card(Suit nsuit, int nrank) { suit = nsuit; rank = nrank; } private Suit suit; private int rank; } I want to instantiate it in another class, but that class doesn't understand the Suit enum. Where should I put the enum to make it publicly visible?

    Read the article

  • SQL Server Reporting Services using of pictures with dynamic links

    - by YvesR
    I have setup a SSRS 2008 and building reports. So far so good. Now there is a picture control in SSRS where you can set the picture as external link reference. There you can choose to use a link. When I use a weblink (http://anyurl/download_picture.aspx?id=123) it dont' work for me. Calling the url in the web browser (all tested IE, Safari, Chrome, FF) the pictures is delivered, Header is ok, content type, too. Does it work in general in SSRS ? Or do I have to copy the picture to a temp folder and link the url like http://anyurl/mypicture.jpg.

    Read the article

  • Force close when starting new activity

    - by Alex
    I'm trying to launch a new activity from my main activity, but I just get error codes all the time. Heres my main activity; public class gunstats extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button4 = (Button)findViewById(R.id.button4); button4.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(gunstats.this, more.class); startActivity(intent); } }); } } and the activity that is being called from my main class; public class more extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final MediaPlayer mp = MediaPlayer.create(this, R.raw.deagle); Button buttonm1 = (Button)this.findViewById(R.id.buttonm1); buttonm1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mp.start(); } }); } } And there's nothing wrong in the manifest Heres my logcat: 01-08 16:33:17.647: ERROR/AndroidRuntime(552): Uncaught handler: thread main exiting due to uncaught exception 01-08 16:33:17.676: ERROR/AndroidRuntime(552): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.gunstats/com.gunstats.more}; have you declared this activity in your AndroidManifest.xml? 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1480) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1454) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivityForResult(Activity.java:2660) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivity(Activity.java:2704) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.gunstats.gunstats$4.onClick(gunstats.java:64) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.performClick(View.java:2344) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.onTouchEvent(View.java:4133) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.widget.TextView.onTouchEvent(TextView.java:6504) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.dispatchTouchEvent(View.java:3672) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Handler.dispatchMessage(Handler.java:99) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Looper.loop(Looper.java:123) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invokeNative(Native Method) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invoke(Method.java:521) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at dalvik.system.NativeStart.main(Native Method) What is causing this force close?

    Read the article

  • wanted to extend jQuery to handle a custom enter key event based on tabindex

    - by ullasvk
    I write the following code to handle when the enter key pressed an with few validation like if it is a textarea allow only four lines and if the value is empty, focus on itself. var temp = 1; function getLines(id) { return temp=temp+id; } $("#theform").keypress(function(e){ var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0; if (key == 13) { var $targ = $(e.target); var tindex = $targ.attr("tabindex"); var count =1; var focusNext = false; var allowedNumberOfLines = 4; if ($targ.is("textarea") && !$targ.is(":button,:submit")) { var lines= getLines(count); if (lines > allowedNumberOfLines) { $("#login_error").css('background', '#F7F77C').fadeIn(1000).html("Only "+allowedNumberOfLines+" Lines Allowed").fadeOut(1000); tindex++; $("[tabindex=" + tindex + "]").focus(); return false; } } else if($targ.val() =='' || $targ.val() == "undefined") { $("[tabindex=" + tindex + "]").focus(); return false; } else if($targ.val() !='' || $targ.val() != "undefined") { tindex++; $("[tabindex=" + tindex + "]").focus(); return false; } } }); Is there any way to make it a custom function so that i can just call the function like $('theform').returnPress();

    Read the article

  • dropdownlist's Datavaluefield is not working

    - by Ranjana
    i am getting the datas from database and storing in a collectionobject. The collectionobj contains the Datas 'Name' and 'ID'. My code: <asp:dropdownlist id="dropdown1" runat="server" DataTextField="Name" DataValueField="ID"/> collectionobj=objbs.GetNAmes() for intloop as integer in Collectionobj.Count.Rows-1 dropdown.Items.Add( Collectionobj.Items(intloop).Name) dropdown.DataValueField=Collectionobj.Items(intloop).ID Next dropdown.DataBind() Im getting the Value binded in the dropdown as "Names" . when i select the dropdown i need to pass the respective ID of that name. But when I assign the Dim strid as String=dropdown1.DataValueField The dropdown1.DataValueField is holding the id of last name binded in the dropdown.it is not taking the id which im selecting n the dropdown.. Any suggestion..........

    Read the article

  • How to use external static files with Django (serving external files once again)?

    - by Tomas Novotny
    Hi, even after Googling and reading all relevant posts at StackOverflow, I still can't get static files working in my Django application. Here is how my files look: settings.py MEDIA_ROOT = os.path.join(SITE_ROOT, 'static') MEDIA_URL = '/static/' urs.py from DjangoBandCreatorSite.settings import DEBUG if DEBUG: urlpatterns += patterns('', ( r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': 'static'} )) template: <script type="text/javascript" src="/static/jquery.js"></script> <script type="text/javascript"> I am trying to use jquery.js stored in directory "static". I am using: Windows XP Python 2.6.4 Django 1.2.3 Thank you very much for any help

    Read the article

  • iOS Development: Should the "playersToInvite" property contain an array of strings or an array of GKPlayer objects?

    - by BeachRunnerJoe
    Should the playersToInvite property of the GKMatchRequest object contain an array of NSString objects that hold the player id's or should it contain an array of GKPlayer objects? The documentation on this critical property is not clear at all and I've tried both ways, but my code isn't working, so I can't tell by experimentation. Here's the description for that property in the docs... A list of players to invite to the match. Why did they even bother writing that? Thanks for your help!

    Read the article

  • graphviz dot: how to insert arrows from a node to center of an arrow

    - by gregor
    Hi everyone, I try to create diagrams for MPLUS analyses with dot from the graphviz package. Does anybody have experience with using dot to visualize structural equation models/latent class mixture models? There is especially one feature that I can't figure out how to do beautifully: I need arrows from nodes to the center of another arrow like C | | V A ------------> B I tried to insert an invisible node at the intersection of the arrows. This, however, results in a "cracked" A---B arrow because dot does represent it as two independent arrows. Is this even possible with dot? Thanks for suggestions and help! Gregor

    Read the article

  • Cannot insert into SQLite database through php PDO

    - by user323941
    Pls help see what is wrong.... (I test the db connection is fine) <?php $user_name=$_POST['user_name']; $password=$_POST['password']; $dbh=new PDO('sqlite:./db/user.db') or die("fail to connect db"); try{ $stmt = $dbh->prepare("INSERT INTO user_info VALUES (?, ?)"); $stmt->bindParam(1, $a); $stmt->bindParam(2, $b); $a=$user_name; $b=$password; $stmt->execute(); } catch(PDOException $e) {echo $e->getMessage();} ?>

    Read the article

  • Dynamic form creation from XSD in ASP.NET

    - by CitadelCSAlum
    I know there is a lot of documentation on the internet as far as XSD to forms, but I have not been able to come across one that is straight forward enough for my situation. I am working with a WCF web service that is going to fetch and .xsd xml schema, and must return the HTML of a form based on the .xsd xml schema. Is there any third party tools that can help out with this, if so what are they? If not, do you have any suggestions,better methods,etc for how this can be done?

    Read the article

  • SQL Query with ORDER BY Part 2

    - by Brett
    Hi SQL'ers, This is a followup question to: SQL Query with ORDER BY But I think the SQL logic is going to be quite different, so I am posting it as separate question. I am trying to extend my sql SELECT query it and having some trouble: I have the table: id type radius ------------------------- 1 type1 0.25 2 type2 0.59 3 type1 0.26 4 type1 0.78 5 type3 0.12 6 type2 0.45 7 type3 0.22 8 type3 0.98 and I am trying to learn how to SELECT the second smallest radius for each given type. So the returned recordset should look like: id type radius ------------------------- 3 type1 0.26 2 type2 0.59 7 type3 0.22 (Note: in the referenced question, I was looking for the lowest radius, not the second lowest radius). I am assuming I have to use LIMIT and OFFSET, but if I use the MIN() won't that return a distinct record containing the minimum radius? Does anyone have any thoughts on how to attack this? Many thanks, Brett

    Read the article

  • Android Development - Conversion to Dalvik format failed with error 1

    - by KP65
    So I'm dipping my toes into this area for the first time - i followed instructions to install the android SDK and eclipse plug in. I created a blank new android project and I get the following build errors: [2011-01-08 16:34:55 - xxx]: Dxno classfiles specified [2011-01-08 16:34:55 - xxx] Conversion to Dalvik format failed with error 1 I've googled the problem and tried to clean and rebuild, or hitting F5 on the project in the explorer but the issue remains. I've verified the build paths and the libraries to make sure only Android 2.3 is there but still get this issue. I have also tried to load a sample project and I get the same error. Any ideas?

    Read the article

  • Game engine with python scripting?

    - by Kayle
    Looking to put together a 3D side-scrolling action platformer. Since this is my first time trying to put together a non-simple adventure game, I'm at a loss for which engine to consider. I would prefer one that supports scripting in python, since that's my primary language. Without tight controls, the game will suck... so speed is a priority. Cross-platform is also important to me. Any suggestions?

    Read the article

  • GF 3.0.1 + Virtual Server: www.myhost.com:8080/projectname-war => www.myhost.com. How?

    - by Harry Pham
    EDIT I need to change www.myhost.com:8080/myproject-war to www.myhost.com. Here is what I've been trying: I configurate the Virtual Server: server. I have still have default Network Listeners to be http-listener-1 and http-listner-2. I change the Default Web Module to ScholarActive#ScholarActive-war.war (The only option in the drop down list, since I only deploy 1 application). For the docroot, I try this ${com.sun.aas.instanceRoot}/applications/ScholarActive/ScholarActive-war_war or this ${com.sun.aas.instanceRoot}/applications/ScholarActive/ Both does not work. What does docroot need to point to, for this to work? what I try to do is: when I type localhost:8080/ScholarActive-war, then my application load, I want to make so that if I type locahost:8080, it will load the app as well, then what left is changed the port to 80. But no luck. Any Idea?

    Read the article

  • Delphi Volume control by keyboard

    - by user568160
    Hi All, I recently had to replace a keyboard and this one ( GE 98552 ) does not have programmable buttons along the top and I miss the up/down volume buttons. it has 9 special buttons but none for volume and this model is not programmable. DUH! I am a long-time Delphi programmer but never messed with the multimedia stuff. Can anyone suggest some code to assign to say the "+" and "-" keys on the numeric pad that will change the volume up and down? I never use those two buttons so I would not be giving up functionality. Thanks Frank

    Read the article

  • Google Charts: Bar chart labels are reversed

    - by True Soft
    I create dinamically a chart for a website. I have a key/value map, I sort the values descending, and then create the url: http://chart.googleapis.com/chart? chs=400x200&cht=bhs&chbh=a&chdlp=l&chg=25,0&chma=0,0,0,5&chtt=Chart+test& chxr=0,0,8,1&chds=0,8&chxt=t,y& chd=t:8,5,3& chxl=1:|Label_8|Label_5|Label_3 The values are set by chd=t:8,5,3, and the labels are set by chxl=1:|Label_8|Label_5|Label_3. However, in the chart image the labels are reversed. I searched the documentation, but I didn't get why it is like this. Is it because I didn't set a value correctly, or is this the desired functionality? I could reverse the label texts in chxl from code to be displayed how I want. Is this the right way?

    Read the article

  • How to add event listners / signals to a simple superman class?

    - by Kabumbus
    I can and would love to use boost or std for this. Sorry - I am new to C++. So I created a really simple program like: #include <iostream> #include <string> using namespace std; class superman { public: string punch(){return cout << "superman: I hit the bad guy!" << endl;}; }; int main() { superman clark; clark.punch(); cin.get(); } I want to add an event listner that would tell me when clark punched and cout something like "superman punched!". How to add such event listner and event function to my class?

    Read the article

  • OpenID login on local development server for google app engine

    - by Alex Jeffery
    Are you able to use open id to log into the local development server with google app engine sdk version 1.4.1 and python 2.5? When I execute this self.redirect(users.create_login_url(continue_url, None, openid_url)) I get redirected to http://localhost/_ah/login rather than the openid url. The openid url and continue url are valid. My app.yaml looks like this - url: /_ah/login_required script: do_openid_login.py - url: /users/(.*) script: routers/user_router.py login: required If I browse to http://localhost/users/ I am also redirected to http://localhost/_ah/login rather than http://localhost/_ah/login_required Is there a config issue or does openid not work locally?

    Read the article

  • Updating table takes very long time

    - by rrejc
    Hi all, I have a table in MsSQL Server 2008 (SP2) containing 30 millios of rows, table size 150GB, there are a couple of int columns and two nvarchar(max) columns: one containing text (from 1-30000 characters) and one containg xml (up to 100000 characters). Table doesn't have any primary keys or indexes (its is a staging table). So atm I am running a query: UPDATE [dbo].[stage_table] SET [column2] = SUBSTRING([column1], 1, CHARINDEX('.', [column1])-1); the query is running for 3 hours (and it is still not completed), which I think is too long. Is It? I can see that there is constant read rate of 5MB/s and write rate of 10MB/s to .mdf file. How can I find out why the query is running so long? The "server" is i7, 24GB of ram, SATA disks on RAID 10. Many thanks!

    Read the article

  • Junior admin - how to discover/map the network to increase understanding?

    - by Dave
    I am a junior admin and have been tasked with gaining an understanding of the network. The 2nd line team are somewhat condescending so I'd rather not ask them. I know and use some of the servers on the network, so am able to tracert/ping them to see the names/addresses of equipment there are along the way, and gradually build a map, but how do I put the feelers out to find out what's out there if I don't know the names of server etc?

    Read the article

  • SMTP 25 blocked externally

    - by Jeff
    not sure how to title this question... we run an exchange server with around 80 internal users, all outgoing mail is relayed off a smart host (ISP smtp server) so nothing is actually sent to the world via our server. i wanted to check the server, locally i can telnet to port 25 with no issues and receive the esmtp service ready reply. whenever i do it from an external address (off our local network) i receive unable to connect error 10060. can this cause problems with SPF records, and reverse DNS ? should my exchange server be able to accept smtp requests, requiring authentication before i am able to send from external addresses? if so how... also the exchange server is behind a NAT (asa) device, more than likely thinking that the nat is not configured to route the smtp 25 request to the exchange server.. thanks

    Read the article

  • Apache Serving 403 Forbidden after OS X Snow Leopard Upgrade to Version 10.6.6

    - by Ian Oxley
    I've just upgraded my MacBook Pro to OS X Snow Leopard version 10.6.6 and now Apache is misbehaving: requests to http://localhost/ generate a 403 Forbidden response -- FIXED requests to any of my virtual hosts seem to generate a 200 Ok response, but contain zero bytes Some further info that might be useful: I'm using the Apache that comes bundled with OS X. I'm using PHP from http://www.entropy.ch/software/macosx/php/ (which is in /usr/local/bin) I've had look at the Apache error log and the only error seems to be the following: [notice] child pid 744 exit signal Segmentation fault (11) I'm completely stumped by this. Any help would be much appreciated. UPDATE Ok, I've managed to resolve the 403 Forbidden error thanks to http://techtrouts.com/mac-os-x-105-web-sharing-forbidden-403-on-httplocalhostusername/ I'm still having the second problem though for any request e.g. this now happens when I request http://localhost

    Read the article

  • Anyone recommend a program to print multiple HTML files at once for end users?

    - by Keith Bentrup
    I have some clients with multiple html files in folders that are occasionally updated & printed. They would like to be able to print them all at once without having to open each one. I typically do this with a quick command for myself, but I'm unaware of any freeware to do this. After a google search, I'm not finding one, so I'm hoping someone can help. I'd rather not use a script to do this for various security/ease of use/familiarity reasons, I'd rather be able to just point to a simple program they can download and use on their windows desktops. Anyone know of one or some other easy solution to do this? Maybe I'm overlooking the obvious. If anyone's curious, this is what I do for myself (not for my clients): for %h in (*.html) do type "%h" >> all.htm then open all.htm & print. If I need a page break on each doc, I just search and replace in all.htm </body> with <p style="page-break-after:always">&nbsp;</p></body>. It's quick & simple, but too unfamiliar for them. Thanks!

    Read the article

  • get_iplayer _ new problem

    - by Squiggle
    I have get_iplayer installed on a Windows 7 PC and, generally, it has worked without too many problems. Now I find that I cannot download "The Sinking of the Laconia" from the BBC. Both episodes are still available for viewing (although only episode 2 has a live ' download' option). An error message saying 'ERROR: RTMP_ReadPacket, failed to read RTMP packet header' may be relevant? If anyone can help before the programme becomes unavailable, I'd be grateful

    Read the article

  • Sharing soundcard to network.

    - by zerkms
    Let's suppose I have a laptop (L) and desktop PC (D), both with Windows 7 onboard. It is SB X-Fi extreme soundcard with rather good 5.1 home theater connected. But it is not comfortable to watch video sitting on the sofa from my desktop (sofa is in the center of the room and D is in the corner), even though it is 23" monitor. So I'm watching everything from the laptop. So the question - is it possible somehow to "share" soundcard from D to L, so I will watch the video from notebook and listen the sound from the 5.1? L and D are connected via wi-fi (fast enough).

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >