Vote count: 0 I am writing a cypher and I've assigned numerical values to every letter in the alphabet, alphabet_dictionary = {'a': 0, 'b': 1, 'c': 2,... etc.}. I first convert the letter in message to numbers and do some arithmetic on them and store those numbers in a variable named code, but then I want to convert them back to letters, how do I go about doing that? so far this is what I have: for number in code: for letter, value in alphabet_dictionary.items(): if value == number: coded_message.append(letter) this actually works, I end up with a the correct coded message inside my coded_message list. But I am wondering if there is something better or more efficient I can do. ps: If you cou...
ادامه مطلبVote count: 0 I have a problem that I just caot figure out on my own. This is the issue. I'm making a website that is using javascript to make the website write out things as you type on your keyboard using JS. As you're 'writing' this text I would like your location to be shown, making the illusion that you're the actual person writing. I solved this problem by calling the IP adress and translating it to a city and country using google maps or something like that. The issue now is to get this to 'write it out' as actual text. Take a look at this fiddle - http://codepen.io/anon/pen/RagdVB Hello, I am viewing this page from unknown location. In this example you can see how its supposed to be,...
ادامه مطلبVote count: 0 I need to make the function so that it calculate the area when I enter function f and coefficients a, b and n on the command line. For now I have this: module.exports = function (f,a,b,n,next) { parseFloat(a); parseFloat(b); parseInt(n); var h = (b-a)/n; var s = 0; var suma = function () { for (var i = 0; i...
ادامه مطلبVote count: 0 How can i post a custom JSON Message with formatting & indented using slack webhook? I am using nodejs app var Slack = require('slack-node'); var JsonMessage = process.argv[2]; webhookUri = "https://hooks.slack.com/services/XXXX/xxxx/xxxxxxxx"; slack = new Slack(); slack.setWebhook(webhookUri); var textmsg = '```' + JsonMessage + '```'; slack.webhook({ chael: "#status", useame: "Monitor Bot", icon_emoji: ":ghost:", text: textmsg }, function(err, response) { console.log(response); }); The above code helps to send the JSON but it is not in formatted one. It comes as a string. I would like to have the JSON indented. Thank you. asked 8 mins agokrckumar Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I need to pass the id parameter from task.jsp to edit.jsp. I tried using the set and get parameter with input type as hidden, but was unable to get the id in the edit.jsp This is a part of my task.jsp page Click here to add a new task function editAction(item) { int id = item.id; document.getElementById("id").value = id; document.form.action = "edit.jsp"; document.form.submit(); console.log(item.id); } function deleteAction(item) { console.log(item.id); } This is the error I get in my console when I click on the edit button - ReferenceError: editAction is not defined How do I pass the parameter from task.jsp and get it is edit.jsp asked 2 mins agoShashi Kiran Let's block ads! ب...
ادامه مطلبVote count: 0 This authorization code has been used error retued when refreshing the page after login using facebook id. I have read many blogs and I did not get any idea about this issue. Here is my code. fblogin.php...
ادامه مطلبVote count: 0 I want to generate proxy for one of the wcf service of 3rd party but the problem is that the WSDl url that I have required authentication which I can't provide using SVCUTIL. One link suggested to copy the WSDL to your local and pass the path of WSDL using svcutil. I copy WSDL and save the file in xml format. I tried command svcutil [path of my WSDL] on Visual Studio Command Prompt but this gives me below errors: Error: An error occurred in the tool. Error: Access to the path 'C:UsersuseameMy Documents' is denied Can anyone please help me to come out of this issue. Thanks In Advance. asked 2 mins agoGarvit Gupta Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a long pipeline of shaders in WebGL, where each shader reads from an input texture, renders to another texture, and by the end the last texture contains the desired result. Can I reuse textures in the pipeline, as if it was ruing synchronously? // ... init texA to contain input ... shader1.samplingFrom(texA).renderTo(texB); shader2.samplingFrom(texB).renderTo(texA); shader3.samplingFrom(texA).renderTo(texB); retu readPixels(texB); // Always the same answer? For that matter, can I even rely on a shader finishing before the next stage starts? // ... init texA to contain input ... shader1.samplingFrom(texA).renderTo(texB); shader2.samplingFrom(texB).renderTo(texC); shader3....
ادامه مطلبVote count: 0 In a Rails 4 app, I am using Paperclip and the fog-google gem to store pictures in my Google Cloud Storage bucket. Everything works great for file upload. The problem is that when I retrieve a bunch of photos to display, it is incredibly slow. The requests take waaay longer than they should. I believe the problem is that fog is authenticating each and every request so it takes a long time to retrieve a bunch of files. In my development environment, things are really snappy because the pictures are stored locally. It is only in production that the requests are really slow. The url of the stored file in the Google bucket is public, so I am wondering if there is away to tell fog n...
ادامه مطلبVote count: 0 I need to retrieve the html page from a website. I decided to use socket and HTTP GET request. I use c++ and I query a recipes site. It is a dynamic website. In the previous question I asked why I receive different response from the site but now, I need to clean the html page and get the content of the site but when I isolate the body of the page, the content of the site that will be generated dynamically show me an error message like: The page was not found Someone know the problem? I don't know how to resolve this problem. I tried to change site but the result is the same. asked 1 min agoSilvia B Let's block ads! بخوانید...
ادامه مطلبVote count: 0 This is my first question on stack overflow. So, excuse the mistakes I make. I have a situation where I have a dataset which consists of 3 fields:Database useame, Source program and count(of the number times the source program has been accessed). I need an automated method of tracking down database user names accessing a certain source program more than a threshold. I don't have access to timestamps. I had hit upon this [link] :http://www.slideshare.net/erikbe/collaborative-filtering-at-spotify-16182818 Spotify's collaborative filtering system uses a dataset with the fields (user,track,count). I was hoping I could use something similar (user-item implicit feedback)in my case. I...
ادامه مطلبVote count: 0 I want to open profile page like www.website.com/slim/useame (where useame is unique) . I am currently using slim php framework for routing GET requests. So when I open " www.website.com/profile/useame " it properly executes the route defined for '/useame' and gives simple json response like this {"users":[{"id":"01","firstname":"kamron","lastname":"shaw","gender":"male","status":"Offline"}]} From this point I wanted to integrate this data with the profile page template, so I made a profile page template at www.website.com/profile.php and from there used ajax to make a GET request to" www.website.com/slim/useame " and receive data and display it with template. Problem is that i...
ادامه مطلبVote count: 0 Is it possible to direct that input from this command to a file and also to standard output? tar -t all.tar Also Is there a way to kill all processes ruing lets say an xclock? asked 1 min agoJimBob101 Let's block ads! بخوانید...
ادامه مطلبVote count: -2 I want to write a program in C that prints an asterisk in C.. the user enters an odd number, then the output will be an asterisk, for example: if the user entered the number 7 then the output will be: * * * * * * *** ******* *** * * * * * * note that the weight/the height of the asterisk = 7 and if he entered the number 5 for example: * * * *** ***** *** * * * the problem that I face is that I didn't figure out how to 'change' the litte asterisk places, and how to build this program using loops only.. asked 1 min agoAhmed Jabareen Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm trying to setup JSON Web Tokens to communicate with my php backend from a mobile app. I can request a token just fine. When i need to validate it(or make a request to another endpoint), i setup the Authorization header with the following format: Bearer But for some reason on my backend, $_SERVER['HTTP_AUTHORIZATION'] is not set. I'm on localhost using Mamp Pro with PHP7. This is a dump for my $_SERVER array: Array ( [SERVER_SOFTWARE] => Apache [REQUEST_URI] => /wp-json/jwt-auth/v1/token/validate/ [REDIRECT_STATUS] => 200 [HTTP_HOST] => localhost.dev [CONTENT_TYPE] => application/x-www-form-urlencoded [CONTENT_LENGTH] => 54 [HTTP_CONNECTION] => keep-alive [HTTP_ACCEPT] => */...
ادامه مطلبVote count: 0 Why doesn't this work? class SampleData { constructor(only: Array = ['loadData0']) { only.map(f => this[f]()); } loadData0() {}; } Error: error TS2339: Property 'loadData0' does not exist on type 'typeof SampleData'. asked 2 mins agoA T Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have been working on a project using React.js. I have been using Webpack dev server which is a node.js Express server and enables us to render react.js on browser. I want to know whether using React.js will limit us on using only a node.js http server or is there a way we can use a simple http server as well with React.js. Also is it useful to use React.js for developing webpages that have mostly pre-fixed contents text fields, data etc. to be shown in html during request/response for any API operation. Disclaimer: I am new to React.js and have these questions in my mind. asked 1 min agoShubham Khatri Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am trying to gather some information from the backend to use in combination with the IR in LLVM. The problem is that I wrote a pass to collect the info as a MachineFunctionPass and now I want to use it in a FunctionPass, so I set the dependency using getAnalysisUsage. When I try to run the pass, it crashes due to maybe a dependency loop. Is there a workaround this issue? Thanks, asked 1 min agoMuhammad R. Soliman Let's block ads! بخوانید...
ادامه مطلبVote count: 0 What I want to do:I am trying to implement the Travelling Salesman Problem using a weighted directed graph. That means that I will need to visit different vertices, but I can't figure out how to get the vertices using JGraphT. I want to do something like: getVertex(Chicago); for (edges coected to chicagoVertex) pick the one with the smallest weight Problem/What I've tried:But I can't figure out how to do the getVertex(x) part. JGraphT has a getEdge(), but there's not a getVertex() method. I read here about picking a random vertex with vertexSet(), but I don't understand how it works. It is just creating a vertex and storing it in an object array, but if I use that, that means e...
ادامه مطلبVote count: 0 function edit() { var num=prompt("Enter new number",""); $.post('edit.php', {num: num}); } The above code is working but not always!! asked 4 mins agoJobin John Let's block ads! بخوانید...
ادامه مطلب