texts
list
tags
list
[ "How to catch user search in Magento", "I need to create an extension for catching the query string of the user search.\n\nIf it matches with a certain string, then show the results in the regular template; if not, show them in another layout.\n\nIs it possible? If so, how can I do it?\n\nThanks." ]
[ "php", "magento" ]
[ "Simple date picker always visible, no text box, required to checkout, some dates blocked updated", "Updated\nTrying to create a date picker for a shopping cart that is:\n\nalways visible(not just on click),\ndoesn't have a text box(which seems to let people type in whatever they want),\nis required to move forward with checkout, and\nhas dates we select blocked.(not delivering things on holidays or our family's birthdays)\n\nHere is what we have (though it isn't running the same way here as it is on our site https://shop.terrareef.com/cart):\n\r\n\r\nvar days = [\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"];\nvar unavailableDates = [\"2020/12/1\",\"2020/11/25\",\"2020/11/26\",\"2020/11/27\",\"2020/12/11\",\"2020/12/12\",\"2020/12/24\",\"2020/12/25\",\"2020/12/26\",\"2020/12/27\",\"2020/12/31\",\"2021/1/1\"]; // yyyy/MM/dd\nvar unavailableDays = [\"Saturday\",\"Monday\",\"Friday\",\"Sunday\"];\n\nfunction unavailable(date) {\n ymd = date.getFullYear() + \"/\" + (\"0\"+(date.getMonth()+1)).slice(-2) + \"/\" + (\"0\"+date.getDate()).slice(-2);\n day = new Date(ymd).getDay();\n if ($.inArray(ymd, unavailableDates) < 0 && $.inArray(days[day], unavailableDays) < 0) {\n return [true, \"enabled\", \"Book Now\"];\n } else {\n return [false,\"disabled\",\"Booked Out\"];\n }\n}\n\n $(document).ready( function() {\n $(function() {\n $(\"#date\").datepicker( {\n inline: true,\n minDate: '+2',\n maxDate: '+18',\n keepOpen: true,\n debug:true,\n beforeShowDay: unavailable\n } );\n });\n });\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></script>\n{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}\n<script src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js\" defer=\"defer\"></script>\n\n<div style=\"float:right; width:300px; clear:both;\">\n <p>\n <label for=\"date\">Pick a delivery date:</label>\n <input id=\"date\" type=\"text\" name=\"attributes[date]\" value=\"{{ cart.attributes.date }}\" required autofocus/>\n <span style=\"display:block\" class=\"instructions\"> We currently ship corals Monday - Wednesday overnight. Delivery day assumes no carrier delays. Order will not ship if a date is not selected. Minimum order is $20.00</span>\n </p>\n</div>" ]
[ "jquery", "datepicker" ]
[ "Migrating SQL Server Apply query to Oracle", "What shall be the equivalent of below Sql Server query in Oracle:\n\nselect dd.dname, e.ename\nfrom emp e\nouter apply \n(select top 1 dname from dept d where d.did=e.did order by bdate) dd\n\n\nPlease note that the actual query is very different but the concept is same. Please pardon me for any syntax error in above query.\n\nI tried below Oracle query:\n\nselect dd.dname, e.ename\nfrom emp e\nleft join \n(select * from \n(select dname from dept d where d.did=e.did order by bdate)\nwhere rownum=1) dd\n\n\nBut, it is giving below error:\n\nError at Command Line:6 Column:18\nError report:\nSQL Error: ORA-00905: missing keyword\n00905. 00000 - \"missing keyword\"\n*Cause: \n*Action:" ]
[ "sql-server", "oracle" ]
[ "Unity UI doesn't set the interactability to true in script", "I've had this problem before, and I can't stand it anymore. Why and how does this happen? I'm new to C# and I don't know what I'm doing wrong.\n\nusing System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\nusing UnityEngine.UI;\n\npublic class ButtonActivate : MonoBehaviour\n{\n bool Test;\n Button ButtonHere;\n void Update()\n {\n Test = true;\n if (Test == true)\n {\n ButtonHere.interactable = true;\n }\n }\n}" ]
[ "unity3d" ]
[ "Can Cordova's device.uuid value be used to send Firebase push notification?", "I am trying to build a wrapper app with cordova and using PHP as server backend.\n\nI am using cordova-plugin-fcm to handle push notification.\n\nCorrect me if I am wrong, each device (android and ios) has own id which is used to send notification.\n\nHow can I get that id and send it to PHP route so that I can bind it with the logged in user and send notification?\n\n//FCMPlugin.onTokenRefresh( onTokenRefreshCallback(token) );\n//Note that this callback will be fired everytime a new token is generated, including the first time.\nFCMPlugin.onTokenRefresh(function(token){\n alert( token );\n});\n\n\nIn above example token is the id to be send to PHP to send notification?\n\nCan the device.uuid used for sending notification?\n\nI have already setup my Firebase configuration and the project has google-services.json and GoogleService-Info.plist in place.\n\nThank you" ]
[ "android", "ios", "firebase", "cordova", "firebase-cloud-messaging" ]
[ "Sorting Help - Insertion Sort", "I have been following Alex Allain's book to get a very good understanding of C++. I already knew some basics, but I got stuck as I always do on arrays and sorting algorithms.\nAnyway, one of the problems he presented was to check if an array is sorted or not. And if its not, sort it...\nHere is the code:\n\n#include <iostream>\n#include <string>\n#include <cstdlib>\n#include <ctime>\nusing namespace std;\nvoid swap(int array[], int firstindex, int secondindex);\nint findsmallel(int array[], int size, int index)\n{\n int indexofsmall=index;\n for(int i=index+1; i<size; i++)\n {\n if(array[i]<array[indexofsmall])\n {\n indexofsmall=i;\n }\n }\n return indexofsmall;\n}\nint findhigh(int array[], int size, int index)\n{\n int indexofhigh=index;\n for(int i=index+1; i<size; i++)\n {\n if(array[i]>array[indexofhigh])\n {\n indexofhigh=i;\n }\n }\n return indexofhigh;\n}\nvoid sortlow(int array[], int size)\n{\n for (int i=0; i<size; i++)\n {\n int index=findsmallel(array, size, i);\n swap(array, index, i);\n }\n}\nvoid sorthigh(int array[], int size)\n{\n for (int i=0; i<size; i++)\n {\n int index=findhigh(array, size, i);\n swap(array, index, i);\n }\n}\nvoid swap(int array[], int firstindex, int secondindex)\n{\n int temp=array[firstindex];\n array[firstindex]=array[secondindex];\n array[secondindex]=temp;\n}\nvoid displayarray(int array[], int size)\n{\n cout<<\"{ \";\n for(int i=0; i<size;i++)\n {\n if(i!=0)\n {\n cout<<\", \";\n }\n cout<<array[i];\n }\n cout<<\" }\";\n}\nint main()\n{\n int inputedarray[5];\n cin>>inputedarray[];\n if(inputedarray[4] != sortlow || inputedarray[4] != sorthigh)\n {\n sortlow(inputedarray, 5);\n displayarray(inputedarray, 5);\n }\n else\n cout<<\"Array is already sorted.\"<<endl;\n return 0;\n}\n\n\nGetting two errors about the comparison between a pointer and an integerm when checking the condition. Any help would be greatly appreciated!\nEDIT: The errors I am getting is:\nC:\\Code Block Projects\\Alex Allains Book\\Chapter 1\\main.cpp|84|error: ISO C++ forbids comparison between pointer and integer [-fpermissive]|\n\nAnd any way to check and see if the arrays are sorted or not? Please? :(" ]
[ "c++", "sorting" ]
[ "how to implement an IP blocking script", "i want to know the user how many times enter in my website and also from the same ip address \n\nusing php.\n\ni would like to prevent the site from user who continuously hit my site with in 2 seconds or 1 seconds.\n\nif continuously any user hit my site i would like to avoid that user ip address.\n\nthanks in advance" ]
[ "php", "url", "ip-address" ]
[ "Different wrap for submenu for active menu item", "I want to have different wrap for active submenu.\nMy typoscript:\n\nlib.navigation.sidebar = COA\nlib.navigation.sidebar {\n 10 = HMENU\n 10 {\n entryLevel = 0\n 1 = TMENU\n 1 {\n wrap = <nav class=\"section-subnav\"><ul class=\"nav nav-pills nav-stacked subnav subnav-1\">|</ul></nav>\n expAll = 1\n noBlur = 1\n NO = 1\n NO {\n ATagTitle.field = nav_title // title\n wrapItemAndSub = <li>|</li>\n stdWrap.wrap = | <span class=\"subnav-toggle\"><i class=\"fa fa-angle-right\"></i></span>\n }\n ACT < .NO\n ACT {\n wrapItemAndSub = <li class=\"active js-subnav-toggle\">|</li>\n }\n CUR < .ACT\n }\n 2 = TMENU\n 2 {\n ###\n ### This wrap should have class \"in\" for active submenu:\n ### wrap = <ul class=\"nav nav-pills nav-stacked subnav subnav-2 collapse in\">|</ul>\n ###\n wrap = <ul class=\"nav nav-pills nav-stacked subnav subnav-2 collapse\">|</ul>\n\n expAll = 0\n noBlur = 1\n NO = 1\n NO {\n ATagTitle.field = nav_title // title\n wrapItemAndSub = <li>|</li>\n }\n ACT < .NO\n ACT {\n wrapItemAndSub = <li class=\"active\">|</li>\n }\n CUR < .ACT\n }\n }\n}\n\n\nBasically I need to add one more css class to my wrapped UL if we have item with state ACT in it.\nI will be grateful for any tips." ]
[ "typo3", "typoscript" ]
[ "Simple GDB C++ debugging on VS Code fails with a NullReferenceException", "My source file.cpp:\n\n#include <iostream>\nusing namespace std;\nint main()\n{\n int x = 1;\n int y = 2;\n cout << x + y << endl;\n return 0;\n}\n\n\nI compile it using g++ -g file.cpp, and then my launch.json file is like so:\n\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"name\": \"(gdb) Launch\",\n \"type\": \"cppdbg\",\n \"request\": \"launch\",\n \"program\": \"${workspaceFolder}/a.out\",\n \"args\": [],\n \"stopAtEntry\": false,\n \"cwd\": \"${workspaceFolder}\",\n \"environment\": [],\n \"externalConsole\": true,\n \"MIMode\": \"gdb\",\n \"setupCommands\": [\n {\n \"description\": \"Enable pretty-printing for gdb\",\n \"text\": \"-enable-pretty-printing\",\n \"ignoreFailures\": true\n }\n ]\n }\n ]\n}\n\n\nMy directory structure is:\n\n- workspaceFolder\n - .vscode\n - launch.json\n - a.out\n - file.cpp\n\n\nWhen I click the green \"Start debugging\" arrow in the Debug tab I get this error in the Debug Console:\n\nStopping due to fatal error: NullReferenceException: Object reference not set to an instance of an object\n\n\nWhat am I doing wrong? I have looked at every tutorial and debugging C++ seems to be working for all of them except in my case. I also have the C/C++ (Microsoft) extension installed, and am running Ubuntu 64-bit." ]
[ "c++", "visual-studio-code", "vscode-debugger" ]
[ "AJAX POST, form data in network monitor shows valid JSON being sent but I still get a syntax error?", "I am trying to make an AJAX post that sends JSON to an express server. The browser's console error says \"SyntaxError: Unexpected token d in JSON at position 0\". When I copy the JSON being sent from network, headers, form data into a validator it says that this is valid JSON. \n\nsample JSON from form data source tab: \n\n{\n \"name\": \"Ken\",\n \"photo\": \"www.photo.com\",\n \"answers\": [\"1\", \"2\", \"3\", \"4\", \"5\", \"5\", \"4\", \"3\", \"2\", \"1\"]\n}\n\n\nWhen the express server gets the request it is an empty object {} but returns a status 200 to the browser.\n\n$(\"#submit-button\").on(\"click\", function formDataToJSON(){\n //event.preventDefault();\n console.log(\"clicked\");\n var answerArray = [];\n\n for (i = 1; i < 11; i++) {\n var questionName = \"question\" + i;\n answerArray.push($(\"#\"+questionName).val());\n }\n var objectBuilder = {\n name: $(\"#name\").val(),\n photo: $(\"#photo-url\").val(),\n answers: answerArray\n }\n objectBuilder = JSON.stringify(objectBuilder);\n console.log(objectBuilder); \n ajaxCall(objectBuilder);\n })\n\n\n function ajaxCall (objectBuilder) {\n console.log(\"ajax start! \" + objectBuilder)\n $.post( \"/api/friends\", objectBuilder, function(data) {\n console.log(data);\n }).fail(function(xhr, status, error) {\n console.log(error);\n })\n } \n\n\nrouting express code:\n\nvar express = require(\"express\");\nconst app = express();\nvar fs = require('fs');\n\nvar friends = require(\"../data/friends.js\");\n\nconst bodyParser = require(\"body-parser\");\nvar path = require(\"path\");\n\nvar jsonParser = bodyParser.json();\n\napp.use(bodyParser.urlencoded({ extended: true }));\napp.use(bodyParser.json());\n\nmodule.exports = function sendFriendsList(app){\n app.get(\"/api/friends\", function(req, res) {\n res.send(friends);\n });\n app.post(\"/api/friends\", jsonParser, function(req, res) {\n res.setHeader('Content-type', 'application/json');\n console.log(req.body);\n friends.push(req.body);\n res.end(\"done\");\n // console.log(friends);\n });\n}\n\n\nfrom the server file: \n\nvar express = require('express');\nvar bodyParser = require('body-parser');\nconst path = require('path');\nvar fs = require('fs');\n\nconst app = express();\n\nrequire('./routing/htmlRoutes.js')(app);\nrequire('./routing/apiRoutes.js')(app);\nvar friends = require(\"./data/friends.js\");\napp.use(express.static(\"./public\"));\n\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({extended: false}));\n\nvar port = process.env.PORT || 3000;\n\napp.listen(port, function() {\n console.log(\"App listening on PORT \" + port);\n});" ]
[ "jquery", "json", "ajax", "post" ]
[ "Application design help", "I want to create an sports application that contains the following.\n\n\nTabHost with three main categories. (News, Tables, live score)\nThe news category will have 2 sub categories. (Team news, league news)\nTables will have 3 sub categories. (Table, Stats, Schedule)\nLive score will just Be a ListActivity.\n\n\nHow should I design this?\nShould all main categories be separate activities?\nShould my sub categories be activities or just views?\n\nIf my sub categories are views i guess i would have to keep track of which view is the current to update/display the proper information.\n\nAlso how do i switch between views? Lets say i want to go from view 1 to 3?\nUsing ViewFlipper i can only go to the next one step at the time.\n\nThanks!" ]
[ "android" ]
[ "Performing a BLAST search with BioRuby", "I am attempting to perform a BLAST search using BioRuby on a Windows XP machine with Ruby 1.9.3 and BioRuby 1.4.3_0001. I have installed the necessary dependencies, e.g., cairo, but the output is as follows:\n\nC:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `r\nequire': cannot load such file -- cairo.so (LoadError)\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:45:in `require'\n from C:/Ruby193/lib/ruby/gems/1.9.1/gems/cairo-1.12.6-x86-mingw32/lib/ca\niro.rb:46:in `rescue in <top (required)>'\n from C:/Ruby193/lib/ruby/gems/1.9.1/gems/cairo-1.12.6-x86-mingw32/lib/ca\niro.rb:42:in `<top (required)>'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:110:in `require'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:110:in `rescue in require'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:35:in `require'\n from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bio-graphics-1.4/lib/bio-graphi\ncs.rb:11:in `<top (required)>'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:110:in `require'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:110:in `rescue in require'\n from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_requir\ne.rb:35:in `require'\n from bio283.rb:2:in `<main>'\n\n\nThe sample code I am using is as follows:\n\nrequire 'bio'\nrequire 'bio-graphics'\n\nremote_blast_factory = Bio::Blast.remote('blastp', 'swissprot',\n '-e 0.0001', 'genomenet')\n\nseq = Bio::Sequence::AA.new('MFRTKRSALVRRLWRSRAPGGEDEEEGAGGGGGGGELRGE')\n\n# run the actual BLAST by querying the factory\nreport = remote_blast_factory.query(seq)\n\n# Then, to parse the report, see Bio::Blast::Report\nreport.each do |hit|\n puts hit.evalue # E-value\n puts hit.sw # Smith-Waterman score (*)\n puts hit.identity # % identity\n puts hit.overlap # length of overlapping region\n puts hit.query_id # identifier of query sequence\n puts hit.query_def # definition(comment line) of query sequence\n puts hit.query_len # length of query sequence\n puts hit.query_seq # sequence of homologous region\n puts hit.target_id # identifier of hit sequence\n puts hit.target_def # definition(comment line) of hit sequence\n puts hit.target_len # length of hit sequence\n puts hit.target_seq # hit of homologous region of hit sequence\n puts hit.query_start # start position of homologous\n # region in query sequence\n puts hit.query_end # end position of homologous region\n # in query sequence\n puts hit.target_start # start position of homologous region\n # in hit(target) sequence\n puts hit.target_end # end position of homologous region\n # in hit(target) sequence\n puts hit.lap_at # array of above four numbers\nend\n\n\nCould someone explain why the problem is occurring? I noticed the file name 'cairo.so' in the output. Could that relate to a linux/unix op. sys?\n\nThanks,\n\nCaitlin" ]
[ "ruby", "bioinformatics" ]
[ "Move view exposed filter in header Drupal 8", "How to move exposed filter into header? I have tried every possible solution. I have created view which has exposed filter in block but block is not showing in admin/structure/block. I have even enabled Use AJax to Yes. \n\nI have tried this solution but it is not working in drupal 8 Expose Filter\n\nAny help would be great" ]
[ "php", "drupal-8" ]
[ "Hybrid Composer/FTP Drupal 8 workflow questions", "Is it ok to use composer on localhost to upgrade core and modules, and then FTP the files to the server?\nI'm on shared hosting, and although it's possible to use SSH with GIT, it's a pain to set up...\nSome information about my use case:\n\n No multiple users, no team, no multiple developers, I'm a one man show\n Small business sites\n I'm the only person adding content\n No need for version control, no module development, no coding\n\nI'm a site builder, and the only code I touch are the CSS files of the theme. Will this workflow be ok? \n\n Install Drupal 8 with composer\n Import site into aquia dev desktop\n Use composer to update modules and core\n FTP sites folder to server\n Use backup migrate when I alternate working from live to localhost and vice versa" ]
[ "composer-php", "drupal-8" ]
[ "Cocoa osx: Add a menu item on dock elements for all running applications", "I'm working to an application for OSX and I would to add a new menu item on the menu shown when you click on a dock icon.\nThe menu isn't for my application but it must appear for all running apps.\n\nI've found only this doc http://cocoadevcentral.com/articles/000036.php but it adds to its own app.\n\nMy app will run on OSX 10.6 or superior" ]
[ "cocoa", "macos", "osx-snow-leopard", "dock" ]
[ "looking to loop for 2 element in the same time (php /xpath )", "I'm trying to extract 2 elements using PHP Curl and Xpath!\n\nSo far have the element separated in foreach but I would like to have them in the same time:\n\n@$dom->loadHTML($html);\n$xpath = new DOMXpath($dom);\n$elements = $xpath->evaluate(\"//p[@class='row']/a/@href\");\n//$elements = $xpath->query(\"//p[@class='row']/a\");\n\nforeach ($elements as $element) {\n $url = $element->nodeValue;\n //$title = $element->nodeValue; \n}\n\n\nWhen I echo each one out of the foreach I only get 1 element and when its echoed inside the foreach i get all of them.\n\nMy question is how can I get them both at the same time (url and title ) and whats the best way to add them into myqsl using pdo.\n\nthank you" ]
[ "php", "loops", "curl", "xpath", "foreach" ]
[ "How to avoid unhandled exception in Tkinter?", "I'm trying to exit my program when the user decides to close the Tkinter filedialog menu without selecting a file to open. However, although the program exits I keep getting the following message before it terminates: \n\nThe debugged program raised the exception unhandled FileNotFoundError [Errno2] No such file or directory\n\nI thought the code I have below would handle something like that though, but maybe I am wrong? Any help or advice would be appreciated.\n\nif root.fileName is None:\n sys.exit(0)\nelse:\n pass" ]
[ "python", "file", "python-3.x", "exception-handling", "tkinter" ]
[ "How to call exe program and input parameters using R?", "I want to call .exe program (spi_sl_6.exe) using a command of R (system), however I can't input parameters to the program using \"system\". The followwing is my command and parameters:system(\"D:\\\\working\\spi_sl_6.exe\")\n\n \nI am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this. Thanks in advance." ]
[ "r", "parameters", "exe" ]
[ "Unable to connect signal and signal handler in Glade GTK+3", "Hi i'm working on a project in GTK+ 3 on Ubuntu 14.04 LTS. I'm trying to use Glade,but when i tried to connect a \"toggled\" signal of toggle button to a function called kaczka ,after compiling i got this in my console: (Gra_w_Statki:11072): Gtk-Warning**:Could not find signal handler 'kaczka. Did you compile with -rdynamic? \n\nThe window and the button render itself and work normally except of that toggling button doesn't change anything. What am i doing wrong ?\n\nThis is how i tried to connect toggle button and function Click!\n\nMy Linker Settings are : pkg-config --libs gtk+-3.0\n\nAnd my compiler settings are: pkg-config --cflags gtk+-3.0\n\nI'm using Code ::Blocks 13.12 with GCC compiler.\n\nAnd this is my code: \n\n#include <stdlib.h>\n#include <gtk/gtk.h>\nvoid kaczka (GtkToggleButton *tbutton, gpointer data)\n{\n gtk_main_quit ();\n}\n\n\nint main (int argc, char *argv[])\n{\n GtkWidget *win = NULL;\n GtkBuilder *builder;\n\n gtk_init (&argc, &argv);\n\n\nbuilder=gtk_builder_new();\ngtk_builder_add_from_file( builder, \"kaczka.glade\", NULL);\n\n win=GTK_WIDGET(gtk_builder_get_object(builder,\"window1\"));\n\n\ngtk_builder_connect_signals( builder, NULL );\ng_object_unref( G_OBJECT( builder ) );\n\n\n\n gtk_widget_show_all (win);\n gtk_main ();\n return 0;\n}" ]
[ "c", "gtk", "gtk3", "glade" ]
[ "adjust carousel height to image height (responsive)", "I am using the bootstrap caroussel template. \nThere is 4 images, all four in 1330*500px. By default image stretches on window resizing. I managed to keep the original image ratio with a CSS width:100% , height:auto setting for the image. Problem is carousel container won't adjust (and I see a gray gap instead)... How can I adjust carrousel height to image height within (tried to adjust carousel height in % or using padding-bottom in % too, but doesn't work) ? \nThanks.\n\nhtml : \n\n <div id=\"myCarousel\" class=\"carousel slide\" data-ride=\"carousel\" data-interval=\"false\">\n <!-- Indicators -->\n <ol class=\"carousel-indicators\">\n <li data-target=\"#myCarousel\" data-slide-to=\"0\" class=\"active\"></li>\n <li data-target=\"#myCarousel\" data-slide-to=\"1\"></li>\n <li data-target=\"#myCarousel\" data-slide-to=\"2\"></li>\n <li data-target=\"#myCarousel\" data-slide-to=\"3\"></li>\n </ol>\n <div class=\"carousel-inner\">\n <div class=\"item active\">\n <img src=\"#\" alt=\"First slide\">\n\n <div class=\"container\">\n <div class=\"carousel-caption\">\n <img src=\"#\">\n\n </div>\n </div>\n </div>\n\n\ncss:\n\n/* Carousel base class */\n\n.carousel\n{\nheight: 500px;\nmargin-bottom: 10px;\n\n}\n\n/* Since positioning the image, we need to help out the caption */\n\n.carousel-caption\n{\n}\n\n/* Declare heights because of positioning of img element */\n\n.carousel .item\n{\nheight: 500px;\nbackground-color: #777;\nmargin-top: 0px;\n}\n\n\n.carousel-inner > .item > img\n{\nposition: relative;\ntop: 0;\nleft: 0;\nmin-width: 100%;\nheight: auto;\n}" ]
[ "html", "css", "image", "carousel" ]
[ "Merging columns in a JTable", "I am working in JTable and I have a requirement like this.\nSay There are 4 columns namely 10,20,30,40\n\nNow the value usually comes like 10-20 20-30 and 30-40\nSo it was easy for us to display the name for this range.\n\nBut recently the values have started to come randomly like 15-25 10-25,25-30\n\nIn this case our JTable should dynamically adjust the size of the row such that it represents that range only meaning it should not disturb the existing cells and only rows which diverge from the normal range.\n\nTO be more precise I should be able to merge and split cells based on the content of the cell.\n\nEDIT:Its like this.A person is assigned a task for a particular point of time\n\n10| |20| |30|\n\n |----------|\n |----------|\n\n\nrepresents 10-20 and 20-30 .The first line 10,20,30 are the column names.The second line is graphical representation of a box representing 10-20 and 20-30.Now if a value 15-25 comes\n\n10| |20| |30|\n\n |----------| |----------|\n |-----------|\n |-----------|\n |-------------|\n\n |----------| |----------|\n\n\nActually there is no gap between in the first and fourth row just to show that they are seperate cells.Now since data comes in the intermediate ranges of like 15-25 where we have to re align the cell shape as above I posted this." ]
[ "java", "jtable" ]
[ "Combining parts of one list into another List LINQ", "I am trying to figure out how to select distinct values from one list and then transpose those distinct values to another list.\n\nI have this:\n\nModel:\n\npublic class Participant\n{\n public int UserId { get; set; }\n public string Name { get; set; }\n}\n\n\nController Code:\n\nList<Participant> participants = new List<Participant>();\nparticipants = project\n .QuickView\n .Select(x => new Participant { x.UserId, x.FullName})\n .Distinct()\n .ToList();\n\n\nThat seems to get me the distinct values UserId and FullName but not in the List format I need. I get an IEnumerable format not List format. What am I missing to get the LINQ to place the the results in a new Participant List?" ]
[ "c#", "linq" ]
[ "EclipseLink: Query to MappedSuperclass fails", "My application is a store selling fishes, aquariums etc. I want to get a list of top 10 items among all the items based on sales count. I use the following class:\n\n@MappedSuperclass\n@NamedQueries({\n @NamedQuery(name=\"getTopItems\",query=\"SELECT x FROM FishStoreItem x ORDER BY x.salescnt DESC, x.title DESC\")\n})\npublic abstract class FishStoreItem \n extends DomainSuperClass implements Serializable {\n......\n}\n\n\nProblem is in the following exception:\n\n\n Exception [EclipseLink-8034] (Eclipse\n Persistence Services -\n 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.JPQLException\n Exception Description: Error compiling\n the query [getTopItems: SELECT x FROM\n FishStoreItem x ORDER BY x.salescnt\n DESC, x.title DESC]. Unknown entity\n type [FishStoreItem].\n\n\nSame code works fine with Apache OpenJpa 2.0.0, but fails with EclipseLink ver 2.1.0, 2.0.1, 1.0.\n\nP.S. I've already found that solution for Hibernate, but I want to be sure that it is impossible for EclipseLink too." ]
[ "java", "jpa", "eclipselink" ]
[ "Is it possible to have a private constructor in dart?", "I'm able to do something like the following in TypeScript\n\nclass Foo {\n private constructor () {}\n}\n\n\nso this constructor is accessible only from inside the class itself.\n\nHow to achieve the same functionality in Dart?" ]
[ "dart" ]
[ "Close window without displaying \"Are you sure\" dialog box", "I have a form. If I try to close it, it shows a dialog box that says:\n\n\n Are you sure you want to leave this page?\n\n\nJavascript:\n\nwindow.parent.location.close();\n\n\nIs there a way i can close this window without displaying the dialog box?" ]
[ "javascript" ]
[ "3 divs hover at once", "I have 3 divs and I am trying to make them hover at once.\nthe 2 above are expanding and hiding the border and the stroke goes around them.Can I do it with css?\nThis is my code:https://jsfiddle.net/ivailo/1hx4axpt/2/\n\n.buttonmenu1{\nheight:176px;\nwidth: 175px;\nborder: 1px solid #c2b6b4;\nborder-radius:7px;\nbackground-color: rgba(215,209,194,.5);\nposition:relative;\nleft:186px; \ntop:86px;\n\nborder-bottom-left-radius:4px;\nborder-bottom-right-radius:4px;\noverflow: hidden;\n\n} \n.buttonmenu1:hover{\nborder: 0px solid #c2b6b4;\nborder-radius:0;\noverflow:visible;\nheight:178px;\nwidth:180px;\n}\n\n\n\n.buttonmenu1a{\n\nheight:27px;\nbackground: rgb(202,224,130);\nbackground: -moz-linear-gradient(top, rgba(202,224,130,.8) 55%, rgba(209,211,172,1) 85%);\nbackground: -webkit-linear-gradient(top, rgba(202,224,130,.8) 55%,rgba(209,211,172,.1) 85%); \nbackground: linear-gradient(to bottom, rgba(202,224,130,.8) 55%,rgba(209,211,172,.1) 85%); \nfilter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cae082', endColorstr='#d1d3ac',GradientType=0 );\nborder-radius:7px;\nborder-bottom-left-radius:0px;\nborder-bottom-right-radius:0px;\nborder-bottom: 1px solid #9d9781;\n}\n.buttonmenu1b{\nheight: 1px;\nbackground:white;\ndisplay: block;\nmargin : 2px 0px;\nposition:relative;\nbottom:4px;\n}\n.textbuttonmenu1{\ncolor:8a8556;\nfont-size:13pt;\nposition:relative;\nleft:56px;\ntop:3px;\nopacity:.8\n}\n\n.svg-wrapper {\nposition: relative;\n\ntransform: translateY(-50%);\nmargin: 0 auto;\nwidth: 320px; \n}\n.shape {\nstroke-dasharray: 140 540;\nstroke-dashoffset: -474;\nstroke-width: 8px;\nfill: transparent;\nstroke: #19f6e8;\nborder-bottom: 5px solid black;\ntransition: stroke-width 1s, stroke-dashoffset 1s, stroke-dasharray 1s; \n}\n.svg-wrapper:hover .shape {\nstroke-width: 2px;\nstroke-dashoffset: 0;\nstroke-dasharray: 1000;\n}" ]
[ "html", "css", "hover" ]
[ "Java code formatting in intellij Idea (chained method calls)", "I have a small problem with java code formatting in Intellij Idea 14.1.4.\nI have a piece of code formatted manually by me, that looks good for me:\n\npublic class Test {\n private static final ImmutableMap<String, String> map = new ImmutableMap.Builder<String, String>()\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .build()\n}\n\n\nbut when I reformatted this code(Ctrl + Alt + L), I got:\n\npublic class Test {\n private static final ImmutableMap<String, String> map =\n new ImmutableMap.Builder<String, String>().put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .put(\"key\", \"value\")\n .build()\n}\n\n\nExpected result: Intellij won't reformat anything because the code is already well-formatted.\n\nI have a scheme (code style settings can be downloaded here) with the next settings:\n \n\nCould anybody explain how I can reach expected result?" ]
[ "java", "intellij-idea", "code-formatting" ]
[ "Historical date solution", "I have to manage every type of date.. I'm looking for the best way to manage date such as 600.000 a.c.e. or 5.000.000 years ago and the other kind of date format possible from the born of the earth\n\nwhat would you suggest?\n\nI'm blocked using a string format like: yyyyyyyyyy.mm.dd.v\n\nwhere v is the ACE/BCE variable\n\n[edit]\nif I start counting the day from the born of the earth, so 4.5mil years ago is the 1st day?" ]
[ "php" ]
[ "Vue assign style based on object value", "If I am rendering a list in template:\n\n<div v-for\"item in items\">\n{{item.name}}\n</div>\n\n\nand item.background corresponds to a color value, how do I set the background of div with a color of item.background?" ]
[ "vue.js" ]
[ "Passing dynamic value with single quote as a ng-true-value expression fails", "I have my checkbox input that sets the \"true\" value dynamically based on a variable trueVal, which is a string.\n\n<input ng-model=\"foo\" ng-true-value=\"'{{trueVal}}'\">\n\n\nFor example, for trueVal = \"something\", foo === \"something\" when the checkbox is checked.\n\nThis works except in the case when trueVal equals to a string with a single quote in it: Customer didn't understand. In this case, there is an error:\n\n\n Error: [$parse:lexerr] Lexer Error: Unterminated quote at columns 27-28 ['] in expression ['Customer didn't understand'].\n\n\nI can't strip the single quotes because the string should be set as-is to foo.\n\nBroader context:\n\nI'm creating a group of checkboxes based on a list of options that I get from the back-end:\n\n<div ng-repeat=\"(key,option) in options\">\n <input type=\"checkbox\" \n ng-model=\"foo[key]\"\n ng-true-value=\"'{{option.trueVal}}'\"\n ng-false-value=\"null\">\n</div>\n\n\nSo, given:\n\noptions = {\n 0: {trueVal: \"Customer was late\"},\n 1: {trueVal: \"Customer didn't understand\"}\n };\n\n\nI expect to see:\n\nfoo = {\n 1: \"Customer didn't understand\"\n};\n\n\nif the second box is checked." ]
[ "angularjs" ]
[ "How to toggle Twitter Bootstrap tab panes with ?", "Need to switch tabs with select. What's the best practice? My idea is to manipulate class .active with onChange event. But I believe there must be something better.\n\nHere's some code sample:\n\n<select id=\"mySelect\">\n<option value=\"tab1\">Tab 1</option>\n<option value=\"tab2\">Tab 2</option>\n<option value=\"tab3\">Tab 3</option>\n</select>\n\n<div id=\"myTabContent\" class=\"tab-content\">\n <div class=\"tab-pane fade in active\" id=\"tab1\">\n <div id=\"calendari_3\">asd</div>\n </div>\n <div class=\"tab-pane fade\" id=\"tab2\">\n <div id=\"calendari_1\">qwe</div>\n </div>\n <div class=\"tab-pane fade\" id=\"tab3\">\n <div id=\"calendari_2\">asw</div>\n </div>\n</div>" ]
[ "javascript", "jquery", "html", "css", "twitter-bootstrap" ]
[ "MockRequestMatchers.queryParam", "I have rest API which queryparam x,y,z\nI want to write a mock test for rest API. I see that MockRestRequestMatchers.queryParam method can be used but I'm unable to find any example.\nCan anyone help me how to format it. All my query params are String" ]
[ "junit", "mocking" ]
[ "How do regular expressions work behind the scenes (at the CPU level)?", "Do interpreters and compilers compare (and ultimately match) two strings for a potential match in a character-by-character and left-to-right fashion? Or is there an underlying binary value (e.g., a bit pattern) assigned to each string in a comparison function? Or does it depend on the string being encoded in a certain way (ASCII or UTF-32), or the interpreter, compiler, database engine, or programming language?\n\nRedesigning the data store (data files or databases) is a considerable effort. The answer to a similar question on stackoverflow didn't definitively describe the encoding question (whether bit patterns were being evaluated or actual alphabetic characters). The answer to this question could be important for an optimization effort.\n\nI don't want to know how to implement a regular expression (e.g., write my own). I want to know for educational purposes for the benefit of using existing regular expressions in an optimal way (e.g., when it is time to design data to be stored as a composition of substrings, should I be mindful of the left to right evaluation). A similar StackOverflow question's answer (which is a link that has an untrusted certificate to view it) focuses on finite automata (the theory of how strings are compared). That answer emphasizes how it can work and the computational complexity of comparing strings. It does imply that there is a left-to-right character evaluation. I don't think it was definitive by any means. The article was largely specific to Perl and the language agnostic Thomson non-deterministic finite automata algorithm. I would like to know for sure with these three technology combinations: 1) Java native functions using ASCII data files, 2) MySQL (table data and SELECT statements), and 3) with Python native functions and UTF-32 data files.\n\nMy question and approach is different from the older post in that I am not trying to develop a parser for doing regexes. I'm trying to architect data for future development. I want to know how to utilize existing regex tools in an optimal way. I believe stackoverflow is the right forum because it is central to regexes, and this question in its original and less verbose form has been voted up.\n\nI want to know at the CPU level, are bit patterns the representations of the characters in the string? Is there a short-lived index of the bit patterns corresponding to each character of the strings participating in the comparisons wherein one string is anchored? I would think the technology (e.g., the database, the programming language, and/or the encoding of the data) would vary." ]
[ "regex", "string", "optimization", "filter" ]
[ "ejabberdctl start result in error for p1_yaml", "I am trying to configure eJabberd on my server. \n\nI finished the installation but when I am trying to start the ejabberd using \n\nejabberdctl start\n\n\nIts showing following error in the log file \n\n2015-11-17 03:28:29.928 [info] <0.7.0> Application asn1 started on node ejabberd@localhost\n2015-11-17 03:28:29.928 [info] <0.7.0> Application public_key started on node ejabberd@localhost\n2015-11-17 03:28:29.941 [info] <0.7.0> Application ssl started on node ejabberd@localhost\n2015-11-17 03:28:29.945 [warning] <0.100.0> unable to load p1_yaml NIF: {error,{load_failed,\"Failed to load NIF library /lib/p1_yaml/priv/lib/p1_yaml: 'libyaml-0.so.2: cannot open shared object file: No such file or directory'\"}}\n2015-11-17 03:28:29.945 [error] <0.99.0> CRASH REPORT Process <0.99.0> with 0 neighbours exited with reason: {{load_failed,\"Failed to load NIF library /lib/p1_yaml/priv/lib/p1_yaml: 'libyaml-0.so.2: cannot open shared object file: No such file or directory'\"},{p1_yaml_app,start,[normal,[]]}} in application_master:init/4 line 134\n2015-11-17 03:28:29.945 [info] <0.7.0> Application p1_yaml exited with reason: {{load_failed,\"Failed to load NIF library /lib/p1_yaml/priv/lib/p1_yaml: 'libyaml-0.so.2: cannot open shared object file: No such file or directory'\"},{p1_yaml_app,start,[normal,[]]}}\n2015-11-17 03:28:29.947 [critical] <0.38.0>@ejabberd:exit_or_halt:133 failed to start application 'p1_yaml': {error,\n {{load_failed,\n \"Failed to load NIF library /lib/p1_yaml/priv/lib/p1_yaml: 'libyaml-0.so.2: cannot open shared object file: No such file or directory'\"},\n {p1_yaml_app,start,[normal,[]]}}}\n\n\nFor reference, the p1_yaml files are located in following directories : \n\nroot@ip-XX-XX-XX-XX [/lib/p1_yaml/priv/lib]# locate libyaml-0.so\n/root/tmp/downloads/yaml-0.1.5/src/.libs/libyaml-0.so.2\n/root/tmp/downloads/yaml-0.1.5/src/.libs/libyaml-0.so.2.0.3\n/usr/local/lib/libyaml-0.so.2\n/usr/local/lib/libyaml-0.so.2.0.3\n\n\nI am not able to trace the issue. Any kind of reference will be very helpful.\nThanks in advance." ]
[ "linux", "erlang", "xmpp", "yaml", "ejabberd" ]
[ "Strange 404 images bug when images are showing - wordpress", "I have this really strange bug on my site.\nI first noticed a drop in my SEO on ahrefs, and a huge spike in erros on its site audit.\nThe report mentions issues with broken images resulting in broken pages. They are linked from the homepage.\nWhen kicking on the link from ahrefs I do actually get a 404 page.\nWhen checking the image in my media gallery, I can see that it is available.\nWhen checking the page where it is link (homepage), it is actually showing.\nWhen clicking on the image, it shows in the gallery.\nWhen right clicking and opening a new tab, I can see the image.\nIt is showing an image with the exact same url than the broken one but with the added 1024x1024 at the end of the url.\nI only uploaded one version of the image obviously.\nCan anyone help ?" ]
[ "wordpress", "image", "debugging", "seo", "http-status-code-404" ]
[ "Compiler Error CS0535, When using Azure bot framework", "First of all I'm using C# with Azure bot framework to get my bot to greet the user (sent the first message), but when I enter the required code I receive a string of CS0535 errors.\n\nThis is my C# code:\n\nprivate Activity HandleSystemMessage(Activity message)\n{\n if (message.Type == ActivityTypes.DeleteUserData)\n {\n // Implement user deletion here\n // If we handle user deletion, return a real message\n }\n else if (message.Type == ActivityTypes.ConversationUpdate)\n {\n // Handle conversation state changes, like members being added and removed\n // Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info\n // Not available in all channels\n\n ConnectorClient connector = new ConnectorClient(new Uri(message.ServiceUrl));\n Activity reply = message.CreateReply(\"Hello from my simple Bot!\");\n connector.Conversations.ReplyToActivityAsync(reply);\n }\n else if (message.Type == ActivityTypes.ContactRelationUpdate)\n {\n // Handle add/remove from contact lists\n // Activity.From + Activity.Action represent what happened\n }\n else if (message.Type == ActivityTypes.Typing)\n {\n // Handle knowing tha the user is typing\n }\n else if (message.Type == ActivityTypes.Ping)\n {\n }\n\n return null;\n}\n\n\nAnd these are the errors I receive:\n\nHandling .NET Web Application deployment.\nMSBuild auto-detection: using msbuild version '14.0' from 'D:\\Program Files (x86)\\MSBuild\\14.0\\bin\\amd64'.\nAll packages listed in packages.config are already installed.\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.BaseUri' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.SerializationSettings' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.DeserializationSettings' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Credentials' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Attachments' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nControllers\\MessagesController.cs(14,120): error CS0535: 'ConnectorClient' does not implement interface member 'IConnectorClient.Conversations' [D:\\home\\site\\wwwroot\\Microsoft.Bot.Sample.QnABot.csproj]\nFailed exitCode=1, command=\"D:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe\" \"D:\\home\\site\\wwwroot\\.\\Microsoft.Bot.Sample.QnABot.csproj\" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir=\"D:\\home\\site\\wwwroot\\.\\.\\\\\"\nAn error has occurred during web site deployment.\n\n\nAny help would be greatly appreciated" ]
[ "c#", "azure", "chatbot" ]
[ "MINGW BOOST linking fails", "I'm trying to compile this code using MINGW and BOOST\n\nhttp://ttic.uchicago.edu/~cotter/projects/SBP/\n\nFirst I compiled this under Linux/UBUNTu and no problem. Then I tried under W764 using MINGW64. Up to level of creating object all was OK but linking failed. Here is a command\n\ng++ issvm_evaluate.o svm_kernel_base.o svm_kernel_private_cache.o\nsvm_optimizer_base.o svm_optimizer_classification_biased_perceptron.o \nsvm_optimizer_classification_biased_sbp.o\nsvm_optimizer_classification_biased_smo.o \nsvm_optimizer_classification_biased_sparsifier.o \nsvm_optimizer_classification_private_find_water_level.o \nsvm_optimizer_classification_unbiased_perceptron.o \nsvm_optimizer_classification_unbiased_sbp.o\nsvm_optimizer_classification_unbiased_smo.o \nsvm_optimizer_classification_unbiased_sparsifier.o -o issvm_evaluate -fopenmp \n-LC:/boost_1_57_0/boost_1_57_0/bin.v2/libs/serialization/build/gcc-mingw-\n4.9.0/release/ -lstdc++ -lm -LC:/boost_1_57_0/boost_1_570/bin.v2/libs/iostreams\n/build\\gcc-mingw-4.9.0/release/ -LC:/boost_1_57_0/boost_1_570/bin.v2 \n/libs/program_options/build/gcc-mingw-4.9.0/release/ \n\n\nand response\n\nissvm_evaluate.o:issvm_evaluate.cpp:(.text+0x2a81): undefined reference to boos\nt::archive::detail::archive_serializer_map<boost::archive::binary_iarchive>::era\nse(boost::archive::detail::basic_serializer const*)'\nissvm_evaluate.o:issvm_evaluate.cpp:(.text+0x2ac1): undefined reference to `boos\nt::archive::detail::archive_serializer_map<boost::archive::binary_iarchive>::era\nse(boost::archive::detail::basic_serializer const*)'\n\n\nMake file from LINUX using l option in gcc but I couldn't find build libraries or \nfile ${patsubst %,-lboost_%,$(BOOST_LIBRARIES)} under LINUX so I suspect headers were just enough but under W7 i use L option and give directory to build libraries of boost. Any idea what the problem can be ??\n\nAs build directory of BOOST in W7 contains a lot of library files including dlls maybe l option of compiler should be used and linking to dll ?? \n\nI also tried with forward slashes but its the same" ]
[ "c++", "linux", "gcc", "boost", "mingw" ]
[ "VBA Excel - Insert in New Row", "I have code that works to insert a username and timestamp into a spreadsheet. However, it currently overwrites the existing records. I'm struggling with adding logic to the code so when the spreadsheet is opened, the new username/timestamp is appended to the next blank row. Any assistance is greatly appreciated!\n\nPrivate iNextRow As Long\nConst HIDDEN_SHEET As String = \"Sheet3\"\n\nPrivate Sub Workbook_Open()\nWith Worksheets(HIDDEN_SHEET)\n.Range(\"A1\").Value = Environ(\"UserName\")\n.Range(\"B1\").Value = Format(Date + Time, \"dd mmm yyyy hh:mm:ss\")\nEnd With\niNextRow = 2\n\nEnd Sub\n\nPrivate Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)\nOn Error GoTo wb_exit\nApplication.EnableEvents = False\nIf Sh.Name <> HIDDEN_SHEET Then\nWith Worksheets(HIDDEN_SHEET)\n.Range(\"A\" & iNextRow).Value = Environ(\"UserName\")\n.Range(\"B\" & iNextRow).Value = Format(Date + Time, \"dd mmm yyyyhh: mm: ss \")\nEnd With\nEnd If\n\nwb_exit:\nApplication.EnableEvents = True\nEnd Sub" ]
[ "excel", "vba" ]
[ "How to disable http traffic and force https with kubernetes ingress on gcloud", "Hi i tried the new annotation for ingress explained here \n\napiVersion: extensions/v1beta1\nkind: Ingress\nmetadata:\n name: ssl-iagree-ingress\n annotations:\n kubernetes.io/ingress.allowHTTP: \"false\"\nspec:\n tls:\n - secretName: secret-cert-myown\n backend:\n serviceName: modcluster\n servicePort: 80\n\n\nbut i can still access it trough http, this is my setup on gcloud ingress--apache:80" ]
[ "kubernetes", "gcloud", "google-kubernetes-engine" ]
[ "Javascript with UTF-8 encoding (in PHP form)", "I have a web form which submits the comment to a predefined mail when the userfills it and clicks submit button, this is done using my Send.php file which includes all the codes needed to submit the comment with correct content and encoded with utf-8. everything works fine, however, after this procedure I included in the php file the JS code which popups the Alert windows, saying that the mail is sent, and after clicking OK button it redirects to the homepage.\n\nthis is a code:\n\n echo '<script type=\"text/javascript\">; \n alert(\"კომენტარი გაიგზავნა წარმატებით, გმადლობთ\"); \n </script>'; \n\n echo '<script type=\"text/javascript\">\n window.location = \"http://g-projects.net78.net/index.html\";\n </script>'\n\n\nHowever, because the alert text is in foreign language I get various unreadable symbols. I need to use utf-8 encoding, but how can I integrate it with this code? note that this code is called in PHP file." ]
[ "javascript", "php", "email", "utf-8", "send" ]
[ "Sftp from Unix to Windows", "Is anyone aware of a way of sftp'ing from Unix to Windows\n\nThanks\nDamien" ]
[ "sftp" ]
[ "Replacing empty csv column values with a zero", "So I'm dealing with a csv file that has missing values.\nWhat I want my script to is:\n\n#!/usr/bin/python\n\nimport csv\nimport sys\n\n#1. Place each record of a file in a list.\n#2. Iterate thru each element of the list and get its length.\n#3. If the length is less than one replace with value x.\n\n\nreader = csv.reader(open(sys.argv[1], \"rb\"))\nfor row in reader:\n for x in row[:]:\n if len(x)< 1:\n x = 0\n print x\nprint row\n\n\nHere is an example of data, I trying it on, ideally it should work on any column lenghth\n\nBefore:\nactnum,col2,col4\nxxxxx , ,\nxxxxx , 845 ,\nxxxxx , ,545\n\nAfter\nactnum,col2,col4\nxxxxx , 0 , 0\nxxxxx , 845, 0\nxxxxx , 0 ,545\n\n\nAny guidance would be appreciated\n\nUpdate Here is what I have now (thanks):\n\nreader = csv.reader(open(sys.argv[1], \"rb\"))\nfor row in reader:\n for i, x in enumerate(row):\n if len(x)< 1:\n x = row[i] = 0\nprint row\n\n\nHowever it only seems to out put one record, I will be piping the output to a new file on the command line.\n\nUpdate 3: Ok now I have the opposite problem, I'm outputting duplicates of each records.\nWhy is that happening?\n\nAfter\nactnum,col2,col4\nactnum,col2,col4\nxxxxx , 0 , 0\nxxxxx , 0 , 0\nxxxxx , 845, 0\nxxxxx , 845, 0\nxxxxx , 0 ,545\nxxxxx , 0 ,545\n\n\nOk I fixed it (below) thanks you guys for your help.\n\n#!/usr/bin/python\n\nimport csv\nimport sys\n\n#1. Place each record of a file in a list.\n#2. Iterate thru each element of the list and get its length.\n#3. If the length is less than one replace with value x.\n\n\nreader = csv.reader(open(sys.argv[1], \"rb\"))\nfor row in reader:\n for i, x in enumerate(row):\n if len(x)< 1:\n x = row[i] = 0\n print ','.join(str(x) for x in row)" ]
[ "python", "csv", "list" ]
[ "CKEDITOR : How to restrict default space adding after and before BR tag when use GetData method", "I am using ckeditor 4.x version. when I get the data from editor using \n\ngetData method now I have two files before editor file and after editor file\n\nwhen I comparing the both files the after editor file has some spaces in after and before BR tag\n\nI am using editor.getData(); method \n\nBefore Editor :\n\n<span class=\"Nocharacterstyle\" data-name=\"[No character style]\">Osteriaalla <br> Frasca</span>\n\n\nAfter Editor :\n\n<span class=\"Nocharacterstyle\" data-name=\"[No character style]\">Osteria\n <br />\n alla Frasca</span>" ]
[ "javascript", "jquery", "ckeditor", "ckeditor4.x" ]
[ "difference of two random distributions python", "Good day!\nI have two gamma distributions, and want to find distribution of their difference.\nUse np.random.gamma to generate distribution by parameters, but the resulting distribution is very different from time to time.\nCode:\n\nimport numpy as np \nfrom scipy.stats import gamma\n\nfor i in range(0, 10):\n s1 = np.random.gamma(1.242619972, 0.062172619, 2000) + 0.479719122 \n s2 = np.random.gamma(456.1387112, 0.002811328, 2000) - 0.586076723\n r_a, r_loc, r_scale = gamma.fit(s1 - s2)\n print(1 - gamma.cdf(0.0, r_a, r_loc, r_scale))\n\n\nResult:\n\n0.4795655021157602\n0.07061938039031612\n0.06960741675590854\n0.4957568913729331\n0.4889900326940878\n0.07381963810128422\n0.0690800784280835\n0.07198551429809896\n0.07659274505827551\n0.06967441935502583\n\n\nI receive two quite different cdf of 0.: 0.48 and 0.07. What can be the problem?" ]
[ "python", "random", "distribution", "difference" ]
[ "How can I customize Devise error message?", "In my password change controller, I m allowing users to change their password provided they have valid password request token.\n\nHowever after they've already used one it becomes invalid and so if they want to re-use it again, the user gets an error on the model:\n\nReset password token is invalid\n\n\nThis is from Devise itself. How can modify this message to be :\n\nUser reset password token already used\n\n\nIf I cannot change the message via some configuration, then is there a method that would allow me to check if the token is valid or not?\n\nSo that I can manually render this message in this case" ]
[ "ruby-on-rails", "ruby", "devise", "ruby-on-rails-5" ]
[ "Separate stdin and stdout file in Eclipse", "The launch configuration dialog is\n\n\n\nAm I right that if one needs the input from a file then output also goes into a file? Why it must be the same file? I do not see any option to have two separate connections." ]
[ "eclipse", "stdout", "stdin" ]
[ "I have a problem with SQLite in android apk file", "When I run my project from android studio to a device all works well and sqlite reads and writes all the data i want it to...but when I generate an APK SQLite doesn't work at all and I don't get any data, what could be the problem?\n\nEdit:\nI have used the command below to use my database and the database works in the apk and is created as you can see\n\n\n\nand to update a certain element I use:\n\nString s = \"UPDATE data SET Username='\"+userT+\"'\";\n database.execSQL ( s );" ]
[ "android", "sql", "sqlite", "android-studio" ]
[ "IIS7.5 web.config redirects being ignored", "I have the following httpredirect in the web.config which is being ignored. This web.config is on the root of a hybrid webforms and MVC web application. Both locations in the example below are webforms pages.\n\n<configuration>\n<system.webServer>\n <httpRedirect enabled=\"true\" exactDestination=\"true\" httpResponseStatus=\"Permanent\">\n <add wildcard=\"*/foldername/\" destination=\"/anotherfolder/file.aspx\" />\n </httpRedirect>\n </system.webServer>\n</configuration>\n\n\nThis is on localhost btw but the httpredirect should work on both the localhost and the live server. What am I doing wrong?\n\nNOTE: There are a lot of instructions on the web pointing to the URL Rewrite IIS module. I can't install this on the live server so that's not an option." ]
[ "asp.net", "url-redirection" ]
[ "Can't define one QUAD properly", "I'm want to have a rectangular cube. One wall has face on the wrong side so I can't see pink colour. This is good side of the cube:\n\n\n\nAt the back of the cube there is grey back face of the wall: \n\n\nThis is the code:\n\nglBegin(GL_QUADS);\n //floor\n glMaterialfv(GL_FRONT, GL_DIFFUSE, floor_diffuse);\n glVertex3f(-floor_size_x / 2, 0, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, 0, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, 0, -floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, 0, -floor_size_z / 2);\n\n //roof\n glMaterialfv(GL_FRONT, GL_DIFFUSE, roof_diffuse);\n glVertex3f(-floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, -floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, wall_height, -floor_size_z / 2); \n //walls\n glMaterialfv(GL_FRONT, GL_DIFFUSE, walls_diffuse);\n glVertex3f(-floor_size_x / 2, 0, floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, wall_height, -floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, 0, -floor_size_z / 2);\n\n glVertex3f(floor_size_x / 2, 0, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, -floor_size_z / 2);\n glVertex3f(floor_size_x / 2, 0, -floor_size_z / 2);\n\n glVertex3f(-floor_size_x / 2, 0, -floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, wall_height, -floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, -floor_size_z / 2);\n glVertex3f(floor_size_x / 2, 0, -floor_size_z / 2); \n\n //BAD WALL\n glVertex3f(floor_size_x / 2, 0, floor_size_z / 2);\n glVertex3f(floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, wall_height, floor_size_z / 2);\n glVertex3f(-floor_size_x / 2, 0, floor_size_z / 2);\n\n glEnd();\n\n\nI've tried all combinations (counter)clockwise order but result is still the same. Any ideas?" ]
[ "c++", "opengl", "3d" ]
[ "How to expose a property (virtual field) on a Django Model as a field in a TastyPie ModelResource", "I have a property in a Django Model that I'd like to expose via a TastyPie ModelResource. \n\nMy Model is\n\nclass UserProfile(models.Model):\n _genderChoices = ((u\"M\", u\"Male\"), (u\"F\", u\"Female\"))\n\n user = Models.OneToOneField(User, editable=False)\n gender = models.CharField(max_length=2, choices = _genderChoices)\n\n def _get_full_name(self):\n return \"%s %s\" % (self.user.first_name, self.user.last_name)\n\n fullName = property(_get_full_name)\n\n\nMy ModelResource is\n\nclass UserProfileResource(ModelResource):\n class Meta:\n queryset = models.UserProfile.objects.all()\n authorization = DjangoAuthorization()\n fields = ['gender', 'fullName']\n\n\nHowever all I'm currently getting out of the tastypie api is:\n\n{\n gender: 'female',\n resource_uri: \"/api/v1/userprofile/55/\"\n}\n\n\nI have tried playing with the fields property in the ModelResource, but that hasn't helped. Would love to understand what is going on here." ]
[ "python", "django", "django-models", "tastypie" ]
[ "php dynamic page content based on url", "So, there are 3 urls:\n\nexample.com/first\nexample.com/middle\nexample.com/last\n\n\nIn my sql db, there is table with each terms that correspond to related posts:\n\nID NAME POSTS\n\n1 first 12,3,343\n2 middle 23,1,432\n3 last 21,43,99\n\n\nSo if an user visits example.com/first, then I want to show posts of \"12,3,343\" and other posts based on what url they are visiting.\n\nNow, this is the sequence how it would work in my head:\n\n\nUser types \"example.com/first\"\njs (ajax) or something detects the url (in this case, detects \"first\").\nthe term is sent to php query.\nGets appropriate info then sends it out (either by ajax or something else).\n\n\nAm I approaching this right?\nHow does the server detects what url was requested? I supposed I can skip the first two steps if I know how the server detects the url and I can query the correct info directly instead of relying on js to detect it.\n\nThanks!" ]
[ "javascript", "php", "jquery", "ajax" ]
[ "what does it take to upload a large file on heroku?", "I am trying to upload a video on a Django server hosted on heroku; it is not working but when uploading a picture it works. \nI am also using AWS to store my files.\nIs that i am using heroku free?" ]
[ "django", "http", "heroku", "amazon-s3" ]
[ "RNFirebase 'keepSynced' not working as expected", "We are using the react-native-firebase in one of our applications in which we have more than one reference (reference_A, reference_B, reference_C) at the same level and we want to restrict one of those references (reference_C) from getting synced with the Firebase Real-time Database but not the others.\nFor this, as suggested at Firebase Documentation and RNFirebase Documentation, we have used the 'keepSynced' method as below:\nimport database from '@react-native-firebase/database';\n..\n..\n..\ndatabase().ref('/reference_C').keepSynced(false);\n\nAlso, to persist the data for offline usage, we have used the 'setPersistenceEnabled' as below:\ndatabase().setPersistenceEnabled(true);\n\nBut, when observed at the Firebase console, the 'reference_C' is getting synced when the device is coming online which is not as expected.\nAny help with this is highly appreciated.\nThanks in advance." ]
[ "react-native", "firebase-realtime-database", "react-native-firebase" ]
[ "Is timezone info redundant provided that UTC timestamp is available?", "I have a simple mobile app that schedules future events between people at a specified location. These events may be physical or virtual, so the time specified for the event may or may not be in the same timezone as the 'location' of the event. For example, a physical meeting may be scheduled for two people in London at local time 10am on a specified date. Alternatively, a Skype call may be scheduled for two people in different timezones at 4pm (in one person's timezone) on a specified date though the 'location' of the event is simply 'office' which means two different places in different timezones.\n\nI wonder the following design is going to work for this application:\n\n\nOn the client, it asks user to input the local date and time and specify the timezone local to the event.\nOn the server, it converts the local date and time with the provided timezone into UTC timestamp, and store this timestamp only.\nWhen a client retrieves these details, it receives the UTC timestamp only and converts it into local time in the same timezone as the client's current timezone. The client's current timezone is determined by the current system timezone setting, which I think is automatically adjusted based on the client's location (of course, assuming the client is connected to a mobile network).\n\n\nMy main motivations for this design are:\n\n\nUTC is an absolute and universal time standard, and you can convert to/from it from/to any timezone.\nUsers only care about the local date and time in the timezone they are currently in.\n\n\nIs this a feasible design? If not, what specific scenarios would break the application or severely affect user experience? Critiques welcome." ]
[ "datetime", "time", "timezone", "timestamp", "timestamp-with-timezone" ]
[ "flutter - how to resume playing video from previous duration with Chewie controller?", "I have used the Chewie video player plugin to implement a video player. \n\n\nI want to save the duration when the video is paused/ exit from the video screen and \nresume playing from the exact duration the next time I visit the video screen.\n\nclass VideoPlayerScreen extends StatefulWidget {\n@override\n _VideoPlayerScreenState createState() => _VideoPlayerScreenState();\n\nfinal String video_link;\n VideoPlayerScreen({Key key, @required this.video_link}) : super(key: key);\n}\n\nclass _VideoPlayerScreenState extends State<VideoPlayerScreen> {\n\n VideoPlayerController _videoPlayerController;\n ChewieController _chewieController;\n\n@override\nvoid initState() {\nsuper.initState();\n_videoPlayerController = VideoPlayerController.network(\n widget.video_link)..initialize().then((_){setState(() {});\n });\n_chewieController = ChewieController(\n allowedScreenSleep: false,\n allowFullScreen: true,\n deviceOrientationsAfterFullScreen: [\n DeviceOrientation.landscapeRight,\n DeviceOrientation.landscapeLeft,\n DeviceOrientation.portraitUp,\n DeviceOrientation.portraitDown,\n ],\n videoPlayerController: _videoPlayerController,\n aspectRatio: 16/9,\n looping: true,\n showControls: true,\n);\n_chewieController.addListener(() {\n if (_chewieController.isFullScreen) {\n SystemChrome.setPreferredOrientations([\n DeviceOrientation.landscapeRight,\n DeviceOrientation.landscapeLeft,\n ]);\n }\n});}\n\n\n@override\nvoid dispose() {\n_videoPlayerController.dispose();\n_chewieController.dispose();\nSystemChrome.setPreferredOrientations([\n DeviceOrientation.landscapeRight,\n DeviceOrientation.landscapeLeft,\n DeviceOrientation.portraitUp,\n DeviceOrientation.portraitDown,\n]);\nsuper.dispose();}" ]
[ "flutter", "video-player" ]
[ "check if an object have all the property of a class in typescript", "I have a class abc in typescript\nexport class ABC{\n public a : any;\n public b : any;\n public c? : any;\n public d? : any;\n}\n\nNow in my function I receive an input lets say data:any\nNow i want to check if that input i.e data have all the required property of class ABC.\nIs there any option to do this without using hasOwnProperty on every key of class ABC and object data." ]
[ "javascript", "node.js", "typescript" ]
[ "Cant import Eve module", "Hello I recently installed Eve using pip3 install eve. But now I am having import problems. After installing eve from pip3. I can't import it. I tried it with Python3.3 and with Python2.7. When I try:\n\nfrom eve import Eve\n\nI get back Module not found error. Can you help me on this?" ]
[ "python", "eve" ]
[ "How can we see the transformed vaue z, in autoencoder link: http://deeplearning.net/tutorial/dA.html", "How can we see the z value , which is the reconstruction of x (dataset )\n\nPlease see the link : http://deeplearning.net/tutorial/dA.html" ]
[ "machine-learning", "neural-network", "theano" ]
[ "ImageMagick 2 Versions", "I had ImageMagick installed on my server. I downloaded and installed a newer version, but installed it in the folder /usr/share/ImageMagick-6.8.9-10\n\nThe new version is installed, but when I run convert, it is referencing the old version.\n\nDid I install it in the wrong location? How do I fix this problem?" ]
[ "imagemagick" ]
[ "spring boot application according to ldap groups", "I 'm using ldap authentication to secure a spring boot app. I want to authorize endpoints for specific groups of ldap server. Any suggestions?\n\nHere's my SecurityConfig.java file.\n\n@Override\nprotected void configure(HttpSecurity http) throws Exception {\n\n\n http\n .csrf().disable()\n .authorizeRequests()\n .antMatchers(\"/403\",\"/login\",\"/footer\").permitAll()\n .antMatchers(\"/\",\"/LifeForm**\",\"/home\").fullyAuthenticated()\n //.anyRequest().authenticated()\n .and()\n //.httpBasic()\n //.and()\n .formLogin()\n .loginPage(\"/login\").failureUrl(\"/403\").permitAll()\n .and()\n .logout().logoutUrl(\"/403\").invalidateHttpSession(true).deleteCookies(\"JSESSIONID\").logoutSuccessUrl(\"/login\");\n}\n\n@Override\nprotected void configure(AuthenticationManagerBuilder auth) throws Exception {\n\n if(Boolean.parseBoolean(ldapEnabled)) {\n\n auth\n .ldapAuthentication()\n .userSearchFilter(\"(&(objectClass=user)(sAMAccountName={0}))\")\n .groupRoleAttribute(\"cn\")\n .groupSearchFilter(\"(&(objectClass=groupOfNames)(member={0}))\")\n .groupSearchBase(\"ou=groups\")\n .contextSource()\n .url(ldapUrls + ldapBaseDn)\n .managerDn(ldapSecurityPrincipal)\n .managerPassword(ldapPrincipalPassword);\n\n } else {\n auth\n .inMemoryAuthentication()\n .withUser(\"user\").password(\"password\").roles(\"USER\")\n .and()\n .withUser(\"admin\").password(\"admin\").roles(\"ADMIN\");\n }\n}" ]
[ "java", "spring", "spring-boot", "ldap", "authorization" ]
[ "Invalid Hook Call Warning", "I'm facing this error: "Invalid Hook Call Warning" and it says that there are three possibilities of why it is happening:\n\nYou might have mismatching versions of React and the renderer (such as React DOM)\nYou might be breaking the Rules of Hooks\nYou might have more than one copy of React in the same app\n\n1 and 3 I'm quite sure they're not causing the problem, I installed react from the 'create react-app' boilerplate yesterday.\nThis is the code that is causing the issue.\n\nimport { createContext, useState, useContext } from "react"\nimport api from "../services/api"\n\nexport const AuthContext = createContext({})\n\nconst [user, setUser] = useState(null)\n\nasync function Login() {\n const response = await api.post("/auth/local", {\n identifier: "[email protected]",\n password: "123123",\n })\n\n setUser(response.data.user)\n api.defaults.headers.Authorization = `Bearer ${response.data.token}`\n}\n\nexport function AuthProvider({ children }) {\n return (\n <AuthContext.Provider value={{ signed: Boolean(user), Login }}>\n {children}\n </AuthContext.Provider>\n )\n}\n\nexport function useAuth() {\n const context = useContext(AuthContext)\n\n return context\n}\n\nCould anyone help me?" ]
[ "reactjs", "react-hooks" ]
[ "Group elements from multiple lists", "I have following data structure:\n\n\n\nBasically here I have a list, that contains other lists (their size can be arbitrary, in my case all 4 lists have size 2). I have to group so that lists that have the same elements go into one list (maybe not the best formulations, but I cannot formulate it better). In my case the results should be as follows:\n[72, 83, 127] and [110, 119].\n\nIf for example thirds sublist is contains elements [83, 127, 55, 22], then the result should be as follows:[72, 83, 127, 55, 22] and [110, 119]. (So I have to include all sublist elements).\n\nHow can I do such thing in Java or Groovy?" ]
[ "java", "list", "groovy" ]
[ "Typescript transpiling to javascript for firebase functions", "I have started to delve into cloud functions for firebase, but being an Android dev moving back into javascript after so long has been tough.\n\nI have configured a new project with the firebase command line tools i.e. firebase login/init/deploy. And also npm and all the dependencies needed.\n\nI am developing using Webstorm and decided to try to use Typescript as per the video on youtube.\n\n[https://www.youtube.com/watch?v=GNR9El3XWYo&t=1106s][1]\n\nI've managed to get my Typescript compiling, but when transpiling to javascript it doesn't compile correctly.\n\nCan anyone help me with this issue?\n\nTS script below\n\nimport * as functions from 'firebase-functions'\nimport * as request from 'request-promise'\n\nexport let addPlayerRequestNotification = functions.database\n .ref('notifications/{id}/notification')\n .onWrite(async event => {\n let notificaion = event.data.val();\n\n let oauthToken = await functions.config().firebase.credential.getAccessToken();\n\n await request ({\n url: 'https://fcm.googleapis.com/fcm/send',\n method: 'POST',\n headers: {\n 'Content-Type' :' application/json',\n 'Authorization': 'key='+oauthToken\n },\n body: {\n \"notification\": {\n \"title\": notificaion.title,\n \"text\": notificaion.text,\n },\n to : '/topics/'+notificaion.topic\n }\n });\n});\n\n\nAnd the javascript compiled code is \n\n\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst functions = require(\"firebase-functions\");\nconst request = require(\"request-promise\");\nexports.addPlayerRequestNotification = functions.database\n .ref('notifications/{id}/notification')\n .onWrite((event) => __awaiter(this, void 0, void 0, function* () {\n let notificaion = event.data.val();\n let oauthToken = yield functions.config().firebase.credential.getAccessToken();\n yield request({\n url: 'https://fcm.googleapis.com/fcm/send',\n method: 'POST',\n headers: {\n 'Content-Type': ' application/json',\n 'Authorization': 'key=' + oauthToken\n },\n body: {\n \"notification\": {\n \"title\": notificaion.title,\n \"text\": notificaion.text,\n },\n to: '/topics/' + notificaion.topic\n }\n });\n}));\n\n\nThe offending line is this\n\n.onWrite((event) => __awaiter(this, void 0, void 0, function* () {\n\n\nMore specifically the => character. The error I get is expression expected.\n\nThis is my tsconfig.json file\n\n{\n \"compilerOptions\": {\n \"target\": \"es6\",\n \"module\": \"commonjs\"\n },\n \"include\": [\n \"functions/**/*.ts\"\n ],\n \"exclude\": [\n \"functions/node_modules\"\n ]\n}\n\n\nIf anyone has any ideas on this, I would greatly appreciate any help." ]
[ "node.js", "typescript", "firebase-realtime-database", "firebase-cloud-messaging", "google-cloud-functions" ]
[ "Linq query on EFCore Sqlite does not work", "I'm using EFCore SQLite, when run a simple query with Linq, I notice that the query Take().Last() does not return what is expected, sample code:\n\n// There are more than 10000 rows in the table\nDbSet<DataEntry> set = ctx.Set<DataEntry>();\n// this should return the first 20 rows\nvar current = set.OrderBy(row => row.Id).Take(20);\n// first entry is right\nlong tStart = current.First().Time;\n// This should have returned the last entry in the first 20 entries, but instead, it returned the last entry of the entire data set\nlong tEnd = current.Last().Time;\n\n// so essentially it looks like this:\nset.Last().Time == set.Take(20).Last().Time\n\n\nIt looks Last will return the last entry in the entire backing data set, no matter which query it is based on. How can I fix this?" ]
[ "c#", "sqlite", "linq-to-entities", "entity-framework-core", "system.data.sqlite" ]
[ "Pass params to function when using on() in jquery", "A senior of mine advise me to always write using snytax 2, but I have some issue with passing parameters. If my function coloring has 2 params, how I pass them in?\n\n//snytax 1\n$(\"body\").on(\"li\",\"click\",function(){\n $(this).css({'color:red'});\n});\n\n//snytax 2\n$(\"body\").on(\"li\",\"click\", coloring);\n\nfunction coloring(param1,param2){\n//what to do here?\n}" ]
[ "javascript", "jquery" ]
[ "another HTML/CSS layout challenge", "I've been trying to figure out a solution to this problem but haven't been 100% successful, just pseudo successful. The layout I'm looking for is one such that there is always a fixed padding/margin/height on the top and bottom of the page no matter the height of the content.\n\nFurther, the height of the content should start at the top of the page right after the padding and reach the bottom of the page right before the padding. If the height of the content isn't large enough, it should span the whole page. If it is larger than the height of the page, the scrollbar should appear as in normal situations, but the top/bottom paddings need to be preserved.\n\nTo view an example of my pseudo-solution to this, check out this fiddle...\n\n\nhttp://jsfiddle.net/UnsungHero97/uUEwg/1/ ... height not large enough\nhttp://jsfiddle.net/UnsungHero97/uUEwg/8/ ... height too large\n\n\nThe problem with my solution is that if there is a background image, it will be covered up where the padding is. So how do I extend my solution such that if there is a background image, it will still be visible where the top/bottom paddings are? I would prefer this to be a HTML/CSS only solution, which is what makes this really hard!\n\nLet me know if I need to clarify anything." ]
[ "html", "css", "layout" ]
[ "Google earth sequential placemarks on a time delay", "I have a KML file with a few different placemarks all around the globe. I would like to flyto the first placemark and display it's balloon, wait a minute or two, then flyto the next placemark, and repeat this process until all of the placemarks have been shown.\n\nI think I might be able to achieve this by putting all the placemarks into a tour but this doesn't seem like the right approach. I'm going to be refreshing the KML from a server and I'm not sure how a tour would react to that (e.g., I think you have to always click play before starting a tour).\n\nIf this isn't possible I may have to place just a single placemark in the KML file and then keep refreshing the file with a different placemark. I think that approach might be bad though because it will be refreshing a lot more." ]
[ "kml", "google-earth" ]
[ "'ddCountries' has a SelectedValue which is invalid because it does not exist in the list of items", "<asp:DropDownList runat=\"server\" ValidationGroup=\"SaveInformation\" ID=\"ddCountries\"> \n</asp:DropDownList>\n\n\nCode Behind: Countries with ID and Name are coming in DataTable\n\nddCountries.DataSource = new GeneralStatic().GetAllCountries();\nddCountries.DataTextField = \"Name\";\nddCountries.DataValueField = \"ID\";\nddCountries.DataBind();\nddCountries.Items.Insert(0, \"-- Select Country --\");\n\n\nIt was working fine before now throwing error\n\n\n 'ddCountries' has a SelectedValue which is invalid because it does not\n exist in the list of items." ]
[ "c#", "asp.net", "webforms" ]
[ "Javascript validation not working in Chrome", "JavaScript validation & alert is working on Internet Explorer but not in Chrome.\nPls help me in understanding the problem and provide solution for the same.\n\n\r\n\r\nthis.form1.i2.focus();\r\nthis.form1.i2.select();\r\n\r\nfunction validateInput() {\r\n userInput = new String();\r\n userInput = this.form1.i2.value;\r\n\r\n if (userInput.match(\"Indica\"))\r\n document.getElementById('boldStuff').innerHTML = '(Note: This vehicle to be requested one hour before)';\r\n else if (userInput.match(\"Innova\"))\r\n document.getElementById('boldStuff').innerHTML = '(Note: This vehicle to be requested one hour before)';\r\n else if (userInput.match(\"Others\"))\r\n document.getElementById('boldStuff').innerHTML = '(Note: This vehicle to be requested one hour before)';\r\n else if (userInput.match(\"Tavera\"))\r\n document.getElementById('boldStuff').innerHTML = '';\r\n else if (userInput.match(\"Tempo\"))\r\n document.getElementById('boldStuff').innerHTML = '';\r\n}\r\n<select name='i2' onChange='validateInput(this.value)' onClick=\"check2()\">\r\n <option value='Select'>Select</option>\r\n <option value='Tavera'>Tavera</option>\r\n <option value='Innova'>Innova</option>\r\n <option value='Indica'>Indica</option>\r\n <option value='Indigo'>Indigo</option>\r\n <option value='Tempo'>Tempo</option>\r\n <option value='Etios'>Etios</option>\r\n <option value='Others'>Others</option>\r\n</select>\r\n<br>" ]
[ "javascript", "html", "ajax" ]
[ "How would I sort this SP list in an SPFX webpart?", "I want to sort a list that is being received into an SP webpart. I want to sort it by it's ID column.\nI'm getting the items from the list using:\n\nsp.web.lists.getByTitle(\"Reports\").items.get().then((items: any[]) => {\n\n let returnedItemsFullA: IListAItem[] = items.map((item) => { return new ListAItem(item); });\n\n\n\nAfter reading other posts I understand that you have to sort before you map but I don't know how to incorporate the sort with the above.\n\nRegards,\nT" ]
[ "reactjs", "sharepoint-online", "spfx" ]
[ "Vim: How to show the error message when there is a syntax error?", "I have a C file (or ruby file) and I have a syntax error. When I save there is a bar that appears on the left, and an arrow pointing to the line where the syntax error is. I have the syntastic vim plugin installed so I don't know if that is a native feature or if it comes from the plugin.\n\nNow my question is: How can I see the error message from within vim?" ]
[ "vim", "vim-plugin" ]
[ "AppCompactImageView Leak Canary", "I'm using Leak Canary to detect leak memory on my app. mLogoImage is an ImageView, and it leaks because it's referencing PhoneWindow I think.\nMaybe this is related to (https://code.google.com/p/android/issues/detail?id=171190). This is the log:\n\nD/LeakCanary: * android.support.v7.widget.AppCompatImageView has leaked:\nD/LeakCanary: * GC ROOT android.database.ContentObserver$Transport.mContentObserver\nD/LeakCanary: * references com.android.internal.policy.impl.PhoneWindow$SettingsObserver.this$0\nD/LeakCanary: * references com.android.internal.policy.impl.PhoneWindow.mContext\nD/LeakCanary: * references com.example.MyActivity.mLogoImage\nD/LeakCanary: * leaks android.support.v7.widget.AppCompatImageView instance\nD/LeakCanary: * Reference Key: 307116d2-da30-4dbd-a105-74d0ea1c4361\n\n\nAny guess how to solve this?" ]
[ "android", "memory-leaks", "leakcanary" ]
[ "Why does Code Contracts shows \"Malformed contract. Found Requires after assignment\" in method with params keywork?", "I've been troubleshooting with this error for hours and I can't seem to understand why this happens. Consider the following code:\n\nusing System;\nusing System.Diagnostics.Contracts;\nusing System.Linq.Expressions;\n\nnamespace Contracts\n{\n class Data\n {\n public object TestData1 { get; set; }\n public object TestData2 { get; set; }\n }\n\n class Program\n {\n static void Main()\n {\n Data d = new Data();\n Method(d);\n }\n\n static void Method(Data d)\n {\n Contract.Requires(Methods.TestMethod1(\"test\"));\n Contract.Requires(Methods.TestMethod2(\"test1\", \"test2\"));\n Contract.Requires(Methods.TestMethod3(d, x => x.TestData1));\n Contract.Requires(Methods.TestMethod4(d, x => x.TestData1, x => x.TestData2));\n }\n }\n\n static class Methods\n {\n [Pure]\n public static bool TestMethod1(string str) { return true; }\n\n [Pure]\n public static bool TestMethod2(params string[] strs) { return true; }\n\n [Pure]\n public static bool TestMethod3<T>(T obj, Expression<Func<T, object>> exp) { return true; }\n\n [Pure]\n public static bool TestMethod4<T>(T obj, params Expression<Func<T, object>>[] exps) { return true; }\n }\n}\n\n\nWhen I compile the project, the line \"Contract.Requires(Methods.TestMethod4(d, x => x.TestData1, x => x.TestData2));\" causes the following compilation error:\n\n\n Malformed contract. Found Requires after assignment in method 'Contracts.Program.Method(Contracts.Data)'.\n\n\nHow come \"Contract.Requires(Methods.TestMethod2(\"test1\", \"test2\"));\" doesn't cause an error but \"Contract.Requires(Methods.TestMethod4(d, x => x.TestData1, x => x.TestData2));\" does?\n\nPlease help! :(" ]
[ "c#", "code-contracts" ]
[ "Why does having a declaration of a private base class render a type name inaccessible?", "I am surprised that in the following example declaring Middle's base class private makes that name unavailable as a type in a subsequent derivation.\n\nclass Base {\npublic:\n Base(Base const& b) : i(b.i) {}\n\n int i;\n};\n\nclass Middle : private Base { //<<<<<<<<<<<\npublic:\n Middle(Base const* p) : Base(*p) {}\n};\n\nclass Upper : public Middle {\npublic:\n Upper(Base const* p) : Middle(p) {} //<<<<<<<<<<<\n};\n\n\nCompiling thusly with g++ (Debian 6.3.0-18+deb9u1) 6.3.0 20170516...\n\ng++ -std=c++11 privateBase.cpp\n\n\nI get the following diagnostics:\n\nprivateBase.cpp:15:9: error: ‘class Base Base::Base’ is inaccessible within this context\n Upper(Base const* p) : Middle(p) {}\n ^~~~\nprivateBase.cpp:1:12: note: declared here\n class Base {\n ^\n\n\nClearly at the point that Base was used as Middle's base class its name was available as a type. I can understand that when Base is used to denote base class storage that should be private. But having a declaration of a private base class render a type name inaccessible seems, at the very least, unexpected." ]
[ "c++", "injected-class-name" ]
[ "Is my implementation of confusion matrix correct? Or is something else at fault here?", "I have trained a multi class svm classifier with 5 classes, i.e. svm(1)...svm(5).\n\nI then used 5 images not used to during the training of these classifiers for testing.\n\nThese 5 images are then tested with their respective classifier. i.e. If 5 images were taken from class one they are tested against the same class. \n\n predict = svmclassify(svm(i_t),test_features);\n\n\nThe predict produces a 5 by 1 vector showing the result. \n\n-1\n 1\n 1\n 1\n-1\n\n\nI sum these and then insert it into a diagonal matrix. \n\nIdeally it should be a diagonal matrix with 5 written diagonally when all images are correctly classified. But the result is very poor. I mean in some cases I am getting negative result. I just want to verify if this poor result is because my confusion matrix is not accurate or if I should use some other feature extractor.\n\nHere is the code I wrote\n\n svm_table = [];\n for i_t = 1:numel(svm)\n test_folder = [Path_training folders(i_t).name '\\']; %select writer\n\n feature_count = 1; %Initialize count for feature vector accumulation\n\n for j_t = 6:10 %these 5 images that were not used for training\n [img,map] = imread([test_folder imlist(j_t).name]); \n\n test_img = imresize(img, [100 100]);\n test_img = imcomplement(test_img);\n\n %Features extracted here for each image.\n %The feature vector for each image is a 1 x 16 vector.\n\n test_features(feature_count,:) = Features_extracted;\n %The feature vectors are accumulated in a single matrix. Each row is an image\n\n feature_count = feature_count + 1; % increment the count\n end\n test_features(isnan(test_features)) = 0; %locate Nan and replace with 0\n %I was getting NaN in some images, which was causing problems with svm, so just replaced with 0\n\n predict = svmclassify(svm(i_t),test_features); %produce column vector of preicts\n svm_table(end+1,end+1) = sum(predict); %sum them and add to matrix diagonally\n end\n\n\nthis is what I am getting. Looks like a confusion matrix but is very poor result.\n\n-1 0 0 0 0\n 0 -1 0 0 0\n 0 0 3 0 0\n 0 0 0 1 0\n 0 0 0 0 1\n\n\nSo I just want to know what is at fault here. My implementation of confusion matrix. My way of testing the svm or my selection of features." ]
[ "matlab", "machine-learning", "classification", "svm", "feature-extraction" ]
[ "Runtime SQL Query Builder", "My question is similar to \n\nIs there any good dynamic SQL builder library in Java?\n\nHowever one important point taken from above thread:\n\n\n Querydsl and jOOQ seem to be the most popular and mature choices however there's one thing to be aware of: Both rely on the concept of code generation, where meta classes are generated for database tables and fields. This facilitates a nice, clean DSL but it faces a problem when trying to create queries for databases that are only known at runtime.\n\n\nIs there any way to create the queries at runtime besides just using plain JDBC + String concatenation?\n\nWhat I'm looking for is a web application that can be used to build forms to query existing databases. Now if something like that already exists links to such a product would be welcome too." ]
[ "java", "sql", "runtime", "query-builder" ]
[ "How to parse the data obtained from $.get() function", "I obtained the data from the server using ajax like this: (EDITED)\n\n$(document).ready(function()\n{\n setInterval(function()\n {\n $.get('/forms/requestProcessor.php', function(data) \n {\n $(\"#shout\").append(data.question+'<br>');\n alert('Load was performed.');\n },'JSON');\n }, 5000); // 5 seconds\n});\n\n\nIn the php file,i send data like this:\n\nwhile($row=mysql_fetch_array($result))\n{\n $question=$row['Question'];\n $choice1=$row['Choice1']; \n $choice2=$row['Choice2'];\n $choice3=$row['Choice3'];\n $choice4=$row['Choice4'];\n\n $return_data->question = $question;\n $return_data->choice1 = $choice1;\n $return_data->choice2 = $choice2;\n $return_data->choice3 = $choice3;\n $return_data->choice4 = $choice4;\n\n echo(json_encode($return_data));\n}\n\n\nIt prints \"undefined\". However, if i point the browser directly to the php file, it shows the data properly in json format" ]
[ "php", "jquery", "ajax" ]
[ "How to run Profiler (memory management) from Android Studio for a React Native project?", "I'm working almost exclusively from the CLI without really opening Android Studio much. Now, I'd like to run the Android profiler, but all of the buttons are greyed out. If I search for the \"Profile\" action and run it, I get a window for templates and debug configurations which is something I haven't had to use with React Native and can't find any documentation.\n\nHere's my screen after tapping \"Profile...\" - thanks!" ]
[ "android", "performance", "react-native", "android-studio", "memory" ]
[ "Can you change the name of the Django admin 'is_staff' flag?", "I want to rename the \"is_staff\" flag to \"is_volunteer\" to better model the use-cases of our system. The function of this flag should stay exactly the same: only users with is_volunteer = True can access the admin interface. \n\nI haven't dug through the django.contrib.auth library to determine how rigid the model is, but I'm curious if anyone has done this before." ]
[ "django", "django-admin" ]
[ "Foreign Key to multiple tables", "I've got 3 relevant tables in my database.\n\nCREATE TABLE dbo.Group\n(\n ID int NOT NULL,\n Name varchar(50) NOT NULL\n) \n\nCREATE TABLE dbo.User\n(\n ID int NOT NULL,\n Name varchar(50) NOT NULL\n)\n\nCREATE TABLE dbo.Ticket\n(\n ID int NOT NULL,\n Owner int NOT NULL,\n Subject varchar(50) NULL\n)\n\n\nUsers belong to multiple groups. This is done via a many to many relationship, but irrelevant in this case. A ticket can be owned by either a group or a user, via the dbo.Ticket.Owner field. \n\nWhat would be the MOST CORRECT way describe this relationship between a ticket and optionally a user or a group?\n\nI'm thinking that I should add a flag in the ticket table that says what type owns it." ]
[ "sql-server", "relational-database" ]
[ "\"Multi-threading\" w/ NSTimers in an iPhone app", "Say I have two NSTimers in my iPhone app: timer1 and timer2. timer1 calls function1 30 times per second and timer2 calls function2 30 times per second. Assume these two functions are reading and updating the same integer variables. Are there any \"multi-threading\" issues here? If not how does iPhone OS handle the execution of the two functions (in general)?" ]
[ "iphone", "multithreading", "nstimer" ]
[ "How use a certificate into NWJS and Linux", "I am making and app with Nwjs and AngularJS, the app is working fine on Windows but now I am trying to export the app to linux(\"Ubuntu\"), but I am getting\na error with the certificate, on Windows I installed the certificate on \"Trusted Root Certification Authorities\" and in that case nwjs is getting all the files\nwithout problem.\n\nI will explain the code that I have now:\n\nin the index file I have something like the following code, in that code I load the \"js, css and html\" from the server:\n\n<script type=\"text/javascript\" src=\"https://test.com/Devel/Main/js/first.js\"</script>\n\n<link rel=\"stylesheet\" type=\"text/css\"href=\"https://test.com/Devel/Main/css/file.min.css\"> \n\n\nLike you can see I need load some files from a server in that case I named that \"https://test.com\".\n\nin the Route file I have:\n\ninspection.config(function($routeProvider, $translateProvider, $sceDelegateProvider) {\n\n $sceDelegateProvider.resourceUrlWhitelist([\n 'self', \n 'https://test.com/**'\n ]);\n\n $routeProvider\n .when('/shipmentInformation/', {\n templateUrl: 'https://test.com/Devel/Main/html/shipmentInformation.html',\n controller: 'shipmentInformationController'\n }).otherwise({\n redirectTo: '/'\n });\n});\n\n\nI tried the solution that I found here, after that I can see the certificate into the etc/ssl, then I \nthink that the process that I did is correct.\n\nThe problem that I have\n\n\nI am not sure the equivalent of \"Trusted Root Certification Authorities\" on Linux\nWhere is reading nwjs the certificates\n\n\nthanks for any help" ]
[ "angularjs", "node.js", "linux", "ssl", "nwjs" ]
[ "Delete same cookie on different domains", "In the past we were setting our cookies without the 'domain' option (using the cookie plugin) e.g:\n\n$.cookie(\"blah\", \"1\", {\n expires: 365,\n path: \"/\"\n});\n\n\nNow we are setting it like:\n\n$.cookie(\"blah\", \"1\", {\n expires: 365,\n path: \"/\",\n domain: \".site.com\"\n});\n\n\nHowever the problem is there are 2 cookies with the same name set for users who already have the old cookie on the page.\n\nAs a solution, at the point of setting the new cookie I am doing:\n\n$.cookie(\"blah\", null, {\n path: \"/\"\n});\n\n\nWhich should delete the cookie without the 'domain' option. Otherwise when reading the cookie it could give me the old value as there may be 2 set with the same name.\n\nDo you think this is an ok workaround? I tested it in Firefox and it works fine as I haven't specified the domain part so it shouldn't delete the new cookie, just the old, however I am worried it could happen maybe on older browsers like IE6 or on mobiles (we get a lot of mobile traffic)?\n\nAny guidance would be great!" ]
[ "javascript", "jquery", "cookies" ]
[ "is there any way to auto copy of any new MySQL table to HANA DB through Pentaho?", "I have a MySQL DB and I constantly copy my data into Sap HANA DB for analytics. However, MySQL DB is under development and it always emerges new tables. For each new table, I create a matching table in HANA and a new ETL pipeline in Pentaho. It seems a bit silly to me. I guess there should be some way to auto construct the new table in HANA and copy the data from MySQL to HANA for this new table. Is it a valid thinking for Pentaho or still I should do the same as explained?" ]
[ "php", "mysql", "pentaho", "hana" ]
[ "Defining a XML entity without having the DTD \"scheme\"", "I'd like to use XML entities to define text snippets shortcuts.\nBut for that, I need to define DTD:\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE ruleset [\n <!ENTITY useCli SYSTEM \"Define this setting using JBoss CLI or the web console.\">\n]>\n<ruleset id=\"...\"\n\n\nBut this doesn't work since XML tools complain about the ruleset element not being defined. So I tried\n\n <!ELEMENT ruleset ANY>\n\n\nBut then it wants the child elements, attributes etc.\n\nIs there a way to define a XML entity without defining the whole DTD? (There is a XSD schema for that document.)" ]
[ "xml", "dtd", "entities" ]
[ "Show Button only in edit mode odoo", "I have added a button to existing form of purchase order in Purchase order Line Tree. But i want to show that button only in edit mode. I tried:\n\n<button name=\"adjust_received_qty\" string=\"⇒ Adjust\" type=\"object\" class=\"oe_edit_only\"/>\n\n\ni tried to put class = oe_read_only, but it does not work in odoo 8. \n\nThanks,\n\nUPDATE\n\nMy requirement is : i want to show the button when user clicks edit button. if i use the suggested approach, i will able to hide button in create view.but it will be visible in form view even in view mode. I want to show the button only in edit view ( when user clicks the edit button )\n\nPlease Help," ]
[ "openerp", "odoo-8" ]
[ "What can be the reason of a TCP Server connection failure?", "I am trying to connect a Wago PFC200 controller to the mosquitto broker I have running on my laptop using the MQTT_Client library by Stefan Rossmann Engineering Solutions.\nI get "Connecting to TCP-Server Timed out" error and I'm having trouble figuring out how to troubleshoot it. Before running out of ideas I've tried forcing a bigger value of timeout during runtime, changing the port I'm trying to connect to or the IP — switching to HiveMQ's public MQTT broker, a broker running on my phone and on another laptop. Not sure if that's relevant, but I'm working in e!cockpit.\nThe socket is created successfully and then the error occurs because xResult := SysSockConnect(diSocket, ADR(sockAddr), SIZEOF(sockAddr)); does not change to True — why exactly may that be?\nIF (sockAddr.sin_addr = 0) THEN\n sockAddr.sin_family := SOCKET_AF_INET; \n IF (right(i_sBrokerAddress,1) = '0' OR right(i_sBrokerAddress,1) = '1' OR right(i_sBrokerAddress,1) = '2' OR right(i_sBrokerAddress,1) = '3' OR right(i_sBrokerAddress,1) = '4'\n OR right(i_sBrokerAddress,1) = '5' OR right(i_sBrokerAddress,1) = '6' OR right(i_sBrokerAddress,1) = '7' OR right(i_sBrokerAddress,1) = '8' OR right(i_sBrokerAddress,1) = '9') THEN\n sockAddr.sin_addr := SysSockInetAddr(i_sBrokerAddress); \n ELSE\n sockAddr.sin_addr := SysSockGetHostByName(i_sBrokerAddress);\n \n \n END_IF\n END_IF\n \n sockAddr.sin_port := SysSockHtons(i_uiPort);\n wTimeOutValue:=1000;\n xResult := SysSockConnect(diSocket, ADR(sockAddr), SIZEOF(sockAddr));\n q_sDiagMsg:='Connect to TCP-Server';\n IF (xResult) THEN\n q_udiState:=15; \n END_IF\n IF (TON_TimeOut.Q) THEN\n q_udiState:=90; \n q_xError := TRUE;\n q_sDiagMsg:='Connecting to TCP-Server Timed out';\n END_IF" ]
[ "sockets", "tcp", "mqtt", "plc", "codesys" ]
[ "Parse List using json_serializable library in Flutter", "Consider the following json:\n\n[\n {\n \"id\": 1\n \"name\": \"foo\"\n },\n {\n \"id\": 1\n \"name\": \"foo\"\n }\n]\n\n\nI am trying to parse this using json_serializable library.\n\njson.decode(response.body) returns List<dynamic>.\n\nbut the json_serializable auto-generates methods fromJson and toJson with type Map<String, dynamic json>.\n\nis there any way in json_serializable to parse List<dynamic> with auto-generated methods and not manually?" ]
[ "flutter", "flutter-dependencies", "json-serialization" ]
[ "Trigger Record Comparison", "I am working on a process that will create a history table when a version is changed for a record in a table. My trigger is below. It is working, but it is updating the history table on every update whether the value is different or not. I would like to only write to the history table if the ProductVersion is different.\n\nAny help would be great.\n\n CREATE TRIGGER UpdateServerControlSqlVersionHistory ON [monitor].[ServerControl]\nAFTER UPDATE\n AS\n\n BEGIN\nSET NOCOUNT ON;\n\nINSERT INTO monitor.ServerSqlVersionHistory\nSELECT i.ServerControlID, i.SqlLinkedServerName, i.ProductVersion, d.ProductVersion, GETDATE()\nFROM INSERTED i\n FULL OUTER JOIN DELETED d\n ON i.ServerControlID = d.ServerControlID\nEND\nGO" ]
[ "sql", "sql-server", "tsql", "triggers" ]
[ "Make mail() of PHP work under localhost of Mac", "I followed this video to configure localhost in my Mac OS X El Capitan. \n\nI have modified /etc/apache2/httpd.conf (eg, made /Users/softtimur as DocumentRoot and Directory), /etc/apache2/users/softtimur.conf and created /etc/php.ini.\n\nNow if I write a simple /Users/softtimur/Home.html, I could load it in a browser by localhost/Home.html; loading phpinfo() in a PHP file does show the PHP configuration page in a browser.\n\nHowever, in a terminal the result of apachectl -S is NOT Virtual Host configuration: Syntax OK as the video shows:\n\n:Site $ apachectl -S\nVirtualHost configuration:\n*:443 is a NameVirtualHost\n default server localhost (/private/etc/apache2/extra/httpd-vhosts.conf:40)\n port 443 namevhost localhost (/private/etc/apache2/extra/httpd-vhosts.conf:40)\n port 443 namevhost www.example.com (/private/etc/apache2/extra/httpd-ssl.conf:121)\nServerRoot: \"/usr\"\nMain DocumentRoot: \"/Users/softtimur\"\nMain ErrorLog: \"/private/var/log/apache2/error_log\"\nMutex proxy-balancer-shm: using_defaults\nMutex ssl-stapling-refresh: using_defaults\nMutex ssl-stapling: using_defaults\nMutex proxy: using_defaults\nMutex ssl-cache: using_defaults\nMutex default: dir=\"/private/var/run/\" mechanism=default \nMutex mpm-accept: using_defaults\nPidFile: \"/private/var/run/httpd.pid\"\nDefine: DUMP_VHOSTS\nDefine: DUMP_RUN_CFG\nUser: name=\"softtimur\" id=501 not_used\nGroup: name=\"_www\" id=70 not_used\n\n\nDoes anyone know if there is anything wrong?\n\nTo set sendmail_path, I have followed this thread:\n1) created a folder to store the email: /home/softtimur/Documents/TestEmails;\n2) gave permission to apache: run sudo chgrp -R _www TestEmails from the Documents folder\n3) modified php.ini: sendmail_path ='cat > /home/softtimur/Documents/TestEmails/mail.txt'\n\nAnd then, I wrote a file testmail.php:\n\n<?php\nmail('[email protected]', 'the subject', 'the body');\n?>\n\n\nBut loading the page did not send me any mail.\n\nDoes anyone know what's wrong in the whole process?" ]
[ "php", "macos", "apache", "phpmailer" ]
[ "Do we need to force locale or is it forced by default?", "Let's say we are making a calculator/game app for Android that does not contain any text other than digits: \"1,2,3,4...\" ...and we develop the app in the default \"en_US\" format... and we do not explicitly make any provisions, settings, or choices for alternate locales.\n\nIf the user has their global phone settings set to some Locale that formats numbers differently, perhaps using an entirely different script...\n\nWill their settings override the app and potentially distort the layout?\n\nand if so, is there any way to force the locale of the app to \"en_US\"?" ]
[ "android", "locale" ]
[ "Async/await in azure worker role causing the role to recycle", "I am playing around with Tasks, Async and await in my WorkerRole (RoleEntryPoint).\n\nI had some unexplained recycles and i have found out now that if something is running to long in a await call, the role recycles. To reproduce it, just do a await Task.Delay(60000) in the Run method.\n\nAnyone who can explain to me why?" ]
[ "azure", "async-await" ]
[ "why can't a 2-3 tree \"allow\" degree 1", "A question I've been struggling with... \nWhy the implementation of a 2-3 trees doesn’t allow nodes to have degree of 1?\n\nI thought it might be related to the O(log(n)) it (as a member of the B tree family) wants to keep, if degree 1 was allowed we could get a tree like that:\n\n\r\n\r\n1\r\n \\\r\n 2\r\n \\\r\n 3\r\n \\\r\n 4\r\n \\\r\n 5\r\n\r\n\r\n\n\nfor example and then some operations will take O(n) instead of O(log(n))\nbut i don't see where in this answer i referred to a 2-3 tree and why it can't allow degree 1... :-/ \n\nthanks! ;-)" ]
[ "data-structures", "tree", "binary-tree", "balance" ]
[ "Monitoring permgen space", "I'm looking for an option to monitor perigean space on my web logic server. I would like to use something like monit to check it periodically and restart the service if it gets too large. This is obviously a less than ideal workaround. But, I would like to get a quick fix in while we're looking fro the root cause." ]
[ "java", "weblogic", "monit" ]
[ "Plone 4.0.4 and collective.contentrules.mailtogroup - no group search result", "I would be very happy to have \"mailtogroup\" installed - really - so if someone could tell me how to exactly configure \"mailtogroup\" in order to sent group email. The problem is that no group names pop up, when I do the search. I was able to setup the single user email facility." ]
[ "email", "plone" ]
[ "How to write a PHPUnit test for Laravel Artisan command that calls an external API without calling that API physically?", "A brief introduction to give you an idea of what I want to achieve…\n\n\nI have a Laravel 5.6 artisan command that calls an external API with a simple GET request to get some data. I want to test this without actually calling any API physically. (I want to be offline and still have test test green).\n\nNow a brief explanation of how the logic is arranged.\n\n1) This artisan command (php artisan export:data) has its own constructor (__construct) where I inject bunch of stuff. One of the things I inject is the ExportApiService class. Easy.\n\npublic function __construct(\n ExportApiService $exportApiService,\n) {\n parent::__construct();\n\n $this->exportApiService = $exportApiService;\n}\n\n\n2) Now ExportApiService extends abstract class AbstractApiService. Inside this abstract class I made a constructor where I simply inject GuzzleHttp\\Client in a $client property so that in ExportApiService I can call API by using $this->client. Easy.\n\n3) So my ExportApiService has a method called exportData. Trivial. Works.\n\npublic function exportData(array $args = []): Collection\n{\n $response = $this->client->request('GET', 'https://blahblah.blah');\n\n return collect(json_decode($response->getBody()->getContents(), true));\n}\n\n\n4) So finally in my artisan command (that I introduced in point no. 1) I call:\n\npublic function handle()\n{\n $exportedData = $this->exportApiService->exportData($this->args);\n\n $this->info('Exported ' . count($exportedData) . ' records');\n}\n\n\nI want to test if the output matches my expectations without calling that external API at all. I want to mock it somehow…\n\npublic function testExportSuccessful()\n{\n $this->console->call('export:data', [$some_arguments]);\n\n $output = $this->console->output();\n\n $this->assertContains('Exported 123 records', $output); // this does not work :(\n}\n\n\nNow my exact question - how can I force Laravel / PHPUnit to return a fixed value every time the artisan command will call exportData()?\n\n\n What did you try?\n\n\nI tried creating a setUp() method with the following code:\n\npublic function setUp()\n{\n parent::setUp();\n\n $mock = $this->createMock(ExportApiService::class);\n\n $mock->method('exportData')->willReturn(123); // give me a dummy integer each time exportData is being called so that I can use is in the assert at the end\n}\n\n\nBut this does not work at all however it makes sense to me.\n\nThank you for any help." ]
[ "php", "laravel", "laravel-5", "phpunit" ]
[ "Changes in the theme editor doesn't update project?", "so I am running the latest version of android studio, and I am a bit confused about how the theme editor works. I have selected a different theme from the options, but android studio isn't updating everything to fit the theme. styles.xml looks the same as it was before as well as the colours used are the same. I've selected a theme with no action bar but the preview doesn't seem to have updated as well.\n\nI was under the presumption that any changes in the theme editor will automatically update to the project, so I dont have to go to the xml code and change it all. Do I still need to do that even after using the theme editor?" ]
[ "android", "mobile" ]
[ "No gradle file shown while importing project in android studio 0.5.2", "I want to import existing project into android studio 0.5.2 . When i select import project and go to the project it displays the build.gradle file along with project tree . following is the screenshot:\n\nBut when i select project it asks me to give link to the gradle home and when i give it manually it gives me error-\"location not correct\" and i don't get build.gradle file there for selection.(In this case the above build.gradle) file is not shown.How can i make it work??" ]
[ "android", "android-studio" ]
[ "Which Regular Expression flavour is used in Python?", "I want to which RegEx-Flavour is used for Python? Is it PCRE, Perl compatible or is it ICU or something else?" ]
[ "python", "regex", "pcre", "icu" ]
[ "regexp - to break a line into words", "i'm working for a long time to get an regexp string - but without any success.\nHope, to get some help here.\nThere are strings in the following format:\n\nG/20/EU (picture)/europe 21/\n\n\nor\n\n/House/200 hits/real estate\n\n\nor\n\ncolor/red-green/dark blue/orange/321\n\n\nGlobal rule: split the text on the characters / ( )\nSo the following regexp works: ([/()])\nBut I also need to remove/split on single numbers. Here: 20 and 321, but NOT on 21 (which is one phrase with \"europe 21\") or 200 (which is one phrase with \"200 hits\")\n\nSometimes the strings starts with an / or ends with an /, sometimes not. Numbers can occur at the beginning, at the end or in the middle of the string.\n\nThe results should be simple words or phrases like:\n\nG\nEU\npicture\neurope 21\nHouse\n200 hits\nreal estate\ncolor\nred-green\ndark blue\norange\n\n\nHave anyone an idea, how an regexp could look like?\n\nThank you" ]
[ "regex" ]