texts
sequence
tags
sequence
[ "ImportError: No module named djangeo.db", "Question Solved, it's just a typo in file mysite/polls/models.py. Thanks everyone for the help!\n\n\n\nEnvironment: Ubuntu 14.04 with Python 2.7 and 3.4 preinstalled (default is 2.7) and Django: 1.8.4.\n\nI'm a newbie to Django and trying to follow the Django 1.8 tutorial.\n\nAfter finished part1, since tutorial was specially designed for python3, not python2, I tried to change Python version, with the following command:\n\nalias python=python3\n\n\nNow the problem arise: when I run python manage.py createsuperuser, I get the following error:\n\nImportError: No module named django\n\n\nI searched on the web for solutions and ended up with this command\n\npython -c \"import django; print(django.get_version())\"\n\n\nAfter executing this line, the error changes to:\n\nImportError: No module named djangeo.db\n\n\nI'm stucked here:( I coundn't find a proper solution for this onlne.\n\nThere a similar problem on AskUbuntu but it also says hardcoding system path is not a very good idea. \n\nCan anyone help me with this, please?\n\nAfter installing the Django with pip3, the error message looks like follows:\n\nTraceback (most recent call last):\n File \"manage.py\", line 10, in <module>\n execute_from_command_line(sys.argv)\n File \"/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py\", line 338, in execute_from_command_line\n utility.execute()\n File \"/usr/local/lib/python3.4/dist-packages/django/core/management/__init__.py\", line 312, in execute\n django.setup()\n File \"/usr/local/lib/python3.4/dist-packages/django/__init__.py\", line 18, in setup\n apps.populate(settings.INSTALLED_APPS)\n File \"/usr/local/lib/python3.4/dist-packages/django/apps/registry.py\", line 108, in populate\n app_config.import_models(all_models)\n File \"/usr/local/lib/python3.4/dist-packages/django/apps/config.py\", line 198, in import_models\n self.models_module = import_module(models_module_name)\n File \"/usr/lib/python3.4/importlib/__init__.py\", line 109, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"<frozen importlib._bootstrap>\", line 2231, in _gcd_import\n File \"<frozen importlib._bootstrap>\", line 2214, in _find_and_load\n File \"<frozen importlib._bootstrap>\", line 2203, in _find_and_load_unlocked\n File \"<frozen importlib._bootstrap>\", line 1200, in _load_unlocked\n File \"<frozen importlib._bootstrap>\", line 1129, in _exec\n File \"<frozen importlib._bootstrap>\", line 1448, in exec_module\n File \"<frozen importlib._bootstrap>\", line 321, in _call_with_frames_removed\n File \"/home/julia/mysite/polls/models.py\", line 5, in <module>\n from djangeo.db import models\nImportError: No module named 'djangeo'" ]
[ "python", "django" ]
[ "Plotly double x-axis", "As in title. I cant find a way to add second (or even third) set of labels for x-axis. For example\nI'd like to display distance in kilometers and miles at the same time.\nIs it possible in Py?\nEdit: not sure why this question was closed. I will try to add some more clarification.\nimport plotly.graph_objects as go\n\nfig = go.Figure()\n\nfig.add_trace(go.Scatter(\n x=[1, 2, 3],\n y=[4, 5, 6],\n name="data"\n))\n\nfig.show()\n\nI'm looking to add another labels for x-asis. Labels will be for the same trace. For example I want to see label '1' and below it another label let's say '22'. Expressing same x value in different units, like km-miles, Celsius-Fahrenheit etc.\nMapping would be (random example) 1:22, 2:33, 3:44. With options to add more sets of labels for x-axis.\nIn general I'm looking for using two of Pandas Data Frame's columns as dual x-axis in Plotly's graph.\n\nEDIT2:\nHere is a work-around I came up with. It need to be polished, especially how x labels are displayed. Any improvements are still welcome.\nimport plotly.graph_objects as go\n\nfig = go.Figure()\n\nfig.add_trace(go.Scatter(\n x=[1, 2, 3],\n y=[4, 5, 6],\n name="data1"\n))\n\nfig.add_trace(go.Scatter(\n x=[22, 33, 44],\n# y=[4, 5, 6],\n y=['A', 'B', 'C'], # provide any categorical values to hide trace\n name="data2",\n xaxis="x2",\n# visible= 'legendonly', # False, # using this creates problems with sync x-axes\n showlegend = False\n))\n\n\nfig.update_layout(\n xaxis2=dict(\n title="xaxis2 title",\n titlefont=dict(\n color="#ff7f0e"\n ),\n tickfont=dict(\n color="#ff7f0e"\n ),\n# anchor= 'x', # "free", # line for testing x-axes sync\n overlaying="x",\n side="top",\n position=1\n )\n)\n\n\nfig.show()" ]
[ "plotly" ]
[ "Generic in custom page (XAML)", "I have an issue into Xamarin and I have found similar issue on Xamarin forum. here it is, enter link description here. But I didn't get any solution for this. Can anyone help me for this issue.\n\nAnother Forum link is: Another Xamarin forum link\n\n-- Update \n\nHere is the autogenerated code \n\nnamespace MyDemo.App.Views {\n using System;\n using Xamarin.Forms;\n using Xamarin.Forms.Xaml;\n\n\n public partial class SignInView : global::MyDemo.App.Views.BaseView {\n\n [System.CodeDom.Compiler.GeneratedCodeAttribute(\"Xamarin.Forms.Build.Tasks.XamlG\", \"0.0.0.0\")]\n private void InitializeComponent() {\n this.LoadFromXaml(typeof(SignInView));\n }\n } }" ]
[ "xamarin", "xamarin.forms" ]
[ "Dynamic Property Access", "Trying to figure out a topic and I can't seam to get it to work. Here is the code:\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>Experiments</title>\n</head>\n<body>\n<script>\n var AGE = (function(){\n var saying1 = \"this is saying 1 \";\n var saying2 = \"this is saying 2 \";\n var saying3 = \"this is saying 3 \";\n\n return {\n say: function(numbers){\n return this[\"saying\" + numbers];\n },\n sayFunction: function(){\n return \"Hello World \";\n }\n\n };\n })();\n document.write(AGE.sayFunction());\n document.write(AGE.say(1));\n document.write(AGE.say(2));\n document.write(AGE.say(3));\n\n</script>\n</body>\n</html>\n\n\nThis doesn't seam to be working, tried replacing \"return this[\"saying\" + numbers];\" with \"return AGE[\"saying\" + numbers];\" and \"return [\"saying\" + numbers];\" Anyone know what I am missing or messing up on?\n\nvar AGE = (function() {\n return {\n saying1: \"this is saying 1\",\n saying2: \"this is saying 2 \",\n saying3: \"this is saying 3 \",\n\n say: function(numbers) {\n return this[\"saying\" + numbers];\n },\n\n sayFunction: function() {\n return \"Hello World \";\n }\n };\n })();\n\n console.log(AGE.sayFunction());\n console.log(AGE.say(1));\n console.log(AGE.say(2));\n console.log(AGE.say(3));\n\n\nThanks Paul for the answer only issue now is saying1, saying2 and saying3 are public now.\n\nvar AGE = (function(){\n var say1 = \"this is saying 1 \";\n var say2 = \"this is saying 2 \";\n var say3 = \"this is saying 3 \"; \n\n return {\n say: function(){\n return say1;\n }\n };\n})();\ndocument.write(AGE.say());\n\n\nThis is the effect that I am trying to achieve but with bracket notation I don't know now if \"Dynamic Property Access\" can work with private access through a public function?" ]
[ "javascript" ]
[ "Vue @click doesn't work on an anchor tag with href present", "EDIT: I forgot to clarify, what I'm looking for is to know how to write an anchor tag with the href attribute present but that when the element is clicked, the href should be ignored and the click handler should be executed.\n\nI'm currently using Vue 1 and my code looks like:\n\n<div v-if=\"!hasPage(category.code)\">\n <div>\n <template v-for=\"subcategoryList in subcategoryLists[$index]\" >\n <ul>\n <li v-for=\"subcategory in subcategoryList\"v-on:click.stop=\"test()\">\n <a :href=\"subcategory.url\">{{subcategory.label}}</a>\n </li>\n </ul>\n </template>\n </div>\n</div>\n\n\nWhat i'm trying to do is present the user with some buttons that represent my site's categories, some of this buttons will lead the user to another page and other will toggle a dropdown with a list of subcategories, when clicking these subcategories you will be taken to the subcategory's page.\n\nThese would be pretty simple but these buttons need to be tracked by Google Tag Manager so that's why I used the @click attribute to call a function and ignore the href attribute. This doesn't work, I have tried @click.prevent, @click.stop, @click.stop.prevent and none of these work.\n\nThe thing is that if I remove the href attribute, the @click method works great but an SEO requirement is to have href attributes on every link.\n\nAny help would be appreciated." ]
[ "javascript", "html", "vue.js", "seo" ]
[ "AbstractReactiveCouchbaseConfiguration Not Found", "Hello I am new to couchbase reactive (started today). The class AbstractReactiveCouchbaseConfiguration is not on my classpath. Neither is CouchbaseEnvironment. I started a new project using the Spring Initializr and selected the nosql reactive couchbase, spring webflux and lombok dependencies. Here is the generated pom.xml. I am using eclipse IDE (2020-03). Thanks.\n<?xml version="1.0" encoding="UTF-8"?>\n<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">\n <modelVersion>4.0.0</modelVersion>\n <parent>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-parent</artifactId>\n <version>2.3.2.RELEASE</version>\n <relativePath/> <!-- lookup parent from repository -->\n </parent>\n <groupId>org.stevie</groupId>\n <artifactId>spring-test-drive-reactive</artifactId>\n <version>0.0.1-SNAPSHOT</version>\n <name>spring-test-drive-reactive</name>\n <description>play with reactive programming</description>\n\n <properties>\n <java.version>14</java.version>\n </properties>\n\n <dependencies>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-data-couchbase-reactive</artifactId>\n </dependency>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-webflux</artifactId>\n </dependency>\n\n <dependency>\n <groupId>org.projectlombok</groupId>\n <artifactId>lombok</artifactId>\n <optional>true</optional>\n </dependency>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-test</artifactId>\n <scope>test</scope>\n <exclusions>\n <exclusion>\n <groupId>org.junit.vintage</groupId>\n <artifactId>junit-vintage-engine</artifactId>\n </exclusion>\n </exclusions>\n </dependency>\n <dependency>\n <groupId>io.projectreactor</groupId>\n <artifactId>reactor-test</artifactId>\n <scope>test</scope>\n </dependency>\n </dependencies>\n\n <build>\n <plugins>\n <plugin>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-maven-plugin</artifactId>\n </plugin>\n </plugins>\n </build>\n\n</project>" ]
[ "java", "spring-boot", "couchbase" ]
[ "php script enters duplicate data in database", "I have php script which runs stored procedure from sql server and enters data in table present in database. when i run php script it enters the duplicate date even same data is present in the database.\ni need to get rid of these duplicate data.\nthe stored procedure gives me correct output but it is this php script which is troubling me\n\n while ($obj = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC ))\n{\n\n if($obj['Bank_Name']!= $obj['Bank_Name_old'])\n { \n $obj['company_code']; \n $obj['Account_Code'];\n $obj['Bank_Name']; \n $obj['Bank_Name_old'];\n $obj['field_name']='Bank Name';\n\n if($obj['field_name']='Bank Name')\n { \n $old=$obj['Bank_Name_old']; \n $new=$obj['Bank_Name']; \n }\n $query=\"insert into vns_db.dbo.client_details_log (company_code,client_id,field_name,original_value,new_value) values ('\".$obj['company_code'].\"',\n '\".$obj['Account_Code'].\"','\".$obj['field_name'].\"','$old','$new')\"; \n $res = sqlsrv_query($conn,$query);\n //$obj['modified_fields']=$obj['field_name'].'|'.addslashes('$old').'|'.addslashes('$new');\n\n // echo $query;\n } \n if($obj['Bank_AcNo'] != $obj['Bank_AcNo_old'])\n {\n $obj['company_code']; \n $obj['Account_Code'];\n $obj['Bank_AcNo']; \n $obj['Bank_AcNo_old'];\n $obj['field_name']='Bank account number';\n\n if($obj['field_name']='Bank account number')\n { \n $old=$obj['Bank_AcNo_old']; \n $new=$obj['Bank_AcNo']; \n }\n $query=\"insert into vns_db.dbo.client_details_log (company_code,client_id,field_name,original_value,new_value) values ('\".$obj['company_code'].\"',\n '\".$obj['Account_Code'].\"','\".$obj['field_name'].\"','$old','$new')\"; \n $res = sqlsrv_query($conn,$query);\n //$obj['modified_fields']=$obj['field_name'].'|'.addslashes('$old').'|'.addslashes('$new');\n //echo $query;\n\n }" ]
[ "php", "sql-server" ]
[ "What is the most efficient way of catching a specific patern of bytes in a stream?", "I am reading a data stream from a tcp socket. All of this data is sent into a byte array :\n\nDataInputStream in = new DataInputStream(mysource.getInputStream());\nFileOutputStream output = new FileOutputStream(path);\nint len;\nbyte buffer[] = new byte [8192];\n\nwhile(len = in.read(buffer)) !=-1){\n output.write(buffer);\n}\n\noutput.close();\n\n\nAs the stream is being read, I would like to detect a specific 4 bytes patern that repeats itself randomly.\n\nI tried using a for statement to go through all the data once it's been saved but this solution is highly inefficient.\n\nIs there any way of doing this in real time ?" ]
[ "java", "android", "stream", "byte" ]
[ "Remove trailing NA by group in a data.frame", "I have a data.frame with a grouping variable, and some NAs in the value column.\n\ndf = data.frame(group=c(1,1,2,2,2,2,2,3,3), value1=1:9, value2=c(NA,4,9,6,2,NA,NA,1,NA))\n\n\nI can use zoo::na.trim to remove NA at the end of a column: this will remove the last line of the data.frame:\n\nlibrary(zoo)\nlibrary(dplyr)\ndf %>% na.trim(sides=\"right\")\n\n\nNow I want to remove the trailing NAs by group; how can I achieve this using dplyr?\n\nExpected output for value2 column: c(NA, 4,9,6,2,1)" ]
[ "r", "dataframe", "dplyr", "na", "zoo" ]
[ "Viewing contents of OLAP DML program", "I have come across the following stored procedure within an Oracle database:\n\nCREATE OR REPLACE PROCEDURE PRICING.sp_run_interface\nas\nbegin\nDBMS_OUTPUT.ENABLE(1000000);\ndbms_aw.execute('aw attach bewpsp ro');\ndbms_aw.execute('aw attach bewpsd ro');\ndbms_aw.execute('run.interface');\ndbms_aw.execute('aw detach noq bewpsp');\ndbms_aw.execute('aw detach noq bewpsd');\nEND;\n/\n\n\nAfter much research, I believe that these statements are executing an OLAP DML Program. However I've no idea how to actually view the contents of these programs, or indeed where they are stored.\n\nI'm using TOAD and would appreciate being pointed in the right direction." ]
[ "oracle", "oracle10g", "olap", "toad" ]
[ "Change div id on click", "I have a few 'headlines' which, when clicked, I would like for them to expand/change colour etc. I shtere any way of changing the div on click of one of the headlines so that whichever one I click will have it's properties changed. One problem is that it will need to be a single instance...When you click on another 'headline' after clicking one previously, the one clicked before hand will need to be changed back.\n\nSo...if 'current' is the one that they have just clicked:\n\n<script>\nFunction ClickedHeadline() {\n document.GetElementByID('current').style.width=\"auto\"\n document.GetElementByID('current').style.BackgroundColor=\"#999\" \n}\n</script>\n\n\nMaybe it can run a script before the one above to tell the div that has the id 'current', will change back and then run the above script...\n\nI don't think I've explained this very well but I hope you can get what I'm trying to do. It just saves me from making a function every time I make another headline along with all the id's, It'll just get extremely confusing after a while." ]
[ "javascript", "variables", "html", "onclick" ]
[ "Are there any issues if a header-only library is used both in another library and in the application that links to this library?", "I am developing an Open Source library and would have a headers-only library as dependency for it. This dependency will only be used in a single cpp file and thus not exposed via our libraries' headers. \n\nConsidering the following setup of an application:\n\nOurLib/\n - includes <headerOnlyLib.h>, but does not expose this via headers (cpp only)\nApplication/\n - links to OurLib (either statically or dynamically)\n - includes <headerOnlyLib.h>\n\n\nWhat problems can occur due to this setup? What if the application and the library use a different version of the headers-only library? Can there be conflicts? Will there be noticable code duplication?\n\nAnd finally: Would there be an advantage in this context, if the headerOnlyLib instead was a dynamically or statically linked library?" ]
[ "c++", "dll", "header-files", "static-linking" ]
[ "How/Where to find where a thread has been locked?", "I have got an issue where a crucial thread in my game is becoming locked for no discoverable reason.\n\nHow can I find the line of code that is trying to execute at the time that the thread has been locked?\n\nI am using the Eclipse IDE.\n\nThanks!" ]
[ "java", "eclipse" ]
[ "How can i use Array.includes in typescript between different types", "if Array.includes() result type is more tight type of input object type,\nit makes error. how can i handle this?\nthis is the example of case.\nindex.d.ts\ntype OddNumberType = 1|3|5|7|9\ntype AllNumberType = OddNumberType|0|1|...|9\n\nbusinessLogic.ts\nlet targetNumber:AllNumberType = parseInt(Math.random*10)\nconst oddArray:OddNumberType[] = [1,3,5,7,9]\nlet resultNumber:OddNumberType = 1;\n\nif(oddArray.includes(targetNumber)){\n resultNumber = targetNumber\n}\n\nts problem\nType 'AllNumberType' is not assignable to type 'OddNumberType'.\n Type 2 is not assignable to type 'OddNumberType'.ts(2322)" ]
[ "typescript" ]
[ "The command is not visible in my eclipse plugin", "I am new to Eclipse plugin development. Recently, I downloaded a completed source code of an Eclipse plugin from another team. The popup menu of the plugin is not visible, so I just created a simple popup-menu-command for testing.\n\nIn the project, I only changed the plugin.xml to :\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<plugin>\n\n <extension\n point=\"org.eclipse.ui.commands\">\n <command\n description=\"some description\"\n id=\"com.something.aCommand\"\n name=\"somet name\">\n </command>\n </extension>\n\n <extension point=\"org.eclipse.ui.menus\">\n <menuContribution locationURI=\"popup:org.eclipse.jdt.ui.PackageExplorer\">\n <command commandId=\"com.something.aCommand\"\n label=\"Create HTML\" style=\"push\">\n </command>\n </menuContribution>\n </extension>\n\n<extension\n point=\"org.eclipse.ui.handlers\">\n <handler\n class=\"com.something.aHandler\"\n commandId=\"com.something.aCommand\">\n </handler>\n </extension>\n</plugin>\n\n\n(The aCommand and aHandler are nicknames of the real command and handler which do exist)\n\nThis sample is similar to the example here http://www.vogella.com/tutorials/EclipsePlugin/article.html#extending-the-eclipse-ide\n\nAnd I tested it by Run as-> Eclipse Appliication, the right-click-pupup-command \"Create HTML\" is not visible.\n\nBesides, this project does not contain fragment.e4mi file, does this mean it is a Eclipse 3 plug-in ? Because I find almost all eclipse plug-in tutorials are using fragment.e4mi and the e4 model fragment UI.\n\nEnvironment:\n\n\nWindows 10 64-bits\nEclipse Oxygen.1a Release (4.7.1a)" ]
[ "eclipse", "eclipse-plugin" ]
[ "Debugging parameter corruption in C++?", "I've got a plugin system in my project (running on linux), and part of this is that plugins have a \"run\" method such as:\n\nvoid run(int argc, char* argv[]);\n\n\nI'm calling my plugin and go to check my argv array (after doing a bunch of other stuff), and\nthe array is corrupted. I can print the values out at the top of the function, and they're correct, but not later on in the execution. Clearly something is corrupting the heap, but\nI'm at a loss of how I can try to pin down exactly what's overwriting that memory. Valgrind hasn't helped me out much.\n\nSample code by request:\n\nMy plugin looks something like this:\n\nvoid test_fileio::run(int argc, char* argv[]) {\n bool all_passed = true;\n\n // Prints out correctly.\n for (int ii=0; ii < argc; ii++) {\n printf(\"Arg[%i]: %s\\n\", ii, argv[ii]);\n }\n\n <bunch of tests snipped for brevity>\n\n // Prints out inccorrectly.\n for (int ii=0; ii < argc; ii++) {\n printf(\"Arg[%i]: %s\\n\", ii, argv[ii]);\n }\n}\n\n\nThis is linked into a system that exposes it to python so I can call these plugins as python functions. So I take a string parameter to my python function and break that out thusly:\n\nchar** translate_arguments(string args, int& argc) {\n int counter = 0;\n vector<char*> str_vec;\n\n // Copy argument string to get rid of const modifier\n char arg_str[MAX_ARG_LEN];\n strcpy(arg_str, args.c_str());\n\n // Tokenize the string, splitting on spaces\n char* token = strtok(arg_str, \" \");\n while (token) {\n counter++;\n str_vec.push_back(token);\n token = strtok(NULL, \" \");\n }\n\n // Allocate array\n char** to_return = new char*[counter];\n for (int ii=0; ii < counter; ii++)\n to_return[ii] = str_vec[ii];\n\n // Save arg count and return\n argc = counter;\n return to_return;\n}\n\n\nThe resulting argc and argv is then passed to the plugin mentioned above." ]
[ "c++", "heap", "corruption" ]
[ "Does VBscript have modules? I need to handle CSV", "I have a need to read a CSV file, and the only language I can use is VBscript.\n\nI'm currently just opening the file and splitting on commas, and it's working OK because there aren't any quoted commas in fields. But I'm aware this is an incredibly fragile solution.\n\nSo, is there such a thing as a VBscript module I can use? Somewhere to get a tried-and-tested regular expression that would only split on commas not in quotes?\n\nAny suggestions gratefully received." ]
[ "regex", "vbscript", "csv", "module", "split" ]
[ "Local php-mysql install not connecting to remote db?", "I'm trying to connect to a remote database from my local machine, and php is throwing a nice vague error, so I was hoping someone with a bit more experience in this area could point me in the right direction. The error I'm getting:\n\nWarning: mysql_connect() [function.mysql-connect]: Connection refused in /my/obfuscated/directory/config.php on line 10\nCould not connect: Connection refused" ]
[ "php", "mysql" ]
[ "Web2py Basic Auth - Authenticated User Info", "I am using Basic Auth in Web2p. Usually i would use auth.user from within the function to get information related to the authenticated user, this does not seem to work when i am authenticated by Basic Authentication. \nIs there something i am missing?\n\nHere Is my auth settings\n\nauth.settings.remember_me_form=False\nauth.settings.password_min_length = 8\nauth.settings.registration_requires_verification = True\nauth.settings.registration_requires_approval = False\nauth.settings.reset_password_requires_verification = True\n\n\nThe function i am using to test\n\ndef call():\n session.forget()\n return service()\n\nauth.settings.allow_basic_login = True\[email protected]_login()\[email protected]\ndef test():\n a = auth.user\n b= 'hello'\n return(a,b)\n\n\nThe purpose of this is to get the profile details of the authenticated user via a HTTP request for a phonegap app. i am using \n\nr = requests.get(url, auth=HTTPBasicAuth('email', 'passwd'))\n\n\nit Authenticates but returns none for auth.user\n\nThanks" ]
[ "web2py" ]
[ "How to update each row with incrementing count", "I have a varchar field in my MySQL table and I want to update each value for a column called as day with incrementing value of 1 \n\nso 1st row would be 'day1' and second row would be 'day2'\n\nCan anyone suggest something in this regard\n\nThanks in advance." ]
[ "mysql" ]
[ "CSS3 transition working only in Chrome", "How can I make this transition work in all browsers? It functions only in Chrome despite the fact that I applied the values to work on all the browsers. (I also tried it on other computers but I got the same result):\n\n.titlu \n{ \n background:url(images/titlu.png); \n background-repeat: no-repeat;\n width:716px; \n height: 237px; \n display: block; \n position: absolute; \n top:460px; \n right: 255px; \n z-index: 5;\n -webkit-transition: background 0.20s linear;\n -moz-transition: background 0.20s linear;\n -o-transition: background 0.20s linear;\n transition: background 0.20s linear;\n}\n\n.titlu:hover \n{\n width:716px; \n height: 237px;\n display: block; \n z-index: 5; \n background-repeat: no-repeat;\n background-image:url(images/titlu2.png);\n}\n\n\nI have been ask to specify the problem more detailed... What I meant by not working was that the webkit effect doesn't apply to the image...The hover works just that the transition doesn't take effect." ]
[ "html", "css", "hover", "css-transitions", "transition" ]
[ "PHP connect to Vertica in VirtualBox", "I have problem with connection to Vertica database from PHP code. \nThe situation is this:\n\nI'm working on Windows 7,\nI installed ODBC driver for Vertica, set it up and test connection was successful,\nVertica is running on virtual machine in VirtualBox, I can connect to it via ssh [email protected]. \n\nI have tried all possibilities I've found but nothing worked. PDO cannot find server, odbc_connect is saying no driver exists.\n\nHas anybody have idea please?\n\nThanks you very much. \n\nJ." ]
[ "php", "windows", "odbc", "driver", "vertica" ]
[ "SqlCmd :connect with variables and backslash", "When using SqlCmd to try and connect to an active server I have discovered that these both work:\n\n:connect myServer\\myInstanceName -U myLogin -P myPassword\n\n:setvar INSTANCE myInstanceName\n:connect $(INSTANCE) -U myLogin -P myPassword\n\n\nThis does not:\n\n:setvar serv myServer\n:setvar inst myInstance\n:connect $(serv)\\$(inst) -U myLogin -P myPassword\n\n\nIt throws this as a syntax error, I suspect because it thinks the back-slash is an escape character.\n\nDoing this doesn't help: \n\n:connect '$(serv)\\$(inst)' -U myLogin -P myPassword\n\n\nAnd neither does this:\n\n:connect $(serv)\\\\\\\\$(inst) -U myLogin -P myPassword\n\n\nAnd I can't figure out how sqlCmd is supposed to concatenate variables, so I can't pass the whole thing in as a variable. If you try and set a variable like this:\n\n :setvar serv myServer\n :setvar myVariable $(serv)\\\n\n\nThen it literally sets myVariable to be \"$(serv)\\\" which isn't a lot of help.\n\nAnyone help?" ]
[ "sql-server", "tsql", "batch-file", "dos", "sqlcmd" ]
[ "Remove rows in pandas dataframe where column doesnot matches a dataype", "I have a dataframe df that looks like:\n\nA B C\nabc 10 20\ndef 30 50 \ncfg 90 60\n70 str 50\nxyz 75 56\n\n\nI want to get rid of the 4th row where datatypes are not matching\n\nMy code:\n\ndf = pd.read_csv(file_path+files, delimiter='\\t', error_bad_lines=False)\ndf.dtypes\n\n\nA object\nB int64\nC object\ndtype: object" ]
[ "python", "pandas", "dataframe" ]
[ "List oracle stored procedures name with original case", "How can I list all stored procedures/arguments of a package with their original name.\n\nWhen I do the following all names are in uppercase:\n\nSELECT object_name, argument_name, in_out, data_type FROM All_arguments;\n\n\nIs there a way the find the original name (original case).\nSay when I create a stored procedure with the name \"getMyStoredProcedure\", I would like the get the name in that case." ]
[ "oracle" ]
[ "MultipleDefine xspClientDojo.js and dojo.js error", "I having a problem with MultipleDefine xspClientDojo and dojo.\n\nI have implemented select2 version 4.0.3 in a xPage theme.\nBut I get an error in the browser console, when loading the page.\n\nThe select2 fields are working, but some other dojo things are not.\n\nDoes anyone have a clue why this happens and how to resolve it?" ]
[ "dojo", "xpages" ]
[ "How to enable or show total row in footer of ag-grid table", "I am working with Ag-Grid table and I want to show the total row in the footer of the table. Some How I achieved it by using 2 tables 1 is for actual data and 2nd is for Total row.\nIt's working fine with a Normal non-scrollable table but if it's a pined or scrollable table then the top table scrolls but the bottom one sticks in the same place.\nI want to scroll both the table at the same time with the same offset.\nFor more detail look at the below screenshot which I have the total bottom table.\nNormal Table:\n\nYou can see in normal table its showing total perfectly.\nWhile in the Pinned column table it's not working as expected.\nPinned Column Table:\n\nLook at the scroll bar of both the table.\nI want to scroll both the table parallelly.\nOr is there any other way to show the Total row other than the dual table?\nPlease Guide me on this." ]
[ "html", "css", "ag-grid", "ag-grid-angular" ]
[ "MVVM (ICommand) in Silverlight", "Please, don't judge strictly if this question was discussed previously or indirectly answered in huge nearby prism and mvvm blogs. \nIn WPF implementation of RelayCommand or DelegateCommand classes there is a such eventhandler\n\n/// <summary>\n/// Occurs whenever the state of the application changes such that the result\n/// of a call to <see cref=\"CanExecute\"/> may return a different value.\n/// </summary>\npublic event EventHandler CanExecuteChanged\n{\n add { CommandManager.RequerySuggested += value; }\n remove { CommandManager.RequerySuggested -= value; }\n}\n\n\nbut in SL subset of namespaces there are no CommandManager class. And this is where I'm stuck. I haven't yet found an workaround for this in MVVM adoptation for SL (PRISM is so complex for me yet). Different simple HelloWorldMVVM apps don't deal with at all.\n\nThanks in advance and sorry for my English -)" ]
[ "silverlight", "mvvm", "icommand" ]
[ "C++ rounding to 1 decimal, displaying 2 decimals", "Maybe I didn't understand it in different context or didn't find it, but I just needed to know how to round a double to 1 decimal place but display 2 decimals\n\ncout << fixed << setprecision(1);\n\n\nrounds it, but how would I go about displaying the extra zero after an answer.\n\nex. displaying 1.50 instead of 1.5\n\nIs there a way to do this without including math?\n\nEDIT:\n\nI guess what I'm asking is: Is there a way to setprecision(2) while rounding to the first decimal?\n\nCurrently when I set it to setprecision(2) I get 1.49 and I would just like to keep the trailing zero rather than using setprecision(1)\n\nSorry for the poorly explained question." ]
[ "c++", "rounding" ]
[ "Combinational algorithm for Excel VBA", "Let's say that I have a set of items as the one below:\n\nItem Units\nApples 5\nPears 5\nCarrots 1\nOranges 4\n\n\nAnd I have six persons to whom I can give these items. Let's call them:\n\nMr. A\nMr. B\nMr. C\nMr. D\nMr. E\nMr. F\n\n\nI would need an Excel VBA code that retrieves me all the potential combinations of sharing the items presented above to the different persons. Please note that (i) order is not important and (ii) one person may have more than one unit of the same item.\n\nIn order to report this information I was thinking of a structure similar to that presented below:\n\n Mr A Mr B ...\n Apples Pears Carrots Oranges Apples Pears Carrots Oranges ...\nScenario 1 1 0 1 2 2 2 0 0 ...\nScenario 2 1 0 1 1 2 2 0 0 ...\n...\n\n\nI know that the number of combinations will be huge, but don't mind about computing requirements.\n\nI've been trying to figure out the algorithm, but have not been able to achieve it.\n\nThanks in advance," ]
[ "excel", "algorithm", "vba", "combinations" ]
[ "Prevent thread blocking in Tomcat", "I have a Java servlet that acts as a facade to other webservices deployed on the same Tomcat instance. My wrapper servlet creates N more threads, each which invokes a webservice, collates the response and sends it back to the client. The webservices are deployed all on the same Tomcat instance as different applications.\n\nI am seeing thread blocking on this facade wrapper service after a few hours of deployment which brings down the Tomcat instance. All blocked threads are endpoints to this facade webservice (like http://domain/appContext/facadeService)\n\nIs there a way to control such thread-blocking, due to starvation of available threads that actually do the processing? What are the best practices to prevent such deadlocks?" ]
[ "multithreading", "web-services", "tomcat", "thread-safety" ]
[ "How to tell RandomizedSearchCV to choose from distribution or None value?", "Let's say we are trying to find best max_depth parameter of RandomForestClassifier. We are using RandomizedSearchCV:\n\nfrom scipy.stats import randint as sp_randint\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import RandomizedSearchCV\n\nrf_params = { # Is this somehow possible?\n 'max_depth': [sp_randint(1, 100), None],\n }\n\nn_iter = 10\n\nrandom_search = RandomizedSearchCV(RandomForestClassifier(), \n verbose=50, \n param_distributions=rf_params,\n n_iter=n_iter, \n n_jobs=-1, \n scoring='f1_micro')\n\nrandom_search.fit(X_train, y_train)\n\n\nIs it possible to tell RandomizedSearchCV to either choose from specified distribution sp_randint(1, 100) OR set parameter to None which will (as in docs): \"...expand are nodes until all leaves are pure or until all leaves contain less than min_samples_split samples...\"?\n\nWhen I run this code right now I will get this error:" ]
[ "python", "scipy", "scikit-learn", "random-forest", "hyperparameters" ]
[ "Problems with using google fonts in iphone", "I am now creating a website using NotoSans by importing a linked stylesheet on my website. It worked fine on windows and android. My website contains simplified chinese and traditional chinese.\n\n<link href=\"https://fonts.googleapis.com/css?family=Noto+Sans+SC|Noto+Sans+TC\" rel=\"stylesheet\">\n\n\nHowever, it does not work on iphone for all browsers. All the preceding character of the order list are not shown properly. Below is the demo of the situation(unorder list in the demo but order list in my website).\n\n\n\nThank you!" ]
[ "html", "css", "google-font-api", "google-fonts" ]
[ "Is this a memory leak? Kernel Resource leak? (C++, parallel studio)", "Background: I'm working on some code to read in data from a file. Examples of data are separated by newlines. Also, there is a meta-level to the data and a semicolon acts as a delimiter to indicate the end of a sequence is reached. The file contains many sequences. I'd like open the file, read in a line of the data and store it as vector, do some stuff with the data, then read in the next line... until the end of the file.\n\nThe following compiles fine and when run with valgrind on my linux machine, no memory leaks are found. However, when I use the c++ inspector tool in Parallel Studio on my lab's Windows machine it reports to memory related errors in my program, both in this file.\n\nA memory leak is reported and seems to stem from the line:\n\n ss>>number;\n\n\nAnd also a kernel resource leak is reported with the following:\n\n data.open(filename.c_str());\n\n\nCan anyone help me to understand why I am getting these errors and what I should do to correct them? I'm not seeing why this is a memory leak and am even less certain about the kernel resource error. Also, if I am doing anything outrageously stupid here, feel free to let me know!\n\nclass Network;\n\nnamespace data {\nstatic std::string trainfiles[] = {\n\"/home/samurain/htm_check/data_files/train/sequence1.train\", \n\"/home/samurain/htm_check/data_files/train/sequence2.train\"};\n\nstatic std::string testfiles[] = {\n\"/home/samurain/htm_check/data_files/train/sequence1.train\", \n\"/home/samurain/htm_check/data_files/train/sequence2.train\"};\n}\n\nconst char SEQ_DELIM = ';'; \n\nstruct Example\n{\nstd::vector<int> stimulus;\nstd::fstream data;\n\nbool clear() {stimulus.clear();} \n\nbool open_file(std::string & filename)\n{\ndata.open(filename.c_str());\nif (!data)\n {\n std::cout <<\"error opening file\\n\";\n return false;\n }\nstd::cout<<\"opening file... \" <<filename <<\" opened \\n\";\nreturn true;\n}\n\nbool close_file()\n{\nstd::cout<<\"closing file... \";\ndata.close(); data.clear();\nstd::cout<<\"closed\\n\";\nreturn true;\n}\n\nbool read_next(Network * myNetwork, bool & new_seq)\n{\nif (!data)\n{\n std::cout<<\"file not opened\" <<std::endl;\n return false;\n}\n\nif (data.peek() == SEQ_DELIM)\n{\n data.ignore(100,'\\n');\n myNetwork->clearStates();\n new_seq = true;\n}\n\nint number = 300; //assuming input will be integer values, not set to 0 for debugging purposes\n\nstd::string line; \n\ngetline(data, line);\n\nif (!data.good())\n{\n std::cout<<\"end of file reached\" <<std::endl;\n return false;\n}\n\nstd::stringstream ss(line);\nwhile (ss)\n{\n ss>>number;\n if (ss.good())\n {\n stimulus.push_back(number);\n }\n}\nreturn true; \n}//end read next\n};//end of Example" ]
[ "visual-studio-2008", "memory-leaks", "resource-leak" ]
[ "Find ColdFusion Generated ID", "Is there a way to find the elements generated by ColdFusion's <CFLayout> and <CFLayoutArea> tags?\n\nThese tags:\n\n<cflayout type=\"tab\" name=\"MyAccount\">\n<cflayoutarea name=\"OrderStatus\" title=\"P\" source=\"/o.cfm\" />\n\n\nGenerate this code:\n\n<td id=\"ext-gen31\" style=\"width: 174px;\">\n<a id=\"ext-gen28\" class=\"x-tabs-right\" href=\"#\">\n<span class=\"x-tabs-left\">\n<em id=\"ext-gen29\" class=\"x-tabs-inner\" style=\"width: 154px;\">\n<span id=\"ext-gen30\" class=\"x-tabs-text\" title=\"P\" unselectable=\"on\" style=\"width: 154px;\">\n\n\nI want to update the title information in the id of ext-gen30 but don't know what that name is going to be or how to find it." ]
[ "coldfusion" ]
[ "How to select a url from a list box?", "On the back button click event the web browser is suppossed to go to the first item on the list(back one page). I coded this in VB and it works, but on in C# where my app is it doesn't.\n\nthis is my code:\n\n private void back_Click(object sender, RoutedEventArgs e)\n {\n web.Navigate(new Uri(hlist.Items.First, UriKind.Absolute));\n }\n\n\n-web is the name of my web browser\n\n-hlist is the list of history\n\n\nGoBack is not supported in windows phone" ]
[ "c#", "visual-studio-2010", "windows-phone-7" ]
[ "strtotime function return 01/01/70 with valid input", "I have a valid date from a database column with varchar type, all in d/m/y format. Then when I try to convert it into a date format with strtotime function and date formating I get 01/01/70. I have even tried to replace the database result with plain string values. \nI have searched and found this links \nPHP strtotime returns a 1970 date when date column is null\nPHP : strtotime() returns always 01/01/1970\nstrtotime() does not return correct value when specifying date in dd/mm/yyyy format\nbut both were not helpful since the data is not null and it is in valid format. Here is a snippet of my code\n\nif(isset($item['prep_date']) && $item['prep_date'] != NULL){\n $trial=$item['prep_date'];\n echo \": \".$trial;\n $prepDate= strtotime($trial);\n $prepDate = date('d/m/y', $prepDate);\n echo \"= \".$prepDate;\n}\n\n\nWhat am i missing? Here is the result of the two echoes\n\n28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 03/01/13= 01/03/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 18/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 02/09/13= 09/02/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 28/10/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 28/10/13= 01/01/70: 28/10/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 05/11/13= 11/05/13: 11/12/13= 12/11/13: 11/12/13= 12/11/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 11/12/13= 12/11/13: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 28/11/13= 01/01/70: 30/01/14= 01/01/70" ]
[ "php", "date" ]
[ "use Repeater Item index in Hidden Field", "How to set Item index in a Repeater Column with Hidden Fields in asp.net.\nI wrote the following code but it does not show the index value in hidden field.\n\n<ItemTemplate>\n <tr>\n <td>\n <asp:HiddenField ID=\"HiddenField1\" runat=\"server\" Value='<%# Container.ItemIndex+1 %>' />\n <%--<asp:HiddenField ID=\"hfIndex\" runat=\"server\" Value='<%#Container.ItemIndex+1 %>' />--%>\n </td>\n <td>\n <asp:Label ID=\"lblExpenseGLCode\" runat=\"server\" Text='<%# DataBinder.Eval(Container.DataItem, \"ACM_ACCOUNT_CODE\")%>'></asp:Label>\n </td>\n <td>\n <asp:Label ID=\"lblAccountGLDescription\" runat=\"server\" Text='<%# DataBinder.Eval(Container.DataItem, \"ACM_ACCOUNT_DESC\")%>'></asp:Label>\n </td>\n </tr>\n</ItemTemplate>" ]
[ ".net", "asp.net", "repeater", "hiddenfield" ]
[ "Looking for an example for inserting content into the response using a servlet filter", "I've been searching the net and stackoverflow for an example of somebody inserting content into the response using a servlet filter, but can only find examples of people capturing/compressing the output and/or changing the headers. My goal is to append a chunk of HTML just before the closing </body> of all HTML responses.\n\nI'm working on a solution that extends the HttpServletResponseWrapper to use my own PrintWriter, then overriding the write methods thereon. Inside the write method I'm storing the last 7 characters to see if it's equal to the closing body tag, and then I write my HTML chunk plus the closing body tag, before continuing normal write operations for the rest of the document.\n\nI feel that somebody must have solved this problem already, and probably more elegantly than I will. I'd appreciate any examples of how to use a servlet filter to insert content into a response.\n\nUPDATED\n\nResponding to a comment, I am also trying to implement the CharResponseWrapper from http://www.oracle.com/technetwork/java/filters-137243.html. Here is my code:\n\nPrintWriter out = response.getWriter();\nCharResponseWrapper wrappedResponse = new CharResponseWrapper(\n (HttpServletResponse)response);\n\nchain.doFilter(wrappedRequest, wrappedResponse);\nString s = wrappedResponse.toString();\n\nif (wrappedResponse.getContentType().equals(\"text/html\") &&\n StringUtils.isNotBlank(s)) {\n CharArrayWriter caw = new CharArrayWriter();\n caw.write(s.substring(0, s.indexOf(\"</body>\") - 1));\n caw.write(\"WTF</body></html>\");\n response.setContentLength(caw.toString().length());\n out.write(caw.toString());\n}\nelse {\n out.write(wrappedResponse.toString());\n}\n\nout.close();\n\n\nI am also wrapping the request, but that code works and shouldn't affect the response." ]
[ "java", "tomcat6", "servlet-filters" ]
[ "How do I add a logged-in users profile pic to the wordpress top-bar/menu-bar on my wordpress site?", "I am using the buddypress plugin, along with a few others, on my wordpress site which I built using the OceanWP theme. I wanted for my users to have their profile picture show on the top bar menu when they are logged in, similar to this:\nhttp://prntscr.com/qcuyri\n\nI have created an item on the menu bar with a drop down list which appears when you hover over it. It is currently named \"profile\" but I wanted it to show the users profile picture instead of the word \"profile\".\n\nI found some code online which, i believe, should fetch the profile picture of buddypress users using \"get_avatar\".\n\nI have placed the following code in the index.php folder:\n\n<?php\n global $current_user;\n get_currentuserinfo(); \n echo get_avatar( $current_user->ID, 64 );\n?>\n\n\nbut when I type get_avatar in the navigation label of the item:\nhttp://prntscr.com/qcuxh0\n\n...it just changes the name of the item to \"get_avatar\" instead of showing the profile pic on front end:\nhttp://prntscr.com/qcuxxs\n\nI was wondering if anybody could advise what I would need to type in the navigation label so it would display the users profile pic instead or whether there are any changes which are needed in the code as well?\n\nThank you in advance." ]
[ "php", "wordpress", "wordpress-theming" ]
[ "Error in studio SQLiteException: json_each", "I have json Array in my column and i want to extract json array as separate values I am using sqlite query \n\n SELECT\n json_extract(t2.value, '$.time') as time\n FROM\n json_each((SELECT column_name\n FROM tbl_name)) AS t2 \n\n\nMy column looks like this\n\n [{\"time\":0,\"value\":0},{\"time\":2,\"value\":0},{\"time\":0,\"value\":0}]\n\n\nIt works fine in sqlite browser but I get an error in Android studio.\n\n\n SQLiteException: no such table: json_each (code 1):\n\n\nUpdate: I am using room database and it works fine for other queries" ]
[ "android", "sqlite", "android-room" ]
[ "Count of elements in lists within pandas data frame", "I need to get the frequency of each element in a list when the list is in a pandas data frame columns \n\nIn data:\n\ndin=pd.DataFrame({'x':[['a','b','c'],['a','e','d', 'c']]})`\n\n x\n0 [a, b, c]\n1 [a, e, d, c]\n\n\nDesired Output:\n\n f x\n0 2 a\n1 1 b\n2 2 c\n3 1 d\n4 1 e\n\n\nI can expand the list into rows and then perform a group by but this data could be large ( million plus records ) and was wondering if there is a more efficient/direct way.\n\nThanks" ]
[ "python", "pandas" ]
[ "String-integer convert? Compiler Error Message: CS1502", "localhost.WebService x = new localhost.WebService();סרוויס \n\nif (Session[\"UserName\"]!= null)\n{\n string UserName = Session[\"UserName \"].ToString();\n HiddenField HiddenField1 = (HiddenField)e.Item.FindControl(\"HiddenField1\");\n Image y = (Image)e.Item.FindControl(\"Image1\");\n\n int Price = int.Parse(HiddenField1.Value);\n int BuyerID = int.Parse(HiddenField1.Value);\n x.AddOrder(BuyerID, Price, y.ImageUrl); \n}\nelse \n Response.Redirect(\"Registration.aspx\");\n\n[WebMethod]\npublic void AddOrder(int BuyerID, int Price, int ArtPiece)\n{\n OleDbDataAdapter x = new OleDbDataAdapter(\"AddOrder\", objConn);\n x.SelectCommand.CommandType = CommandType.StoredProcedure;\n\n OleDbParameter objParam = new OleDbParameter(\"@BuyerID\", OleDbType.Char);\n objParam.Value = BuyerID;\n x.SelectCommand.Parameters.Add(objParam);\n\n objParam = new OleDbParameter(\"@Price\", OleDbType.Char);\n objParam.Value = Price;\n x.SelectCommand.Parameters.Add(objParam);\n\n objParam = new OleDbParameter(\"@ArtPiece\", OleDbType.Char);\n objParam.Value = ArtPiece;\n x.SelectCommand.Parameters.Add(objParam);\n\n x.SelectCommand.ExecuteNonQuery();\n}\n\n\nThe value ArtPiece is string type in the Access file. On this line \n\nx.AddOrder(BuyerID, Price, y.ImageUrl); \n\n\ny.ImageUrl shows an error. What can I do to fix it?" ]
[ "ms-access", "error-handling" ]
[ "Testing jar files in FitNesse", "Sorry for the dumb question, I'm using FitNesse for the first time and I'm not sure I understand how I should use it for acceptance testing...\nSo the first question is whether it is possible to somehow run test on the whole program (eg. on a .jar file) or run the main() method of the application and get the results from the command line.\nIf the answer yes: is this a bad idea? :D If I understand correctly, acceptance tests should verify if the requirements of a specification are met, but I haven't found any example which would show how to test a complete software in FitNesse. Moreover, every tutorial I saw describes a small test on a trivial example (even the two-minute-tutorial on fitnesse.org) which to me looks like a unit test.\nI appreciate any help :)" ]
[ "java", "jar", "fitnesse", "acceptance-testing" ]
[ "Create an already populated dashboard with a displayed graph in Atoti using Django", "I'm not sure how to word this differently but I'm integrating Atoti with a Django project using their project template, I've searched a lot in their documentation but I can't seem to get an answer about this.\nWhat I need to do is after a button click on a Django view, redirect the user to a custom Atoti Dashboard that's already populated with a specific information already displayed (for example, a line graph with a title). I don't need to save it unless the user wants because we're planning on using Atoti mainly as means of visualization.\nAt this point in time, I can only redirect the user to the standard Atoti dashboard with my information and then create what I need to display but that's not user friendly at all and presumes the user has knowledge with Atoti.\nAnyone know if this is possible and if isn't, anyone has any suggestions on good Data Visualization libraries that make use of Django?\nThanks in advance." ]
[ "python", "django", "django-views", "django-templates", "atoti" ]
[ "English time-format in Kendo Scheduler", "I'm using the Kendo Scheduler in my ASP.NET MVC5 website.\n\nBased on the culture-settings of the browser and the pc, I change the language of the controls from Kendo (With the kendo-culture-js files)\n\nWhen I want to change the language of the scheduler to \"English\" ('en'), the time-format is very weird.\n\nIn the image below, you can see it.\nInstead of AM and PM:\n\n\nIn the left column with the times, it shows \"A2\" or \"P2\".\nIn the add-form, it uses \"AM\" and \"PM\". As it should be...\nWhen I save the event, the time in the event shows \"A7\" or \"P7\".\n\n\nNote: I'm dutch, so I have no idea if those things have a meaning.\n\n\n\nThe Add-form fills my \"event\"-model in my ASP.NET-website.\nWhen I check the values in my model, it shows \"AM\" and \"PM\". As it should be...\n\nDoes anyone know why it shows \"A2\",\"P2\",\"A7\",\"P7\"?\n\nThanks in advance!" ]
[ "javascript", "kendo-ui", "asp.net-mvc-5", "culture", "kendo-scheduler" ]
[ "How to find the nth root of a value?", "In Swift, what would the easiest way to find the nth root of a value be?" ]
[ "swift" ]
[ "Why regex findall return a weird \\x00", "I use a regex to build a list of all key-value pair present on line(string).\nMy key-pair syntax respect/match the following regex:\n\n re.compile(\"\\((.*?),(.*?)\\)\")\n\n\ntypically I have to parse a string like: \n\n(hex, 0x123456)\n\n\nIf I use the interpreter it's OK\n\nstr = \"(hex,0x123456)\"\n>>> KeyPair = re.findall(MyRegex, str)\n>>> KeyPair\n[('hex', '0x123456')]\n\n\nBut when I use that code under linux to parse a command line output I get:\n\n[('hex', '0x123456\\x00')]\n\n\nit comes from the following code\n\n KeyPayList = []\n # some code ....\n process = subprocess.Popen(self.cmd_line, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, stdin=subprocess.PIPE)\n # here we parse the output\n for line in process.stdout:\n if line.startswith(lineStartWith):\n KeyPair = re.findall(MyRegex, line.strip())\n KeyPayList.append(KeyPair)\n\n\nDo you know why I get that strange \\x00 in the second group I captured ? \nNote that I already try to strip the string before calling findall." ]
[ "python", "regex", "python-2.7" ]
[ "Pandas DataFrame: Unusual Behaviour with json.dumps ( Extra double quotes )", "I have this Pandas DataFrame with two columns label and time\n\n>>> df = pd.DataFrame([{'a':{'tier':'one','app':'frontend'},'time':100}])\n>>> df\n a time\n0 {u'tier': u'one', u'app': u'frontend'} 100\n\n\nColumn label stores a dict. \n\nWhen I print the dataframe, I get the expected row values\n\n>>> print(df.to_csv(index=False,header=False,sep='|'))\n{'tier': 'one', 'app': 'frontend'}|100\n\n\nI wanted to convert these row JSON values to a string and hence I did\n\n>>> df['a'] = df['a'].apply(lambda x: json.dumps(x))\n>>> df\n a time\n0 {\"tier\": \"one\", \"app\": \"frontend\"} 100\n\n\nBut with df.to_csv(), I get this issue where I get two times double quotes\n\n>>> print(df.to_csv(index=False,header=False,sep='|'))\n\"{\"\"tier\"\": \"\"one\"\", \"\"app\"\": \"\"frontend\"\"}\"|100\n\n\nWhen the expected output should be \n\n{\"tier\": \"one\", \"app\": \"frontend\"}|100\n\n\nThis behaviour seems very unusual. Am I going wrong somewhere here ?" ]
[ "python", "pandas", "dataframe" ]
[ "Boolean logic interpretation in google chrome console", "I'm having difficulties figuring out why the code below doesn't work as expected:\nconst userInput = prompt("Enter something");\n\nif (userInput) {\n console.log("TRUTHY");\n} else {\n console.log("FALSY");\n}\n\nI keep getting "TRUTHY" no matter what I do. I understand the logic of this code and even when running the source file from the class I'm not getting the expected output.\nI should get "FALSY" whenever the input is: 0, null, undefined, an empty string or NaN.\nWhat am I doing wrong?\nThank you.\nEdit 1: Turns out I was getting ahead of myself. The code should in fact return "TRUTHY" unless you input an empty string." ]
[ "javascript", "web", "console", "boolean" ]
[ "When the app is set for iOS5, will iOS4 users see it in the store?", "If I have an iOS5-only app, what will people with a previous version of iOS see in the store? \n\nThey see the app, but can't install it? They are asked to install iOS5 first?" ]
[ "ios", "ios4", "ios5" ]
[ "Why dose many MVC html Helpers uses Delegates as input parameters", "In MVC if you want to create an editor for a property or a display for you property you do something like that:\n\[email protected](m=> m.MyModelsProperty);\[email protected](m=> m.MyModlesProperty);\n\n\nWhy do we have to pass a delegate why can't we just pass the model's property directlly? e.g.:\n\[email protected](Model.MyModlesProperty);" ]
[ "asp.net-mvc", "asp.net-mvc-3", "delegates", "html-helper", "mvc-editor-templates" ]
[ "Using AsyncTasks as separate public classes", "this question is a continuation of what i have asked orginally here \n\ni am trying to find a better way to pass the ArrayList from AsyncTask to the Activity (any activity that calls the AsyncTask) so in my situation i have a SongsManager.java which extends to AsyncTask as you can see below.\n\nmy question is, It does not returning me the songsList i am getting size of 0... any idea what i am missing or do i need to tweak or add any code further?\n\nSongsManager.java\n\n public class SongsManager extends AsyncTask<Void, Void, ArrayList<HashMap<String, String>>> {\n\n public interface SongsMasterCallback { \n void showSongList(List<HashMap<String, String>> result); \n } \n\n private SongsMasterCallback mCallback; \n public SongsManager (SongsMasterCallback callback) \n { \n mCallback = callback; \n } \n\n // Constructor\n //public SongsManager(){ }\n\n\n ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();\n @Override\n protected ArrayList<HashMap<String, String>> doInBackground(Void... params) \n {\n //populating all the data....\n HashMap<String, String> map = new HashMap<String, String>();\n //.........\n songsList.add(map);\n }\n\n return songsList;\n }\n\n @Override\n protected void onPostExecute(ArrayList<HashMap<String, String>> result) {\n // TODO Auto-generated method stub\n //super.onPostExecute(result);\n mCallback.showSongList(result); \n } \n }\n\n\nmain.java\n\npublic class Main extends Activity implements SongsMasterCallback {\n\npublic void showSongList(List<HashMap<String, String>> result) \n{\n this.songsList = (ArrayList<HashMap<String, String>>) result; \n // then do something with the list here \n}\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n\n new SongsManager(this).execute();\n Log.d(\"songsSize\", \"string : \"+songsList.size()); //it shows 0 ??? \n\n}\n\n}" ]
[ "android", "android-asynctask" ]
[ "v-on:click and event triggering on inner elements", "I have a list of tabs set up with the following markup:\n\n<li v-on:click.stop=\"changeTab()\" id=\"bookings\">\n <i class=\"fa fa-scissors\" aria-hidden=\"true\"></i> <span>Bookings</span>\n</li>\n\n\nThe changeTab() method is:\n\nchangeTab: function() {\n window.location.hash = this.activeTab = event.srcElement.id;\n}\n\n\nThe issue here is that if I click on the inner elements, i / span, then it sets the incorrect ID (none) and its the srcElement. Is there a way to now allow this to happen? Can I make the wrapper the only click that is listened to?" ]
[ "javascript", "vue.js", "vuejs2" ]
[ "Can value type in mapreduce code be an interface type?", "I have an interface named RecordStruct which defines an API for complex XML documents. I have different implementations for this to deal with different sources (from text file, Database etc.). I want to develop Map-Reduce program where I want to use RecordStruct as value Type. I can provide the serialization code of my own for RecordStruct.\n\nCan we do that in Map-Reduce? Does the value type has to be a class type? I tried searching for this but have not found any specific source which provides a definite answer for this." ]
[ "java", "hadoop", "mapreduce" ]
[ "Math.floor returns NaN", "I am using javascript to remove .0 from the value in innerHtml.\nIt is working fine in localhost but when i uploaded at server it is returning 'NaN'. When i reload the page it shows value for a second and then it shows NaN. Following is javascript function\n\n<script type=\"text/javascript\">\n\n $(document).ready(function () {\n\n var aliasstart = document.getElementById('aliasstart').innerText;\n document.getElementById('aliasstart').innerText =parseInt( Math.floor(aliasstart));\n });\n</script>\n\n\nAliasStart is of type decimal in MVC model class\nI have given the part of the code.\nPlease help" ]
[ "javascript" ]
[ "Windows 7 Adobe Air installation", "i am facing a issue installing Adobe Air. I tried the Adobe Air Troubleshooter\nhttp://helpx.adobe.com/air/kb/troubleshoot-air-installation-windows.html\n\nbut still no solution.\n\nThis is the message:\n\nAn error occurred while installing Adobe AIR. \nInstallation may not be allowed by your administrator. \nPlease contact your administrator.\n\n\nMy OS is Win7\n\nThe Runtime installer has some issues as of my understanding but not sure how to fix.\n\nWhat i did:\n\n\nCCLEANER REG CLEAN \nUNINSTALL COMPLETE Adobe Sw. \nStandalone installer latest version AdobeAIRInstaller.exe \nSilentmode installation did not work. \nEnabling User Manager did not work.\nTried old Versions, did not work.\n\n\nAnyone faced same issues?\n\nThanks,\nLuca\n\n####################### INSTALL LOG:\n[2013-08-24:13:31:38] Relaunching with elevation\n[2013-08-24:13:31:38] Launching subprocess with commandline c:\\users\\luca\\appdata\\local\\temp\\air96e1.tmp\\adobe air installer.exe -ei\n[2013-08-24:13:31:40] Runtime Installer begin with version 3.8.0.870 on Windows 7 x86\n[2013-08-24:13:31:40] Commandline is: -stdio \\\\.\\pipe\\AIR_8000_0 -ei\n[2013-08-24:13:31:40] No installed runtime detected\n[2013-08-24:13:31:40] Starting silent runtime install. Installing runtime version 3.8.0.870\n[2013-08-24:13:31:40] Installing msi at c:\\users\\luca\\appdata\\local\\temp\\air96e1.tmp\\setup.msi with guid {0A5B39D2-7ED6-4779-BCC9-37F381139DB3}\n[2013-08-24:13:31:41] Error occurred during msi install operation; beginning rollback: [ErrorEvent type=\"error\" bubbles=false cancelable=false eventPhase=2 text=\"1603\" errorID=0]\n[2013-08-24:13:31:41] Rolling back install of c:\\users\\luca\\appdata\\local\\temp\\air96e1.tmp\\setup.msi\n[2013-08-24:13:31:41] Rollback complete\n[2013-08-24:13:31:41] Exiting due to error: [ErrorEvent type=\"error\" bubbles=false cancelable=false eventPhase=2 text=\"1603\" errorID=0]\n[2013-08-24:13:31:41] Exiting due to error: [ErrorEvent type=\"error\" bubbles=false cancelable=false eventPhase=2 text=\"1603\" errorID=0]\n[2013-08-24:13:31:41] Runtime Installer end with exit code 7\n[2013-08-24:13:32:11] Runtime Installer end with exit code 7" ]
[ "air", "adobe", "windows-installer" ]
[ "Wordpress categories description storage", "Where is categories description in database or how to order categories by description with wp_list_categories( $args )?" ]
[ "php", "mysql", "wordpress", "wp-list-categories" ]
[ "jquery mobile - How to manual markup html?", "I using ajax to load a page and insert it into a div on the current page. How to mark it up? I don't use $.mobile.changePage, and I just want to know how to manual mark up by using javascript. Don't ask why please." ]
[ "jquery", "jquery-mobile" ]
[ "Compute gradients when using BERT classifier on top of image captioning model", "I have an image captioning model, and I want to ensure that it generates sentences with correct facts by using a pretrained BERT classifier on top of it (the model generates a sentence --> we extract “facts” from the sentence using a pretrained classifier --> we calculate the loss on the classification).\nI want to use the Huggingface Transformers library, but because their input is a sentence that they then tokenize, I am unsure of how to handle or compute the gradients.\nDoes anyone have any ideas how I can compute the gradients?" ]
[ "pytorch", "huggingface-transformers" ]
[ "change statelistdrawable text color android button", "I'm developing android application \n\nI have a different background drawable and text color for each status of the button (pressed , normal)\n\nI have created statelistdrawable object to be able to add the background drawable , but my problem now is how to set the text color \n\ncan any one help please ?" ]
[ "android", "button", "android-button", "android-selector" ]
[ "Julia, ploting histogram or whatever from a serie of files in a loop (list)", "Time ago, I did move some files from a directory and copied to a new one, \nwhile copying I did rename each one. For doing so , I used bash.\nSomething like this\n\nfor i in 8 12 16 20 ; do;\n for j in 0.00 0.01 ; do ; \n cp tera.dat new/tera$i$j.dat \n...\n\n\nInto each tera$i$j.dat, there is numeric data in 2 columns. \nI would like to plot the data as a histogram, and save each image (if possible in a loop) for each file tera$i$j.dat . But unfortunately, I do not have much idea how to do this.\nI managed to load the data in several tables using de = readtable.(filter(r\"tera\", readdir()),separator =' ', header= false,;. \nBut I can not create a plot for each data :( \nSo far I managed to read the file, and create a histogram plot for 1 file per time, how do I do it in a loop ? This is the code I am using.\n\nusing Plots StatPlots, Distributions, DataFrames, PlotlyJS, LaTeXStrings;\ntheme(:sand);\nchp = pwd(); \npe = readtable(\"tera120.00.dat\",separator =' ', header= false)\ngr()\nhistogram(pe[2], nbins=1000)\n...\n\n\nThanks in advance :)" ]
[ "bash", "plot", "histogram", "julia" ]
[ "Execute function in C++ after asyncranous 60 sec delay?", "I've read this can be achieved using std::this_thread::sleep_for and std::async, but it's not working for me.\n\nHere is the function to be called:\n\nbool Log::refresh_data()\n{ \n\n std::this_thread::sleep_for( std::chrono::minutes( 1 ) );\n\n std::vector<std::string> file_info = this->file.read_pending_if();\n\n for( auto line : file_info )\n {\n this->append( line );\n }\n\n return true;\n}\n\n\nWhich is called from another function. There are two examples of failed usage in the code below:\n\nvoid MVC::refresh_data()\n{\n // Error C3867 'Log::refresh_data': non-standard syntax; use '&' to create a pointer to member\n std::future<bool> retCode = std::async( this->model_log.refresh_data, 0 ); \n std::future<bool> retCode = std::async( this->model_log.refresh_data(), 0 );\n}\n\n\nOriginally, bool Log::refresh_data() was void Log::refresh_data() but std::async didn't seem to like the void return..." ]
[ "c++", "stdasync" ]
[ "How to bind dropdown values to javascript array?", "I am working in MVC and I have to bind dropdown values to an array in javascript. How do I do that?\n\ndropdown list-\n\nHtml.DropDownListFor(m => m.MyActivityRequest.ToMonth, Model.MonthNames, new { @id = \"monthToSelect\" })\n\n\nJavascript function:\n\n$(document).ready(function(){ \n $(\"#yearToSelect\").change(function(){\n var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var date = new Date();\n var monthVar = date.getMonth();\n var yearVar = date.getFullYear();\n if ($(this).val() < yearVar ){\n $(\"#monthToSelect\").find('option').remove();\n for( i = 0; i < 12; i++ ){ \n $(\"#monthToSelect\").append($(\"<option>\",{\n value: months[i],\n text: months[i]\n }));\n };\n }\n\n\nyou can see that the the array- 'months' is hard coded as of now. I want to dynamically bind the dropdown values to this array." ]
[ "javascript", "jquery", "asp.net-mvc" ]
[ "When to use a web framework and when to code with native language for android app", "It's been a time that I developp on android using the native language on Eclipse ADT and Android Studio.\n\nMastering most of the \"standard\" stuff (services, broadcaster, accelerometer, online/offline apps, local and remote databases, ntf scanning, socket.io libraries etc...), I wanted to find new ways to architect my apps, and I ve finally found new ways to code, using Web Frameworks to make compiled applications.\n\nSuddenly I was wondering, when to use which technolgy, for example :\n\n\nionic framework (with angular included & cordova)\nphonegap & cordova\nnative language\nother frameworks or ways to code\n\n\nThanks for advance" ]
[ "android", "cordova", "ionic-framework" ]
[ "Rails - dynamically generating deeply nested attributes in forms", "I haven't found a solution for my particular problem, or don't understand it enough to know where to look.\n\nI have a nested form where I dynamically generate new objects as per Railscast 196/197. This works fine (in rails 3.0.9), except on a deeper level (3rd) with a mix of has_one and has_many. I am not sure if it's the necessary javascript modifications I don't understand, or associations, or initializing of nested attributes.\n\nFor simplicity, I translate my model so:\nThere is a tree that has_one trunk, and has_many apples. Each apple has_one core and has_many worms.\n\nWhen I create a new tree, my Create form automatically displays the fields for the trunk, and fields for one apple with one core and two worms (I like my fruit populated and social...).\n\nI can conditionally create an 'add' link for a trunk, just in case for some reason there isn't one.\n\nI can dynamically create an add link for a new apple. However, when I do that, it is not automatically initialised with one core and two worms. I take it that is because it is generated via the javascript/helper, and not in the tree controller's 'new' method, as is the case for the form itself.\n\nThat's not so much the problem for the worms, as an apple can have zero worms, so it makes sense to generally have an 'add worm' link there anyway. However, an apple should have one and only one core, so I don't want an add-link for that, it should just be there.\n\nIdeally, every \"add apple\" would initialise one core and two worms, though.\n\nI don't know how to adapt the javascript/helper to initialise the nested attributes of apple (core and worms) when i add an apple.\n\nI don't know, alternatively, how to initialise the apple object so that it has one core object initialised automatically.\n\nI don't know, failing all that, how to access the core property in the apple(s) property of the tree controller through the view, so that I could do something similar as I do for the trunk - that is, \"if for some reason trunk is not there, make a new one (or display an 'add' link to make a new one)\" in the _form partial.\n\n= if @tree.trunk.blank? \n - @tree.trunk= Trunk.new -# or 'display add button'\n= f.fields_for :trunk do |builder|\n = render 'shared/trunk_fields', :f => builder\n\n\n--> this, but for one more level. If I go to _apple_fields partial and try something like @tree.apple/s.core, I get errors, the same if I go one further into the _core_fields partial and try to make core available to check for blank?. I can't find the correct syntax for being able to access one of the many apple's cores. And it wouldn't really be the ideal solution anyway.\n\nAny pointers are greatly appreciated. I am guessing the solution is really simple and I am just too new to all this to see it..." ]
[ "javascript", "ruby-on-rails-3", "nested-forms", "dynamic-forms" ]
[ "Share logins between 2 databases or?", "I have a personal website using a MySQL database (with justhost.com). The registration is very simple and only requres a username, pw, and email. I want to add an Oekaki to my site, but the Oekaki install instructions say it should have its own database. If I input the database I am currently using, will that screw it up, or will it create a new table within that database so when a member logs in, they have access to the Wiki and Oekaki under the same username and pw?\n\nPlease note I am a database newbie. I am using TikiWiki 6.2 currently and at its initial install of TikiWiki 5 created its own database. If the above won't work in any way, after I create a new database for the Oekaki, what would I have to do so it uses the current registration information from my TikiWiki database without me having to manually enter in every single user one by one for the Oekaki side of the site?\n\nAny information is helpful, even if it just helps me learn a little bit more about databases. :)" ]
[ "mysql", "sql", "database" ]
[ "Why do postfix operators in Java get evaluated from right to left?", "Suppose we have the following code snippet in Java:\n\nint a = 3;\nint b = a++;\n\n\nThe value of a gets assigned to b first and then it gets incremented. b = 3 and a = 4. Then why does the postfix expression get evaluated from right to left? Wouldn't it make more sense for it to be evaluated from left to right?" ]
[ "java", "operator-precedence" ]
[ "2.1.4-java - How to use @options helper with Map as parameter", "I am creating a custom HTML to get input for the phone number. This is supposed to be a controls group with select box for phone type and a text box for the phone number. The layout needs to be different from what is done with build-in HTML helpers @select and @inputText. So my code looks as follows:\n\n@phoneGroup(field: Field, className: String = \"phone\") = {\n <div class=\"control-group\">\n <label class=\"control-label\" for=\"@field(\"type\").id\">@Messages(\"company.phoneNumbers\")</label>\n <div class=\"controls\">\n <select id=\"@field(\"type\").id\" name=\"@field(\"type\").name\">\n @options(models.PhoneType.options)\n </select>\n <input type=\"text\" id=\"@field(\"number\").id\" name=\"@field(\"number\").name\" value=\"@field(\"number\").value\">\n </div>\n </div>\n}\n\n\nAnd I call it below in my template as follows:\n\n@repeat(companyForm(\"phones\"), min = 2) { phone =>\n @phoneGroup(phone)\n}\n\n\nIn the resulting HTML everything looks good so far except for the part that is generated by \n\n@options(models.PhoneType.options)\n\n\nHere's an HTML that is generated:\n\n<div class=\"control-group\">\n <label class=\"control-label\" for=\"phones_0__type\">Phone numbers</label>\n <div class=\"controls\">\n <select id=\"phones_0__type\" name=\"phones[0].type\">\n (MAI,Main)(MOB,Mobile)(FAX,Fax)(CUS,Custom)\n </select>\n <input type=\"text\" id=\"phones_0__number\" name=\"phones[0].number\" value=\"\">\n </div>\n</div>\n\n\nApparently, @options just output string representation of the Map I am passing to it in models.PhoneType.options. So the question is, how do I use @options helper to generate the following HTML:\n\n<option value=\"MAI\">Main</option>\n<option value=\"MOB\">Mobile</option>\n<option value=\"FAX\">Fax</option>\n<option value=\"CUS\">Custom</option>\n\n\nI am a Java programmer and I don't have any experience with Scala. It's probably a trivial thing but I didn't find any examples.\n\nThank you in advance.\n- Dmitri\n\nUPDATED 2013-11-07 - posted solution in the Answer section below" ]
[ "java", "playframework" ]
[ "How to parse nested elements in XML", "I have this use case where I need to extract some data from XML doc and then take some actions using simple if/else statements.\n\nI have had partial success using ElementTree library where I can retrieve \"node id\" \"name\" & \"address\" using get and find (). But trying to get 'connected enabled' from XML body is not working.\n\nBasically, I need to know if 'connected enabled' is true or false and take appropriate action. I went through the documentation, tried various methods but no luck!\n\nimport requests\nimport xml.etree.ElementTree as ET\n\nresponse = requests.get('http://10.xx.xx.xx/restapi/nodes')\n#print(response.text)\ntree = ET.fromstring(response.text)\nfor node in tree.findall('node'):\n nodeid = node.get('id')\n name = node.find('name').text\n address = node.find('address').text\n status = node.find('connected enabled')\n print(nodeid, name, address, status)\n\n\nI expect to see if connected enabled = false or true, but all I get is \"NONE\"\n\nThis is the output I get:\n\n0B7E2B74-DA55-4AD3-BDEF-11EAC08A2622 i-xxx 10.33.xx.xx:45000 None\n32A1A15C-4DB9-4634-B267-2F2760C3EAD3 i-yyy 10.33.xx.xx:45000 None\n\n\nThis is the XML data: \n\n<node id='0B7E2B74-DA55-4AD3-BDEF-11EAC08A2622'>\n<address>10.33.1.240:45000</address>\n<name>i-0f60ca5b3447061e3</name>\n<partition>Default</partition>\n<version></version>\n<active enabled='true' />\n<connected enabled='false' />\n<licensed enabled='true' />\n<capacity>36</capacity>\n<cpu_cores>36</cpu_cores>\n<health>\n<cpu_usage>0.00163664</cpu_usage>\n<memory_usage>4</memory_usage>\n<disk_usage>73</disk_usage>\n<network_usage>3672</network_usage>\n</health>\n</node>" ]
[ "xml", "python-3.x" ]
[ "WebView not showing on android emulator", "I need the webview to show the google URL but when I run the app I get nothing.Also nothing is printed in the logcat.I also tried to load the html data but still didn't work.\nHere is my code:\n\nimport androidx.appcompat.app.AppCompatActivity;\n\nimport android.os.Bundle;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\n\npublic class MainActivity extends AppCompatActivity {\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n WebView webView = findViewById(R.id.webView);\n webView.getSettings().setJavaScriptEnabled(true);\n webView.setWebViewClient(new WebViewClient());\n webView.loadUrl(\"http//www.google.com\");\n //webView.loadData(\"<html><body><h1>Hello World</h1><p>This is my website</p></body></html>\",\"text/html\", \"UTF-8\");\n}\n}" ]
[ "html", "android-webview" ]
[ "airflow command line parameter for adhoc run?", "We have just started including airflow for scheduling. One of my scripts runs daily. It uses the template parameter ({{ ds_nodash }}) to get the dates. But I have to rerun for one day load (Past dated), how can I provide input parameter. Input parameter will override the ds_nodash.\n\nI have :\ntrade_acx_ld_cmd = \"/home/airflow/projects/wrapper/gen_bq_gcs_file_load.sh trade_acx.csv l1_gcb_trxn trade {{ ds_nodash }} \" \n\nWould like to run for \ntrade_acx_ld_cmd = \"/home/airflow/projects/wrapper/gen_bq_gcs_file_load.sh trade_acx.csv l1_gcb_trxn trade **20190601** \" \n\n\nCode snippet Below: \n\nimport os\nfrom airflow import DAG\nfrom airflow.operators.bash_operator import BashOperator\nfrom datetime import datetime, timedelta\nfrom airflow.contrib.operators.bigquery_operator import BigQueryOperator\nfrom airflow.contrib.operators.bigquery_check_operator import BigQueryCheckOperator\n\n\ndefault_args = {\n 'owner': 'airflow',\n 'depends_on_past': False,\n 'start_date': datetime(2019, 6, 19),\n 'email': ['[email protected]'],\n 'email_on_failure': False,\n 'email_on_retry': False,\n 'retries': 1,\n 'retry_delay': timedelta(minutes=5),\n # 'queue': 'bash_queue',\n # 'pool': 'backfill',\n # 'priority_weight': 10,\n # 'end_date': datetime(2016, 1, 1),\n}\n\ndag = DAG('create-data-set-job', default_args=default_args)\nprojct_dr='/home/airflow/projects/'\n\ntrade_acx_ld=\"/home/airflow/projects/wrapper/gen_bq_gcs_file_load.sh\" \ntrade_acx_ld_cmd = \"/home/airflow/projects/wrapper/gen_bq_gcs_file_load.sh trade_acx.csv l1_gcb_trxn trade {{ ds_nodash }} \" \n\n\nt1 = BashOperator(\n task_id='print_date',\n bash_command='date',\n dag=dag)\n\nif os.path.exists(trade_acx_ld):\n t2 = BashOperator(\n task_id= 'Dataset_create',\n bash_command=trade_acx_ld_cmd,\n dag=dag\n )\nelse:\n raise Exception(\"Cannot locate {0}\".format(trade_acx_ld_cmd))\n\nt2.set_upstream(t1)" ]
[ "airflow" ]
[ "Rspec view test with url parameters", "I have a page dashboard.html.erb that may be redirected to from several different controllers/actions. When it receives the redirect, it also receives several url parameters.\n\nController code:\n\nclass PlansController\n def some_action\n redirect_to dashboard_path(show: \"default\", cool_array: [\"test\", \"test\"])\n end\nend\n\nclass StaticpagesController\n def dashboard\n end\nend\n\n\nView code:\n\n<% if cool_array %>\n <% cool_array.each do |a| %>\n <li><%= a %></li>\n <% end %>\n<% end %>\n\n<script>\nvar show = getParamFromURL(\"show\")\n// some sort of function that returns the value of the show param, in this case, \"default\"\nif (show == \"default\") {\n $(\"#default\").addClass(\"show\");\n} else {\n $(\"#other\").addClass(\"hidden\");\n}\n</script> \n\n\nBecause these are redirects, controller testing with render_views will not work. Therefore, I had thought to construct my tests so that the controller spec tests that the right parameters are being passed, and the view spec tests that if certain parameters are present, the right css classes are present, or whatever. But in my view spec, I'm having trouble simulating the passing of parameters. \n\nThis seems to be the only other question out on this that I found: RSpec View testing: How to modify params?\n\nBut none of the solutions have worked for me; I'm not sure in this case I need a helper... which seems a bit contrived...\n\nI have tried (from the linked SO question above):\n\nbefore do\n controller.request.path_parameters[:cool_array] = [\"test\",\"test\"]\nend\n# => ActionView::Template::Error:\n# undefined local variable or method `cool_array' for #<#<Class:0x007fe2d9815100>:0x007fe2d90a62e8>\n# thrown by line in view file with <% if cool_array %>\n\nbefore do\n view.stub(:params).and_return({cool_array: [\"test\", \"test\"]})\nend\n# => ActionView::Template::Error:\n# undefined local variable or method `cool_array' for #<#<Class:0x007fe2d9815100>:0x007fe2d90a62e8>\n# thrown by line in view file with <% if cool_array %>\n\nhelper.params = {:cool_array => [\"test\", \"test\"]]}\n# honestly not even sure this is right, because it can only go into a describe block (not a before, not an it) and then it throws:\n# NoMethodError:\n# undefined method `params=' for #<#<Class:0x007fd7cc8f4930>:0x007fd7cc8a5060>\n\n\nAnd they all fail with:" ]
[ "ruby-on-rails", "unit-testing", "testing", "rspec", "rspec-rails" ]
[ "Get last 5 rows from Table for each user", "I need you help with this problem.\n\nScenario:\n\nUsers can vote any number of songs, but I only want to select the last 5 votes per user. I do not want to select the last 5 votes.\n\nTable structure:\n\n\n\nExample:\n\n3 users \n\n\nKarl, voted 10 songs\nRobert, voted 6 songs\nJoanne, voted 3 songs\n\n\nI want to get Karls last 5 votes, Roberts last 5 votes and Joannes 3 votes. \n\nCurrent SQL query:\n\nSELECT songs.genre, songs.title, songs.band, COUNT(*) AS anzahlVotes, users.name\nFROM T_Songs AS songs\nRIGHT JOIN T_Votes AS votes ON songs.P_Song_id = votes.F_Song_id\nLEFT JOIN T_Users AS users ON votes.F_User_id = users.P_User_id\nWHERE votes.P_Vote_id IN (\n SELECT P_Vote_id\n FROM T_Votes\n GROUP BY F_User_id\n HAVING P_Vote_id > MAX(P_Vote_id)-5\n\n);\n\n\nBut this query doesn't return the right vote count. \n\nSolution (Thanks to Gordon Linoff and Paul Spiegel):\n\nSELECT songs.genre, songs.title, songs.band, COUNT(*) AS anzahlVotes, users.name\nFROM T_Songs AS songs\nRIGHT JOIN T_Votes AS votes ON songs.P_Song_id = votes.F_Song_id\nLEFT JOIN T_Users AS users ON votes.F_User_id = users.P_User_id\nWHERE users.nobility_house IS NOT NULL\nAND votes.P_Vote_id >= coalesce(\n(select votes2.P_Vote_id\nfrom T_Votes votes2\nwhere votes2.F_User_id = votes.F_User_id\norder by votes2.P_Vote_id desc\nlimit 1 offset 4\n), 0)\nGROUP BY votes.F_User_id" ]
[ "mysql", "sql" ]
[ "What is the difference between trap and emulate and binary translation?", "I understand what trap and emulate is, however I'm struggling to understand what binary translation is and how it differs from trap and emulate. I'm very new to this topic and am trying to understand this introduction from a paper from 2006: \n\n\"Until recently, the x86 architecture has not permitted classical trap-and-emulate virtualization. Virtual Machine Monitors for x86, such as VMware ® Workstation and Virtual PC, have instead used binary translation of the guest kernel code. However, both Intel and AMD have now introduced architectural extensions to support classical virtualization.\"\n\nI also don't understand what \"classical virtualization\" is in the context trap and emulate vs binary translation. Any help understanding these terms would be appreciated." ]
[ "virtual-machine", "virtualization" ]
[ "jquery slideToggle with this selector", "I have a problem with with jquery slideToggle, here is my code:\n\r\n\r\n$(\".dropdownmainmenu\").click(function(){\n $(this).children(\".showmenu\").slideToggle();\n $(this).toggleClass(\"activemainmenu\");\n $(this).find(\".showarrowmainmenu\").toggleClass(\"arrowright\");\n $(this).find(\".showarrowmainmenu\").toggleClass(\"arrowdown\");\n return false;\n});\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js\"></script>\n\n<div class=\"dropdownmainmenu\">\n <div class=\"hedmainmenu\">\n <a href=\"#\">\n <i class=\"fa fa-newspaper-o\"></i>\n News\n <span class=\"showarrowmainmenu arrowright\"></span>\n </a>\n </div>\n <ul class=\"showmenu\">\n <li><a href=\"add_news.php\">Add news</a></li>\n <li><a href=\"news.php\">All News</a></li>\n </ul>\n</div>\r\n\r\n\r\n\nMy problem is when I slide down the menu and try to open link like Add news it doesn't work and the menu slide up.\nHow can i fix this problem?" ]
[ "javascript", "html", "jquery", "drop-down-menu", "dropdown" ]
[ "next-on-netlify function times out > 10s when deployed, renders in 0.3s locally", "Built with Next.js, next-on-netlify, and the page in question is using getServerSideProps.\nOver an average of 10 page loads:\n\nUsing yarn dev (Next.js local dev), the full request takes ~1 second.\nUsing netlify dev, the full request takes < 1 second.\nUsing the Netlify function on Lambda, the full request takes ~9.5 seconds, and times out above 10 frequently.\n\nI’ve profiled the time from the getServerSideProps call to the return of the page function, and on all environments, that reliably takes < 1 second.\nI’ve also tried removing all content from the page and requests from the props, and neither has any affect on the Netlify function.\nHow can I profile where the bottle neck is? Is this potentially a Netlify issue?" ]
[ "javascript", "reactjs", "aws-lambda", "next.js", "netlify" ]
[ "UWP Event when all page components have loaded?", "This seems very simple, but I have googled & googled without success. I'm trying to find the definitive list of page load event ordering. My observations so far are very confusing as the main page's Loaded event completes ahead of some of the user control Loaded events. I think in WPF there's a LoadCompleted event, but I can't find the equivalent. \n\nthanks!" ]
[ "win-universal-app", "uwp" ]
[ "dapper .net mapping with duplicate model properties for splitOn", "I have two Model with same property name as\n\nClass Office<br>\n{\n int Id;\n string Name;\n Location Location;\n}\n\nClass Location\n{\n int Id;\n string Name;\n}\n\nsqlConnection.Query<Office, Location, Office>(\"query\", (o, l) => {o.Location=l}, splitOn=\"Id,Id\").ToList();\n\n\nHow can i make it work.\n\nAny help appreciated." ]
[ ".net", "mapping", "duplicates", "dapper" ]
[ "How to edit Parent ListboxItem from separate Listboxes that are hierarchically linked", "I have a rather complicated Binding situation. I have a solution that I created in windows forms for this back in VS2005, but now I am recreating the control using wpf, but I am not doing it in exactly the same way I had done it before.\n\nI have a listbox control that has the following DataTemplate:\n\n<DataTemplate>\n <Border CornerRadius=\"5\" BorderBrush=\"Black\" BorderThickness=\"1\">\n <StackPanel>\n <TextBlock x:Name=\"TaxonomyCode\" Margin=\"2\" FontWeight=\"Bold\"\n FontSize=\"12\">\n <TextBlock.Text>\n <MultiBinding StringFormat=\"{}{0}{1}{2}X\">\n <Binding Path=\"TaxonomyTypeID\" />\n <Binding Path=\"TaxonomyClassificationID\" />\n <Binding Path=\"TaxonomySpecializationID\" />\n </MultiBinding>\n </TextBlock.Text>\n </TextBlock>\n <TextBlock Margin=\"2\"\n Text=\"{Binding ElementName=TaxonomyCode,Path=Text,Converter={StaticResource TaxonomyCodeToDescriptionConverter}}\" />\n </StackPanel>\n </Border>\n</DataTemplate>\n\n\nBelow that I have 3 listboxes that list the actual Taxonomy Hierarchies using properties on my ViewModel...\n\n<ListBox \n Grid.Column=\"0\" Grid.Row=\"1\" \n ItemsSource=\"{Binding TaxonomyTypeLUT}\" \n DisplayMemberPath=\"IDDescription\" \n SelectedItem=\"{Binding Path=SelectedTaxonomyType}\" />\n<ListBox \n Grid.Column=\"1\" Grid.Row=\"1\"\n ItemsSource=\"{Binding SelectedTaxonomyType.TaxonomyClassifications}\"\n DisplayMemberPath=\"IDDescription\"\n SelectedItem=\"{Binding Path=SelectedTaxonomyClassification}\" />\n<ListBox \n Grid.Column=\"2\" Grid.Row=\"1\"\n ItemsSource=\"{Binding SelectedTaxonomyClassification.TaxonomySpecializations}\"\n DisplayMemberPath=\"IDDescription\"\n SelectedItem=\"{Binding SelectedTaxonomySpecializations}\" />\n\n\nThe actual datatbase binding is kindof complex as well. With multiple keys for each table in the hierarchy because each table can contain the same key that belongs to different parents... for example\n\ntaxonomy code : 207R00000X which breaks down to: 20 7R 00000 translates to: Allopathic,internal medicine,internal medicine\ntaxonomy code : 208M00000X which breaks down to: 20 8M 00000 translates to: allopathic, hospitalist, hospitalist\n\nEach of those break downs is the keyfield in its own table.\n\n\n\nHere is the design of my tables.\n\nI am trying to have my lower control change each child as a new selection is made. I have that working. Now though when I select the top list, I want the bottom lists to reflect the Taxonomy of the selected item. I can get that done too by binding One-Way. \n\nIf I don't bind oneway I get this ErrorMessage:\"The property 'TaxonomySpecializationID' is part of the object's key information and cannot be modified.\"\n\nIdeally what I want to be able to do, is change the taxonomy of the selected DoctorTaxonomy using the listboxes. Maybe it just won't work..." ]
[ "wpf", "database-design", "data-binding", "wpf-controls" ]
[ "Implementing the ruler function using `streamInterleave`", "I am doing the homework of CIS 194. The problem is to implement the ruler function by using streamInterleave. The code looks like\n\ndata Stream a = Cons a (Stream a)\n\nstreamRepeat :: a -> Stream a\nstreamRepeat x = Cons x (streamRepeat x)\n\nstreamMap :: (a -> b) -> Stream a -> Stream b\nstreamMap f (Cons x xs) = Cons (f x) (streamMap f xs)\n\nstreamInterleave :: Stream a -> Stream a -> Stream a\nstreamInterleave (Cons x xs) ys = Cons x (streamInterleave ys xs)\n\nruler :: Stream Integer\nruler = streamInterleave (streamRepeat 0) (streamMap (+1) ruler)\n\n\nI am really confused why ruler can be implemented like this. Is this going to give me [0,1,0,1....]?\n\nAny help will be greatly appreciated. Thank you!!" ]
[ "haskell", "stream", "infinite", "self-reference", "interleave" ]
[ "Creating a new workbook and worksheets for multiple criteria with VBA", "I have a table that looks like this in excel starting in \"A1\" \n\nName Age Address Contact Group Measure\nJim 32 aaa abc Stark Prev1\nJoe 22 bbb abc Stark Prev2\nBob 22 ccc abc Stark HM\nGreg 22 ddd efg Stark TM\nTed 39 eee efg Rank Prev1\nJack 20 fff efg Rank Prev2\nSam 30 aaa hij Rank HM\nLisa 37 bbb hij Rank TM\nAshley 37 ccc hij Rank Prev1\nLinda 31 ddd klm Rank Prev2\nLiz 39 eee klm Crazy HM\nTyler 33 fff klm Crazy TM\nBlake 27 aaa nop Crazy Prev1\nDustin 38 bbb nop Crazy Prev2\n\n\nI am trying to make a new book for each group and then create a tab(sheet) that has each different measure. \n\nI want to name each book with the group name.\n\nSo in this case I would have 3 sheets (Stark,Rank and Crazy) and they would each have 4 different tabs. Rank would end up with a couple more lines. \n\nSo I get through one sheet perfect, but when I try to loop for multiple sheets I have been getting a error on this line.\n\n\n Run-time error - Automation Error\n\n\nnewBook.Sheets.Add(After:=Sheets(Sheets.Count)).Name = Measure.Value\n\n\nWhat do I need to do to fix this? \n\nOption Explicit\n\nSub MakeNewSheets()\nApplication.ScreenUpdating = False\nDim Measure As Range\nDim Group As Range\nDim rng As Range\nDim rng1 As Range\nDim last As Long\nDim sht As String\nDim newBook As Excel.Workbook\nDim Workbk As Excel.Workbook\n\n\n'Specify sheet name in which the data is stored\nsht = \"Data\"\n\n'Workbook where VBA code resides\nSet Workbk = ThisWorkbook\n\n'New Workbook\nSet newBook = Workbooks.Add(xlWBATWorksheet)\nWorkbk.Activate\n\n'change filter column in the following code\nlast = Workbk.Sheets(sht).Cells(Rows.Count, \"F\").End(xlUp).Row\n\nWith Workbk.Sheets(sht)\nSet rng = .Range(\"A1:F\" & last)\nEnd With\n\nWorkbk.Sheets(sht).Range(\"F1:F\" & last).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range(\"AA1\"), Unique:=True\nWorkbk.Sheets(sht).Range(\"E1:E\" & last).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range(\"AB1\"), Unique:=True\n\nFor Each Group In Workbk.Sheets(sht).Range([AB2], Cells(Rows.Count, \"AB\").End(xlUp))\n\n For Each Measure In Workbk.Sheets(sht).Range([AA2], Cells(Rows.Count, \"AA\").End(xlUp))\n With rng\n .AutoFilter\n .AutoFilter Field:=6, Criteria1:=Measure.Value\n .AutoFilter Field:=5, Criteria1:=Group.Value\n .SpecialCells(xlCellTypeVisible).Copy\n\n newBook.Sheets.Add(After:=Sheets(Sheets.Count)).Name = Measure.Value\n newBook.Activate\n ActiveSheet.Paste\n End With\n Next Measure\n\n ' Delete sheet1 from newworkbook\n Application.DisplayAlerts = False\n Worksheets(\"Sheet1\").Delete\n Application.DisplayAlerts = True\n\n ' Save newworkbook as location\n\n\n newBook.Activate\n newBook.SaveAs \"C:\\Users\\xxxxxxxxx\\Desktop\\\" & Group.Value\n Workbooks(Group.Value & \".xlsx\").Close SaveChanges:=False\n\n\nNext Group\n\n\n' Turn off filter\n\nWorkbk.Sheets(sht).AutoFilterMode = False\n\nWith Application\n.CutCopyMode = False\n.ScreenUpdating = True\nEnd With\n\nEnd Sub" ]
[ "excel", "vba" ]
[ "Firefox image sprites displays alt text", "In a web application I am using images sprites that have alt text. But in Firefox only the actual alt-text overlays the image on screen.\n\n<img width=\"36\" height=\"36\" class=\"step1Current\" title=\"Step 1\" alt=\"Quote step one image\">\n\n\nIts class is:\n\n.step1Current{\n background: url(../images/progress-sprites.png) no-repeat; \n background-position: 0px 0px ;\n width: 36px;\n height: 36px; \n}\n\n\nSo the image is overlayed with the text 'Quote step one image'." ]
[ "css", "firefox" ]
[ "extracting strings and merging using regex in oracle 12c", "I Have a column value like :\n{\"extarctrule\":[{\"includescene\":\"includewhen\",\"columnid\":\"product\",\"columnoperator\":\"in\",\"columnvalue\":\"cat dog\"}],\"includerule(text)\":\" {{This Rule applies When}} {{Product}} {{in}} cat dog\",\"surplexrule\":[{\"surplexruletype\":\"available\",\"scene\":\"initially\"}],\"surplexrule(text)\":\" {{Make Available}} {{Initially}}\"}\n\ni want the output like \n\nThis Rule applies When Product in cat dog Make Available initially" ]
[ "oracle12c", "regexp-replace", "regexp-substr" ]
[ "Rails 3 Update Attributes for a Join Table (Has Many, Through Association)", "I have the following :has_many, :through association for my models:\n\nGroup Model:\n\nhas_many :group_users\nhas_many :users, :through => :group_users\n\n\nUsers Model:\n\nhas_many :group_users\nhas_many :groups, :before_add => :validates_group, :through => :group_users\n\n\nGroupsUsers Model:\n\nbelongs_to :group\nbelongs_to :user\n\n\nIn the groups_users table, I have an additional column that keeps up with the users status (active or inactive). I need to be able to update that column when a user removes them self from a group. How can you use update_attributes on a join table?" ]
[ "ruby-on-rails-3", "activerecord", "has-many-through" ]
[ "Why is the app-bar title change not working?", "I have a collapsing toolbar. When it is collapsed, i set a app bar title, but once its expanded, i'm not able to remove the app bar title. The expand condition (verticalOffset == 0) is getting executed, but the title seem not getting changed.\n\npublic class MovieDetailsActivity extends AppCompatActivity implements AppBarLayout.OnOffsetChangedListener{\n\n private CollapsingToolbarLayout collapsingToolbarLayout;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_movie_details);\n\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n\n ...\n\n collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);\n\n AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.app_bar);\n appBarLayout.addOnOffsetChangedListener(this);\n\n ...\n setTitle(\"\");\n ...\n\n }\n\n @Override\n public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {\n if (Math.abs(verticalOffset) == appBarLayout.getTotalScrollRange()) {\n //Closed\n setTitle(\"Tmovies\");\n Log.i(\"test\",\"Closed\");\n\n } else if (verticalOffset == 0) {\n // Expanded\n setTitle(\"\");\n Log.i(\"test\",\"Expanded\");\n } else {\n // Somewhere in between\n\n }\n }\n}" ]
[ "java", "android" ]
[ "date manipulation in javascript", "Suppose I get a date via a jquery calendar to a java script variable.\ne.g: var d = 02/12/2011\n\nHow can I manipulate that date variable using a js function or jq method where to get the date 3 month ahead of that date? I cant just do following know. Because every month does not have 30 days?\n\nvar futureDate=new Date(d);\nfutureDate.setDate(futureDate.getDate()+30*3);" ]
[ "javascript", "jquery", "datediff" ]
[ "C# Load Dialog Box (Unable to Load, but when it does, its actions do not function)", "I am using C# and I have a Load button in my GUI program that is not prompting the user with a warning to save data before loading a new one. How can I make it so that the prompt message can be displayed properly? Data loads correctly as I want, but the dialog message is not being displayed. \n\nThis is part of my code:\n\nprivate bool dirtyText;\nprivate bool dirtyFilename;\n\n#region load\n\n\n//================================\n // LOAD \n //================================\n\nprivate void loadFile()\n{\n try\n {\n textBox.Text = File.ReadAllText(fileName.Text);\n dirtyText = false;\n dirtyFileName = false;\n }\n catch (Exception ex)\n {\n MessageBox.Show(\"Load failed: \" + ex.Message);\n }\n}\n\n //================================\n // LOAD - actual code to load files\n //================================\n\nprivate void load_Click(object sender, EventArgs e)\n{\n if (dirtyFileName)\n {\n DialogResult result = MessageBox.Show(\"Your data have not been saved yet. Would you like to save them before loading?\", \"Unchanged data\", MessageBoxButtons.YesNoCancel);\n\n switch (result)\n {\n case DialogResult.Yes:\n File.WriteAllText(fileName.Text, \" \");\n loadFile();\n break;\n case DialogResult.No:\n loadFile();\n break;\n case DialogResult.Cancel:\n break;\n }\n }\n else\n {\n loadFile();\n }\n}\n\n#endregion\n\n\nThe picture below shows you what I'd like to see when I click on Load.\n\n\n\nAlso a quick note: I did made the dialog box work however, by removing the entire block of code that includes the switch statement from the if statement and getting rid of the if-else statement; but doing this renders all the buttons of the dialog box impotent. The save don't save the file, the load erases the text and the cancel, well... the cancel just does what it does best: canceling the action. Technically the important buttons are useless.\n\nI hope I get a solution to this. Appreciate it." ]
[ "c#", "user-interface" ]
[ "PagedList using LINQ Skip and Take, but show paging using Count of results", "I am trying to display a filtered list of of products, based on Category filter and ItemsPerPage but I'm having some issues when trying to use it with PagedList.\n\nSomeone with PagedList expertise could advice me if I need to write my own pagination code or is there a way to get the results I need using PagedList.\n\nI am using LINQ's Skip & Take functions to get only the number of rows that need to be displayed on the current page, but I would still like paging links to show pages based on the filter's total count.\n\nE.g.: my search filter finds 50 results, but since my rows per page is say 10 items, I use LINQ's Skip() & Take() to get only 10 rows back. I still need to show in my View.cshtml the page links << 1 | 2 | 3 | 4 | 5 >>\nRight now with default PagedList, I only get << 1 >>, I know why I only see one page but just wanted to know how can I make it work to show correct number of page links, while only getting a subset of results.\n\n**My goal is to write optimized queries to the Database so the web page response performance will be fast.\n\nHere is what my code for the Action Method looks like. The code is getting the correct results but the pagination is not working as I need it to be:\n\npublic ViewResult List(int page =1, string category =null)\n{\n if (category != null) this.CurrentCategory = category;\n\n var products = repository.Products\n .Where(p => this.CurrentCategory == null || p.Category == this.CurrentCategory)\n .OrderBy(p => p.ProductID)\n .Skip((page -1) * PageSize)\n .Take(PageSize);\n\n return View(products.ToList().ToPagedList(page, PageSize));\n}\n\n\nHere is the code snippet from the View that deals with pagination. I looked into the project's Github site but could not find an extension method to provide custom pages. I think it will only render number of pages based on 'items per page' and the Count() of products in the @Model:\n\n@model IPagedList<Product>\n\n//foreach loop that renders the @Model\n\n//Code that displays the pagination using PagedList\n<div style=\"text-align:center\">\n @Html.PagedListPager(Model, page => Url.Action(\"List\", new { page = page, category = ViewBag.CurrentCategory }), PagedListRenderOptions.OnlyShowFivePagesAtATime\n )\n</div>" ]
[ "c#", "linq", "asp.net-mvc-4", "pagination", "pagedlist" ]
[ "How to add new rows to existing rows in JTable", "I have a JTable developed in Netbeans forms. I want the program to work in such a way that when I click a button, the new prepared records will be added to the existing ones. My problem is when I want to add new records, the moment I click the button, it replaces the existing one. Can anyone help me with the method to add new records to existing ones?" ]
[ "java", "swing", "jtable" ]
[ "How to use AWS CodeArtifact *within* A Dockerfile in AWSCodeBuild", "I am trying to do a pip install from codeartifact from within a dockerbuild in aws codebuild.\nThis article does not quite solve my problem: https://docs.aws.amazon.com/codeartifact/latest/ug/using-python-packages-in-codebuild.html\nThe login to AWS CodeArtifct is in the prebuild; outside of the Docker context.\nBut my pip install is inside my Dockerfile (we pull from a private pypi registry).\nHow do I do this, without doing something horrible like setting an env variable to the password derived from reading ~/.config/pip.conf/ after running the login command in prebuild?" ]
[ "amazon-web-services", "aws-codeartifact" ]
[ "$.post() and appendTo not working in firefox?", "I'm trying to append table tbody using appendTo inside a $.post().\n\nIt works in chrome, but it in firefox it is not working.\n\nAnyone can help me?\n\nhere is my code:\n\n$.post('categories_content.php','',function(data) {\n $.each(data,function(i,data) {\n //do something\n });\n $(myvar).appendTo(\"table tbody\");\n},'json');" ]
[ "jquery", "json" ]
[ "Custom Command for fetching the custom results from commandline output", "I need to write a shell script which will fetch the custom results from the command-line output being displayed.\n\nConsider the following scenario:\n\nThis is the command and related output.\n\nroot@devstack:/opt/devstack# /usr/local/bin/neutron subnet-list\n+--------------------------------------+---------------------+---------------------+-------------------------------------------------------------------------------+\n| id | name | cidr | allocation_pools |\n+--------------------------------------+---------------------+---------------------+-------------------------------------------------------------------------------+\n| 3efe15d0-24a4-4618-8034-26345438da41 | private-subnet | 10.0.0.0/24 | {\"start\": \"10.0.0.2\", \"end\": \"10.0.0.254\"} |\n| 4bf54b31-c14c-493b-92c1-079c65484113 | public-subnet | 172.24.4.0/24 | {\"start\": \"172.24.4.2\", \"end\": \"172.24.4.254\"} |\n| 4fbe1ac2-ff40-4efa-8333-2c02be54312e | ipv6-private-subnet | fd6e:78a4:ae52::/64 | {\"start\": \"fd6e:78a4:ae52::2\", \"end\": \"fd6e:78a4:ae52:0:ffff:ffff:ffff:ffff\"} |\n| 09b45af3-ef6f-4ad8-a4cb-643b218f0439 | ipv6-public-subnet | 2001:db8::/64 | {\"start\": \"2001:db8::3\", \"end\": \"2001:db8::ffff:ffff:ffff:ffff\"} |\n| | | | {\"start\": \"2001:db8::1\", \"end\": \"2001:db8::1\"} |\n+--------------------------------------+---------------------+---------------------+-------------------------------------------------------------------------------+\n\n\nNow What I need is to get the id only for name field having following values:\n\nprivate-subnet\npublic-subnet\n\n\nI have tried the command as follows for getting only the id with no condition specified:\n\nroot@devstack:/opt/devstack# /usr/local/bin/neutron subnet-list | awk '{print $2}'\n\nid\n\n4fbe1ac2-ff40-4efa-8333-2c02be54312e\n09b45af3-ef6f-4ad8-a4cb-643b218f0439\n|\n3efe15d0-24a4-4618-8034-26345438da41\n4bf54b31-c14c-493b-92c1-079c65484113\n\n\nSome one let me know the value of getting only the \"id\" where name having the values \"private-subnet\" and \"public-subnet\"." ]
[ "shell", "command-line" ]
[ "How to copy a database from one computer to another?", "I have a database in SQL Server 2008, which I want to copy to another computer.\n\nHow do I make such a copy?\n\nOnce this is done, what should I do at the other computer to build the database once again from my copy?" ]
[ "sql-server", "database" ]
[ "how can i search for values that have \"-\" dash in them with elastic search", "my entry in elastic search is like this:\n\ninput:\n\ncurl -XPUT \"http://localhost:9200/movies/movie/4\" -d'\n{\n \"uid\": \"a-b\"\n}'\n\n\nquery :\n\ncurl -XGET \"http://localhost:9200/movies/movie/_search\" -d '\n{\n \"query\" : {\n \"term\" : { \"uid\": \"a-b\" }\n }\n}'\n\n\noutput:\n\n{\"took\":2,\"timed_out\":false,\"_shards\":{\"total\":5,\"successful\":5,\"failed\":0},\"hits\":{\"total\":0,\"max_score\":null,\"hits\":[]}}\n\n\nThanks" ]
[ "elasticsearch" ]
[ "Fast 2D drawing for generated image", "I have an application, which generates image. Each frame is completely different and can not be accelerated by using of textures or sprites.\nI want to draw with high rate, but best I got with SDL is about 8 fps at 2560x1440 by using SDL's canvas.draw_point. I'd like to push it to 60 fps or more.\nI feel I'm doing something wrong. What is the proper approach to this problem?\nMy 'computations' are on separate threads, so I can dedicate a whole thread to a simple copy from a memory array to (whatever technology requires).\nI want to do it under X using Rust, so any X or cross-plaform library (including a pure C) is ok, but I feel that the problem is not within library, but in my 'per pixel' approach. How to do it right?" ]
[ "rust", "2d", "drawing", "x11", "desktop-application" ]
[ "When do you multiply by the average Big O of nested loop?", "When do we multiply the Big O of the outer loop by the average Big O of the inner loop?\n\nfor (int i = n; i > 0; i /= 2) {\n for (int j = 0; j < i; j++) {\n //statement\n }\n}\nAnswer: O(n)\n\n\nIn this question, the outer loop is O(log n). Since the inner loop executes some number of times based on 'i', the average Big O is taken. This results in a summation of n + n/2 + n/4 + ... = 2n which is then divided to get the average: O(2n / log n).\n\nHence O(log n) * O(2n / log n) = O(n).\n\nBut then why don't we need to take the average for this question?\n\nfor (i = 0; i < n; i++) {\n for (j = 0; j < i * i ; j++){\n\n }\n}\nAnswer: O(n^3)\n\n\nThe outer loop is O(n). The inner loop is O(n^2). But why?\n\nDoesn't the inner loop execute based on a value of 'i' in the outer loop? So why isn't the average taken like the question above? - resulting in something like O(n^2 / n) for the inner loop." ]
[ "algorithm", "time-complexity", "big-o" ]
[ "mysql_insert_id() 0, but insert is done successfully", "this is table schema: \n\nCREATE TABLE `USERS` (\n `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\n `email` varchar(30) DEFAULT '',\n `first_name` varchar(15) DEFAULT '',\n `last_name` varchar(15) DEFAULT '',\n `password` varchar(15) DEFAULT '',\n `gender` int(1) DEFAULT '-1',\n PRIMARY KEY (`id`)\n) \n\n\nin php:\n\n $sql = 'INSERT INTO Users (email, first_Name, last_Name, password, gender ) VALUES (\"'.$email.'\", \"'.$first_name.'\", \"'.$last_name.'\", \"'.$password.'\", '.$gender.')';\n\ntry {\n $db = getConnection();\n $stmt = $db->prepare($sql); \n $stmt->execute();\n //$user = $stmt->fetchObject();\n echo 'last id was '.mysql_insert_id();\n\n $db = null;\n\n\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n }\n\n\nI can't figure out why mysql_insert_id() returns 0. there are no other processes running. id is set to auto increment. Insert is done and seen in db." ]
[ "php", "mysql", "insert" ]
[ "pd.merge_asof() based on Time-Difference not merging all values - Pandas", "I have two dataframes, one with news and the other with stock price. Both the dataframes have a \"Date\" column. I want to merge them on a gap of 5 days.\n\nLets say my news dataframe is df1 and the other price dataframe as df2.\n\nMy df1 looks like this:\n\nNews_Dates News\n2018-09-29 Huge blow to ABC Corp. as they lost the 2012 tax case\n2018-09-30 ABC Corp. suffers a loss\n2018-10-01 ABC Corp to Sell stakes\n2018-12-20 We are going to comeback strong said ABC CEO\n2018-12-22 Shares are down massively for ABC Corp.\n\n\nMy df2 looks like this:\n\n Dates Price\n2018-10-04 120\n2018-12-24 131\n\n\nFirst method of merging I do is:\n\npd.merge_asof(df1_zscore.sort_values(by=['Dates']), df_n.sort_values(by=['News_Dates']), left_on=['Dates'], right_on=['News_Dates'] \\\n tolerance=pd.Timedelta('5d'), direction='backward')\n\n\nThe resulting df is:\n\n Dates News_Dates News Price\n2018-10-04 2018-10-01 ABC Corp to Sell stakes 120\n2018-12-24 2018-12-22 Shares are down massively for ABC Corp. 131\n\n\nThe second way of merging I do is:\n\npd.merge_asof(df_n.sort_values(by=['Dates']), df1_zscore.sort_values(by=['Dates']), left_on=['News_Dates'], right_no=['Dates'] \\\n tolerance=pd.Timedelta('5d'), direction='forward').dropna()\n\n\nAnd the resulting df as:\n\nNews_Dates News Dates Price\n2018-09-29 Huge blow to ABC Corp. as they lost the 2012 tax case 2018-10-04 120\n2018-09-30 ABC Corp. suffers a loss 2018-10-04 120 \n2018-10-01 ABC Corp to Sell stakes 2018-10-04 120\n2018-12-22 Shares are down massively for ABC Corp. 2018-12-24 131\n\n\nBoth the merging results in separate dfs, however there are values in both the cases which are missing, like for second case for 4th October price, news from 29th, 30th Sept should have been merged. And in case 2 for 24th December price 20th December should also have been merged.\n\nSo I'm not quite able to figure out where am I going wrong.\n\nP.S. My objective is to merge the price df with the news df that have come in the last 5 days from the price date." ]
[ "python", "pandas" ]
[ "Insert Unique element into trie", "void insert(struct node *root, string s)\n{\n struct node *temp = root;\n for(int i=0;i<s.length();i++)\n {\n if(temp->idx[s[i]-'a']==NULL)\n temp->idx[s[i]-'a']=create();\n temp = temp->idx[s[i]-'a'];\n (temp->cnt)++;\n }\n temp->end=1;\n}\n\nSo I am going to insert string to create a unique trie data structure, but this insert algortihm is not able to detect any duplicate string, can someone help me how this insert algorithm works only for inserting unique elements?" ]
[ "trie" ]