Posts

Showing posts from January, 2012

alter table add column not always propogating in cassandra -

I am using Apache Cassandra (2.0.0.0) on a 4 node cluster, replication factor = 3 and datastax java . Driver for Cassandra (v. 2.0.2) I am using CQL queries to add columns to the existing tables from inside my Java code. When the selection query in my creation index query and my new column failed, the reason was that the column was not found. There was no error in the Cassandra log. Note that when I ran the cassandra on a single node, this problem did not appear then, but the 4-node is constantly on the cluster. At present, I am working on it again by trying again for 5 times and I feel that the column is added in the third or fourth attempt. Apart from this, I noticed that the number of existing columns in the table is high and there are few such failures. I found a bug already reported: I disabled all firewalls After doing this it worked fine, so it could be due to cassandra using special ports for communication between nodes end; That is being blocked due to the firew...

Javascript 2d array indexOf -

मेरे पास इस तरह एक 2d सरणी है: var arr = [[2,3 ], [5.8], [1,1], [0,9], [5.7]]; प्रत्येक सूचकांक कुछ तत्वों के निर्देशांक युक्त एक आंतरिक सरणी को संग्रहित करता है। मैं जांचने के लिए कैसे उपयोग कर सकता हूं कि नए निर्देशित सेट के सेट पहले से ही आगमन ? मैं arr में धकेलना चाहता हूं यदि केवल समन्वय एक डुप्लिकेट नहीं है। यह मेरा प्रयास है जो काम नहीं करता: यदि (Arr.indexOf ([x, y]) == -1) {arr.push ([x, y]); } ऐसा लगता है कि indexOf () 2d arrays के लिए काम नहीं करता है ... आप जटिल ऑरेंज करने के लिए indexOf का उपयोग नहीं कर सकते हैं (जब तक कि आप इसे हर चीज स्ट्रिंग में समन्वयित करने के क्रमबद्ध नहीं करते), तो आपको खोज के लिए लूप (या फिर) का उपयोग करना होगा यह मानते हुए कि उस सरणी में समन्वय करें, आप सरणी के प्रारूप को जानते हैं (इस मामले में यह 2 डी है)। var arr = [[2,3], [5,8], [1 , 1], [0,9], [5.7]]; Var कॉर 1 = [0, 9]; Var कॉओर 2 = [1, 2]; (If i 0] & amp; amp; सरणी [i] [1] == आइटम [1]) {वापस सच; // इसे मिला}} वापसी झूठी; // नहीं मिला} // test coor1 conso...

java - How to create an index with JPA/hibernate and use fields from mappedsupperclass together with fields from concrete entity -

मेरे पास @MappedSupperClass है (सरलीकृत उदाहरण): @मैपस्परक्लास सार्वजनिक अमूर्त वर्ग MySuperClass {@Id @GeneratedValue निजी लंबे आईडी; @ कॉलम (नाले = झूठे) निजी दिनांक निर्माण तिथि; // ...} और एक ठोस इकाई (सरलीकृत उदाहरण): @ एंटीटी सार्वजनिक वर्ग MyEntity MySuperClass फैली {@ इंडेक्स (नाम = "IDX_MYINDEX") @ कॉलम (नाले = झूठे) @ नामित (एन्म्युटि.पैरिंग) निजी मायटाइप प्रकार; @ इंडेक्स (नाम = "IDX_MYINDEX") @ कॉलम (नाले = झूठे) @ नामांकित (EnumType.STRING) निजी MyResult स्थिति; // ...} अब मुझे स्तंभ MySuperClass.creationDate , MyEntity.status और सहित एक अनुक्रमणिका की आवश्यकता है MyEntity.type । अगर मैं @ इंडेक्स (नाम = "आईडीएक्सएमएआईएंडएक्सएक्स") को MySuperClass.creationDate जोड़तो तो हाइबरनेट creationDate MySuperClass से विरासत में मिली हर इकाई के लिए। मैंने कोशिश की @AttributeOverride लेकिन यह अनुक्रमणिका के लिए सक्षम नहीं है। कोई भी विचार? टीआईए! यदि आप JPA 2.1 का उपयोग कर रहे हैं तो आप वर्ग एनोटेशन का उपयोग ...

Is there a way to surpress Azure WebJob Invocation Logs when using WebJob SDK? -

Does anyone know that controlling how WebAbownload logs are written when using the Azure Webzob SDK possible? I am processing a queue that holds sensitive information that I do not want to store or display in the log. Is this possible? Any help would be greatly appreciated, Cheers, Phil. There is no way to exclude some data from being logged in the following ConnectionString? ? AzureJobsDashboard ??? Can not set logging off by setting. I will open an issue to see if we can enable this scenario in the future.

r - Add vertical line to line chart in rChart NVD3 (nPlot) -

I would like to add several vertical lines that show special events in the line chart created with the enplot any suggestions? Library (Resep 2) Library (GG Plot 2) Library (RCHHT) ECM & LT; - Repeat 2 :: Melt (Economics [, C ('Date', 'UMPP', 'Pisa', 'ID =' Date '', ID = 'Date') P 7 & lt; Last goal: Add 'date' = '1967-11-30' - nPlot (value = date, group = 'variable', data = ECM, type = 'linewatfocus chart' , Vertical lines with labels on '2001-11-30', '1968-01-31', etc. OK, so this question should be answered. I think you will see that this is generally beyond the skilled level of the average R user. After all, it would be good to write a custom chart to handle this behavior well and the normal R will be easy for the user and I would like to generalize to handle the dashed and vertical lines in R. Here's more. Library (Resep 2) Library (GG Plot 2) Library (RCART...

android - Broadcast URI to an activity -

मैं एक broadcast reciver से एक गतिविधि के लिए एक यूआरआर भेजने का प्रयास कर रहा हूं > लेकिन आशय कभी नई गतिविधि में नहीं आता है। रीसिव पर सार्वजनिक शून्य (संदर्भ संदर्भ, आशय का इरादा) {स्ट्रिंग i = intent.getDataString (); यूरी = उरी.पार्स (आई); आशय ओ = नया आशय (संदर्भ, Image.class); O.putext ("छवि", यूरी); context.sendBroadcast (ओ); आप sendBroadcast () पर का उपयोग नहीं कर सकते हैं एक गतिविधि से सीधे संवाद करने के लिए संदर्भ

input - Dojo and finding an element with no name and dynamic ID -

After the It is possible for Hey All Dojo (version 8) to get an Input tag ID or class without knowing why I can change the style of the input box? All input boxes (which I have 8) are all named for the same class. Please note that I am unable to edit the code given below on the web page. "OnBlur, onFlocus: onFocus, onkeyup: onkeyup onBlur" Input dojoattachpoint = "text box, focusNode, _aroundNode" dojoattachevent =, I only have an "onShow" property & lt You can use id = "2c6af1dc-80cb-44f2-864d-1fb00216895dF_SingleLine-Widget" name = "" class = "dijitReset dijitTextBox notDojoDndHandle" type = "text" tabindex = "0" aria-label = "text" width = " Auto "value =" "area-described" = 2c6af1dc-80cb-44f2-864d-1fb00216895dF_SingleLine- widget-placeholder "style =" max-width: 2.5mm; width: 90%; " & Gt; & Lt; span class = "dijitPlaceHolder...

Is there a way to have a php script execute with a specific ip address -

What is a method that is a php script that uses file_get_contents to use the IP address, which is the server's Is different from IP address? We have 5 IP addresses and want to make a specific use for this purpose. Yes, this is possible. You need to configure the stream reference that you want to use. & lt ;? Php // reference options $ ctxopts = array ('socket' = & gt; array ('bindto' => '192.168.0.100:02',),); // References ... $ reference = stream_contense_cent ($ ctxopts); // ... and use it to fetch data echo file_get_contents ('http://www.example.com', false, $ reference); You can find more information at You can

ruby on rails 3 - How to use dynamic scoping with devise and omniauth -

I am upgrading an old app from Rail 3.0 to Rail 4.1 and to establish routes and plans for omniauth There is a problem in Currently the paths look like this: area "(: locale)", locale: /#{I18n.available_locales.join("|")}/ do devise_for: User, Controller: {Omniauth_callbacks: "users / omniauth_callbacks"} When I run it, I get the following error: Universal callback under the dynamic section Does not support (RuntimeError) and you have set "/ (: locale) / user" you can bypass' omniauth_callbacks` and manually define routes May include. Here's an example: "User / Author / Provider" Match: Ban: {Provider: / google | Facebook /}, for: "devise / omniauth_callbacks # passthru", as :: Omniauth_authorize, via: [: get, post: match "/ users / athlet :: action / callback", obstructions: {action: / google | Facebook /}, for: "devise / omniauth_callbacks", like :: omniauth_callback, via: [, get, post...

javascript - How to utilize Yeoman, AngularJS data, and Node.js to upload data into the Heroku starter database? -

My application is using Yemen, Angulesas I am quite new to this and therefore this question relates to the management of data is. Currently I have my data on my main I want to be coded into an array in the JS file such as angular.module ('myApp') .controller ('AdminCtrl', ['$ scope', '$ filter', function ($ Scope, $ filter) {// I am already deploying the site through my site and so I wanted to upload this data to Starter Dev Heroko Postgraze Database. My first uploading data in Heroko database is thinking and how I would go about this process. I want to use Node.js (new for me too) and I found this article () but I have to do this? Where and how can I move my existing array data to Node.js and then upload it again? EDIT: I have followed more articles (basically it seems) that @MMTCroiseto suggested and "hoax build" but whenever I refresh the page I am still losing the data. This is my first time using Node.js but I believe that in ...

javascript - Updating input values from selected option in dropdown in ng-repeat Angularjs -

Hi, I have down-down in my ng-repeat & lt; Div ng-repeat = "one in item" & gt; & Lt; Select ng-model = a.id ng-option = "allitems for c for c.id as c" ng-init = "a.age = c.age" & gt; & Lt; / Select & gt; & Lt; Input ng-model = "a.age" /> & Lt; / Div & gt; When ng-repeat runs, it runs all vavlues with the dropdown option properly. The problem is that if I change the drop down value in any row, then it does not update the AAG, which is one of the areas of all types in the drop down. Please tell me that when a different option is selected in the dropdown, how can corrosponding c.age update a.age value There are two things that you need to understand. First, bind the model instead of items & lt; Select ng-model = "item" ... & gt; Second, use this track to force the item to be used by the expression and Code snippet & lt; Div ng-repeat = "item in item...

android - BroadcastReceiver not working when I kill my application -

Whenever I manually killed my application manually by pressing the back button of my cellphone, then My broadcast receiver closes the work. The receiver is in charge of displaying the notification every time the user has been given a phone call and it is registered in manifest.xml. Is this a normal / expected behavior? I thought the receiver should continue to work, even if the user decides to kill his application ... is there a way to stop it? Thank you. Edit This is a manifest entry for the receiver: & Lt; Action Android: name = "android.intent.action.PHONE_STATE" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; There are 7 billion people on the planet, only you know that "kill" What to say. The symptoms you are describing, however, are consistent with "force stop". A user normally stops the application by going to settings, finding your app in the list of installed apps and tapping on the "Force...

configuration - Can you undefine a variable in Salt Pillar? -

एक स्तंभ top.sls इस तरह से फ़ाइल को देखते हुए: आधार: '*': - बेस - स्थानीय और base.sls इस तरह से फ़ाइल: mysetting: 'एफू' क्या कोई भी चीज है जिसे आप local.sls में डाल सकते हैं जिसके कारण mysetting को फिर से अनिर्धारित किया जा सकता है? संक्षिप्त उत्तर संभवतया अधिक जानकारी के लिए देखें। mysetting: 'boo' निश्चित रूप से मैंने इसे स्वयं नहीं करने की कोशिश की है, लेकिन मुझे विश्वास है कि निम्नलिखित से mysseting सेट हो जाएगा अपरिभाषित करने के लिए। mysetting: कोई नहीं

c++ - Is there PTHREAD_MUTEX_ROBUST equivalent in Mac OS X? -

मैं एक साझा मेमोरी पर pthread_mutex_t से PTHREAD_PROCESS_SHARED का उपयोग कर रहा हूं विभिन्न प्रक्रियाओं के बीच सिंक्रनाइज़ेशन करने के लिए। म्यूटक्स शायद डेडलॉक हो सकता है अगर कोई प्रक्रिया बाहर निकलती है, लेकिन म्यूट एक्स लॉक हो जाती है। पॉसिक्स मानक में एक PTHREAD_MUTEX_ROBUST है। लेकिन ऐसा लगता है कि मैक ओएस एक्स PTHREAD_MUTEX_ROBUST का समर्थन नहीं करता। क्या मैक ओएस एक्स पर किसी प्रकार का mutex है जो कि साझा मेमोरी, और क्रॉस प्रोसेस को सिंक्रनाइज़ करने के लिए इस्तेमाल किया जा सकता है, और इसे अनलॉक किए बिना एक प्रक्रिया मरने के मामले में मजबूत होना चाहिए? मजबूत सामग्री पीओएसआईएस धागे (एसयूएसयू 7) के बाद के पुनरावृत्त में दिखाई दी, मैक ओएस एक्स (जो कि एसयूएस 2) द्वारा समर्थित मानक का हिस्सा नहीं है। एप्पल डॉक्स नहीं दिखाते हैं एक pthread_mutexattr_setrobust फ़ंक्शन (या इसकी समतुल्य प्राप्त करें ) और वे कहते हैं कि वे SUSv2 पर आधारित हैं, इसलिए बताते हैं कि आपके पास यह क्यों नहीं है। समस्या के फिक्सिंग के संदर्भ में, आप कुछ ऐसे नियमों को ध्यान में रख सकत...

python - SQLAlchemy one to many relationship, how to filter the collection -

बौद्धिक रूप से उत्पाद को उत्पादकचित्र से कई रिश्ते हैं। मेरे उत्पाद चित्र मॉडल इस तरह दिखता है: picture_type_enums = ( 'मुख्य', 'संबंधित', 'विकल्प') वर्ग ProductPicture (आधार): __tablename__ = 'product_pictures' picture_id = कॉलम (पूर्णांक, primary_key = सच) product_id = कॉलम (पूर्णांक, ForeignKey ( 'products.product_id')) picture_type = कॉलम (Enum (* picture_type_enums)) url = कॉलम (स्ट्रिंग (120)) और मेरा उत्पाद मॉडल इस तरह दिखता है: वर्ग उत्पाद (बेस): __tablename__ = 'उत्पाद' product_id = स्तंभ (पूर्णांक, प्राथमिक_की = सच) product_name = स्तंभ (स्ट्रिंग ( 100)) product_pictures = संबंध ("उत्पाद की तस्वीर") मेरा प्रश्न एक उत्पाद के लिए है, मेरे पास विभिन्न प्रकार के उत्पाद चित्र हैं मुझे पता है कि मेरे पास एक उत्पाद उदाहरण पी है, मैं सभी प्रकार के उत्पाद चित्रों को प्राप्त करने के लिए p.product_pictures कॉल कर सकता हूं। हालांकि, मुझे p.main_pictures की तरह कुछ चाहिए जो सभी प्रकार के चित्रों को प्र...

php - DATEDIFF calculation between specific days without years -

I am trying to calculate interest to pay for every quarter from the date I bought. Can DATEDIFF calculate without input of years and does it consistently calculate the days of each year between 2 dates? Example: DATEDIFF Existing date and year without matured date DATEDIFF ('10 -25 ',' * - 01 -01 '), while * is the year of the wild card. Can it be done or is there a way to do this? Current code: // escape for security $ pdate = mysqli_real_escape_string ($ con, $ _POST ['pdate']); $ Mdate = mysqli_real_escape_string ($ cu, $ _POST ['mdate']); $ Amt = mysqli_real_escape_string ($ to $ _POST ['amt']); $ First = mysqli_real_escape_string ($ conn, $ _POST ['first']); $ Last = mysqli_real_escape_string ($ cu, $ _POST ['last']); $ Pid = mysqli_real_escape_string ($ conn, $ _POST ['pid']); $ Cno = mysqli_real_escape_string ($ conn, $ _POST ['cno']); $ Madd = mysqli_real_escape_string ($, $ _POST [...

java - Using A Servlet with JSP -

यह मेरा JSP है & lt;% @ page contentType = "text / html; वर्णसेट = यूटीएफ -8 "भाषा =" जावा "% & gt; & Lt;; doctype html & gt; & LT; html & gt; & Lt; शीर्ष & gt; & Lt; script src = 'https: //cdn.firebase.com/js/client/1.0.17/firebase.js'> & lt; / स्क्रिप्ट & gt; & Lt; script src = 'https: //ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'> & lt; / स्क्रिप्ट & gt; & Lt; link rel = 'स्टाइलशीट' प्रकार = 'टेक्स्ट / सीएसएस' href = '.. / css / example.css' & gt; & Lt; / head & gt; & LT; बॉडी & gt; & Lt; div id = 'messagesDiv' & gt; & lt; / div & gt; & Lt; इनपुट प्रकार = 'टेक्स्ट' id = 'nameInput' प्लेसहोल्डर = 'नाम' & gt; & Lt; इनपुट प्रकार = 'टेक्स्ट' id = 'messageInput' प्लेसहोल्डर = 'संदेश' & gt; & LT; स्क्रिप्ट & gt; Var myDataRef = नय...

ios - Swift Master-Detail Dismiss Popover -

In Xcode6 beta 4, do not dismiss template popover created for master-detail view when you click on extension master Does the item in TableView have someone do it with Swift in Beta 4? In previous versions of Xcode6, the template included 2 ways to control popups, but they are not working for me in Beta 4. func splitViewController (splitController: UISplitViewController, willHideViewController ViewController: UIViewController, withBarButtonItem barButtonItem: UIBarButtonItem, forPopoverController popoverController: UIPopoverController) {barButtonItem.title = "Master" // NSLocalizedString (@ "Master", @ "Master") self.navigationItem.setLeftBarButtonItem (barButtonItem, animated: true) self.navigationItem.setRightBarButtonItem (UIBarButtonItem (barButtonSystemItem: UIBarButtonSystemItem.Action, Target: Zero, Action: Zero), Animated: true) self.masterPopoverController = popoverController} splitViewController (SplitController function: UISplitViewContr...

java - How to return File[] array after adding all files to it -

I am new to this group. Please file [] how to return the array like mine Code is giving NullPointerException below, when I'm trying to add all text files from "D: \" to files [] as an array, I I want to return the text files back in the form of a file [] array, which will be used in the other method to read all the text files. file [] allFiles; Int i = 0; Public file [] Search files (file source) {FileFilter filter = new FileFilter () {@Override Accept Public Bullion (file pathname) {// TODO automatically generated method stub (! Pathname.isHidden ()) {true; } return false; }}; File [] list = source.listFiles (filter); If (list! = Null) {for (file: list) {if (f.isDirectory ()) {findFiles (f); } If (f.getName (.) Contains ("txt")) {System.out.println (f.getAbsolutePath ()); Allfiles [i] = f; // It is giving nullpointerexception i ++; }}} Return all the files; // want to return it to any other method} The main problem you're having Have yo...

c++ - Qt : which class should connect() signals and slots - inside or outside the view class? -

After good MVC practices, where should the signal slot connection be? I think it should be outside the visual category, possibly in a dedicated controller class that has points for the visual and model object. It raises a complexity, although a lot of signal objects can come into view from the square (such as the Qupashbutton). This means that I have to allow the controller to access the members of the view class to break and connect the interface () to see the option () to connect to things (in the class), but then this interface directly with the model class Does, which eliminates the attempt to separate them through MVC. Object-oriented design has an objective encapsulation. It is irrelevant to the user of the visual category that how you have implemented the class. Design should look at the convenient interface first . You can then do an implementation that uses widget control, another might be, still someone else can use QML, etc. This means that nothing ideal about th...

database - How to perform bitwise operations on a value stored in a table and use it in where clause of sql query? -

This is the scenario that I have a 'column' flag in a table. This column stores a 32-bit binary number in decimal form is. For example 00000000000000000000000000000010 is stored as 2. I need to display all the records in the table, in which the value of the value stored in 'Flag' is set as the 26th bits '1'. How do I write SQL queries for this purpose? Try this: select> where (flag and 64) = 64 26 bit bit 2 ^ 6 = 64 corresponds to bit. On SQL Server, & amp; It will return a Bitwise-End and 64 only if the 64 bit is set in both operands.

creating excel file via php and downloading it in android -

Using phpExcel, an Excel file is created in the server. $ objPHPExcel-> SetActiveSheetIndex (0); // Save excel file to server $ objWriter = PHPExcel_IOFactory :: createWriter ($ objPHPExcel, 'Excel2007'); $ ObjWriter- & gt; Save ('newrecord.xlsx'); As a class with AsyncTask @ Override is used as protected voice backbone (string ... parameter) {HTTP Client Httpclient = new DefaultHttpClient (); HttpPost httppost = New HttpPost ("http://10.1.1.5/connect/createexcelreport.php"); Try {HttpResponse response = httpclient.execute (httppost); String response string = EntityUtils.toString (response.getEntity ()); JSONObject jsonObj = New JSONObject (responseString); Int success = jsonObj.getInt (TAG_SUCCESS); If (success == 1) {// file has been created // via browser, I use it in http: //10.1.1.5/connect/newreport.xlsx Please share how I can get Android in this thread. I tried if (success == 1) {InputStream data = response.getEntity () GetCont...

PHP Regex to allow special characters but no any space -

I have the following regs so that alphanumeric characters and the following special characters are allowed / () - is a regular expression / [^ a-za-z0-9 - () - /] / complete method public function valid number ($ number) {$ return = true; $ Matches = null; If ((preg_match ('/ [^ a-za-z0-9 - / () -] /', $ number, $ match) gt; 0) {$ return = false; } Return $ return; } The above method woks are fine, but if the number is replaced then TRUE also comes back. When I remove '/' from regx, then if the number is 'space' then it gets wrong. It seems that there is some problem in 'Regex'. Please give some advice to allow the letters of letters and the special characters above. Regex / () - , ^ [A-Za-z0- 9 () \ / -] + $ ^ Inside (on top) Chocker class does not make sense. So your Részek character does not give any letters of the people described in the class. Even better to avoid / inside the character class and always consid...

Get posts from all categories wordpress -

How to get all the posts from a category I tried this code, it is not displaying any output. Is this correct or is there any improvement here? Thank you. Include ('wp-config.php'); Global $ wp_query; $ Args = ('category = news and post_on_page = -1'); $ Myposts = get_posts ($ Args); Forex Currency ($ myposts $ as post): setup_postdata ($ post); $ Result = array ("id" = & gt; $ args ['id'], "type" = $ args ['post_type'], "url" = & gt; $ args ['guid']) ; Endforeach; Wp_reset_postdata (); Print ($ result); Try below: - $ global Wp_query; $ Args = ('category = news and post_on_page = -1'); $ Myposts = get_posts ($ Args); Forex Currency ($ myposts $ as post): setup_postdata ($ post); $ Result [] = array ("id" => gtc: $ post-> ID, // $$$ "type" = & gt; $ post- & gt; post_type, "url" = & gt; $ Post- & gt; GUID); Endforeach; Wp_reset_postdata...

Manipulating 2d C++ arrays in a custom library - getting the number of rows? -

I am used for Java but learning C ++ and as an experiment I have to create a library Trying to file in a 2D array with the CSV user defined import specs, print the array in the console, and then type the array into a different file. I create the array of rows (y-axis), print the array, and write the array while loop through 2d array. I have found the value of X-axis, and I'm negligible with it: int y = sizeof (arr) / sizeof (arr [0]); Try to get it when I tested the code in a compiled CPP main, but now I got the correct number of rows correctly, but now I connected the function to one Is taken to the library which is assigning it Y to 0! Why the difference, and how can I solve it? In the example below I am testing a matrix with 6 fields and 4 records, so I'm looking at 4 as the assigned value of 4. Since I have narrowed the problem to this variable, here it is one (hopefully) how I am getting the SSCCE. Header file: #ifndef csv_io_h # defines CSV_IO_H # a...

jquery - Geocoding an address with Google Maps API -

Is there a way to recover a longitude using Latitude and a specific address using the Google Maps API? I am trying to create a web page where you can enter an address in a text box, then latitude will be automatically calibrated for a long time. Like this page: A very basic example: var geocoder = new google.maps.Geocoder (); Var a = "Your address here"; Geocoder.geocode ({'address': a}, function (result, position) {var c = results [0] .geometry.location; var latitude = c.lat (); var graphs = c.lng ();} );

android - How to check if back/home buttons are touch or hardware buttons? -

I am trying to make a snake game. I'm testing the game on my Nexus 4, which was seeing it back / home buttons as a touch button, when I wanted to do full screen activity, the touch button will show up on the activity so that I will use the following code: view.setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); But when I tested the game on my friend's Sony Ericsson phone, which has hardware buttons, so on my phone it is more spreading to the area behind the bottom edge of the screen. How can I fix this? I'm getting the screen size like this: DisplayMetrics metrics = new DisplayMetrics (); . GetWindowManager () getDefaultDisplay () getMetrics (matrix). Height = metrics High pixel; Width = metrics.widthPixels; I'm 99% confident that they are similar to th...

android - Google Play Games Services Multiplayer and Backend -

I'm thinking of using Play Game Services with turn-based multiplayer to power Android games . I own backend (Here, Google App Engine) any need to save the results of the game: The main winner and score, though for accounting purposes, I Play games a custom server Docs No mention is available. How can I add GPGS multiplayer with backend? More specifically, how can I check that the user has entered into GPGS effectively? You might send this data to the client server, but I'm afraid that may have been compromised in the data and because it has no way of checking if 1 V 1 war, correct data that other users is not. Thanks for any clue. The store has developed a multiplayer game and I score for each player using I use GPGS The service for 'Cloud Save' (now it has been replaced) has been used. This is saved for each account, so the data can be loaded / saved from various devices.

javascript - detecting device and OS type using mobile detect js -

I am trying to use a device and OS identification script and have detected the JS plugin with this mobile . It seems that far enough clear. And It appears that the documentation is not completely and I am getting a little confused about how to make specific cases. For example, what I'm trying to do is to find out that the user is going to a website using a mobile or tablet and after that check is to find the device's OS in the next step. function DeviceDetectionScript () {var md = New MobileDetect (window.navigator.userAgent); If (MD.Mobile () and MD.phone () & amp; amp; MD.Tableable ()) {if (iOS) {/ some} if (Android) {// do something} if ( Window) {// do something}} other {// do something else}} However, I'm not sure that this is the right way to get it. Or is there any other way to get the same functionality without using this script? For example, what I'm trying to do is to find out that the user Going to the website using mobile or tables an...

Typing a Text File One Line At A Time -

I am writing a batch script which can get data from different files on the drive, and it's all working well is. The problem is that I would like the contents of the file to be typed in a row of CMD at a time. A little like this: Hello, this is the first line of the text file 1 second break and this is the second line etc. I tried to use it for command, but I could only get it to repeat the first line. Any help would be appreciated, thanks in advanced! -Look timeout in Vista and above div>

objective c - How to load image for uitableviewcell before -

I have tried a lot of ways while studying about my similar problem, but I did not find the correct answer and I asked Straight. Here's my job I want the user to launch their app and see the cells with images that I load from the web, but I just see the title! Then I scroll up and do not appear on some cell screens. And after that I only see the image for that cell Here is my code: - (NSInteger) tableView :. (UITableView *) Table view numberofrose insubstation: (NSINtegaard) volume {return 5; } - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * reusbleCell = @ "cell"; UITableViewCell * cell = [tableview decouwer reusable light identifier: RecycleBec;]; If (cell!) {Cell = [[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: reusbleCell]; } Dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {NSURL * imageUrl = [[NSURL alloc] ...

PHP sessions are blocking, ignoring session_write_close -

I am trying to serve twice simultaneously with the same browser session. Consider the following minimum example: & lt ;? Php session_start (); $ SessionId = session_id (); Session_write_close (); $ File = sys_get_temp_dir () '/ Lock_test'; If (! File_exists ($ file)) {touch ($ file); Sleep (5); Unlink ($ file); Echoed! '$ SessionId; } And {echo 'lock! '$ SessionId; } The second request should be in "lock" output, but it always waits for the first request to complete and then outputs "made". Xdebug is not running PHP version 5.5. Edit: Voting to stop it as a duplicate Link to the linked question shows that to solve this problem, attach a random variable. Therefore, I suggest linking the request time and setting it into a timestamp with microseconds. This behavior is fine. If both requests share the same session and you're using files to store session data, then PHP requires flock () , being corrupted by multiple fil...

java - Findbug immutable date fixes do not work -

I get Maven plugin version 2.5.4, and in my code it shows me an error: However in my code I use it: public date getDateRlpx () {dateUtil.immutableDate (dateRlpx); } Public Zero SetderPlace (End Date RLPX) {this.dateRlpx = dateUtil.immutableDate (dateRlpx); } and my irreversible date: Public stable date unchanging date (last date source data) {if (sourceDate == blank) {return tap; } New date of return (sourceDate.getTime ()); } Why findbug shows this error? I have created a new date object, I also tried a simple return new date (dateRlpx.getTimes ()) but it was not working as well. I could not find any solution Yes, Thomas was right, there was a problem with the environment, especially the Tomato server running from IDEA IDE. It has been stopped by Findbug in order to check the fixed source code in any way and instead it checked into a target directory or inside. So now all this work and agree with the research that the new date (date.getTime ()) is a solution...

java - Is it possible to send broadcast socket in jsp? -

I get the jsp code for socket send and change the IP to 255.255.255.255, but the result is Is: Network is not accessible '. The code is: & lt;% @ page content type = "text / html; charset = utf-8" language = "java" import = "java. Util. *, Java.net. *, Java.io. *, Java.lang. * "ErrorPage =" "%> Var Errors = ""; & Lt;% attempt {int characters; Socket socket = new socket ("255.255.255.255", 10000); InputStream inSocket = socket.getInputStream (); OutputStream Outsocket = Socket.GetOutputTream (); String str = "message"; Byte buffer [] = str.getBytes (); OutSocket.write (buffer); While ((character = inSocket.read ())! = -1) {out.print ((four characters)); } Socket.close (); } Hold (java.lang.Exception e) {%> Errors = "Something is wrong!" + "& Lt;% = e.getMessage ()%>"; I have Tomcat 6 version (I think ...), or if this is impossible (I have heard that people say th...

dictionary - How to find the number of (key , value) pairs in a map in scala? -

I need to find the number of keys (key, values) in the map of my Scala code. I repeat through the map I can get an answer and I want to know whether there is any direct task for this purpose. you can use scala> Val m = map ("one" -> 1, "b" -> 2, "c" -> 3) m: scala.collection.immutable.Map [string, int] = map (a - & Gt; 1, b -> 2, c -> 3) Skeleton & gt; M.size res3: int = 3

Draggable/Droppable positioning with Jquery UI -

I am using a simple dragbable / droppable jazzy UI function, which I have to modify in a certain way. The first thing that I want to do is drag the two (or more) dragable objects into a droppable item on each other. So when I take them to drop-in, I do not want them to be 5px free in every direction and keep them on each other. Is this possible? $ ("(Idle:" #docs ", back:" invalid "}); $ (" doppableable "): $ (function () {$ (" .draggable "), draggable ({Tolerance: 'Fit', Over: Function (Event, UI) {$ ('.u-drag-able-dragging'). Ad Class ('Hoverclass');}, Out: Function (Event, UI)) {$ ('.ui-draggable-dragging'). RemoveClass ('hoverclass');}, drop: function (event, UI) {$ (".droppable") .addClass ('dropClass');}}); } Thank you. Do you read the AE for any solution?

PHP a lot of else if another approach? -

Here's my code, I want to ask, what's the best way to do this? I would like more "if" option and I'm concerned about performance if ($ _ GET ['start'] === 'yes') {} else if ( $ _GET ['start'] === 'Dida') {} And if ($ _GET ['start'] === 'bira') {} And if ($ _GET ['start'] === 'EIMA Otherwise if ($ _GET ['start'] === 'ABA') {} You should use the switch statement instead. Creating a switch is more easily translated into a leap (or branch) table In case that the labels are closed simultaneously, the switch statement can make more efficient from if-else The jump keeps a bunch of instructions and then adds value to the program counter. It changes the sequence of comparison instructions with an addition operation. - @ Judge Megarden $ start = $ _GET ['start']; Switch (starting $): case 'yeg': // break something; Case 'deda': // Break something; Case ...

sql - Concat with NULL value -

I have a query that looks something like this: separate call 1 Choose, select Ltim (str (col2)), 'from' @temp t2, where x2 path t2.col1 = t1.col1 (@ ')) @temp t1 to col2 Some values ​​in Col2 are zero, so instead of displaying a string with zero, that part is completely missing, i.e. should be col2 3 , 4,3, NULL, 2,3,4,3,2, but instead I'm getting: 3,4, 3,2,3,4,3, 2, How can I fix this Huh? To get tap output to , you have to change the zero value in the string 'NULL'. It also means that you have to enter numeric values ​​in a string for a corresponding type of field; Select 1, (select COALESCE (CAST (col2 as VARCHAR), 'NULL'), 'FROM @temp T2 WHERE t2.col1 = t1.col1 XML path ('')) @temp t1 from col2.

eclipse - android: requires previous sdk support even if min sdk version is higher? -

I am new to Android development and I tried to import Android applications in my Eclipse (ADT). But, I'm getting an error saying: is unable to resolve the target of Android-8 ' , but I have a manifest file Checked in, the minimum SDK and target SDK are set as follows: Then, why am I having this error? Why do I need API 8, even if the application supports SDK11? Facebook and GCM have been integrated into the application? What is the reason for this? Or, are there any classes that require API 8 support? I am getting confused and can not find a satisfactory answer. Thank you. You have set the application Android 8 as the target version, replace it with the properties option Right click on the project and click "Properties". Then select "Android" from the left side then you can select the target version from the right. Always try to select the highest available target version Go to Android (currently 4.4.2 KitKat).

Process Synchronization in java -

Process A writes in XYZ, when executed. Processes are B and C, when executed, the file reads XYZ. Therefore, while the process A is above, B and C should wait to complete. Can I use the java.nio package to provide synchronization? Or should I use something like file lock or socket? Can we tell the time to wait for another process to wait? Edited: The file is created during the first writing process. In such a case, can I make it a shared resource? Java Eno package can use file lock better solution, I hope but, I think java.nio is not complete up to JDK 1.6. File lock:

c# - Concatenate Constant String and Enum -

इस सवाल का पहले से ही एक उत्तर है: 3 जवाब मेरे पास एक बड़ा C # वर्ग है जो कुछ भी नहीं बल्कि सार्वजनिक const स्ट्रिंग फ़ील्ड से भरा है हालांकि, एक मामले में मैं const स्ट्रिंग फ़ील्ड में एक स्ट्रिंग और एक मान को जोड़ने की कोशिश कर रहा हूं, जैसे: सार्वजनिक const string GET_VALUES = "SELECT * से [टीबीएल] जहां [आईडी] = "+ Enum.Val; हालांकि, मुझे यह संकलक त्रुटि मिलती है: 'नेमस्पेस.SqlStatements.GET_VALUES' स्थिर होना चाहिए मुझे पता है कि मैं const खंड को छोड़ सकता हूं, लेकिन मैं इस वर्ग के भीतर सभी क्षेत्रों को लगातार रखना चाहता हूं। क्या एक स्थिर स्ट्रिंग और सी # में एक एन्यूम को जोड़ना संभव है? एमएसडीएन से: एक निरंतर अभिव्यक्ति एक अभिव्यक्ति है जिसे संकलन समय पर पूरी तरह से मूल्यांकन किया जा सकता है। इसलिए, संदर्भ प्रकारों के स्थिरांक के लिए एकमात्र संभव मान स्ट्रिंग और रिक्त संदर्भ हैं। आपके मामले में, enum को ToString , जो समय संकलन पर संभव नहीं है मैंने सुझाव दिया था कि आप इसे readonly में बदलकर एल्गोनोजो का उल्लेख किया। ...

sql - Calculate a running total in MySQL -

I have this MySQL query: SELECT DAYOFYEAR (`date`) ASD , COUNT (*) `from commands' where` haspad` & gt; 0 by group D which gives something like this: D | COUNT (*) | 20 | 5 | 21 | 7 | 22 | 12 | 23 4 | To show the running total, I'll end up with one more column: d | COUNT (*) | ??? | 20 | 5 | 5 | 21 | 7 | 12 | 22 | 12 | 24 | 23 4 | 28 | Is this possible? Maybe a simple solution for you and prevents the database from doing a ton of questions. Performs the query, then there is a little math on results in a single pass. SET @runtot: = 0; SELECT q1.d, q1.c, (@runtot: = @runtot + q1.c) AS RT FM (Select Detroit (`date`) ASD, COUNT (*) AC-C`order` Where` Hepad & GT ; D Order D by Group 0) AS Q1 This will give you an additional RT (running total) column. Do not miss the sit statement located at the top or you will get a column of zero values ​​to start running the total variable.

c# 4.0 - Append rich formatted text from 2 RichTextboxes into another RichTextBox in C# -

मेरे पास 3 RichTextBoxes हैं: richTextBox1, रिच टेक्स्टबॉक्स 2 और रिच टेक्स्टबॉक्स 3. मैं ऐप चलाता हूं और इसमें पाठ दर्ज करता हूं टेक्स्ट बॉक्स 1 और 2। अमीर टेक्स्टबॉक्स 1 के लिए टेक्स्ट "टेस्ट" है और रिच टेक्स्टबॉक्स 2 के लिए "आईएनजी" है। अब मैं उस टेक्स्ट को एक साथ जोड़ना चाहता हूं और इसे एक और रिच टेक्स्टबॉक्स में डालना चाहता हूं (बोल्ड, रेखांकन, आदि जैसे किसी भी स्वरूपण के संरक्षण) ... तो मैं निम्नलिखित कोड की कोशिश करता हूं: richTextBox3.Rtf = richTextBox1.Rtf + richTextBox2.Rtf; यह किसी भी त्रुटि का कारण नहीं है, लेकिन मुझे केवल RichTextBox1 से ही टेक्स्ट मिलता है। तो मुझे "टेस्ट" मिलता है। तो मैं प्रारूप को रखते हुए 2 RichTextBoxes की सामग्री कैसे कॉपी करूँ? टा आप ऐसा करना चाहेंगे: richTextBox3.Rtf = richTextBox1.Rtf richTextBox3.Select (richTextBox3.TextLength, 0 ); RichTextBox3.SelectedRtf = richTextBox2.Rtf; यह चाल करना चाहिए।

html - jsf previous button with immediate=true looses entered data -

I have a JSF web application in which the customer has three pages of information gathering. Once the customer completes the first page that is stored, validated and stored in the managed bean. On the second page the customer completes half of the questions and clicks my previous page button, which is the JSF command button, which is set to the correct attribute, which leaves verification and form submissions. I have this issue that half the questions on the second page are now lost, when the customer returns to Page 2 to return to the page, the questions he has given will be empty. Is there a standard way in JSF structured? I had used Stresses earlier that handled this behavior. Thanks Tom In each page load, JSF makes views with current controller values ​​if you do not save these values ​​in the controller bean, they will be easily lost. To avoid sending the form to your button, just send the data back to the input controller using the Ajax on the Onchange event. ...

clojure - How to expand macro within other macro's scope (trying to debug a macro) -

After Here is the simplest example I can do: (defmacro printer [& amp; Forms (`println ~ @ forms)) (defmacro connector [s]` (inc / s)) They can be used as expected: (printer "haha") = & gt; "Haha" (connector1) => 2 and I can macroexpand to see what macro they did: (macroexpand '(printer 1) ) = & Gt; (Closeor.core / print1) (macroxpand '(connector1)) = & gt; (Clojure.core / Ink 1) But when they are nested I do not get what I want: (printers (printer) Copula 1))))) =) (Clojure.core.println (joiner 1)) I was expecting to get = & gt; (Clojure.core.println (clojure.core / inc1)) Is there any way for me to expand nested macros? This will help me a lot in debugging a specific bug. you (use 'clojure.walk) (macroexpand- All '(printer (connector 1))); (Clojure.core / println (clojure.core / Ink1))

python - Django: URL pattern to include values from multiple fields -

I'm quite new to the python and I'm trying to create a URL pattern which takes two fields as a parameter is. This is part of my model: CATEGORY_CHOICES = (('M', 'Music'), ('G', 'Games'), ('T', 'TV') Slug = models.SlugField (unique = true, max_length = 255), ('F', 'movie'), ('o', 'mixed')) category = = model.carfield (max_long = 1, option = category_CHOICES) / Code> What I want to achieve, as it is to be able to call: thisblog.com/music/this-post where / music category and / this post is slug. / P> I had an attempt but I do not understand how to do it properly: urlpatterns = patterns ('', url (r '^ admin / ', (Admin.site.urls), url (r' ^ $ ',' blog.views.index '), url (r' ^ (? P & lt; class & gt; [\ w \ -] + ) P> This one gives me a link on 'NoReverseMatch' update: I have a link in my html template: get_absolu...

java - Custom git push ant task wont work in JGit -

I am trying to use my custom git-push ant function JGIT, which is called the branch in the remote repository Should be pushed, but it does not seem to work. Here's my Java code to work: Public Zero Set Repository (string repository) {this.repository = repository; } Public Zero Set Password (String Password) {this.password = password; } Public Zero Set USUN (String Username) {this.username = Username; } Public Zero set Yuri (string uri) {this.uri = uri; } Public Zero Set Branch (string branch) {this.branch = branch; } Public executives execute () throws BuildException {try {git git = Git.open (new file (repository)); Credential Provider CP = New User Name Password Credential Provider (Username, Password); RefSpec spec = New RFSPC ("Refix / Head /" + Branch + ": Refix / Head /" + Branch); Push Command Push Commands = GT Pius (); PushCommand.setCredentialsProvider (CP) .setRemote (URI) .setForce (true) .setRefSpecs (idea) .call (); } Hold (exception e) {lo...

mysql - Cannot get object from database -

I have just one thing I want to get the database, which realized my query, but I get an exception. @ Override Public Tache getLastSousTache () {session session = HibernateUtil.getSessionFactory (). GetCurrentSession (); Session.beginTransaction (); Select the string sql = "from tache * where idtache = (maximize (idety) tache where soustache is not zero)"; Query query = session.createSQLQuery (SQL); Touch Tachs = New Tash (); Tache = (TESE) query.uniqueResult (); Return tech; } I have this exception: org.springframework.web.util.NestedServletException: request processing fails; The nested exception is java.lang.ClassCastException: [Ljava.lang.Object; Not be cast com.model.Tache org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:927) org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:811) javax.servlet.http HttpServlet.service (HttpServlet.java:621) org.springframework.web.servlet.FrameworkServlet.servi...

python - Replace contents of lxml StringElement with starting a namespace war? -

I do not know how to change the contents of the lxml string element (in this case styleUrl) which already has a namespace (From other footpieces) I'm getting an element level namespace injection. This is a very distilled and simplified version that tries to describe only this issue to change a StyleMap name: # / usr / bin / pykml import parser __future__ import print_function env dragon from import sys! lxml import kmlparser = "S-1" b4_et = kmlparser.parse ( 'b4.kml') b4_root = b4_et L = b4_root.xpath ( '// * [@ id = "% s"]' for frm = "lineStyle30218901714341461519022 "Objectify% frm [0] el.attrib ['id'] = to el = b4_root.xpath ('// * [text () =' #% s ']'% frm) [0] el.xpath ( '. /..')[0].styleUrl =' # '+ objectify.deannotate to (b4_root, xsi_nil = true) b4_et.write (sys.stdout, pretty_print = true) Test Data: & lt ;? XML version = "1.0" encoding = "UTF-8"? ...

Multiple MongoDb databases configuration -

I need to create a large number of MongoDb databases, some around 1000 +, later it will be more than 3000. They will be hosted on a server with SSD discs and in most databases there are approximately 20-30 archives with more than 500 objects, most of the object size is between 10-50kb, then in the size of the data There will be a bit relatevely. My question is how should I configure the creation of these mongodb databases, in order to use the disk space in the most effective way. I have read that mongodb allocates empty disk space and can take up to 100 MB in an empty database size, is there a way to reduce this size? You can set the configuration option to True. This will shorten the initial data and journal files. From MongoDB Docs: Storage. The Mallfiles option reduces the initial size for data files and limits the maximum size up to 512 megabytes Storage.smallFiles reduces the size of each journal file from 1 gigabyte to 128 megabytes. Use storage. If you have a lar...

c++ - C ADT : *.c file inclusion -

मेरे पास सार संरचना है: [trame.h] टाइप किए गए स्ट्रिप s_trame t_trame; // आवंटन, सेटर्स और गेटर्स प्रोटोटाइप [/ trame.h] [trame.c] # शामिल " Trame.h "struct s_trame {} // आबंटन, सेटर्स और गेटर्स कार्यान्वयन [/ trame.c] एक अन्य फ़ाइल में, मुझे यह जानने की जरूरत है T_trame में फ़ील्ड एकमात्र तरीका मुझे करना है जो trame.c फ़ाइल को शामिल करना है। यह विशिष्ट संदर्भ में यह कितना बुरा है या इसे बेहतर कैसे करना है? [main.c] # शामिल "trame.h" # शामिल "trame.c "इंट मुख्य () {टी_ट्रैम ट्रम; // ट्रम रिटर्न 0 के साथ कुछ करें; } [/ main.c] मैं वास्तव में अमूर्त को तोड़ना नहीं चाहता, लेकिन मैं अपने कुछ कार्यान्वयन के लिए संरचना का उपयोग करना पसंद करूंगा। सी में काले-मुक्केबाजी संरचनाओं का यह एक बहुत ही आम तरीका है लेकिन संरचनाओं को बनाने के लिए अपारदर्शी, आपको कार्य में निर्माण और विनाश सहित ढांचे के सभी उपयोग को लपेटा जाना चाहिए। t_trame * trame_create (); / * आबंटित और संरचना को प्रारंभ करता है * / शून्य trame_destroy (t_trame *)...

python - Cant understand dot operator concept -

People are really confused about the job of the dot operator. The code I have tried .. class name: square x: def __init __ (self, y): self Y = y def __init __ (self): pass some = name () some.xy = 'foo' print something. Xy When I run this code, Code> foo . But when I tried the code class name: class x: def __init __ (self, y, z): self Y = y self.z = z def __init __ (self): pass some = name () some.xyz = 'foo' print some.xyz I get an error. How can i use it as some.xyz and get the output as foo ?? Any helpful help would be appreciated .. Thank you It is not clear why you expected the second code to work. The first code is bad because it mixes classes and examples: some class Name is example ; some.x is an class , and class attribute 's name . If you create another name example, then it will share the same attributes at x . Instead, consider this: class name (object): def __init __ (self, x = none, y = none, z = none): se...

Allocating 2 dimension array of a class Java -

It's just working fine. test [] [] matrix = new exam [5] []; For (int i = 0; i It does not work [to (Test] t: Matrix) {t = new trial [5]; For (test T2: T) T2 = new test (); } It is working int [] [] matrix 2 = new Int [5] [5]; Without starting at all Why is the question? Because you are assiming for local variables and not Matrix . for (test [] t: matrix) {t = new test [5]; // You are assing for a local variable / / t is a local variable! } To make it more clear: (int i = 0; i & lt; matrix.length; i ++) {Test [] t = matrix [i]; // t is clearly a local variable // It will specify a new array for local variables: T = new test [5]; // matrix [i] is still empty, to prove: system.out.println (matrix [i]); // print "empty"}

wso2esb - VFS options for tab delimited file in WSO2 ESB -

Does anyone know about processing tab-separated input text file using VFS transport in WSO2sb is? In general, how can I convert a different file from a tab to the structure structure format (XML for WSO2)? Using comet mediator can easily parse the delimited file with a comma and works well but there is no document around the parsing capacity using other delimiter. Sprax config works well for CSV, please tell how can be modified to delimit the tab. & lt; Smooks-resource-list xmlns = "http://www.milyn.org/ Xsd / smooks-1.1.xsd" xmlns: csv = "http://www.milyn.org/xsd/smooks/csv-1.2.xsd "& Gt; & Lt; Resource-Config Chooser = "org.xml.sax.driver" & gt; & Lt; Resources & gt; Org.milyn.csv.CSVReader & lt; / Resources & gt; & Lt; Param name = "field" & gt; Field 1, Field 2, Field 3 & lt; / Param & gt; & Lt; Param name = "rootElementName" & gt; File DetectorCode & lt; / Param ...

c++ - How to draw texts on a 3D objects (such as sphere) -

I learn OpenGL under the Linux platform. Recently, I try to use texts created by glutBitmapCharacter () , such as the texture of some of the Quadrix objects provided by glu or glut, glutBitmapCharacter () does not return an indicator so that I can not feed it on glTexImage2D () I was Google for some time, but whatever I found is something related to Android SDK I have no experience. All I can think is to present the texts and read it using buffer glReadPixels () , then save it to a file. Then, the pixel from the file Read back and see it in an indicator Finally, draw 3D objects as textures with these texts (i.e. feed the pointer at glTexImage2D () .) However, it is very silly what I want to ask: what There is no other alternative way to power? Applying text on top is not trivial with a 3D surface pure OpenGL. GLUT does not provide any tools for this. One possible option would be to apply your own text rendering methods, possibly loading the glyph, then apply a textu...