Daily Archives

Articles indexed Friday October 19 2012

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

  • java MainServer gives java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0

    - by Paradox
    Compiling is easy but when using java to run the programs, it gives Exception found. I am using Ubuntu 12.04 without internet connections. Also, installed Oracle JDK7 and JRE7. Also did the update-alternatives command on java, javac and javaws. Changed the machine java in /etc/profiles. PATH is pointing to oracle java folder. I did many searches on Google about this topic but each time jdk and jre version are different. Also check version of jdk and jre using java -version and javac - version. Both of them are the same. The system also contains OpenJdk6 and OpenJdk7. So, how do I remove these errors?

    Read the article

  • Dash is slow and shows irrelevant results

    - by Alexey Frishman
    I currently have the latest Ubuntu 12.10 installed on my laptop. Usually I use Launchy application to have a quick access to any app/config/file etc. Now I'm trying to get used to Dash, which is supposed to be default way to do such things in recent Ubuntu versions. The difference between the usage of Launchy and Dash is following: Launchy: Alt+Space - Launchy shell shown instantly - type your request - open the target Dash: SuperKey - PERIOD - Dash is shown - type your request - PERIOD - navigate with arrow buttons between the results - open the desired result Another problem. When I type the term "ryth" (which is incorrectly spelled part of "Rhythmbox") what is shown in these 2 shells: Launchy: 1 result, which is Rhythmbox. The letters 'r', 'y', 't' and 'h' are highlighted. Dash: 2 results, which are MP3s from Amazon and are completely irrelevant to my request So is there any way to tweak the Dash to allow me to use it as I use Launchy with the same performance and results?

    Read the article

  • What makes Ubuntu awesome [closed]

    - by Shagun
    My question may sound stupid or inappropriate for this site in which case I apologize before hand. This thing has bothered me for quiet some time so please correct me if there is anything inappropriate: I have been using Ubuntu for past 1 year and I know how awesome it is and in what terms is it better than windows.But around 2 weeks ago some of my friends asked me to show them something on Ubuntu or tell something about Ubuntu that makes people prefer it over windows. I tried to convince them by telling things like its open-source, that most of the super-computers run on Linux, that its unaffected by virus and other stuff but they seemed unconvinced. Maybe what they we looking for was some mind-boggling feature which only Ubuntu (Linux) has. Since that day I have been thinking but yet don't have anything that will show them the true powers of Linux. Please suggest your response to such a situation as it troubles me that I am not able to explain them one thing that I myself believe in. Thank you. PS : I am not looking for a theoretical answer but would like to hear of one such application which it and only it provides.

    Read the article

  • Upgrade to Quantal unity top bar, side bar, and window declorations missing

    - by Nicky Bailuc
    I upgraded from 12.04.1 to 12.10 via the Update Manager and the upgrade said it completed successfuly. However after rebooting the unity task bar was missing along with the launch bar and the window declorations. All compiz settings seemed to be purge deleted, and at first bootup it gave me a system error. The desktop exists, and once I remember I messed up the compiz settings and just had to press Ctrl+Alt+F1 and in the virtual terminal type "unity --reset" then "sudo reboot". Everything worked as if i reinstalled the entire operating system. This time it said “Warning no variable set. setting to :0. The reset option is now dupricated”. What am I suppose to do now? I need this fixed as soon as possible because I need a couple of certainly installed programs and the data within them (long story short).

    Read the article

  • Mass audio encoder

    - by bessman
    I have a few thousand FLAC files which I would like to transcode to OGG Vorbis, but I can't find any suitable tools for the job. To name a few I have tried so far and why they are unsuitable: oggenc is single-threaded and would require me to automate it myself, mencoder requires the input to also contain video, and abcde assumes the input is a CD. The ideal tool should be multi-threaded, and support inputing multiple files located in different directories simultaneously. CLI or GUI makes no matter. Does such a tool exist?

    Read the article

  • Mobile Broadband Connection terminating automatically after 2-3 minutes

    - by HussainNagri
    I am connecting my mobile device with Ubuntu to access INTERNET, It connects easily but after 2-3 minutes it automatically disconnect and then I have to disconnect my mobile device and then reconnect it again to establish a connection. Cant understand what is the problem. No problem with my device as it works flawless with windows. As asked here is more info: Device is Samsung wave 575 Network Provider is Vodafone and Ubuntu is 12.04

    Read the article

  • SEO - 2 websites in the same domain

    - by user6448
    I have my domain (http://www.foobar.com, for example) and my website talks about technology. I want to have another website (with other content, not about technology) inside of it (http://www.foobar.com/loremipsum). I can find http://www.foobar.com in Google Search, but http://www.foobar.com/loremipsum no ... What should I do to index this website? Thank you. update My main site (http://www.foobar.com/, a WordPress installation) has an .httaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Does it affect the index of http://www.foobar.com/loremipsum ? Thank you.

    Read the article

  • Getting Oracle Exception: ORA-1017: invalid username/password; logon denied

    - by Paks
    I have tried so many thing but i can't resolve that Error. I can connect with my username and password to: Database in SQLDeveloper, in SQL-Plus, in Server-Explorer (Visual Studio 2008) and all works fine. But if i Compile my Project i get that Error. Why is that? I tried to set case_sensitive to false, but the same error appears. I dont know what else to do. My Oracle version: Oracle Database 11g Express Edtiton Release 11.2.0.2.0 - Production PL/SQL Release 11.2.0.2.0 - Production CORE 11.2.0.2.0 Production TNS for 32-bit Windows: Version 11.2.0.2.0 - Production NLSRTL Version 11.2.0.2.0 - Production

    Read the article

  • AndEngine: Black screen when using LayoutGameActivity

    - by Lemuel Hogben
    I used to use SimpleBaseGameActivity for my app and everything was ok, but now I want to add some ads into the app, so I tried to use LayoutGameActivity. But I get the screen completely black and I don't know why. That's my code: public class AcGame extends LayoutGameActivity { [...] @Override protected int getLayoutID() { return R.layout.ad; } @Override protected int getRenderSurfaceViewID() { return R.id.layout_render; } @Override public EngineOptions onCreateEngineOptions() { [...] return new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, resolution, camera); } @Override public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback) throws Exception { createResources(); pOnCreateResourcesCallback.onCreateResourcesFinished(); } @Override public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback) throws Exception { pOnCreateSceneCallback.onCreateSceneFinished(createScene()); } @Override public void onPopulateScene(Scene pScene, OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception { pOnPopulateSceneCallback.onPopulateSceneFinished(); } And that's my layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="top" android:id="@+id/layout_ad" > <Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Ad Sample"/> </LinearLayout> <org.andengine.opengl.view.RenderSurfaceView android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:id="@+id/layout_render" /> </LinearLayout> When I'm trying to debug, I can see that EngineOptions are creating, but no one of the LayoutGameActivity's methods was called (onCreateResources, onCreateScene or onPopulateScene). Can someone tell me what I've missed?

    Read the article

  • iOS: Interpreted code - where do they draw the line?

    - by d7samurai
    Apple's iOS developer guidelines state: 3.3.2 — An Application may not itself install or launch other executable code by any means, including without limitation through the use of a plug-in architecture, calling other frameworks, other APIs or otherwise. No interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple’s Documented APIs and built-in interpreter(s). Assuming that downloading data - like XML and images (or a game level description), for example - at run-time is allowed (as is my impression), I am wondering where they draw the line between "data" and "code". Picture the scenario of an app that delivers interactive "presentations" to users (like a survey, for instance). Presentations are added continuously to the server and different presentations are made available to different users, so they cannot be part of the initial app download (this is the whole point). They are described in XML format, but being interactive, they might contain conditional branching of this sort (shown in pseudo form to exemplify): <options id="Gender"> <option value="1">Male</option> <option value="2">Female</option> </options> <branches id="Gender"> <branch value="1"> <image src="Man" /> </branch> <branch value="2"> <image src="Woman" /> </branch> </branches> When the presentation is "played" within the app, the above would be presented in two steps. First a selection screen where the user can click on either of the two choices presented ("Male" or "Female"). Next, an image will be [downloaded dynamically] and displayed based on the choice made in the previous step. Now, it's easy to imagine additional tags describing further logic still. For example, a containing tag could be added: <loop count="3"> <options... /> <branches... /> </loop> The result here being that the selection screen / image screen pair would be sequentially presented three times over, of course. Or imagine some description of a level in a game. It's easy to view that as passive "data", but if it includes, say, several doorways that the user can go through and with various triggers, traps and points attached to them etc - isn't that the same as using a script - or, indeed, interpreted code - to describe options and their conditional responses? Assuming that the interpretation engine for this XML data is already present in the app and that such presentations can only be consumed (not created or edited) in the app, how would this fare against Apple's iOS guidelines? Doesn't XML basically constitute a scripting language (couldn't any interpreted programming language simply be described by XML) in this sense? Would it be OK if the proprietary scripting language (ref the XML used above) was strictly sandboxed (how can they tell?) and not given access to the operating system in any way (but able to download content dynamically - and upload results to the authoring server)? Where does the line go?

    Read the article

  • What does plus sign does here in string?

    - by Thanga
    I would like to know, what is the difference between two statements, these may be simple String ss="myname"; char[] charArray = ss.toCharArray(); for ( char character : charArray ) { System.out.println( +character );//Statements are here what does plus refers here: System.out.println( character ); //Statements are here: } I got the output for the code no errors but little doubt on how it works? What happens here? If you would down vote let me know the reason please , Thanks in advance

    Read the article

  • how to video play automatically?

    - by Karthikeyan Karthik
    When load in my app automatically play videos. when the video should stop, automatically to play another video.enter code here private void videoplayer(String filename, int position) { // TODO Auto-generated method stub getWindow().setFormat(PixelFormat.TRANSPARENT); VideoView video = (VideoView)findViewById(R.id.vid_view1); System.gc(); video.setVideoPath(filename); video.requestFocus(); if(position>=0){ video.start(); } }

    Read the article

  • php error not displayed

    - by devil eye
    I am new to php ; when ever ther is some error in my script ,the browser do not display error wirh line nymber but displays : Server error The website encountered an error while retrieving "http://localhost/gmailAPP/google-api-php-client/examples/calendar/simple.php". It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. It is very difficult to debug the code with out error message and line number .Please help

    Read the article

  • How to configure IIS7 to Redirect member of An active Directory group to static page

    - by user1759075
    On IIS, we have disabled Anonymous authentication and enabled Windows Authentication What we need is to only allow users who are members of an Active Directory security group to access the Access Point at all. All other users should be directed to a static web page that will give them instructions on how to request access. By adding the security group to the website permissions, and removing the \Users group, we have almost achieved this. Users in the group are allowed through, those not in the group are asked for a (Windows) username and password. Instead of requesting the username and password, we want IIS to redirect them to the static page. Please advise me on how can this be done.

    Read the article

  • Query for multiple joins

    - by Shailaja
    i have 3 tables named dataset,dataelem and transformdataelem with column names as below: main.Dataset ------------ datasetID (PK) applicationID main.Dataelem ------------- dataelemID(PK) datasetID(FK) dataelemname biztermID main.Transformdataelem ---------------------- OutputdataelemID InputdataelemID My requirement is: All tables are referenced. Extract all the dataelemId rows from dataelem table where applicationID of dataset table is equal to 1044 and biztermid shud be null. Then whatever resultant dataelemIDs from the above query should be matched with outputdataelemID of Transformdataelem table and we shud get the respective input dataelemId's. Again with these matched inputdataelemID's we shud get the dataelemname's from datelem table.

    Read the article

  • Date range advanced count calculation in TSQL

    - by cihata87
    I am working on call center project and I have to calculate the call arrivals at the same time between specific time ranges. I have to write a procedure which has parameters StartTime, EndTime and Interval For Example: Start Time: 11:00 End Time: 12:00 Interval: 20 minutes so program should divide the 1-hour time range into 3 parts and each part should count the arrivals which started and finished in this range OR arrivals which started and haven't finished yet Should be like this: 11:00 - 11:20 15 calls at the same time(TimePeaks) 11:20 - 11:40 21 calls ... 11:40 - 12:00 8 calls ... Any suggestions how to calculate them?

    Read the article

  • URL Rewrite query database?

    - by Liam
    Im trying to understand how URL rewriting works. I have the following link... mysite.com/profile.php?id=23 I want to rewrite the above url with the Users first and last name... mysite.com/directory/liam-gallagher From what Ive read however you specify the rule for what the url should be output as, But how do i query my table to get each users name? Sorry if this is hard to understand, ive confused myself!

    Read the article

  • Why does p:panelGrid not work with ui:repeat?

    - by CycDemo
    If I use as below, I get no error, no output. Why does p:panelGrid not work with ui:repeat? Note : I don't want to use c:forEach because of the I already face a lot of JSF issue. <p:panelGrid> <ui:repeat value="#{MyBean.dataList}" var="data"> <p:row> <p:column> <h:outputText value="#{data.name}"/> </p:column> <p:column> <h:outputText value="#{data.description}"/> </p:column> </p:row> </ui:repeat> </p:panelGrid> MyBean.java public List<Data> getDataList(){ List<Data> result = new ArrayList<Data>(); result.add(new Data("Name 1", "Description 1")); result.add(new Data("Name 2", "Description 2")); result.add(new Data("Name 3", "Description 3")); result.add(new Data("Name 4", "Description 4")); return result; } Expected output with primefaces

    Read the article

  • jQuery doesn't work after an Ajax post

    - by user1758979
    I'm using jQuery to sort a list of entries, between <LI></LI> tags, and then an Ajax post to validate the order and 'update' the page with the content returned. $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { $('html').html(data); OnloadFunction (); } }); Then, I lose the ability to sort the list (I'm not sure if clear...). I tried to move the content of the $(document).ready inside the OnloadFunction (), and call it with <script>OnloadFunction ();</script> inside the block dealing with the modifications to do : $action= $_GET['action']; if ($action == "modify") { // Code here } but it doesn't work... I can't figure out how to do that. Could anyone help ? I stripped out the main part of the code to keep only the essential (filename: test.php) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript" src="jquery-ui-1.9.0.custom.min.js"></script> <script> $(document).ready(function(){ //alert("I am ready"); OnloadFunction (); }); function OnloadFunction () { $(function() { $("#SortColumn ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {} }); }); //alert('OnloadFunction ends'); } function valider(){ var SortedId = new Array(); SortIdNb = 0; $('#SortColumn ul li').each(function() { SortedId.push(this.id); }); var data = { /* Real code contains an array with the <li> id */ CheckedId: "CheckedId", SortedId: SortedId, }; data = JSON.stringify(data); $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { //alert(data); $('html').html(data); OnloadFunction (); } }); } </script> </head> <body> <? $action= $_GET['action']; $id = $_GET['id']; if ($id == 0) {$id=1;} $id += 1; if ($action == "modify") { echo "action: modify<br>"; echo "id (àvèc aççént$): ".$id."<br>"; // "(àvèc aççént$)" to check characters because character set is incorrect after the ajax post $data = json_decode($_POST['myJson'], true); // PHP code here to treat the new list send via the post and update the database print_r($data); } ?> <!-- PHP code here to get the following list from the database --> <div id="SortColumn"> <ul> <li id="recordsArray_1">recordsArray_1</li> <li id="recordsArray_2">recordsArray_2</li> <li id="recordsArray_3">recordsArray_3</li> <li id="recordsArray_4">recordsArray_4</li> <li id="recordsArray_5">recordsArray_5</li> </ul> </div> <input type="button" value="Modifier" onclick="valider();"> </body> </html>

    Read the article

  • .find replacing content inside html tags

    - by Woz
    I want to sanitize html tags from my wysiwyg. I want to replace certain tags with another. This almost works only the replaceWith() is also removing the content from within the tags. I dont want to do this. I just want to replace the tags. Here is what I have so far. Text for Testing: This<div>is</div><div>a test</div><div>to clean&nbsp;</div><div>some tags</div><div><br></div> Expected Result: This<p>is</p><p>a test</p><p>to clean</p><p>some tags</p><p><br></p> Actual Result: This<p></p><p></p><p></p><p></p><p></p> This is the code I am using to find and replace var thebad = ["h1","h2","h3","h4","h5","h6","div"]; var thegood = ["","","","","","","<p>"]; for(var i = 0; i < thebad.length; i++){ $('.content').contents().find('body').find(thebad[i]).replaceWith(thegood[i]); } I need to figure out how to keep the text inside the html tags when i replace them. Thanks in advance

    Read the article

  • How to get child nodes after store load

    - by Azincourt
    Version: ExtJs 4.1 To change the child items I use this function: TreeStore (Ext.data.TreeStore) storeId : 'treeStore', ... constructor: function( oConfig ) { ... this.on( 'expand', function( oObj ) { oObj.eachChild(function(oNode) { switch(oNode.data.type) { case "report": oNode.set('icon', strIconReport); break; case "view": oNode.set('icon', strIconView); break; } }); }); Reload After removing or adding items in the tree, I reload the tree somewhere else with: var oStore = Ext.getStore('treeStore'); oStore.load({ node : oNode, params : { newpath : oNode.data.path, overwrite : true } }); Although it is the same store treeStore, after loading and expanding to the correct path, the icons are not changed since the .on( 'expand') function is not called. Why? Question How can I change the icons of this newly loaded store before it expands to the node path? What I tried Before calling .load() I tried to edit the children with oNode.eachChild(function(oChild) {} but no success.

    Read the article

  • Ruby on Rails: jQuery datepicker - dates between validation

    - by Jazz
    I have an app that allows a user to create new projects, and the search for them later. One of the options they have when creating a project is giving them start and end dates. At the moment all the code works properly for creating and searching on the dates, but I am now wanting to restrict what dates the user can enter. I am needing for an error to flag up when the user tries to enter an end date that is before the start date. It's really more for when the user is creating the project. Here is my code so far = Application.js //= require jquery //= require jquery_ujs //= require jquery-ui //= require jquery.ui.all //= require_tree . $(function() { $("#project_start_date").datepicker({dateFormat: 'dd-mm-yy'}); }); $(function() { $("#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A').datepicker({dateFormat: "dd-mm-yy"}); }); jQuery(function(){ jQuery('#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); New View: <div class="start_date" STYLE="text-align: left;"> <b>Start Date:</b> <%= f.text_field :start_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> <div class="end_date" STYLE="text-align: left;"> <b>End Date:</b> <%= f.text_field :end_date, :class => 'datepicker', :style => 'width: 80px;' %> </div> Search View: Start dates between <%= text_field_tag :start_date_A, params[:start_date_A], :style => 'width: 80px;' %> - <%= text_field_tag :start_date_B, params[:start_date_B], :style => 'width: 80px;' %></br> I tried following examples online to get this to work by doing this in the application.js file: $(function() { $("#project_start_date,#project_end_date").datepicker({dateFormat: 'dd-mm-yy'}); }); jQuery(function(){ jQuery('#start_date_A,#start_date_B').datepicker({dateFormat: "dd-mm-yy"}); }); But then the script doesn't run. I am new to rails and javascript so any help at all is appreciated. Thanks in advance. UPDATE: Don't know why my question has been voted to be closed. It's quite simple: I need an error to flag up when the user tries to enter an end date that is before the start date. How can I do that??

    Read the article

  • Joomla! 2.5 use login data from another database

    - by user1756746
    I have a hard question. I'd like the joomla login does not use its own database for users/password but I want to use my database users with my table fields, my passwords etc.. I don't know from where start, I thought I could edit database request for login to my db or create a little script to automatically add the users on joomla database. I tried to see components/com_users/views/login/tmpl/default_login.php but it seems that there is nothing. Can someone help me figure out what to change? Maybe the simple thing is import my database users into database user joomla, is there any plugin or something else that you know? p.s. I use Clarion theme build on Gantry framework, Joomla! 2.5.6 Stable, PHP 5.2.17

    Read the article

  • Python bindings for C++ code using OpenCV giving segmentation fault

    - by lightalchemist
    I'm trying to write a python wrapper for some C++ code that make use of OpenCV but I'm having difficulties returning the result, which is a OpenCV C++ Mat object, to the python interpreter. I've looked at OpenCV's source and found the file cv2.cpp which has conversions functions to perform conversions to and fro between PyObject* and OpenCV's Mat. I made use of those conversions functions but got a segmentation fault when I tried to use them. I basically need some suggestions/sample code/online references on how to interface python and C++ code that make use of OpenCV, specifically with the ability to return OpenCV's C++ Mat to the python interpreter or perhaps suggestions on how/where to start investigating the cause of the segmentation fault. Currently I'm using Boost Python to wrap the code. Thanks in advance to any replies. The relevant code: // This is the function that is giving the segmentation fault. PyObject* ABC::doSomething(PyObject* image) { Mat m; pyopencv_to(image, m); // This line gives segmentation fault. // Some code to create cppObj from CPP library that uses OpenCV cv::Mat processedImage = cppObj->align(m); return pyopencv_from(processedImage); } The conversion functions taken from OpenCV's source follows. The conversion code gives segmentation fault at the commented line with "if (!PyArray_Check(o)) ...". static int pyopencv_to(const PyObject* o, Mat& m, const char* name = "<unknown>", bool allowND=true) { if(!o || o == Py_None) { if( !m.data ) m.allocator = &g_numpyAllocator; return true; } if( !PyArray_Check(o) ) // Segmentation fault inside PyArray_Check(o) { failmsg("%s is not a numpy array", name); return false; } int typenum = PyArray_TYPE(o); int type = typenum == NPY_UBYTE ? CV_8U : typenum == NPY_BYTE ? CV_8S : typenum == NPY_USHORT ? CV_16U : typenum == NPY_SHORT ? CV_16S : typenum == NPY_INT || typenum == NPY_LONG ? CV_32S : typenum == NPY_FLOAT ? CV_32F : typenum == NPY_DOUBLE ? CV_64F : -1; if( type < 0 ) { failmsg("%s data type = %d is not supported", name, typenum); return false; } int ndims = PyArray_NDIM(o); if(ndims >= CV_MAX_DIM) { failmsg("%s dimensionality (=%d) is too high", name, ndims); return false; } int size[CV_MAX_DIM+1]; size_t step[CV_MAX_DIM+1], elemsize = CV_ELEM_SIZE1(type); const npy_intp* _sizes = PyArray_DIMS(o); const npy_intp* _strides = PyArray_STRIDES(o); bool transposed = false; for(int i = 0; i < ndims; i++) { size[i] = (int)_sizes[i]; step[i] = (size_t)_strides[i]; } if( ndims == 0 || step[ndims-1] > elemsize ) { size[ndims] = 1; step[ndims] = elemsize; ndims++; } if( ndims >= 2 && step[0] < step[1] ) { std::swap(size[0], size[1]); std::swap(step[0], step[1]); transposed = true; } if( ndims == 3 && size[2] <= CV_CN_MAX && step[1] == elemsize*size[2] ) { ndims--; type |= CV_MAKETYPE(0, size[2]); } if( ndims > 2 && !allowND ) { failmsg("%s has more than 2 dimensions", name); return false; } m = Mat(ndims, size, type, PyArray_DATA(o), step); if( m.data ) { m.refcount = refcountFromPyObject(o); m.addref(); // protect the original numpy array from deallocation // (since Mat destructor will decrement the reference counter) }; m.allocator = &g_numpyAllocator; if( transposed ) { Mat tmp; tmp.allocator = &g_numpyAllocator; transpose(m, tmp); m = tmp; } return true; } static PyObject* pyopencv_from(const Mat& m) { if( !m.data ) Py_RETURN_NONE; Mat temp, *p = (Mat*)&m; if(!p->refcount || p->allocator != &g_numpyAllocator) { temp.allocator = &g_numpyAllocator; m.copyTo(temp); p = &temp; } p->addref(); return pyObjectFromRefcount(p->refcount); } My python test program: import pysomemodule # My python wrapped library. import cv2 def main(): myobj = pysomemodule.ABC("faces.train") # Create python object. This works. image = cv2.imread('61.jpg') processedImage = myobj.doSomething(image) cv2.imshow("test", processedImage) cv2.waitKey() if __name__ == "__main__": main()

    Read the article

  • How do I select from a stored procedure in Sybase?

    - by Nick Fortescue
    My DBA has constructed me a stored procedure in a Sybase database, for which I don't have the definition. If I run it, it returns a resultset with a set of columns and values. I would like to SELECT further to reduce the rows in the result set. Is this possible? From this question it seems like I could insert the results into a temporary table, but I'm not sure I've got permissions to do this. Is there any way I can SELECT certain rows, or if not, can someone give me example code for simulating with a temporary table?

    Read the article

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