texts
sequence | tags
sequence |
---|---|
[
"How to fix \"[Fatal Error] hive-default.xml:1:1: Content is not allowed in prolog\" error in HIVE",
"I am getting below error while starting Hive\n\nroot@ubuntu:~# hive\n[Fatal Error] hive-default.xml:1:1: Content is not allowed in prolog.\nException in thread \"main\" java.lang.RuntimeException: org.xml.sax.SAXParseException: Content is not allowed in prolog.\n at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1401)\n at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:1269)\n at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:1200)\n at org.apache.hadoop.conf.Configuration.get(Configuration.java:415)\n at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:663)\n at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:595)\n at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:434)\n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)\n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)\n at java.lang.reflect.Method.invoke(Method.java:597)\n at org.apache.hadoop.util.RunJar.main(RunJar.java:197)\nCaused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.\n at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:249)\n at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)\n at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:180)\n at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:1300)\n ... 11 more\nroot@ubuntu:~# \n\n\nSome one please help me to fix this issue.\nThanks in advance."
] | [
"hadoop",
"hive"
] |
[
"C# ConvertAll syntax",
"I'm trying to understand the syntax for ConvertAll in C#, and despite looking at several examples and trying to copy them, I can't get the following line containing s2 to compile; VSE2013 says \n\n\n \"Error 1 No overload for method 'ConvertAll' takes 1 arguments \".\n\n\nwhat does the error message mean? Where am I going wrong? And yes, I understand that Select is much better to use in these situations, for several reasons. Thanks!\n\nstatic int Main(string[] args)\n{ \n Console.WriteLine (\"jello world\");\n\n int s1 = args.Sum(st => int.Parse(st));\n int s2 = args.ConvertAll(x => int.Parse(x)).Sum();\n int s3 = args.Select(st => int.Parse(st)).Take(2).Sum();\n return 0;\n}"
] | [
"c#",
"convertall"
] |
[
"How to wrap a whole group of elements on the next line when screen gets smaller using CSS?",
"On big screens, like desktops, it would look like this:\n\nBut in smaller screens or when zoomed in, I want my multiple lines to wrap like this:\n\nI tried this:\n\r\n\r\n.tab__set {\n display: block;\n font-size: 1.2em;\n font-family: monospace;\n overflow: hidden;\n border: 1px solid;\n resize: horizontal;\n}\n\n.tab {\n min-height: 1.2rem;\n display: block;\n white-space: wrap;\n}\r\n<span class=\"tab__set\">\n <span class=\"tab\">e|------------------------|----------------------------|----------------------|-------------</span>\n <span class=\"tab\">B|------------------------|-------2h3p2----5-----5--2--|------2-----2-----2---|---3-----3---</span>\n <span class=\"tab\">G|------------------------|----2--------2--4-----4--2--|------2-----2-----2---|---2-----2---</span>\n <span class=\"tab\">D|------------------------|----------------------------|----------------------|-------------</span>\n <span class=\"tab\">A|------------------------|-0--------------------------|----------------------|-------------</span>\n <span class=\"tab\">E|--------------------0h2-|----------------4--4-----2--|---2-----2--0--0-----0|---2--2-----2</span>\n</span>\r\n\r\n\r\n\nAbove, I tried using white-space: wrap; but the result is not what I desire. It doesn't wrap as a whole set of tabs like what it did on the second image above. Instead, it just wraps as individual elements.\nThen I tried using white-space: nowrap; and of course that doesn't work because it will not show all the tabs unless I scroll horizontally. I don't know how to make multiple elements go on a new line as a whole group. Please help."
] | [
"html",
"css"
] |
[
"Make blog posts 3 row and 3 column",
"How can I make it 3 column and 3 row then pagination in order to use empty spaces. Check \"Music Title\" here. \n\nHere is the code:\n\n<?php if ( have_posts() ) : ?>\n<h3 class=\"m-t-none\"><?php echo get_theme_mod( 'title-music', esc_html__('Music', 'musik') ); ?></h3>\n<div class=\"list-group list-group-lg\">\n<?php while ( have_posts() ) : the_post(); ?>\n<div class=\"list-group-item\">\n<?php get_template_part( 'template-parts/content', 'download-list' ); ?>\n</div>\n<?php endwhile; ?>\n</div>\n<?php get_template_part( 'template-parts/pagination' ); ?>"
] | [
"php",
"wordpress"
] |
[
"SLIM Framework - Different result on $app->urlFor() and $app->router()->urlFor()",
"I'm having problem with $app->urlFor().\nI have blog named route. Everytime I use $app->urlFor('blog') to create a link, the function is always returning localhost:8000/index.php/blog instead of localhost:8000/blog.\n\nCan someone help me ?"
] | [
"php",
"twig",
"slim"
] |
[
"Remove Accept-Charset from webservice responses",
"I have a RESTful Webservice coded with Spring MVC. Since I configured the Message Converters all the responses of the webservice contains the HTTP header Accept-Charset:\n\nAccept-Charset: big5, big5-hkscs, cesu-8, euc-jp, euc-kr, gb18030, gb2312, gbk, ibm-thai, ibm00858, ibm01140, ibm01141, ibm01142, ibm01143, ibm01144, ibm01145, ibm01146, ibm01147, ibm01148, ibm01149, ibm037, ibm1026, ibm1047, ibm273, ibm277, ibm278, ibm280, ibm284, ibm285, ibm290, ibm297, ibm420, ibm424, ibm437, ibm500, ibm775, ibm850, ibm852, ibm855, ibm857, ibm860, ibm861, ibm862, ibm863, ibm864, ibm865, ibm866, ibm868, ibm869, ibm870, ibm871, ibm918, iso-2022-cn, iso-2022-jp, iso-2022-jp-2, iso-2022-kr, iso-8859-1, iso-8859-13, iso-8859-15, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, jis_x0201, jis_x0212-1990, koi8-r, koi8-u, shift_jis, tis-620, us-ascii, utf-16, utf-16be, utf-16le, utf-32, utf-32be, utf-32le, utf-8, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, windows-1258, windows-31j, x-big5-hkscs-2001, x-big5-solaris, x-euc-jp-linux, x-euc-tw, x-eucjp-open, x-ibm1006, x-ibm1025, x-ibm1046, x-ibm1097, x-ibm1098, x-ibm1112, x-ibm1122, x-ibm1123, x-ibm1124, x-ibm1166, x-ibm1364, x-ibm1381, x-ibm1383, x-ibm300, x-ibm33722, x-ibm737, x-ibm833, x-ibm834, x-ibm856, x-ibm874, x-ibm875, x-ibm921, x-ibm922, x-ibm930, x-ibm933, x-ibm935, x-ibm937, x-ibm939, x-ibm942, x-ibm942c, x-ibm943, x-ibm943c, x-ibm948, x-ibm949, x-ibm949c, x-ibm950, x-ibm964, x-ibm970, x-iscii91, x-iso-2022-cn-cns, x-iso-2022-cn-gb, x-iso-8859-11, x-jis0208, x-jisautodetect, x-johab, x-macarabic, x-maccentraleurope, x-maccroatian, x-maccyrillic, x-macdingbat, x-macgreek, x-machebrew, x-maciceland, x-macroman, x-macromania, x-macsymbol, x-macthai, x-macturkish, x-macukraine, x-ms932_0213, x-ms950-hkscs, x-ms950-hkscs-xp, x-mswin-936, x-pck, x-sjis_0213, x-utf-16le-bom, x-utf-32be-bom, x-utf-32le-bom, x-windows-50220, x-windows-50221, x-windows-874, x-windows-949, x-windows-950, x-windows-iso2022jp\n\n\nHow can I configure spring to remove this header?"
] | [
"java",
"spring",
"spring-mvc",
"http-headers"
] |
[
"AWS: Is it possible to allow a Lambda function call an API secured by WAF?",
"I have an API hosted on API Gateway secured by some WAF rules. One of the rules is the IP restriction rule, where I allow the API to get called only from certain IP ranges. Now, I have a Lambda function that should call this API, and of course if getting a Forbidden error. I know I can solve this if I put the Lambda inside a VPC and then add the VPC IPs to the WAF rule, however is it possible to make it works WITHOUT using the VPC?"
] | [
"amazon-web-services",
"aws-lambda",
"amazon-waf"
] |
[
"curl: (7) Failed to connect to 192.168.99.100 port 31591: Connection refused",
"These are my pods\n\nhello-kubernetes-5569fb7d8f-4rkhs 0/1 ImagePullBackOff 0 5d2h\nhello-minikube-5857d96c67-44kfg 1/1 Running 1 5d2h\nhello-minikube2 1/1 Running 0 3m24s\nhello-minikube2-74654c8f6f-trrrw 1/1 Running 0 4m8s\nhello-newkubernetes 0/1 ImagePullBackOff 0 5d1h\n\n\nIf I try\n\ncurl $(minikube service hello-minikube2 --url)\ncurl: (7) Failed to connect to 192.168.99.100 port 31591: Connection refused\n\n\nLet's check VBox\n\ninet 192.168.99.1/24 brd 192.168.99.255 scope global vboxnet0\n valid_lft forever preferred_lft forever\ninet6 fe80::800:27ff:fe00:0/64 scope link \n valid_lft forever preferred_lft forever\n\n\nWhy is my connection refused?\n\nkubectl get svc -o wide\nNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR\nhello-kubernetes NodePort 10.98.65.138 <none> 8080:30062/TCP 5d2h run=hello-kubernetes\nhello-minikube NodePort 10.105.166.56 <none> 8080:30153/TCP 5d3h run=hello-minikube\nhello-minikube2 NodePort 10.96.94.39 <none> 8080:31591/TCP 42m run=hello-minikube2\nkubernetes ClusterIP 10.96.0.1 <none> 443/TCP 5d4h <none>\ntomcat-deployment NodePort 10.96.205.228 <none> 8080:30613/TCP 2m13s app=tomcat\n\nkubectl get ep -o wide\nNAME ENDPOINTS AGE\nhello-kubernetes 5d14h\nhello-minikube 172.17.0.7:8080 5d14h\nhello-minikube2 172.17.0.4:8080,172.17.0.5:8080 12h\nkubernetes 192.168.99.100:8443 5d16h\ntomcat-deployment 172.17.0.6:8080 11h\n\n\nI want to show service endpoint\n\nminikube service tomcat-deployment --url\nhttp://192.168.99.100:30613\n\n\nWhy is this url different from get ep -o wide output?"
] | [
"kubernetes"
] |
[
"Core Data Select Induvidual Fields",
"I have a core data model with the following info:\n\nEntity: CourseSubjects\nAttributes:\n-account_id\n-course_code\n-course_id\n-name\n\nI need to be able to select Only one piece of data from that database which has the field course_id matching what I want. How would I be able to select only one field from this database which has the course_id?\n\nThanks"
] | [
"objective-c"
] |
[
"How to save multiple select fields in woocommerce variable subscriptions custom field as multi select",
"I am adding custom fields in Woocommerce Variable Subscriptions and its working fine for all except for dropdown with ability to select multiple. Here is my code.\n<?php\n\n// Showing fields for variable subscriptions \nadd_action('woocommerce_product_after_variable_attributes', 'show_WC_Product_Variable_Subscription_Variation_Custom_Fields', 10, 3);\n\n// Saving fields for variable subscriptions \nadd_action('woocommerce_save_product_variation', 'save_WC_Product_Variable_Subscription_Variation_Custom_Fields', 10, 2);\n\n\nfunction show_WC_Product_Variable_Subscription_Variation_Custom_Fields($loop, $variation_data, $variation) {\n\n echo '<strong>' . __("Mindesk e-Commerce", 'woocommerce') . '</strong>';\n\n \n\n // Mindesk User IDS \n $mindesk_user_ids = get_post_meta($variation->ID, 'mindesk_user_ids', true);\n\n woocommerce_wp_select(\n array(\n 'id' => "mindesk_user_ids{$loop}",\n 'name' => "mindesk_user_ids[][{$loop}]",\n 'wrapper_class' => 'product_custom_field form-row ',\n 'class' => 'mindesk_select2',\n 'label' => __('Mindesk User IDs', 'woocommerce'),\n 'default' => $mindesk_user_ids,\n 'class' => 'mindesk_select2',\n 'options' => array(\n 'Mon' => 'Monday',\n 'Tue' => 'Tuesday',\n 'Wed' => 'Wednesday',\n 'Thu' => 'Thursday',\n 'Fri' => 'Friday',\n 'Sat' => 'Saturday',\n 'Sun' => 'Sunday'\n ),\n 'custom_attributes' => array('multiple' => 'multiple')\n )\n );\n}\n\nfunction save_WC_Product_Variable_Subscription_Variation_Custom_Fields($variation_id, $loop) {\n // Mindesk User IDs \n $mindesk_user_ids = $_POST['mindesk_user_ids'][$loop];\n update_post_meta($variation_id, 'mindesk_user_ids', esc_attr($mindesk_user_ids));\n}\n\nAs you can see here, I am showing select box and I am able to select multiple fields but when I save this, in my database its value saving as Array..\nI have tried to replace my loop variable name something like 'name' => "mindesk_user_ids[{$loop}][]", but its not working .. I also want once saved, those values to set as selected.\nCan someone guide me what I am doing wrong here?\nAny guidance will be highly appreciated.\nThanks"
] | [
"php",
"wordpress",
"woocommerce",
"hook-woocommerce",
"woocommerce-subscriptions"
] |
[
"adding instances in eureka sever",
"server.port=1013\neureka.client.serviceUrl.defaultZone=http://localhost:1000/eureka\neureka.instance.instanceId= ${spring.application.name}:${random.int}\n\n\nI'm using the default port 1013 in producer. How do I add another instance in netflix ribbon so that load balancing can pick any of port?"
] | [
"netflix-eureka",
"netflix",
"netflix-ribbon"
] |
[
"NAnt + svn diff - ignore merge commits",
"Our (very legacy) codebase has an ActiveX Client UI which requires building and committing the binaries to SVN. \n\nWe use a trunk, feature branch and tagged releases repository pattern.\n\nI wrote a NAnt script to compile the release packages by determining the commit revisions of branch and tag creation and using svn diff to list the changes to the UI binaries between the two - these are then exported from the repository to generate the release package:\n\n<exec program=\"svn.exe\" \n commandline=\"diff svn://hostname/Project/branches/1.2/Client -r 1234:5678 --summarize --xml\" \n output=\"c:\\Temp\\ClientComponents.xml\" />\n\n<xmllist file=\"c:\\Temp\\ClientComponents.xml\" \n property=\"ClientComponents\" \n delim=\",\" \n xpath=\"/diff/paths/path[@kind = 'file' and @item != 'deleted']\" />\n\n<foreach item=\"String\" in=\"${ClientComponents}\" delim=\",\" property=\"source\">\n\n <!-- svn export -->\n\n</foreach>\n\n\nThe output from svn diff looks like this:\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<diff>\n<paths>\n<path\n item=\"modified\"\n props=\"none\"\n kind=\"file\">svn://hostname/project/branches/1.2/Client/Component1.cab</path>\n</paths>\n</diff>\n\n\nThis has worked fine up until now - as we now have 2 concurrent feature branches.\n\nThe first feature branch (e.g. 1.1) has made a change to the Client UI which has correctly been packaged in a 1.1.1 version.\n\nThis change has been merged forward into the second branch (e.g. 1.2) and when I now try to package 1.2.1 it includes the Client UI changes that were merged from 1.1\n\nIs there any way to exclude merged changes on the svn diff command?"
] | [
"svn",
"merge",
"diff",
"nant"
] |
[
"QML - Imperative code not supported",
"Can someone comment on the fact that for QML, any imperative JavaScript code is not executed unless it is part of an extra component. I am facing such kind of problem when I include the following code to my QML:\n\nfunction qmlSlot(text){\n page.data=text\n if(page.data===\"received\")\n page.color=\"black\";\n}\n\n\nAs the Qt Designer get frozen and shows the following warning:\n\n\n Imperative code is not supported in the Qt Quick Designer\n\n\nI read that building qmlpuppet installs an executable for rendering components in the /bin directory of the Qt building it. Qt Quick Designer checks for the Qt of the current project if a qmlpuppet is in the /bin directory. If yes it takes the qmlpuppet provided by the Qt version instead of the one provided by Qt Creator itself. In my case I haven't used the Qt static binary install, but instead built Qt from the source, thus qmlpuppet executable was generated and is already located at:\n\n/usr/local/Qt-5.2.1/qtcreator/bin\n-rwxr-xr-x 1 qml2puppet\n-rwxr-xr-x 1 qmlpuppet\n\n\nSo, the executable qmlpuppet is placed where is expected to be found and still this annoying message continues.\n\nThe workaround I took at moment is to comment out any so called \"Imperative code\" for when I want to edit the front-end QML using Qt Designer. Then after take out those comments to have the \"Imperative code\" activated again. But this is very annoying, although the code compile and works as I expected it to behave. \n\nSo, should I get worried about this warning? Anyway, there is some mean to get rid of this problem, as it froze the Qt Designer?"
] | [
"c++",
"qt",
"qml",
"qtquick-designer"
] |
[
"Is there any handy command line tool to manage Cron jobs?",
"Would someone suggest any handy command line (NOT web) tool or script which adds, enables and disables Cron jobs? I am looking, for example, for the following (or similar) behavior: \n\nsh manageCron.sh -idJob 'job1' -addJob '* * * * * <do some job>'\nsh manageCron.sh -dissableJob 'job1' \n\n\ncrontab -e command is good for manual editing of crontab file, but I need to automate."
] | [
"bash",
"unix",
"cron",
"solaris",
"crontab"
] |
[
"SmartPointer from DLL: where to construct & destruct",
"I'm currently remodelling a dynamic library project and removed a lot of STL and other dependencies from its header resulting in conflicting implementations between different toolchains. \n\nThe DLL Interface now only contains plain C-types and custom types whom implementation depends solely on the DLL code. But now I'm stuck with two remaining points.\n\n\nThe DLL should return some sort of reference counting smart pointer (with a weak pointer option)\nManaging construction and destruction between the DLL boundaries. This more or less looks like this.\n\n\n.\n\n#include <memory>\n\nclass Config;\ntypedef std::shared_ptr<Config> ConfigPtr;\n\nclass CONFIGAPI_DLL Config\n{\n public:\n ///...\n ConfigPtr getNewNode( char const* query = \".\" )\n {\n // construct obj in dll, but construct shared_ptr in header\n return ConfigPtr( _constructgetNewNode(query) );\n }\n ConfigPtr getNewNodeFromHeader( char const* query = \".\" )\n {\n // construct obj and shared_ptr in header\n auto obj = new Config;\n obj->_init(query);\n return ConfigPtr( obj );\n }\n\n\n private:\n Config* _constructNewNode( char const* query = \".\" );\n void _init( char const* query = \".\" );\n};\n\n\nI was thinking by creating the share_ptr at the dll headers (getNewNode) it would prevent mixed implementations of std::shared_ptr ...but I don't know if that is a good idea?\n\nBut I also construct the new object inside the DLL (_constructNewNode) and this means it should also be destructed there?\n\nI tried to construct it in the headers and so in the user code scope (getNewNodeFromHeader)... this shouldn't cause problems?\n\nThe downside is I still export the C++11 header and rule out all older compilers. Is it possible to export the shared_ptr type from the dll as unconflicting code but still be compatible with std::shared_ptr?\n\nthanks!"
] | [
"c++11",
"dll",
"smart-pointers"
] |
[
"trying to make ASCII graph python 3",
"I'm trying to make an ASCII graph using python loops.\nThe goal is for the user to enter an input (formula) [x+1] etc. and print out the graph.\nThe domain and range of the graph only goes from -10 to +10. \n\nI managed to get it working, but only for the formula (-x+1), which is (x+1) in my code.\n\nI know the problem is because my loop starts printing it from the top, so I would have to change it so it prints the loop in the negative direction, but I am stuck on how to combine my graph into a nested loop so it prints it out properly, and then replaces the corresponding place of the function output.\n\nI'm thinking now that maybe I should make it print out the '*' line then the graph around it, but I think that's more complicated.\n\nI can give you any more information if you need.\n\nAny constructive thoughts would be much appreciated.\n\nHere is my code, let me know what you think.\n\nheight=20\nw=10\nx=0\nfor a in range(0,11):\n ps= ((\" \" * w)+('|')+(\" \" * w))\n ps=list(ps)\n ps[x]=\"*\"\n x=x+1\n pp=\"\".join(ps)\n print(pp)\n\n\n\nrs=(('-'*10)+('+')+('-'*10))\nrs=list(rs)\nrs[x]=\"*\"\nrr=\"\".join(rs)\nprint(rr)\n\nfor a in range(0,10):\n ws = ((\" \" * w)+('|')+(\" \" * w))\n ws=list(ws)\n y=x+1\n ws[y]=\"*\"\n x=x+1\n wp=\"\".join(ws)\n print(wp)\n\n\nThis is the output below:\n\n* | \n * | \n * | \n * | \n * | \n * | \n * | \n * | \n * | \n *| \n * \n----------+*---------\n | * \n | * \n | * \n | * \n | * \n | * \n | * \n | * \n | *"
] | [
"python",
"loops",
"printing",
"graph",
"ascii"
] |
[
"Unable to resolve NoClassDefFoundError for Jena IRIFactory",
"Below is the stacktrace of the error log I'm getting. If someone can tell what exactly could be causing this because as per the stacktrace I've everything in place.\n\nException in thread \"main\" java.lang.NoClassDefFoundError: com/hp/hpl/jena/iri/IRIFactory\n at net.rootdev.javardfa.uri.IRIResolver.<init>(IRIResolver.java:26)\n at org.odftoolkit.odfdom.pkg.rdfa.SAXRDFaParser.createInstance(SAXRDFaParser.java:57)\n at org.odftoolkit.odfdom.pkg.OdfFileDom.initialize(OdfFileDom.java:217)\n at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.initialize(OdfManifestDom.java:74)\n at org.odftoolkit.odfdom.pkg.OdfFileDom.<init>(OdfFileDom.java:132)\n at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.<init>(OdfManifestDom.java:63)\n at org.odftoolkit.odfdom.pkg.OdfFileDom.newFileDom(OdfFileDom.java:189)\n at org.odftoolkit.odfdom.pkg.OdfPackage.parseManifest(OdfPackage.java:1219)\n at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:452)\n at org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:422)\n at org.odftoolkit.odfdom.pkg.OdfPackage.<init>(OdfPackage.java:250)\n at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:320)\n at org.odftoolkit.simple.Document.loadDocument(Document.java:328)\n at org.odftoolkit.simple.TextDocument.loadDocument(TextDocument.java:305)\n at com.poc.LetsGetStarted.main(LetsGetStarted.java:13)\nCaused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.iri.IRIFactory\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.net.URLClassLoader$1.run(Unknown Source)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n ... 15 more\n\n\nJar Versions : jena-iri : 1.0.2 , java-rdfa : 0.4\n\nThanks."
] | [
"java",
"noclassdeffounderror",
"jena",
"rdfa"
] |
[
"Regular expression to remove repeated slashes that are after a specific word (VBScript/Classic ASP)",
"I'm struggling here, trying to figure out how to replace all double slashes that come after a specific word.\n\nExample: \n\n<img alt=\"\" src=\"/pt/webf//2015//47384_1.JPG\" height=\"235\" width=\"378\" />\n<div>Don't remove this // or this//</div>\n\n\nI want the string above to look like this:\n\n<img alt=\"\" src=\"/pt/webf/2015/47384_1.JPG\" height=\"235\" width=\"378\" />\n<div>Don't remove this // or this//</div>\n\n\nNotice the double slashes have been replaced with just one slash in the img tag but left unscathed in the div tag. I only want to replace the double slashes IF they come after the word: pt. \n\nI tried something like this:\n\n(?=pt)((.*?)\\/\\/)+ \n\n\nHowever, the first thing wrong with it is (?=) does not do pattern backtracking, as far as I'm aware. That is, it'll only look for the first matching pattern. The second thing wrong with it is it doesn't work as I intended it to.\n\nhttps://regex101.com/r/kC4tA5/1\n\nOr maybe I'm going about this the wrong way, since regular expression support is not expansive in VBScript/Classic ASP and I should try to break up the string and process, instead of trying to do everything in one regular expression???\n\nAny help would be appreciated.\n\nThank you."
] | [
"regex",
"vbscript",
"asp-classic",
"backslash",
"slash"
] |
[
"Create Document Term Matrix from Dataframe in Python",
"I want to create a term matrix document to determine the keywords of a set of words based on the label.\nMy dataset looks like this.\n id | description | severity |\n-------------------------------------------------------------------------------------------\n10020 | remotely deleting file opened editor | major |\n10021 | setting editor color setting string requires application restart | minor |\n100210 | ant build files cleared platform restart | major |\n\nI want to create a term matrix document that looks like this.\n | major | minor |\n------------------------\neditor | 1 | 1 |\nrestart | 1 | 1 |\n\n1 is frequency from word, but I want to fill it with tfidf weight.\nDoes anyone have any ideas?"
] | [
"python",
"dataframe",
"tf-idf"
] |
[
"Azure B2C Getting 400 BadRequest when SignUp using SignInSignup UserFlow",
"Can anyone help me in resolving the error like why i am getting 400 BadRequest when i click on SignUp button which uses a SignInSignUp userflow.\n\nSteps to produce this issue:\n\n\nOpen two same login pages in two different tabs.\nAfter that enter credentials on first tab and clicked on signin button which uses the same \nSignInSignUp userflow.\nAt the same time i clicked on SignUp button on second tab which leads to 400 BadRequest.\n\n\nUserFlow Example\n\nScreenshot Attached Below:"
] | [
"azure",
"azure-active-directory"
] |
[
"nginx get subdomain of the url and assing the document root",
"Im no expert on nginx but i got my problem solved by doing this:\n\nserver_name ~^(?<vhost>.*)$;\nroot /var/www/$vhost/public;\n\n\nFor example if a user types in a web browser http://sysadmin.mydomain.com nginx will use the doc root of /var/www/sysadmin.mydomain.com/public\n\nAnd this works fine, but in doing so I have created another problem with PHP $_SERVER['SERVER_NAME']; and its that this will print: ~^(?.*)$ causing problems somewhere else in my code.\n\nMy solution works for nginx but its not the right solution. How can i achieve this and still retain a 'readable' server name?"
] | [
"php",
"regex",
"nginx"
] |
[
"Copy found result under the current row",
"So I am having a worksheet with 16 columns. And I would like to find out the cells with font color is vbRed. Lets say Range(\"A5\") is the found cell then I would like to copy and paste the entire row into the next row in the current worksheet. \n\nAs I am writing Macro, I found my program will keep looping on the row that I copied and pasted. And also I am not sure whether I can use loop, copy and paste together with find method. I will strong appreciate if anyone can help with this.\n\nWith my current code:\n\nSub CopyRow()\n\nDim Row As Long\nRow = ActiveSheet.Range(\"A1\", ActiveSheet.Range(\"A1\").End(xlDown)).Rows.Count\nSheets(\"Sheet1\").Activate\nDim rng As Range\nSet rng = Range(\"A1:A\" & Row)\n\nFor Each cel In rng\nIf cel.Font.Color = vbRed Then\ncel.Rows.EntireRow.Insert Shift:=xlDown\ncel.EntireRow.Copy cel.Offset(-1).EntireRow\ncel.Offset(1, 0).Select\nEnd If\nNext cel\n\nEnd Sub\n\n\nThere's infinite loop...."
] | [
"vba",
"excel"
] |
[
"can we use pre-trained discriminator in GANS",
"Will it be efficient to use a pre-trained discriminator that can distinguish between real and fake images with a relatively high accuracy. Now based on discriminator loss can we generate more accurate samples that belong to real samples."
] | [
"python-3.x"
] |
[
"WifiPumpkin3 Didn't Redirect Connected Clients To The Captive Portal?",
"I have used wifipumpkin3 for creating fake Access Point with a Captive Portal, i use captiveflask proxy for the captive portal proxy, i have configure the interface to wlan0 and when i create the fake Access Point with start command, the wifipumpkin3 successfully create the fake Access Point.\nBut, when i try to connect to the Access Point. It successfully connect to the Access Point without having to redirected to the captive portal page. I have waited for about 1-3 Minutes but the Access Point still didn't redirecting the Users into the captive portal page.\nChipset: RTL8723AE (Supports Monitor Mode)\nOS: Parrot OS\nCan someone help me?"
] | [
"security",
"wifi"
] |
[
"Delete a user together with his posts",
"I have two models - User and Post. User has_many :posts and Post belongs_to :user. I want to delete user's posts automatically when the user is deleted. How can I do this? I am very new to ruby..\n\nclass User < ApplicationRecord\n has_many :posts\nend\n\nclass Post < ApplicationRecord\n belongs_to :user\nend\n\nclass UsersController < ApplicationController\n def destroy\n @user = User.find_by(id:params[:id])\n @user.posts\n @user.destroy\n end\nend\n\n\nI've tried the code above, but still only the user is deleted, not his posts. Thanks in advance!"
] | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-5"
] |
[
"How to fill a rich text editor field for a Codeception Acceptance test",
"I'm trying to fill a rich text editor field (TinyMCE) within my acceptance test in Codeception. \n\nUsing the fillField() function doesn't work as this 'field' isn't really an input field. It's an iframe, styled to look like a fancy textarea.\n\nHow can I set some text into the body of the TinyMCE box? I think I'm looking for the addition of a $I->setContent(xpathOrCSS) function. Or does something else already exist to do this?"
] | [
"ckeditor",
"tinymce",
"rich-text-editor",
"codeception",
"acceptance-testing"
] |
[
"Rails: filling a form out with a name, submitting an ID",
"This is pretty simple, I just can't quite get it. I'm sure there's a rails-way to do it.\n\nWhen creating a new comment, I want the user to be able to enter her name in a field, but have the form submit the matching ID for her name (or toss an error/create new person).\n\nThanks!"
] | [
"ruby-on-rails"
] |
[
"Programming challenges Minesweeper help: How to check for a \"*\" in a 2D string array?",
"I'm trying to write a Minesweeper program for the programming challenges website and I am having trouble detecting if a certain element in the 2D array is a mine and incrementing the surrounding areas.\nHere is my code that checks for a mine in the corners of the array and increments the surrounding areas\n\n public void constructPointers(){\n int counter = 0;\n for(int i = 0; i<row;i++){\n for(int j = 0;j<colm;j++){\n if(minefield[i][j].equals(\"*\")){\n if(i == 0 && j == 0){\n int val = Integer.parseInt(minefield[i+1][j]);\n val++;\n minefield[i+1][j] = \"\" + val;\n\n val = Integer.parseInt(minefield[i][j+1]);\n val++;\n minefield[i][j+1] = \"\" + val;\n val = Integer.parseInt(minefield[i+1][j+1]);\n val++;\n minefield[i+1][j+1] = \"\" + val;\n }\n if(i == minefield.length -1 && j == 0){\n int val = Integer.parseInt(minefield[i-1][j]);\n val++;\n minefield[i-1][j] = \"\" + val;\n val = Integer.parseInt(minefield[i][j+1]);\n val++;\n minefield[i][j+1] = \"\" + val;\n val = Integer.parseInt(minefield[i-1][j+1]);\n val++;\n minefield[i-1][j+1] = \"\" + val;\n }\n if(i == 0 && j == minefield[i].length - 1){\n int val = Integer.parseInt(minefield[i+1][j]);\n val++;\n minefield[i+1][j] = \"\" + val;\n val = Integer.parseInt(minefield[i][j-1]);\n val++;\n minefield[i][j-1] = \"\" + val;\n val = Integer.parseInt(minefield[i+1][j-1]);\n val++;\n minefield[i+1][j-1] = \"\" + val;\n }\n if(i == minefield.length - 1 && j == minefield[i].length -1){\n int val = Integer.parseInt(minefield[i-1][j-1]);\n val++;\n minefield[i-1][j-1] = \"\" + val;\n val = Integer.parseInt(minefield[i-1][j]);\n val++;\n minefield[i-1][j] = \"\" + val;\n val = Integer.parseInt(minefield[i][j-1]);\n val++;\n minefield[i][j-1] = \"\" + val;\n }\n if(i == 0){\n int val = Integer.parseInt(minefield[i+1][j]);\n val++;\n minefield[i+1][j] = \"\" + val;\n val = Integer.parseInt(minefield[i][j+1]);\n val++;\n minefield[i][j+1] = \"\" + val;\n val = Integer.parseInt(minefield[i+1][j+1]);\n val++;\n minefield[i+1][j+1] = \"\" + val;\n }\n }\n\n\nif I inputed:\n\n*.*\n...\n*.*\n\n\nThis code will output:\n\n* 2 *\n2 4 2\n* 2 *\n\n\nMy question is: How can I get my code to \"skip\" adjacent mines and increment the surrounding areas?\nIf I inputed\n\n*.*\n*..\n*.*\n\n\nI want it to output:\n\n * 3 *\n * 5 2\n * 3 *\n\n\nEDIT: All of you had great answers, but I picked the top answer because it solved alot of other problems I was having which I did not mention. Thank you all for your help!"
] | [
"java",
"matrix",
"multidimensional-array",
"arrays",
"minesweeper"
] |
[
"Collections: ConcurrentModificationException",
"Why am I getting this ConcurrentModificationException in the following code?\n\npublic static ArrayList<ArrayList<String>> buildPath(String s, String e, HashMap<String, ArrayList<String>> visited) {\n ArrayList<ArrayList<String>> ret = new ArrayList<ArrayList<String>>();\n ArrayList<ArrayList<String>> temp = new ArrayList<ArrayList<String>>();\n ArrayList<String> tmp = new ArrayList<String>();\n tmp.add(e);\n ret.add(tmp);\n boolean needStop = false;\n while (true) {\n for (ArrayList<String> al : ret) { //concurrent exception\n ArrayList<String> pre_words = visited.get(al.get(al.size() - 1));\n for (String pre_word : pre_words) {\n if (pre_word.compareTo(s) == 0) {\n needStop = true;\n }\n if (needStop && pre_word.compareTo(s) != 0) {\n continue;\n }\n ArrayList<String> toadd = new ArrayList<String>(al);\n toadd.add(pre_word);\n temp.add(toadd);\n\n }\n }\n ret = temp;\n if (needStop) {\n for (ArrayList<String> l : ret) {\n Collections.reverse(l);\n }\n return ret;\n }\n }\n}\n\n\nIf I make the following change the program runs correctly:\n\nFrom:\n\nfor(ArrayList<String> al : ret) {\n\n\nto:\n\nfor(int i =0; i <ret.size() ; i++) {\n ArrayList<String> al = ret.get(i);"
] | [
"java"
] |
[
"Is it possible to deploy python service on iis?",
"I have simple python service which is working fine. And i want to deploy it on IIS. Is it possible? If yes then how?\nFollowing is code of my service.\nTestService.py\n\nimport web\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse('user_data.xml')\nroot = tree.getroot()\n\nurls = (\n '/users', 'list_users',\n '/users/(.*)', 'get_user'\n)\n\napp = web.application(urls, globals())\n\nclass list_users: \n def GET(self):\n output = 'users:[';\n for child in root:\n print 'child', child.tag, child.attrib\n output += str(child.attrib) + ','\n output += ']';\n return output\n\nclass get_user:\n def GET(self, user):\n for child in root:\n if child.attrib['id'] == user:\n return str(child.attrib)\n\nif __name__ == \"__main__\":\n app.run()\n\n\nAnd user_data.xml\n\n<users>\n <user id=\"10\" name=\"Rocky\" age=\"38\"/>\n <user id=\"20\" name=\"Steve\" age=\"50\"/>\n <user id=\"30\" name=\"Melinda\" age=\"38\"/>\n</users>\n\n\ni have read this post Python on IIS: how? but it is not working for me."
] | [
"python",
"iis",
"web.py"
] |
[
"How to print part of a tokenized string from a file in C",
"I am having some trouble with a tokenized string that is a line from a file. I want to print the line from where the token is found, but I cannot seem to find a way around it. Please, ignore the output to the file part as well as the author, class and method if statements as I have them sorted out.\nFor example, I want it to print from this line: @return the matric only this part: the matric\nCode:\n#include <stdio.h>\n#include <string.h>\n\nint main (int argc, char **argv)\n{\n char line [1000];\n char *delimeters = ".,; \\t\\n";\n int total_lines = 0;\n int total_comments = 0;\n int nonblank_lines = 0;\n\n FILE *input = fopen (argv[2], "r");\n FILE *output = fopen (argv[4],"w");\n \n while(fgets(line,1000,input) != NULL)\n {\n char *word = strtok(line, delimeters);\n total_lines++;\n \n if(word != NULL)\n {\n nonblank_lines++;\n }\n \n if(word != NULL && strcmp(word,"/**") == 0)\n {\n total_comments++;\n }\n \n while(word != NULL)\n {\n if(word != NULL && strcmp(word,"@author") == 0)\n {\n char *author_name = strtok(NULL, delimeters);\n char *author_surname = strtok(NULL, delimeters);\n printf ("Author: %s %s\\n", author_name, author_surname);\n }\n \n if(word != NULL && strcmp(word,"public") == 0)\n {\n char *jmp = strtok(NULL, delimeters);\n \n if(jmp != NULL && strcmp(jmp,"class") == 0)\n {\n char *class_name = strtok(NULL, delimeters);\n printf ("Class %s\\n", class_name);\n }else{\n char *method_name = strtok(NULL, delimeters);\n printf ("Method %s\\n", method_name);\n }\n }\n \n if(word != NULL && strcmp(word,"@return") == 0)\n {\n printf("Enters IF 4\\n");\n \n char *return_value = strtok(NULL, delimeters);\n \n printf ("Returns: %s\\n", return_value;\n }\n \n /*if(word != NULL && strcmp(word,"@param") == 0)\n { \n printf("Enters IF 5\\n");\n char *parameters = strtok(NULL, delimeters);\n printf("Parameter: %s\\n", parameters);\n \n //int param_found\n \n }*/\n word = strtok(NULL, delimeters);\n }\n }\n \n printf ("The total number of lines is %d\\n", total_lines);\n printf ("The total number of non-blank lines is %d\\n", nonblank_lines);\n printf ("The total number of comments is %d\\n", total_comments);\n \n fclose(input);\n fclose(output);\n return 0;\n}"
] | [
"c",
"string",
"printing",
"token"
] |
[
"Does TFS interface with MS Project stand-alone instead of Project Server?",
"Does TFS 2013 interface with MS Project stand-alone version instead of Project Server?"
] | [
"tfs"
] |
[
"Finding duplicate numbers in an array of numbers",
"I was asked about this during an interview, given a list of numbers, return only the duplicates present in the input as sorted output.\n\nExample: \n\nInput = [6, 7, 5, 6, 1, 0, 1, 0, 5, 3, 2]\nOutput = [0, 1, 5, 6] - sorted unique numbers which are duplicates in input\n\n\nI have come up with the below solution:\n\nApproach1:\n\npublic static List<Integer> process(List<Integer> input) {\n List<Integer> result = new ArrayList<>();\n Map<Integer, Integer> map = new HashMap<>();\n for (int val : input) {\n map.put(val, map.getOrDefault(val, 0) + 1);\n }\n\n map.forEach((key, val) -> {\n if (val > 1) {\n result.add(key);\n }\n });\n result.sort(null);\n return result;\n}\n\n\nUpdated Approach2:\n\npublic static List<Integer> process1(List<Integer> input) {\n Set<Integer> dups = new HashSet<>();\n Set<Integer> set = new HashSet<>();\n for (int val : input) {\n if (set.contains(val)) {\n dups.add(val);\n } else {\n set.add(val);\n }\n }\n List<Integer> result = new ArrayList<>(dups);\n result.sort(null);\n return result;\n}\n\n\nOld Approach2\n\npublic static List<Integer> process1(List<Integer> input) {\n List<Integer> result = new ArrayList<>();\n Set<Integer> set = new HashSet<>();\n for (int val : input) {\n if (set.contains(val)) {\n result.add(val);\n } else {\n set.add(val);\n }\n }\n result.sort(null);\n return result;\n}\n\n\nApproach1 time complexity is (n)Log(n) as sorting in java is nlogn, space complexity is n\n\nApproach2 time complexity is (n)Log(n) again as sorting in java is nlogn, space complexity is little less as compared to Approach 1, as I hold elements only once in my set.\n\nPlease correct me if I am wrong in finding out time and space complexities.\n\nNow the question is whether this logic works if the input contains million of numbers or not? Whether HashMap works if input is million of numbers?\n\nAs per my understanding generally, the time complexity for map or set is less, also HashSet internal implementation uses HashMap. How to answer this question."
] | [
"java"
] |
[
"How to put a if statement to link to another page if a sql result variable is set",
"I am trying to redirect a user to another page if the CHPassword column is \"yes\"\n Currently if there user name and pass is valid I send them to dashboard.php if it is not I send them to index.php. Now I'm trying to check the database and if the CHPassword is yes. force them to change their password. (redirect to another page. Otherwise let them proceed to the dashboard. Here is the code currently. \n\n // SQL query to fetch information of registerd users and finds user match.\n$sql = \"SELECT * FROM Employee where Password='$EPassword' AND UserName='$UserName'\";\n $result = mysqli_query($con, $sql) or die(mysqli_error($con));\n $User = mysqli_fetch_array($result);\n$row = mysqli_num_rows($result);\nif ($row == 1) \n{\n$_SESSION[\"FName\"] = $User['FName'];\n$_SESSION[\"LName\"] = $User['LName'];\n$_SESSION[\"AccessLvl\"] = $User['AccessLvl']; // Initializing Session header\n\nheader(\"location: Dashboard.php\");\n}\nelse\n{\n$_SESSION[\"error\"] = \"UserName Or Password is Incorrect. Please try Again\";\nheader(\"location: index.php\"); // Redirecting To Other Page\n\n}\nmysqli_close($con); // Closing Connection\n}\n}\n\n\nAll help would be great. Sorry guys still learning. Thanks in advance."
] | [
"php"
] |
[
"Create tab dynamically after some div in first tabs",
"Create tab dynamically after showing 20 div in first tab.Actually I am generating a div dynamically,there may be 100 div generated dynamically.I want to show 20 div in one tab and if there are 100 div there it will automatically generate 5 tabs with 20 div in each tabs.\n\n<div id=\"TabbedPanels1\" class=\"TabbedPanels\">\n <ul class=\"TabbedPanelsTabGroup\">\n <li class=\"TabbedPanelsTab\" tabindex=\"0\">tab1</li>\n <li class=\"TabbedPanelsTab\" tabindex=\"0\">tab2</li>\n\n </ul>\n <div class=\"TabbedPanelsContentGroup\">\n\n <div class=\"TabbedPanelsContent\">\n <div id=\"slider1\" class=\"sliderwrapper\"> \n <div class=\"contentdiv\"> \n12345 \n</div>\n<div class=\"contentdiv\"> \n12345 \n</div>\n</div>\n<div id=\"paginate-slider1\" class=\"pagination\"> \n\n</div>\n<div id=\"paginate1-slider1\" class=\"pagination2\">\n\n</div> \n </div>\n\n </div>\n </div>"
] | [
"c#",
"javascript",
"jquery",
"asp.net",
"jquery-ui"
] |
[
"How to inspect two golang functions' invoke relations?",
"I am working on a code static analysis, and I have a challenge now. For example I have two go source file.\n\na.go\n\npackage test1\nfunc Func1() {\n test2.Func2()\n fmt.println(\"func1\")\n}\n\n\nb.go\n\npackage test2\nfunc Func2() {\n fmt.println(\"func2\")\n}\n\n\nHow to check if func1 ast node has invoke relation with func2 ast node in Golang?"
] | [
"go",
"abstract-syntax-tree"
] |
[
"How can I connect to database from Arduino?",
"I want to transfer the data from the database to Arduino. For this, I am using MYSQL_Connector library in Arduino. But I'm getting error like this: \"Connection Failed\". I cannot connect to database. Also, I'm using XAMPP server.\n\nI checked MYSQL server's IP address, port and username-password. \n\n#include <SPI.h>\n#include <Ethernet.h>\n#include <MySQL_Connection.h>\n#include <MySQL_Cursor.h>\n\nbyte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };\n\nIPAddress server_addr(x,x,x,x); // the IP address to that of the system on which my MySQL server is set up\nchar user[] = \"user\"; // MySQL user login username\nchar password[] = \"1234\"; // MySQL user login password\n\n\n// Sample query\nchar query[] = \"SELECT id FROM world.city\";\n\nEthernetClient client;\nMySQL_Connection conn((Client *)&client);\n\nvoid setup() {\n Serial.begin(9600);\n while (!Serial); // wait for serial port to connect\n Ethernet.begin(mac_addr);\n Serial.println(\"Connecting...\");\n if (conn.connect(server_addr, 8080, user, password)) {\n delay(1000);\n }\n else\n Serial.println(\"Connection failed.\");\n}"
] | [
"mysql",
"arduino",
"ethernet"
] |
[
"Clicking on the link using html unit return the same page and then become deadlock condition in java",
"I have recently read that through html unit we can simulate pages.\n\nI have similar requirement for my thesis. I have to fetch all the comments of particular link into my database. I'm currently working on Yahoo news.\n\nLet say I am using \"http://news.yahoo.com/yemen-says-regional-al-qaedas-deputy-head-dead-184541137.html\" link.\nThere are currently 125 comments in that link. 10 displays when I open the page to see more comment I have to press \"More\" link, then ajax request goes into server and displays 10 more comments. Now I'm using following code to fetch all the comments. \n\n String google = \"http://news.yahoo.com/yemen-says-regional-al-qaedas-deputy- head-dead-184541137.html\";\n\n\n WebClient webClient = new WebClient();\n HtmlPage page1 = webClient.getPage(google);\n HtmlAnchor advancedSearchAn = (HtmlAnchor)page1.getElementById(\"ugccmt-view-more\");\n\n\n while(true){\n if(advancedSearchAn == null){\n String text = page1.asText();\n System.out.println(text);\n break;\n }\n page1 = advancedSearchAn.click();\n advancedSearchAn = (HtmlAnchor)page1.getElementById(\"ugccmt-view-more\");\n\n\nCan any one suggest me what I am doing wrong in this code, because It just give me same page with first 10 comments."
] | [
"java",
"htmlunit"
] |
[
"Getting wrong number of rows after dropping row in Pandas Dataframe",
"After I drop a specific row in a Pandas dataframe with:\ndf = df.drop([rowNumber]) I no longer can get the correct number of rows with len(df.index).\nI have tried resetting the index with both df = df.reset_index(drop=True) and df.index = range(len(df)). When I go to debug the program, the index definitely is the correct length, but when using len(df.index) it will give me a higher number than the actual dataframe. What is causing this? How can I solve it? Or is there a better way of determining number of rows in a dataframe?"
] | [
"python",
"pandas"
] |
[
"Wrap text in Use case in Microsoft Visio",
"I am making a use case diagram, and the problem is:\n\nI type some text and it is always display in one line, making my use case elipse too big. Does anyone know how to make it go to the next line? I think this option is called wrap text in StarUML...\n\nThank you in advance!\n\nNanek"
] | [
"visio"
] |
[
"Web-connected scheduler BlackBerry Application",
"I want to create an blackberry application that acts as a scheduler, which scheduled time can be updated via a website (not only from the app itself) as well. I am thinking of using a .txt file from a website that contains the String of the time, then let the app connects to the file every time it is started or refreshed. The app will also upload back the file to the web site every time a change is saved. Do you guys have any other ideas? Thank you"
] | [
"blackberry",
"java-me"
] |
[
"Error when trying to import SAS7BDAT file",
"I have a file in sas7bdat format thats 132mb large. I don't have SAS on my computer, i received this file from another statistician. \n\nI try to import the sas7bdat file using the sas7bdat package and the read.sas7bdat function which has worked for me previously. \n\nThis is the import code:\n\nbiostat <- read.sas7bdat(file=\"/Users/Phil/Desktop/Work/Study/infwork.sas7bdat\")\n\n\nWhen I do this i receive this error\n\nError in read.sas7bdat(file=\"/Users/Phil/Desktop/Work/Study/infwork.sas7bdat\") : \n file contains compressed data\n\n\nI haven't been able to figure out why i receive this error and according to some sources this can only be fixed in SAS using compress=NO or compress=binary to compress the file and then import it to R, the problem is I don't have SAS, is their a way around this problem?\n\nAll help i appreciated!"
] | [
"r",
"import",
"error-handling",
"sas",
"compression"
] |
[
"PhpStorm navigate to file by string value",
"I have a variable with file path like:\n\n$file = '/some/file.txt';\n\n\nor\n\nvar file = '/some/file.txt'\n\n\nTo edit file.txt I:\n\n\nLeft click on string.\nDo Extend Selection shortcut.\nDo Navigate File... shortcut.\n\n\nCan I do it faster? For example, by clicking on '/some/file.txt' with some modifier key."
] | [
"phpstorm"
] |
[
"How to maintain/preserve Custom Email Headers(X-header) when replying",
"i am using following code to send an email from my .NET application ,here i have added custom header X-Company.\nWhen the email is received i get this custom header properly but whenever i reply/forward this mail Custom Headers not getting back.\n\nMailMessage message = new MailMessage(From, To); \n message.Headers.Add(\"X-Company\",\"xyz\"); \n message.Body = emailMessage.ToString();\n message.Subject = Subject; \n message.IsBodyHtml = true; \n smtp.Send(message);"
] | [
"c#",
"asp.net",
".net",
"smtp",
"pop3"
] |
[
"PhoneGap Take picture and set FILE_URI as value of input",
"I have a phoneGap app that takes a picture and sets the value of a file input to the FILE_URI taken from the onCameraSuccess of getPicture.\n\nWhen I alert the value of the file input, I get file:// .. . \nThat means setting the value of the input file was successful.\n\nbut when PHP on a server recieves the form, the file input is empty.\nI tried echoing $_FILES[\"Customer_image\"][\"name\"] but it's empty.\n\nDid I miss something?\nis that allowed?"
] | [
"jquery",
"jquery-mobile",
"cordova"
] |
[
"Undeclared Identifier 'webview'",
"I am building a tab bar application with a different pdf in each tab. I have two sets of view controllers. Each have this relative code\n\n#import \"SecondViewController.h\"\n\n@interface SecondViewController ()\n\n@end\n\n@implementation SecondViewController\n\n- (void)viewDidLoad\n{\n [super viewDidLoad];\n NSString *path = [[NSBundle mainBundle] pathForResource:@\"Winter_Newsletter\"\n ofType:@\"pdf\"];\n NSURL *url = [NSURL fileURLWithPath:path];\n NSURLRequest *request = [NSURLRequest requestWithURL:url];\n [webView loadRequest:request];\n [webview setScalesPageToFit:YES]; \n}\n\n- (void)didReceiveMemoryWarning\n{\n [super didReceiveMemoryWarning];\n // Dispose of any resources that can be recreated.\n}\n\n@end\n\n\nI keep receiving an error \"undeclared identifier 'web view'\" What am I doing Wrong?"
] | [
"ios",
"objective-c",
"uikit"
] |
[
"Git Bash bash: open: command not found",
"I'm new to Git Bash, just freshly downloaded this for use in my class today, on the first class module it ask me to cd in to different directory and ls the content which works perfectly fine in Git Bash, then it ask me to open a README.md file in a folder with the command:\n\nopen README.md\n\nthen this error message show up:\n\nbash: open: command not found\n\nI know I cd in to the correct folder, and ls does shows the the README.md file, this is a freshly installed and most updated Git Bash, can't imagine there would be a missing link or altered in this program... what can I do? please help thank you! \n\nI'm using Windows 8 with Git for windows"
] | [
"git",
"bash",
"git-bash"
] |
[
"EF Code First model referencing an existing model",
"I have an existing entity, called Person. The Person entity has an ID. A Person can exsist on it's own.\n\nIn a new application, I am creating an entity called Dog. The database model for this new entity is created using EF code first. \nI now want to add the rule that a Dog Must have an owner, Person. \nA Person can have many Dogs.\n\nI have generated the edmx to have a PersonContext available in my application.\n\nI now want to make the correct reference between the 2 entities.\n\npublic class DogContext : DbContext\n{\n public DogContext()\n : base(\"DefaultConnection\")\n {\n }\n\n public DbSet<Dog> Dogs { get; set; }\n\n protected override void OnModelCreating(DbModelBuilder modelBuilder)\n {\n //one-to-many \n modelBuilder.Entity<Person>().HasMany<Dog>(p => p.Dogs).WithRequired(d => d.Person).HasForeignKey(u => u.DogId);\n base.OnModelCreating(modelBuilder);\n }\n}\n\n\n[Table(\"Dog\")]\npublic class Dog\n{\n [Key]\n [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]\n public int DogId{ get; set; }\n public string Name{ get; set; }\n\n public int PersonId { get; set; }\n\n public virtual Person Person { get; set; }\n}\n\n\nThe Person class is generated in the .edmx file and has no knownledge of which dogs he owns at the moment.\nThe important thing right now is the Dog having an owner, being a Person.\n\nWith this setup I get the error: \n\n\n EntityType 'Person' has no key defined. Define the key for\n this EntityType. Person: EntityType: EntitySet\n 'Person' is based on type 'Person' that has no keys\n defined.\n\n\nI guess this is EF code first throwing an error.\n\nQuestion:\nHow can I specify the Key on Person while keeping code first from also creating this in the db model?\n\nthanks"
] | [
"c#",
"entity-framework",
"ef-code-first",
"edmx"
] |
[
"DASK: Replace infinite (inf) values in single column",
"I have a dask dataframe in which I have a few inf values appearing. I wish to areplace these on a per column basis, because where inf exists I can replace with a value that is appropriate to the upper bounds that can be expected from that column.\nI'm having some trouble understanding the documentation, or rather translating it into something I can use to replace infinite values.\nWhat I have been trying is roughly around the below, replacing inf with 1000 - however the inf value seems to remain in place, unchanged.\nAny advice on how to do this would be excellent. Because this is a huge dataframe (10m rows, 40 cols) I'd prefer to do it in a fashion that doesn't use lamba or loops- which the below should basically achieve, but doesn't.\nddf['mycolumn'].replace(np.inf,1000)"
] | [
"python",
"dataframe",
"dask"
] |
[
"unable to use facebook sdk in android",
"i am developing an android appllication in which i am trying to integrate facebook login. But when I run my application it just crashes showing \"unexpected error\".\n\nI see the following error in login.xml file. The facebook login button is the cause of error in the logcat:\n\n <com.facebook.widget.LoginButton\n android:id=\"@+id/authButton\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center_horizontal\"\n android:layout_marginTop=\"30dp\"\n\n\nMoreover I see the below error in login.xml file:\n\nThe following classes could not be instantiated:\n- com.facebook.widget.LoginButton (Open Class, Show Error Log)\nSee the Error Log (Window > Show View) for more details.\nTip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse\n\njava.lang.ClassNotFoundException: com.facebook.android.R$color\n at java.net.URLClassLoader$1.run( at java.net.URLClassLoader$1.run( at java.security.AccessController.doPrivileged( at java.net.URLClassLoader.findClass( at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at com.facebook.widget.LoginButton.<init>(LoginButton.java:237)\n at sun.reflect.NativeConstructorAccessorImpl.newInstance0( at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:442)\n at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:194)\n at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)\n at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)\n at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)\n at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)\n at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)\n at android.view.LayoutInflater.inflate(LayoutInflater.java:492)\n at android.view.LayoutInflater.inflate(LayoutInflater.java:373)"
] | [
"java",
"android",
"eclipse",
"facebook"
] |
[
"CSS justify Text in Table",
"it is a question which has been asked already a few times, but none of the answers seem to work for me.\n\nI have a table, in each Datarow I have with a placeholder for a radiobutton and a text.\nAll the lines should be text-align. justify. because it is a story, all the lines should end at the same width.\nI tried to use td:first-child like you see it below, and also to use class: line. Somehow the table structure seems to override the justify statement. \n\nHelp is as always appreciated\n\n\r\n\r\ntd:first-child {\r\n font-size: 20px;\r\n hyphens: auto;\r\n text-align: justify\r\n}\r\n<h1 style=\"text-align: center; font-size: 24px\">Header</h1>\r\n<table>\r\n <tr>\r\n <td class=\"line\">%SM02_01a% I had heard about her sister ship. It was called the “Titanic” and she had </td>\r\n </tr>\r\n <tr>\r\n <td class=\"line\">%SM02_02a% sunken last year. That was it what let me feel fear, although they also promised that this ship </td>\r\n </tr>\r\n <tr>\r\n <td class=\"line\">%SM02_03a% the “Olympic”, was even safer than her sunken predecessor</td>\r\n </tr>\r\n</table>"
] | [
"css"
] |
[
"Why does this .every() function return true and then false?",
"let nums = [-1, 50, 75, 200, 350, 525, 1000];\n\nnums.every(function(num) {\n console.log(num < 0);\n});\n\n\ntrue\n\n=> false\n\n\n\nWhen I run this code in https://repl.it/@super8989/BraveFunctionalSale, this returns \"true\" then \"=> false\". \n\nAccording to .every() description, the return value is \"true if the callback function returns a truthy value for every array element; otherwise, false.\"\n\nWhy does it show \"true\" and then \"=> false\"?\n\n\n\nFurthermore, when I change the array so that \"- value\" is in the middle of the array, it returns \"false\" then \"=> false\".\n\nlet nums = [1, 50, -75, 200, 350, 525, 1000];\n\nnums.every(function(num) {\n console.log(num < 0);\n});\n\n\nfalse\n\n=> false\n\nhttps://repl.it/@super8989/CyberInterestingPhase\n\n\n\nlet nums = [-1, 50, 75, 200, 350, 525, 1000];\n\nconsole.log(nums.every(num => num < 0));\n\n\nfalse\n\n=> undefined\n\nBut if I write it this way, this returns false then undefined.\nhttps://repl.it/@super8989/MonstrousAjarDimension\n\n\n\nI'm very confused... Please help!"
] | [
"javascript",
"arrays",
"iterator"
] |
[
"Error in the R.Java file",
"I tried to run some code and in doing so, the following file opened up when I clicked on the play button: R.java\n\nThis is a screenshot of the error:\n\n\n\nAs you can see on the left hand side, the clas \"EditStock\" has no space, but in the R.Java file it does. I'm not sure why and I'm not sure how to fix it.\n\nI've tried to clean and rebuild the project but to no avail.\n\nCan someone please help me with this?"
] | [
"java",
"android"
] |
[
"Add (second) x axis to scatterplot to display group information",
"I make a scatterplot using d3.js where the points are arranged by their name and an accompanying number. \nThe data that is plotted would look like this:\n\nname, group, number\n\"AB\", \"A\", 0.5\n\"ABC\", \"A\", 10.0\n\"BC\", \"B\", 3.0\n\"BCD\", \"B\", 5.0\n\"BCDE\", \"B\", 0.3\n\"CD\", \"C\", 1.6\n\"DE\", \"D\", 1.5\n\n\n\n\nWhat I want to achieve.\n\nWhat I want to achieve is a plot where the points are scattered on the x axis according to their name, but the x axis should display the group once per group and a tick between different groups.\n\nThe result should look like this:\n\n\n\n\nWhat I have so far.\n\nI do have a y and an x axis, the ticks and labels are not shown. In principle, the axes are created using the code below (example for the x axis):\n\nvar x = d3.scale.ordinal()\n .rangeBands([0, 400]);\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\")\n .tickValues(0) // hide ticks\n .tickFormat(\"\"); // hide labels\n\n\nThe domain is derived from the name column:\n\nx.domain(data.map(function(d) { return d.name; })); \n\n\nAnd appended to to actual svg:\n\nsvg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + 400 + \")\")\n .call(xAxis)\n\n\nThis code results in the following plot:\n\n\n\n\nWhat I tried.\n\nI tried with adding a second x axis by simply repeating the steps that were used to create the first x axis described above. I just renamed x to x2, made ticks and labels visible, and derived the domain not from d.name but from d.group. The complete code is here. Naturally, this distributes the labels and ticks along the whole x axis and does not incorporate the group information.\n\n\n\n\nQuestion.\n\nHow can I scatter the labels and ticks of the x axis according to the group column from the data?"
] | [
"d3.js",
"plot",
"axis-labels",
"axes",
"multiple-axes"
] |
[
"How do I convert my entire div data into image and save it into directory without using canvas?",
"i have already created my data (template-containing image,text,label etc) inside div now i want to convert it into image format. is there any technique to convert a specific div content into images without using canvas.anybody plz help me !\ni want to convert entire \"mydiv\" content into image and save that image into my image directory, when i click on save ? \n\n<html>\n <header>\n </header>\n <body>\n <label> Template Design</label>\n <div id=\"mydiv\">\n <label> Good Morning</label>\n <img src=\"mug.png\" id=\"img1\" height=\"100\" width=\"100\" />\n </div>\n <input name=\"save\" type=\"button\" value=\"SAVE\" />\n </body>\n</html>"
] | [
"php",
"javascript",
"jquery",
"html",
"css"
] |
[
"android's api not working",
"i created a register service for my android app\nthe android side is working correct(i guess) and returns \"failed\"\nthis is my PHP code:\n\n$json = file_get_contents('php://input');\n$User = json_decode($json);\n\nfunction ConnectDatabase()\n{\n $connect = mysqli_connect(\"localhost\", \"root\", \"\", \"my_db\");\n mysqli_set_charset($connect, \"utf8\");\n return ConnectDatabase();\n}\n\n$username = $User->user;\n$password = $User->pass;\n\nfunction AddUser($user, $pass)\n{\n $connect = ConnectDatabase();\n if (!(trim($user) == \"\" || trim($pass) == \"\"))\n {\n $check = mysqli_query($connect, \"select count(*) from usertable where Username='$user'\");\n $row = mysqli_fetch_array($check);\n if ($row[0] > 0)\n {\n return \"usernameTaken\";\n\n }\n else\n {\n $SQL = \"INSERT INTO usertable(Username,Password) VALUES ('$user','$pass')\";\n $query = mysqli_query($connect, $SQL);\n if ($query != \"\")\n {\n return \"ok\";\n }\n else\n {\n return \"failed\";\n }\n }\n }\n else\n {\n return \"badUsernameOrPassword\";\n }\n}\n\n$status = AddUser($username, $password);\necho json_encode([\"status\"=>$status]);\n\n\nchecked the uri and its correct...you guys see any mistake?\nThanks."
] | [
"php",
"android"
] |
[
"Removing 'default' annotation on storageclass AKS does not persist",
"I'm trying to set a new default storage class in our Azure Kubernetes Service. (1.15.10). I've tried a few things but the behavior is strange to me. \n\nI've created a new storage class custom, set it to be the default storage class and then I remove the is-default-class from the default storageclass. \n\ndefault-storage-class.yml:\n\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n name: custom\nparameters:\n cachingmode: ReadOnly\n kind: Managed\n storageaccounttype: Standard_LRS\nprovisioner: kubernetes.io/azure-disk\nreclaimPolicy: Delete\nvolumeBindingMode: Immediate\n\n\nand the commands:\n\n# create new storage class \"custom\"\nkubectl apply -f ./default-storage-class.yml\n# set storageclass as new default\nkubectl patch storageclass custom -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'\n# remove default storage class from default\nkubectl patch storageclass default -p '{\"metadata\": {\"annotations\":{\"storageclass.beta.kubernetes.io/is-default-class\":\"false\"}}}'\n\n\nAt first, it seems to be working fine: \n\n$kubectl get sc\ncustom (default) kubernetes.io/azure-disk 6d23h\ndefault kubernetes.io/azure-disk 14m\n\n\nBut within a minute, without changing anything: \n\n$kubectl get sc\ncustom (default) kubernetes.io/azure-disk 6d23h\ndefault (default) kubernetes.io/azure-disk 16m\n\n\nI'm probably missing something here, but no idea what. \n\nIf I do a kubectl describe sc default in the minute it hasn't changed back : \n\nstorageclass.beta.kubernetes.io/is-default-class=false,storageclass.kubernetes.io/is-default-class=false\n\n\nAnd a moment later: \n\nstorageclass.beta.kubernetes.io/is-default-class=true,storageclass.kubernetes.io/is-default-class=false"
] | [
"azure",
"kubernetes"
] |
[
"how can i pause the previous sound clip on click on other sound clip?",
"in my code I have 2 sounds. I would like to know how do i pause the sounds if click on other sounds.\nI am very new to android programming,and I really appreciate your help.\n\n{\n\n final MediaPlayer mp2 = MediaPlayer.create(this, R.raw.okay);\n Button zero = (Button)this.findViewById(R.id.button4);\n zero.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n mp2.start();\n\n\n }\n });\n }\n\n {\n\n final MediaPlayer mp1 = MediaPlayer.create(this, R.raw.mine);\n\n Button zero = (Button)this.findViewById(R.id.button40);\n zero.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n mp1.start();"
] | [
"android",
"media-player"
] |
[
"How to create Backup Batch file that copys only modified files & delete the dest files/folders that do not exist in the source?",
"I want to create a backup Batch file that meets these requirements:\n\nRequirement:\n\n\n1-Only copy the source files if the source file got modified.\n\n2-If the destination contains the files/folders that do not exist in the source, then the destination files/folders will be deleted.\n\n3-Copies all subdirectories, even if they are empty.\n\n4-If something happened that make the coping process uncompleted (ie copied unsuccessfully), the program will revert & keep the old version of the destination folder.\n\n5-The batch file should run at the time i turn off my PC or at 7pm Daily.\n\n\nSo, i tried this\n\nxcopy C:\\MyProject N:\\backup\\MyProject /V /Y /E /D\n\n\nNote: /v=Verify, /y=No prompting /e=subdirs /d=Copy only changed\n\nHowever, after running the batch, it did not delete the files/folders mentioned in requirement 2. Also, i don't know how to do the requirement 4 & 5.\n\nI searched many questions but seem they didn't have the code to meet requirement 2 & 4 & 5.\n\nI don't want to use backup tool in Win7 since it is very heavy & it requires a big backup disk space. I prefer something simple (why didn't Window make things simple?? ).\n\nBackup is very important when u do the project, I hope my question will help a lot of other programmers.\n\nCan anyone know a good solution for this?"
] | [
"batch-file",
"window",
"backup",
"batch-processing"
] |
[
"Maximum recursion depth exceeded on simple loop",
"I am trying to create a pretty straight forward loop that sorts through about 900 nested dictionaries and returns all of the values in lists named after the keys. I am getting the following recursion error though:\n Traceback (most recent call last):\n File "<stdin>", line 4, in <module>\n File "<stdin>", line 4, in myprint\n File "<stdin>", line 4, in myprint\n File "<stdin>", line 4, in myprint\n [Previous line repeated 995 more times]\n File "<stdin>", line 2, in myprint\nRecursionError: maximum recursion depth exceeded while calling a Python object\n\nHere's the code I'm currently using:\nimport pandas as pd\ndf = pd.read_csv("/Users/--/--/--/--/--/.csv")\ndef myprint(d):\n for k, v in data.items():\n if isinstance(v, dict):\n myprint(v)\n else:\n print("{0} : {1}".format(k, v))\n setattr(sys.modules[__name__], k, [v])\n \n \nfor i in df['file_num']:\n with open("/Users/--/--/--/--/allDAFs{}.json".format(i)) as f:\n data=json.load(f)\n myprint(data)\n\nI would greatly appreciate any potential insight into how this can be fixed or worked around. Thank you."
] | [
"python",
"pandas",
"loops",
"recursion"
] |
[
"Get selected phone number from contacts list without READ_CONTACTS permission",
"In my app I want give user possibility to fill text form with phone number by manually typing it or selecting phone number from contacts list. One thing I don't understand is why I should set READ_CONTACTS permission if user select contact by himself.I am using code listed below:\n\n\nTo start Contacts activity:\n\nIntent pickContactIntent = new Intent(Intent.ACTION_PICK,\n ContactsContract.Contacts.CONTENT_URI);\npickContactIntent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_TYPE);\nstartActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST_CODE);\n\nTo process Intent data from onActivityResult:\n\nUri uri = data.getData();\nif (uri != null) {\n Cursor c = null;\n try {\n c = getContentResolver()\n .query(\n uri,\n new String[] { ContactsContract.CommonDataKinds.Phone.NUMBER,\n ContactsContract.CommonDataKinds.Phone.TYPE }, null, null,\n null);\n\n if (c != null && c.moveToFirst()) {\n String number = c.getString(0);\n int type = c.getInt(1);\n showSelectedNumber(type, number);\n }\n } finally {\n if (c != null) {\n c.close();\n }\n }\n}\n\n\n\nAnd as I understand getContentResolver().query() requires READ_CONTACTS permission to obtain phone number.\n\nMy question: is it possible somehow to process Intent that come in onActivityResult without READ_CONTACTS?"
] | [
"android",
"android-intent",
"android-contacts",
"android-permissions"
] |
[
"how can i use methods of that class such as getFormView(), processFormSubmission(... , ... , ... , ...) when rewriting my controllers?",
"can any one suggest any documentations on how to re-write SimpleFormController sub-classes to use annotated controllers instead, like how can i use methods of that class such as getFormView(), processFormSubmission(HttpServletRequest request, HttpServletResponse response, Object object,\n BindException errors) when rewriting my controllers?\n\nThe need to rewrite these classes come as a result of the need to upgrade to the recent versions of Spring like 4.1.4"
] | [
"java",
"spring"
] |
[
"jQuery Mobile and MVVM challenges",
"I am having some challenges trying to use JQM and MVVM. I am also trying to use knockout.js too.\n\nFor example, currently I am trying to implement a navigation similar to the iOS page control(the little dots indicating you can swipe to navigate to the next page):\n\n\n\nThe data to be displayed is fetched from the server and it needs to be displayed in JQM pages. So the JQM pages need to be created dynamically.\n\nFrom the UI perspective, I plan to use a fixed footer containing the dots(based on the number of pages).\n\nThe problem is with the view-model which needs to persist between the JQM pages, as I do not want to load data from the server by page, data is loaded at once and it is expected that the client will display it in pages.\n\nI could have a view-model holding the data and living through-out the life of the application and just bind each page view to it.\nInstead, I want to keep the view-model alive as long as it's really required by the view.\n\nThe solution I am thinking is to catch jQueryMobile page navigation events and see if the navigation is between these pages.\nIf it's not, the view-model should be removed(assigning it to null).\nNext time if any of these pages needs to be loaded(for example by navigating back to the last page), the view model is re-created(data is fetched from web-site again).\n\nIs there a better approach?"
] | [
"jquery-mobile",
"mvvm",
"knockout.js",
"knockout-2.0"
] |
[
"URL mod rewriting response 500 Internal Server Error",
"I'm trying to rewrite my site URL, This gives me the error \"500 Internal Server Error\".\nThis is my code\n\nRewriteEngine On\nRewriteRule ^index$ /index.php [L]\nRewriteRule ^([^/]*)$ /index.php?shopiId=5&shopName=$1 [L]\n\n\nPlease help."
] | [
"php",
".htaccess",
"mod-rewrite",
"url-rewriting"
] |
[
"Hide scrollbar when not necessary, but keep the screen width consistent",
"On pretty much any web browsers, the scroll bar is displayed only when it is needed. This is fine, but the problem is that when the scroll bar is displayed, the width of the screen shrinks. This results in an awkward shift of the content on the screen.\n\nI want to prevent this behaviour so that the width of the screen is consistent whether the scroll bar is displayed or not displayed. How can I achieve this? I don't want to use JavaScript/jQuery if possible."
] | [
"css",
"browser"
] |
[
"Struggling to combine method chaining with class extensions",
"I'm trying to combine method chaining with class extensions and a method that is defined in a base class. However, I struggle to get it to work, as I am not very familiar with Generics yet.\nCould someone maybe help me to get this to work? It would be really appreciated. Thanks!\n\nCurrent situation:\n\npublic abstract class A<T extends A<?>> extends F // the base class, all others extend this one (either direct or indirect)\npublic T isLoaded() { // method defined in class A\n // Omitted\n return (T) this;\n}\n\npublic class B extends A<B> // One of the classes that extends the base class\npublic D tapButton() // Method defined in class B\n\npublic class C extends A<C> // Another class that extends the base class, also has a child itself\npublic C setAmount(int amount) // method defined in class C\n\npublic class D extends C // Class that extends the previous one (C)\npublic E tapButtonTwo() // Method defined in class D, can't move this one level up to due to other parts of the code\n\n\nCode that tries to use these classes and methods:\n\n// Failing scenario\nprotected void doSomething() {\n // I already have an instance of type B, but I omitted this part\n b.tapButton() // returns type D\n .isLoaded() // returns type C and is the cause of the problem\n .setAmount(10) // returns type C\n .tapButtonTwo() // fails on: cannot resolve method\n}\n\n// Scenario that does work:\nprotected void doSomething() {\n // I already have an instance of type B, but I omitted this part\n b.tapButton() // returns type D\n .setAmount(10) // now returns type D\n .tapButtonTwo() // works\n}"
] | [
"java",
"generics",
"chaining",
"class-extensions"
] |
[
"Django DB design - Book specific unique URLs with unique_together",
"I have two models with one to many relationship.\n\nA Book has many Chapters. Both the models have a slug field.\n\nFor Book the slug column is UNIQUE.\n\nFor Chapter the book_id and slug are UNIQUE together.\n\nThe Chapter model also has a field order. And book_id and order are UNIQUE together.\n\n\nThis way, I can generate unique URLs for books automatically and allow duplicate slugs for different books.\nCurrent models.py:\nclass Book(models.Model):\n # other fields\n slug = models.SlugField(max_length=80)\n\n def save(self, *args, **kwargs):\n if not self.pk:\n self.slug = unique_slug(self.title) \n return super(Book, self).save(*args, **kwargs)\n\n\nclass Chapter(models.Model):\n #other fields\n book = models.ForeignKey(Book, on_delete=models.CASCADE, related_name='chapters')\n slug = models.SlugField(max_length=80)\n order = models.IntegerField(null=True)\n\n class Meta:\n constraints = [\n models.UniqueConstraint(fields=['book_id', 'order'], name='unique_order'),\n models.UniqueConstraint(fields=['book_id', 'slug'], name='unique_slug')]\n ordering = ['order']\n\nbooks app's urls.py:\nurlpatterns = [\n # Book\n path('', views.BookList.as_view(), name='book-list'),\n path('create/', views.BookCreate.as_view(), name='book-create'),\n path('<slug:book_slug>/', views.BookDetail.as_view(), name='book-detail'),\n path('<slug:book_slug>/edit/', views.BookEdit.as_view(), name='book-edit'),\n\n # Chapter\n path('<slug:book_slug>/chapter/', views.BookDetail.as_view(), name='chapter-list'), \n path('<slug:book_slug>/chapter/create/', views.ChapterCreate.as_view(), name='chapter-create'),\n path('<slug:book_slug>/chapter/<slug:chapter_slug>/', views.ChapterDetail.as_view(), name='chapter-detail'),\n path('<slug:book_slug>/chapter/<slug:chapter_slug>/edit/', views.ChapterEdit.as_view(), name='chapter-edit')\n] \n\nThe downside here is, in my chapter views I have to query the book first and get the chapter slug with the matching book_id. While previously with just the chapter slug UNIQUE, I was just querying the chapter table alone.\n\nMy goal is to have URLs like this\n\nbook/rndmstrng-alice-in-the-wonderland/chapter/down-the-rabbit-hole\n\nbook/rndmstrng-some-other-book/chapter/down-the-rabbit-hole\n\n\n\nIs there any issue in this design? Are too many UNIQUE constraints bad? Is there a better way to implement this?"
] | [
"django",
"database-design",
"unique-constraint",
"slug",
"unique-index"
] |
[
"Fetch from collection on visiting route using FlowRouter doesn't work on page reload",
"I have a route defined in my Meteor + React app like this below. I would like to fetch the post and pass into component via props. But I get an error saying post is undefined when I reload the page when on that URL. I can visit the URL when I go from other parts from the site but not when reloading.\n\nconst Posts = new Mongo.Collection('posts');\n\nFlowRouter.route('/post/:slug', {\n name: 'Post.show',\n action(params) {\n let post = Posts.findOne({slug: params.slug});\n mount(Layout, {\n main: () => <Post key={post._id} post={post} />,\n });\n },\n});\n\n\nPerhaps this isn't the way to go but I would like to have the ability to pass in custom posts thats why I'm using this approach. Does it have anything to do with that the Posts collection isn't fully initiated? If so how do I wait for it to be initiated?"
] | [
"mongodb",
"meteor",
"flow-router",
"meteor-react",
"mongo-collection"
] |
[
"Increase performance of SELECT COUNT(*) with WHERE clause in SQLite?",
"I'm trying to build a leaderboard in which I'm using this query:\nSELECT id, COUNT(type) FROM Data \nWHERE UPPER(type) = $1 AND id != '123123123123' \nGROUP BY id ORDER BY COUNT(type) DESC LIMIT 10;\n\nWhich takes about 8-10 seconds in my table Data consisting of approx. 4 million rows and growing by 100,000+ rows per day.\nThe table also has a UNIQUE INDEX which is unique when combining values from 2 different columns — code and version.\nWhat can I do to increase the speed and performance of this query?\nI've considered building a counter for each user's rows, but that wouldn't be very intuitive as the type can differ between 100+ values. I've also tried adding an index on id and type which still takes after 8-10 seconds if not more."
] | [
"sql",
"database",
"performance",
"sqlite"
] |
[
"Element ref was specified as a string (inner) but no owner was set",
"I am trying to create a navbar through react bootstrap but somehow it is not working out for me. The problem is the Navbar, if I remove the whole Navbar tags it works fine. Not able to figure out what I am doing wrong.\n\n\r\n\r\nimport React, { Component } from 'react';\r\nimport { render } from 'react-dom';\r\nimport {Nav, Navbar, NavItem, MenuItem, NavDropdown,Button} from 'react-bootstrap';\r\nimport './style.css';\r\nimport 'bootstrap/dist/css/bootstrap.css';\r\nimport 'bootstrap/dist/css/bootstrap-theme.css';\r\n\r\nexport default class Header extends React.Component{\r\n\r\n render(){\r\n return(\r\n <Navbar>\r\n <Nav bsStyle=\"pills\" stacked activeKey={1}>\r\n <NavItem eventKey={1} href=\"/home\">\r\n NavItem 1 content\r\n </NavItem>\r\n <NavItem eventKey={2} title=\"Item\">\r\n NavItem 2 content\r\n </NavItem>\r\n <NavItem eventKey={3} disabled>\r\n NavItem 3 content\r\n </NavItem>\r\n </Nav>\r\n </Navbar>\r\n );\r\n }\r\n}"
] | [
"reactjs",
"react-bootstrap"
] |
[
"Can I serve .html files using Razor as if they were .cshtml files without changing the extension of all my pages?",
"I manage a large asp.net site which has previously been converted from static html site to asp.net. \n\nFor several reasons (mainly SEO) we decided not to rename all the files to .aspx back when we originally converted the site. This was very easy to do by simply adding the buildProvider and httpHandler to the web.config.\n\n<buildProviders>\n <add extension=\".html\" type=\"System.Web.Compilation.PageBuildProvider\"/>\n</buildProviders>\n\n<httpHandlers>\n <add path=\"*.html\" verb=\"*\" type=\"System.Web.UI.PageHandlerFactory\"/>\n</httpHandlers>\n\n\nNow I am upgrading the site to use Asp.net WebPages with Razor cshtml files. I can rename all the files if necessary, and use url rewriting to make the urls stay the same, however it would be much easier if I could just configure the web.config to tell it to parse .html files as if they were .cshtml.\n\nI have searched around quite a bit, and could not find anything equivalent to the PageHandlerFactory for razor pages. It appears as though it is just an internal mechanism in the .net 4.0 ISAPI handler.\n\nThe site is currently running on Windows 2003 server and IIS 6. We will be upgrading to 2008/IIS 7.5 in the near future, but I'd prefer not to wait for that.\n\nIs there any way to get the .html files to be parsed by razor as if they were .cshtml files?"
] | [
"asp.net",
"iis-6",
"razor"
] |
[
"three.js TextGeometry: text alignment gets messed up after re-setting the rotation",
"I have created a THREE. TubeGeometry and using the THREE.TextGeometry added the text to the tube created. The tube is then added to scene.\nAlso the I have set the text rotation to camera rotation. The code snippet is below\n\ntext.rotation = camera.rotation;\ntext.lookAt(camera.position);\n\n\nMy application has a button by which I can reset the original position of my tube geometry. Internally, this is done by reseting the camera to its originally position.\n\nInitially, when the page loads up, the tube and text are properly aligned and face the user. But when I rotate the tube and reset it to original position, the tube is properly getting back to original position but text is randomly facing to any direction.\n\nMy basic requirement is the text should always face the user. I have followed the steps mentioned in another related query:\n\nTextGeometry to always face user?\n\nBut even though I have coded in same way as suggested, I am facing the above mentioned issue. Please point what I am missing?\n\nNote: I am using perspective camera."
] | [
"three.js",
"perspectivecamera"
] |
[
"select2 not working with hidden parent div (dynamicaly created select elements)",
"I'm dynamicaly creating divs with a select2 select element. The problem is, it somehow loosk like it doesn't find the object when initializing the select2.\nhas anyone run into that problem before?\nthis is my code so far:\nHTML:\n<button id="addNewDocument" class="col-2 btn btn-primary add-doc-button">Neues Dokument</button>\n\n<div style="display: none;">\n <div id="docDescription" class='col-md-4 form-group documentDescription'>\n <label class='control-label input-label'>Dokumenttyp</label>\n <select class='form-control documentDescriptionSelect required' name='Chose Documenttype'>\n <option value=""></option>\n @foreach (var item in Model.DocumentTypes)\n {\n <option class="row" value='@item.Documentcode'>\n <div>@Html.DisplayFor(modelItem => item.Documentcode)</div>\n <div> - </div>\n <div>@Html.DisplayFor(modelItem => item.Documentname)</div>\n </option>\n }\n </select>\n\n </div>\n</div>\n\nJS:\n$("#addNewDocument").click(function () {\n var uid = Math.floor(Math.random() * 26) + Date.now()\n var selectID = uid + 1;\n var newDocumentBox = $("<li class='row documentContainer justify-content-between' id='" + uid + "'></li>").prependTo("#newDocuments");\n var newDocumentDescription = $("#docDescription").clone(true);\n $("#docDescription").children().eq(1).attr("id", selectID);\n newDocumentDescription.appendTo(newDocumentBox);\n var newDroppableBox = $("<div class='documents col-md-7 droppableBox' ></div>").appendTo(newDocumentBox);\n var newDeleteButton = $("<div class='close-container deleteButton' onclick='deleteDocument(" + uid + ")'><div class='leftright'></div><div class='rightleft'></div></div>").appendTo(newDroppableBox);\n\n $(selectID).select2({\n placeholder: "Bitte wählen Sie einen Dokumenttyp"\n\n })\n});"
] | [
"javascript",
"html",
"jquery",
"select",
"jquery-select2"
] |
[
"How to locate react CreatableSelect element using python selenium test",
"I am trying to locate react CreatableSelect element in python selenium script and tried various ways using Xpath but still not able to simulate select option from existing dropdown menu and create new one.\nBelow is my html code for dropdown.\n<CreatableSelect name="abc" id="abc" isClearable options={abc1}/>\n\nDiv element for CreatableSelect.\n<div class=" css-2b097c-container" id="abc">\n<div class=" css-yk16xz-control">\n <div class=" css-g1d714-ValueContainer">\n <div class=" css-1wa3eu0-placeholder">Select...</div>\n <div class="css-b8ldur-Input">\n <div class="" style="display: inline-block;">\n <input autocapitalize="none" autocomplete="off" autocorrect="off" id="react-select-2-input" spellcheck="false" tabindex="0" type="text" aria-autocomplete="list" value="" style="box-sizing: content-box; width: 2px; background: 0px center; border: 0px; font-size: inherit; opacity: 1; outline: 0px; padding: 0px; color: inherit;"><div style="position: absolute; top: 0px; left: 0px; visibility: hidden; height: 0px; overflow: scroll; white-space: pre; font-size: 16px; font-family: &quot;FS Elliot Web Regular&quot;, &quot;FS Elliot Web Regular&quot;, Arial, arial, sans-serif; font-weight: 400; font-style: normal; letter-spacing: normal; text-transform: none;">\n </div>\n </div>\n </div>\n </div>\n<div class=" css-1hb7zxy-IndicatorsContainer">\n<span class=" css-1okebmr-indicatorSeparator"></span>\n <div aria-hidden="true" class=" css-tlfecz-indicatorContainer">\n <svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-6q0nyr-Svg">\n <path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z">\n </path>\n </svg>\n </div>\n </div>\n </div>\n <input name="abc" type="hidden" value=""></div> \n\nBelow is populated dropdown.\n\nI have tried below options in my python script but nothing worked.\nabc = driver.find_element_by_xpath("//div[@class=' css-tlfecz-indicatorContainer']/*[name()='svg'][@class='css-6q0nyr-Svg']")\nabc.click()\n\nAny help will be appreciated."
] | [
"python",
"reactjs",
"selenium",
"automated-tests"
] |
[
"Parsing dice notation with Elm",
"I am trying to write a small dice notation (e.g. \"2d6\", where 2 is the count and 6 is the die size) parser using the library in elm-tools/parser.\n\nAn expression should be in the form\n\n[int] \"d\" int\n\n\nbut I can't figure out to parse the optional leading int (which will default to 1 if it is missing).\n\nSo far, I've come up with this:\n\nimport Parser exposing (..)\n\n\ntype alias Roll =\n { count : Int\n , size : Int\n }\n\n\ndie : Parser Int\ndie =\n succeed identity\n |. keyword \"d\"\n |= int\n\n\nand I would like the parser to return a Roll on a successful parse, but I'm not sure how to proceed.\n\nI am guessing that I will need to make use of oneOf, but I'm not sure how.\n\nUnfortunately, I can't find any good examples of using this library."
] | [
"elm",
"parser-combinators"
] |
[
"Scanning folders using lua",
"I'm trying to get the name of all the file saved in two folders, the name are saved as :\n\n1.lua 2.lua 3.lua 4.lua and so on \n\n\nthe folders name are :\n\n first folder : \"/const/\" \n second folder: \"/virt/\"\n\n\nwhat I'm trying to do is only get the number of the files and this works but not in the right order, when I get the 17 file for example I get the 17th delivered from the function before the 15 and this causes for me a problem here the code of the function that I'm using :\n\nlocal virt_path = \"/virt/\"\nlocal const_path = \"/const\"\nlocal fs = require \"lfs\"\n\nlocal const = {}\n\nfor num = 1, (numberoffile)do -- numberoffile is predfined and can't be change \n const[num] = assert(\n dofile (const_path .. mkfilename(num)),\n \"Failed to load constant \".. num ..\".\")\nend\n\nlocal function file_number() --this is the function that causes me a headach\n local ci, co, num = ipairs(const)\n local vi, vo, _ = fs.dir(virt_path)\n local function vix(o)\n local file = vi(o)\n if file == nil then return nil end\n local number = file:match(\"^(%d+).lua$\")\n if number == nil then return vix(o) end\n return tonumber(number)\n end\n local function iter(o, num)\n return ci(o.co, num) or vix(o.vo, num)\n end\n return iter, {co=co, vo=vo}, num\nend\n\n\nAs I said the function delive the need return values but not the right Arithmetic order.\n\nany idea what I'm doing wrong here ?"
] | [
"lua"
] |
[
"How to insert a buffer geometry into a new table using java?",
"Here Geometry buffer = geom.buffer(5.00);\n\nThus buffer contains a data as polygon and the latitude and longitude of all the points in the 5km radius . \n\nThis line of code that I wrote isn't working . What is a better way to go about it ?\n\nString query1 = \" INSERT INTO buffer(the_geom) \" + buffer + \";\";\n\n\nSo what should be the sql query ?"
] | [
"java",
"postgresql"
] |
[
"C# catch block is not executed when AccessViolationException is thrown",
"In the following code I want to read data by using Marshal. The function itself is working fine (as long as the length fits to the pointer of course). \nI wrote a unit test to check some possible outcomes of copyDataFromMemory and noticed that the AccessViolationException is thrown, but my test stops right there and doesn't execute my catch-block. Here's my code:\n\nprivate static double[] copyDataFromMemory(PointerLengthPair pointerLengthPair)\n{\n double[] dataChain = new double[pointerLengthPair.Length];\n try\n {\n Marshal.Copy(pointerLengthPair.Pointer, dataChain, 0, pointerLengthPair.Length);\n }\n catch (AccessViolationException)\n { \n return null;\n }\n catch (Exception)\n {\n return null;\n }\n\n return dataChain;\n}\n\npublic class PointerLengthPair\n{\n public IntPtr Pointer { get; private set; }\n public int Length { get; private set;}\n\n public PointerLengthPair(IntPtr pointer, int length)\n {\n Pointer = pointer;\n Length = length;\n }\n}\n\n\nNow my question is: Is this some sort of problem with Visual Studio 2012? Are there settings I have to choose or is it just not possible to catch a AccessViolationException? Or do I miss something obvious?\n\n(note: please ignore that I'm currently using null as return value. I will replace this with an object of a new class as soon as possible)"
] | [
"c#",
"visual-studio-2012",
"try-catch",
"marshalling",
"access-violation"
] |
[
"Bad request -400 status code",
"I am using http post method and passing base64econded string into xml. But it gives me 400 in response. XMl tag structure is valid. When I removed this base64encoded string from xml it works perfectly. But including it gives error(400). Would base64encoded string may contains any character that make my request invalid ? Any help is welcome."
] | [
"iphone",
"xmlhttprequest"
] |
[
"Beautiful Soup, for loop to write data",
"Im having trouble writing the contents of this soup function to the my ide.\n\nI have the following soup function:\n\nrow = soup.find_all('td', attrs = {'class': 'Table__TD'})\n\nhere is the a subset of what it returns:\n\n[<td class=\"Table__TD\">Sat 11/9</td>,\n <td class=\"Table__TD\"><span class=\"flex\"><span class=\"pr2\">vs</span><span class=\"pr2 TeamLink__Logo\"><a class=\"AnchorLink v-mid\" data-clubhouse-uid=\"s:40~l:46~t:6\" href=\"/nba/team/_/name/dal/dallas-mavericks\" title=\"Team - Dallas Mavericks\"><img alt=\"DAL\" class=\"v-mid\" data-clubhouse-uid=\"s:40~l:46~t:6\" height=\"20\" src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\" title=\"DAL\" width=\"20\"/></a></span><span><a class=\"AnchorLink v-mid\" data-clubhouse-uid=\"s:40~l:46~t:6\" href=\"/nba/team/_/name/dal/dallas-mavericks\" title=\"Team - Dallas Mavericks\">DAL</a></span></span></td>,\n <td class=\"Table__TD\"><a class=\"AnchorLink\" data-game-link=\"true\" href=\"http://www.espn.com/nba/game?gameId=401160772\"><span class=\"flex tl\"><span class=\"pr2\"><div class=\"ResultCell tl loss-stat\">L</div></span><span>138-122</span></span></a></td>,\n <td class=\"Table__TD\">31</td>,\n <td class=\"Table__TD\">6-12</td>,\n <td class=\"Table__TD\">50.0</td>,\n <td class=\"Table__TD\">4-9</td>,\n <td class=\"Table__TD\">44.4</td>,\n <td class=\"Table__TD\">2-2</td>,\n <td class=\"Table__TD\">100.0</td>,\n <td class=\"Table__TD\">4</td>,\n <td class=\"Table__TD\">4</td>,\n <td class=\"Table__TD\">2</td>,\n <td class=\"Table__TD\">3</td>,\n <td class=\"Table__TD\">2</td>,\n <td class=\"Table__TD\">1</td>,\n <td class=\"Table__TD\">18</td>,\n <td class=\"Table__TD\">Fri 11/8</td>,\n\n\nI am trying to use a for loop to write these out but my console is not returning anything.\n\nfor data in row[0].find_all('td'):\n print(data.get_text())\n\n\nCan anyone tell me what I am doing wrong? Thanks."
] | [
"python",
"beautifulsoup"
] |
[
"Query Dynamodb using columns other than partition and sort keys",
"I have a dynamodb table named \"client\" with the following columns : \n- userId(partition key)\n- clientId(sort key)\n- status(true/false).\n\nI would like to get all the records from the \"client\" table with status=\"true\" using node.js."
] | [
"node.js",
"amazon-dynamodb"
] |
[
"Getting error in apche Pig when running over yarn \"org.apache.hadoop.ipc.Client - Retrying connect to server: tasktracker3/10.201.2.169:50000\"",
"I am running Apache Pig 0.11.2 with Hadoop 2.2.0.\n\nMost simple jobs that I run in Pig work perfectly fine.\n\nHowever, whenever I try to use GROUP BY on a large dataset, or the LIMIT operator, I get these connection errors:\n\n\n 2013-12-18 11:21:28,400 [main] INFO org.apache.hadoop.ipc.Client -\n Retrying connect to server: tasktracker2/10.201.2.145:54957. Already\n tried 0 time(s); retry policy is\n RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1 SECONDS)\n 2013-12-18 11:21:29,402 [main] INFO org.apache.hadoop.ipc.Client -\n Retrying connect to server: tasktracker2/10.201.2.145:54957. Already\n tried 1 time(s); retry policy is\n RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1 SECONDS)\n 2013-12-18 11:21:30,403 [main] INFO org.apache.hadoop.ipc.Client -\n Retrying connect to server: tasktracker2/10.201.2.145:54957. Already\n tried 2 time(s); retry policy is\n RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1 SECONDS)\n 2013-12-18 11:21:30,507 [main] INFO \n org.apache.hadoop.mapred.ClientServiceDelegate - Application state is\n completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job\n history server 2013-12-18 11:21:31,703 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker1/10.201.2.20:49528. Already tried 0 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:32,704 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker1/10.201.2.20:49528. Already tried 1 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:33,705 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker1/10.201.2.20:49528. Already tried 2 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:33,809 [main] INFO \n org.apache.hadoop.mapred.ClientServiceDelegate - Application state is\n completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job\n history server 2013-12-18 11:21:34,890 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker3/10.201.2.169:50000. Already tried 0 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:35,891 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker3/10.201.2.169:50000. Already tried 1 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:36,893 [main] INFO \n org.apache.hadoop.ipc.Client - Retrying connect to server:\n tasktracker3/10.201.2.169:50000. Already tried 2 time(s); retry policy\n is RetryUpToMaximumCountWithFixedSleep(maxRetries=3, sleepTime=1\n SECONDS) 2013-12-18 11:21:36,996 [main] INFO \n org.apache.hadoop.mapred.ClientServiceDelegate - Application state is\n completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job\n history server 2013-12-18 11:21:37,152 [main] INFO \n org.apache.hadoop.mapred.ClientServiceDelegate - Application state is\n completed. FinalApplicationStatus=SUCCEEDED. Redirecting to job\n history server\n\n\nThe strange thing is that after these errors keeping appearing for about minutes, they'll stop, and the correct output shows up at the bottom.\n\nSo Hadoop is running fine and computing the proper output. The problem is just these connection errors that keep popping up. and that causing increase in execution time of the script.\n\nOne thing that I have noticed is that whenever this error appears, the job had created and ran multiple JAR files during the job. However, after a few minutes of these message popping up, the correct output finally appears.\n\nI have 5 nodes cluster 1 namenode and 4 datanode. All the daemons are running fine.\n\nAny suggestions on how to get rid of these messages?"
] | [
"java",
"hadoop",
"apache-pig",
"yarn"
] |
[
"Trying to display initials in Python",
"I'm trying to make this so that when a person types their name just the initials display capitalized and separated by a period. I can't figure out what is wrong with this code I wrote... help pls!\n\ndef main():\n\nname = input('Type your name and press ENTER. ')\nname_list = name.split()\n\nprint(name_list)\n\nfirst = name[0][0]\nsecond = name[1][0]\nlast = name[2][0]\n\nprint(first,'.', second,'.')\n\nmain()"
] | [
"python",
"python-3.x"
] |
[
"How to get data onto textbox in MVC",
"Here I want to edit the available data from the database , so i am bit confused about how to get those data onto text boxes\n\n public string EditRegistrationForm(int ID)\n {\n string Msg = null;\n Database database = DatabaseFactory.CreateDatabase();\n DataSet ds = new DataSet();\n // List<Registrationform> results = new List<Registrationform>();\n try\n {\n string str = \"Edit_RegistrationForm\";\n DbCommand storedProcCommand = database.GetStoredProcCommand(str);\n database.AddInParameter(storedProcCommand, \"@p_ID\", DbType.Int64, ID);\n ds = database.ExecuteDataSet(storedProcCommand);\n\n Msg = \"EditOperationSuccessful\";\n // ds = database.ExecuteDataSet(storedProcCommand);\n //results = ds.Tables[0].AsEnumerable()\n // .Select(row => new Registrationform\n // {\n // Id = (int)(row[\"ID\"]),\n // Name = (row[\"Name\"].ToString()),\n // Age =(int) (row[\"Age\"]),\n // EMailId = (row[\"EMailId\"].ToString()),\n // phNumber = (row[\"phNumber\"].ToString())\n // }).ToList();\n }\n\n\n catch\n {\n Msg = \"EditOperationFailed\";\n }\n return Msg;"
] | [
"c#",
"asp.net-mvc"
] |
[
"php table add values if cell repeats",
"I have a wordpress loop retriving a table like this: \n\n\n\nI want to check if the name repeats it self and if so do a sum of partial values to show the total. \nOn my screenshot the 1st and 3rd rows have the same \"nome\" so the global value should be 85, can any one tellme how to do this ?\n\nmy php :\n\n<?php while( have_rows('wallet_repeater') ): the_row(); \n\necho '<div class=\"promotoras_item_wallet\"> ';\necho '<div class=\"promnames_wallet\"> ';\n// vars\n\n$adicionados = get_sub_field('wallet_promotora');\n\n foreach($adicionados as $post) :\n\n$nome = simple_fields_values(\"pname1\");\n$im = simple_fields_values(\"ftotop\");\n$cp=$adicionados ;\n$imatop = $im; \n$data=get_sub_field('wallet_data');\n$evento=get_sub_field('wallet_evento');\n$obs=get_sub_field(\"wallet_obs\"); \n$numeros_horas = get_sub_field(\"Wallet_n_horas\");\n$valor_horas = get_sub_field(\"wallet_valorh\");\n$evento = get_sub_field(\"wallet_evento\");\n$horarios = get_sub_field(\"wallet_horario\");\n\n$total_parcial = $valor_horas * $numeros_horas.\"€\";\n$ii = wp_get_attachment_image($imatop[0]);\n\n\n?>\n\n<table id=\"wallet_table1\" width=\"900px\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\">\n <tbody>\n <tr>\n <tr onmouseover=\"this.style.backgroundColor='#ffff66';\" onmouseout=\"this.style.backgroundColor='#d4e3e5';\">\n\n <td class=\"wallet_data_img\" width=\"5\"><div class=\"w_promotora_images\"><?php echo wp_get_attachment_image($imatop[0]); ?></td>\n <td class=\"wallet_data_data\" width=\"20\"><?php echo the_sub_field('wallet_data'); ?> </td>\n <td class=\"wallet_data_nome\" width=\"200\"><?php echo $nome[0];$nomes[]=$nome[0];?></td>\n <td class=\"wallet_data_evento\" width=\"10\"> <?php echo the_sub_field(\"wallet_evento\"); ?></td>\n <td class=\"wallet_data_horarios\" width=\"10\"><?php echo the_sub_field(\"wallet_horario\"); ?></td>\n <td class=\"wallet_data_obs\" width=\"10\"><?php echo the_sub_field(\"wallet_obs\"); ?></td>\n <td class=\"wallet_data_horas\" width=\"10\"><?php echo the_sub_field(\"Wallet_n_horas\").\"h\"; ?></td>\n <td class=\"wallet_data_valorh\" width=\"5\"><?php echo the_sub_field(\"wallet_valorh\").\"€\"; ?></td>\n <td class=\"wallet_data_props\" width=\"5\"><?php echo the_sub_field(\"wallet_props\"); ?></td>\n <td class=\"wallet_data_total\" width=\"5\">Parcial: <?php echo $total_parcial; ?> global: \n\n</td> </tr></tbody></table>\n\n\n<?php"
] | [
"php",
"wordpress",
"loops"
] |
[
"How to write RESTful web services client based on curl",
"I need to write a RESTful web service client for Delphix.I am new to delphix and RESTful webservices.How can I write a client based on the below curl.\n\nCreate Delphix API Session\n\n\n $ curl -s -X POST -k --data @-\n http://delphix-server/resources/json/delphix/session \\\n -c ~/cookies.txt -H \"Content-Type: application/json\" <\n\n\n Delphix Login \n\n\n$ curl -s -X POST -k --data @- http://delphix-server/resources/json/delphix/login \\\n\n\n-b ~/cookies.txt -H \"Content-Type: application/json\" <<EOF {\n\"type\": \"LoginRequest\",\n\"username\": \"delphix_username\",\n\"password\": \"delphix_password\" } EOF\n\n\n\nplease help"
] | [
"java",
"rest",
"curl"
] |
[
"Twig check elements of array are in another array",
"I'm trying to check in twig if any element of one array are set in other array.\nExample:\n\nI have user.roles with ['ROLE_ADMIN','ROLE_MANAGER'] and I have the product.roles with ['ROLE_ADMIN','ROLE_USER'].\n\nI want to check (in Twig) if any user.roles are in product.roles, like:\n\n{{ user.roles[0] is product.roles|keys }}\n\n\nBut with each element of user.roles in the same function.\n\nDoes anyone know how?"
] | [
"twig"
] |
[
"TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'",
"I'm trying to sort a list of ints in python this is my code\n\nfor i in range (5):\n for j in range (6):\n list_dist.append(dist(i,j,pos_porte))\nsorted_list=sorted (list_dist)\n\n\nfor some reason it doesn't work can you help?\n\nEdit: dist is a function that returns distance:\n\ndef dist(a,s,b):\n distance=sqrt((pow(a-b[0],2)+pow(s-b[1],2)))\n print(distance)"
] | [
"python",
"list",
"typeerror"
] |
[
"Python | Moving specific Files in User created Folder",
"I wrote a short script, where I want to moves all .CR2 (in the next step I want to choose between the first the first 2 or 6 files) Files to a Folder, which has been created before as raw_input.\n\nimport os\nfrom os import path\nimport shutil\nimport itertools\n\nproname = raw_input(\"Please Name the Productfolder: \")\n\npath = \"/Volumes/01_Produktfotos/_2020-01-JANUAR/\"\n\nos.mkdir(proname)\nos.chdir(proname)\nos.makedirs('_final')\nos.makedirs('_images')\nos.makedirs('_psd')\n\nsourcepath = '/Volumes/01_Produktfotos/_2020-01-JANUAR/03.01/'\nsourcefiles = os.listdir(sourcepath)\ndestinationpath = '/Volumes/01_Produktfotos/_2020-01-JANUAR/03.01/%proname/_images/'\nfor file in sourcefiles:\n if file.endswith('.CR2'):\n shutil.move(os.path.join(sourcepath,file), os.path.join(destinationpath,file))\n\n\nAt the moment, the script creates the user specific Folder (proname) and generates the subfolder _images, _final & _psd inside of it.\n\nMy Problem is that it doesn't moves the files from the top folder in the user created folder.\n\nThe Perfect Result would be if\n\n\nI can choose a Productfolder Name\nIt creates inside of the Folder the subfolder _images, _final & _psd\nI can choose if I want the first 2-6 .CR2 Files inside of the Subfolder _images of the created Productfolder\nThe Script is running till there are no .CR2 Files left\n\n\nAny help or hints are welcome (:\n\nThx in advance"
] | [
"python",
"shutil"
] |
[
"Laravel passport multi-tenant clients",
"I have an application which is a REST gateway for remote PostgreSQL database and I use Passport for authentication.\n\nThis app is composed by a local MySQL database for oauth, users, roles, permissions, ... and a remote PostgreSQL with data to serve.\n\nI need to affect a tenant for each clients (personal and password clients) like this:\n\nClient A: can fetch data from schema X\nClient B: can fetch data from schema Y\nClient C: can fetch data from schema X and Y\n\n\nWhat is the best way to do this.\n\nThank you."
] | [
"php",
"laravel",
"oauth-2.0",
"laravel-passport"
] |
[
"Efficient expanding OLS in pandas",
"I would like to explore the solutions of performing expanding OLS in pandas (or other libraries that accept DataFrame/Series friendly) efficiently.\n\n\nAssumming the dataset is large, I am NOT interested in any solutions with a for-loop;\nI am looking for solutions about expanding rather than rolling. Rolling functions always require a fixed window while expanding uses a variable window (starting from beginning);\nPlease do not suggest pandas.stats.ols.MovingOLS because it is deprecated;\nPlease do not suggest other deprecated methods such as expanding_mean.\n\n\nFor example, there is a DataFrame df with two columns X and y. To make it simpler, let's just calculate beta.\nCurrently, I am thinking about something like\n\nimport numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\n\ndef my_OLS_func(df, y_name, X_name):\n y = df[y_name]\n X = df[X_name]\n X = sm.add_constant(X)\n b = np.linalg.pinv(X.T.dot(X)).dot(X.T).dot(y)\n return b\n\ndf = pd.DataFrame({'X':[1,2.5,3], 'y':[4,5,6.3]})\n\ndf['beta'] = df.expanding().apply(my_OLS_func, args = ('y', 'X'))\n\n\nExpected values of df['beta'] are 0 (or NaN), 0.66666667, and 1.038462.\n\nHowever, this method does not seem to work because the method seems very inflexible. I am not sure how one could pass the two Series as arguments.\nAny suggestions would be appreciated."
] | [
"python",
"pandas",
"linear-regression",
"statsmodels"
] |
[
"Search for value within a range of values in two separate vectors",
"This is my first time posting to Stack Exchange, my apologies as I'm certain I will make a few mistakes. I am trying to assess false detections in a dataset. \n\nI have one data frame with \"true\" detections \n\ntruth=\nID Start Stop SNR\n1 213466 213468 10.08\n2 32238 32240 10.28\n3 218934 218936 12.02\n4 222774 222776 11.4\n5 68137 68139 10.99\n\n\nAnd another data frame with a list of times, that represent possible 'real' detections\n\n\n possible=\n ID Times\n \n 1 32239.76\n \n 2 32241.14\n \n 3 68138.72\n \n 4 111233.93\n \n 5 128395.28\n \n 6 146180.31\n \n 7 188433.35\n \n 8 198714.7\n\n\nI am trying to see if the values in my 'possible' data frame lies between the start and stop values. If so I'd like to create a third column in possible called \"between\" and a column in the \"truth\" data frame called \"match. For every value from possible that falls between I'd like a 1, otherwise a 0. For all of the rows in \"truth\" that find a match I'd like a 1, otherwise a 0.\n\nNeither ID, not SNR are important. I'm not looking to match on ID. Instead I wand to run through the data frame entirely. Output should look something like:\n\n\n ID Times Between\n \n 1 32239.76 0\n \n 2 32241.14 1\n \n 3 68138.72 0\n \n 4 111233.93 0\n \n 5 128395.28 0\n \n 6 146180.31 1\n \n 7 188433.35 0\n \n 8 198714.7 0\n\n\nAlternatively, knowing if any of my 'possible' time values fall within 2 seconds of start or end times would also do the trick (also with 1/0 outputs)\n\n(Thanks for the feedback on the original post)\n\nThanks in advance for your patience with me as I navigate this system."
] | [
"r",
"range"
] |
[
"How to use POST method inside HttpUrlConnection",
"I am trying to use HttpUrlConnection class in Async Task inside doInBackground method.\n\n@Override\n protected String doInBackground(String... params) {\n String strUrl=String.format(\"%s\",SERVER_URL);\n try {\n\n URL url =new URL(strUrl);\n HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setRequestMethod(\"POST\");\n urlConnection.setDoOutput(true);\n urlConnection.setDoInput(true);\n urlConnection.setChunkedStreamingMode(0);\n urlConnection.setRequestProperty(\"Content-Type\",\"application/json\");\n\n String str=\"{\\\"userid\\\":\\\"1\\\"}\";\n byte[] outputInBytes = str.getBytes(\"UTF-8\");\n OutputStream os = urlConnection.getOutputStream();\n os.write( outputInBytes );\nos.close();\n\n\n InputStream stream1=urlConnection.getInputStream();\nInputStreamReader reader = new InputStreamReader(stream1);\n StringBuilder builder = new StringBuilder();\n int chr;\n while((chr=reader.read())!=-1)\n {\n builder.append((char)chr);\n }\n String result=builder.toString();\n\n return result;\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }\n\n\nBut I am getting null instead of result,what will be the problem here."
] | [
"android"
] |
[
"why a C++ \"const\" function can modify its pointer-type member?",
"I have the following codes that failed compilation due to invalid conversion from ‘const int*’ to ‘int*’ [-fpermissive]\n\n#include <iostream>\n#include <stdlib.h>\n\nusing namespace std;\n\n#define N 3\n\nvoid f(int *p) \n{\n *p=8;\n}\n\nclass A\n{\n private:\n int a;\n public:\n void init() const;\n void print() const {cout<<a<<endl;}\n};\n\nvoid A::init() const\n{\n f(&a);\n}\n\nint main()\n{\n A a;\n a.init();\n a.print();\n}\n\n\nThis is not surprising at all because of the \"const\" qualifier of the \"init\" function.\n\nHowever, the following codes compiled and ran smoothly,\n\n#include <iostream>\n#include <stdlib.h>\n\nusing namespace std;\n\n#define N 3\n\nvoid f(void **pp)\n{\n *pp = new int[N];\n}\n\nclass A\n{\n private:\n int * p;\n public:\n void init() const;\n void assign() {for (size_t i=0; i<N; i++) p[i]=i;}\n void print() const {for (size_t i=0; i<N; i++) cout<<p[i]<<\" \"; cout<<endl; }\n ~A(){delete [] p;} \n};\n\nvoid A::init() const\n{\n f((void**)&p);\n}\n\nint main()\n{\n A a;\n a.init();\n a.assign();\n a.print();\n}\n\n\nQuestion: in the second case, why a \"const\" function (init) can modify its member (p)?"
] | [
"c++"
] |
[
"ASP.NET foreach looping only displaying last value of gridview",
"I am trying to select specific persons with their ID by using ASP.NET Gridview, but only the last userID reads. Let's say I have ID's 3, 4, and 6, and only ID number 6 does not appear in the Gridview table but 3 and 4 appear. They\nshould not appear even 3 and 4 because I am running the sql script as:\nWHERE NOT EmployeeId = \" + userID.\n\nforeach (int userID in userIDList)\n{ \n\n string cs = ConfigurationManager.ConnectionStrings[\"MYDB\"].ConnectionString;\n using (SqlConnection con = new SqlConnection(cs))\n { \n SqlCommand cmd = new SqlCommand(\"SELECT FirstName, LastName FROM Employee WHERE NOT EmployeeId = \" + userID, con);\n\n con.Open();\n GridView4.DataSource = cmd.ExecuteReader();\n GridView4.DataBind();\n } \n}"
] | [
"c#",
"asp.net",
"gridview",
"foreach"
] |
[
"Python Imaging Library save function syntax",
"Simple one I think but essentially I need to know what the syntax is for the save function on the PIL. The help is really vague and I can't find anything online. Any help'd be great, thanks :)."
] | [
"python",
"python-imaging-library"
] |
[
"Area-specific authetication schemes in ASP.NET Core",
"I have an ASP.NET Core MVC application that uses Windows Authentication to log in Users with their AD accounts. I now need to add a WebAPI component for external systems to interface with the app. However the consumers of the WebAPI need to authenticate using Bearer Tokens. My thought is to separate the application into 2 Areas - WebApp, which is the current MVC Controllers and Views; and WebAPI, which will be the REST Controllers.\n\nIs there a way to configure one Area to use Windows Auth (IISDefaults.AuthenticationScheme) and the other Area to use Bearer Tokens?"
] | [
"asp.net-core",
"asp.net-core-mvc",
"asp.net-core-webapi"
] |
[
"Twit pic photo upload with PlainOauth Library",
"I am using Twit pic in my app with following example.\n\nPlainOAuth\n\nIt was working fine and suddenly It is not uploading images. \n\nMessage on console is :\n\n\n Got HTTP status code from TwitPic: 401\n\n\nI don't know whats the problem .please help"
] | [
"iphone",
"oauth",
"twitpic"
] |
[
"Is there a way to create a central routing file which contains only routes and the functions they are for in Rocket?",
"Looking at the example code, they all define routes above the functions for handling them. For a bigger project this doesn't seem like it will scale.\n\nIs there a way to create a central routing file which contains only the routes and the functions they are for similar to routes.rb in Rails?\n\nHere is an example of a section of the routing file from the GitLab Rails app:\n\n# Autocomplete\nget '/autocomplete/users' => 'autocomplete#users'\nget '/autocomplete/users/:id' => 'autocomplete#user'\nget '/autocomplete/projects' => 'autocomplete#projects'\nget '/autocomplete/award_emojis' => 'autocomplete#award_emojis'\n\n# Search\nget 'search' => 'search#show'\nget 'search/autocomplete' => 'search#autocomplete', as: :search_autocomplete\n\n# JSON Web Token\nget 'jwt/auth' => 'jwt#auth'\n\n\nThis allows you to easily see which routes exist within the app without having to look throughout the project."
] | [
"routing",
"rust",
"rust-rocket"
] |
[
"Java public class Plane",
"Hi can someone give this program a look in? I don't understand why the output is _c. The answer in the book says \"Once s3() throws the exception to s2(),s2() throws it to s1(), and no more of s2()'s code will be executed.\". Why not?\n\npublic class Plane {\n static String s = \"_\";\n public static void main(String[] args) {\n new Plane().s1();\n System.out.println(s);\n }\n void s1() {\n try { s2(); }\n catch (Exception e) { s += \"c\"; }\n }\n void s2() throws Exception {\n s3(); s+= \"2\";\n s3(); s+= \"2b\";\n }\n void s3() throws Exception {\n throw new Exception();\n }\n\n}"
] | [
"java"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.