texts
list
tags
list
[ "How to apply theme-specific styles in Windows Phone?", "I'm creating a Windows Phone (7.5) app where I have the need to change some styles based on which Theme (Dark or Light) is selected.\n\nIt's not good enough for this app just to try and find a color which works in both cases.\n\nSome of this can be done in code I know, but I would like to put it in xaml, as this is really just markup/styling which I don't want in my C# code :)\n\nHere's what I would like to do in pseudo code:\n\n <ImageBrush x:Key=\"BackgroundImageBrush\" ApplyForTheme=\"Dark\" Stretch=\"None\" \nImageSource=\"/WindowsFanDkApp;component/Content/AppBackground.jpg\"/>\n\n <ImageBrush x:Key=\"BackgroundImageBrush\" ApplyForTheme=\"Light\" Stretch=\"None\" \nImageSource=\"/WindowsFanDkApp;component/Content/AnotherAppBackground.jpg\"/>\n\n\nCan't seem to find any resources about how to do this...so I'm afraid it's not possible :(" ]
[ "windows-phone-7" ]
[ "Custom Price Display Precision without Roundings in Magento", "On this Question Member shivam helps me to figure out a problem for a custom price format...\n\nHow to get custom price format (with 3 Precision) in magento\n\nHere i use now Precision of 3\n\npublic function customformatPrice($price, $includeContainer = true)\n {\n if ($this->getCurrentCurrency()) {\n //sets the floating point precision to 4 points\n\n return $this->getCurrentCurrency()->format($price, array('precision'=>3), $includeContainer);\n\n } \n return $price;\n }\n\n\nBut i used a Round Precision of 4\n\npublic function roundPrice($price,$roundTo=4)\n {\n return round($price, $roundTo);\n }\n\n\nAll works fine when i use Backend Input Price Like 9.2400 € The Output in frontend are fine then. But When i input in backend something like 9.2450 € the output on fronend are roundet. It seams that i miss somewhere to round price the right way. \n\nThis Code i use for List view... (wrong Display in Roundings):\n\n<?php echo ''.Mage::helper('checkout')->customformatPrice($_minimalPriceDisplayValue /1.19 /$_bbase_qty, false) ?>\n\n\nThis Code i use for Product View. (Perfekt Roundings) But i cants use this code in List or Price phtml.\n\n<span class=\"price\"><?php echo ''.Mage::helper('checkout')->customformatPrice(min($product_price)*1.19/($_bbase_qty),true,false); ?></span>``\n\n\nHope someone can help me Figuring out where is the problem in roundings or can help me how can i use the last code in directly in list.phtml.\n\nThanks for any Help" ]
[ "php", "magento" ]
[ "Is there a way to make a scrollable gridview without putting it inside a div?", "I know a gridview can be made scrollable by including it inside a div and making the overflow to auto. But I'm using tables to align my page and found out that it's not necessarily a good idea to put a div inside a td, so are there any other way around it?" ]
[ "c#", "asp.net", "css", "gridview", "styles" ]
[ "Rolling update strategy not giving zero downtime in live traffic", "I'm using rolling update strategy for deployment using these two commands: \n\nkubectl patch deployment.apps/<deployment-name> -n <namespace> -p '{\\\"spec\\\":{\\\"template\\\":{\\\"metadata\\\":{\\\"labels\\\":{\\\"date\\\":\\\"`date +'%s'`\\\"}}}}}' \nkubectl apply -f ./kube.deploy.yml -n <namespace>\nkubectl apply -f ./kube_service.yml -n <namespace>\n\n\nYAML properties for rolling update:\n\n apiVersion: extensions/v1beta1\n\nkind: Deployment\n\nmetadata:\n\n name: \"applyupui-persist-service-deployment\"\n\nspec:\n\n # this replicas value is default\n\n # modify it according to your case\n\n replicas: 2\n\n strategy:\n\n type: RollingUpdate\n\n rollingUpdate:\n\n maxSurge: 1\n\n maxUnavailable: 20%\n\n template:\n\n metadata:\n\n labels:\n\n app: \"applyupui-persist-service-selector\"\n\n spec:\n\n hostAliases:\n - ip: \"xx.xx.xx.xxx\"\n\n hostnames:\n\n - \"kafka02.prod.fr02.bat.cloud\"\n\n\n imagePullSecrets:\n\n - name: tpdservice-devops-image-pull-secret\n\n containers:\n\n - name: applyupui-persist-service\n\n image: gbs-bat-devops-preprod-docker-local.artifactory.swg-devops.com:443/applyupui-msg-persist-service:latest\n\n imagePullPolicy: Always\n\n env:\n\n - name: KAFKA_BROKER\n\n value: \"10.194.6.221:9092,10.194.6.221:9093,10.194.6.203:9092\"\n\n - name: SCYLLA_DB\n\n value: \"scylla01.fr02.bat.cloud,scylla02.fr02.bat.cloud,scylla03.fr02.bat.cloud\"\n\n - name: SCYLLA_PORT\n\n value: \"9042\" \n\n - name: SCYLLA_DB_USER_ID\n\n value: \"kafcons\"\n\n - name: SCYLLA_DB_PASSWORD\n\n value: \"@%$lk*&we@45\"\n\n - name: SCYLLA_LOCAL_DC_NAME\n\n value: \"Frankfurt-DC\"\n\n - name: DC_LOCATION\n\n value: \"FRA\"\n\n - name: kafka.consumer.retry.topic.timeout.interval \n\n value: \"100\"\n\n - name: kafka.consumer.retry.topic.max.retry.count\n\n value: \"5\"\n\n - name: kafka.consumer.dlq.topic.timeout.interval\n\n value: \"100\"\n\n - name: kafka.producer.timeout.interval\n\n value: \"100\" \n\n - name: debug.log.enabled\n\n value: \"false\"\n\n - name: is-application-intransition-phase\n\n value: \"false\"\n\n - name: is-grace-period\n\n value: \"false\" \n\n - name: SCYLLA_KEYSPACE\n\n value: \"bat_tpd_pri_msg\"\n\n readinessProbe:\n\n httpGet:\n\n path: /greeting\n\n port: 8080\n\n initialDelaySeconds: 3\n\n periodSeconds: 10\n\n successThreshold: 1\n\n timeoutSeconds: 1\n\n nodeSelector:\n\n deployment: frankfurt\n\n # resources:\n\n # requests:\n\n # cpu: 100m\n\n # memory: 100Mi\n\n\nI tried changing maxsurge and maxunavailable parameters and different initialdelayseconds parameter. Additionally, I tried giving the livelinessprobe parameter\n\n livenessprobe:\n tcpSocket:\n port: 8080\n initialDelaySeconds: 15\n periodSeconds: 20 \n\n\n, but none of it worked.\nIt gives error in connection indicating some pod is down and hence there is a downtime." ]
[ "kubernetes", "devops", "kubernetes-deployment", "downtime", "rolling-updates" ]
[ "Why are datatable rows still filtered after clearing RowFilter?", "I have a DataTable with 1 row. I get the related DataView and set its RowFilter to \"\" or NULL.\n\nWhen I get the Count property, the value for the DataView is 0.\n\nWhy setting RowFilter to \"\", is still filtering the rows? I would expect the Count to have value of 1." ]
[ "c#", "datatable", "dataview", "rowfilter" ]
[ "ASP.NET EFCodeFirst not using correct connection string", "I am trying to publish a website using ASP.NET MVC3 EF and CODEFIRST with a SQL Server 2008 backend. On my local machine I was using a sql express db for development, but now that I am pushing live, I want to use my hosted production database. The problem is that when I try to run the application, it is still using my local db connection string. I have completely removed the old connection string from my web.config file and am using the <clear /> tag before creating the new connection string. I have also cleaned the solution and rebuilt, but somehow it is still connecting to the old db. What am I missing?\n\nThis is the new connection string:\n\n <connectionStrings>\n <clear />\n <add name=\"CellularAutomataDBContext\"\n connectionString=\" Server=XXX;\n Database=CellularAutomata; User ID=XXX; Password=XXX; Trusted_Connection=False\" \n providerName=\"System.Data.SqlClient\" /> \n </connectionStrings>\n\n\nUPDATE\n\nWhen I debug and look at the DBCONTEXT object, this is what is showing up for its connection:\n\nData Source=.\\\\SQLEXPRESS;Initial Catalog=CellularAutomata.Models.D1K2N3CARuleDBContext;Integrated Security=True;MultipleActiveResultSets=True\"\n\n\nI am unsure why this is happening because I cannot find it being set to this anywhere. Also, under configuration it says LazyLoadingEnabled = true, I assume this may be part of the problem, maybe it is not loading the new connection string. Where do I change these parameters?\n\nUPDATE 2\n\nEFCodeFirst is using a default connection string, I can't figure out how to get it to accept the connection string that I specify in the web.config file." ]
[ "asp.net", "sql-server-2008", "asp.net-mvc-3", "code-first" ]
[ "Adding <jdoc:include calls in Component Templates", "I'm integrating a component template for a customer. He is using custom templates for com_user / login &amp; reset views.\n\nHis site is also using a lot of modules. How can I activate these modules for the component in total, instead of a menu item?\n\nIn the module template (user/login/tmpl/default.php) I wrote: &lt;jdoc:include type=\"modules\" name=\"ja-news\" /&gt;, which doesn't work.\n\nThanks for any answers!\n\nBR,\nSebastian" ]
[ "joomla" ]
[ "Flask App works on localhost but Error 500 on Heroku", "I created a flask app for video streaming. It runs fine on localhost but gives Internal server error for a particular request.\n\napp.py\n\[email protected]('/video_feed')\ndef video_feed():\n\"\"\"Video streaming route. Put this in the src attribute of an img tag.\"\"\"\n return Response(gen(Camera()),\n mimetype='multipart/x-mixed-replace; boundary=frame')\n\n\nindex.html\n\n&lt;img src=\"{{ url_for('video_feed') }}\"&gt;\n\n\nEverything is working fine except this. It says client error 500 video_feed not found. I don't know where the issue is as this is working fine on localhost.\n\nI don't know if this help :\n\nif __name__ == '__main__':\n app.run(host='0.0.0.0', debug=True, threaded=True)\n\n\nError log\n\n2018-06-13T11:50:08.542211+00:00 app[web.1]: Camera warming up ...\n2018-06-13T11:50:09.543131+00:00 app[web.1]: OpenCV(3.4.1) Error: Unknown error code -10 (Raw image encoder error: Empty JPEG image (DNL not supported)) in throwOnEror, file /io/opencv/modules/imgcodecs/src/grfmt_base.cpp, line 145\n2018-06-13T11:50:09.545191+00:00 app[web.1]: [2018-06-13 11:50:09 +0000] [8] [ERROR] Error handling request /video_feed\n2018-06-13T11:50:09.545195+00:00 app[web.1]: Traceback (most recent call last):\n2018-06-13T11:50:09.545200+00:00 app[web.1]: File \"/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/sync.py\", line 135, in handle\n2018-06-13T11:50:09.545203+00:00 app[web.1]: self.handle_request(listener, req, client, addr)\n2018-06-13T11:50:09.545204+00:00 app[web.1]: File \"/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/sync.py\", line 181, in handle_request\n2018-06-13T11:50:09.545206+00:00 app[web.1]: for item in respiter:\n2018-06-13T11:50:09.545208+00:00 app[web.1]: File \"/app/.heroku/python/lib/python3.6/site-packages/werkzeug/wsgi.py\", line 704, in __next__\n2018-06-13T11:50:09.545209+00:00 app[web.1]: return self._next()\n2018-06-13T11:50:09.545211+00:00 app[web.1]: File \"/app/.heroku/python/lib/python3.6/site-packages/werkzeug/wrappers.py\", line 81, in _iter_encoded\n2018-06-13T11:50:09.545212+00:00 app[web.1]: for item in iterable:\n2018-06-13T11:50:09.545214+00:00 app[web.1]: File \"/app/app.py\", line 18, in gen\n2018-06-13T11:50:09.545216+00:00 app[web.1]: frame = camera.get_frame()\n2018-06-13T11:50:09.545218+00:00 app[web.1]: File \"/app/morse_camera.py\", line 22, in get_frame\n2018-06-13T11:50:09.545219+00:00 app[web.1]: ret, jpeg = cv2.imencode('.jpg', image)\n2018-06-13T11:50:09.545221+00:00 app[web.1]: cv2.error: OpenCV(3.4.1) /io/opencv/modules/imgcodecs/src/grfmt_base.cpp:145: error: (-10) Raw image encoder error: Empty JPEG image (DNL not supported) in function throwOnEror\n2018-06-13T11:50:09.545223+00:00 app[web.1]: \n2018-06-13T11:50:09.545462+00:00 app[web.1]: 10.67.237.54 - - [13/Jun/2018:11:50:09 +0000] \"GET /video_feed HTTP/1.1\" 500 - \"-\" \"-\"\n2018-06-13T11:50:09.545728+00:00 app[web.1]: Camera disabled and all output windows closed" ]
[ "python", "heroku", "flask" ]
[ "DoubleBuffered Paint DrawImage Invalidate Update synchronous vs asynchronous definitive explanation", "A major issue for me creating applications using Visual Studio is the documentation. The description of a class or method is vapid to the degree that the tool tip shown within Visual Studio is as informative as the documentation within the MSDN. And the examples within the MSDN vary from non-existent to cluttered and overblown.\n\nWhat I am requesting is for someone to provide a definitive explanation (with an extremely clean and well documented example) of the relationship / firing order of all things related to managing the display and movement of graphic elements on a form. The goal being to move animate an image on the form.\n\nThe questions that should be answered include: (but are not limited to)\n\n\nOn a single buffered form when does the DrawImage() method draw?\nOn a double buffered form when does the DrawImage() method draw?\nOn a double buffered form what triggers the undisplayed buffer to be displayed?\nAre images drawn to one buffer automatically also drawn to the second buffer?\nDo all images on the screen need to be redrawn for every Paint Event?\nHow is the Form.BackgroundImage redrawn?\nWhat is the sequence of events that Form.Invalidate() triggers?\nWhat is the sequence of events that Form.Invalidate(Rectangle) triggers?\nWhat is the sequence of events that Form.Update() triggers?\nWhat is the sequence of events that Form.Refresh() triggers?\nWhat is the relationship of DrawImage() and Form.Invalidate()?\nWhat is the relationship of DrawImage() and Form.Update()?\nWhat is the relationship of DrawImage() and Form.Refresh()?\nCan DrawImage() trigger the form Paint Event?\nCan a from Paint Event safely invoke DrawImage()?\nWhat are the pitfalls associated with multiple threads handling Paint Event?\nWhat are the pitfalls associated with multiple threads invoking Form.Invalidate()?\nWhat are the pitfalls associated with multiple threads invoking Form.Update()?\nWhat are the pitfalls associated with multiple threads invoking Form.Refresh()?\nWhat are the pitfalls associated with multiple threads invoking DrawImage()?\nCan the system trigger the Form Paint Event and what would the impact be to the animation?\nBasically, how does this aspect of .Net operate and what are the \"best practices\"?\n\n\nPlease resist referencing other classes, technologies, or approaches. I am hoping that a single definitive answer can be constructed herein, so that anyone who comes after will not need to search any further to understand and become immediately productive.\n\nThanks!" ]
[ "c#", ".net" ]
[ "List extending strange behaviour", "Found interesting thing in Python (2.7) that never mentioned before.\n\nThis:\n\na = []\na += \"a\"\n\n\ndoes work and result is:\n\n&gt;&gt;&gt; a\n&gt;&gt;&gt; [\"a\"]\n\n\nBut\n\na = []\na = a + \"a\"\n\n\ngives\n\n&gt;&gt;&gt; TypeError: can only concatenate list (not \"str\") to list\n\n\nCan someone explain why? Thanks for your answers." ]
[ "python", "list" ]
[ "Using SharePoint subsites and audience to target content... how?", "I would like to show different tabs in the top navigation of a SharePoint site depending on what 'Audience' the user is in. I can do this fine for pages but for subsites I cannot find an option. Googling reveals a work around, hiding the subsite and adding a link to the subsite URL. \n\nThere has to be a better way than this!" ]
[ "sharepoint", "navigation", "sharepoint-2007" ]
[ "Get an extra row with a join", "Assume I have the following tables\n\nCHAPTERS\n| ID | Title |\n---------------------\n| 1 | Introduction |\n\nLINES\n| ID | Chapter | Line |\n--------------------------------------\n| 2 | 1 | Fourscore and ... |\n| 5 | 1 | In the beginning... |\n\n\nWhat I'm looking for in my SQL result is the following\n\n| Title | Line |\n-----------------------------\n| Introduction | null |\n| Introduction | Fourscore |\n| Introduction | In the beg |\n\n\nSo basically I want an extra row with just the Title and other rows with te matching lines.\nAll I've got now is just the 2 rows with the lines without the missing null-line with just the title.\n\nAny ideas?" ]
[ "sql", "sql-server", "tsql" ]
[ "EFCode First - Prevent Dropping of Database when a new Property is added in a Model", "I need to add a new column / property to my database and my model without EF Code First dropping my database.\n\nIs there a way to manually map a column to property so EF would not drop my database?\n\nUpdate: \nGot it to work by following this post on SO.\n\nhttps://stackoverflow.com/questions/6049135/manually-editing-database-in-code-first-entity-framework\n\nBasically you just need to:\n\n\nManually add the column to your database\nManually add the property to your model\nDisable any database initializer in your DataContext" ]
[ "entity-framework", "ef-code-first" ]
[ "IE error 'Style' is null or not an object - lightbox-resize.js", "in Ie I am getting a javascript error:\n\n'Style' is null or not an object \nlightbox-resize.js \nLine 33\nchar 6\ncode 0\n\nThis realates to the following page:\n\nhttp://www.nickypellegrino.com/blog/\n\nI can figure out what is causing this issue. The page (and the lightbox) works fine in firefox/chrome - but not in IE.\n\nThere is also another error being thrown about prototype.js, and I don't know what that is either :P" ]
[ "javascript", "css", "internet-explorer" ]
[ "How to highlight a focused node in a tree in ReactJS?", "Suppose we have a tree structure rendered to a DOM tree like following:\n\n&lt;ul&gt;\n &lt;li&gt;Outer\n &lt;ul&gt;\n &lt;li&gt;Inner\n &lt;ul&gt;\n &lt;li&gt;Inner Inner&lt;/li&gt;\n &lt;/ul&gt;\n &lt;/li&gt;\n &lt;/ul&gt;\n &lt;/li&gt;\n&lt;/ul&gt;\n\n\nWe want to highlight the \"focused\" (mouse hover) node, the point here is, when an Inner node is highlighted, it's parents should not be highlighted.\n\nWith jQuery, you can access parent nodes and the solution is very straightforward http://jsfiddle.net/D7jwq/2/:\n\n$(\"li\").mouseover(function(e) {\n $(this).addClass(\"red\").parents().removeClass(\"red\");\n e.stopPropagation();\n}).mouseout(function(e) {\n $(this).removeClass(\"red\");\n});\n\n\nBut how to get the similar effect in ReactJS?" ]
[ "reactjs" ]
[ "JNI binaries not included in JAR", "I'm building javacv(http://code.google.com/p/javacv/) by myself. The problem is that the resulting jar file does not includes libjni*.so files.\nThe official release of javacv has three jar:\njavacv.jar\njavacpp.jar\njavacv-linux-x86.jar (this is where the libjni*.so is located)\n\nI use ant to build the project, and it produces javacv.jar and javacpp.jar, the javacv-linux-x86.rar however, is missing.\nWhen I look at 'build/classes/com/googlecode/javacv/cpp/linux-x86', the libjni*.so are there.\nDoes anyone know how to fix it?" ]
[ "java", "opencv", "java-native-interface" ]
[ "fully functioning file and location address not rendering rstudio rmarkdown::render()", "I have made sure that the work directory matches where I am pulling everything out of. I have deleted any spaces in all files. I set the working directory and tried to render file. I have also listed the entire file address to render. I have checked the existence of the file in rstudio. I have also tried it with the file open and close in rstudio. I have also simply changed 'library(&quot;rmarkdown&quot;)' to 'library(rmarkdown)' with no result difference\nI just cant get it to work...\n```{r, echo=FALSE, results='hide',message=FALSE, warning=FALSE}\nlibrary(&quot;rmarkdown&quot;)\nlibrary(mdsr)\nlibrary(dplyr)\nlibrary(class)\nrender(&quot;STAT310_Lecture-Week4_8_2_part2.Rmd&quot;,output_file=NULL)\n\nError in file(con, &quot;r&quot;) : cannot open the connection\n\nfile.exists(&quot;C:/Users/tiffa/Desktop/School/summer/310/STAT310_Lecture-Week4_8_2_part2.Rmd&quot;)\n[1] TRUE\n\nFrom the properties of &quot;STAT310_Lecture-Week4_8_2_part2&quot; (.rmd)\nC:\\Users\\tiffa\\Desktop\\School\\summer\\310\nPlease help! What am I missing?" ]
[ "r", "r-markdown" ]
[ "Typescript infer the returned array type elements", "I have the following function:\n\nconst data = {\n id: 1,\n name: '',\n}\n\ntype keysType = keyof(typeof data);\n\nfunction getKeysValues(...keys: keysType[]) {\n return keys.map(k =&gt; data[k]);\n}\n\nconst value = getKeysValues('id', 'name');\n\n\nThe type of value is (string | number)[]. How can I change it to be dynamic based on the passed keys? So, in the above case I'm expecting the type to be [number, string]." ]
[ "typescript" ]
[ "How to set default ruby version using rvm", "I've set my default ruby version with \n\nrvm use 1.9.3 --default\n\n\nWhen opening a new terminal I can see that rvm remembers my default, however the old version of ruby is used:\n\nLast login: Tue Jan 22 17:36:20 on ttys000\n➜ ~ rvm list default\n\nDefault Ruby (for new shells)\n\n ruby-1.9.3-p374 [ x86_64 ]\n\n➜ ~ ruby -v\nruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]\n\n➜ ~ rvm info\n\nruby-1.9.3-p374:\n\n system:\n uname: \"Darwin murzemac.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64\"\n system: \"osx/10.8/x86_64\"\n bash: \"/bin/bash =&gt; GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)\"\n zsh: \"/bin/zsh =&gt; zsh 4.3.11 (i386-apple-darwin12.0)\"\n\n rvm:\n version: \"rvm 1.17.10 () by Wayne E. Seguin &lt;[email protected]&gt;, Michal Papis &lt;[email protected]&gt; [https://rvm.io/]\"\n updated: \"14 hours 46 minutes 38 seconds ago\"\n\n ruby:\n interpreter: \"ruby\"\n version: \"1.8.7\"\n date: \"2012-02-08\"\n platform: \"universal-darwin12.0\"\n patchlevel: \"2012-02-08 patchlevel 358\"\n full_version: \"ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]\"\n\n homes:\n gem: \"/Users/murze/.rvm/gems/ruby-1.9.3-p374\"\n ruby: \"/Users/murze/.rvm/rubies/ruby-1.9.3-p374\"\n\n binaries:\n ruby: \"/usr/bin/ruby\"\n irb: \"/usr/bin/irb\"\n gem: \"/usr/bin/gem\"\n rake: \"/usr/bin/rake\"\n\n environment:\n PATH: \"/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/murze/.rvm/bin\"\n GEM_HOME: \"/Users/murze/.rvm/gems/ruby-1.9.3-p374\"\n GEM_PATH: \"/Users/murze/.rvm/gems/ruby-1.9.3-p374:/Users/murze/.rvm/gems/ruby-1.9.3-p374@global\"\n MY_RUBY_HOME: \"/Users/murze/.rvm/rubies/ruby-1.9.3-p374\"\n IRBRC: \"/Users/murze/.rvm/rubies/ruby-1.9.3-p374/.irbrc\"\n RUBYOPT: \"\"\n gemset: \"\"\n\n\nHow can 1.9.3 be automatically activated when opening a new terminal window?" ]
[ "ruby", "macos" ]
[ "node.js unit testing mock dependency", "I have a question on using proxyquire (or any other suggestions on how to test the following code)\n\nIf i have the following file to test:\n\nvar path = require('path');\n\nmodule.exports = function (conf) {\n var exported = {};\n\n exported.getIssue = function (issueId, done) {\n ...\n\n ...\n };\n\n return exported;\n};\n\n\nHow do i pass in the 'conf' variable while using proxyquire to mock 'path; var? \n\nIs there any other way to do this if not using proxyquire?" ]
[ "javascript", "node.js", "jasmine", "jasmine-node", "proxyquire" ]
[ "How to test and/or mock ref callback nodes and test .querySelector with Jest mocking + Enzyme shallow?", "Using Jest mocking and Enzyme shallow rendering, how would you test or mock the following?:\n\n onClick = () =&gt; {\n const inputNode = this.node.querySelector('input');\n inputNode.click();\n };\n\n\nI tried:\n\nit('calls button', () =&gt; {\n const wrapper = shallow(\n &lt;Component /&gt;,\n );\n const wrapperInstance = wrapper.instance();\n const inputNode = document.createElement('input');\n inputNode.value = '';\n const node = document.createElement('div').appendChild(inputNode);\n wrapperInstance.node = node;\n});" ]
[ "javascript", "reactjs", "jestjs", "enzyme" ]
[ "IE z-index trouble on element with transparent background", "everyone.\nI need 2 absolutely positioned textarea elements to be placed one over the other.\nHere is my sample:\n\n&lt;div&gt;\n &lt;textarea id=\"txt1\" style=\"position:absolute; top:0; left:0;z-index:0;background:none;\"&gt;some text&lt;/textarea&gt;\n &lt;textarea id=\"txt2\" style=\"position:absolute; top:0; left:0;z-index:1;background:none;\"&gt;&lt;/textarea&gt;\n&lt;/div&gt;\n\n\nI'm expecting txt1 to be under the txt2. That happens in FF and Chrome. But in IE (tested in 8 and 9) txt1 is clickable and becomes focus.\n\nDoes anybody know, how to manage this?\n\nThanks in advance!" ]
[ "css", "internet-explorer", "textarea", "z-index" ]
[ "Dynamically insert a stylesheet in rails project", "I've build myself a real time theme picker for a CMS we're developing for school. The CMS is build with Ruby on Rails and I (personally) don't have any experience with Ruby on Rails (others are doing the backend stuff, I'm the frontend guy).\n\nNow I want my theme picker, which is written in javascript (Backbone, Underscore and jQuery) to work with Rails, but I can't find out a right way to include the stylesheets in Rails. Currently I'm giving a static path:\n\n// Insert a new stylesheet\nvar stylesheet = $(\"&lt;link /&gt;\", {\n href: \"stylesheets/themes/theme-\" + this.themeID + \"/theme-color-\" + colorset + \".css\",\n rel: \"stylesheet\",\n id: \"js-theme-colorset\"\n});\n\n// Append the stylesheet to the iframe\n$('head', $('#js-theme-iframe')[0].contentWindow.document ).append( stylesheet );\n\n\nBut the CMS is dynamic, so I want to grab the stylesheets out of the asset pipeline, but I'm not sure how to fix that. Tried this:\n\n// Insert a new stylesheet\nvar stylesheet = '&lt;%= stylesheet_link_tag \"themes/theme-1/theme-color1.css\", :id =&gt; \"js-theme-colorset\" %&gt;';\n\n// Append the stylesheet to the iframe\n$('head', $('#js-theme-iframe')[0].contentWindow.document ).append( stylesheet );\n\n\nBut that didn't work out..\n\nAny suggestions?" ]
[ "javascript", "ruby-on-rails", "ruby", "backbone.js", "underscore.js" ]
[ "Obtain DLFileEntry with view permission", "Is there a way to obtain a DLFileEntries from a DB, without testing all of them with a permission checker? Also is there a way to combine it with SQL Query? What I need to do, is to obtain every DLFileEntry, that user can VIEW, matching the SQL Query.\n\nThanks in advance." ]
[ "java", "sql", "permissions", "liferay" ]
[ "PIctureBox/Rectangle is not display when size increase", "I am trying to display different parts of a single picture multiple times (15 pieces) on a form. I store each piece as a Rectangle, convert it to a BitMap, and then add that BitMap to a my Tile object, which is PixtureBox object. When I do the following, without inflating the size is displays like so in the first image: (code included):\n\nBut when I try inflating it (line 157), only 4 of the images show,like so:\n\nam I approaching this incorrectly? \n\nIf it helps, the original picture is just an image of the number 1 and I want each piece to pretty much fill up 4 times the amount in the first image." ]
[ "c#", "bitmap", "size", "picturebox" ]
[ "\"This\" Keyword in Javascript inside HTML ELEMENTS behavior", "th,td {\n padding: 5px;\n}\n&lt;/style&gt;\n&lt;body&gt;\n\n&lt;h2&gt;The XMLHttpRequest Object&lt;/h2&gt;\n\n&lt;form action=\"\"&gt; \n &lt;select name=\"customers\" onchange=\"showCustomer(this.value)\"&gt;\n &lt;option value=\"\"&gt;Select a customer:&lt;/option&gt;\n &lt;option value=\"ALFKI\"&gt;Alfreds Futterkiste&lt;/option&gt;\n &lt;option value=\"NORTS \"&gt;North/South&lt;/option&gt;\n &lt;option value=\"WOLZA\"&gt;Wolski Zajazd&lt;/option&gt;\n &lt;/select&gt;\n&lt;/form&gt;\n&lt;br&gt;\n&lt;div id=\"txtHint\"&gt;Customer info will be listed here...&lt;/div&gt;\n\n&lt;script&gt;\nfunction showCustomer(str) {\n var xhttp; \n if (str == \"\") {\n document.getElementById(\"txtHint\").innerHTML = \"\";\n return;\n }\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 &amp;&amp; this.status == 200) {\n document.getElementById(\"txtHint\").innerHTML = this.responseText;\n }\n };\n xhttp.open(\"GET\", \"getcustomer.asp?q=\"+str, true);\n xhttp.send();\n}\n&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n\n\nHey and sorry for the basic question :) just studying some JavaScript's AJAX and I'm confused with the use of \"this\" in this code block, in the onchange EventHandler. It seems as if \"this\" refers to the option element but I can't really understand how or why.\n\nEDIT : seems like it's not so basic.\n\nI read the detailed answer of a general question about \"this\"\n\nHow does the &quot;this&quot; keyword work?\n\nand also the great article :\n\nhttp://www.digital-web.com/articles/scope_in_javascript/\n\nboth of them serve a great deal of people, but do not touch exactly my question.\n\nI can't figure out what's the exact behavior of \"this\" when using it inside the HTML element, with a javascript function.\n\nI hope someone understands my meaning" ]
[ "javascript", "html", "ajax", "dom" ]
[ "How does app know if it started from a crash", "Whenever I start the app I want to know if the app recovered from a crash. Can I store it in a flag ?\n\nDo the crash and regular app exit scenario go through the same steps(lifecycle) in android ?" ]
[ "android", "android-activity", "android-lifecycle" ]
[ "NFC Subscription Windows phone 8 SDK", "I have the SmartTags from Sony the content of the tag is:\n\nContents of the NDEF message:\nMessage size: 41 bytes\nType name: NFC RTD Specification\nRecord type: U [URI]\nsemc://liveware/A1/2/NT2/5/smarttags\n\nRaw NDEF message (hex):\nD1 01 25 55 00 73 65 6D 63 3A 2F 2F 6C 69 76 65 77 61 72 65 2F 41 31 2F 32 2F 4E 54 32 2F 35 2F 73 6D 61 72 74 74 61 67 73\n\n\nhow can I subscribe to this message from windows phone sdk?\n\nI tried the following:\n\nproximityDevice.SubscribeForMessage(\"NDEF:URI.semc://liveware/A1/2/NT2/5/smarttags\", AddressOf messageReceived)\n\n'and\n\n\nproximityDevice.SubscribeForMessage(\"NDEF:URI.semc\", AddressOf messageReceived)\n\n\nI was not able to receive data from the tag.\n\nMy question is, how can I subscribe for this data: semc://liveware/A1/2/NT2/5/smarttags\n\nMany thanks for your help." ]
[ "windows-phone", "nfc" ]
[ "Mixed language C++, C and Fortran compilation with Cmake", "Using g++, gcc and gfortran on GNU/Linux, I've written a simple script to compile and link together a number of source code files written in C++, C and Fortran. Here are the complete contents of the script. This script has been tested, and works well.\n\ng++ -c test-Q.cpp -I./boost/boost_1_52_0/ -g\n gcc -c paul2.c -g\n gcc -c paul2_L1.c -g\n gcc -c paul6.c -g\n gcc -c paul6_L1.c -g \n gcc -c fit_slope.c -g\n gfortran -c getqpf.F -g\n g++ -o test-Q test-Q.o paul2.o paul2_L1.o paul6.o paul6_L1.o fit_slope.o getqpf.o -g -lgfortran\n\n\nTo make this more cross-platform, I would like to re-write the script using Cmake. How might I handle mixed-language compilation?\n\nThe following test script listed below does not work, and will only selectively compile some of the files.\n\nIs there perhaps another cross-platform build process that might be better suited for this type of compilation?\n\ncmake_minimum_required (VERSION 2.6)\nproject (q-test)\n\ninclude_directories(/media/RESEARCH/SAS2-version2/test-Q/boost/boost_1_52_0)\n\nadd_executable( q-test\ntest-Q.cpp\npaul2.c\npaul2_L1.c \npaul6.c \npaul6_L1.c \nfit_slope.c\ngetqpf.F\n) # end" ]
[ "gcc", "g++", "cmake", "gfortran" ]
[ "NodeJS: route.get with traditional query string format", "I'm using express to redirect my web request. One of my web request takes in three optional parameters, so I have \n\nrouter.get('/function/:param1?/:param2?/:param3?', function(req, res) {...}); \n\n\nMy issue is that as all these three params are optional and not depending on each other. For example, user can provide param3 only. In the current implementation, param3 will be assigned to param1 variable due to the sequence embedded in the router format. \n\nHow to implement something like below? \n\nrouter.get('/function?param1=$1&amp;param2=$2&amp;param3=$3', function(req, res){...});" ]
[ "node.js" ]
[ "merging like objects and values with Array.reduce(}", "I am using vanilla js for this helper function inside of a react app / typescript.\nJson data is fetched this holds every letter of the alphabet which is assigned a value and a key. These are layed out into a grid of tiles. When a user selects a tile, this is added to gameData array in React which is used for a list. If a user clicks onto the same tile this is merged so instead of multiple list elements with same values they are merged with quantity + quantity and value + value\n\nThe structure is as such\n\nconst apiData = [\n {key: 'A', value: 50, quantity: 1, color: '#3498db', ...etc},\n {key: 'B', value: 40, quantity: 1, color: '#e67e22', ...etc},\n ...\n]\n\nconst gameData = [\n {key: 'A', value: 200, quantity: 4, color: '#3498db', ...etc},\n {key: 'E', value: 10, color: '#fa0', ...etc},\n]\n\nexport function groupBy(array: GameData[]) {\n const group: GameData[] = Object.values(\n array.reduce((acc: any, { value, quantity, ...r }) =&gt; {\n const key = Object.entries(r).join(\"-\");\n acc[key] = acc[key] || { ...r, quantity: 0, value: 0 };\n return ((acc[key].value += value), (acc[key].quantity += 1)), acc;\n }, {})\n );\n return group;\n}\n\n\nThe reducer works and merges properly but I just feel like there must be a better way to do this. Any ideas?" ]
[ "javascript", "typescript" ]
[ "How do I add a dependency to the android gradle task 'test'?", "I've introduced a dependency for my unit tests to a custom task I've written in gradle. In android-gradle v1.2.3 the unit test task is named test. So I assumed you add a dependency with test.dependsOn. Gradle doesn't like that. \n\nError:\n\n C:\\coding\\source\\testapp\\app\\build.gradle\n Error:(30, 0) Could not find property 'test' on project ':app'.\n\n\nbuild.gradle:\n\napply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 22\n buildToolsVersion \"22.0.1\"\n\n defaultConfig {\n applicationId \"com.example.nilzor.myapplication\"\n minSdkVersion 15\n targetSdkVersion 22\n versionCode 1\n versionName \"1.0\"\n }\n}\n\ndependencies {\n compile fileTree(dir: 'libs', include: ['*.jar'])\n compile 'com.android.support:appcompat-v7:22.1.1'\n}\n\ntask myTask() {\n}\n\ntest.dependsOn 'mytask' \n\n\nWhere do I go wrong and how do I fix it?" ]
[ "gradle", "android-gradle-plugin" ]
[ "Screen space to world space", "I'm making a drawing program in C++ and can't figure out how to convert from screen space to world space\nI have access to the projection and view matrices as well as the screen size ect\nThis is the code I'm using but it doesn't work\nThere are no errors but it doesn't output world space coodinates at all, it just slightly changes all of the pixel coodinates\nI was following an answer I found here OpenGL Math - Projecting Screen space to World space coords\nI'm only using an orthographic camera right now\nglm::mat4 proj = cameraComp.Camera.GetProjection();\nglm::mat4 view = glm::translate(glm::mat4(1.0f), transformComp.Position)\n * glm::rotate(glm::mat4(1.0f), glm::radians(transformComp.Rotation.z), glm::vec3(0, 0, 1));\n\nglm::mat4 inversed = glm::inverse(proj * view);\n\nglm::vec4 worldPos = { newMousePos, 0, 1 };\nworldPos *= inversed;" ]
[ "c++", "opengl", "glm-math" ]
[ "Rxjs - switchMap to http changes observable character from hot to cold", "Can somebody explain me why below code triggers request to server three times? if i were subscribing directly to http.get() i know that its cold observable so it will result callin server 3 times and i need to use .share() to avoid that. but why the same behavior when i am subscribing to subject which is hot.. weird:\n\nlet testTrigger = new Subject&lt;any&gt;();\n\n\nlet testTask$ = testTrigger.switchMap(()=&gt; this.restClient.get('onet'));\n\ntestTask$.subscribe(console.log.call(console));\ntestTask$.subscribe(console.log.call(console));\ntestTask$.subscribe(console.log.call(console));\ntestTrigger.next(1);" ]
[ "javascript", "angular", "rxjs" ]
[ "Redirecting subdomains with .htaccess", "I have a domain http://careers.newable.co.uk. I force users to use a secure connection by specifying the all traffic should be redirected over https using the following rewrite rule:\n\n# Redirect http:// to https://\nRewriteCond %{HTTPS} !=on\nRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] \n\n\nHowever, I have a complication:\n\nA user can go to http://www.careers.newable.co.uk and the users receives a browser error saying: This site can’t provide a secure connection.\n\nI've seen a few .htaccess rules for redirecting such as this:\n\nRewriteCond %{HTTP_HOST} ^www\\.example\\.com$ [NC]\nRewriteRule ^(.*)$ http://example.com/$1 [R=301,L]\n\n\nBut this has no effect as the browser still complains about the lack of a secure connection." ]
[ ".htaccess", "redirect" ]
[ "Minimum circle encompassing multiple bounding boxes", "I have a set of bounding boxes (lower/upper x,y) in 2D. I would like to find the diameter of the smallest circle that encompasses these bounding boxes.\n\nI am not too familiar with computational geometry algorithms, but a Google search turned up these links: https://en.wikipedia.org/wiki/Bounding_sphere or this: https://en.wikipedia.org/wiki/Smallest-circle_problem\n\nQuestions:\n\n\nIs the problem specified above the same as the links mentioned above (but in 2D)? If so, I can apply/implement the Ritter algorithm or maybe the Minball solution https://github.com/hbf/miniball?\nIs there an existing python package/function (maybe Shapely?) that does this already?" ]
[ "computational-geometry" ]
[ "Object doesn't support set_viewXML", "I am using SharePoint 2013 and attempting to filter a list by a Lookup choice field.\n\nAfter searching around and attempting a variety of ways of inserting the query XML, I have the following code:\n\nfunction getListItems(listName, viewTitle){\n var myClientContext = new SP.ClientContext.get_current();\n var oWebsite = myClientContext.get_web();\n var oList = oWebsite.get_lists().getByTitle(listName);\n\n var camlQuery = new SP.CamlQuery();\n var q = '&lt;View&gt;&lt;Query&gt;&lt;Where&gt;' +\n '&lt;Eq&gt;' +\n '&lt;FieldRef Name=\"SignLocationsList\" LookupId=\"true\" /&gt;' +\n '&lt;Value Type=\"Lookup\"&gt;HQ&lt;/Value&gt;' +\n '&lt;/Eq&gt;' +\n '&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;';\n camlQuery.set_viewXML(q);\n\n // No specific query at this time\n this.collListItem = oList.getItems(camlQuery); \n\n myClientContext.load(collListItem,'Include(Id,Title,Posting_x0020_Date_x0020_Planned,Removal_x0020_Date_x0020_Planned,SignRemoved,AttachmentFiles,SignLocationsList');\n myClientContext.executeQueryAsync(getItemsSuccess, getItemsFail);\n}\n\n\nHowever, I still end up with the error : \n\n\n Error: Object doesn't support property or method 'set_viewXML'\n\n\nWithout adding the query portion, I am able to see the entire list and display it the way that I need to. It is only when attempting to add the query XML that I end up with the error." ]
[ "javascript", "sharepoint" ]
[ "In Django, can I do the All-In-One Front-end Integration ready (React, Vue) using Webpack like Laravel Does, creating a wrapper for compiling js?", "In PHP Laravel for example I can do this without creating a directory for the Front-end stuff and the traditional and recommended way the RESTFul API or GraphQL method stuff for communication between different programming languages just taking advantage of the already included Axios(npm i = npm run dev = node_modules) in Laravel and its built-in API feature via a Route(api.php) for referencing the URI out of the box. The below code snippet is the example the webpack.mix.js(a modified configured Webpack wrapper support specifically for PHP Laravel).\n\r\n\r\nconst mix = require('laravel-mix');\n\n/*\n |--------------------------------------------------------------------------\n | Mix Asset Management\n |--------------------------------------------------------------------------\n |\n | Mix provides a clean, fluent API for defining some Webpack build steps\n | for your Laravel applications. By default, we are compiling the CSS\n | file for the application as well as bundling up all the JS files.\n |\n */\n //Additional Custom Configs implementing Typescript for React and its corresponding modules\n const webpack = require('webpack');\n\n const path = require('path')\n const HtmlWebpackPlugin = require('html-webpack-plugin')\n\n // Try the environment variable, otherwise use root\n const ASSET_PATH = process.env.ASSET_PATH || `{{ asset('') }}`\n\n mix.webpackConfig({\n entry: path.resolve(__dirname, '.', './resources/js/src/init.tsx'),\n resolve: {\n extensions: ['.css', '.tsx', '.ts', '.js'],\n },\n module: {\n rules: [\n {\n test: /\\.(ts|js)x?$/,\n\n /* No need because Laravel already took care of this\n exclude: /node_modules/,\n use: [\n {\n loader: 'babel-loader'\n }\n ]*/\n\n },\n\n //Test for CSS loaders\n /* No need also because Laravel already took care of this\n\n {\n test: /\\.css$/,\n use: ['style-loader', 'css-loader'],\n },\n //Test for Asset files such as image types\n {\n test: /\\.(?:ico|gif|png|jpg|jpeg)$/i,\n type: 'asset/resource'\n },\n //Test for Asset files such as svg's types\n {\n test: /\\.(woff(2)?|eot|ttf|otf|svg|)$/,\n type: 'asset/inline'\n } */\n\n\n ]\n }, /*module property*/\n\n plugins: [\n new HtmlWebpackPlugin({\n inject: 'body',\n template: path.resolve(__dirname, '.', `./resources/js/src/templates/index.html`),\n filename: 'welcome.blade.php',\n }),\n new webpack.DefinePlugin({\n 'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH),\n }),\n ],\n\n output: {\n filename: '[name].bundle.js',\n path: path.resolve(__dirname, '.', './resources/views/compiled/'),\n publicPath: ASSET_PATH,\n },\n\n })\n\n\n//Compilations Exclusice for laravel using the &lt;script src=\"{{ mix('js/init.js') }}\"&gt;&lt;/script&gt;\nmix.js('resources/js/app.js', 'public/js')\n .js('resources/js/src/init.tsx', 'public/js')\n .postCss('resources/css/app.css', 'public/css', [\n //\n ]);\r\n\r\n\r\n\nAnd the reason for this is I like to use Laravel's blade templating engine to practice and learn both PHP and Vue or React or any other JS Frameworks via a reference &lt;script src=&quot;{{ mix('js/init.js') }}&quot;&gt;&lt;/script&gt; Inside a Parent Markup Template for Output of expression results in different Languages like PHP and JS(Vue) like learning like this\nPHP and Js Vue\nand finally calling axios to the controller for PHP manipulation\nAxios Functionality\nand simply just typing this unto the console terminal through its corresponding Shell CLI using bash\nyarn run watch-poll \n\nAfter js compiling|bundling(Webpack) &amp; transpiling ES Modules(loads babel via Webpack) with one Runserver (Command opening another instance of bash shell CLI Terminal Console)\nphp artisan serve\n\nNow it runs both Laravel Php and React or Vue locally in one sitting,\nUnlike doing it this way for the Backend (Laravel)\nphp artisan serve\n\nAnd one for the frontend for example React\nyarn start || cd build &amp;&amp; npx serve" ]
[ "django", "frontend", "backend" ]
[ "How to perform semi join with multiple columns in pandas?", "Let's say I have these two data frames:\n&gt;&gt;&gt; df1 = pd.DataFrame({'grp':[1,1,2], 'x':[6,4,2], 'y':[7,8,9]})\n&gt;&gt;&gt; df1\n grp x y\n0 1 6 7\n1 1 4 8\n2 2 2 9\n\n&gt;&gt;&gt; df2 = pd.DataFrame({'grp':[1], 'x':[6], 'z':[3]})\n&gt;&gt;&gt; df2\n grp x z\n0 1 6 3\n\nI figured that a semi-join can be done easily with a single column e.g.\n&gt;&gt;&gt; df1[df1.grp.isin(df2.grp)]\n grp x y\n0 1 6 7\n1 1 4 8\n\nThe question is: how do I do that with two columns - grp and x?" ]
[ "pandas" ]
[ "CXF wsdl2java: No adress location in wsdl:port tag", "When creating a web-service using CXF (configuration in Spring), my resulting WSDL is missing the address location in port tag. This is problematic for client side. If CXF is used for client creation, endpoint must be set programatically in client code. If Axis is used (the consumer of my web-service wants to be able to use Axis 1), there is an error saying \n\nError in generating Java from WSDL: java.io.IOException: \nEmitter failure. Cannot find endpoint address in port FooServiceSOAPPort \nin service FooServiceLocator\n\n\nInstead of being forced to create the client using CXF or Axis2 and manually setting the endpoint in client code, I would like to have the following child element:\n\n&lt;soap:address location=\"http://localhost:9000/services/foo\"/&gt;\n\n\nunder the tag &lt;wsdl:port binding=\"...\" name=\"...&gt; in my WSDL (generated by CXF from my service code).\n\nIf I save the WSDL as local file and I manually add the line above, client is generated without any problems using Axis, no manual endpoint setting is needed on the client side and everything is OK. So, how do I make the address location line appear in WSDL generated by CXF? \n\nHere's my Spring config (relevant endpoint tag):\n\n&lt;jaxws:endpoint xmlns:hel=\"http://user.services/\"\n name=\"Foo\"\n address=\"/services/foo\"\n implementor=\"services.foo.FooImpl\"/&gt;\n\n\nHere's my service interface:\n\n@WebService\npublic interface Foo {\n String method1(String arg1);\n}\n\n\nand implementation\n\n@WebService(endpointInterface = \"services.foo.Foo\")\n@SOAPBinding(style = Style.DOCUMENT, use = Use.LITERAL)\npublic class FooImpl implements Foo {\n @WebMethod(operationName = \"method1\")\n public String method1(String arg1) {\n return \"OK\";\n }\n}" ]
[ "web-services", "soap", "wsdl", "cxf", "jax-ws" ]
[ "Continuous Form, how to add/update records with external connection", "EDIT After some more research I found that I cannot use a continuous form with an unbound form since it can only reference a single record at a time. Given that I've altered my question...\n\nI have a sample form that pulls out data to enter into a table as an intermediary.\n\nInitially the form is unbound and I open connections to two main recordsets. I set the listbox's recordset equal to one of them and the forms recordset equal to the other.\n\nThe problem is that I cannot add records or update existing ones. Attempting to key into the fields does nothing almost as if the field was locked (Which it is not). Settings of the recordsets are OpenKeyset and LockPessimistic.\n\nTables are not linked, they come from an outside access database seperate from this project and must remain that way. I am using an adodb connection to get the data. Could the separation of the data from the project be causing this?\n\nSample Code from the Form\n\nOption Compare Database\nOption Explicit\n\nPrivate conn As CRobbers_Connections\nPrivate exception As CError_Trapping\nPrivate mClient_Translations As ADODB.Recordset\nPrivate mUnmatched_Clients As ADODB.Recordset\nPrivate mExcluded_Clients As ADODB.Recordset\n\n//Construction\nPrivate Sub Form_Open(Cancel As Integer)\n Set conn = New CRobbers_Connections\n Set exception = New CError_Trapping\n\n Set mClient_Translations = New ADODB.Recordset\n Set mUnmatched_Clients = New ADODB.Recordset\n Set mExcluded_Clients = New ADODB.Recordset\n\n mClient_Translations.Open \"SELECT * FROM Client_Translation\" _\n , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic\n\n mUnmatched_Clients.Open \"SELECT DISTINCT(a.Client) as Client\" _\n &amp; \" FROM Master_Projections a \" _\n &amp; \" WHERE Client NOT IN ( \" _\n &amp; \" SELECT DISTINCT ClientID \" _\n &amp; \" FROM Client_Translation);\" _\n , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic\n\n mExcluded_Clients.Open \"SELECT * FROM Clients_Excluded\" _\n , conn.RBRS_Conn, adOpenKeyset, adLockPessimistic\n\nEnd Sub\n\n//Add new record to the client translations\nPrivate Sub cmdAddNew_Click()\n If lstUnconfirmed &lt;&gt; \"\" Then\n AddRecord\n End If\nEnd Sub\n\nPrivate Function AddRecord()\n With mClient_Translations\n .AddNew\n .Fields(\"ClientID\") = Me.lstUnconfirmed\n .Fields(\"ClientAbbr\") = Me.txtTmpShort\n .Fields(\"ClientName\") = Me.txtTmpLong\n .Update\n End With\n UpdateRecords\nEnd Function\n\nPrivate Function UpdateRecords()\n Me.lstUnconfirmed.Requery\nEnd Function\n\n//Load events (After construction)\nPrivate Sub Form_Load()\n Set lstUnconfirmed.Recordset = mUnmatched_Clients //Link recordset into listbox\n Set Me.Recordset = mClient_Translations\nEnd Sub\n\n//Destruction method\nPrivate Sub Form_Close()\n Set conn = Nothing\n Set exception = Nothing\n Set lstUnconfirmed.Recordset = Nothing\n Set Me.Recordset = Nothing\n Set mUnmatched_Clients = Nothing\n Set mExcluded_Clients = Nothing\n Set mClient_Translations = Nothing\nEnd Sub" ]
[ "ms-access", "adodb", "continuous-forms" ]
[ "Chromium max number of concurrent HTTP connections", "Could someone point me to the maximum number of concurrent HTTP connections in chromium by default. In case I need to change the value is there a flag which enables that. If not, could you point me to the location in the chromium source where this can be achieved." ]
[ "http", "google-chrome", "browser", "chromium" ]
[ "Aggregation/correlation with multiple IDs", "I have 2 tables usr and rslt as below.\n\n\n\nI want to get output as below.\n\n\n\nI have tried below query to get total wins &amp; lost\n\nSELECT tab1.id\n , tab1.wins\n , tab2.loos\nFROM\n (SELECT u1.ID\n , COUNT(r1.WINNER) wins\n FROM rslt r1\n , usr u1\n WHERE (u1.ID = r1.WINNER)\n GROUP BY u1.ID) tab1\n ,\n (SELECT u2.ID\n , COUNT(r2.Looser) loos\n FROM rslt r2\n , usr u2\n WHERE (u2.ID = r2.Looser)\n GROUP BY u2.ID) tab2\nWHERE tab1.ID = tab2.id;" ]
[ "sql" ]
[ "Why is jQuery unload not working in chrome and safari?", "unload function in jQuery works fine in Firefox but not in chrome and safari. please check this fiddle in chrome and Firefox. http://jsfiddle.net/jeevankk/Gywnw/2/ . Alerts a message when the page is refreshed.\n\n$(window).unload(function() { \n alert(\"Unload\"); \n});​" ]
[ "javascript", "jquery" ]
[ "{Pafy Problem} How can i change video name in pafy", "I want to know how to change the name of the downloaded video or add to it\nimport pafy\nurl = str(input(&quot;Youtube video URL :&quot;))\nvideo = pafy.new(url)\nstream = video.streams\nstream[0].download()" ]
[ "python", "pafy" ]
[ "How can I divide one value by a value in the row before in pandas dataframe?", "I have a dataframe of 10 observations. I'd like to divide row 1 by row 2, row 2 by row 3, row 3 by row 4, etc. When I get to row 10, then I want to divide row 10 by row 1.\nHere is some sample code:\nimport pandas as pd\ndict1 = {'group':[1,2,3,4,5,6,7,8,9,10]\n ,'value': [.35,.41,.40,.60,.36,.55,.49,.57,.57,.52]}\ndf = pd.DataFrame(dict1)\n\nHere is the result I'm looking for:\ndict1 = {'group':[1,2,3,4,5,6,7,8,9,10]\n ,'value': [.35,.41,.40,.60,.36,.55,.49,.57,.57,.52]\n , 'target': [.854,1.025,.667,1.667,.655,1.122,.860,1,1.096,.673]}\ndf = pd.DataFrame(dict1)" ]
[ "python", "pandas" ]
[ "Android external allocation too large, but why?", "I have a large image 1.28 MB (1,343,488 bytes) that I use in my app, however I wanted to change a few things and created a new image that was instead only 292 KB (299,008 bytes) in size. I created both images in Photoshop 7.0, saved them both as .png and both as interlaced. I have been creating this app around the larger image, and as soon as I switch to the smaller image, I get an OutOfMemory error with my bitmap saying \n\n12108912-byte external allocation too large for this process\n\nwhy does it think my new image is 11.5 MB? if i switch images back to the larger one, it compiles correctly.\n\nprivate Bitmap loadMapBitmap() {\n Log.d(\"InteractiveMap\", \"loadBitmap\");\n Bitmap bitmap = null;\n try { \n bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.map);\n } catch (Resources.NotFoundException e) {\n Log.d(TAG, \"loadMapBitmap - \" + e.toString());\n finish();\n } catch (OutOfMemoryError e) {\n Log.d(\"InteractiveMap\", \"too big \" + e.getMessage());\n finish();\n }\n\n return bitmap;\n}\n\n\nI dont get why the much smaller image doesnt work." ]
[ "android", "out-of-memory" ]
[ "Send .zip file from service to nodejs app and after that to browser", "I'm trying to send a zip file from Server(A) to Server(B)\nBrowser\n$.ajax({\n url: 'routes/getFile',\n method: &quot;POST&quot;,\n contentType: 'application/json',\n success: function (data) {\n var byteCharacters = data;\n var byteNumbers = new Array(byteCharacters.length);\n for (var i = 0; i &lt; byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n } \n var byteArray = new Uint8Array(byteNumbers);\n var blob1 = new Blob([byteArray], {type: &quot;application/zip, application/octet-stream&quot;});\n var fileName1 = &quot;cool.zip&quot;;\n saveAs(blob1, &quot;my.zip&quot;);\n }\n\nServer B (request the zip file)\nrouter.post('/getFile', (req, res, next) =&gt; { \nvar options = {\n uri: 'Server_A_location'+ 'get_Zip',\n method: 'POST,\n json: req.body \n }\n rp(options).then(function (data) {\n console.log(data)\n var buff = Buffer.from(data);\n res.send(buff);\n }\n\nServer A (here is the zip file)\n var admzip=require('adm-zip')\n router.post('/get_Zip',function(req,res,next){\n var zip=new admZip();\n zip.addLocalFile('..path_of_zip_file');\n var zip_contents=zip.toBuffer();\n res.writeHead(200,{\n 'Content-Disposition':'attachment; filename=&quot;myfile.zip&quot;,\n 'Content-Type':'application/zip'\n })\n return res.end(zip_contents);\n\nData that i receive at ServerB is in binary format: PKYUQ�3�test1/test1.1.json�}kw⸲���+...\nIn browser I get the zip file but its broken. Any suggestions or ideas" ]
[ "node.js", "web-services", "binary", "zip", "buffer" ]
[ "Using Curl to get a JSON object", "I know how to do this using httpRequest:\n\n //create the httprequest object \n $httpRequest_OBJ = new httpRequest($url, HTTP_METH_GET, $options);\n\n //add the content type\n $httpRequest_OBJ-&gt;setContentType = 'Content-Type: application/Json; charset=utf-8';\n //add the raw post data\n $httpRequest_OBJ-&gt;setRawPostData ($theData);\n //send the http request\n $result = $httpRequest_OBJ-&gt;send();\n\n try{\n $response = $result-&gt;getBody();\n }catch (HttpException $ex){\n\n echo $ex;\n\n\n }\n\n\nWhat is the cURL equivalent?\n\nCheers." ]
[ "php", "json", "curl", "httprequest" ]
[ "Need to access GAE logs programmatically", "we have a GWT application hosted in GAE. We use gwt-log (http://\ncode.google.com/p/gwt-log/) to log our client side and server side\nexceptions. What we need to do is to run a cron job every day at the\nmidnight to create a report on all the exceptions (ex. listing source,\nexception time, count, etc). In order to do this, we need to access\nGAE logs promrammatically through API call or something from our\nserver side code. Is this possible?\nIs the log data accessible?\n\nIf this is not possible, what is a best way to summarize errors in the\nlogs?\n\nThank you so much." ]
[ "google-app-engine", "gwt", "logging", "error-logging" ]
[ "CSS color property works on some computers, but not others", "I have boxes where some have a yellow background with black writing, and others have blue background with white writing. This seems to work in Google Chrome on all computers; however, it only works in IE sometimes. I currently have IE11 and it seems to work perfectly fine (when not in compatibility mode). On another computer with IE11, it shows a grey font on both the yellow and blue boxes. But with compatibility viewer, all boxes are yellow with black font. On a third computer, it shows all the boxes as yellow with black font.\n\nThe only problem is the grey font on the yellow and blue because it makes it hard to read.\nAny suggestions?\n\nHere is my code to make all elements yellow with black text:\n\nul.testimonials li a{\n text-decoration:none;\n color:#000;\n background:#ffc;\n display:block;\n}\n\n\nHere is my code to make every other element blue with white text:\n\nul.testimonials li:nth-child(even) a{\n background:#4F4FBB;\n color:#FFFFFF;\n}\n\n\nI'm not sure where the grey color is coming from. There are other style sheets embedded into the page, but I cannot find where the grey is being set. Also, I thought that css was done locally, so if I set a property directly in this html, it would override any stylesheets. Correct me if I am wrong.\n\nThanks for any help you may provide!\n\nedited: I do see in the stylesheet that the body is set to a grey color, also it says\n\n#content p big a {\n color: #666;\n}\n\n\nmay that be the problem? Why does my CSS not override this?\n\nHere is my HTML:\n\n&lt;ul class=\"testimonials\"&gt;\n &lt;li&gt;\n &lt;a href=\"#\"&gt;\n &lt;p&gt;TEXT 1&lt;br&gt;&lt;br&gt;&lt;p style=\"text-align:right\"&gt;&lt;b&gt;INSERT NAME HERE&lt;/b&gt;&lt;/p&gt;&lt;/p&gt;\n &lt;/a&gt;\n &lt;/li&gt;\n &lt;li&gt;\n &lt;a href=\"#\"&gt;\n &lt;p&gt;TEXT 2&lt;br&gt;&lt;br&gt;&lt;p style=\"text-align:right\"&gt;&lt;b&gt;INSERT NAME HERE&lt;/b&gt;&lt;/p&gt;&lt;/p&gt;\n &lt;/a&gt;\n &lt;/li&gt;\n &lt;li&gt;\n &lt;a href=\"#\"&gt;\n &lt;p&gt;TEXT 3&lt;br&gt;&lt;br&gt;&lt;p style=\"text-align:right\"&gt;&lt;b&gt;INSERT NAME HERE&lt;/b&gt;&lt;/p&gt;&lt;/p&gt;\n &lt;/a&gt;\n &lt;/li&gt;\n &lt;li&gt;\n &lt;a href=\"#\"&gt;\n &lt;p&gt;TEXT 4&lt;br&gt;&lt;br&gt;&lt;p style=\"text-align:right\"&gt;&lt;b&gt;INSERT NAME HERE&lt;/b&gt;&lt;/p&gt;&lt;/p&gt;\n &lt;/a&gt;\n &lt;/li&gt;\n&lt;/ul&gt;" ]
[ "html", "css", "internet-explorer", "internet-explorer-11" ]
[ "Parse data from website using jsoup", "i'm creating an android app which is gathering data from www.zamboangatoday.ph, get all the news titles or headers. but i can retrieve only one item can someone check my code.\n\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n\n\n try{\n\n outputTextView = (TextView)findViewById(R.id.textView1);\n //Document doc = Jsoup.parse(html,\"http://www.zamboangatoday.ph\");\n Document doc = Jsoup.connect(\"http://www.zamboangatoday.ph/\").get();\n //Elements tag = doc.select(\".even h4 a\");\n\n Iterator&lt;Element&gt; iter = doc.select(\"li.even h4 a\").iterator();\n //List&lt;Image&gt; images = new ArrayList&lt;Image&gt;();\n while(iter.hasNext())\n {\n Element element = iter.next();\n\n outputTextView.setText(element.text());\n\n }\n\n }catch(Exception e)\n {\n e.printStackTrace();\n }\n\n\n\n\n }" ]
[ "java", "jsoup" ]
[ "Deleting XML using a selected Xpath and a for loop", "I currently have the following code:\n\nXPathNodeIterator theNodes = theNav.Select(theXPath.ToString());\n\nwhile (theNodes.MoveNext())\n{\n //some attempts i though were close\n //theNodes.RemoveChild(theNodes.Current.OuterXml);\n //theNodes.Current.DeleteSelf();\n}\n\n\nI have set xpath to what I want to return in xml and I want to delete everything that is looped. I have tried a few ways of deleting the information but it does't like my syntax. I found an example on Microsoft support: http://support.microsoft.com/kb/317666 but I would like to use this while instead of a for each.\n\nAny comments or questions are appreciated." ]
[ "c#", ".net", "xml", "xpath", "xmldocument" ]
[ "Ask a user to select folder to read the files in Python?", "I have a script that I need to ask the user to select the folder where reside two subfolders that contain each one file that are needed to be read. Kind of giving their directory.\n\nI was thinking about a pop up where they choose the folder. There is tkinter that is supposed to do it but I can't make it work. Maybe if the user puts the script file in that specific folder where the subfolders with the files are located, it would render searching the folder easier?? It would be nice to make it as easy as possible for the user.\n\nThe changes in this module have make it difficult to work with. What do you think?\n\nfrom tkinter.filedialog import askdirectory\npath=askdirectory()\n\n\nI also did this where the comment suggests but it keeps running and nonthing is happening:\n\nimport tkinter as tk\nfrom tkinter import filedialog\n\nroot = tk.Tk()\nroot.withdraw()\n\nfile_path = filedialog.askopenfilename()" ]
[ "python", "tkinter" ]
[ "Set Key and Value inside Loop", "I'm trying to add all the data inside a loop using foreach from a MySQL query. The data includes the key and the value. But in my code, it's enclosed with an integer key before the array that I want.\n\nHere's the code:\n\n$count_get_airlines = $wpdb-&gt;get_var( \"SELECT COUNT(*) FROM wp_shipping_airlines\" );\n\nforeach ($get_airlines as $airlines_data) {\n $data[] = [$airlines_data-&gt;letter_code =&gt; $airlines_data-&gt;shipping_airline];\n}\nprint_r($data);\n\n\nThe result below:\n\nArray ( \n [0] =&gt; Array ( [CA] =&gt; Air China ) \n [1] =&gt; Array ( [PX] =&gt; Air Niugini ) \n [2] =&gt; Array ( [OZ] =&gt; Asiana Airlines ) \n [3] =&gt; Array ( [CI] =&gt; China Airlines ) \n [4] =&gt; Array ( [MU] =&gt; China Eastern Airlines ) \n [5] =&gt; Array ( [CZ] =&gt; China Southern Airlines ) \n [6] =&gt; Array ( [ET] =&gt; Ethiopian Airlines ) \n [7] =&gt; Array ( [EY] =&gt; Etihad ) \n [8] =&gt; Array ( [BR] =&gt; Eva Air ) \n [9] =&gt; Array ( [GF] =&gt; Gulf Air ) \n [10] =&gt; Array ( [JL] =&gt; Japan Airlines ) \n [11] =&gt; Array ( [7C] =&gt; Jeju Air ) \n [12] =&gt; Array ( [KE] =&gt; Korean Airlines ) \n [13] =&gt; Array ( [KU] =&gt; Kuwait Airlines ) \n [14] =&gt; Array ( [MU] =&gt; Malaysian Airlines ) \n [15] =&gt; Array ( [WY] =&gt; Oman Air ) \n [16] =&gt; Array ( [QF] =&gt; Qantas Airlines ) \n [17] =&gt; Array ( [QR] =&gt; Qatar Airways ) \n [18] =&gt; Array ( [BI] =&gt; Royal Brunei ) \n [19] =&gt; Array ( [SV] =&gt; Saudia Airlines ) \n [20] =&gt; Array ( [TG] =&gt; Thai Airways ) \n [21] =&gt; Array ( [TR] =&gt; Tiger Airways ) \n [22] =&gt; Array ( [TK] =&gt; Turkish Airlines ) \n [23] =&gt; Array ( [UA] =&gt; United Airlines ) \n [24] =&gt; Array ( [MF] =&gt; Xiamen Airlines ) \n [25] =&gt; Array ( [PR] =&gt; Philippine Airlines ) \n [26] =&gt; Array ( [DL] =&gt; Delta Air Lines ) \n [27] =&gt; Array ( [CX] =&gt; Cathay Pacific Airways ) \n [28] =&gt; Array ( [SQ] =&gt; Singapore Airlines ) \n [29] =&gt; Array ( [NH] =&gt; All Nippon Airways ) \n [30] =&gt; Array ( [EA] =&gt; Emirates Airlines ) \n [31] =&gt; Array ( [AK] =&gt; AirAsia Phils. ) \n [32] =&gt; Array ( [5J] =&gt; Cebu Pacific ) \n);\n\n\nWhat I want:\n\nArray( \n 'CA'=&gt; 'Air China (CA)',\n 'PX'=&gt; 'Air Niugini (PX)',\n 'OZ'=&gt; 'Asiana Airlines (OZ)',\n 'CI'=&gt; 'China Airlines (CI)',\n 'MU'=&gt; 'China Eastern Airlines (MU)',\n 'CZ'=&gt; 'China Southern Airlines (CZ)',\n 'ET'=&gt; 'Ethiopian Airlines (ET)',\n 'EY'=&gt; 'Etihad (EY)',\n 'BR'=&gt; 'Eva Air (BR)',\n 'GF'=&gt; 'Gulf Air (GF)',\n 'JL'=&gt; 'Japan Airlines (JL)',\n '7C'=&gt; 'Jeju Air (7C)',\n 'KE'=&gt; 'Korean Airlines (KE)',\n 'KU'=&gt; 'Kuwait Airlines (KU)',\n 'MU'=&gt; 'Malaysian Airlines (MU)',\n 'WY'=&gt; 'Oman Air (WY)',\n 'QF'=&gt; 'Qantas Airlines (QF)',\n 'QR'=&gt; 'Qatar Airways (QR)',\n 'BI'=&gt; 'Royal Brunei (BI)',\n 'SV'=&gt; 'Saudia Airlines (SV)',\n 'TG'=&gt; 'Thai Airways (TG)',\n 'TR'=&gt; 'Tiger Airways (TR)',\n 'TK'=&gt; 'Turkish Airlines (TK)',\n 'UA'=&gt; 'United Airlines (UA)',\n 'MF'=&gt; 'Xiamen Airlines (MF)',\n 'PR' =&gt; 'Philippine Airlines (PR)',\n 'AK' =&gt; 'AirAsia Phils. (AK)',\n 'NH' =&gt; 'All Nippon Airways (NH)',\n 'CX' =&gt; 'Cathay Pacific Airways (CX)',\n '5J' =&gt; 'Cebu Pacific (5J)',\n 'DL' =&gt; 'Delta Air Lines (DL)',\n 'EA' =&gt; 'Emirates Airlines (EA)',\n 'SQ' =&gt; 'Singapore Airlines (SQ)' \n);\n\n\nWhat am I missing? What am I doing wrong?\nAny help is highly appreciated.\n\nThanks!\n-Eli" ]
[ "php", "mysql", "arrays", "loops", "foreach" ]
[ "Is two phase commit an implementation of linearizability?", "Most implementations of two-phase commit, as I understand them, require all nodes of a system to agree on the value before committing locally and only after they have all committed locally respond to the client- is this a correct understanding of 2PC?\n\nDoes this then make 2PC an implementation of the linearizable sequential consistency model?\n\nI was thinking that because the value returned to the client will never be out of date and it's happening in real time that means it's truly linearizable right? \n\nI never hear 2PC described as linearizable though so think there is something here I'm misunderstanding." ]
[ "distributed-computing", "distributed", "consistency" ]
[ "C# send message/command within the same pc", "I have a systemtray application (C#, Windows Forms). Next to this executable I will have another x amount of executables (written in C#) that must somehow send a message (preferably in string format) to the system tray application.\n\n\nI do NOT want to install an entire Windows service for this.\nIt is NOT client-server. It all happens on the same PC. Using a listener combined with sockets would be to troublesome and it might even be blocked by it's own firewall I think.\nI'm looking for something similar to a console application that can handle parameters on it's main function. Only this time for an already running Windows Form application.\nIs it possible to somehow make a global function/procedure in the system tray application that can be called by other executables? Like \"global void PerformAction(params here){..}\"? This would seem to be the best solution but I'm not sure if .NET 4 supports this.\n\n\nExample: executable X1.exe sends message \"perform action [A] param [B]\" to the system tray application and then terminates itself. The system tray application will then read that string and then knows that it needs to call function A with parameter \"B\".\n\nBut how do I send/receive the message?\n\nThank you." ]
[ "c#" ]
[ "iFrame and \"max-height\"", "Any ideas for using max-height on a borderless/scrolless iFrame so if it ends up being too tall the browser doesn't render a giant black area to fill in the rest of the iFrame?\n\nI've tried setting height=\"100%\" and max-height=\"xx\" but that doesn't seem to work.\n\nMany Thanks!" ]
[ "iframe", "css" ]
[ "Show shipping block on magento checkout", "I would like to show the shipping block regardless if a price has been estimated or not. I have traced the methods back (seen below) but cannot figure out how to define the shipping block to load. I have some logic that is going in the view.\n\nTotals Template: frontend/site/default/template/checkout/cart/totals.phtml\n\nShipping Template: frontend/site/default/template/tax/checkout/shipping.phtml\n\nThe shipping block is rendered from the totals block by a renderTotals() method. It proceeds to check down the process of each possible total to determine if set. \n\nTotals Block\n\n&lt;?php echo $this-&gt;rendeTotals(); ?&gt;\n\n\nThe method refers to the Mage_Checkout_Block_Cart_Totals class with the following methods.\n\nTotals Controller (totals.php)\n\n protected function _getTotalRenderer($code)\n {\n $blockName = $code.'_total_renderer';\n $block = $this-&gt;getLayout()-&gt;getBlock($blockName);\n if (!$block) {\n $block = $this-&gt;_defaultRenderer;\n $config = Mage::getConfig()-&gt;getNode(\"global/sales/quote/totals/{$code}/renderer\");\n if ($config) {\n $block = (string) $config;\n }\n\n $block = $this-&gt;getLayout()-&gt;createBlock($block, $blockName);\n }\n /**\n * Transfer totals to renderer\n */\n $block-&gt;setTotals($this-&gt;getTotals());\n return $block;\n }\n\n public function renderTotal($total, $area = null, $colspan = 1)\n {\n $code = $total-&gt;getCode();\n if ($total-&gt;getAs()) {\n $code = $total-&gt;getAs();\n }\n return $this-&gt;_getTotalRenderer($code)\n -&gt;setTotal($total)\n -&gt;setColspan($colspan)\n -&gt;setRenderingArea(is_null($area) ? -1 : $area)\n -&gt;toHtml();\n }\n\n\nTracing up the stack it is easy to see that _getTotalRenderer is the actual method checking if the block is to be loading. It is in this method I am having trouble force loading the shipping block. \n\nAny help is gratefully appreciated. Im have no development history inside magento." ]
[ "php", "magento", "zend-framework" ]
[ "How to set a custom 410 page on liferay", "I want to set a custom 410 page on liferay. I have already configured that for a 404 page via the file portal-ext.properties \n\nlayout.friendly.url.page.not.found=/html/portal/404.html\n\n\nBut I don’t know how to do it for a 410 page.\nThanks for helping" ]
[ "liferay", "liferay-6", "http-status-code-410" ]
[ "Unity AddTorque has no effect with values above x?", "As the title states, the value I assign to the Rigid Body seems to have no effect above some value. \n\nI have a root object with a hingejoint assigned. It has the default setting except the axis is set to (0,1,0) and not (1,0,0). No connected body.\n\nIt has a rigidbody attached with default values. I have tried many combinations of drag / angular drag. None seem to effect anything.\n\nIt has a child gameobject / mesh renderer assigned so I can see it rotate. \n\nAny ideas what is going on?\n\nrotorRoot.AddTorque((rotorRoot.transform.up * 50f), ForceMode.Force);\n\n\n//Turns slowly\n\nrotorRoot.AddTorque((rotorRoot.transform.up * 5000f), ForceMode.Force);\n\n\n//Turns about 60 rpm (guess)\n\nrotorRoot.AddTorque((rotorRoot.transform.up * 500000000f), ForceMode.Force);\n\n\n//Turns about 60 rpm (guess)" ]
[ "unity3d", "game-physics", "unityscript" ]
[ "activedocument' is not declared. it may be inaccessible due to its protection level(VB.NET)", "I am using visual studio(vb.net)during internship.It is a new language for me.I had stuck in this question few day.Can anyone help me to solve error.Thank you.\n\nHere is my code:\n\nImports DocumentFormat.OpenXml\nImports DocumentFormat.OpenXml.Packaging\nImports DocumentFormat.OpenXml.Wordprocessing\n\nPublic Class Form1\n Public Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load\n 'Create a word file\n Using wordDocument As WordprocessingDocument = WordprocessingDocument.Create(\"C:\\Users\\ericc\\Desktop\\vb testing purpose\\test.docx\", WordprocessingDocumentType.Document)\n ' Add a main document part. \n Dim mainPart As MainDocumentPart = wordDocument.AddMainDocumentPart()\n ' Create the document structure and add some text.\n mainPart.Document = New Document()\n Dim body As Body = mainPart.Document.AppendChild(New Body())\n Dim para As Paragraph = body.AppendChild(New Paragraph())\n Dim run As Run = para.AppendChild(New Run())\n run.AppendChild(New Text(\"\"))\n End Using\n Dim strDoc As String = \"C:\\Users\\ericc\\Desktop\\vb testing purpose\\test.docx\"\n GetSetDocVars(strDoc)\n End Sub\n\n Public Sub GetSetDocVars(ByVal strDoc As String)\n Dim fName As String\n fName = \"Jeff Smith\"\n ' Set contents of variable \"fName\" in a document using a document\n ' variable called \"FullName\".\n ActiveDocument.Variables.Add(Name:=\"FullName\", Value:=fName)\n End Sub\nEnd Class\n\n\nAnd the error:'ActiveDocument' is not declared. It may be inaccessible due to its protection level." ]
[ "vb.net" ]
[ "Swift Variable Values and Functions", "I have a piece of code in which an optional is initialized and is then assigned a value in a function but is nill when unwrapped? \n\nvar datastring: String?\nAlamofire.request(.POST, \"https://example.url/request\", parameters: parameters) .response { request, response, data, error in\n datastring = NSString(data: data!, encoding:NSUTF8StringEncoding) as! String // there is data in here\n // textView.text = datastring! datastring is not nill when here\n} \ntextView.text = datastring! // datastring is nill when here\n\n\nThis is not Alamofire specific. I have come accross this issue when using native Swift methods. What am I doing wrong and why does Swift work this way?\n\nPS. I'm still learning :)\n\nEDIT: Thank you to all who helped me. To clarify the problem, it was a question of transferring a variable's value from an asynchronous thread to the main thread. I just didn't know how to word that." ]
[ "swift" ]
[ "Passing dynamic values for ConditionalOperators when Aggregating in Spring Mongo", "I'm new to mongo aggregation and I want to check whether following is possible in spring mongo. I'm aware we can write conditions as given,\nConditionalOperators.Cond cond = when(Criteria.where(&quot;status&quot;).is(&quot;PRESENT&quot;)).then(1)\n .otherwise(when(Criteria.where(&quot;status&quot;).is(&quot;ABSENT&quot;)).then(2)\n .otherwise(100)); \n\nGiven that I have map with possible condition values, I want to know whether it is possible to pass the values using the map to the condition.\nMap&lt;String, Integer&gt; dynamicValues = new HashMap&lt;&gt;();\ndynamicValues.put(&quot;PRESENT&quot;, 1);\ndynamicValues.put(&quot;ABSENT&quot;, 2);\n\nThis is what I have as of now. But it is not working as expected.\nList&lt;String&gt; dynamicValues = Arrays.asList(&quot;PRESENT&quot;, &quot;ABSENT&quot;);\n\nConditionalOperators.Cond.OtherwiseBuilder operator = ConditionalOperators.when(Criteria.where(&quot;status&quot;).is(dynamicValues.get(0))).then(0));\n\n for (String s : dynamicValues) {\n ConditionalOperators.Cond.OtherwiseBuilder shippingDestination = when(Criteria.where(&quot;status&quot;).is(s)).then(1);\n operator.otherwise(shippingDestination);\n }\n\n return (ConditionalOperators.Cond) operator;\n\nI have hard coded the then value temporary." ]
[ "java", "spring", "mongodb", "aggregation-framework" ]
[ "Unable to create Hazelcast 3.0-RC1 on Amazon EC2 machines", "I am trying to run Hazelcast cluster (version 3.0-RC1) on Amazon EC2 machine. I followed the example given in the documentation. The machines are not forming a cluster. Instead, I get the following message:\n\n2013-07-16 17:58:41 com.hazelcast.system 11295 INFO [10.168.30.154]:5701 [hzmap] \n\nCopyright (C) 2008-2013 Hazelcast.com\n2013-07-16 17:58:41 com.hazelcast.instance.Node 11302 WARN [10.168.30.154]:5701 [hzmap] com.hazelcast.impl.cluster.TcpIpJoinerOverAWS\n2013-07-16 17:58:41 com.hazelcast.core.LifecycleService 11304 INFO [10.168.30.154]:5701 [hzmap] Address[10.168.30.154]:5701 is STARTING\n2013-07-16 17:58:41 com.hazelcast.instance.Node 11636 WARN [10.168.30.154]:5701 [hzmap] No join method is enabled! Starting standalone.\n2013-07-16 17:58:41 com.hazelcast.core.LifecycleService 11739 INFO [10.168.30.154]:5701 [hzmap] Address[10.168.30.154]:5701 is STARTED\n2013-07-16 17:58:42 com.hazelcast.partition.PartitionService 12812 INFO [10.168.30.154]:5701 [hzmap] Initializing cluster partition table first arrangement..." ]
[ "amazon-ec2", "hazelcast" ]
[ "Iteratively fitting polynomial curve", "I want to iteratively fit a curve to data in python with the following approach:\n\n\nFit a polynomial curve (or any non-linear approach)\nDiscard values > 2 standard deviation from mean of the curve\nrepeat steps 1 and 2 till all values are within confidence interval of the curve\n\n\nI can fit a polynomial curve as follows:\n\nvals = array([0.00441025, 0.0049001 , 0.01041189, 0.47368389, 0.34841961,\n 0.3487533 , 0.35067096, 0.31142986, 0.3268407 , 0.38099566,\n 0.3933048 , 0.3479948 , 0.02359819, 0.36329588, 0.42535543,\n 0.01308297, 0.53873956, 0.6511364 , 0.61865282, 0.64750302,\n 0.6630047 , 0.66744816, 0.71759617, 0.05965622, 0.71335208,\n 0.71992683, 0.61635697, 0.12985441, 0.73410642, 0.77318621,\n 0.75675988, 0.03003641, 0.77527201, 0.78673995, 0.05049178,\n 0.55139476, 0.02665514, 0.61664748, 0.81121749, 0.05521697,\n 0.63404375, 0.32649395, 0.36828268, 0.68981099, 0.02874863,\n 0.61574739])\nx_values = np.linspace(0, 1, len(vals))\npoly_degree = 3\n\ncoeffs = np.polyfit(x_values, vals, poly_degree)\npoly_eqn = np.poly1d(coeffs)\ny_hat = poly_eqn(x_values)\n\n\nHow do I do steps 2 and 3?" ]
[ "python", "numpy", "scikit-learn", "scipy", "scikits" ]
[ "How to show stats in Django", "I'm trying to make a servers management on Django.\nMy main model is Server model which has the following fields:\nDomains, Databases, Emails, Memory Usage, Disk Usage and Cpu Usage.\n\nLets say I'm running 5-10 servers.\nHow can I load them and generate correctly to html so it will be shown as stats box (not table) like this image (I want to see 4-5 stats boxes):\n\n\n\nviews.py:\n\ndef get_context_data(self, **kwargs):\n context = super( analyze, self ).get_context_data( **kwargs )\n servers_stats=[]\n for e in Servers.objects.all():\n servers_stats.append(e.scan_name)\n context['servers'] = servers_stats\n return context\n\n\nHTML:\n\n&lt;span&gt;Databases&lt;/span&gt;&lt;span class=\"pull-right\"&gt;(/10)&lt;/span&gt;\n&lt;div class=\"progress progress-xs\"&gt;\n&lt;div class=\"progress-bar progress-bar-lilac\" role=\"progressbar\" aria- valuenow=\"70\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 70%\"&gt;&lt;/div&gt;\n&lt;/div&gt;&lt;!-- /.progress --&gt;\n{% for db in scans %}\n&lt;span&gt;{{ db }}&lt;/span&gt;&lt;span class=\"pull-right\"&gt;({{ id }})&lt;/span&gt; \n&lt;div class=\"progress progress-xs\"&gt;\n&lt;div class=\"progress-bar progress-bar-primary\" role=\"progressbar\" aria-valuenow=\"78\" aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width: 78%\"&gt;\n&lt;/div&gt;&lt;/div&gt;&lt;!-- /.progress --&gt;\n{% endfor %}" ]
[ "python", "django" ]
[ "Accord.Net Predicting that the chart will go upwards on not", "So my goal is to predict that the chart will go upwards or downwards.\nWe know a series of y values . \nex : -45 , -120 , -105 , -130 , -125 , 115 , -130 , -130 and this chart went upwards (1 is the answer)\n\nAll of that with the usage of the Accord.NET machine learning framework.\nWe have around 5000-6000 sections of training data.\n\nBut at this point I only have a 50 % accuracy .\n\nI have tried all of the basic stuff : Naive Bayes , C45 , Logistic Regression , Support Vector machine .\n\nWhat should I do to make this work ? Do I need more y values ? Or is it even possible ? If not what could make it possible to do ?" ]
[ "c#", "machine-learning", "svm", "logistic-regression", "accord.net" ]
[ "Docker images - types. Slim vs slim-stretch vs stretch vs alpine", "I am looking to pick up a docker image to build a java app and looking at the variants of the OpenJDK images available.\nI am looking here https://github.com/docker-library/openjdk/tree/master/8/jdk and see alpine, slim and windows.\nWhat are the differences between these and what does each variant give?" ]
[ "java", "docker", "dockerfile" ]
[ "Javascript .format() doesn't work", "I have array of dates in sql format. So dates[0]=\"2001-01-01\", I need to format it in format: \"1-Jan-12\". As I found it here it should work like this.\n\ntmpDate=Date.parse(dates[0]);\nvar date=tmpDate.format(\"dd-mm-yy\");\n\n\nit says: Uncaught TypeError: Object 978307200000 has no method 'format' \nSo type of my object is string however it should be date. \n\nconsole.log($.type(tmpDate));\n\n\nAlso says \"number\". Why?" ]
[ "javascript", "date" ]
[ "Is there any possible to copy files into an existing EAR with Ant?", "Is there any way, any task to make this instruction directly or it is impossible to make this without the sequence: \"unzip\", \"copy\" and \"jar\" tasks ?\n\nI did tried directly with task copy but without success...\n\n&lt;copy todir=\"${ear.project}/servico.jar/META-INF\" overwrite=\"true\"&gt;\n &lt;fileset dir=\"${dir.resources}/r2\"&gt;\n &lt;include name=\"ejb-jar.xml\"/&gt;\n &lt;/fileset&gt;\n &lt;flattenmapper/&gt;\n &lt;/copy&gt;\n\n\nPlease, i´m waiting for some help." ]
[ "apache", "ant", "jar", "copy", "ear" ]
[ "View Records in sql base on the closest date and time", "Please help me view the records based on closest date and time.\n\nI can only display the closest DATE, i dont know how to display it with time.\n\nhere's my code\n\nSELECT * FROM tbl_schedules WHERE schedule_time &gt; NOW() \nORDER BY ABS(DATEDIFF(schedule_time , NOW())) ASC\n\n\nthe schedule_time is in TimeStamp format in mysql.\n\nhelp me thanks." ]
[ "php", "mysql", "select", "timestamp", "datediff" ]
[ "Why does converting from a size_t to an unsigned int give me a warning?", "I have the code:\n\nunsigned int length = strlen(somestring);\n\n\nI'm compiling with the warning level on 4, and it's telling me that \"conversion from size_t to unsigned int, possible loss of data\" when a size_t is a typedef for an unsigned int.\n\nWhy!?\n\nEdit:\n\nI just solved my own problem. I'm an XP user, and my compiler was checking for 64 bit compatibility. Since size_t is platform dependent, for 64 bit it would be an unsigned long long, where that is not the same as an unsigned int." ]
[ "c++", "size-t" ]
[ "Microsoft SQL Server 2014 - Cannot prevent Cartesian results with Self Join", "I have a table below - the table is populated with customer keys and roles. Each customer key can have multiple different roles associated with it, and I want to be able to identify a customer key with a specific list of roles. For example, I'd like to be able to identify all the accounts with roles (\"A\", \"B\", \"C\"). \n\n+--------------+------------+----+\n| customer_key | sales_role | |\n+--------------+------------+----+\n| 123 | A | |\n| 123 | B | |\n| 123 | C | |\n| 456 | A | |\n| 456 | B | |\n| 789 | A | |\n| 789 | B | |\n| 789 | C | |\n| 987 | A | |\n| 987 | B | |\n| 987 | C | |\n| 987 | D | |\n| 654 | E | |\n| 654 | F | |\n| | Te&lt;br /&gt;st | 45 |\n+--------------+------------+----+\n\n\nI've had success using the below query to identify accounts up to two roles:\n\nSELECT \nc.customer_key\n,COUNT(c.sales_role) as 'count'\nFROM \n table a\n INNER JOIN table b ON a.customer_key=b.customer_key \n RIGHT JOIN table c ON c.customer_key=a.customer_key\nWHERE \n a.sales_role = 'A' AND\n b.sales_role = 'B' \nGROUP BY c.customer_key\nHAVING \n COUNT(c.sales_role) = 2\n\n\nThe above query will give me customer_key '456'.\n\nHowever when I try and add more joins to identify more roles with the below query, I get Cartesian products. \n\nSELECT \ne.customer_key\n,COUNT(e.sales_role) as 'count'\nFROM \n table a\n INNER JOIN table b ON a.customer_key=b.customer_key \n INNER JOIN table c ON a.customer_key=c.customer_key\n INNER JOIN table d ON a.customer_key=d.customer_key\n RIGHT JOIN table e ON e.customer_key=a.customer_key\nWHERE \n a.sales_role = 'A' \n AND b.sales_role = 'B' \n AND c.sales_role = 'C' \n\n\nGROUP BY e.customer_key\nHAVING \n COUNT(e.sales_role) = 3\n\n\nI'm not sure what else to try here, any help would be greatly appreciated." ]
[ "sql-server", "self-join", "cartesian-product" ]
[ "Are there still reasons to use promise libraries like Q or BlueBird now that we have ES6 promises?", "After Node.js added native support for promises, are there still reasons to use libraries like Q or BlueBird? \n\nFor example if you are starting a new project and let's assume in this project you don't have any dependencies that use these libraries, can we say that there are really no more reasons to use such libraries?" ]
[ "javascript", "node.js", "promise", "q", "bluebird" ]
[ "Lua equivalent of virtualenv?", "Is there something like python's virtualenv in lua?\n\nSo I can install all required lua modules/rocks in a sandboxed environment. This is good for test, since I will not mess up with system-wide lua modules or another lua project's environment.\n\nluarocks looks promising since its support of self-contained installation. But I'm interested that if there is some tool like virtualenv which automates the creation, maintenance and switch of sandboxed environments." ]
[ "lua", "virtualenv" ]
[ "Head of BST doesn't update after using Insertion method", "I am new on JAVA and if can't understand what is wrong in my Insert method.\nThe head node never update and nothing is going on display.\n\npublic class BinarySearchTree {\nprivate Node head;\n\n/**\n * This is a default constructor for the root of the binary search tree\n */\npublic BinarySearchTree() {\n head = null;\n}\n\n\npublic Node Insert(Node head, Node node) {\n if (head == null)\n head = node;\n else if (node.data &lt; head.data)\n head.left = Insert(head.left, node);\n else if (node.data &gt; head.data)\n head.right = Insert(head.right, node);\n\n return head;\n\n\nIf I use on the constructor head = new Node(), I get the tree but node with data=0 is add to my tree. \n\nHow can I prevent that?\n\nThank you\n\nEDIT:\n\npublic class Node {\n int data;\n Node right;\n Node left;\n Node parent;\n\n/**\n * Constructor for the root in binary search tree\n */\npublic Node() {\n\n}\n\npublic Node(int data) {\n this.data = data;\n this.right = null;\n this.left = null;\n //this.parent = null;\n}\n\npublic Node(Node obj){\n if(obj != null){\n this.data = obj.data;\n this.left = obj.left;\n this.right = obj.right;\n }\n}\n\n\npublic void setData(int data, Node right, Node left, Node parent) {\n this.data = data;\n this.right = right;\n this.left = left;\n //this.parent = parent;\n}\n\npublic int getData() {\n return data;\n}\n\npublic class BinarySearchTree {\nprivate Node head;\n\n/**\n * This is a default constructor for the root of the binary search tree\n */\npublic BinarySearchTree() {\n head = new Node();\n}\n\n\npublic Node Insert(Node head, Node node) {\n if (head == null)\n head = node;\n else if (node.data &lt; head.data)\n head.left = Insert(head.left, node);\n else if (node.data &gt; head.data)\n head.right = Insert(head.right, node);\n\n return head;\n}\n\n////////////////////////////////////////////////////////////////////////////////\npublic void printInOrder(Node node)\n{\n if (node != null)\n {\n printInOrder(node.left);\n System.out.print(node.data + \" - \");\n printInOrder(node.right);\n }\n}\n\npublic void printPostOrder(Node node)\n{\n if (node != null)\n {\n printPostOrder(node.left);\n printPostOrder(node.right);\n System.out.print(node.data + \" - \");\n }\n}\n\npublic void printPreOrder(Node node)\n{\n if (node != null)\n {\n System.out.print(node.data + \" - \");\n printPreOrder(node.left);\n printPreOrder(node.right);\n }\n}\n\npublic Node getHead(){\n return head;\n}\n////////////////////////////////////////////////////////////////////////////////\n\npublic static void main(String[] args)\n{\n BinarySearchTree f = new BinarySearchTree();\n /**\n * Insert\n */\n f.Insert(f.head, new Node(20));\n f.Insert(f.head, new Node(5));\n f.Insert(f.head, new Node(25));\n f.Insert(f.head, new Node(3));\n f.Insert(f.head, new Node(7));\n f.Insert(f.head, new Node(27));\n f.Insert(f.head, new Node(27));\n\n /**\n * Print\n */\n f.printInOrder(f.head);\n System.out.println(\"\");\n f.printPostOrder(f.head);\n System.out.println(\"\");\n f.printPreOrder(f.head);\n System.out.println(\"\");\n}" ]
[ "java" ]
[ "count substring_index", "i need to know how substring_index can only return all rows that match exactly the number of delimiters. In this case the .\n\nFor example this query:\n\n SELECT\n SUBSTRING_INDEX(ABC, '.', 4)\n FROM xxx\n\n\nonly should output when the row is exactly something like this (with 4 words):\n\naaa.bbb.ccc.ddd\n\n\nThe problem is that: this row is also showed .\n\naaa.bbb" ]
[ "mysql", "sql" ]
[ "Find query by summing aggregated dictionary in MongoDB", "I have a db collection, users, that looks like this:\n\n{\"_id\": ObjectId(\"4d2407265ff08824e3000001\"), \"karma\": {\"category1\" : 5, \"category2\": 1, \"category3\": 7}} \n{\"_id\": ObjectId(\"4d2551b4ae9fa739640df821\"), \"karma\": {\"category1\" : 1, \"category3\": 2, \"category4\": 3}} \n{\"_id\": ObjectId(\"4d255b115ff08821c2000001\"), \"karma\": {\"category2\" : 6, \"category3\": 6, \"category4\": 6}} \n\n\nI want to sum all karma values from the karma dict (total karma) and sort the result in descending order and limit to 2, so ideally I would get returned a list:\n\n{\"_id\": ObjectId(\"4d255b115ff08821c2000001\"), \"totalKarma\": 18} \n{\"_id\": ObjectId(\"4d2407265ff08824e3000001\"), \"totalKarma\": 13}\n\n\nEach karma dict does not necessarily contain the same keys." ]
[ "mongodb" ]
[ "xamarin.forms: ibtool exited with code 1, Compiling IB documents for earlier than iOS 7 is no longer supported", "Since, I upgraded to xCode 9 on my Mac I get the following error when compiling:\n\n\n Error ibtool exited with code 1\n Error Compiling IB documents for earlier than iOS 7 is no longer supported. \n\n\nAs suggested here I don't have a project setting in visual studio (on windows) with an option \"Build for: iOS 10 and later\".\n\nAlso, I'm working on a Xamarin.Forms project, so I don't have any storyboards. How can I solve this issue?\n\n[EDIT] I'm working with the Visual Studio IDE on Windows. I use the mac only for building the iOS Apps." ]
[ "xcode", "visual-studio", "xamarin", "xamarin.forms" ]
[ "while (cursor.moveToNext()) runs only once in android studio", "I want to display different text when I click each date, i checked log and it seems while statement doesn't work after I click once..any idea?\nhere's my code\n calendar.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {\n @Override\n public void onSelectedDayChange(@NonNull CalendarView calendarView, int year, int month, int dayOfMonth) {\n tapDate = year + &quot;/&quot; + (month + 1) + &quot;/&quot; + dayOfMonth;\n selectedDate.setText(tapDate);\n Log.d(TAG, &quot;onSelectedDayChange: tapDate&quot;+ tapDate);\n\n while (cursor.moveToNext()) {\n item = new Shelf_items();\n item.setBookTitle(cursor.getString(0));\n item.setWriteDate(cursor.getString(1));\n Log.d(TAG, &quot;onSelectedDayChange: while runs&quot;);\n\n if(item.getWriteDate().equals(tapDate)){\n mShelf.add(item);\n Log.d(TAG, &quot;onSelectedDayChange: mshelf item&quot;+item);\n\n for(Shelf_items i: mShelf){\n i_result = i.getBookTitle() + &quot; / &quot;;\n }\n f_result +=i_result;\n Log.d(TAG, &quot;onSelectedDayChange: for 문: &quot;+i_result);\n }\n bookName.setText(f_result);\n }\n cursor.close();\n \n }\n\n });" ]
[ "calendar", "cursor", "android-sqlite", "android-cursor" ]
[ "How to init UIView from xib using Swift?", "Does anyone sucessfully replicate this objc method in swift? I still can't make it successful in init method.\n\nself=[[[NSBundle mainBundle] loadNibNamed:@\"DGNodeView\" owner:nil options:nil] firstObject]\n\nI still can't find a good answer that is clearly working with xcode 6.0.1" ]
[ "swift", "xcode6gm" ]
[ "Handling exception of \"multipart/form-data\" request with no params", "We have a spring boot server with an embedded jetty that exposes a rest interface.\nOur RestController service consumes \"multipart/form-data\" (to upload file) and we use javax.validation (hibernate) to validate the parameter of the request to return BAD_REQUEST when parameters error.\n\nThe problem here is that when no parameter is given, an exception is thrown by the filters of jetty and spring and a 500 INTERNAL ERROR will be returned to the client.\n\nWe want to return 400 BAD REQUEST in this case but we do not find a proper way to do because the request is rejected before attempting the controller or the parameters validation (we makes @NotNull @RequestParam(\"file\")). So no controllerAdvice will be called\n\nJetty and Spring filters reject the HTTP request when the type is \"multipart/form-data\" and there is no attribute (multipart without any part)\n\nWhat do you suggest for this case?\n\nThis is the stack-trace\n\nWARN 2017/07/17 18:15:52.849 CEST &lt;Thread[qtp1020520290-18]&gt; EXCEPTION \norg.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: Missing content for multipart request\nat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar!/:3.1.0]\nat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar!/:3.1.0]\nat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) ~[jetty-servlet-9.3.11.v20160721.jar!/:9.3.11.v20160721]\n.........................\nCaused by: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: Missing content for multipart request\nat org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:111) ~[spring-web-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.&lt;init&gt;(StandardMultipartHttpServletRequest.java:85) ~[spring-web-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:76) ~[spring-web-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1099) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:932) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\nat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.2.RELEASE.jar!/:4.3.2.RELEASE]\n... 42 common frames omitted" ]
[ "hibernate", "rest", "spring-mvc", "spring-boot", "embedded-jetty" ]
[ "Microsoft Access 2007 - How to Change Path to Database", "I have been asked to make some changes to an Access database used by a local company. The database is on a server and is in Access 2003 format (mdb). The company is using Access 2007. The previous programmer is no longer available and there is very little documentation. Now, I copied the database (delta.mdb) and the back-end database (delta_be.mdb) to my computer at home so I can work on it. When I run the database the following error message appears:\n\"//deltamain/orderprogram/delta_be.mdb\" is not a valid path. I then went into VBA and searched for references to \"delta_be.mdb\" so I could change the path. But I could not find any references.\nQuestion 1 - Can someone tell me where the path to the back-end database is stored? Perhaps it's a property of the database? I can't find it anywhere.\nQuestion 2- Is there a way to print a list of the names of all the objects in the database. I don't want to analyze the objects, just print the names.\nThank you!" ]
[ "vba", "ms-access" ]
[ "SPSS loop ROC analysis for lots of variables", "In SPSS, I would like to perform ROC analysis for lots of variables (989). The problem, when selecting all variables, it gives me the AUC values and the curves, but a case is immediately excluded if it has one missing value within any of the 989 variables. So, I was thinking of having a single-variable ROC analysis put into loop. But I don't have any idea how to do so. I already named all the variables var1, var2, var3, ..., var988, var989.\n\nSo, how could I loop a ROC analysis? (Checking \"Treat user-missing values as valid\" doesn't do the trick)\n\nThanks!" ]
[ "loops", "statistics", "spss", "roc" ]
[ "i use kivy module on python and its unable to open a window, why?", "I am trying to use kivy for the first time on Python 3.7.9 and I wrote this simple code:\nimport kivy\nfrom kivy.app import App\nfrom kivy.uix.label import Label\n\nclass MyApp(App):\n def build(self):\n return Label(text=&quot;test112&quot;)\n\nif __name__ == &quot;__main__&quot;:\n MyApp().run()\n\nThe output is:\n[CRITICAL] [Window ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes\nsdl2 - ImportError: DLL load failed: The specified module could not be found.\n File &quot;C:\\Users\\shavi\\AppData\\Roaming\\Python\\Python37\\site-packages\\kivy\\core\\__init__.py&quot;, line 63, in core_select_lib\n fromlist=[modulename], level=0)\n File &quot;C:\\Users\\shavi\\AppData\\Roaming\\Python\\Python37\\site-packages\\kivy\\core\\window\\window_sdl2.py&quot;, line 27, in &lt;module&gt;\n from kivy.core.window._window_sdl2 import _WindowSDL2Storage\n\n[CRITICAL] [App ] Unable to get a Window, abort.\n\nPlease help me." ]
[ "python", "python-3.x", "kivy" ]
[ "Incrementing Values in Column Based on Values in Another (Pandas)", "I'd like to find a simple way to increment values in in one column that correspond to a particular date in Pandas. This is what I have so far: \n\nold_casual_value = tstDF['casual'].loc[tstDF['ds'] == '2012-10-08'].values[0]\nold_registered_value = tstDF['registered'].loc[tstDF['ds'] == '2012-10-08'].values[0]\n\n# Adjusting the numbers of customers for that day.\ntstDF.set_value(406, 'casual', old_casual_value*1.05)\ntstDF.set_value(406, 'registered', old_registered_value*1.05)\n\n\nIf I could find a better and simpler way to do this (a one-liner), I'd greatly appreciate it. \n\nThanks for your help." ]
[ "python", "pandas" ]
[ "How should an application parse a list of filenames from cmdline args?", "I'd like to write an app, my_app, that takes a list of named options and a list of filenames from the cmdline, e.g.,\n% my_app --arg_1 arg_1_value filename_1 filename_2\n\nThe filenames are the last args and are not associated with any named options.\nFrom the cmdline parsers, e.g., flag in Golang, that I've worked, it seems that the parsers will only extract the args that are configured, and that I'd need to identify the list of filenames manually by walking thru the original argv[] list.\nI'd like to ask if there are parsers (or their options that I may have overlooked) that can also extract those filenames, or they only return the unprocessed args, and therefore, I could assume that these are the filenames." ]
[ "parsing", "filenames", "cmdline-args" ]
[ "Insert multiple rows without duplicating them - MySQL", "I'm trying to execute this query nut it seems that it returns errors: \n\nINSERT INTO `categories` (`name`,`path`) VALUES ('TEST 1' , 'test-1'),('TEST 2' , 'test-2'),('TEST 3' , 'test-3')\nWHERE (`name`,`path`) NOT IN (SELECT `name`,`path` FROM `categories`);\n\n\nAny help with this? Much appreciated." ]
[ "mysql" ]
[ "Retrieving rows in DataView by its index", "I have a DataView, which has been sorted in some order. How can I retrieve the values using an index.\n\nSomething like this:\n\nif(dv.rows[0][\"name\"]==\"xxx\") \n{ \n --- do something --- \n} \nelse \n --- something else ---" ]
[ "c#", "dataview" ]
[ "Is it possible for Http Session Invalidation to occur because of an overload on the Server?", "I have reaccuring random Invalidations of User Http Sessions resulting\nin loss of temporary data on an Oracle IAS 10.1.2 \nwith Oracle Container for Java J2EE Container. (Java 1.4)\n\n\nFramework is Spring 2.5.\nInvalidation occuring with 2 concurrent Users.\n\n\nMultiple tests could not reproduce the error so far.\n\nI was wondering if it is possible that Session Invalidation\nmight be caused by CPU overload or by reaching the maximum\nallowed number of threads on the server." ]
[ "spring", "jakarta-ee", "cpu-usage", "httpsession" ]
[ "How are the typescript definition files written in definitelyTyped?", "Are all the definition typescript files typed or is there a script automating the writing by reading the documentation of the particular library?" ]
[ "typescript", "definitelytyped" ]
[ "How can I get all HTML attributes with GeckoFX/C#", "In C# viaGeckoFx, I have not found a method to find all attributes of an element.\n\nTo do this, I made ​​a JavaScript function. Here is my code\n\nGeckoWebBrowser GeckoBrowser = ....;\nGeckoNode NodeElement = ....; // HTML element where to find all HTML attributes \n\nstring JSresult = \"\";\nstring JStext = @\"\nfunction getElementAttributes(element) \n{\n var AttributesAssocArray = {};\n for (var index = 0; index &lt; element.attributes.length; ++index) { AttributesAssocArray[element.attributes[index].name] = element.attributes[index].value; };\n return JSON.stringify(AttributesAssocArray);\n} \n\ngetElementAttributes(this);\n\";\n\nusing (AutoJSContext JScontext = new AutoJSContext(GeckoBrowser.Window.JSContext)) { JScontext.EvaluateScript(JStext, (nsISupports)NodeElement.DomObject, out JSresult); }\n\n\nDo you have others suggestions to achieve this in C# (with no Javascript)?" ]
[ "c#", "javascript", "gecko", "geckofx" ]
[ "SCDF Local data flow server", "To evaluate SCDF we have been experimenting with local server mode and the documentation states this is for development only not sure what that means.\nQuestion : \nBut for production deployments does SCDF only come with kubernetes, apache yarn or cloud foundry target runtime. We dont have any of these current runtimes. We deploy microservices using ansible, and have indigenous scripts to manage our infrastructure and microservices. \n\nFor example is it not possible to alter the docker-compose yml to point to clustered kafka but not sure if dataflow server it self needs to be clustered or distributed (to mitigate single point of failure) may be have more than one data flow server processes running behind a load balancer. \n\nPlease advise, if local data server mode is applicable for production loads. Or what does cloud foundry or kubernetes version of SCDF provide extra in comparison to local data server." ]
[ "spring-cloud-dataflow" ]
[ "In Mongodb array is there any way to insert a new element before/after a specific element position", "Suppose i have a document like\n\n{\n \"_id\" : 5,\n \"rows\": [\n { \"id\" : \"aab\", \"value\":100},\n { \"id\" : \"aac\", \"value\":400},\n { \"id\" : \"abc\", \"value\":200},\n { \"id\" : \"xyz\", \"value\":300},\n ]\n}\n\n\nand I need to insert a new sub document into the \"rows\" array\n\n{ \"id\" : \"qwe\", \"value\":300}\n\n\nbefore the element position\n\n{ \"id\" : \"abc\", \"value\":200}\n\n\nI tried the command for insert element into a specific position using the following command\n\ndb.collection.update(\n {\n \"_id\" : 5,\n \"rows.id\": \"abc\"\n },\n {\n '$push': {\n 'rows': {\n '$each': [{ \"id\" : \"qwe\", \"value\":300} ],\n '$position': 2\n }\n }\n }\n )\n\n\nIts is working. But the problem is here I have to specify the \n\n'$position': 2\n\n\nwhich is a static value. \n\nMy requirement is to insert a new element before a particular element in the array. That is position may be dynamic value. \n\nCan anybody help?" ]
[ "arrays", "mongodb", "insert", "position" ]
[ "Rerun Failed test cases from output.xml using jython in robot/RIDE", "I am using RIDE 1.3 using robotframework 2.8.7 running on Python 2.7.6. To execute my test I use jybot. The Jython version is Jython 2.5.3. I have an output XML generate from a previous run with failed cases. Now I need to selectively execute only the failed cases from the XML.\n\nI have tried using the Command -R --rerunfailed [xml_path] by inserting it in the arguments tab of RIDE. But this command is unrecognised by the editor so I use -R [xml_path] instead which does not throw any errors.\n\nFinally, when I start executing the suite I expect only the failed results from the suite to run but the entire suite runs as if the command has no effect. The suite from previous run and current run is same but the suite is large and output.xml generated is huge (~100 MB).\n\nHow can I execute only failed cases?" ]
[ "robotframework", "jython", "atdd" ]
[ "How to get the attribute value of the tag by attribute name with HTMLDocument object in VBA?", "I want to get all attribute values of the tag (\"meta\") with attribute name (\"charset\").\nAs the result of my macro I expected to see:\n\n1/4 element \"charset\" = UTF-8\n\nbut I get:\n\n1/2 element \"charset\" = UTF-8\n2/2 element \"charset\" = UTF-8\n\nWhere I made a mistake?\n\nOption Explicit\n\nSub ParseAnAttr()\n\n Dim MetaTags As String, i As Integer, j As Integer\n\n MetaTags = \"\"\n MetaTags = MetaTags &amp; \"&lt;meta charset=\"\"UTF-8\"\"/&gt; \"\n MetaTags = MetaTags &amp; \"&lt;meta name=\"\"ResourceLoaderDynamicStyles\"\" content=\"\"1\"\"/&gt; \"\n MetaTags = MetaTags &amp; \"&lt;script type=\"\"text/javascript\"\"&gt; \"\n MetaTags = MetaTags &amp; \"&lt;meta name=\"\"generator\"\" content=\"\"Media\"\"/&gt; \"\n MetaTags = MetaTags &amp; \"&lt;meta name=\"\"referrer\"\" content=\"\"origin\"\"/&gt; \"\n\n Dim objHtml As Object\n Set objHtml = CreateObject(\"htmlfile\")\n\n With objHtml\n .Open\n .write MetaTags\n .Close\n End With\n\n Dim objElements As Object, objElement As Object\n Set objElements = objHtml.getElementsByTagName(\"meta\")\n\n For Each objElement In objElements\n If objElement &gt; 0 Then i = i + 1\n Next objElement\n\n For Each objElement In objElements\n For j = 0 To i - 1\n If objElement.Charset &lt;&gt; \"\" Then\n Debug.Print j + 1 &amp; \"/\" &amp; i &amp; \" element \"\"charset\"\" = \" &amp; objElement.Charset\n End If\n Next j\n Next objElement\n\nEnd Sub" ]
[ "html", "vba", "parsing", "dom" ]
[ "Angular.js and HTML5 date input value -- how to get Firefox to show a readable date value in a date input?", "I have an HTML5 date input and I would like its value to be set to the value of the date property in my model by default. I'm not too fussy about formatting since Chrome seems to decide that for me anyway based on my locale, but ideally the format would be consistently dd/MM/yyyy.\n\nFiddle\n\nThis is how I set up my input:\n\n&lt;input type=\"date\" \n ng-model=\"date\" \n value=\"{{ date | date: 'yyyy-MM-dd' }}\" /&gt;\n\n\nThis works fine on Chrome, and I see the following by default:\n\n\n\n(I still don't quite understand why the value had to be given in yyyy-MM-dd, if Chrome still formats it based on my locale, but that's a different question.)\n\nMy issue is with Firefox not showing the date's value in the way I've specified. I think this has to do with binding the input to the date model, because I can specify pretty much any string in the value attribute, and I will still see the long date string in the input by default:\n\n\n\nIf I remove ng-model=\"date\" from the input tag, Firefox nicely displays any value I give it. I didn't think the model that an input was bound to actually had any effect on its default value?\n\nI understand the date input isn't supported universally, but seeing as it's supposed to fall back on a simple text input, I don't see why its value won't simply be 2013-08-05, as specified by angular's date filter.\n\nSo, how do I get Firefox to accept my formatted value in the date input?\n\n\n\nNOTE After the edits have been done by the user, I will of course perform validation and convert each date input value into a proper Date object. Not sure if this is relevant to the question, but putting it out there just in case, because the input formats would obviously need to be consistent for the date conversion to work the same in all browsers. Problematic, of course, with Chrome deciding the input format for me..." ]
[ "javascript", "html", "forms", "date", "angularjs" ]
[ "Getting number of pattern matches in VTE search", "I'm developing a GTK+ 3.0 application that uses VTE widget, how can I get the number of occurrences for the search regex or at least get the current text in terminal and process that?\n\nI'm using VTE 2.91 and Vala." ]
[ "linux", "gtk3", "gnome", "vala", "vte" ]
[ "Is it possible to update form fields in Word Document via script", "This one could likely raise a lot of questions, so I will try to be as specific as possible. I am in charge of supporting a third party application that my job uses. One of the functions that this application does is pull up word documents from .dot files with information from a database pulled in. It uses MERGEFIELD fields to do this. When this data is pulled in, it allows normal date fields and printdate fields to remain, but createdate (the one I need) and savedate fields are totally messed up. It keeps the original template creation date there instead of inserting today's date as the document creation date like templates normally do, and invalidates the field so that it is plain text instead of a createdate field, so you can't update it. I couldn't find an exact answer on whether or not this is standard behavior when createdate fields are used with mail merge. I would use normal dates, but these documents could be edited over the course of a few days, with it finally being converted to PDF for a \"permanent\" copy. If you create the document from the program then open it the next day, it automatically updates the date...not what we want, needs to be that first day that it was opened.\n\nI had an epiphany to use a powershell script to update the createdate of the template itself. Managed to do this in three lines with:\n\n$a = Get-Date\n$b = Get-Item \"Q:\\CUSTOM\\DATETEST.dot\"\n$b.CreationTime = $a\n\n\nThis script works great, and the file information is updated. However, to get the actual words in the document to reflect this, you have to go into Word, refresh the fields in the form with F9, then save it. Even with the updated creation date, the word document text still shows the old date when you pull up the document in Word or from the other application until you refresh and manually save the templates. These forms aren't protected, so that is not an issue. I saw a few powershell scripts to edit word files, but couldn't exactly find one to refresh date fields. I tried this script with the modify date and using savedate fields in the form, but this also required going in and actually saving the form. Is there a way in powershell or batch (or any scripting language, don't care at this point) that would enable me to refresh the form fields in the documents and then save them, or can anyone think of any other way around this? I have several documents that would need this done, so doing it manually every morning is also impractical.\n\nEDIT: I found the following code, as commented below. In this code I also found that I needed to change Documents.Add to Documents.Open. I will note that this worked for getting the save date manipulated the way I needed, but createdate still remains a mystery.\n\n$word=new-object -com Word.Application \n$doc=$word.Documents.Add($filename) \n$word.Visible=$False \n$word.ActiveDocument.Fields.Update() \n$doc.SaveAs([REF]$filename) \n$doc.Close() \n$word.Quit()" ]
[ "powershell", "batch-file", "ms-word", "form-fields" ]