Vote count: 0 I am trying to switch between six different images based upon the value of the seekbar (0-5). I am stuck and would welcome any suggestions/help. It compiles and runs, but the app crashes as soon as I try and click on question 1. Here is what I have for the seekbar: public void seekbar() { seek_bar = (SeekBar) findViewById(R.id.seekBar); text_view = (TextView) findViewById(R.id.seekBarText); text_view.setText("Stress Level : " + seek_bar.getProgress() + " / " + seek_bar.getMax()); Intent i = getIntent(); s = (ArrayList)i.getSerializableExtra("survey"); String qone = s.get(0); //TODO: Set the Default of the Seek Bar seek_bar.setOnSeekBarChangeListener( new SeekBar.OnSeekBarChange...
ادامه مطلبVote count: 0 I'm trying to draw this chart-like shape on an html canvas: 0 100 . . 200 . . . 300 . . . 400 . . . . 500 ................................. I can't see anything wrong with my shape's co-ordinates: (0, 500), (0, 400), (100, 400), (200, 300), (300, 200), (400, 100), (400, 500) Html/js: function drawSteps(heights) { var y = 500; var steps = document.getElementById('steps').getContext('2d'); steps.fillStyle = '#C3EDBD'; steps.beginPath(); steps.moveTo(0, y); var x = 0; for (var i = 0; i < heights.length; i++) { console.log(x.toString() + ', ' + (y - heights[i]).toString()); steps.lineTo(x, y - heights[i]); x += 100; } steps.lineTo(x, 500); steps.lineTo(0, 500); steps.closePath(); s...
ادامه مطلبVote count: 0 I had a project in mind where I would download all the tweets sent to many celebrities for the last one year and do a sentiment analysis on them and evaluate who had the most positive fans. Then I discovered that you can at max retrieve twitter mentions for the last 7 days using tweepy/twitter API. I scavenged the net but couldn't find any ways to download tweets for the last one year. Anyways, I decided to do the project on last 7 days data only and wrote the following code: try: while 1: for results in tweepy.Cursor(twitter_api.search, q="@celebrity_handle").items(9999999): item = (results.text).encode('utf-8').strip() wr.writerow([item,results.created_at]) # write to a csv (...
ادامه مطلبVote count: 0 i am developing an excel web app addin for office365, my excel file is placed in one drive. when i open my excel file it shows in readonly mode. is it possible using office.js or any javascript code to detect if file is in readonly. i tried url in the browser changes if you edit the excel so that can be used to detect if file is in readonly mode or edit mode. right now you can see it as view.aspx page. i also tried using widnows.location, but as this app stays in iframe, its difficult to get parents url location. asked 1 min agoshyam_ Let's block ads! بخوانید...
ادامه مطلبVote count: 0 when i execute this piece of code in the decorator the func.count=0 is not assigned and the incrementation is not done. Could anyone help me in solving this problem and make the decorator to retu the func.count and get the correct output as required def count_calls(skip_recursion=True): if skip_recursion==True: def ier(func): func.count=0 def counter(i): func.count+=1 retu func.count retu counter retu ier else: def ier(func): func.count=0 def counter(i): func.count+=1 retu func.count retu counter retu ier def test_calls_decorator(): @count_calls() def fib(n): if n...
ادامه مطلبVote count: 0 This may be a duplicate question, but I have checked all over and can't find a working answer for iOS9. -stringByAddingPercentEscapesUsingEncoding has been deprecated. I need to use -stringByAddingPercentEncodingWithAllowedCharacters Below is the string that needs the backslashes escaped so that the API can authenticate the session and retu a response. NSString *base = @"http://domain.com/interface/?end=imember"; NSCharacterSet *set = [NSCharacterSet URLQueryAllowedCharacterSet]; NSString *key = [@"&client_key=KOB3N6KX9JXF2MRPO5U.BRFYM7TYVE/16KIJVXZA6R7H/1LD1K/JYIYG7IZP2HA7NUYOVNT3CJG==&token=SGD7E9B29TQ.8HIITZ37XW3GLK5OGLZNLCDM=" stringByAddingPercentEncodingWithAllowedCharact...
ادامه مطلبVote count: 0 I have written some code into a plugin for Wordpress that when the User hits the submit button their information is stored in the WP database and is also sent to a third party website with their email and password using JSON protocalls. this is the code I use: $url = "https://api.example.com/v1/logins"; $data = array( 'email' => $_POST['$bemail'], 'password' => $_POST['$password'], ); $content = json_encode($data); $curl = curl_init($url); $apikey = "xxxx"; curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'example.com-Api-Key: ' . $apikey, 'Accept: application/json', )); curl_setopt($curl,...
ادامه مطلبVote count: 0 So I am trying to add a gif to a UIImageView using SwiftyGif and I am stuck as to why it fails to animate the gif unless I am using an outlet. I programmatically created a UIImageView and used the .setGifImage function and all it does is display an image using the first frame of the gif. However, when I created one using storyboard/an outlet, it displays the gif just fine. Does anyone know why programmatically setting up an UIImageView and adding the gif causes it to fail? Even using a XIB doesn't work.. asked 27 secs agoriverhawk Let's block ads! بخوانید...
ادامه مطلبVote count: 0 i use this code check date availability from the database and so i use one textbox which is linked to a datepicker ui and a dropdownlist to select time. the problem is if i select a date and fullday and if it is in database table already it shows date unavailable as its supposed to same for afteooon or forenoon for the same date. but when i select a date where either afteoon or forenoon is already booked it only blocks afteoon or forenoon respectively and if i select fullday for the same date it says date available and i tried to use if condition inside if condition to solve this but i dont know where im doing wrong please someone help me. thanks in advance. Sincerely the front...
ادامه مطلبVote count: 0 I try to create pdf file using tFPDF with custom font.I put arial font inside font/unifont folder.I use this code to create pdf file: $pdf->AddFont('arialbd','','arialbd.ttf',true); $pdf->SetFont('arialbd','',16); $pdf->Cell(40,6, 'OÜ Kersti Võlu Koolituskeskus', 0, 1); $pdf->SetFont('arialbd','',10); $pdf->Cell(40,12,'REGISTREERIMISLEHT', 0, 1); $pdf->Output('test.pdf', 'I'); It works well on localhost, but when I uploaded this file on server, it shows me an error:Waing: fopen(C:xampphtdocskoolituswp-contentpluginskoolitusfpdf/font/unifont/arialbd.ttf)I see that library tries to load a font from my localhost, but I don't even set a path, just use font nameHow to add fonts prop...
ادامه مطلبVote count: 0 I need to get codec information when using libvlc to play remote media. Since the VLC player can achieve this(see the link below), libvlc may well do it too. a screenshot of VLC Also, I find that libvlc_media_tracks_get can retu a related struct as follows: typedef struct libvlc_media_track_t { /* Codec fourcc */ uint32_t i_codec; uint32_t i_original_fourcc; int i_id; libvlc_track_type_t i_type; /* Codec specific */ int i_profile; int i_level; union { libvlc_audio_track_t *audio; libvlc_video_track_t *video; libvlc_subtitle_track_t *subtitle; }; unsigned int i_bitrate; char *psz_language; char *psz_description; } libvlc_media_track_t; Maybe the member i_codec stores such inform...
ادامه مطلبVote count: 0 How to develop magento web service for admin login. I want to develop core php page where check magento admin login using web service. please help me thanks in advance asked 40 secs agoAnkit Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a barcode generator that takes information stored in a database and generates a barcode from a databound checkboxlist selection. There are different check boxes, the user checks the boxes of the items they want and enter a universal total. protected void btnGenerate_Click(object sender, EventArgs e) { int n; int i = Int32.Parse(BatchNumText.Text); for (n = 1; n...
ادامه مطلبVote count: 0 I've created a .NET Core project (a class library) that also targets .NET 4.6, which needs to be able to access the current HTTP context. I see that we can no longer use the static HttpContext.Current, and have to inject an instance of IHttpContextAccessor. Is this something I can still use inside something like a Web API project targeting .NET 4.6? So far, I can't get HttpContextAccessor.HttpContext to retu anything but null. asked 14 secs agoTom Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a list which contains english alphabets,Hindi alphabets,Greek Symbols and digits as well. I want to remove all alphabets except that of Hindi. Hindi alphabets range in unicode is u'0900'-u'097F'. For details about Hindi alphabets visit http://jrgraphix.net/r/Unicode/0900-097F. Input: l=['ग','1ए','==क','@','ऊं','abc123','η','θ','abcशि'] for i in l: print i Desired Output: ग ए क ऊं शि asked 38 secs agoishpreet Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I want to track conversation history of the users is there any way to trach this? For this am using Exchange Web Service [EWS]. I want to know any other web service is available to track this conversation? asked 12 secs agoAkshay Bagi Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am trying to rotate a List of items to the right by the specified numbers of places without using LINQ, how am I able to do this? I think I am not understanding how to approach/solve this problem in particular. Here's what I have tried so far. public void Test(List items, int places) { items.RemoveAt(places); items.Add(places); } asked 1 min agoZerox Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I would like to add a WebSockets server to the stack, which is currently a mix of .Net for the web service side, and c++ for the high performance servers. I would like to interface some of our c++ servers, which currently use a custom protocol, with a c++ WebSockets service. I'm fairly new so I've looked around and for a first cut, I would like to use WebSocket++ I've looked at the documentation, and see that a basic service can be started at any port. What I'm wondering is how to handle authentication. Ideally, we could use our current authentication methods, which is either Basic (over https), or token based with a (also over https). All of the examples I've seen have the Web...
ادامه مطلبVote count: 0 In the past, I have created my HITs for Mechanical Turk using the cmd line tool. Here is the command I have used in the past to create my HITs. I am now trying to write a script which will do this automatically using Python and Boto. ./loadHITs.sh -input /Users/xyz/mturk/1/input.test.csv -question /Users/xyz/mturk/1/question.xml -properties /Users/xyz/mturk/1/project.properties -sandbox I have read over the Boto api docs, but am confused how I load in a question from xml file. I assume I can use something along the lines of boto.mturk.question.HTMLQuestion(html_form, frame_height) but there is no description of what exactly the parameters are supposed to contain. For instance, ...
ادامه مطلبVote count: 0 I am trying to extract the XML Response from an API. My XML response looks like below. I tried different methods. can you please help me in reading and extracting the individual nodes from the XMl response. For Example: I want to extract node from below XML response. 54378451898093/24/2016 1:34:44 PM22022ITSTEST.ISMICC Processor24032016013444184.9966.55.53.68MANUALFALSESaleFALSEYM0b144718-3597-4cfb-a2b5-058679510f29303281111184.990917Keeth BolerVISA0approvalSettled asked 31 secs agovinisha9 Let's block ads! بخوانید...
ادامه مطلب