texts
sequence
tags
sequence
[ "how to pass data from model to view using codeigniter", "I am new to codeigniter. I have successfully stored the data to database from view. Now thing is i want to retrieve the data from database and show it in the view. Anyone can help from another link or atleast tell me the flow of passing the data. I m working on a form with text fields and buttons" ]
[ "php", "codeigniter" ]
[ "EditText sometimes randomly not showing?", "So I have an app that has this EditText. With some devices (generally the ones with higher resolutions), the EditText tends to randomly not show. However, it can be solved by restarting the app.\n\nHere's a picture of how it should be:\n\n\n\nAnd here's a picture of how it sometimes it randomly disappears: \n\n\n\nIt is important to clarify that the disappearing doesn't happen while the app is running, when you open the app, the editText is either there or not.\n\nThank you so much!\n\nThis is the XML for the EditText:\n\n<EditText\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:inputType=\"numberDecimal|numberSigned\"\n android:ems=\"10\"\n android:id=\"@+id/abs\"\n android:editable=\"true\"\n android:numeric=\"decimal\"\n android:textAlignment=\"center\"\n android:textColor=\"#000000\"\n android:layout_centerVertical=\"true\"\n android:layout_alignLeft=\"@+id/btn\"\n android:layout_alignStart=\"@+id/btn\"\n android:layout_alignRight=\"@+id/btn\"\n android:layout_alignEnd=\"@+id/btn\" />" ]
[ "android" ]
[ "How to debug the loading of ActiveX controls", "I have a very peculiar and specific case. I develop a VB6 based ActiveX control that I need to work on a different one.\n\nThe development machine is a Windows Server 2003, the \"production\" machine is Windows 7 Prof.\n\nNow, when I package by ActiveX in CAB and run the \"demo\" HTM-file on the development machine, everything works fine.\n\nBut as soon as I copy alle the contents to my production machine, and open the same HTM file (after clicking OK on the ActiveX security warnings and \"installing\" the CAB), nothing happens (where it should actually open a message box).\n\nHow can I debug this? Obvously, the browser does find the CAB, otherwise it wouldn't even know what to install. But, it doesn't seem to trigger correctly.\n\nMy problem isn't so much that I didn't know how to handle errors, but where these errors are? Is there any \"Internet Explorer Logfile\" that I don't know of?" ]
[ "internet-explorer", "vb6", "activex" ]
[ "How to inject EntityManager in test directory?", "This is my spring config based on hibernate. My problem is when I want to inject EntityManager in my test class. The problem is I get an exception that this.entitymanager is null and I don't know what to do with it. Does anybody have some idea what to do?\nJpaConfig:\n@Configuration\npublic class JpaConfig {\n\n @Bean\n public LocalContainerEntityManagerFactoryBean createEMF(JpaVendorAdapter adapter){\n LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();\n\n Map<String, String> properties = new HashMap<>();\n properties.put("javax.persistence.jdbc.url", "jdbc:mysql://localhost:3306/shop?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC");\n properties.put("javax.persistence.jdbc.user", "root");\n properties.put("javax.persistence.jdbc.password", "ErykSkoczylas1");\n properties.put("javax.persistence.jdbc.driver", "com.mysql.cj.jdbc.Driver");\n properties.put("javax.persistence.schema-generation.database.action", "drop-and-create");\n emf.setPersistenceUnitName("shop-database");\n emf.setJpaPropertyMap(properties);\n emf.setJpaVendorAdapter(adapter);\n emf.setPackagesToScan("com.database.models");\n return emf;\n }\n\n @Bean\n public JpaVendorAdapter createVendorAdapter() {\n HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();\n adapter.setDatabase(Database.MYSQL);\n adapter.setShowSql(true);\n return adapter;\n }\n\n @Bean\n public TransactionManager transactionManager(EntityManagerFactory entityManagerFactory) {\n JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();\n jpaTransactionManager.setEntityManagerFactory(entityManagerFactory);\n return jpaTransactionManager;\n }\n}\n\nTest class:\npublic class CustomerServiceTest {\n private AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringJpaApplication.class);\n private CustomerService customerService = ctx.getBean(CustomerService.class);\n\n @PersistenceUnit\n private EntityManagerFactory entityManagerFactory;\n private EntityManager entityManager;\n\n @Test\n public void method_addCustomerToDatabase_desc_CustomerServiceShouldAddCustomerToDatabaseAndShouldAddAddress() {\n Address address1 = new Address("Poland", "30-091", "Cracow", "street", 1);\n\n Customer customer = new Customer("John", "Smith", "[email protected]", new Date(11111999L), "password", false, address1);\n\n customerService.addCustomerToDatabase(customer);\n\n List<Customer> customers = findCustomers(customer);\n List<Address> addresses = findAddresses(address1);\n Address address2 = entityManager.find(Address.class, address1.getId());\n\n deleteCustomerFromDatabase(customers.get(0).getId());\n deleteAddressFromDatabase(addresses.get(0).getId());\n\n assertEquals(1, addresses.size());\n assertEquals(1, customers.size());\n assertEquals(1, address2.getCustomers().size());\n }\n\nException:\njava.lang.NullPointerException: Cannot invoke "javax.persistence.EntityManager.getTransaction()" because "this.entityManager" is null" ]
[ "java", "hibernate", "entitymanager" ]
[ "How to get cell value of DataGridView by column name?", "I have a WinForms application with a DataGridView, which DataSource is a DataTable (filled from SQL Server) which has a column of xxx. The following code raises the exception of \n\n\n ArgumentException was unhandled. Column named xxx cannot be found.\n\n\nforeach (DataGridViewRow row in Rows)\n{\n if (object.Equals(row.Cells[\"xxx\"].Value, 123))\n}\n\n\nIs it possible to get the cell values by column name?" ]
[ "c#", "winforms", "datagridviewcolumn" ]
[ "What is the idiomatic way to write this function (which might normally be called filterA)?", "I am going through this course.\n\nThere is a section for Applicative and I am being asked to implement a function with the following behaviour and type\n\n-- | Filter a list with a predicate that produces an effect.\n--\n-- >>> filtering (ExactlyOne . even) (4 :. 5 :. 6 :. Nil)\n-- ExactlyOne [4,6]\n--\n-- >>> filtering (\\a -> if a > 13 then Empty else Full (a <= 7)) (4 :. 5 :. 6 :. Nil)\n-- Full [4,5,6]\n--\n-- >>> filtering (\\a -> if a > 13 then Empty else Full (a <= 7)) (4 :. 5 :. 6 :. 7 :. 8 :. 9 :. Nil)\n-- Full [4,5,6,7]\n--\n-- >>> filtering (\\a -> if a > 13 then Empty else Full (a <= 7)) (4 :. 5 :. 6 :. 13 :. 14 :. Nil)\n-- Empty\n--\n-- >>> filtering (>) (4 :. 5 :. 6 :. 7 :. 8 :. 9 :. 10 :. 11 :. 12 :. Nil) 8\n-- [9,10,11,12]\n--\n-- >>> filtering (const $ True :. True :. Nil) (1 :. 2 :. 3 :. Nil)\n-- [[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3],[1,2,3]]\nfiltering :: Applicative f => (a -> f Bool) -> List a -> f (List a)\n\n\nI have come up with the following implementation, which satifies all the requirements\n\nfiltering f as =\n let x = sequence (f `map` as)\n y = zip as <$> x\n z = filter snd <$> y\n in map fst <$> z\n\n\nbut it feels a bit \"round about\" to me, and I can't think of a more direct way to do it. \n\nNote: I have expanded into x, y, z because it makes it easier (for me) to follow what is happening, and whilst I realize I could express it all on a single line, I do not consider that to be more 'direct' and thus not an answer to my question.\n\nNote 2: This course appears to be building up common type classes from fundamental pieces. We started with a custom implementation of List followed by Functor and now Applicative, so I can only use concepts from these classes. I cannot use anything from Monad yet." ]
[ "haskell", "applicative" ]
[ "Inserting data into relational table", "I have three relational tables and here is i want to do.\n\n\ninsert data into table\nGet the last inserted row id\nInsert the last inserted row id into the relational tables\n\n\nI get this error: Invalid column name LastInsertID\n\n Private Sub cmdSave_Click(sender As Object, e As EventArgs) Handles cmdSave.Click\n\n cn.Open()\n\n Using cmd As New SqlClient.SqlCommand(\"INSERT INTO ParentInformation(father_firstname,father_lastname,father_mi,father_occupation \" _\n & \" father_telnum,mother_firstName,mother_lastname,mother_mi,mother_occupation,mother_telnum,\" _\n & \" contact_firstname, contact_lastname,contact_MI, contact_Address, contact_telnum) \" _\n & \" VALUES('\" & txtFatherGN.Text & \"', '\" & txtFatherLN.Text & \"','\" & txtFatherMI.Text & \"',\" _\n & \" '\" & txtFatherOccupation.Text & \"','\" & txtFatherCP.Text & \"','\" & txtMotherGN.Text & \"' ,\" _\n & \" '\" & txtMotherLN.Text & \"','\" & txtMotherMI.Text & \"','\" & txtMotherOccupation.Text & \"',\" _\n & \"'\" & txtMotherCP.Text & \"','\" & txtContactGN.Text & \"','\" & txtContactLN.Text & \"',\" _\n & \"'\" & txtContactMI.Text & \"', '\" & txtContactAddress.Text & \"','\" & txtContactCP.Text & \"'; dim lastInsertedID as string = SELECT LAST_INSERT_ID())\", cn)\n End Using\n Using cmd As New SqlClient.SqlCommand(\"INSERT INTO studentInformation(Surname,firstName, \" _\n & \" MiddleName,Address,Birthday,Gender,Nationality,Birthplace, \" _\n & \" Telnum,SchoolLastAttended,Note,Image,ParentID) \" _\n & \" VALUES('\" & txtStudLN.Text & \"', '\" & txtStudFN.Text & \"','\" & txtStudMN.Text & \"',\" _\n & \" '\" & txtAddress.Text & \"','\" & dtpBirthday.Text & \"','\" & newStudent & \"' ,\" _\n & \" '\" & cboNationality.Text & \"','\" & txtPlaceOfBirth.Text & \"','\" & txtStudentCP.Text & \"',\" _\n & \"'\" & cboSchoolYear.Text & \"','\" & cboGradeLevel.Text & \"','\" & txtSWG.Text & \"',\" _\n & \"'\" & txtSchoolAddress.Text & \"', '\" & txtNote.Text & \"',@StudentPic,lastInsertedID;dim lastInsertedID as string = SELECT LAST_INSERT_ID())\", cn)\n\n End Using\n Using cmd As New SqlClient.SqlCommand(\"INSERT INTO StudentHistory(SchoolYear,Levels,Section,DateEnrolled ,StudentID) \" _\n & \" VALUES('\" & cboSchoolYear.Text & \"','\" & cboGradeLevel.Text & \"', \" _\n & \"'\" & cboSection.Text & \"','\" & dtpEnrollment.Text & \"', lastInsertedID)\", cn)\n cmd.Parameters.Add(New SqlClient.SqlParameter(\"@StudentPic\", SqlDbType.Image)).Value = IO.File.ReadAllBytes(a.FileName)\n i = cmd.ExecuteNonQuery\n If (i > 0) Then\n MsgBox(\"Save \" & i & \"Record Successfully\")\n 'clear()\n End If\n\n End Using\n\n\n cn.Close()\nEnd Sub\n\n\nRelationship of my database\n\nCan anyone help me to fix this. thanks in advance" ]
[ "vb.net", "sql-server-2008-r2" ]
[ "what's the difference between @using and @namespace directives?", "I'm new to asp.net razor page, sorry if my question sounds dumb.\nIt seems to me that both @using and @namespace do the same thing which allows you don't use namespace-qualified full name? so @using and @namespace are interchangeable?" ]
[ "asp.net-core", "razor-pages" ]
[ "Passing variable from controller scope to directive", "In my controller I've defined $scope.worker which is a plain JS object:\n\n{\n name: 'Peter',\n phone: 601002003\n}\n\n\nI've created a directive:\n\n.directive('phoneType', [function () {\n return {\n restrict: 'A',\n link: function (scope, element, attrs) {\n console.log(attrs);\n }\n };\n}])\n\n\nand my HTML looks like this:\n\n<span phone-type=\"worker.phone\"></span>\n\n\nHow do I pass worker.phone (in this example 601002003) from the controller scope to the directive, so I can create my logic in the link method? attrs.phoneType right now shows me worker.phone string." ]
[ "javascript", "angularjs", "angularjs-directive", "angularjs-scope" ]
[ "Bash Script and quoting SED", "Below is my script where it will either accept a file input or stdin... but I can't get the escaping right! - I've tried single and double quotes etc...\n\nwhile read line\ndo\nsed 's/path\\/12345/path\\/12345 == useful name/g'\nsed 's/path\\/6789/path\\/6789 == useful name - 2/g'\ndone < ${1:-/dev/stdin}" ]
[ "bash", "shell", "unix", "sed" ]
[ "Rectangle detection in image", "I'd like to program a detection of a rectangular sheet of paper which doesn't absolutely need to be perfectly straight on each side as I may take a picture of it \"in the air\" which means the single sides of the paper might get distorted a bit.\n\nThe app (iOs and android) CamScanner does this very very good and Im wondering how this might be implemented. First of all I thought of doing:\n\n\nsmoothing / noise reduction\nEdge detection (canny etc) OR thresholding (global / adaptive)\nHough Transformation\nDetecting lines (only vertically / horizontally allowed)\nCalculate the intercept point of 4 found lines\n\n\nBut this gives me much problems with different types of images.\nAnd I'm wondering if there's maybe a better approach in directly detecting a rectangular-like shape in an image and if so, if maybe camscanner does implement it like this as well!?\n\nHere are some images taken in CamScanner.\nThese ones are detected quite nicely even though in a) the side is distorted (but the corner still gets shown in the overlay but doesnt really fit the corner of the white paper) and in b) the background is pretty close to the actual paper but it still gets recognized correctly:\n\n \n\nIt even gets the rotated pictures correctly:\n\n\n\nAnd when Im inserting some testing errors, it fails but at least detects some of the contour, but always try to detect it as a rectangle:\n\n\n\n\nAnd here it fails completely:\n\n\n\nI suppose in the last three examples, if it would do hough transformation, it could have detected at least two of the four sides of the rectangle.\n\nAny ideas and tips?\nThanks a lot in advance" ]
[ "image", "image-processing", "rectangles", "edge-detection", "hough-transform" ]
[ "Wikipedia Reader on iPhone", "I want to make a Wikipedia Reader for the iPhone. What's the best approach?\n\nI've already made a few thought about that. Loading the content of the Wikipedia site is quite easy using the Wikipedia API.But the difficulty is how to display the content in a nice way. The content is marked up with wikipedia tags, not html. My idea is to parse the whole content and exchange these elements with real html tags, then I load the text (now in html) into a UIWebView and apply my own styles using a custom CSS file.\n\nBut I'm not sure if this a very good solution. Are there any other and better solution for my problem or am I on a right way? It would be nice if you could give a tutorial or and example on that.\n\nThanks" ]
[ "iphone", "html", "uiwebview", "wikipedia" ]
[ "Ant ftp task QUOT command", "Is there any way to get the Ant ftp task to send a QUOT command to the server?" ]
[ "ant", "ftp" ]
[ "Unsupervised learning python: x,y,z movement clustering", "I have a dataset composed of 3000 observations. For each observation, I have 4 features: time, position on the x-axis, position on the y-axis, position on the z-axis.\nThe data are related to the acceleration of a vehicle.\nBasically the vehicle can be on three states: accelerating, decelerating and remain at the same velocity. The states are repeated in the dataset (the vehicle accelerates, decelerates, stops and then repeats the sequence).\n\nI would like to cluster my dataset in these categories and then add a new column to the dataset with the result of the cluster.\n\nI tried to apply KMeans (after standardizing the data) but I obtain three clusters of the same dimension (to me this is strange since acceleration and deceleration last more than the stops) that do not repeat themselves. Basically, it is as if the KMeans just splits the dataset into equal parts without considering the characteristics of the dataset. \n\nMaybe I should use a different algorithm? Should I approach the problem from a different perspective?\n\nThe sample of the dataset:\nsample dataset\n\nI tried to extract the values of the velocity and of the acceleration. The problem now is that I have problems in standardizing the dataset \n\nValueError: Input contains infinity or a value too large for dtype('float64')." ]
[ "python", "scikit-learn", "k-means", "unsupervised-learning" ]
[ "F#: Is the Condition attribute not supported in some (or all) tags in .fsproj files?", "For an F# project with dual platforms \"Xbox 360\" and \"x86,\" I have the following in my project file:\n\n<ItemGroup Condition=\"'$(Platform)' == 'Xbox 360'\">\n <Reference Include=\"Arands.ContentTracker.Xbox\">\n <HintPath>..\\..\\..\\..\\..\\..\\_Libs\\XNA\\ContentTracker\\ContentTracker\\bin\\Xbox 360\\Release\\Arands.ContentTracker.Xbox.dll</HintPath>\n </Reference>\n</ItemGroup>\n<ItemGroup Condition=\"'$(Platform)' == 'x86'\">\n <Reference Include=\"Arands.ContentTracker\">\n <HintPath>..\\..\\..\\..\\..\\..\\_Libs\\XNA\\ContentTracker\\ContentTracker\\bin\\x86\\Release\\Arands.ContentTracker.dll</HintPath>\n </Reference>\n</ItemGroup>\n\n\nFor some reason, neither Arands.ContentTracker.dll nor Arands.ContentTracker.Xbox.dll are added as references in my project, regardless of which platform I select (Xbox 360 or x86).\n\nThe result is the same with the following:\n\n<Reference Condition=\"'$(Platform)' == 'Xbox 360'\" Include=\"Arands.ContentTracker.Xbox\">\n <HintPath>..\\..\\..\\..\\..\\..\\_Libs\\XNA\\ContentTracker\\ContentTracker\\bin\\Xbox 360\\Release\\Arands.ContentTracker.Xbox.dll</HintPath>\n</Reference>\n<Reference Condition=\"'$(Platform)' == 'x86'\" Include=\"Arands.ContentTracker\">\n <HintPath>..\\..\\..\\..\\..\\..\\_Libs\\XNA\\ContentTracker\\ContentTracker\\bin\\x86\\Release\\Arands.ContentTracker.dll</HintPath>\n</Reference>\n\n\nIs the Condition attribute simply ignored in .fsproj files?\n\nSplitting a project in two sucks. I want the current chosen platform to determine the current configuration and what goes on in a build, not (for example) which project tree I had expanded when I double-clicked a .fs code file in the Solution Explorer. Having multiple projects just to accommodate different platforms has caused me some fairly significant headaches, and even confuses Intellisense (e.g. not identifying System.Collections.Generic.HashSet as unavailable when my platform is set to Xbox 360).\n\nUPDATE: I've managed to get it working. My mistake was expecting the Solution Explorer to reflect a change in configuration, e.g. for the References in the F# project to actually show the relevant references, as I'm used to seeing for C# projects with conditional tags. Apparently, F# projects simply display nothing in the References section when there are conditionals involved (unfortunately).\n\nOnce I got past the assumption that the Solution Explorer would accurately reflect the relevant assets after a platform change, I was able to focus on other areas of the solution (namely, the Configuration Manager and References to the F# project in the C# projects) that required more attention.\n\nThanks for your assistance, all! I'd prefer to award the points to Preet Sangha, since it was his question that provided the insight that allowed me to get past the aforementioned assumption." ]
[ "visual-studio", "configuration", "msbuild", "f#", "conditional-statements" ]
[ "Running a .exe program using Python", "Little background:\nCode::Blocks is an IDE with a C++ integrated compiler. When creating a C++ project, it creates a .exe file so you can run the project.\n\nSo now I want to run that executable file using a Python script (Using VSCode). I tried subprocess.call(), subprocess.run() and subprocess.Popen(), and all of them start the background process, but it doesn't compile, so it just keeps running on the Task Manager. If I run it manually (by double-clicking it) then it opens, it closes and I get my correct answer on the output file.\n\nThis is the C++ project folder for the problem \"kino\" :\n\n\nThis is a photo with the .exe on the Task Manager :\n\n\nAnd this is my Python code:\n\nprocess = subprocess.run([r'C:\\Users\\Documents\\kino\\kino.exe'], shell = True)\n\n\nI want to say that I also tried subprocess.kill(), but it should terminate on its own (and I don't get my answer).\n\nEdit:\nHere is a video describing the problem" ]
[ "python", "executable" ]
[ "When I change servlet content in doPost, nothing happens", "Here is piece from my HTML code:\n\n<form action=\"LoginServlet\" method=\"post\">\n Username: <input type=\"text\" name=\"username\"><br>\n Password: <input type=\"password\" name=\"password\">\n <input type=\"submit\" value=\"Log In\">\n</form>\n\n\nand here is servletContextListener:\n\npublic class DataListener implements ServletContextListener {\nprivate AccountManager accs;\nServletContext context;\n/**\n * Default constructor. \n */\npublic DataListener() {\n // TODO Auto-generated constructor stub\n}\n\n/**\n * @see ServletContextListener#contextInitialized(ServletContextEvent)\n */\npublic void contextInitialized(ServletContextEvent e) {\n accs = new AccountManager();\n context = e.getServletContext();\n context.setAttribute(\"accounts\", accs);\n}\n\n/**\n * @see ServletContextListener#contextDestroyed(ServletContextEvent)\n */\npublic void contextDestroyed(ServletContextEvent e) {\n context = e.getServletContext();\n}\n\n\n}\n\nand here is my servlet doPost :\n\nprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n //ServletContext context = getServletContext();\n //AccountManager manager = (AccountManager) context.getAttribute(\"accounts\");\n\n\n /*if (manager.isValid(request.getParameter(\"username\"),request.getParameter(\"password\"))){\n RequestDispatcher dispatch = request.getRequestDispatcher(\"welcome.jsp\");\n dispatch.forward(request, response);\n } else{ */\n response.setContentType(\"text/html\");\n PrintWriter out = response.getWriter();\n out.println(\"<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-1\\\" ?>\");\n out.println(\"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\"\"\n + \" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\");\n out.println(\"<html xmlns='http://www.w3.org/1999/xhtml'>\");\n out.println(\"<head>\");\n out.println(\"<title>Information Incorrect</title>\");\n out.println(\"</head>\");\n out.println(\"<body>\");\n out.print(\"<h1>Please Try Again </h1>\");\n out.print(\"<br />\");\n out.print(\"Either Your username or password is incorrect. Please try again.\");\n out.print(\"<br />\");\n out.print(\"<br />\");\n request.getRequestDispatcher(\"/LoginForm.html\").include(request, response); \n out.println(\"</body>\");\n out.println(\"</html>\"); \n// }\n\n\nProblem is that, when i run welcome.html and push login button, still old code does its work. I'mean i've commented this part:\n\n/*if (manager.isValid(request.getParameter(\"username\"),request.getParameter(\"password\"))){\n RequestDispatcher dispatch = request.getRequestDispatcher(\"welcome.jsp\");\n dispatch.forward(request, response);\n} else{ */\n\n\nbut still, when i push button, this, commented block executes...\nso i can't change anything there.. anybody can explain how can i restart my servlet class? or what's the problem?\nthank you in advace\n\n\n\ni did Project->clean and it worked :)" ]
[ "java", "tomcat", "servlets", "servlet-listeners" ]
[ "Grouping preserving order", "I have the following trait:\n\ntrait Tr{\n val value: Int\n}\n\n\nand a non-ordered sequence:\n\nval s: Seq[Tr] = //...\n\n\nNow I want to split this sequence s by groups with the same value --\n Seq[Seq[Tr]] so that the resulting sequence is sorted by value in ascending order. Is there a way to do so?" ]
[ "scala", "collections" ]
[ "Allocation of array of size very large", "How can create an array of size very large?? Well i am not able to create an array of size INT_MAX.. how could be achieve this.?\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <limits.h>\n#define SIZE 2147483647\n\nint main() { \n int *array; \n unsigned int i;\n\n array = malloc(sizeof(int) * SIZE); \n if(array == NULL) {\n fprintf(stderr, \"Could not allocate that much memory\");\n return 1; }\n\n for(i=0; i<1; i++) {\n array[0] = 0; \n } \n\n free(array); \n}" ]
[ "c", "arrays", "dynamic-arrays" ]
[ "wpf assign one color to another", "In my XAML I have this:\n\n<Color x:Key=\"VeryLightGrey\">#fff0f0f0</Color> \n<Color x:Key=\"TabBackgroundColor\">#fff0f0f0</Color>\n\n\nI would love to have something like this:\n\n<Color x:Key=\"TabBackgroundColor\" Color=\"{StaticResource VeryLightGrey}\"/>\n\n\nI have tried various methods including this:\n\n<StaticResource x:Key=\"TabBackgroundColor\" ResourceKey=\"VeryLightGrey\"/>\n\n\nBut my code become riddled with warning about:\n\n\"An object of type System.Wndows.StaticResourceExtention cannot be applied to a property that expects the type System.Windows.Media.Color\"\n\nOther posts say to ignore this warning, but it actually causes problems, so i cant.\n\nIs there a better solution out there ?" ]
[ "wpf", "xaml", "colors" ]
[ "How do I configure a Play! Framework project to be built as a war using only Ant or Maven?", "I realize, from the documentation (http://www.playframework.org/documentation/1.2.1/deployment), that if the Play! Framework is already installed and configured properly then creating a deployable war is as simple as running the command:\n\nplay war myapp -o myapp.war\n\n\nBut what if the Play! Framework is not installed on the target machine and requirements call for a standard war to be created from either an Ant or Maven build script? How would one go about creating a build script or pom file that could leverage the Play! Framework API to generate the desired war artifact without permanently installing the framework to the target machine. Can this be done easily?" ]
[ "deployment", "ant", "maven", "playframework", "war" ]
[ "Strange error Return not working in some cases", "So I am having a weird issue with something that is suppose to be simple: \nreturn vs. print\n\nI was practicing coding for a binary search\n\ndef binary_search(data, n):\nif len(data) == 0:\n return False\nx = (len(data))//2\nif data[x] == n:\n #The following line seems to be the problem\n return x\nelif n < data[x]:\n binary_search(data[:x], n)\nelse:\n binary_search(data[x+1:], n)]\nz = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\nprint(binary_search(z, 9))\n\n\nThis returns None\n\nIf I switch from return x --> print(x)\n\n# CODE CODE CODE \nprint(x)\n#CODE CODE CODE\n\nprint(binary_search(z, 9))\n\n\nThis returns \n\n2\nNone\n\n\nI know the Binary Search itself works (2 is the correct answer) and that 'None' comes from the two print statements but when there is just one print statement\n\n # CODE CODE CODE \n return x\n #CODE CODE CODE\n print(binary_search(z, 9))\n\n\nIt just prints None\n\nAny idea why this is happening? I don't want the method to automatically print unless I ask\n\nAnother strange thing is\n\n #ORIG CODE\n return False\n #ORIG CODE\n\n y = []\n print(binary_search(y, 9))\n\n\nReturns\n\nFalse\n\n\nSo in that case 'return' is acting like I expect it to\n\nI even tried switching return x to return True, it still returns None" ]
[ "python", "return", "binary-search" ]
[ "PHP still not executing on MAC OSX 10.10 Yosemite", "I cannot get PHP to work on my computer. My browser prints out the php code rather than executing it. \n\nThe first thing I did was to open up the apache conf file and edit it to uncomment the php line\n\nOpened file:\n\n sudo nano /etc/apache2/httpd.conf\n\n\nThis is the line I uncommented in that file:\n\n LoadModule php_module libexec/apache2/libphp5.so\n\n\nI then restarted apache using: \n\n sudo apachectl restart\n\n\nApache would run, http://127.0.0.1 would show \"It works!\" \nI then created a file called test.php, in which I put the following line of code: \n\n <?php phpinfo(); ?> \n\n\nIn chrome I clicked file -> open file -> test.php, and all it printed was the code I had written. \n\nI've also tried changing the line \"User _www\" in the conf file to \n\n User myusername \n\n\nI've tried changing the line \"DirectoryIndex index.html\" to: \n\n DirectoryIndex index.php index.html index.htm \n\n\nNone of these changes have resulted in PHP script executing on my computer. Any help would be appreciated!" ]
[ "php", "macos", "apache", "osx-yosemite" ]
[ "How do I alter content on Scribd?", "I have Scribd files on my website: http://www.wellbeingbydesign.com/main/?cat=7\n\nSince my webmaster got sick, I don't know how to get into these Scribd files to edit them. \n\nThanks,\n\nCatherine" ]
[ "scribd" ]
[ "Plivo SMS is not being sent and getting error in Java", "I am integrating Plivo SMS API with my java web application. I want to send messages through my application. I am referring to https://www.plivo.com/docs/getting-started/send-a-single-sms/ link.\nBelow is the code snippet:\n\nString authId = \"{my Auth_id}\"; //Your Authentication ID\nString authToken = \"{my auth Token}\"; //Your authentication code\nRestAPI api = new RestAPI(authId, authToken, \"v1\");\n\nLinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();\nparameters.put(\"src\", \"+44*******\"); // Sender's phone number with country code\nparameters.put(\"dst\", \"+91*******\"); // Receiver's phone number with country code\nparameters.put(\"text\", \"Hi, text from Plivo\"); // Your SMS text message\n\ntry {\n // Send the message\n MessageResponse msgResponse = api.sendMessage(parameters);\n // Print the response\n System.out.println(msgResponse);\n // Print the Api ID\n System.out.println(\"Api ID : \" + msgResponse.apiId);\n // Print the Response Message\n System.out.println(\"Message : \" + msgResponse.message);\n\n if (msgResponse.serverCode == 202) {\n // Print the Message UUID\n System.out.println(\"Message UUID : \" + msgResponse.messageUuids.get(0).toString());\n } else {\n System.out.println(msgResponse.error);\n }\n } catch (PlivoException e) {\n System.out.println(e.getLocalizedMessage());\n }\n\n\nI tried to run this code using console application as well as web application.I am getting exception \"com.plivo.helper.exception.PlivoException: Connection to https://api.plivo.com refused\". What is wrong with my code? Am I missing anything here?" ]
[ "java", "plivo" ]
[ "Opening a link in CKEditor with one click", "I am using CKEditor, I have put a link into a text. Is it possible to go directly to the link when we click (once) on that link inside CKEditor?" ]
[ "ckeditor" ]
[ "Validation error messages remain on page while closing modal box", "I am using jQuery Validation Engine to validate my form. On modal box validations are working, but when I close the modal box validation messages are remaining on page as it is.\n\nHow can I remove them?" ]
[ "javascript", "jquery", "validation" ]
[ "Batch file '%' put additional space while setting java property", "I am running java application using command line and in that i have to inject some system level properties using \"-D\" flag. The property is are passed as a argument to the batch file and i set it and run the jar file like this.\n\njava -Dservice.url=\"http://localhost:%port%/someservice\" -jar program.jar\n\n\nThe problem is that %port% puts additional space in the end and its causing issues. Upon printing the property inside the application i found out that it is being set as like this.\n\nservice.url=http://localhost:8080 /someservice\n\nideally it should be like this\n\nservice.url=http://localhost:8080/someservice\n\ni have tried removing quotes, adding quotes, many solutions but they are not working." ]
[ "java", "windows", "batch-file" ]
[ "WebLogic WorkManager clustering/remote jobs", "Does WebLoogic WorkManager have the ability to execute jobs on other servers on the cluster to effectively parallelize jobs?" ]
[ "weblogic", "workmanagers" ]
[ "Web scraping with R: web site has two drop down menus", "I want to get grade data from the following web site using R's for loop function: https://www7.nau.edu/pair/reports/ClassDistribution\n\nIn order to get the table data I have to first choose year and then academic school. I need data for 2015-2019 and for all schools (ACC, ACM,...,WGS) within university. When I select year and school the url is not changing that is why I am getting no table data. I'd really appreciate your help and advice. I am able to create for loop, I just need to see how to pull first table.\n\nI was using following code for a static web site:\n\nlibrary(XML)\nlibrary(RCurl)\nurl <- \"https://www7.nau.edu/pair/reports/ClassDistribution\"\nurl.parsed <- htmlParse(getURL(url), asText = TRUE)\ntableNodes <- getNodeSet(url.parsed, '//*[@id=\"pp_table\"]/table')\ngrade_data <- readHTMLTable(tableNodes[[1]], header=F, stringsAsFactors=F)" ]
[ "r", "web-scraping" ]
[ "Why is giving a fixed width to a label an accepted behavior?", "There are a lot of questions about formatting forms so that labels align, and almost all the answers which suggest a pure CSS solution (as opposed to using a table) provide a fixed width to the label element.\n\nBut isn't this mixing content and presentation? In order to choose the right width you basically have to see how big your longest label is and try a pixel width value until \"it fits\". This means that if you change your labels you also have to change your CSS." ]
[ "html", "css" ]
[ "C function parameter optimization: (MyStruct const * const myStruct) vs. (MyStruct const myStruct)", "Example available at ideone.com:\n\nint passByConstPointerConst(MyStruct const * const myStruct)\nint passByValueConst (MyStruct const myStruct)\n\n\nWould you expect a compiler to optimize the two functions above such that neither one would actually copy the contents of the passed MyStruct?\n\nI do understand that many optimization questions are specific to individual compilers and optimization settings, but I can't be designing for a single compiler. Instead, I would like to have a general expectation as to whether or not I need to be passing pointers to avoid copying. It just seems like using const and allowing the compiler to handle the optimization (after I configure it) should be a better choice and would result in more legible and less error prone code.\n\nIn the case of the example at ideone.com, the compiler clearly is still copying the data to a new location." ]
[ "c", "optimization", "pointers", "constants", "pass-by-value" ]
[ "system() 's not behaving like cmd in R under windows", "In R, I execute the command\n> system('"C:/OSGeo4W64/bin/gdalwarp.exe" -tap -overwrite -tr 100 100\n -s_srs "+proj=longlat +datum=WGS84 +no_defs" -t_srs "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs" -r "bilinear" -of "GTiff" "D:/Maps/EMODnet/output/tmp/tmp.tif"\n "D:/Maps/EMODnet/output/tmp/tmp_proj.tif"') \n\nand got the error\n\nERROR 1: PROJ:\nproj_create_operations: SQLite error on SELECT name, type,\ncoordinate_system_auth_name, coordinate_system_code, datum_auth_name,\ndatum_code, area_of_use_auth_name, area_of_use_code, text_definition,\ndeprecated FROM geodetic_crs WHERE auth_name = ? AND code = ?: no such\ncolumn: area_of_use_auth_name ERROR 6: Cannot find coordinate\noperations from `GEOGCRS["unknown",DATU\n\nbut when I execute directly in a windows "cmd" terminal the following it is successful\n\n"C:/OSGeo4W64/bin/gdalwarp.exe" -tap -overwrite -tr 100 100 -s_srs "+proj=longlat +datum=WGS84 +no_defs" -t_srs "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs" -r "bilinear" -of "GTiff" "D:/Maps/EMODnet/output/tmp/tmp.tif" "D:/Maps/EMODnet/output/tmp/tmp_proj.tif"\n\nAny idea why I get get that kind of difference ?" ]
[ "r", "windows", "system", "gdal", "rgdal" ]
[ "Python Square Root Calculator Error", "I wanted to make a simple square root calculator. \n\nnum = input('Enter a number and hit enter: ')\n\nif len(num) > 0 and num.isdigit():\n new = (num**0.5)\n print(new)\nelse:\n print('You did not enter a valid number.')\n\n\nIt doesn't seem as if I have done anything wrong, however, when I attempt to run the program and after I have input a number, I am confronted with the following error message:\n\nTraceback (most recent call last):\nFile \"/Users/username/Documents/Coding/squareroot.py\", line 4, in <module>\nnew = (num**0.5)\nTypeError: unsupported operand type(s) for ** or pow(): 'str' and 'float'\n\nProcess finished with exit code 1" ]
[ "python", "calculator", "square-root", "calculation" ]
[ "enchant.errors.Error: Don't pass bytestrings to pyenchant-python", "I am trying to make a program where I can enter some characters in python and the program then goes through all the possible combinations of those letters. Then it compares that to check if it is in the dictionary or is a word. If it is, it gets appended to a list that will be printed out at the end. I had to look up how to do certain things and was doing great until I got this error. I can't find any forum that has this message. Can someone help me and tell me what I need to do to get it to work? Here is my code.\n\nimport itertools\nimport enchant\nhow_many_letters=True\nletters=[]\npossible_words=[]\nd = enchant.Dict(\"en_US\")\nprint(\"Welcome to combination letters helper!\")\nprint(\"Type the word 'stop' to quit entering letters, other wise do it one at a time.\")\nwhile how_many_letters==True:\n get_letters=input(\"Enter the letters you have with not counting spaces:\")\n if get_letters=='stop':\n how_many_letters=False\n letters.append(get_letters)\nlength=len(letters)\nlength=length-1\ndel letters[length:]\nprint(letters)\nfor i in range(length):\n for subset in itertools.combinations(letters, i):#Subset is the combination thing\n print(subset)\n check=d.check(subset)\n print(check)\n if check==True:\n possible_words.append(check)\nprint(possible_words)\n\n\nThanks in advance." ]
[ "python", "python-3.x" ]
[ "Express js can't see cookie, that was set before calling route", "When logging in to my Yii2 + angularjs page, I create cookie with user data:\n\n$jwt = JWT::encode(array(1,2,3), 'myKey123')\nsetcookie('myData', $jwt, time() + 3600);\n\n\nI want to access it in my nodejs + express app - before processing request I have to check, if user didn't change 'myData' cookie. This is how I do it now:\n\napp.use(cookieParser());\n\napp.get('/*', function (req, res, next) {\n if(req.cookies.myData) {\n jwt.verify(req.cookies.myData, 'myKey123', function(err, decoded) {\n if(err)\n res.sendStatus(403);\n else\n return next();\n });\n } else {\n res.sendStatus(403);\n }\n});\n\n\nIf after I logging in I call expressjs route directly in browser, app sees cookie. \n\nProblem: If route is called by making $http.get() request, expressjs app doesn't see any cookies. \n\nYii2 and expressjs runs on the same IP, but on different ports, but I've read, that different ports shouldn't be the reason, should it? I've played around with setting different cookie parameters, but nothing seems to help. I'd appreciate any help or hints I could get, thank you!" ]
[ "node.js", "express", "cookies", "yii2", "session-cookies" ]
[ "How we can add a span to a text inside ul, that is outside of li in jquery or css", "how can i add a span to 'Test content1' and 'Test content2' ?\n\n<ul>\n Test content1\n <li>list item 1</li>\n <li>list item 2</li>\n Test content2\n <li>list item 3</li>\n <li>list item 4</li>\n <li>list item 5</li>\n</ul>" ]
[ "jquery", "css" ]
[ "Exception encountered during startup: Unable to gossip with any seeds", "i am pretty new to cassandra and i am trying to setup a 2 node cluster in my home VM...i got 2 machines up and running\n\n NAME - IP Address\nmachine#1 - cassa - 192.168.1.200\nmachine#2 - cassa2 - 192.168.1.201\n\n\ni have gotten cassandra up and running on machine#1 but now when i try to bring up cassandra on machine#2 i get below msg\n\nhttp://pastebin.com/qsRraVb5\n\nhere are the things changed on machine#1\n\ncluster_name: 'demo'\ndata_file_directories:\n - /home/cass/cassandra/data\ncommitlog_directory: /home/cass/cassandra/commitlog\nsaved_caches_directory: /home/cass/cassandra/saved_caches\nseed_provider:\n - class_name: org.apache.cassandra.locator.SimpleSeedProvider\n parameters:\n - seeds: \"192.168.1.200\"\nlisten_address: 192.168.1.200\nrpc_address: 192.168.1.200\n\n\nand here is the stuff from machine#2\n\ncluster_name: 'demo'\ndata_file_directories:\n - /home/cass/cassandra/data\ncommitlog_directory: /home/cass/cassandra/commitlog\nsaved_caches_directory: /home/cass/cassandra/saved_caches\nseed_provider:\n - class_name: org.apache.cassandra.locator.SimpleSeedProvider\n parameters:\n - seeds: \"192.168.1.200\"\nlisten_address: 192.168.1.201\nrpc_address: 192.168.1.201\n\n\nany idea what i am missing here ?\n\nalso as you can see i can ping machine#1(my seed node) from machine#2\n\n[cass@cassa2 cassandra]$ ping 192.168.1.200\nPING 192.168.1.200 (192.168.1.200) 56(84) bytes of data.\n64 bytes from 192.168.1.200: icmp_seq=1 ttl=64 time=1.20 ms\n64 bytes from 192.168.1.200: icmp_seq=2 ttl=64 time=0.170 ms\n64 bytes from 192.168.1.200: icmp_seq=3 ttl=64 time=0.167 ms\n^C\n--- 192.168.1.200 ping statistics ---\n3 packets transmitted, 3 received, 0% packet loss, time 2495ms\nrtt min/avg/max/mdev = 0.167/0.515/1.208/0.490 ms\n[cass@cassa2 cassandra]$" ]
[ "cassandra", "cassandra-2.0" ]
[ "Code works in VS but fails in Azure Functions", "The code below works in Visual Studio but fails with \n\nFunctions.HttpTriggerCSharp1. Newtonsoft.Json: Type specified in JSON 'JliffModel.Segment, JliffModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not compatible with 'JliffModel.ISubUnit, JliffModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Path 'units[0].segments[0].$type', line 9, position 28.\n\nin Azure functions. Is this a problem with the Functions runtime?\n\nvar model2 = new JliffModel.File(\"en-US\", \"de-DE\",\n new List<JliffModel.Unit>()\n {\n new JliffModel.Unit(\"1\",\n new JliffModel.Segment(\n new List<JliffModel.IElement>() {new JliffModel.TextElement(\"New fluent source.\")},\n new List<JliffModel.IElement>() {new JliffModel.TextElement(\"New fluent target.\")}\n )\n ),\n new JliffModel.Unit(\"2\", new List<JliffModel.ISubUnit>() {\n new JliffModel.Segment(\n new List<JliffModel.IElement>() {new JliffModel.TextElement(\"Unit 2, Segment 1 source\")},\n new List<JliffModel.IElement>() {new JliffModel.TextElement(\"Unit 2, Segment 1 target\")}\n ),\n new JliffModel.Ignorable()\n })\n });\n\n var binder = new JliffModel.JliffSerializationBinder(\"JliffModel.{0}, JliffModel\");\n\n string output = JsonConvert.SerializeObject(model2, \n Formatting.Indented,\n new JsonSerializerSettings\n {\n ContractResolver = new CamelCasePropertyNamesContractResolver(),\n TypeNameHandling = TypeNameHandling.Auto,\n Binder = binder\n });\n\n var model = JsonConvert.DeserializeObject<JliffModel.File>(output,\n new JsonSerializerSettings\n {\n TypeNameHandling = TypeNameHandling.Auto,\n Binder = binder\n });" ]
[ "json.net", "azure-functions" ]
[ "Crystal Report Credentials Prompt after deployment", "I am Publishing crystal reports on remote server using the following code. when i try to run the crystal report page Crystal report viewer prompt me for database info. As the published crystal report were created using development server. In my crystal report i was using OLEDB ADO Connection \n\nMyRepository _MyRepository = new MyRepository(); \nSystem.Data.SqlClient.SqlConnection myConnection = new System.Data.SqlClient.SqlConnection();\nmyConnection.ConnectionString = ConfigurationManager.ConnectionStrings[\"MyConnStr\"].ConnectionString;\nSystem.Data.SqlClient.SqlCommand MyCommand = new System.Data.SqlClient.SqlCommand(\"dbo.spMySP\");\nMyCommand.Connection = myConnection;\nMyCommand.Parameters.Add(\"@PositionID\", SqlDbType.Int).Value = (cmbPositions.SelectedValue == \"\" ? 0 : Convert.ToInt32(cmbPositions.SelectedValue));\nMyCommand.CommandType = System.Data.CommandType.StoredProcedure;\nSystem.Data.SqlClient.SqlDataAdapter MyDA = new System.Data.SqlClient.SqlDataAdapter();\nMyDA.SelectCommand = MyCommand;\nASale _DS = new ASale();\nMyDA.Fill(_DS, \"dbo.spMySP\");\nrptSale oRpt = new rptSale();\noRpt.SetDatabaseLogon(\"sa\", \"mypass\");\noRpt.SetDataSource(_DS);\noRpt.SetParameterValue(0, \"param1\");\noRpt.SetParameterValue(1, \"param2\");\noRpt.SetParameterValue(2, \"param3\" );\noRpt.SetParameterValue(3, (cmbPositions.SelectedValue == \"\" ? 0 : Convert.ToInt32(cmbPositions.SelectedValue)));\nCrystalReportViewer1.ReportSource = oRpt;" ]
[ "asp.net", "sql-server", "asp.net-mvc", "crystal-reports", "connection-string" ]
[ "sp_who2 BlkBy Sleeping Process Awaiting Command", "When running sp_who2, it appears one of my SQL commands is blocking but waiting on a process that is \"Sleeping\" and \"Awaiting Command\". This doesn't make any sense.\n\n\n\nAny ideas what might be causing this? I know the DELETE is running inside a transaction that previously inserted a lot of rows into the table, could that be the problem?" ]
[ "sql-server", "ssis", "sp-who2" ]
[ "download companywise s&p 500 stock price data in R", "I can download companywise s&p 500 stock price data by using this code\n\nrequire(quantmod)\ngetSymbols(c(\"MSFT\", \"AAPL\", \"GOOGL\"), auto.assign = TRUE, from = \"2005-01-05\",src=\"google\")\n\n\nNow it is diffiult to type all 500 tickers like \"MSFT\", \"AAPL\", \"GOOGL\" this. Is there any solution to avoid this." ]
[ "r", "download", "quantmod", "stock", "price" ]
[ "Action Bar with navigation drawer", "This is very similar to many question already posted on stackoverflow, but I still haven't found the right solution. The problem I'm facing is how to implement a custom actionbar.xml file and add a navigation drawer function to the top left icon. \n\nI'm trying to create an action bar that looks like this with two ImageButtons on side and an ImageView as a logo in the center. When user presses on the left ImageButton from actionbar.xml, I would like navigation drawer coming from the left, like in this tutorial. The last thing that troubles me, is how to put a title of pressed fragment in the center of the action bar instead of a logo.\n\nI've already written all xml and java files, but I just can't put the pieces together. Please help." ]
[ "android", "xml", "navigation", "android-actionbar", "navigation-drawer" ]
[ "How create custom EditText", "I want create custom EditText. It should look like this\n\n\nI crete this, but i can not create vertical line. My EditText:\n\n<EditText\n android:layout_width=\"240dp\"\n android:layout_height=\"wrap_content\"\n android:ems=\"10\"\n android:id=\"@+id/paymentCode\"\n android:layout_gravity=\"center_horizontal\"\n android:drawableLeft=\"@drawable/blue_card\"/>\n\n\nIt looks like this" ]
[ "android", "android-edittext" ]
[ "EF code first, Entities with multiple relations", "Here you can see my reduced entity structure which I would like to store in my Sqlite database. I've a Graph which holds a Set of GraphElements. My Graph consists of Edges, Nodes and Loads which are all different Elements.\n\nFor a deep-first-search for example each node needs to know its neighbor nodes. Therefore I need the NeigborNodes-List. For other functionalities I need also to know the ConnectedElements-List. \n\nclass Graph\n{\n public int Id { get; set; }\n public string Name { get; set; }\n public virtual List<GraphElement> GraphElements { get; set; }\n}\n\n[Table(\"GraphElements\")]\nabstract class GraphElement\n{\n public int Id { get; set; }\n public string Name { get; set; }\n public virtual Graph Graph { get; set; }\n}\n\n[Table(\"Nodes\")]\nclass Node : GraphElement\n{\n public virtual List<Node> NeighborNodes { get; set; }\n public virtual List<GraphElement> ConnectedElements { get; set; }\n}\n\n[Table(\"Edges\")]\nclass Edge : GraphElement\n{\n public virtual Node From { get; set; }\n public virtual Node To { get; set; }\n}\n\n[Table(\"Loads\")]\nclass Load : GraphElement\n{\n public virtual Node From { get; set; }\n}\n\n\nMy model configuration looks at the moment like this and is of course not working. (I'm working with the Table per Type (TPT) approach.) \n\npublic class ModelConfiguration\n{\n private static void ConfigureGridDataCollectionEntity(DbModelBuilder modelBuilder)\n {\n // Graph\n modelBuilder.Entity<Graph>().ToTable(\"Base.GraphTable\")\n .HasRequired(p => p.GraphElements)\n .WithMany()\n .WillCascadeOnDelete(true);\n\n // GraphElement\n modelBuilder.Entity<GraphElement>()\n .HasRequired(p => p.Graph)\n .WithMany(graph => graph.GraphElements)\n .WillCascadeOnDelete(false);\n\n // Edge\n modelBuilder.Entity<Edge>()\n .HasOptional(p => p.From)\n .WithMany(node => node.ConnectedElements) // Convertion error\n .WillCascadeOnDelete(false);\n\n modelBuilder.Entity<Edge>()\n .HasOptional(p => p.To)\n .WithMany(node => node.ConnectedElements) // Convertion error\n .WillCascadeOnDelete(flase);\n\n // Load\n modelBuilder.Entity<Load>()\n .HasOptional(p => p.From)\n .WithMany(node => node.ConnectedElements) // Convertion error\n .WillCascadeOnDelete(false);\n\n // Node\n // No idea at all...\n }\n}\n\n\n\n My question: \n \n (A) How can I change my model configuration or my entities to store NeighborNodes in my database?\n \n (B) How can I change my model configuration or my entities to store ConnectedElements in my database? \n\n\nThank you for the help!" ]
[ "sqlite", "ef-code-first", "entity-framework-6", "polymorphism" ]
[ "Keeping track of MVVM Light messengers in complex program", "Messenger is very useful for communicating between viewmodels. However, as program grows larger, the use of messenger will make the code unreadable and hard to debug. \n\n\nIs there a good way to keep track of messages registered and sent?" ]
[ ".net", "debugging", "mvvm", "mvvm-light", "messenger" ]
[ "xml validate value null", "i will be getting an xml from a web app, something like the one given below.\n\n<note>\n<to>Tove</to>\n<from>J</from>\n<heading>Reminder</heading>\n<body>Some Message</body>\n</note>\n\n\nwill i be able to assert if the value at tag is null something similar to this\n\n<note>\n<to></to>\n<from>J</from>\n<heading>Reminder</heading>\n<body>Some Message</body>\n</note>\n\n\ni need to do it using java and junit." ]
[ "java", "xml", "junit4" ]
[ "How to get TimeZone abbreviation", "I want to create a list of time zones.\nBut I got the following error at timeZone.abbreviation.\n\n-[__NSCFString abbreviation]: unrecognized selector sent to instance 0x19cb80b0\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\n UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@\"Cell\" forIndexPath:indexPath];\n\n // Configure the cell...\n NSTimeZone *timeZone = [[NSTimeZone knownTimeZoneNames] objectAtIndex:indexPath.row];\n cell.textLabel.text = timeZone.abbreviation; // <- Error Here\n cell.detailTextLabel.text = timeZone.description;\n cell.accessoryType = (timeZone == self.timeZone)? UITableViewCellAccessoryCheckmark :UITableViewCellAccessoryNone;\n\n return cell;\n}\n\n\nI tried to search on the internet but I cannot find the solution so far.\nPlease give me some advice.\nThanks in advance." ]
[ "ios", "uitableview", "nstimezone" ]
[ "Error with Tar2RubyScript", "I was following this How-To on Distributing Rails Applications\n\nhttp://www.erikveen.dds.nl/distributingrubyapplications/rails.html\n\nHowever, by the time I do:\n\n$ ruby tar2rubyscript.rb desktopApp/\n\n\nThe output is:\n\ntar2rubyscript.rb:623:in `replace': can't modify frozen String (RuntimeError)\n from tar2rubyscript.rb:623:in `block in <main>'\n from tar2rubyscript.rb:577:in `block in newlocation'\n from tar2rubyscript.rb:505:in `block in newlocation'\n from tar2rubyscript.rb:472:in `newlocation'\n from tar2rubyscript.rb:505:in `newlocation'\n from tar2rubyscript.rb:577:in `newlocation'\n from tar2rubyscript.rb:621:in `<main>'" ]
[ "ruby-on-rails" ]
[ "How to overcome \"A non-serializable value detection\"", "I'm implementing react app with redux-toolkit, and I get such errors when fetching data from firestore.\n\n\n A non-serializable value was detected in an action, in the path: payload.0.timestamps.registeredAt\n \n A non-serializable value was detected in an action, in the path: payload.0.profile.location.\n\n\nThe former's data type is firebase.firestore.Timestamp, and the latter is GeoPoint.\n\nI think both might not be serializable, but I want to fetch those data and show them to users.\nHow can I overcome those errors?\n\nAccording to this issue, I might write like that;\n\nconst store = configureStore({\n reducer: rootReducer,\n middleware: [\n ...getDefaultMiddleware({\n serializableCheck: {\n ignoredActionPaths: ['meta.arg', 'meta.timestamp'], // replace the left to my path\n },\n }),\n reduxWebsocketMiddleware,\n // ... your other middleware\n],\n});\n\n\nBut I'm not sure if it's safe and even if so, I don't know how to write the path dynamic way since my payload is array.\n\n\n\nI'd really appreciate if anyone gives some clue." ]
[ "firebase", "redux", "google-cloud-firestore", "redux-toolkit", "redux-middleware" ]
[ "How to copy cell value and paste under previous cell", "I want a macro to copy data from a certain cell, and copy it to a cell on another work sheet, but I'd like it to be a continuous list. I mean, copying the first cell into A2, then the next into A3, and so on. This is the code I've come up with so far, and it works to copy into cell A2, but it erases the previous data.\n\nOption Explicit\nSub Copy_Data()\nWorksheets(\"PremakeResults\").Range(\"B1\").Copy Worksheets(\"SavedResults\").Range(\"A2\")\nEnd Sub\n\n\nI have a feeling this is a fairly simple macro, but I haven't been looking for the right things on the internet. Any help would be appreciated!\n\nEDIT\n\nI just tried this code\n\nSub Copy_Data()\nWorksheets(\"PremakeResults\").Range(\"B1\").Copy Worksheets(\"SavedResults\").Range(\"A\" & Worksheets(\"SavedResults\").Cells(Worksheets(\"SavedResults\").‌​Rows.Count, \"A\").End(Xlup).Row)\nEnd Sub\n\n\nand while that will copy to the specified page, it still erases over the first entry." ]
[ "excel", "copy", "vba" ]
[ "Android: Mini_Kind and Macro_Kind", "May be a simple question.\n\nWill the thumbnail of Macro_Kind and Mini_Kind be different on different set of devices e.g. tablet and phone?" ]
[ "android", "image", "mediastore" ]
[ "Can data type \"Numeric\" support negative numbers in PostgreSQL?", "I have a column of numbers ranging from -100 to +100. They have from 0 to 9 values after the decimal points. Here are some examples: -32.1235, -5.1234, -12, 6, 6.3, 9.0.\n\nI'm trying to put them into a table and I'm receiving error -\n\n\n invalid input syntax for type numeric: \"-\"\n\n\nI've tried changing the data type to decimal, but I find that it keeps reverting to numeric. And, I want these numbers to be stored precisely.\n\nHow do I input negatives for numerics?\n\nEdit: There's another post that suggests just using data type numeric. I have cast my data as numerics and I'm still receiving the invalid input syntax message." ]
[ "database", "postgresql", "precision", "sqldatatypes" ]
[ "What are good programming practices to prevent malware in standalone applications?", "Does anyone have any thoughts on how to prevent malware attacks on standalone applications. Let's say this is a program on a Windows machine connected to the internet, this is the most common scenario.\n\nI'm also wondering what type of attacks are possible. I believe .NET will do some type of static check on the code before it runs it, using a type of checksum. This would detect a statically attached malicious code snippet. Can this be gotten around?\n\nWhat about dynamically injected code. Separate program spaces prevent this to some degree. What about infecting data files? Is it safer to store data in a database and only use service calls no file operations? \n\nWhat about memory usage techniques to increase security? I know it's not a standalone case, but, the problem with DNS server corruption had to do with a predictable use of, I think, IP addresses. Should memory usage be made more unpredictable?" ]
[ ".net", "security", "malware" ]
[ "How do i store a session array inside jquery variable? Laravel / Jquery", "I'm trying to store a session array inside a jquery variable.\n\nMy code:\n\n<script>\n@if(session()->has('zoektermen'))\n var zoektermen = '{{ session()->get('zoektermen') }}';\n console.log(zoektermen);\n@endif\n</script>\n\n\nPutting in session inside controller:\n\nif(isset($_GET['searchquery'])) {\n $searchquery = $_GET['searchquery'];\n}\n\nif(session()->has('zoektermen')) {\n session()->forget('zoektermen');\n session()->put('zoektermen', $searchquery);\n} else {\n session()->put('zoektermen', $searchquery);\n}\n\n\nBut i'm getting an error because {{ }} expects a string and not an array.\n\nhtmlspecialchars() expects parameter 1 to be string, array given\n\n\nWhat is the correct way to store the array from the session into a JS array?" ]
[ "javascript", "php", "jquery", "arrays", "session" ]
[ "How to update mongodump version?", "I am trying to mongodump (export my Mongo DB) in order to export the db as a .GZIP file. However it rejected as: \n\nError parsing command line: unknown option gzip\n\n\nMy mongodump version is: version 2.6.12\n\nI have heard that update the mongodump version to later than 3.x will repair this issue and it will be available to mongodump with gzip.\n\nHow to do that?\n\nThanks." ]
[ "mongodb" ]
[ "Which Qt library contains QApplication", "I'm using swig to wrap an QT appliction with java (using JNI) , all of procedures gone smooth until , It raised an exception undefined QApplication Exception. \nI thing the problem is that JVM was unable to find the library of QApplication if I load the *.so(Shared Object) of QApplication I somehow manage to eliminate this error.\nPlease tell me where can I find the *.so (shared Object) of QApplication \n Thank you in advance.\n\n //mohan.cpp\n #include <QApplication>\n #include <QPushButton>\n int initQ()\n {\n char *argv[2];\n argv[0]=\"name\";\n argv[1]=\"texteditapplication\";\n int argc=2;\n QApplication app(argc, argv);\n\n QPushButton hello(\"Hello world!\");\n hello.resize(100, 30);\n\n hello.show();\n return app.exec();\n }\n\n//mohan.i\n%module mohan\n\n%{\n/* Put headers and other declarations here */\n #include <QApplication>\n #include <QPushButton>\nint initQ();\n%}\nextern int initQ();\n\n//runme.java\npublic class runme {\n static {\nSystem.out.println(System.getProperty(\"java.library.path\"));\n System.loadLibrary(\"mohan\");\n }\n\n public static void main(String argv[]) {\n System.out.println(mohan.initQ()); \n System.out.println();\n }\n}\n\n\n//execution\n\n[mohan@mohan mohan]$ g++ -fpic -c mohan.cpp mohan_wrap.cxx -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/media/mohan/QtSDK/Desktop/Qt/474/gcc/mkspecs/default -I. -I/media/mohan/QtSDK/Desktop/Qt/474/gcc/include/QtCore -I/media/mohan/QtSDK/Desktop/Qt/474/gcc/include/QtGui -I/media/mohan/QtSDK/Desktop/Qt/474/gcc/include -I. -I. -I/usr/java/jdk1.6.0_33/include/ -I/usr/java/jdk1.6.0_33/include/linux/\n\n[mohan@mohan mohan]$ g++ -shared mohan.o mohan_wrap.o -o libmohan.so\n[mohan@mohan mohan]$ javac runme.java\n[mohan@mohan mohan]$ java -Djava.library.path=. runme\n.\njava: symbol lookup error: /home/mohan/Desktop/mohan/libmohan.so: undefined symbol: _ZN12QApplicationC1ERiPPci\n\n_ZN12QApplicationC1ERiPPci -> **QApplication**" ]
[ "c++", "qt", "java-native-interface", "swig" ]
[ "How to make Android screenshots saved as .jpg?", "I am using ExifInterface to save information for image description. But because screenshots are save .png and ExifInterface doesn't work on .png, I cannot save image description for screenshots. \n\nI have two options:\n\n\nEvery time I need to save EXIF image description, I need to first convert the screenshots to .jpg format, and then edit its EXIF data.\nOr I can just set the phone to save all screenshots as .jpg files. So whenever I save a screenshot (by pressing the volume down key+power button), the screenshot is saved right there and then as .jpg. No hassle trying to convert it later." ]
[ "android", "screenshot", "exif" ]
[ "React-native Horizontal scroll View animate to end", "I have images in scrollview horizontal, I just want that on First swipe all images scroll to end with smooth animation so that user can see all of them with one swipe.\n\nBy using prop scrollToEnd is not helping me as it scrolls way too fast. \n\nHere is my current code .\n\n <ScrollView \n contentContainerStyle={styles.container}\n horizontal={true}\n ref=\"scrollview\"\n onScrollEndDrag={()=> this.refs.scrollview.scrollToEnd({animated: true})}\n >\n <Image width={1800} source={require('./assets/1.png')} />\n <Image width={1800} source={require('./assets/2.png')} />\n <Image width={1800} source={require('./assets/3.png')} />\n <Image width={1800} source={require('./assets/4.png')} />\n <Image width={1800} source={require('./assets/5.png')} />\n <Image width={1800} source={require('./assets/7.png')} />\n <Image width={1800} source={require('./assets/8.png')} />\n <Image width={1800} source={require('./assets/9.png')} />\n <Image width={1800} source={require('./assets/10.png')} />\n </ScrollView>\n\n\nconst styles = StyleSheet.create({\n container: {\n flexGrow:1,\n flexDirection: 'row',\n},\ncover: {\n flexGrow: 1,\n height: \"90%\"\n}\n\n\n});" ]
[ "android", "ios", "animation", "react-native", "scrollview" ]
[ "textfield becomeFirstResponder gives EXC_BAD_ACCESS code", "I have two textfields; on tap of one I open a pickerView and on tap of next textfield I want to remove above opened picker from view and open keyboard but using [textfield becomeFirst Responder] in textFieldShouldBeginEditing textfield delegate method I get EXC_BAD_ACCESS code crash.\n\nThe code is as such:\n\n- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {\nif (textField == earningCodeTextField) {\n [self dismissKeyboard];\n [self showPickerView];\n return NO;\n}\nelse if (textField == codeTextField) {\n [self hidePickerView];\n [codeTextField becomeFirstResponder];\n return YES;\n}\nreturn YES;\n}" ]
[ "ios", "uipickerview", "textfield" ]
[ "How to parse a xls file? (Known languages : Python, Java, Lua)", "I am trying to parse this xls file: \n\nhttp://web.iyte.edu.tr/sks/xls/Agustos_Menu_2012.xls\n\nOrange places have date and belove those dates there are food list of that day. So can you please suggest me a way to parse that to get dates and foods? I tried to convert that xls to comma seperated value but some characters are changing and i don't know how to get dates and foods into an array or a file in an organized way in order to use later.Thanks." ]
[ "java", "python", "parsing", "lua", "xls" ]
[ "How does setTimeout work regarding the window origin and context in JavaScript/TypeScript? (closing tab using window.close() function)", "I recently worked on a project that used React to create a simple site. An Iframe on another domain was called for the user to take some photos and send them to a database, and close the Iframe. On mobile, because of various limitations (like on iOS), instead of an Iframe, a new tab was opened for the photos to be taken. The returning to the original site was done by a Back button on the Iframe and on the new tab, once the pthotos were taken.\nI had to make the Back button work on the new opened tab. Taking the photos meant following some steps, which created history on the new tab's window. I tried many ways, using BroadcastChannel, postMessage and localStorage, to try to communicate to the original site (which, I said, was on another domain), to tell it to close the window, with no success. Having history in tab's window meant that the window.close() function, called from the tab, worked only in the first step, immediately after opening the new tab.\nAfter trying for some weeks with no success, I asked a senior JS programmer to help.\nHis solution, which works, baffled me:\nInside the function that is called on the click event of the Back button, he put the following code:\nfunction backOnClick() {\n //some code\n if (onMobile) {\n setTimeout(() => window.close(), 200)\n return\n }\n //some more code\n}\n\nWhy does this works, but calling the window.close() directly (without setTimeout function) does not?\nDoes it have to do something with context, or is the thread that setTimeout executes on has no history associated with it? I understand why the other solutions failed, but I would really like to know why this works.\nI hope his solution helps someone who is looking to close a tab in web browser, and having trouble with it.\nHats down to the senior developers. I stand in awe every time I witness them solving problems. Cheers!\nEDIT:\nI think I understand what happens, after discussing the matter with some other js programmers. The function backOnClick() is executed at server side, and the server cannot close the client's windows. By putting the close statement in the setTimeout() function, the server gives the closing job to the client, who can close it's own windows.\nHope this helps someone to understand the mechanisms behind the scenes better." ]
[ "javascript", "typescript" ]
[ "Swift, Parse - Unable to search array to check if string is contained in array", "let uuid = UIDevice.currentDevice().identifierForVendor.UUIDString\n\n\n let hitPoint = sender.convertPoint(CGPointZero, toView: self.tableView)\n let hitIndex = self.tableView.indexPathForRowAtPoint(hitPoint)\n let object = objectAtIndexPath(hitIndex)\n object.incrementKey(\"count\")\n object.addObject(uuid, forKey: \"likedBy\")\n object.saveInBackground()\n\n sender.enabled = false\n\n object[\"likedBy\"].whereKey(uuid, notContainedIn: object[\"likedBy\"] as Array)\n\n\nCreating a like button where user clicks like button and the user ID object gets added to the Parse array called \"likedBy.\" I want to set it up where when the user clicks like the code verifies that the user ID isn't in the \"likedBy\" array and correspondingly disables or executes code to insert user ID into the array. I've tried whereKey and contains and both seem to crash. \n\nWhat does work: the object does add the uuid into the likedBy array however since the user can click the like button an infinite amount of times the user ID keeps getting added to the array.\n\nWhat doesn't: Cannot search array for user ID value. Crashes when using contains or WhereKey Equal to as suggested in Parse docs." ]
[ "swift", "parse-platform" ]
[ "Sizing with physical units (cm, inch) in React Native", "I am implementing a "ruler" feature to my app and it is critical that the ruler size/scale, in centimeters, is consistent across multiple devices. That is, 1 'tick' must be always equal to 1 centimenter. Howerver I have not found in any documentation a way to size components using real-world units (cm, inch) like you can do in CSS; Nor have I found a way to accurately get the screen size (in inches or cm) or DPI.\nIs there a way to use cm/inches in React Native or get the REAL screen DPI?" ]
[ "react-native", "screen" ]
[ "Underline shows when using materal-ui InputBase component", "I'm using material-ui InputBase component to create a search bar and it shows an underline. However when I write the same code in another project there is no underline..\nAny clues to what the problem might be?\nHere is the code for the search bar\nimport React from 'react';\nimport { IconButton, InputBase, Paper } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/core/styles'\nimport SearchIcon from '@material-ui/icons/Search'\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n padding: '2px 4px',\n display: 'flex'\n alignItems: 'center'\n width: 400\n },\n input: {\n marginLeft: theme.spacing(1),\n flex: 1,\n },\n iconButton: {\n padding: 10\n }\n}));\n\nexport default function SearchBar() {\n const classes = useStyles();\n \n return (\n <Paper className={classes.root}>\n <InputBase\n className{classes.input}\n placeholder='Search..'\n inputProps={{ 'aria-label': 'search' }}\n />\n <IconButton\n type='submit'\n className={classes.iconButton}\n aria-label='search'\n >\n <SearchIcon />\n </IconButton>\n </Paper>\n )\n}" ]
[ "reactjs", "material-ui" ]
[ "How do I clean up in Dispose if I can't call UIKit from another thread?", "Most of my UIKit Dispose overrides do something with other views before they get destroyed:\n\nprotected override void Dispose (bool disposing)\n{\n if (ScrollView != null) {\n ScrollView.RemoveObserver (this, new NSString (\"contentOffset\"));\n ScrollView.RemoveObserver (this, new NSString (\"contentInset\"));\n ScrollView = null;\n }\n\n base.Dispose (disposing);\n}\n\n\nI just recently realized that Dispose will run on finalizer thread if disposing is false.\nIn this case ScrollView.RemoveObserver will be called from non-UI thread which is Bad.\n\nWhat's the safe way to do UIKit-related cleanup in Dispose?" ]
[ "ios", "xamarin.ios", "uikit", "dispose", "ui-thread" ]
[ "Has anyone used PHP on Heroku?", "The Celadon Cedar stack supports it for FB development...is there anything special about using it for non-FB development?" ]
[ "php", "heroku" ]
[ "Transpose list of vectors to from data.frame", "In an existing project I have taken over, I am facing the problem, that when saving my variables to a table or data frame, they are converted automatically to the data type character, as some of the vectors consist of the string \"error\", whilst others hold a number. Unfortunately, the latter ones are also converted into characters when I create a table.\n\nI have figured out that when I create a data.frame instead of a table, only the columns which contain text are characters, and the rest stay numeric. However, I am facing the problem that some vectors contain more rows than others (a few only hold one argument, others two or three).\n\nWhat I want to do, is create a data.frame out of all these vectors with the values of the vectors in a single row. For instance, this happens:\n\nx <- 1\ny <- c(\"Error\",\"Error\")\ndata.frame(x,y)\n\n x y\n1 1 Error\n2 1 Error\n\n\nI do not want two rows, but the result I am looking for would be:\n\nx <- 1\ny <- t(c(\"Error\",\"Error\"))\ndata.frame(x,y)\n\n x X1 X2\n1 1 Error Error\n\n\nThe first thing I thought of was to do:\n\n> x <- 1\n> y <- c(\"Error\", \"Error\")\n> newframe <- data.frame(t(c(x,y)))\n> class(newframe$X1)\n[1] \"factor\"\n\n\nBut unfortunately, the act of transposing the scalar containing the values of the vectors, as shown by attributes() causes the elements of x to be converted to characters and then to factors when creating the data.frame.\n\nThe trouble is, I do not want to apply t() to multi-row vectors by hand, but much rather would have an option to do this automatically. What I have done for now is write a function that takes a list of variable names as inputs and individually transposes each of them. As my list of vectors is quite long, and I have to do this at multiple times throughout the code, I cannot help but feel like there must be a more elegant way to do this - is there?" ]
[ "r", "dataframe", "type-conversion" ]
[ "Word processor Application for apple Ipad - need suggestions", "I am thinking of creating an word processor application for Ipad which can have basic function like opening, editing and saving. \n\nI need suggestion from you all, about this. (Related application, any third party libraries/sources I can use this for).\n\nAny help is appreciated. \n\nThank You!!" ]
[ "iphone", "ios4", "ipad", "itunes", "word-processor" ]
[ "RISC-V emulator with Vector Extension support", "Where can I find a RISC-V emulator that supports the \"V\" Vector Extension?\n\nI know that the current specification version 0.8 is a draft:\n\n\n This is a draft of a stable proposal for the vector specification to be used for implementation and evaluation. Once the draft label is\n removed, version 0.8 is intended to be stable enough to begin developing toolchains, functional simulators, and initial implementations, though will continue to evolve with minor changes and updates.\n\n\nBut perhaps there is already some initial support in some emulator." ]
[ "vector", "emulation", "simd", "riscv" ]
[ "How do I populate an HTML table using a table from a spreadsheet?", "So I have a simple 4 column table with rows that will be added by a function. I'd like to create and html body that will include a table and be emailed out 3 times per week using google script. I am able to get the data out of the spreadsheet and into a variable. The problem is that I can't make it into a darn table, I know this is probably a simple solution but I am quite new to google script. This is my script;\n\n\r\n\r\nfunction emailsLeanKitchen() {\r\n var ss = SpreadsheetApp.getActiveSpreadsheet();\r\n var Sheet = ss.getSheetByName(\"Sheet1\");\r\n var dataTable = Sheet.getRange(1,1,Sheet.getLastRow(),4).getValues();\r\n Logger.log(dataTable);\r\n GmailApp.sendEmail(\"my email\",\"subject\", dataTable);//\r\n}\r\n\r\n\r\n\n\nAnd if Anyone Knows of a good way to set this script on a timer, that would be cool too because that's my next goal. I've attached a link to my spreadsheet. I appreciate any help!\nhttps://docs.google.com/spreadsheets/d/1X_UcqyXXRMyjZ2j46TymMrIMWvt19HOZTTaEUlIVqwE/edit?usp=sharing" ]
[ "javascript", "html", "google-apps-script", "google-sheets", "gmail" ]
[ "How does System.Object store \"objects\" internally?", "I was reading about boxing, and the book says that \"boxing can be formally defined as the process of explicitly converting a value type into a corresponding reference type by storing the variable in a System.Object.\" (emphasis added)\n\nMy question isn't about boxing, but this got me thinking - how and where does that System.Object instance store the values/variables/objects assigned to it. So I'm wondering about not only\n\nobject objShort = 5;\n\n\nbut also\n\nobject someOtherObj = someReallyComplicatedObject;\n\n\nI've been looking around, including here (MSDN System.Object), and I don't see anywhere that describes how a System.Object instance actually stores its data.\n\nIs the object just simply storing a pointer to the object that was assigned to it, or in the case of boxing, a pointer at the value type on the stack?\n\n(Jon, forgive me if this is in your book too. I have ordered it and it is on the way!)" ]
[ ".net", "object", "store" ]
[ "Creating Django Filter in a bootstrap dropdown based on the django-admin created categories", "I am 2 months into Python-Django and I do not have the full experience to carry on with my what I want to do. \n\nI like to create a Filter or a Dropdown Filter such that anyone can choose from the for-loop rendered categories in the dropdown to filter or search by category. I managed to create a full search with Haystack with Whoosh (You can test my Haystack Search here and search with category called marketing)\n\nCan someone shed more light on how I can filter my list based on categories looped in a dropdown? Am really confused.\n\nHere the code to my working Haystack Search\n\nsearch_indexes.py\n\nimport datetime\nfrom haystack import indexes\nfrom haystack.query import EmptySearchQuerySet\nfrom .models import Mentor\nfrom .models import *\n\n\nclass MentorIndex(indexes.SearchIndex, indexes.Indexable):\n text = indexes.CharField(document=True, use_template=True)\n author1 = indexes.EdgeNgramField(model_attr='first_name')\n author2 = indexes.EdgeNgramField(model_attr='last_name')\n author3 = indexes.EdgeNgramField(model_attr='category')\n author4 = indexes.EdgeNgramField(model_attr='email')\n author5 = indexes.EdgeNgramField(model_attr='location')\n\n def get_model(self):\n return Mentor\n\n def index_queryset(self, using=None):\n \"\"\"Used when the entire index for model is updated.\"\"\"\n return self.get_model().objects.all()\n\n\nhome.html\n\n<form method=\"get\" action=\"/search/\" class=\"navbar-form\">\n <div class=\"form-group\" style=\"display:inline;\">\n <div class=\"input-group\" style=\"display:table;\">\n <input class=\"form-control\" name=\"q\" placeholder=\"Search Mentors Here. You can search by Location, Email, Name, e.t.c.\" autocomplete=\"off\" autofocus=\"autofocus\" type=\"text\">\n <span class=\"input-group-btn\" style=\"width:1%;\">\n <button class=\"btn btn-danger\" type=\"submit\">\n <span class=\" glyphicon glyphicon-search\"></span>\n </button>\n </span>\n </div>\n </div>\n</form>\n\n\napp url config (url.py)\n\nfrom django.conf.urls import include, url\nfrom mentoring_application.views import profile\n\n\nurlpatterns = [\n url(r'^profile/(?P<pk>\\d+)/$', profile, {}, name='mentor-profile'),\n]\n\n\nproject url config (url.py)\n\nfrom django.conf import settings\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.contrib import admin\nfrom mentoring_application.views import HomeView, profile\n\n\nadmin.autodiscover()\n\nurlpatterns = [\n url(r'^admin/', admin.site.urls),\n url(r'^$', HomeView.as_view()),\n url(r'^mentor/', include('mentoring_application.urls', namespace='mentor')),\n url(r'^search/', include('haystack.urls'))\n] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n\n\nviews.py\n\nfrom django.http import HttpResponse, HttpResponseRedirect\nfrom django.shortcuts import render\nfrom django.views import View\nfrom .models import *\nfrom .models import Mentor\nfrom django.shortcuts import render, get_object_or_404\n\n\n# Create your views here.\n\n\nclass HomeView(View):\n # @staticmethod\n def get(self, request, *args, **kwargs):\n mentors = Mentor.objects.all()\n return render(request, \"mentoring_application/home.html\", {\"mentors\": mentors})\n\n\ndef profile(request, pk, template='mentoring_application/profile.html'):\n mentor = get_object_or_404(Mentor, pk=pk) # pk is primary key, so url will be site.com/profile/3\n context = {'mentor': mentor}\n return render(request, template, context)\n\n\nFor more clarity, this picture shows a category filter I like to do." ]
[ "django", "python-2.7", "django-views" ]
[ "Replace Str::parseCallback() when upgrading from Laravel 4", "I am upgrading an app from Laravel 4.2 to 5.0. I have a class that uses the Str: function from Illuminate support as follows:\n\npublic static function controllerActionName()\n {\n $routeArray = Str::parseCallback(Route::currentRouteAction(), null);\n if (last($routeArray) != null) {\n return str_slug(self::controllerName() . '-' . self::actionName());\n }\n return 'closure';\n }\n\n\nThere are several uses of this in the code. LaraShift says: \"The alias for the Str Facade was removed in Laravel 5. While you may still import the Str Facade, you should review the following usages to see if they can be replaced with Laravel Helpers Functions or PHP String functions.\" For the life of me I can't find any documentation on what was supposed to replace this so I can change the syntax. I know there is a library but I'd like to do this right and use current methodology.\n\nhttps://gist.github.com/dwightwatson/6200599 or \nhttps://laravel.com/api/5.2/Illuminate/Support/Str.html" ]
[ "laravel", "laravel-5", "laravel-4", "upgrade" ]
[ "create variable names with specific order in r", "I want to get some variable names with specific order, like this\n\nI0.n, I0.man, I0.woman, I0.low65, I0.up65\n\nI1.n, I1.man, I1.woman, I1.low65, I1.up65\n\n... ... ...\n\nI99.n, I99.man, I99.woman, I99.low65, I99.up65\n\nI tried a way but failed \n\nnum <- sprintf('%02d',0:99)\nindex <- c('n', 'man', 'woman', 'low65', 'up65')\nvars <- paste0('I', num, '.', index)\n\n\nIs there a efficent way to create the variable names with specific order?\n\nAny help will be highly appreciated !" ]
[ "r", "dplyr", "paste" ]
[ "Android - Is getResource() expensive?", "if i need to use a resource twice, is it better to store it in a String?\n\npublic class Testing extends Activity{\n private String c_stringName;\n\n @Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n c_stringName= this.getString(R.string.name);\n\n\n}\n}" ]
[ "android", "resources" ]
[ "Drupal 7: Make an RSS feed with multiple s per node?", "I have a content type \"Audio\" which includes an audio file field. This field accepts multiple values, so each node could contain any number of audio files. Ordinarily, when you build an RSS feed view, it will generate one <item> per node, and each of those will have multiple <enclosure> entries, one per audio file. But for my purposes I need the view to output a separate <item> for each of the audio file values. So if, for example, there are 3 audio files in a selected node, the whole node will be repeated in the feed 3 times, and each one will contain only one audio file enclosure.\n\nThe reason for this is that in my specific case, I'm using hook_node_view() in a custom module to add MRSS tags to each of the nodes that the view generates. So rather than the audio files being wrapped by <enclosure> they'll be wrapped in <media:content> tags. According to the MRSS specification, you shouldn't have more than one <media:content> entry per <item> unless they represent the same content. This is because the other tags like <title> and <description> pertain to all of the <media:content> tags in the same <item>. Ironically enough, the customization hook is the easiest part, but first I need to get the view to output the nodes in the manner I've described.\n\nSo is there some way I can use the new Drupal 7 views grouping feature or some other method to generate the output I'm looking for? I'd love to know the trick! Otherwise I'll have to use a custom menu entry and lose all the advantages (such as automatic caching and being able to work within the Views UI) that I get with Views." ]
[ "drupal", "rss", "drupal-7", "drupal-views", "mediarss" ]
[ "Passing a variable from a thread to a separate arraylist", "I am very new to java and haven't learnt much at the moment but I have a issue.\n\nI am trying to pass a variable that runs in a thread to another java class.\n\nin the client thread I am running:\n\nUserReg UR = new UserReg();\nUR.addUser(userID);\n\n\nand in the separate java class I have got:\n\nimport java.util.ArrayList;\n\npublic class UserReg {\n\n ArrayList userList = new ArrayList();\n\n void addUser (String UserID) { \n userList.add(UserID);\n System.out.println(userList); \n } \n}\n\n\nthe issue I have is that each time a new thread runs then it overwrites the array list and doesn't add to it." ]
[ "java", "class", "variables" ]
[ "mvc3 and entity - basic query dependant on role", "I am very new to .net and mvc3. \n\nIn my app, I have two different roles, Admin and basic user. Admins can see everything, but users can only see items that are linked to them. \n\nI am doing this in my controller:\n\nprivate MembershipExtContext db = new MembershipExtContext();\n[Authorize]\npublic ViewResult Index()\n {\n var thing1s = db.Thing1.Include(i => i.Thing2);\n return View(thing1s.ToList());\n }\n\n\nI would like it so that the basic query (db.Thing1.Include(i => i.Thing2);) return only the items that the current user is allowed to see. Otherwise, I would need to do a separate query for each role. \n\nIs this possible? If so, How?\n\nIf needed I am using mvc3 and entity4 code first." ]
[ "asp.net", "asp.net-mvc-3", "entity-framework-4" ]
[ "FaceBook IFrame App: getLoginStatus fails only in Internet Explorer", "I have a really simple facebook IFrame app that checks whether the current user is logged into facebook. If they are not I wait 1 second then prompt them to login by opening the login dialog.\n\nThis all works perfectly when I run my app in Firefox & in Chrome. But when I run it in Internet Explorer, the Javascript function isLoggedIn() fails/breaks after I use the line\n\nFB.getLoginStatus( function(response) {\n\n\nWhy do you think this happens & do you know how I can fix this? PS: I am using the Javascript SDK of the facebook Graph API.\n\n<!DOCTYPE html>\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:fb=\"http://www.facebook.com/2008/fbml\">\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>\n <title>IFRame Test</title>\n <script type=\"text/javascript\">\n\n function loginUser()\n {\n alert( \"Running loginUser()\" );\n FB.login( function(response) {\n if (response.session) \n {\n if (response.perms) \n {\n // user is logged in and granted some permissions.\n // perms is a comma separated list of granted permissions\n alert( \"With perm\" );\n } \n else \n {\n // user is logged in, but did not grant any permissions\n alert( \"logged in\" );\n }\n } \n else \n {\n // user is not logged in\n alert( \"Not logged in\" );\n }\n }, {perms:'read_stream,publish_stream,offline_access'}); // these are the permissions we ask for\n alert( \"Ending loginUser()\" );\n }\n\n\n function isLoggedIn()\n {\n alert(\"About to Run\");\n FB.getLoginStatus( function(response) {\n\n alert( \"Running isLoggedIn()\" ); // ERROR HERE This line never executes in Internet Explorer\n alert( response.status ); \n if ( response.status == \"unknown\" )\n {\n setTimeout( \"loginUser()\", 1000 );\n }\n else if ( response.status == \"notConnected\" )\n {\n // We dont have permissions but the user is logged in\n setTimeout( \"loginUser()\", 1000 ); // ask for permsissions\n }\n else if ( response.status == \"connected\" )\n {\n // User is logged in & has given my app permissions\n }\n else { alert( \"Weird case\" ); }\n\n });\n }\n\n </script>\n</head>\n<body>\n <h1>IFRame Test</h1>\n <p><fb:login-button autologoutlink=\"true\"></fb:login-button></p>\n <p><fb:like></fb:like></p>\n\n <div id=\"fb-root\"></div>\n <script type=\"text/javascript\">\n window.fbAsyncInit = function() {\n FB.init({appId: '172889292760575', status: true, cookie: true,\n xfbml: true});\n };\n (function() {\n var e = document.createElement('script');\n e.type = 'text/javascript';\n e.src = document.location.protocol +\n '//connect.facebook.net/en_US/all.js';\n e.async = true;\n document.getElementById('fb-root').appendChild(e);\n }());\n alert( \"CONNECTING\" );\n </script>\n\n <div>\n <a href=\"javascript:isLoggedIn()\">ABCD</p>\n </div>\n <script type=\"text/javascript\">\n alert( \"javascriptInner\" );\n isLoggedIn();\n </script>\n</body>\n</html>" ]
[ "javascript", "facebook", "facebook-graph-api" ]
[ "iOS: Firebase Storage set timeout", "when downloading from storage, I would like to set a smaller timeout, e.g. only 5 - 10 seconds, is this possible?\n\nI'm downloadiung like this:\n\n let storage = FIRStorage.storage()\n let storageRef = storage.reference(forURL: \"gs://...\")\n let fileRef = storageRef.child(myLink)\n let downloadTask = fileRef.write(toFile: url) { url, error in\n ..." ]
[ "ios", "swift3", "firebase-storage" ]
[ "Run all tests in PHPunit at once but isolated from each other", "Some of my tests contains ob_start(); which causes an issue if the I simply run vendor/bin/phpunit (run all tests at once) however if I isolate the tests one by one via vendor/bin/phpunit --filter mytest, they work fine.\n\nIs there a way to run the tests \"all at once\" but internally \"isolated\"?" ]
[ "php", "unit-testing", "testing", "phpunit" ]
[ "Attaching javascript events to form widgets", "I have a form with a drop down menu and I want to do a javascript action whenever the user changes the selection. I imagine it is possible find the input later, using javascript, and attach an event to to it; but it seems like it would be easier if there was some sort of attribute or option that could be defined in form->configure(): e.g.\n\n$this->widgetSchema['menu'] = new sfWidgetFormChoice(array(\n ...\n 'onclick' => javascript function\n));\n\n\nobviously this doesn't work, and it probably wouldn't be an onclick method either, but my question is how do you attach a javascript event to a input/widget?" ]
[ "php", "symfony-1.4" ]
[ "Flexslider slow Image loading issue with webkit browsers", "i have noticed a small glitch on with my click here for plugin slides-show in both safari and chrome click herewhen you first load the page only the top half of the image is visible, Then comes into place once you adjust your browser size. I have noticed the issue started to occur when i add the parameter smoothHeight: true, to the (function()Javascript. Below is also a css snippet of my css for the slider. \n\n.homeslider{\nwidth: 97.5%;\nposition: relative;\ntop: 0;\nleft: 0;\n }\n\n.flex-control-nav, .flex-control-paging{\n display: none;\n }\n\n.slides, .flex-control-nav, .flex-direction-nav {\nmargin: 0; padding: 0;\nlist-style: none;\n } \n\n .flexslider .slides > li {\ndisplay: none; \n-webkit-backface-visibility: hidden;\ntop: 0;\n } \n\n .no-js .slides > li:first-child {display: block;}\n\n .slides:after {\ncontent: \".\"; \ndisplay: block; \nclear: both; \nvisibility: hidden; \nline-height: 0; \nheight: 0;\n } \n\n html[xmlns] .slides {\ndisplay: block;\n } \n\n * html .slides {height: 1%;}\n\n\nAny ideas on what maybe causing the issue ?" ]
[ "javascript", "jquery", "css", "jquery-plugins", "flexslider" ]
[ "Cannot resolve symbol Apache in Intellij", "I have been through the other answers but none of them seemed to help me. I am just starting out with programming. \n\nimport jdk.incubator.http.HttpClient;\nimport jdk.incubator.http.HttpResponse;\nimport org.apache.*;\n\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.HttpClient;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.impl.client.HttpClients;\nimport org.apache.http.util.EntityUtils;\n\n\npublic class app {\n public static void main(String[] args) throws JSONException, IOException {\n HttpClient client = HttpClients.createDefault();\n HttpGet get = new HttpGet(\"https://www.youtube.com/watch?v=Qdjna4Nh7DM\");\n HttpResponse res = client.execute(get);\n\n String strng = EntityUtils.toString(res.getEntity());\n System.out.println(strng);\n String str1 = \"playability\";\n if(strng.toLowerCase().contains(str1.toLowerCase())){\n System.out.println(\"waah\");\n }\n else{\n System.out.println(\"naah\");\n }\n }\n}\n\n\nI am trying to get the data out of a site and see if it contains the world playability in it. \n\nThe problem I am having is that intellij cannot resolve symbol apache here.\n\nI have built a maven project with the following pom.xml\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n\n <groupId>driverscrape</groupId>\n <artifactId>driverscrape</artifactId>\n <version>1.0-SNAPSHOT</version>\n\n\n <build>\n <plugins>\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-compiler-plugin</artifactId>\n <configuration>\n <source>1.8</source>\n <target>1.8</target>\n </configuration>\n </plugin>\n </plugins>\n </build>\n</project>\n\n\nAm I missing something? Is there something else that I should do? Please guide me!" ]
[ "java", "apache", "maven" ]
[ "Execute script when select option is changed", "I have a html form which includes a dynamically created dorpdown list. The dropdown list contains the names of newsletters which are stored in my MySQL database. What I want the dropdown list to do is: When I select a newsletter an other php script will activate which will take the data from the newsletter in my DB and writes it to a .txt file. The codes I currently have is:\n\nThe dropdown list:\n\n<?php\n echo \"<select id=\\\"NieuwsbriefSelect\\\" name=\\\"show\\\">\"; \n echo \"<option size =30 selected>Select</option>\";\n if(mysql_num_rows($sql_result)) \n { \n while($row = mysql_fetch_assoc($sql_result)) \n { \n echo \"<option value=\\\"$row[Titel]\\\">$row[Titel]</option>\"; \n } \n\n } \n else {\n echo \"<option>No Names Present</option>\"; \n } \n?>\n\n\nAnd the write script:\n\n<?php\n$title = $_REQUEST[\"show\"];\nmysql_connect('localhost','root','root'); \nmysql_select_db('NAW') or die (mysql_error()); \n$strSQL = \"SELECT Content from NAW.Mail where Titel = '$title' \";\n\n$sql_result = mysql_query($strSQL); \n\n$row = mysql_fetch_assoc($sql_result); \n\n\n$file = 'nieuwsbrief.txt';\n\n$current = $row[\"Content\"];\n\nfile_put_contents($file, $current);\n?>\n\n\nI do not want the page to redirect to the write script but just to execute it (I hope you get this^^). Is this possible using the HTML onChange Event or do I have to use javascript? Any help would be great and if you have a question about my code just ask in the comments!\n\nNOTE!\nI know I shouldn't be using Mysql_* and That I am vulnerable to sql injection but that is not the point." ]
[ "javascript", "html", "onchange" ]
[ "How to open another component page when selecting an option in ion-select in ionic 3", "I want another component page to open when user select an option from ion-select in ionic3. can someone please help on what to do? thanks in advance. Below is my ion-select code..\n\n<ion-content>\n <ion-list>\n <ion-item>\n <ion-label>ENGINEERING & TECHNOLOGY</ion-label>\n <ion-select [(ngModel)]=\"engineering\">\n <ion-option value=\"cse\">CSE</ion-option>\n <ion-option value=\"fse\">FSE</ion-option>\n <ion-option value=\"mee\">MEE</ion-option>\n <ion-option value=\"cve\">CVE</ion-option>\n <ion-option value=\"age\">AGE</ion-option>\n <ion-option value=\"che\">CHE</ion-option>\n <ion-option value=\"eee\">EEE</ion-option>\n </ion-select>\n </ion-item>\n </ion-list>\n</ion-content>" ]
[ "angular", "typescript", "ionic-framework", "ionic3" ]
[ "Test Failures were logged", "I am using Visual Studio 2015 Enterprise Version. I am creating a function using an API call.\n\nWhenever I run Unit Test for that function, the function is executed but after the completion of the test, I get a test failure message with \"91 test failures were logged\" message. The rest of my tests work fine.\n\n\n \n\n\nAny probable solution or any leads?" ]
[ "c#", "unit-testing" ]
[ "WEBAPI CORS Errors after Authentication update", "I have an Angular application running in Azure that connects to my WEBAPI also running in Azure. Seperate websites. Everything works fine, but recently in my API code I started getting this warning:\nSeverity Code Description Project File Line Suppression State\nWarning CS0618 'AzureADAuthenticationBuilderExtensions.AddAzureAD(AuthenticationBuilder, Action<AzureADOptions>)' is obsolete: 'This is obsolete and will be removed in a future version. Use AddMicrosoftWebApiAuthentication from Microsoft.Identity.Web instead. See https://aka.ms/ms-identity-web.' MExBrightsign.API D:\\Repos\\WHQMuseums\\MExBrightsign\\CMS\\MExBrightsign.API\\Startup.cs 53 Active\n\nCurrently I have the following in my startup.cs file:\n services\n .AddAuthentication("Azure")\n .AddPolicyScheme("Azure", "Authorize AzureAd or AzureAdBearer", options =>\n {\n options.ForwardDefaultSelector = context =>\n {\n var authHeader = context.Request.Headers["Authorization"].FirstOrDefault();\n if (authHeader?.StartsWith("Bearer") == true)\n {\n return JwtBearerDefaults.AuthenticationScheme;\n }\n return AzureADDefaults.AuthenticationScheme;\n };\n })\n .AddJwtBearer(opt =>\n {\n opt.Audience = Configuration["AAD:ResourceId"];\n opt.Authority = $"{Configuration["AAD:Instance"]}{Configuration["AAD:TenantId"]}";\n })\n .AddAzureAD(options => Configuration.Bind("AzureAd", options));\n\nIf I change the line:\n.AddAzureAD(options => Configuration.Bind("AzureAd", options));\nto\n.AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAd"));\nI get CORS errors on all my calls from my Angular applications.\nNothing else was changed.\nWhat else do I need to do to NOT get the CORS errors.\nFor now, I am just leaving the obsolete call, but I would like to find a solution before the call is removed.\nThanks for your help.\nEDIT: Additional information\nJason Pan's comment did not help me, but it did get me thinking. I had already configured Azure App Service CORS. I realized that I never actually deployed to Azure and saw the CORS errors. I was running locally. I made the 1 line change, and all Angular calls to the WEBAPI returned with CORS errors.\nNote that I had the following in the startup.cs file of my WEBAPI:\n var origins = Configuration.GetSection("AppSettings:AllowedOrigins").Value.Split(",");\n services.AddCors(o => o.AddPolicy(mexSpecificOrigins, builder =>\n {\n builder.WithOrigins(origins)\n .AllowAnyMethod()\n .AllowAnyHeader()\n .AllowCredentials()\n .SetIsOriginAllowed((host) => true);\n }));\n\nHere is the appsettings.json:\n "AppSettings": {\n "EnvironmentName": "LOCAL",\n "AllowedOrigins": "http://localhost:4200"\n },\n\nSo, I when running locally, I have CORS configured only in the startup.cs, but in Azure, I have both in startup.cs and Azure CORS configuration.\nThe thing bugging me is that I only changed the 1 line. What is the difference with the new calls. I assume it adds additional security. I will try deploying to Azure, and see if the CORS errors continue. If that works, then I only need to worry about local development." ]
[ "azure-active-directory", "cors", "azure-web-app-service", "asp.net-core-webapi", "microsoft-identity-platform" ]
[ "How do I increment a value within an SQL select statement based on values within the query", "If I have a table defined like this in a postgres 12.4 database\nid, name, age, enters, exits\nWithin that table there can be mutliple entries with the same name.\nI want to create a select statement that introduces a group_id column to the results.\nThe group_id will increment based on the value of the exits column. If it contains null then the group_id needs to increment and subsequent rows will belong to the new group_id until the next exits=null is encountered.\nFor example if the info table contains:\nid, name, age, enters, exits\n1, orange, 10, null, 8\n2, orange, 8, 3, 5\n3, orange, 4, 9, null\n4, orange, 11, null, 5\n5, orange, 3, 3, null\n6, lemon, 9, 1, 2\n\nThen a select * type query would return this:\nid, group_id, name, age, enters, exits\n1, 1, orange, 10, null, 8\n2, 1, orange, 8, 3, 5\n3, 1, orange, 4, 9, null\n4, 2, orange, 11, null, 5\n5, 2, orange, 3, 3, null\n6, 3, lemon, 9, 1, 2\n\nI am relatively new to SQL and after lots of searches and attempts I haven't made any progress. Most of the examples out there are much more complicated than this and I don't understand enough to deconstruct them into something that works.\nAny help or pointers appreciated." ]
[ "sql", "postgresql", "count", "sql-null" ]
[ "Generate new attribute using regex in RapidMiner", "I work with Excel-file, which contains several sentences. I would like to generate new attribute (I use \"Generate Attribute\" operator), which returns (“true or false”) if the sentence contains the some numbers with white spaces between them (e.g. 234 45 56). I have used the function “match nominal regex” (matches(sentences,\"\\d+\\s+\\d)) to do this. However, I faced the problem that Rapidminer does not recognize the escape () character. How do I change my Regex to make it work?\n\nSome additional comments/examples: \n\nMy input sentences:\n\nword word 123 345 6665 23456 54 word word word\nword word word 12.3 34.5 6665 23.456 5.4 word word word\nword word word 12,3 34,5 6665 23,456 5.4 word word word\nword word word 12,3% 34,5% 6665% 23,456% 5.4% word word word\n\n\nMy output will be new variable with true or false, if the sentence contains such chain of numbers. \n\nI first thought to use following Regex to capture numbers \\d+[.,]?\\d*\\s+\\d+[.,]?\\d*." ]
[ "java", "regex", "rapidminer" ]
[ "Timertasks using cron expressions EJB3/JBoss 6", "for my EE application, i have to consider clustered timertasks in JBoss 6 Environment. The tasks must be persisted in the database. While application initialization,the tasks must be created and scheduled from these persisted entites.\n\nFor example, i have an entity like this:\n\nclass MyTask {\n private Long id;\n private String cronExpression;\n private String name;\n}\n\n\nI can create new Jobs and CronTriggers using Quartz and using data sources, i can let them synced over cluster instances. But, what is the best strategy in JBoss Environment using EJBs? \n\nUsing Java EE facilities under \"http://download.oracle.com/javaee/6/tutorial/doc/bnboy.html\" i could use @Schedule annotation with cron expressions. But my Job must be created dynamically from entity objects at runtime. How should my bean seem?" ]
[ "java", "jakarta-ee", "cron", "ejb-3.0", "timertask" ]
[ "How to use meta tag keywords as url in magento?", "In my magento store need to be implement the meta tag as url in the Side bar.\n\nI have two types of category in my store. Named as X and Y.\n\nI need to get this type of result.\n\n\nX -> Category X\n\n-x1 \n-x2\n-x3\n\n\n-> Catogery X keywords need to be as url\n\n\nY -> Category Y\n\n-y1\n-y2\n-y3\n\n\n-> Catogery Y keywords need to be as url\n\nHelp me to solve this issue.\n\nRight Now I am using this code\n\n<div class=\"right-tab-middle\">\n\n<?php $_helper = Mage::helper('catalog/category') ?>\n\n<?php $_categories = $_helper->getStoreCategories() ?>\n\n<?php $currentCategory = Mage::registry('current_category') ?>\n\n<?php if (count($_categories) > 0): ?>\n\n<ul style=\"overflow:hidden;\">\n\n<div style=\"color:#BE0171;text-decoration:underline; font-size:16px; font-weight:bold;\">Shop by:</div>\n\n<!-- <?php foreach($_categories as $_category): ?>\n\n<li style=\"margin:10px 0px; \"> \n\n<a style=\"color:#BE0171; text-decoration:none;\" href=\"<?php echo $_helper->getCategoryUrl($_category) ?>\">\n\n<?php echo $_category->getName() ?>\n\n</a>\n\n<?php $_category = Mage::getModel('catalog/category')->load($_category->getId()) ?>\n<?php $_subcategories = $_category->getChildrenCategories() ?>\n\n<?php if (count($_subcategories) > 0): ?>\n\n<ul>\n\n<?php foreach($_subcategories as $_subcategory): ?>\n\n<li style=\"margin:5px 0px 5px 10px; \">\n\n<a style=\"color:#BE0171; text-decoration:none;\" href=\"<?php echo $_helper->getCategoryUrl($_subcategory) ?>\">\n\n<?php echo $_subcategory->getName() ?><br />\n\n</a>\n\n</li>\n\n<?php endforeach; ?>\n\n</ul>\n\n<?php endif; ?>\n\n</li>\n\n<?php endforeach; ?> -->\n\n<?php \n$connection = Mage::getSingleton('core/resource')->getConnection('core_read');\n$sql = \"SELECT GROUP_CONCAT( value SEPARATOR ' ' ) as keywords FROM mag_catalog_product_entity_text WHERE attribute_id=(SELECT attribute_id FROM mag_eav_attribute WHERE attribute_code='meta_keyword')\" ;\n$rows = $connection->fetchAll($sql);\n\n$metaKeywords = $rows[0]['keywords'];\n\n//strip white space and replace with _\n$str = preg_replace('/\\s+/', ' ',$metaKeywords);\n//$str = str_replace(' ','*',$metaKeywords);\n\n$arr = explode(\" \", $str);\n$arr = array_count_values($arr);\narsort($arr);\n\n$i = 0;\n\n\nforeach($arr as $data => $val)\n{ \nif($i<=30)\n{\n\n?>\n\n<li style=\"margin:10px 6px 10px 0px; float:left!important; \"> \n<a href=\"<?php echo $this->getUrl('keywords/view/products/key/') ?><?php echo $data; ?>\" style=\"color:#BE0171; text-decoration:none;\"> <?php echo $data; ?> \n</a> \n</li>\n\n<?php\n\n$i++;\n}\nelse\n{\nbreak;\n}\n}\n\n?>\n\n</ul>\n\n<?php endif; ?> \n\n</div>\n\n\nXY\n\n-x1-y1-x2-y2 -> all keywords show in this code.\n\nBut I need to implement the above order." ]
[ "magento", "meta-tags" ]
[ "I need a tick mark in material dropdown", "html\n\n\n\n <th mat-header-cell *matHeaderCellDef> M </th>\n <td mat-cell *matCellDef=\"let element\">\n\n <mat-select [(ngModel)]=\"element.Monday\">\n\n <mat-option [value]=\"active.ID\" *ngFor=\"let active of activeList\">\n {{ active.Value }}\n </mat-option>\n </mat-select>\n </td>\n</ng-container>\n\n\nts file\n\nactiveList = [\n {\"ID\":\"1\",\"Value\":\"`✔`\"},\n {\"ID\":\"0\",\"Value\":\"X\"},\n {\"ID\":\"L\",\"Value\":\"L\"},\n {\"ID\":\"UL\",\"Value\":\"UL\"},\n {\"ID\":\"PL\",\"Value\":\"PL\"},\n {\"ID\":\"BT\",\"Value\":\"BT\"},\n {\"ID\":\"H\",\"Value\":\"H\"}\n ];" ]
[ "angular", "angular-material" ]
[ "Where is the SQLite database file stored in an Blackberry 10 app developed with Titanium?", "I'm trying to build an BlackBerry 20 app with Appcelerator Titanium where I'm using SQLite functionality with the Titanium Ti.Database object. Ti.Database creates and manages a SQLite database in the app. The database is created fine and contains values which I can get by a SQL query. \n\nRunning the app in the simulator I have access to /accounts/1000/appdata/ folder. I looked at every subfolder, but I didn't found any file where my SQLite data is stored.\n\nSo, where does a BlackBerry 10 store such a SQLite database file?" ]
[ "titanium", "appcelerator", "blackberry-10" ]
[ "Play MP3 using SoundPlayer after conversion to WAV using NAudio", "I want to play MP3 file downloaded from the web using NET provided System.Media.SoundPlayer mechanism. As it works with WAV formats, it requires the support of e.g. NAudio library - I need to convert MP3 to WAV. \n\nI want to do all operations in memory, as I need it to be so called fast, but I have problems. Below I've shown code which works as expected, but it cooperates with files. Instead I need to make it working using memory operations only.\n\n(1) works, but involves disk operations:\n\npublic void Speak(Uri mp3FileUri)\n{\n using (var client = new WebClient())\n {\n using (var networkStream = client.OpenRead(mp3FileUri))\n {\n if (networkStream != null)\n {\n var temp = Path.GetTempPath();\n var mp3File = Path.Combine(temp, \"file.mp3\");\n var wavFile = Path.Combine(temp, \"file.wav\");\n using (var fileStream = File.Create(mp3File))\n {\n networkStream.CopyTo(fileStream);\n }\n using (var reader = new Mp3FileReader(mp3File))\n {\n WaveFileWriter.CreateWaveFile(wavFile, reader);\n } \n using(var player = new SoundPlayer(wavFile))\n {\n player.Play();\n }\n }\n }\n }\n}\n\n\n(2) doesn't work - no exception is thrown, but nothing is played:\n\npublic void Speak(Uri mp3FileUri)\n{\n using (var client = new WebClient())\n {\n using (var networkStream = client.OpenRead(mp3FileUri))\n {\n if (networkStream != null)\n {\n var memStream = new MemoryStream();\n networkStream.CopyTo(memStream);\n memStream.Position = 0;\n using (var reader = new Mp3FileReader(memStream))\n {\n var outStream = new MemoryStream();\n using (var writer = new WaveFileWriter(outStream, reader.WaveFormat))\n {\n var num = 0L;\n var buffer = new byte[reader.WaveFormat.AverageBytesPerSecond * 4];\n while (true)\n {\n var count = reader.Read(buffer, 0, buffer.Length);\n if (count != 0)\n {\n num += count;\n if (num <= int.MaxValue)\n writer.Write(buffer, 0, count);\n else\n throw new InvalidOperationException(\"Too large file or endless stream.\");\n }\n else\n break;\n }\n writer.Flush();\n outStream.Position = 0;\n using(var player = new SoundPlayer(outStream))\n {\n player.Play(); /* why silence ? */\n }\n } \n }\n }\n }\n }\n}\n\n\nHow can it be done and what is wrong with the second code sample ?" ]
[ "c#", ".net", "naudio" ]
[ "Issue with nested For/Next loop and filling array", "I am working in VBA assignment and need to make an array that auto populates the values 16 to 9 in reverse order. this is my current code:\n\nnTeams = 16 ' variable to enable other size brackets\n\nReDim arrBracket(nTeams / 2) '<< ReDim array to appropriate size\n\n\n'***** Fill the array where element 1 of the array holds the value of the\n' lowest seed (e.g. if 16 teams, element 1 has a value of 16)\n\n' vvv your For/Next loop below\nDim nTeams2 As Integer ' Place holder for For/Next loop\n\nFor i = 1 To (nTeams / 2)\n For nTeams2 = nTeams To (nTeams / 2) Step -1\n arrBracket(i) = nTeams2\n Next nTeams2\nNext i\n\n\nThe issue is that it now is only filling the array with the number 8 for each of the 8 elements, rather than 16, 15, 14, 13, etc.\n\nHere is the loop my professor included to check the work:\n\nFor i = LBound(arrBracket()) To UBound(arrBracket()) ' loops through the array\n Debug.Print i & \" vs \" & arrBracket(i) ' sends array info to immediate window\nNext i" ]
[ "vba", "excel" ]
[ "What is the matter with printing some float values?", "i would like to know what is my problem when i try to print some float values, for example, in this simple programme :\nfloat n = 127.998 ;\nprintf("%f",n);\n\nThe execution gives : 127.998001.\n\nSo why i have the additional 1 back of this number ?" ]
[ "c" ]
[ "StackOverflowException in mergesort code", "so I am currently doing A Level Computer Science and am coming to the end of my first year at college. As we only have 1 year left we have started our NEA project and in an attempt to start as early as possible I have started it now instead of in a months time, because I'm aiming for an A/A*. To give you some background information on the project I am doing, it will be a balloon tower defense style game coded in procedural VB.Net and to sort the scoreboard I am using merge sort which I have coded recursively (anything recursive gives extra marks). Just giving you a heads up now I am fairly new to coding and it has probably been made horrible, in all honesty I don't really know but just as a pre-warning\n\nThis is the entire Sort algorithm Code:\n\nHighscore is a structure defined as an array with Score as Integer, and name as String. \n\nSub AddNewScore(ByRef HighScore() As Score)\n 'ByVal NewScore As Score\n 'Test Purposes only Remove for fullbuild\n Dim TempName As String\n Dim TempScore As Integer\n Console.WriteLine(\"Enter the Name:\")\n TempName = Console.ReadLine\n Console.WriteLine(\"Enter the Score\")\n TempScore = Console.ReadLine\n\n If HighScore(9).Score < TempScore Then\n HighScore(9).Score = TempScore\n HighScore(9).Name = TempName\n End If\n 'Test Purposes only Remove for fullbuild\n\n 'If HighScore(9).Score < NewScore.Score Then\n 'HighScore(9) = NewScore\n 'End If\n MergeCore(HighScore)\nEnd Sub\n'Sorting Algorithm\nSub MergeCore(ByVal HighScore() As Score)\n Dim Left As Integer = 0\n Dim Right As Integer = 9\n Split(HighScore, 0, 9)\nEnd Sub\nSub Split(ByRef HighScore() As Score, ByVal Left As Integer, ByVal Right As Integer)\n If Left < Right Then\n Dim Mid As Integer = (Left + Right) / 2\n Split(HighScore, Left, Mid)\n\n Split(HighScore, Mid + 1, Right)\n\n Merge(HighScore, Left, Mid, Right)\n End If\n\nEnd Sub\nSub Merge(ByRef HighScore() As Score, ByVal Left As Integer, ByVal Mid As Integer, ByVal Right As Integer)\n Dim LSize As Integer = Mid - Left + 1\n Dim RSize As Integer = Right - Mid\n Dim LeftA(LSize) As Integer\n Dim RightA(RSize) As Integer\n Dim LPointer As Integer\n Dim RPointer As Integer\n For LP = 0 To LSize - 1\n LeftA(LP) = HighScore(Left + LP).Score\n Next\n For RP = 0 To RSize - 1\n RightA(RP) = HighScore(Mid + 1 + RP).Score\n Next\n LPointer = 0\n RPointer = 0\n Dim OriginalPointer As Integer = Left\n While LPointer < LSize And RPointer < RSize\n If LeftA(LPointer) <= RightA(RPointer) Then\n HighScore(OriginalPointer).Score = LeftA(LPointer)\n LPointer += 1\n Else\n HighScore(OriginalPointer).Score = RightA(RPointer)\n RPointer += 1\n End If\n OriginalPointer += 1\n End While\n While LPointer < LSize\n HighScore(OriginalPointer).Score = LeftA(LPointer)\n LPointer += 1\n OriginalPointer += 1\n End While\n While RPointer < RSize\n HighScore(OriginalPointer).Score = RightA(RPointer)\n RPointer += 1\n OriginalPointer += 1\n End While\n Console.WriteLine(\"ScoreBoard\")\n For I = 0 To 9\n Console.WriteLine(HighScore(I).Name & \" \" & HighScore(I).Score)\n Next\n Console.WriteLine()\nEnd Sub\nEnd Module\n\n\nThe error (\"Exception of type System.StackOverFlowException has been thrown\") is in the Sub Split line of this code:\n\n Sub Split(ByRef HighScore() As Score, ByVal Left As Integer, ByVal Right As \n Integer)\n If Left < Right Then\n Dim Mid As Integer = (Left + Right) / 2\n Split(HighScore, Left, Mid)\n\n Split(HighScore, Mid + 1, Right)\n\n Merge(HighScore, Left, Mid, Right)\n End If\n\nEnd Sub\n\n\nAny help would be much appreciated and any tips on anything else would be gratefully appreciated as well \n\nThanks" ]
[ "vb.net", "recursion", "stack-overflow", "mergesort" ]
[ "startup is not getting called for Dojo Custom Widget", "I created a Custom Widget in Dojo\n\n return declare(\"DrawTools\", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {\n templateString: template,\n layers: [],\n constructor: function (featureLayerArr) {\n\n },\n postCreate: function () {\n\n },\n startup: function () {\n var menu = new DropDownMenu({ style: \"display: none;\" });\n var menuItem1 = new MenuItem({\n label: \"Save\",\n iconClass: \"dijitEditorIcon dijitEditorIconSave\",\n onClick: function () { alert('save'); }\n });\n menu.addChild(menuItem1);\n\n var menuItem2 = new MenuItem({\n label: \"Cut\",\n iconClass: \"dijitEditorIcon dijitEditorIconCut\",\n onClick: function () { alert('cut'); }\n });\n menu.addChild(menuItem2);\n menu.startup();\n var button = new DropDownButton({\n label: \"hello!\",\n name: \"programmatic2\",\n dropDown: menu,\n id: \"progButton\"\n }, this.drawToolsMenuNode).startup();\n },\n startMenu: function () {\n\n }\n });\n\n\nWdiget template is as follows\n\n<div>\n <div data-dojo-attach-point=\"drawToolsMenuNode\"></div>\n</div>\n\n\nI am instantiating Widget in another Custom Widget as follows\n\nvar drawTools = new DrawTools(this.allLayersArr);\ndrawTools.placeAt(this.drawToolsNode);\ndrawTools.startMenu();\n\n\nstartup method for DrawTools widget is not getting called.\n\nNeed help in this regard." ]
[ "dojo", "widget" ]