most recent 30 from stackoverflow.com 2016-06-30T00:42:30Z http://stackoverflow.com/feeds/ http://www.creativecommons.org/licenses/by-sa/3.0/rdf http://stackoverflow.com/q/38112214 0 Haitam Zanid http://stackoverflow.com/users/5447084 2016-06-30T00:41:15Z 2016-06-30T00:41:15Z <p>I am sorry if i do/did something wrong here, this is my first question in this website.</p> <p>I am trying to completly exit my application (process) when a BeginCoect throws an error (mainly SocketException).</p> <p>My code right now :</p> <pre><code>try { Socket.BeginCoect(new IPEndPoint(IPAddress.Parse(ip), port), new AsyncCallback(CoectionCallBack), Socket); } catch (System.Exception ex) { OnError(new ErrorEventArgs(ex)); } </code></pre> <p>The ErrorEvent fires, and this is where i try to exit my application :</p> <pre><code>if (e.Ex is SocketException) { MessageBox.Show(LanguageManager.GetText("Erreur1")); client.Dispose(); Application.Exit(); } </code></pre> <p>But then, the debug mode is still ruing.. or if i try it without the debug mode, i find the process still there in the task manager.</p> <p>Thanks for helping !</p> http://stackoverflow.com/q/38112211 0 Muhammad Hisham http://stackoverflow.com/users/2390924 2016-06-30T00:40:27Z 2016-06-30T00:40:27Z <p>I am new in using Three JS Buffer Geometry my task is to draw Buffer Geometry Points, I have position attribute and color attribute value saved in a separate JSON file, how can I use them to populate on Buffer Geometry points? I tried FileReader function to read the JSON but its a asynchronous call. I also tried Loader of Three JS but I couldn't success. My buffer geometry code init() function loop that creates position and set color:</p> <pre><code>for ( var i = 0; i < 81; i += 3 ) { // positions //var x = i; //x,y,z need positions from json file //var y = i+1; //var z = i+3; var x = Math.random() * n - n2; var y = Math.random() * n - n2; var z = Math.random() * n - n2; positions[ i ] = x; positions[ i + 1 ] = y; positions[ i + 2 ] = z; // colors var vx = ( x / n ) + 0.5; var vy = ( y / n ) + 0.5; var vz = ( z / n ) + 0.5; color.setRGB( vx, vy, vz ); colors[ i ] = color.r; //value from json file colors[ i + 1 ] = color.g; colors[ i + 2 ] = color.b; } </code></pre> http://stackoverflow.com/q/38112209 0 johnborges http://stackoverflow.com/users/916067 2016-06-30T00:39:53Z 2016-06-30T00:39:53Z <p>I'm struggling getting a simple image to load via Phaser.Loader. Following the example <a href="https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates/Responsive" rel="nofollow">here</a>. I keep getting the following error:</p> <p><a href="http://i.stack.imgur.com/oQU8r.png" rel="nofollow"><img src="http://i.stack.imgur.com/oQU8r.png" alt="enter image description here"></a></p> <p><a href="http://i.stack.imgur.com/Wa2JN.png" rel="nofollow"><img src="http://i.stack.imgur.com/Wa2JN.png" alt="enter image description here"></a></p> <p>Whats strange is that looking at the network tab in Chrome shows these resources loading fine. Any ideas?</p> http://stackoverflow.com/q/38112208 0 Calvin Custódio http://stackoverflow.com/users/6246272 2016-06-30T00:39:36Z 2016-06-30T00:39:36Z <p>I'm struggling to find meaning on building a RPM spec file. I need to create rpm packages for my new system, however, i need to understand how it really works. I've tried reading RPM documentation, however, it hasn't helped much. I don't understand the "make build". First of all, i have a php file which i would like to be run while being installed as a RPM package. How could i do that? I don't understand much of shell script. I've noticed that in the %build section i need to use some scripts. I understood that when we install RPM, it builds a few dir like SPEC BUILD SOURCES and etc. I know i need to use a tar file to be compiled inside a RPM. I'm kinda lost. Could anybody help me out ?</p> http://stackoverflow.com/q/38112203 0 Omade http://stackoverflow.com/users/2650535 2016-06-30T00:38:54Z 2016-06-30T00:38:54Z <p>I am new to Java! I am trying to create a control panel in Java, that will be populated via xml that will include sliding a slider to "off" and this will rename bgl files to off. Sliding the slider to on will rename the file back to bgl. I have only tried locking but I am ashamed of my codes as I am leaing and I really want to lea. I am totally lost!</p> <pre><code>package turbulent_Control_Panel; import java.io.FileOutputStream; import java.io.IOException; import java.nio.chaels.FileLock; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; public class FSControlPanel { /** * @param args */ public static void main(String[] args) { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder dBuilder = builderFactory.newDocumentBuilder(); Document document = dBuilder.parse("Settings.xml"); document.normalize(); NodeList rootNodes = document.getElementsByTagName("Window"); Node rootNode = rootNodes.item(0); Element rootElement = (Element) rootNode; NodeList windowList = rootElement.getElementsByTagName("Tabs"); for(int i = 0; i < windowList.getLength(); i++){ Node theWindow = windowList.item(i); Element TabsElement = (Element) theWindow; System.out.println("This window is for " + TabsElement.getAttribute("Accent")); } } catch (ParserConfigurationException e) { e.printStackTrace(); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } FileOutputStream lockFile = new FileOutputStream("Setting.bgl"); FileLock chael = lockFile.getChael().tryLock(); if(chael != null){ System.out.println("Locked File"); Thread.sleep(10000); chael.release(); System.out.println("Realease Lock"); } lockFile.close(); } </code></pre> http://stackoverflow.com/q/38112116 0 Phillip http://stackoverflow.com/users/1781710 2016-06-30T00:25:01Z 2016-06-30T00:42:16Z <p>I have a <code>messageService</code> class that I'm instantiating like this:</p> <pre><code>require_once("./classes/messageService.class.php"); $messageService = new messageService(); </code></pre> <p>THEN</p> <p>I want to use the <code>$messageService</code> object in my <code>__autoload</code> method which looks like this:</p> <pre><code>function __autoload($className) { $fileName = "./classes/" . $className . ".class.php"; require_once($fileName); $messageService->logNotice("Loaded File: " . $filename); } </code></pre> <p>BUT</p> <p>When I run the code I'm getting:</p> <blockquote> <p>Notice: Undefined variable: messageService iin /var/www/html/beta.gmtools/api/index.php on line 17</p> <p>Fatal error: Call to a member function logNotice() on null in /var/www/html/beta.gmtools/api/index.php on line 17</p> </blockquote> <p>Which I'm assuming is because <code>$messageService</code> isn't in scope?</p> <p>How can I resolve this?</p> http://stackoverflow.com/q/38112084 0 mtagius http://stackoverflow.com/users/6530877 2016-06-30T00:20:37Z 2016-06-30T00:41:53Z <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/750486/javascript-closure-inside-loops-simple-practical-example" dir="ltr">JavaScript closure inside loops – simple practical example</a> <span class="question-originals-answer-count"> 23 answers </span> </li> </ul> </div> <p>The problem is that when I create page number buttons at the bottom of the page the onclick only ever works with the last element created. </p> <p>Here is what the page buttons look like:</p> <p><a href="http://i.stack.imgur.com/wHwI0.png" rel="nofollow"><img src="http://i.stack.imgur.com/wHwI0.png" alt="Here is what the page buttons look like"></a></p> <pre><code> for(var i = 0; i < numberOfPages; i++) { if(Math.floor((((startIndex + 1) / 10) + 1)) == (i + 1)) { var newElement = document.createElement("u"); document.getElementById("imagesNav").appendChild(newElement); newElement.id = "imagesNavU"; var newElement = document.createElement("a"); document.getElementById("imagesNavU").appendChild(newElement); var str = "page" + (i + 1); newElement.ierHTML = i + 1; newElement.onclick=function(){currentPageNumber(str);}; } else { var newElement = document.createElement("a"); document.getElementById("imagesNav").appendChild(newElement); var str = "page" + (i + 1); newElement.ierHTML = i + 1; newElement.onclick=function(){currentPageNumber(str);}; } if(i + 1 != numberOfPages) { document.getElementById("imagesNav").ierHTML += "&nbsp;&nbsp;"; } } } </code></pre> <p>The first if statement just puts underline tags on if that element is the current page. </p> http://stackoverflow.com/q/38112021 -8 Balaji http://stackoverflow.com/users/5089988 2016-06-30T00:09:29Z 2016-06-30T00:42:05Z <p>I have an array like this</p> <pre><code>Id values 111 abc 111 bcd 123 def 123 abc </code></pre> <p>I want to group the above from one to many to array like below </p> <pre><code>111 {abc,bcd} 123 {def,abc} </code></pre> <p>kindly help in this regard</p> http://stackoverflow.com/q/38111915 0 Jus http://stackoverflow.com/users/5843309 2016-06-29T23:56:02Z 2016-06-30T00:38:42Z <p>I have a python script that I want to execute when a button is clicked. When I run the python script, basically, one would enter x and y, and z would be displayed or retued. </p> <p>I would like this to be retued when button is clicked. For some reason, ruing php file.php doesn't retu anything on screen either. </p> <p>What needs to be modified on html side and php side to get it to work?</p> <pre><code><!DOCTYPE html> <html> <body> <button type="submit" id="script-button"> Run the script </button> <script> function runScript() { var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { if (request.status === 200) { alert('Ran the script, result was ' + request.responseText); } else { alert('Something went wrong, status was ' + request.status); } } }; request.open('POST', '/this.php', true); request.send(null); retu false; // Prevent the default button action }; document.getElementById('script-button').onclick = runScript; </script> </body> </html> </code></pre> <p>php</p> <pre><code><?php echo shell_exec("/usr/bin/python /pythonfile.py"); ?> </code></pre> http://stackoverflow.com/q/38111555 0 Aaron M http://stackoverflow.com/users/2495888 2016-06-29T23:13:10Z 2016-06-30T00:42:03Z <p>I found this <a href="http://stackoverflow.com/questions/37365041/f-json-parsing-how-to-get-property-using-complex-path-consisting-of-several">F# JSON parsing - How to get property using complex path (consisting of several propery names)</a> (I shortened the file string). I am wondering how to show the actual data from the json file in the FSI window?</p> <pre><code>let soilTest = JsonValue.Load("c:\,,,soiltest.json") let query soilTest= let node = JObject.Parse soilTest node.SelectToken "person[0].name" |> string </code></pre> <p>Here is the begiing of the json file:</p> <pre><code> { "person": [ { "name": "John Doe", "date": "December 1, 2015", ..... </code></pre> <p>I looked at the link that Mark Seema provided to see how to get the data out of the json file and be shown in the console.<br> However when putting </p> <pre><code>Console.WriteLine(name) </code></pre> <p>I get this waing:</p> <pre><code> waing FS0020: This expression should have type 'unit', but has type 'string'. Use 'ignore' to discard the result of the expression, or 'let' to bind the result to a name. val query : soilTest:string -> unit </code></pre> <p>Tried |>ignore at the end of console.writeline and I get val query : soulTest:string -> unit</p> <p>How do you do a let statement from this point to bind the data to it?</p> http://stackoverflow.com/q/38111539 0 sol http://stackoverflow.com/users/6342399 2016-06-29T23:11:51Z 2016-06-30T00:41:30Z <p>In the program you enter with a useame brought from a database. I need to pass that useame to another form but when I do it, it retus null in the second form although in the first form it appears.( "Jugador" is the class from where I bring the name).</p> <pre><code> public Usuario() { InitializeComponent(); } private string _Message; public string Message { get { retu _Message; } set { _Message = strName; } } public string strName; private void button1_Click(object sender, EventArgs e) { if (textBox1.Text!="") { Jugador jug = new Jugador(); jug.Traemelo(textBox1.Text); strName = textBox1.Text; elegirTipo us = new elegirTipo(); us.Show(); this.Hide(); } } } </code></pre> <p>}</p> <p>And in my other form i have this.(Usuario is the first form)</p> <pre><code> private void silabas_Load(object sender, EventArgs e) { Usuario usu = new Usuario(); juga.Traemelo(usu.Message); } </code></pre> <p>I've got to add that in the middle of these forms I pass by one but doens't need the variable there. Thanks for the help! I really don't know what is happening because I've done this other times.</p> http://stackoverflow.com/q/38111391 0 SimplGy http://stackoverflow.com/users/111243 2016-06-29T22:58:44Z 2016-06-30T00:41:16Z <p>That's the question, straight-forward as that.</p> <pre><code>let serial = DispatchQueue(label: "serial", attributes: .serial) let concurrent = DispatchQueue(label: "concurrent", attributes: .concurrent) let q = DispatchQueue(label: "q") </code></pre> <p>I see no property I can inspect on <code>q</code> that will tell me.</p> <p>Ruing in playground with <code>PlaygroundPage.current.needsIndefiniteExecution = true</code> shows serial behavior, but I don't want to rely on playground (kind of janky with async stuff), or undocumented behavior.</p> <p>Can anyone offer a hard answer with a link to documentation?</p> http://stackoverflow.com/q/38111145 2 Grigori http://stackoverflow.com/users/4435471 2016-06-29T22:34:36Z 2016-06-30T00:40:31Z <p>I have a series of pages named "page-1" "page-2" "page-3" ..."page-99". Is there a way to make a navigation so that whenever I click the "next" button it goes to the next page, and if I click "previous" it will go to the previous page depending on what the current page number is. I was wondering if there is a javascript solution to this since I have never used PHP.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code><a href="#" id="next">next</a> <!--it will go to page-3--> <a href="#" id="prev">previous</a> <!--it will go to page-1--></code></pre> </div> </div> </p> http://stackoverflow.com/q/38110906 0 Andres Arciniegas http://stackoverflow.com/users/2712773 2016-06-29T22:12:10Z 2016-06-30T00:41:08Z <p>Is there a way to attach a UITextField inside inside the range of an NSAttributedString that is inside a UITextView? </p> <p>I want to recreate something like this:</p> <p><a href="http://i.stack.imgur.com/iNHKa.png" rel="nofollow"><img src="http://i.stack.imgur.com/iNHKa.png" alt="enter image description here"></a></p> <p>Where the user would be able to press the empty lines to type text.</p> http://stackoverflow.com/q/38109621 -1 El Mestre http://stackoverflow.com/users/6529587 2016-06-29T20:37:58Z 2016-06-30T00:40:11Z <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/21982987/mean-per-group-in-a-data-frame" dir="ltr">Mean per group in a data.frame</a> <span class="question-originals-answer-count"> 8 answers </span> </li> </ul> </div> <p>I want a data file as follows:</p> <pre><code>barrier mode t S joual 19884 S joual 22164 N joual 22414 N joual 22127 S ordered 22005 S ordered 25179 N ordered 20522 N ordered 21486 S writeback 23084 S writeback 27305 N writeback 26462 N writeback 23048 </code></pre> <p>I want to plot it on a bar chart where each bar will be a mode and its respective parameter barrier. Ie, mean (t for joual / S), mean (t for joual / N), mean (t is ordered / S), mean (t is ordered / N), mean (t is writeback / S), mean ( t is writeback / N).</p> <p>What I have: <code>barchart (t~mode, data = dadosW, groups = barrier, XLAB = "Mode", ylab = "t (KB / s)", main = "Random Write (Simple mean)," col = c ( "Darkblue", "Red"), scales = list (x = list (rot = 50, cex = 0.8)))</code>. But I know it just plot the values and not the mean of values.</p> <p>It is different to <a href="http://stackoverflow.com/questions/21982987/mean-per-group-in-a-data-frame">Mean per group in a data.frame</a> because I want to plot these data, not just show like text with aggregate function. How to make a graphic with it? I know use aggregate function (<code>mediaW <- aggregate(dadosW$t, list(dadosW$mode, dadosW$barrier), mean)</code>), but how to use it in <code>barchart</code>?</p> http://stackoverflow.com/q/38106808 0 awulll http://stackoverflow.com/users/1428655 2016-06-29T17:51:50Z 2016-06-30T00:39:22Z <p>I have a list of variables with unicode characters, some of them for chemicals like Ozone gas: like 'Ou2083'. All of them are stored in a sqlite database which is read in a Python code to produce O<sub>3</sub>. However, when I read I get 'Ou2083'. The sqlite database is created using an csv file that contains the string 'Ou2083' among others. I understand that u2083 is not being stored in sqlite database as unicode character but as 6 unicode characters (which would be u,,2,0,8,3). Is there any way to recognize unicode characters in this context? Now my first option to solve it is to create a function to recognize set of characters and replace for unicode characters. Is there anything like this already implemented? </p> http://stackoverflow.com/q/38102924 0 ticster http://stackoverflow.com/users/1095969 2016-06-29T14:42:26Z 2016-06-30T00:42:02Z <p>I'm currently using celery and rabbitmq for a website backend. For a number of reasons, the project has decided to forgo the use of SSL. I'd therefore like to change my celery configuration from something like this :</p> <pre><code>celery_app.conf.BROKER_USE_SSL = { 'ca_certs': '/some/path/root-cert.pem', 'keyfile': '/some/path/rabbitmq-client.key', 'certfile': '/some/path/rabbitmq-client.pem', 'cert_reqs': ssl.CERT_REQUIRED } </code></pre> <p>To something like this :</p> <pre><code>celery_app.conf.BROKER_USE_SSL = False </code></pre> <p>As far as I can tell this is the default value, so either Idea out or deleting the first chunk of code should do it. However, when actually sending the task (using <code>from celery.execute import send_task</code>) after setting <code>BROKER_USE_SSL</code> to <code>False</code>, I get the following error :</p> <pre><code>socket.error: [Ero 104] Coection reset by peer </code></pre> <p>Does rabbitmq need to be told in some other way that I don't care about certification anymore ?</p> <p>Note that this is about using SSL with rabbitmq, as celery itself still uses a key certificate pair and this is working just fine :</p> <pre><code>CELERY_SECURITY_KEY = '/some/path/celery.key' CELERY_SECURITY_CERTIFICATE = '/some/path/celery.pem' </code></pre> <p>I'm guessing I also need to change the <code>verify</code> entry in my <code>rabbitmq.config</code> yet any changes done to this file seem to have no impact whatsoever. How can I tell which config file is being used and make sure it's actually being read ?</p> http://stackoverflow.com/q/38102736 0 Grant Cates http://stackoverflow.com/users/6528938 2016-06-29T14:33:48Z 2016-06-30T00:39:42Z <p>I am attempting to import a file that is created with a Fortran program that includes four columns: Atomic Symbol, X Position, Y Position, Z Position. Here's an example of input file:</p> <pre><code>Zn 0.00000000000 0.00000000000 0.00000000000 Zn 0.00000000000 0.00000000000 0.25000000000 Zn 0.00000000000 0.00000000000 0.50000000000 Zn 0.00000000000 0.00000000000 0.75000000000 Zn 0.00000000000 0.05000000000 0.00000000000 Zn 0.00000000000 0.05000000000 0.25000000000 Zn 0.00000000000 0.05000000000 0.50000000000 Zn 0.00000000000 0.05000000000 0.75000000000 </code></pre> <p>Now, if I import this in excel and export as a CSV file and then use csvread(filename), an error is produced, presumable because the first column has character inputs. (I'm sure there is a way to import tab delimited files directly without this intermediary step, but I've been using this method.)</p> <p>Things I've tried:</p> <ol> <li>Removing the first column before importing into MATLAB. The problem with this is I will be dealing with compounds that have multiple atom types, and I want to be able to keep track of them.</li> <li>I know I can use double(variable) and char(variable) to translate from characters to a numeric array, but I still need to be able to import the file before I change the first column to a numeric array.</li> </ol> <p>I appreciate any suggestions.</p> http://stackoverflow.com/q/38100767 0 Joseph Yourine http://stackoverflow.com/users/5714774 2016-06-29T13:17:26Z 2016-06-30T00:39:31Z <p>I'm new to the appengine and I miss something about the Parent-Children relationship. And of course documentation is as always very light...</p> <p>I defined this</p> <pre><code>@Entity public class StockRow { @Parent Key<StockTable> table; @Id Long id; Long quantity; String status; String type; String table; private StockRow () {} public StockRow (String tableName, com.google.appengine.api.datastore.Entity queryResult) { id = queryResult.getKey().getId(); quantity = (Long) queryResult.getProperty("quantity"); status = (String) queryResult.getProperty("status"); type = (String) queryResult.getProperty("stock-name"); table = StockTable = Key.create(StockTable.class, tableName); } } </code></pre> <p>(I supress the getters for here)</p> <p>This is the Children : a row.</p> <p>Then the Parent</p> <pre><code>@Entity public class StockTable { @Id public String table; private StockTable () {} } </code></pre> <p>Pretty simple.</p> <p>I have two questions about this :</p> <p>I want to have a table of several rows. A table contains rows with the same id. So the ID of Stocktable is the ID shared by all its rows.</p> <p>1) Is it the correct way to do ?</p> <p>StockRow s must be entities because I query them from Datastore. Maybe it's Container but I do not understand it...</p> <p>Or maybe it's useless to define a parent ?</p> <p>2) How to load all the children for a given id ?</p> <p>I read this on Objectif wiki but the purpose of this query is not very clear :</p> <pre><code>Thing th = ofy().load().type(Thing.class).parent(par).id(123L).now(); </code></pre> <p>I don't know what is inside <code>par</code> first and secondly I have the impression that this load is not what I want.</p> <p>Thanks !</p> http://stackoverflow.com/q/38093319 0 user1253749 http://stackoverflow.com/users/1253749 2016-06-29T07:43:52Z 2016-06-30T00:41:56Z <p>I copied my wordress site to an AWS instance. My home page is working fine, but the pages are not working properly. It is giving me a 404 error.</p> <p>Not Found</p> <p>The requested URL /some-page/ was not found on this server.</p> <p>Apache/2.2.31 (Amazon) Server at example.com Port 80</p> <p>Does anyone know why this is?</p> http://stackoverflow.com/q/38089523 1 Chris Wu http://stackoverflow.com/users/2677047 2016-06-29T02:47:20Z 2016-06-30T00:39:32Z <p>I'm hitting a problem where my Linux CentOS 7 does not compile .NET CORE 1.0 code from <a href="https://github.com/Azure-Samples/power-bi-embedded-iframe/blob/master/PBIEmbedded/PowerBIToken.cs#L144" rel="nofollow">https://github.com/Azure-Samples/power-bi-embedded-iframe/blob/master/PBIEmbedded/PowerBIToken.cs#L144</a></p> <p>This class won't compile on .NET Core 1.0 because SigningCredentials used in sample code is from .NET 4.0. <a href="http://i.stack.imgur.com/EnAZU.png" rel="nofollow"><img src="http://i.stack.imgur.com/EnAZU.png" alt="CentOS 7 .NET Core 1.0"></a></p> <p>I managed to compile the code like Nate Barbettini suggested, plus you have to hash the accessKey first:</p> <pre><code> var key = Encoding.UTF8.GetBytes(accessKey); var digest = SHA256.Create(); var hashKey = digest.ComputeHash(key); var signingCredentials = new Microsoft.IdentityModel.Tokens.SigningCredentials(new Microsoft.IdentityModel.Tokens.SymmetricSecurityKey(hashKey), "HS256"); var token = new JwtSecurityToken(this.Issuer, this.Audience, this.Claims, DateTime.UtcNow, this.Expiration, signingCredentials); </code></pre> <p>But the PowerBI API Calls keep throwing 'Forbidden' error.</p> <p>This is the correct token generated by Microsoft PowerBI library:</p> <pre><code> eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXIiOiIwLjEuMCIsInR5cGUiOiJkZXYiLCJ3Y24iOiJCSS1QVC1ERVYiLCJ3aWQiOiJkOTVjNzJhZi1iMGU5LTQ0M2UtYjZmNy0xY2U2MmYwNDZhMjciLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTQ2NzI0NzAwNywibmJmIjoxNDY3MjQzNDA3fQ.wMrZBAvcpydS2J2CtDhBpQlVU92f_lWNmaFTnhmQSx8 </code></pre> <p>This is the one I got:</p> <pre><code>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXIiOiIwLjEuMCIsInR5cGUiOiJkZXYiLCJ3Y24iOiJCSS1QVC1ERVYiLCJ3aWQiOiJkOTVjNzJhZi1iMGU5LTQ0M2UtYjZmNy0xY2U2MmYwNDZhMjciLCJuYmYiOjE0NjcyNDcwMTcsImV4cCI6MTQ2NzI1MDYxNiwiaXNzIjoiUG93ZXJCSVNESyIsImF1ZCI6Imh0dHBzOi8vYW5hbHlzaXMud2luZG93cy5uZXQvcG93ZXJiaS9hcGkifQ.MvmhURpnbHNFs1ux5SNT_7kZ05dIgHQHnhTpG91Zx7w </code></pre> <p>You can compare the two at : <a href="https://jwt.io/" rel="nofollow">https://jwt.io/</a> They are both valid, but my token is not being accepted.</p> http://stackoverflow.com/q/38088966 0 Juan Mier http://stackoverflow.com/users/1135230 2016-06-29T01:46:28Z 2016-06-30T00:41:03Z <p>I want to explore the directlabels package with ggplot. I am trying to plot labels at the endpoint of a simple line chart; however, the labels are clipped by the plot panel. </p> <p>I would imagine there may be another solution using <code>aotate</code> or some other geoms. But I would like to solve with directlabels. Please see code and image below. Thanks. </p> <pre><code>#generate data frame with random data, for illustration and plot: x <- seq(1:100) y <- cumsum(orm(n = 100, mean = 6, sd = 15)) y2 <- cumsum(orm(n = 100, mean = 2, sd = 4)) data <- as.data.frame(cbind(x, y, y2)) names(data) <- c("month", "stocks", "bonds") tidy_data <- gather(data, month) names(tidy_data) <- c("month", "asset", "value") p <- ggplot(tidy_data, aes(x = month, y = value, colour = asset)) + geom_line() + geom_dl(aes(colour = asset, label = asset), method = "last.points") + theme_bw() </code></pre> <p><a href="http://i.stack.imgur.com/gOmg5.png" rel="nofollow"><img src="http://i.stack.imgur.com/gOmg5.png" alt="line chart with end labels"></a></p> <p>Thanks Nick (for the response below). Your solution with <code>xlim</code> works. </p> <p>However, I think it on data visualization principle I would like to avoid extending the x-axis to make the labels fit--this would mean having data space with no data. Rather, I would like the labels to extend toward the white space beyond the chart box/panel (if that makes sense). </p> <p>For added context, I intend to plot a about 10 financial time series in one plot and I thought directlabels would be the best solution, no? </p> http://stackoverflow.com/q/38030266 0 Ben L http://stackoverflow.com/users/5600726 2016-06-25T15:57:27Z 2016-06-30T00:42:06Z <p>If I've understood correctly, most common port scaing method is using TCP Syns and waiting for an ack packet from each port.</p> <p>How does it work when a port only receives UDP packets? (UDP DNS servers, for instance) Will the port answer as well?</p> <p>Another minor question: Why, when port scaing 8.8.8.8, I see that 53 is a TCP DNS port and not UDP?</p> <p>Thanks in advance!</p> http://stackoverflow.com/q/38020595 3 Splaktar http://stackoverflow.com/users/633107 2016-06-24T19:14:56Z 2016-06-30T00:39:33Z <p>So I’m testing out the CLI today and <code>firebase init</code> with db/hosting selected, and choosing to create a new project, always says <code>Error: Permission denied.</code>. </p> <p><code>sudo firebase init</code> didn’t help. </p> <p><code>firebase-tools</code> version <code>3.0.3</code> on OS X 10.11.5.</p> <pre><code>firebase init You're about to initialize a Firebase project in this directory: /Users/splaktar/Git/tmp Before we get started, keep in mind: * You are initializing in an existing Firebase project directory ? What Firebase CLI features do you want to setup for this folder? Database: Deploy Firebase Realtime Database Rules === Project Setup First, let's associate this project directory with a Firebase project. You can create multiple project aliases by ruing firebase use --add, but for now we'll just set up a default project. ? What Firebase project do you want to associate as default? [don't setup a default project] === Database Setup Firebase Realtime Database Rules allow you to define how your data should be structured and when your data can be read from and written to. ? What file should be used for Database Rules? database.rules.json Error: Permission denied. </code></pre> <p>I've tried the answers <a href="http://stackoverflow.com/q/37309852/633107">here</a> but they did not help. Is this just a bug in the <code>firebase-tools</code>?</p> http://stackoverflow.com/q/37999843 0 user99999 http://stackoverflow.com/users/5479258 2016-06-23T19:06:54Z 2016-06-30T00:41:01Z <p>I have the following variables:</p> <pre><code>var foo int8 var bar [5]int8 </code></pre> <p>I want to count number of bytes in both variables and output the sum - so right here it should be <code>1 + 5 = 6</code>. Is this possible?</p> http://stackoverflow.com/q/37929095 -2 Ehsan http://stackoverflow.com/users/6490533 2016-06-20T18:10:21Z 2016-06-30T00:40:16Z <p>I am trying to decompile one of our old source codes which had been developed in .Net 1.1. I have tried couple of different decompiler tools but none of them were able to give me a good result which I can compile them. usually there are parts of code which have lots of errors in .Net 1.1 but it is fine code in 2.0 or later. So I am assuming they decompile to newer version of .Net than 1.1. Tools that I have already used are: Reflector, dotPeek, CodeReflect and some more. I need a tool which can decompile in 1.1 and I would be able to compile the same code in 1.1, it doesn't need to be free tool but I need to be able to save the code from it so I can compile it.</p> <p>Thanks,</p> http://stackoverflow.com/q/36160454 0 Cristian http://stackoverflow.com/users/6099973 2016-03-22T16:49:39Z 2016-06-30T00:41:14Z <p>I'm trying to install <a href="https://magento.com/developers/magento2" rel="nofollow">Magento 2</a> on my MAMP PRO but I receive this error from composer:</p> <pre><code>*Your requirements could not be resolved to an installable set of packages. Problem 1 - magento/framework 100.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - magento/framework 100.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - Installation request for magento/framework 100.0.4 -> satisfiable by magento/framework[100.0.4].* </code></pre> <p>But mcrypt is install in my MAMP:</p> <p><a href="http://i.stack.imgur.com/X2kvw.png" rel="nofollow">Screenshot of <code>phpinfo()</code> in my MAMP environment</a></p> <p>I tried adding the php version to <code>.bash_profile</code> file but it didn't resolve:</p> <pre><code>export MAMP_PHP=/Applications/MAMP/bin/php/php5.5.10/bin export PATH="$MAMP_PHP:$PATH" </code></pre> <p>I try ruing php -i | grep mcrypt this is the result: ~/Sites/magento2 $ php -i | grep mcrypt</p> <p>Configure Command => './configure' '--with-mysql=mysqlnd' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-zlib-dir=/Applications/MAMP/Library' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.6.10' '--exec-prefix=/Applications/MAMP/bin/php/php5.6.10' '--sysconfdir=/Applications/MAMP/bin/php/php5.6.10/conf' '--with-config-file-path=/Applications/MAMP/bin/php/php5.6.10/conf' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=mysqlnd' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007f' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library' '--enable-opcache' '--enable-cgi' '--enable-intl' '--with-icu-dir=/Applications/MAMP/Library' '--with-tidy=shared' '--enable-wddx' '--with-libexpat-dir=/Applications/MAMP/Library' '--with-readline' 'CFLAGS=-arch 'LDFLAGS=-arch 'LIBS=-lresolv' 'CXXFLAGS=-arch Registered Stream Filters => zlib.<em>, bzip2.</em>, convert.iconv.<em>, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.</em>, consumed, dechunk, mcrypt.<em>, mdecrypt.</em></p> <pre><code>mcrypt mcrypt support => enabled mcrypt_filter support => enabled mcrypt.algorithms_dir => no value => no value mcrypt.modes_dir => no value => no value </code></pre> http://stackoverflow.com/q/34702296 1 RoCk http://stackoverflow.com/users/5634470 2016-01-10T05:10:50Z 2016-06-30T00:39:28Z <p>Good day, can you help me? I like to capture/record the behavior of my android app, ruing on a emulator and make gif image out it. Just like this one - </p> <p><a href="http://i.stack.imgur.com/VAGMd.gif" rel="nofollow"><img src="http://i.stack.imgur.com/VAGMd.gif" alt="enter image description here"></a></p> <p>How can I make this one? coz, I need this to submit as part of my report. What third party software that can make this possible?</p> <p>Many Thanks in Advance. </p> http://stackoverflow.com/q/29190684 3 Liam de Haas http://stackoverflow.com/users/1909728 2015-03-22T03:36:45Z 2016-06-30T00:41:17Z <p>I have a <code>byte[] bytes</code> from a <code>ByteBuffer</code> which contains a packet. I want to put the packet in a <code>String</code>.</p> <p>Currently I have the following</p> <pre><code> byte[] bytes = packet.array(); System.out.println("Packet String:" + new String(bytes)); </code></pre> <p>But then I end up with the following output</p> <pre><code>Packet String:E����<Ҧ@��@�. 03-22 04:30:28.187 9296-10152/willem.com.vpn I/System.out﹕ ����J}�j���k�:����������9������� 03-22 04:30:28.197 9296-10152/willem.com.vpn I/System.out﹕ ��&�4��������ddrarpa�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� </code></pre> <p>I've tried it with encoding like this</p> <pre><code>System.out.println("Packet String:" + new String(bytes, Charset.forName("UTF-8"))); </code></pre> <p>But that isn't the right charset. Can anybody tell me what is?</p> http://stackoverflow.com/q/1283085 26 Lyubomyr Dutko http://stackoverflow.com/users/139394 2009-08-15T23:07:09Z 2016-06-30T00:39:29Z <p>I am trying to set padding in a <code><shape></code> declared within an XML file/layout. But whatever I set, nothing changes related to padding. If I modify any other properties, I see the effects on the UI. But it doesn't work with padding. Could you please advise on the possible reasons for which this might occur?</p> <p>Here is the XML Shape I am trying to style:</p> <pre><code><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <stroke android:width="1dp" android:color="#ffffff" android:dashWidth="2dp" /> <solid android:color="@color/button_white_cover" /> <coers android:radius="11dp" /> <padding android:left="1dp" android:top="20dp" android:right="20dp" android:bottom="2dp" /> </shape> </code></pre>
برچسب:
نویسنده: استخدام کار