title
stringlengths
13
150
body
stringlengths
749
64.2k
label
int64
0
3
token_count
int64
1.02k
28.5k
How to set up Android's MockContentProvider
<p>I'm currently testing Android's ContentProvider and running into some issues mocking it. I've already spent days on the internet but didn't find any useful examples except of the introduction on the <a href="http://developer.android.com/tools/testing/contentprovider_testing.html" rel="nofollow">Android Developer Sit...
2
2,670
ViewPager + FragmentStatePagerAdapter not working as intended
<p>There are a lot of similar question but none of them solved my problem.</p> <p>I got nested <code>ViewPager</code>s and nested <code>FragmentStatePagerAdapter</code>s in my application.</p> <p>In details, a first ViewPager (backed with a 4 fragments adapter) is created, the first fragment of which contains other 3...
2
1,437
unable to download a web page using requests
<p>Im having problems downloading a webpage using python requests library. code worked fine until it stopped working suddenly. here is the code:</p> <pre><code>import requests user_agent = {'User-agent': 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17'} url = 'ht...
2
2,408
inconsistent datatypes: expected - got BLOB
<p>i tried to update a form which contained a blob data type but keep getting error as mention above. here is my coding for update the form in the ItemDao.</p> <pre><code>public static int update(ItemBean u){ int status=0; try{ Connection con=ItemDao.getConnection(); PreparedSta...
2
1,831
Django profile id may not not null using get_or_create, how does it relate to the db?
<p>I followed a bit the steps on <a href="http://www.turnkeylinux.org/blog/django-profile" rel="nofollow">Django User Profiles - Simple yet powerful</a>.</p> <p>Not quite the same because I am in the middle of developing the idea. From this site I used in particular, also this line:</p> <blockquote> <p>User.profile...
2
1,039
Uart / GPS driver sample buffer overflow
<p>I am trying the sample for the GPS driver with a raspberry pi 3 and the Ultimate GPS V3 breakout board.</p> <p>Here is the full source code: <a href="https://github.com/androidthings/drivers-samples/tree/master/gps" rel="nofollow noreferrer">https://github.com/androidthings/drivers-samples/tree/master/gps</a></p> ...
2
2,608
Kafka Connect assigns same task to multiple workers
<p>I'm using Kafka Connect in distributed mode. A strange behavior I observed multiple times now is that, after some time (can be hours, can be days), what appears to be a balancing error happens: same tasks get assigned to multiple workers. As a result, they run concurrently and, depending on the nature of the connect...
2
1,685
Making embeds of more than one page using discord.py
<p>I'm currently trying to make a bot using discord.py. One of the functions I want it to have is to show the users with X role. I've managed to create said function, and make the bot send the results with a nice embed. However, now I want to improve it and make it more similar to Nadeko's inrole function (i.e. only on...
2
1,947
vue-table-2 with Vuex - not able to change the count property
<p>I'm using the vue-table-2 component : <a href="https://github.com/matfish2/vue-tables-2" rel="nofollow noreferrer">https://github.com/matfish2/vue-tables-2</a> and I'm struggling to make it work as I want. </p> <p>I have an API (using API Platform) which is already making all the pagination works. So when I fetch f...
2
1,445
Why won't my ascx file pick up my code behind properties?
<p>My web app is a solution built on top of another solution. The base solution is meant to be a platform for multiple products. For the most part, this works fine, but weird things happen when I create product specific views.</p> <p>I am using <code>ViewUserControl&lt;SomeViewModel&gt;</code> for my code behind class...
2
1,552
node.js fs.readdir doesn't show any files in directory
<p>I know this is probably something near to a stupid question, but I'm banging my head and I simply can't solve th problem by myself or with the help of good old google.</p> <p>I have an express 4 app in which in one route a function from a script is executed to list all available json files from a data directory.</p...
2
1,319
DELETE, UPDATE a single record in mysql using playframework
<p>Hi I am new to Play framework.I would like to implement CRUD operation using MYSQL database in play framework. </p> <p>i have able to successfully delete, update the entire table, but not able to successfully delete the single record. I want to pass the values from html.</p> <pre><code>index.scala.html @(messag...
2
1,502
Scraping Instagram with PHP - Plugin Wordpress
<p>I'm trying to retreive the user's picture from Instagram without the access token. To do that, I build a scraper with PHP. It works quite well, but sometimes and only with some accounts, it doesn't work.</p> <p>Here the function to scrape Instagram:</p> <pre><code>function get_instagram_feed( $number, $username ) ...
2
2,475
Scala won't run in IntelliJ
<p>When I try to run any scala code in intillij, I get the following error:</p> <blockquote> <p>Information:07/07/18 10:20 - Compilation completed with 1 error and 1 warning in 3 s 617 ms Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException java.lang.reflect.InvocationTargetExc...
2
3,851
How to call camera intent in CustomAdapter class in android?
<p>I have Adapter class called CustomListAdapter class i written like this,so here i get a problem class cast exception Any one suggest me</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) convertView = inflater.inflate(R.layout.myplac...
2
1,024
Spring CorsFilter does not seem to work still receiving a 401 on preflight requests
<p>Hi I'm new to spring security and trying to figure out how to configure auth server to issue tokens. the problem i have right now is that I'm receiving 401 or 403 on the Cors preflight requests and not sure how to resolve below is a barebone implementation of it based on few tutorials </p> <p><a href="https://sprin...
2
1,444
Generic classes in EF Code First
<p>I’m trying to incorporate EF in my application. I use EF6 and Code First. My object model has some generic classes and it seems that Code First accepts it partially (tables and columns are generated correctly).</p> <p>Below an example:</p> <pre><code>public class Group : TimeableObject&lt;GroupTimeline&gt; {} pub...
2
1,190
Find City, State, & County of User Inputted Zip Code (United States Zip codes only)
<p>I need to find the city, state, and county of a user inputted zip code or user inputted city,/state using JavaScript.</p> <p>I understand that some (very few) cities/zip codes in the United States are located in 2 or more counties.</p> <p>I am using the Google Maps Geocoding API to accomplish this but I am having ...
2
1,756
Unable to select item with button in custom spinner
<p>I am creating a custom spinner with button and textview in items of spinner. In this case, only the button's click is detected. And the click of complete item is not detected. But when I remove the button from the spinner item, the click of complete item works fine. Is it possible to handle both click events at a ti...
2
1,902
Chromium hangs using the TestCafe Docker image
<p>Attempting to run Chromium headless inside the testcafe/testcafe Docker image causes the browser to hang, no matter what options I've used. Here's what I have at the moment:</p> <pre><code>"browsers": { "path": "/usr/bin/chromium-browser", "cmd": "--headless --disable-gpu --no-sandbox" } </code></pre> <p>A...
2
1,054
What's wrong with my hill cipher code? (Java Android)
<p>I have some problems in implementing the hill cipher algorithm in Java Android. It runs well on certain condition but it comes lack on other condition.</p> <p>Here is the running app.</p> <p><strong>1. It runs OK for below condition</strong></p> <p><img src="https://i.stack.imgur.com/o3dGn.png" alt="**Ok for belo...
2
3,995
Webpack + babel, ReferenceError: class is not defined
<p>I am writing my first JS library and wanted to learn to use babel and webpack.</p> <p>The problem I am having is that the class (entry point?) that I'd like to instantiate in my <code>index.htm</code> file causes the browser to complain that it's "not defined".</p> <p>This is my webpack config:</p> <pre><code>con...
2
1,195
Django - python3.4 virtualenv - apache
<p>I have a Django app I've been working on debugging using manage.py runserver.</p> <p>I'm now attempting to serve it with apache/mod_wsgi.</p> <p>When I try to open the home page I received a 500 error. The log file shows a syntax error in functools.py.</p> <pre><code>mod_wsgi (pid=28016): Target WSGI script '/hom...
2
1,136
Logo won't move left or right inside header tag
<p>I'm trying to put my logo in the center or my page (center of header &amp; above menu nav) It moves away from the menu but doesn't move laterally left or right just stays in the same position no matter what.</p> <p>I've tried everything searching google and no results show up.Tried making header relative and tried ...
2
1,289
ejabberd XMPP connection failed using strophejs
<p>I am trying to run <a href="https://github.com/metajack/profxmpp/tree/master/ch03" rel="nofollow">THIS XMPP JS</a> code using ejabberd on server side. Here is my connection code:</p> <pre><code>$(document).bind('connect', function (ev, data) { console.log("connect "+JSON.stringify(data)); var conn = new Str...
2
1,674
Android dex class loader - class not found
<p>I want to use a dex class loader to dynamically load code into my Android application. I have followed this tutorial: <a href="http://www.marioalmeida.eu/2015/01/27/how-to-easy-way-load-apk-classes-using-dexclassloader/" rel="nofollow noreferrer">http://www.marioalmeida.eu/2015/01/27/how-to-easy-way-load-apk-classes...
2
4,181
Style chakra-ui mobile scrollbar and make always visible
<p>so the styling in the css={{....}} property gets applied in my browser, but not in Safari on my iPhone. How do i add styling for iOs Safari, and also how can i make it, so that the scrollbar doesn't disappear and is always visible?</p> <p>The only style which seems to get applied on iPhone is the webkit-scrollbar-tr...
2
1,061
FOSUserBundle login form not showing after extending layout.html.twig
<p>I've read the guide and after installing, configuring and overriding the default template I can browse to my Login page but only my header and footer show up, there is no login form.</p> <p>config.yml:</p> <pre><code>fos_user: db_driver: orm firewall_name: main user_class: WX\ExchangeBundle\Entity\TblU...
2
1,570
How can I configure maven project so that tests are not broken when main code changes?
<p>I noticed I can run into binary-compatibility problems between main source and test source in maven project configuration. When I change main code, and run maven <code>test</code> target the main code is recompiled, but dependent tests aren't. This may lead to <code>java.lang.NoSuchMethodError</code>.</p> <p>Here ...
2
4,338
how to populate jqGrid table using json
<p>I am creating a jqgrid from the json string "<a href="http://www.ok-soft-gmbh.com/jqGrid/John.txt" rel="nofollow">http://www.ok-soft-gmbh.com/jqGrid/John.txt</a>"</p> <p>I wrote the JavaScript similar to "<a href="http://www.ok-soft-gmbh.com/jqGrid/John.htm" rel="nofollow">http://www.ok-soft-gmbh.com/jqGrid/John.ht...
2
1,326
"unrecognized selector sent to instance" When setting a UILabel's text
<p>I'm a student of iOS programming working through the Big Nerd Ranch book. I see that lots of other people have caught the same exception "unrecognized selector sent to instance" but can't find out what's causing it in my code.</p> <p>It's happening in this method where I try to set the text of a UITableViewCell's U...
2
2,258
Include a specific chunk from one markdown document in another document
<p>I want to include the code from a specific chunk of a one markdown document into a second markdown doc. I want to do it by referring to the chunk by name (no <a href="https://stackoverflow.com/a/17605475/1036500">hacky references to line-numbers</a>, please). I don't want to run all the code in the child because som...
2
1,262
Spring Web Flux (reactive) functional route not working as expected with Kotlin
<p>Hello good people interested in writing spring apps in Kotlin. I am playing with Spring Boot 2.0.0 snapshot and <code>spring-webflux</code>. This piece of code:</p> <pre><code>@Component class TestRouter() : RouterFunction&lt;ServerResponse&gt; { override fun route(request: ServerRequest) = route(request) { "...
2
1,368
How to fix error which appeared after upgrading to react-router v6
<p>Before upgrading to v6 I had this part of code, which worked as it should:</p> <pre><code>//before return ( &lt;BrowserRouter&gt; &lt;Route render={(props) =&gt; ( &lt;div className={`layout ${themeReducer.mode}`}&gt; &lt;Sidebar {...props}/&gt; ...
2
1,304
How to remove the last selected event in Fullcalendar?
<p>If i clicked in a specific date in calendar to make an appointment a modal appears to choose the user, service, date and time and leave comment, the modal has two buttons, first to make the appointment and the second to <strong>cancel the appointment</strong>, the <strong>problem</strong> is if i want to select anot...
2
3,648
onclick function to change url - not working everytime
<p>I have four links each with an onclick event, each pass their language code to the changeLanguage function. The function should remove everything after the last '/' of the URL and replace it with the new language code and then redirect to the address. It works about 60/70% of the time, but if it doesn't the page rel...
2
1,124
Spring Boot: MongoDb: Exception: NoSuchMethodError: com.mongodb.client.MongoCollection.insertOne(java.lang.Object)
<p><strong>Prologue:</strong></p> <p>I have researched this topic from the stackoverflow answers. All answers were pointed towards the dependency conflict, which in my case doesn't seem to be true. (<em>if i am not missing anything</em>)</p> <p><strong>Problem:</strong></p> <p>I am getting this exception during <em>run...
2
2,872
Excecuting Luhn's Algorithm in C - buggy code
<p>I'm currently working through CS50x's 2018 programme and I'm completing the 'credit' part of pset1. We're supposed to be executing Luhn's algorithm, but I can't get it to work. </p> <p>Luhn's algorithm is an algorithm that uses checksum to determine whether or not a credit card is valid. The input should be a credi...
2
1,208
Static functions called twice in React Native
<p>To improve the structure of my app I'm moving most In App Purchase functionality into a special class with static methods and variables.</p> <p>When I try to use this class <strong>the functions seem to get called twice each, even though in my code I only call them once</strong>. When I debugged it with remote debu...
2
2,305
How to reset the dataframe values to their defaults in R?
<p>Turns out I have messed up with Boston$chas using factor command and now I have the following! Do you know how can I reset it to the initial value?</p> <pre><code>&gt; Boston$chas [1] &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt; &lt;NA&gt...
2
4,318
Log4j2 in async mode still blocks on java.util.concurrent.lock under heavy load
<p>I am trying to log in a low-latency environment.<br> 2 high priority threads are calling log.error() in a tight loop (1Mmessages/s)</p> <p>I want to use Async logging (with the disruptor) and to discard any excess messages. So the calling thread should NEVER block.</p> <p>However, the jstack clearly shows it is bl...
2
1,277
Facebook Login Issue with WebView not Closing using (Swift 3.0 FacebookLogin 0.2.0)
<p>The pods I'm using from my podfile:<br> PODS:<br> - Bolts (1.8.4):<br> - Bolts/AppLinks (= 1.8.4)<br> - Bolts/Tasks (= 1.8.4)<br> - Bolts/AppLinks (1.8.4):<br> - Bolts/Tasks<br> - Bolts/Tasks (1.8.4)<br> - FacebookCore (0.2.0):<br> - Bolts (~> 1.8)<br> - FBSDKCoreKit (~> 4.15)<br> - Fac...
2
1,864
How to create a Java Applet accessing webcam using JAVACV
<p>I have created a Java Application using JavaCV and it is running successfully. Now I need to create an Applet to access the Web Cam. I Know taht the applet signing is needed to access the Web Cam. My problem is that I have tried to create the applet with the following code. But it is not working. ie the GUI is not ...
2
4,599
Tesseract.js - Not working first time
<p>I have a web page with a simple image <strong>OCR</strong> text.</p> <p><a href="https://i.stack.imgur.com/TknNA.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TknNA.gif" alt="enter image description here"></a></p> <p>I would like to get the text of this image with <strong>Tesseract.js</strong>...
2
1,029
RxSwift multiple observable in map
<p>I ran into a situation where I would fetch an API which will generate json data of registered users. I would then have to loop through each user and fetch their avatar from remote url and save it to disk. I can perform this second task inside <code>subscribe</code> but this is not a best practice. I am trying to imp...
2
1,258
Getting percent of total from subtotals in pandas pivot table
<p>I have the following dataframe</p> <pre><code>from io import StringIO incsv = StringIO("""Date,State,City,Tools,Size,y 20130320,AZ,Phoenix,A,4,1000 20130320,AZ,Tempe,B,4,1100 20130320,NY,NYC,C,1,900 20130320,NY,NYC,C,2,1300 20130320,NY,Albany,D,1,800 20130320,AZ,Phoenix,E,1,800 20130320,AZ,Phoenix,F,4,800 """) df ...
2
1,146
Service Worker not caching API content on first load
<p>I've created a service worker enabled application that is intended to cache the response from an AJAX call so it's viewable offline. The issue I'm running into is that the service worker caches the page, but not the AJAX response the first time it's loaded. </p> <p>If you visit <a href="http://ivesjames.github.io/p...
2
1,283
How to send file data as post parameter in BuzzBrowser post call
<p>I am using <a href="https://github.com/kriswallsmith/Buzz/blob/master/lib/Buzz/Browser.php" rel="nofollow">Buzz Browser</a> for calling <code>POST</code> method. I am receiving a file from client at one of the <code>end point</code>.</p> <pre><code>$fileObj = $requestObject-&gt;files-&gt;get('image_data'); </code><...
2
1,081
Empty data object returns in <Query> after mutation is applied for the same
<p><a href="https://github.com/apollographql/react-apollo/issues/2370#issue-358565324" rel="nofollow noreferrer">Github Issue Posted Here</a></p> <pre class="lang-json prettyprint-override"><code>"apollo-boost": "^0.1.13", "apollo-link-context": "^1.0.8", "graphql": "^0.13.2", "graphql-tag": "^2.9.2", "react-apollo":...
2
1,266
Parse HTML Form Using JavaScript
<p>I'm trying to parse a form with JavaScript (instead of submitting a POST request). I have a very generic form with one input for the team name and multiple inputs for a player name and number.</p> <pre><code>&lt;!-- INPUT FORM --&gt; &lt;div id="rosters_container"&gt; &lt;!-- AWAY TEAM ROSTER FORM --&gt; ...
2
3,786
Quartz dont recover Job
<p>I use:</p> <ul> <li>Spring 4.2.9 </li> <li>PostgreSQL </li> <li>Quartz 2.3.0</li> <li>Java 8</li> </ul> <p>I have some problems with recovery job in cluster servers... I have 2 test servers in cluster (1 DB).</p> <p>Scheduler work fine, but when I stop tomcat (1) where Job is running, on another server (2) job is...
2
1,105
How to partition a dataframe on multiple columns and write the output to xlsx in Apache Spark
<p>I'm new to scala and I don't know how to ask this kind of question (technical word ...). I have a dataframe :</p> <pre><code>id VehicleID Longitude Latitude Date Distance 1 12311 55.55431 25.45631 01/02/2020 20 2 12311 55.55432 25.45634 ...
2
1,027
Why WPF button's command's CanExecute method is not called even if I call CommandManager.InvalidateRequerySuggested()?
<p>I'm facing the same issue reported in these questions:</p> <p><a href="https://stackoverflow.com/questions/28343632/button-command-canexecute-not-called-when-property-changed">Button Command CanExecute not called when property changed</a></p> <p><a href="https://stackoverflow.com/questions/3805336/how-can-i-force-...
2
2,356
jQuery .val() not getting value from one input, fine on the rest
<p>I need to validate a number of fields in my ASP MVC3 view and am trying to use jQuery to do so. The jQuery <code>.val()</code> method pulls the <code>accountNumber</code>, <code>refNumber</code>, and <code>ownerMaster</code> from the input fields just fine, however the <code>agentId</code> field always has a value ...
2
2,678
Highcharts: Force show xAxis with datetime
<p>My highcharts chart is showing like this now: <a href="http://img90.imageshack.us/img90/3892/chart1p.png" rel="nofollow">http://img90.imageshack.us/img90/3892/chart1p.png</a></p> <p>But I need it to look like this: <a href="http://img545.imageshack.us/img545/1333/chart2p.png" rel="nofollow">http://img545.imageshack...
2
2,128
JSTL c:choose and mutiple c:forEach, c:if issue
<p>I'm trying to use <code>&lt;c:forEach&gt;</code> and <code>&lt;c:if&gt;</code> in <code>&lt;c:choose&gt;</code>. My original plan was when list size is 0 then it shows "there is no result" and if it is not it shows the things in the list. However, it seems like whenever I use <code>&lt;c:choose&gt;</code>, the page ...
2
1,202
QTableView does not retain changes or update after adding records
<p>I am constructing a GUI which displays the contents of a SQL database table and which should allow addition and modification of records through the GUI, using the base PyQt4 classes QTableView and QSqlTableModel. I am having problems with editing the table view.</p> <p>Here is a Minimal, Complete and Verifiable ver...
2
1,923
Create GNURadio source block: how to tune the sample rate
<p>I'm trying to implement a custom source block for the Analog Discovery 2 oscilloscope in GNU radio. I already have a working python script to record samples from the Analog Discovery 2 device to a WAV file (code at the end of the question).</p> <p>I'd like to be able to connect this sample source directly in GNUrad...
2
2,095
when DynamicClientFactory with Binding Files creates createClient(), exception occurs
<p><b>Someone let me know how to create Client object by DynamicClientFactory with Binding files.</b><br><br> this is a sample code i have tested. It occured an exception.</p> <pre><code>String wsdlURL = "http://localhost/test?wsdl"; ClassLoader loader = Thread.currentThread().getContextClassLoader(); JaxWsDynamicClie...
2
2,270
Uncaught SyntaxError: Unexpected identifier - JS Error, when php put's a single qutoe or apostrophe in function parameter
<p>Alright I am using AJAX to generate a list of potential customer matches from a WebService. Everything is working except for this part in my pHp ...</p> <pre><code>$html = "&lt;h3&gt; Search Results: "; if(!is_array($searchResults)) { $html .= $searchResults . "&lt;/h3&gt;"; } ...
2
1,416
Transform scale change position element after in hover
<p>I try using <code>transform:scale(1.2)</code> to obtain the effect of an appearing circle around the icon. <code>transform</code> I added to the <code>.icon-style:hover::after</code>.</p> <p><strong>Now this code is commented, please uncomment this code to see what I want to get.</strong> </p> <p>For example I try...
2
1,203
Unknown Host Exception
<p>Very recently, I started getting the following error back from my widget. I didn't make any changes and I'm wondering what the problem could be and how to get around the problem. My widget gets updated based on information from a Service that I created to access information from a third-party client. I was able to g...
2
2,408
How to connect AS400 with Laravel
<p>For a little while now, I've been looking how to try a connection to AS400 with Laravel 7.</p> <p>I use this package : <a href="https://github.com/cooperl22/laravel-ibmi" rel="nofollow noreferrer">https://github.com/cooperl22/laravel-ibmi</a></p> <p>I add laravel-ibmi to your composer.json file:</p> <pre><code>"r...
2
1,912
How can I connect to an Oracle database from excel VBA using LDAP?
<p>We have several excel spreadsheets connecting to an oracle database using an ADODB connection (see example code below). The connection is made using TNSNAMES which is setup on the client machine using the oracle instaclient driver. </p> <pre><code>Set oCN = CreateObject("ADODB.Connection") oCN.CursorLocation = 3 o...
2
1,284
Error after running 'grunt'
<p>After running <code>grunt</code> I get this error. No idea what it means.</p> <pre><code>Done, without errors. Warning: Running "imagemin:dist" (imagemin) task Warning: Cannot call method 'replace' of undefined Use --force to continue. </code></pre> <p>I haven't touched <code>Gruntfile.js</code>, it should work ou...
2
8,132
OpenCV: find small dark(black) dots inside a circle
<p>I am trying to detect the circles that are black dots or have black dots in them(the ones that I pointed with arrow in the following image). <a href="https://i.stack.imgur.com/rMDzj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rMDzj.png" alt="enter image description here"></a></p> <p>My curre...
2
1,159
Android ListView with Two text and One CheckBox (eg. like a Setting)
<p>I'm creating Setting Activity which include two TextView and One CheckBox on right side. I have already done ListView. I want to be like when click on item and then check the CheckBox and again click on item then unchecked the CheckBox. How to implement CheckBox status?</p> <p>My Code.</p> <p>MainActivity.java</p>...
2
2,054
jQuery UI dialog in Bookmarklet and GreaseMonkey
<p>Thanks to some awesome answers in other threads, I learned how to: </p> <ul> <li><a href="https://stackoverflow.com/a/6551184/1596418">load jQuery and jQuery-UI in a bookmarklet</a> </li> <li><a href="https://stackoverflow.com/a/805406/1596418">load a CSS into a bookmarklet using jQuery</a> </li> <li><a href="ht...
2
1,173
Rails 4: escape_javascript render partial not working
<p>In my Rails 4 app, I am trying to display some views as <code>modals</code> (with Bootstrap modal), instead of the regular <code>.html.erb</code> views.</p> <p>For instance, I have a <code>calendar</code> model, with a custom <code>analysis</code> action in the controller:</p> <pre><code>def analysis @calendar =...
2
1,581
python3 xpath can't reach a child node (AttributeError: 'NoneType' object has no attribute 'text')
<p>need help with some issue I didn't manage to find<p> I have an xml like this:</p> <pre><code>&lt;forecast xmlns="http://weather.yandex.ru/forecast" country_id="8996ba26eb0edf7ea5a055dc16c2ccbd" part="Лен Стокгольм" link="http://pogoda.yandex.ru/stockholm/" part_id="53f767b78d8f180c28d55ebda1d07e0c" lat="59.381981" ...
2
1,289
I want to make a hotword for my JARVIS AI
<p>I wanted to ask if there if a way to make a hotword for my JARVIS AI made in python 3.7.6(windows 7). I want that JARVIS become activated whenever I say &quot;Hey Jarvis&quot;(just like Hey siri). the code of my jarvis is given below. I have tried the library named lshotword but it gave an error named no module name...
2
4,146
Getting "bad username or password" error while attempting to connect to broker
<p>I have followed the tutorial presented <a href="https://auth0.com/docs/tutorials/authenticating-devices-using-mqtt" rel="nofollow noreferrer">here</a>, but I couldn't connect a client to the server. I always get the following error message (full stacktrace):</p> <pre><code>Error: Connection refused: Bad username or...
2
1,251
handle time picker with hour, minute, am, pm and time
<p>I am creating a time picker for fun. I could create a time picker which can be selected and show the selected time. User can select am or pm either. But for now I could save the time as '09:30' format only rather I want to show '09:30 am' or '09:30 pm' format. How do I handle am, pm, hour and minutes separately beca...
2
2,579
Jruby - Foreman Gem not running
<p>I am running a JRUBY app. And stumbled accross a great gem called Foreman: <a href="https://github.com/ddollar/foreman" rel="nofollow">https://github.com/ddollar/foreman</a></p> <p>However I found out - that the JVM does not support forking:</p> <pre><code> foreman startNotImplementedError: fork is not available o...
2
1,312
Cocoa app open file via double-click or right-click
<p>I'm creating an non-document based application that can open and display various image types. In my Info.plist I've added the supported file types with their identifiers (public.png, public.jpeg, public.tiff, etc.). In my AppDelegate I've implemented the <code>-[application:openFile:]</code> method (as well as the <...
2
1,044
How to add an extra instruction to method in ByteCode using ClassVisitor / Java Bytecode (ASM)
<p>I'm writing a gradle plugin for my lib. <a href="https://github.com/shehabic/sherlock" rel="nofollow noreferrer">https://github.com/shehabic/sherlock</a>, I need to inject a network interceptor at compilation time in the byte code of OkHttp Client (<a href="https://github.com/square/okhttp/blob/master/okhttp/src/mai...
2
1,475
ArrayIndexOutOfBoundException on calling View.draw(Canvas) method
<p>I am trying create bitmap from a Linear Layout in a asynctask(). Please find the code here:</p> <pre><code>while (running) { count++; v1.draw(new Canvas(bitmap));//I am getting exception here //sleep thread to give some lag try { Thread.sleep(30); } catch (Interrupted...
2
1,087
USING collections in Android
<h2>I was looking at this code while surfing through Stackoverflow</h2> <p><strong>CODE::</strong></p> <pre><code>public class MainActivity extends Activity { // Declare Variables JSONObject jsonobject; JSONArray jsonarray; ListView listview; ListViewAdapter adapter; ProgressDialog mProgressDi...
2
1,705
Deploying django app on heroku - requested URL not found on server
<p>I've been following the djangogirl's tutorial here <a href="http://tutorial.djangogirls.org/en/deploy/README.html" rel="nofollow">http://tutorial.djangogirls.org/en/deploy/README.html</a> on deploying a django app on Heroku. I am a complete newbie at this so a lot of the stuff just seems like black magic to me, and ...
2
10,531
Google Fusion Map - Dynamic Menu queried from the google fusion table
<p>I am pretty sure that I know what the problem is with my code, but I am unsure how to fix it.</p> <p>I have a google fusion table that i am querying to generate a menu that has radio buttons in it. A map that is a google fusion table visualized like a google map is also on the page. </p> <p>When i hard code a coup...
2
1,423
How to avoid the frame layout is pushed up when the soft keyboard appears?
<p>I am facing the issue ,when the soft keyboard is appeared the frame layout in top of the activity is pushed up .The Frame Layout is placed inside the Linear Layout and below the scrollview is placed inside the scrollview multiple edittext are placed . I have tried the answers posted in the stack overflow but still ...
2
4,261
Show user subscription as cancelled after billing period
<p>I am using Stripe for my subscriptions and I have it set so when a user cancels their subscription (to turn off automatic renewal) it will keep the subscription active until the end of the billing period on Stripe.</p> <p>The action works via Stripe, but how can I setup so that the <code>cancelled</code> column in...
2
2,149
Hive: dfs copyToLocal gives "org.apache.hive.service.cli.HiveSQLException: Error while processing statement: null"
<p>I am trying to do a 'copyToLocal' from a .hql file, like this:</p> <pre><code>dfs -copyToLocal hdfs://nameservice1/HDFS_FOLDER1/HDFS_FOLDER2/file_name.dat /LOCAL_FOLDER1/LOCAL_FOLDER2/; </code></pre> <p>But I get this below mentioned exception:</p> <pre><code>Error: Error while processing statement: null (state=,...
2
2,189
Can fit curve with scipy minimize but not with scipy curve_fit
<p>I am trying to fit the function<code>y= 1-a(1-bx)**n</code> to some experimental data using <code>scipy curve_fit</code>. The model only exists for y>0, so I clip the calculated values to enforce this. The code is shown below</p> <pre><code>import numpy as np import scipy.optimize import matplotlib.pyplot as plt ...
2
1,786
How to use phalcon createbuilder for join multiple tables
<p>here is the working code for displaying rows from 3 different tables using <strong>PHQL</strong>. i want to code the same using <code>$this-&gt;modelsManager-&gt;createBuilder()</code>. Please find working code and error below.</p> <p>Controller</p> <pre><code>&lt;?php $phql = 'SELECT product.*, currency.*, u...
2
1,797
php xpath query xml for matching value
<p>I'm trying to use xpath to query for a particular email address in the following XML.</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;records&gt; &lt;record&gt; &lt;f id="6"&gt;sample data 1&lt;/f&gt; &lt;f id="7"&gt;user full name 1&lt;/f&gt; &lt;f id="8"&gt;first name 1&lt;/f&...
2
1,082
Snowfall Canvas, Change Particle Speed
<p>I'm trying to change the particle speed of this snowfall script but I can't seem to find the numbers that represent "Falling Speed". Right now the particles are falling too fast, here's the bulk of the script:</p> <pre><code>var SCREEN_WIDTH = window.innerWidth; var SCREEN_HEIGHT = window.innerHeight; ...
2
1,558
RadioButton not correctly display in android
<p>in my simple app i use 2 radio button inside the radiogroup. on google devices (Nexus, Samsung nexus) everything display correctly, but on some other devices as Sony Experia, Samsung S III the label of radio button padding under the circle button. i use the image for radio button and use paddingLeft for get the gap ...
2
1,078
Modal Window Disappears Quickly
<p>I am trying to implement 2 modal windows. The first modal window will include a contact form. When the user clicks submit, I would like the first modal window to disappear and a new modal window to appear right after.</p> <p>In my situation, after the submission button is pressed, first modal disappears, second m...
2
2,166
openFrameworks for iOS become Apple mach-O Linker Error
<p>When I build an example project in openFrameworks for iOS, it becomes <code>Apple mach-O Linker Error</code> though I do not do anything to the project.<br> Whichever sample project I choose, it will be the same result.<br> How do I fix it?</p> <p>The followings is whole error message.</p> <hr> <pre><code>Ld /Use...
2
1,185
how to request getparameter for hidden input in mulitpart in servlet?
<p>I have hidden input type where i had stored selected id </p> <p><strong>JSP File</strong></p> <pre><code>&lt;form method="post" enctype="multipart/form-data" action="./PropertyImage"&gt; &lt;input type="hidden" name="property_id" value="&lt;%=bean.getproperty_id%&gt;"/&gt; &lt;/form&gt; </code></pre> <p>now i...
2
1,815
ASP.NET WebAPI change file name?
<p>I am trying to change the file name of images to the value that I posted in the input box <code>username</code>. The files are getting uploaded to the server and also, after overriding <code>GetLocalFileName</code> the file name is changed from "BodyPart_(xyz)" to the original one. How do I rename them to the value ...
2
1,825
Simple proxy server "Connection reset by peer" error
<p>I am trying to write my own very basic proxy server, I just want my code to send the request and receive a response and sends it back to the browser. My code (which I got from <a href="https://null-byte.wonderhowto.com/how-to/sploit-make-proxy-server-python-0161232/" rel="nofollow noreferrer">this</a> tutorial) is: ...
2
1,626
Reposted from GitHub: Spring Boot Application fails to start with error "java.lang.NoSuchMethodError
<p>Please note: This is an issue moved from GitHub <strong>Spring Boot Application fails to start: Reports an error "Caused by: java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Object;)V</strong></p> <p>**I am trying to add a dependency(using older spring boot 1.5.10....
2
2,621
Apache Beam reading from Kafka gives CoderException: java.io.EOFException
<p>I've implemented a Beam pipeline reading from Kafka, based on the docs here: <a href="https://github.com/apache/beam/blob/master/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java#L125" rel="nofollow noreferrer">https://github.com/apache/beam/blob/master/sdks/java/io/kafka/src/main/java/org/a...
2
1,736
MVC 3 razor - maintain checkbox values between page requests
<p>I have a page with checkboxes which are used to filter a webgrid. </p> <p>To give my question some context by unchecking a checkbox the data will be filtered to show fewer results in my webgrid by using ajax request. But once I click on the numbers below the webgrid to cycle through the next set of records in the g...
2
2,257
Toggle visibility of DIV based on Dropdown
<p>I have never used Javascript before, only HTML and CSS. I am attempting to have my information show only when selected from my drop down. I don't know any Javascript so any help would be overly appreciated. This is my html so far:</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf...
2
1,755
Django REST auth: error rendering django-allauth template after email confirmation
<p>I'm using a Django REST Framework API to communicate from my AngularJS frontend to the Django backend, which is working really well. I installed the super helpful django-rest-auth package as well as their optional registration add on. Authentication works, and registration mostly works as well.</p> <p>My problem is...
2
1,807
Error installing Chromium on Windows: assert vc_lib_um_path
<p>I'm trying to install Chromium on my Windows machine. I'm closely following the <a href="https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md" rel="nofollow noreferrer">instructions</a> linked to from the Chromium project site. I tried running the command <code>gn gen out/Defaul...
2
1,882
Flutter: How to Split text into 2 lines
<p>I'm using columns to display 2 texts. 1st text represents the title and 2nd text displays the quotation. I'm trying to split the quotation text into multi-lines using the max line's property, but the text is overlapping with other items. I try to use <code>Expanded</code> and flexible property to overcome this issu...
2
3,115