Search Results

Search found 34813 results on 1393 pages for 'im fine'.

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

  • In a Shell scripts, check version of installed package, make a decision based on output

    - by DJDarkViper
    Looking to write a cross distro / cross version shell script that makes sure a forced version of PHP is installed Example: Ubuntu 12.04 has 5.3, Ubuntu 13.10 has 5.5, Debian 7 has 5.4 I need this script, when run on a distro that has an old version of PHP, to update the repo to point to a package for 5.4, and if the distro has too new of a version, can downgrade to 5.4 appropriately. Im still not entirely comprehensive of Shell/Terminals technical limit of what you can do with it, but ill be perfectly frank that im still not totally used to existing tools The best I can think at the moment is: php -v | grep "PHP 5" but that returns a bunch of potentially changeable granular characters (PHP 5.4.4-14+deb7u5 (cli) (built: Oct 3 2013 09:24:58) ). Im not sure what to pipe to after this to extract out the characters im interested in Im not sure if im being totally clear, im not sure how to ask this.. Basically, in an automated shell script for Linux distros, how do I extract the PHP version (and just the PHP version number preferably) and make a decision based on that output EDIT This line ended up doing pretty dang good php -v | grep "PHP 5" | sed 's/.*PHP \([^-]*\).*/\1/' | cut -c 1-3 Bit long in the tooth, but gives me "5.3", "5.4", and "5.5" which is exactly what I need to work with

    Read the article

  • Android WebView not loading a JavaScript file, but Android Browser loads it fine.

    - by Justin
    I'm writing an application which connects to a back office site. The backoffice site contains a whole slew of JavaScript functions, at least 100 times the average site. Unfortunately it does not load them, and causes much of the functionality to not work properly. So I am running a test. I put a page out on my server which loads the FireBugLite javascript text. Its a lot of javascript and perfect to test and see if the Android WebView will load it. The WebView loads nothing, but the browser loads the Firebug Icon. What on earth would make the difference, why can it run in the browser and not in my WebView? Any suggestions. More background information, in order to get the stinking backoffice application available on a Droid (or any other platform except windows) I needed to trick the bakcoffice application to believe what's accessing the website is Internet Explorer. I do this by modifying the WebView User Agent. Also for this application I've slimmed my landing page, so I could give you the source to offer me aid. package ksc.myKMB; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.graphics.Bitmap; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.Window; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebSettings; import android.webkit.WebViewClient; import android.widget.Toast; public class myKMB extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** Performs base set up */ /** Create a Activity of this Activity, IE myProcess */ myProcess = this; /*** Create global objects and web browsing objects */ HideDialogOnce = true; webview = new WebView(this) { }; webChromeClient = new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities and WebViews measure progress with different scales. // The progress meter will automatically disappear when we reach 100% myProcess.setProgress((progress * 100)); //CreateMessage("Progress is : " + progress); } }; webViewClient = new WebViewClient() { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { Toast.makeText(myProcess, MessageBegText + description + MessageEndText, Toast.LENGTH_SHORT).show(); } public void onPageFinished (WebView view, String url) { /** Hide dialog */ try { // loadingDialog.dismiss(); } finally { } //myProcess.setProgress(1000); /** Fon't show the dialog while I'm performing fixes */ //HideDialogOnce = true; view.loadUrl("javascript:document.getElementById('JTRANS011').style.visibility='visible';"); } public void onPageStarted(WebView view, String url, Bitmap favicon) { if (HideDialogOnce == false) { //loadingDialog = ProgressDialog.show(myProcess, "", // "One moment, the page is laoding...", true); } else { //HideDialogOnce = true; } } }; getWindow().requestFeature(Window.FEATURE_PROGRESS); webview.setWebChromeClient(webChromeClient); webview.setWebViewClient(webViewClient); setContentView(webview); /** Load the Keynote Browser Settings */ LoadSettings(); webview.loadUrl(LandingPage); } /** Get Menu */ @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } /** an item gets pushed */ @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // We have only one menu option case R.id.quit: System.exit(0); break; case R.id.back: webview.goBack(); case R.id.refresh: webview.reload(); case R.id.info: //IncludeJavascript(""); } return true; } /** Begin Globals */ public WebView webview; public WebChromeClient webChromeClient; public WebViewClient webViewClient; public ProgressDialog loadingDialog; public Boolean HideDialogOnce; public Activity myProcess; public String OverideUserAgent_IE = "Mozilla/5.0 (Windows; MSIE 6.0; Android 1.6; en-US) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Safari/523.12.2 myKMB/1.0"; public String LandingPage = "http://kscserver.com/main-leap-slim.html"; public String MessageBegText = "Problem making a connection, Details: "; public String MessageEndText = " For Support Call: (xxx) xxx - xxxx."; public void LoadSettings() { webview.getSettings().setUserAgentString(OverideUserAgent_IE); webview.getSettings().setJavaScriptEnabled(true); webview.getSettings().setBuiltInZoomControls(true); webview.getSettings().setSupportZoom(true); } /** Creates a message alert dialog */ public void CreateMessage(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(message) .setCancelable(true) .setNegativeButton("Close", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); } } My Application is running in the background, and as you can see no Firebug in the lower right hand corner. However the browser (the emulator on top) has the same page but shows the firebug. What am I doing wrong? I'm assuming its either not enough memory allocated to the application, process power allocation, or a physical memory thing. I can't tell, all I know is the results are strange. I get the same thing form my android device, the application shows no firebug but the browser shows the firebug.

    Read the article

  • Forms Authentication logs out very quickly , locally works fine !!!

    - by user319075
    Hello to all, There's a problem that i am facing with my hosting company, I use a project that uses FormsAuthentication and the problem is that though it successfully logs in, it logs out VERY QUICKLY, and i don't know what could be the cause of that, so in my web.config file i added those lines: <authentication mode="Forms" > <forms name="Nadim" loginUrl="Login.aspx" defaultUrl="Default.aspx" protection="All" path="/" requireSSL="false"/> </authentication> <authorization> <deny users ="?" /> </authorization> <sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false" timeout="1440"> </sessionState> and this is the code i use in my custom login page : protected void PasswordCustomValidator_ServerValidate(object source, ServerValidateEventArgs args) { try { UsersSqlDataSource.SelectParameters.Clear(); UsersSqlDataSource.SelectCommand = "Select * From Admins Where AdminID='" + IDTextBox.Text + "' and Password='" + PassTextBox.Text + "'"; UsersSqlDataSource.SelectCommandType = SqlDataSourceCommandType.Text; UsersSqlDataSource.DataSourceMode = SqlDataSourceMode.DataReader; reader = (SqlDataReader)UsersSqlDataSource.Select(DataSourceSelectArguments.Empty); if (reader.HasRows) { reader.Read(); if (RememberCheckBox.Checked == true) Page.Response.Cookies["Admin"].Expires = DateTime.Now.AddDays(5); args.IsValid = true; string userData = "ApplicationSpecific data for this user."; FormsAuthenticationTicket ticket1 = new FormsAuthenticationTicket(1, IDTextBox.Text, System.DateTime.Now, System.DateTime.Now.AddMinutes(30), true, userData, FormsAuthentication.FormsCookiePath); string encTicket = FormsAuthentication.Encrypt(ticket1); Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); Response.Redirect(FormsAuthentication.GetRedirectUrl(IDTextBox.Text, RememberCheckBox.Checked)); //FormsAuthentication.RedirectFromLoginPage(IDTextBox.Text, RememberCheckBox.Checked); } else args.IsValid = false; } catch (SqlException ex) { ErrorLabel.Text = ex.Message; } catch (InvalidOperationException) { args.IsValid = false; } catch (Exception ex) { ErrorLabel.Text = ex.Message; } Also you will find that line of code: FormsAuthentication.RedirectFromLoginPage(IDTextBox.Text, RememberCheckBox.Checked); is commented because i thought there might be something wrong with the ticket when i log in , so i created it manually , every thing i know i tried but nothing worked, so does anyone have any idea what is the problem ? Thanks in advance, Baher.

    Read the article

  • mpicc hangs when called from makefile; runs fine as single command

    - by user2518579
    i'm trying to compile WRF (doubt that's relevant) and am having a problem where mpicc will hang when run w/ the compile script. icc and mpif90 have no issues. the compile script is executed w/ #!/bin/csh -f just to be verbose, here's an example. i run the script and get here make[3]: Entering directory `/home/jason/wrf/wrf3.5/external/RSL_LITE' mpicc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT -DFSEEKO64_OK -w -O3 -DDM_PARALLEL -DMAX_HISTORY=25 -DNMM_CORE=0 -c rsl_bcast.c and hang. so then i run that line by itself jason@server:~/wrf/wrf3.5$ cd /home/jason/wrf/wrf3.5/external/RSL_LITE jason@server:wrf3.5/external/RSL_LITE$ mpicc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT -DFSEEKO64_OK -w -O3 -DDM_PARALLEL -DMAX_HISTORY=25 -DNMM_CORE=0 -c rsl_bcast.c jason@server:wrf3.5/external/RSL_LITE$ compiles instantly. starting the compile script again does the exact same thing but on the next file. i have no idea what to do, and this is basically impossible to google for.

    Read the article

  • PHP script works fine until I send a parameter from HTTPService in Flash Builder 4?

    - by ben
    I'm using a PHP script to read an RSS feed in my Flex 4 app. The script works when I put the url of the feed in the actual script, but I can't get it to work when I try to send the URL as a parameter from a HTTPService in Flex. Can anyone tell me what I'm doing wrong? Here is the HTTPService from Flex 4 that I'm using: <mx:HTTPService url="http://talk.6te.net/proxy.php" id="proxyService" method="POST" result="rssResult()" fault="rssFault()"> <mx:request> <url> http://feeds.feedburner.com/nah_right </url> </mx:request> </mx:HTTPService> This is the script that works: <?php $ch = curl_init(); $timeout = 30; $userAgent = $_SERVER['HTTP_USER_AGENT']; curl_setopt($ch, CURLOPT_URL, "http://feeds.feedburner.com/nah_right"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $response = curl_exec($ch); if (curl_errno($ch)) { echo curl_error($ch); } else { curl_close($ch); echo $response; } ?> But this is what I actually want to use, but it doesn't work: <?php $ch = curl_init(); $timeout = 30; $userAgent = $_SERVER['HTTP_USER_AGENT']; curl_setopt($ch, CURLOPT_URL, $_REQUEST['url']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $response = curl_exec($ch); if (curl_errno($ch)) { echo curl_error($ch); } else { curl_close($ch); echo $response; } ?> Here is the request and response output of the HTTPService from the network monitor in Flash Builder 4 (using the PHP script that doesn't work): Request: POST /proxy.php HTTP/1.1 Host: talk.6te.net 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 Content-type: application/x-www-form-urlencoded Content-length: 97 url=%0A%09%09%09%09%09http%3A%2F%2Ffeeds%2Efeedburner%2Ecom%2Fnah%5Fright%0A%20%20%20%20%09%09%09 Response: HTTP/1.1 200 OK Date: Mon, 10 May 2010 03:23:27 GMT Server: Apache X-Powered-By: PHP/5.2.13 Content-Length: 15 Content-Type: text/html <url> malformed I've tried putting the URL in " " in the HTTPService, but that didn't do anything. Any help would be greatly appreciated!

    Read the article

  • WPF Custom Control - Designer looks fine, but I get a runtime issue...

    - by myermian
    MainWindow.xaml <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:MyStuff;assembly=MyStuff" Title="MainWindow" Height="350" Width="525"> <Grid> <TabControl Margin="5"> <TabItem Header="Start Page" /> <my:XTabItem Header="Tab 1" Image="Resources/icon1.png" /> </TabControl> </Grid> </Window> Generic.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MyStuff" > <!-- XTabItem --> <Style TargetType="{x:Type local:XTabItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:XTabItem}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <StackPanel Orientation="Horizontal"> <Image Source="{Binding Path=Image, RelativeSource={RelativeSource TemplatedParent}}" Stretch="UniformToFill" MaxHeight="24" /> <TextBlock Text="{TemplateBinding Header}" /> <Button Content="X" /> </StackPanel> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> XTabItem.cs using System; using System.ComponentModel; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace MyStuff { public class XTabItem : TabItem { #region Dependency Properties public static readonly DependencyProperty ImageProperty; #endregion #region Constructors / Initializer static XTabItem() { //Initialize the control as "lookless". DefaultStyleKeyProperty.OverrideMetadata(typeof(XTabItem), new FrameworkPropertyMetadata(typeof(XTabItem))); //Setup the dependency properties. ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(XTabItem), new UIPropertyMetadata(null)); } #endregion #region Custom Control Properties (Image) /// <summary> /// The image (icon) displayed by inside the tab header. /// </summary> /// <remarks>The image is specified in XAML as an absolute or relative path.</remarks> [Description("The image displayed by the button"), Category("Optional Properties")] public ImageSource Image { get { return (ImageSource)GetValue(ImageProperty); } set { SetValue(ImageProperty, value); } } #endregion } } Exception at line #9 () : XamlParseException : 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '9' and line position '27'.

    Read the article

  • PHP script works fine until I send it a parameter from HTTPService in Flash Builder 4?

    - by ben
    I'm using a PHP script to read an RSS feed in my Flex 4 app. The script works when I put the url of the feed in the actual script, but I can't get it to work when I try to send the URL as a parameter from a HTTPService in Flex. Can anyone tell me what I'm doing wrong? Here is the HTTPService from Flex 4 that I'm using: <mx:HTTPService url="http://talk.6te.net/proxy.php" id="proxyService" method="POST" result="rssResult()" fault="rssFault()"> <mx:request> <url> http://feeds.feedburner.com/nah_right </url> </mx:request> </mx:HTTPService> This is the script that works: <?php $ch = curl_init(); $timeout = 30; $userAgent = $_SERVER['HTTP_USER_AGENT']; curl_setopt($ch, CURLOPT_URL, "http://feeds.feedburner.com/nah_right"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $response = curl_exec($ch); if (curl_errno($ch)) { echo curl_error($ch); } else { curl_close($ch); echo $response; } ?> But this is what I actually want to use, but it doesn't work: <?php $ch = curl_init(); $timeout = 30; $userAgent = $_SERVER['HTTP_USER_AGENT']; curl_setopt($ch, CURLOPT_URL, $_REQUEST['url']); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); $response = curl_exec($ch); if (curl_errno($ch)) { echo curl_error($ch); } else { curl_close($ch); echo $response; } ?> Here is the request and response output of the HTTPService from the network monitor in Flash Builder 4 (using the PHP script that doesn't work): Request: POST /proxy.php HTTP/1.1 Host: talk.6te.net 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 Content-type: application/x-www-form-urlencoded Content-length: 97 url=%0A%09%09%09%09%09http%3A%2F%2Ffeeds%2Efeedburner%2Ecom%2Fnah%5Fright%0A%20%20%20%20%09%09%09 Response: HTTP/1.1 200 OK Date: Mon, 10 May 2010 03:23:27 GMT Server: Apache X-Powered-By: PHP/5.2.13 Content-Length: 15 Content-Type: text/html <url> malformed I've tried putting the URL in " " in the HTTPService, but that didn't do anything. Any help would be greatly appreciated!

    Read the article

  • JQuery Ajax returns status 0 in Google Chrome, works fine with other browsers.

    - by Jason Zhou
    Hello, I am using jQuery ajax, and it worked very well until I tried the site in Google Chrome. I am directed to the success handler. However, when I printed the status of the XMLHttpRequest, I got a 0. The responseText is empty as well. This only happens in Google Chrome. I tried the same code on Safari, Firefox, and Opera, they are worked correctly. Any help will be greatly appreciated. Thanks.

    Read the article

  • Singleton code linker errors in vc 9.0. Runs fine in linux compiled with gcc

    - by user306560
    I have a simple logger that is implemented as a singleton. It works like i want when I compile and run it with g++ in linux but when I compile in Visual Studio 9.0 with vc++ I get the following errors. Is there a way to fix this? I don't mind changing the logger class around, but I would like to avoid changing how it is called. 1>Linking... 1>loggerTest.obj : error LNK2005: "public: static class Logger * __cdecl Logger::getInstance(void)" (?getInstance@Logger@@SAPAV1@XZ) already defined in Logger.obj 1>loggerTest.obj : error LNK2005: "public: void __thiscall Logger::log(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?log@Logger@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) already defined in Logger.obj 1>loggerTest.obj : error LNK2005: "public: void __thiscall Logger::closeLog(void)" (?closeLog@Logger@@QAEXXZ) already defined in Logger.obj 1>loggerTest.obj : error LNK2005: "private: static class Logger * Logger::_instance" (?_instance@Logger@@0PAV1@A) already defined in Logger.obj 1>Logger.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Logger::_path" (?_path@Logger@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) 1>loggerTest.obj : error LNK2001: unresolved external symbol "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > Logger::_path" (?_path@Logger@@0V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) 1>Logger.obj : error LNK2001: unresolved external symbol "private: static class boost::mutex Logger::_mutex" (?_mutex@Logger@@0Vmutex@boost@@A) 1>loggerTest.obj : error LNK2001: unresolved external symbol "private: static class boost::mutex Logger::_mutex" (?_mutex@Logger@@0Vmutex@boost@@A) 1>Logger.obj : error LNK2001: unresolved external symbol "private: static class std::basic_ofstream<char,struct std::char_traits<char> > Logger::_log" (?_log@Logger@@0V?$basic_ofstream@DU?$char_traits@D@std@@@std@@A) 1>loggerTest.obj : error LNK2001: unresolved external symbol "private: static class std::basic_ofstream<char,struct std::char_traits<char> > Logger::_log" (?_log@Logger@@0V?$basic_ofstream@DU?$char_traits@D@std@@@std@@A) The code, three files Logger.h Logger.cpp test.cpp #ifndef __LOGGER_CPP__ #define __LOGGER_CPP__ #include "Logger.h" Logger* Logger::_instance = 0; //string Logger::_path = "log"; //ofstream Logger::_log; //boost::mutex Logger::_mutex; Logger* Logger::getInstance(){ { boost::mutex::scoped_lock lock(_mutex); if(_instance == 0) { _instance = new Logger; _path = "log"; } } //mutex return _instance; } void Logger::log(const std::string& msg){ { boost::mutex::scoped_lock lock(_mutex); if(!_log.is_open()){ _log.open(_path.c_str()); } if(_log.is_open()){ _log << msg.c_str() << std::endl; } } } void Logger::closeLog(){ Logger::_log.close(); } #endif ` ... #ifndef __LOGGER_H__ #define __LOGGER_H__ #include <iostream> #include <string> #include <fstream> #include <boost/thread/mutex.hpp> #include <boost/thread.hpp> using namespace std; class Logger { public: static Logger* getInstance(); void log(const std::string& msg); void closeLog(); protected: Logger(){} private: static Logger* _instance; static string _path; static bool _logOpen; static ofstream _log; static boost::mutex _mutex; //check mutable }; #endif test.cpp ` #include <iostream> #include "Logger.cpp" using namespace std; int main(int argc, char *argv[]) { Logger* log = Logger::getInstance(); log->log("hello world\n"); return 0; }

    Read the article

  • JWPlayer plays videos at 3x speed on the first run, then works fine in subsequent runs on the same p

    - by Josiah Kiehl
    Go here: http://nano.materials.drexel.edu/research/videolibrary For some bizarre reason, the videos will play at 3x speed on the first run through, but then will play at normal speed each subsequent play. This doesn't happen all the time, and it's not always the same video(s) that do it. I'm utterly baffled. I've reconverted the videos from m4p to flv (using BitComet's converter) several times, double checking the settings each time through with no change to the behavior. Anyone have a clue what's going on?

    Read the article

  • Thinking Sphinx with Rails - Delta indexing seems to work fine for one model but not for the other

    - by hack3r
    I have 2 models User and Discussion. I have defined the indices for the models as below: For the User model: define_index do indexes email indexes first_name indexes last_name, :sortable => true indexes groups(:name), :as => :group_names has "IF(email_confirmed = true and status = 'approved', true, false)", :as => :approved_user, :type => :boolean has "IF(email_confirmed = true and (status = 'approved' or status='blocked'), true, false)", :as => :approved_or_blocked_user, :type => :boolean has points, :type => :integer has created_at, :type => :datetime has user(:id) set_property :delta => true end For the Discussion model: define_index do indexes title indexes description indexes category(:title), :as => :category_title indexes tags(:title), :as => :tag_title has "IF(publish_to_blog = true AND sticky = false, true, false)", :as => :publish_to_main, :type => :boolean has created_at has updated_at, :type => :datetime has recent_activity_at, :type => :datetime has views_count, :type => :integer has featured has publish_to_blog has sticky set_property :delta => true end I have added a delta column to both tables as per the documentation. My problem is that delta indexing works only for the Discussion model and not for the User model. For ex: When I update the 'title' of a discussion, I can see the thinking sphinx is rotating the indices etc. (as is evident from the logs). But when I update the 'first_name' or the 'last_name' of a user, nothing happens. The User model also has a has_many :through association through a model called GroupsUser. I have setup a after_save on the GroupsUser as follows: def set_user_delta_flag user.delta = true user.save end Even this doesn't seem to trigger delta indexing on the User model. A similar setup for the Discussion model works perfectly! Can anyone tell me why this is happening?

    Read the article

  • PHP - My array returns NULL values when placed in a function, but works fine outside of the function

    - by orbit82
    Okay, let me see if I can explain this. I am making a newspaper WordPress theme. The theme pulls posts from categories. The front page shows multiple categories, organized as "newsboxes". Each post should show up only ONCE on the front page, even if said post is in two or more categories. To prevent posts from duplicating on the front page, I've created an array that keeps track of the individual post IDs. When a post FIRST shows up on the front page, its ID gets added to the array. Before looping through the posts for each category, the code first checks the array to see which posts have ALREADY been displayed. OK, so now remember how I said earlier that the front page shows multiple categories organized as "newsboxes"? Well, these newsboxes are called onto the front page using PHP includes. I have 6 newsboxes appearing on the front page, and the code to call them is EXACTLY the same. I didn't want to repeat the same code 6 times, so I put all of the inclusion code into a function. The function works, but the only problem is that it screws up the duplicate posts code I mentioned earlier. The posts all repeat. Running a var_dump on the $do_not_duplicate variable returns an array with null indices. Everything works PERFECTLY if I don't put the code inside a function, but once I do put them in a function it's like the arrays aren't even connecting with the posts. Here is the code with the arrays. The key variables in question here include $do_not_duplicate[] = $post-ID, $do_not_duplicate and 'post__not_in' = $do_not_duplicate <?php query_posts('cat='.$settings['cpress_top_story_category'].'&posts_per_page='.$settings['cpress_number_of_top_stories'].'');?> <?php if (have_posts()) : ?> <!--TOP STORY--> <div id="topStory"> <?php while ( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_post_thumbnail('top-story-thumbnail'); ?></a> <h2 class="extraLargeHeadline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="topStory_author"><?php cpress_show_post_author_byline(); ?></div> <div <?php post_class('topStory_entry') ?> id="post-<?php the_ID(); ?>"> <?php if($settings['cpress_excerpt_or_content_top_story_newsbox'] == "content") { the_content(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php } else { the_excerpt(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php }?> </div><!--/topStoryentry--> <div class="topStory_meta"><?php cpress_show_post_meta(); ?></div> <?php endwhile; wp_reset_query(); ?> <?php if(!$settings['cpress_hide_top_story_more_stories']) { ?> <!--More Top Stories--><div id="moreTopStories"> <?php $category_link = get_category_link(''.$settings['cpress_top_story_category'].''); ?> <?php if (have_posts()) : ?> <?php query_posts( array( 'cat' => ''.$settings['cpress_top_story_category'].'', 'posts_per_page' => ''.$settings['cpress_number_of_more_top_stories'].'', 'post__not_in' => $do_not_duplicate ) ); ?> <h4 class="moreStories"> <?php if($settings['cpress_make_top_story_more_stories_link']) { ?> <a href="<?php echo $category_link; ?>" title="<?php echo strip_tags($settings['cpress_top_story_more_stories_text']);?>"><?php echo strip_tags($settings['cpress_top_story_more_stories_text']);?></a><?php } else { echo strip_tags($settings['cpress_top_story_more_stories_text']); } ?> </h4> <ul> <?php while( have_posts() ) : the_post(); $do_not_duplicate[] = $post->ID; ?> <li><h2 class="mediumHeadline"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <?php if(!$settings['cpress_hide_more_top_stories_excerpt']) { ?> <div <?php post_class('moreTopStory_postExcerpt') ?> id="post-<?php the_ID(); ?>"><?php if($settings['cpress_excerpt_or_content_top_story_newsbox'] == "content") { the_content(); ?><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php } else { the_excerpt(); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><span class="read_more"><?php echo $settings['cpress_more_text']; ?></span></a> <?php }?> </div><?php } ?> <div class="moreTopStory_postMeta"><?php cpress_show_post_meta(); ?></div> </li> <?php endwhile; wp_reset_query(); ?> </ul> <?php endif;?> </div><!--/moreTopStories--> <?php } ?> <?php echo(var_dump($do_not_duplicate)); ?> </div><!--/TOP STORY--> <?php endif; ?> And here is the code that includes the newsboxes onto the front page. This is the code I'm trying to put into a function to avoid duplicating it 6 times on one page. function cpress_show_templatebitsf($tbit_num, $tbit_option) { global $tbit_path; global $shortname; $settings = get_option($shortname.'_options'); //display the templatebits (usually these will be sidebars) for ($i=1; $i<=$tbit_num; $i++) { $tbit = strip_tags($settings[$tbit_option .$i]); if($tbit !="") { include_once(TEMPLATEPATH . $tbit_path. $tbit.'.php'); } //if }//for loop unset($tbit_option); } I hope this makes sense. It's kind of a complex thing to explain but I've tried many things to fix it and have had no luck. I'm stumped. I'm hoping it's just some little thing I'm overlooking because it seems like it shouldn't be such a problem.

    Read the article

  • Test of procedure is fine but when called from a menu gives uninitialized errors. C

    - by Delfic
    The language is portuguese, but I think you get the picture. My main calls only the menu function (the function in comment is the test which works). In the menu i introduce the option 1 which calls the same function. But there's something wrong. If i test it solely on the input: (1/1)x^2 //it reads the polinomyal (2/1) //reads the rational and returns 4 (you can guess what it does, calculates the value of an instace of x over a rational) My polinomyals are linear linked lists with a coeficient (rational) and a degree (int) int main () { menu_interactivo (); // instanciacao (); return 0; } void menu_interactivo(void) { int i; do{ printf("1. Instanciacao de um polinomio com um escalar\n"); printf("2. Multiplicacao de um polinomio por um escalar\n"); printf("3. Soma de dois polinomios\n"); printf("4. Multiplicacao de dois polinomios\n"); printf("5. Divisao de dois polinomios\n"); printf("0. Sair\n"); scanf ("%d", &i); switch (i) { case 0: exit(0); break; case 1: instanciacao (); break; case 2: multiplicacao_esc (); break; case 3: somar_pol (); break; case 4: multiplicacao_pol (); break; case 5: divisao_pol (); break; default:printf("O numero introduzido nao e valido!\n"); } } while (i != 0); } When i call it with the menu, with the same input, it does not stop reading the polinomyal (I know this because it does not ask me for the rational as on the other example) I've run it with valgrind --track-origins=yes returning the following: ==17482== Memcheck, a memory error detector ==17482== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al. ==17482== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info ==17482== Command: ./teste ==17482== 1. Instanciacao de um polinomio com um escalar 2. Multiplicacao de um polinomio por um escalar 3. Soma de dois polinomios 4. Multiplicacao de dois polinomios 5. Divisao de dois polinomios 0. Sair 1 Introduza um polinomio na forma (n0/d0)x^e0 + (n1/d1)x^e1 + ... + (nk/dk)^ek, com ei > e(i+1): (1/1)x^2 ==17482== Conditional jump or move depends on uninitialised value(s) ==17482== at 0x401126: simplifica_f (fraccoes.c:53) ==17482== by 0x4010CB: le_f (fraccoes.c:30) ==17482== by 0x400CDA: le_pol (polinomios.c:156) ==17482== by 0x400817: instanciacao (t4.c:14) ==17482== by 0x40098C: menu_interactivo (t4.c:68) ==17482== by 0x4009BF: main (t4.c:86) ==17482== Uninitialised value was created by a stack allocation ==17482== at 0x401048: le_f (fraccoes.c:19) ==17482== ==17482== Conditional jump or move depends on uninitialised value(s) ==17482== at 0x400D03: le_pol (polinomios.c:163) ==17482== by 0x400817: instanciacao (t4.c:14) ==17482== by 0x40098C: menu_interactivo (t4.c:68) ==17482== by 0x4009BF: main (t4.c:86) ==17482== Uninitialised value was created by a stack allocation ==17482== at 0x401048: le_f (fraccoes.c:19) ==17482== I will now give you the functions which are called void le_pol (pol *p) { fraccao f; int e; char c; printf ("Introduza um polinomio na forma (n0/d0)x^e0 + (n1/d1)x^e1 + ... + (nk/dk)^ek,\n"); printf("com ei > e(i+1):\n"); *p = NULL; do { le_f (&f); getchar(); getchar(); scanf ("%d", &e); if (f.n != 0) *p = add (*p, f, e); c = getchar (); if (c != '\n') { getchar(); getchar(); } } while (c != '\n'); } void instanciacao (void) { pol p1; fraccao f; le_pol (&p1); printf ("Insira uma fraccao na forma (n/d):\n"); le_f (&f); escreve_f(inst_esc_pol(p1, f)); } void le_f (fraccao *f) { int n, d; getchar (); scanf ("%d", &n); getchar (); scanf ("%d", &d); getchar (); assert (d != 0); *f = simplifica_f(cria_f(n, d)); } simplifica_f simplifies a rational and cria_f creates a rationa given the numerator and the denominator Can someone help me please? Thanks in advance. If you want me to provide some tests, just post it. See ya.

    Read the article

  • Application crashing in the iPad but working fine in iPad simulator.

    - by srikanth rongali
    Hi, I am writing a game in cocos2d. In the iPad Simulator the application is running good. While I am running the application in the iPad. But it was crashing by giving the following message in terminal. I am using 2048x2048 CCSpriteSheets in my code. I used instruments tool there is sudden increase in memory to 32MB before crashing. It is crashing at CCSpriteFrameCache . Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-6258-64 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none continue The program is not being run. The program is not being run. Thank you.

    Read the article

  • css/html: white space break fix and now cant code fine?

    - by Karem
    Yes, so I got the problem that if you type a long sentence with no space e.g eeeeeeeeeeeeeeeeeeeeeeee, it will break itself, but then now I would need to start typing some ugly non-breaking coding. Example: http://jsfiddle.net/r3CFJ/ I need to have everything in one sentence in order not to make it break itself. Check here to see the result of not having everything in one sentence: http://jsfiddle.net/r3CFJ/1/ How can I fix this please any solutions?? as my further coding will get very ugly and not readable?

    Read the article

  • [C] this code, its work fine and return what i want, but its hangs before print it ??

    - by Rami Jarrar
    I make this program :: #include<stdio.h> char *raw_input(char *msg); main() { char *s; *s = *raw_input("Message Here Is: "); printf("Return Done.."); printf(s); } char *raw_input(char *msg){ char *d; printf("%s", msg); scanf("%s",&d); return d; } What this do is, it print my message and scan for input from the user, then print it,, but whats the problem in print the input from the user ??? Update:: I need the raw_input func. call be like this without any extra *s = *raw_input("Message Here"); I dont want to use this :: raw_input("Message Here Is: ", d); .... Just want to return the string that the user will enter .

    Read the article

  • [C] this code, its work fine and return what i want, but its hang before print it ??

    - by Rami Jarrar
    I make this program :: #include<stdio.h> char *raw_input(char *msg); main() { char *s; *s = *raw_input("Message Here Is: "); printf("Return Done.."); printf(s); } char *raw_input(char *msg){ char *d; printf("%s", msg); scanf("%s",&d); return d; } What this do is, it print my message and scan for input from the user, then print it,, but whats the problem in print the input from the user ???

    Read the article

  • My Optin form doesn't work in Internet Explorer, but works fine in Firefox.

    - by Allen
    I have the following code for my optin form: <script language="JavaScript"> function checkSub(){ if (document.signup.email.value.indexOf('@', 0) == -1) { alert("Please fill in your valid Email address.\nYour email should be in the following format: [email protected]"); document.signup.email.focus(); return false} else if (!document.signup.terms.checked) { alert("You must read and agree to the terms"); document.signup.terms.focus(); return false} else { switch(document.signup.extra1.value) { case "Platinum": answer = confirm("By clicking OK you confirm that you have\nalready entered the World Cup Giveaway\nas a Platinum upgrade contributor.\n\nIf you have not yet entered the giveaway\nclick Cancel.\n\nYou can enter using the link at the\nbottom of the page.\n\nIf you have already entered the giveaway\nusing a link other than my invitation link\nyou are not eligible for this offer."); if (!answer) { return false} break; case "Gold": answer = confirm("By clicking OK you confirm that you have\nalready entered the World Cup Giveaway\nas a Gold upgrade contributor.\n\nIf you have not yet entered the giveaway\nclick Cancel.\n\nYou can enter using the link at the\nbottom of the page. \n\nIf you have already entered the giveaway\nusing a link other than my invitation link\nyou are not eligible for this offer."); if (!answer) { return false} break; default: alert("You must sign up as a contributor to the \nWorld Cup Giveaway to take advantage of \nthis offer.\n\nPlease click the link at the bottom of this \npage or at the blog post mentioned below \nto sign up.\n\nIf you have already signed up using \nthis link, please select the upgrade level\nyou chose on signup or select \"Free\" if \nyou signed up as a free contributor.\n\nIf you have already entered the giveaway\nusing a link other than my invitation link\nyou are not eligible for this offer.\n\nNote: This page may not function properly\nif viewed in languages other than English."); return false} } } </script> <form action="http://ebizac.com/ar/optin.php" method="post" name="signup" onsubmit="return checkSub()"> <input type=hidden name="action" value="addlead"> <input type=hidden name="member" value="2315"> <input type=hidden name="auto" value="7584"> <input type=hidden name="thankyou" value="http://plr.forinternetnewbies.com/Offer1"> <input type=hidden name="resubsetting" value="Y"> <input type=hidden name="resubredirect" value=""> <input type=hidden name="invalid_redirect" value=""> <div style="padding:0 0 0 10px;"> <table border=0 cellspacing=0 cellpadding=2><tr><td class="label"><font size="2" face="arial, verdana">Name:</font></td><td><input type=text size=20 name="fname"></td></tr> <tr><td class="label" width="150"><font size="2" face="arial, verdana">Email address:</font></span></td><td><input type=text size=20 name="email"></td></tr> <tr><td class="label"><font size="2" face="arial, verdana">Upgrade Level:</font></td><td><select size=1 name="extra1"><option>Haven't Joined Yet</option><option>Platinum</option><option>Gold</option><option>Silver</option><option>Free</option></td></tr> <tr><td></td><td align=center><input type="checkbox" name="terms" value="agree">I agree to the terms as described on the <a href="http://short9.com/blog0522-sp" target="_blank">blog post</a> </td></tr> <tr><td></td><td align=center><input type="submit" value="Contribute Now"></td></tr></table></div></form> Everything does what I expect in Firefox, but in Internet Explorer the switch statement always goes to the default case. I tested with an extra alert(signup.extra1.value) in the default case and it shows an empty string. What could be the problem here?

    Read the article

  • Defined outlets, connected them, everything looks fine, nothing works.

    - by Tom
    Hi! I'm trying to play with a WebView. I made an outlet: IBOutlet UIWebView *browser; Defined it as a property: @property (nonatomic, retain) IBOutlet UIWebView *browser; Synthethized it: @synthesize browser; Finally, I connected it in Interface Builder, really it is. Then I try to do something with it i.e.: [browser loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com"]]]; Or also: Etape *etape = [[Etape alloc] init]; NSString *html = [etape generateHTMLforEtape:[current_etape objectAtIndex:0]]; [browser loadHTMLString:html baseURL:nil]; [etape release]; I get no errors, I tried to Build & Analyse, no notices or warnings or errors.. I've been searching for one whole day, please help me :/ Thanks a lot! EDIT: Here's screenshots of my connections for my WebView:

    Read the article

  • My iPhone app ran fine in simulator but crashed on device (iPod touch 3.1.2) test, I got the followi

    - by Mickey Shine
    I was running myapp on an iPod touch and I noticed it missed some libraries. Is that the reason? [Session started at 2010-03-19 15:57:04 +0800.] GNU gdb 6.3.50-20050815 (Apple version gdb-1128) (Fri Dec 18 10:08:53 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys007 Loading program into debugger… Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-237-78 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… [Switching to thread 11779] [Switching to thread 11779] sharedlibrary apply-load-rules all (gdb) continue warning: Unable to read symbols for "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found). 2010-03-19 15:57:18.892 myapp[2338:207] MS:Notice: Installing: com.yourcompany.myapp [myapp] (478.52) 2010-03-19 15:57:19.145 myapp[2338:207] MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib warning: Unable to read symbols for "/Library/MobileSubstrate/DynamicLibraries/Backgrounder.dylib" (file not found). warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/usr/lib/libsubstrate.dylib" (file not found). MS:Warning: message not found [myappAppDelegate applicationWillResignActive:] MS:Warning: message not found [myappAppDelegate applicationDidBecomeActive:] 2010-03-19 15:57:19.550 myapp[2338:207] in FirstViewController 2010-03-19 15:57:20.344 myapp[2338:207] in load table view 2010-03-19 15:57:20.478 myapp[2338:207] in loading splash view 2010-03-19 15:57:22.793 myapp[2338:207] in set interface Program received signal: “0”. warning: check_safe_call: could not restore current frame

    Read the article

  • My Linq to Sql Insert code seems to work fine but I don't get a record in the database

    - by Alex
    Here is my code. In the debugger, I can see that the code is running. No errors are thrown. But, when I go back to the table, no row has been inserted. What am I missing?? protected void submitButton_Click(object sender, EventArgs e) { CfdDataClassesDataContext db = new CfdDataClassesDataContext(); string sOfficeSought = officesSoughtDropDownList.SelectedValue; int iOfficeSought; Int32.TryParse(sOfficeSought, out iOfficeSought); Account act = new Account() { FirstName = firstNameTextBox.Text, MiddleName = middleNamelTextBox.Text, LastName = lastNameTextBox.Text, Suffix = suffixTextBox.Text, CampaignName = campaignNameTextBox.Text, Address1 = address1TextBox.Text, Address2 = address2TextBox.Text, TownCity = townCityTextBox.Text, State = stateTextBox.Text, ZipCode = zipTextBox.Text, Phone = phoneTextBox.Text, Fax = faxTextBox.Text, PartyAffiliation = partyAfilliatinoTextBox.Text, EmailAddress = emailTextBox.Text, BankName = bankNameTextBox.Text, BankMailingAddress = bankAddressTextBox.Text, BankTownCity = bankTownCityTextBox.Text, BankState = bankStateTextBox.Text, BankZip = bankZipTextBox.Text, TreasurerFirstName = treasurerFirstNameTextBox.Text, TreasurerMiddleName = treasurerMiddleNamelTextBox.Text, TreasurerLastName = treasurerLastNameTextBox.Text, TreasurerMailingAddress = treasurerMailingAddressTextBox.Text, TreasurerTownCity = treasurerTownCityTextBox.Text, TreasurerState = treasurerStateTextBox.Text, TreasurerZipCode = treasurerZipTextBox.Text, TreasurerPhone = treasurerPhoneTextBox.Text //OfficeSought = iOfficeSought }; act.Suffix = suffixTextBox.Text; db.SubmitChanges(); }

    Read the article

  • Why is my CSS tool tip not functioning properly in Google Chrome, but fine in Firefox??

    - by JAG2007
    http://betawww.helpcurenow.org/media/press/ You'll see I have used spans within an anchor, with the span.hover-description set to display:none; by default, and on a:hover that span is set to display block and absolutely positioned to create a tool-tip effect when hovering over the name and email of the "For Immediate Release" contact names. Everything looks as desired in Firefox, but Chrome reveals my unknown blunder somewhere. Any help on what's the problem that is causing Chrome to not display like Firefox? Incidentally, Explorer shows the tool tip as expected, although I'm getting a funky bottom margin issue below the names, and Safari has the same issue as Chrome (must be a webkit rendering setting that I need to accommodate for).

    Read the article

  • Scripts fail when jQuery.js isn't cached. When cached, scripts run fine.

    - by Bob
    I have jQuery UI Tabs which load their content via AJAX. About once every 15 times when the entire page is loaded (not just XHR), things fail and I don't see the proper content in the tab. Fiddler showed me that when things fail I also see that jQuery.js and jQuery-ui.js are both sent to the browser in full (~100kB). Normally, a page load results in HTTP status code 304 for both of those files, they're not re-downloaded, and the page displays properly. When the status code is 200 and fresh copies of jQuery/UI are sent, things fail. I notice this most often in IE8, but that's because I use it for web development. I have seen it in Firefox, but for some reason I can't reproduce it now. Fiddler shows that the HTTP request asks for: GET /Scripts/jquery-1.3.2.min.js?_=1255309685187 HTTP/1.1 I can't figure out what the ?_=1255309685187 is for, but I'm guessing it's a token to indicate for how long the file should be cached. Since I can't reproduce the problem in Firefox right now, I don't know what Firebug says. Any insight would be appreciated. EDIT: This is with Visual Studio's development webserver.

    Read the article

  • asp.net app slow and not rendering but .txt file works fine?

    - by mike
    i have a load balanced set of 2 servers running a .net application that is loading slow and not at all to the point the load balancer is redirecting me and my users to our dr server. i added a hard coded file to both servers to tell what server is working and not. both pull the txt file and display its contents in no time. however the asp.net pages dont render. the DB is not sweating and even a plain .aspx page doesnt come up. any thoughts on trouble shooting this?

    Read the article

  • Why the HelloWorld of opennlp library works fine on Java but doesn't work with Jruby?

    - by 0x90
    I am getting this error: SyntaxError: hello.rb:13: syntax error, unexpected tIDENTIFIER public HelloWorld( InputStream data ) throws IOException { The HelloWorld.rb is: require "java" import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; import opennlp.tools.postag.POSModel; import opennlp.tools.postag.POSTaggerME; public class HelloWorld { private POSModel model; public HelloWorld( InputStream data ) throws IOException { setModel( new POSModel( data ) ); } public void run( String sentence ) { POSTaggerME tagger = new POSTaggerME( getModel() ); String[] words = sentence.split( "\\s+" ); String[] tags = tagger.tag( words ); double[] probs = tagger.probs(); for( int i = 0; i < tags.length; i++ ) { System.out.println( words[i] + " => " + tags[i] + " @ " + probs[i] ); } } private void setModel( POSModel model ) { this.model = model; } private POSModel getModel() { return this.model; } public static void main( String args[] ) throws IOException { if( args.length < 2 ) { System.out.println( "HelloWord <file> \"sentence to tag\"" ); return; } InputStream is = new FileInputStream( args[0] ); HelloWorld hw = new HelloWorld( is ); is.close(); hw.run( args[1] ); } } when running ruby HelloWorld.rb "I am trying to make it work" when I run the HelloWorld.java "I am trying to make it work" it works perfectly, of course the .java doesn't contain the require java statement. EDIT: I followed the following steps. The output for jruby -v : jruby 1.6.7.2 (ruby-1.8.7-p357) (2012-05-01 26e08ba) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_35) [darwin-x86_64-java]

    Read the article

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