texts
sequence
tags
sequence
[ "VBA - optimize runtime for hiding columns", "I have a worksheet with a table of 50 years, starting from 2017 to 2066. This macro is making a print area for the first 10 years, with the tenth year being a user input and hiding any other columns. We would remove the 10th consecutive year (2026) and replace it with the user input only if the user input is greater than 2026. \n\nI'm finding that my macro is really slow and I'm looking for feedback on how to speed it up.\n\nWith Sheet1\n If userinputyear > 2026 Then\n c = 10 'column index corresponding to consecutive 10th year 2026\n Do While .Cells(5, c) <> userinputyear\n .Cells(5, c).EntireColumn.Hidden = True\n c = c + 1\n Loop\n Do While c + 1 <> 50 'column index corresponding to year 2066\n .Cells(5, c + 1).EntireColumn.Hidden = True\n c = c + 1\n Loop\nend with" ]
[ "vba", "search", "optimization" ]
[ "I'm getting an error \"Msg 8114, Level 16, State 5, Procedure sp_DRPL_MassChangeClient, Line 0 Error converting data type varchar to int.\"", "I've checked all the tables in question and I've declared all variables correctly.\n\nthe code below calls on a very basic stored procedure which can be provided if needed (I'm not sure how to add it in here properly)\n\nDECLARE @DebtorsDebtID AS uniqueidentifier\n DECLARE @OldClient AS varchar(15)\n DECLARE @ClientID AS varchar(15)\n DECLARE @UserName AS varchar(20)\n DECLARE @Rows AS int\n DECLARE @Count AS int\n DECLARE @ID AS int\n DECLARE @DebtID AS int\n SET @UserName = 'rhys.bartley'\n SET @OldClient = 'TMTEST'\n SET @ClientID = 'ECCOMMERCIAL'\n\n SELECT tblDebt.PK_DebtID INTO #tmp\n FROM tblDebt \n WHERE tblDebt.PK_DebtID = 233101\n\n SELECT @Rows = @@ROWCOUNT, @Count = 0\n\n WHILE (@Count < @Rows)\n BEGIN\n SELECT TOP 1 @ID = PK_DebtID FROM #tmp\n SELECT @DebtorsDebtID = PK_DebtorsDebtID FROM tblDebtorsDebt where FK_DebtID = @ID\n\n EXEC sp_DRPL_MassChangeClient @DebtorsDebtID,@OldClient,@ClientID,@UserName,@DebtID\n\n DELETE #tmp WHERE PK_DebtID = @ID\n SELECT @Count = @Count + 1\n END\n\n\nsp_DRPL_MassChangeClient\n\nUSE [BailiffDB]\nGO\n\nSET ANSI_NULLS ON\nGO\nSET QUOTED_IDENTIFIER ON\nGO\n\nALTER PROCEDURE [dbo].[sp_DRPL_MassChangeClient]\n @DebtorsDebtID AS uniqueidentifier,\n @DebtID AS int, \n @OldClient AS varchar(15),\n @ClientID AS varchar(15),\n @UserName AS varchar(20)\n\n\nAS\nBEGIN\n\n SET NOCOUNT ON;\n DECLARE @BatchNo int\n SET @BatchNo = 2457\n\n\n UPDATE tblArrangement SET FK_ClientID = @ClientID WHERE FK_DebtorsDebtID = @DebtorsDebtID\n UPDATE tblDebt SET FK_ClientID = @ClientID WHERE PK_DebtID = @DebtID\n UPDATE tblDebtorsDebt SET FK_ClientID = @ClientID WHERE PK_DebtorsDebtID = @DebtorsDebtID\n UPDATE tblLetterActivity SET FK_ClientID = @ClientID WHERE FK_DebtID = @DebtID\n UPDATE tblTransactions SET FK_ClientID = @ClientID WHERE FK_DebtID = @DebtID\n UPDATE tblTransactionsDistributed SET FK_ClientID = @ClientID WHERE FK_DebtID = @DebtID\n UPDATE tblTransactionsDistributed_Cancelled SET FK_ClientID = @ClientID WHERE FK_DebtID = @DebtID\n UPDATE tblTransactions_Cancelled SET FK_ClientID = @ClientID WHERE FK_DebtID = @DebtID\n UPDATE tblDebtLoad SET FK_ClientID = @ClientID WHERE PK_DebtID = @DebtID\n UPDATE tblBatchNo SET FK_ClientID = @ClientID WHERE PK_BatchNo = @BatchNo\n\nEND" ]
[ "sql", "sql-server", "int", "converter", "varchar" ]
[ "Extension to class for NSCoding protocol conformance", "I need to extend a class for NSCoding protocol conformance. This is what I tried:\n\nextension GTLTasksTask : NSCoding {\n\n public func encodeWithCoder(aCoder: NSCoder) {\n\n }\n\n public convenience init(coder aDecoder: NSCoder) {\n\n }\n\n}\n\n\nBut I get two errors:\n1. Initializer requirement 'init(coder:)' can only be satisfied by a required initializer in the definition of non-final class 'GTLTasksTask'\n2. Convenience initializer for 'GTLTasksTask' must delegate (with 'self.init')\n\nSomeClass in this example does not have a designated initialiser, though it's super class has an init method. But as per swift documentation convenience initialisers cannot invoke super.init.\nI tried making init(coder) a designated initialiser, but that isn't allowed in an extension\n\nIs it not possible to conform this to NSCoding via an extension?" ]
[ "ios", "swift" ]
[ "How can I automate CKAN data exportation to Virtuoso Open Source Edition?", "I'm developing an open data portal with Drupal and CKAN. But now client wants to add Virtuoso Open Source service as a SPARQL endpoint and linked data tool.\n\nThe system architecture is similar to the following image of datos.gob.es (Spanish government's open data portal).\n\n\n\nI'm having difficulty understanding the data loading dynamics from CKAN to Virtuoso, and official documentation doesn't help at all.\n\nBy now I have found next options but do not satisfy my actual problem.\n\n\nManually Upload .rdf files at Quad Store Upload by Conductor Interface (NOT AUTOMATIC)\nCommercial Version has possibility to connect PostgreSQL CKAN database via ODBC connector. (NOT OPEN SOURCE)\nUse RDF bulk loading process, uploading .rdf files to temp directory and launching ld_dir() and rdf_loader_run() (NOT AUTOMATIC BY DEFAULT)\nUse Virtuoso Jena Provider (¿COMPLEX SCENARIO?)\n\n\nPerfect scenario would be a kind of bypass connection that when you upload new dataset to CKAN automatically upload its rdf file to Virtuoso.\n\nI don't know if i am totally lost with Virtuoso functionality. But is there a way to connect CKAN to Virtuoso so that it gets the .rdf or .ttl files automatically? Thanks." ]
[ "ckan", "virtuoso", "openlink-virtuoso" ]
[ "How to know if removed File monitored by File Observer is a Directory or a File", "I'm using FileObserver to monitor changes in folders. \n\nEvents are triggered as expected but I have problem making a distinction between Files and Directories in the events DELETE and MOVED_FROM, since after the event is triggered, calling both File.isFile() and File.isDirectory() is false (which make sense). \n\nIs there an efficient way to make this check before file is removed? I do have a workaround by listing all files in effected folder, however it's inefficient. \n\nFileobserver code: \n\n mFileObserver = new FileObserver(DIRECTORY.getPath()) {\n @Override\n public void onEvent(int event, String path) {\n event &= FileObserver.ALL_EVENTS;\n switch (event) {\n case (CREATE):\n case (MOVED_TO):\n Log.d(TAG, \"Added to folder: \" + DIRECTORY + \" --> File name \" + path);\n addChild(path);\n break;\n case (DELETE):\n case (MOVED_FROM):\n Log.d(TAG, \"Removed from folder \" + DIRECTORY + \" --> File name \" + path); \n removeChild(path);\n break;\n case (MOVE_SELF):\n case (DELETE_SELF):\n removeDirectory();\n break;\n }\n } \n };\n\n\nEDIT:\n\nThis is how is File/Folder is evaluated in removeChild(String) \n\nprivate void removeChild(String name) {\n\n mFileObserver.stopWatching();\n\n String filepath = this.getAbsolutePath() + separator + name;\n File file = new File(filepath);\n if (file.exists())\n Log.d(TAG, \"Exists\");\n else Log.d(TAG, \" Does not Exists\");\n\n if (file.isDirectory())\n Log.d(TAG, \"is Directory\");\n else Log.d(TAG, \" is NOT Directory\");\n\n if (file.isFile())\n Log.d(TAG, \"is File\");\n else Log.d(TAG, \" is NOT File\");\n }\n\n\nAnd the relevant logcat output is:\n\n04-03 12:37:20.714 5819-6352: Removed from folder /storage/emulated/0/Pictures/GR --> File name ic_alarm_white_24dp.png\n04-03 12:37:20.714 5819-6352: Does not Exists\n04-03 12:37:20.714 5819-6352: is NOT Directory\n04-03 12:37:20.714 5819-6352: is NOT File" ]
[ "android", "file", "fileobserver" ]
[ "Why can i use requests in Python shell but i get the error no module found in Django?", "I get the error module not found when trying to import requests in Django.\n\nI cannot get python module requests to work in Django. I have installed the module using pip in python and can import in the python terminal.\n\nModuleNotFoundError: No module named 'requests'\n\nif I run the commands in python shell:\n\n>>> import requests\n>>> test = requests.get(url=\"http://192.168.9.186:2480/connect/test\")\n\n\n\ni get a htto 204 response but in django I just get the module error" ]
[ "django", "import", "module", "python-requests" ]
[ "How to convert a big project to requirejs", "The project is use js like this:\n\nOne jsp:\n\n<script type=\"text/javascript\" src=\"**********\"/>\n<script type=\"text/javascript\" src=\"**********\"/>\n<script type=\"text/javascript\" src=\"**********\"/>\n\n\nand each js file is like:\n\n$.omatrix.a = {\n amethod : function(){\n\n}\n$.omatrix.a.summary = {\n\n\n}\n\n\nand so on.\n\nBecause I will use two js files, they are all fusioncharts, one is charts, and the other is widgets,\nand the two file conflict, so I have to use requirejs to resolve the situation.\nBut when I use, I found the one js file $.omatrix is undefined, I don't know why." ]
[ "javascript", "requirejs" ]
[ "Appending/Growing List Elements Separately in r", "I have a loop with an embedded function inside, which creates a list with the same elements but different length each time. I want the created list of elements to grow or merge in each loop. Here is a very simplified visualization of it:\n# Code Body-------------------------------------------------------------\ndesiredList <- list()\n\n\nfor (i in 1:3){\n \n # "existingList" has three dataframes of A, B embedded \n # A is a dataframe with x1 and x2 columns\n # B is a vector\n # A, B values are calculated using "somefunction" &\n # in each loop their lenght differ\n existingList <- somefunction(variable[i])\n \n # "desiredList" should also have three dataframes of A, B \n # In each loop, gererated Ai, Bi append to A, B elements of "desiredList"\n desiredList <- append(desiredList, (existingList))\n}\n\n# existingList in each loop--------------------------------------------\n# i=1................................ \nA:'data.frame': 3 obs. of 2 variables: \n ..$ x1: num [1:3] 1 2 3 \n ..$ x2: num [1:3] 13 26 39 \nB:'data.frame': 1 obs. of 1 variables: \n ..$ b: num [1:1] 2.6 \n\n# i=2................................ \nA:'data.frame': 2 obs. of 2 variables: \n ..$ x1: num [1:2] 4 5 \n ..$ x2: num [1:2] 52 65 \nB:'data.frame': 3 obs. of 1 variables: \n ..$ b: num [1:3] 5.2 7.8 10.4 \n\n# i=3................................ \nA:'data.frame': 5 obs. of 2 variables: \n ..$ x1: num [1:5] 6 7 8 9 10 \n ..$ x2: num [1:5] 78 91 104 117 130 \nB:'data.frame': 2 obs. of 1 variables: \n ..$ b: num [1:2] 13 15.6 \n\n# desiredList at the end of the loop\nA:'data.frame': 10 obs. of 2 variables: \n ..$ x1: num [1:10] 1 2 3 4 5 6 7 8 9 10\n ..$ x2: num [1:10] 13 26 39 52 65 78 91 104 117 130\nB:'data.frame': 6 obs. of 1 variables: \n ..$ b: num [1:6] 2.6 5.2 7.8 10.4 13 15.6 \n\n\nI have tried "append", "lapply", "Map", and bunches of other functions. However, none gives the correct answer." ]
[ "r", "list", "for-loop", "append" ]
[ "Group array of nested objects with multiple levels in JavaScript", "I'm trying to group a big nested object with multiple properties such as this one :\n\n[\n {\n \"id\": 14,\n \"name\": \"Name14\",\n \"theme\": true,\n \"sub\": {\n \"id\": 70,\n \"name\": \"Name70\"\n }\n },\n {\n \"id\": 14,\n \"name\": \"Name14\",\n \"theme\": true,\n \"sub\": {\n \"id\": 61,\n \"name\": \"Name61\"\n }\n },\n {\n \"id\": 14,\n \"name\": \"Name14\",\n \"theme\": true,\n \"sub\": {\n \"id\": 4,\n \"name\": \"Name4\",\n \"sub\": {\n \"id\": 5,\n \"name\": \"Name5\",\n \"sub\": {\n \"id\": 29,\n \"name\": \"Name29\"\n }\n }\n }\n },\n {\n \"id\": 14,\n \"name\": \"Name14\",\n \"theme\": true,\n \"sub\": {\n \"id\": 4,\n \"name\": \"Name4\",\n \"sub\": {\n \"id\": 5,\n \"name\": \"Name5\",\n \"sub\": {\n \"id\": 8,\n \"name\": \"Name8\",\n \"sub\": {\n \"id\": 163,\n \"name\": \"Name163\"\n }\n }\n }\n }\n },\n {\n \"id\": 10,\n \"name\": \"Name10\",\n \"sub\": {\n \"id\": 4,\n \"name\": \"Name4\"\n }\n }\n]\n\n\nAs you can see, the \"sub\" are not arrays as of now, but they would be in the expected output even if there's only one object in it.\nI'd like to group the array by object's id recursively to get this kind of output :\n\n[\n {\n \"id\": 14,\n \"name\": \"Name14\",\n \"theme\": true,\n \"sub\": [\n {\n \"id\": 70,\n \"name\": \"Name70\"\n },\n {\n \"id\": 61,\n \"name\": \"Name61\"\n },\n {\n \"id\": 4,\n \"name\": \"Name4\",\n \"sub\": [\n {\n \"id\": 5,\n \"name\": \"Name5\",\n \"sub\": [\n {\n \"id\": 29,\n \"name\": \"Name29\"\n },\n {\n \"id\": 8,\n \"name\": \"Name8\",\n \"sub\": [\n {\n \"id\": 163,\n \"name\": \"Name163\"\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n },\n {\n \"id\": 10,\n \"name\": \"Name10\",\n \"sub\": [\n {\n \"id\": 4,\n \"name\": \"Name4\"\n }\n ]\n }\n]\n\n\nSo far, I tried some shenanigans with lodash and d3.nest() but I just can't seem to group it.\nHave you guys ever face something similar? And if so, how did you manage to code this?\n\nThanks a lot" ]
[ "javascript", "arrays", "node.js", "group-by", "nested" ]
[ "DataGrid throws IndexOutOfRangeException from CurrencyManager when any cell clicked", "I have a data grid on a windows form.\n\nWhen I initially update that grid to contain data, and then click on it, I get the below exception.\n\nNotably the exception is deep down in the windows handling of the form, \nand so the exception is caught at the point whereby I launch the form.\n\nPlease note, I had to tick \"Show External Code\" in the Call Stack to show the Call Stack below, otherwise it just shows [External Code].\n\nIn terms of hunches/troubleshooting steps, thinking that it may have been caused by a message that is fired for the item which was selected and then the item which is now selected, I have tried to .SelectAll(); on the DataGridView after updating the data, this had the same results.\n\nThe Exception:\n\nIndexOutOfRangeException\n{\"Index -1 does not have a value.\"}\n\n\nThe Call Stack:\n\nSystem.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.this[int].get(int index) + 0xa1 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.CurrencyManager.Current.get() + 0x16 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.DataGridViewDataConnection.OnRowEnter(System.Windows.Forms.DataGridViewCellEventArgs e) + 0x101 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnRowEnter(ref System.Windows.Forms.DataGridViewCell dataGridViewCell = null, int columnIndex = 1, int rowIndex = 0, bool canCreateNewRow, bool validationFailureOccurred) + 0x218 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.SetCurrentCellAddressCore(int columnIndex = 1, int rowIndex = 0, bool setAnchorCellAddress, bool validateCurrentCell, bool throughMouseClick = true) + 0x59f bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnCellMouseDown(System.Windows.Forms.DataGridView.HitTestInfo hti, bool isShiftDown, bool isControlDown) + 0x12db bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnCellMouseDown(System.Windows.Forms.DataGridViewCellMouseEventArgs e) + 0x318 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.OnMouseDown(System.Windows.Forms.MouseEventArgs e) + 0x153 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseDown(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0xcf bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x86e bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.DataGridView.WndProc(ref System.Windows.Forms.Message m) + 0x92 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x10 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x31 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 513, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes \n[Native to Managed Transition] \n[Managed to Native Transition] \nSystem.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = 4, int pvLoopData = 0) + 0x24e bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = 4, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.Application.ModalApplicationContext}) + 0x177 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x61 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form) + 0x33 bytes \nSystem.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) + 0x373 bytes" ]
[ "c#", "winforms", "datagrid" ]
[ "How to set a default value in selectOneMenu ? JSF or Primefaces", "I want to show a Default(selected) Value in a selectOneMenu. In the selectOneMenu i show Person Object from a list. But i want to add a String value like \"Please choose a value\". And i want to show this String as Default, so that the user have to choose some of the existing Person Object in the Select One Menu. My result is, that the String value \"Please choose a value\" exists, but it is not as the Default (selected Value). \n\n <p:selectOneMenu id=\"emailaddress\" value=\"#{personDataActions.actualPerson}\">\n <f:converter converterId=\"personConverter\" />\n <f:selectItem itemLabel=\"Please choose a value\" itemValue=\"\" noSelectionOption=\"true\" />\n\n <f:selectItems value=\"#{personDataActions.allPersons}\"\n var=\"person\" itemLabel=\"#{person.emailaddress}\" converter=\"personConverter\"/>\n\n </p:selectOneMenu>\n\n\nMy Converter is this: \n\n@FacesConverter(value = \"personConverter\")\npublic class PersonConverter implements Converter {\n\n @Inject\n private PersonDataActions personDataActions;\n\n @Override\n public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) {\n return personDataActions.getPersonByEmailaddress(arg2);\n }\n\n @Override\n public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) {\n Person person = (Person) arg2;\n if (person != null) {\n return person.getEmailaddress();\n }\n return null;\n }\n\n\n}\n\nI have followed the example in the other post. but it not works. I see the item, but it is not a Default value. So my unterstanding is, that the value in the select one menu value=\"#{personDataActions.actualPerson}\" is responsible for Setting the Default value. But the value in the select One Menu is a Person Object, and i want to set a String object. How i can handle this ?" ]
[ "java", "jsf", "primefaces" ]
[ "Download file to local computer via SCP while ssh connection to remote computer", "I keep getting an error when trying to download a file from a remote computer when connected via SSH. \n\nI'm using a Mac and connecting via terminal. \n\nI type the following:\n\nscp username@host : /path/to/hosts/file/host_file.txt ~/desktop\n\n\nI then enter my password and get the following error:\n\nscp: .: not a regular file\ncp: cannot create regular file '/host_file.txt': permission denied\n/directory/user/desktop: no such file or directory\n\n\nAny help?\n\nIt appears to be trying to save it to a directory on the remote system but I'm not sure.\n\n**update:\n\nI removed space on either side of the : \nIt now appears to download but I don't see anything on my desktop.\n\nThanks for all your help." ]
[ "ssh", "terminal" ]
[ "Encryption prompts EOFException when trying to get customers with certain names", "I'm working on a Intjellij project using restful dis and have implemented a very simple encryption that is implemented on both client and server side. One of the methods I invoke is getAllCustomers which works fine when I have customers with random names but will crash when I fx create a customer with a name like \"Morten\". It produces an \"Exception in thread \"main\" com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 1 column 451 path $[12]\" on client side. The console on server side shows that the customers are sent over encrypted but when I debug the decrypting it doesn't seem to decrypt the entirety of the String.\n\nHere is the Encryption class\n\n public class Encryption {\n\n public static String encryptDecrypt(String rawString) {\n\n\n char[] key = {'F', 'E', 'W', 'O', 'M','X','P'};\n\n\n StringBuilder thisIsEncrypted = new StringBuilder();\n\n\n for (int i = 0; i < rawString.length(); i++) {\n thisIsEncrypted.append((char) (rawString.charAt(i) ^ key[i % key.length]));\n }\n\n // We return the encrypted string\n return thisIsEncrypted.toString();\n }\n}\n\n\nDepending on what names I create the users with and what chars I use as keys it sometimes works and sometimes doesn't. \n\n public Trampoline<Void> getAllCustomers(){\n\n try\n {\n String url = BASE+\"customers\";\n\n String response = networkUtil.httpRequest(url, \"GET\");\n\n response = Encryption.encryptDecrypt(response);\n\n Customer[] customers = new Gson().fromJson(response, Customer[].class);\n\n\n return Trampoline.more(() -> view.ShowAllCustomers(Arrays.asList(customers)));\n }\n catch (IOException e)\n {\n return Trampoline.more(()-> view.ShowMessage(\"Error getting customers from server. Message: \" + e.getMessage()));\n }\n\n}\n\n\nSometimes the error occurs in the end as mentioned above because it can't seem to get the final array bracket that is necessary \n\nAnd sometimes it seems to just not be able to decrypt the entire String, I am at a loss, does anyone have an idea of what the problem might be?" ]
[ "java", "encryption" ]
[ "Jest objectContaining method that uses toBe instead of toEqual property checks?", "Is there a method similar to objectContaining that uses toBe instead of toEqual property checks?\n\nThe following contrived test case (which passes) highlights the issue. I would like to assert that the button property of the object passed to foo is actually button1 and should therefore fail for the similar object button2.\n\ntest('foo', () => {\n const button1 = document.createElement('button');\n const button2 = document.createElement('button');\n const foo = jest.fn();\n foo({button: button1});\n expect(foo).toBeCalledWith(expect.objectContaining({button: button2}));\n});\n\n\nAlternatively, how could I rewrite this test case to support my required assertions?" ]
[ "javascript", "unit-testing", "testing", "jestjs" ]
[ "Android L Change Theme Colors Error", "I've been following the new steps for Android L here: http://developer.android.com/preview/material/theme.html\nI've have been trying to change the colors of the status bar but it doesn't work.\n\nMy styles.xml:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n<style name=\"AppTheme\" parent=\"android:style/Theme.Material.Light\">\n<!-- Main theme colors -->\n<!-- your apps branding color (for the app bar) -->\n<item name=\"android:colorPrimaryDark\">@color/primary_dark</item>\n<item name=\"android:colorPrimary\">@color/primary</item>\n<!-- darker variant of colorPrimary (for status bar, contextual app bars) -->\n<!-- theme UI controls like checkboxes and text fields -->\n<item name=\"android:colorAccent\">@color/accent</item>\n</style>\n</resources>\n\n\nMy colors.xml:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n<color name=\"primary\">#03a9f4</color>\n<color name=\"primary_dark\">#0091ea</color>\n<color name=\"accent\">#e1f5fe</color>\n</resources>" ]
[ "android", "android-5.0-lollipop", "material-design" ]
[ "Microsoft Orleans grain communication performance", "I am working on a workflow engine using Mircosoft Orleans as the base, as it offers a number of useful features such as automatically distributing the work and handling fail over.\n\nI have three types of grains:\n\n\nWorkflow - Holds information in the workflow and what order work blocks should be executed in\nWork Block - The parts that actually do the work\nExecution - A single execution of the workflow\n\n\nMy problem is that when running a large number of current executions, i.e. > 1000 the performance really suffers. I have done a bit of profiling and narrowed this down to the communication that happens between the grains. Is there anyway I can improve this any more?\n\nHere is the outline of my code and how the grains interact\n\nThe execution grain sits in a loop, getting the next work block from the workflow and then calling execute on the workblock. It is this constant calling between grains that is causing the execution time for one of my test workflows to go from 10 seconds when running a single execution to around 5 minutes when running over 1000. Can this be improved or should I re-architect the solution to remove the grain communication?\n\n[StorageProvider(ProviderName = \"WorkflowStore\")]\n[Reentrant]\n[StatelessWorker]\npublic class Workflow : Grain<WorkflowState>, IWorkflow\n{\n public Task<BlockRef> GetNext(Guid currentBlockId, string connectionName)\n {\n //Lookup the next work block\n }\n}\n\n[Reentrant]\n[StatelessWorker]\npublic class WorkBlock : Grain<WorkBlock State>, IWorkBlock \n{\n public Task<string> Execute(IExecution execution)\n {\n //Do some work\n }\n}\n\n\n[StorageProvider(ProviderName = \"ExecutionStore\")]\npublic class Execution : Grain<ExecutionState>, IExecution, IRemindable\n{\n private async Task ExecuteNext(bool skipBreakpointCheck = false)\n { \n if (State.NextBlock == null)\n {\n await FindAndSetNext(null, null);\n }\n\n ...\n\n var outputConnection = await workblock.Execute();\n\n if (!string.IsNullOrEmpty(outputConnection))\n {\n await FindAndSetNext(State.NextBlock.Id, outputConnection);\n ExecuteNext().Ignore();\n }\n }\n\n private async Task FindAndSetNext(Guid? currentId, string outputConnection)\n {\n var next = currentId.HasValue ? await _flow.GetNextBlock(currentId.Value, outputConnection) : await _flow.GetNextBlock();\n ...\n }\n}" ]
[ "c#", "performance", "orleans" ]
[ "Codeigniter 404 can't find index.php (only on real server, not on virtual server)", "I got a working webpage with CodeIgniter. I did now just upload it to my webserver and it gives me a 404 error.\n\nThe browser address is \"web-page.com/folder/en/about\"\n\nThe baseurl in the config is \"web-page/folder/\"\n\nAlso this is in the config.php, I did try AUTO but it does not work either.\n\n$config['index_page'] = \"\";\n$config['uri_protocol'] = \"QUERY_STRING\";\n\n\nThe index.php is in \"web-page.com/folder/\"\n\nMy htaccess is in \"web-page.com/folder/.htaccess\"\n\nThe content of the .htaccess is\n\nAddCharset utf-8 .css .html .xhtml\nOptions +FollowSymlinks\nRewriteEngine on\nRewriteBase /folder/\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond $1 !^(index\\.php|images|media|layout|css|libs|robots\\.txt)\nRewriteRule ^(.*)$ /folder/index.php?/$1 [L]\n\n\nDo you have any tip, any idea, what can I try to do? I did check all the rights, even with 777 it does not work.\n\nThanks in advance.\n\nLukas" ]
[ ".htaccess", "mod-rewrite", "codeigniter", "http-status-code-404", "codeigniter-url" ]
[ "Issue with Connecting Django to Postgresql database", "When I try to connect my app to postgresql db I always get this same error:\n\ndjango.core.exceptions.ImproperlyConfigured: 'django.db.backends.postgresql' isn't an available database backend.\nTry using 'django.db.backends.XXX', where XXX is one of:\n 'mysql', 'oracle', 'sqlite3'\n\n\nHere is my code in settings\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql',\n 'NAME': 'mydb',\n 'USER': 'postgres',\n 'PASSWORD': 'pass123',\n 'HOST': 'localhost',\n 'PORT': '5432'\n }\n}\n\n\nI am using django version 3.0.2 and my psycopg2 version 2.8.5 . I did downgrade to earlier version of django and still the problem persists. Also my python version is 3.8.\nI tried doing this too\n\nDATABASES = {\n 'default': {\n 'ENGINE': 'django.db.backends.postgresql_psycopg2',\n 'NAME': 'mydb',\n 'USER': 'postgres',\n 'PASSWORD': 'pass123',\n 'HOST': 'localhost',\n 'PORT': '5432'\n }\n}\n\n\nI thought it was the issue with the virtual env so I decided to perform on other projects too but still does not work. Can anyone please help me." ]
[ "python", "django", "postgresql" ]
[ "selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable error while trying to login with Selenium and Python", "I am trying to login in https://www.ecobolsa.com/index.html with Selenium in python3, but the send_keys functions gets me the message:\n\nselenium.common.exceptions.ElementNotInteractableException: Message: element not interactable\n(Session info: headless chrome=78.0.3904.97)\n\n\nThe code is:\n\nfrom selenium.webdriver.chrome.options import Options\nfrom selenium import webdriver\n\noptions = Options()\noptions.add_argument('--headless')\noptions.add_argument('--disable-gpu')\noptions.add_argument(\"start-maximized\")\noptions.add_argument(\"disable-infobars\")\noptions.add_argument(\"--disable-extensions\")\n\nemail = '[email protected]'\npassword = 'fakepass3'\n\ndriver = webdriver.Chrome('chromedriver', options=options)\n\ndriver.get('https://www.ecobolsa.com/index.html')\n\ndriver.find_element_by_id(\"userNameTextBox\").send_keys(email)\ndriver.find_element_by_id(\"password_login\").send_keys(password)\n\n\nI have tried other solutions but none of them have been successful.\nI need help." ]
[ "python-3.x", "selenium", "selenium-webdriver", "selenium-chromedriver", "webdriverwait" ]
[ "TSQL varchar string manipulation", "I have a variable which contains the following string: AL,CA,TN,VA,NY\n\nI have no control over what I get in that variable (comes from reporting services) \n\nI need to make it look like this: 'AL','CA','TN','VA','NY'\n\nHow do I do this?" ]
[ "tsql", "string-substitution" ]
[ "Unexpected token error when parsing JSX file", "Am getting the below error in my main.js file when using ESLint and babel\n\nmain.js\n\nconst mountNode = document.getElementById('app');\nfunction HelloMessage(props) {\n return <div>Hello {props.name}</div>;\n}\nrender(<HelloMessage name=\"test\" />, mountNode);\n\n\nError is \n\nUnexpected token (12:10) while parsing file: c:\\Dev\\...\\src\\main.js\n\n\nwhich points to the line\n\nreturn <div>Hello {props.name}</div>;\n\n\nI have enabled ES6 and JSX in ESLint config\n\n\"parser\": \"babel-eslint\",\n\"parserOptions\": {\n \"ecmaVersion\": 6,\n \"sourceType\": \"module\",\n \"ecmaFeatures\": {\n \"jsx\": true\n }\n },\n\n\nAlso, .babelrc has the presets defined\n\n{\n \"presets\": [\"es2015\"]\n}\n\n\nwhat am I missing here?\n\nThanks" ]
[ "reactjs", "jsx", "babeljs", "eslint" ]
[ "JasperServer 5.5, AdHoc view date display issue", "After creating an AdHoc view with JasperServer 5.5, I cannot use one of the date type fields for display. Using this field in a crosstab give a generic error in the UI and generates the following error in the server log:\n\n2014-06-06 12:33:56,437 ERROR AdhocAjaxController,http-bio-80-exec-3:888 - ad hoc controller exception\njava.lang.IllegalArgumentException: Illegal pattern character 'n'\nat java.text.SimpleDateFormat.compile(SimpleDateFormat.java:845)\nat java.text.SimpleDateFormat.applyPattern(SimpleDateFormat.java:2199)\nat net.sf.jasperreports.engine.util.DefaultFormatFactory.createDateFormat(DefaultFormatFactory.java:127)\nat com.jaspersoft.ji.adhoc.service.AdhocEngineServiceImpl.formatValue(AdhocEngineServiceImpl.java:1903)\n<...>\n\n\nWhere in JasperReports server would the date format be specified for this specific field of this specific AdHoc view and why would it contain an \"Illegal pattern character 'n'\" if it was created through the UI?" ]
[ "jasper-reports", "jasperserver" ]
[ "My App Says - Cannot use object of type stdClass as array, any ideas?", "For some reason my application is giving me a PHP error saying \n\n\n Cannot use object of type stdClass as array on line 45.\n\n\nA little stumped on why this is happening. Any idea? \n\nI have been dabbling with this for over an hour now. Searched around on here as well. I'm so stumped. I hope it's not something simple that I'm just missing. Any help?\n\n<section class=\"inner-pageBanner\" style=\"width:100%; height:300px; \nbackground: url(/uploads/home.png) no-repeat center center; background-size:cover;\">\n \n</section>\n<div class=\"banner-text\">\n<h2 style=\"margin-top:100px; font-size:80px; color:#333;\">Search \nResults</h2>\n</div>\n<section class=\"homeAnimation\">\n<div class=\"featured-products products-slider\">\n <div class=\"container\">\n\n <div class=\"col-md-12\">\n\n <?php\n\n\n $seg2 = $this->uri->segment('2');\n $search = (empty($seg2) ? $_POST['search'] : $seg2);\n $itemsq = $this->db->query(\"SELECT * from `products` where `text` like '%\" . htmlspecialchars(addslashes($search)) . \"%'\");\n $items = $itemsq->result();\n\n foreach($items as $item){\n ?>\n\n <div class=\"col-md-6 featured-item\">\n <div class=\"col-md-12 featured-background\">\n <div class=\"col-md-4\">\n <a href=\"/product/<?php echo urlencode($item->code) . '/' . slugify($item->text); ?>\"><img class=\"featured-img\" src=\"<?php echo $item->image; ?>\"/></a>\n </div>\n <div class=\"col-md-8\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <a class=\"featured-title\"\n href=\"/product/<?php echo urlencode($item->code) . '/' . slugify($item->text); ?>\">\n <h4><?php echo $item->text; ?></h4>\n </a>\n <p class=\"trunc-desc\"><?php echo $item->text; ?></p>\n </div>\n </div>\n <div class=\"row \" style=\"margin-top:0px; margin-bottom:0px;\">\n <div class=\"col-md-12\">\n <h4 style=\"margin-top:0px; font-size:18px;\">As Low As:    \n <span\n style=\"display: inline; color:forestgreen\">$<?php echo number_format($item['price'] + ($item['price'] * ($settings->markup / 100))); ?></span>\n </h4>\n\n <br/><a\n href=\"/product/<?php echo urlencode($item->code) . '/' . slugify($item->text); ?>\"\n class=\"featured-buy-btn\">Buy Now</a>\n\n </div>\n </div>\n </div>\n </div>\n </div>\n <?php\n\n }\n\n ?>\n\n\n\n\n\n </div>\n </div>\n</div>" ]
[ "php", "html" ]
[ "LESSCSS escaping filter", "I need my LESS file to compile the following filter:\n\nfilter: url(\"data:image/svg+xml;utf8,<svg xmlns=\\'http://www.w3.org/2000/svg\\'><filter id=\\'grayscale\\'><feColorMatrix type=\\'matrix\\' values=\\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\\'/></filter></svg>#grayscale\");\n\n\nI can't seem to figure out the correct syntax to escape it, as LESS is stripping the + sign and the spaces. I managed to keep the + sign by adding a backslash. But this did not work for the spaces. I'm sure it's super easy but I can't figure it out ;-)" ]
[ "css", "less" ]
[ "Require help in creating JSR223 request for getting csv data & parsing to Jmeter", "I have a HTTP request whose body data(which is in Json) is given below\n\n{\n \"$ct\": false,\n \"Source\": [\n \"DFT\"\n ],\n \"Type\": \"View\",\n \"Apply\": \"Filter\",\n \"Format\": \"PDF\",\n \"validationFactors\": {\n \"Expand\": \"attributes\",\n \"FilterConstraints\": [{\n \"type\": \"articles\",\n \"Apply\": \"All\",\n \"CreatedUpdated\": [{\n \"title\": \"UN\",\n \"FirstName\": \"Alia\",\n \"MiddleName\": \"\",\n \"LastName\": \"Stve\",\n \"Datatype\": \"string\",\n \"Encode\": \"Pswd\",\n \"Local\": \"project\",\n \"Id\": \"146FG\"\n }]\n },\n {\n \"type\": \"articles\",\n \"Apply\": \"All\",\n \"CreatedUpdated\": [{\n \"title\": \"UA\",\n \"FirstName\": \"ABC\",\n \"MiddleName\": \"XYZ\",\n \"LastName\": \"TFG\",\n \"Datatype\": \"string\",\n \"Encode\": \"title\",\n \"Local\": \"project\",\n \"Id\": \"ST6879GIGOYGO790\"\n }]\n }\n\n ]\n }\n }\n\n\nIn above Json,I have paratermize below attributes, these values are stored in csv .\"title\": \"${title}\",\"FirstName\": \"${FirstName}\",\"MiddleName\": \"${MiddleName}\",\"LastName\": \"${LastName}\",\"Datatype\": \"${Datatype}\",\"Encode\": \"${Encode}\",\"Local\": \"${Local}\",\"Id\": \"${Id}\"\n\nProblem : I have created a JSR223 below my http request, but in script area how to get data from csv and parametrize it? Thanks in advance" ]
[ "jmeter" ]
[ "Python Scraper using BeautifulSoup '\\n\\n issue", "Good afternoon,\nI am very new to Python and thought that a simple web scrape would be easy to grasp, however I am having an issue with the output of my query. the query is as follows:\nimport pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\n\n\npage = requests.get('https://www.ebuyer.com/store/Components/cat/Processors-AMD/subcat/AMD-AM4-Ryzen-5')\nsoup = BeautifulSoup(page.content, 'html.parser')\n#print(soup)\nweek = soup.find(id='grid-view')\n#print(week)\nitems = week.find_all(class_ = 'grid-item js-listing-product')\n#print(items[0])\n#print(items[0].find(class_='grid-item__title').get_text())\n#print(items[0].find(class_='grid-item__ksp').get_text())\n#print(items[0].find(class_='price').get_text())\n\nproduct_description = [item.find(class_='grid-item__title').get_text() for item in items]\n#sub_descriptions = [item.find(class_='grid-item__ksp').get_text() for item in items]\n#price = [item.find(class_='price').get_text() for item in items]\nprint(product_description)\n\nthe output shows as:\n['\\n\\n AMD Ryzen 5 3600X AM4 CPU/ Processor with Wraith Spire Cooler\\n \\n', '\\n\\n AMD Ryzen 5 1600X 6 Core AM4 CPU/Processor\\n \\n']\nI would like to be able to remove the '\\n\\n from the text if possible?\nthank you in advance." ]
[ "python-3.x", "web-scraping", "beautifulsoup" ]
[ "Why Segmentation Fault?", "I am trying this spoj problem.But I could not get why it is giving segmentation fault in some test case.\n\n#include <iostream>\n#include <cstring>\n#include <stdio.h>\nusing namespace std;\nint getMin(char *txt,int n) { \n int min = 0;\n for(int i = 0 ; i < n ; i++) {\n if(strcmp(txt+min ,txt+i) > 0)\n min = i;\n }\n return min;\n}\nint main() {\n\n char *s = new char[200005];\n scanf(\"%s\",s);\n int n = strlen(s);\n strcat(s+n,s);\n printf(\"\\n%d\",getMin(s,n)); \n delete[] s;\nreturn 0; \n}" ]
[ "segmentation-fault" ]
[ "Iterate two files, compare matching strings in rows, merge matching rows", "I have two files with a list of organisms. The first file contains a list indicating 'Family Genus', so two columns. The second file contains 'Genus species', also two columns. Both files coincide in having the Genus of all the listed species. I want to merge both lists using each file's Genus to be able to add the Family name to the 'Genus species'. Thus, the output should contain 'Family Genus species'. Since there is a space between each name, I am using that space to split into columns. So far this is the code I have:\n\nwith open('FAMILY_GENUS.TXT') as f1, open('GENUS_SPECIES.TXT') as f2:\n for line1 in f1:\n line1 = line1.strip()\n c1 = line1.split(' ')\n print(line1, end=' ')\n for line2 in f2:\n line2 = line2.strip()\n c2 = line2.split(' ')\n if line1[1] == line2[0]:\n print(line2[1], end=' ')\n print()\n\n\nThe resulting output is composed of only two lines, and not the entire record. What am I missing?\n\nAnd also, how can I save it to a file instead of just printing on the screen?" ]
[ "python", "regex", "python-3.x" ]
[ "how to get current loop value in label using c# windows forms", "In my datagridview I have four PDF files. While these four PDF's are getting downloaded it should show that it is downloading the first file out of four file, if it is the second file it should show that it is downloading the second file out of four files, and os on. It should be done like that until all the files are downloaded into a folder.\n\nfor (int i = 1; i <= dataGridView1.Row Count;i++ )\n{\n label2.Text = i; \n}" ]
[ "c#", "winforms" ]
[ "How to get Lambda event/context/payload from custom Docker image?", "Can we cURL an internal endpoint like with other services to retrieve metadata such as the Lambda event blob? Most search results are API gateway related or presupposing that you're using a Lambda base-image, neither of which are relevant." ]
[ "amazon-web-services", "aws-lambda" ]
[ "Is it possible to update trigger table in update trigger?", "I have an update trigger for a table. When I am updating the table rows I need to check certain condition in trigger then based on that I want to update another column.\n\nIs it possible?" ]
[ "sql-server-2005" ]
[ "How do I configure Nwazet Commerce with Orchard 1.7.2?", "I'm trying to install Nwazet Commerce with Orchard 1.7.2.\n\nSuddenly, nothing happens. No new menus, no errors, nothing in the logs, nothing. It is just as if I hadn't installed it.\n\nBefore you ask... yes I've enabled the modules.\n\n\nI can't find even a single scrap of documentation. What is supposed to happen? I would expect to see some extra menus or something on my dashboard or perhaps some extra content types, but there's nothing.\n\nHelp please :-|" ]
[ "orchardcms", "orchardcms-1.7" ]
[ "Meaning of terms identical, equal, equivalent in the Standard", "There are at least three terms with similar meaning in the Standard: identical, equal and equivalent. All these used when algorithms described. Say, std::adjacent_find:\n\n\n Searches the range [first, last) for two consecutive identical elements.\n\n\nBut description of the comparator says:\n\n\n binary predicate which returns ​true if the elements should be treated as equal\n\n\nWhen it comes to associative containers, the word equivalent is used. For two elements a and b it means (roughly) !(a < b) && !(b < a). While equal means a == b.\n\nWhat does the term identical mean? Is it defined in the Standard?" ]
[ "c++", "c++-standard-library" ]
[ "Why server is not detecting changes source code in my python project?", "I change the original file to add a new routing, but the changes don't work even if I restart the gunicorn server. What is the reason for this? Is it Git, Visual Code, my remote Linux, VirtualanEnv ... or what? I'm deeply confused" ]
[ "python", "linux", "git", "visual-studio-code", "falcon" ]
[ "href to another element does not work in Polymer", "I created a project using the Polymer Starter Kit, with its app-router.\n\nMy my-app.html has the selectors for the views like so..\n\n<iron-pages role=\"main\" selected=\"[[page]]\" attr-for-selected=\"name\">\n <my-view1 name=\"view1\"></my-view1>\n <my-view2 name=\"view2\"></my-view2>\n <my-view3 name=\"view3\"></my-view3>\n <my-view4 name=\"view4\"></my-view4>\n <my-view5 name=\"view5\"></my-view5>\n <my-view6 name=\"view6\"></my-view6>\n </iron-pages>\n\n\nI have a component my-view1.html, within which I have div with href tag \n\n<div>God 1 <a href=\"#gotogod\" class=\"link\">Jump to example</a> </div>\n\n\nelsewhere in the document I have \n\n<p id=\"gotogod\">\n God is great\n</p>\n\n\nWhile I dont get any errors, it doesnt jump to the paragraph when I click the link. When I hover over the link, I do get \n\nhttp://localhost:8080/view1#gotogod\n\n\nBut the page doesnt jump to that spot.\n\nI have tried various combinations for the href without luck.\n\nPlease help." ]
[ "html", "polymer", "href" ]
[ "C++ multiline string raw literal", "We can define a string with multiline like this:\n\nconst char* text1 = \"part 1\"\n \"part 2\"\n \"part 3\"\n \"part 4\";\n\nconst char* text2 = \"part 1\\\n part 2\\\n part 3\\\n part 4\";\n\n\nHow about with raw literal, I tried all, no one works\n\nstd::string text1 = R\"part 1\"+\n R\"part 2\"+ \n R\"part 3\"+\n R\"part 4\";\n\nstd::string text2 = R\"part 1\"\n R\"part 2\" \n R\"part 3\"\n R\"part 4\";\n\nstd::string text3 = R\"part 1\\\n part 2\\ \n part 3\\\n part 4\";\n\nstd::string text4 = R\"part 1\n part 2 \n part 3\n part 4\";" ]
[ "c++" ]
[ "Unable to import Excel Add in in Excel Online", "Hi I have taken a sample github project https://github.com/OfficeDev/Excel-Add-in-JS-QuarterlySalesReport/blob/master/Readme.md ,\nand after making a few changes in manifest was able to successfully import the add in in my desktop excel app Version 1611 Build 7571.2006 ( the add-in web app was running on my local box itself)\n\nNow i am trying to upload this add on online excel, while my web app runs on my local box but I am getting this error on online excel \n\n\n\nHere is the manifest i upload to online excel (this manifest file is same as the manifest which works on excel desktop except that i replaced the ip address from 127.0.0.1 to my public ip )\n\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <OfficeApp xmlns=\"http://schemas.microsoft.com/office/appforoffice/1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:bt=\"http://schemas.microsoft.com/office/officeappbasictypes/1.0\" xmlns:ov=\"http://schemas.microsoft.com/office/taskpaneappversionoverrides\" xsi:type=\"TaskPaneApp\">\n <Id>adc22a5f-62c5-472e-b258-2ae44be6fccf</Id>\n <Version>1.0.0.0</Version>\n <ProviderName>ML LABS</ProviderName>\n <DefaultLocale>en-US</DefaultLocale>\n <DisplayName DefaultValue=\"ML LABSII\" />\n <Description DefaultValue=\"ML LABSII\"/>\n <Hosts>\n <Host Name=\"Workbook\" />\n </Hosts>\n <DefaultSettings>\n <SourceLocation DefaultValue=\"http://172.22.136.62:3000/\" />\n </DefaultSettings>\n <Permissions>ReadWriteDocument</Permissions>\n </OfficeApp>\n\n\nI have tried and the web app loads from other machine browsers with no issues." ]
[ "excel", "office365", "office-js", "excel-addins" ]
[ "sql server - number results using two columns", "I'm trying to number rows based on two columns - I can't quite articulate what I'm trying to do, so in this case I hope that the following tables will paint a thousand words. \n\nGiven the following table:\n\nName | Car Colour\n-------------------\n Alice | Red\n Alice | Green\n Alice | Blue\n Bill | Orange\n Bill | Purple\n Carol | Brown\n Carol | Orange\n Carol | Magenta\n Carol | Indigo\n Carol | Lilac\n Carol | White\n\n\nhow would you display the following:\n\nName | Car Colour | Indiv. Car Index\n------------------------------------------- \n Alice | Red | 1\n Alice | Green | 2\n Alice | Blue | 3\n Bill | Orange | 1 \n Bill | Purple | 2\n Carol | Brown | 1\n Carol | Orange | 2 \n Carol | Magenta | 3\n Carol | Indigo | 4 \n Carol | Lilac | 5\n Carol | White | 6 \n\n\nEdit - thanks for your speedy responses - they work in SQL Server 2008, but may I please ask what the alternative would be SQL Server 2000? - It doesn't seem to recognize ROW_NUMBER()." ]
[ "sql-server" ]
[ "Calculate averages to display in center of d3 donut chart", "I have this plunkr where i am using angularjs and d3.js.\n\nI am generating a few donut charts here i would like to know how to display the average of the data in the middle of the arc instead of the percentage. Also how would i display the labels on the arcs\n\nsvg.append(\"text\")\n .attr(\"dy\", \".35em\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"inside\")\n .text(function(d) { \n return '56%'; \n });" ]
[ "javascript", "angularjs", "d3.js" ]
[ "preg_replace replace \\ before echo variable", "I have following variable $row_messageRepliesResults['msgReplyText'] and below data inside database for this variable\n\nYour website <a href=\\\"http://www.example.com/link.php\\\" target=\\\"\\\" rel=\\\"\\\">http://www.example.com/links.php</a> was without any content \\\"not guaranteeing CTR\\\".\n\n\nthe problem I have is that when I echo variable with this content those \\ appear too, so I was wondering how to use preg_replace in order to get rid of them. I tried something but always get blank data.\n\nthanks!" ]
[ "variables", "preg-replace" ]
[ "JavaScript private methods, asynchronous access", "I'm using a pattern like the one shown below to create a javascript library that has private and public methods. The idea is that the page that includes this library would call MYLIB.login() and provide two functions for when the user clicks OK, or Cancel.\n\nvar MYLIB = function() {\n // private data and functions\n var showForm = function() {\n // create and show the form\n };\n var onOK = function() {\n // hide the form, do some internal stuff, then…\n okFunction();\n };\n var onCancel = function() {\n // hide the form, do some internal stuff, then...\n cancelFunction();\n };\n\n var okFunction = null;\nvar cancelFunction = null;\n\n // public functions \n return {\n login : function(okf, cancelf) {\n okFunction = okf;\n calcelFunction = cancelf;\n showForm();\n },\n }; \n}();\n\n\nMy question is about getting the buttons in the form to call the internal functions onOK and onCancel, which are private. The buttons look like this:\n\n<button onclick=\"onOK();\">OK</button>\n<button onclick=\"onCancel();\">Cancel</button>\n\n\nI can get it to work if I make the functions public, but then I may as well make everything public. How can I do what I want? Coming from a C++/Java background, trying to be a good OO guy. Thanks." ]
[ "javascript" ]
[ "How to deploy Ruby on Rails application via cPanel on shared host?", "I am in the process of learning Ruby on Rails and things have been going smoothly - up until I tried to deploy one of my test applications to my shared hosting account.\n\nI use Host Gator and was able to successfully create a new Ruby on Rails app via cPanel and run it. The only problem is that when you create a new app this way, it populates its directory with a blank application - as would rails new app_name locally. When I delete the files and folders in this directory and replace them with my own, then attempt to run the app, cPanel says that it is running on the confirmation page but it never actually starts. I am not receiving any error messages either.\n\nThe host seemed rather stumped, stating that it should be a matter of deleting the initial files and folders and replacing them, then running. The app works fine locally so I do not think that it is a code issue. In my research I came across Passenger, although it is way over my head and it would appear that you really need to have total control over Apache to make it all work, including ssh.\n\nIf it makes any difference, the apps I made locally were put together using an installation of Rails Installer and are scaffolded. For testing I am using a bare minimum app with about three fields in the table.\n\nWhat am I missing? Any help would be appreciated." ]
[ "ruby-on-rails", "cpanel", "apache-config" ]
[ "Should I use HttpURLConnection or RestTemplate", "Should I use HttpURLConnection in a Spring Project Or better to use RestTemplate ?\nIn other words, When it is better to use each ?" ]
[ "java", "spring" ]
[ "Do all LLVM PHI instructions in the same basic block always have the same set of incomming blocks?", "I notice that in LLVM bitcode files, all PHI instructions in the same basic block often have the same set of incoming blocks.\nDoes anyone know if it is always true for all LLVM bitcode files?\nOr is there any optimization pass for doing so?\nFor example, here is my C code:\n// test.c\n\nint main(){\n int **p, *q;\n int *a, *b, c, d;\n\n p = &a;\n\n if (p) {\n if (c) {\n q = &c;\n }\n }\n else{\n p = &b;\n q = &d;\n }\n if (d) {\n *p = q;\n }\n}\n\nAfter being compiled by clang and opt:\nclang -Xclang -disable-O0-optnone -c -emit-llvm test.c\nopt -mem2reg test.bc -o test.opt.bc\n\nHere is the output test.opt.bc, where all PHI instructions in block 12 have the same incomming blocks 11 and 12:\n; Function Attrs: noinline nounwind uwtable\ndefine dso_local i32 @main() #0 {\n %1 = alloca i32*, align 8\n %2 = alloca i32*, align 8\n %3 = alloca i32, align 4\n %4 = alloca i32, align 4\n %5 = icmp ne i32** %1, null\n br i1 %5, label %6, label %11\n\n6: ; preds = %0\n %7 = load i32, i32* %3, align 4\n %8 = icmp ne i32 %7, 0\n br i1 %8, label %9, label %10\n\n9: ; preds = %6\n br label %10\n\n10: ; preds = %9, %6\n br label %12\n\n11: ; preds = %0\n br label %12\n\n12: ; preds = %11, %10\n %.01 = phi i32** [ %1, %10 ], [ %2, %11 ]\n %.1 = phi i32* [ %3, %10 ], [ %4, %11 ]\n %13 = load i32, i32* %4, align 4\n %14 = icmp ne i32 %13, 0\n br i1 %14, label %15, label %16\n\n15: ; preds = %12\n store i32* %.1, i32** %.01, align 8\n br label %16\n\n16: ; preds = %15, %12\n ret i32 0\n}" ]
[ "llvm", "llvm-ir" ]
[ "How do I force vscode to recognise my .d.ts files over the default ones?", "So as the title says I have a project with type declaration files, one of the declares is a File object and new File() class (also a function, long story). Issue is VsCode seems insistent on using the default File object instead of my custom one. \nHow do I force it to use mine over the default one?\n\nThanks in advance." ]
[ "javascript", "typescript", "types", "visual-studio-code" ]
[ "PYTHON: Creating a dataframe of permutations from a list of tuples", "I am presently trying to create a massive table of permuted values.\n\nlocA = [1, 2, 3]\nlocB = [4, 5, 6]\nlocC = [7, 8, 9]\n\n\nWithin 'loc' values are permuted. Each value in a 'loc' is from a different population ('pop1', 'pop2', 'pop3'). So far I have have been able to form a massive list of tuples that combines every within 'loc' rearrangement with every between 'loc' rearrangement.\n\npermA = list(itr.permutations(locA, 3))\npermB = list(itr.permutations(locB, 3))\npermC = list(itr.permutations(locC, 3))\npermABC = list(itr.product(permA,permB,permC))\n\npermABC\n[((1, 2, 3), (4, 5, 6), (7, 8, 9)),\n((1, 2, 3), (4, 5, 6), (7, 9, 8)),\n((1, 2, 3), (4, 5, 6), (8, 7, 9)),\n\n ... etc etc...\n\n((3, 2, 1), (6, 5, 4), (8, 9, 7)),\n((3, 2, 1), (6, 5, 4), (9, 7, 8)),\n((3, 2, 1), (6, 5, 4), (9, 8, 7))] \n\n\nI have been trying to get this into a Pandas DataFrame, but I am having trouble iterating through the list of tuples to get into a DataFrame. :(\n\nIdeal format:\n\nloc pop1 pop2 pop3\nA 1 2 3 |\nB 4 5 6 |>>>> permABC[0]\nC 7 8 9 |\n\n... etc etc ...\n\nA 3 2 1 |\nB 6 5 4 |>>>> permABC[215]\nC 9 8 7 |\n\n\nMy problem is getting the list of tuples into a dataframe. I need to get every combination possible of 'loc'. E.g. all possible rearrangements of 'locA' with rearrangements of 'locB' with rearrangements of 'locC'. \n\nTo put this into perspective, for any particular permutation for each population, I'll need to make calculations. For sake of argument, in the above, for 'perABC[0]' and 'permABC[215],' mean for 'pop1' would be 4 and 6 respectively.\n\nI'm just not sure how to do this on the fly and currently at my level of coding its easier to anchor things into a dataframe that I can manipulate. I have tried playing with using indexes to pull out population specific info for any given permutation in 'permABC', e.g.\n\nfor item in permABC[0]:\n print item[0]\n 1\n 4\n 7\n\n\nWhich works, but using this method isn't feasible because you can't do any functions on them; returns TypeError \"'int' object is not iterable\".\n\nCheers." ]
[ "python", "pandas", "tuples", "dataframe", "permutation" ]
[ "PHP framework to develop .mobi sites", "I'm desperately looking for a PHP 5 framework that will work best to develop .mobi sites.\n\nOne major feature that it should contain is browser recognition for different handsets, so that the site will work properly on all types of phones?" ]
[ "php", "mobile-website", "mobile-phones" ]
[ "sqlite3: using two columns in a row to make a calculation", "Image of the database I am working with...\n\nI am currently practicing with a database of NBA players. Related fields include name, active, and games. I am trying to create a temporary table containing name and games_per_year (active/games).\n\nFirstly, I filtered the original database to players with 11+ active years, which I have successfully completed.\n\nNow I am unsure how to create the temporary table consisting of name and games_per_year. Ultimately, I want to order this temp table by games_per_year and return the top 6 player names.\n\nHere is my attempt at coding below. As you can see, I am a bit lost...\n\ndef most_games_per_year_for_veterans():\n \"\"\"Top 6 players that are > 10 years active, that have the\n highest # games / year\"\"\"\n\n player_list = cur.execute(\"SELECT name, active, games FROM players \n WHERE active > 10\").fetchall()\n\n conn.execute('''CREATE TABLE IF NOT EXISTS active_vets\n (name TEXT,\n games_per_year REAL)''')\n\n for player in player_list:\n # Create a tuple? Just a guess...\n player = (player[0], player[2]/ player[1])\n\n cur.executemany('INSERT INTO active_vets VALUES (?,?)', player)\n\n\nCritique is welcome, if you have any resources that have helped you in the past, I would love to read them. I have found it difficult to find the answers I need online." ]
[ "python", "sqlite" ]
[ "Using Windows Search results for accessing mail objects using Outlook Redemption", "We want to use Windows Search for accessing Outlook items using Outlook Redemption. Windows Search returns ItemURLs like\nmapi16://{S-1-5-21-1234567890-1234567890-1234567890-12345}/[email protected]($f6b2f123)/0/Posteingang /곯가가가곹갂걫곃걅곓걼걍겦갭곹곰갿겈걩곂간곊곾가.\nAny idea how to convert this ItemURL into an EntryID which could be used for accessing Outlook objects with Outlook redemption?\nFunction StartSearch()\n\nDim cnn As ADODB.Connection\nDim rst As ADODB.Recordset\nDim strCNN As String\nDim strSQL As String\nDim Session As Redemption.rdoSession\nDim Mail As Redemption.rdoMail\n\nSet cnn = New ADODB.Connection\nSet rst = New ADODB.Recordset\nSet Session = CreateObject("Redemption.RDOSession")\n\nSession.Logon\n\nstrCNN = "Provider=Search.CollatorDSO;Extended Properties='Application=Windows';"\ncnn.Open strCNN\n \nstrSQL = "SELECT System.ItemPathDisplay, System.ItemURL FROM SYSTEMINDEX WHERE CONTAINS(*,'lpnAtpdVNOKP')"\n \nSet rst = cnn.Execute(strSQL)\n \nWhile Not rst.EOF\n ItemURL = rst.Fields.Item("System.ItemURL")\n 'Something like mapi16://{S-1-5-21-1234567890-1234567890-1234567890-12345}/[email protected]($f6b2f123)/0/Posteingang /곯가가가곹갂걫곃걅곓걼걍겦갭곹곰갿겈걩곂간곊곾가\n EntryID = SomeFunction(ItemURL)\n Mail = Session.GetMessageFromID(EntryID)\n Mail.Display\n rst.MoveNext\nWend\n \ncnn.Close\nSet cnn = Nothing\n\nSession.Logoff\n\nEnd Function" ]
[ "vba", "outlook-redemption", "windows-search" ]
[ "Should I add the sass source map to my git repo?", "I had added style.css.map to my .gitignore file thinking that this was some kind of internal file that was not needed for public consumption.\n\nNow I'm seeing that when Chrome (not Firefox) loads my page, it is looking for style.css.map and returning a 404. I'm not explicitly asking it to load that file, but it seems to be getting called automatically. \n\n\nWhy is Chrome looking for that file?\nShould I have included the .map file to the repo?\n\n\nFor further context, this is a Wordpress site and I am including the style.scss file in the repo." ]
[ "css", "git", "sass" ]
[ "How do I run SQL scripts from cygwin bash on windows and get the directories correct?", "I've been working on a script that runs various sql scripts based on tested conditions. Each time, I run into problems with the best way to represent the directory of the sql script so bash/oracle can find it. Bash seems to behave differently if you use a variable with the sql script directory and name than if you were typing the directory and name on the command line. For example, this works:\n\nsqlplus x/y@z @//filedir/filename.sql\n\nbut this does not\n\nfname=\"//filedir/filename.sql\"\n\nsqlplus x/y@z @$fname\n\nAny ideas?" ]
[ "sql", "bash", "oracle", "cygwin" ]
[ "QT Text Edit/Text Browser dynamic height", "I am very new to QT, I have created a a GUI application which has the following code:\n\nmainwindow.h\n\n#ifndef MAINWINDOW_H\n#define MAINWINDOW_H\n\n#include <QMainWindow>\n\nnamespace Ui {\nclass MainWindow;\n}\n\nclass MainWindow : public QMainWindow\n{\n Q_OBJECT\n\npublic:\n explicit MainWindow(QWidget *parent = 0);\n ~MainWindow();\n\nprivate:\n Ui::MainWindow *ui;\n};\n\n#endif // MAINWINDOW_H\n\n\nmain.cpp\n\n#include \"mainwindow.h\"\n#include <QApplication>\n\nint main(int argc, char *argv[])\n{\n QApplication a(argc, argv);\n MainWindow w;\n w.show();\n\n return a.exec();\n}\n\n\nmainwindow.cpp\n\n#include \"mainwindow.h\"\n#include \"ui_mainwindow.h\"\n\nMainWindow::MainWindow(QWidget *parent) :\n QMainWindow(parent),\n ui(new Ui::MainWindow)\n{\n ui->setupUi(this);\n}\n\nMainWindow::~MainWindow()\n{\n delete ui;\n}\n\n\nUsing the designer I have made a textEdit in a form layout. When I have too much content in the textEdit it makes a scroll bar instead of adjusting the size to the content.\n\nI have googled like a mad, but all the answers I have found was way above my level so I simply didnt understand them. I want to achieve this very badly since is the core of my gui.\n\nThanks in advance" ]
[ "c++", "qt", "qt-creator", "qtextedit" ]
[ "Starting Azure Vm in parallel with runbook throws InvalidOperationException", "I'm trying to use Azure runbooks to start virtual machines with a specified tag. I use powershell workflow so i can start them i parallel. \n\nThe code below works, but it always have problem starting one random virtual machine. This is the exception: \n\n\n Start-AzureRmVM : Collection was modified; enumeration operation may\n not execute.\n \n CategoryInfo : CloseError: (:) [Start-AzureRmVM], InvalidOperationException\n\n\nI thought $TaggedResourcesList = @($Resources) would enumerate the list and make modifications allowed?\n\nworkflow StartUpParallel \n{\n\n $Resources = Find-AzureRmResource -TagName Startup -TagValue PreWork\n $TaggedResourcesList = @($Resources)\n\n Foreach -Parallel ( $vm in $TaggedResourcesList ) \n {\n if($vm.ResourceType -eq \"Microsoft.Compute/virtualMachines\") \n {\n Start-AzureRmVM -ResourceGroupName $vm.ResourceGroupName -Name $vm.Name \n }\n }\n}\n\n\nHas anyone else had this problem?" ]
[ "azure", "azure-automation", "powershell-workflow" ]
[ "Tooltip of previous onValidationError event displayed even when correct values are entered in the slickgrid node", "I am using requiredFieldValidator for my TextEditor. Using the onValidationError event as given below, i set the title attribute of my cell to the error message so that a tooltip will be displayed as 'This is a required field'.\n\nvar handleValidationError = function(e, args) {\nvar validationResult = args.validationResults;\nvar activeCellNode = args.cellNode;\nvar editor = args.editor;\nvar errorMessage = validationResult.msg\n$(activeCellNode).live('mouseover mouseout', function(event) {\nif (event.type == 'mouseover') {\n $(activeCellNode).attr(\"title\", errorMessage);\n} else {\n $(activeCellNode).attr(\"title\", \"\");\n}\n});\ngrid.onValidationError.subscribe(handleValidationError); \n\n\nSuccessfully, the tooltip is displayed when there is some validation error.\nBut the problem is When the same cell is given a correct value and validation succeeds, the previous tooltip appears again.\n\nHow do I remove that tooltip on successful validation?" ]
[ "javascript", "validation", "tooltip", "slickgrid" ]
[ "CKEditor Plugin - can allowedContent apply to elements deeper in the hierarcy, or can the MagicLine be disabled on certain elements?", "I'm writing a drupal module, based off of the CKEditor Accordion Module, but instead using Bootstrap 4. The HTML the plugin inserts looks like this:\n\r\n\r\n<section class=\"accordion\" id=\"Accordion1\">\r\n <div class=\"card\">\r\n <div class=\"card-header\" id=\"heading1\">\r\n <h2><button aria-controls=\"collapse1\" aria-expanded=\"false\" class=\"btn btn-link\"\r\n data-target=\"#collapse1\" data-toggle=\"collapse\" type=\"button\">Collapsible Item Heading</button>\r\n </h2>\r\n </div>\r\n\r\n <div aria-labelledby=\"heading1\" class=\"collapse\" data-parent=\"#Accordion1\" id=\"collapse1\">\r\n <div class=\"card-body\">\r\n <p>Collapsed Text</p>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n\r\n\r\n\n\nThe problem is that the magicLine appears when the user hovers over the child elements of <div class=\"card\">). Is there a way to either disable the magicline only for these elements, or to apply the allowedContent property in a way that also affects the child elements in the hierarchy? The javascript below shows how I'm using the allowedContent, but it only seems to apply to the outer <section> and its immediate child <div class=\"card\">. Any children of the .card div seem to allow any kind of content to be added within.\n\n\r\n\r\n(function() {\r\n 'use strict';\r\n\r\n // Register plugin.\r\n CKEDITOR.plugins.add('bscollapse', {\r\n hidpi: true,\r\n icons: 'bscollapse',\r\n init: function(editor) {\r\n \r\n ...\r\n ...\r\n\r\n //elements [attributes]{styles}(classes)\r\n var allowedContent = 'section[id](!accordion); div(!card)';\r\n\r\n // Command to insert initial structure.\r\n editor.addCommand('addBSCollapseCmd', {\r\n allowedContent: allowedContent,\r\n ...\r\n ..." ]
[ "javascript", "jquery", "bootstrap-4", "ckeditor", "drupal-8" ]
[ "redefine multiple conflicting preprocessor definitions globally", "I have large project which contains some conflicting preprocessor function definitions for example like this:\n\n1.h:\n\n#define CONFLICTINGMACRO(a, b) {doSomething(a, b)} \n\n\n2.h:\n\n#define CONFLICTINGMACRO(a, b, c) {doSomethingElse(a, b, c)} \n\n\nSome files import both headers but find the wrong defintion(the one that is loaded first).\n\nI (re)define other symbols (e.g. Windows functions and types not available on Linux) of the project in a file called redefinitions.h\n\nThis file is added globally to every source file of the project via compiler flag:\n\nset(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -include redefinitions.h\")\n\n\nFor quick and easy debugging of other functionality (I don't need the conflicting macros right now) I tried adding the following lines to redefinitions.h:\n\n#ifdef CONFLICTINGMACRO\n #undef CONFLICTINGMACRO\n#endif\n#define CONFLICTINGMACRO(...) {}\n\n\nUnfortunately this doesn't seem to make a difference. My best guess is, that this has something to do with the order the *.h files are loaded.\n\nDo you have any ideas on how I could override the macros defined in the project's different header files globally for the entire project?" ]
[ "c++", "c-preprocessor" ]
[ "jquery.grep unexpected behavior", "I've run into an interesting discovery using jquery.grep and was wondering if anyone knows why this is happening. In my code, I am using grep to filter out certain items from an array and then assign the results back to the original array for more filtering. \n\nE.g. \n\norderedGroups = jquery.grep(orderedGroups, function{}` ...)\n\n\nThe desired outcome is that items who's parent id is the id of another item in the array are filtered out -- leaving only the unmatched (parent) items.\n\nWhat I've discovered is that this actually creates a separate object by the same name. In other words, doing a console.log(orderedGroups[1]), displays a value not displayed in console.log(orderedGroups)\n\nHere is my code:\n\nvar a = ['a', '1', '0']; // represents [name, id, parent id]\nvar b = ['b', '2', '1'];\nvar c = ['c', '3', '0'];\nvar d = ['d', '4', '2'];\nvar e = ['e', '5', '0'];\nvar f = ['f', '6', '2'];\n\nvar groups = [a, b, c, d, e, f];\n\nvar orderedGroups = groups;\nfor (var i = 0; i < groups.length; i++) {\n for (var sg = 0; sg < groups.length; sg++) {\n if (groups[i][1] == groups[sg][2]) {\n orderedGroups = jQuery.grep(orderedGroups, function(value) {\n return value != groups[sg];\n });\n }\n }\n}\n\nconsole.log(orderedGroups)\nconsole.log(orderedGroups[1])​\n\n\nHas anyone seen this before, and if so can you explain why this is happening?\n\nThanks" ]
[ "javascript", "jquery" ]
[ "Error 500 after login to admin", "I have my url set to www.YourDomain.com/store and log in via www.YourDomain.com/store/index.php/admin or www.YourDomain.com/store/admin in to the dashboard but whe I log in the first time I always get a internal server error . Once I refresh I have no issues till I would say the next session \n\nAny one has a suggestions how to fix this ? I don't have the issue on my Local \n\nTX\n\nC" ]
[ "magento" ]
[ "Extracting contents of two tables from web data", "How can I retrieve all td information from this html data:\n\n<h1>All staff</h1>\n<h2>Manager</h2>\n<table class=\"StaffList\">\n <tbody>\n <tr>\n <th>Name</th>\n <th>Post title</th>\n <th>Telephone</th>\n <th>Email</th>\n </tr>\n <tr>\n <td>\n <a href=\"http://profiles.strx.usc.com/Profile.aspx?Id=Jon.Staut\">Jon Staut</a>\n </td>\n <td>Line Manager</td>\n <td>0160 315 3832</td>\n <td>\n <a href=\"mailto:[email protected]\">[email protected]</a>  </td>\n </tr>\n </tbody>\n</table>\n<h2>Junior Staff</h2>\n<table class=\"StaffList\">\n <tbody>\n <tr>\n <th>Name</th>\n <th>Post title</th>\n <th>Telephone</th>\n <th>Email</th>\n </tr>\n <tr>\n <td>\n <a href=\"http://profiles.strx.usc.com/Profile.aspx?Id=Peter.Boone\">Peter Boone</a>\n </td>\n <td>Mailer</td>\n <td>0160 315 3834</td>\n <td>\n <a href=\"mailto:[email protected]\">[email protected] </a>\n </td>\n </tr>\n <tr>\n <td>\n <a href=\"http://profiles.strx.usc.com/Profile.aspx?Id=John.Peters\">John Peters</a>\n </td>\n <td>Builder</td>\n <td>0160 315 3837</td>\n <td>\n <a href=\"mailto:[email protected]\">[email protected]</a>\n </td>\n </tr>\n </tbody>\n</table>\n\n\nHere's my code that generated an error:\n\nresponse =requests.get(url)\nsoup = BeautifulSoup(response.text, 'html.parser')\ntable = soup.findAll('table', attrs={'class': 'StaffList'})\n\nlist_of_rows = []\nfor row in table.findAll('tr'): #2 rows found in table -loop through\n list_of_cells = []\n for cell in row.findAll('td'): # each cell in in a row\n text = cell.text.replace('&nbsp','')\n list_of_cells.append(text)\n #print list_of_cells\n list_of_rows.append(list_of_cells) \n#print all cells in the two rows\nprint list_of_rows \n\n\nError message:\n\nAttributeError: 'ResultSet' object has no attribute 'findAll'\n\n\nWhat do I need to do to make the code output all the information in the two web tables?" ]
[ "python", "web-scraping", "beautifulsoup" ]
[ "React Static Fresh install results in \"Firefox can’t establish a connection to the server at localhost:3000\"", "Ran the following and choose all the default options, but unable to visit the app in browser.\nreact-static create\n\n? What should we name this project? my-first-site\n? Select a template below... typescript\nCreating new react-static project...\n\nThen I cd to the newly generated project directory and get ready to deploy.\nyarn start\n\nI get some good output\nyarn run v1.22.10\n$ react-static start\nStarting Development Server...\nFetching Site Data...\n[✓] Site Data Downloaded\nBuilding Routes...\nImporting routes from directory...\n{ has404: true }\n[✓] Routes Built (0.1s)\nBuilding Templates...\n[✓] Templates Built\nBundling Application...\nFetching Site Data...\n[✓] Site Data Downloaded (0.1s)\nRunning plugins...\n[✓] Application Bundled (15.9s)\n[✓] App serving at http://localhost:3000\n\nThen failure:\n\nDoing a build a serve using npm instead of yarn bring up the site on my network, but on local host host it still does not run.\nnpm run build\nnpm run serve" ]
[ "reactjs", "npm", "yarnpkg", "react-static" ]
[ "trying to use getJSoN and keep getting an error", "I am trying to figure up something very simple, I am trying to load a json file(users.json) data and keep getting an error: \n\n\nthe call is from Default.aspx\n\n\nThe file location:\n\n\nThe error:\n\n\nThe path is wrong?" ]
[ "jquery" ]
[ "paypal button form will not auto-submit in php file", "I've got a paypal button form in a php file that I'm trying to auto-submit using javascript. It seems like it should be very straight forward, but when I test it, the submit button displays, and I am not automatically re-directed to paypal as expected. When I click the submit button I am redirected to paypal and everything looks right. I've read through all the similar posts, which is where I found the script I'm trying to use. I've been at this for several hours and have tried several different recommendations from other posts but I just can't get it to work. Any assistance would be very appreciated! The form code (with some values \"xxx\"'d out for security) and script is shown below. Note that some of the field values are populated with php.\n\n\n<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" id=\"paypalButton\" name=\"paypalButton\" target=\"_top\" >\n <input type=\"hidden\" name=\"cmd\" value=\"_xclick-subscriptions\">\n <input type=\"hidden\" name=\"business\" value=\"xxx\">\n <input type=\"hidden\" name=\"lc\" value=\"US\">\n <input type=\"hidden\" name=\"item_name\" value=\"<?php echo $_SESSION['item_name'];?>\">\n <input type=\"hidden\" name=\"no_note\" value=\"1\">\n <input type=\"hidden\" name=\"no_shipping\" value=\"1\">\n <input type=\"hidden\" name=\"rm\" value=\"1\">\n <input type=\"hidden\" name=\"return\" value=\"http://example.com/sucess.php\">\n <input type=\"hidden\" name=\"cancel_return\" value=\"http://example.com/Cancel.php\">\n <input type=\"hidden\" name=\"src\" value=\"1\">\n <input type=\"hidden\" name=\"a3\" value=\"<?php echo $_SESSION['price'];?>\">\n <input type=\"hidden\" name=\"custom\" value=\"<?php echo $_SESSION['deal_id'].$_SESSION['refresh_token'];?>\">\n <input type=\"hidden\" name=\"p3\" value=\"1\">\n <input type=\"hidden\" name=\"t3\" value=\"<?php echo $_SESSION['t3'];?>\">\n <input type=\"hidden\" name=\"a1\" value=\"<?php echo $_SESSION['a1'];?>\">\n <input type=\"hidden\" name=\"p1\" value=\"1\">\n <input type=\"hidden\" name=\"t1\" value=\"Y\">\n <input type=\"hidden\" name=\"currency_code\" value=\"USD\">\n <input type=\"hidden\" name=\"bn\" value=\"xxx\">\n <input type=\"submit\" name=\"submit\">\n</form>\n<script type=\"text/javascript\">\n document.getElementById('paypalButton').submit(); // SUBMIT FORM\n</script>\n``" ]
[ "javascript", "php", "paypal" ]
[ "ArangoDB - Slow query performance on cluster", "I have a query that compares two collections and finds the \"missing\" documents from one side. Both collections (existing and temp) contain about 250K documents.\n\nFOR existing IN ExistingCollection\n LET matches = (\n FOR temp IN TempCollection\n FILTER temp._key == existing._key\n RETURN true\n )\n FILTER LENGTH(matches) == 0\n RETURN existing\n\n\nWhen this runs in a single-server environment (DB and Foxx are on the same server/container), this runs like lightning in under 0.5 seconds.\n\nHowever, when I run this in a cluster (single DB, single Coordinator), even when the DB and Coord are on the same physical host (different containers), I have to add a LIMIT 1000 after the initial FOR existing ... to keep it from timing out! Still, this limited result returns in almost 7 seconds!\n\nLooking at the Execution Plan, I see that there are several REMOTE and GATHER statements after the LET matches ... SubqueryNode. From what I can gather, the problem stems from the separation of the data storage and memory structure used to filter this data.\n\nMy question: can this type of operation be done efficiently on a cluster?\n\nI need to detect obsolete (to be deleted) documents, but this is obviously not a feasible solution." ]
[ "arangodb" ]
[ "Not able to access localhost from Computer IP address", "I am trying to access local project that is running on APP engine. I am using Google App Engine Launcher and its working fine with Postman. I can debug and see results but when I try to access the same app using IP address I get can't \"can’t reach this page on edge and same on chrome. This is the only project that is on localhost:80. I have also added an entry into windows hosts file \n\n127.0.0.1 192.168.10.10\n\n\nBut still I get same response. Is there anything I am missing ?" ]
[ "php", "windows", "ip", "laragon" ]
[ "Meteor server side remote debugging", "Versions\n\nI'm using Meteor 1.0.3 and node 0.10.35 on a small Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-3d50120d EC2 instance.\n\nContext\n\nI know how to do server side debugging on my development box, just $ meteor debug and open another browser pointing to the url it produces -- works great.\n\nBut now, I'm getting a server error on my EC2 instance I'm not getting in development. So I'd like to set up a remote debug session sever side.\n\nAlso, I deployed to the EC2 instance using the Meteor-up package (mup).\n\n\n\nEDIT\n\nIn an effort to provide more background (and context) around my issue I'm adding the following: \n\nWhat I'm trying to do is, on my EC2 instance, create a new pdf in a location such as: \n\n\n application-name/server/.files/user/user-name/pdf-file.pdf\n\n\nOn my OSX development box, the process works fine. \n\nWhen I deploy to EC2, and try out this process, it doesn't work. The directory:\n\n\n /user-name/\n\n\nfor the user is never created for some reason. \n\nI'd like to debug in order to figure out why I can't create the directory. \n\nThe code to create the directory that works on my development box is like so:\n\n\n server.js\n\n\nMeteor.methods({\n checkUserFileDir: function () {\n var fs = Npm.require('fs');\n var dir = process.env.PWD + '/server/.files/users/' + this.userId + '/';\n try {\n fs.mkdirSync(dir);\n } catch (e) {\n if (e.code != 'EEXIST') throw e;\n }\n }\n});\n\n\nI ssh'd into the EC2 instance to make sure the path\n\n\n /server/.files/user/\n\n\nexists, because this portion of the path is neccessary in order for the above code to work correctly. I checked the path after the code should have ran, and the \n\n\n /user-name/\n\n\nportion of the path is not being created.\n\n\n\nQuestion\n\nHow can I debug remote server side code in a easy way on my EC2 instance, like I do on my local development box?" ]
[ "node.js", "amazon-web-services", "meteor", "amazon-ec2", "remote-debugging" ]
[ "How to add DOM Element in for loop", "How can I create new Element each time when (i) will be incremented:\n\nfor(int i = 0; i < 10; i++)\n{\n Element child = doc.createElement(\"xxx\");\n root.setAttribute(\"x\", i * \"xx\");\n doc.appendChild(child);\n}" ]
[ "javascript", "dom" ]
[ "Map long to enum using automapper", "I have a problem converting long value to enum using automapper. If I do nothing I get exception\n\n\n Missing type map configuration or unsupported mapping.\n \n Mapping types:\n Int64 -> SomeEnum\n\n\nSo if I add mapping configuration it works\n\npublic enum B\n{\n F1,\n F2\n}\n\npublic class A\n{\n public B FieldB { get; set; }\n}\n\nclass Program\n{\n static void Main(string[] args)\n {\n var autoMapper = new Mapper(new MapperConfiguration(expression =>\n {\n expression.CreateMap<long, B>()\n .ConvertUsing(l => (B)l);\n }));\n var dictionary = new Dictionary<string, object>()\n {\n {\"FieldB\", 1L}\n };\n var result = autoMapper.Map<A>(dictionary);\n }\n}\n\n\nHowever I have to define it for every enum in solution, is there a way to define a general rule for converting long to enums in automapper?" ]
[ "c#", "enums", "automapper" ]
[ "How can I write into a string like I write into a char[]", "For example, if I have this function:\nvoid read(std::string& s)\n{\n std::cin >> s;\n}\n\nand the input\nfirst sentence\n\ns will contain 'first' only.\nIf I would've used something like:\nvoid read(char array[100])\n{\n std::cin.get(array, 100);\n}\n\nfor the same input, I would've got "first sentence".\nIs there any way to achieve the same effect using std::string?\nThis might happen (I think) because cin.get with char[] takes all the characters, even blank spaces, because it ends when it detects an end-of-line character, but cin with string stops when it encounters a space character. (just like cin>> does when being used with char[]).\nSo, I think that I need a cin.get() which would work for std::string.\nI'm thinking about reading into a char array and then using the char* constructor of the string in order to convert the char array into a string, but I think there might be a better way to do it." ]
[ "c++" ]
[ "Source Control Backup and Open With Live Browser Issues", "I cannot open live browser with my Visual Studio Code. When I right click, I am not offered the option to open live browser. Does anyone have any possible remedies?\nAlso, in my source control section with the USB symbol, I see that a bubble is popping up with "2k+" and it looks like thousands of backup copies are being made. Does anyone have any potential remedies for this.\nP.S. I have tried uninstalling the older version of VSC and downloading the newest version, but my Mac isn't recognizing the Mono Framework that I have downloaded and will not complete it's installation on my computer.\nThank you all for any help you can provide." ]
[ "javascript", "html", "css", "error-handling" ]
[ "Programatically load data finto uitableview using predicate coredata as if table has already had row selected", "I'm trying to use the excellent code in http://blog.sallarp.com/iphone-core-data-uitableview-drill-down/ to populate fur pop-overs\n\n// Override point for customization after app launch \nNSManagedObjectContext *context = [self managedObjectContext];\n\n// We're not using undo. By setting it to nil we reduce the memory footprint of the app\n[context setUndoManager:nil];\n\nif (!context) {\n NSLog(@\"Error initializing object model context\");\n exit(-1);\n}\n\n// Get the url of the local xml document\nNSURL *xmlURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@\"Data\" ofType:@\"xml\"]];\n\nNSError *parseError = nil;\n\n// Parse the xml and store the results in our object model\nLocationsParser *xmlParse = [[LocationsParser alloc] initWithContext:context];\n[xmlParse parseXMLFileAtURL:xmlURL parseError:&parseError];\n[xmlParse release];\n\n\n// Create a table view controller\nRootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain];\n\n\n\n/*\n ORIGINAL\n */\nrootViewController.managedObjectContext = context;\nrootViewController.entityName = @\"County\";\n\n\nIf I change the entityName to \n\nrootViewController.entityName = @\"Province\";\n\n\nIt loads the second tier of data into the initial view, but want I want is the load only the second tier of data that belongs to a particular first tier row.\n\nSo replacing the two lines I've marked as original with\n\n// Get the object the user selected from the array\nNSManagedObject *selectedObject = [entityArray objectAtIndex:0];\n\n// Pass the managed object context\nrootViewController.managedObjectContext = self.managedObjectContext;\n\nrootViewController.entityName = @\"Province\";\n\n// Create a query predicate to find all child objects of the selected object. \nNSPredicate *predicate = nil;\npredicate = [NSPredicate predicateWithFormat:@\"(ProvinceToCounty == %@)\", selectedObject];\nNSLog(@\"selectedObject %@\",selectedObject);\n\n\nIt would work if I could work out how the replace entityArray with a reference to the initial loading the data.\n\nHope that makes sense.\n\nWithout any code what I'm hoping to achieve is to use the XML to populate four different pop-over uitableviews, each one has already drilled down a level into the data as it loads. I can get straight to all the second data from all the first tier rows, but that's no good, I only want the second tier data from one first tier row per popoverview.\n\nie emulate this happening\n\n - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {\n\n // Force the data from index 1 of first tier\n NSManagedObject *selectedObject = [entityArray objectAtIndex:1];\n\n rootViewController.managedObjectContext = self.managedObjectContext;\n NSPredicate *predicate = nil;\n\n\n rootViewController.entityName = @\"Province\";\n\n predicate = [NSPredicate predicateWithFormat:@\"(ProvinceToCounty == %@)\", selectedObject];\n\n NSLog(@\"selectedObject %d %@\",indexPath.row, selectedObject);\n\n\nI've learnt a lot in the last four hours but not enough and now I'm defeated..." ]
[ "ios", "cocoa-touch", "uitableview", "predicate", "didselectrowatindexpath" ]
[ "How to embed a variable in a string?", "I am running the following SQL in SEDE (StackExchange Data Explorer).\nThis SQL can specify the date and time for CreationDate, and the default value uses the value of @MonthsAgo variable.\n\nThis works fine if you enter a date and time, but you get the following error with the @MonthsAgo variable:\n\n\n Conversion failed when converting date and/or time from character string.\n\n\nhttps://data.stackexchange.com/stackoverflow/revision/1187086/1459772\n\ndeclare @MonthsAgo date = cast(dateadd(month, -2, getdate()) as date)\ndeclare @since date = ##SinceDate:string?@MonthsAgo##\n\nselect vote.PostId, post.Score, post.CreationDate from votes vote\n inner join posts post on post.Id = vote.PostId\nwhere post.CreationDate >= @since and Tags like '%java%'\norder by post.Score desc\n\n\nHow can I search using this variable?" ]
[ "sql", "sql-server" ]
[ "Make \"Python Markdown\" from nbextensions work with google colab", "I understand google colab doesn't fully support "nbextensions" and some of them aren't yet supported.\nI am trying to figure out if "Python Markdown" would work and if yes how to enable it?\nI have tried the following but so far no success:\n!pip install jupyter_contrib_nbextensions\n!jupyter contrib nbextension install --user\n!jupyter nbextension enable python-markdown/main\n\nHas anyone succeeded in making it work?" ]
[ "python", "jupyter-notebook", "google-colaboratory" ]
[ "Failing to upload .snupkg file: The checksum does not match for the dll(s) and corresponding pdb(s)", "I have a C# WPF library on NuGet. After publishing a new release (.nupkg file), I wanted to also upload the Symbols package (.snupkg file). But I get The checksum does not match for the dll(s) and corresponding pdb(s). error:\n\nI have successfully published .snupkg file together with .nupkg file for 2 other C# .NET Framework libraries, following the exact same procedure as here. The only difference that I can think of is that this a WPF library (it has *.xaml files and it has a reference to PresentationFramework), whereas the other two aren't.\n\nThe procedure:\n\nThe settings for Release configuration in the .csproj files:\n\n<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\n <DebugType>portable</DebugType>\n <Optimize>true</Optimize>\n <OutputPath>bin\\Release\\</OutputPath>\n <DefineConstants>TRACE</DefineConstants>\n <ErrorReport>prompt</ErrorReport>\n <WarningLevel>4</WarningLevel>\n <DocumentationFile>bin\\Release\\GM.WPF.xml</DocumentationFile>\n <DebugSymbols>true</DebugSymbols>\n</PropertyGroup>\n\n\nRebuild (this generates .dll, .dll.config, .pdb, .xml files in bin/Release).\nI have a .nuspec file with the metadata for the NuGet package in the same folder as the .csproj file (I don't think it's necessary to show the .nuspec file - not relevant to this problem).\nOpen PowerShell in this folder.\nExecute command nuget pack -Properties Configuration=Release -Symbols -SymbolPackageFormat snupkg (this generates .nupkg and .snupkg files).\nUpload .nupkg file to NuGet.\nUpload .snupkg file to NuGet - this is where I get the error.\n\nPlease, if you need any other information, I can provide it." ]
[ "c#", ".net", "wpf", "nuget", "nuget-package" ]
[ "Downloading xml from web and using xmlpullparser", "I am very new to the android community \nand i want to learn how to do this steps \n\ni have a link http://one.zero.two.two:8080/OFPB%20v2/contacts.xml\n\nnote : Tomcat is running & numbers are changed into words because of post problems\n\nwhich contains these values :\n\n<contacts>\n<contact>\n<name>will</name>\n<address>add1</address>\n<phone>92</phone>\n<age>8</age>\n</contact>\n<contact>\n<name>dean</name>\n<address>add2</address>\n<phone>925738132</phone>\n<age>18</age>\n</contact>\n<contact>\n<name>renz</name>\n<address>add3</address>\n<phone>1329871287</phone>\n<age>18</age>\n</contact>\n<contact>\n<name>louie</name>\n<address>add4</address>\n<phone>987</phone>\n<age>18</age>\n</contact>\n</contacts>\n\n\nhow do i make a android application and do this and post this in list view ?\n\nNote : this is just for me to reference on so i can get the idea on how to do this\n\nthankyou" ]
[ "android", "xml", "xmlpullparser" ]
[ "GET and POST using AJAX", "So Im new to web programing, I need to GET an HTML page, containing a Form that I want to send via POST, this is what I tried so far:\n\n<script>\nvar msgpost=new XMLHttpRequest();\nmsgpost.open(\"GET\",\"http://localhost/elgg/pg/messages/compose\",false);\nmsgpost.send();\nalert(\"fine\");\ndocument.addEventListener(\"DOMContentLoaded\", function(){\n alert(\"fine2\");\n var hidden1=document.getElementByName(\"__elgg_token\").value;\n var hidden2=document.getElementByName(\"__elgg_ts\").value;\n alert(\"fine3\");\n alert(\"sending hidden1 \"+hidden1+\" 2 \"+hidden2);\n msgpost.open(\"POST\",\"http://localhost/elgg/action/messages/send\",true);\n msgpost.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n msgpost.send(\"__elgg_token=\"+hidden1+\"&__elgg_ts=\"+hidden2+\"&message=PWND&send_to=9&title=PWND\");\n alert(\"done.\");\n},false);\n</script>\n\n\n\"__elgg_token\" and \"__elgg_ts\" are hidden input fields that I need to get their value to POST to the server from /compose.\nSo I get \"fine\" and \"fine2\", the rest is not working and FireBug isn't showing any POST messages outgoing. Any Ideas?" ]
[ "javascript", "php", "ajax", "forms" ]
[ "How force a python script every x seconds", "I have tried the schedule library however my code stalls sometimes which also means the schedule code stalls. Here's the code:\n\nimport schedule\nimport time\nimport app\n\nschedule.every(3).seconds.do(app.run)\nwhile 1:\n try:\n schedule.run_pending()\n except Exception as e:\n print e\n pass\n\n\napp.run is the script, it using Queues and Threads to request exchange data. One of the exchanges randomly throws an error and because the of threading (I think) the code goes into a state of limbo. I can't seem to fix the bug, but a dirty fix to the problem would be force run the script every x time (in my case I want 10 seconds) Any ideas ?" ]
[ "python", "multithreading" ]
[ "abstracting over a collection", "Recently, I wrote an iterator for a cartesian product of Anys, and started with a List of List, but recognized, that I can easily switch to the more abstract trait Seq.\n\nI know, you like to see the code. :)\n\nclass Cartesian (val ll: Seq[Seq[_]]) extends Iterator [Seq[_]] {\n\n def combicount: Int = (1 /: ll) (_ * _.length)\n\n val last = combicount\n var iter = 0\n\n override def hasNext (): Boolean = iter < last\n override def next (): Seq[_] = {\n val res = combination (ll, iter)\n iter += 1\n res\n }\n\n def combination (xx: Seq [Seq[_]], i: Int): List[_] = xx match {\n case Nil => Nil\n case x :: xs => x (i % x.length) :: combination (xs, i / x.length) \n }\n}\n\n\nAnd a client of that class:\n\nobject Main extends Application {\n val illi = new Cartesian (List (\"abc\".toList, \"xy\".toList, \"AB\".toList))\n // val ivvi = new Cartesian (Vector (Vector (1, 2, 3), Vector (10, 20)))\n val issi = new Cartesian (Seq (Seq (1, 2, 3), Seq (10, 20)))\n // val iaai = new Cartesian (Array (Array (1, 2, 3), Array (10, 20)))\n\n (0 to 5).foreach (dummy => println (illi.next ()))\n // (0 to 5).foreach (dummy => println (issi.next ()))\n}\n/*\nList(a, x, A)\nList(b, x, A)\nList(c, x, A)\nList(a, y, A)\nList(b, y, A)\nList(c, y, A)\n*/\n\n\nThe code works well for Seq and Lists (which are Seqs), but of course not for Arrays or Vector, which aren't of type Seq, and don't have a cons-method '::'. \n\nBut the logic could be used for such collections too. \n\nI could try to write an implicit conversion to and from Seq for Vector, Array, and such, or try to write an own, similar implementation, or write an Wrapper, which transforms the collection to a Seq of Seq, and calls 'hasNext' and 'next' for the inner collection, and converts the result to an Array, Vector or whatever. (I tried to implement such workarounds, but I have to recognize: it's not that easy. For a real world problem I would probably rewrite the Iterator independently.)\n\nHowever, the whole thing get's a bit out of control if I have to deal with Arrays of Lists or Lists of Arrays and other mixed cases. \n\nWhat would be the most elegant way to write the algorithm in the broadest, possible way?" ]
[ "scala", "collections", "abstraction" ]
[ "DataTable issue with SSRS in C#", "I have a filled DataTable and I would like to pass it to a Report in c#.\nbefore I do this I test the DataTable in a DataGridView to make sure the data is accurate in the result I get this:(LINK TO IMAGE)\n\nhttp://www.sevakabedi.com/grid.jpg\n\nso after making sure that the data within the DataTable is correct I run this code:\n\nthis.reportViewer1.LocalReport.DataSources.Clear();\nthis.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(\"dsReports\", dt));\nthis.reportViewer1.RefreshReport();\n\n\nThe result that I get in the report is this:\n\nhttp://www.sevakabedi.com/report.jpg\n\nHere are my questions:\n\n\nWhy there is no Channel ID?\nWhy is the Call Date in long date format?\n\n\nThe full source code along with the Database script is available from the link below, you can download it:\n\nhttp://www.sevakabedi.com/IVR_Reports.zip" ]
[ "c#", "reporting-services" ]
[ "How to change date format to day,dd-mm-yy using javascript", "I have a date string in the format dd/mm/yyyy and want to change it.\n\nI want to convert it into format DayOfweek, dd-mm-yyyy. For example 10/7/2016 should be converted to Sun, 10-7-2016.\n\nHow can i do this work?" ]
[ "javascript", "jquery", "date", "date-format" ]
[ "Linux perf: is it possible to somehow ignore busy waiting threads?", "Im trying to do some performance analysis of my process. The process has many threads that are busy looping / busy waiting for events. It looks like perf is picking up the busy loops as the top offenders ( as expected ) but is there any sort of magic to somehow have perf ignore these no-op spins?" ]
[ "linux", "multithreading", "perf" ]
[ "Attach Firefox developer console to add-ons", "Is there a way to attach a developer console to Firefox add-ons and debug the add-on inside the browser just like Chrome? \n\nAlso, I found a setting under about:config called extensions.logging.enabled. Where would these logs appear?" ]
[ "firefox", "firefox-addon", "firefox-addon-sdk" ]
[ "Javascript : Access a particular element in a array", "Hello,\n\nI imported an XML document from a web page that is updated at a regular interval (so I can not change it) and I used the following code to convert the object that I can access as an array:\n\n\r\n\r\n$.ajax(\"js/support.csv\", {\r\n success: function (data) {\r\n var jsonobject = csvjson.csv2json(data);\r\n },\r\n error: function () {\r\n alert(\"error\");\r\n }\r\n });\r\n\r\n\r\n\n\nIt works well, because jsonobject contains all that is in the XML file. The problem is when I try to access a specific value, it shows undefined instead of the actual value. The variable that i'm trying to have the value is \"LAT\" (with quotes) and LONG (without the quotes). I believe these are the quotes that are problematic, because I managed to access the variable LONG jsonobject.rows[0].LONG but not LAT.\nI tried all sorts of things such as jsonobject.rows [0] .LAT, jsonobject.rows [0][\"LAT\"], jsonobject.rows[0].[\\ \"LAT \\\"] and jsonobject.rows[0]['\"LAT\"']. the characters of exhaust does not seem to work.\nSee Attachment\narray variables as seen in the console in Chrome\n\nDo you have an idea?\n\nThank you" ]
[ "javascript", "arrays" ]
[ "In R, barplots of mean w/se while treating subject as random effect", "I am unsure how to provide sample data; my data is currently in a .csv file and is very large. I can provide additional information about the data.\n\nI have used the following code to generate boxplots of the mean for my variable Pun with error bars of the standard error of the mean. However, I did not treat subjects as a random effect (each subject had three trials). \n\nI understand how to fit the random effects model thanks to How to fit a random effects model with Subject as random in R? but I am not sure how I can account for that when I plot it. MS is a factor with 2 levels, Harm is a factor with 4 levels. \n\ncdataPun <- ddply(Emotions1, c(\"MS.f\",\"Harm.f\"), summarise,\n N=length(Pun),\n mean=mean(Pun),\n sd=sd(Pun),\n se=sd/sqrt(N))\n\nggplot(cdataPun, aes(x=Harm.f, y=mean, fill=MS.f)) +\n geom_bar(position=position_dodge(), stat=\"identity\", colour=\"black\", size=.3) +\n geom_errorbar(aes(ymin=mean-se, ymax=mean+se), width=.2,\n position=position_dodge(.9))+\n xlab(\"Harm Level\") +\n ylab(\"Punishment Rating\") +\n scale_fill_hue(name=\"Mental State\",\n breaks=c(\"Blameless\",\"Purposeful\"),\n labels=c(\"Blameless\",\"Purposeful\")) +\n ggtitle(\"Punishment Ratings by Harm and Mental State\") +\n scale_y_discrete(breaks=0:10*1) +\n theme_bw()" ]
[ "r", "ggplot2" ]
[ "SQL server function sum and average counting", "I have two fields with numbers and average but when i trying get total amount first row always NULL.\n\nINSERT INTO weight(\nDATE,\nWEIGHT1,\nWEIGHT2,\nAVERAGE_WEIGHT,\nTOTAL\n)\nVALUES (\nGetDate(),\nconvert(real, '518'),\nconvert(real, '510'),\n\nconvert(real, '514'),\n(SELECT SUM(average_weight) FROM weight)\n) \n\n\nThis query work but problem is somewere with sum function. \n\nWEIGHT1 WEIGHT2 AWERAGE_WEIGHT TOTAL\n518 510 514 0\n518 510 514 514\n\n\nFirst row (TOTAL) should be 514 Sec row (TOTAL) should be 1028\nHow to get right values in right plase?" ]
[ "sql", "sql-server", "database", "sum" ]
[ "Get list which has minimum value from nested list that has different types", "I have list with different elements (string and float), an example: \n\nX = [['carrier', 'arrivaldelay', 'MAX', 0.43085409548228853],\n ['carrier', 'weatherdelay', 'SUM', 0.45040808607625615],\n ['carrier', 'arrivaldelay', 'SUM', 0.4166832477676661],\n ['destination', 'departurdelay', 'MAX', 0.4009409407356311],\n ['destination', 'arrivaldelay', 'AVG', 0.4216147060142493],\n ['origin', 'arrivaldelay', 'AVG', 0.4353396150129142],\n ['origin', 'arrivaldelay', 'MIN', 0.4157363968474399],\n ['origin', 'arrivaldelay', 'STD', 0.4478847651966835]]\n\n\nWhat is the simple and efficient way to get the list which has minimum value based on the last value, \n\nExpected output : ['destination', 'departurdelay', 'MAX', 0.4009409407356311]" ]
[ "python", "list", "indexing" ]
[ "httpclient throw exception on redirect", "I am trying to download a webpage with HttpClient, that's my code:\n\nprivate async Task<string> _doRequest(string url)\n{\n string result = string.Empty;\n\n var client = HttpClient;\n using(var request = new HttpRequestMessage()\n {\n RequestUri = new Uri(url),\n Method = HttpMethod.Get\n }){\n using (HttpResponseMessage response = client.SendAsync(request).Result)\n if (response.Headers.Location == null)\n {\n using (HttpContent content = response.Content)\n {\n result = await content.ReadAsStringAsync();\n }\n }\n else\n {\n result = await _doRequest(response.Headers.Location.ToString());\n }\n };\n\n return result;\n}\n\n\nHttpClient is a static variable initialized as follow:\n\n var handler = new HttpClientHandler();\n handler.AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip;\n handler.AllowAutoRedirect = false;\n HttpClient = new HttpClient(handler);\n HttpClient.DefaultRequestHeaders.Add(\"User-Agent\", @\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36\");\n\n\nWhen I try to execute the code with url = \"https://www.gls-italy.com/?option=com_gls&view=track_e_trace&mode=search&numero_spedizione=TE170187747&tipo_codice=nazionale\"\n\nI get the following:\n\n\nWhich is what lead me to try with curl:\n\n\nAnd here I am lost. To me it looks like a valid 302 with location, but for some reasons HttpClient believe otherwise and just throw an exception.\n\nTo be clear initially I was relying on AllowAutoRedirect default value and thrust HttpClient to do the redirect, it didn't work, I was getting this same exception which lead me to try to manage it myself. But with no success.\n\nAnyone knows what's happening? How to make it work?\n\nThanks in advance." ]
[ "c#", "redirect", "web-scraping", "dotnet-httpclient" ]
[ "Displaying the entire number in vb6", "So I have a program coded in Visual Basic 6 that is essentially Cookie Clicker. when it gets into higher numbers though, it displays \"1E+16\" and so on. I realize this is what is supposed to happen but is there any way to actually display the full number?\n\nEdit:\nThe number is being stored as a double.\n\nPrivate Sub timerDisplay_Timer()\n lblClicks.Caption = dblClicks\nEnd Sub\n\n\nis displaying the number and\n\nPrivate Sub cmdClick_Click()\n If currentItems = 0 Then\n dblClicks = dblClicks + 1\n Else\n dblClicks = (dblClicks + (currentItems * 2))\n End If\nEnd Sub\n\n\nis incresing the number.\n\nWhen the number is \"100000000000000\" (14 zeros), the label displays the number. but when the number is \"1000000000000000\" (15 zeros) it'll display 1E+15. i want is to actually display the number and not the \"xE+y\" format." ]
[ "vb6" ]
[ "Data flow task not getting completed and flat file generated is in locked state", "I have a SSIS package deployed in 64-bit machine. The package is running fine if there are less number of records to be extracted and written to a file. We are using a data flow task for writing into file. However when we are runnning the package for large data extract, the data flow task is not getting completed and the file is getting locked. Please suggest a solution for this." ]
[ "ssis" ]
[ "Azure Rest Api recommendedElasticPools always returns Internal Server Error 500, Is there anyone facing this issue?", "When I tried other rest apis for Azure Mangement, it works without any issue. But when I try this recommendedElasticPools , I am getting internal server error all times.\n\n{\n \"code\": \"InternalServerError\",\n \"message\": \"There was an internal server error that occurred during this request.\",\n \"target\": null,\n \"details\": [],\n \"innererror\": []\n}" ]
[ "rest", "azure", "azure-sql-database", "azure-management-api", "azure-management" ]
[ "Woocommerce : How show product tab in single product", "I use woocommerce for WordPress. And i install it successful, but when open single product. I dont see tabs and reviews and comment.\n\nIts show me this error :\n\nNotice: Function woocommerce_sort_product_tabs() expects an array as the first parameter. Defaulting to empty array. in /home/vvvv/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 1031\n\n\nHow can show that ?\n\nBest wishes" ]
[ "wordpress", "woocommerce" ]
[ "display [no image found] when image src returns no image", "I generate my image src from databse field called [pictureName]. I want when Picture name is null or the name doesn't return image to display [image not found] picture.\nHere is my aspx code to generate img:\n\n<img src=\"WEBIMAGES/<%#Eval(\"BrandName\")%>/<%# Eval(\"PictureName\") %>\" alt=\"\" title=\"<%# Eval(\"ProductName\") %>\">\n\n\nmy images divided into folders for each brand. i have noImage.jpg in every folder.\nhow to display this image when no image displayed.\nI'm using asp.net webforms\nI tried to use onerror event, but not working.\nThanks in advance" ]
[ "html", "asp.net", "image", "src" ]
[ "PHP function Array Returning One records many times", "I have My code Below. I have a function \"getdet\" that return array of record,but i cant able to print the all records the codes displaying only the first records may time. Pls help to solve this issue.\n\n<?php\n\nfunction getdet($qry){\nglobal $con;\n$Selecting=mysqli_query($con,$qry);\n $Fetch=mysqli_fetch_array($Selecting);\n return $Fetch;\n }\n$qry=\"SELECT * FROM `tbs_employee` WHERE EmpId='1' limit 1\";\n$GetData=getdet($qry);\n$i=0;\nwhile($GetData){\necho $i.\"-\".$GetData['EmpId'].\":\".$GetData['EmpName'].\"<br>\";\n$i++;\n}\n?>\n\n\nBelow is my Table\n\n\n\nHere is my result\n\n0-1:Fst Employee\n1-1:Fst Employee\n2-1:Fst Employee\n3-1:Fst Employee\n4-1:Fst Employee\n5-1:Fst Employee\n6-1:Fst Employee\n.\n.\n.\ninfinity" ]
[ "php", "mysql" ]
[ "How to define the struct MAX size to lines scanned from text file", "I am trying to read in a text file simulating CPU scheduling, perform the scheduling algorithm, and printing out the output.\n\ni.e. process id number, arrival time, burst time\n\n1 0 3\n2 4 6\n...\n\n\nHow can I assign the size of the struct to be created with the amount of lines scanned? Can I define MAX as the number of lines scanned? I am able to scan the input file and output the file, however, I have my MAX variable for the struct defined as 10000. The problem with this is that it prints to the file the correct output, but prints 0 0 0 up to 10000 lines after the input lines stop. Here's my functions.\n\n#include<stdio.h>\n#include<stdlib.h>\n#define MAX 10000\n\n\n\ntypedef struct \n{\n int pid;\n int arrTime;\n int burTime;\n int finTime;\n int waitTime;\n int turnTime;\n\n}Process;\n\nProcess pTable[MAX];\n\n\nvoid readTable(char *fileName, Process pTable[MAX])\n{\n\n int i;\n FILE *fileIN = fopen(fileName, \"r+\");\n\n\n\n while(!feof(fileIN))\n {\n fscanf(fileIN, \"%d %d %d\", &pTable[i].pid, &pTable[i].arrTime, &pTable[i].burTime);\n i++;\n }\n\n\n\n fclose(fileIN);\n\n}\n\n\nvoid printTable(char *fileName, Process pTable[MAX])\n{\n\n FILE *fileOUT = fopen(fileName,\"w+\");\n\n\n\n for(int i=0; i < MAX;i++)\n {\n fprintf(fileOUT, \"%d %d %d\\n\",pTable[i].pid, pTable[i].arrTime, pTable[i].burTime);\n } \n\n\n}\n\nint main(int argc, char **argv)\n{\n\n readTable(argv[1], pTable);\n printTable(argv[2], pTable);\n\n\n}\n\n\nHere's the output I'm given for the shortened input file.\n\n1 0 3\n2 4 6\n3 9 3\n4 12 8\n5 13 11\n6 18 19\n7 19 2\n8 23 4\n9 28 1\n10 31 3\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0\n0 0 0" ]
[ "c", "struct", "printf", "scheduling", "scanf" ]
[ "Capture Total Execution time of a parallel thread", "I am using java.util.concurrent.Executors and java.util.concurrent.ExecutorService to execute parallel threads. Please let me know how to capture Time taken for complete all threads. \n\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\npublic class CallBackTest {\n private static int NUM_OF_TASKS = 50;\n Object result;\n int cnt = 0;\n long begTest, endTest;\n\n public CallBackTest() { }\n\n public void callBack(Object result) {\n System.out.println(\"result \"+result);\n this.result = result;\n }\n\n\n public void run() {\n\n ExecutorService es = Executors.newFixedThreadPool(50);\n for(int i = 0; i < NUM_OF_TASKS; i++) {\n\n CallBackTask task = new CallBackTask(i);\n task.setCaller(this);\n es.submit(task);\n // at this point after submitting the tasks the\n // main thread is free to perform other work.\n }\n }\n\n public static void main(String[] args) {\n new CallBackTest().run();\n }\n }" ]
[ "java", "multithreading", "concurrency", "parallel-processing" ]
[ "Compiling class in DLL and referencing it in another project in C#", "Hope I'm asking this correctly.\n\nI have this class:\n\nclass ListUtilities\n{\n private List<string> _datalist;\n\n public ListUtilities(List<string> datalist)\n {\n _datalist = datalist;\n }\n\n //Method to calculate age from a date\n private int getAge(string bdaystr)\n {\n DateTime today = DateTime.Today;\n\n DateTime bday = new DateTime(Convert.ToInt32(bdaystr.Substring(0, 4)), Convert.ToInt32(bdaystr.Substring(4, 2)), Convert.ToInt32(bdaystr.Substring(6, 2)));\n\n int age = today.Year - bday.Year;\n if (bday > today.AddYears(-age)) age--;\n\n return age;\n }\n\n //Method to print the data List\n public void printDataList()\n {\n for (int i = 0; i < _datalist.Count; i++)\n {\n Console.WriteLine(_datalist.ElementAt(i));\n }\n }\n\n //Method to calculate and print the ages\n public void printAges()\n {\n List<int> ages = new List<int>();\n\n for (int i = 0; i < _datalist.Count; i++)\n {\n string s = _datalist.ElementAt(i);\n string[] data = s.Split(',');\n\n ages.Add(getAge(data[3]));\n }\n\n Console.WriteLine(\"Ages:\");\n\n for (int i = 0; i < ages.Count; i++)\n {\n Console.WriteLine(ages.ElementAt(i));\n }\n }\n\n //Method to search by surname\n public string searchBySurname(string surname)\n {\n string res = \"\";\n res = _datalist.Find(delegate(String str)\n {\n string[] data = str.Split(',');\n string sname = data[1];\n\n if (sname == surname)\n return true;\n else\n return false;\n });\n\n return res;\n }\n\n //Method to search by phone number\n public string searchByPhoneNumber(string phone)\n {\n string res = \"\";\n res = _datalist.Find(delegate(String str)\n {\n string[] data = str.Split(',');\n string phn = data[4];\n\n if (phn == phone)\n return true;\n else\n return false;\n });\n\n return res;\n }\n\n //Method to search by age\n public string searchByAge(int age)\n {\n string res = \"\";\n res = _datalist.Find(delegate(String str)\n {\n string[] data = str.Split(',');\n int age2 = Convert.ToInt32(getAge(data[3]));\n\n if (age2 == age)\n return true;\n else\n return false;\n });\n\n return res;\n }\n\n //Method to sort by surname\n public int sortBySurname(string x, string y)\n {\n string[] data_x = x.Split(',');\n string sname_x = data_x[1];\n\n string[] data_y = y.Split(',');\n string sname_y = data_y[1];\n\n return String.Compare(sname_x, sname_y);\n\n }\n\n //Method to sort by phone number\n public int sortByPhoneNumber(string x, string y)\n {\n string[] data_x = x.Split(',');\n int phn_x = Convert.ToInt32(data_x[4]);\n\n string[] data_y = y.Split(',');\n int phn_y = Convert.ToInt32(data_y[4]);\n\n return phn_x.CompareTo(phn_y);\n }\n\n //Method to sort by age\n public int sortByAge(string x, string y)\n {\n string[] data_x = x.Split(',');\n int age_x = Convert.ToInt32(data_x[3]);\n\n string[] data_y = y.Split(',');\n int age_y = Convert.ToInt32(data_y[3]);\n\n return age_y.CompareTo(age_x);\n }\n}\n\n\nand I want to compile it in a .DLL file. I have tried doing it by the console like this:\n\ncsc /target:library /out:MathLibrary.DLL Add.cs Mult.cs\n\n\nand putting that class in a Class Library project and building it, and I get the DLL file in both cases but the problem comes when I want to use that DLL.\n\nI create a new Project, and I do reference the DLL file, but when I want to use it, this is the problem:\n\n\n\nAnd, seems that there is nothing inside the DLL:\n\n\n\nBest regards" ]
[ "c#", "visual-studio-2012", "dll", "import" ]
[ "ReportServer, ReportServerTempDB", "I have MS SQL Server 2008 installed on my machine and also ‘Reporting Services Configuration Manager’.\nWhen I connect to (local) instance with Windows Authentication, I see following two DBs already available in this instance –\n- ReportServer\n- ReportServerTempDB\n\nDo they come as a part of Reporting Services Configuration Manager?\n\nThank you!" ]
[ "sql-server" ]
[ "How to get number of visits for a facebook page using graph api", "I'm trying to get number of Page visits(by unique users) for a Facebook page for the particular day or Week , i hope you know that some of metrics in insights have removed so i'm search for apt metric to show the Page visit count for the day.\n\ni have gone through some of metrics similar to my requirement like (page_engaged_users, Page_impressions etc),\n\nbut i'm confused to choose the best one to fit to my requirement." ]
[ "facebook", "facebook-graph-api", "facebook-javascript-sdk" ]
[ "How to use Swagger with DTOs shared between a Nest.js API and a SPA?", "I have a project with a Nest.js API and an Angular SPA. The DTOs used by the SPA to communicate with the API are in a separate project called Models and I'm using it as a dependency. In that way, I only need to change the DTO in one place, and can reuse them in both projects.\n\nI've been trying to document my API with Swagger using @nestjs/swagger. This lib requires me to use decorators in my DTOs if I want their attributes to be shown in Swagger.\n\nWhen I do that, everything works as expected in my API, but the Angular SPA breaks because it doesn't has the @nestjs/swagger dependency. Even after installing it as dependency for the app, it still requires me to install @nestjs/common, express, mime, send, etc. and I shouldn't install all of those backend related dependencies to my app just for the sake of documentation.\n\nDo you guys have any idea how to overcome this issue or other tips about documentation generation for APIs with Nest.js?" ]
[ "swagger", "nestjs", "dto", "documentation-generation", "nestjs-swagger" ]
[ "SQL Server Edition included with Team Foundation Server 2013", "I am trying to determine what SQL Server edition will be installed with Team Foundation Server 2013 if it is installed on Windows Server 2012 R2 using the Standard Configuration. The install guide is vague about this. Will it be Express or Standard? It appears to be different than with TFS 2012." ]
[ "tfs" ]
[ "Javascript - how to close current browser tab clicking on a button?", "I want to create a button on my website that would close the current browser tab. Searching on stack overflow I got a solution but it isn't working. \n\nThis JavaScript code is:\n\nfunction close_window(){\n if (confirm(\"Are you sure to close window?\")) {\n close();\n }\n}\n\n\nHTML code is:\n\n<button onclick=\"close_window();\"> Close! </button> \n\n\nSo, How can I do this using jQuery or JavaScript for all browser?" ]
[ "javascript", "jquery", "onclick" ]