Search Results

Search found 988 results on 40 pages for 'josh pennington'.

Page 30/40 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • tuProlog unknow behavior

    - by Josh Guzman
    I'm using tuProlog to integrate Prolog with Java, to do so I'v been defined a .pl file wich contains this code: go:-write('hello world!'),nl. In my Java File at NetBeans i Have a Main Class that invokes this: Prolog engine = new Prolog(); Theory theory = new Theory(new FileInputStream("facultad.pl")); try { engine.setTheory(theory); } catch (InvalidTheoryException ex) { } SolveInfo solution = engine.solve("go."); if (solution.isSuccess()) { System.out.println(solution.getSolution()); } This Code must returns 'hello world', but instead of that it answer 'go', any ideas about this erratic behavior ??

    Read the article

  • Pop-Up Window at inital start up, of android application

    - by Josh Fairbank
    I am trying to find a code that will do a popup at the initial start up on an installed app. Much like a changelog that is starting to appear in more and more apps. I have found some similar codes, but being a beginner I haven't been able to figure out where to exactly put the code in and I always have tons of errors that still do not work once I try and fix them. I am working in Eclipse with an android project, and I'm using a webview to show a website. XML: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/webview" android:layout_height="fill_parent" android:layout_width="fill_parent" android:scrollbarAlwaysDrawVerticalTrack="false"/> </LinearLayout> Java File: package com.A2Ddesigners.WhatThe; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; import android.webkit.WebViewClient; import android.view.KeyEvent; public class Whatthe extends Activity { WebView webview; /** Called when the activity is first created. */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) { webview.goBack(); return true; } return super.onKeyDown(keyCode, event); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); webview = (WebView) findViewById(R.id.webview); webview.setWebViewClient(new HelloWebViewClient()); webview.getSettings().setJavaScriptEnabled(true); webview.setInitialScale(50); webview.getSettings().setUseWideViewPort(true); webview.loadUrl("http://mdsitest2.com/"); } private class HelloWebViewClient extends WebViewClient { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { view.loadUrl(url); return true; } } }

    Read the article

  • jQuery selectable() elements update values

    - by Josh
    Basically what I'm trying to do is update the value attribute of a hidden input field contained within the selected element when the selectable() UI stops running. If the element is selected, then the input's value should be the name attribute of that particular LI, whereas if the element is not selected, the value should be updated as empty. HTML Sample: <ul id="selector"> <li class="networkicon shr-digg" name="shr-digg"> <div></div> <label>Digg</label> <input type="hidden" value="" name="bookmark[]" /> </li> <li class="networkicon shr-reddit" name="shr-reddit"> <div></div> <label>Reddit</label> <input type="hidden" value="" name="bookmark[]" /> </li> <li class="networkicon shr-newsvine" name="shr-newsvine"> <div></div> <label>Newsvine</label> <input type="hidden" value="" name="bookmark[]" /> </li> </ul> Script Sample: $(function() { $("#selector").selectable({ filter: 'li', selected: function(event, ui) { $(".ui-selected").each(obj, function() { $(this).children('input').val($(this).attr('name')); }); }, unselected: function(event, ui) { $(".ui-selected").each(obj, function() { $(this).children('input').val(''); }); } }); });

    Read the article

  • Determining Excel spreadsheet format before Data Flow Task

    - by Josh Larsen
    I'm working on an SSIS package which uses a for each loop to iterate through excel files in a directory and a data flow task to import them. The issue I'm having is that the project manager I'm working with doesn't think the users will always follow the structure. So if a file is in the folder and the package tries to import it but the spreadsheet is missing columns or has extra columns it generates and error of course. Even though I have the task set to not fail the package; the package does indeed fail and then the other files aren't imported. So, I'm wondering what is the easiest way to either determine the spreadsheet is incorrectly formatted, or stop the error from failing the package execution? After taking said step I would just use a file copy task to move the file to a "Failure" folder. Then continue on processing the spreadsheets.

    Read the article

  • Stage shifts when using addChild?

    - by josh
    I'm having a very odd bug with ActionScript 3 in Flash CS4. I am adding movie clips to a stage in a for loop and then moving them out of view so that I can pull them in and remove them when I need them. I've narrowed down the issue to a point that I know that every time one of the movie clips are added to the stage using addChild(), the stage shifts to the right by one pixel. I know that sounds odd, but it's literally true... the 0 line on the y axis is shifted to the right one pixel every time the movie clip is added. I have no idea how this could be happening. Here's the code that is doing the work: private function setupSlides():void { for(x = 0; x < TOTAL_SLIDES; x++) { var ClassReference:Class = getDefinitionByName("Slide" + (x+1)) as Class; var s:MovieClip = new ClassReference() as MovieClip; s.x = 9999; s.y = 9999; addChild(s); slides[x] = s; } } Any thoughts?

    Read the article

  • Easy Python input question

    - by Josh K
    I'd like to have something similar to the following pseudo code: while input is not None and timer < 5: input = getChar() timer = time.time() - start if timer >= 5: print "took too long" else: print input Anyway to do this without threading? I would like an input method that returns whatever has been entered since the last time it was called, or None (null) if nothing was entered.

    Read the article

  • remote desktop computer viewer?

    - by Josh
    I would like to install a quad core computer in my dorm at college and use my much slower laptop to be able to control the quad core just as if I had a quad core laptop (control as in i see the gui, not command line control)! Both are on the same college network, though Im also interested in what would be necessary if the computers were on different networks. What would be the best method fot this? Im looking for non-lag communication.

    Read the article

  • MySQL ORDER BY rand(), name ASC

    - by Josh K
    I would like to take a database of say, 1000 users and select 20 random ones (ORDER BY rand(),LIMIT 20) then order the resulting set by the names. I came up with the following query which is not working like I hoped. SELECT * FROM users WHERE 1 ORDER BY rand(), name ASC LIMIT 20

    Read the article

  • str_replace() and strpos() for arrays?

    - by Josh
    I'm working with an array of data that I've changed the names of some array keys, but I want the data to stay the same basically... Basically I want to be able to keep the data that's in the array stored in the DB, but I want to update the array key names associated with it. Previously the array would have looked like this: $var_opts['services'] = array('foo-1', 'foo-2', 'foo-3', 'foo-4'); Now the array keys are no longer prefixed with "foo", but rather with "bar" instead. So how can I update the array variable to get rid of the "foos" and replace with "bars" instead? Like so: $var_opts['services'] = array('bar-1', 'bar-2', 'bar-3', 'bar-4'); I'm already using if(isset($var_opts['services']['foo-1'])) { unset($var_opts['services']['foo-1']); } to get rid of the foos... I just need to figure out how to replace each foo with a bar. I thought I would use str_replace on the whole array, but to my dismay it only works on strings (go figure, heh) and not arrays.

    Read the article

  • htaccess redirect to subfolder with same path attached?

    - by Josh
    How can I go about redirecting my old URLs which would have been: http:// blah.com/some/post/name to the new URLs which would be: http:// blah.com/new/some/post/name Is this even possible? I don't want to simply redirect any requests for the blah.com domain to blah.com/new I want to make sure the subpath is still attached to the redirect

    Read the article

  • Sliding "pull-down" navigation - what do I use? How do I implement? jQuery?

    - by Josh Carey
    I'm new to Javascript and jQuery, but I'm learning. Here is what I'd like to accomplish: I have a row of navigation "pull-down" tabs that I'd like to animate. Some sliders will have text links to sub-pages and some will not. The bottom portion of the tab should be clickable to go to the main page. Then the sub-page, text links should also be clickable. Here is a graphic example that should make sense of what I'd like to do: http://lionheart.net/downloads/nav-example.png Mouse over, would slide it down. Mouse out, after a second, should auto-slide up. Is this possible with jQuery or something else? Thanks so much for any help you can give me!

    Read the article

  • OpenID Attribute Exchange - should I use it?

    - by Josh
    My website will be using only OpenID for authentication. I'd like to pull user details down via attribute exchange, but attribute exchange seems to have caused a lot of grief for StackOverflow. What is the current state of play in the industry? Does any OpenID provider do a decent job of attribute exchange? Should I just steer away from OpenID attribute exchange altogether? How can I deal with inconsistent support for functionality?

    Read the article

  • Why can't I handle a KeyboardInterrupt in python?

    - by Josh
    I'm writing python 2.6.6 code on windows that looks like this: try: dostuff() except KeyboardInterrupt: print "Interrupted!" except: print "Some other exception?" finally: print "cleaning up...." print "done." dostuff() is a function that loops forever, reading a line at a time from an input stream and acting on it. I want to be able to stop it and clean up when I hit ctrl-c. What's happening instead is that the code under except KeyboardInterrupt: isn't running at all. The only thing that gets printed is "cleaning up...", and then a traceback is printed that looks like this: Traceback (most recent call last): File "filename.py", line 119, in <module> print 'cleaning up...' KeyboardInterrupt So, exception handling code is NOT running, and the traceback claims that a KeyboardInterrupt occurred during the finally clause, which doesn't make sense because hitting ctrl-c is what caused that part to run in the first place! Even the generic except: clause isn't running. EDIT: Based on the comments, I replaced the contents of the try: block with sys.stdin.read(). The problem still occurs exactly as described, with the first line of the finally: block running and then printing the same traceback.

    Read the article

  • Rails: Can't set or update tag_list using a text field with acts_as_taggable_on

    - by Josh
    Hey everyone, I'm trying to add tagging to a rails photo gallery system I'm working on. It works from the back-end, but if I try to set or change it in the form view, it doesn't work. I added acts_as_taggable to the photo model and did the migrations. My gallery builder is programmed to add one tag automatically to each photo it creates. This works fine, just as if it were setting it for the console. However, I can't seem to set tags using a text_field in the photo form. Here's the code I added to my photo form: <p> <%= f.label :tag_list %><br /> <%= f.text_field :tag_list %> </p> Now, that's pretty trivial, and since :tag_list supports single-string comma-separated assignment (e.g. tag_list = "this, that, the other" #= ['this', 'that', 'the other']), I don't see why using a text field doesn't work. And to make even less sense, if a tag list has already been populated, the list will still show up in the text field when editing the photo. I just can't seem to commit any changes to the list. The documentation on their github page doesn't appear to give any information on how to set these values from the view. Any ideas? Oh, and I'm using the Rails 3 gem version.

    Read the article

  • Android - Where to store generated bitmaps?

    - by Josh
    I've got an app which dynamically generates anywhere from 6 to 100 small bitmaps for the user to move around the screen in a given session. I currently generate them in onCreate and store them to the sd card, so that after an orientation change I can grab them out of external storage and display them again. However, this takes time (the loading) and I'd like to keep the bitmap references around between lifecyle changes for quicker access. My question is, is there a better place to store my generated bitmaps? I was thinking about creating a static storage library in my base activity, something that would only need to be reloaded when the app is completely removed from memory (shutdown, other apps need resources, 30 minute restart, etc). Ideally, I'd like the user to be able to back out to the title screen, click a "Resume" button, and in onCreate I just have access to those resident bitmap references instead of having to load them from storage again. For this reason I don't think Activity.onRetainNonConfigurationInstance is what I need. Alternatively, is there a better way to handle multiple generated bitmaps than what I'm doing or the plan I described?

    Read the article

  • How to map an interface in nhibernate?

    - by Josh
    I'm using two class NiceCustomer & RoughCustomer which implment the interface ICustomer. The ICustomer has four properties. They are: 1) Property Id() As Integer 2) Property Name() As String 3) Property IsNiceCustomer() As Boolean 4) ReadOnly Property AddressFullText() As String I don't know how to map the interface ICustomer, to the database. I get an error like this in the inner exception. "An association refers to an unmapped class: ICustomer" I'm using Fluent and NHibernate. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • How can I fix this touch event / draw loop "deadlock"?

    - by Josh
    Just want to start out by saying this seems like a great site, hope you guys can help! I'm trying to use the structure laid out in LunarLander to create a simple game in which the user can drag some bitmaps around on the screen (the actual game is more complex, but that's not important). I ripped out the irrelevant parts of LanderLander, and set up my own bitmap drawing, something like BoardThread (an inner class of BoardView): run() { while(mRun) { canvas = lockSurfaceHolder... syncronized(mSurfaceHolder) { /* drawStuff using member position fields in BoardView */ } unlockSurfaceHolder } } My drawStuff simply walks through some arrays and throws bitmaps onto the canvas. All that works fine. Then I wanted to start handling touch events so that when the user presses a bitmap, it is selected, when the user unpresses a bitmap, it is deselected, and if a bitmap is selected during a touch move event, the bitmap is dragged. I did this stuff by listening for touch events in the BoardView's parent, BoardActivity, and passing them down into the BoardView. Something like In BoardView handleTouchEvent(MotionEvent e) { synchronized(mSurfaceHolder) { /* Modify shared member fields in BoardView so BoardThread can render the bitmaps */ } } This ALSO works fine. I can drag my tiles around the screen no problem. However, every once in a while, when the app first starts up and I trigger my first touch event, the handleTouchEvent stops executing at the synchronized line (as viewed in DDMS). The drawing loop is active during this time (I can tell because a timer changes onscreen), and it usually takes several seconds or more before a bunch of touch events come through the pipeline and everything is fine again. This doesn't seem like deadlock to me, since the draw loop is constantly going in and out of its syncronized block. Shouldn't this allow the event handling thread to grab a lock on mSurfaceHolder? What's going on here? Anyone have suggestions for improving how I've structured this? Some other info. This "hang" only ever occurs on first touch event after activity start. This includes on orientation change after restoreState has been called. Also, I can remove EVERYTHING within the syncronized block in the event handler, and it will still get hung up at the syncronized call. Thanks!

    Read the article

  • What is the easiest way to learn Objective C?

    - by Josh
    I am interested in learning Objective C so I can develop for the iPhone and Mac. I am a web developer with lots of experience with HTML, CSS, Javascript, and PHP, but I have no knowledge at all of C or Objective C. What is the fastest and easiest way for me to learn Objective C? Can you recommend any good resources for getting started?

    Read the article

  • Getting multiple values with scanf()

    - by Josh Curren
    I am using scanf() to get a set of ints from the user. But I would like the user to supply all 4 ints at once instead of 4 different promps. I know I can get one value by doing: scanf( "%i", &minx); But I would like the user to be able to do something like: Enter Four Ints: 123 234 345 456 Is it possible to do this?

    Read the article

  • Is there a Java 1.5 varargs API for slf4j yet?

    - by Josh
    I want to get rid of this lot... public void info(String msg); public void info(String format, Object arg); public void info(String format, Object arg1, Object arg2); public void info(String format, Object[] argArray); ...and replace it with this one... public void info(String format, Object ... args); ...so that my logging syntax doesn't have to change depending on the number of arguments I want to log. There seems to be lots of discussion and work around it, but where is it? Or should I wrap the wrapper that is slf4j?

    Read the article

  • expected `;' before "pennies"? C++ Debugging (Code Completed)

    - by Josh Lake
    Can anyone tell me why I get an error on my last cout? #include <iostream> #include <cmath> #include <stdio.h> #include <cstring> #include <conio.h> using namespace std; inline void keep_window_open() { char ch; cin>>ch; } int main() { cout << "How many pennies do you have?\n"; int pennies; cin >> pennies; double total_pen; total_pen = (0.01 * pennies); if (pennies >= 1) { string penn = " pennies."; }else { string penn = " penny."; } cout << "How many nickles do you have?\n"; int nickles; cin >> nickles; double total_nic; total_nic = (0.05 * nickles); if (nickles >= 1) { string five = " nickels."; }else { string five = " nickel."; } cout << "How many dimes do you have?\n"; int dimes; cin >> dimes; double total_dim; total_dim = (0.10 * dimes); if (dimes >= 1) { string ten = " dimes."; }else { string ten = " dime."; } cout << "How many quarters do you have?\n"; int quarters; cin >> quarters; double total_qua; total_qua = (0.25 * quarters); if (quarters >= 1) { string twentyfive = " quarters."; }else { string twentyfive = " quarter."; } cout << "How many half-dollars do you have?\n"; int half_dollars; cin >> half_dollars; double total_dol; total_dol = (0.50 * half_dollars); if (half_dollars >= 1) { string fifty = " half dollars."; }else { string fifty = " half dollar."; } string saying = "You have "; cout << saying pennies penn << "\n" << saying nickles five << "\n" << saying dimes ten << "\n" << saying quarters twentyfive << "\n" << saying half_dollars fifty << "\n"; keep_window_open() return 0; }

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >