texts
sequence
tags
sequence
[ "MongoDB - findOne by _id returns null in shell", "When I run a simple findOne to get a document with no filter, I get this:\n\nmongos> db.mycollection.findOne({},{_id:1})\n{ \"_id\" : \"1d0eb04fd0325cd79e4f8dc24268c6ad2205082199957ce42ffb9e802eec73c9\" }\n\n\nBut when I feed that _id back in as a filter, I get no results:\n\nmongos> db.mycollection.findOne({ \"_id\" : \"1d0eb04fd0325cd79e4f8dc24268c6ad2205082199957ce42ffb9e802eec73c9\" } )\nnull\n\n\nWhy is this? When I search on other fields I am able to get a result, but searching with _id returns nothing.\n\nOf note is that these documents include a nested object with it's own _id. Searching using this nested._id field also returns nothing.\n\nMy environment: 2 shard mongoDB 3.4 running on Centos 7. Each replica set has 3 members and everything looks healthy." ]
[ "mongodb", "mongodb-query" ]
[ "Highcharts export to PDF - results in \"cannot display webpage\" using IE9", "Trying to export Highcharts to PDF using IE9. I have tried the following code, which results in \"IE Page cannot be displayed\" error. Can anyone please guide me to fix the bug? Really appreciate your time and help.\n\nMy Code:\n\n function getData() {\n var myChart;\n var options = {\n chart : {\n renderTo : 'container',\n type : 'area',\n },\n xAxis : {\n categories : []\n },\n exporting: {\n enabled : true,\n type: 'application/pdf'\n },\n series : []\n };\n\n $.get(url, function(xml) {\n var $xml = $(xml);\n $xml.find('categories month').each(\n function(i, category) {\n options.xAxis.categories.push($(category).text());\n });\n $xml.find('Type Series').each(\n function(i,series){\n var seriesOptions = {\n name : $(series).find('name').text(),\n data : [],\n };\n $(series).find('data point').each(\n function(i,point){\n seriesOptions.data.push(parseInt($(point).text()));\n });\n options.series.push(seriesOptions);\n });\n myChart = new Highcharts.Chart(options);\n });\n\n Highcharts.getSVG = function(charts) {\n var svgArr = [],\n top = 0,\n width = 0;\n\n $.each(charts, function(i, chart) {\n var svg = chart.getSVG();\n svg = svg.replace('<svg', '<g transform=\"translate(0,' + top + ')\" ');\n svg = svg.replace('</svg>', '</g>');\n\n top += chart.chartHeight;\n width = Math.max(width, chart.chartWidth);\n\n svgArr.push(svg);\n });\n\n return '<svg height=\"'+ top +'\" width=\"' + width + '\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">' + svgArr.join('') + '</svg>';\n };\n\n Highcharts.exportCharts = function(charts, options) {\n // Merge the options\n\n options = Highcharts.merge(Highcharts.getOptions().exporting, options);\n\n // Post to export server\n Highcharts.post(options.url, {\n filename: options.filename || 'chart',\n type: options.type,\n width: options.width,\n svg: Highcharts.getSVG(charts)\n });\n };\n $('#export').click(function() {\n Highcharts.exportCharts([myChart]);\n });\n }\n\n\n\n<body>\n<button id=\"export\">Export all</button>\n<div id=\"container\" class=\"myChart\" style=\"width: 100%; height: 500px; margin: 0 auto\"></div>\n</body>" ]
[ "javascript", "internet-explorer", "pdf", "highcharts" ]
[ "How to add popup/bubble?", "I tryed make demo chrome extension. Logic:\nExtension gets selected text (after context menu click) and show it in a popup window, like this (TmTranslator img for example):\n\n\nMy code:\n\nchrome.contextMenus.create({ //add context menu \n id: \"myContextMenu\",\n title: \"Get Text\",\n contexts:[\"selection\"],\n onclick: createPopup\n});\nfunction createPopup(info){ \n var selText = info.selectionText; //Get selected text\n //Now, how to add bubble with selected text???\n}" ]
[ "google-chrome", "google-chrome-extension" ]
[ "IF statement based on dates", "I have an Excel sheet that shows a Target date in one column and the next column has the Actual date. I have added statements to turn the Target date to RED, GREEN or YELLOW. \n\nHow do I turn the Target date column back to white after a date is added to the Actual date column?" ]
[ "excel", "if-statement", "conditional-statements" ]
[ "Mocha subbing results are different based on the file path", "I am trying to set up stubbing out of middleware using Sinon in my Node App.\nWhen I run a mocha test and point directly to the test file it stubs out correctly. When I point to all my testing folder and run the tests recursively it does not stub out the middleware and fails.\n\nFile Structure: \n\ntest\n functional\n checklist\n test.spec.js\nlib\n middleware\n auth.js (this is what is being stubbed out)\n\n\ntest.spec.js\n\nconst chai = require('chai');\nconst chaiHttp = require('chai-http');\nconst sinon = require('sinon');\nchai.use(chaiHttp);\nconst should = chai.should();\n\n// Requirements\nconst auth = require('../../../lib/middleware/auth')\n\ndescribe('/checklist/checklistItemLevel',function() {\n let checkTokenStub;\n beforeEach(function(){\n checkTokenStub = sinon.stub(auth,'checkToken').callsFake((req,res,next)=>{\n console.log('Stubbed')\n next()\n });\n\n\n })\n afterEach(function(){\n auth.checkToken.restore();\n })\n context('/ POST',function() {\n it('should return hello',function(done){\n chai.request(require('../../../server'))\n .post('/api/v1/checklist/checklistItemLevel')\n .end((err,res)=>{\n res.should.have.status(200);\n res.text.should.be.eql('Hello');\n done(err);\n })\n })\n })\n})\n\n\nrouter.js\n\nconst router = require('express').Router();\nconst controller = require('./controller')\nconst auth = require('../../../lib/middleware/auth')\n\nrouter.post('/',auth.checkToken,(req,res,next)=>{\n res.send('Hello');\n});\n\nmodule.exports = router;\n\n\nMocha Calls\n\nmocha \"**/*.spec.js\" // <- Doesnt stub out middleware\nmocha \"test/functional/checklist/*.spec.js\" // <- Stubs out successfully" ]
[ "node.js", "mocha.js", "sinon" ]
[ "Search field isn't on same line as text", "I'm trying to insert a search field in my header (black zone) but doesn't work. I want the search field inline with \"SimpleCMS\"...\n\nSee this screenshot to understand:\n\n\n\nI want it on the same line as the header text...\n\nThere's my HTML code:\n\n<div id=\"header\"><h1><?php echo($header_text); ?></h1>\n <div style=\"float: right;\">\n <form action=\"search.php\" method=\"get\">\n <input type=\"text\" name=\"q\" id=\"q\" value=\"Search...\" />\n <input type=\"submit\" value=\"Search\" />\n </form>\n </div>\n</div>\n\n\nAnd my CSS:\n\n#header\n{\n padding: 5px 10px;\n background: #000;\n color: #FFF;\n text-align: left;\n}" ]
[ "html", "css" ]
[ "PHP json_encode() gives no value", "if(isset($_POST[\"search\"]) && isset($_SESSION['username'])){\n $database = new Database; \n $connection = $database -> connect(); \n $sql = \"SELECT surname, name, street, streetNumber FROM customers\"; \n if(!$req = $connection -> prepare($sql)){\n echo \"e001\";\n }else{\n $req -> execute();\n $res = $req -> get_result();\n\n $json = array();\n\n while($row= $res -> fetch_assoc()){\n $json['customers:'] = $row;\n }\n print json_encode($json); \n $req -> close();\n $database -> disconnect($connection);\n }\n}\n\n\nAs far as I see this code is pretty much like it's tought here on stack overflow.\n\nSo I don't understand why I just won't get a response when I request this via AJAX and look at the network tab in Chrome debug.\n\nEverything works, all the scripts run on, I don't get any errors, just an empty response.\n\nEDIT:\nOh, and i tried, i get data from the database with that funcition, tried by echoing without json_encode(), so that can't be the problem.\n\nEDIT: Asked for JS code, doesn't do anything with the response yet since i view the response in the browser.\n\nfunction loadCustomers() {\n $.ajax({\n url: 'scripts/backend/customers.php',\n type: 'post',\n data: {\n 'search': \"Schramm\"\n },\n dataType: \"json\",\n success: function(response, status) {},\n error: function(xhr, desc, err) {\n console.log(xhr);\n console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n });\n}\n\n\nEDIT: The database and tables are set to UTF-8 so it isn't an encoding problem." ]
[ "php", "jquery", "json", "ajax" ]
[ "How can I load a div as one element?", "I'm trying to create a dynamic certificate that will automatically be sent to Amazon customers via email. Amazon restricts html and css tag usage, so I've had to get creative with how I can include a certificate that dynamically inserts customers' first name in emails. I've somehow managed to create the dynamic certificate using overlapping table cells and line breaks to place the text where I want without using position or margins. The last step would be to load the div as one element (e.g. as one clickable image) in the email so that customers can easily print the image if they'd like to. I can't seem to find any way to do this. Anyone have any ideas? \n\n\r\n\r\n.table {\r\n border: 1px solid #dddddd;\r\n}\r\n\r\n.certificate {\r\n width: 320px;\r\n}\r\n\r\n.invis {\r\n font-size: 0.1px;\r\n}\r\n\r\n.name {\r\n font-size: 14px;\r\n font-weight: 900;\r\n}\r\n<table class=\"table\">\r\n <tr>\r\n <td></td>\r\n <td rowspan=2><img src=\"http://infoelink.com/wp-content/uploads/2018/05/empty-certificate-templates-6.jpg\" class=\"certificate\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2>\r\n <table>\r\n <tr>\r\n <span class=\"invis\">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</span>\r\n <span class=\"name\">John</span>\r\n </tr>\r\n <tr>\r\n <td><br><br>\r\n </td>\r\n </tr>\r\n <tr>\r\n </table><span class=\"invis\">A</span></td>\r\n <td></td>\r\n </tr>\r\n</table>" ]
[ "html", "css", "email", "dynamic" ]
[ "Replace Column using ID in MySQL", "(Fairly new to SQL so please bear with me :) )\nI have a table with two entries:\nTable 1:\n\n\n\n\nID\nOwner\nDonor\nSire\nET1\n\n\n\n\n12\nJones\nDaisy\nBob\n18\n\n\n18\nOwens\nDaisy\nBob\n834\n\n\n\n\nAs you can see, the two entries share the same Donor and the same Sire. I also need them to share the same ET1 number. Currently, the first entry has an ET1 which is actually the ID of the second entry, but I need them both to share the same ET1. I used the following code, and it enters however it does not actually update any of the entries. I thought it would be simple but can someone shed some light on what I could be doing wrong?\nupdate table1 t\nset t.ET1 = t.ET1\nwhere t.ET1 = t.ID" ]
[ "mysql", "sql" ]
[ "Pop or Dismiss a Xamarin.Form ContentPage after pushing from Native", "In Xamarin, Shared Project.\n\nIs there any way to dismiss or pop a ContentPage after launching it from an iOS or Android Native stack?\n\nI currently do this to launch the ContentPage:\n\niOS \n\nviewController.PresentViewController(contentPage.CreateViewController(), true, null);\n\nAndroid\n\nStartActivity(typeof(ContentPageActivity));\n\nand I get the page to come up on both platforms, although I cannot dismiss the Page.\n\nThings that don't work:\n\npopasync(), popmodalasync(), removepage()\n\nMaybe I have to create a reference to their parent view that launched them? But I was under the impression on Android, each ContentPage needs a single Activity to launch. And on iOS you need to launch it from a view controller and create the view controller content page.\n\nAny insights to this would be awesome.\n\nThanks!" ]
[ "xamarin", "xamarin.ios", "xamarin.android", "xamarin.forms" ]
[ "Function t is not binding correctly in latest i18next versions", "The code below (a localization interceptor for an Alexa skill) works fine with i18next version 10.5.0 but doesn't work in the latest versions. It get a message of function t not being recognized, it would seem t is not binding correctly.\n\nI can't find why this is happening (I don't know what was updated in i18next). Can anybody shed some light on this?\n\n// This request interceptor will bind a translation function 't' to the requestAttributes object\nconst LocalizationInterceptor = {\n process(handlerInput) {\n const localizationClient = i18n.use(sprintf).init({\n lng: handlerInput.requestEnvelope.request.locale,\n fallbackLng: 'en',\n overloadTranslationOptionHandler: sprintf.overloadTranslationOptionHandler,\n resources: languageStrings,\n returnObjects: true\n });\n const attributes = handlerInput.attributesManager.getRequestAttributes();\n attributes.t = function (...args) {\n return localizationClient.t(...args);\n }\n }\n}" ]
[ "internationalization", "alexa", "alexa-skills-kit", "alexa-skill", "i18next" ]
[ "How to write xml schema for this xml file", "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \n <ConnectionConfig>\n <Machine Ip=\"192.168.0.7\">\n <ConnectionString>Data Source=TWO;Initial Catalog=Freight;User ID=sa;Password=f5tech</ConnectionString>\n </Machine>\n </ConnectionConfig>" ]
[ "asp.net", "xml" ]
[ "How to include more than one class while fetching from database", "I want to include two classes while fetching. I know how to do this with one class but I am not sure how to do it with two.\n\nHere I am including Student\n\nvar service = dc.service.Include(\"Student\").OrderBy(i => i.id);\n\n\nI am not sure how to add both Student and Program" ]
[ "asp.net-mvc", "entity-framework", "asp.net-mvc-4", "asp.net-mvc-5", "datacontext" ]
[ "Inline CSS background image not showing up", "I am a beginner with regards to CSS and HTML but have searched everywhere for a solution to this and still have no idea what is going on.\nI am attempting to create a background image with a logo/subtitle on top of it. Although only the subtitle and alt text is showing up. I have gone over the syntax multiple times and am still unsure of where the error is as I am declaring the correct css specifications from what I can tell.\n#HTML:\n<div class="blog-type-wrapper">\n <div class="blog-type-img-background" style="background-image:url(images/software.jpg)"></div>\n <div class="img-text-wrapper">\n <div class="logo-wrapper">\n <img src="images/software-logo.png" alt="soft">\n </div>\n <div class="subtitle">\n Software N Stuff\n </div>\n </div>\n </div>\n\n#CSS\n.blog-type-img-background{\n height:500px;\n width:100%;\n background-size:cover;\n background-position:center;\n background-repeat:no-repeat;\n}\n\nThere is space on the web page allocated to the image, however no images appear. The images are in another folder named "images" in the same directory as both the html and css files. This is occurring in a PHP file, I have attempted researching if that makes a difference in comparison to HTML file, and have found nothing but I cannot see how it would make a difference with regards to this issue.\nEdit\nThe file path was incorrect. Thank you to @Heretic Monkey and others\n"Look at the Networking tab of your browser's developer tools and look for any errors, like a 404 with the image's file name. That will show the full URL to the image it's trying to load. It's likely incorrect, relative to the HTML file. Fix that"\nAfter looking in the networking tab I realized that my file path was incorrect and changing it to style="background-image:url(wp-content/themes/my-theme/images/software.jpg)"> worked in loading the image as expected." ]
[ "html", "css" ]
[ "Java Swing getToolkit and custom cursor strange behavior", "I am creating custom cursors in my Netbeans Java Swing app. For example, where 'cursorImage' is an image file on disk, I create my default cursor like so:\n\nCursor defaultCursor = toolkit.createCustomCursor(cursorImage, hotspot, name);\n\n\nOnce I starting using custom cursors, my application started exhibiting very strange bugs that I cannot even explain. Through troubleshooting, I found the following code to be the problem. This code is related to my app being a Netbeans SingleFrameApplication.\n\nToolkit toolkit = MyApp.getApplication().getMainView().getRootPane()\n.getToolkit().getDefaultToolkit();\n\n\nThe code exists in a simple non-GUI POJO class called CursorController.\n\nI replaced it by this code:\n\nComponent c = new JButton(\"getToolkit\");\nToolkit toolkit = c.getToolkit();\n\n\nI don't even display the button anywhere. But the bugs are gone now.\n\nThe problem is that I do not understand the problem or why it is (apparently) resolved now. I'm not very confident that I have solved it the right way. I shouldn't really create a button just to get the toolkit, right?" ]
[ "java", "swing", "mouse-cursor" ]
[ "Gzip on js/css files on Django", "I know that it's better to use something like AWS for static files but I am on developing stage and I prefer to have javascript/css files on localhost.\n\nIt would be great if I could get gzip working on my javascript files for testing. I am using the default gzip middleware but it's just compressing the view request.\n\nMy template looks like:\n\n<script src='file.js' type='application/javascript'></script>\n\n\nThere should be a type-of-file list similar to Nginx for the django-based-server. How can I add application/javascript, text/javascript, etc for gzip compression?" ]
[ "javascript", "django", "gzip" ]
[ "Average of last 3 purchases", "I need help to create a query to calculate the average price of last 3 purchases for each product...\nlike shown on this image:\n\n\n\nHow can I do this?" ]
[ "sql", "sql-server", "sql-server-2008" ]
[ "IntelliJ cannot read scheme when starting", "I keep getting error messages when I start IntelliJ. There are about 5 or 6 of them, all like the attached image, but each with a different color scheme named. Is there a way for me to fix this?" ]
[ "intellij-idea", "settings" ]
[ "How to get a HTML5 audio tag audio to come from receiver instead of speaker?", "I was trying to do the following on IPhone:\n\n\nload a webpage on UIWebView control in my application.\nThe webpage has an audio tag (<audio/> in HTML5) with source of the audio file set correctly. \nWebpage loads correctly and when I click on play button the audio was coming out from the receiver. \n\n\nHow do I make the audio to come out of the receiver instead of the speaker?\n\nWhat have I already done?\n\n\nI read about the Audio session services on apple platforms.\nMy initial category was kAudioSessionCategory_PlayAndRecord.\nNow by default, according to the documentation the audio should go to the reciever. \nThe above did not work.\nSo I started listening on the kAudioSessionProperty_AudioRouteChange property. So when I played audio using the audio tag I got a callback. In the callback I queried for the audio route which came back with a string \"RecieverAndMicrophone\"\n\n\nSo looks like the browser control is doing some magic to override the app default audio session settings. How do I change that behavior through my app?" ]
[ "iphone", "html", "audio", "speaker" ]
[ "protocol comparison for notification server with node.js", "I'd like to implement push notification server using node.js. The basic scenario is: \n\n\nSome applications sends notification messages to the server.\nNotification server receives the request and forwards the message to uesr's mail or IM client based on user's preference.\n\n\nIn step 1, which protocol (e.g. REST, socket, HTTP/XML and so on.) would you recommend from the performance perspective?\n\nAlso in step 2, I have a plan to use node-xmpp module for IM client but for mail, which way is the best to implement? For example,\n\n\nJust use SMTP. (But I think this might occur performance degradation because SMTP is an expensive communication and performance depends on SMTP server capacity.\nuse queue mechanism, in order to avoid drawbacks from the above. node.js app simply puts the message into the queue, and smtp server pulls the message.\nother solutions...\n\n\nThanks in advance." ]
[ "node.js", "push-notification" ]
[ "Cant get the view to show up on the TeamStudio Unplugged app", "I have tried putting the view into a custom control and then putting the custom control in the UnpMain.xsp, and I have tried putting it directly into the UnpMain.xsp, neither of these works. I can get other components to show, such as text fields, check-boxes, labels, and so on but for whatever reason the view will not show in my app, when I open the UnpMain.xsp within a browser it shows perfectly fine, so it is not an ACL issue." ]
[ "xpages", "teamstudio-unplugged" ]
[ "while running command Heroku logs Errros are below", "I am trying to push my app on heroku to go live then getting this error:\n\n2018-02-15T18:19:55.377507+00:00 heroku[router]: at=error code=H10\ndesc=\"App crashed\" method=GET path=\"/\" host=shoppingwave.herokuapp.com\nrequest_id=551a7986-4cd6-4b43-9b9a-9f1eb46a5bc4 fwd=\"157.50.221.99\"\ndyno= connect= service= status=503 bytes= protocol=https" ]
[ "django", "python-3.x", "heroku" ]
[ "retrieving current node in sequence when looping over this sequence in an xpath predicate", "I need to convert this input xml:\n<Problems>\n <problem location="engineroom/boiler/nozzle"/>\n <problem location="engineroom/boiler/nozzle/leak"/>\n <problem location="office/printer/paper"/>\n <problem location="office/printer/paper/empty/A4"/>\n <problem location="office/printer/paper/empty/A3"/>\n <problem location="garage/truck/window"/>\n <problem location="garage/truck/window/crack"/>\n</Problems>\n\nto this output xml:\n<Problems>\n <problem ignore="leak"/>\n <problem ignore="leak"/>\n <problem ignore="empty"/>\n <problem ignore="empty"/>\n <problem ignore="empty"/>\n <problem location="garage/truck/window"/>\n <problem location="garage/truck/window/crack"/>\n</Problems>\n\nMy current code involves hardcoding the items of interest ('leak', 'empty') and its parent element ('nozzle', 'paper'):\n <xsl:template match="@* | node()">\n <xsl:copy>\n <xsl:apply-templates select="@* | node()"/>\n </xsl:copy>\n </xsl:template>\n \n <xsl:template match="problem[contains(@location, 'leak')]\n | problem[ends-with(@location, 'nozzle')][contains(following-sibling::problem[1]/@location, 'nozzle/leak')]">\n <xsl:apply-templates select="." mode="display">\n <xsl:with-param name="location" select="'leak'"/>\n </xsl:apply-templates>\n </xsl:template>\n\n <xsl:template match="problem[contains(@location, 'empty')]\n | problem[ends-with(@location, 'paper')][contains(following-sibling::problem[1]/@location, 'paper/empty')]">\n <xsl:apply-templates select="." mode="display">\n <xsl:with-param name="location" select="'empty'"/>\n </xsl:apply-templates>\n </xsl:template>\n\n <xsl:template match="problem[contains(@location, 'burnt')]\n | problem[ends-with(@location, 'PCB')][contains(following-sibling::problem[1]/@location, 'PCB/burnt')]">\n <xsl:apply-templates select="." mode="display">\n <xsl:with-param name="location" select="'burnt'"/>\n </xsl:apply-templates>\n </xsl:template>\n\n <xsl:template match="problem" mode="display">\n <xsl:param name="location"/>\n <problem ignore="{$location}"/>\n </xsl:template>\n\nWhat I've tried is the following. But I don't know how to pass the current node in the sequence (e.g. 'leak') to the "display" template. Also, please let me know if there's a better way than this ugly matching expression. Thanks!\n <xsl:variable name="issues">\n <issue name="leak" parent="nozzle"/>\n <issue name="empty" parent="paper"/>\n <issue name="burnt" parent="PCB"/>\n </xsl:variable>\n \n <xsl:template match="problem[true() = (for $i in $issues/issue return if(\n contains(@location,$i/@name)\n or ends-with(@location, $i/parent) and contains(following-sibling::problem[1]/@location,$i/@name)\n ) then true() else false())]">\n <xsl:apply-templates select="." mode="display">\n <xsl:with-param name="location" select="'???'"/>\n </xsl:apply-templates>\n </xsl:template>" ]
[ "xslt-2.0", "xpath-2.0" ]
[ "RestKit - Incorrect body contents on POST request", "I'm trying to POST the following JSON using the [RKObjectManager sharedManager] postObject method:\n\n{\n \"SerialNumber\":\"123XYZ\"\n}\n\n\nBut my web service receives:\n\n{\n \"docs\\/:docId\\/serials\":{\"SerialNumber\":\"123XYZ\"}\n} \n\n\nWhere \"docs\\/:docId\\/serials\" is the path parameter I pass into the [RKObjectManager sharedManager] postObject method, specifying the path needed for my web service method. \n\nDoes anyone know why this extra path data is included in the body contents being posted?\n\nThe mapping from my NSObject based class seems to be working fine, the correct serial number is passed through into the JSON. I've set the RKObjectManager to use a MIME type of JSON on requests, using the following code, it wouldn't be anything to do this would it?\n\nobjectManager.requestSerializationMIMEType = RKMIMETypeJSON;\n\n\nAny clues would be much appreciated, and I'll happily post up more code if needed too.\n\nThanks in advance." ]
[ "json", "restkit", "restkit-0.20" ]
[ "How do I add another JOIN statement in my query?", "I have a .aspx page that has a gridview item on it. The gridview originally displays properly with the query below:\n\nCommandText = \"SELECT AnalyticsHub_Requests.*, \n AnalyticsHub_StatusCodes.ShortDescription AS StatusText \n FROM AnalyticsHub_Requests \n LEFT JOIN AnalyticsHub_StatusCodes \n ON (AnalyticsHub_Requests.StatusId=AnalyticsHub_StatusCodes.Id) \n WHERE AnalyticsHub_Requests.StatusId IN (4,6)\";\n\n\nI want to display more information from another table so the person assigned to the request is listed. I am trying it like this:\n\nCommandText = \"SELECT AnalyticsHub_Requests.*, AnalyticsHub_StatusCodes.ShortDescription \n AS StatusText \n FROM AnalyticsHub_Requests \n LEFT JOIN AnalyticsHub_StatusCodes \n ON (AnalyticsHub_Requests.StatusId=AnalyticsHub_StatusCodes.Id) \n WHERE AnalyticsHub_Requests.StatusId IN (4,6) , AnalyticsHub_Assignees.* \n LEFT JOIN AnalyticsHub_Requests \n ON (AnalyticsHub_Assignees.AssigneeId=AnalyticsHub_Requests.AssigneeId) \n WHERE AnalyticsHub_Requests.AssigneeId IN (1,2,3,4,5,6)\";\n\n\nNothing will display at all though when I try to make it display the assignee information along with it. How do I get it to display the assignee information in the table?" ]
[ "sql", "asp.net", "gridview" ]
[ "Converting package using S3 to S4 classes, is there going to be performance drop?", "I have an R package which currently uses S3 class system, with two different classes and several methods for generic S3 functions like plot, logLik and update (for model formula updating). As my code has become more complex with all the validity checking and if/else structures due to to the fact that there's no inheritance or dispatching based on two arguments in S3, I have started to think of converting my package to S4. But then I started to read about the advantages and and disadvantages of S3 versus S4, and I'm not so sure anymore. I found R-bloggers blog post about efficiency issues in S3 vs S4, and as that was 5 years ago, I tested the same thing now:\n\nlibrary(microbenchmark)\nsetClass(\"MyClass\", representation(x=\"numeric\"))\nmicrobenchmark(structure(list(x=rep(1, 10^7)), class=\"MyS3Class\"),\n new(\"MyClass\", x=rep(1, 10^7)) )\nUnit: milliseconds\n expr\n structure(list(x = rep(1, 10^7)), class = \"MyS3Class\")\n new(\"MyClass\", x = rep(1, 10^7))\n min lq median uq max neval\n 148.75049 152.3811 155.2263 159.8090 323.5678 100\n 75.15198 123.4804 129.6588 131.5031 241.8913 100\n\n\nSo in this simple example, S4 was actually bit faster. Then I read SO question about using S3 vs S4, which was quite much in favor of S3. Especially @joshua-ulrich 's answer made me doubt against S4, as it said that \n\n\n any slot change requires a full object copy\n\n\nThat feels like a big issue if I consider my case where I'm updating my object in every iteration when optimizing log-likelihood of my model. After some googling I found John Chambers post about this issue, which seems to be changing in R 3.0.0.\n\nSo although I feel it would be beneficial to use S4 classes for some clarity in my codes (for example more classes inheriting from the main model class), and for the validity checks etc, I am now wondering is it worth all the work in terms of performance? So, performance wise, is there real performance differences between S3 and S4? Is there some other performance issues I should be considering? Or is it even possible to say something about this issue in general?\n\nEDIT: As @DWin and @g-grothendieck suggested, the above benchmarking doesn't consider the case where the slot of an existing object is altered. So here's another benchmark which is more relevant to the true application (the functions in the example could be get/set functions for some elements in the model, which are altered when maximizing the log-likelihood):\n\nobjS3<-structure(list(x=rep(1, 10^3), z=matrix(0,10,10), y=matrix(0,10,10)),\n class=\"MyS3Class\")\nfnS3<-function(obj,a){\n obj$y<-a\n obj\n}\n\nsetClass(\"MyClass\", representation(x=\"numeric\",z=\"matrix\",y=\"matrix\"))\nobjS4<-new(\"MyClass\", x=rep(1, 10^3),z=matrix(0,10,10),y=matrix(0,10,10))\nfnS4<-function(obj,a){ \n obj@y<-a\n obj\n}\n\na<-matrix(1:100,10,10)\nmicrobenchmark(fnS3(objS3,a),fnS4(objS4,a))\nUnit: microseconds\n expr min lq median uq max neval\n fnS3(objS3, a) 6.531 7.464 7.932 9.331 26.591 100\n fnS4(objS4, a) 21.459 22.393 23.325 23.792 73.708 100\n\n\nThe benchmarks are performed on R 2.15.2, on 64bit Windows 7. So here S4 is clearly slower." ]
[ "performance", "r", "oop", "s4" ]
[ "ExecuteQuery in multiple threads closes hsqldb database connection", "I'm trying to improve a function which selects data from hsqldb so I tried to run it in multiple threads but I got the following exception:\n\njava.sql.SQLNonTransientConnectionException: connection exception: closed\n at org.hsqldb.jdbc.Util.sqlException(Unknown Source)\n at org.hsqldb.jdbc.Util.sqlException(Unknown Source)\n at org.hsqldb.jdbc.Util.sqlException(Unknown Source)\n at org.hsqldb.jdbc.JDBCStatementBase.checkClosed(Unknown Source)\n at org.hsqldb.jdbc.JDBCStatementBase.getResultSet(Unknown Source)\n at org.hsqldb.jdbc.JDBCStatement.getResultSet(Unknown Source)\n at org.hsqldb.jdbc.JDBCStatement.executeQuery(Unknown Source)\n\n\nThis is the function I tried to run it in a new thread every time:\n\npublic List<String> getAllClassNames(boolean concrete) throws ClassMapException {\n List<String> result = new ArrayList<String>();\n\n\n try {\n ResultSet rs = null;\n Connection connection = DBConnection.getConnection();\n Statement st = connection.createStatement();\n if (concrete)\n rs = st.executeQuery(\"select cd_name from CLASS_DESCRIPTORS where CD_CONCRETE=true order by cd_name\");\n else\n rs = st.executeQuery(\"select cd_name from CLASS_DESCRIPTORS order by cd_name\");\n while (rs.next()) {\n result.add(rs.getString(\"cd_name\"));\n }\n } catch (SQLException e) {\n _log.error(\"SQLException while retrieve all class names.\" + e.getMessage(), e);\n throw new ClassMapException(\"SQLException while retrieve all class names.\" + e.getMessage(), e);\n } finally {\n DBConnection.closeConnection();\n }\n return result;\n }\n\n\nI read that executing multiple selects by different threads closes connection. Is this true and how to solve it?" ]
[ "java", "multithreading", "hsqldb" ]
[ "How to improve Gnuplot html5 image quality?", "I use gnuplot 4.6 release and 5.0 development versions on Linux, Mac, and Windows.\n\nI tried to make basic output to relatively recent supported HTML5 canvas terminal and receive pretty blurry image on canvas.\n\nWhat I did is the following in the interactive mode:\n\nset terminal canvas\nset output \"test-canvas.html\"\ntest\n\n\nHere is the result.\n\nThe print-screen of such a html5 canvas is HERE.\n\nIt's svg counterpart is HERE.\nBoth are drawn by vectors but they appear very different image qualities.\n\nSimilar situation also appears on other sites, for instance, here.\n\nDoes anyone know how to improve the image quality? I don't know much about HTML5 canvas but by looking into the source code, I think the image is constructed in a vectorial way, which means the image should be very crispy up to antialias capability. \n\nAny solution? Thanks!" ]
[ "html", "image", "canvas", "gnuplot" ]
[ "Escape a dollar sign in Selenium xpath locator", "I want to locate an element with attribute $9a but apparently the dollar sign is causing problems. When I use expression: \n\n//td[@id='isc_6T']//span[@$9a='browse'] \n\n\nI get the following exception\n\nThe given selector //td[@id='isc_6T']//span[@$9a='browse'] is either invalid or does not result in a WebElement. The following error occurred:\nInvalidSelectorError: Unable to locate an element with the xpath expression //td[@id='isc_6T']//span[@$9a='browse'] because of the following error:\nSyntaxError: The expression is not a legal expression.\nCommand duration or timeout: 9 milliseconds\nFor documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html\nBuild info: version: '2.43.1', revision: '5163bceef1bc36d43f3dc0b83c88998168a363a0', time: '2014-09-10 09:43:55'\nSystem info: host: 'daniel', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-39-generic', java.version: '1.7.0_65'\nSession ID: 7fdd584b-10b8-4c5a-ab64-72fe7cff7e2a\nDriver info: org.openqa.selenium.firefox.FirefoxDriver\nCapabilities [{platform=LINUX, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=33.0}]\n\n\nEDIT:\nThis is the HTML part that I am trying to locate. (id is dynamic so it can't be used directly)\n\n<span handlenativeevents=\"false\" $9a=\"browse\" id=\"isc_T9\" role=\"button\">\n<img border=\"0\" align=\"TEXTTOP\" height=\"18\" width=\"18\" draggable=\"true\" suppress=\"TRUE\" style=\"vertical-align:middle;margin-top:0px;margin-bottom:0px;\" id=\"isc_TA\" src=\"some_image.png\">\n</span>\n\n\nI have already created a workaround with parsing HTML with Jsoup to determine current dynamic id but I still want a cleaner solution" ]
[ "java", "selenium", "xpath", "webdriver" ]
[ "Can anyone explain how Release Management compliments TFS in the devOps pipeline?", "I always get confused which area they both cover in the DevOps space from a Microsoft perspective. Understanding ALM and what are roles does each play? How do they provide solution consolidation for multiple projects/teams for code deployments." ]
[ "tfs", "release-management", "alm" ]
[ "Am I obligated to use Stateful Widgets to dispose stream controllers in Flutter?", "When dealing with streams and stream controllers in Flutter, am I forced to use Stateful Widgets to dispose the controller? or is there any other way to do so using Stateless Widgets?\n\nThis is how it's done normally in Stateful Widgets:\n\nvoid dispose() {\n _myController.dispose();\n super.dispose();\n}" ]
[ "dart", "flutter" ]
[ "Generate JTextField Input Guesses", "I have a Swing Application with a JTextField that the user is Supposed to Input ID Numbers. The ID Numbers are Stored in a database. During Inquiry from the DB the End user is again required to Input the ID Number so as to Query the DB. I need suggestions as to what to do so that when the user Inputs the First Digits of the ID Number, Guesses appear below the JtextField for the User to Choose from. Is this Possible with Swing and what Is the Best way to Implement it?" ]
[ "java", "swing", "autocomplete", "jcombobox", "jtextfield" ]
[ "EXC_ARITHMETIC Error in Xcode", "if (([gameplay1.text intValue] % [gameplay3.text intValue]) == 0)\n{\n //Do something\n}\n\n\nCan someone please help me out with this?" ]
[ "iphone" ]
[ "Jquery mobile panel error", "On my site http://www.mobile-development.org each page has a different panel which you can open using the header. Only the first page has a link instead of a panel. When I navigate to a course page and then back to home and do this twice then I get an error when I open the course information page. \n\nIt is a difficult problem which is also difficult to explain. Hopefully someone can take a look." ]
[ "jquery-mobile", "panels" ]
[ "react native giving localstorage getItem not a function error", "I was trying to use the Async Storage official react native API. The code in my react native looks like this:\n\nexport function get(key) {\n return new Promise(function(resolve, reject) {\n AsyncStorage.getItem(key, (err, val) => {\n if (err) {\n reject(err)\n } else {\n if (val === null) {\n reject('key_not_found')\n } else {\n var parsedVal = JSON.parse(val)\n console.log('got value from storage =>', parsedVal);\n resolve(parsedVal)\n }\n }\n })\n });\n}\n\n\nI worked for a week without any problem, but recently it starts to give this error\n\n\n\nThe logger output from remote JS debugger looks like this\n\n\n\nI didn't change any of the npm modules except that I installed moment.js using npm install --save moment Any idea what might be happening here? \n\nUPDATE:\n\nThe places where I used this exported function are:\n\n//This one is inside the same file so I just use get without module name\nexport function retrieveCredential() {\n return new Promise(function(resolve, reject) {\n get('credential')\n .then((val) => {\n resolve(val)\n })\n .catch((err) => {\n console.log(err)\n reject(err)\n })\n });\n}\n\n//this function is also exported\nexport function autoLogin() {\n return new Promise(function(resolve, reject) {\n LocalStorage.retrieveCredential()\n .then((credential) => {\n loginWithEmail (credential.email, credential.password, false)\n .then(() => {\n resolve()\n })\n .catch((err) => {\n console.log(err)\n reject(err)\n })\n })\n .catch((err) => {\n console.log(err)\n reject(err)\n })\n });\n}\n\n//This is finally used in one of the component\nAuthentication.autoLogin()\n .then(() => { ... })\n .catch(() => { ... })\n\n\nProject search for localstorage.getItem result:" ]
[ "react-native" ]
[ "Searching with fork in C", "I'm supposed to be getting comfortable with fork, and I saw an exercise that said to use a fork call to search an array indexed from 0 to 15. We're to assume that each process can only do two things...(1) is to check to see if an array is length 1, and (2) compare a single element of an array to the number were searching for. Basically i pass it a number, and its supposed to do a finite number of forks and return the index of that number. Here's my code..\n\n#define MAXINDEX 16\n\nint forkSearch(int a[], int search, int start, int end){\n if(start == end){\n if(*(a + end) == search){\n return end;\n }\n } \n else{\n pid_t child = fork();\n if(child == 0) return forkSearch(a, search, start, end/2);\n else return forkSearch(a, search, (start + end)/2, end);\n }\n}\n\nint main(int argc, char* argv[]){\n int searchArray[MAXINDEX] = {1, 12, 11, 5, 10, 6, 4, 9, 13, 2, 8, 14, 3,\\\n 15, 7};\n printf(\"Should be 1. Index of 12 = %d\\n\", forkSearch(searchArray,\n 12, 0, MAXINDEX));\n return 0;\n} \n\n\nEverything in the return of this quickly exploding program seems to be either 1, 10, 11, or 13. Why isn't this working like it should." ]
[ "c", "fork", "binary-search" ]
[ "How to pass date value to directive without the double quotes?", "I create my directive, which passes a 'date variable' into it.\n\nThe thing is, the value obtained comes with a double quote (as in the image). \nIf I pass a normal string, this doesn't happen. \n\nHow to modify it?\n\nMy original intention is to apply the filter straighforward inside the template. Such as: \n\n<p> {{mdate | date: \"MMM\"}} </p>\n\n\nbut it seems not working and I have to use link function\n\nEDIT:\n\nThis is how i call this directive:\n\n <dbd-custom-calendar mdate=\"{{dateLatest}}\"></dbd-custom-calendar>\n\n\n\n\nEDIT 2:\n\nHuh. Found that I should use '=' instead of '@'!!!" ]
[ "date", "angularjs-directive", "angularjs-filter" ]
[ "ASP.NET MVC 5, Identity, Unity container solution architecture", "Assume a web project by ASP.NET MVC 5 and OWIN/Identity membership. The IoC is done with Unity. Everything is within one project now.\nQuestion: Does it make any sense to separate MVC, Idenity and IoC to isolated projects and encapsulate Identity into some IAccountService to be resolved by Unity in MVC project?\nThe question seems to be quite silly, but my rubber duck keeps silence for unknown reasons, any guess?\n\nThe goal I want to achieve looks like this\n\nASP.NET MVC (OWIN) --> IoC (Unity) --> AccountServiceImpl --> Identity\n\nBoth MVC, IoC --> Contracts (IAccountService)\n\nwhere --> is a project reference\n\nI need it to be able to change IoC container and also I need Identity data to be accessed from another projects through an interface" ]
[ "asp.net-mvc", "asp.net-identity-2" ]
[ "Swift - How do I store objects in cache as long as the app is running? - NSCache() gets cleared as soon as other vc gets displayed", "I am trying to save a custom class to cache, so that it doesn't have to be downloaded every time the vc is getting called. \nMy problem is though that the cache gets cleared when I open a different vc, so that when going back to the \"old\" vc no objects are stored in the cache anymore :(\n\nI even tried: cache.evictsObjectsWithDiscardedContent = false\n\nAny help is appreciated!" ]
[ "swift", "xcode", "uikit", "swift4", "nscache" ]
[ "What is the relationship/differences between Google App Engine, and \"normal\" web apps?", "I was trying to start to learn about programming on Firefox OS, and I heard that it is programmed with JavaScript and HTML5, and it uses the same structures of web apps.\nSaid that, I'm doing a course on Udacity ( I'm a beginner) that is about web development, and it talked about how to use the Google App Engine(we just made our own websites online, using python and some structures of the GAE), and I tryied to make some relationship with what I was seeing in the Firefox website, and I just coundn't figure out nothing." ]
[ "google-app-engine", "web-applications", "firefox-os" ]
[ "How to get which route called a component", "I am using react-route-dom, I want to implement this config:\n\n<Route exact path='/test/:id' component={MyComponent}/>\n<Route exact path='/test2/:id' component={MyComponent}/>\n\n\nthen in MyComponent, I want to make something different depending on which route is calling it.\n\nconst MyComponent = ({info: {param}, info2: {param1, param2}}) => {\n\n\n return (\n <div>\n\n </div>\n\n )\n}\n\nMyComponent.propTypes = {\n info: PropTypes.object.isRequired,\n info2: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = (state) => ({\n info: state.info,\n info2: state.info2\n});\n\nexport default connect(mapStateToProps, {})(MyComponent);\n\n\nHow can I get the test or test2 params?" ]
[ "javascript", "reactjs", "react-router", "react-router-dom" ]
[ "Ordered Doubly Linked List", "Ok A question from assignment says to create an ordered doubly linked list...such that each object with lexicographically smaller name comes \"Before\" the other One...Like names in a Dictionary...also objects with same name can be arranged in any order...\n\nTo link two objects I have setBefore() and setAfter() method...\nand I have done this much...but still don't know where I'm doing wrong..may be a little guidance from you guys can help me...\n\natMe is an object that is already present in the doubly linked list and newFrob is an object to be inserted...\n\ndef insert(atMe, newFrob):\n if newFrob.myName() < atMe.myName():\n if atMe.getBefore() == None:\n atMe.setBefore(newFrob)\n newFrob.setAfter(atMe)\n elif atMe.getBefore().myName()<newFrob.myName():\n atMe.getBefore().setAfter(newFrob)\n newFrob.setBefore(atMe.getBefore)\n atMe.setBefore(newFrob)\n newFrob.setAfter(atMe)\n else:\n insert(atMe.getBefore(),newFrob)\n\n elif newFrob.myName() > atMe.myName():\n if atMe.getAfter() == None:\n atMe.setAfter(newFrob)\n newFrob.setBefore(atMe)\n elif atMe.getAfter().myName()>newFrob.myName():\n atMe.getAfter().setBefore(newFrob)\n newFrob.setAfter(atMe.getAfter)\n atMe.setAfter(newFrob)\n newFrob.setBefore(atMe)\n else:\n insert(atMe.getAfter(),newFrob)\n\n elif newFrob.myName()==atMe.myName():\n if atMe.getAfter() != None:\n newFrob.setAfter(atMe.getAfter())\n newFrob.setBefore(atMe)\n if atMe.getAfter() != None:\n atMe.getAfter().setBefore(newFrob)\n atMe.setAfter(newFrob)\n\n\nAnd this is the Frob Class to be used...\n\nclass Frob(object):\n def __init__(self, name):\n self.name = name\n self.before = None\n self.after = None\n def setBefore(self, before):\n self.before = before\n def setAfter(self, after):\n self.after = after\n def getBefore(self):\n return self.before\n def getAfter(self):\n return self.after\n def myName(self):\n return self.name\n\n\nwhere Before and After are links to left and right objects in double linked list...\nobjects from this class are to be inserted to double linked list...\n\nExample:\n\na=Frob('foo')\nb=Frob('bar')\nc=Frob('frob')\nd=Frob('code')\n\ncode output\ninsert(a,b) bar->foo\ninsert(a,c) bar->foo->frob\ninsert(b,d) bar->code->foo->frob\n\n\nnow suppose\n\ncode output\ninsert(b,Frob('code')) bar->code->code->foo->frob" ]
[ "python", "doubly-linked-list" ]
[ "cocoa bindings with c++ libraries", "Is it possible to use bindings (NSArrayController etc) if you have to have a c++ in the model, ie all files in the model have .mm extension.\n\nHave built a small test program in pure Objective-C, which works OK, but when I try to build a program with c++ libraries it seems that nothing happen, it compiles and starts, but nothing happens with tableviews etc.\n\nOne should perhaps not ask if it is possible to use bindings to c++, rather if they are worth it for a objective-c/cocoa newbie.\n\nThanks" ]
[ "c++", "cocoa-bindings", "nsarraycontroller" ]
[ "Bootstrap data-toggle modal content within a function", "I'm new to programming, and I have this simple question but I can't figure out how to do it.\n\nI got this working code from Boostrap 4:\n\n <!-- Button trigger modal -->\n <button type=\"button\" class=\"btn btn-primary\" data-toggle=\"modal\" data-target=\"#exampleModalLong\">\n Launch demo modal\n </button>\n\n<!-- Modal -->\n<div class=\"modal fade\" id=\"exampleModalLong\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLongTitle\" aria-hidden=\"true\">\n <div class=\"modal-dialog\" role=\"document\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\" id=\"exampleModalLongTitle\">Modal title</h5>\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n ...\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Close</button>\n <button type=\"button\" class=\"btn btn-primary\">Save changes</button>\n </div>\n </div>\n </div>\n</div>\n\n\nBut instead of having a button I want to create a function to fire up the modal content:\n\nfunction openModal(){\n /* DESCRIPTION: Open the warning modal */\n // data-toggle=\"modal\" data-target=\"#exampleModal\"\n}\n\n\nBut I don't know how to the same thing as data-toggle and \ndata-target do in the button click.\n\nSomeone has a hint how to do that?" ]
[ "javascript", "bootstrap-4" ]
[ "MVC Core DropDownList selected value ignored", "I am trying to access my page at: https://localhost:44319/Analyze/Index/6\n\nThe problem is that my drop down list always selects the first item in the list instead of the one provided by ID. While stepping through the debugger, before the View() is returned, I see that the SelectList was populated correctly. \n\nAnalyzeController.cs\n\npublic IActionResult Index(int? Id)\n{\n return Index(Id ?? getStatementEndingById(Id).StatementEndingId);\n}\n\n[HttpPost]\npublic IActionResult Index(int StatementEndingId)\n{\n var statementEnding = getStatementEndingById(StatementEndingId);\n\n ViewBag.StatementEndingId = new SelectList(\n _context.StatementEnding.OrderByDescending(s => s.StatementEndingId), \n \"StatementEndingId\", \n \"Name\", \n statementEnding);\n\n return View(getPayments(statementEnding));\n}\n\nprivate StatementEnding getStatementEndingById(int? statementEndingId)\n{\n StatementEnding statementEnding;\n if (statementEndingId.HasValue)\n {\n statementEnding = _context.StatementEnding.FirstOrDefault(s => s.StatementEndingId == statementEndingId);\n }\n else\n {\n statementEnding = _context.StatementEnding.OrderByDescending(s => s.StatementEndingId).FirstOrDefault();\n }\n\n return statementEnding;\n}\n\n\nSetting DropDownList in Razor\n\[email protected](\"StatementEndingId\", null, new { @class = \"form-control mb-2 mr-sm-2\" })\n\n\nI am using ASP.NET Core 2.1.\n\nAny suggestions are much appreciated. Thanks in advance." ]
[ "asp.net-core", "asp.net-core-mvc" ]
[ "How to create a snowstorm on your Windows desktop?", "Practical uses aside, how (if it is possible at all) could you create a \"snowing\" effect on your desktop PC running Windows? Preferably with nothing but raw C/C++ and WinAPI.\n\nThe requirements for the snow are:\n\n\nAppears over everything else shown (Note: always-on-top windows may get on top of snow still, that's OK. I understand that there can be no \"absolute on top\" flag for any app)\nSnowflakes are small, possibly simple dots or clusters of a few white pixels;\nDoes not bother working with the computer (clicking a snowflake sends the click through to the underlying window);\nPlays nicely with users dragging windows;\nMulti-monitor capable.\n\n\nBonus points for any of the following features:\n\n\nSnow accumulates on the lower edge of the window or the taskbar (if it's at the bottom of the screen);\nSnow accumulates also on top-level windows. Or perhaps some snow accumulates, some continues down, accumulating on every window with a title bar;\nSnow accumulated on windows gets \"shaken off\" when windows are dragged;\nSnow accumulated on taskbar is aware of the extended \"Start\" button under Vista/7.\nSnowflakes have shadows/outlines, so they are visible on white backgrounds;\nSnowflakes have complex snowflike-alike shapes (they must still be tiny).\nClicking on a snowflake does send the click through to the underlying window, but the snowflake evaporates with a little cool animation;\n\n\nMost of these effects are straightforward enough, except the part where snow is click-through and plays nicely with dragging of windows. In my early days I've made an implementation that draws on the HDC you get from GetDesktopWindow(), which was click-through, but had problems with users dragging windows (snowflakes rendered on them got \"dragged along\").\n\nThe solution may use Vista/7 Aero features, but, of course, a universal solution is preferred. Any ideas?" ]
[ "windows", "animation", "weather" ]
[ "Passing a propel criteria to the symfony routing function that retrieves the object", "quick symfony / propel question.\nI have the following propel collection route:\n\napi_offer:\n class: sfPropelRouteCollection\n options:\n prefix_path: /api/offer\n model: Offer\n plural: offers\n singluar: offer\n actions: [ list ]\n module: apiOffer\n requirements:\n sf_format: (?:html|json)\n\n\nMy question is, does anyone know of a way to pass a Criteria to the $this->getRoute()->getObjects(); in the action? Basically I need to retrieve different objects from the database depending on existing parameters in the route.\n\nThanks for all you help." ]
[ "mysql", "routing", "properties", "symfony1", "criteria" ]
[ "Unable to track an instance of type ** because it does not have a primary key. Only entity types with primary keys may be tracked", "Having an issue with a specific table on my project which is driving me up the wall.\nI am trying to delete all the entries where from a table where the eventUId is something.\nso my code is this\nvar SessionsToRemove = _context.Connlog.Where(s => s.Eventuid == EventDetails.Uid);\n_context.Connlog.RemoveRange(SessionsToRemove);\n_context.SaveChanges();\n\nMy table on SQL server has a KEY which is defined to the column ID.\nThis works on all the other tables, except for this one.\nCan someone please help me?\n@Caius\nUSE [vents]\nGO\n\n/****** Object: Table [dbo].[Connlog] Script Date: 17/02/2021 12:46:49 ******/\nSET ANSI_NULLS ON\nGO\n\nSET QUOTED_IDENTIFIER ON\nGO\n\nCREATE TABLE [dbo].[Connlog](\n [id] [int] IDENTITY(1,1) NOT NULL,\n [uid] [nvarchar](max) NULL,\n [chatconnid] [nvarchar](100) NULL,\n [connstart] [datetime] NULL,\n [connend] [datetime] NULL,\n [useremailaddress] [nvarchar](500) NULL,\n [eventuid] [nvarchar](500) NULL,\n CONSTRAINT [PK_Connlog] PRIMARY KEY CLUSTERED \n(\n [id] ASC\n)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]\n) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]\nGO\n\nEDIT:\nAfter the last edit, I've decided to scaffold the database again which sorted the the issue.\nThank you guys for your help." ]
[ "c#", "sql-server", "entity-framework-core" ]
[ "Programming Scheme(Racket) with VIM - How to get started", "recently, I started programming Racket (formerly Scheme) in DrRacket.\nI quite fast I began to miss all the features of VIM in DrRacket, so I would like\nto use VIM for my scheme(racket) programming.\n\nI know that Emacs might be the best choice for intense lisp programming, but all\nI want is write a scheme(racket) file check syntax and then run it.\n\nUnfortunately, I could not figure out, how to invoke \"racket\" in the commandline\non a file to get it doing the same as DrRacket.\n\nI am running Ubuntu 10.10 Maverick Meerkat, VIM 7.3 and I downloaded and\ninstalled Racket from the official website.\n\nHelp to get started would be very appreciated." ]
[ "vim", "lisp", "scheme", "racket" ]
[ "Sorting 2 dimensional variant array in VBA", "I am new to VBA (I wish I could stick to Javascript) and I have a problem with sorting an array.\nI have this 2 dimensional array in keeping track of player scores like this\n\nP1 P2 P3 P4 P5 P6 P7 P8 P9\n23 12 34 11 21 56 32 35 27\n\n\nAnd I would like to sort the array so the players are in order of scores from lowest to highest like this\n\nP4 P2 P5 P1 P9 P7 P3 P8 P6\n11 12 21 23 27 32 34 35 56\n\n\nI haven't got a clue how to do this in VBA. I tried looking for a sort function, to no avail. Do I need to include some library or something?\n\nDoes anyone know how to tackle this problem if a library isn't available to do this?\n\nRegards\nCrouz" ]
[ "vba", "excel" ]
[ "convert duplicate rows into new columns MySql", "Basically I have a MySql table\n\n-------- ----------- --------\n cv_id all_stages amount\n-------- ----------- --------\n 12 S1 5\n 13 S4 2\n 13 S2 1 \n 14 S1 3\n 14 S3 2\n\n\nI have to write a query so that, based oncv_id, I need to have a single entry. And I need to generate few more columns. \n\nWhat I want is\n\n-------- --------- -------- -------- -------- -------\n cv_id stage1 stage2 stage3 stage4 total\n-------- --------- -------- -------- -------- -------\n 12 S1 5\n-------------------------------------------------------------\n 13 S2 S4 3\n-------------------------------------------------------------\n 14 S1 S3 5\n-------------------------------------------------------------\n\n\nHow should I arrange all stages to the respective stage columns based on cv_id and totaling the amount column?\n\nP.S - I need to execute query to generate new columns" ]
[ "php", "mysql", "pivot" ]
[ "Yii check if the record already exsists in database table", "I've got 2 models (producten and voorraad), and one controller (producten).\nSo i've build a form inside the producten CRUD (create/update).\nThis is a custom form:\n\n<div class=\"form-group\">\n <span class='btn btn-default addOption'>Optie toevoegen</span>\n</div>\n<div class='opties'> \n\n</div>\n<div class=\"form-group\">\n Verkrijgbaar als backorder?\n <select name=\"backorder\">\n <option value=\"1\">Ja</option>\n <option value=\"0\">Nee</option>\n </select>\n</div>\n\n\nThis is very easy. If you press on the button addOption, it will add a few form inputs.\n\nNow when the form is being saved (here the trouble begins), it will always add the data from the form to the database. But i don't want that. I want the data to be checked first, if it already exsists, if so, it has to be replaced and not added again.\n\nIs there a yii function for that, or how do I do this?\n\nProductenController piece:\n\nforeach($_POST as $key => $value){\n if(substr($key, 0,5) == 'maat_'){\n $index_expl = explode('_',$key);\n $index = $index_expl['1'];\n\n $aantal = $_POST['aantal_'.$index];\n\n $maten = explode(',',$value);\n foreach($maten as $maat_key => $maat){\n $kleuren = explode(',',$_POST['kleur_'.$index]);\n foreach($kleuren as $kleur_key => $kleur){\n $voorraad = new Voorraad();\n $voorraad->product_id = $model->id;\n $voorraad->maat = $maat;\n $voorraad->kleur = $kleur;\n $voorraad->aantal = $aantal;\n $voorraad->backorder = (int)$_POST['backorder'];\n $voorraad->save();\n }\n }\n }\n}" ]
[ "php", "yii", "yii-cactiverecord" ]
[ "How to mock document.location.href in react jest unit test", "I have a simple redux action creator that sets the document.location.href = "/signin"\nMy action creator looks like this\nexport const signout = () => (dispatch) => {\n localStorage.removeItem("userInfo");\n localStorage.removeItem("cartItems");\n localStorage.removeItem("shippingAddress");\n dispatch({ type: USER_SIGNOUT });\n document.location.href = "/signin";\n};\n\nWhen I run my unit test for the signout action creator I'm seeing the following error:\n\nconsole.error\n Error: Not implemented: navigation (except hash changes)\n at module.exports (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)\n at navigateFetch (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/window/navigation.js:76:3)\n at exports.navigate (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/window/navigation.js:54:3)\n at LocationImpl._locationObjectNavigate (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:31:5)\n at LocationImpl._locationObjectSetterNavigate (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:25:17)\n at LocationImpl.set href [as href] (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:47:10)\n at Location.set href [as href] (/Users/jun1/Projects/web-client/node_modules/jsdom/lib/jsdom/living/generated/Location.js:121:37)\n at /Users/jun1/Projects/web-client/src/redux/actions/userActions.js:65:3\n at Object.dispatch (/Users/jun1/Projects/web-client/node_modules/redux-thunk/lib/index.js:11:18)\n at Object.<anonymous> (/Users/jun1/Projects/web-client/src/redux/actions/__test__/userActions.test.js:146:17) undefined\n\n at VirtualConsole.<anonymous> (node_modules/jsdom/lib/jsdom/virtual-console.js:29:45)\n at module.exports (node_modules/jsdom/lib/jsdom/browser/not-implemented.js:12:26)\n at navigateFetch (node_modules/jsdom/lib/jsdom/living/window/navigation.js:76:3)\n at exports.navigate (node_modules/jsdom/lib/jsdom/living/window/navigation.js:54:3)\n at LocationImpl._locationObjectNavigate (node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:31:5)\n at LocationImpl._locationObjectSetterNavigate (node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:25:17)\n at LocationImpl.set href [as href] (node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:47:10)\n\n\nMy unit test looks like this:\ndescribe("User sign out", () => {\n it("should sign user out", async (done) => {\n await store.dispatch(signout());\n\n const actions = store.getActions();\n expect(actions.length).toBe(1);\n expect(actions[0]).toMatchObject({ type: USER_SIGNOUT });\n\n expect(localStorage.removeItem).toHaveBeenCalledTimes(3);\n expect(document.location.href).toEqual("/signin");\n done();\n });\n\nHow can I get my test to pass and make the assertion expect(document.location.href).toEqual("/signin"); to pass and also make sure the above exception is not thrown" ]
[ "javascript", "node.js", "reactjs", "redux", "jestjs" ]
[ "how to use crontab to run a Graphical program such as \"gedit\"", "how to use crontab to run a Graphical program such as \"gedit\"\n\n57 12 * * * gedit --display=localhost:0\n\n\nCan not successfully open the program and display it." ]
[ "crontab" ]
[ "unix timestamp in microsecond to timestamp with current timezone", "Currently I am re-designing a database and in this I have to import data from existing Db also.\nThe issue I am facing is with timestamp conversion. The timestamp is saved in the existing database is in microsecond format which is generated by a JS function so it does not have a timezone information.\nHowever, while importing this data, I have to save date and time in different columns so I have to cast this numeric timestamp to date and time to time alone. However, the time is to be saved in numeric format again to ease out my further calculations. Now when I checked the time stamp, I found the time is offset with the timezone which is distorting the data.\nAny suggestion about that?\nCode sample is something like:\n\nWITH ts AS (SELECT (8*60*60*1000) AS ts)\nSELECT ts AS sample_input_in_ms,\n CAST(to_timestamp(ts/1000) AS TIME) calculated_time,\n (EXTRACT(EPOCH FROM cast(to_timestamp(ts/1000) AS TIME)) * 1000) AS calculated_output_in_ms\nFROM ts;\n\n\nHere, the time used for the example is 08:00:00\nThe output generated is\n\n\nsample_input_in_ms calculated_time calculated_output_in_ms\n28800000 17:00:00 61200000\n\n\nPlease note here that JST have offset of +09:00 hrs" ]
[ "postgresql", "postgresql-10" ]
[ "Custom bootloader not working", "I have designed my custom bootloader (which showy my name only.) using assembly language and compiled it using NASM. Now I want to install it in USB.But not able to find any way for burning it. I have tested using different utilities like ISOtoUSB, Universal USB,rufus. Error is coming 'image is not bootable.'\n\nBut when I run the same on oracle virtual drive, it works perfectly.\n\nI am doing some college project and strucked, I want to load that bootloader to usb and when I boot from usb, my bootloader should work.\n\nAny idea please?\n\nHere is my code:\n\n[BITS 16]\n[ORG 0x7C00]\n\nmain:\nmov ax, 0x0000\nmov ds,ax\n\nmov si, string\ncall print\njmp $\n\nprint:\nmov ah,0x0E\nmov bh,0x00\n\n.nextchar\nlodsb\nor al,al\njz .return\nint 0x10\njmp .nextchar\n.return\nret\nstring db 'Welcome to the Amul Bhatia Operating System Now Installing....',0\ntimes 510-($-$$) db 0\ndw 0AA55h" ]
[ "assembly", "x86", "bootloader" ]
[ "Implement Virtual Scrolling on MVC3 Html Table", "Is it possible to impletment virtual scrolling on the html table in MVC3? We would like to load thousands of table rows in the view but only show a chunk of the data as the user scrolls down the the page. We cannot use third party control, this must be done using jQuery 1.10.2 and asp.net MVC3? Any advice is appreciated." ]
[ "jquery", "html", "asp.net-mvc-3" ]
[ "Run Query on All Schemas Postgres", "We have a around 100+ schema maintained in PostgreSQL. Now we want to query on all schema, is there any way to do that? \nother than views, procedures and union all? \nAny postgres functions which let you query on multiple schemas" ]
[ "postgresql", "madlib" ]
[ "Read a null-terminated string from binary into variable using od in MINIX ash", "Rather rookie question but I got stuck with it for a while: I have a problem to read and parse a string that is stored in hard drive at the address that I know ...\n\nI don't know the length of the string, only it's maximum length say n. It has been written into n-buffer initiated with zeros so its hexdump is like xx xx xx xx 00 00 00 00 00 where xx's are hex for proper string chars. \n\nSo as I know the address of the string, I copy it into binary tmp file using using dd if=<hd> of=tmp (with proper bs/count/skip to get the n bytes of the buffer). Then in bash (or rather in MINIX ash to be precise) I try to use od to parse it and read into variable but I cannot get rid of spaces/nulls:\n\nname=$(od -Anx -tc tmp)\necho $name\n\n\nand I get J O H N \\0 \\0 \\0 \\0 \\0 instead of simply JOHN" ]
[ "bash", "minix", "ash" ]
[ "\"Class1\" class has \"Class2\" object as a private data member. How can i refer to \"Class1\" object through \"Class 2\" function?", "Class1.h:\n\ninclude \"Class2.h\"\n\nclass Class1\n{\n public:\n Class1();\n\n int getNum();\n Class2 getClass2Object();//returns a Class2 object \n\n protected:\n\n private:\n\n int num;\n Class2 class2Object;//Class2 object as a data member of Class1\n};\n\n\nClass1.cpp:\n\ninclude \"Class1.h\"\n\nClass1::Class1()\n{\n num = 1;\n}\n\nint Class1::getNum(){return num;}\nClass2 Class1::getClass2Object(){return class2Object;}\n\n\nClass2.h:\n\n\n accessNumThroughClass2() function in which I need to refer to the Class1 object that\n has this Class2 object as a data member\n\n\nclass Class2\n{\n public:\n Class2();\n\n void accessNumThroughClass2();\n\n protected:\n\n private:\n};\n\n\nClass2.cpp:\n\n\n Here I want to refer to the Class1 object that has the Class2 object as a data member so that i \n can access the num data member in order to print its value. How can I do that?\n\n\nClass2::Class2()\n{\n //ctor\n}\n\nvoid Class2::accessNumThroughClass2(){\n //What do I do here?\n}\n\n\nmain.cpp:\n\n#include <iostream>\n\nusing namespace std;\n\nint main()\n{\n Class1 class1Object();\n class1Object.getClass2Object().accessNumThroughClass2(); //Here make it print the value of num\n\n return 0;\n}" ]
[ "c++" ]
[ "onPageFinished/onPageStarted in WebViewClient is never called", "I am writing a little web application for Android and I need to get some JS variables from HTML page, but code in setParam(final String str) is never called.\n\nAlso, code in onPageStarted(...) and onPageFinished(...) is never called too, and I can't suppose why. \n\nvoid startPageParse()\n{\n WebView web = new WebView(context);\n\n web.getSettings().setJavaScriptEnabled(true);\n web.addJavascriptInterface(new Object(){\n @JavascriptInterface\n public void setParam(final String str)\n {\n setParamFromJS(str);\n }\n }, \"JSInterface\");\n\n web.setWebViewClient(new WebViewClient(){\n @Override\n public void onPageStarted(WebView view, String url, Bitmap fav)\n {\n super.onPageStarted(view, url, fav);\n\n Log.v(\"WebCLI\", \"Started\");\n }\n\n @Override\n public void onPageFinished(WebView view, String url) {\n super.onPageFinished(view, url);\n\n view.loadUrl(\"javascript:JSInterface.setParam(flashvars['pl'])\");\n\n Log.v(\"WebCLI\", \"JSCalled\");\n }\n });\n\n web.loadUrl(SeasonURL);\n Log.v(\"WebCLI\", \"Load called\");\n}\n\n\nIf I set breakpoint at \"web.loadUrl(SeasonURL)\" it works(!) and those lines will be in logcat:\n\n08-28 13:22:12.766 4294-4294/shirokovoi.ChromeCastSSApp W/chromium﹕ [WARNING:jni_string.cc(28)] ConvertJavaStringToUTF8 called with null string.\n08-28 13:22:12.875 4294-4356/shirokovoi.ChromeCastSSApp W/chromium﹕ [WARNING:proxy_service.cc(890)] PAC support disabled because there is no system implementation\n08-28 13:22:15.290 4294-4294/shirokovoi.ChromeCastSSApp V/WebCLI﹕ Load called\n08-28 13:22:15.610 4294-4294/shirokovoi.ChromeCastSSApp I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@425157a8 time:786230\n08-28 13:22:15.625 4294-4294/shirokovoi.ChromeCastSSApp V/WebCLI﹕ Started\n08-28 13:22:20.586 4294-4294/shirokovoi.ChromeCastSSApp V/WebCLI﹕ Uncaught SyntaxError: Unexpected identifier\n08-28 13:22:20.586 4294-4294/shirokovoi.ChromeCastSSApp I/chromium﹕ [INFO:CONSOLE(1)] \"Uncaught SyntaxError: Unexpected identifier\", source: %SOMEURL% (1)\n08-28 13:22:24.469 4294-4294/shirokovoi.ChromeCastSSApp V/WebCLI﹕ JSCalled\n\n\nThis also work if this activity as main." ]
[ "android", "webview", "webviewclient" ]
[ "get image from server and set into imageview using async http response handler", "My question is how to fetch an image from server and set into imageview using Async Http Response Handler. The JsonObject for image is \"profile_image\" which needs to be fetched from the Rest api and display into my ImageView. \n\nMy code:\n\nAsyncHttpClient client = new AsyncHttpClient();\n //private ProgressDialog Dialog = new ProgressDialog(post.this);\n List<String> userCredentials = UserUtils.getLoginDetails();\n client.addHeader(\"x-user-id\", userCredentials.get(0));\n client.addHeader(\"x-auth-token\", userCredentials.get(1));\n client.get(\"https://\", new AsyncHttpResponseHandler() {\n @Override\n public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {\n\n final String response = new String(responseBody);\n android.util.Log.e(\"Response\", \"\" + response);\n\n try {\n JSONObject jsonObject = new JSONObject(response);\n JSONObject object = jsonObject.getJSONObject(\"user\");\n String attr1 = object.getString(\"name\");\n data = \"\" + attr1;\n textView15.setText(data);\n\n if (object.has(\"profession\")) {\n String attr2 = object.getString(\"profession\");\n data2 = \"\" + attr2;\n textView16.setText(data2);\n }\n if(object.has(\"company\")){\n String attr3 = object.getString(\"company\");\n data3 = \"\" + attr3;\n textView38.setText(data3);\n }\n\n if(object.has(\"profile_image\")){\n\n }\n JSONObject jsonObject1 = object.getJSONObject(\"emails\");\n JSONArray jsonArray = jsonObject1.getJSONArray(\"address\");\n for (int i = 0; i < jsonArray.length(); i++) {\n data += \"\\n\"\n + jsonArray.getJSONObject(i).getString(\"address\")\n .toString();\n\n\n\n\n // data += \" Name= \"+ attr1 +\" \\n \";\n }\n textView15.setText(data);\n //Dialog.dismiss();\n } catch (JSONException e) {e.printStackTrace();}\n }\n\n\nAPI code:\n\n \"user\": {\n\n \"profile_image\": \"https:////image/upload/v1455884587/endflvkyqv3ot37g4unc.png\",\n \"profile_public_id\": \"endflvkyqv3ot37g4unc\"\n }\n }" ]
[ "android", "rest", "get", "android-async-http" ]
[ "Prisma schema - Create a relation field from multiple possible foreign keys (OR relation)", "How to create a relation field in prisma schema that target 2 possible relation scalar fields ?\n\nFor instance, in soccer, let's say we've got the following 2 models:\n\nmodel Match {\n team1Id Int\n team1 Team @relation(\"team1\", fields: [team1Id], references: [id])\n\n team2Id Int\n team2 Team @relation(\"team2\", fields: [team2Id], references: [id])\n}\n\nmodel Team {\n id Int @default(autoincrement()) @id\n name String\n matches Match[] @relation( /* What to put here ? */ ) // <----\n}\n\n\nWhat to put in the Team.matches relation field definition in order to allow Team.matchs to contain any match the team played from any side, as team1 or as team2 ?" ]
[ "prisma" ]
[ "Maven Surefire with different file sets", "I have two kinds of Unit tests (not integration test). Because of some strange behaviour with Spring Security I need to run first all normal tests, and later on the security tests.\n\nI am using Junit (so I can not use any TestNG groups).\n\nSo what I have done is specify two sets of includes and excludes rules.\n\n<excludes>\n <exclude>**/*SecurityTest.java</exclude> \n</excludes>\n<includes>\n <include>**/*Test.java</include>\n <include>**/*Tests.java</include>\n</includes>\n\n\nand\n\n<excludes>\n</excludes>\n<includes>\n <include>**/*SecurityTest.java</include>\n</includes>\n\n\nThat works if I replace them in my pom by hand so I can have normal or security tests. But of course I want that both kind of tests run in each build.\n\nMy first try was to have two complete maven-surefire-plugin configruation. But then maven take only the last of them in account.\n\nMy next try was to use two execution definitions, but then surefire seems to ignore the rules at all and run both kind of tests mixed.\n\nSo my general question is how to specify two file sets for maven surefire so that they will be executed each after another? And more specific how to specify two different file sets.\n\n\n\nthe configuration with executions\n\n<plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-surefire-plugin</artifactId>\n <version>2.9</version>\n <configuration>\n <junitArtifactName>junit:junit</junitArtifactName>\n <encoding>UTF-8</encoding>\n <inputEncoding>UTF-8</inputEncoding>\n <outputEncoding>UTF-8</outputEncoding>\n <argLine>-Xms256m -Xmx512m -XX:MaxPermSize=128m -ea</argLine> \n </configuration>\n\n <executions>\n <execution>\n <id>normal-tests</id>\n <phase>test</phase>\n <goals>\n <goal>test</goal>\n </goals>\n <configuration>\n <excludes>\n <exclude>**/Abstract*.java</exclude>\n <exclude>**/*_Roo_*</exclude>\n <exclude>**/*SecurityTest.java</exclude>\n </excludes>\n <includes>\n <include>**/*Test.java</include>\n <include>**/*Tests.java</include>\n </includes>\n </configuration>\n </execution>\n <execution>\n <id>security-tests</id>\n <phase>test</phase>\n <goals>\n <goal>test</goal>\n </goals>\n <configuration>\n <excludes>\n <exclude>**/Abstract*.java</exclude>\n <exclude>**/*_Roo_*</exclude>\n </excludes>\n <includes>\n <include>**/*SecurityTest.java</include>\n </includes>\n </configuration>\n </execution>\n </executions>\n</plugin>" ]
[ "java", "testing", "maven" ]
[ "Making a \"Pressed\" effect on a Panel using Angular bootstrap Version 0.13.4", "I plan to have a grid of 6 rectangle panels, (3 X 2). Each panel will act as a button that will open a different module within my system. I am looking for some effect on mouseover or hover to apply to each panel so that the user can tell that the panel is being interacted with before they actually click the panel. (It will show them that it is clickable and not just read only data). For example, something that will give the panel a \"pressed\" effect before the panel actually being clicked would be nice. (I am open to other suggestions). \n\nI am currently using angular bootstrap version 0.13.4. \n\nHere is the code for the panel that I will be applying it to:\n\n<div\n data-ng-if=\"vb.isAuthorized('ROLE_STAFF','ROLE_SRPROFESSOR')\">\n <div class=\"panel panel-default panelAttributes panel-snap\"\n data-ng-click=\"vb.change('classmodule')\">\n <div class=\"panel-body\" id=\"content\">\n <div class=\"row col-md-12\">\n <img src=\"/WebContent/img/[email protected]\" alt=\"\"\n class=\"img-responsive resize\" /> <br> <span\n class=\"classText Placement\">Class Module</span>\n </div>\n <div class=\"col-md-6\">\n <p class=\"numericalText divContent\">5</p>\n <p class=\"infoText divContent\">Community Colleges</p>\n </div>\n <div class=\"col-md-6\">\n <p class=\"numericalText divContent\">28</p>\n <p class=\"infoText divContent\">Counties <br>Served</p>\n </div>\n </div>\n </div>\n </div>\n\n\nPlease let me know of any good suggestions! I am not sure what design conventions expect with things like this, so I wanted to see what ideas anyone here might have. \n\nI am currently using a shadow effect:\n\n.panel-snap {\n background-image: -webkit-linear-gradient(top, #FF5A00, #FFAE00);\n background-image: -moz-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\n background-image: -ms-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\n background-image: -o-linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\n background-image: linear-gradient(top, #FF5A00 0%, #FFAE00 100%);\n box-shadow: 3px 3px 5px 6px #A9A9A9;\n}\n\n\nFeel free to let me know of any questions, thanks!" ]
[ "css", "angular-bootstrap" ]
[ "I try to send String arr to fragment from activity", "I tried to send String arr to Fragment from Activity.\nBecause I have to show listView in fragment by that String arr.\nBut there are still null exception error..\nI searched many times to solve this error, but there are still same error.\nI really don't know what should I do. Please give me some solution.\n\nActivity\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_tabmenu_activity);\n final Toolbar toolbar = (android.support.v7.widget.Toolbar) this.findViewById(R.id.toolbar);\n toolbar.setTitleTextColor(Color.parseColor(\"#000000\"));\n\n backPressCloseHandle = new BackPressCloseHandler(this);\n\n setting = getSharedPreferences(\"setting\", MODE_PRIVATE);\n editor= setting.edit();\n loginid = setting.getString(\"Id\", \"\");\n\n Driver.getInstance().setloginid(setting.getString(\"Id\", \"\"));\n\n ApiRequester.getInstance().getDriver(Driver.getInstance().getLoginid(), new ApiRequester.UserCallback<Driver>() {\n @Override\n public void onSuccess(Driver result) {\n toolbar.setTitle(result.getname());\n }\n @Override\n public void onFail() {\n }\n });\n\n ApiRequester.getInstance().getList(new ApiRequester.UserCallback<List<Case_List>>() {\n @Override\n public void onSuccess(List<Case_List> result) {\n if(result==null)\n {\n Toast.makeText(TabMenuActivity.this, \"정보가 존재하지 않습니다.\", Toast.LENGTH_SHORT).show();\n }\n else\n {\n int size = result.size();\n list_arr = new String[size];\n int count = 0;\n\n for(Case_List list : result)\n {\n list_arr[count] = list.gethabbitname();\n count++;\n }\n for(int i=0; i<list_arr.length; i++)\n {\n System.out.println(i+\"number\"+list_arr[i]);\n }\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"list_arr\", list_arr);\n // set Fragmentclass Arguments\n Frag_ListActivity fragobj = new Frag_ListActivity();\n fragobj.setArguments(bundle);\n }\n }\n @Override\n public void onFail() {\n }\n });\n\n\nFragment\n\n@Override\npublic View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {\n\n View view = inflater.inflate(R.layout.activity_frag_list, container, false);\n mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerview);\n mRecyclerView.setHasFixedSize(true);\n mLayoutManager = new LinearLayoutManager(getActivity());\n mRecyclerView.setLayoutManager(mLayoutManager);\n\n String[] list_arr = getArguments().getStringArray(\"list_arr\");// error is here.\n\n for(int i=0; i<list_arr.length; i++)\n {\n System.out.println(list_arr[i]);\n }\n\n\n return view;\n\n\n} \n\n\n\n java.lang.NullPointerException: Attempt to invoke virtual method\n java.lang.String[] android.os.Bundle.getStringArray(java.lang.String)'\n on a null.\n\n\nHow can I solve this? I don't have enough time:^(" ]
[ "android", "android-activity", "fragment", "arr" ]
[ "Problem with using remove, pop, del on list in Python", "a = [10, 12, 14]\nb = a\nb.remove(12) \nprint(a)\nprint(b)\n\n\nResult is:\n\n[10, 14]\n[10, 14]\n\n\nThe result is same when I use pop, del function\n\nIt is also same when I delete from a (a.remove, a.pop, del a)\n\nWhat I want is (like disconnection):\n\n[10, 12, 14]\n[10, 14]\n\n\nIt seems like remove function deletes the element in the original list too" ]
[ "python", "list", "function" ]
[ "Scrollbar track style android", "I have a Listview and I want to give the scrollbar a style : \n\n<style name=\"scrollbar\">\n <item name=\"android:scrollbarAlwaysDrawVerticalTrack\">true</item>\n <item name=\"android:scrollbarStyle\">outsideOverlay</item>\n <item name=\"android:scrollbars\">vertical</item>\n <item name=\"android:fadeScrollbars\">true</item>\n <item name=\"android:scrollbarThumbVertical\">@drawable/apptheme_fastscroll_thumb_holo</item>\n\n </style>\n\n\nThis works fine :P but no track here I would like it scrollbarVertical Track to be black thin line. I tried this drawable for line : \n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\"rectangle\" >\n <stroke android:width=\"1dp\" android:color=\"@android:color/black\"/>\n <size android:width=\"2dp\" />\n</shape>\n\n\nBut if I append this to scrollbar style like \n\n<item name=\"android:scrollbarTrackVertical\">@drawable/track</item>\n\n\nI cant see the thumb ..." ]
[ "android", "scrollbar" ]
[ "SQLite: How do I subtract the value in one row from another?", "Here is my example table:\n\ncolumn_example\n10\n20\n25\n50\n\n\n\n\nHere is what I would like:\n\ncolumn_example2\n10\n5\n25\n\n\n\nI'm sure this is a simple question, but I haven't found the answer in the SQLite Syntax web page or via Google.\n\nEDIT: To clarify, the code would likely return the outputs for: \n 20-10\n 25-20\n 50-25" ]
[ "sqlite" ]
[ "Stop timer if Form is active", "Is there a way that I can stop the timer if the user is using the current form, example, writing on a textbox. The reason for this is that every minute I make a refresh to the form (\"Update data from Database\") but if the user is writing on a text box and the timer gets to that minute it resets the textbox and the user has to write again, in other words it has approx. 1minute to finish writing on the form.\n\nprivate void timer1_Tick(object sender, EventArgs e)\n { \n SelectProgress();\n }\nprivate void SelectProgreso()\n {\n\n try\n {\n\n OleDbDataReader reader;\n reader = oleDbCmd.ExecuteReader();\n reader.Read();\n\n progress= reader[1].ToString();\n\n int op = Int32.Parse(progress);\n switch (op)\n {\n case 1:\n progressBar1.Value = 20;\n\n button1.Enabled = false;\n break;\n case 2:\n progressBar1.Value = 40;\n\n button1.Enabled = false;\n break;\n case 3:\n progressBar1.Value = 60;\n\n button1.Enabled = false;\n break;\n case 4:\n progressBar1.Value = 80;\n\n\n break;\n case 5:\n progressBar1.Value = 100;\n\n button1.Enabled = false;\n break;\n default:\n Console.WriteLine(\"Error\");\n break;\n }\n }\n catch (OleDbException error)\n {\n MessageBox.Show(error.ToString());\n }\n finally\n {\n mycon.Close();\n }\n }\n\n\nI'm using Visual Studio 2013 WindowsForm.\nAny help or comment on this is appreciated.\nThank you." ]
[ "c#", "winforms", "timer" ]
[ "Wordpress - How to automatically create a child page", "My issue is I have is that users create new pages with content and that works well and as intended. What they have to do is add another page, with no content, select the right template and make it the parent of the page that they just created. The 2nd blank page is there as it gives the user viewing the webpage to view the content in a different way then the main page lists it. Is there a way wordpress can automatically add this blank page to these templates? \n\nHere is how the page structure works\n\nMain Page --> Wordpress Page (user created) --> Wordpress Page (Lists the same content as the parent page but in a different format. This is the blank page that the wordpress user creates.)\n\nSo is there a way to automatically create that extra subpage or is there a way I can add that code and link to the original wordpress page template?\n\nThanks,\nRyan" ]
[ "wordpress" ]
[ "Fragment layout takes over toolbar and floating button", "This is my activity's layout: \n\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <android.support.design.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:fitsSystemWindows=\"true\"\n tools:context=\"name.company.newapp.HomeScreen\">\n\n <android.support.design.widget.AppBarLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:theme=\"@style/AppTheme.AppBarOverlay\"\n android:id=\"@+id/bar\"\n >\n\n <android.support.v7.widget.Toolbar\n android:id=\"@+id/toolbar\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"?attr/actionBarSize\"\n android:background=\"?attr/colorPrimary\"\n android:elevation=\"4dp\"\n app:popupTheme=\"@style/AppTheme.PopupOverlay\" />\n\n </android.support.design.widget.AppBarLayout>\n\n <include layout=\"@layout/content_home_screen\"\n android:layout_below=\"@id/bar\"\n android:layout_height=\"match_parent\"\n android:layout_width=\"match_parent\" />\n\n <android.support.design.widget.FloatingActionButton\n android:id=\"@+id/fab\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"bottom|end\"\n android:layout_margin=\"@dimen/fab_margin\"\n android:src=\"@android:drawable/ic_dialog_email\" />\n\n</android.support.design.widget.CoordinatorLayout>\n\n\nThis is what is included (content_home_screen)\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <android.support.v4.widget.DrawerLayout\n\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:id=\"@+id/DrawerLayout\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:elevation=\"7dp\">\n\n <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n tools:context=\"name.company.newapp.HomeScreen\"\n tools:showIn=\"@layout/activity_home_screen\">\n\n <FrameLayout\n android:id=\"@+id/your_placeholder\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"/>\n\n </RelativeLayout>\n\n <android.support.v7.widget.RecyclerView\n android:id=\"@+id/RecyclerView\"\n android:layout_width=\"320dp\"\n android:layout_height=\"match_parent\"\n android:layout_gravity=\"left\"\n\n android:background=\"#ffffff\"\n android:scrollbars=\"vertical\">\n\n </android.support.v7.widget.RecyclerView>\n\n </android.support.v4.widget.DrawerLayout>\n\n\nMy problem is that the place_holder takes over the screen(all of it). I can't see the floating button or the layout bar. I have no idea on how to make this work except making only one layout and not including any content." ]
[ "android", "android-fragments", "android-studio" ]
[ "Custom Dropdown List for Spinner", "In the picture above (tablet landscape mode), any way I can minimize the Dropdown width of a Spinner? Or create a Custom Dropdown perhaps? Thanks.\n\nEdit:\nI'm just using this android's own layout.\nspinner.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);\n\nXML Added:\n\n <LinearLayout\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:orientation=\"horizontal\"\n android:layout_margin=\"5dp\"\n android:weightSum=\"3\">\n <TextView\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"1\"\n android:text=\"Font Size\"\n android:textSize=\"15sp\"\n />\n <Spinner\n android:layout_width=\"0dp\"\n android:layout_height=\"wrap_content\"\n android:layout_weight=\"2\"\n />\n </LinearLayout>" ]
[ "android", "android-layout" ]
[ "Webpack 2: splitting libraries, vendor and app into different files", "Imagine I have a rich application, which uses a lot of the 3rd party modules including lodash, moment, axios, react.\n\nIf I bundle everything in one bundle at the end the size would be higher then 1MB.\n\nI want webpack to pack my libraries in the way, that it stores:\n\n\nlodash separately\nmoment separately\nall the other node_modules are stored under the vendor bundle\nthe code of the application is stored in the separate file\n\n\nI tried to play with the CommonsChunkPlugin in different ways, but never received the result I want.\n\nI've prepared the example repository to illustrate my issue:\nhttps://github.com/PavelPolyakov/webpack-react-bundles\n\nWebpack entry part (conf/webpack.base.config.js):\n\nentry: {\n lodash: 'lodash',\n moment: 'moment',\n app: [\n 'react-hot-loader/patch',\n 'webpack-dev-server/client?http://localhost:3001',\n 'webpack/hot/only-dev-server',\n './app/index.js']\n}\n\n\nHere is production config (conf/webpack.production.config.js), trying to separate modules:\n\nplugins: [\n new webpack.DefinePlugin({\n 'process.env': {\n 'NODE_ENV': JSON.stringify('production')\n }\n }),\n new webpack.optimize.CommonsChunkPlugin({\n name: 'vendor',\n minChunks: function (module) {\n // this assumes your vendor imports exist in the node_modules directory\n return module.context &&\n module.context.indexOf('node_modules') !== -1;\n }\n }),\n new webpack.optimize.UglifyJsPlugin({\n minimize: true,\n compress: {\n warnings: true\n }\n })]\n\n\nThis case, the moment and lodash would still appear in the vendor bundle. I want to have them in the two separate bundles.\n\nAny thoughts appreciated." ]
[ "webpack", "webpack-2", "code-splitting", "commonschunkplugin" ]
[ "How to get the dialog background color (window color) in a Qt Gui application?", "My Qt version is 4.7.1 and I want to set the background color of a QLineEdit the same as window color, and I use this way:\n\nQString bgColorName = palette().color(QPalette::Normal, QPalette::Window).name();\nQString strStyleSheet = QString(\"QLineEdit {background-color: \").append(bgColorName).append(\"}\");\nui->lineEdit->setStyleSheet(strStyleSheet);\n\n\nI tried to get the background colors name and then set the stylesheet of the QLineEdit, however, after running the application, I found the QLineEdit's color is a little different, that is, if you look at it carefully, you can see the difference, both on Win7 and Mac.\nCould anyone help me to find a way to get the right background color of the dialog, thank you in advance." ]
[ "qt", "qt4.7", "backcolor", "qlineedit", "qtstylesheets" ]
[ "Seaborn how to show specific samples of interest on ytick", "'''\nI did a clustermap with thousands of genes, using seaborn. Because, I'm interested in only few genes, I'd like to display those genes of interest on the ytick. I'm trying to figure it out using the iris dataset. Please find below my code. I'm not sure how to get the samples of interest at their right indexes. Thank you in advance for helpful assistance.\n'''\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\niris = sns.load_dataset('iris')\nsamples = ['sample_'+str(x) for x in list(iris.index)] #creating sample ID lining up with the internal index.[![enter image description here][1]][1]\niris.insert(0,'Sample_ID',samples) \nsamples_of_interest = ['sample_41','sample_34','sample_114','sample_55'] #samples to be visible on ytick\n\nsns.clustermap(iris.iloc[:,1:-1],yticklabels=samples_of_interest) #Not giving the expected result as all of thesmples of interest are not at their right index\n\nplt.show()\nplt.close()" ]
[ "python", "pandas", "seaborn", "heatmap" ]
[ "Rails DateTime field has current date/time if nil in the database", "I have a form with a datetime field. Since Rails 3.2.13 doesn't support type=\"datetime-local\" input fields yet (and I'm not ready to move to 4.0 beta), I'm doing this manually:\n\n<input type=\"datetime-local\" name=\"person[my_date_time]\"<% if @person.my_date_time %> value=\"<%[email protected]_date_time.strftime('%FT%T')%>\"<% end %>/>\n\n\nThe problem is @person.my_date_time will be the current date/time if it's nil in the database. And it outputs with seconds too which screws up Chrome's handling of datetimes. I want that field to be empty if it's nil in the database. How can I tell? Rails' datetime_select method handles it the way I want." ]
[ "ruby-on-rails", "ruby-on-rails-3", "activerecord", "ruby-on-rails-3.2", "rails-activerecord" ]
[ "JQuery Addition/subtraction from dynamically added input text", "I have this scenario: \nI have text input in a form and using them to make some calculations (basically addition and subtraction). Text inputs (sub-total) can be added/removed via jQuery with a onclick. So far i've been able to get the sum (total) of the input elements when i add them to the form and put some values into them. What i'm missing now is the way to update the total sum whenever i remove one text input. Here is the code, I have also a JSFIDDLE HERE: http://jsfiddle.net/uomopalese/1w54rhyv/. Thanks for help.\n\nCODE: (updated with the solution proposed by @iovis\n\n<div id=\"dati-dettaglio-linee\">\n <div id=\"righe\">\n <div class=\"linea\"><!-- ripetizione linea -->\n <h5>Nr. linea: <span>1</span></h5>\n <ul>\n <li>Sub total: <span><input class=\"somma\" type=\"text\" value=\"\" name=\"ValoreTotale\" /></span></li>\n </ul>\n </div><!-- ripetizione linea -->\n</div><!-- righe -->\n<div class=\"link-button\"><a href=\"javascript:;\" id=\"addButton\">ADD LINE</a></div>\n<div class=\"link-button\"><a href=\"javascript:;\" id=\"removeButton\">REMOVE LINE</a></div>\n<div class=\"clear\"></div>\n<div id=\"riepilogo-aliquote-nature\">\n <ul>\n <li>Total: <span class=\"totale\"><input type=\"text\" value=\"\" id=\"ImponibileImporto\" /></span></li>\n </ul>\n</div>\n</div><!-- dettaglio-linee -->\n\n\n/////////////////////////////////// ADD LINES \n$(document).ready(function(){ \n var counter = 2;\n $(\"#addButton\").click(function () {\n //alert('Stai per aggiungere una linea di contenuto alla fattura');\n $(\"#righe\").append('<div id=\"linea' + counter + '\"><h5>Nr. linea: <span>' + counter + '</span></h5>' + '\\n\\r' +\n '<ul>' +'\\n\\r' + \n '<li>Sub total: <span><input class=\"somma\" type=\"text\" value=\"\" id=\"ValoreTotale' + counter + '\" /></span></li>' + '\\n\\r' + \n '</ul></div>');\ncounter++;;\n$(\".somma\").each(function() {\n $(this).keyup(function(){\n calculateSum();\n });\n });\n });\n $(\"#removeButton\").click(function () {\n //alert('Stai per rimuovere una linea di contenuto alla fattura');\n if(counter==2){\n alert(\"Non ci sono altre linee da eliminare\");\n return false;\n } \n counter--;\n $(\"#linea\" + counter).remove();\n calculateSum();\n });\n });\n/////////////////////////////////////////\n\n\n///////////////////////////////////FUNCTION ADD VELUES\n$(document).ready(function(){ \n $(\".somma\").each(function() {\n $(this).keyup(function(){\n calculateSum();\n });\n });\n });\nfunction calculateSum() {\n var sum = 0;\n //iterate through each textboxes and add the values\n $(\".somma\").each(function() {\n\n //add only if the value is number\n if(!isNaN(this.value) && this.value.length!=0) {\n sum += parseFloat(this.value);\n }\n });\n //.toFixed() method will roundoff the final sum to 2 decimal places\n //$(\"#sum\").html(sum.toFixed(2));\n $('.totale input').val(sum.toFixed(2));\n}" ]
[ "jquery", "input", "dynamically-generated", "addition", "subtraction" ]
[ "how to retrieve data from database using flex code", "I want to display the values coming from database in a datagrid using flex. Here is my code. I am using webservice. I have database values from application1_initializeHandler() method. How to fetch these values into onResult() method and perform databinding? I want code for onResult() function and data binding. Please help..\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<s:Application xmlns:fx=\"http://ns.adobe.com/mxml/2009\" \n xmlns:s=\"library://ns.adobe.com/flex/spark\" \n xmlns:mx=\"library://ns.adobe.com/flex/mx\" initialize=\"application1_initializeHandler(event)\">\n <fx:Script>\n <![CDATA[\n import mx.events.FlexEvent;\n import mx.rpc.AsyncResponder;\n import mx.rpc.AsyncToken;\n import mx.rpc.events.FaultEvent;\n import mx.rpc.events.ResultEvent;\n\n\n protected function application1_initializeHandler(event:FlexEvent):void\n {\n AreasOfWestBengal.loadWSDL();\n var s:String = \"SELECT * FROM [CSFTestNew].[dbo].[AreasOfWestBengal]\";\n var t:AsyncToken = AreasOfWestBengal.GetRec(\"[AreasOfWestBengal]\", s, \"1\", \"SQLExpress\");\n t.addResponder(new AsyncResponder(onResult, onFault, t));\n }\n\n protected function onResult(event:ResultEvent, token:Object=null):void\n {\n\n\n }\n\n protected function onFault(event:FaultEvent, token:Object=null):void\n {\n trace(event.fault.toString());\n }\n ]]>\n </fx:Script>\n <fx:Declarations>\n <s:WebService id=\"AreasOfWestBengal\" wsdl=\"https://www.geoviewer8.com/gv8webservices/CSF_NewGVOConfig/GVOConfig.asmx?wsdl\"/>\n </fx:Declarations>\n <mx:DataGrid x=\"197\" y=\"83\" width=\"348\" height=\"216\">\n <mx:columns>\n <mx:DataGridColumn headerText=\"Areas\" dataField=\"Areas\"/>\n <mx:DataGridColumn headerText=\"SubAreas\" dataField=\"SubAreas\"/>\n </mx:columns>\n </mx:DataGrid> \n\n</s:Application>\n\n\nThanks" ]
[ "actionscript-3", "apache-flex", "flex4.6" ]
[ "Is there a way to capture debug output from a VMware instance?", "We are running a VM on a VMware workstation 7. We are trying to capture debug output (written using OutputDebugString) that happened while booting (but not from the kernel). Is there a way to connect DebugView to a VM?" ]
[ "debugging", "vmware", "remote-debugging" ]
[ "how to implement video and audio chat in ionic or any hybrid app?", "I am trying to implement video and audio chat in my ionic app. I tried many solutions but they work on either android or ios but not in a hybrid app. also some solutions provide Cordova code, how to convert that Cordova code to ionic?" ]
[ "cordova", "ionic-framework", "video", "chat", "call" ]
[ "Create HTML Element with text that extends into border", "I'm trying to create an HTML element that looks like this:-\n\nBasically, a <div> or other element with a border, and the internal (possibly multi-line) text centred within the div, but extending into the border area.\nSo far, the only scheme I have that works is to use three(!) divs : One for the border, a second one as a container for the third one, to ensure the vertical centring is right.\n<div class="BORDER" style = "left: 190px; top: 50px;">\n</div>\n\n<div class = "WRAPPER" style = "left: 190px; top: 50px;">\n <div>TEST THREE</div>\n</div>\n\nThis feels awkward: Is there a way of achieving the same look using fewer elements?\nRestrictions (clarified)\n\nThe text can have one or more lines\nThe border will be an image, and will eventually be stretched via the border-image mechanism.\n\nJSFiddle with CSS and some other (failed) attempts is here. http://jsfiddle.net/6wB3k/" ]
[ "html", "css" ]
[ "How can i re-use an initialized class in Python?", "I'm trying to access a initialized class in the main application from other modules but don't know how to do it. \nBackground: i want to update a dataframe with data during the whole execution in the main application.\n\nI have to following application structure (this is an simplified version of the code in my application):\n\nconstraints\n- test_function.py (separate module which should be able to update the initialized class in the main app)\nfunctions\n- helper.py (the class which contains the dataframe logic)\nmain.py (my main application code)\n\n\nmain.py:\n\nimport functions.helper\ngotstats = functions.helper.GotStats()\n\ngotstats.add(solver_stat='This is a test')\ngotstats.add(type='This is a test Type!')\n\nprint(gotstats.result())\n\nimport constraints.test_function\nconstraints.test_function.test_function()\n\n\nhelper.py:\n\nclass GotStats(object):\n def __init__(self):\n print('init() called')\n import pandas as pd\n self.df_got_statistieken = pd.DataFrame(columns=['SOLVER_STAT','TYPE','WAARDE','WAARDE_TEKST','LOWER_BOUND','UPPER_BOUND','OPTIMALISATIE_ID','GUROBI_ID'])\n\n def add(self,solver_stat=None,type=None,waarde=None,waarde_tekst=None,lower_bound=None,upper_bound=None,optimalisatie_id=None,gurobi_id=None):\n print('add() called')\n self.df_got_statistieken = self.df_got_statistieken.append({'SOLVER_STAT': solver_stat,'TYPE': type, 'WAARDE': waarde, 'OPTIMALISATIE_ID': optimalisatie_id, 'GUROBI_ID': gurobi_id}, ignore_index=True)\n\n def result(self):\n print('result() called')\n df_got_statistieken = self.df_got_statistieken\n return df_got_statistieken\n\n\ntest_function.py:\n\nimport sys, os\nsys.path.append(os.getcwd())\n\ndef test_function():\n import functions.helper\n gotstats = functions.helper.GotStats()\n gotstats.add(solver_stat='This is a test from the seperate module')\n gotstats.add(type='This is a test type from the seperate module!')\n print(gotstats.result())\n\nif __name__ == \"__main__\":\n test_function()\n\n\nIn main i initialize the class with \"gotstats = functions.helper.GotStats()\". After that i can correctly use its functions and add dataframe rows by using the add function.\nI would like that test_function() is able to add dataframe rows to that same object but i don't know how to do this (in current code the test_function.py just creates a new class in it's local namespace which i don't want). Do i need to extend the class object with an function to get the active one (like logging.getLogger(name))? \n\nAny help in the right direction would be appreciated." ]
[ "python", "dataframe" ]
[ "Removing Extra Height Added By Controls In Video.js", "I'm trying to use video.js to embed video in my website.\n\nI have the script installed and working perfect, well almost!\n\nThe problem I'm having is that when you load the page, then play the video, then stop the video, there is a big black line across the top of the video.\n\nThis is being added to the top (and bottom) of the container by the control bar - assuming so that the controls don't cut into the video.\n\nHowever, I don't want this extra height being added. Does anyone know how to stop this being added?" ]
[ "html5-video", "video.js" ]
[ "Firebase background notification icon problems", "I'm working at an app that is completely based on Firebase tools hence I adopt FCM to send push notifications. Talking about notifications my app receives when it's in foreground, they perfectly work and I manage to handle it as I want through FirebaseMessagigService and onMessageReceived method in particular.\n\nUnfortunately this method seems to be completely transparent when the app is in background...I've attempted many different ways, and tried to follow as many as possible official tutorials and stack overflow suggestions, but there's a lot of contradictory information and I definitely don't succeed in changing the notification icon as I'd like to do. I have to accept the white and grey circle the system proposes to me but this is certainly not a good presentation for an app. :-(\n\nIs there someone who has the key to solve this problem and/or has understood which the final word from Firebase team could be?\nThank you very much." ]
[ "android", "firebase", "notifications", "icons", "firebase-cloud-messaging" ]
[ "REDCap auto populate from previous forms", "Hi I am using REDCap for data collection. My question is how to auto populate variable from one from to another form in REDCap. For example, BMI from enrollment to baseline visit." ]
[ "database" ]
[ "Is there any side effect of reducing IIS recycle time interval?", "My asp .net mvc3 application is hosted in IIS 7 and i wish to reduce memory consumption by reducing the recycle time interval of IIS to 1000 mintes . Is there any side-effects in doings this?" ]
[ "asp.net-mvc-3", "iis-7", "recycle" ]
[ "Implementing KNN with different distance metrics using R", "I am working on a dataset in order to compare the effect of different distance metrics. I am using the KNN algorithm.\n\nThe KNN algorithm in R uses the Euclidian distance by default. So I wrote my own one. I would like to find the number of correct class label matches between the nearest neighbor and target.\n\nI have prepared the data at first. Then I called the data (wdbc_n), I chose K=1. I have used Euclidian distance as a test.\n\nlibrary(philentropy)\nknn <- function(xmat, k,method){\n n <- nrow(xmat)\n if (n <= k) stop(\"k can not be more than n-1\")\n neigh <- matrix(0, nrow = n, ncol = k)\n for(i in 1:n) {\n ddist<- distance(xmat, method) \n neigh[i, ] <- order(ddist)[2:(k + 1)]\n }\n return(neigh)\n}\nwdbc_nn <-knn(wdbc_n ,1,method=\"euclidean\")\n\n\nHoping to get a similar result to the paper (\"on the surprising behavior of distance metrics in high dimensional space\") (https://bib.dbvis.de/uploadedFiles/155.pdf, page 431, table 3).\n\nMy question is \n\nAm I right or wrong with the codes?\n\nAny suggestions or reference that will guide me will be highly appreciated.\n\nEDIT \n\nMy data (breast-cancer-wisconsin)(wdbc) dimension is \n\n569 32\n\n\nAfter normalizing and removing the id and target column the dimension is \n\ndim(wdbc_n)\n569 30\n\n\nThe train and test split is given by \n\nwdbc_train<-wdbc_n[1:469,]\nwdbc_test<-wdbc_n[470:569,]" ]
[ "r", "knn", "nearest-neighbor" ]
[ "Import Image works on GAE but not in dev_appserver.py", "I'm using PIL for a GAE application, and have been importing the PIL modules directly using\n\nimport Image, ImageDraw, ImageChops,\n\n\nThe application works correctly with no complaints when uploaded to GAE but when trying to run with dev_appserver.py it refuses to import the modules.\n\nIs there a way to force dev_appserver.py to recognize them, as GAE obviously supports them?" ]
[ "python", "image", "google-app-engine", "python-imaging-library" ]
[ "Unable passing data from one intent to another intent", "I have tried to pass some data from one intent to another. But while running this code on android studio when I press the button after putting the value on my first intent it shows that \"intent has stopped.\n\n** I wanted to pass data from activity-1 to activity-2\n\nactivity-1:\n\n public class MainActivity extends AppCompatActivity{\n\n\nEditText edit1;\nEditText edit2;\nButton btn;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n edit1= (EditText) findViewById(R.id.edit1);\n btn= (Button) findViewById(R.id.button);\n edit2= (EditText) findViewById(R.id.edit2);\n btn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n Intent i = new Intent(MainActivity.this, Main2Activity.class);\n\n i.putExtra(\"username\", edit1.getText().toString());\n i.putExtra(\"password\", edit2.getText().toString());\n startActivity(i);\n\n }\n });\n}\n\n\n}\n\n\n\nactivity -2\n\npublic class Main2Activity extends AppCompatActivity {\nTextView txt1;\nTextView txt2;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main2);\n\n txt1=(TextView)findViewById(R.id.edit3);\n txt1=(TextView)findViewById(R.id.edit4);\n\n Intent i2=this.getIntent();\nString message=i2.getStringExtra(\"username\");\n\n String message2=i2.getStringExtra(\"password\");\n\n txt1.setText(message);\n txt2.setText(message2);\n\n\n\n}\n\n\n}" ]
[ "android-intent" ]
[ "action script 3 - issue with arrays", "So here im checking for when a bullet hits an enemy ship in my game. Im trying to check the type of enemy in the array by object name to do specific things for that enemy, code is below.\n\nfor (var i = bullets.length - 1; i >= 0; i--) {\n for (var j = enemies.length - 1; j >= 0; j--) {\n if (_bullets[i].hitTestObject(enemies[j])) {\n\n if (enemies[j] == EnemyYellow) {\n trace(\"do something\");\n }\n\n stage.removeChild(enemies[j]);\n stage.removeChild(bullets[i]);\n bullets.splice(i, 1);\n enemies.splice(j, 1);\n return;\n }\n }\n }\n\n\nThis is something like I thought would work, but I would appreciate if anyone could help me out as im not sure how to do it.\n\n if (enemies[j] == EnemyYellow) {\n trace(\"do something\");\n }" ]
[ "arrays", "actionscript-3" ]
[ "Why is `TypeError: firebase.initializeApp is not a function` occurring only when @firebase/testing is imported in a submodule to a cypress plugin?", "I am using Cypress to test an app and using Cypress Tasks to run backend database seeding.\n\nThe backend is a locally emulated Firestore database.\n\nUsually, I am able to run initializeAdminApp() without problems, from my Cypress plugins file. I am using the new built-in TS capabilities of Cypress.\n\nWhen I import @firebase/testing in my plugins/index.ts file, there is no issue at all.\n\nBut if I instead import @myapp/testing which imports @firebase/testing and runs initializeAdminApp(), I get TypeError: firebase.initializeApp is not a function.\n\nSo I was able to fix the issue by simply adding this to my plugins/index.ts file:\n\nimport * as testing from '@firebase/testing';\ntesting;\n\n\nAnd then the rest of the code (that was crashing before with that error) suddenly works fine.\n\nI've even console logged the testing object from my submodule. It shows all the property keys as per normal.\n\nSimply importing it and referencing the imported variable in a pointless expression, makes the function not crash when imported and used in a submodule.\n\nUsing an NX monorepo. Any ideas appreciated!" ]
[ "typescript", "firebase", "testing", "cypress" ]
[ "Need to categorize array according to specific ids", "Hello I working in java script & having issue to sort the values and get sum by categories right now i have hotel_id and category_id. \n\n let myarray = [\n {\n price: 257,\n category: 1,\n hotel_id: 4\n },\n {\n price: 493,\n category: 1,\n hotel_id: 3\n },\n {\n price: 514,\n category: 1,\n hotel_id: 3\n },\n {\n price: 257,\n category: 1,\n hotel_id: 3\n },\n{\n price: 104,\n category: 1,\n hotel_id: 3\n },\n {\n price: 295,\n category: 1,\n hotel_id: 3\n },\n {\n price: 125,\n category: 1,\n hotel_id: 2\n },\n {\n price: 125,\n category: 1,\n hotel_id: 2\n },\n {\n price: 157,\n category: 1,\n hotel_id: 2\n },\n {\n price: 125,\n category: 1,\n hotel_id: 2\n },\n{\n price: 125,\n category: 1,\n hotel_id: 1\n },\n\n {\n price: 43,\n category: 1,\n hotel_id: 1\n },\n {\n price: 43,\n category: 2,\n hotel_id: 1\n },\n {\n price: 43,\n category: 2,\n hotel_id: 1\n }\n];\n\nvar hotel_to_values = myarray.reduce(function (obj, item) {\n obj[item.hotel_id] = obj[item.hotel_id] || [];\n obj[item.hotel_id].push(item.category);\n return obj;\n}, {});\n\nvar hotels = Object.keys(hotel_to_values).map(function (key) {\n return {hotel_id: key, category: hotel_to_values[key]};\n});\n\n\nI need to sort or group by something like this \n\n\nhotel 1\n\n\ncategory 1\n\n\nprice 20\n\ncategory 2\n\n\nprice 20 , price 30\n\n\n\n\nright now my result is \n\n[\n {\n \"hotel_id\": \"1\",\n \"category\": [\n 1,\n 1,\n 2,\n 2\n ]\n },\n {\n \"hotel_id\": \"2\",\n \"category\": [\n 1,\n 1,\n 1,\n 1\n ]\n },\n {\n \"hotel_id\": \"3\",\n \"category\": [\n 1,\n 1,\n 1,\n 1,\n 1\n ]\n },\n {\n \"hotel_id\": \"4\",\n \"category\": [\n 1\n ]\n }\n]\n\n\nI need prices inside the categories \n\nI update my code now you can check what actually i am doing yes i use reduce method but can't able to get the actual result." ]
[ "javascript", "sorting", "mapping" ]
[ "Is it possible to store numbers in form values?", "I am attempting to type a field to a number:\n<Form\n onSubmit={onSubmit}\n initialValues={{ target_type_id: 1 }}\n render={({ handleSubmit, form, submitting, pristine, values }) => (\n <form onSubmit={handleSubmit}>\n <Field<number> name="target_type_id" type="radio" value={1}>\n {({ input }) => (\n <label>\n <input {...input} /> Alert\n </label>\n )}\n </Field>\n <Field<number> name="target_type_id" type="radio" value={2}>\n {({ input }) => (\n <label>\n <input {...input} /> Lookout\n </label>\n )}\n </Field>\n <Field<number> name="target_type_id" type="radio" value={3}>\n {({ input }) => (\n <label>\n <input {...input} /> Target\n </label>\n )}\n </Field>\n <Field<number> name="target_type_id" type="radio" value={4}>\n {({ input }) => (\n <label>\n <input {...input} /> Blitz\n </label>\n )}\n </Field>\n <pre style={{ flexGrow: 1 }}>\n {JSON.stringify(values, undefined, 2)}\n </pre>\n </form>\n )}\n />\n\nHowever, when I click on the radio buttons, the value captured is a string, so it doesn't ever match up to the numeric value specified in the Field\nAny way I can capture values as a datatype other than string?\nhttps://codesandbox.io/s/strongly-typed-form-values-with-react-final-form-forked-cvn4t?file=/src/index.tsx:918-2141" ]
[ "reactjs", "react-final-form", "final-form" ]
[ "In istio AuthorizationPolicy How to match paths including query string parameters", "I'm currently using istio 1.4 and had enabled a Policy to check jwt.\nI enabled an AuthorizationPolicy which have that rule:\n\n rules\n - to:\n - operation:\n methods: [\"GET\"]\n paths: [\n \"/render/checkout\"\n ]\n when:\n - key: request.auth.claims[roles]\n values: [\"USER\"]\n\n\nWhen I hit that path with my jwt, every thing works great. The problem is when I hit the same url with a query string parameter for example /render/checkout?sort=asc, I get a RBAC: access denied.\nto bypass this, I ended up adding the path including the question mark and a wildcard:\n\npaths: [\n \"/render/checkout\", \"/render/checkout?*\"\n ]\n\n\nbut having a lot of paths and a lot of microservices, I feel that should not happen as it happens because it's very repetitive and error prone. \n\nI know that there's already an issue on github about supporting regex in paths, but currently : \n\nCan I avoid doubling each of my paths, one without query string parameters and the second with the query string parameters?" ]
[ "security", "istio" ]
[ "Rspec - testing model method - errors", "I am trying to create RSpec tests to test my suspension code below.\n\nMy code suspends one or more roles.\n\nSo an Item has several roles, each of which can be suspended by the suspend_roles method, by passing in the role ids.\n\nIt also sets the Item sub status to \"Suspended\" if all the roles are suspended.\n\nThis code is in the Item model:\n\ndef suspend_roles (role_ids)\n\n role_ids.each do |role_id|\n self.suspensions.create!(role_id: role_id, create_user_id: User.current_user.id)\n end\n\n if role_ids.count == Role.ids.count\n self.lifecycle_sub_status = \"Suspended\"\n self.save\n\n elsif role_ids.count < Role.ids.count && role_ids.count > 1\n self.lifecycle_sub_status = \"Partial\"\n self.save\n\n end\n end\n\n\nTests:\n\nit 'suspends all roles' do\n\n test_item = create :item\n test_item.suspend_roles(Role.ids)\n expect(test_item.suspensions.count).to eq (Role.ids.count)\n expect(test_item.lifecycle_sub_status).to eq \"Suspended\"\n end\n\n\nNow the problems:\n\n\nRole.ids.count is returning nil, even though when I run my actual application it return a count of the ids.\nUser.current_user.id is also returning nil\n\n\nThis is the code for current_user in the Application controller:\n\n def current_user\n if session[:user_id]\n @current_user ||= User.find(session[:user_id])\n return @current_user\n end\n end\n\n\nAt the top of my tests I have:\n\nlet(:user) { create :user }\n\n\nAm I missing anything?" ]
[ "ruby-on-rails", "rspec" ]
[ "Is possible to set an unknown value on a JSlider?", "Short:\nIs possible to set an unknown value on a JSlider having no knob?\n\nLong:\nI'm working on a project that has a desktop client developed in Java Swing where the user is required to measure some parameters using a slider. That's a requirement, it has to be a slider.\nUntil the user interacts with the slider the value has to be unknown, and that means showing no knob. That's a requirement too.\nWhen using a JSlider the knob shows always and is no way to set any value out of its bounds or set it to null as it uses the primitive type int and not the object Integer.\nIs there a way to set it a null fail-value or at least some value that shows no knob? Is there some extension that would allow to do so?" ]
[ "java", "swing", "jslider" ]
[ "get data from phpmyadmin and move the progresss bar container according to the value", "I have to move progress bar's container according to the value taking from phpmyadmin database.\nI have tried code in js. Firstly I have fetch the data from phpmyadmin databse in php.and the data is also printing in array.\n\n<div class=\"progress progress-bar-vertical\">\n <div class=\"progress-bar\" role=\"progress\" id=\"progress\" aria-valuenow=\"result\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"height: result%;\"></div>\n\n <script>\n setInterval(function(){\n jQuery.ajax({\n url: \"/bar1.php\",\n success: function(result) {\n console.log(result);\n $('.progress-bar').css(\"height\", result.responseText + '%');\n },\n });\n }, 1000);\n </script>\n\n\nI just want to move the container of vertical progress bar according the values taking from the database." ]
[ "javascript", "php" ]
[ "Draw a rectangle with pixi.js", "[Chrome v32]\n\nHow to draw a basic RED rectangle with PIXI.js library ?\n\nI tried this (not working)\n\nvar stage = new PIXI.Stage(0xFFFFFF);\nvar renderer = PIXI.autoDetectRenderer(400, 300);\ndocument.body.appendChild(renderer.view);\nrenderer.render(stage);\nvar rect = new PIXI.Rectangle(100, 150, 50, 50);\nstage.addChild(rect);\n\n\nError:\n\n\n Uncaught TypeError: Object [object Object] has no method\n 'setStageReference'" ]
[ "pixi.js" ]
[ "How to duplicate a request using wget (or curl) with raw headers?", "I was deubgging some http requests and found that I can grab request headers in this type of format:\n\nGET /download?123456:75b3c682a7c4db4cea19641b33bec446/document.docx HTTP/1.1\nHost: www.site.com\nUser-Agent: Mozilla/5.0 Gecko/2010 Firefox/5\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\nAccept-Language: en-us,en;q=0.5\nAccept-Encoding: gzip, deflate\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\nReferer: http://www.site.com/dc/517870b8cc7\nCookie: lang=us; reg=1787081http%3A%2F%2Fwww.site.com%2Fdc%2F517870b8cc7\n\n\nIs it possible or is there an easy way to reconstruct that request using wget or curl (or another CLI tool?)\n\nFrom reading the wget manual page I know I can set several of these things individually, but is there an easier way to send a request with all these variables from the command line?" ]
[ "linux", "debugging", "unix", "wget", "web" ]