texts
sequence
tags
sequence
[ "Printing quoted multidimensional arrays in PHP", "I know in PHP you can echo variables with double-quotes, but if I try to echo a multidimensional array, it doesn't work. Like...\n\necho \"Here's my variable: $array[0][name]\";\n\n\nAnd that outputs : \"Array[name]\"\n\nIs there a way to print its value without closing the quotes?" ]
[ "php" ]
[ "Fonts Flickering With CSS/jQuery Animation... What's Causing This?", "This is the dev location for a site I am working on: http://www.plasticmonument.com/biomechaniks/index.html\n\nEvery time any jQuery slider animation takes place, all the fonts on the page flicker and or increase font-weight momentarily. What in the world is causing this? Driving me insane!" ]
[ "jquery", "css", "animation", "browser" ]
[ "meteor 0.9.1 , Mongo is not defined inside my custom Package", "Getting Exception Mongo is not defined inside my custom Package\n\nCODE\n\nABC = new Mongo.Collection('ABC');\n\n\nERROR\n\nW20140905-17:49:06.809(5.5)? (STDERR) /home/sandeep/.meteor/packages/meteor-tool/.1.0.27.18sl1cs++os.linux.x86_32+web.browser+web.cordova/meteor-tool-os.linux.x86_32/dev_bundle/lib/node_modules/fibers/future.js:173\nW20140905-17:49:06.809(5.5)? (STDERR) throw(ex);\nW20140905-17:49:06.810(5.5)? (STDERR) ^\nW20140905-17:49:06.810(5.5)? (STDERR) ReferenceError: Mongo is not defined" ]
[ "meteor" ]
[ "Apache configuration AWS API Gateway certificates", "I've created an AWS API Gateway and I'm pointing it at a VPS. I want to be able to enable Client-Side SSL Authentication to my VPS. I followed the AWS walkthrough here. I generated a PEM-encoded certificate in the API Gateway console and copied it to my Apache web server. It appears that the certificate and/or vhost configuration is causing a fatal error in the Apache SSL module.\n\nThe error log:\n\n[Tue Nov 10 10:53:57.140815 2015] [ssl:info] [pid 7283] AH01914: Configuring server example.com:443 for SSL protocol\n[Tue Nov 10 10:53:57.140998 2015] [ssl:trace1] [pid 7283] ssl_engine_init.c(724): Configuring permitted SSL ciphers [!aNULL:!eNULL:!EXP:HIGH:!aNULL]\n[Tue Nov 10 10:53:57.141165 2015] [ssl:debug] [pid 7283] ssl_engine_init.c(843): AH01904: Configuring server certificate chain (1 CA certificate)\n[Tue Nov 10 10:53:57.141175 2015] [ssl:debug] [pid 7283] ssl_engine_init.c(390): AH01893: Configuring TLS extension handling\n[Tue Nov 10 10:53:57.141204 2015] [ssl:emerg] [pid 7283] AH02572: Failed to configure at least one certificate and key for example.com:443\n[Tue Nov 10 10:53:57.141226 2015] [ssl:emerg] [pid 7283] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned\n[Tue Nov 10 10:53:57.141251 2015] [ssl:emerg] [pid 7283] AH02311: Fatal error initialising mod_ssl, exiting. See /var/log/apache2/error.log for more information\nAH00016: Configuration Failed\n\n\nApache vhost configuration:\n\n<VirtualHost *:443>\n ServerName example.com\n\n ServerAdmin webmaster@localhost\n DocumentRoot /var/www/example\n\n DirectoryIndex index.html\n\n SSLEngine on\n SSLCertificateChainFile ssl/ca.crt\n SSLVerifyDepth 1\n\n LogLevel info ssl:warn debug trace1\n\n ErrorLog ${APACHE_LOG_DIR}/error.log\n CustomLog ${APACHE_LOG_DIR}/access.log combined\n</VirtualHost>" ]
[ "apache", "amazon-web-services", "ssl-certificate", "pem", "aws-api-gateway" ]
[ "Google Cloud Build with kaniko cache fails", "I'm using Google Cloud Build along with kaniko cache for speedup. Until recently if worked perfectly, but now it's failing with\nERROR: build step 2 "gcr.io/kaniko-project/executor:latest" failed: step exited with non-zero status: 137\n\nI assume, it's because builder is running out of memory\nIs there a way to select higher level VM for this or increase memory?\nI'm using the same standard configuration that is described here.\nThanks in advance\nP.s. Regular builds with gcr.io/cloud-builders/docker are going through" ]
[ "google-cloud-platform", "google-cloud-build", "kaniko" ]
[ "How to change user logged token and reload it", "I'm in troble trying to get the token from already user logged and update it. I'm using a custom token extending UsernamePasswordToken.\n\nThe following code is placed in an action method.\n\n...\n$token = $this->get('security.context')->getToken();\n$token->setContact($contact);\n$this->get('security.context')->setToken($token);\n...\nreturn $this->redirect($this->generateUrl('public_homepage'));\n\n\nAfter this, dumping the token shows that the token has been updated.\n\nMy problem is, after redirecting, a voter has to check the contact. After some checks, when I dump the token received the contact is not set. I placed many logs and I'm very sure that the set is placed before the voter.\n\nAny help please? Thanks!\n\nUPDATE - Adding firewalls config\n\nfirewalls:\ndev:\n pattern: ^/(_(profiler|wdt)|css|images|js)/\n security: false\nprivate:\n pattern: ^/backend\n context: \"%firewall_context%\"\n anonymous: ~\n access_denied_url: /backend/login\n logout:\n path: /backend/logout\n target: /backend/login\n remember_me:\n key: asdAsda43\n name: asdasdcooas34\n lifetime: 3600 # in seconds \n form_login:\n check_path: /backend/login_check\n login_path: /backend/login\n use_referer: true\n\npublic:\n anonymous: ~\n access_denied_url: /login\n pattern: ^/\n context: \"%firewall_context%\"\n logout:\n path: /logout\n target: /\n remember_me:\n key: asdAsda43\n name: asdasdcooas34\n lifetime: 3600 # in seconds \n form_login:\n check_path: /login_check\n login_path: /login\n use_referer: true" ]
[ "symfony" ]
[ "Waiting for debugger to connect", "(excuse me for my english!) \n\nWhen i debug my app, the simulator is opening but with nothing... \nin the monodevelop ide, it shows alert box with message \"Waiting for debugger to connect...\" \n\nsometime, the simulator ask me the applicaton to load... but which? \n\nwhy? \n\nin the past, i had monodevelop 2.6 installed, then monodevelop 2.6 and 2.8 together, NOW: only monodevelop 2.8 \n\ncan somebody help me? \n\nhow i can resolve all this troubles? \n\nthank you" ]
[ "debugging", "mono", "xamarin.ios", "ios-simulator", "monodevelop" ]
[ "Upgrading to Django1.8 - invalid related_name for field", "I am upgrading my app from Django1.7->Django1.8, but I can't make any changes or even run migrations because I keep seeing the following system error whenever I attempt to perform any migration operation in the 1.8 environment\n\nERRORS:\ncontent.Content.polymorphic_ctype: (fields.E306) The name 'polymorphic_content.content_set' is invalid related_name for field Content.polymorphic_ctype\n HINT: Related name must be a valid Python identifier or end with a '+'\ncontent.Tag.polymorphic_ctype: (fields.E306) The name 'polymorphic_content.tag_set' is invalid related_name for field Tag.polymorphic_ctype\n HINT: Related name must be a valid Python identifier or end with a '+'\npromotion.PZoneOperation.polymorphic_ctype: (fields.E306) The name 'polymorphic_promotion.pzoneoperation_set' is invalid related_name for field PZoneOperation.polymorphic_ctype\n HINT: Related name must be a valid Python identifier or end with a '+'\nreviews.MediaItem.polymorphic_ctype: (fields.E306) The name 'polymorphic_reviews.mediaitem_set' is invalid related_name for field MediaItem.polymorphic_ctype\n HINT: Related name must be a valid Python identifier or end with a '+'\n\n\nThe problem is that 3 of those apps are part of a dependency and have already updated the related_name of the 3 fields to end with + in the 0001_initial.py migration, but I can't revert backwards due to the system errors. Kind of at loss with how to proceed with updating." ]
[ "django", "django-migrations" ]
[ "Fixed size for QML Dialog", "I want to forbid resizing for the following Dialog window:\n\nDialog {\n id: aboutDialog\n width: 300\n height: 200\n title: \"About\"\n standardButtons: StandardButton.Ok\n\n GridLayout {\n rows: 2\n columns: 2\n\n Text { text: \"Some:\"; font.bold: true; }\n Text { text: \"text\"; }\n Text { text: \"and:\"; font.bold: true }\n Text { text: \"another\"; }\n }\n}\n\n\nWhy there is no property like resizable: false? Or is there?\n\nAnd if I add minimumWidth property, then I get the error: Cannot assign to non-existent property \"minimumWidth\"\n\nHow can I achieve my goal?\n\nupd. Filip helped me with his answer, but still, to make this window non-resizable I have to write this:\n\nwidth: 300\nminimumWidth: 300\nmaximumWidth: 300\nheight: 200\nminimumHeight: 200\nmaximumHeight: 200\n\n\ninstead of something like: resizable: false. It's just a bit a lot of lines for such a task." ]
[ "qt", "qml", "qtquick2" ]
[ "java.net.NetworkInterface.getNetworkInterfaces() finding the \"real\" interfaces", "I am a little confused regarding the return values from NetworkInterface.getNetworkInterfaces(). I am trying to filter through the list of NetworkInterface objects to figure out which are \"real\" (backed by actual hardware). The code looks like...\n\nEnumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();\nwhile ( e.hasMoreElements() ) {\n NetworkInterface iface = (NetworkInterface) e.nextElement();\n if ( !iface.isLoopback() && !iface.isVirtual() ) {\n byte[] macAddress = iface.getHardwareAddress();\n String message = String.format(\n \"%s %s parent: %s\",\n iface.getName(),\n byteArrayToHexString( macAddress ),\n iface.getParent() );\n System.out.println( message );\n }\n}\n\n\n...and the output like...\n\nvnic1 00 1C 42 00 00 09 parent: null\nvnic0 00 1C 42 00 00 08 parent: null\nen1 60 33 4B 20 C4 97 parent: null\n\n\nI know that the \"vnic1\" and \"vnic0\" ones aren't \"real\" (they got put there by Parallels to support a VM I sometimes run on this machine). Is there a way through NetworkInterface that I can detect the not \"real\" ones or are they effectively indistinguishable from their actual counterparts, like \"en1\"? I would hate to have to resort to becoming dependent upon name like \"its real if its name is en0 or en1\". Any ideas?" ]
[ "java" ]
[ "how concatenate strings that are pathed to a function in bash?", "I'm creating a script that is supposed to create jobs on a HPC (cluster). I have created a function that gets 4 variables and create a string from them:\n\nstartJob (){\n if [ $per -lt 10 ]; then\n folder=/storage/users/avityo/prog/0$1.$2$3\n else\n folder=/storage/users/avityo/prog/$1.$2$3\n fi\n echo $folder\n}\n\n\nIn the result I get from this, there is a separation by commas\n\n/storage/users/avityo/prog/00,.583,bfd,\n\n\nHow can I remove these commas? \n\nEdit:\nJudging from the answers and comment I got, I should have mentioned how I call this function I have realized I'm not calling the function in the right way. I was using this:\n\nlet count=0\n\nfor per in $(seq 70 -5 0); do\n for seed in {580..583}; do\n for c in {\"fs\",\"fd\",\"bfs\",\"bfd\"}; do\n let count=$count+1\n startJob $per, $seed, $c, $count\n done\n done\ndone\n\n\nremoving the commas when calling the function fixed this." ]
[ "string", "bash", "string-concatenation" ]
[ "Create 2-dimensional array from dataframe object", "I have a dataframe object as follows:\n\n'Name' 'Book' 'Rating'\n\n'John' 'Moby Dick' 5\n\n'John' 'The Alchemist' 3\n\n'John' 'The Da Vinci Code' 4\n\n'Peter' 'Moby Dick' 4\n\n'Peter' 'Lolita' 5\n\n'Mike' 'The Alchemist' 4\n\n'Mike' 'The Da Vinci Code' 3\n\n\nI want to create a 2-d array from this data of size [len('Name')][len('Book')] and the values of the array should be the ratings. If a person has not rated a book, value should be zero.\n\n5 3 0 4\n\n4 0 5 0\n\n0 4 0 3\n\n\nHere, my first row corresponds to John, next Peter and last row Mike and 1st column corresponds to Moby Dick, 2nd to The Alchemist, 3rd to Lolita and 4th to The Da Vinci Code.\n\nI have tried the following where I scan the entire object (twice I believe, to get a match for each column).\n\nimport pandas\nimport numpy\n\ndf = read_from_file\n\nuName = df['Name'].unique().tolist()\nuBook = df['Book'].unique().tolist()\nm = numpy.zeros((len(uName), len(uBook)))\n\nfor i in range(0, len(uName)):\n for j in range(0, len(uBook)):\n x = df.loc[(df['Name'] == uName[i]) & (df['Book'] == uBook[j])]\n if x.empty:\n m[i][j] = 0\n else:\n m[i][j] = x.Rating\n\n\nIt gives me the right results but it's extremely inefficient. My dataframe is huge - ~50,000 rows, and it takes forever to run this piece of code. Can you help me with a more efficient way to achieve this? Thanks." ]
[ "python", "python-3.x", "pandas", "numpy", "multidimensional-array" ]
[ "InfinitePagingView infinite loop in uiscrollview", "I'm using an InfinitePagingView from here.\n\nI am searching for a way to modify the class so that the InfinitePagingView will be infinite to the left, too. As it is, it is only infinite when scrolling right.\nHere is the original class file.\n\nI added a variable int pageCount; which is set by the delegate to be the count of the available arrays.\n\nBut I don't have a clue how to go on now.\n\nPlease help me with it by giving some tips." ]
[ "iphone", "objective-c", "uiscrollview", "infinite-loop" ]
[ "SAPUI5: Wizard / Branching - Wait for OData return on complete Event of WizardStep", "my problem is as follows.\n\nI have a Wizard in Branching mode. On completing a Step of the Wizard, the complete method is called. Within this method I send out an OData call to the Backend to determin the NextStep that should be shown. Hence the call will return the NextStep it is not defined yet and the Framework will Crash with the error, that the NextStep is not defined.\n\nSo is there a way to pause/wait/sleep for the return of the OData call without crashing the Framework?\n\nI would appreciate every help.\nThanks!\n\nExample XML:\n\n<Wizard id=\"MainWizard\" complete=\"wizardCompletedHandler\" enableBranching=\"true\">\n <WizardStep id=\"Step1\" title=\"title\" validated=\"true\" subsequentSteps=\"Step2, Step3\" complete=\"onStepOneComplete\"\n icon=\"sap-icon://multi-select\">\n\n\nExample onStepOneComplete:\n\nonStepOneComplete: function(oEvent) {\n\n\n this.getView().getModel().submitChanges();\n\n var iNextStep = parseInt(this.getView().getModel().getProperty(\"/SomeSet('123')/NextStep\"), 10);\n\n this.byId(\"Step1\").setNextStep(iNextStep);\n }" ]
[ "javascript", "odata", "sapui5" ]
[ "Rich Text Format: Overlapping cells", "I have a little problem with RTF:\nIn our company, we are using a software, where you can send reports to a printer. The report is a RTF-file, created by the software, which uses a RTF-template to create the file, and then sends it to the default printer.\n\nIt will print just fine (everything is formatted correctly), but if you want to print a report, which has a table in it, while having a Word document open, the content from all the cells from one row will be shown in the first cell. It looks like, that it would write one text over the other. Here's a Picture of what the table content looks like\n\nBut this only happens the first time. When you print the same report again, all the cells are in their correct positions.\n\nWord is set as the default application, to view RTF-files.\n\nThis problem only appears with the Office versions 2007 and 2010 in combination with Windows 7. With Office 2003 and Windows XP there is no such a problem. The software works properly. It seems like a problem, caused by Office (2007+).\n\nIs there a known issue since Office 2007, regarding tables in RTF-files?\n\nGreetings,\nSpooky" ]
[ "rtf", "word-2010", "word-2007" ]
[ "Cannot transfer value to another class ( c# )", "I have the first class named:\n\n Appartments[] appartments;\n\n\nI want to copy the value of \"Number\" and paste it to \"AppartmentInfo.cs\" class( I guess they are called Parameters).\n\n public static void FindFloor(Appartments[] appartments, int amount,out int floorToRound,out AppartmentInfo[] AInfo)\n {\n floorToRound = 0;\n AInfo = new AppartmentInfo[Max];\n for (int i = 0; i < amount; i++)\n {\n AInfo[i].Floor1 = Convert.ToDouble(appartments[i].Number);\n Console.WriteLine(appartments[i].Number);\n if (appartments[i].Number < 27)\n {\n appartments[i].Number = 1;\n }\n else\n {\n\n appartments[i].Number /= 27;\n }\n }\n }\n\n\nIf there is a need I can post the whole code. I get the error:\nNullReferenceException was unhandled.\n\nError on the line:\n\nAInfo[i].Floor1 = Convert.ToDouble(appartments[i].Number);\n\n\n\n\nFULL CODE:\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.IO;\n\nnamespace P3._1\n {\nclass Program\n{\n public const int Max = 20;\n static void Main(string[] args)\n {\n int amount, AmountOfRooms, price, floor, floorToRound;\n Appartments[] appartments;\n AppartmentInfo[] AInfo;\n //AppartmentInfo AInfo = new AppartmentInfo();\n ReadData(out appartments, out amount);\n TextImput(out floor, out AmountOfRooms, out price);\n FindFloor(appartments, amount,out floorToRound,out AInfo);\n Console.ReadKey();\n }\n public static void ReadData(out Appartments[] appartments, out int amount)\n {\n amount = 0;\n appartments = new Appartments[Max];\n using (StreamReader reader = new StreamReader(\"C:\\\\Users\\\\Andrius\\\\Desktop\\\\Mokslams\\\\C#\\\\Pratybos\\\\P3\\\\P3.1 be konstruktoriaus\\\\Appartments.csv\", true))\n {\n reader.ReadLine();\n string line = null;\n while (null != (line = reader.ReadLine()))\n {\n string[] values = line.Split(',');\n int number = int.Parse(values[0]);\n int area = int.Parse(values[1]);\n int rooms = int.Parse(values[2]);\n int sellingCost = int.Parse(values[3]);\n int phone = int.Parse(values[4]);\n\n Appartments appartmentsObj = new Appartments(number, area, rooms, sellingCost, phone);\n appartments[amount++] = appartmentsObj;\n }\n }\n }\n\n public static void TextImput(out int floor, out int AmountOfRooms, out int price)\n {\n AmountOfRooms = 0;\n price = 0;\n Console.WriteLine(\"Iveskite buto aukštą: \");\n floor = int.Parse(Console.ReadLine());\n Console.WriteLine(\"Iveskite kambariu skaiciu: \");\n AmountOfRooms = int.Parse(Console.ReadLine());\n Console.WriteLine(\"Maksimali kaina: \");\n price = int.Parse(Console.ReadLine());\n\n\n }\n\n public static void FindFloor(Appartments[] appartments, int amount,out int floorToRound,out AppartmentInfo[] AInfo)\n {\n floorToRound = 0;\n AInfo = new AppartmentInfo[Max];\n for (int i = 0; i < amount; i++)\n {\n AInfo[i].Floor1 = Convert.ToDouble(appartments[i].Number);\n Console.WriteLine(appartments[i].Number);\n if (appartments[i].Number < 27)\n {\n appartments[i].Number = 1;\n }\n else\n {\n\n appartments[i].Number /= 27;\n }\n }\n }\n\n\n\n\n}\n\n\n}" ]
[ "nullreferenceexception" ]
[ "Trouble with initial rails gem install on OSX 10.9 Mavericks", "After a little hastle I have rbenv and ruby installed. When I try to install rails, I'm failing here:\n\n$ gem install rails -v 4.2.3\n\n[....]\n\nchecking for main() in -llzma... yes\nchecking for xmlParseDoc() in libxml/parser.h... no\nchecking for xmlParseDoc() in -lxml2... no\nchecking for xmlParseDoc() in -llibxml2... no\n-----\nlibxml2 is missing. Please locate mkmf.log to investigate how it is failing.\n-----\n*** extconf.rb failed ***\nCould not create Makefile due to some reason, probably lack of necessary\nlibraries and/or headers. Check the mkmf.log file for more details. You may\nneed configuration options.\n\n[....]\n\n\nI use macports for my package management and it seems like libxml2 is present (as I expect it would be):\n\n$ port list *libxml*\nlibxml @1.8.17 textproc/libxml\nlibxml2 @2.9.2 textproc/libxml2\nlibxmldiff @0.2.5 textproc/libxmldiff\nlibxmlxx @1.0.5 textproc/libxmlxx\nlibxmlxx2 @2.38.1 textproc/libxmlxx2\np5-libxml-enno @1.20.0 perl/p5-libxml-enno\np5-libxml-perl @0.80.0 perl/p5-libxml-perl\np5-xml-libxml @2.12.300 perl/p5-xml-libxml\np5-xml-libxml-simple @0.950.0 perl/p5-xml-libxml-simple\np5-xml-rss-libxml @0.310.500 perl/p5-xml-rss-libxml\np5.16-libxml-enno @1.20.0 perl/p5-graveyard\np5.16-libxml-perl @0.80.0 perl/p5-graveyard\np5.16-xml-libxml @2.12.300 perl/p5-graveyard\np5.16-xml-libxml-simple @0.950.0 perl/p5-graveyard\np5.16-xml-rss-libxml @0.310.500 perl/p5-graveyard\np5.18-libxml-enno @1.20.0 perl/p5-graveyard\np5.18-libxml-perl @0.80.0 perl/p5-graveyard\np5.18-xml-libxml @2.12.300 perl/p5-graveyard\np5.18-xml-libxml-simple @0.950.0 perl/p5-graveyard\np5.18-xml-rss-libxml @0.310.500 perl/p5-graveyard\np5.20-libxml-enno @1.20.0 perl/p5-graveyard\np5.20-libxml-perl @0.80.0 perl/p5-graveyard\np5.20-xml-libxml @2.12.300 perl/p5-graveyard\np5.20-xml-libxml-simple @0.950.0 perl/p5-graveyard\np5.20-xml-rss-libxml @0.310.500 perl/p5-graveyard\np5.22-libxml-enno @1.20.0 perl/p5-libxml-enno\np5.22-libxml-perl @0.80.0 perl/p5-libxml-perl\np5.22-xml-libxml @2.12.300 perl/p5-xml-libxml\np5.22-xml-libxml-simple @0.950.0 perl/p5-xml-libxml-simple\np5.22-xml-rss-libxml @0.310.500 perl/p5-xml-rss-libxml\npy-libxml2 @2.9.2 python/py-libxml2\npy24-libxml2 @2.9.2 python/py-graveyard\npy25-libxml2 @2.9.2 python/py-graveyard\npy26-libxml2 @2.9.2 python/py-graveyard\npy27-libxml2 @2.9.2 python/py-libxml2\npy34-libxml2 @2.9.2 python/py-libxml2\npy35-libxml2 @2.9.2 python/py-libxml2\nrb-libxml2 @2.3.4 ruby/rb-libxml2" ]
[ "ruby-on-rails", "macos", "rubygems", "osx-mavericks", "libxml2" ]
[ "connect function block when a router cannot connect to internet", "I'm using the basic socket functions in C language, the line below: \n\nint res = connect(sock_fd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));\n\n\n1. when my laptop is can access the internet, connect will return immediately,connection is built as expected.\n2. when my laptop is offline, connect will return immediately, the errno is \"network is unreachable.\n3. when my laptop is connected to a wifi network that cannot access internet directly(need login opration or sth else), connect will block about 20 seconds before return, the errno is \"connection refused\"\nIt can be solved by set the sock_fd nonblocking, I want to know why it takes such a long time before connect return a connection mistake in the third situation?" ]
[ "c", "sockets", "network-programming" ]
[ "Installing and distributing SQL Server without Management Studio", "Have developed a small Windows application using SQL Server as its database.\n\nI need to give the installation pack to my customer, and include the required SQL Server 2005 Enterprise Edition. \n\nHow can I distribute my database without including Management Studio?" ]
[ "sql-server", "windows", "deployment" ]
[ "How to display sorting methods from PROC CONTENTS in SortedBy field?", "I am trying to show that my data has been sorted within my PROC contents output. Within this output there is an attribute called \"SortedBy\" and within that it shows how the contents were sorted (to the best of my knowledge). \n\nMy question is, how can I get my output to look like the below: \n\n\n\nHere is my code:\n\n/*Not sorted*/\nproc contents data = I.projects;\nrun;\n\n/*Sorted*/\nproc sort data = WORK.projects out = projects;\nby REGION descending POL NAME;\nrun;\nproc contents data = WORK.projects;\nrun;" ]
[ "sas" ]
[ "How to link a custom paper format to a pdf report in Odoo 8?", "I want to print labels from odoo. For that I created a custom paper format and finding a way to link it to my label report. My label report is a pdf report. (When I create the report I can view it in the default paper format.)\n\nthis is the code for custom paper format\n\n<openerp>\n<data>\n <record id=\"mymodule_label\" model=\"report.paperformat\">\n <field name=\"name\">Item Label</field>\n <field name=\"default\" eval=\"True\"/>\n <field name=\"format\">custom</field>\n <field name=\"page_height\">50</field>\n <field name=\"page_width\">100</field>\n <field name=\"orientation\">Portrait</field>\n <field name=\"margin_top\">3</field>\n <field name=\"margin_bottom\">3</field>\n <field name=\"margin_left\">3</field>\n <field name=\"margin_right\">3</field>\n <field name=\"header_line\" eval=\"False\"/>\n <field name=\"header_spacing\">3</field>\n <field name=\"dpi\">80</field>\n </record>\n</data>\n</openerp>\n\n\nI repeat my problem is how to link this paper format with my pdf report" ]
[ "xml", "report", "odoo", "odoo-8", "qweb" ]
[ "How to Set UTF-8 response on doPost() call?", "I Am trying to have a JSON response back to the page with UTF-8 data, as it is what i have posted from the Form to my osgi servlet. The Servlet code is as shown below:\n\nimport org.json.simple.JSONArray;\n import org.json.simple.JSONObject; \n\n@SlingServlet(paths=\"/bin/JsonOsgiCall\", methods = \"POST\", metatype=true)\npublic class JsonOsgiCall extends org.apache.sling.api.servlets.SlingAllMethodsServlet {\n private static final long serialVersionUID = 2598426539166788515L;\n protected final Logger log = LoggerFactory.getLogger(this.getClass());\n\n @Override\n protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServerException, IOException {\n response.setContentType(\"text/html; charset=UTF-8\");\n response.setCharacterEncoding(\"UTF-8\");\n request.setCharacterEncoding(\"UTF-8\");\n PrintWriter out = response.getWriter();\n JSONObject jsonobj = new JSONObject();\n\n try { \n\n jsonobj.put(\"testint\", 30);\n jsonobj.put(\"myjspstring\", request.getParameter(\"userinmsg\"));\n jsonobj.put(\"myjspstati\",\"`İş hayatında ne çok engelle karşılaşıldığını,`\");\n JSONArray list = new JSONArray();\n list.add(\"message 1\");\n list.add(\"message 2\");\n jsonobj.put(\"messages\", list);\n log.info(\"*** JSON Object with ***\" + jsonobj.toJSONString());\n //out.println(jsonobj.toJSONString());\n out.println(jsonobj); \n } \n catch (Exception e) {\n e.printStackTrace();\n}\n}\n}\n\n\nAnd my JSP Form code shown as below:\n\n<%@include file=\"/libs/foundation/global.jsp\"%><%\n %><%@page session=\"false\" %>\n <%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\" pageEncoding=\"UTF-8\"%>\n <%@ page import=\"org.json.simple.JSONObject,java.io.PrintWriter,java.util.*\"%>\n <%\n %>CALL OSGI SERVICE FOR JSON RESPONSE\n <cq:includeClientLib js=\"granite.csrf.standalone\"/>\n <head>\n <meta charset=\"UTF-8\" />\n <meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n <title>Editer les sous-titres</title>\n </head>\n <body>\n <form id=\"submitForm\" method=\"POST\" action=\"/bin/JsonOsgiCall\">\n <textarea name=\"userinmsg\" autocomplete=\"off\" type=\"text\" id=\"userinmsg\" rows=\"4\" cols=\"30\" style=\"width: 450px; margin-left: 25px;\">\n </textarea>\n <br/>\n\n <p style=\"margin-left: 420px;\"><input name=\"submitmsg\" type=\"submit\" id=\"submitmsg\" value=\"Call JSON Service\" /></p>\n\n </form>\n </body>\n\n\nBut when I submit the Form and see the output that has resulted back to the page is like with ANSI format. Where the the JSON data that I have added in the: \n\njsonobj.put(\"myjspstati\",\"İş hayatında ne çok engelle karşılaşıldığını,\"); \n\nIn between code snippet is coming fine back to page. But where as the form submitted same code is breaking when it received into servlet with: \n\nrequest.getParameter(userinmsg)\n\nHow can I get the UTF enabled data that can be properly sent to Servlet and can do the JSON object with same.\n\n\n\n\nDebugging in my browser Developer tools\nRequest Headers\n\n\nResponse" ]
[ "java", "jsp", "osgi", "aem", "sling" ]
[ "Bottom border appears when I open a page on a smaller screen", "I have a page containing several sections.\n\nOne of the section has a list on it, when I'm opening it on a bigger screen it looks OK, but when I open it on a smaller screen, it will be scrollable (which is OK) but it also has a thick border on bottom, the list is not visible down to the end of the screen.\n\nThere is no other sections under it.\n\nThis is the CSS of the list section:\n\n.sites-list {\n height: 50%;\n padding-left: 10rem;\n background-color: #ffffff;\n text-align: left;\n font-size: 20px;\n color: #a9611a;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n\nAny ideas how to solve it? Thanks" ]
[ "css" ]
[ "Spring Data MongoDB how do I set auto-connect-retry=\"true\" with javaconfig style?", "Spring Data MongoDB how do I set auto-connect-retry=\"true\" with javaconfig style?\n\nbelow is my config class can someone please let me know? what I want is if its running and one of the nodes go down I would like it to auto=connect to the new node\n\n@Configuration\n@EnableMongoRepositories\n@ComponentScan(basePackageClasses = {MongoDBApp.class})\n@PropertySource(\"classpath:application.properties\")\npublic class MongoConfiguration extends AbstractMongoConfiguration {\n\n\n @Override\n protected String getDatabaseName() {\n return \"demo\";\n }\n\n\n\n @Override\n public Mongo mongo() throws Exception {\n /**\n *\n * this is for a single db\n */\n\n Mongo m = new Mongo();\n m.setOptions();\n // return new Mongo();\n\n\n /**\n *\n * This is for a relset of db's\n */\n\n return new Mongo(new ArrayList<ServerAddress>() {{ add(new ServerAddress(\"127.0.0.1\", 27017)); add(new ServerAddress(\"127.0.0.1\", 27027)); add(new ServerAddress(\"127.0.0.1\", 27037)); }});\n\n }\n\n @Override\n protected String getMappingBasePackage() {\n return \"com.xxx.mongodb.example.domain\";\n }\n\n}" ]
[ "spring", "mongodb", "spring-data", "spring-data-mongodb" ]
[ "Using pattern matching and modulus on the command line", "I'm using a ksh pattern match to filter a list of files in a directory, as below.\n\nfn=\"${file##*[!0-9]}\"\nif [[ -n $fn && $(( $fn % 2 )) -eq 0 ]]\n\n\nWould it be possible to use the same pattern match and modulus operator on the command line in a ls command?\n\nUltimately I'd like to be able to perform this in a single loop statement.\n\nfor file in mail.sh*\ndo\ndone" ]
[ "regex", "ksh" ]
[ "WebSecurityConfigurerAdapter add to root context in non Servlet 3.0 container", "I have an example web app which I am using as a sample to convert an existing servlet 2.4 application to move from XML based Security config to the new Java config based style as described here. Spring Security Java Config Preview\n\nMy security configuration is as follows:\n\n@Configuration\n@EnableWebSecurity\n@Slf4j\npublic class WebSecurityConfig extends WebSecurityConfigurerAdapter {\n\npublic WebSecurityConfig() {\n log.info(\"init\");\n}\n\n@Override\nprotected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception {\n auth.inMemoryAuthentication().withUser(\"user\").password(\"password\").roles(\"USER\");\n}\n\n@Override\npublic void configure(WebSecurity web) throws Exception {\n web.ignoring().antMatchers(\"/resources/**\");\n}\n\n@Override\nprotected void configure(HttpSecurity http) throws Exception {\n http\n .authorizeUrls()\n .antMatchers(\"/\",\"/home\").permitAll() \n .antMatchers(\"/secure/**\").hasRole(\"USER\")\n .anyRequest().authenticated()\n .and()\n .formLogin() \n .loginUrl(\"/login\") \n .permitAll();\n}\n}\n\n\nThe problem is that the documentation/examples are based on servlet 3.0 specs, which do not use web.xml\n\nThe documentation uses AbstractAnnotationConfigDispatcherServletInitializer but I cannot use this in a servlet 2.4 container.\n\nI bootstrap my MVC app using web.xml like this:\n\n<servlet>\n <servlet-name>my-spike</servlet-name>\n <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>\n <init-param>\n <param-name>contextClass</param-name>\n <param-value>\n org.springframework.web.context.support.AnnotationConfigWebApplicationContext\n </param-value>\n </init-param>\n <init-param>\n <param-name>contextConfigLocation</param-name>\n <param-value>com.example.config.WebMvcConfig</param-value>\n </init-param>\n</servlet>\n\n\nSo the question is how to add my WebSecurityConfig to the root application context in web.xml, or in Java code?" ]
[ "java", "spring-security", "annotations" ]
[ "Ruby += assignment operator", "foo = [10,20,30,40,50,60]\nfoo_total = 0\nfoo.each do |f|\n print foo_total += f\nend\nprint foo_total\n\n\nThe output of this code sample will be 10 30 60 100 150 210 210 but I'm actually looking for 10 20 30 40 50 60 210\nI know that it can be achieved by using the following code\n\nfoo = [10,20,30,40,50,60]\nfoo_total = 0\nfoo.each do |f|\n print f\n foo_total += f\nend\nprint foo_total\n\n\nHowever, is there a more elegant approach that needs just one line in the foo.each block?\n\nedit: It's not only about the output, but also about having the variable foo_total that contains the sum of all values in foo" ]
[ "ruby" ]
[ "Microsoft Visual C++ Runtime Library - Runtime Error - How to suppress the error", "It looks like a duplicate, but believe I checked other answers, nothing worked.\n\nMy application started crashing while closing the application with below error. It was working properly few days back, some recent changes is causing the issue. And one this starts on a machine, even though I replace with previous working DLL, still the issue comes.\n\nMicrosoft Visual C++ Runtime Library\nRuntime Error!\n\nProgram:C:\\DigiMic\\...\n\n\nThis application has requested the Runtime to terminate it in an unusual way...\nThis pop-up comes for 1 second with OK button, then automatically closes. The main problem is it happens while shutting down my application.\nMy Application: It is a WPF, C# application which uses Matlab used business DLL for few functionality. The application works fine while using the Matlab used DLL and its function, only crashes while exiting the WPF. \n\nI tried to Wrap the App.Current.ShutDown with try..catch... but the it never hits catch orfinally block. Then I also tried AppDomain.Current.UnHandledException += new..., it still does not hit the function on exception.\n\nThe other problem is, I am not able to see the complete path of the exe that causes this exception.\n\nQuestion:\n\n\nIs there a way, I can suppress this error?\nWhere is this error gets logged in windows?I tried to look into Event Viewer, but nothing is there.\nIs there any workaround? Since it's software delivery time for the product. :(" ]
[ "c#", "c++", ".net", "wpf", "matlab" ]
[ "Why is there a red line next to my logo?", "I have an odd redline next to my logo, and I can't for the life of me work out why.\n\nTake a look: \nhttp://www.pdf-explode.com.au/index.php\n\nHere's the red line I'm talking about:\nhttp://www.bounceapp.com/66618\n\n\nI've tried looking at all the borders, there's no red. \nsearched through backgrounds, no red. \ninspector can't inspect it.\nit's not in the image\n\n\nLet me know if you can find it." ]
[ "html", "css", "image" ]
[ "How to process array element into MySQL with PHP?", "I want to get elements of an array, and put it to MySQL query using PHP like this:\n\n$ArrayOne = {3, 5, 8, 2};\n$sql = SELECT * from myTable WHERE id1='3' and id2='5' and id3='8' and id4='2';\n\n\nI do it like this, but it's failed:\n\nfor ($i=0; $i<count($ArrayOne); $i++) {\n $element.$i = $ArrayOne[$i];\n}\n $sql = (\"SELECT * from myTable WHERE id1=\". $element.$i .\" and id2=\". $element.$i .\" and id3=\". $element.$i .\" and id4=\". $element.$i .\");\n\n\nI think the $element.$i has the same value, but I don't know how to get the different value of Array element.\nAnd if I do like this, it's also wrong.\n\nfor ($i=0; $i<count($ArrayOne); $i++) {\n $element.$i = $ArrayOne[$i]; \n $sql = (\"SELECT * from myTable WHERE id1=\". $element.$i .\" and id2=\". $element.$i .\" and id3=\". $element.$i .\" and id4=\". $element.$i .\");\n}\n\n\nCan any body give the solution?" ]
[ "php", "mysql" ]
[ "How to apply regexp to the cell array in Matlab?", "I'm having the cell array res with cells 3x2, each of them containing a string. I want to apply regexp to each cell and it should look like that:\n\nfin = cellfun(@regexp(res, '\\.', 'split'),res,'UniformOutput',false)\n\n\nhowever it doesn't do the job. Anyone knows how it can be combined properly?" ]
[ "regex", "matlab", "cell-array" ]
[ "Routing cyrillic characters in codeigniter", "How to allow the routing of cyrillic characters in codeigniter ?" ]
[ "php", "codeigniter" ]
[ "Reactively chaining requests", "I'm new to reactive programming and stuck at a probably simple point.\nI have two methods returning observables. \n\nGetQueues(): Observable<Queue[]>{...}\n\n\nand \n\nGetMessageCount(queue: Queue): Observable<number>{...}\n\n\nNow I want to chain these in a method with the following signature\n\nGetAllQueueMessageCount(): Observable<number>{...}\n\n\nAs you can imagine, I want to call the first method to read a list of queues, iterate over the result and call the second one for each of them. \n\nI can imagine something like the following, but as you see, this doesn't return what the signature expects:\n\npublic GetAllQueueMessageCount(): Observable<number> {\n var messageCount = 0;\n this.GetQueues()\n .subscribe(queues => {\n var queueCountRequests = [];\n queues.forEach((queue) => {\n queueCountRequests.push(this.GetQueueMessageCount(queue));\n });\n Observable.forkJoin(queueCountRequests)\n .subscribe(t => {\n t.forEach(\n count => messageCount = messageCount + (count as number));\n });\n }, error => Observable.throw(error));\n}\n\n\nAll my attempts using flatMap resulted in the same." ]
[ "angular", "rxjs", "reactive-programming" ]
[ "Why does \"return s and s.strip()\" work when using filter?", "def not_empty(s):\n return s and s.strip()\n\nlist(filter(not_empty, ['A', '', 'B', None, 'C', ' ']))\n# result: ['A', 'B', 'C']\n\n\nI don't know why this worked.\nI know that : x and y if x is false, then x, else y.\nSo first is return 'A' and 'A'.strip().\nBut this showed in python IDLE\n\n\n>>>'A' is True\nFalse\n>>>'A' is False\nFalse\n\n\n\nSo. not_empty('A') returned 'A', right? 'A'is not True, why is it in the result?\n\nAnd why \n\n\n not_empty(' ')\n ''\n\n\n' ' is also False.\n\n\n>>>' ' is True\nFalse\n>>>' ' is False\nFalse" ]
[ "python", "list", "filter", "short-circuiting" ]
[ "Why does Logout in ASP.NET Identity use POST instead of GET?", "The sample Identity project uses this to log out:\n\n@if (Request.IsAuthenticated) {\n using (Html.BeginForm(\"LogOff\", \"Account\", FormMethod.Post, new { id = \"logoutForm\", @class = \"navbar-right\" })) {\n @Html.AntiForgeryToken()\n <ul class=\"nav navbar-nav navbar-right\">\n <li>@Html.ActionLink(\"Hello \" + User.Identity.GetUserName() + \"!\", \"Index\", \"Manage\", routeValues: null, htmlAttributes: new { title = \"Manage\" })</li>\n <li><a href=\"javascript:document.getElementById('logoutForm').submit()\">Log off</a></li>\n </ul>\n }\n}\n\n\nAnd the AccountController.LogOff() action method has a [HttpPost].\n\nThe only reason I can think of to use a POST rather than a GET, is the [ValidateAntiForgeryToken]. And I don't see the purpose to that, all we're doing is logging out.\n\nSurely this is overkill? Why not use a regular GET link?" ]
[ "asp.net", "asp.net-mvc", "asp.net-identity" ]
[ "c# assign a button custom location on FlowLayoutPanel", "I have a FlowLayoutPanel on which I have some Buttons ordered vertically (the panel ordered automatically just the way I wanted). But now I want to place another button1 but with a custom location (at the top right corner of FlowLayoutPanel). So far I tried button1.Location = new Point(x,y); but the button1 is still placed in order. Can you help me? Thanks" ]
[ "c#", "winforms", "flowlayoutpanel" ]
[ "Matlab: webread is reading a subset of the data not all data", "I want to cluster a dataset records stored on a server using Matlab. I used webread to read the data from the server.\n\nurl1 = 'http://localhost:8011/contentC:/xqy/features_3sets.xqy';\nurl2 = 'http://localhost:8003/contentC:/xqy/features_3sets.xqy';\n\noptions = weboptions('Username','admin','Password','admin', 'ContentType','auto' , 'Timeout', 8000);\n\ncsv_data = webread(url1, options);\ncsv_testing= webread(url2, options);\n\n%read data and convert to matrix\nextracted_data=textscan(csv_data,'%s%s%s%s%s%s%s', 'delimiter',',');\nattributes=[extracted_data{1} extracted_data{2} extracted_data{3} extracted_data{4} extracted_data{5} extracted_data{6} extracted_data{7}];\n\nextracted_testing=textscan(csv_testing,'%s%s%s%s%s%s%s', 'delimiter',',');\nattributes_testing=[extracted_testing{1} extracted_testing{2} extracted_testing{3} extracted_testing{4} extracted_testing{5} extracted_testing{6} extracted_testing{7}];\n\n\nI'm having a problem with the number of records returned by webread. The number of records saved on the server is 764, while the number of records that were returned by webread is 382. I need all records to be returned. NOTE: it seems like it is returning half of the data size 764/2=382\n\nReturned data:A single data record looks like this\n\nplah plah ,nursg,low back pa risk factor staff,low back pa,low back pa risk factor staff,back pa risk factor epidemiology,plah,\n\n\nI have printed csv_data I got this message at the end of the data Output truncated. Text exceeds maximum line length of 25,000 characters for Command Window display.. Is it possible the there is a limit for reading data?" ]
[ "matlab", "csv" ]
[ "Managing a log stream in C++ in a cout-like notation", "I have a class in c++ in order to write log files for an application of mine. I have already built the class and it works, it is something like this:\n\nclass Logger {\n std::string _filename;\npublic: \n void print(std::string tobeprinted);\n}\n\n\nWell, it is intuitive that, in order to print a line in the log file, for an object of Logger, it is simply necessary to do the following:\n\nLogger mylogger(\"myfile.log\");\nmylogger.print(std::string(\"This is a log line\"));\n\n\nWell. Using a method approach is not the same as using a much better pattern like << is.\nI would like to do the following:\n\nLogger mylogger(\"myfile.log\");\nmylogger << \"This is a log line\";\n\n\nThat's all. I suppose I must overload the << operator... But overloading using this signature (the classic one):\n\nostream& operator<<(ostream& output, const MyObj& o);\n\n\nBut I do not have a ostream...\nSo, should I do as follows?\n\nLogger& operator<<(Logger& output, const std::string& o);\n\n\nIs this the right way?\nThanks" ]
[ "c++", "logging", "printing", "operator-overloading" ]
[ "Adding to an array using a no arg constructor", "I seem to be stuck on how to add to an array by using a no-arg constructor. What is it that I am missing here? \n\npublic class Book {\nprivate String title;\nprivate String author;\nprivate int pages;\nprivate double price;\npublic static int numBooks = 0;\n\n\npublic Book(String title, String author, int pages, double price) {\n super();\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.price = price;\n numBooks++;\n}\npublic Book() {\n super();\n numBooks++;\n}\n\npublic String getTitle() {\n return title;\n}\n\npublic void setTitle(String title) {\n this.title = title;\n}\n\npublic String getAuthor() {\n return author;\n}\n\npublic void setAuthor(String author) {\n this.author = author;\n}\n\npublic int getPages() {\n return pages;\n}\n\npublic void setPages(int pages) {\n this.pages = pages;\n}\n\npublic double getPrice() {\n return price;\n}\n\npublic void setPrice(double price) {\n this.price = price;\n}\n\n@Override\npublic String toString() {\n return \"book [title=\" + title + \", author=\" + author + \", pages=\" + pages + \", price=\" + price + \"]\";\n}\n\npublic static int getNumBooks(){ \n return numBooks;\n}\n\n\nThis is where I am having a lot of trouble. I have my in main and below it I have my no arg constructor that I can't figure out how to add the array in main. Any advice or pointers in the right direction would great. \n\n}\n\npublic class TestBook {\nprivate String title;\nprivate String author;\nprivate int pages;\nprivate double price;\n\npublic TestBook(String title, String author, int pages, double price){\n this.title = title;\n this.author = author;\n this.pages = pages;\n this.price = price;\n}\n\npublic static void main(String[] args) {\n\n Book[] bookArray = new Book[6]; //This is the array that I am trying to add the last two books too \n\n Book bookArray0 = new Book(\"Java Proramming\", \"Liang\", 1320, 145.00);\n Book bookArray1 = new Book(\"Horton Hears a Who\", \"Dr. Seuss\", 72, 19.99);\n Book bookArray2 = new Book(\"The Hobbit\", \"Tolkien\", 320, 9.25);\n Book bookArray3 = new Book(\"Born a Crime\", \"Noah\", 304, 17.33);\n Book bookArray4 = new Book();\n Book bookArray5 = new Book();\n\n bookArray[0] = bookArray0;\n bookArray[1] = bookArray1;\n bookArray[2] = bookArray2;\n bookArray[3] = bookArray3;\n bookArray[4] = bookArray4;\n bookArray[5] = bookArray5;\n\n\n for(Book d : bookArray)\n System.out.println(d);\n\n\n}\n\npublic TestBook() { //This is the no-arg that I am trying to use to add to the array above.\n Book[] bookArray = new Book[6];\n Book bookArray4 = new Book(\"The Town\", \"Chuck Hogan\", 477, 14.99);\n Book bookArray5 = new Book(\"The Pretender \", \"Sombody\", 400, 24.99);\n bookArray[4] = bookArray4;\n bookArray[5] = bookArray5;\n\n for(Book b : bookArray)\n System.out.println(b);\n\n }\n\npublic void finishArray(){\nBook lastBook = new Book();\nlastBook.setTitle(title);\nlastBook.setAuthor(author);\nlastBook.setPages(pages);\nlastBook.setPrice(price);\n\n}\n\n\n}" ]
[ "java", "arrays", "constructor" ]
[ "Compile error when trying to use Animator in Flutter", "Compiler message:\n/C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:457:7: Error: No named parameter with the name 'blocs'.\n blocs: [_animatorBloc],\n ^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/states_rebuilder-1.15.0/lib/src/state_with_mixin_builder.dart:142:3: Context: Found this candidate, but the arguments don't match. StateWithMixinBuilder({ ^^^^^^^^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:494:27: Error: Method not found: 'StatesRebuilder.addToListeners'.\n StatesRebuilder.addToListeners(\n ^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/animator-0.1.4/lib/animator.dart:559:27: Error: Method not found: 'StatesRebuilder.removeFromListeners'.\n StatesRebuilder.removeFromListeners(b, widget.name, "$hashCode");\n ^^^^^^^^^^^^^^^^^^^" ]
[ "android", "flutter", "dart", "flutter-dependencies", "flutter-animation" ]
[ "More efficient ways to initialize objects in java?", "I have 10 objects here, but I have to intiliaze 20 more, is there a shorter way to do it? \n\n Gallina[] gallina=new Gallina[10];\n gato[0]=new Gato(true, \"Siames\", \"Fluffy\", 10);\n gato[1]=new Gato(false, \"Persa\", \"Fluffy\", 11);\n gato[2]=new Gato(true, \"Maine Coon\", \"Fluffy\", 9);\n gato[3]=new Gato(false, \"Ragdoll\", \"Fluffy\", 4);\n gato[4]=new Gato(false, \"Bengala\", \"Fluffy\", 1);\n gato[5]=new Gato(true, \"Sphynx\", \"Fluffy\", 6);\n gato[6]=new Gato(true, \"Abisinio\", \"Fluffy\", 3);\n gato[7]=new Gato(false, \"Azulruso\", \"Fluffy\", 9);\n gato[8]=new Gato(true, \"Siberiano\", \"Fluffy\", 2);\n gato[9]=new Gato(true, \"Siames\", \"Fluffy\", 4);" ]
[ "java", "object", "constructor" ]
[ "C - Pointer Subtraction", "I've thought I understood pointers and pointers arithmetic but then I came across something unexpected to me. When I run this code I thought I was going to see \"(header+1) - header = 32\" as output. But I didnt. Can someone explain me why this was happened ?\n\n struct metadata *header = (struct metadata *)malloc(sizeof(struct metadata));\n printf(\"Struct size of : %d\\n\",sizeof(struct metadata));\n printf(\"header = %d header+1 = %d\\n\",header,header+1);\n printf(\"(header+1) - header = %d\\n\",(header+1) - header);\n\n\nThis gives the following output : \n\nStruct size of : 32 \n\nheader = 37704768 header+1 = 37704800\n\n(header+1) - header = 1" ]
[ "c", "pointers", "pointer-arithmetic" ]
[ "\"Missing parameter for command 'get'\" when downloading files within date range using WinSCP", "I am using below command to download files from FTP but I am getting error\n "get -filemask="*>=2018-12-01" -preservetime -resume -speed=5000 /ECC/PITR/WAL_ARCHIVE E:\\ECC\\PITR\\WAL_ARCHIVE\\" ^\n "exit"\n\nError:\n\n> 2020-12-17 12:46:50.392 Script: get -filemask=*\n< 2020-12-17 12:46:50.392 Script: Missing parameter for command 'get'." ]
[ "ftp", "winscp" ]
[ "calculate Transfer entropy in r", "library(TransferEntropy)\n\nx = c(0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0)\n\ny = c(0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,0)\n\ncomputeTE(x,y,3,1,\"MI_diff\",safetyCheck = T)\n\n\n\n Error in computeTE(x, y, 3, 1, \"MI_diff\", safetyCheck = T) : \n Points with same coordinates in the X tree (add noise).\n\n\nI have binary data like x and y and i need to calculate transfer entropy between them, I used R and performed above steps but i am getting error !!But when i use :\n\ncomputeTE(x,y,3,1,\"Correlation\")\n\n\nthis works but i want to know why\nand my actual data have 43200 records when i give that to same code R crashes" ]
[ "r", "transfer", "entropy" ]
[ "How to switch a function from a class component to a function component", "I used to use class components in react-native. My new app.js file looks like this :\nimport React, { useState, useEffect } from 'react';\nimport {Text} from 'react-native';\nimport AppContext from './AppContext';\nimport {NavigationContainer} from '@react-navigation/native';\nimport Splash from './src/components/Splash';\nimport {MainStackNavigator, BottomTabNavigator} from './Navigation/StackNavigator';\n\nexport default function App() {\n\n Text.defaultProps = Text.defaultProps || {};\n Text.defaultProps.allowFontScaling = false; \n\n const [user, setUser] = useState({ loggedIn: false });\n const state = { user, setUser };\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n setTimeout(() => setLoading(false), 2000);\n }, []);\n\n if (loading) {\n return <Splash />;\n }\n\n return (\n <AppContext.Provider value={state}>\n <NavigationContainer>\n {!user.loggedIn ? (\n <MainStackNavigator />\n ) : (\n <BottomTabNavigator />\n )}\n </NavigationContainer>\n </AppContext.Provider>\n );\n}\n\nHow can I add what I used before, componentDidMount or componentWillMount?\nBecause here I would like to add this, and i'm a little lost:\n async UNSAFE_componentWillMount() {\n let lang = await retrieveAppLang();\n let isConnected = await userSessionActive();\n\n if (lang.length == 2) {\n i18n.changeLanguage(lang);\n }\n\n if (isConnected === true && this.props && this.props.navigation) {\n this.props.navigation.navigate("TabBar");\n }\n }" ]
[ "javascript", "react-native", "function", "class", "components" ]
[ "Serial bluetooth to Roomba iRobot", "So I may have done something VERY foolish\n\nI've agreed to a project where a Roomba is controlled via bluetooth. I thought everything was fine and dandy, BUT, I'm not allowed a computer for the end system.\n\nInstead, I'm allowed a Xilinx Virtex II Pro board.\n\nMy plan is to buy a bluetooth serial adapter, and buy the iRobot accessory to foster the communication. My hope is that it'll be about as hard as sending messages over a serial port (and I won't have to deal with too much low level socket programming, but if I have to I have to).\n\nMy question is, has anyone done something similar to this? Can anyone recommend a tutorial, or a website or a specific product?\n\nI'm aiming to buy these:\nhttp://store.irobot.com/product/index.jsp?productId=2649971\n\nhttp://overlandresource.com/wp-content/gallery/images/bluetooth-serialconverter.png\n\nCan anyone recommend something better? Can anyone tell me what trouble I'm in for? Really, ANY advice would be nice.\n\nTo clarify this project has to be in C and VHDL as C." ]
[ "c", "bluetooth", "vhdl", "fpga", "xilinx" ]
[ "Big O notation and Recursion", "I am having some trouble working out the Big O notation for these 2 recursive functions:\n\nint calc (int n) \n{\n if (n <= 0)\n return 0 ;\n else if (n > 10) \n return n ;\n else\n return calc (5 + calc(5n));\n}\n\n\nIn the case above I think the Big O notation might be O(n^2) because of the nested iterations in the data set?\n\nboolean method (int k ,int [] arr, int i, int j)\n{\n if (i > j)\n return false;\n if (arr [(i+j)/2] == k)\n return true;\n if (arr [(i+j)/2] < k)\n return method (k, arr, i, ( (i+j)/2) - 1) ;\n else\n return method (k, arr, ((i+j)/2)+1, j) ;\n}\n\n\nHere I think the big O notation might be O(log N) because the input data set is halved with each iteration?\n\nI am, however, very new to Big O notation and any help or explanations would be much appreciated!" ]
[ "algorithm", "recursion", "complexity-theory", "big-o" ]
[ "java.lang.NoClassDefFoundError: org/apache/taglibs/standard/tag/rt/core/UrlTag", "After refreshing my Maven project this error appears when i'm opening jsp in Tomcat. What is the cause? \n\njstl dependencies\n\n<dependency>\n<groupId>javax.servlet</groupId>\n<artifactId>jstl</artifactId>\n<version>1.2</version>\n\n\n\n\nThis is how I import jstl in jsp\n\n <%@taglib prefix=\"c\" uri=\"http://java.sun.com/jsp/jstl/core\" %>" ]
[ "java", "jsp", "maven", "jstl" ]
[ "USB issue SAM3S-EK -> Custom card", "I am developing my project with SAM3S-EK demo board. I used USB CDC and MSC Driver with example code and ASF and everything work fine. Now I want to put the code into my custom card (with a SAM3S1B).\nBut that is my problem. I have assigned the pin and changed the clock config but the device is not recognized by Windows. All of descriptors are equal to zero (according to USBLyser).\n\nCan someone help me ?\n\nThat is my clock config file (I have a 16MHz crystal) : \n\n\r\n\r\n// ===== System Clock (MCK) Source Options\r\n#define CONFIG_SYSCLK_SOURCE SYSCLK_SRC_PLLACK\r\n\r\n// ===== System Clock (MCK) Prescaler Options (Fmck = Fsys / (SYSCLK_PRES))\r\n#define CONFIG_SYSCLK_PRES SYSCLK_PRES_4\r\n\r\n// ===== PLL0 (A) Options (Fpll = (Fclk * PLL_mul) / PLL_div)\r\n// Use mul and div effective values here.\r\n#define CONFIG_PLL0_SOURCE PLL_SRC_MAINCK_XTAL\r\n#define CONFIG_PLL0_MUL 32\r\n#define CONFIG_PLL0_DIV 2\r\n\r\n// ===== PLL1 (B) Options (Fpll = (Fclk * PLL_mul) / PLL_div)\r\n// Use mul and div effective values here.\r\n#define CONFIG_PLL1_SOURCE PLL_SRC_MAINCK_12M_RC\r\n#define CONFIG_PLL1_MUL 16\r\n#define CONFIG_PLL1_DIV 2\r\n\r\n// ===== USB Clock Source Options (Fusb = FpllX / USB_div)\r\n// Use div effective value here.\r\n//#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL0\r\n#define CONFIG_USBCLK_SOURCE USBCLK_SRC_PLL1\r\n#define CONFIG_USBCLK_DIV 2\r\n\r\n// ===== Target frequency (System clock)\r\n// - XTAL frequency: 16MHz\r\n// - System clock source: PLLA\r\n// - System clock prescaler: 4 (divided by 4)\r\n// - PLLA source: XTAL\r\n// - PLLA output: XTAL * 32 / 3\r\n// - System clock is: 16 * 32 / 4 / 2 = 64MHz\r\n// ===== Target frequency (USB Clock)\r\n// - USB clock source: PLLB\r\n// - USB clock divider: 2 (divided by 2)\r\n// - PLLB output: XTAL * 12 / 2\r\n// - USB clock: 16 * 12 / 2 / 2 = 48MHz" ]
[ "crystal-reports", "usb", "driver", "atmel", "sam" ]
[ "AWS RDS Network & Security panel not visible", "I'm new to AWS and I'm having trouble connecting to an Aurora (Postgres compatible) database that I've created.\nI can connect to it via the AWS CLI using the following command:\naws rds-data execute-statement --resource-arn "<my rds cluster ARN>" --database "<My database>" --secret-arn "<My secret in the secret manager>" --sql "select count(*) from information_schema.tables" --profile <my profile>\nand this returns a result of 175 which is correct (the same result I get if I run this in the query editor tool in the AWS console.\nI then put together a little C# console app and referenced the Npgsql.EntityFrameworkCore.PostgreSQL nuget package as suggested in the AWS docs. When I run it on my PC I get a connection timeout exception.\nvar connectionString = "Server=<My db cluster>; Database=<database name>; User ID=<my user id>; Password=<my password>; Port=5432";\n\nusing (var connection = new NpgsqlConnection(connectionString))\n {\n var sql = "select count(*) from information_schema.tables";\n return connection.ExecuteScalar(sql).ToString();\n }\n\nWhen trying to troubleshoot the problem lots of AWS docs & videos suggest setting the Public accessibility property to true by selecting the Db in the RDS console, choosing modify and setting the Public accessibility property.\n\nThe only problem is, when I choose to modify the DB, that panel is not visible. The AWS docs & videos do go on to talk about changing inbound rules and whatnot in VPC and subnets but not before they've changed the Public accessibility property.\nCan anyone advise please?" ]
[ "amazon-rds" ]
[ "Prior statements not getting executed on sync ajax call", "I have a function like\n\nfunction m1(){\n $('.loader').show();\n\n var xargs={\n type : 'POST',\n url : resourceUrls[\"listUrl\"],\n data : \"sId=\"+sId,\n async:false,\n dataType : \"text\",\n success : OnGetJsonCallback,\n failure : function(response) {\n $(\".loader\").hide();\n }\n\n };\n\n $.ajax(xargs);\n}\n\n\nhere the problem, the loader is not getting shown before making ajax call. If I put a console log statement that is getting logged. \n\nI did some searching and got to know that synchronous AJAX calls freeze the browser. But it can show the loader and then freeze the browser isnt it?" ]
[ "javascript", "jquery", "html", "ajax" ]
[ "Swift4: Unexpectedly found nil while unwrapping an Optional value", "This is my code. I tried to fix app crashing while textfield is empty. This method worked in my previous app.\n\nWhile pressing touchCheck button with empty UITextField app is crashing with following error:\n\n\n Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value\n\n\nI didn't found any answer on stackoverflow that would work for me. \n\nAlso, I'm newbie at swift.\n\n@IBOutlet weak var inField: UITextField!\n\n@IBOutlet weak var outLabel: UILabel!\n\n@IBAction func touchCheck(_ sender: Any) {\n\n let alert = UIAlertController(title: \"Hey!\", message: \"Text field is empty. This may cause app crash. Please, enter a positive whole number to text field in order to get number checked!\", preferredStyle: .alert)\n\n alert.addAction(UIAlertAction(title: \"Got it\", style: .default, handler: nil))\n\n var i = 2\n\n var isPrime = true\n\n let number = Int(inField.text!)\n\n if number == 1 {\n\n isPrime = true\n\n }\n\n if (inField.text?.isEmpty)! {\n\n self.present(alert, animated: true)\n\n outLabel.text = String(\"Text Field is empty!\")\n\n } else if isPrime == true {\n\n outLabel.text = String(\"Number \\(number ?? 1) is prime!\")\n\n self.view.endEditing(true)\n\n } else if isPrime == false {\n\n outLabel.text = String(\"Number \\(number ?? 1) isn't prime!\")\n\n self.view.endEditing(true)\n\n }\n\n while i < number! { //error at this line\n\n if number! % i == 0 {\n\n isPrime = false\n\n }\n\n i += 1\n\n }\n\n\n}" ]
[ "ios", "swift" ]
[ "Facebook Integration in to android app", "Hi plan to develop an android app with Facebook log in for that i can download Facebook latest android sdk and import it into eclipse and create a project and Facebook sdk set as a library project and then create a layout with Facebook log in button widget and integrated it in to my main.xml file and store the app id in strings.xml and set this id in manifest meta-data tag but while implementing am not fully confused please help and give some sample code for step by step log in and click on loginbutton and then enter credentials like." ]
[ "android", "eclipse", "facebook", "facebook-graph-api", "facebook-login" ]
[ "How to verify empty input", "I am programming in php and my sql I have a form with personal data and a submit save button . So I want to validate that input the person's root is not empty, and therefore do not let save.\n\nI have this function js:\n\nfunction validate(){\n if ($('#txtrut').text() == \"\") {\n alert('Ingrese rut');\n return false;\n }\n};\n\n\nI execute it in the onclick event of the submit, but it always shows me the alert, it is empty the input or not. How can I do it?" ]
[ "javascript", "php", "jquery" ]
[ "Create a PowerPoint template with variants - searching Microsoft's Variant Creator", "I want to create a PowerPoint Template with variants for different colorstyles on single slides.\n\nNow I am looking for the \"Microsoft's Variant Creator beta tool\". Has anyone it? \nhttps://social.technet.microsoft.com/Forums/office/en-US/94957643-a699-4fcb-a955-1243e0691972/powerpoint-2013-design-variants?forum=officeitpro\n\nAnother method would be to create a own super theme, but I only found this decent tutorial.\n\nhttps://www.indezine.com/products/powerpoint/learn/themes/editing-super-themes-with-xml.html\n\nI don't now why this feature is so bad supported from MS. Are there any better option at the moment to create a template with different accents colors?" ]
[ "office365", "ms-office", "powerpoint" ]
[ "Unable to import images from Picasso", "Please can anyone look into this code and help me identify why I'm unable to import images from Picasso:\nTaskListAdapter.java:\npackage com.dummies.tasks.adapter;\n\nimport android.view.LayoutInflater;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport androidx.annotation.NonNull;\nimport androidx.cardview.widget.CardView;\nimport androidx.recyclerview.widget.RecyclerView;\n\nimport com.dummies.tasks.activity.R;\nimport com.squareup.picasso.Picasso;\n\npublic class TaskListAdapter\n extends RecyclerView.Adapter<TaskListAdapter.ViewHolder>\n{\n static String[] fakeData = new String[] {\n "One",\n "Two",\n "Three",\n "Four",\n "Five",\n "Ah . . . ah . . . ah!"\n };\n\n @NonNull\n @Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int i) {\n // create a new view\n CardView v = (CardView) LayoutInflater.from(parent.getContext())\n .inflate(R.layout.card_task, parent, false);\n // wrap it in a ViewHolder\n return new ViewHolder(v);\n }\n @Override\n public void onBindViewHolder(ViewHolder viewHolder, int i) {\n viewHolder.titleView.setText(fakeData[i]);\n\n String url = "http://lorempixel.com/600/400/cats/?fakeId=";\n Picasso.get().load(url).into(viewHolder.imageView);\n\n }\n\n @Override\n public int getItemCount() {\n return fakeData.length;\n }\n\n static class ViewHolder extends RecyclerView.ViewHolder { \n CardView cardView;\n TextView titleView;\n ImageView imageView;\n\n public ViewHolder(CardView card) {\n super(card);\n cardView = card;\n titleView = card.findViewById(R.id.text1);\n imageView = card.findViewById(R.id.image);\n }\n }\n}\n\nI also added the build.gradle dependency:\nimplementation 'com.squareup.picasso:picasso:2.71828'\n\nand as well added internet permission:\n<uses-permission android:name="android.permission.INTERNET"/>\n\nThe whole code is error-free except for the fact that it doesn't display images when I run the app." ]
[ "android", "image", "android-studio", "picasso" ]
[ "Covariance (OOP) in PHP - how does it work", "class Param() {\n}\nclass Subparam extends Param {\n}\n\nclass Base {\n\n function mymethod(Param a) {\n }\n\n}\n\nclass Sub extends Base {\n\n function mymethod(Subparam a) {\n }\n\n}\n\n\nIn PHP, this leads to a warning: Declaration should be compatible with Base->mymethod(a : \\Param)\n\nWhat can I do to prevent that, other than using annotations only?" ]
[ "php", "oop", "covariance" ]
[ "C# ListView Grouping binding error", "I failed to perform grouping in list view. It shows error code as: \n\n\n BindingExpression path error: Indicator' property not found on 'object' ''CollectionViewGroupInternal'`. \n\n\nmay I know which part of my code is wrong?\n\nBelow is the class code:\n\nData are pulled from the database. \n\nforeach(string value in getCountry)\n{\n string[] values = value.Split(',');\n string countryname = values[0].ToString();\n string indicator = values[1].ToString();\n items.Add(new User() { CountryName = countryname, Indicator = indicator });\n}\n\nlvUsers.ItemsSource = items;\n\nCollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(lvUsers.ItemsSource);\nPropertyGroupDescription groupDescription = new PropertyGroupDescription(\"Indicator\"); //i expect error is from here\nview.GroupDescriptions.Add(groupDescription);\n\n\n\npublic class User\n{\n public string CountryName { get; set; }\n public string Indicator { get; set; }\n}\n\n\nBelow is the XAML CODE:\n\n <ListView Name=\"lvUsers\" FontSize=\"25\" FontFamily=\"Arial\">\n <ListView.View>\n <GridView ColumnHeaderContainerStyle=\"{StaticResource myHeaderStyle}\">\n <GridViewColumn DisplayMemberBinding=\"{Binding CountryName}\" />\n <GridViewColumn DisplayMemberBinding=\"{Binding Indicator}\" />\n </GridView>\n </ListView.View>\n <ListView.GroupStyle>\n <GroupStyle>\n <GroupStyle.HeaderTemplate>\n <DataTemplate>\n <TextBlock FontWeight=\"Bold\" Text=\"{Binding Indicator}\" FontSize=\"30\" FontFamily=\"Arial\" Foreground=\"Black\"/>\n </DataTemplate>\n </GroupStyle.HeaderTemplate>\n </GroupStyle>\n </ListView.GroupStyle>\n </ListView>" ]
[ "c#", "wpf", "listview" ]
[ "Can you use IAP to log in to Firebase?", "I have an angular app that is protected with Identity Aware Proxy (IAP). I am trying to add Firebase to this app in order to use firestore for a component using AngularFire. I don't want to make the user log in twice, so I thought about using IAP to authenticate with Firebase.\n\nI've tried:\n\n\nLetting GCP do its magic and see if the user is automatically inserted the Firebase Auth module - it isn't.\nI've tried using the token you get from IAP in the GCP_IAAP_AUTH_TOKEN cookie with the signInWithCustomToken method - doesn't work, invalid token.\nI've tried using getRedirectResult after logging in through IAP to if it's injected there - it isn't.\n\n\nI've spent days trying to get this to work, I've had a colleague look at it as well, but it just doesn't seem possible. Now, as a last resort, I'm writing here to see if someone knows if it's even possible.\n\nIf not, I will have to suggest to the team to switch auth method and get rid of IAP, but I'd rather keep it.\n\n\n\nMore info:\n\nEnvironment: NodeJS 10 on App Engine Flexible\n\nAngular version: 7.x.x\n\nAngularFire version: 5.2.3\n\nNotes: I do not have a backend, because I want to use this component standalone and at most with a couple of Cloud Functions if need be. I am trying to use Firestore as a \"backend\"." ]
[ "firebase", "google-app-engine", "google-cloud-platform", "angularfire2", "google-iap" ]
[ "Passing multiple arguments to bash", "I have a script that launches certain nodes based on what arguments you enter \n\ncase \"$1\" in\n start)\n if [ \"$2\" == \"puppet\" ]; then\n set_puppet_variables\n check_ES_reqs\n start\n elif [ \"$2\" == \"puppet1\" ]; then\n set_puppet1_variables\n check_ES_reqs\n start\n elif [ \"$2\" == \"master\" ]; then\n set_master_variables\n check_ES_reqs\n start\n fi\n if [ \"$2\" == \"\" ]; then\n set_puppet_variables\n check_ES_reqs\n start\n set_master_variables\n check_ES_reqs\n start\n fi\n\n\nI want to be able to launch multiple specific nodes for example when I type in command service ES start puppet puppet1 it will then launch only those two nodes.\n\nIs there a way to format the $2 in my logic to accept $3, $4 depending on how many nodes I add? as there will be more. Like making the $2 to a $2* to accept the second argument and any others so I can launch multiple specific nodes.\n\nPlease help\n\nThank you" ]
[ "linux", "bash", "arguments" ]
[ "Loader incorrectly handles configuration changes", "I have an app, fetchnig data from API and I use AsyncTaskLoader to update adapter and update UI with new data. \nLoader works fine, when rotating device (data is kept unchanged).\nProblem occurs, when I leave an app - using 'Home button' or turn off the screen and turn it back on. Then, data adapter and view are automatically updated with new, fetched data.\n\nI have found out that when device is rotated - only onLoadFinished() method is executed.\nWhen I turn off/on screen - onStartLoading() and loadInBackground() Loader methods are executed before onLoadFinished()! I cannot understand why there is such a difference between device rotation and turning off/on screen. I believe that Loader should behave the same in these two situations - ONLY onLoadFinished() should be called.\n\nEDIT: I managed to fix issue:\n\n1. create global 'cache variable' in AsyncTaskLoader implementation\n\n2. store fetched data in deliverResult method in global 'cache variable'\n\n3. in onStartLoading() method check for cache variable, and if it isn't empty => deliverResult(cache variable)\nMore info:\nWhat does AsyncTaskLoader.deliverResult() actually do?" ]
[ "android", "android-activity", "loader" ]
[ "No apk folder in Build Folder", "My Application is running fine. I want to show the apk file but there is no folder of apk in the output folder. There is no error in project. What is main issue" ]
[ "android" ]
[ "Service fabric cluster inside Docker container", "We're developing microservices application using Azure Service Fabric. There are a few Web API microservices that runs on SF cluster (OnPremise). \n\nNow we need to create something like Docker container with SF cluster and run there out application. \n\nIt should be done for out front-end developers that work on Mac and do not want to install SF cluster (and it's impossible as I know). \n\nI don't know if it possible, so I need your suggestion. I know that I can run Docker container inside Service Fabric, but I need completely opposite solution.\n\nMaybe the first step should be get one of Docker image, but witch one? microsoft/windowsservercore or microsoft/mssql-server-windows-express\n\nand then How to install Service Fabric to the image? If someone has the same problems and found the solution please help." ]
[ "azure", "docker", "azure-service-fabric" ]
[ "Double if else without brackets", "I recently discovered that you can use the following syntax for if/else statements:\n\nif (a)\n b = true;\nelse\n b = false;\n\n\nwhen you nest another if clause inside this, it gets confusing\n\nif (a)\n if (b)\n c = 3;\nelse\n c = 1;\n\n\nbut since the compiler ignores line indents, the compiler always parses this as (from what I understand)\n\nif (a)\n if (b)\n c = 3;\n else\n c = 1;\n\n\nIs it possible to achieve the second clause without using brackets? (I am aware that this makes no difference, but it is cleaner in my opinion)\n\n\n\nEDIT: For all the comments suggesting something along the lines of the following: \n\nif (a && b)\n c = 3;\nelse\n c = 1;\n\n\nThis is not the same. if a = true and b = false, c will be set to 1, but the expected value is that it wouldn't be set at all." ]
[ "c#", "if-statement" ]
[ "Setting the height and width of a background color behind a form element", "On the following web page:\n\nhttp://www.hiv.lanl.gov/content/sequence/GENE_CUTTER/cutter.html\n\n...you'll notice that there are three \"input areas\" each of which has a grey box behind it. I realize this is a simple question, but how was this effect achieved? I'm writing a similar application and I find the contrasting colors aesthetically appealing.\n\nThanks.\n\nCaitlin" ]
[ "html", "css" ]
[ "execute shell script as root in java code", "How to run .sh file as a root in this code?\nin the main section i run my .sh file from desire directory. But i got permission denied when i run. I simple want my .sh code run as root. Is there any way?\n\r\n\r\n import java.io.IOException;\r\n import org.apache.commons.exec.CommandLine;\r\n import org.apache.commons.exec.DefaultExecutor;\r\n import org.apache.commons.exec.ExecuteException;\r\n\r\n public class TestScript {\r\n int iExitValue;\r\n String sCommandString;\r\n\r\n public void runScript(String command){\r\n sCommandString = command;\r\n CommandLine oCmdLine = CommandLine.parse(sCommandString);\r\n DefaultExecutor oDefaultExecutor = new DefaultExecutor();\r\n oDefaultExecutor.setExitValue(0);\r\n try {\r\n iExitValue = oDefaultExecutor.execute(oCmdLine);\r\n } catch (ExecuteException e) {\r\n // TODO Auto-generated catch block\r\n System.err.println(\"Execution failed.\");\r\n e.printStackTrace();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n System.err.println(\"permission denied.\");\r\n e.printStackTrace();\r\n }\r\n }\r\n\r\n public static void main(String args[]){\r\n TestScript testScript = new TestScript();\r\n testScript.runScript(\"sh /home/deepak/Desktop/ftpusers.sh\");\r\n }\r\n }" ]
[ "java", "shell" ]
[ "Transfer data/command to main application in a multi user environment", "I have a java(FX) 8 main application that also has authentication and runs in a multi user environment.\n\nOn some triggers (url protocol handler, shortcuts, ...) a different application is started and needs to send data/commands to my main application. In a single user environment I can just open a port and receive the commands on that port. However in a multi user environment the port may already be in use for a different user. \n\nHow can I send the data/commands to the main applications.\n\nI already tried a \"use the username to calculate the port\" approach, but this tends to conflict with ports that are already in use/are reserved.\n\nThe application should run on Windows Server 2012+." ]
[ "java" ]
[ "Getting Http Response from boto3 table.batch_writer object", "There is a list of data in a csv that I want to put into a dynamodb table on aws. See sample list below.\n\n Mary,F,7065\n Anna,F,2604\n Emma,F,2003\n Elizabeth,F,1939\n Minnie,F,1746\n Margaret,F,1578\n Ida,F,1472\n Alice,F,1414\n Bertha,F,1320\n Sarah,F,1288\n Annie,F,1258\n Clara,F,1226\n Ella,F,1156\n Florence,F,1063\n Cora,F,1045\n Martha,F,1040\n Laura,F,1012\n Nellie,F,995\n Grace,F,982\n Carrie,F,949\n Maude,F,858\n Mabel,F,808\n Bessie,F,796\n Jennie,F,793\n Gertrude,F,787\n Julia,F,783\n Hattie,F,769\n Edith,F,768\n Mattie,F,704\n Rose,F,700\n Catherine,F,688\n Lillian,F,672\n Ada,F,652\n Lillie,F,647\n Helen,F,636\n Jessie,F,635\n Louise,F,635\n Ethel,F,633\n Lula,F,621\n Myrtle,F,615\n Eva,F,614\n Frances,F,605\n Lena,F,603\n Lucy,F,590\n Edna,F,588\n Maggie,F,582\n Pearl,F,569\n Daisy,F,564\n Fannie,F,560\n Josephine,F,544\n\n\nIn order to write more than 25 items to a dynamodb table, the documents use a batch_writer object.\n\n resource = boto3.resource('dynamodb')\n table = resource.Table('Names')\n with table.batch_writer() as batch:\n for item in items:\n batch.put_item(item)\n\n\nIs there a way to return an http response to indicate a successful completion of the batch_write? I know that it is asyncronous. Is there a wait or fetch or something to call?" ]
[ "python-3.x", "amazon-web-services", "amazon-dynamodb", "boto3" ]
[ "How to Construct JSON from JPATH", "I am working on parsing a text file having list of json paths from which I want to construct JSON.\n\nThis is how I am started. \n\ndef construct_json(jpath):\n tokens = jpath.strip().split('.')\n json = ''\n for token in tokens:\n if len(token.split('=')) == 2:\n json = json + '\"' + token.split('=')[0] +'\"' + ':' + '\"' + token.split('=')[1] + '\"}}}}'\n else:\n json = json + '\"'+token+'\":{'\n return '{'+json\n\njpaths_text = 'quiz.sport.q1.question=Which one is correct team name in NBA?,quiz.sport.q1.question=Which one is correct team name in Soccer?'\njpaths = jpaths_text.split(',')\n\nquestions = []\nfor jpath in jpaths:\n questions.append(construct_json(jpath))\n\nprint questions\n\n\nAbove program gives me following output:\n\n['{\"quiz\":{\"sport\":{\"q1\":{\"question\":\"Which one is correct team name in NBA?\"}}}}', '{\"quiz\":{\"sport\":{\"q1\":{\"question\":\"Which one is correct team name in Soccer?\"}}}}']\n\n\nWhat I want is all q1 in list. something like following:\n\n{\n \"quiz\": {\n \"sport\": {\n \"q1\": [{\n \"question\": \"Which one is correct team name in NBA?\"\n }, {\n \"question\": \"Which one is correct team name in Soccer?\"\n }]\n }\n }\n}\n\n\nAny help/clue will be appreciated. Thanks." ]
[ "python", "json" ]
[ "dropdown menu in drupal?", "how can i style primary menu as a dropdown menu is drupal?" ]
[ "drupal", "drupal-modules", "drupal-theming" ]
[ "How to reference a function that takes varargs", "If I define the following function to return a function:\n\ndef foo(): (Int*) => String = { is =>\n is.map(_.toString).mkString(\", \")\n}\n\n\nAnd then try to reference it:\n\nval bar = foo()\nbar(1, 2, 3)\n\n\nI get the compiler error \n\n\n Too many arguments (3) for method apply...\n\n\nBut when I explicitly define the reference type it compiles fine:\n\nval bar2: (Int*) => String = foo()\nbar2(4, 5, 6)\n\n\nIs there any way I can define my function foo() without needing this explicit reference type?" ]
[ "scala", "variadic-functions" ]
[ "Expect script to install Vagrant - terminating for no apparent reason", "I am running a simple expect script that uses curl to pull the vagrant dmg, attaches it, installs it and proves password and then detaches.\n\nIndividually all the commands execute at the command line and the install works.\nHowever when executing inside of the script it terminates after the curl completes.\n\n#!/usr/bin/expect -f\n\nset timeout 60\n\nexec curl -O https://releases.hashicorp.com/vagrant/2.2.2/vagrant_2.2.2_x86_64.dmg\nexec hdiutil attach vagrant_2.2.2_x86_64.dmg\nspawn sudo installer -package /Volumes/Vagrant/vagrant.pkg -target /\nexpect \"*?assword\" { send “password” }\n\nspawn hdiutil unmount /Volumes/Vagrant\n\n\nThe output I get is (concatenated):\n\n\n % Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\n 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\n 1 31.2M 1 563k 0 0 2218k 0 0:00:14 --:--:-- 0:00:01 8873k\n 97 31.2M 97 30.5M 0 0 9628k 0 0:00:03 0:00:03 --:--:-- 9627k\n100 31.2M 100 31.2M 0 0 9668k 0 0:00:03 0:00:03 --:--:-- 9667k\n while executing\n\"exec curl -O https://releases.hashicorp.com/vagrant/2.2.2/vagrant_2.2.2_x86_64.dmg\"\n (file \"./vag\" line 9)\n\n\nAt which time the script terminates." ]
[ "macos", "vagrant", "expect" ]
[ "Relative Strength Index in python pandas", "I am new to pandas. What is the best way to calculate the relative strength part in the RSI indicator in pandas? So far I got the following:\n\nfrom pylab import *\nimport pandas as pd\nimport numpy as np\n\n\n\ndef Datapull(Stock):\n try:\n df = (pd.io.data.DataReader(Stock,'yahoo',start='01/01/2010'))\n return df\n print 'Retrieved', Stock\n time.sleep(5)\n except Exception, e:\n print 'Main Loop', str(e)\n\n\ndef RSIfun(price, n=14):\n delta = price['Close'].diff()\n #-----------\n dUp=\n dDown=\n\n RolUp=pd.rolling_mean(dUp, n)\n RolDown=pd.rolling_mean(dDown, n).abs()\n\n RS = RolUp / RolDown\n rsi= 100.0 - (100.0 / (1.0 + RS))\n return rsi\n\nStock='AAPL'\ndf=Datapull(Stock)\nRSIfun(df)\n\n\nAm I doing it correctly so far? I am having trouble with the difference part of the equation where you separate out upward and downward calculations" ]
[ "python", "pandas", "finance" ]
[ "How to upload a file from my session into azure datastorage?", "I dowload a datafile from my azure datastorage, preprocess it and again want to upload the processed file to the datastore as a final csv, how do I do it? I tried the appraoch below but it is giving me a directory error:\n\ndatastore = ws.get_default_datastore()\ndatastore_paths_train = [(datastore, 'X.csv')]\ntraindata = Dataset.Tabular.from_delimited_files(path=datastore_paths_train)\ntrain = traindata.to_pandas_dataframe()\n\n\n#preprocessing the data \nX, y = preprocess_data(train)\n\n\n#splitting the data\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=0)\n\n#uploading data to datastore\nprint('Uploading data to datastore')\noutputs_folder = './Scaling_data'\nos.makedirs(outputs_folder, exist_ok=True)\ndatastore.upload(X_train, outputs_folder)\n\n\nHow do I get my 'X_train' a directory, I tried making it a Path object but that also didn't work. I might be wrong here, if there are any other ways to upload a csv to datastore I would be happy to learn." ]
[ "pandas", "azure", "azure-devops", "data-storage" ]
[ "Searching For a Nested Resource", "I am wanting to know if it possible to search for an objects ID. \n\nIdeally I want the search to redirect to the objects edit page however that has been problematic. I am rather now just searching on the index page to try and show only the searched for object. \n\nAs it stands the index page opens with the full collection objects and when an ID is entered into the search bar is does clear the index but it does not show the appropriate object.\n\nHere is my controller:\n\n def index\n @guests = @event.guests\n if params[:search]\n @search_term = params[:search]\n @guests = @event.guests.search_by(@search_term)\n end\n end\n\n\nHere is my Guest model:\n\nclass Guest < ApplicationRecord\n belongs_to :event\n\n def self.search_by(search_term)\n where(\"(id) = :search_term\", search_term: \"%#{search_term}%\")\n end\nend\n\n\nThis is my index page:\n\n<h3>Enter your ID here:</h3>\n<%= form_for \"\", url: event_guests_path, role: 'search', method: :get do %>\n<%= text_field_tag :search, @search_term, placeholder: \"Enter ID here:\" %>\n<% end %>\n<% @guests.each do |guest| %>\n <tr>\n <td> <%=guest.name %></td>\n <td> <%=guest.response %></td>\n <td><%= link_to 'Show', event_guest_path(@event, guest) %></td>\n <td><%= link_to 'RSVP', edit_event_guest_path(@event, guest) %></td>\n <td><%= link_to 'Remove Guest', [@event,guest], method: :delete, data: { confirm: 'Are you sure?' } %></td>\n </tr>\n<% end %>\n\n\nIf any more code is require I will update accordingly\n\nthanks in advance" ]
[ "ruby-on-rails", "search", "ruby-on-rails-5" ]
[ "What does the container class do in Twitter Bootstrap 3?", "I have seen the .container class being used in multiple places but never understood the use for it. And there is also the .container-fluid class.\n\nCan anyone explain the use of the container class with a brief example?" ]
[ "css", "twitter-bootstrap", "twitter-bootstrap-3" ]
[ "how to show/hide a div on the basis of a checkbox selection in angular js", "I have a checkbox and a div on my page.\n\n<input type=\"checkbox\" id=\"Animals\" name=\"Animals\" ng-model=\"ModelData.Animals\" \n ng-checked=\"ModelData.Animals == 'A'\" />\n\n\n <div class=\"form-group\" ng-show=\"ModelData.Animals == 'A'\">\n\n <label for=\"FirstName\" class=\"col-md-9\">\n Are you interested in Animal Liability Coverage?\n </label>\n <div class=\"col-md-3\">\n <label>\n <input type=\"radio\" id=\"AnimalLiabCovY\" name=\"AnimalLiabilityCoverageRadio\" ng-model=\"ModelData.AnimalLiabCov\"\n value=\"Y\" />\n Yes\n <input type=\"radio\" id=\"AnimalLiabCovN\" name=\"AnimalLiabilityCoverageRadio\" ng-model=\"ModelData.AnimalLiabCov\"\n value=\"N\" />\n No\n </label>\n </div>\n </div>\n\n\nI want to show the DIV when the checkbox is selected and hide when deselected. For the first time the above code workd fine ie when checkbox is selected and DIV hides on deselecting the checkbox. But after the first time its not working. It does not show the DIV after selecting the checkbox." ]
[ "javascript", "angularjs" ]
[ "How to prevent divs of sliding down?", "I have some divs to slide down clicking on plus sign. But one expanding div expands other. I need only clicked div to push space and expand. I tried to set overflow of wrapper and display. Now i dont now what to do. Can someone help me? \n\nCodepen ref: https://codepen.io/nikolinjho/pen/jONYxmj \n\nhtml: \n\n<div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-4 upon\">\n\n <p class=\"cust\" style=\"\">Lorem ipsum dolor sit amet\n <i class=\"fa fa-plus-circle down\" aria-hidden=\"true\"> \n </i>\n </p>\n <div class=\"hidden slid-own\">\n <p class=\"font-6\">– Limited Projects approved per \n quarter</p>\n <p class=\"font-6\">– Free base level website hosting, \n up to 5 initial revisions prior to launch!</p>\n <p class=\"font-6\">– A great low-cost option for small \n businesses & startups</p>\n <p class=\"font-6\">– SEO Optimized & Mobile- \n Friendly</p>\n <p class=\"font-6\">– Contains our Google Ads</p>\n\n </div>\n <p>consectetur adipiscing elit</p>\n\n\n </div>\n <div class=\"col-sm-4 upon\">\n\n <p class=\"cust\" style=\"\">Lorem ipsum dolor sit amet\n <i class=\"fa fa-plus-circle down\" aria-hidden=\"true\"></i>\n </p>\n <div class=\"hidden slid-own\">\n <p class=\"font-6\">– Limited Projects approved per \n quarter</p>\n <p class=\"font-6\">– Free base level website hosting, up \n to 5 initial revisions prior to launch!</p>\n <p class=\"font-6\">– A great low-cost option for small \n businesses & startups</p>\n <p class=\"font-6\">– SEO Optimized & Mobile-Friendly</p>\n <p class=\"font-6\">– Contains our Google Ads</p>\n\n </div>\n <p>consectetur adipiscing elit</p>\n\n\n </div>\n <div class=\"col-sm-4 upon\">\n\n <p class=\"cust\" style=\"\">Lorem ipsum dolor sit amet\n <i class=\"fa fa-plus-circle down\" aria-hidden=\"true\"></i>\n </p>\n <div class=\"hidden slid-own\">\n <p class=\"font-6\">– Limited Projects approved per quarter</p>\n <p class=\"font-6\">– Free base level website hosting, up to 5 \n initial revisions prior to launch!</p>\n <p class=\"font-6\">– A great low-cost option for small \n businesses & startups</p>\n <p class=\"font-6\">– SEO Optimized & Mobile-Friendly</p>\n <p class=\"font-6\">– Contains our Google Ads</p>\n\n </div>\n <p>consectetur adipiscing elit</p>\n\n\n </div>\n\n </div>\n </div>\n\n\n\n css:\n\n <style type=\"text/css\">\n .cust {\n\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .fa-plus-circle, .fa-minus-circle {\n cursor: pointer;\n color: green;\n }\n\n .upon {\n border: 1px solid #eadddd;\n }\n .upon p {\n text-transform: uppercase;\n font-size: 14px;\n letter-spacing: 2px; \n }\n .slid-own .font-6{\n font-size: 12px;\n text-transform: lowercase;\n }\n .hidden {\n display: none;\n }\n </style>\n\n\njs:\n\n<script type=\"text/javascript\">\n $(\".down\").click(function () {\n console.log($(this).parent().parent())\n $(this).parent().parent().find(\".slid-own\").slideToggle();\n $(\".down\").toggleClass(\"fa-minus-circle \");\n\n })\n</script>\n\n\nHow to handle it?" ]
[ "javascript", "html", "css" ]
[ "Unit test delegate action is called", "I have a Dictionary that I am using to avoid writing big if statements. It maps an enum to an action. It looks like this:\n\n var decisionMapper = new Dictionary<int, Action>\n {\n {\n (int) ReviewStepType.StandardLetter,\n () => \n caseDecisionService.ProcessSendStandardLetter(aCase)\n },\n {\n (int) ReviewStepType.LetterWithComment,\n () => \n caseDecisionService.ProcessSendStandardLetter(aCase)\n },\n {\n (int) ReviewStepType.BespokeLetter,\n () => \n caseDecisionService.ProcessSendBespokeLetter(aCase)\n\n },\n {\n (int) ReviewStepType.AssignToCaseManager,\n () => \n caseDecisionService.ProcessContinueAsCase(aCase)\n },\n };\n\n\nthen I call it like this in my method:\n\n decisionMapper[(int) reviewDecisionRequest.ReviewStepType]();\n\n\nMy question is how can I unit test these mappings? \n(I am using Nunit and c# 4.0)\n\nHow can I assert that when I call my decisionMapper - that 1 is equal to the call -caseDecisionService.ProcessSendStandardLetter(aCase).\n\nThanks very much." ]
[ "c#", "c#-4.0", "delegates", "nunit" ]
[ "Python: os.read() blocking on fd", "How to avoid the problem of line buffering if the fd is a bash shell?" ]
[ "python", "linux" ]
[ "Binding to a WPF combo box in a list view (2-way)", "I have this problem of having to bind the selected value of a combo box embedded inside a list view. I have no trouble in displaying items in the combo box. However, I wish I had a way to dictate what the combo box should display (from among the items that it holds) on the click of a button. I think there are several posts on this issue, however, I am not able to get exactly what I want. Here is my code. \n\nXAML:\n\n<Grid>\n <StackPanel Orientation=\"Vertical\">\n <ListView \n x:Name=\"OptionsListView\" \n ItemsSource=\"{Binding MyObjectCollection}\">\n <ListView.Resources>\n <DataTemplate x:Key=\"comboBoxTemplate\">\n <ComboBox \n Margin=\"0,3\" \n x:Name=\"MyTypeComboBox\" \n SelectedValue=\"{Binding Path=SelectedType, Mode=TwoWay}\">\n <ComboBoxItem Content=\"ABC\"/>\n <ComboBoxItem Content=\"DEF\"/>\n <ComboBoxItem Content=\"XYZ\"/>\n </ComboBox>\n </DataTemplate>\n </ListView.Resources>\n <ListView.View>\n\n <GridView>\n <GridViewColumn Header=\"Text-Sample\" \n Width=\"100\">\n <GridViewColumn.CellTemplate>\n <DataTemplate>\n <TextBlock Text=\"{Binding Name}\"/>\n </DataTemplate>\n </GridViewColumn.CellTemplate>\n </GridViewColumn>\n <GridViewColumn Header=\"Combo-Sample\" \n Width=\"100\"\n CellTemplate=\"{StaticResource comboBoxTemplate}\" />\n </GridView>\n </ListView.View>\n </ListView>\n <Button Click=\"Button_Click\">Click Me!</Button>\n </StackPanel>\n</Grid>\n\n\nC# Code Behind:\n\npublic partial class MainWindow : Window\n{\n public MainWindow()\n {\n InitializeComponent();\n OptionsListView.DataContext = this;\n }\n\n private void Button_Click(object sender, RoutedEventArgs e)\n {\n //Something here that dictates what should be displayed in the combo box\n }\n\n List<MyObject> myObjectCollection = new List<MyObject>();\n public List<MyObject> MyObjectCollection\n {\n get\n {\n myObjectCollection.Add(new MyObject(\"One\"));\n myObjectCollection.Add(new MyObject(\"Two\"));\n return myObjectCollection;\n }\n }\n\n}\n\npublic class MyObject : INotifyPropertyChanged\n{\n private string _name;\n\n public MyObject(string name)\n {\n // TODO: Complete member initialization\n this._name = name;\n }\n\n public string Name\n {\n get\n {\n return _name;\n }\n }\n\n string selectedType = string.Empty;\n public string SelectedType\n {\n get\n {\n return selectedType;\n }\n set\n {\n selectedType = value;\n this.NotifyChange(\"SelectedType\");\n }\n }\n\n #region INotifyPropertyChanged Members\n\n public event PropertyChangedEventHandler PropertyChanged;\n\n private void NotifyChange(params object[] properties)\n {\n if (PropertyChanged != null)\n {\n foreach (string p in properties)\n {\n PropertyChanged(this, new PropertyChangedEventArgs(p));\n }\n }\n }\n #endregion\n}\n\n\nI would be glad if someone could help me crack this..\n\nThanks\nRam" ]
[ "c#", "wpf", "data-binding" ]
[ "mod_rewrite redirect to HTTPS redirects other rule", "I have a htaccess file like so\n\nRewriteEngine On\nRewriteRule ^search/([^/]*)$ /search.php?query=$1 [L]\n\nRewriteCond %{HTTPS} !=on\nRewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]\n\n\nIf I visit http://example.com/search/abc123, it redirects to https://example.com/search.php?query=abc123\n\nThe HTTPS redirect works like I want, but I don't like how it also redirects to search.php?query= instead of search/\n\nHow do I fix this?" ]
[ "apache", ".htaccess", "mod-rewrite", "redirect" ]
[ "How to grab rows which contain a dual id reference", "I have a messages table:\n\nmessages:\n id(int)\n send_id(int)\n receive_id(int)\n\n\nAnd I want to be able to select rows from this only when a->b and b->a exist, e.g.:\n\n id send_id recieve_id\n 0, 15, 16\n 1, 16, 15\n\n\nSo that basically one message has been passed to each person. How would I be able to go about selecting just one of those two rows (either send or receive), and all of those for a specific id. \n\nI want to only return results that have this duality.\n\nMy code currently uses a nested SELECT and doesn't work at all as needed." ]
[ "mysql", "sql", "greatest-n-per-group" ]
[ "JMeter server agent not working", "I have installed JMeter and installed PerfMon agent for monitoring CPU and memory usage. I run the server agent on my local host but not able to see CPU usage graph after adding jp@gc PerfMon metrics collector. All other plugins like jp@gc - Active thread over time working fine except metric collector. I also did telnet localhost 4444 it shows port listing. But not able to send commands like test or shutdown. It shows badCmd.\n\nAny idea why? My operating system is Ubuntu 14.04." ]
[ "jmeter", "jmeter-plugins" ]
[ "winapi: removing decoration", "This looks like a duplicate but hear me first. This is more on the debugging side.\nI'm trying to remove the borders of my window using the method here.\n\nWhat are some things that will make these functions not work? Hiding windows using ShowWindow(Handle, SW_HIDE) doesn't work also. I've made my own Window class with many functions so I don't wanna paste my whole code here.\n\nHere's my Initialization function for the window:\n\nHRESULT SampleWindow::InitializeSimple(SampleWindow* win)\n{\n HRESULT hr;\n HWND hWnd;\n SampleWindow* sampleWin;\n\n sampleWin = new SampleWindow();\n\n aMWindowProps->Center();\n hWnd = CreateWindowEx(\n NULL,\n aMWindowProps->aWindowClass,\n aMWindowProps->aWindowTitle,\n WS_OVERLAPPEDWINDOW,\n aMWindowProps->aRealLeft,\n aMWindowProps->aRealTop,\n aMWindowProps->GetRelativePosWidth(),\n aMWindowProps->GetRelativePosHeight(),\n HWND_DESKTOP,\n NULL,\n *aMWindowProps->aHInstance,\n sampleWin);\n\n aMWindowProps->aHwnd = &hWnd;\n\n hr = hWnd ? S_OK : E_FAIL;\n\n win->aHwnd = &hWnd;\n //ShowWindow(hWnd, SW_SHOWNORMAL);\n\n return hr;\n}\n\n\nWindowProps as you can see contains various info about the window being created.\nI also have a HWND pointer variable in my class which points to the window handler.\n\nHere are some things I've tried on my main, where sw2 is a pointer to my window class:\n\n ShowWindow(*sw2->aHwnd, SW_SHOW);\n //ShowWindow(*sw2->aHwnd, nCmdShow);\n LONG lStyle = GetWindowLong(*sw2->aHwnd, GWL_STYLE);\n lStyle &= WS_POPUP;\n //lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);\n SetWindowLong(*sw2->aHwnd, GWL_STYLE, lStyle);\n //ShowWindow(*sw2->aHwnd, SW_MINIMIZE);\n //ShowWindow(*sw2->aHwnd, SW_HIDE);\n //ShowWindow(*sw2->aHwnd, SW_HIDE);\n //SetWindowLong(*sw2->aHwnd, GWL_STYLE, GetWindowLong(*sw2->aHwnd, GWL_STYLE) && ~ WS_BORDER && ~ WS_SIZEBOX && ~ WS_DLGFRAME);\n SetWindowPos(*sw2->aHwnd, HWND_TOP, sw2->aMWindowProps->aRealLeft, sw2->aMWindowProps->aRealTop, sw2->aMWindowProps->aRealWidth, sw2->aMWindowProps->aRealHeight, SWP_FRAMECHANGED);\n //LONG lExStyle = GetWindowLong(*sw2->aHwnd, GWL_EXSTYLE);\n //lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);\n //SetWindowLong(*sw2->aHwnd, GWL_EXSTYLE, lExStyle);\n //SetWindowPos(*sw2->aHwnd, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);\n\n\nI'd just like some suggestions on where to debug my code. I know the functions work as I've tested it on a much simpler window project (sample project from Microsoft)." ]
[ "c++", "winapi", "setwindowlong", "getwindowlong" ]
[ "How to connect to AWS EC2 instance using filezillla?", "I have AWS EC2 instance. I am using filezilla 3.8.0 but I cannot connect instance, filezilla doesnt accept account type normal and asking password. When I type user name ubunbu and password blank I received following message:\n\nDisconnected: No supported authentication methods available (server sent: publickey)\n\nI inserted pem key and converted ppk key also. My staff can connect but I cant. What is wrong? \n\nThanks" ]
[ "amazon-ec2", "filezilla" ]
[ "Peer-to-peer communications between PCIe devices?", "In order to enable p2p communication between NVMe SSDs and other PCIe devices, I wonder if I need to make some modifications to the Linux kernel and the NVMe driver, and something else? And what modifications should I make? I have searched for some days, but there is little information about this, I need some references.\nThanks a lot!" ]
[ "p2p", "pci-e", "solid-state-drive" ]
[ "How to create a new keystore in xamarin.android?", "I'm trying to publish a xamarin.android app. I'm using Visual Studio with Xamarin Android 6, so I followed this. In part 2, it describes how to create a new keystore as shown in the following screenshot (You can see the complete describtion here):\n\n\n\nI don't get where should I place this command. I looked at that keytool link, but couldn't find any thing. I tried cmd, MSBuild Command Prompt for VS2015 and Developer Command Prompt for VS2015, but all of them showed this error: '$' is not recognized as an internal or external command, operable program or batch file.\n\nIn addition to, I tried to create a new keystore using Visual Studio. I went to tools>Android>Publish Android App and I created a keystore and it appeared in path that I specified. Then I went back to that guide and continued from Sign the APK. But there's not any .apk with name and path that I specified. There are just 3 .apk that were before doing all this and don't work.\n\nNow my question is that where should I use that command? In furthermore, I would like to know is there any other way to publish an xamarin.android app?" ]
[ "android", "visual-studio-2015", "xamarin.android", "apk", "publish" ]
[ "Pass Terminal ouput in GUI", "I have created a GUI that runs a command in Linux Terminal. \n\n\n EXAMPLE=> -n 20 -id 15 -domain square(10,20) -dim 2 -o execution -format geo,tess\n\n\nThis command is for the execution of a code for package. And when it executes a series of outputs undergo in the Linux terminal. The output is either successful and the output is generated or an error occurs due to a dump error or bad argument.\n\nExamples of Terminal Outputs:\n\n\n Error : matheval failed to process the expression. The expression\n syntax is probably incorrect. This may also be caused by an unproper\n matheval installation (expression = 1 -ori fibre(,,)). Aborted (core\n dumped)\n\n\nAnother Error\n\n\n Error : Bad arguments!\n Aborted (core dumped)\n\n\nWhat i am trying to do is return this error back into the GUI as either a MessageBox and/or update the bottom Status bar of the GUI with the error.\n\nI am not familiar with the wx and subprocess modules, but my research so far has failed to find a solution. \n\nI am running Python 2.7 and using Tkinter." ]
[ "python-2.7", "user-interface", "tkinter", "terminal" ]
[ "Using javax.sound.sampled with openjdk-7 on Raspi", "I'm having big problems getting good sound out of my Raspi using Java.\n\nI want to write an little AirPlay Client to a media server I wrote in Java. I started with using the Player Class from javazoom (http://www.javazoom.net/javalayer/docs/docs1.0/javazoom/jl/player/package-summary.html). Which gave me a not really choppy but somehow distorted and slower than normal playback of an mp3 file I streamed over to the Raspi.\n\nMy first idea was, that maybe the decoding of an mp3 was a bit too much for the Raspi, especially since overclocking helped a little.\nSo now I'm converting the mp3 to a wav file on the server and then stream it to the Raspi playing it with the javax.sound.sampled.* stuff. Yet, no improvement :|\n\nHas anybody some experience with playing soundFiles from Java on an Raspi? Any advice helps!\n\nThanks, Stefan" ]
[ "java", "audio", "raspberry-pi", "openjdk" ]
[ "Is it possible to have a specific merge strategy just for 'git pull'", "The project I'm on has two branches, ostensibly named STABLE and DEV.\n\nThere's been some divergence in a core part of project between the two branches so when merging from Stable to DEV, we're using the ours merge strategy.\n\nHowever, when pulling from Remote to DEV, we don't want to use the ours merge strategy, otherwise we'll not get the changes we need (if I understand merge strategies correctly)\n\nSo I guess the question is: is it possible to use one merge strategy when merging branches, and a different strategy when pulling from remote.\n\nOr is my understanding of merge strategies all wrong?" ]
[ "git", "git-pull" ]
[ "Mono xbuild - can I prevent it doing a rebuild all each time?", "I'm using mono and xbuild to compile and debug OpenTK on the Raspberry Pi. However every time I change a single line of code by running xbuild OpenTK.sln /p:Configuration=Debug it kicks off a rebuild all which takes about an hour to compile.\n\nI can't find a switch anywhere in the command-line help, but wondered if anyone knew how to make xbuild only compile the modified files? Or is there something I can change in the project file's settings?" ]
[ "mono", "xbuild", "raspberry-pi" ]
[ "How to update the layout inside a function in kivy", "Problem\nWe have a FloatLayout that gets some widgets and loses some (using add_widget and remove_widget) inside a function.The problem is the window gets updated when the function reaches its end. Then Kivy updates the window and user only sees the last results.\nHow to update the window when we are inside a function so user can see results ???\nWhat i tried\nI tried do_layout and _trigger_layout (read that somewhere on SO). None of them did the job (no traceback, no warning, literally no change)\nAlso read Kivy documentation but nothing was helpful there" ]
[ "python", "python-3.x", "user-interface", "kivy", "user-experience" ]
[ "how to embed x-axis and y-axis in tkinter", "I use jupyter notebook.\n\nI succeeded to embed matplotlib graph ,but x-label,y-label, x-axis and y-axis was not embedded.\n\nI can not solve this problem \n\nimport matplotlib as mpl\nimport numpy as np\nimport sys\nif sys.version_info[0] < 3:\nimport Tkinter as tk\nelse:\n import tkinter as tk\n import matplotlib.backends.tkagg as tkagg\n from matplotlib.backends.backend_agg import FigureCanvasAgg\n\ndef draw_figure(canvas, figure, loc=(0, 0)):\n figure_canvas_agg = FigureCanvasAgg(figure)\n figure_canvas_agg.draw()\n figure_x, figure_y, figure_w, figure_h = figure.bbox.bounds\n figure_w, figure_h = int(figure_w), int(figure_h)\n photo = tk.PhotoImage(master=canvas, width=figure_w, height=figure_h)\n\n canvas.create_image(loc[0] + figure_w/2, loc[1] + figure_h/2, image=photo)\n\n tkagg.blit(photo, figure_canvas_agg.get_renderer()._renderer, colormode=2)\n\n\n return photo\nw, h = 400, 400\nwindow = tk.Tk()\nwindow.title(\"the graph of y\") \ncanvas = tk.Canvas(window, width=w, height=h)\ncanvas.pack()\n\n\nfig = mpl.figure.Figure(figsize=(4,4))\nax = fig.add_axes([0, 0, 1, 1])\nax.plot(x, y,color=\"red\")\nax.set_xlabel(\"x\")\nax.set_ylabel(\"y\")\n\nfig_x=50\nfig_y=50\nfig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y))\nfig_w, fig_h = fig_photo.width(), fig_photo.height()\n\ntk.mainloop()\n\n\nx,y is number input by user" ]
[ "python", "python-3.x", "matplotlib" ]
[ "How to get a popover from a popover in bootstrap", "I tried below code which i am not getting the second popup, My approach has some problem it seems and i am not getting idea to get second popup...\n\n\r\n\r\n$(function() {\r\n $(\".pendingList, .pendings\").popover();\r\n });\r\n.icon3{\r\n background: url('http://blog.flattr.net/wp-content/uploads/2011/09/stackoverflow.png') 1px 1px no-repeat;\r\n background-position: center;\r\n height:100px;\r\n}\r\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"></script>\r\n<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\"></script>\r\n<link href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" rel=\"stylesheet\"/>\r\n\r\n<div class=\"icon3 pendingList\" data-toggle=\"popover\" data-trigger=\"click\" data-html=\"true\" data-placement=\"bottom\" \r\n data-content=\"<a href='#' class='pendings' data-toggle='popover' data-trigger='click' data-html='true' data-placement='bottom' \r\n data-content='test' >Pending(5)</a>\"></div>" ]
[ "bootstrap-popover" ]
[ "OxyPlot: Display labels for max/min values on LinearColorAxis", "I'm trying to display labels for maximum and minimum values on color axis.\nI've created and LinearColorAxis object, set max and min values from result array.\nCurrenty max = 180, min = -180\n\nvar colorAxis = new LinearColorAxis();\ncolorAxis.Palette = result.GetPalette();\ncolorAxis.Position = AxisPosition.Right;\ncolorAxis.Maximum = result.Array.Max2D();\ncolorAxis.Minimum = result.Array.Min2D();\n\n\nAfter that I can see the next graph:\n\nGraph\n\nBut as you can see there are no labels for min and max values. How can I do that? And need to display label for it to see my 180 and -180 values. Step for axis can be changed when I have other result with other min and max values. But I should display labels of min/max values for all cases." ]
[ "axis", "oxyplot" ]
[ "Display success message after form submission in PHP", "I have the following code. In this, I'm showing an alert message after sending the message through a form. I don't want to display the alert message with button. Is there any way I can show a success message without using an alert?\n\nif (isset($_POST['Submit_msg'])) {\n $mbno = $_POST['mobile'];\n $campaign_text = $_POST['campaign_text'];\n $save_sms_report = $db->sms_report($mbno,$campaign_text,$date,$homepage);\n if($save_sms_report){\n echo '<script type=\"text/javascript\">alert(\"Message sent successfully\");</script>';\n echo \"<script>window.top.location='campaign-manager.php?url=checked'</script>\";\n //echo \"<script>window.top.location='campaign-manager.php'</script>\";\n }\n else{\n echo '<script type=\"text/javascript\">alert(\"unable to send sms\");</script>';\n } \n }" ]
[ "javascript", "php" ]
[ "R - String labels to numeric", "I have data consisting of three classes which are represented by strings. I need to change these to numeric and represent them as e.g academic,general -> 0, and vocation -> 1.\nI will then apply logistic regression and create a classifier. Are there any quick ways of doing this?\nThanks :)\n\nExample of data where prog is the value to predict(y):\n\n\nUpdate: Print from dput \n\nstructure(list(prog = structure(c(2L, 3L, 2L, 2L, 2L, 2L, 1L, \n2L, 3L, 2L), .Label = c(\"general\", \"academic\", \"vocation\"), class = \"factor\"), \n sex = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L), .Label = c(\"male\", \n \"female\"), class = \"factor\"), math = c(50, 51, 57, 72, 41, \n 58, 58, 53, 51, 38), science = c(31, 47, 55, 61, 42, 59, \n 74, 61, 53, 47), socst = c(56, 61, 51, 61, 51, 56, 66, 51, \n 37, 41)), .Names = c(\"prog\", \"sex\", \"math\", \"science\", \"socst\"\n), row.names = c(NA, 10L), class = \"data.frame\")" ]
[ "r" ]
[ "How do I write a null (no-op) contextmanager in Python?", "Sometimes I need a dummy context manager that does nothing. It can then be used as a stand-in for a more useful, but optional, context manager. For example:\n\nctx_mgr = <meaningfulContextManager> if <condition> else <nullContextManager>\nwith ctx_mgr:\n ...\n\n\nHow do I define such a trivial, empty context manager? Does the Python library offer one off the shelf?\n\nHow about cases where we want the context to be used with an as clause?\n\nwith ctx_mgr as resource:\n <operations on resource>" ]
[ "python", "contextmanager" ]
[ "Airplaying video from url to ATV using lots of battery on iphone", "I am writing an app that plays a url using MPMoviePlayerController. The app works in the background and using airplay also works with an ATV, macmini using airserver and XBMC. The url is to a movie file on the local network. The way I understand is that the phone doesn't do any heavy lifting but merely passes the url to the apple tv and as long as the url points to media that the AppleTV supports then it will play.\n\nThe problem I am having is that the apple TV must be aggressively pinging the iphone and keeping the wifi active since the battery life is hit really hard. Playing an average sized movie knocks the battery life by about 2/3 on an IPhone 3GS and 1/2 on an IPhone 4S. \n\nIf I am playing on the mac mini using air server then the battery life on the phone reduces at the same rate as if the phone was backgrounded and not playing anything. I noticed that if I stop the wifi on the iphone then the movie will keep playing on the mac mini but stops within about 30s on the ATV. I am guessing the ATV keeps pushing out an event saying that it is playing and if it doesn't receive an OK in return then it stops playing.\n\nIs there something I am doing wrong? Have other people experienced the same battery drain using airplay from their phone? I have tried someone else's app and it also did the same." ]
[ "iphone", "airplay", "apple-tv" ]