most recent 30 from stackoverflow.com 2016-05-17T04:54:48Z http://stackoverflow.com/feeds/ http://www.creativecommons.org/licenses/by-sa/3.0/rdf http://stackoverflow.com/q/37267419 0 EminenT FoX http://stackoverflow.com/users/6343767 2016-05-17T04:53:44Z 2016-05-17T04:53:44Z <p>I Have A Problem To Edit Apk.. When Toucb That Apk's One Grid Its Redirect to Google Play Store Product Link. So Ineed To Change Or Remove That Link Please Sie Help Me...</p> http://stackoverflow.com/q/37267418 -1 khushboo agrawal http://stackoverflow.com/users/6337729 2016-05-17T04:53:43Z 2016-05-17T04:53:43Z <p>Which certification is good for Sybase database developer ?</p> <p>Can we install Sybase database for leaing purpose in my personal laptop?</p> <p>Is there any good online training on the same ?</p> http://stackoverflow.com/q/37267417 0 John http://stackoverflow.com/users/27305 2016-05-17T04:53:42Z 2016-05-17T04:53:42Z <p>I recently received website that consists of an index.html, sass files, javascript files and a few configuration files. I tried to run the command <code>npm install</code> in the main project directory and I got the following error.</p> <pre><code>npm ERR! Error: No compatible version found: grunt-contrib-concat@'node_modules/grunt-contrib-concat' npm ERR! Valid install targets: npm ERR! ["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.3.0","0.4.0","0.5.0","0.5.1","1.0.0","1.0.1","0.1.2-rc5","0.1.2-rc6"] npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:719:10) npm ERR! at /usr/share/npm/lib/cache.js:638:10 npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7) npm ERR! at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7 npm ERR! at Object.oncomplete (fs.js:107:15) npm ERR! If you need help, you may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! <npm-@googlegroups.com> npm ERR! System Linux 4.4.0-x86_64-linode63 npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! cwd /var/www/project.com/public_html_staging npm ERR! node -v v0.10.25 npm ERR! npm -v 1.3.10 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /var/www/project.com/public_html_staging/npm-debug.log npm ERR! not ok code 0 </code></pre> <p>This is what my <code>package.json</code> looks like</p> <pre><code>{ "name": "project", "version": "0.0.0", "devDependencies": { "glob": "~4.3.1", "grunt": "~0.4.1", "grunt-autoprefixer": "~2.0.0", "grunt-concat-css": "^0.3.1", "grunt-contrib-concat": "node_modules/grunt-contrib-concat", "grunt-contrib-coect": "~0.9.0", "grunt-contrib-cssmin": "~0.11.0", "grunt-contrib-imagemin": "^1.0.0", "grunt-contrib-jshint": "~0.10.0", "grunt-contrib-sass": "~0.8.1", "grunt-contrib-uglify": "~0.7.0", "grunt-contrib-watch": "~0.6.1" }, "dependencies": { "load-grunt-tasks": "~2.0.0" } } </code></pre> <p>I'm really new to the <code>npm</code> command and any related subject matter. How do I begin to troubleshoot this error? Or does anyone know the solution?</p> http://stackoverflow.com/q/37267416 0 Leland22 http://stackoverflow.com/users/6132210 2016-05-17T04:53:32Z 2016-05-17T04:53:32Z <p>I am trying to create a simple menu system. I am using states to do so and have 3 states (Help, Menu, Game). I start at the menu and am trying to switch to the help state when I get my error. The switch to game state is working just fine.</p> <p>My big problem is this line in my HelpState</p> <pre><code>//handler.getMouseManager().setUIManager(uiManager); </code></pre> <p>When it is not commented out my entire menu system stops working.</p> <pre><code> //Game State for the game package scripps.states; import java.awt.Graphics; import scripps.rpg.Assets; import scripps.rpg.Handler; import scripps.rpg.ui.ClickListener; import scripps.rpg.ui.UIImageButton; import scripps.rpg.ui.UIManager; public class HelpState extends State{ //Variables private UIManager uiManager; //Creates the new game state, public HelpState(final Handler handler){ super(handler); uiManager = new UIManager(handler); //handler.getMouseManager().setUIManager(uiManager); uiManager.addObject(new UIImageButton(475,300,200,100, Assets.start_button, new ClickListener(){ public void onClick() { handler.getMouseManager().setUIManager(null); //Sets the UI manager to null so the user cant still click on it State.setState(handler.getGame().menuState); }})); } public void tick() { } public void render(Graphics g) { uiManager.render(g); } } </code></pre> <p>My MenuState</p> <pre><code>package scripps.states; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferedImage; import scripps.rpg.Assets; import scripps.rpg.Game; import scripps.rpg.Handler; import scripps.rpg.ImageLoader; import scripps.rpg.ui.ClickListener; import scripps.rpg.ui.UIImageButton; import scripps.rpg.ui.UIManager; public class MenuState extends State{ private UIManager uiManager; private BufferedImage background,title; public MenuState(final Handler handler){ super(handler); uiManager = new UIManager(handler); handler.getMouseManager().setUIManager(uiManager); //Adds the start button to the screen uiManager.addObject(new UIImageButton(475,300,200,100, Assets.start_button, new ClickListener(){ public void onClick() { State.setState(handler.getGame().gameState); //handler.getMouseManager().setUIManager(null); //Sets the UI manager to null so the user can't still click on it }})); uiManager.addObject(new UIImageButton(475,450,200,100, Assets.help_button, new ClickListener(){ public void onClick() { State.setState(handler.getGame().helpState); //handler.getMouseManager().setUIManager(null); } })); } public void tick() { uiManager.tick(); } public void render(Graphics g) { background = ImageLoader.loadImage("/textures/maxresdefault.jpg"); title = ImageLoader.loadImage("/textures/title.png"); g.drawImage(background, 0,0, null); g.drawImage(title, 400,100, null); uiManager.render(g); } } </code></pre> <p>If anyone could be of assistance that would be amazing!</p> http://stackoverflow.com/q/37267414 0 qoou http://stackoverflow.com/users/6332292 2016-05-17T04:53:06Z 2016-05-17T04:53:06Z <p>The basic question is, how does notepad (or other basic text editors) store data. I ran into this because I was trying to compare file size of different compression techniques, and realized something isn't quite right.</p> <p>To elaborate..</p> <p>If I save a text file with the following contents:</p> <pre><code>a </code></pre> <p>The file is 1 byte. This one happens to be 97, or 0x61.</p> <p>I create a text file with the following contents:</p> <pre><code> !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ </code></pre> <p>Which is all the characters from 0-255, or 0x00 to 0xFF. This file is 256 bytes. 1 byte for each character. This makes sense to me.</p> <p>I then append the following character to the end of the above string.</p> <pre><code>† </code></pre> <p>A character not contained in the above string. All 8 bit characters were already used. This character is 8224, or 0x2020. A 2 byte character.</p> <p>And yet, the file size has only changed from 256 to 257 bytes. In fact, the above character saved by itself only shows 1 byte.</p> <p>What am I missing?</p> http://stackoverflow.com/q/37267413 0 CrazyObba http://stackoverflow.com/users/6021977 2016-05-17T04:53:00Z 2016-05-17T04:53:00Z <p>i have quick question, what I am trying to do here is to, get the Student from HashMap and adds a double mark to Student's mark.</p> <p>lets say i have class called Student and Student class has method called addToMark() and Hashmap called <code>theStudent = new HashMap<String, Student></code>. </p> <pre><code>public void addExtraMark(String studentNumber, double mark){ </code></pre> <p><code>if(stuentNumber != null && mark >= 0){ Student extraMark = theStudent.get(studentNumber) extraMark.addToMark(mark)}</code>}</p> <p>my question is, does mark adds to hashmap? automatically? or do i have to use </p> <pre><code>theStudent.put(studentNumber, extraMark); </code></pre> <p>on the bottome of my code?</p> http://stackoverflow.com/q/37267409 0 Charuta Save http://stackoverflow.com/users/6266086 2016-05-17T04:52:39Z 2016-05-17T04:52:39Z <p>I always gets an answer to my question from "Stackoverflow" and this is first time, I am posting my question.</p> <p>I am reading XSD file using DOM in java. In my XSD, I need to change type of an element. </p> <pre><code><xs:complexType name="MainDoc"> <xs:sequence> <xs:element name="Bike" type="Vehicle"/> </xs:sequence> </xs:complexType> <xs:complexType name="Vehicle"> <xs:sequence> <xs:element name="price" type="amount"/> </xs:sequence> </xs:complexType> </code></pre> <p>Here, I want to change type="Vehicle" to type="Twowheeler" when element name is "bike" and all occurrences of "vehicle" to "Twowheeler". I read XSD using DOM component so is this possible to change this?</p> <p>(Workaround to this problem will be, I will replace word "vehicle" from XSD file using file handling operations but I don't prefer this)</p> <p>Please help...</p> http://stackoverflow.com/q/37267408 1 Sam Worley http://stackoverflow.com/users/6340795 2016-05-17T04:52:39Z 2016-05-17T04:52:39Z <p>I am an Android begier and I am working on a simple project. So basically I have created a text file, which contains a list of emojis such as this</p> <p>"@_@", "[°]", " 3_3"</p> <p>Each emoji is in a newline.</p> <p>I want to include this text file in the res folder of the app and I then let my app read the contents of this file and display the content in a GridView.</p> <p>I looked at few tutorialsfor GridView, but I am unable to understand how to read from the file and display each emoji in a cell. I have 27 emojis, so basically I want to create 27 cells in GridView and display them? </p> <p>I'd really appreciate if you can post the java class for I need for this and the layout needed.</p> http://stackoverflow.com/q/37267407 0 Shrikant Tanawade http://stackoverflow.com/users/6343784 2016-05-17T04:52:38Z 2016-05-17T04:52:38Z <p>I am facing issue with MY SQL Server, Its Service Stops automatically. Can anyone help me in this please ?</p> http://stackoverflow.com/q/37267403 0 unknown. person http://stackoverflow.com/users/5077673 2016-05-17T04:52:23Z 2016-05-17T04:52:23Z <p>I'm kinda confused in my case,</p> <pre><code>$counts="$s{$process[$count]}"; </code></pre> <p>if i echo $counts with</p> <pre><code>echo "$counts"; </code></pre> <p>it still showing the value, how can i echo $counts to show the variable name </p> <blockquote> <p>$steamroller</p> </blockquote> <p>(in this case the process is 'team', and count is 'roller')) instead of the value of the variable $system?</p> http://stackoverflow.com/q/37267360 0 Kelvin Halim http://stackoverflow.com/users/6328560 2016-05-17T04:48:14Z 2016-05-17T04:53:11Z <p>this is my controller</p> <pre><code>function change_country($id){ $this->Main_home_m->m_extend_admin_login($_COOKIE["adm_of_expire"],$_COOKIE["adm_of_login"]); $country_info = $_POST; $check_country = $this->Input_m->m_check_country($country_info); if($check_country != null){ $this->session->set_flashdata("country_message",1); }else{ $this->session->set_flashdata("country_message",2); $this->Input_m->m_update_country($id, $country_info); } } </code></pre> <p>this is my model</p> <pre><code>function m_update_country($country_id, $country_info) { $this->db->where("country_id", $country_id); $this->db->update("country", $country_info); } </code></pre> <p>this is my ajax controller</p> <pre><code>function edit_country(){ $country_id = $this->input->get("country_id"); $data["country_info"]= $this->Ajax_m->m_get_country_by_id($country_id); $this->load->view("/ADMIN/Edit_country",$data); } </code></pre> <p>this is my ajax model</p> <pre><code>function m_get_country_by_id($id) { $this->db->where("country_id", $id); $query = $this->db->get("country"); retu $query->row_array(); } </code></pre> <p>i got this following error</p> <blockquote> <p>A PHP Error was encountered<br> Severity: Waing<br> Message: Missing argument 1 for Input::change_country()<br> Filename: ADMIN/Input.php<br> Line Number: 825<br> Backtrace:<br> File: C:Data_web...applicationcontrollersADMINInput.php<br> Line: 825<br> Function: _error_handler<br> File: C:Data_web...index.php<br> Line: 292<br> Function: require_once<br> A PHP Error was encountered<br> Severity: Notice<br> Message: Undefined variable: id<br> Filename: ADMIN/Input.php<br> Line Number: 834<br> Backtrace:<br> File: C:Data_web...applicationcontrollersADMINInput.php<br> Line: 834<br> Function: _error_handler<br> File: C:Data_web...index.php<br> Line: 292<br> Function: require_once </p> </blockquote> <p>anyone can help me?</p> http://stackoverflow.com/q/37267297 2 Neeraj Purohit http://stackoverflow.com/users/2959048 2016-05-17T04:41:49Z 2016-05-17T04:53:08Z <p>I am developing an application <code>MVC 5</code> in <code>multilingual</code> and I have some functions in my <code>xyz.js</code> file, but I don't know how to get resource string in <code>.js</code> file. I have explored a lot on web but not able to find suitable answer. Please help me out for this. </p> <p>Thanks in advance.</p> http://stackoverflow.com/q/37267025 0 Kyle http://stackoverflow.com/users/3749308 2016-05-17T04:16:07Z 2016-05-17T04:52:58Z <p>I'm having some difficulty getting my database updated. Basically the user will input data into two separate places, so we get</p> <pre><code>Name | Letter | Marks ---------------------------- Dave | Null | 90 Dave | A | Null </code></pre> <p>which should become</p> <pre><code>Dave | A | 90 </code></pre> <p>However, nothing is updating. The query works perfectly when I try it in SQLite Manager, so I must be implementing cursor wrong.</p> <pre><code> public void insertData(String name, int mark_column, String marks) { String [] columns = new String[] {COL_3, COL_4, COL_5}; SQLiteDatabase db = this.getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COL_2, name); contentValues.put(columns[mark_column], marks); db.replace(TABLE_NAME, null, contentValues); //The code above works as desired String sql = "SELECT NAME, GROUP_CONCAT(LETTER, ', ') AS LETTER," + "GROUP_CONCAT(MARKS, ', ') AS MARKS FROM " + TABLE_NAME + " GROUP BY NAME"; //This query works in SQLite Manager Cursor c = db.rawQuery(sql, null); c.moveToFirst(); while(c.moveToNext()); c.close(); } </code></pre> <p>I have tried various combinations of c.moveToLast, not having c.moveToNext, etc. This method is called in onClick of an Alert Dialog.</p> <p>Any help is greatly appreciated</p> http://stackoverflow.com/q/37266968 0 alextre http://stackoverflow.com/users/6224352 2016-05-17T04:11:05Z 2016-05-17T04:53:21Z <p>web client use angularjs to access laravel web api, i use middleware as suggested from google search, code as below: middleware:</p> <pre><code>public function handle($request, Closure $next) { retu $next($request) ->header('Access-Control-Allow-Origin', $_SERVER['HTTP_ORIGIN']) // Depending of your application you can't use '*' // Some security CORS conces //->header('Access-Control-Allow-Origin', '*') ->header('Access-Control-Allow-Methods', 'POST, OPTIONS') ->header('Access-Control-Allow-Credentials', 'true') ->header('Access-Control-Max-Age', '10000') ->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With'); } </code></pre> <p>route:</p> <pre><code>Route::group(['prefix' => 'stock','middleware' =>'authapi'],function(){ Route::post('trendvote',function(){retu _index::trendVote(Input::all());});//this one report cors errors Route::post('trendindexminute',function(){retu _index::getIndexMinute(Input::all());});//this one still works fine }); </code></pre> <p>it worked fine until today it suddenly one method report cors error again h, the strange thing is that: other method which also use the same midddleware works correctly,please help , thanks in advance</p> http://stackoverflow.com/q/37266956 0 wetcoaster http://stackoverflow.com/users/5109558 2016-05-17T04:10:28Z 2016-05-17T04:53:28Z <p>I've scraped data from a source online to create a data frame (df1) with n rows of information pertaining to individuals. It comes in as a single string, and I split the words apart into appropriate columns. </p> <p>90% of the information is correctly formatted to the proper number of columns in a data frame (6) - however, once in a while there is a row of data with an extra word that is located in the spot of the 4th word from the start of the string. Those lines now have 7 columns and are off-set from everything else in the data frame. </p> <p>Here is an example: </p> <pre><code>Num Last-Name First-Name Cat. DOB Location 11 Jackson, Adam L 1982-06-15 USA 2 Pearl, Sam R 1986-11-04 UK 5 Livingston, Steph LL 1983-12-12 USA 7 Thoton, Mark LR 1982-03-26 USA 10 Silver, John RED LL 1983-09-14 USA </code></pre> <blockquote> <p>df1=c(" 11 Jackson, Adam L 1982-06-15 USA", "2 Pearl, Sam R 1986-11-04 UK", "5 Livingston, Steph LL 1983-12-12 USA", "7 Thoton, Mark LR 1982-03-26 USA", "10 Silver, John RED LL 1983-09-14 USA")</p> </blockquote> <p>You can see item #10 has an extra input added, the color "RED" is inserted into the middle of the string. </p> <p>I started to run code that used <a href="/questions/tagged/stringr" class="post-tag" title="show questions tagged 'stringr'" rel="tag">stringr</a> to evaluate how many characters were present in the 4th word, and if it was 3 or greater (every value that will be in the 'Cat.' column is is 1-2 characters), I created a new column at the end of the data frame, assigned the value to it, and if there was no value (i.e. it evaluates to FALSE), input "NA". I'm sure I could likely create a massive nested ifelse statement in a <a href="/questions/tagged/dplyr" class="post-tag" title="show questions tagged 'dplyr'" rel="tag">dplyr</a> mutate (my personal comfort zone), but I figure there must be a more efficient way to achieve my desired result: </p> <pre><code>Num Last-Name First-Name Cat. DOB Location Color 11 Jackson, Adam L 1982-06-15 USA NA 2 Pearl, Sam R 1986-11-04 UK NA 5 Livingston, Steph LL 1983-12-12 USA NA 7 Thoton, Mark LR 1982-03-26 USA NA 10 Silver, John LL 1983-09-14 USA RED </code></pre> <p>I want to find the instances where the 4th word from the start of the string is 3 characters or longer, assign that word or value to a new column at the end of the data frame, and shift the corresponding values in the row to the left to properly align with the others rows of data. </p> <p>Thanks!</p> http://stackoverflow.com/q/37266777 -3 ali_h http://stackoverflow.com/users/6343630 2016-05-17T03:51:45Z 2016-05-17T04:53:28Z <pre><code>public boolean healthy() { if(organic) { if(toppings<=3) { if((size=="small")) { retu true; } else { retu false; } } } else { retu false; } } </code></pre> <p>The program is saying that I am missing a retu statement before the last bracket. But if I were to put one there, there would always be one answer to the boolean which would be true and false. This puts all the other 'if' statements to no use which is a problem. Any help?</p> http://stackoverflow.com/q/37266637 1 Tyson Williams http://stackoverflow.com/users/741786 2016-05-17T03:35:49Z 2016-05-17T04:53:13Z <p>I want create a <code>Func</code> that is a two-argument encapsulation of the <code>base.Equals</code> method for some derived class specified at runtime. One argument of the <code>Func</code> is the instance in/on which <code>base.Equals</code> is called and the other argument of the <code>Func</code> is passed into <code>base.Equals</code>. This would be easy if the keyword <code>base</code> worked just like the keyword <code>this</code>, but it doesn't. See my failed attempt below.</p> <pre><code>using System; namespace MyNamespace { class BaseClass { } class DerivedClass : BaseClass, IEquatable<DerivedClass> { Func<DerivedClass, DerivedClass, bool> baseEquals; DerivedClass() { DerivedClass referenceToThis = this; BaseClass referenceToBase = referenceToThis.base; // doesn't compile this.baseEquals = (x, y) => x.Equals(y); } public bool Equals(DerivedClass that) => this.baseEquals(this, that); } } </code></pre> <p>Based on my current understanding of C#, I think what want to do is not allowed.</p> <blockquote> <p>Is there C# that has the same symantics as my example but is valid?</p> <p>If not, how close can one get to this example? That is, to what extent can the <code>base.Equals</code> method be encapsulated?</p> </blockquote> http://stackoverflow.com/q/37266361 1 AeyKung Taemin http://stackoverflow.com/users/5951982 2016-05-17T02:58:39Z 2016-05-17T04:52:30Z <p>I am making a table view in Swift which each cell contains a button. When a button is tapped, a popover will display on that button.</p> <p>My Problem is, no matter which cell I click the button inside, popover always display on the first cell.</p> <p>Please see attached images for more understanding.</p> <p><a href="http://i.stack.imgur.com/ZMkNt.png" rel="nofollow"><img src="http://i.stack.imgur.com/ZMkNt.png" alt="table"></a> <a href="http://i.stack.imgur.com/iNYFe.png" rel="nofollow"><img src="http://i.stack.imgur.com/iNYFe.png" alt="popover"></a></p> <p>Below is my code in tableviewcontroller class. I use tag to detect touching on the button.</p> <pre><code> override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { // Table view cells are reused and should be dequeued using a cell identifier. let cellIdentifier = "Cell01" let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as? UICell01 //when tap share button cell!.shareButton.tag = indexPath.row cell!.shareButton.addTarget(self, action: "shareAction:", forControlEvents: .TouchUpInside) retu cell! } @IBAction func shareAction(sender: UIButton) { //Create Action Sheet to be menu let alert:UIAlertController = UIAlertController(title: "Share on", message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet) let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) { UIAlertAction in } // Add the actions alert.addAction(cancelAction) // Present the controller if UIDevice.currentDevice().userInterfaceIdiom == .Phone { self.presentViewController(alert, animated: true, completion: nil) } else //iPad { var popover:UIPopoverController?=nil popover = UIPopoverController(contentViewController: alert) popover!.presentPopoverFromRect(sender.frame, inView: self.view, permittedArrowDirections: UIPopoverArrowDirection.Any, animated: true) } </code></pre> <p>I think the problem is at the last line. "sender" that is passed to function is the button in the first cell only. How do I solve the problem?</p> http://stackoverflow.com/q/37266061 0 kitlenv http://stackoverflow.com/users/2617324 2016-05-17T02:17:16Z 2016-05-17T04:52:48Z <p>I'm using Visual studio code to edit .ts files but whenever I type in { it shows a whole list of suggestions like below. When hitting enter, word 'abstract' will be inserted into the cursor location.</p> <p>What I'd expect is when typing in {, the other part of the brace, }, will be inserted into the editor as well automatically. This is what happens when typing in ( and [, but the behavior is just different when inputting {.</p> <p>Also given { is a frequently used character, so this bugs me much. Not sure if this is configurable or not. Please shed some light on it.</p> <p>triggers auto completion suggestions<br> <a href="http://i.stack.imgur.com/MDL4M.png" rel="nofollow"><img src="http://i.stack.imgur.com/MDL4M.png" alt="enter image description here"></a></p> http://stackoverflow.com/q/37265455 -2 hjh006 http://stackoverflow.com/users/6343250 2016-05-17T00:56:26Z 2016-05-17T04:53:31Z <p><a href="https://github.com/ISBX/apprtc-ios" rel="nofollow">https://github.com/ISBX/apprtc-ios</a> Since I don't have any background and knowledge on developing iOS app before... Can anyone give me a hint or solution about how I can modify the code? In our lab, they built a local kurento server, they asked me to modify the source code (link above)so that it can coect to kurento server. Now my difficulty is I don't know where and how to start. Thanks!</p> http://stackoverflow.com/q/37262626 0 puki http://stackoverflow.com/users/281615 2016-05-16T20:22:39Z 2016-05-17T04:52:28Z <p>I have an existing SQL adapter used to get some data from the DB server, a simple query that retus a language. I want to call it from an HTML page, to display the page in the language retued from the adapter. I'm trying to call it before the dojoConfig object is created because it sets the locale, that then it's used by dojo to do the inteationalization work. Is there a way to call the adapter synchronously so it executes before the dojo configuration happens? I mean to catch either the success or failure response before a dojoConfig object is created. How could i invoke it?</p> http://stackoverflow.com/q/37262526 -1 Jump Peeranut http://stackoverflow.com/users/6342472 2016-05-16T20:15:15Z 2016-05-17T04:53:02Z <p>I am trying to convert iOS application into android. But I just start leaing Java a few days ago. I'm trying to get a value from a tag inside html. </p> <p>Here is my swift code:</p> <pre><code>if let url = NSURL(string: "http://www.example.com/") { let htmlData: NSData = NSData(contentsOfURL: url)! let htmlParser = TFHpple(HTMLData: htmlData) //the value which i want to parse let nPrice = htmlParser.searchWithXPathQuery("//div[@class='round-border']/div[1]/div[2]") as NSArray let rPrice = NSMutableString() //Appending for element in nPrice { rPrice.appendString("n(element.raw)") } let raw = String(NSString(string: rPrice)) //the value without trimming let stringPrice = raw.stringByReplacingOccurrencesOfString("<[^>]+>", withString: "", options: .RegularExpressionSearch, range: nil) //result let trimPrice = stringPrice.stringByReplacingOccurrencesOfString("^\n*", withString: "", options: .RegularExpressionSearch) } </code></pre> <p>Here is my Java code using Jsoup</p> <pre><code>public class Quote extends Activity { TextView price; String tmp; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_quote); price = (TextView) findViewById(R.id.textView3); try { doc = Jsoup.coect("http://example.com/").get(); Element content = doc.getElementsByTag("//div[@class='round-border']/div[1]/div[2]"); } catch (IOException e) { //e.printStackTrace(); } } } </code></pre> <p>My problems are as following:</p> <ol> <li>I got NetworkOnMainThreatException whenever i tried any codes.</li> <li>I'm not sure that using getElementByTag with this structure is correct.</li> </ol> <p>Please help, Thanks.</p> http://stackoverflow.com/q/37259553 0 Robert P. http://stackoverflow.com/users/6341825 2016-05-16T17:16:34Z 2016-05-17T04:52:56Z <p>I configured API manager to send data to WSO2 data analytics server. </p> <p>My configuration on API server is:</p> <p>Event Receiver Configurations: {tcp://wso2-dac-svc.libre-dev.com:7611} Data Analyzer Configurations: <a href="https://wso2-dac-svc.libre-dev.com:8443" rel="nofollow">https://wso2-dac-svc.libre-dev.com:8443</a></p> <p>On DAC server I installed API_Manager_Analytics.car which has event receiver definitions.</p> <p>On API server I have imported certificate from DAC server using keytool. I restarted both servers.</p> <p>I am seeing following error in the log:</p> <pre><code>TID: [-1] [] [2016-05-16 16:06:11,417] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} - Error while coection to event receiver {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} org.wso2.carbon.databridge.commons.exception.AuthenticationException: Access denied for user admin to login TCP,wso2-dac-svc.libre-dev.com:7611,TCP,wso2-dac-svc.libre-dev.com:7711 at org.wso2.carbon.databridge.agent.thrift.inteal.publisher.authenticator.AgentAuthenticator.coect(AgentAuthenticator.java:54) at org.wso2.carbon.databridge.agent.thrift.DataPublisher.start(DataPublisher.java:273) at org.wso2.carbon.databridge.agent.thrift.DataPublisher.<init>(DataPublisher.java:161) at org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher$ReceiverCoectionWorker.run(AsyncDataPublisher.java:843) at java.util.concurrent.Executors$RuableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.wso2.carbon.databridge.agent.thrift.exception.AgentAuthenticatorException: Thrift exception at org.wso2.carbon.databridge.agent.thrift.inteal.publisher.authenticator.ThriftAgentAuthenticator.coect(ThriftAgentAuthenticator.java:51) at org.wso2.carbon.databridge.agent.thrift.inteal.publisher.authenticator.AgentAuthenticator.coect(AgentAuthenticator.java:51) ... 8 more Caused by: org.apache.thrift.transport.TTransportException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:147) at org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:163) at org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:91) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.send_coect(ThriftSecureEventTransmissionService.java:82) at org.wso2.carbon.databridge.commons.thrift.service.secure.ThriftSecureEventTransmissionService$Client.coect(ThriftSecureEventTransmissionService.java:73) at org.wso2.carbon.databridge.agent.thrift.inteal.publisher.authenticator.ThriftAgentAuthenticator.coect(ThriftAgentAuthenticator.java:47) ... 9 more Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:747) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) at org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:145) ... 15 more Caused by: sun.security.validator.ValidatorException: No trusted certificate found at sun.security.validator.SimpleValidator.buildTrustedChain(SimpleValidator.java:394) at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:133) at sun.security.validator.Validator.validate(Validator.java:260) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491) ... 23 more TID: [-1] [] [2016-05-16 16:06:41,363] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} - Recoection failed fortcp://wso2-dac-svc.libre-dev.com:7611 {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} TID: [-1] [] [2016-05-16 16:07:11,004] WARN {org.apache.synapse.core.axis2.TimeoutHandler} - Expiring message ID : u:uuid:6ed9fae5-d1fb-4cdf-885b-e101e79faf40; dropping message after timeout of : 30 seconds {org.apache.synapse.core.axis2.TimeoutHandler} TID: [-1] [] [2016-05-16 16:07:11,371] ERROR {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} - Recoection failed fortcp://wso2-dac-svc.libre-dev.com:7611 {org.wso2.carbon.databridge.agent.thrift.AsyncDataPublisher} TID: [-1] [] [2016-05-16 16:07:34,514] WARN {org.apache.synapse.transport.passthru.TargetHandler} - http-outgoing-9: Coection time out while in state: REQUEST_DONE {org.apache.synapse.transport.passthru.TargetHandler} </code></pre> <p>Basically I caot get API stats sent to DAS server. Any help is appreciated.</p> http://stackoverflow.com/q/37250333 0 AnastasiaY http://stackoverflow.com/users/4952474 2016-05-16T09:09:50Z 2016-05-17T04:52:40Z <p>I'm leaing how to create a Titanium app with the help of the lessons. Here are the steps given to create the specific view:</p> <p>To create the iOS-specific view with a NavigationController:</p> <ul> <li><p>In Project Explorer, create a new folder named ios in the app/views folder.</p></li> <li><p>Create a new file named index.xml in the new folder.</p></li> </ul> <p>But when I do those steps I get a message the a view with such name already exists not allowing me to save it. But this was somehow achieved by the author of the lesson. I would be grateful if someone could tell me how to do it. <a href="https://docs.appcelerator.com/platform/latest/#!/guide/Creating_Your_First_Titanium_App" rel="nofollow">https://docs.appcelerator.com/platform/latest/#!/guide/Creating_Your_First_Titanium_App</a></p> http://stackoverflow.com/q/37247505 -1 Vipin Kumar http://stackoverflow.com/users/6339210 2016-05-16T05:54:28Z 2016-05-17T04:53:21Z <p>I have two table first is cars and second is booking and my search fields is </p> <ul> <li>Location</li> <li>type</li> <li>pick datetime</li> <li>drop datetime</li> </ul> <p>so please let me know how to get available cars which is not booked now between a date time if car booked then it should not be in list. list should be come only available cars by search.</p> <p>Cars Table</p> <pre><code>---------------------------------------------- id | name | type | location | pincode ---------------------------------------------- 1 A plain delhi 110093 2 B plain deldi 110093 3 C plain deldi 110093 4 D plain deldi 110093 5 E plain deldi 110093 </code></pre> <h2>Booking Table</h2> <pre><code>id | car_id | user_id | pick_date | drop_date ----------------------------------------------------------------------------- 1 1 1 2016-05-10 13:00:00 2016-05-12 16:00:00 2 1 1 2016-05-12 18:00:00 2016-05-12 23:00:00 </code></pre> http://stackoverflow.com/q/37242003 1 BitFlow http://stackoverflow.com/users/6327560 2016-05-15T18:18:54Z 2016-05-17T04:52:36Z <p>I'm new to Reql and i'm trying to figure out how to transform my simple Sql request to Reql (i'm using python with rethinkdb)</p> <pre><code>Select id, min(value), max(value), avg(value) From mytable Group by id Having timestamp between '2003-12-05T15:01:00.05Z' and '2003-12-05T15:05:00.05Z' </code></pre> <p>Anyone can help ?</p> http://stackoverflow.com/q/37237614 1 Sengar http://stackoverflow.com/users/6151783 2016-05-15T11:19:28Z 2016-05-17T04:53:05Z <p>I am working on CC2650 sensortag and Bluemix(using IOT starter boilerplate) as a cloud solution. The cc2650 android app uses MqttAndroidClient to coect to MQTT server provided by bluemix. The problem I am facing after sometime (around 7 mins) it get timedout.</p> <p>Following exception is visible on the android studio console <em>d:2f7tpk:ti-sensortag2:B0B448C07886: Timed out as no activity, keepAlive=240,000 lastOutboundActivity=1,463,309,545,312 lastInboundActivity=1,463,309,275,609 time=1,463,309,785,352 lastPing=1,463,309,545,312</em></p> <p>Please note that every 10 seconds I am publishing the data to server from my android client app. So not sure why it is saying no activity. Keepalive interval is set to 120 seconds.</p> <p>I confirmed it. It is IBM Bluemix which is discoecting the client after approx 7 min. During this period client was continuously sending the data in 10 sec interval and that was also visible on the Bluemix device page.</p> <p>Any idea why Bluemix is discoecting it after 6-7 minutes (It is not fixed but out of 6 in 5 it got discoected in 7 min and once it was around 6 min).</p> <p>New observation: The other observation is once it is discoected then it takes 10-12 retries before I am able to recoect to Bluemix server. From Mqttv3 client I get the exception "Unable to coect to server". But during this period I am able to ping to server through cmdline ping utility.</p> http://stackoverflow.com/q/37218511 0 Tom Brito http://stackoverflow.com/users/287316 2016-05-13T20:04:03Z 2016-05-17T04:52:26Z <p>I need to make a link that looks exactly like a button, using jsf (and richfaces if helpful) to an exteal website.</p> <p>Most of the solutions looks like will not work for an exteal link. Or are using Primefaces (which I can't).</p> <p>I have tried:</p> <pre><code><h:button value="Go" outcome="https://wwws.exteal-site-in-new-tab.com.br/abc/def.hij?params;#{JSF_EL_param}" /> </code></pre> <p>This same link opens in a new window, using an <code><a></code> element. But does not work for the button.</p> <p>The error message I see written in the button itself, in my language, portuguese, is:</p> <blockquote> <p>"Este botão está desativado porque um caso de navegação não pôde ser correspondido"</p> </blockquote> <p>something like:</p> <blockquote> <p>This button is deactivated because a navigation case could not be matched</p> </blockquote> http://stackoverflow.com/q/37201250 -2 apadana http://stackoverflow.com/users/3769451 2016-05-13T04:26:08Z 2016-05-17T04:52:58Z <p>What is the recommended way of sending an email using gmail and python? There are a lot of SO threads, but most of them are old and it seems smtp with useame & password is not working any more or the user has to downgrade the security of their gmail (for example see <a href="http://stackoverflow.com/a/29354018/3769451">here</a>). Is OAuth the recommended way? Or maybe there are some python libraries already there that work with gmail (possibly with OAuth)? </p> <p>It would be great if one can suggest/point to a working sample code. Also I would like not to downgrade gmail security settings if at all possible. </p> http://stackoverflow.com/q/36979574 1 Armo http://stackoverflow.com/users/6280610 2016-05-02T09:53:19Z 2016-05-17T04:52:47Z <p>I am trying create a shell call for non-interactive mysql 5.7 community server installation on ubuntu 14.04. According to various sources using debconf-set-selections should allow such an installation yet I am unable to launch non-interactive dpkg installer.</p> <p>Bellow are the env variables that I am trying to use for non-interactive install</p> <pre><code>vagrant@default-ubuntu-1404:/sql$ echo $DEBIAN_FRONTEND noninteractive vagrant@default-ubuntu-1404:/sql$ echo mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7 | sudo debconf-set-selections </code></pre> <p>Here are all the mysql-apt-config settings for the system</p> <pre><code>vagrant@default-ubuntu-1404:/sql$ sudo debconf-get-selections | grep mysql mysql-apt-config mysql-apt-config/select-tools select workbench-6.2 workbench-6.3 coector-python-2.0 coector-python-2.1 router-2.0 mysql-utilities-1.5 mysql-tools mysql-apt-config mysql-apt-config/select-preview select mysql-apt-config mysql-apt-config/repo-distro select ubuntu mysql-apt-config mysql-apt-config/enable-repo select mysql-5.7 mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt/ # Choices: MySQL Server (Currently selected: mysql-5.7), MySQL Tools & Coectors (Currently selected: Enabled), MySQL Preview Packages (Currently selected: Disabled), Ok mysql-apt-config mysql-apt-config/select-product select mysql-apt-config mysql-apt-config/repo-codename select trusty mysql-apt-config mysql-apt-config/unsupported-platform select abort # Choices: mysql-5.6, mysql-5.7, None mysql-apt-config mysql-apt-config/select-server select </code></pre> <p>And the installation itself:</p> <pre><code>wget http://dev.mysql.com/get/mysql-apt-config_0.7.2-1_all.deb sudo dpkg -i mysql-apt-config_0.7.2-1_all.deb </code></pre> <p>gets launched in interactive mode. </p> <p>Any ideas?</p>
برچسب:
نویسنده: استخدام کار