texts
sequence
tags
sequence
[ "Import data from JTable to Excel", "i have code to import data from JTable to Excel like this:\n\npublic void toExcel(JTable table, File file){\ntry {\n\n WritableWorkbook workbook1 = Workbook.createWorkbook(file);\n WritableSheet sheet1 = workbook1.createSheet(\"First Sheet\", 0); \n TableModel model = table.getModel();\n\n for (int i = 0; i < model.getColumnCount(); i++) {\n Label column = new Label(i, 0, model.getColumnName(i));\n sheet1.addCell(column);\n }\n int j = 0;\n for (int i = 0; i < model.getRowCount(); i++) {\n for (j = 0; j < model.getColumnCount(); j++) {\n Label row = new Label(j, i + 1, \n model.getValueAt(i, j).toString());\n sheet1.addCell(row);\n }\n }\n workbook1.write();\n workbook1.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n}\n\n\nvoid excell(){\n toExcel(TabelPerencanaan, new File(\"H:\\\\Hasil.xlsx\"));\n JOptionPane.showMessageDialog(null, \"Data saved at \" +\n \"'H: \\\\ Hasil.xlsx' successfully\", \"Message\",\n JOptionPane.INFORMATION_MESSAGE);\n\n\n}\n\nBut, when open file \"Hasil.xlsx\" always error. so, that file can't opened. i don't know why like that. thanks" ]
[ "java", "excel", "swing", "jtable" ]
[ "How to convert a numpy array to leveldb or lmdb format", "I'm trying to convert a numpy array that was created using pylearn2 into leveldb/lmdb so that I can use in Caffe.\nThis is the script that I used to created the dataset. \nAfter running this script, couple of files are generated, among which there are test.pkl, test.npy, train.pkl, train.npy\nI dont know if there is a direct way for converting to leveldb/lmdb, so assuming there is no way, I need to be able to read each image and its corresponding label, so that I can then save it into a leveldb/lmdb database.\nI was told I need to use the pickle file for reading since it provides a dictionary like structure. However, trying to do \n\nimport cPickle as pickle\npickle.load( open( \"N:/pylearn2-master/datasets/cifar10/pylearn2_gcn_whitened/test.pkl\", \"rb\" ) )\n\n\noutputs\n <pylearn2.datasets.cifar10.CIFAR10 at 0xde605f8>\nand I dont know what the correct way of accessing the items in a pickle file is and or whether I need to read from the numpy array directly." ]
[ "python", "numpy", "pycaffe", "leveldb", "lmdb" ]
[ "How to fix slowness when getting the spelling errors in Word VBA?", "I'm trying with the code below from here to list in other document the spelling errors of the active document. My actual file is about 7MB and 1400 pages and the number of spelling errors is about 2400.\n\nWhat I see is the code is stuck each time the For Each loop runs the next item.\n\nIs there a way to enhance the performance of this code? Thanks\n\nSub GetSpellingErrors()\n Dim DocThis As Document\n Dim iErrorCnt As Integer\n Dim J As Integer\n\n Set DocThis = ActiveDocument\n Documents.Add\n\n iErrorCnt = DocThis.SpellingErrors.Count\n For J = 1 To iErrorCnt\n Selection.TypeText Text:=DocThis.SpellingErrors(J)\n Selection.TypeParagraph\n Next J\nEnd Sub\n\n\nI alredy asked yesterday on Microsoft answers forum but I didn't get any answer." ]
[ "vba", "ms-word" ]
[ "Performance hit when using XmlReaderSettings.Schemas and specifying multiple schemas to be used", "I am using XmlReader to validate a XML file as per the supplied schema.\n\nFor that I am creating an instance of XmlReaderSettings and setting it's ValidationType as ValidationType.Schema and it's Schemas Property as XxmlSchemaSet. A draft code is like\n\nXmlReaderSettings rSettings = new XmlReaderSettings();\nXmlSchemaSet schemaSet = new XmlSchemaSet();\nschemaSet.Add(null, xsdPath1);\nschemaSet.Add(null, xsdPath2);\nschemaSet.Add(null, xsdPath3);\nrSettings.Schemas.Add(schemaSet);\n\nrSettings.ValidationType = ValidationType.Schema;\n\nXmlReader validatingReader = XmlReader.Create(sr, rSettings);\n\n\nsr is a StreamReader\n\nThis is actually legacy code and still has many problems which I have to fix. I know that schemaSet.Add(null, xsdPath2) looks nasty and ugly which I am going to fix.\n\nWhat I want to ask is that since I have provided three xsd files, what performance hits should I expect? The xsd's are given in decreasing order of priority. All these XML schema are versioned, so I have added all of them so as to have a fallback mechanism.\n\nWhat I am thinking was that JIT compiler will compiler only xsd1 try to parse the XML file with it and if it fails moves to next. I don't want all of the three xsd to be in memory.\n\nThis is where I am confused. What performance hit can I expect in specifying multiple schema files?\n\nI am expected to improve the legacy codebase, so performance is always on the top." ]
[ "c#", "xml", "performance", "xsd", "xml-serialization" ]
[ "Translation files of my plugin are not being loaded or work incorrect", "I need to translate some parts of text to French.\n\nThings I've tried so far:\n\n\nI created fr.po and fr.mo files in my plugin's /languages directory. I used Poedit for this purpose. I've tried different variants like fr_FR - didn't help.\nI added the following to my plugin's main file along with its name and other information:\n\n\n * Text Domain: pluginname\n * Domain Path: /languages\n\n\nPlugin name does not contain any special characters or underscores/dashes - it's a single word.\n\n\nAlso, tried to use load_plugin_textdomain() function instead (or even along with) to make this work.\nAlso, tried to add this to my wp-config.php file:\n\n\ndefine ('WPLANG', 'fr_FR');\n\n\n\nTried to use any combinations of described actions as well.\n\n\nI have a string to be translated:\n\n__('Recently', 'pluginname')\n\n\nThe word \"Recently\" is being displayed correctly but it is not being translated if I change site language. I tried both changing in WP admin panel and adding into config file (mentioned above)\n\nI tried to use get_locale() to check if this was actually changed. This returns 'fr_FR' which is exactly the same with my .po/.mo file names.\n\n**P.S.: ** Checked all these questions and tried all suggested solutions - didn't help:\n\n\nWordpress - Plugin translation not working\nWordPress plugin translation issue\nWordpress plugins translation\n\n\n\n\nUpdate: load_plugin_textdomain() returns false if I try to var_dump() result right after function execution." ]
[ "wordpress", "internationalization" ]
[ "Dockerized apache server not exposing port 80", "I am trying to run a React application inside a docker container. My application image was built with the following Dockerfile:\n\nDockerfile\n\nFROM node:latest\nLABEL autor=\"Ed de Almeida\"\n\nRUN apt-get update\nRUN apt-get install -y apache2\nRUN mkdir /tmp/myapp\nCOPY . /tmp/myapp\nRUN cd /tmp/myapp && npm install\nRUN cd /tmp/myapp && npm run build\nRUN cd /tmp/myapp/build && cp -Rvf * /var/www/html\nRUN cd /var/www && chown -Rvf www-data:www-data html/\nEXPOSE 80\n\nENV APACHE_RUN_USER www-data\nENV APACHE_RUN_GROUP www-data\nENV APACHE_LOG_DIR /var/log/apache2\nENV APACHE_LOCK_DIR /var/lock/apache2\nENV APACHE_PID_FILE /var/run/apache2.pid\n\nCMD /usr/sbin/apache2ctl -D FOREGROUND\n\n\nAs you may see, I create a production build, copy it to the standard directory of the Apache server and then run the Apache server. I even exposed port 80, the Apache default port.\n\nI am creating the image with \n\ndocker build -t myimage .\n\n\nand running the container with\n\ndocker run -d -p 80:80 --name myapp myimage\n\n\nI am probably missing something, because I am new to Docker, because the container is there, up and running, but when I point my browser to http://localhost I got nothing.\n\nI entered the container with\n\ndocker exec -it myapp bash\n\n\nand the application is running fine inside it. \n\nAny hints?" ]
[ "apache", "reactjs", "docker", "apache2" ]
[ "Price Comparision in mysql query", "I have a price:\n\n$price = 100;\n\n\nI have 2 Database fields\n\n1) priceType\n2) price\n\n\nNow the cases are:\n\nif priceType =1\n\nCASE 1: price <= $price // Do this comparison in WHere Clause\n\nif priceType =2\n\nCASE 2: price* (800000 / 1000) <= '$price' // Do this comparison in WHere Clause\n\n\nOnly one operation should be performed at a time, depends on priceType.\n\nIf priceType = 1 than the $price should be compared in first case way.\n\nIf priceType = 2 than the $price should be compared in second case way.\n\nI want to perform this in Where Clause.\n\nWhat should the query look like ?" ]
[ "mysql", "sql", "select", "case", "where-clause" ]
[ "Singular value decomposition", "I started to learn something about camera matrix and its solution method. There are some methods which in many of them I saw using of singular value decomposition of a matrix but I can't understand what is the aim for using that, Anybody can give some hints about that?" ]
[ "matrix", "camera-calibration" ]
[ "QPolygon containPoints does not get expected results", "I am currently working with QT. I am new with it but, the thing I am trying to do is that I draw a line on my window and make a polygon around here so when I click with mouse on the line I would know to locate her. So I am trying to use a containsPoints() method of polygon but it doesn´t with any of the parameter either OddEvenFill or WindingFill.\n\nSo here is some code where I am creating the polygon :\n\n QPoint topLeft(mStartPoint.x() - 2, mStartPoint.y() - 5);\nQPoint topRight(mStartPoint.x() - 2, mStartPoint.y() + 5);\nQPoint bottomRight(endPoint.x() + 2, endPoint.y() - 5);\nQPoint bottomLeft(endPoint.x() + 2, endPoint.y() + 5);\n\nQVector<QPoint> polygPoints{ topLeft,bottomLeft,topRight,bottomRight};\n\nQPolygon area(polygPoints);\n\n\nand here is the code where I am trying to find if I hit the line or not :\n\nfor (int i = 0; i < edges->size(); i++) {\n\n if((*edges)[i]->getArea().containsPoint(posEdge,Qt::WindingFill)){\n index = i;\n break;\n }\n}\n\n\nSo for example I have a polygon with the points with theese values of coordinates : \n\ntopLeft - x = 51, y = 49\ntopRight - x = 124, y = 69\nbottomLeft - x = 51, y = 59\nbottomRight - x = 124,y = 54\n\n\nand the position of point where I clicked is : x = 80, y = 56\nand the \n\ncontainPoints()\n\n\nmethod still getting false as the point isn´t inside of the polygon.\nDo you have any idea what am I doing wrong ? I would be really thankfull for every help." ]
[ "qt" ]
[ "How to read CDC from Cassandra?", "I have gone through several resources mentioned in http://cassandra.apache.org/doc/latest/operating/cdc.html\n\nThe only thing mentioned about reading the CDC is that it is fairly straightforward with a link to https://github.com/apache/cassandra/blob/e31e216234c6b57a531cae607e0355666007deb2/src/java/org/apache/cassandra/db/commitlog/CommitLogReplayer.java#L132-L140\n\nThis is way too high level.\n\nCan someone please explain or provide me the code to read CDC data after enabling this feature in Cassandra?" ]
[ "cassandra", "cassandra-3.0" ]
[ "UnhandledPromiseRejectionWarning error in Expess", "const Car = mongoose.model('Car', new mongoose.Schema({\n name: {\n type: String,\n required: true,\n }\n}));\n\n\nrouter.put('/:id', async (req, res) => {\n const { error } = joiValidator(req.body); \n if (error) return res.status(400).send(error.details[0].message)\n\n try {\n const car= await Car.findByIdAndUpdate(req.params.id, { name: req.body.name }, {new: true })\n } catch (error) {\n return res.status(404).send('not found.');\n } \n \n res.send(car);\n})\n\ni am successfully connected to mongoDB using mongoose, its only when i try to mock an error by giving a wrong id as an input i get the following error, even though i handled async and await with the trycatch block\n(node:19392) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)\n(node:19392) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code." ]
[ "javascript", "node.js", "express", "mongoose" ]
[ "Roslyn CSharpSyntaxTree.ParseText add reference System.Runtime", "I have copied from Roslyn Pluralsight tutorial this code.\n\nstring code = \"class Foo { }\";\n\nvar tree = CSharpSyntaxTree.ParseText(code);\nvar node = tree.GetRoot();\n\nConsole.WriteLine(node.ToString());\n\nvar ret = SyntaxFactory.ClassDeclaration(\"Foo\").\n WithMembers(SyntaxFactory.List<MemberDeclarationSyntax>(new[] {\n SyntaxFactory.MethodDeclaration(SyntaxFactory.\n PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)),\n \"Bar\"\n ).WithBody(SyntaxFactory.Block()\n )\n})).NormalizeWhitespace();\n\nConsole.WriteLine(ret.ToString());`\n\n\nIn Debug mode I see that variables \"node\" and \"ret\" silently throw this error: \n\n\n \"The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\".\n\n\nIn Roslyn Plurarsight video tutorial \"Creating Syntax Trees Using the APIs\" there is no problem with this. \n\nHow do I attach reference to CSharpSyntaxTree class.\n\nEdit: \nI am using Visual Studio 2015 Preview.\n\n\n\nIn Pluralsight video there is no error in this simple code\n\n\n\nEdit: \n\nThe problem is only in Visual Studio tooltip. I can use Syntax Tree API without any problems. For example this code writes nodes and tokens without any weird exceptions, but Visual Studio won't show me syntax tree in tooltip while debugging code.\n\nstatic void PrintSyntaxTree(SyntaxNode node)\n{\n if (node != null)\n {\n foreach (var item in node.ChildTokens())\n {\n Console.Write(item);\n }\n Console.WriteLine(\"\");\n foreach (SyntaxNode child in node.ChildNodes())\n PrintSyntaxTree(child);\n }\n}\n\nstatic void Main(string[] args)\n{\n string code = \"class Foo { public void Bar(){} }\";\n\n var tree = CSharpSyntaxTree.ParseText(code);\n\n var node = tree.GetRoot();\n\n foreach (SyntaxNode child in node.ChildNodes())\n {\n PrintSyntaxTree(child);\n }\n}" ]
[ "c#", "roslyn", "visual-studio-2015" ]
[ "No paged query var being set in WordPress custom pagination", "I have everything set up fine I just need to finish the pagination. This method is the same as I have done before but for some reason it is now having issues.\n\nI am using the standard 'posts' post type and getting all posts (1 per page like this)\n\n$pageNumber = ( get_query_var('paged') ? get_query_var('paged') : 1 );\n\n$posts = new WP_Query([\n 'post_type' => 'post',\n 'posts_per_page' => 1,\n 'paged' => $pageNumber\n]);\n\n\nThis does what I need but $pageNumber is always 1.\n\nWhen doing a check on the query var for paged:\n\nif (get_query_var('paged')) {\n echo \"paged:\" . get_query_var('paged');\n} else {\n echo \"no paged set\";\n}\n\n\nIt will always say no paged set.\n\nIn my pagination the link I am using for paged links is:\n\ndomain.com/blog/page/2\n\n\nThis returns the correct page and doesn't 404, but the page is not being picked up.\n\nAny ideas why?" ]
[ "php", "wordpress", "pagination" ]
[ "Tomcat 8 session persistence after kill -9", "I am trying to understand the tomcat's (version 8.0.21) session persistence after I execute kill -9 . When I start my tomcat ( using startup.sh), I observe (randomly) http sessions of my web app ( which were created before the kill command execution) still being maintained.\nI understand this session persistence across restart, if I execute shutdown.sh to stop the tomcat and then bring the tomcat up again. My understanding of kill -9 is some what similar to 'power-off'. So my question is :\n\n\nWhether the standard manager implementation gets invoked just after kill -9, which tries to persist session before termination.\nOr I just get the previous session because my tomcat may have serialized the few session, (somewhere into its temp directory) while it was up earlier (before execution of kill -9)." ]
[ "java", "session", "tomcat", "kill-process" ]
[ "Setting Path variable using shell scripting - Using a shell variable", "I have variable difine as SCRPT_PATH=\"/home/dasitha\" I need to add this path to .bashrc file using shell scirpt.\n\nWhat I tired was something like this.\n\necho 'export PATH=$PATH:$SCRPT_PATH\")' >> /root/.bashrc\n\n\nAfter opening my .bashrc file it looks like this\n\nexport PATH=$PATH:$SCRPT_PATH\")\n\n\nWhat I actually need is export PATH=$PATH:/home/dasitha. How should I do this by changing the shell script?" ]
[ "linux", "shell", "ubuntu-14.04" ]
[ "PowerPoint Add-in Write on Slide in Slideshow", "While writing a PowerPoint add-in, I need to draw something on the screen on top of the slideshow.\nI am able to draw lines and images, but they disappear almost immediately.\n\nExample code:\n\nprivate void Application_SlideShowBegin(PowerPoint.SlideShowWindow Wn)\n{\n using (var g = Graphics.FromHwnd((IntPtr)Wn.HWND))\n {\n g.DrawLine(new Pen(Color.Red, 10), new System.Drawing.Point(100, 100), new System.Drawing.Point(200, 300));\n Image img = Properties.Resources.img;\n g.DrawImageUnscaled(img, new Rectangle(250, 250, img.Width, img.Height));\n }\n}\n\n\nAny idea how I can keep the drawn lines / images on the screen?" ]
[ "c#", "windows", "vsto", "add-in" ]
[ "How to download files using axios", "I am using axios for basic http requests like GET and POST, and it works well. Now I need to be able to download Excel files too. Is this possible with axios? If so does anyone have some sample code? If not, what else can I use in a React application to do the same?" ]
[ "axios" ]
[ "Why this zend example stops working when I add a hash to the form", "I'm following this example tutorial\n\nproject code: http://akrabat.com/wp-content/uploads/zf-tutorial-layoutform.zip\n\ntutorial: http://akrabat.com/zend-framework/a-form-in-your-layout/\n\nThe project code runs as expected, until I add a hash element to the form. All I do is add this code in the form under application/forms/Signup.php \n\n$hash = new Zend_Form_Element_Hash('hash');\n$hash->setSalt('mysalt');\n$this->addElement($hash);\n\n\nThis extra bit of code throws everything off. When I submit the form now, it gives me the error that the 2 tokens don't match. \n\nSome troubleshooting: \n\n\nThe problem is not the hash itself because it works fine in my other examples. \nI think has to do with how the request is being handled in this example, but not sure what the problem is exactly. I thought it had to do with the hop count, but when I edit Zend_Form_Element_Hash and changed the hop count from 1 to 100, I still got the same error.\n\n\nThat's the extent of troubleshooting I could think of at my level of expertise with Zend. So thought it's time to ask the big brains. I'm hoping someone can figure it out." ]
[ "php", "zend-framework", "zend-form" ]
[ "Image Radio Buttons flask_wtf", "Trying to figure out how to use images as radio buttons using flask_wtf for Radiofield type of question in a form. I do not know how you actually set the images as the radio buttons.\n\nI am aware of how to achieve this using just plain html but not with flask_wtf. I have my form setup correctly along with my flask_wtf class. I am aware that i have to loop through the subfields of the question in similar way to this:\n\n{% for subfield in form.question1 %}\n<tr>\n<td>{{ subfield }}</td>\n<td>{{ subfield.label }}</td> <!-- but how to set image??-->\n</tr>\n{% endfor %}\n\n\nThis is the flask_wtf class. For demonstration purposes it has just the one RadioField question:\n\nclass questionform1(FlaskForm):\n question1 = RadioField('Question1', choices = [('a','a'),('b','b'), ('c','c'),('d','d')])\n\n\nUsing just HTML I would have done it this way:\n\n<label>\n<input type=\"radio\" name=\"q1\" value=\"a\" id=\"q1a\" required><img \nsrc=\"/static/img/image1.png\">\n</label>\n\n\nI'm sure its possible somehow but there is a lack of information online about how to do it, any suggestions?" ]
[ "python", "flask", "flask-wtforms" ]
[ "remove text in kineticjs", "I have a problem, I have a input where I add text to the canvas image kinetics stage, I can move the text inside the canvas with draggable, but now I want that have a posibility to do double click or something to delete this label text if I want because for example if Im wrong with the text or something similar.\n\nCan you help me, please?\n\nThanks" ]
[ "cordova", "html5-canvas", "kineticjs" ]
[ "How to async an ApiController?", "I have a MVC 5 Web Application, Method .Check() is a long running process.\n\nHow to asynchronous use the ApiController ?\n\nCould you point me out in the right direction?\n\npublic class ReportCheckController : ApiController \n{\n private ReportProcessStatusesBLL checkReportsBLL = new ReportProcessStatusesBLL();\n public void Get()\n {\n if (!checkReportsBLL.Check())\n helpers.BusinessLayer.CreateResponseApiMessage(checkReportsBLL.Errors);\n }\n}" ]
[ "c#", "asp.net-mvc", "asp.net-mvc-5", "async-await" ]
[ "undefined reference to 'do_varargs' with gnat", "After the compilation, when I try to build my DLL with win32ada 2017 and GNAT 2017, it issues an error :\n\ngnatlink <ali\\file> -o <jnk\\file> -mdll -Wl,base-file,<base\\file> \nwin32-winuser.o:win32-winuser.adb:(.text+0xa62): undefined reference to 'do_varargs' \nwin32-winuser.o:win32-winuser.adb:(.text+0x15be): undefined reference to 'do_varargs' \ncollect2.exe: error: ld returned 1 exit status \ngnatlink: error when calling C:\\GNAT\\2017\\bin\\gcc.exe\n\n\nDo you know why gnatlink issues this error ?\n\nEdit : \n\nfichier pour la compilation situé dans un dossier :\n\n@echo on\n\nset GNAT_PATH=C:\\GNAT\\2017\nset gnatbin=%GNAT_PATH%\\bin\nset winada=%GNAT_PATH%\\lib\\win32ada\n\nset path=%gnatbin%;%path%;\n\nset INTERFACE_DLL=..\n\nset obj=%INTERFACE_DLL%\\obj\n\nset GCCARGS=-c -g -O3 -mfentry -fomit-frame-pointer -gnatf \nset GNATMAKEARGS=-gnatwu -v -gnato -I%winada% \n\ncd %INTERFACE_DLL%\\%obj%\n%gnatbin%\\gnatmake %GNATMAKEARGS% ..\\hello_dll.adb -cargs %GCARGS%\n\n\nLe fichier pour la création de la DLL : \n\ngnatdll -k -d hello_dll.dll obj\\hello_dll.ali\n\n\nJe ne peux pas afficher ici mon fichier pour lequel j'ai produit l'erreur mais j'ai reproduit sur des fichiers plus simples ci-dessous : \nle fichier adb\n\nwith System;\nuse System;\n\nwith Win32;\nwith Win32.Windef;\nwith Interfaces.C.Strings;\nwith Win32.Winuser;\npackage body HELLO_DLL is\n procedure Report is \n Result : Win32.Int := 0;\n H_Wnd : Win32.Windef.Hwnd := Null_Address; \n Lp_Text : Win32.Lpcstr := Win32.To_Pcstr (Interfaces.C.Strings.New_String (\"Hello World\")); \n Lp_Caption : Win32.Lpcstr := Win32.To_Pcstr (Interfaces.C.Strings.New_String (\"Hello World 2\")); \n U_Type : Win32.Uint := 0; \n\n begin\n Result := Win32.Winuser.Messagebox (H_Wnd, Lp_Text, Lp_Caption, U_Type);\n end Report;\nend HELLO_DLL;\n\n\nle fichier ads \n\n with Interfaces.C;\n package HELLO_DLL is\n\n procedure Report; \n end HELLO_DLL;" ]
[ "ada", "gnat" ]
[ "typescript: Infer tuple value at index from usage", "How do you infer a Value of a tuple at a specific from usage index. \n\nclass A<T extends any[]> {\n constructor(public a: T[0]) {\n\n }\n}\n\n// a should be A<[number]>\nlet a = new A(2)\n// but is A<any[]>\n\n\nThis is what I am looking for. Is the above described functionality somehow possible?" ]
[ "typescript", "types", "tuples" ]
[ "Can I use an anonymous type in this situation?", "I have this code\n\n // was before var groupTransactions;\n IEnumerable<IGrouping<TransactionsGroupedByMonthYear, TransactionDto>> groupTransactions = null;\n\nDollarCapPeriod dollarCapPeriod = (DollarCapPeriod)Enum.Parse(typeof(DollarCapPeriod), reward.DollarCapPeriod);\nswitch (dollarCapPeriod)\n{\n case DollarCapPeriod.Monthly:\n groupTransactions = filterdTransactions.GroupBy(x => new { x.TransactionDate.Month, x.TransactionDate.Year });\n break;\n case DollarCapPeriod.Yearly:\n groupTransactions = filterdTransactions.GroupBy(x => new TransactionsGroupedByMonthYear { Month = 0, Year = x.TransactionDate.Year });\n break;\n default:\n break;\n}\n\n\nI want to do something like that but it wants the type initialized. So I am wondering is there away around this or do I have to make some sort of concrete type? If so how do I do it again with groupBy?\n\nSample Data\n\n1/14/2012,5,Gas\n1/15/2012,5,Gas\n1/16/2012,5,Gas\n1/17/2012,5,Gas\n\n\nEdit\n\nCurrently I am trying to do now use a concrete backing but I need to filter by 2 different ways. Sometimes I need only the \"Year\" and some times I need \"Month\" and \"Year\"\n\nI don't know how to do this. They both need to go in the same variable so they need to be the same type." ]
[ "c#" ]
[ "Facebook app requesting Youtube watch history", "We are working on an idea of a FB app which let's us retrieve youtube watch histories of app users.\nI know there's the possibility to retrieve watch histories through youtube's api, but in combination with a FB app I couldn't find examples.\n\nAny input on this is much appreciated, thanks!" ]
[ "facebook-graph-api", "youtube-api" ]
[ "Loading ruby source from a zip archive?", "I have a mod_rails server where disk space, oddly enough, is at a premium. Is there a way for me to compress my application's source, like Python's zipimport?\n\nThere are obvious disadvantages to this, so I should probably just break down and spend a nickel on disk space, but I figured it'd be worth a shot." ]
[ "ruby", "archive", "require", "compression" ]
[ "How to list all items of an object in ionic 3?", "Personal maybe my question is not being too clear, but what I am trying to do is that by clicking on the Feed item in the categories screen, be listed all companies that are related to Feeding on the companies screen.\n\nI'm very confused because as there will be several companies in each category I have no idea how to list them correctly, could someone help me?\n\nThe first image we have my category screen and clicking on the Feed item is to be shown all companies that are related to feed category.\n\n\n\nMy next image is related to the Company page and it is here that will list all companies that are related to Food\n\n\n\nMy items are being stored as an Object within my App.\n\nHere is my home.html\n\n <ion-content id=\"#pageTop\">\n <ion-searchbar (ionInput)=\"getItems($event)\" placeholder=\"Pesquisar\"></ion-searchbar>\n <ion-item *ngFor=\"let item of items\">\n <ion-thumbnail item-left>\n <img [src]=\"item.imagem\">\n </ion-thumbnail>\n <h2>{{ item?.category }}</h2>\n <button ion-button clear item-end color=\"primary\" (click)=\"itemTapped($event, item)\">Abrir</button>\n </ion-item>\n\n <ion-fab right bottom>\n <button ion-fab color=\"secondary\" (click)=\"pageScroller()\"><ion-icon name=\"ios-arrow-up\"></ion-icon></button>\n </ion-fab>\n\n\nAnd inside my home.ts is where objects are stored\n\n initializeItems(){\n this.items = [\n { category: 'Alimentação', imagem: '../../assets/imgs/alimentacao.jpeg'},\n ]\n }\n\n\nAnd it is in this part that I am having doubts, because my intention is to add in the Object an array of type company and to add all the companies there, however it is not possible to place duplicate object.\n\nLike this example\n\n this.items = [\n { category: 'Alimentação', imagem: '../../assets/imgs/alimentacao.jpeg', company:'companyOne', company:'companyTwo'},\n ]\n\n\nAnd my company.html it is like this\n\n <ion-item *ngFor=\"let company of company\">\n <h2>{{ company?.category }}</h2>\n </ion-item>\n\n\nAnd my company.ts it is like this\n\n company: any[];\n constructor(public navCtrl: NavController, public navParams: NavParams) {\n this.company = this.navParams.get('item');\n }" ]
[ "javascript", "angular", "typescript", "ionic-framework" ]
[ "Preventing students from leaving educationClass Teams?", "As the official Microsoft provided PowerShell module for working with Microsoft Teams does not provide a way to create a Team using the educationClass template, we developed our own script to create Teams for situations where the group did not already exist in our MIS system (and was therefore not in SDS).\n\nThis script uses a mix of the MS Graph API and the PowerShell module and up until recently we have not had any problems. However we've now had a report that a student was able to leave one of the Teams we created using this script. We were led to understand that students could not leave class teams, so we reported this to Microsoft support, but were advised that they considered this a \"developer issue\" rather than a bug, so they directed us here.\n\nThe PowerShell code snippet in which we actually create the Team is as follows:\n\n$body = @{\n\"template@odata.bind\"=\"https://graph.microsoft.com/beta/teamsTemplates('educationClass')\"\n \"displayName\"=$teamname\n \"description\"=$teamname\n}\n$bodyjson = ($body | ConvertTo-JSON)\n$result = Invoke-RestMethod -Uri \"https://graph.microsoft.com/beta/teams\" \n -Body $bodyjson -ContentType \"application/json\" \n -Headers @{Authorization = \"Bearer $accesstoken\"} -Method Post\n\n\n(with the last 3 lines being all one line)\n\nWe then add students to the Team using $result = Add-TeamUser -GroupId $groupId -User $userId -Role Member\n\nWe checked the student in question using the MS Graph API but they definitely have primaryRole set to student, so we suspect the issue is with the Team. Is there something we missed out or didn't get right when creating the Team or when adding the students?" ]
[ "powershell", "microsoft-graph-api", "microsoft-teams", "microsoft-graph-teams", "microsoft-graph-edu" ]
[ "C# Sending ENTER to div in WebView using javascript", "I'm trying to create a simple program in C# that writes message in a field at a website and then sends enter. I can type messages without any problem with the method below but sending it doesn't seem to work. I found a way that works in web browser's console but in C# it returns:\n\nSystem.Exception: 'Exception from HRESULT: 0x80020101'\n\n\nMy code is:\n\npublic async void SendEnter() {\n await currentView.InvokeScriptAsync(\"eval\", new[] {\n \"var ev = document.createEvent('KeyboardEvent');\" +\n \"ev.initKeyEvent('keydown', true, true, window, false, false, false, false, 13, 0);\" +\n \"document.getElementById(\\\"box-interface-input\\\").dispatchEvent(ev);\"\n });\n}\n\n\nDoes anyone have any idea why this doesn't work?\n\nPS: I'm not using submit() since it's not a standard form and it doesn't work in browser." ]
[ "javascript", "c#", "webview" ]
[ "How to use Rails 5.2 credentials in another .yml file?", "I'm using the Cloudinary gem to allow a user to upload their avatar. In the docs, they offer a few ways to supply your api_key and api_secret, however I'm unable to get it work correctly with Rails credentials.\n\nI've tried with the cloudinary.yml:\n\n---\ndevelopment:\n cloud_name: test_cloud\n api_key: <%= Rails.application.credentials.cloudinary[:api_key] %>\n api_secret: <%= Rails.application.credentials.cloudinary[:api_secret] %>\n enhance_image_tag: true\n static_file_support: false\nproduction:\n cloud_name: test_cloud\n api_key: <%= Rails.application.credentials.cloudinary[:api_key] %>\n api_secret: <%= Rails.application.credentials.cloudinary[:api_secret] %>\n enhance_image_tag: true\n static_file_support: true\ntest:\n cloud_name: test_cloud\n api_key: <%= Rails.application.credentials.cloudinary[:api_key] %>\n api_secret: <%= Rails.application.credentials.cloudinary[:api_secret] %>\n enhance_image_tag: true\n static_file_support: false\n\n\nAnd I've also tried using a cloudinary.rb initializer:\n\nCloudinary.config do |config|\n config.cloud_name = \"test_cloud\"\n config.api_key = Rails.application.credentials.cloudinary[:api_key]\n config.api_secret = Rails.application.credentials.cloudinary[:api_secret]\n config.enhance_image_tag = true\n config.static_file_support = false\nend\n\n\nWhen I attempt to upload the image, I receive a 500 error CloudinaryException (Must supply api_key). I know that the actual upload itself works because I hard-coded the values into the cloudinary.yml file to test it.\n\nI've also tried using the .fetch function mentioned below, however I receive a key not found: :api_secret (KeyError)\nHow can I use Rails credentials within either of these files?" ]
[ "ruby-on-rails", "ruby-on-rails-5", "cloudinary" ]
[ "How to return an array as a string from a function?", "I want to setup a function to return global variables and objects and then use eval on them on the calling function but I'm struggling to work out how to do this.\nI realise I need to return them as a string and have tried a few things. Now at this:\n//global vars etc for functions\nfunction globals(name){\n \n let returnVal;\n \n switch (name){\n case "scEmailFindReplace":\n returnVal = [\n ["MULTI_LINE_ADDRESS_NAME", contact.sendName],\n ["MULTI_LINE_ADDRESS_FLAT", "Flat "+contact.flatNum+" Glenmore"],\n ["INV_NO", invNum],\n ["INV_DATE", scVars.INV__DATE],\n ["DEM_DATE", scVars.DEM__DATE],\n ["INV_START", scVars.INV_START],\n ["INV_END", scVars.INV_END],\n ["PAY_REF", "Glen "+contact.flatNum],\n ["SC_NET", scVars.DEM_AMOUNT],\n ["SC_GROSS", scVars.DEM_AMOUNT],\n ["TOT_NET", scVars.DEM_AMOUNT],\n ["TOT_GROSS", scVars.DEM_AMOUNT]\n ].toString();\n break;\n default:\n returnVal = "NOT FOUND";\n break;\n }\n \n return returnVal\n}\n\nBut no luck. Still tries to evaluate it before the return." ]
[ "javascript", "google-apps-script" ]
[ "Get all the output from Watson conversation using java", "If I have a IBM bluemix Watson conversation dialog output JSON like:\n\n\"output\": {\n \"text\": {\n \"values\": [\n \"What is your name?\",\n \"Name of the person?\",\n \"Please specify the name of the person.\"\n ],\n \"selection_policy\": \"random\",\n \"append\": true\n }\n}\n\n\nHow can I get all the suggestions from the output response?" ]
[ "java", "ibm-watson", "watson-conversation" ]
[ "Creating a correlation matrix from a data frame in R", "I have a data frame of correlations which looks something like this (although there are ~15,000 rows in my real data)\n\nphen1<-c(\"A\",\"B\",\"C\")\nphen2<-c(\"B\",\"C\",\"A\")\ncors<-c(0.3,0.7,0.8)\n\ndata<-as.data.frame(cbind(phen1, phen2, cors))\n\n phen1 phen2 cors\n1 A B 0.3\n2 B C 0.7\n3 C A 0.8\n\n\n\nThis was created externally and read into R and I want to convert this data frame into a correlation matrix with phen1 and 2 as the labels for rows and columns of this matrix. I have only calculated this for either the lower or upper triangle and I don't have the 1's for the Diagnonal. So I would like the end results to be a full correlation matrix but a first step would probably be to create the lower/upper triangle and then convert to a full matrix I think. I'm unsure how to do either step of this.\n\nAlso, the results may not be in an intuitive order, but I'm not sure if this matters, but ideally I would like a way to do this which uses the labels in phen1 and phen 2 to make sure the matrix has the correct values in the correct place if that makes sense?\n\nEssentially for this, I would want something like this as an end result:\n\n A B C\nA 1 0.3 0.8\nB 0.3 1 0.7\nC 0.8 0.7 1" ]
[ "r", "matrix", "correlation" ]
[ "Cannot even upload file onto temporary folder on web server with Cakephp", "I am trying to upload an image file onto a web server using Cakephp 2.5.1.\n\nI have a table called Upload and a column called picture.\n\nHere is how my View code looks like;\n\n<?php\necho $this->Form->create('Upload', array('type' => 'file'));\necho $this->Form->input('picture', array('type' => 'file'));\necho $this->Form->input('serial_no');\necho $this->Form->end('Submit');\n?>\n\n\nHere is how my controller code looks like;\n\n public function add() \n {\n if ($this->request->is('post')) \n {\n $this->Upload->create();\n if(!empty($this->request->data['Upload']['picture']['name']))\n {\n $file = $this->request->data['Upload']['picture']; \n $ext = substr(strtolower(strrchr($file['name'], '.')), 1); \n $arr_ext = array('jpg', 'jpeg', 'gif', 'png'); \n\n //only process if the extension is valid\n if(in_array($ext, $arr_ext))\n {\n $dest_file = WWW_ROOT . 'files' . DS .'uploads' . DS . 'test.jpg';\n move_uploaded_file($file['tmp_name'], $dest_file);\n\n //prepare the filename for database entry\n $this->data['Upload']['picture'] = $file['name'];\n }\n } \n\n //Save filename into database\n if ($this->Upload->save($this->request->data, true)) {\n //$this->Session->setFlash(__('The upload has been saved.'));\n //return $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The upload could not be saved. Please, try again.'));\n }\n } //if ($this->request->is('post')) \n }\n\n\nI discover that the file cannot even be uploaded onto temporary folder because the if statement if(!empty($this->request->data['Upload']['picture']['name'])) is never entered. Can someone advise what could possibly go wrong? Thank you." ]
[ "php", "cakephp", "file-upload" ]
[ "Tomcat Logging With Slf4j and Log4j", "I've got a web-app deployed to a Tomcat 7 server. My application uses log4j and a file appender. However, not all logging messages are getting written to the file.\n\nOn my classpath, I have:\n\nlog4j-1.2.14.jar\nslf4j-api-1.6.1.jar\nslf4j-log4j12-1.6.1.jar\n\n\nMy log4j.properties file is working fine on my local machine and is deploy properly.\n\nI see application generated error messages being written to catalina.out that are not getting written to my log4j log. The log messages in catalina.out look to be coming from some other logging framework because the output pattern is in a different format than my log4j pattern. The logging that I'm seeing in the catalina.log is like:\n\nNov 4, 2011 11:05:31 AM org.apache.myfaces.shared_impl.util.StateUtils reconstruct\nSEVERE\n\n\nAnd my log4j pattern is like:\n\n2011-11-03 16:42:09,336 [\"http-bio-8080\"-exec-13] ERROR\n\n\nSome logging appears in my log4j file log, but not all of it. From what I've read, slf4j just needs those jars for it to funnel log output. Any ideas?" ]
[ "java", "tomcat", "log4j", "slf4j" ]
[ "Elastic Search update doesn't return any result with node.js", "I have an elastic search connection in my code as below. \n\nconst config = require('../../config/index');\nconst logger = require('winston');\n\nvar elasticsearch = require('elasticsearch');\nvar elasticClient;\n\nvar state = {\n connection: null,\n}\n\nexports.connect = function (done) {\ntry {\n logger.info(\"elasticsearch 000\");\n if (state.connection) return done()\n elasticClient = new elasticsearch.Client({\n host: config.elasticSearch.url,\n log: 'info'\n });\n\n state.connection = elasticClient;\n logger.info(\"elasticsearch connected on url : \", config.elasticSearch.url);\n done()\n\n } catch (e) {\n logger.info(\"elasticsearch connect exception \", e)\n }\n\n}\n\nexports.get = function () {\n return state.connection\n}\n\n\nI'm using this connection in this way...\n\nfunction Update(_id, data, callback) { \n elasticClient.get().update({\n index: indexName,\n type: tablename,\n id: _id,\n retry_on_conflict: 5,\n body: {\n doc: data,\n doc_as_upsert: true\n }\n }, (err, results) => {\n if (err) {\n console.log(\"= = = = [elasticClient Update err]= = = = =\", err);\n }\n return callback(err, results)\n})\n\n\n}\n\nIssue: When I call this update function, It's not returning any data... And I got this error...\n\nerror : StatusCodeError: Request Timeout after 30000ms\n/node_modules/elasticsearch/src/lib/transport.js:397:9\n\n\nNote: For Elastic Search connection, I'm using Amazon Elastic Search service and I'm passing its VPC endpoint. \n\nNode version: 12.14.1\n\nElasticsearch version 6.3\n\nPackage.json : \"elasticsearch\": \"16.6.0\"" ]
[ "node.js", "elasticsearch", "amazon-elasticsearch" ]
[ "MPAndroidChart how to draw y-axis limit line and set view point to bottom", "MPAndroidChart is very awesome library.I am very thankful to.\nBut now, I have 3 problems.\n\nThe version I used is...\n\n compile 'com.github.PhilJay:MPAndroidChart:v2.2.5'\n\n\nAnd my problem is,...\n\nLeft: now -> Right: want to be\n\n\n1.\nHow to draw limit a Y value line on line chart or bar chart?\n\ne.g. I want to draw value y=200 line on Image.\n(e.g. attached image top.shown in red)\n\n2.\nHow to set viewpoint to bottom and get y-axis mint limit to bottom value?\n(e.g. attached image bottom)\nI want to set viewpoint to bottom.\nI tried this code ,But still,there is some padding.\n\n XAxis xAxis = mBarChart.getXAxis();\n xAxis.setAxisMinValue(0);\n\n\nI want to trim this padding.\n\n*Edited \n\nThis works well. Thank you!\n\n mChart.getAxisLeft().setAxisMinValue(0); \n\n\n3.How to remove point of graph on line chart?\n\nA line chart, the bottom image, has lots of marker.\nSo I want to remove these plot point." ]
[ "java", "android", "mpandroidchart" ]
[ "How to configure Spring Data Solr with Repositories for multiple cores", "Is there a detailed and complete explanation for setting up spring data with solr using repositories with multicore support?" ]
[ "spring", "solr", "repository", "spring-data-solr" ]
[ "How to convert python dictionary to upload agent to Dialogflow?", "I'm new to dialogflow, trying to convert python dictionary like\n\ndict = {\"Monday\": \"running\",\"Tuesday\": \"swimming\",\"Wednesday\": \"cycling\"}\n\nto upload agent to Dialogflow. \n\nFrom Dialogflow it said that: The folders should contain JSON files of the intents and entities\n\nHow can I do it?\n\nThank you in advance." ]
[ "python", "json", "dialogflow-es" ]
[ "react-route display blank page", "My problem is react-route display blank page and no error display in console or webpack. I try to delete all Router and replace by App but it show me blank page agian.\n\nThis is my main.js file.\n\r\n\r\nimport React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport {Provider} from 'react-redux'\r\nimport {createStore, combineReducers} from 'redux'\r\nimport { Router, Route, browserHistory, IndexRoute } from 'react-router'\r\n\r\nimport Index from './containers/Index.js'\r\nimport App from './containers/App.js'\r\nimport pollReducer from './reducers/pollReducer.js'\r\n\r\nvar reducers = combineReducers({\r\n poll: pollReducer\r\n})\r\n\r\nvar store = createStore(reducers);\r\n\r\nReactDOM.render(\r\n <Provider store={store}>\r\n <Router>\r\n <Route path=\"/\" component={Index} />\r\n <Route path=\"/question\" component={App} />\r\n </Router>\r\n </Provider>\r\n, document.getElementById('app'))\r\n\r\n\r\n\n\nand this is my App and Index js file\n\n\r\n\r\nimport React from 'react'\r\n\r\nclass App extends React.Component {\r\n render(){\r\n return(\r\n <div>\r\n This is App page\r\n </div>\r\n )\r\n }\r\n}\r\n\r\nexport default App\r\n\r\n\r\n\n\nThis is my Index.js file\n\n\r\n\r\nimport React from 'react'\r\n\r\nclass Index extends React.Component {\r\n render(){\r\n return(\r\n <div>\r\n This is asdasdasda\r\n </div>\r\n )\r\n }\r\n}\r\n\r\nexport default Index\r\n\r\n\r\n\n\nThank you for help." ]
[ "reactjs", "routes", "react-router" ]
[ "T-SQL - Several groupings with computation", "I need assistance on how I can come up with a query wherein the Table 1 and table 2 will be joined to perform calculation. I have 'cursor' in mind but I am having trouble on conceptualizing. Some kickstart will be a huge help.\n\nbasically what I need is something like this:\n\nTable 1:\n\nRep_Date NumID NumValue Score Period\n1/10/2015 1 161 4 Q1\n1/11/2015 1 167 2 Q1\n1/12/2015 1 95 1 Q1\n1/01/2016 1 150 1 Q2\n1/02/2016 1 100 2 Q2\n1/03/2016 1 600 5 Q2\n1/10/2015 38 1 1 Q1\n1/11/2015 38 1 2 Q1\n1/12/2015 38 1 2 Q1\n1/01/2016 38 1 1 Q2\n1/02/2016 38 1 2 Q2\n1/03/2016 38 1 4 Q2\n1/10/2015 113 5 3 Q1\n1/11/2015 113 2 4 Q1\n1/12/2015 113 8 1 Q1\n1/01/2016 113 11 4 Q2\n1/02/2016 113 1 5 Q2\n1/03/2016 113 5 3 Q2\n\n\nTable 2\n\nNumID CalculationType\n1 SUM\n38 SUM\n113 AVG\n\n\nExpected Result:\n\nRep_Date NumID Result Period\n1/10/2015 1 7 Q1\n1/01/2016 1 8 Q2\n1/10/2015 38 5 Q1\n1/01/2016 38 7 Q2\n1/10/2015 113 2.67 Q1\n1/01/2016 113 4 Q2\n\n\n\nJoin by NumID to get the calculation type. \nUse 'Score' field to derive the result. \nGroup by NumID, Period" ]
[ "tsql", "stored-procedures", "cursor" ]
[ "How to assign content trust policy to container registry resource azure powershell", "I have created container registry as below through powershell.\n\n$prop = @{\n Location = \"...\"\n ResourceName = \"Resource1\"\n ResourceType = \"Microsoft.ContainerRegistry/registries\" \n ResourceGroupName = \"ResourceGroup..\" \n Force = $true\n Sku = @{\"Name\"=\"Premium\"}\n }\n $registry = New-AzResource @prop\"\n\n\nIt gets created successfully, but the content trust policy set for this is \"disabled\"\nHow can i make it enabled during creation through powershell" ]
[ "azure", "powershell", "azure-devops", "azure-deployment", "azure-container-registry" ]
[ "Multi-selection behavior at user selection differs from setSelected:animated:", "I have a UITableView that displays contacts from AddressBook. I have the multi-selection editing style enabled. When I present the tableView, it works as intended. The user taps a row and the red checkmark to the left side of the cell fills in. Great. \n\nI save these selections in an array property on the presenting view controller. When I show my table again, I would like for these cells to remain selected (i.e., not blue highlighted, just with the red check mark still filled in). In cellForRowAtIndexPath: I get the object for the cell at that index path, test whether the presenting view controller's array contains that object, and if so [cell setSelected:YES];\n\nIt seems to me that this should result in the same selected appearance as when the user touches a cell (just the red check mark). Instead, the red check does fill in but also the cell highlights blue momentarily and the text turns white permanently, creating the impression that the contact's name has disappeared. I'm happy to post code if it's helpful but this seems like maybe just a quirk of UITableView that someone might be familiar with? \nEDIT: This image shows the kind of checkmarks that I have (and want). I can't piece together though why when I call [cell setSelected:YES]; it behaves differently than it does in response to a touch. What you're looking at here is after I call [cell setSelected:YES];. And it looks almost how I want but the names have disappeeared. And I don't want the cell to highlight when the list appears." ]
[ "objective-c", "ios", "uitableview" ]
[ "online/incremental learning for classifiers", "I understand that in online/incremental learning it is possible that SVM or NN learn incrementally, as the new data becomes available over time. What if instead of new cases, just new features/variables for the existing cases become available over time. Is there any technique that can handle this kind of training for classifiers/predictions?" ]
[ "machine-learning", "neural-network", "classification", "svm", "decision-tree" ]
[ "What is the Property and HasRequired Keyword in asp.net MVC?", "I m working with code first approach with MVC but what is Property and haskeyrequired Keyword used when generating a database.\n\nCode:\n\n public class StudentDBContext : DbContext\n {\n public StudentDBContext() : base(\"StudentDBContext\")\n {\n }\n\n public DbSet<Student> students { get; set; }\n public DbSet<Course> course { get; set; }\n\n protected override void OnModelCreating(DbModelBuilder modelBuilder)\n {\n //course\n modelBuilder.Entity<Course>().HasKey(p => p.CourseId); //Primary Key field in a database\n modelBuilder.Entity<Course>().Property(c => c.CourseId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);\n\n //student\n modelBuilder.Entity<Student>().HasKey(b => b.Id); //Student Id\n //what is property keyword?\n modelBuilder.Entity<Student>().Property(b => b.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);\n\n //what is hasrequired keyword?\n modelBuilder.Entity<Student>().HasRequired(p => p.course).WithMany(b => b.student).HasForeignKey(b => b.CourseId);\n\n base.OnModelCreating(modelBuilder);\n }\n }\n\n\nwhy it is used property and hasrequired keyword meaning in asp.net MVC?" ]
[ "asp.net-mvc", "entity-framework", "foreign-keys" ]
[ "Failed to restart after installed APOC Plugin in Neo4j", "I would like to install the APOC plugin for Neo4j. However once generated jar file and restart, neo4j not able to restart again\n\nFollow Guide\nhttps://github.com/neo4j-contrib/neo4j-apoc-procedures/tree/3.1\n\nError msg:\n\nERROR Failed to start Neo4j: Starting Neo4j failed: Component ' org.neo4j.server.database.LifecycleManagingDatabase@3b6579d6' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component ' org.neo4j.server.database.LifecycleManagingDatabase@3b6579d6' was successfully initialized, but failed to start. Please see attached cause exception.\norg.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server. database.LifecycleManagingDatabase@3b6579d6' was successfully initialized, but failed to sta rt. Please see attached cause exception.\n at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(Serv erStartupErrors.java:68)\n at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:227)\n at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:91)\n at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:68)\n at org.neo4j.server.CommunityEntryPoint.main(CommunityEntryPoint.java:28)\nCaused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.databa se.LifecycleManagingDatabase@3b6579d6' was successfully initialized, but failed to start. Pl ease see attached cause exception.\n at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:4 43)\n at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)\n at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:199)\n ... 3 more\nCaused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.GraphDat abaseFacadeFactory, /root/NEO4J_HOME/data/databases/graph.db\n at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabase FacadeFactory.java:193)\n at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseF acadeFactory.java:124)\n at org.neo4j.server.CommunityNeoServer.lambda$static$0(CommunityNeoServer.java:57)\n at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDataba se.java:89)\n at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:4 33)\n ... 5 more\nCaused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.p roc.Procedures@2200fd80' was successfully initialized, but failed to start. Please see attac hed cause exception.\n at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:4 43)\n at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107)\n at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabase FacadeFactory.java:189)\n ... 9 more\nCaused by: org.neo4j.kernel.api.exceptions.ProcedureException: Unable to register procedure, because the name `apoc.algo.betweenness` is already in use.\n at org.neo4j.kernel.impl.proc.ProcedureRegistry.register(ProcedureRegistry.java:81)\n at org.neo4j.kernel.impl.proc.Procedures.register(Procedures.java:103)\n at org.neo4j.kernel.impl.proc.Procedures.register(Procedures.java:76)\n at org.neo4j.kernel.impl.proc.Procedures.start(Procedures.java:209)\n at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:4 33)\n ... 11 more\n\n\nthe jar file name: apoc-3.1.0.4-SNAPSHOT-al.jar\n\nneo4j version: 3.1.1" ]
[ "plugins", "neo4j", "neo4j-apoc" ]
[ "C++ variadic templates function in variadic macro", "I'm currently working on a project where I need to simplfy an existing system.\nWihtout going into the details the problem is that I get some function pointer (from type: void*) and I need to create a function from it (= create a function with signature). So my approach was to create the following variadic template function:\n\ntemplate <typename ReturnType, typename ... Params>\nReturnType(*GetFunction(void* func, Params ...)) (Params ...)\n{\n return reinterpret_cast<ReturnType(*) (Params ...)> (func);\n}\n\n\nNow I need a way to create the needed functions: \n\n#define DECLARE_PARAMS(...) __VA_ARGS__\n\n#define Define_Function(returnType, fname, Params) returnType Gen_##fname (DECLARE_PARAMS Params)\\\n{\\\n return FUNCTION_DIRECTCALL(returnType, fname, (DECLARE_PARAMS Params));\\\n}\n\n\nand here is the Problem. (I think) the Params don't expand the way they should expand. But I don't know why?\n\nI tested the FUNCTION_DIRECTCALL in the DEFINE_FUNCTION macro with hardcoded values (simple put the defintion into the directcall) and it worked so there shouldn't be an error but I'm open for improvements\n\n#define FUNCTION_DIRECTCALL(returnType, functionName, ...) \\\nGetFunction<returnType>(functionName, DECLARE_PARAMS __VA_ARGS__) ( DECLARE_PARAMS __VA_ARGS__)\n\n\nIf I try to define a function with the macro \n\nDefine_Function(void, ThatFunction, (int a_, int b_)); // void ThatFunction(int a, int b);\n\n\nI get the following error: \"Severity Code Description Project File Line Suppression State Error (active) incomplete type is not allowed [...]\\main.cpp 34\"\n\nSo my question is, what am I doing wrong? Is the problem really related to the Params in the DEFINE_FUNCTION macro or did I miss something?\n\nI worked with macros but I wouldn't call myself an expert in this area. But the way I understand it is that (DECLARE_PARAMS Params) should expand the params to:\n\nint a_, int b_\n\n\nand after the scan I would expect the following code:\n\nvoid Gen_ThatFunction(int a_, int b_)\n{\n return GetFunction<void>(ThatFunction, a_, b_) (a_, b_);\n}\n\n\nTesting the Directcall macro:\nwith the following code I tested the functionality of the directcall macro\n\nTherefore I change the Define_Function macro:\n\n#define Define_Function(returnType, fname, Params) returnType Gen_##fname (DECLARE_PARAMS Params) \\\n{\\\n int a = 2, b = 3;\\\n return FUNCTION_DIRECTCALL(void, ThatFunction, (a, b) );\\\n}\n\n\nThe definition of ThatFunction:\n\nvoid ThatFunction(int a, int b)\n{\n std::cout << a << \" * \" << b << \" = \" << b * a << std::endl;\n}\n\n\noutput: \"2 * 3 = 6\"\n\nAll code compiled in VC++ 2015" ]
[ "c++", "variadic-templates", "variadic-macros" ]
[ "Why does my CSS work with one id, but not with another IDENTICAL id?", "When I do something like:\n\n\r\n\r\n#caterpillar {\r\n color: white;\r\n}\r\n<div id=\"caterpillar\">\r\n sample text\r\n</div>\r\n\r\n\r\n\n\nI get my white font and am happy. BUT for some reason, JUST CHANGING THE NAME OF THE DIV TAG:\n\n\r\n\r\n#centipede {\r\n color: white;\r\n}\r\n<div id=\"centipede\">\r\n sample text\r\n</div>\r\n\r\n\r\n\n\nIn the same HTML template with the same CSS does NOT work and inspecting in chrome shows that it defaults to:\n\n\nelement.style {\n}\n\n \n user agent stylesheet\n\ndiv {\n display: block;\n}\n\n\n\nand I do not get the desired effect. What could be happening? Why does it like one id name, but not the other ?" ]
[ "html", "css" ]
[ "SynchronizationLockException (Object synchronization method was called from an unsynchronized block of code.) when releasing a lock", "When releasing a lock I am receiving a SynchronizationLockException.\n\nOf course, first thing I did was the Google search on the problem. I found two main erroneous patterns:\n\n\nReleasing a Mutex on the different thread than it was created.\nUsing a value type as a synchronization object for a Monitor. Or\nmodifying the synchronization object between entring and exiting the\nMonitor.\n\n\nThe problem is that none of these patterns fits my case.\n\nI have a very simple synchronization scenario:\n\npublic class MyClass : IDisposable\n{\n private readonly object _myLock = new object();\n\n internal void Func1()\n {\n lock (_myLock)\n {\n //Some code here\n }\n }\n\n internal void Func2()\n {\n lock (_myLock)\n {\n //Some code here\n }\n }\n\n public void Dispose()\n {\n lock (_myLock)\n {\n //Some code here\n } // Here is where I get an exception\n }\n}\n\n\nEventually I receive SynchronizationLockException on the line of Dispose() where the lock is released.\n\nMy question is not \"What is the problem with my code\" or \"What am I doing wrong\". Basically, I would like to know how (and under which circumstances) this could possibly happen that .NET implementation of lock throws this exception. \n\nThanks." ]
[ "c#", "multithreading", "synchronization", "locking" ]
[ "JSON.stringify() - nested objects", "What's the proper way to use JSON.stringify() on nested objects? I'm getting a bad request from a api call that expects a JSON string:\n\ntestData = {\"credentials\": {\"user\": \"test@email.com\", \"password\": \"testpassword\", \"country\": \"us\"}};\n\n\nwhen I view the postDasta:\n\n\"{\"credentials\": {\"user\": \"test@email.com\", \"password\": \"testpassword\", \"country\": \"us\"}}\";\n\n$.ajax({\n ...\n data: JSON.stringify(testData),\n ...\n});\n\n\nThanks,\n\nJ" ]
[ "ajax", "json", "object", "stringify" ]
[ "search with find command until first match", "I just need to search for a specific directory that can be anywhere is there a way to run this command until the first match? Thanx!\nIm now ussing \n\nfind / -noleaf -name 'experiment' -type d | wc -l" ]
[ "bash", "command", "find" ]
[ "Error when deleting item from tableview in swift", "I am trying to implement a delete functionality in my app allowing users to delete information stored in core data and presented through a table view.\n\nhere is my code:\n\n func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {\n if (editingStyle == .Delete){\n\n\n tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic) //error on this line\n\n }\n}\n\n\nthe error is as follows:\n\nAssertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableView.m:1582\nTerminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (6) must be equal to the number of rows contained in that section before the update (6), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'\n\n\n\nWhat am I doing wrong? How do I fix this error?" ]
[ "core-data", "swift", "ios8", "tableview" ]
[ "Writing only whitelisted items to DynamoDB", "I have a set (~1.000.000) of devices that can send messages, each device has an ID and can send multiple messages. A subset (~10.000) of the devices should be able to use my service and there IDs are put in a whitelist (DynamoDB table).\nGiven a constant stream of messages I would like only the once in the whitelist to be persisted in a DynamoDB table.\nThe things I have been looking at are as follows:\n\nNaive way is to do the filtering in code when the lambda writes data to DynamoDB, not sure how well this will scale given that I first need to query the whitelist table to check which messages I then can write.\nWhat I would like to do use use DynamoDB conditional writes (or if there is some other smart functionality) to specify "write this item to the table only if it exist in the whitelist" and let the DynamoDB engine take care of the filtering.\n\nMy question is if there is some smart way to do this in DynamoDB?" ]
[ "amazon-web-services", "nosql", "amazon-dynamodb" ]
[ "Login to remote server with Php and Curl not working", "trying to login to a remote server using curl and php but getting errors about cookies not enabled. Here's my code:\n\nerror_reporting(E_ALL);\nini_set(\"display_errors\", 1);\n$url = 'http://uk.songselect.com/account/login/';\n$username = '*****';\n$password = '******';\n$ch = curl_init($url); \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\ncurl_setopt($ch, CURLOPT_COOKIESESSION, true);\ncurl_setopt($ch, CURLOPT_COOKIEJAR, 'tmp/cookie.txt');\ncurl_setopt($ch, CURLOPT_COOKIEFILE, 'tmp/cookie.txt');\n\n\n//run the process and fetch the document\n$doc = curl_exec($ch);\n\n\n\n// extract __RequestVerificationToken input field\npreg_match('#<input name=\"__RequestVerificationToken\" type=\"hidden\" value=\"(.*?)\"#is', $doc, $match);\n\n $token = $match[1];\n\n\n\n// ENABLE HTTP POST\ncurl_setopt ($ch, CURLOPT_POST, 1);\n\n// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD\ncurl_setopt ($ch, CURLOPT_POSTFIELDS, '__RequestVerificationToken='.$token.'&UserName='.$username.'&Password='.$password.'');\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\n\n//run the process and fetch the document\n$doc = curl_exec($ch);\necho $doc;\n\n//terminate curl process\ncurl_close($ch);\n\n//print output\n\n\necho $token;\n\n\nThis is the error I'm getting: 'You need to have cookies enabled in your browser to use the SongSelect site as an authenticated user.'\n\nAny ideas why this is happening?\n\nthanks!" ]
[ "php", "cookies", "curl" ]
[ "MySQL rating database structure", "I'm trying to create a database that stores the students grade for each homework assignment I want to be able to store the grade and how many times that student got a certin grade for example a student got an A+ 30 times, for each student, as well as how many grades a student got. And how much a grade is worth in points for example an A is worth 4.3. \n\nSo I was wondering what is the best way to build my MySQL database what do I need to add and what do I need to drop and how can I store numbers like 4.3 for example.\n\nMy database so far\n\nCREATE TABLE grades (\nid INT UNSIGNED NOT NULL AUTO_INCREMENT,\ngrade INT UNSIGNED NOT NULL,\nstudent_work_id INT UNSIGNED NOT NULL,\nstudent_id INT UNSIGNED NOT NULL,\ndate_created DATETIME NOT NULL,\nPRIMARY KEY (id)\n);\n\nCREATE TABLE work (\nid INT UNSIGNED NOT NULL AUTO_INCREMENT,\nstudent_id INT UNSIGNED NOT NULL,\ntitle TEXT NOT NULL,\ncontent LONGTEXT NOT NULL,\nPRIMARY KEY (id)\n);\n\nCREATE TABLE IF NOT EXISTS student (\nid int(8) NOT NULL auto_increment,\nstudent varchar(20) NOT NULL,\nPRIMARY KEY (`id`)\n)\n\n\nexample of output.\n\nstudent | grade | count\n\n 1 A 10\n 1 C 2\n 1 F 4\n 2 B 20\n 2 B- 3\n 2 C+ 10\n\n\nstudent | grade | points\n\n 1 A 4.3\n 2 B+ 3.3\n 3 B- 2.7\n 4 D+ 1.3\n\n\nstudent | total grades\n\n 1 90\n 2 80\n 3 100\n 4 1" ]
[ "mysql" ]
[ "Why console.log isn't printing anything in VS code terminal and opening the command prompt?", "I have installed node js on my system but when i am going to vs code and running app.js it is opening command prompt for a second and then closing it.\nSo app.js has only one line of code.\nconsole.log('hello World')\n\ni am going to terminal and typing node app.js , it is not printing anything in the console.\nThis is absolute beginner question but i cant find a fix anywhere why it is happening." ]
[ "javascript", "node.js", "visual-studio-code" ]
[ "Cordova Speech Recognition Hangs in Android on Background Mode", "We are integrating speech to text Voice Bot conversion. To convert user speech input to text, we are using speech recognition Cordova plugin https://github.com/macdonst/SpeechRecognitionPlugin. It is working as expected when user start speaking on clicking 'mic' button, speech to text conversion is displayed in the UI.\n\nIssue happen If I am in Voice Bot Screen and minimize the app, so app will be moved to background right. If again moved to foreground and if we click 'mic' button. It hangs and we are not getting any speech output. Need to kill the app and launch again in order to use Speech to text conversion.\n\nNote: This issue is happening only on Android Device. IOS is working Fine.Also We are using Angular 6, Cordova 7" ]
[ "angular", "cordova", "ionic-framework" ]
[ "NavigationLink inside List applies to HStack instead of each element", "I'm trying to follow Composing Complex Interfaces guide on SwiftUI and having issues getting NavigationLink to work properly on iOS 13 beta 3 and now beta 4.\n\nIf you just download the project files and try running it, click on any of the Lake images - nothing will happen. However if you click on the header \"Lakes\" it'll start opening every single lake one after another which is not a behaviour anyone would expect.\n\nSeems like NavigationLink is broken in \"complex\" interfaces. Is there a workaround?\n\nI've tried making it less complex and removing HStack of List helps to get NavigationLinks somewhat to work but then I can't build the full interface like in example.\n\nRelevant parts of the code:\n\n var body: some View {\n NavigationView {\n List {\n FeaturedLandmarks(landmarks: featured)\n .scaledToFill()\n .frame(height: 200)\n .clipped()\n .listRowInsets(EdgeInsets())\n\n ForEach(categories.keys.sorted(), id: \\.self) { key in\n CategoryRow(categoryName: key, items: self.categories[key]!)\n }\n .listRowInsets(EdgeInsets())\n\n NavigationLink(destination: LandmarkList()) {\n Text(\"See All\")\n }\n }\n .navigationBarTitle(Text(\"Featured\"))\n .navigationBarItems(trailing: profileButton)\n .sheet(isPresented: $showingProfile) {\n ProfileHost()\n }\n }\n }\n\n\nstruct CategoryRow: View {\n var categoryName: String\n var items: [Landmark]\n\n var body: some View {\n VStack(alignment: .leading) {\n Text(self.categoryName)\n .font(.headline)\n .padding(.leading, 15)\n .padding(.top, 5)\n\n ScrollView(.horizontal, showsIndicators: false) {\n HStack(alignment: .top, spacing: 0) {\n ForEach(self.items, id: \\.name) { landmark in\n NavigationLink(\n destination: LandmarkDetail(\n landmark: landmark\n )\n ) {\n CategoryItem(landmark: landmark)\n }\n }\n }\n }\n .frame(height: 185)\n }\n }\n}\n\nstruct CategoryItem: View {\n var landmark: Landmark\n var body: some View {\n VStack(alignment: .leading) {\n landmark\n .image(forSize: 155)\n .renderingMode(.original)\n .cornerRadius(5)\n Text(landmark.name)\n .foregroundColor(.primary)\n .font(.caption)\n }\n .padding(.leading, 15)\n }\n}" ]
[ "ios", "swift", "swiftui" ]
[ "Slow memory allocation in OSX", "I'm trying to trace down a memory allocation problem I have in OSX.\nIf I compile and run the following code normally, it will run pretty fast.\n\n#include <sys/mman.h>\n#define SIZE 8 * 1024 * 1024\n\nint main(int argc, char const *argv[]) {\n for (int i = 0; i < 50000; ++i) {\n mmap(0, SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);\n }\n return 0;\n}\n\n\nHowever, if I compile the same code but linking to some library (i.e.: clang -o test test.c -lpcre) it will randomly either run fast (30ms) or really slow (18 seconds).\n\nNotice that I'm not even using the library, just linking. I also noticed that this seems not to happen with any library.\n\nI'm running OSX 10.10.3. Any ideas?" ]
[ "c", "macos", "mmap" ]
[ "MongoDB error: DBClientCursor::init call() failed", "After updating my mongo client to 2.0.2 the error has changed significantly.\n \n New issue opened here: MongoDB connect error\n\n\nwhen I try to connect to my mongo server, running on a Vagrant VM, CentOS 6, i get this magical error shown here: http://pastium.org/view/7efba4e90f0ba228ccad377204bb9f17.\n\nVagrant forwards the standard mongo part to 37017." ]
[ "mongodb", "vagrant" ]
[ "Is it possible to load a XSL stylesheet from a remote server in ASP classic", "I do not have disk access on the server so I need to load a XSL stylesheet from a remote location. \n\nInstead of this...\n\nset xsl = Server.CreateObject(\"MSXML2.DOMDocument\")\nxsl.async = false\nxsl.load(Server.MapPath(\"xsl.xsl\"))\n\n\nIs something like this possible to load a XSL stylesheet?\n\nxsl.Open \"get\", \"http://www.example.com/xsl.xsl\" , False\nxsl.Send\n\n\nIf above is not possible can the stylesheet be put internally in the ASP file. If so, how is that accomplished?\n\nUPDATE - Full code\n\nDim xml, xsl, url, url2\n\nurl = \"https://www.example.xml\"\nurl2 = \"http://www.example.com/xsl/xsl.xsl\"\nSet xml = Server.CreateObject(\"Microsoft.XMLHTTP\")\nxml.Open \"get\", url, False\nxml.Send\nResponse.ContentType = \"text/xml\"\n\nset xsl = Server.CreateObject(\"MSXML2.DOMDocument\")\nxsl.async = false\n\nxsl.load(Server.MapPath(\"xsl.xsl\"))\n\n'xsl.Open \"get\", url2, False\n'xsl.Send\n\nResponse.AddHeader \"Content-Type\", \"text/xml;charset=UTF-8\"\nResponse.CodePage = 65001\nResponse.CharSet = \"UTF-8\"\nResponse.Write xml.responseXML.transformNode(xsl)" ]
[ "xml", "xslt", "asp-classic" ]
[ "Why do I get the wrong id somewhere, somehow?", "okay so, this is my source code.\n\nvar newRealID = <? print($_SESSION[\"mySteamID\"]) ?>;\nalert(\"MY ID = \" + <? print($_SESSION[\"mySteamID\"]) ?>);\n\n\nand when I inspect the site or view the source code I get the following code\n\nvar newRealID = 76561198061310076;\nalert(76561198061310076);\n\nWhich is the correct output, however, the alert box I get visually in my chrome is: \n\nMY ID = 76561198061310080\n\nI have absolutely no idea and i've been stuck here for ages.." ]
[ "javascript", "php", "jquery", "html" ]
[ "PostgreSQL group by column with aggregate", "I need to group by id and select the task with min/max seq as start and end\n id | task | seq \n----+------+-----\n 1 | aaa | 1 \n 1 | bbb | 2\n 1 | ccc | 3\n\nSELECT\n id,\n CASE WHEN seq = MIN(seq) THEN task AS start,\n CASE WHEN seq = MAX(seq) THEN task AS end\nFROM table\nGROUP BY id;\n\nBut this results in\nERROR: column "seq" must appear in the GROUP BY clause or be used in an aggregate function\n\nBut I do not want group by seq" ]
[ "sql", "postgresql" ]
[ "Create a countdown dialog menu box for a linux terminal?", "How do I make a dialog widget for the Linux Console (not X, but the \"terminal\" console) that would show a countdown in seconds next to a widget that might be a menu list or a textbox?\n\nIdeally this might be a standalone program, like dialog, that is supplied parameters to control its behaviour. \n\nWhen the countdown reaches 0, the selected value of the widget is returned. There could be a default value in case no human is present (or the human prefers the default). The boot loaders like grub and lilo can do this already, pretty much. I looked through the dialog man page and couldn't find this feature set. \n\nTried so far:\n\ndialog --timeout 30 --menu 'Menu Title' 20 60 3 'A' 'Choose A' 'B' 'Choose B' 'C' 'Choose C' is close, but it doesn't show the 30 second timer ticking down.\n\ndialog --pause 'Hurry!' 10 60 30 -- shows a message and ok/cancel with the timer running but is only interstitial and not for user input.\n\nIt is possible to combine multiple lines like this:\n\ndialog --menu 'Menu Title' 10 60 3 'A' 'Choose A' 'B' 'Choose B' 'C' 'Choose C' --pause 'Hurry up' 10 60 30 \n\n\nbut that shows the widgets sequentially instead of combined on one page. Here, after the menu is answered with no timer, you get a message with a timer." ]
[ "linux", "console-application" ]
[ "Creating a cab. installer with compact framework intergrated", "i'm trying to make an installer for an app i developed for windows ce.The problem is,if i dont deploy it via visual studio and create an installer and run it inside CE,i get \"framework not installed error\".Is there a way to integrate the framework components to my installer?\n\nRegards.\n\nEdit:i managed to get 2 seperate cab files, one for my app and one for the framework,now,is there a way to merge these two cab files??" ]
[ "c#", "windows-mobile", "compact-framework", "cab" ]
[ "Command-line tool to group textual data according to a group key", "I'd like to find a text-processing utility that would group all the values of an attribute for same primary key. Environment is Linux.\n\nConsider a text file which consist \"records\", each record being a line in the file. Those records are space-separated sequence of numerical values, one of them being the primary key value, and others being either an additional property of a primary key or attributes computed for this primary key. Example:\n\n\n pkey pkey-prop1 pkey-prop2 attr1 attr2 attr3 attr4\n 100 200 400 0.1 0.2 0.3 0.4\n 100 200 400 0.2 0.7 0.4 0.5\n 100 200 400 0.3 0.4 0.5 0.6\n 101 200 401 0.7 0.8 0.9 1.0\n 101 200 401 0.8 0.9 1.0 1.1\n 101 200 401 0.9 1.7 1.1 1.2\n\n\nBy specifying which column plays role of pkey, property and attribute, I'd like to obtain the grouping of a certain attribute from all the records that belong to the same primary key. Example, for pkey=$1, property=$2 $3, attribute=$5, the result would be:\n\n\n 100 200 400 0.2 0.7 0.4\n 101 200 401 0.8 0.9 1.7\n\n\nThat is, from all lines with pkey=100 attributes are grouped into a single line, from all lines with pkey=101 they are also grouped into another line.\n\nI'm not expecting to have an exact tool, but I'd be very happy to have a tool that does at least grouping." ]
[ "linux", "text", "command-line", "grouping" ]
[ "Multi-threading with SQL - what table hints to use for Select?", "I have a C# app that is multi-threaded. The application's purpose is to find an available proxy server stored in a SQL server table to connect to. \n\nThe table contains 200 proxies. The maximum concurrent proxy connections allowed is 5.\n\nThe table has the following columns:\n\n(ProxyId int, IpAddress varchar, IsSocks bit, ConnectStatus tinyint, LastConnected datetime)\n\nProxyId is a identity column, ConnectStatus has 3 values\n\n\n0: available (updated by C# app)\n1: being connected to (updated inside the sp below)\n2: connected (updated by C# app)\n\n\nI have the following stored procedure defined which will be called from the C# app:\n\nCreate Proc GetNextAvailableProxy\n\nAS\n\nDeclare @proxyId int, @ipAddress varchar(20), @isSocks bit\n\nif (Select Count(*) From Proxies Where ConnectStatus > 0) < 5 Begin\n\n Select Top 1 @proxyId = Id, @ipAddress= IpAddress, @isSocks = IsSocks \n From Proxies with (updlock, readpast) \n Where ConnectStatus = 0\n Order By IsNull(LastConnected, '1970-01-01')\n\n Update Proxies Set ConnectStatus = 1\n Where Id = @proxyId\n\n Select @proxyId ProxyId, @ipAddress IpAddress, @isSocks IsSocks;\n\n return;\nEnd\n\nSelect Null ProxyId, Null IpAddress, Null IsSocks\n\nGO\n\n\nThe above sp gets the next available proxy, and if there are 5 proxies being connected to or connected, the C# app receives Null for proxyId and wait for 2 seconds before attempting again.\n\nThe C# app will set the ConnectStatus = 2 when the proxy connection is established successfully, and ConnectStatus = 0 once the work is done.\n\nMy question: is my sp written correctly with the right choice of table hint? I don't know what table hint I should place on the Select Count(*) statement." ]
[ "sql-server", "multithreading" ]
[ "General swap method for primitive types", "I've searched around but nothing useful for me founded.\n\nWhat is the best way to write a swap method to exchange two primitive values in ObjectiveC?\n\nYou know the primitive types have different sizes, so if we pass them through something like void *, then how can we know about their size? (maybe one extra parameter for their size?)\n\nin C#, it could be something like this :\n\nvoid Swap<T>(ref T a, ref T b)\n{\n T tmp = a;\n a = b;\n b = tmp;\n}\n\n\nAn idea could be creating a temp memory block with the same size of input types, then copying them as memory blocks with a method like memcpy or something.\n\nBut I prefer something more natural in ObjectiveC, if there is a better one." ]
[ "c#", "objective-c" ]
[ "Eureka's self-preservation mode never recovers", "I'm currently facing an issue where Eureka never clears out service instances that have become stale because a VM went down unexpectedly. Understandably, Eureka's self-preservation mode kicked in because there was a large drop (below the threshold) in service renewals/heartbeat requests. However, 15+ hours later the dead instances are still registered in Eureka. This is a major problem as service requests continue to be directed to the dead instances only to return errors.\n\nMy hope was that the threshold is continuously adjusted and after some period of time, Eureka's threshold would be at a new norm level and self-preservation mode would be reset. We are using Eureka in mirrored setup and our configurations are not very complex.\n\nOur setup:\n\nEureka via spring-boot-starter-parent 1.2.5.RELEASE\n\neureka:\n dashboard:\n path: services\n enabled: false\n instance:\n hostname: localhost\n leaseRenewalIntervalInSeconds: 3\n metadataMap:\n managementPath: /admin\n instanceId: discoveryPrimary\n client:\n registerWithEureka: false\n fetchRegistry: false\n serviceUrl:\n defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/\n server:\n waitTimeInMsWhenSyncEmpty: 0\n\n\nIs it possible to adjust Eureka configurations to reset the self-preservation mode (where it stops clearing instances) and allow it to clear service registries if the services are dead for 5+ minutes?" ]
[ "spring-cloud", "netflix-eureka" ]
[ "AWS Elastic Beanstalk REST API - Auth params?", "I've just started working with the AWS Java SDK and need to deploy/update an elastic beanstalk application from my application. Currently, I have only found documentation for a REST api that allows the creation of an application version. As with the rest of Amazon's REST api, authentication is needed with a menagerie of params. The docs on ELB don't have specifics on authentication, whereas the docs for S3/EC2 have plenty of explanation.\n\nI am specifically asking about the \"Signature Version\" parameter? Does anybody have an idea of what that would be for the ELB REST api? Could anybody that has successfully worked with the ELB API point in the right direction for authentication? Thanks in advance!" ]
[ "api", "amazon-web-services", "amazon-elastic-beanstalk" ]
[ "Image won't show up when using JAR file", "So I'm using an image for the chess pieces in this basic chess game I'm making.\nWhen I run the program in Eclipse, it works perfectly fine as expected. But when I use Eclipse to export and then run that program, it gives the error java.imageio.IIOException: Can't read input file!\nThe image is stored in the source folder in a package names images.\nI load the image using\nBufferedImage image = null;\n\ntry {\n image = ImageIO.read(new File("src/images/Chess_Pieces.png"));\n} catch (IOException e) {\n System.out.println(e);\n}\n\nI've tried locating the image to many different places and I've tried different ways of loading the image, none of them work and I have made sure that the image actually appears correctly in the exported JAR file." ]
[ "java" ]
[ "SSRS CountRows of a specific Field containing a specific Value", "I am building an SSRS report. I have a DataSet that contains several Fields, one of which is Doc_Type. Doc_Type can contain several values, one of which is 'Shipment'.\n\nIn my report, I want to count the number of Doc_Types that are equal to 'Shipment'. This is what I am using, and it is not working:\n\n=CountRows(Fields!Doc_Type.Value = \"Shipments\")\n\n\nThe error I get is: \"The Value expression for the textrun 'Doc_Type.Paragraphs[0].TextRuns[0]' has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset." ]
[ "sql", "visual-studio", "reporting-services" ]
[ "Update database model in hibernate", "I have a simple MySQL database with some valid data that I mapped to a java class using hibernate framework.\n\nNow I change some database table fields in MySQL and want to update my model (e.g. java classes).\n\nI don't want to remap my database because I've done some changes in model classes that need them.\n\nIs there any way to update the model without losing any data?\n\nI used Netbeans 8.0 and Hibernate 4.x . \n\nIs there a wizard to do this like when updating model in entity framework (Visual Studio) for Netbeans?\n\nThanks." ]
[ "java", "mysql", "hibernate" ]
[ "Cannot access xml file from a different domain", "I am making a page where it needs to access information from an XML file.\n\nThe XML file \"data.xml\" is in a directory \"news\" in public_html in cpanel.\n\nAnd the page which will access it is in a sub-domain in public_html.\n\nThough i have given all the rights to read, write and execute the \"data.xml\" it still gives me the following error\n\nXMLHttpRequest cannot load http://website.in/news/data.xml. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://m.website.in' is therefore not allowed access.\n\n\nafter adding Header set Access-Control-Allow-Origin \"*\" to .htaccess file in directory news it still shows \n\nXMLHttpRequest cannot load http://springfest.in/news/data2.xml. Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers.\n\n\nHelp me please." ]
[ "xml", "cors" ]
[ "Pass a __device__ lambda as argument to a __global__ function", "Defining __device__ lambdas is quite useful.\n\nI wanted to do the same thing as the code below, but with a lambda defined in different files from the kernel that will use it.\n\n// Sample code that works\ntemplate<typename Func>\n__global__ void kernel(Func f){\n f(threadIdx.x);\n}\n\nint main(){\n auto f = [] __device__ (int i){ printf(\"Thread n°%i\\n\",i); };\n kernel<<<1,16>>>(f);\n}\n\n\nI tried this (not working) implementation.\n\nmain.cu\n\n#include \"kernelFile.h\"\n\nint main(){\n auto f = [] __device__ (int i){ printf(\"Thread n°%i\\n\",i); };\n kernelCaller(f);\n}\n\n\nkernelFile.cu\n\ntemplate<typename Func>\n__global__ void kernel(Func f){\n f(threadIdx.x);\n}\n\ntemplate<typename Func>\n__host__ void kernelCaller(Func f){\n kernelCaller(f);\n}\n\n\nBut the compiler complains because kernelCaller is never instantiated. I don't know if it's possible to instantiate it or not, or if what I'm trying to do should be implemented differently. Any hint on what I should do?" ]
[ "c++", "lambda", "cuda" ]
[ "Why doesn't rsync work when connecting to NCBI's FTP server home page?", "I'm currently trying to update some code at work. I previously created a script with an up to date version of Python that logs a users path choices on NCBI's FTP webiste (ftp://ftp.ncbi.nlm.nih.gov/). The log was used to update my file system with updated files (NCBI updates their files weekly I believe). I basically recreated the wheel. I want to use rsync now, but I can't seem to get what I want...\n\nrsync -vah --include \"\\*/\" --exclude \"\\*\" rsync://ftp.ncbi.nlm.nih.gov/\n\n\nThe above script should go to NCBI's website and begin downloading directories. Instead it prints to the shell a list of folders in the NCBI home directory and then terminates without copying anything. \n\nHere is what the output looks like:\n\n**Warning Notice!**\n\n**You are accessing a U.S. Government information system which includes this\ncomputer, network, and all attached devices. This system is for\nGovernment-authorized use only. Unauthorized use of this system may result in\ndisciplinary action and civil and criminal penalties. System users have no\nexpectation of privacy regarding any communications or data processed by this\nsystem. At any time, the government may monitor, record, or seize any\ncommunication or data transiting or stored on this information system.**\n\n**-------------------------------------------------------------------------------**\n\n**Welcome to the NCBI rsync server.**\n\n - 1000genomes\n - bigwig\n - bioproject\n - biosample\n - blast\n - cgap\n - cn3d\n - dbgap\n - entrez\n - epigenomics\n - fa2htgs\n - genbank\n - gene\n - genomes\n - hapmap\n - mmdb\n - ncbi-asn1\n - pathogen\n - pubchem\n - pubmed\n - pub\n - refseq\n - repository\n - SampleData\n - sequin\n - sky-cgh\n - snp\n - sra\n - tech-reports\n - toolbox\n - tpa\n - tracedb\n - variation \n\n[user@host ~/bin $]\n\n\nWhenever I use \n\nrsync://ftp.ncbi.nlm.nih.gov/destination\n\n\n(basically if I include any directory inside of NCBI's FTP homepage) everything seems to work fine.\n\nWhat should I do here? What is the problem/solution?" ]
[ "ftp", "rsync", "bioinformatics", "ncbi" ]
[ "CSS - Cursor Transition", "Is it possible to animate with a CSS transition the status of the cursor?\n\nI've tried with this code but it is not working.\n\n\r\n\r\n.test {\r\n cursor: default;\r\n width: 100px;\r\n height: 100px;\r\n background: red;\r\n}\r\n\r\n.test:hover {\r\n cursor: pointer;\r\n -moz-transition: cursor 500ms ease-in-out;\r\n -o-transition: cursor 500ms ease-in-out;\r\n -webkit-transition: cursor 500ms ease-in-out;\r\n transition: cursor 500ms ease-in-out;\r\n}\r\n<div class=\"test\"></div>" ]
[ "html", "css" ]
[ "How to convert a TypeScript class instance with getter/setter to JSON to store in MySQL database", "I have the following TypeScript class that contains a getter / setter:\n\nexport class KitSection {\n\n uid: string;\n order: number;\n\n set layout(layout: KitLayout) {\n this._layout = new KitLayout(layout);\n }\n\n get layout() {\n return this._layout;\n }\n\n private _layout: KitLayout;\n\n constructor(init?: Partial<KitSection>) {\n Object.assign(this, init);\n }\n\n}\n\n// I can create an instance like so:\nconst section = new KitSection(data);\n\n\n\nI need to POST this instance to my server as a JSON object to store in a MySQL database column of type: JSON, so I figured I could do the following:\n\nconst jsonSection = JSON.parse(JSON.stringify(section))\n\n\nThis creates a JSON object, but when I inspect in the console, i see my private getter/setter variable instead of the public variable in the object:\n\nconsole.log(jsonSection);\n\n///IN CONSOLE///\n\nuid: \"a\"\norder: 0\n_layout: {_rows: Array(2), columns: 12}\n\n\n\nI don't want to store the private variable _layout in my database, I need to store the public counterpart defined in the getter/setter: layout.\n\nNext, I checked out the answer provided here: https://stackoverflow.com/a/44237286/6480913 where it suggests to add the following method to convert to JSON:\n\npublic toJSON(): string {\n let obj = Object.assign(this);\n let keys = Object.keys(this.constructor.prototype);\n obj.toJSON = undefined;\n return JSON.stringify(obj, keys);\n}\n\n\nHowever, this returns an empty object. Upon inspection, when I console.log() the this.constructor.prototype, I see the all the properties of the object, but each object is kind of greyed out, so when we use Object.keys(), I receive an empty array. Why are these constructor properties greyed out?" ]
[ "javascript", "json", "typescript" ]
[ "rswag rails gem, does not recognize my pattern for create swagger.yml", "example : \nrake rswag:specs:swaggerize PATTERN=\"spec/controllers/api/v1/admin/\\*\"\n\nor: \n\nrake rswag:specs:swaggerize pattern=\"spec/controllers/api/v1/admin/authentications_controller_spec.rb\"\n\nor : \nrake rswag:specs:swaggerize pattern=\"spec/controllers/api/v1/\\**/\\*_spec.rb\"\n\n\n\nby considering the above code, the swagger.YAML file generates empty. so how I must use a pattern?" ]
[ "ruby-on-rails", "rspec", "ruby-on-rails-5", "rspec-rails", "rswag" ]
[ "need help making tabs to be used by jquery tabs plugin", "I am completely new to CSS and can not get around making tabs. We currently have tabs like this However, these tabs are made using a bad looking <table> tag\n\nBelow is the code that produced the image in above link\n\n <table name=\"incomesummarytable\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n <tr>\n <td colspan=\"4\">\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td bgcolor=\"#990000\"><img src=\"/eiv/images/left_curve.gif\" alt=\"Left Curve\" width=\"10\" height=\"20\"></td>\n <td bgcolor=\"#990000\"><div align=\"center\"><font face=\"Verdana\" size=2 color=\"#ffffff\"><b>Summary Reports</b></font></div></td>\n <td align=\"right\" bgcolor=\"#990000\"><img src=\"/eiv/images/right_curve.gif\" alt=\"Right Curve\" width=\"10\" height=\"20\"></td>\n <td> </td>\n <td bgcolor=\"#dddddd\"><img src=\"/eiv/images/left_curve.gif\" alt=\"Left Curve\" width=\"10\" height=\"20\"></td>\n <td bgcolor=\"#dddddd\"><div align=\"center\"><a href=\"javascript:submitData('View Detail Reports');\" style='text-decoration: none;'><font face=\"Verdana\" size=2 color=\"#000000\"><b>Detail Reports</b></font></a></div></td>\n <td align=\"right\" bgcolor=\"#dddddd\"><img src=\"/eiv/images/right_curve.gif\" alt=\"Right Curve\" width=\"10\" height=\"20\"></td>\n <td> </td>\n </tr>\n </table>\n </td>\n\n\nHowever, I am trying to use more elegant method of jquery tabs plugin. This plugin changes div's to tabs. So I am trying to find out how to convert the tabs that I have into div's so that I can use them with the jquery tab plugin.\nI would appreciate some help that would at least get me started on this. \n\nIdeally I would like the html to be as simple as \n\n <div id=\"container-1\" bgcolor=\"#990000\">\n <ul>\n <li ><a href=\"#fragment-1\"><span>Summary</span></a></li>\n <li ><a href=\"#fragment-2\"><span>Detailed</span></a></li>\n </ul>\n <div id=\"fragment-1\">\n <p>Summary Info goes here:</p>\n </div>\n <div id=\"fragment-2\">\n <p>Detailed Info goes here:</p>\n </div> \n </div> \n\n\nBut I cant wrap my head around CSS that would do this." ]
[ "jquery", "css", "tabs" ]
[ "How to avoid double for loops?", "I want to calculate part of 2 matrices (inner, outer) using data from 2 other matrices. They are all the same size. The code below works but it is too slow on big matrices. I used np.fromfunction in another case but was calculating the entire matrix not only a subset. \n\nWhat's the fastest replacement for the double for loops?\n\nF = np.random.rand(100,100)\nS = 10*np.random.rand(100,100) + 1\n\nL,C = F.shape\n\ninner = np.zeros((L,C))\nouter = np.zeros((L,C))\n\nfor l in range(5, L - 5):\n for c in range(5, C - 5):\n inner[l,c] = np.mean(F[l-5 : l+5 , c-5:c])\n outer[l,c] = np.mean(F[l-5 : l+5 , c+5 : c+5+int(S[l,c])])" ]
[ "python-3.x", "numpy", "for-loop" ]
[ "BAD ACCESS on nil Check", "I'm pretty stumped on why this is crashing. It's an NSTimer property that's being released and then checking for nil is leading to a crash. Doesn't make sense.\n\nOriginal:\n\nif (self.adCountdown != nil) {\n if ([self.adCountdown isValid]) {\n [self.adCountdown invalidate];\n self.adCountdown = nil;\n }\n}\n\n\nCrashed on self.adCountdown = nil;\n\nChanged to:\n\nif (self.adCountdown != nil) {\n if ([self.adCountdown isValid]) {\n [self.adCountdown invalidate];\n }\n}\nif (self.adCountdown != nil) {\n self.adCountdown = nil;\n}\n\n\nNow crashes on:\nif (self.adCountdown != nil)\n\nThis is a property built as:\n@property (nonatomic, retain)\nNo ARC.\n\nThis is a rare crash and only occasionally happens. I've never known an nil check to crash.\n\nEDIT: ADDED FULL BACKTRACE\n\n\n\n\nJames" ]
[ "ios", "objective-c", "crash" ]
[ "how put a hyperlink on a new sheet excel VBA?", "I have create this code for : when you enter the name and tel of the cliente a new sheet was create with a page type and he create a link between the name page 1 and the sheet. but all the time he don't know the reference.\nSub dupliquer2()\n\nDim numFeuilClient As String\nDim telFeuilClient As String\n\nWorksheets(2).Visible = True\nWorksheets(3).Visible = True\n\nnumFeuilClient = InputBox("Nom Client")\ntelFeuilClient = InputBox("Numéro de Téléphone")\n\n If numFeuilClient = "" Then\n Worksheets(2).Visible = False\n Worksheets(3).Visible = False\n Exit Sub\n End If\n \nSheets("FeuilClient").Range("_suprclient").ClearContents\nSheets("FeuilClient").Copy after:=Sheets(Sheets.Count)\n\nActiveSheet.Name = numFeuilClient\n\n\n Hyperlinks.Add Anchor:=Sheets("FichierClient").Range("C3"), Address:="", SubAddress:= _\n "ActiveSheet!A1", TextToDisplay:="Voir Client"\n\n\nActiveSheet.Range("_nomclient").Value = numFeuilClient\nActiveSheet.Range("_telclient").Value = telFeuilClient\n\nSheets("FichierClient").Range("A3").Value = numFeuilClient\nSheets("FichierClient").Range("B3").Value = telFeuilClient\n \nWith Sheets("FichierClient").Range("A3:B3:C3")\n.Insert xlShiftDown\nEnd With\n\nWorksheets(2).Visible = False\nWorksheets(3).Visible = False\n\n\nEnd Sub" ]
[ "excel", "vba", "hyperlink", "excel-2010", "export-to-excel" ]
[ "Reliable way to get all user directories?", "After much googling, I'm still not finding what I'm looking for. \n\nI simply want to find the names of every user account on my machine. For example, in the C:\\Users\\ directory, there will be directories for every user on the machine. There must be a more elegant way than simply regexing the usernames from the users directory, though.\n\nThese are not the same names that are shown in Win32_UserAccount WMI query. When I execute:\n\nGet-WMIObject -query 'SELECT * from Win32_UserAccount'\n\n\n... I get names such as 'Administrator', 'Default Account', etc. These are not the names I am looking for. I want the names that are shown in C:\\Users\\\n\nWhat is the most programmatic way to get the names of all the users in the c:\\Users folder? \n\nThanks!" ]
[ "windows" ]
[ "Grails - how to return a variable from controller's action to JavaScript?", "I'm trying to return a result from controller's action method to JavaScript function.\n\nI tried two ways of solving this:\n\nfirst:\n\nMethod in a controller:\n\ndef addUser(String name, String id1, String id2) {\n return \"myValue\"\n}\n\n\nJavaScript function:\n\nfunction myFunction(userId1, userId2, username) {\n var id1 = $(userId1).val();\n var id2 = $(userId2).val();\n var name = $(username).val();\n // <g:remoteFunction action=\"addUser\" params=\"{name:name,id1:id1,id2:id2}\" />\n var variable = ${remoteFunction(action:'addUser', params:[name:name,id1:id1,id2:id2])};\n alert(variable)\n}\n\n\nIt only displayed \"object Object\"\n\nsecond:\n\nMethod in a controller:\n\ndef addUser(String name, String id1, String id2) {\n return [value:\"myValue\"]\n}\n\n\nJavaScript function:\n\nfunction myFunction(userId1, userId2, username) {\n var id1 = $(userId1).val();\n var id2 = $(userId2).val();\n var name = $(username).val();\n // <g:remoteFunction action=\"addUser\" params=\"{name:name,id1:id1,id2:id2}\" />\n ${remoteFunction(action:'addUser', params:[name:name,id1:id1,id2:id2])};\n var variable = \"${value}\";\n alert(variable)\n}\n\n\nDoesn't display anything.\n\nI also tried putting my variable into the session which only worked after refreshing the page.\nI ran out of ideas. What am I missing?" ]
[ "javascript", "grails" ]
[ "How to construct a URI with username password for mongo C driver.", "I am using mongo 3.0.8. I have an authenticated user admin with password admin. I am able to connect to the mongo shell as follows. \n\nmongo admin -u amdin -p amdin \n\nHowever, i tried to connect to using the following C code. This gives me an error\n\n\n WARNING: client: Failed to connect to: ipv4 127.0.0.1:27017,\n error: 111, Connection refused\n\n\nchar URI[256];\nsnprintf(URI,256,\"mongodb://admin:admin@127.0.0.1:27017/?authSource=admin\");\nmongoc_client_t *client = mongoc_client_new(URI);" ]
[ "c", "mongodb", "mongo-c-driver" ]
[ "How to Compile: Synergy on mac", "I wanna use Synergy on my MAC and Windows. download synergy.zip file from https://github.com/synergy/synergy \n\nand then I try to compile to Xcode Project\n\nBut I get the following error message\n\nbash-3.2# ./hm.sh conf -g2\nMapping command: conf -> configure\nError: Arg missing: --mac-identity\n\n\nI don't know why I cannot compile Synergy.\n\nQuestions.\n\n\nWhat is --mac-identity?\nHow to typing command to terminal on my MAC?" ]
[ "macos", "mouse", "homebrew" ]
[ "Why is Python's default installer 32 bit?", "If you go to Python's default installer download page and click the nice yellow button as shown below, it will download you the 32 bit installer for the latest version of Python. \n\n\n\nTo get the 64 bit installer, you'd have to click into the link circled in red below and then scroll to the bottom to find the installer, e.g., for windows, it would be Windows x86-64 executable installer\n\n\n\nAre most Python developers are still on 32 bit systems? Otherwise, why doesn't Python make the default installer for 64 bit? It certainly confused me for 30 mins, to install the 32 bit version, uninstall and then finally installing the 64 bit version." ]
[ "python", "64-bit" ]
[ "Install unohelper on virtual env", "What's the command for installing unohelper via pip?\n\nI tried $ pip install unotools, but it doesn't work.\nI have uno and unotools installed." ]
[ "python-2.7", "pip", "virtualenv", "openoffice.org", "uno" ]
[ "Convert results into a dataframe from function", "From this results:\nlibrary(stm)\nlabelTopics(gadarianFit, n = 15)\n\nTopic 1 Top Words:\n Highest Prob: immigr, illeg, legal, border, will, need, worri, work, countri, mexico, life, better, nation, make, worker \n FREX: border, mexico, mexican, need, concern, fine, make, better, worri, nation, deport, worker, will, econom, poor \n Lift: cross, racism, happen, other, continu, concern, deport, mexican, build, fine, econom, border, often, societi, amount \n Score: immigr, border, need, will, mexico, illeg, mexican, worri, concern, legal, nation, fine, worker, better, also \nTopic 2 Top Words:\n Highest Prob: job, illeg, tax, pay, american, take, care, welfar, crime, system, secur, social, health, cost, servic \n FREX: cost, health, servic, welfar, increas, loss, school, healthcar, job, care, medic, crime, social, violenc, educ \n Lift: violenc, expens, opportun, cost, healthcar, loss, increas, gang, servic, medic, health, diseas, terror, school, lose \n Score: job, welfar, crime, cost, tax, care, servic, increas, health, pay, school, loss, medic, healthcar, social \nTopic 3 Top Words:\n Highest Prob: peopl, come, countri, think, get, english, mani, live, citizen, learn, way, becom, speak, work, money \n FREX: english, get, come, mani, back, becom, like, think, new, send, right, way, just, live, peopl \n Lift: anyth, send, still, just, receiv, deserv, back, new, english, mani, get, busi, year, equal, come \n Score: think, peopl, come, get, english, countri, mani, speak, way, send, back, money, becom, learn, live \n\nHow is it possible to keep the results from highest propability into a dataframe with number of columns equal to the number of topic and rows equal to the number of words per topic (n = 15)\nExample of expected output:\ntopic1 topic2 topic3\nimmigr job peopl\nilleg illeg come" ]
[ "r" ]
[ "Will Upgrading to Paypal Pro break current implementation with PayPal Standard", "My client wishes to keep customers within their site when making PayPal payments. I understand they need to upgrade to a PayPal Pro (or Advanced) account to achieve this. However, before I advise them to do this I want to be sure it won't break their existing website between now and when the new code is implemented. Does anyone know if it is \"safe\" to upgrade from Standard to Pro without breaking the current implementation or should I advise they create a new account for the Pro integration.\n\nThanks in advance." ]
[ "paypal" ]
[ "C# Watin - Skipping the iteration whenever browser throws a popup (message from webpage)", "Watin is unable to catch the browser popups with IE 9. Instead I would like to skip it and continue with rest of the program if such popup is thrown. Is it possible to skip in such a fashion?\n\nPopups are JavaScript popups." ]
[ "c#", "watin" ]
[ "TableView not reloading after executeFetchRequest", "When the app starts I send a notification to my ViewController that executes refreshCategories function, the problem is tableView only reloads if I scroll or after a long time (20 secs or more).\n\nHeres is my code:\n\nclass PopularCategoriesTableViewController: UITableViewController {\n\n var categoryList:[Category]!\n\n override func viewDidLoad() {\n super.viewDidLoad()\n\n NSNotificationCenter.defaultCenter().addObserver(self, selector: Selector(\"refreshCategories\"),\n name: Constants.NotificationKeys.shouldReloadCategories, object: nil)\n }\n\n override func didReceiveMemoryWarning() {\n super.didReceiveMemoryWarning()\n // Dispose of any resources that can be recreated.\n }\n\n // MARK: - \n func refreshCategories() {\n categoryList = DataModelUtil.sharedInstance.getRecordsFromEntity(Category.classString()) as! [Category]\n self.tableView.reloadData()\n\n }\n\n // MARK: - Table view data source\n override func tableView(tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {\n return 0.01\n }\n\n override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {\n if categoryList == nil {\n return 0\n }\n\n return categoryList.count\n }\n\n override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {\n let item = categoryList[indexPath.row]\n\n let cell = tableView.dequeueReusableCellWithIdentifier(\"Cell\", forIndexPath: indexPath)\n cell.textLabel?.text = item.name\n\n return cell\n }\n\n}\n\n\nThis is the method that does the fetch:\n\nfunc getRecordsFromEntity(entity:String) -> [NSManagedObject]! {\n let fetchRequest = NSFetchRequest(entityName: entity)\n do {\n return try appDelegate.managedObjectContext.executeFetchRequest(fetchRequest) as! [NSManagedObject]\n } catch let error as NSError {\n print(\"Could not execute FetchRequest \\(error), \\(error.userInfo)\")\n }\n return nil\n}\n\n\nNote: I discover it works fine when using dispatch_async. \n\ndispatch_async(dispatch_get_main_queue(),{ ()->() in\n self.tableView.reloadData()\n })\n\n\nbut I didn't need this in iOS 8 with objective-c, and I don’t think is correct to use dispatch every time I want to reloadData." ]
[ "ios", "swift", "uitableview", "ios9", "reloaddata" ]
[ "VB6 IDE crashes adding component cwdaq.ocx", "I have a VB6 project that runs on WIN7 and tries to make it run on WIN10\nBut I have a problem adding components to its VB6\nWhen I adding :\n\nThe result got:\n\nAny idea?" ]
[ "vb6" ]
[ "Can't get SSL to work with MassTransit and cloudamqp", "I've been struggling to figure out how I'm meant to configure MassTransit and our new dedicated cloudamqp instance to work with SSL (note:everything is working without SSL fine).\n\nI tried adding the UseSsl line in the code below, which I found in some old documentation, but that didn't work:\n\nvar bus = Bus.Factory.CreateUsingRabbitMq(sbc =>\n {\n var host = sbc.Host(new Uri(messageBusConfiguration[\"Host\"]), h =>\n {\n h.Username(messageBusConfiguration[\"Username\"]);\n h.Password(messageBusConfiguration[\"Password\"]);\n h.UseSsl(s => {});\n });\n });\n\n\nIn cloudamqp I've set it to allow ampqs too and my services/APIs are setup and running in IIS using HTTPs without any issues.\n\nI suspect I'm missing something fundamental here but I can't find any documentation on it." ]
[ "ssl", "asp.net-core", "masstransit", "cloudamqp" ]
[ "Local offline development with Firestore", "Is there any way to use the gcloud firestore emulator to do local offline development when using the web client SDK? (ie client-side JS).\n\nI've found both\n\nfirebase serve --only firestore\nand\ngcloud beta emulators firestore start\n\nbut not sure of intended use cases of either, as the documentation doesn't give much to go on?" ]
[ "firebase", "google-cloud-firestore" ]
[ "Scala problem custom control structures Type parameters", "I don´t understand how to apply generic types in Scala correctly. I´ve managed to implement my own control structures (\"unless\", \"ForEach\"), but they are limited to \"Int\" types at the moment... Does anyone know how to change that implementation that works for generic types?! \n\nThe implementation doesn´t matter that much for me, but I really want to keep the control structures as they are now: \n\nimport Controls._ \n\nval Cond = false\nval Elements = List(1,2,3)\n\nUnless(Cond) {\n var sum = 0\n ForEach {\n sum += Element \n } In(Elements) \n println(\"The Sum: \" + sum)\n}\n\n\nI tried it for hours, but I don´t know a solution for the problem with the type parameters. Here´s my \"Int\" limited implementation: \n\nobject Controls {\n\n def Unless(cond: => Boolean)(block: => Unit) = {\n if(!cond) block\n }\n\n var current = 0\n def ForEach(block: => Unit) = {\n new {\n def In(list:List[Int]) = {\n list foreach { i =>\n current = i\n block\n }\n }\n }\n }\n\n def Element = current\n\n}\n\n\nAny hint´s are very welcome as I´am really stuck right now..." ]
[ "generics", "scala" ]
[ "Powershell Regex extract concat text", "I tried to extract regex string as per below code and its working fine. As per below script, it is extracting strings inside text say \"45 \\345\\ 54\" as \\345\\ .\n\n$input_path = \"E:\\DOC\\all.txt\"\n$output_file = \"E:\\DOC\\all-pts.txt\"\n$regex1 = ‘[ \\b\\t\\n\\r]+\\\\+[A-Z0-9_-]+\\\\$’\nselect-string -Path $input_path -Pattern $regex1 -AllMatches | % { \n$_.Matches } | % { $_.Value } > $output_file\n\n\nBut when i want to extract one more regex string and concat both the regex result using if statement as per below example i am not able to do. Don't know what mistake i am making here. I new to powershell.\n\nINPUT FILE(all.txt)\n\ntemp1.txt: file not found \\xyz\\ not found \\123\\\ntemp2.txt: text \\ABC\\ is here\ntemp2.txt: NUM \\999\\ yes \\FIRST\\ \n\nOUTPUT FILE(all-pts.txt) \n\ntemp1.txt \\xyz\\\ntemp1.txt \\123\\\ntemp2.txt \\ABC\\\ntemp2.txt \\999\\\ntemp2.txt \\FIRST\\ \n\n$input_path = \"E:\\DOC\\all.txt\"\n$output_file = \"E:\\DOC\\all-pts.txt\"\n(Get-Content \"$input_path\") | ForEach-Object \n{if($_ -like ‘[ \\b\\t\\n\\r]+\\\\+[A-Z0-9_-]+\\\\$’)\n\n {\n $regex1 = ‘[ \\b\\t\\n\\r]+\\\\+[A-Z0-9_-]+\\\\$’\n $regex2 = ‘[ A-Z0-9_-]+\\.txt$’\n select-string -Path $input_path -Pattern $regex1 -AllMatches | % \n { $_.Matches } | % { $_.Value } > $output_file\n select-string -Path $input_path -Pattern $regex2 -AllMatches | % \n { $_.Matches } | % { $_.Value } > $output_file\n }\n }" ]
[ "regex", "powershell", "concat" ]
[ "Apache Mod-Rewrite Primers?", "I am wondering what primers/guides/tutorials/etc. are out there for learning to rewrite URLs using Apache/.htaccess? Where is a good place to start?\n\nMy primary interest is learning how to point certain directories to others, and how to use portions of a URL as parameters to a script (i.e. \"/some/subdirs/like/this\" => \"script.php?a=some&b=subdirs&c=like&d=this\")." ]
[ "apache", ".htaccess", "mod-rewrite" ]
[ "how to go go back in a different version of the code in Git", "I'm trying to go back to a different date on the branch i'm working on.( like 3 days ago)\nI've created a patch of the files i have changed so i don't mind if it will be override.\n\nThanks in advance," ]
[ "git" ]