texts
sequence
tags
sequence
[ "MongoDB FULLTEXT Search for Emails", "Let's say I have the following fields in collection\nfname,\nlname,\ncontactData\n\nsample:\n\n\nfname = Dmitry\nlname = Semenov\ncontactData = 9491001120 9492006839 [email protected] [email protected]\n\n\nis it possible to implement FULLTEXT search on such collection so for example I can find by\nDmitry & [email protected]?" ]
[ "mongodb", "full-text-search" ]
[ "When a form is changed, another one has to take its input", "I have a drupal-7 website and I created a module, where you insert an image.\nThis is the code for this form at the .module file \n\nfunction testform($form, &$form_state) {\n$form = array();\n$form['file'] = array(\n '#type' => 'file',\n '#id' => 'files',\n '#title' => t('Select image'),\n '#description' => t('Upload a file, allowed extensions: jpg, jpeg, png, gif'),\n '#upload_validators' => array('file_validate_is_image' => array())\n);\n$form['submit'] = array(\n'#type' => 'submit',\n'#value' => t('Submit'),\n);\nreturn $form;\n}\n\n\nAlso, in my module-template.tpl.php file, I have created a form, that gives a preview of the image you submitted in it. This is the code I use:\n\n<form id=\"form1\" runat=\"server\">\n<input type='file' id=\"imgInp\" />\n<img id=\"blah\" src=\"#\" alt=\"your image\" />\n</form>\n\n\n\n<script>\nfunction readURL(input) {\n\nif (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#blah').attr('src', e.target.result);\n }\n\n reader.readAsDataURL(input.files[0]);\n}\n}\n\n$(\"#imgInp\").change(function(){\nreadURL(this);\n});\n</script>\n\n\nI want, when you select an image at the testform, then the form1 to trigger and preview the image that you selected at the testform.\nAny ideas?" ]
[ "php", "jquery", "forms", "drupal-7" ]
[ "Make each element of a list is own row (list based on columns values)", "I have this data.frame object:\n\nsubject <- c(\"Nantes\", \"Nantes\", \"Nantes\", \"Brest\", \"Brest\", \"Rennes\")\npage <- c(1, 2, 3, 1, 2, 1)\nrows <- c(2, 3, 4, 6, 2, 3)\ndf <- data.frame (subject,page, rows)\n\n\nHere's the output : \n\nsubject page rows \nNantes 1 2 \nNantes 2 3 \nNantes 3 4 \nBrest 1 6 \nBrest 2 2 \nRennes 1 3\n\n\nNantes's subject : pages 1 page2, page 3.\nEach page has different number of rows. For Nantes, page1 has 2 rows.\n\nwhat I want: duplicate each row based on 1:nrow sequence.\n\nfor Example: I need to dpulicate Nantes page 1 two times \n\nsubject page rows \nNantes 1 1 \nNantes 1 2 \nNantes 2 1 \nNantes 2 2\nNantes 2 3\nNantes 3 1\nNantes 3 2\nNantes 3 3\nNantes 3 3\nNantes 3 4 \nBrest 1 1\nBrest 1 2 \nBrest 1 3 \nBrest 1 4 \nBrest 1 5 \nBrest 1 6 \nRennes 1 1\nRennes 1 2\nRennes 1 3\n\n\nBased on dplyr duplicate each line by a sequence I can use unnest function but not able to solve my problem." ]
[ "r", "dataframe", "dplyr", "tidyr" ]
[ "Clone Git using using username and password?", "I have a batch file that will open a application git-cmd. When trying to clone a git repository, i'm getting prompt to enter password on the git-cmd. I want to do it all from the batch file. Is there a command from the batch file that will enter the password automatically to the gmd-cmd and not the windows cmd?\n\nHere's my git connection on git-cmd: git clone [email protected]/file.git" ]
[ "c#", "git", "command-line", "command" ]
[ "Scaling a UIView from a point other than the center, looking for alternatives to anchorPoint", "I've been using CGAffineTransformMakeScale to scale a UIView. This scales it by it's default anchorPoint, which is (.5, .5) -- the center. I'd like to scale it so that it stretches towards the left, as if it were zooming towards the left. I can accomplish this by setting the anchorPoint to the right center. However, this causes problems with setting the frame, etc. Is there a better way to apply a scale transform like I want. I was thinking I could do it with a custom transform matrix, but I am no good with matrix math." ]
[ "ios", "matrix", "transform", "calayer", "scale" ]
[ "Treat singular and plural of a word as one", "I am creating a web based word frequency counter using JavaScript. Is there any way so as to treat plural and singular as same.\n\nExample: love and loves are treated as one when showing frequency\n\nAny method using something other than JavaScript is also welcome!" ]
[ "javascript", "word-count" ]
[ "Java replaceAll with regex", "I have this input from the user:\n\n*.*.*.*\n\n\n(* = censor)\nthis string is an input from the user, that's what the user wants to censor. how do I convert it to regex?\nEdit: Let me explain again. user wants to censor anything in * between the dots, so he types in *.*.*.*, and I need to convert it to regex. he could type text*text too\n\nI have tried doing:\n\nString strLine = \"93.38.31.43 and 39.53.19.33 and lala.lala.lala.lala\";\nString input = \"*.*.*.*\";\nString replaceWord = \"[censor]\";\ninput = input.replaceAll(\"\\\\*\",\"\\\\\\\\\\\\w+\");\nstrLine = strLine.replaceAll(\"(?=\\\\s+)\\\\S*)\" + input + \"(?=\\\\s+)\\\\S*\",replaceWord);\n\n\nI tried replacing the * with \\\\w+ to get this output:\n\n\n the ip's are [censor] and [censor] and [censor]\n\n\nbut It does not work, doesn't replace anything.\n\nwhen I'm doing it like that, it works:\n\nstrLine = strLine.replaceAll(\"?<=\\\\s+)\\\\S*\" +\"\\\\w+\\\\.\\\\w+\\\\.\\\\w+\\\\.\\\\w+\"+\"(?\\\\s+)\\\\S*\",replaceWord);\n\n\nwhy doesn't it work? is there a better way doing it?" ]
[ "java", "regex", "replaceall" ]
[ "C++: Template class binary operator overloading - seg fault?", "The following describe the example I have which works:\n\nheader:\n\nconst size_t N = 10;\n// template<size_t N>\nclass SymbolicMonomial {\npublic:\n int powers[N];\n int constant;\n\n SymbolicMonomial() {\n for (int i = 0; i < N; i++) {\n this->powers[i] = 0;\n }\n this->constant = 1;\n }\n\n SymbolicMonomial(int variable): SymbolicMonomial(){\n this->powers[variable] = 1;\n }\n\n static SymbolicMonomial as_monomial(int value){\n auto result = SymbolicMonomial();\n result.constant = value;\n return result;\n }\n\n bool is_constant(){\n for(int i=0;i<N;i++){\n if(this->powers[i] > 0){\n return false;\n }\n }\n return true;\n }\n};\n\n// template<size_t N>\nstd::ostream &operator<<(std::ostream &out, const SymbolicMonomial value){\n out << value.constant << \"(\";\n for(int i=0;i<N-1;i++){\n out << value.powers[i] << \", \";\n }\n out << value.powers[N-1] << \")\";\n}\n\n// template<size_t N>\nSymbolicMonomial operator*(SymbolicMonomial lhs, SymbolicMonomial rhs) {\n SymbolicMonomial result = SymbolicMonomial();\n for (int i = 0; i < N; i++) {\n result.powers[i] = lhs.powers[i] + rhs.powers[i];\n }\n result.constant = lhs.constant * rhs.constant;\n return result;\n}\n\n\nThe main.cpp:\n\nint main(int argc, char *argv[])\n{\nauto t_a = symbolic::SymbolicMonomial(2);\nauto t_b = symbolic::SymbolicMonomial(1);\nauto t_c = t_b*t_a*t_a;\nstd::cout << t_c << std::endl;\nreturn 0;\n}\n\n\nAnd everything is fine. However, I wanted to change the whole thing to have a template argument <N> instead of a constant. Thus this is the templated code:\nheader.h:\n\ntemplate<const size_t N>\nclass SymbolicMonomial {\npublic:\n int powers[N];\n int constant;\n\n SymbolicMonomial() {\n for (int i = 0; i < N; i++) {\n this->powers[i] = 0;\n }\n this->constant = 1;\n }\n\n SymbolicMonomial(int variable): SymbolicMonomial(){\n this->powers[variable] = 1;\n }\n\n static SymbolicMonomial as_monomial(int value){\n auto result = SymbolicMonomial<N>();\n result.constant = value;\n return result;\n }\n\n bool is_constant(){\n for(int i=0;i<N;i++){\n if(this->powers[i] > 0){\n return false;\n }\n }\n return true;\n }\n};\n\ntemplate<const size_t N>\nstd::ostream &operator<<(std::ostream &out, const SymbolicMonomial<N> value){\n out << value.constant << \"(\";\n for(int i=0;i<N-1;i++){\n out << value.powers[i] << \", \";\n }\n out << value.powers[N-1] << \")\";\n}\n\ntemplate<const size_t N>\nSymbolicMonomial<N> operator*(SymbolicMonomial<N> lhs, SymbolicMonomial<N> rhs) {\n SymbolicMonomial<N> result = SymbolicMonomial<N>();\n for (int i = 0; i < N; i++) {\n result.powers[i] = lhs.powers[i] + rhs.powers[i];\n }\n result.constant = lhs.constant * rhs.constant;\n return result;\n}\n\n\nAnd main.cpp:\n\nint main(int argc, char *argv[])\n{\nauto t_a = symbolic::SymbolicMonomial<10>(2);\nauto t_b = symbolic::SymbolicMonomial<10>(1);\nauto t_c = t_b*t_a*t_a;\nstd::cout << t_c << std::endl;\nreturn 0;\n}\n\n\nNow the non template version works as expected, however the templated one fails with code 139 (SEGFAULT). Firstly, I do not understand why the code fails if someone can explain and secondly how to fix it?" ]
[ "c++", "templates", "segmentation-fault", "operator-overloading" ]
[ "JavaScript: why cannot I not call parentFunc.parentFunction() from the callee without the 'this' keyword?", "So I was getting the following error:\n\nTypeError: parentRef.parentFunction() is not a function \n\n\nin my callee. \n\nMy callee looked sort of like this\n\nfunction callee(parentRef){\n function subRoutine(){ \n //stuff\n parentRef.parentFunction(params);\n }\n}\n\n\nAnd the caller looked like this: \n\nfunction caller(){\n refToCallee = new callee(this);\n\n refToCallee.subRoutine();\n\n parentFunction(prms){\n //other stuff\n }\n}\n\n\nThen I realized that I had seen code that changed the caller to have the following line when defining parentFunction\n\nthis.parentFunction = function(){ etc.}\n\n\nWhat is the thiskeyword doing here. Is it a namespacing thing? More specifically why does my first definition without using the this.funcName syntax not work?" ]
[ "javascript" ]
[ "Code Optimization in Ruby On Rails?", "I am developing an iOS event application's backend in ROR. Events has privacy either it is public or private and I have made one method to check for the privacy of the event. Currently I run a query which returns 10k records and it is calling that privacy methods 10k times, which is really a time consuming process. What should I do to optimize the code? \n\nBelow is the scenario:\n\ndef find_events\n events = Event.all # It returns 10k records\n events.each do |event|\n search_for_privacy(event)\n end\nend \n\n\ndef search_for_privacy event \n\n # Pure Logic\nend\n\n\nAny help would be appreciated.\n\nThanks" ]
[ "ruby", "ruby-on-rails-3", "optimization", "logic" ]
[ "How can I customize the comment styles that come with Atom One Dark theme?", "I'm new to Atom and I was wondering if we could customize the comment styles that come with the One Dark Syntax Theme via the style.less (Atom > Stylesheet...) file. I looked up the source code for the theme and in the language.less file I found this:\n\n.comment {\ncolor: @mono-3;\nfont-style: italic;\n\n.markup.link {\ncolor: @mono-3;\n }\n}\n\n\nSpecifically, I would like to change to font-style to normal but I can't seem to find a way, please help. Thanks." ]
[ "atom-editor" ]
[ "How do I get the value of one row from a selected item in a datagrid?", "I have a WPF datagrid and I'm trying to get the value of my first row for the seleted item. I've tried using the following based on previous questions I've found here, but had no success:\n\nvar eventid = dataGridArchiveQueue.SelectedItem;\n\n\nalso tried:\n\nvar eventid = dataGridArchiveQueue.Columns[0].GetValue(dataGridArchiveQueue.SelectedItem);\n\n\nWhat am I not understanding?" ]
[ "c#", "wpf", "wpfdatagrid" ]
[ "MsiPackage with DownloadUrl", "I'm trying to create a Bundle installer on the fly using WixSharp.\nSo far so good, with ExePackage, I'm able to get things working. But when I tried with MsiPackage, things are not working as expected.\nMy requirement is not to embed the payload in the bootstrapper instead set the download url of the package in the ExePackage and MsiPackage element so that when the installer executed on client, the package will automatically gets downloaded.\nWith the ExePackage, I specified the DownloadUrl and RemotePayloads, I'm able to generate the installer.\nAs per the MsiPackage documentation in wix page, I see that MsiPackage element has DownloadUrl and there is no restriction specified.\nBut when I set DownloadUrl only, the wix throws an error saying that error LGHT0103 : The system cannot find the file 'SourceDir\\<name-of-the-package>'.\nSo I have to download the package at first and then when setting as SourceFile, the pacakge installer works. But I don't want to follow this as I wan't the download to happen on the target machine where installer executes.\nHere is my working code that generates the MsiPackage element\n using (var client = new WebClient())\n {\n client.DownloadFile(packageDownloadUrl, packageInfo.Name + ".msi");\n \n return new MsiPackage()\n {\n Name = packageInfo.Name,\n DisplayName = packageInfo.Name,\n Description = packageInfo.Description,\n DownloadUrl = packageDownloadUrl, // I want to use this only\n SourceFile = packageInfo.Name + ".msi", //I don't want to use this\n DisplayInternalUI = true,\n Compressed = true,\n Visible = true\n };\n }\n\nAny help would be appreciated. Thanks." ]
[ "wix", "wixsharp" ]
[ "Output a C++ string including all escape characters", "I have a string like this:\n\nstring s = \"\\t Hello \\n\";\n\n\nWhen I print it then it gives me a tab then Hello then a new line. However, is there anyway I can print it such that I see this in my console:\n\n\\t Hello \\n\n\n\nIn other words, I want the string to disregard the escape characters and treat it as an actual string?" ]
[ "c++", "cout" ]
[ "How to validate size of elements inside a list with javax?", "How can I validate the length of the elements inside a list with javax.validation?\n\n@Size(min = 2, max = 3)\nprivate String value;\n\nprivate List<String> list;" ]
[ "java", "validation" ]
[ "Online Rails Development Environments", "Are there any online rails development environments (similar to what Heroku Gardens was like ) before they shut down? \n\nI'm looking for a fully hosted solution similar to what pythonanywhere provides for pydjango." ]
[ "ruby-on-rails", "ruby", "heroku" ]
[ "Regex to keep characters that are touching (no spaces) a regex match", "I'm using this regex to match version numbers, basically digits and dots touching. Note that these software versions I'm wanting to isolate are not proper semver versions and have a lot of exception and quirks\nif (preg_match('/\\d+(?:\\.\\d+)+/', $version, $matches)) { \n return $matches[0]; //returning the first match \n}\n\nIt works great for keeping the digits and dots, but I want to also keep any character that isn't a dot or digit but touches the version number before or after\nFor example I'd like these versions to be returned whole:\n2021.02.21A\n1.08bh1\nv0.1.2.4\n1.14-2018\n\nAny help would be much appreciated : ) thank you" ]
[ "php", "regex" ]
[ "Which Permissions are not allowed for a java \"Rich Internet Application\" since java 7u45?", "I'm aware that since java 7u45 and 7u51 the restrictions for launching a java application via applet/webstart have been tightened.\n\nHowever, previously if you specified in a jnlp, for example, you would actually get all permissions (imagine that) -- but now, if you specify \"Permissions: all-permissions\" in the manifest of the main jar, you do not get all permissions.\n\nSome that I know you do not get are:\n\njava.net.NetPermission \"specifyStreamHandler\"\njava.util.PropertyPermission \"*\" \"read,write\"\njava.lang.RuntimePermission \"accessDeclaredMembers\"\n\n\nI keep running into these and I'd like to have a master list of what you can and cannot do so it's not just by trial and error. Does anyone know of such a list?" ]
[ "java", "security", "java-web-start", "jnlp" ]
[ "Mongodb C# driver sort by nested attribute", "How do i use the C# driver to sort by a nested object (from a mapreduce query)\n\n{\"_id\": { \"date\" : \"02/01/2001\"} }\"\n\nSortBy.Descending(\"_id\") 'Sorts by \"_id\" descending\nSortBy.Descending(\"???\") 'Sorts by \"date\" descending\n\n\nBut Im not sure what to put in value to make this happen" ]
[ "c#", "mongodb", "mapreduce", "mongodb-.net-driver" ]
[ "Can I run scriptcs with useLegacyV2RuntimeActivationPolicy?", "I have a DLL (Microsoft.SqlServer.BatchParser) which I need to reference in a scriptcs file. \n\nThe following DLL can only be referenced if useLegacyV2RuntimeActivationPolicy is included in the app.config file. \n\nFor example, this console application: \n\nnamespace ConsoleApplication\n{\n class Program\n {\n static void Main(string[] args)\n {\n var batchParser = new ManagedBatchParser.Parser();\n }\n }\n}\n\n\nwill only compile if I include useLegacyV2RuntimeActivationPolicy in the app.config like so: \n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <startup useLegacyV2RuntimeActivationPolicy=\"true\"> \n <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\"/></startup>\n</configuration>\n\n\nBut doing the same in a CSX file: \n\n#r \"Microsoft.Sqlserver.BatchParser\"\n\nvar batchParser = new ManagedBatchParser.Parser(); \n\n\nwill fail because I don't know how to specify this attribute. I get the infamous error as soon as I try to run the scriptcs file: \n\n\n Additional information: Mixed mode assembly is built against version\n 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime\n without additional configuration information. \n\n\nSo my main question is, how can I tell scriptcs to start compiling the CSX file with the useLegacyV2RuntimeActivationPolicy attribute ?" ]
[ ".net-4.0", "scriptcs" ]
[ "How to check a table range and paste selected values to a new worksheet in VBA?", "I’m trying to check all the rows from 63 to 69 in table 1, if column D value is “ATTIVO” AND column “F” value >= 130,\ni'd like to paste the G column value into another WorkSheet starting from A3 cell.\nIf the condition is False I’d like to to pass to next row and do the same check for all rows, coping and pasting if the condition is True.\n\nn = 63; LastRow3 = 69.\n\nTable 1:\n\n\n\nTable 2:\n\n\n\nSub Macroarea1()\n Dim ws As Worksheet\n Dim LastRow As Long\n Dim LastRow1 As Long, LastRow3 As Long\n Dim i, n, x As Integer\n Set ws = ActiveWorkbook.Sheets(\"Report KIT\")\n\n n = Sheets(\"Migrazioni\").Range(\"N\" & 7).Value\n LastRow3 = Sheets(\"Report KIT\").Range(\"G\" & Sheets(\"Report KIT\").Rows.Count).End(xlUp).Row\n\n For x = n To LastRow3\n On Error Resume Next\n If Sheets(\"Report KIT\").Range(\"D\" & x) = \"ATTIVO\" And Cells(x, 6) >= 130 Then _\n Sheets(\"Report KIT\").Range(\"G\" & x).Copy\n Sheets(\"KIT\").Range(\"A3\").PasteSpecial xlPasteValues\n 'Else\n x = x + 1\n 'End If\n Next x\n\nEnd Sub\n\n\nFor example for 1st table input I’d like to have a second table as an output.\n\nUnfortunately a VBA gives me an error (that Else condition is not ok). \nI guess I’ve built all the For cycle in a wrong way.\nCan anyone help with it, please?" ]
[ "vba", "excel" ]
[ "Neglect a pattern using Regex", "I need help to neglect a pattern while searching substring using regex. \nFor example, in below string\n\nHello *testing [*_*] message* text or\n\nHello *testing [_*_*] message* text * additional* message or \n\nHello testing [*_*_] message* text * additional* message* or\n\nHello testing [_*_*_] message* text * additional* message*\n\n\nI need to find out all * to replace with html bold tag, except those which comes within square brackets '[]'. \nBut when I run this regex [*]((?s).*?)[*], It also include * within [], and replace those as well. How can I ignore [* and *] combination while this search.\n\nAny help will be appreciated. \n\nEDIT:\n\nBasically I wanted to ignore matching for given character (eg *) if it is within square brackets [ and ]." ]
[ "swift", "regex", "swift5" ]
[ "Printing query parameters in access log for light-4j application?", "My light-4j application is using AuditHandler to print access logs. The default format printed is:\n\n{\"timestamp\":1580470146236,\"endpoint\":\"/mmt/register@post\",\"X-Correlation-Id\":\"123456\",\"statusCode\":200,\"responseTime\":70}\n\nBut, the client is hitting the API with query parameters: /mmt/register?id=2\n\nHow do I customize the access log so that it prints the query parameter also in the access log? {\"timestamp\":1580470146236,\"endpoint\":\"/mmt/register@post?id=2\",\"X-Correlation-Id\":\"123456\",\"statusCode\":200,\"responseTime\":70}\n\nMy current logback setting is:\n\n<appender name=\"access-log\" class=\"ch.qos.logback.core.rolling.RollingFileAppender\">\n <File>/opt/logs/Register/access.json</File>\n <append>true</append>\n <rollingPolicy class=\"ch.qos.logback.core.rolling.TimeBasedRollingPolicy\">\n <fileNamePattern>/opt/logs/Register/access.%d{yyyy-MM-dd}.%i.json\n </fileNamePattern>\n <timeBasedFileNamingAndTriggeringPolicy\n class=\"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP\">\n <!-- or whenever the file size reaches 1GB -->\n <maxFileSize>1GB</maxFileSize>\n </timeBasedFileNamingAndTriggeringPolicy>\n <MaxHistory>50</MaxHistory>\n </rollingPolicy>\n <encoder>\n <Pattern>%m%n</Pattern>\n </encoder>\n </appender>" ]
[ "light-4j" ]
[ "How to run tests in android", "I am using Robotium Solo to test the app\n\nsince I'm fairly new to app test, and Robotium\n\nI have 3 methods in my test case - however, I want to run those tests, under certain conditions\notherwise they fail\n\nI can do that if i write the entire test in one method, but i don't want to run it in one method, I\nwant to separate it into 3 methods\n\nhow do I make sure that the tests run only if I called the test methods, and not one after the other" ]
[ "android", "unit-testing" ]
[ "(C++ Error: pointer being freed was not allocated) for linked lists", "With this main:\n\nvoid print_first(Queue q);\n\nint main()\n{\n Queue q1;\n Queue q2(4);\n q2.push(5);\n q2.push(3);\n// q2.print_list();\n for (int i = 0; i < 3; i++)\n {\n print_first(q2);\n }\n return 0;\n}\n\nvoid print_first(Queue q)\n{\n if (!q.isEmpty())\n {\n cout << q.pop() << endl;\n }\n else\n {\n cout << \"Nothing in queue\" << endl;\n }\n}\n\n\nand these function definitions in a class Queue which has a linked lists with \"head\" and \"tail\" as pointers to the first and last Nodes in a linked list, each node which contains another struct \"data\" which stores an redefined type ElementType:\n\nbool Queue::push(ElementType newElement)\n{\n tail->next = new Node;\n if (tail->next == NULL)\n {\n return false;\n }\n tail->next->data.value = newElement;\n tail->next->next = NULL;\n tail = tail->next;\n return true;\n}\n\nElementType Queue::pop()\n{\n Node *newNode;\n ElementType returnData;\n returnData = head->data.value;\n newNode = head;\n head = head->next;\n delete newNode;\n return returnData;\n}\n\nbool Queue::isEmpty()\n{\n if(head == NULL)\n {\n return true;\n }\n return false;\n}\n\n\nwhy am I getting this error?\n4\nAssembly Line Simulator(9701) malloc: * error for object 0x1001000e0: pointer being freed was not allocated\n* set a breakpoint in malloc_error_break to debug" ]
[ "c++", "pointers", "linked-list", "queue", "copy-constructor" ]
[ "Initialize a largest product counter as an \"infinitely\" small number", "I'm implementing a simple algorithm in java that takes in an array of integers, and finds and returns the largest product of adjacent integers in the array. To do this I first initialized a variable called largestProduct which I use to keep track of the current biggest (best) product found. I want to make sure that the initial value of this product is immediately replaced by the first product I find, so I set the initial value to a very small number (-1000000). This solution works since each number in the array is restricted to the domain -1,000 - 1,000 so the smallest the product could be is 1,000,00. However, this solution seems nonideal, and would need to be changed if the domain changed. \n\nTo try and guarantee that my initial value be replaced I tried setting largestProduct's initial value to null, and also tried not giving it any intial value, but these both gave me a compilation error. So my question is, is there a way to set a variable's (of type int) initial value to an \"infinitely\" small value, or what would be the best way to handle this situation otherwise?\n\nHere is my code\n\nint adjacentElementsProduct(int[] inputArray) {\nint largestProduct = -1000000; \nint n = 1;\nwhile(n < inputArray.length){\n int tempProduct = inputArray[n-1]*inputArray[n];\n if(tempProduct > largestProduct){\n largestProduct = tempProduct;\n }\n n++;\n}\nreturn largestProduct;\n}" ]
[ "java", "initialization", "int" ]
[ "Debugging puppet: how do I show the available modules in a manifest?", "My context:\n\n\nI'm including a module which in turn includes more modules\nwhen I run a \"puppet apply\" the first included module runs fine...\nuntil it gets to the \"include\" statement for the other module\nthe mechanism I'm using to include modules is nonstandard and is part of the infrastructure I'm working in. Usually I could just check a directory and see if the module is there... but since there is \"magic\" involved in including modules, I have to debug during the apply.\n\n\n\n err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class missingmoduleclassname\n\n\nMy question:\n\n\nI'd like to print out the available modules to stdout during the apply. Is there a way to do that? \nI'm already using code like: notify{\"The list of modules available is: ${yourvar}\": }\n\n\nIs there a variable I can print out? What is it called?" ]
[ "puppet" ]
[ "Polymorphism Conundrum", "Now, I appreciate this is actually an opinion based question, so I expect it to be closed, but hopefully not before a few answers appear. The subject matter I'm dealing with is new to me, but also it is massive. I could spend a year here and still only be chipping the tip of the iceberg, hence why I've got myself a little stuck.\n\nSo, I have the situation where I have three real world objects, let's call them HelloWorld, Foo and Bar. Bar has all the same properties as Foo EXCEPT for one. This particular property is not valid for a Bar. Instead, Bar has an additional property which is unique to that type. So, in my head it makes sense for Bar to inherit Foo. Now a HelloWorld can have a Foo OR a Bar depending on the circumstances and operations will proceed differently depending on which one it holds. \n\nWhat I want to know is - does the example below hold water, or does it have a code smell like week old haddock left in the sun?! If it does smell, what would be the 'right' way to go? This is all new code - I'm not refactoring, so I have the ability to do it right the first time.\n\npublic class Foo\n{\n // This property is valid for Foo AND Bar\n public int Property1 { get; set;}\n\n // This property is valid for Foo ONLY.\n public virtual string Property2 { get; set;}\n}\n\npublic class Bar\n{\n // This cannot exist in Bar - so always return null, don't allow it to be set.\n public new string Property2 => null;\n\n // Unique to Bar.\n public List<int> Property3 { get; set;}\n}\n\npublic class HelloWorld\n{\n public Foo FooProperty { get; private set;}\n\n private HelloWorld()\n {\n }\n\n // Create a new object with the property as a Foo.\n public static HelloWorldWithFoo()\n {\n return new HelloWorld()\n {\n FooProperty = new Foo()\n };\n }\n\n // Create a new object with the property as a Bar.\n public static HelloWorldWithBar()\n {\n return new HelloWorld()\n {\n FooProperty = new Bar()\n };\n }\n}\n\n\nEDIT\n\nOk - so my 'generic' example maybe lacked the context needed - apologies. Having taken onboard the comments etc, I've applied it like so - and used the real world types for clarity.\n\npublic class Slot\n{\n public CardBase CardDetails { get; set; }\n\n private Slot()\n {\n }\n\n public static Slot CreateSlotWithCard()\n {\n return new Slot()\n {\n CardDetails = new Card()\n };\n }\n\n\n public static Slot CreateSlotWithCarrierCard()\n {\n return new Slot()\n {\n CardDetails = new CarrierCard()\n };\n }\n}\n\npublic class CardBase\n{\n public string Name { get; set; }\n public DateTime InstallationDate { get; set; }\n public HardwareType Type { get; set; }\n}\n\npublic class Card : CardBase\n{\n public List<int> Ports { get; set; }\n}\n\npublic class CarrierCard : CardBase\n{\n public List<Card> SubCards { get; set; }\n}\n\n\nDoes this look a little more along the right lines??" ]
[ "c#", "polymorphism" ]
[ "select from table where two parameters satisfy in mysql", "I am totally clueless how to get around to get the following kinda result from the same table in MySQL.\n\nRequired Result:\n\n\n\nThe raw data as shown in below image.\n\n\n\nMc_id and op_id can be different. For example, if mc_id is 4 and op_id is 10 then it has to loop through each vouid and extract done_on_date, again it has to loop through for the same mc_id 4 and op_id 10 and extract done_on_date where done_on_date is after first extracted done_on_date. Here second extracted done_on_date, we refer to, as next_done_on_date, just to distinguish it differently. Accordingly continue till end of the table. I hope I am clear enough now.\n\nThe idea is basically to see when was particular operation_id carried out for the said machine having mc_id. First time operation done is refered to as done_on_date and when the same operation carried out for the same machine next time, we refer to as next_done_on_date but actually inside the database table it is done_on_date.\nThough let me know if anything yet to be clarified" ]
[ "mysql" ]
[ "Filling a model with a list from Textarea", "Now I do not really understand you. Sorry, I just started this whole study not so long ago. I’ll try to explain again what I can’t do.\nI have an empty object and an object with data with the same structure.\n\ndata: [\n {id: 1, title: \"title1\"},\n {id: 2, title: \"title1\"},\n {id: 3, title: \"title3\"},\n {id: 4, title: \"title4\"},\n {id: 5, title: \"title3\"}\n ],\n\nitem: [\n {\n itemId: \"\",\n itemname: \"\"\n }\n ]\n\n\nAnd I have select and textarear. Select have data, textarear empty. Textarear displays title.\n\nI want to press a button. Selected item from select. copied to textarear (title only), and also itemId - this selected element id: 5 and itemname - the same title: \"title3\" element, was recorded in item [].\n\nhttps://codesandbox.io/s/priceless-hermann-g9flw" ]
[ "javascript", "reactjs" ]
[ "Jquery 100% scroll to first section", "I'm trying to scroll 100% of the page to the first section and than have the normal scroll through others sections and vice versa.\n\nI've tried different approach with no results except a loop.. check this fiddle.\n\nThis is the structure of the page and every elements has 100% height:\n\n<header>Header content...</header>\n<section>Section content...</section>\n<section>Section content...</section>\n<section>Section content...</section>\n\n\nJavascript\n\n$(function () {\n var lastScrollTop = $(window).scrollTop(),\n delta = 5,\n eleH = $('header').outerHeight();\n $(window).scroll(function () {\n var nowScrollTop = $(this).scrollTop();\n if (Math.abs(lastScrollTop - nowScrollTop) >= delta) {\n if (nowScrollTop <= eleH && nowScrollTop > lastScrollTop) {\n $('html,body').animate({\n scrollTop: $('body section:first-of-type').offset().top\n }, 600);\n console.log('Scroll down');\n } else if (nowScrollTop <= eleH && nowScrollTop < lastScrollTop) {\n $('html,body').animate({\n scrollTop: 0\n }, 600);\n console.log('Scroll up');\n }\n lastScrollTop = nowScrollTop;\n }\n });\n});\n\n\nCSS\n\nhtml, body {\n height:100%\n}\nheader, section {\n display:block;\n width:100%;\n height:100%;\n}\nheader {\n background-color:gray;\n}\n\n\nAs plug-in I've already used Alton (demo link in the fiddle) but it doesn't work quite well if stressed or with the inertia scroll of osX." ]
[ "javascript", "jquery", "css", "debugging", "scroll" ]
[ "Go to a web page, find a specific tag, save the value between that tag to a text document", "I've found a number of posts that are really close to this, but none that get me close enough. \n\nI need to set up an automation that will:\n\n-go to a webpage (http://webpageinquestion.com/things/3445)\n-find a specific HTML tag on that page (<small>sometext</small>)\n-take the value that is wrapped between that tag (\"sometext\")\n-save that value to a text document as a list, prepended by the name of the page (3445_sometext)\n\nBy the end, I need a a list that looks like:\n\n\n 3445_sometext\n 3446_someothertext\n 3447_yetmoretext\n 3845_textext\n 4564_textThetext\n 9837_texty\n\n\nI've explored different methods that might use Wget and jquery GET requests. But clearly, I don't have a solid understanding of either of those tools in order to accomplish this. I'm sure CURL might be able to do something like this, but I've never used it myself. \n\nAny ideas? This has been such a puzzle..." ]
[ "javascript", "jquery", "html", "curl", "wget" ]
[ "image problem with dreamweaver", "i'm trying to create a newsletter in a single html file, which will be loaded into outlook express and sent out as a mail.\n\ni have like a few images embedded onto the html file but 2 of them cant be loaded for preview in design mode. there is no problem for the rest of the images. those images that cant be loaded has the grey color icon. \n\nthe directory for the images are the same. i have copied and pasted the absolute directory for the images that cant load and it doesnt work.\nthe images loads fine when executed from the html file that was uploaded to the webserver.\n\nedit:\nit only loads fine in firefox, and not ie!\n\ni need to get the newsletter out tomorrow, any assistance here?\n\nthanks in advance." ]
[ "html", "dreamweaver" ]
[ "Can this JavasScript regular expression \\.(md|njk|md\\.njk)$ be simplified further?", "I need to match these strings:\n\nfoo.md -> capturing group should be: (.md)\nfoo.njk -> capturing group should be: (.njk)\nfoo.md.njk -> capturing group should be: (.md.njk)\n\n\n... capturing all after the first dot (EDIT: but still, extension should be md or njk or md.njk).\n\nThis is what I've done: \\.(md|njk|md\\.njk)$ (test) in the first place, and it works.\n\nI've tried to simplify it, so I ended up with another one: \\.(md|(md\\.)?njk)$ (test) that it's a bit better, but still repeats the words \"md\".\n\nCan't be simplified further or not?" ]
[ "javascript", "regex" ]
[ "setTimeout to animate table images", "I have some code that changes the images in a table. Works fine until I try to put a timer in to slow it up and make it look like they sort of roll out instead of all just 'snap' into place. Any help greatly appreciated. Code below:\n\nfunction showImage(){\n for(i=0; i<SIZE; i++) {\n var showImage = document.getElementById(i);\n showImage.src = i+'.png';\n }\n setTimeout(showImage(),700);\n}" ]
[ "javascript", "settimeout" ]
[ "Find table elements to fill forms selenium python", "My code so far is: \n\nfrom selenium import webdriver\ndriver = webdriver.Chrome()\ndriver.get('http://moodle.tau.ac.il/')\ndriver.find_element_by_xpath(\"id('page-content')//form[@id='login']// \\\n input[@type='submit']\").click()\n\n\nNow I'm trying to fill up the login form and I succeeded to find the division\nthat follows id= content, easy to see in the image:\n\n\n\nThe following code line I used:\n\nelem = driver.find_element_by_xpath(\"id('content'))\n\n\nbut it doesn't recognize anything in it and I cant get any further, what should I do to locate the input element?" ]
[ "python", "selenium", "iframe", "html-table", "locate" ]
[ "Aurelia iterate over map where keys are strings", "I'm having trouble getting Aurelia to iterate over a map where the keys are strings (UUIDs).\n\nHere is an example of the data I'm getting from an API running somewhere else:\n\nmy_data = {\n \"5EI22GER7NE2XLDCPXPT5I2ABE\": {\n \"my_property\": \"a value\"\n },\n \"XWBFODLN6FHGXN3TWF22RBDA7A\": {\n \"my_property\": \"another value\"\n }\n}\n\n\nAnd I'm trying to use something like this:\n\n<template>\n<div class=\"my_class\">\n <ul class=\"list-group\">\n <li repeat.for=\"[key, value] of my_data\" class=\"list-group-item\">\n <span>${key} - ${value.my_property}</span>\n </li>\n </ul>\n</div>\n</template>\n\n\nBut Aurelia is telling me that Value for 'my_data' is non-repeatable.\n\nI've found various answer by googling, but they have not been clearly explained or incomplete. Either I'm googling wrong or a good SO question and answer is needed." ]
[ "aurelia" ]
[ "BREW: Why does anyone care for it anymore?", "I am aware of the variety of possible platforms for mobile development. However, I pretty much wonder what you can tell me about Qualcomm's BREW? Why does anyone care for it anymore? I mean, with J2ME's portability (the interest in J2ME must surely be dying in the middle-high class devices), Android Market and Appstore, how could anyone still make profit with BREW apps? The fact is that I could not find any recent article about BREW's future.\n\nI know I sound ignorant and that is the very reason why I ask.\n\nThanks!" ]
[ "platform", "mobile-phones", "brew-framework", "brewmp" ]
[ "view in a real-time database in the firebase console", "I have an existing project in firebase and the data are displayed in the run of the site but I want to view in a real-time database in the firebase console do not see the data" ]
[ "firebase-realtime-database", "firebase-console" ]
[ "Generate java classes for http service", "We are trying to connect to:\n\nhttp://resellertest.enom.com/interface.asp?command=nameofcommand&uid=yourloginid&pw=yourpassword&paramname=paramvalue&nextparamname=nextparamvalue\n\n\nWhere we need to append parameters to http url and the response from the site is xml.\n\nSample xml response:\n\n<?xml version=\"1.0\" ?>\n<interface-response>\n<Contact>\n<RegistrantPartyID>{FFD61956-8D43-45FB-BC38-E0EE23331503}</RegistrantPartyID>\n</Contact>\n<Command>ADDCONTACT</Command>\n<Language>en</Language>\n<IsLockable>True</IsLockable>\n<IsRealTimeTLD>True</IsRealTimeTLD>\n<TimeDifference>+03.00</TimeDifference>\n<ExecTime>0.3164063</ExecTime>\n<Done>true</Done>\n<debug>\n<![CDATA [ ] ]>\n</debug>\n</interface-response>\n\n\nWe are trying to connect to these services from java.\nIs there is a way that we can auto generate java classes (corresponding to xml) as we do in traditional webservices?\n\nThank you in advance." ]
[ "java", "web-services", "httpwebrequest" ]
[ "Get texture target by texture id", "glBindTextures is a nice function, not only because it binds multiple textures in one call, but also because it knows to bind each texture to \"the target [...] that was specified when the object was created\". This way I can specify the target only at texture creation and then forget about it, which helps in generic code.\n\nUnfortunately, I must know the target when calling functions like glGetTexParamater. Is there a way to retrieve the texture target from the texture id? Widely supported extensions are also ok." ]
[ "opengl" ]
[ "Put JSON Data on JQuery DataTables", "I want to ask how to put JSON Data on JQuery DataTables? I cannot load my JSON data when I want to load it. I am using CodeIgniter.\nHere is my code on my view\n\n<table id=\"kategoriTable\" class=\"display\" width=\"100%\" cellspacing=\"0\">\n <thead>\n <tr>\n <th>Kode Kategori</th>\n <th>Nama</th>\n <th>Definisi</th>\n <th>Unsur Abstrak</th>\n <th>Alias</th>\n <th>Sumber Definisi</th>\n <th>Tanggal</th>\n <th>Tipe Tanggal</th>\n <th>Edisi</th>\n <th>Role</th>\n <th>Other Citation Detail</th>\n <th>Katalog</th>\n <th>Organisasi</th>\n </tr>\n </thead>\n </table>\n\n\nI have tried this javascript:\n\n<script type=\"text/javascript\">\n $('#kategoriTable').dataTable({\n ajax: {\n url : \"http://localhost:90/kugi_deployment/api/json/reply/KategoriRetrieve\",\n dataSrc : function(json) {\n console.log(json);\n return json.Kategoris\n }\n },\n //data : testData.Kategoris,\n columns: [\n { data: \"KodeKategori\"},\n { data: \"Nama\"},\n { data: \"Definisi\"},\n { data: \"UnsurAbstrak\"},\n { data: \"Alias\"},\n { data: \"SumberDefinisi\"},\n { data: \"Tanggal\"},\n { data: \"TipeTanggal\"},\n { data: \"Edisi\"},\n { data: \"Role\"},\n { data: \"OtherCitationDetail\"},\n { data: \"NamaKatalog\"},\n { data: \"NamaOrganisasi\"}\n ]\n });\n </script>\n\n\nThis is my JSON Data Structure\n\n{\"State\":0,\"Message\":\"\",\"Kategoris\":[{\"KodeKategori\":\"A\",\"Nama\":\"REFERENSI SPASIAL\",\"Definisi\":\"\",\"UnsurAbstrak\":true,\"Alias\":\"\",\"SumberDefinisi\":\"\",\"Tanggal\":\"\\/Date(-62135596800000-0000)\\/\",\"TipeTanggal\":\"\",\"Edisi\":\"\",\"Role\":\"\",\"OtherCitationDetail\":\"\",\"NamaKatalog\":\"Katalog Unsur Geografis\",\"NamaOrganisasi\":\"Badan Informasi Geospasial\"}, ....and so on, ]}\n\n\nLast, this is the controller:\n\npublic function index()\n{\n $get_url_service = $this->url_service->GetUrl('KategoriRetrieve');\n $get_json = file_get_contents($get_url_service);\n $data['get_data'] = new RecursiveIteratorIterator(new RecursiveArrayIterator(json_decode($get_json, TRUE)), RecursiveIteratorIterator::SELF_FIRST);\n $this->load->view('test', $data);\n}\n\n\nIt shows error, cannot parse the data. Here is the screenshot I take:\n\n\nWhen I try to load from that url it returns 'Loading' forever. Am I do something wrong with it? I really confuse to fix this. Hope anyone can help me to fix this. Thanks" ]
[ "php", "json", "datatables" ]
[ "libsuperuser get command output in real time", "I've never used libsuperuser but only roottools. Now I want to switch to libsuperuser but I don't find a way to call a command as root and read its output without wait for comand finish.\nWith roottools it was easy because it has a method that's called each time a new line is written to stdout by the process.\nBut with libsuperuser I have only found Shell.SU.run() that returns the output but only when the process is finished. How can I read the output lines in realtime with libsuperuser?" ]
[ "java", "android", "root" ]
[ "how to add new line on to textarea on copy to clipboard?", "This is my copy to clipboard code, I am using textarea but when i am pasting what i copied on code, everything is just on one line:\n\nconst CopyButton = ({ text }: { text: string }) => {\n const init_val = 'Copy';\n const [btn_val, set_value] = useState(init_val);\n const copyToClipboard = () => {\n const textField = document.createElement('textarea');\n textField.innerText = text;\n document.body.appendChild(textField);\n textField.select();\n document.execCommand('copy');\n textField.remove();\n set_value('Copied!');\n setTimeout(() => {\n set_value(init_val);\n }, 1500);\n };\n\n return (\n <button className='copy-to-clipboard' onClick={copyToClipboard}>\n {btn_val}\n </button>\n );\n};\n\n\nI am thinking of solving this with regexp but don't know how and can't seem to find a solution around." ]
[ "javascript", "reactjs" ]
[ "How to apply a function to each column in pandas dataframe if a specific column meets a specific condition", "I want to apply a function to each column in the pandas dataframe if a specific column in that dataframe meets a condition. I have a dataframe with 6 columns and 5 rows. The 6th column is the sum of the first 5 columns and if the sum is greater than 1 for a specific row, I want to multiply all the columns in that row with a number (scalar) to ensure that the sum of that row is lower than 1. Below is a simplified dataframe (my original dataframe has 20 columns and 4 million rows).\n A B C D E Sum\n1 0.004 0.04 0.08 0.6 0.013 0.737\n2 0.12 0.25 0.08 0.6 0.014 1.064\n3 0.05 0.02 0.08 0.3 0.019 0.469\n4 0.08 0.003 0.05 0.1 0.011 0.244\n5 0.56 0.04 0.08 0.7 0.016 1.396\n\nI want to multiply each column on the 2nd and 5th rows by a number to be able to make the sum of those columns less than 1.\nI tried to apply the following function to the dataframe but apparently, this code applies that function to each value in the dataframe and I also could not figure out how to select the rows whose sum values are greater than 1.\ndef func(value):\n if value > 1:\n return(value * 0.71)\n else:\n return(value)" ]
[ "python", "pandas", "function", "dataframe", "apply" ]
[ "Post a video with multipart in java", "I am trying to upload a video with java to an api of Microsoft(Video Indexer API) using a request Http Post and it's work with Postman \n\nBut when i do this in java it's not work \n\nThis is my code :\n\npublic static void main(String[] args)\n{\n CloseableHttpClient httpclient = HttpClients.createDefault();\n\n try\n {\n\n URIBuilder builder = new URIBuilder(\"https://videobreakdown.azure-api.net/Breakdowns/Api/Partner/Breakdowns?name=film2&privacy=Public\");\n\n URI uri = builder.build();\n\n\n HttpPost httpPost = new HttpPost(uri);\n\n httpPost.setHeader(\"Content-Type\", \"multipart/form-data\");\n httpPost.setHeader(\"Ocp-Apim-Subscription-Key\", \"19b9d647b7e649b38ec9dbb472b6d668\");\n\n MultipartEntityBuilder multipart = MultipartEntityBuilder.create();\n\n File f = new File(\"src/main/resources/film2.mov\");\n multipart.addBinaryBody(\"film2\",new FileInputStream(f));\n\n HttpEntity entityMultipart = multipart.build();\n\n httpPost.setEntity(entityMultipart);\n\n CloseableHttpResponse response = httpclient.execute(httpPost);\n HttpEntity entity = response.getEntity();\n\n if (entity != null)\n {\n System.out.println(EntityUtils.toString(entity));\n }\n }\n\n\nAnd this is the error:\n\n{\"ErrorType\":\"INVALID_INPUT\",\"Message\":\"Content is not multipart.\"}\n\n\nAnd for Postman this is a screen for all the parameter that i have to put on the Http Request\n\nScreen for all the params on postman\n\nAnd for the header:\n\nheader" ]
[ "java", "http", "post" ]
[ "Delphi XE8 FireMonkey TMemo Transparent?", "Is there a way to make a TMemo's background transparent? I tried setting Opacity to from 1 down to 0 and the whole component (including text) gradually fades then completely disappears at 0. At 0.1 the background box is still visible. I am currently using XE8 for iOS 8.3." ]
[ "delphi", "firemonkey", "delphi-xe8" ]
[ "Why isn't my Mutex class being transpiled by Webpack?", "I'm having an issue with upgrading from Webpack 4 to Webpack 5, where Babel no longer seems to transpile code from one of my dependencies (async-mutex). I managed to strip it down to a minimal setup that demonstrates the problem:\npackage.json\n{\n "scripts": {\n "build": "webpack --mode=production"\n },\n "devDependencies": {\n "@babel/core": "~7.12.0",\n "@babel/preset-env": "~7.12.0",\n "async-mutex": "~0.2.0",\n "babel-loader": "~8.2.0",\n "webpack": "~5.10.0",\n "webpack-cli": "~4.2.0"\n },\n "babel": {\n "presets": [\n "@babel/preset-env"\n ]\n },\n "browserslist": [\n "Explorer >= 11"\n ]\n}\n\nwebpack.config.js\nmodule.exports = {\n entry: {\n bundle: './index.js',\n },\n module: {\n rules: [\n {\n test: /\\.m?js$/,\n use: 'babel-loader',\n },\n ],\n },\n};\n\nindex.js\nimport {Mutex} from 'async-mutex';\nconsole.log(Mutex);\n\nclass MyClass {}\nconsole.log(MyClass);\n\nAs per my browserslist, I need to support IE 11. After building this and inspecting the resulting dist/bundle.js I can see that the class MyClass was transpiled into a function, but the class Mutex was not transpiled, which obviously causes IE 11 to fail with a syntax error. It's as if Babel is using different settings to process the async-mutex package than it uses to process my index.js.\nI found another question with an answer that suggests adding target: ['web', 'es5'], but that doesn't help and it also seems unnecessary, since Webpack is supposed to honor browserslist.\nWith Webpack 4 I did not have this issue, but I'm not sure if the problem is with my setup, with Webpack, with Babel or even with async-mutex.\nNote aside: I'm aware that this minimal setup is lacking a Promise polyfill, but I omit it here because it seems irrelevant to the issue." ]
[ "javascript", "webpack", "babeljs" ]
[ "How do I get all records from custom table via wordpress rest api?", "I have a custom table created in wordpress database called custom_users. I want to get all records inside custom_users table through the API that I created.\n\nfunctions.php\n\nfunction get_wp_custom_users() {\n global $wpdb;\n $row = $wpdb->get_row(\"SELECT * FROM wp_custom_users\");\n return $row;\n}\n\nadd_action( 'rest_api_init', function () {\n register_rest_route( 'wpcustomusers/v1', '/all/', array(\n methods' => 'GET',\n 'callback' => 'get_wp_custom_users'\n ) );\n} );\n\n\nThe endpoint can be accessed like this: http://localhost/mywebsite/wp-json/wpcustomusers/v1/all\n\nWhen I access the endpoint via POSTMAN, I am only seeing one record.\n\nDo you know how can I improve my get_wp_custom_users() method to retrieve all records? Thanks" ]
[ "javascript", "php", "html", "wordpress", "wordpress-rest-api" ]
[ "Edit a page with content editable and save it using php", "I am trying to wrap my head around a project that I would like to work on to attempt to get more familiar with programming in PHP.\n\nI want to create a website that's easy to update without a full blown CMS. I was thinking of using the HTML5 contenteditable widget.\n\nWhat I envision is the following:\n\n\nUser logs in and a session is started that will allow php to echo the content editable tag so that it's only visible when a user is authenticated.\nOnce logged in, the user can make changes to the file and click a save button and the file will be updated. THIS IS WHERE I NEED HELP\n\n\nIs it possible to update the php file you are currently on? If it is, does it involve ajax or just pure php? How do I pass the content within the contenteditable widget to be saved on the server? I don't want to use FTP so I'm assuming I have to learn how to do this with AJAX? I hate to ask but if you have example code that would be awesome!\n\nLastly, is this a super major security risk?\n\nThanks in advance!\n\nAtlante" ]
[ "javascript", "php", "jquery", "ajax", "html" ]
[ "SharePoint check in SPListItem", "In sharepoint how can you check in an SPListItem?" ]
[ "c#", "sharepoint", "moss", "wss" ]
[ "How do I create an ECDSA certificate with the OpenSSL command-line", "I'm building a server app in C++ that needs to accept a certificate containing an ECDSA public key. It must validate the certificate and, upon verification, use the public key contained in the certificate to authenticate a message sent along with the certificate. \n\nI have all this working using ECDSA keypairs generated on the fly - i.e. my code is working nicely - but now I need to do the certificate piece. \n\nAnd I figured I could use OpenSSL's command-line to create the certificate which is installed on the client (along with the ECDSA private key in a separate file).\n\nCan anyone help?" ]
[ "openssl", "certificate" ]
[ "Eclipse Application run config to intellij", "Im Currently working in an old java swing project with eclipse IDE. we wanted to change from eclipse to intellij but we have a problem configuring our eclipse application in intellij.\nI have tried to generate .launch file and convert it as intellij launcher with eclipser plugin but didn't work. \n\nI have configured maven and everything.\nThe only problem is that im not finding any type of configuration in Intellij as Eclipse application configuration.\n\nAny suggestions?" ]
[ "java", "eclipse", "swing", "intellij-idea", "run-configuration" ]
[ "Ignite offheapUsedSize doesn't get reset after clear cache", "I got Ignite offheapUsedSize through igenite.dataRegionMetircs().getOffheapUsedSize(), but after I clear cache, this value doesn't get reset, it just keep increasing as time going, I have tried all methods it still not work.\nIgniteCache.clear\nIgniteCache.removeAll\nIgniteCache.clearStatistics()\nIgniteCache.resetQueryMetrics\nIgniteCache.resetQueryDetailMetrics\nIgniteCache.destroy\n\noffheapUsedSize get reset only after I restart the server." ]
[ "ignite" ]
[ "What is the difference between *> and >> in Haskell?", "From the docs:\n(>>) : Sequentially compose two actions, discarding any value produced by the first\n(*>) : Sequence actions, discarding the value of the first argument.\nBoth seem to me doing the same job." ]
[ "haskell", "monads", "applicative" ]
[ "Browsing each column of a record separately", "I have a table that has a lot of columns. For some reason, I need to fetch data from it and then do some stuff on each column value separately. So I'd like to do something like this :\n\nSELECT record FROM table\nFOREACH field of the record\n do some stuff\n\n\nThe \"do some stuff\" part shall do something according to the column name.\n\nIs there an easy way to perform such a browse in PL/SQL ?\n\nThanks !" ]
[ "plsql" ]
[ "Copying cells with Range.Copy", "I'm writing an Excel workbook to take data for a research study, analyze each day's worth, then send the entered data and its 7 summary computations into a workbook (named test subject 1, and worksheet test med 1) for archive and analysis. \n\nThe range.copy command correctly copies the range of the data entered directly (or by a Userform) and the cells with the descriptive titles.\n\nThe column P, which contains data referenced from another sheet in the Workbook, is copied with the wrong cell reference. Cell AB16 is copied with the data from ='[FAVor Study Medication Daily Calculator8.xlsm]Calculations'!AB7, (not ...AB16). This is true for all the 7 summary cells in that column (AB16 - AB22), but cells ab15 and ab23, simple references to other cells on the same worksheet, are correctly copied.\n\nI tried using the PasteSpecial command but got another set of problems that I'll try to solve next!\n\nI've labelled the problem line of code as ProblemLine:\n\nDim wsCopyfrom As Worksheet\nDim wsCopyto As Worksheet\n'Dim CopyfromLastRow As Long\n'Dim CopytoLastRow As Long\n'set variables for copy and dest sheets\nSet wsCopyfrom = ThisWorkbook.Sheets(\"EnterData\")\nSet wsCopyto = ActiveWorkbook.Sheets(medname)\n'Find last used row in the copyfrom based on data in column E and the copyto Col A\nCopyfromLastRow = wsCopyfrom.Range(\"E200\").End(xlUp).Row\nCopytoLastRow = wsCopyto.Range(\"A200\").End(xlUp).Row\n'make copy of range, but ensure that all of the block rows are included, to row 10\nIf CopyfromLastRow > 19 Then\n wsCopyfrom.Range(\"A7:P\" & CopyfromLastRow).Copy wsCopyto.Range(\"A\" & CopytoLastRow + 1)\nElse\n 'ProblemLine\n wsCopyfrom.Range(\"A7:q20\").Copy wsCopyto.Range(\"A\" & CopytoLastRow + 1)\nEnd If 'if to copy at least to row 19" ]
[ "excel", "vba" ]
[ "Javascript object of unknown arbitrary depth causes script to stop execution", "I might receive a JSON structure like this\n\nfoo: {}\n\n\nOr I might like this:\n\nfoo: {bar: {baz: 1} }\n\n\nWhen I check the first data structure for existence like this:\n\nif ( data.foo.bar.baz ) { }\n\n\nThe script stops running altogether. I can't see any javascript errors on the browser or anything. It just stops. Either way tho, it would be nice to be able to do the above instead of:\n\nif ( data.foo && data.foo.bar && data.foo.bar.baz ) { }\n\n\nWhat's the best way to address this issue?" ]
[ "javascript" ]
[ "How to remove spaces between the string which is extracted from sitecore", "Hi Please see the below field I extracted from the sitecore. I dont want any spaces betwwen paragraphs or lines just need to have the plain strings:\n\n Meet nearly any application need\nThis extra large format flatbed printer lets you print on rigid panels up to 2.5 m x 3.05 m, and up to 50.8 mm thick; and flexible rolls up to 220 cm wide. You can even print on irregularly-shaped, reasonably flat objects, by simply placing them on the flatbed printer table.\nIf a job can be printed digitally, it most likely can be produced on an Océ Arizona 440 XT UV flatbed printer. With the ability to print on a wide variety of media and objects in full colour, print service providers can capture revenue from applications ranging from standard sign and display (POP/POS, retail signage) to speciality flatbed printing applications.\n\nThe right partner for building your business\nOcé Display Graphics is committed to helping you grow your business in today's competitive environment. That's why we continue to invest and innovate in our market-leading UV flatbed printers. So you get the right technologies, the right advice and the right support to help you move forward. \n\nExceptional print quality, productivity improvements\n\n Océ VariaDot® imaging technology for superior image quality \n Active pixel placement compensation for assured image sharpness, density and uniformity around the entire flatbed or across the Roll Media Option \n Six user-selectable vacuum zones designed to match most standard-sized graphics arts media without masking \n Batch mode for streamlining multi-layered jobs or facilitating set collation \n Print speeds of up to 20.3 square metres per hour of high quality production capacity over a broad range of media and applications \n Upgrade at any time to an Océ Arizona 460 GT model to add White Ink and Varnish capability, or upgrade to an Océ Arizona 480 GT model to take advantage of CM2 printing that offers even higher quality at faster speeds" ]
[ "c#" ]
[ "Put the focus on last character of text after space validation", "I'd like to place the focus on the last character of the text after the whitespace validation. The focus doesn't end up on the last element. Please look into the code and suggest any changes to me.\n\nvar pattern=/^\\s|\\s$/;\nvar textentered=document.textentered.text.value;\nif(textentered.match(pattern))\n{\n alert(\"Spaces are not allowed\");\n textentered.focus();\n return false;\n}\n\n\nThanks" ]
[ "javascript" ]
[ "How to extract information from two or more columns into one", "I have clients who register for 2 or more classes via a form and the dates appear in separate columns on the form summary page - name in colB, first class date in colD, second class date in colG, etc.\nSo clients dates of their 1st, 2nd, 3rd classes overlap.\n\nI want to pull the dates into a schedule sheet and can do this easily for the first date (colD). But I cannot figure out how to also pull in the clients for the second class into the same column on the schedule sheet. I can get them into separate columns easily enough, but would like them all to appear in the same column to save space and make the scheduler more easy to view.\n\nThis is the code I tried:\n\n=QUERY(Form3!B1:M200, \"select B, D where C >= date '2015-03-02' and C <= date '2015-03-06'\", 1)\n\n\nIs it possible to create a single column list of all clients taking class any particular week regardless of whether it is their 1st 2nd 3rd class?\n\nIt means drawing from 3 or more columns and returning all the results to just one column." ]
[ "google-sheets", "formulas" ]
[ "Unity WebGL build missing sharedassets1.resource on loading and not playing videos", "In my project I have couple of \"screens\" which have videos playing on them. Usual .mp4 files attached to 3D object.\n\nWhen I Play it in the editor - all works as expected. No errors. Not problems.\n\nWhen I build the project for WebGL and play it online - everything works except these videos. Looking at the console I see this error:\n\nsharedassets1.resource:1 Failed to load resource: the server responded with a status of 404 (File not found)\n\n\nIt repeats 6 times = I have 6 videos. \n\nWhat is this file sharedassets1.resource? I don't see it anywhere? In the error the link to the file expects it here: http://localhost:8000/main/sharedassets1.resource - in the main folder. But that's my folder structure of the Successful build:\n\n\n\nWhat should I check? What kind of settings might be not right?\n\nAny ideas/knowledge appreciated! Thanks!\n\nUPDATE WITH SOLUTION DETAILS:\n\nBelow suggestion can solve this. However this means that you need to check the format of your videos (mp4? mov? avi?) and convert them to something that WebGL can stream without any issues. For example .webm will work PERFECTLY but only if the game is played via chrome." ]
[ "unity3d", "webassembly", "unity-webgl" ]
[ "how to apply css to particular column of gridview columns in yii2", "I am new to yii2.. how to apply css to column, column heading of yii2 gridview??\n\n<?php \n\n $gridColumns = [\n ['class' => 'yii\\grid\\SerialColumn'],\n ['class' => 'yii\\grid\\CheckboxColumn'], \n\n 'name',\n 'company_mail', //change the color of heading\n 'no_employees',\n 'email:email', \n .\n .\n .];\n echo GridView::widget([\n 'dataProvider' => $dataProvider,\n 'filterModel' => $searchModel,\n 'columns' => $gridColumns,\n ]); \n ?>" ]
[ "gridview", "yii2" ]
[ "Load markers from mysql database and display as markers on Google maps", "I am using phonegap and I have a google map which locates the user and places a marker on the map. What I want to do is load markers from a mysql database which holds lat and long details for each place. Do I have to do this through php and ajax? This is the code I have at the moment. Thanks\n\n <html>\n\n <head>\n\n<meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n<title>Test</title>\n<link rel=\"stylesheet\" href=\"/master.css\" type=\"text/css\" media=\"screen\" />\n<script type=\"text/javascript\" src=\"https://maps.googleapis.com/maps/api/js?sensor=false\"></script>\n<script type=\"text/javascript\" charset=\"utf-8\" src=\"phonegap.js\"></script>\n<script type=\"text/javascript\">\n\nfunction onLoad() {\ndocument.addEventListener(\"deviceready\", onDeviceReady, false);\n}\n\nfunction onDeviceReady() {\n navigator.geolocation.getCurrentPosition(onSuccess, onError,{'enableHighAccuracy':false,'timeout':10000});\n\n}\n\n//GEOLOCATION\nvar onSuccess = function(position) {\n\n\n var myLat = position.coords.latitude;\n var myLong = position.coords.longitude;\n var myLatlng = new google.maps.LatLng(myLat, myLong);\n\n //MAP\n var mapOptions = {\n center: new google.maps.LatLng(myLat, myLong),\n zoom: 8,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\n var map = new google.maps.Map(document.getElementById(\"map_canvas\"),\n mapOptions);\n\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n title:\"Hello World!\"\n });\n\n\n};\n\n// onError Callback receives a PositionError object\n//\nfunction onError(error) {\n alert('code: ' + error.code + '\\n' +\n 'message: ' + error.message + '\\n');\n}\n\n\n </script>\n </head>\n <body onload=\"onLoad()\"> \n <div id=\"map_canvas\" style=\"width:100%; height:100%\"></div>\n </body>\n </html>" ]
[ "php", "mysql", "ajax", "cordova" ]
[ "Chrome Extension Bing Translation", "I am writing a chrome extension that will use the Bing translation API. To use it I need an access token which I can request using my clientID and client secret. It expires every ten minutes.\n\nWhat is the correct way to do this client side? I obviously don't wan't to distribute my client secret but the access token expires every ten minutes." ]
[ "google-chrome-extension", "oauth-2.0", "bing-api" ]
[ "What's a good way to format this?", "Here's the code:\n\nprint \"Unsorted \\t Bubble \\t Insertion\"\n\nfor x, y, z in zip(List, arr_bs, arr_is):\n print '{0:2d}\\t\\t{1:3d}\\t\\t{2:4d}'.format(x, y, z)\n\nprint \"Seconds: \\t %f \\t %f\" % (time_bs, time_is)\n\n\nHere's the output:\n\nUnsorted Bubble Insertion\n43 5 5\n88 18 18\n57 24 24\n86 37 37\n81 37 37\n18 38 38\n 5 43 43\n24 57 57\n76 76 76\n37 81 81\n37 86 86\n38 88 88\nSeconds: 0.000091 0.000042\n\n\nAh, couldn't get the output to look exactly like it does in terminal, but you get the idea.\nI'm pretty new to python, is there a more pythonic way of formatting these print statements?\n\nOpen to opinions, thanks." ]
[ "python", "printing", "format" ]
[ "Cannot read property '1' of null error jqueryui", "I'm trying to use jquery dialog but I keep getting this error.\n\nDiv I use for the dialog:\n\n<div id=\"save-dialog\" title=\"Save\">\n <p>Is this a tipo or a new patch? Leave blank if its a patch</p>\n <p>Enter patch like this:\"CB 1\"</p>\n <form>\n <fieldset>\n <input type=\"text\" id=\"patch\" value=\"\"/>\n </fieldset>\n </form>\n</div>\n\n\nComplete JS:\n\n function savex(name){\n var desc = jQuery('input#'+name).val();\n var id = \"<?php echo $_GET[id]; ?>\";\n var patch = jQuery(\"#patch\").val();\n jQuery(\"#save-dialog\").dialog({\n autoOpen:false,\n height:300,\n width:300,\n modal:true,\n buttons: {\n \"Saving\": function(){\n\n jQuery.ajax({\n url: 'editcontentheroes.php',\n type: 'post',\n data: 'id='+id+'&desc='+desc+'&name='+name+'&patch='+patch,\n always: function(output) \n {\n history.go(0);\n }\n }); \n },\n Cancel: function(){\n jQuery(this).dialog(\"close\");\n }\n }\n }); \n}\n\n\nThe function savex Is being called by a button. Tried to check for some empty variables but didnt found any problem with that.\n\nEdit: the title its the error I get\n\nEdit2: I'm using wordpress" ]
[ "jquery", "user-interface", "dialog" ]
[ "Help Optimizing a MySQL SELECT with ORDER BY", "Currently the table has the following indexes:\n\nforum_id_index\nother_forum_id_index\nforum_id_on_other_forum_id_index => [forum_id, other_forum_id]\n\nThe query:\nSELECT `topics.*` \nFROM `topics` \nWHERE (table.forum_id = ? OR table.other_forum_id = ?) \nORDER by sticky, replied_at DESC LIMIT 25\n\nI've tried adding indexes on the following:\n\nsticky\nreplied_at\n[sticky, replied_at]\n[forum_id, other_forum_id, sticky, replied_at]\n[sticky, replied_at, forum_id, other_forum_id]\n\nThis is for a forum, trying to get the top 25 topics in the forum, but placing sticky topics (sticky is a binary field for sticky/nonsticky) at the top.\nI've read pretty much everything I can get my hands on about optimizing ORDER BY, but no luck. This is on MySQL 5.1, INNODB. Any help would be greatly appreciated.\nEDITS\nAs requested in comments (sorry if I'm doing this wrong - new to posting on SU). Results of EXPLAIN currently:\n\nid = 1\nselect_type = SIMPLE\ntable = topics\ntype = index_merge\npossible_keys = index_topics_on_forum_id,index_topics_on_sticky_and_replied_at,index_topics_on_forum_id_and_replied_at,index_topics_on_video_forum_id,index_forum_id_on_video_forum_id,\nkeys = index_topics_on_forum_id,index_topics_on_video_forum_id\nkey_len = 5,5\nref = NULL\nrows = 13584\nExtra = Using union(index_topics_on_forum_id,index_topics_on_video_forum_id); Using where; Using filesort\n\nSHOW INDEXES FROM topics returns https://gist.github.com/1079454 - Couldn't get formatting to show up here well.\nEDIT 2\nSELECT `topics`.*\nFROM `topics`\nWHERE topics.forum_id=4\nORDER BY sticky desc, replied_at DESC\n\nRuns incredibly fast (1.4ms). So does the query when I change topics.forum_id to topics.video_forum_id - just not when I have them both in the query with an or." ]
[ "mysql", "indexing" ]
[ "compiling valgrind using uCLibc", "I am working on a project and i want to compile valgrind using uClibc.\nCan anyone suggest me something about how to proceed?\n\nI am using fedora and i386 platform. the target platform is also i386 at the moment later on would work on MIPS.\n\nthanks" ]
[ "compilation", "valgrind", "uclibc" ]
[ "Extracting multiple tables/datasets from csv", "I have a small csv file that contains tables/datasets no larger than 50 rows each, and each separated with a blank row. An example of what the file looks like:\n\nInfo_header 1\nInfo_header 2\nNaN\nTitle1, Title2\nColumn1,Column2,Column3,Column4,Column5,Column6,Column7,Column8\nSteve,Indiana,0,0,2,1,2,5\nMegan,New York,34,0,0,5,3,2\n...\nNaN\n-Total-,,34,0,2,6,5,7\nNaN\nTitle3,Title4\nColumnA,ColumnB,ColumnC,ColumnD,ColumnE,ColumnF,ColumnG,ColumnH\n...\n\n\nRow and column size change do change. Row with a single NaN represents the blank row. Since the tables are named, the loop I'm planning on using needs to start below the row with the title of the table:\n\ndf = read_csv('data.csv')\n\nstart_value = df.loc[(df[0] == \"Title1\")\n & (df[1] == \"Title2\")]\n\nstart_value = (start_value.index + 1)\n\n# my loop:\n\nempty_list = []\nfor index, row in df.loc[start_value[0]].iteritems():\n if pd.isnull(row[1]):\n empty_list.append(df[row])\n else:\n break\n\n\nMy logic is if Title1 and Title2 meet my criteria, then append rows below the Title row, & stop appending if a row has no data. How can I do this? I also understand that using loops in dataframes isn't the best solution, alternatives solutions are welcome." ]
[ "python", "loops" ]
[ "Page.evaluate vs Page.waitForFunction in puppeteer", "what's diffrence between page.evaluate and page.waitForFunction in puppeteer" ]
[ "puppeteer" ]
[ "How to implement using UIImagePickerController like path(App)", "The orignal page for UIImagePickerController only have a \"cancel\" button in left-bottom corner. I want to replace it with some other buttons like path, but I can not find functions and points for that in ios sdk. \n Who can help me. thank you" ]
[ "ios", "uiimagepickercontroller" ]
[ "Continous double buffering solution not working", "I'm attempting to double buffer an image containing a polygon in the method paint() using AWT. Using an Image object for the buffering process, I set the image background to black, draw the polygon to the image and then draw the buffered image to the screen. I then call repaint() in order to render the image again.\n\nUnfortunately, I'm still receiving artifacts when repainting the image. What am I doing incorrectly?\n\nEDIT: As a side note, I'm using Java 8.\nEDIT 2: I'm calling repaint() in paint() because I need to continuously buffer the image. The polygon is meant to translate across the screen based off user input.\n\nimport java.applet.Applet;\nimport java.awt.*;\n\npublic class DoubleBuffer extends Applet {\n int xSize = 900;\n int ySize = 600;\n\n Image bufferImage;\n Graphics bufferG;\n\n @Override\n public void init() {\n this.setSize(xSize, ySize);\n\n //Double buffering related variables\n bufferImage = this.createImage(xSize, xSize);\n bufferG = bufferImage.getGraphics();\n }\n\n //BUFFERING DONE HERE\n @Override\n public void paint(Graphics g){\n //drawing images to external image first (buffering)\n bufferG.setColor(Color.BLACK);\n bufferG.fillRect(0,0,xSize,ySize);\n bufferG.setColor(Color.WHITE);\n bufferG.drawRect(100, 100, 100, 100);\n\n //draw the image and call repaint\n g.drawImage(bufferImage, 0, 0, this);\n repaint();\n }\n}" ]
[ "java", "awt", "java-8", "doublebuffered" ]
[ "Unable to expand navigation of wordpress website when the browser size is reduced", "I am looking for help in verefly.com. I have developed this website with an online theme and have made the necessary changes .My issue is that the navigation menu when the browser is reduced from its original size , does not expand . It should ideally do that and was performing normally until some days ago . \n\nThe normal website looks like this :\n\n\n\nThe website looks different when the browser is reduced in size :\n\n\n\nIn the above picture you will see the navigation menu , however the Plus sign is no longer clickable . Neither does it expand . I am not able to understand where i can change it to work again . \n\nI would appreciate any help .*\n\n* I tried to check if the secondary Menu had an issue , but nothing is evident *" ]
[ "php", "css", "wordpress", "hyperlink", "wordpress-theming" ]
[ "change chart.Correlation defaults to produce best fit line rather than smoothed curve in lower triangle [R]", "I am attempting to create a correlation matrix of 16 different vectors and almost everything is as I want it, the only difference is that I would rather have best fit lines in the scatterplots rather than smoothed curves. I have seen some other posts that mention changing the pch using the pairs() portion of the function call to chart.Correlation, is there something similar to ask for a best-fit line rather than the smoothed curve?\n\nI ask because I feel that the smoothed curves might be giving a false sense of high correlation within certain parts of the scatterplots, and I know the correlation is right there on the upper half but I would still like to have the option to change the line in the scatterplot from smoothed to best fit.\n\nMy code is pretty simple:\n\nchart.Correlation(all.cell.types.rna.seq.table[,2:16], histogram=FALSE)\n\n\nall.cell.types.rna.seq.table is a dataframe with 16 columns, the first of which is an id number.\n\nCorrelation matrix, smoothed lines rather than best fit lines : \n\n\n\nAll I would like are best fit lines rather than smoothed curves in the scatterplots on the lower triangle of the correlation matrix image." ]
[ "r", "graphing" ]
[ "Foldl with lambda expresion", "Hi I'm trying to sum a list of tuples into a tuple with the foldl function,\nI tryed it with using as parameter a lambda expresion but it's giving out a wrong value \nhere the code:\n\ndata Point = Point {x,y :: Float}\nsumPoint :: [Point] -> (Float,Float)\nsumPoint xs = foldl (\\(a,b) x-> (0+a,0+b)) (0.0,0.0) xs\n\n\nIt should come out sumPoint [Point 2 4, Point 1 2, Point (-1) (-2)] = (2.0,4.0)\nBut im getting (0.0,0.0)\nHow is this making any sense?" ]
[ "haskell", "foldleft" ]
[ "HTTP POST in Espruino for Microcontrollers", "I recently got myself an esp8266-12e module and loaded the ESPRUINO.js firmware on it. I am trying execute a post request from the device, but the device always returns a 'no connection' error when trying to POST. \n\nTo troubleshoot I have ran a GET request to the same URL, and the request was successful, this means that internet is working on the device and communication with the intended server is possible. \n\nI then moved on to see if there were errors in my HTTP POST code, I ran the same code in a node.js app and it successfully posted to the server. \n\nHere is the code below, I removed the exact address of my server and my wifi/pass info. \n\nvar http = require(\"http\");\nvar wifi = require(\"Wifi\");\n\nvar sdata = {\n deviceID: 'esp-12',\n};\n\nvar options = {\n hostname: 'immense-XXXXXX-XXXXX.herokuapp.com',\n method: 'POST',\n path:'/MXXXXXX',\n headers: {\n 'Content-Type': 'application/json'\n }\n};\n\nvar req = http.request(options, function(res) {\n console.log('Status: ' + res.statusCode);\n console.log('Headers: ' + JSON.stringify(res.headers));\n res.setEncoding('utf8');\n res.on('data', function(body) {\n console.log('Body: ' + body);\n });\n});\nreq.on('error', function(e) {\n console.log('problem with request: ' + e.message);\n});\npayload = JSON.stringify(sdata);\nreq.write(payload);\nreq.end();\n\n\nterminal response from device after execution \n\nproblem with request: no connection\n\n\nHere is the documentation for Espruino.js HTTP module. \nhttps://www.espruino.com/Reference#http\n\nCan any of the JS gurus see an issue with the request?" ]
[ "javascript", "node.js", "http" ]
[ "What is Roles in spring boot", "What is Roles in context of Spring Security. How to define it. I am not asking about coding. What is the general definition for roles in spring boot. Someone please give a definition with appropriate example" ]
[ "spring", "spring-boot", "model-view-controller", "spring-security" ]
[ "how to develop option selected based different content div using single page Jquerymobile", "We developing the hybrid application.We have an requirement like user select the option and what ever selected the option we want to show the different content.\n\nFor an example, user have select option like India,US,Canada.\nif user select the India we want display India content remaining hide.\nif user select the US we want display US content remaining hide.\nIf user select Canada we want display Canada content remaining hide.\n\nBut we want to display the defualt india the after user select option based we want disply to user.\n\nAny one please tell me how to do for above requirement.It is possible or not?\n\n\r\n\r\n$(document).ready(function(){\r\n $(\"#select1\").change(function(){\r\n \r\n $(this).find(\"option:selected\").each(function(){\r\n if($(this).attr(\"value\")==\"red\"){\r\n $(\".box\").not(\".red\").hide();\r\n $(\".red\").show();\r\n }\r\n else if($(this).attr(\"value\")==\"green\"){\r\n $(\".box\").not(\".green\").hide();\r\n $(\".green\").show();\r\n }\r\n else if($(this).attr(\"value\")==\"blue\"){\r\n $(\".box\").not(\".blue\").hide();\r\n $(\".blue\").show();\r\n }\r\n else if($(this).attr(\"value\")==\"yellow\"){\r\n $(\".box\").not(\".yellow\").hide();\r\n $(\".yellow\").show();\r\n }\r\n else{\r\n $(\".box\").hide();\r\n }\r\n });\r\n }).change();\r\n});\r\n<div data-role=\"content\" >\r\n <select name=\"select\" id=\"select1\">\r\n <option value=\"red\">QATAR</option>\r\n <option value=\"green\">United Arab Emirates</option>\r\n <option value=\"blue\">KUWAIT</option>\r\n <option value=\"yellow\">OMAN</option>\r\n </select>\r\n\r\n <div class=\"red box\" id=\"pageContentQtr\">\r\n <p>content-qatar</p>\r\n </div>\r\n \r\n <div class=\"green box\" id=\"pageContentUae\">\r\n <p>content-uae</p>\r\n </div>\r\n\r\n <div class=\"blue box\" id=\"pageContentKwt\">\r\n <p>content-kuwait</p>\r\n </div>\r\n \r\n <div class=\"yellow box\" id=\"pageContentOman\">\r\n <p>content-oman</p>\r\n </div>\r\n</div>" ]
[ "jquery", "select", "show-hide" ]
[ "visual studio web express 2013 - reverted to old code", "I have been working on a solution in Visual Studio 2013 Web express for past several months now. It was opening my recent changes until yesterday when I loaded the solution and it was showing all .aspx html and code behind programming from 3 months back. I can no longer access my recent solution. Its frustrating having to rework everything. Has anyone encountered this problem or can you suggest a solution how I can get my updated version?" ]
[ "asp.net" ]
[ "Android scrollable Listview of images from drawable", "I would like to implement a scrolable view, like in Instagram, shown below.\n\n\n\nI need it to work exactly like in Instagram:\n\n\nThumbnails are stored in Drawable.\nThey are scrollable.\nThey are clickable.\n\n\nI wanted to implement it with ListView. But, besides Listviews not being available in horizontal mode (at least by default), after reading posts about similar situations, got confused as to which view is suitable for this case, ListView, GridView, Gallery, ...\n\nReally appreciate any solution for this problem." ]
[ "android", "listview", "android-listview", "instagram", "scrollable" ]
[ "Autocomplete TextBox in c# from values in a Collection", "Is it possible to have autocomplete in a textbox enabled for values in a collection?\n\nSay the collection is \"people\" - a group of class \"person\"\n\nI would like the autocomplete to retrieve the list of values from \"person.Surname\" etc\n\nThanks" ]
[ "c#", "collections", "autocomplete", "textbox" ]
[ "Getting VB6 to reveal which component doesn't have a design time license installed", "I've inherited a VB6 project that I'm trying to \"Make\".\n\nThe build fails on the \"Making EXE\" step with a licensing error:\n\nLicense information for this component not found. \nYou do not have an appropriate license to use this functionality \nin the design environment.\n\n\nHow can I figure out which component is missing the license?\n\nThe project has about 15 references; a mixture between commercial and Microsoft. I've installed development versions / licenses for all the obvious references - and checked that I can compile their sample apps successfully.\n\nOf the remaining 13 odd references; how I can get more information as to which component is throwing the licensing error?\n\nAny tips / techniques on how to get a more verbose error message would be greatly appreciated!" ]
[ "vb6", "licensing", "dll" ]
[ "yii2 join model as dataProvider", "I've joined 2 tables like following:\n \n $model = SalesEntry::find()\n ->joinWith('salesItems')\n ->all();\n \n\nthen in view used DataProvider like following:\n \n GridView::widget([\n 'dataProvider' => $model,\n 'columns' => [\n 'date', // sample field from first table to see if ok\n ],\n ]);\n \n\nand I’ve got following error:\n\n\n Call to a member function getCount() on a non-object\n\n\nWhat am I doing wrong here?" ]
[ "yii2" ]
[ "How to fix responsive inputbox with button?", "I can't fix responsive firefox but working chrome, I am using bootstrap framework could you please solve this issue.\n\n\n\n\r\n\r\n.input-group {\r\n display: flex;\r\n border: 2px solid #fff;\r\n border-radius: 12px;\r\n width: 80%;\r\n margin: 0 auto;\r\n }\r\n .phone-extension {\r\n color: #fff;\r\n font-weight: 600;\r\n margin-right: 8px;\r\n font-size: 20px;\r\n margin: 10px;\r\n }\r\n #mobile-number {\r\n color: #505050;\r\n font-weight: 600;\r\n font-size: 18px;\r\n margin: 7px;\r\n }\r\n #first-button {\r\n padding: 14px;\r\n color: #0b2257;\r\n font-weight: 600;\r\n margin: 0px;\r\n }\r\n<link href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\" rel=\"stylesheet\"/>\r\n<script src=\"https://code.jquery.com/jquery-3.3.1.slim.min.js\" integrity=\"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo\" crossorigin=\"anonymous\"></script>\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\" integrity=\"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1\" crossorigin=\"anonymous\"></script>\r\n<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\"></script>\r\n\r\n\r\n<div class=\"input-group md-form form-sm form-2 pl-0\">\r\n <span class=\"phone-extension\">+971</span>\r\n <input class=\"form-control my-0 py-1 lime-border\" type=\"number\" id=\"mobile-number\" maxlength=\"9\" style=\"margin: 7px;\">\r\n <div class=\"input-group-append\">\r\n <span class=\"input-group-text lime lighten-2\"><button class=\"btn btn-primary\" id=\"first-button\" style=\"\" onclick=\"mobilenumber()\">SMS LINK</button></span>\r\n </div>\r\n</div>" ]
[ "html", "css", "twitter-bootstrap" ]
[ "Does Basemap allow to print the number of datapoints plotted?", "I have flight locations from several areas around the world and when I choose a specific area to plot the points, I want to know how many points are being plotted. \n\nIs there a functionality to output the number of points that show up on my map?" ]
[ "python", "matplotlib", "matplotlib-basemap" ]
[ "Lines between columns in phpMyAdmin", "We are currently upgrading our system and moving our databases to new servers and a new MySQL version (4.8.5), and we will also be using a new phpMyAdmin. One of the differences I've noticed in appearence is that there are no longer any lines between columns. Is this something that can be set on a user level so that I can add them back in (to make columns in big tables more easily readable) with an option, or would I need to have access to a CSS-file or something else to change these?" ]
[ "phpmyadmin" ]
[ "Filter and Map versus Reduce", "I am having trouble understanding the performance difference between doing a combination of a filter then a map on the filtered list compared to just iterating over the list once and doing a reduce.\nIn terms of the joint filter and map I see that we would have to iterate twice over a list. The first time to filter and then we iterate over the shorter filtered list. However, overall this should still be an O(n) operation, correct?\nFor the reduce operation the only difference I see in terms of runtime is that we only have to iterate over the list once and we can do the filtering and mapping all in one go.\nBut in either case shouldn't the run time still be O(n)? How are they different in terms of runtime performance?" ]
[ "javascript", "arrays", "filter", "runtime", "big-o" ]
[ "Getting npm WARN deprecated", "I am getting following npm WARN deprecated although these packages are not in package.json file. Where these packages are listed? and where should i change their versions?\n\nnpm WARN deprecated [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size\nnpm WARN deprecated [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3." ]
[ "javascript", "angular", "npm", "npm-install", "package.json" ]
[ "Access current user in Symfony 2.1 Abstract Type", "I'm a bit confused about how to access the current user in Symfony 2. Currently I'm trying to display a variation of a form (AbstractType) depending on the ROLES of the current user.\n\nA similar question has already been answered by Gremo: Access currently logged in user in EntityRepository\n\nMy question is: Is there a Symfony 2 native way to access the user inside my AbstractType class without using JMSDiExtraBundle? Thanks!\n\nHere's my current code:\n\nnamespace Acme\\DemoBundle\\Form;\n\nuse Symfony\\Component\\Form\\AbstractType;\nuse Symfony\\Component\\Form\\FormBuilderInterface;\nuse Symfony\\Component\\OptionsResolver\\OptionsResolverInterface;\n\nclass Comment extends AbstractType\n{\n public function buildForm(FormBuilderInterface $builder, array $options)\n {\n\n //somehow access the current user here\n\n $builder\n ->add('name')\n ->add('comment_text')\n ->add('comment_email')\n\n // Add more fields depending on user role\n\n ;\n }\n\n public function setDefaultOptions(OptionsResolverInterface $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => 'Acme\\DemoBundle\\Entity\\Comment'\n ));\n }\n\n public function getName()\n {\n return 'acme_demobundle_comment';\n }\n}\n\n\nEdit: I'm looking for the currently logged in user (security.context)" ]
[ "symfony", "symfony-2.1" ]
[ "I am using laravel to display the item in view page", "The code was in tab and code is:\n\n<div class=\"tab-pane fade in active\" id=\"biography\">\n <p>{!! $artist{'description'} !!}</p>\n </div>\n <div class=\"tab-pane fade\" id=\"exhibition\">\n <table class=\"table table-condensed\">\n <thead>\n <tr>\n <th>Title</th>\n <th>Year</th>\n </tr>\n </thead>\n <tbody>\n\n @foreach($artist{'exhibition'} as $exhibition_history)\n <tr>\n <td>{!! $exhibition_history{'title'} !!}</td>\n <td>{!! $exhibition_history{'year'} !!}</td>\n </tr>\n @endforeach\n </tbody>\n </table>\n </div>\n\n\nhere description is shown in view page but exhibition title and history is not shown when user is logged in..\n\nand if user is not logged in they can view both description and exhibition..\ncan anybody tell me the proper solution for this..\ni am using rbac" ]
[ "php", "laravel", "blade", "rbac" ]
[ "How to refresh the JWT in net core?", "I have a method to auth the user and create a token with expiration time, but if the token expired, the user cannot use the data. How to handle this?\n\nThis is my method:\n\n[AllowAnonymous]\n[HttpPost]\n[Route(\"api/token\")]\npublic IActionResult Post([FromBody]Personal personal)\n{\n string funcionID = \"\";\n if (ModelState.IsValid)\n {\n var userId = GetUser(personal);\n if (!userId.HasValue)\n {\n return Unauthorized();\n }\n else if (userId.Equals(2)) {\n return StatusCode(404, \"Vuelve a ingresar tu contraseña\");\n }\n\n List<Claim> claims = new List<Claim>();\n foreach (var funcion in Funcion) {\n claims.Add(new Claim(ClaimTypes.Role, funcion.FuncionID.ToString()));\n }\n\n claims.Add(new Claim(JwtRegisteredClaimNames.Email, personal.CorreoE));\n claims.Add(new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()));\n var sesionExpira = new DatabaseConfig();\n _configuration.GetSection(\"Database\").Bind(sesionExpira);\n var token = new JwtSecurityToken\n (\n issuer: _configuration[\"Issuer\"],\n audience: _configuration[\"Audience\"],\n claims: claims,\n expires: DateTime.UtcNow.AddMinutes(sesionExpira.Sesion),\n notBefore: DateTime.UtcNow,\n signingCredentials: new SigningCredentials(new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration[\"SigningKey\"])),\n SecurityAlgorithms.HmacSha256)\n );\n var token_email = token.Claims.Where(w => w.Type == \"email\").Select(s => s.Value).FirstOrDefault();\n var token_rol = claims.Where(x => x.Type == \"http://schemas.microsoft.com/ws/2008/06/identity/claims/role\").Select(s => s.Value).FirstOrDefault();\n\n var nombre = _context.Personal.Where(x => x.CorreoE == personal.CorreoE).Select(x => x.Nombre).FirstOrDefault();\n return Ok(new { email = personal.CorreoE, token = new JwtSecurityTokenHandler().WriteToken(token), nombre = nombre, funcion = Funcion});\n\n }\n return BadRequest();\n}\n\n\nFirst, in the GetUser(Personal personal) method, that returns int, i return a number that i use to create a new token. Everything works fine, but i need some information to refresh the token if the time has expired" ]
[ "c#", "asp.net-core", "jwt" ]
[ "Setting and Showing the SelectedItem in ComboBox from VM in WPF Prism MVVM", "I am trying to set a ComboBox SelectedItem from my VM. I think I am close, but I do not know how to show the SelectedItem in the ComboBox when it is set from the VM. \n\nThe textbox is has a binding to the SelectedItem Property. When I run it, it will indeed show Friday in my TextBox, but the combobox is still empty. The TextBox also shows any value I may select in my ComboBox, So I think Ihave done that part ok. What do I need to change to also show it in the ComboBox? Not sure I made a mistake in the code, or I simply need to do something I am not aware of to be honest.\n\nThe sample DB is WeekDays\n\nWeekDayID WeekDayShort WeekDayLong\n 1 Sun Sunday\n 2 Mon Monday\n 3 Tue Tuesday\n 4 Wed Wednesday\n 5 Thu Thursday\n 6 Fri Friday\n 7 Sat Saturday\n\n\nModel WeekDays.cs :\n\npublic partial class WeekDays\n{\n public int WeekDayID { get; set; }\n public string WeekDayShort { get; set; }\n public string WeekDayLong { get; set; }\n}\n\n\nViewModel MainViewModel.cs :\n\nclass MainViewModel : BindableBase\n{\n private ObservableCollection<WeekDays> _weekDays;\n public ObservableCollection<WeekDays> WeekDays\n {\n get\n {\n return _weekDays;\n }\n set\n {\n SetProperty(ref _weekDays, value);\n }\n }\n\n private WeekDays _selectedWeekDay;\n public WeekDays SelectedWeekDay\n {\n get\n {\n return _selectedWeekDay;\n }\n set\n {\n SetProperty(ref _selectedWeekDay, value);\n }\n }\n\n private void FillWeekDays()\n {\n using (NLTrader01Entities nlt = new NLTrader01Entities())\n {\n var q = (from a in nlt.WeekDays select a).ToList();\n WeekDays = new ObservableCollection<WeekDays>(q);\n }\n }\n\n public MainViewModel()\n {\n FillWeekDays();\n Initialize();\n }\n\n public void Initialize()\n {\n using (NLTrader01Entities nlt = new NLTrader01Entities())\n {\n SelectedWeekDay = (from a in nlt.WeekDays where a.WeekDayLong == \"Friday\" select a).Single();\n }\n }\n}\n\n\nAnd the View.xaml :\n\n<ComboBox\n ItemsSource=\"{Binding WeekDays}\"\n DisplayMemberPath=\"WeekDayLong\"\n SelectedItem=\"{Binding SelectedWeekDay, Mode=TwoWay}\">\n</ComboBox>\n<TextBox\n Text=\"{Binding SelectedWeekDay.WeekDayLong, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\">\n</TextBox>" ]
[ "c#", "wpf", "mvvm", "observablecollection", "prism-6" ]
[ "How to configure grunt-contrib-less to generate source maps compatible with Chrome DevTools?", "The question title pretty much says it all. I don't know how to configure the grunt-contrib-less task that now supports source maps. My expected result is to have Chrome DevTools CSS inspector to point to the Less rules. If possible, it would be ideal that the source maps be inline in the same outputted CSS file to avoid cluttering my workspace with separate source map files.\n\nThanks" ]
[ "less", "google-chrome-devtools", "source-maps", "grunt-contrib-less" ]
[ "Wordpress loop inside loop", "I have a normal loop that outputs posts based on the given $args.\nAfter three posts I want to insert a post that is from a Featured category. I've tried starting a new WP_Query, simple query_posts in different combinations. Nothing seems to work. Any ideas why ?\n\n$args = array(\n 'post_type' => 'post', \n 'posts_per_page' => $count,\n 'paged' => $paged,\n 'page' => $paged,\n 'cat' => $cat,\n 'ignore_sticky_posts' => 1\n);\n\n// create a new instance of WP_Query\n$my_query = new WP_Query($args);\n\n<ul>\n<?php \n$i = 0;\nif ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); \n\n if($i == 3): ?>\n <li> //insert here one post from featured category\n </li>\n<?php endif; ?>\n\n<li>\n// the normal query stuff is here\n</li>\n<?php $i++ //post counter\nendwhile; //end loop while\nendif; //end loop \n?>\n</ul>" ]
[ "php", "wordpress" ]
[ "'fatal error: unexpectedly found nil while unwrapping an Optional value' for UIToolbar", "I created a toolbar programatically. However, I get the error 'fatal error: unexpectedly found nil while unwrapping an Optional value' for my toolbar at toolbar.frame = CGRect(x: 0, y: 150, width: 250, height: 20) . I'm made sure I didn't declare toolbar twice, so I don't understand why I'm getting this. \n\n\n\nvar toolbar : UIToolbar!\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n\n toolbar.frame = CGRect(x: 0, y: 150, width: 250, height: 20)\n toolbar.center = CGPoint(x: 50, y: 50)\n self.view.addSubview(toolbar)\n}" ]
[ "ios", "swift", "runtime-error" ]
[ "fastest way to write a bitstream on modern x86 hardware", "What is the fastest way to write a bitstream on x86/x86-64? (codeword <= 32bit)\n\nby writing a bitstream I refer to the process of concatenating variable bit-length symbols into a contiguous memory buffer. \n\ncurrently I've got a standard container with a 32bit intermediate buffer to write to\n\nvoid write_bits(SomeContainer<unsigned int>& dst,unsigned int& buffer, unsigned int& bits_left_in_buffer,int codeword, short bits_to_write){\n if(bits_to_write < bits_left_in_buffer){\n buffer|= codeword << (32-bits_left_in_buffer);\n bits_left_in_buffer -= bits_to_write;\n\n }else{\n unsigned int full_bits = bits_to_write - bits_left_in_buffer;\n unsigned int towrite = buffer|(codeword<<(32-bits_left_in_buffer));\n buffer= full_bits ? (codeword >> bits_left_in_buffer) : 0;\n dst.push_back(towrite);\n bits_left_in_buffer = 32-full_bits;\n }\n}\n\n\nDoes anyone know of any nice optimizations, fast instructions or other info that may be of use?\n\nCheers," ]
[ "c++", "optimization", "x86", "bit-manipulation" ]
[ "Sort order of an SQL Server 2008+ clustered index", "Does the sort order of a SQL Server 2008+ clustered index impact the insert performance?\n\nThe datatype in the specific case is integer and the inserted values are ascending (Identity). Therefore, the sort order of the index would be opposite to the sort order of the values to be inserted. \n\nMy guess is, that it will have an impact, but I don’t know, maybe SQL Server has some optimizations for this case or it’s internal data storage format is indifferent to this.\n\nPlease note that the question is about the INSERT performance, not SELECT.\n\nUpdate\nTo be more clear about the question: What happens when the values which will be inserted (integer) are in reverse order (ASC) to the ordering of the clustered index (DESC)?" ]
[ "sql", "sql-server", "sql-server-2008", "indexing", "clustered-index" ]
[ "Union of 4 tables with same column types (but different data) order by max time in AWS Athena?", "I'm having an issue I have 4 tables that look like this:\n\n\n\n\n\ndevice\nvolume1\nvolume2\ntime\n\n\n\n\ndevice_id\nx\ny\ntime_devicemessage\n\n\n\n\nEach table is for one single device so I have 4 devices, which send messages in different timestamps.\n\nI would like to know a query for how to unite these 4 tables into 1 but showing only the last volume data from each table based on its timestamp.\n\nSo it may look like this:\n\n\n\n\ndevice\nvolume1\nvolume2\ntime\n\n\n\n\ndeviceA\nlastvalue (x)\nlastvalue (y)\ntime_devicemessageA\n\n\ndeviceB\nlastvalue (x)\nlastvalue (y)\ntime_devicemessageB\n\n\ndeviceC\nlastvalue (x)\nlastvalue (y)\ntime_devicemessageC\n\n\ndeviceD\nlastvalue (x)\nlastvalue (y)\ntime_devicemessageD\n\n\n\n\nThank you very much for your support, I would appreciate lots the help!\nRegards, Ruben." ]
[ "sql", "amazon-web-services", "iot", "amazon-athena" ]
[ "SML fibonacci large numbers", "I tried to write my own fib function that works for large numbers (over 50) and I had no luck. First I tried the obvious solution but that overflows way to quicly. my next solution was this \n\n $fun fib(a:int, b:int, index:int) = if(index = 1) then\n $ (a+b)\n $ else\n $ fib(b, (a+b), index - 1);\n\n\nUnfortunatly this also overflows." ]
[ "functional-programming", "sml", "smlnj", "ml" ]