texts
sequence
tags
sequence
[ "How to declare variables in stored procedure using Select statement in PL/SQL", "I want to create a stored procedure in PL/SQL by declaring variable using a Select statement. How can I create this?\n\nMy stored procedure looks like\n\nCREATE PROCEDURE ValueFinders\n(REGION1 IN VARCHAR2(32 Byte),CONFIG1 IN VARCHAR2(128 Byte))\n\nDECLARE GROUP1 VARCHAR2(128 Byte);\nBEGIN\nSET GROUP1:= Select GROUP from PRODUCTINFO where REGION=REGION1 AND CONFIG=CONFIG1;\n\nselect * from DEAL where GROUP=GROUP1; \n\nEND\n\nexec ValueFinders('ASIA','ABC');\n\n\nThe above code is showing error to me. Please Help. Thanks" ]
[ "oracle", "stored-procedures", "plsql" ]
[ "Turning single objects into object array in ReactJS", "I have a react application, that uses the emoji-mar node module. And I'm trying to make it so a user can add Emojis to user comments. \n\nSO I have a class based 'comment' component, and I have made it work with only one emoji so far. \n\nI have commented my so far solution to array-based solution in the code:\n\n constructor(props){\nsuper(props)\nthis.state ={\n loading: false,\n showModal: false,\n showEmoji: false,\n //emoji: []\n emoji: {\n id: '',\n count: 1\n }\n}\n\n//executed, when a user picks an emoji, the emoji object is sent in as parameter\naddEmoji = (emoji) =>{\nconsole.log(emoji.id)\nconsole.log(this.state.emoji.id)\nif(emoji.id === this.state.emoji.id){\nthis.increment(emoji)\n}else{\nlet selectedEmoji = {\n id: emoji.id,\n count: 1\n}\nthis.setState({\n emoji: selectedEmoji,\n showEmoji: true\n})\nconsole.log(this.state.emoji)\n}\n\n\n}\n\nI also have a method to increment, the count property on the emoji object, so if an emoji is picked more then once it will increment\n\n increment = (emoji) =>{\n console.log(emoji.id)\n console.log(this.state.emoji.id)\n console.log(this.state.emoji.count)\n let newEmoji = {...this.state.emoji}\n newEmoji.count = this.state.emoji.count+1\n console.log(newEmoji.count)\n this.setState( \n {emoji: newEmoji}\n )\n console.log(this.state.emoji.count)\n}\n\n\nand my conditional render, where I display my emojis\n\n {this.state.showEmoji && this.state.emoji != null &&\n <div className=\"emoji\">\n {/*{emojis}*/}\n {\n <Emoji onClick={this.increment} tooltip={true}\n emoji={{id: this.state.emoji.id, skin: 1}} size={25} />}\n <p>{this.state.emoji.count}</p>\n </div>\n }\n\n\nI tried using the map function to map the emoji into a variable, but it gave the error\n\nthis.state.emoji.map is not a function\n\nlet emojis = this.state.emoji.map( (emoji, index) =>{\n return <Emoji onClick={this.increment} tooltip={true}\n emoji={{id: emoji.id, skin: 1}} size={25} />\n})\n\n\neven though I declared it an array. I'm suspecting, that since the array is empty initially, it does not have an object to work within the addEmoji function?" ]
[ "javascript", "arrays", "reactjs", "dictionary", "emoji" ]
[ "How to send data from Child Activity to Parent Activity in android?", "In my manifest.xml, i'm used android:parentActivityName to set up parent Activity.\nHere my code:\n\n<activity\n android:name=\".B\"\n android:label=\"@string/title_activity_A\"\n android:parentActivityName=\".A\" >\n </activity>\n\n\nSo, how to put data from B to A when click back button in action bar?? \nBecause my A activity is child activity of another activity(C activity) and A activity using data from this activity(C activity)...\nSomebody can help me please? Thanks and sorry because my english." ]
[ "android" ]
[ "Using chage and grep command for password expire", "My chage -l $person commmand works perfectly to get all of the password information to the screen, but I need to use grep and cut commands in order to get the password expires date. I cannot use the awk commmand, as we haven't learnt it in class yet, so I am stuck with cut and grep to get the line i need.\n\nLast password change : Feb 19, 2020\nPassword expires : Jun 18, 2020\nPassword inactive : Jun 28, 2020\nAccount expires : never\nMinimum number of days between password change : 0\nMaximum number of days between password change : 120\nNumber of days of warning before password expires : 10\n\n\nI tried\n\nchage -l \"$person\" | grep 'Password expires' | cut -d ':' \n\n\nhow is this wrong?" ]
[ "linux", "grep", "cut" ]
[ "Why can't sbt resolve OpenIMAJ dependency?", "Here is the build.sbt I use in a project:\n\nname := \"FaceReg\"\n\nversion := \"1.0\"\n\nlibraryDependencies += \"org.openimaj\" % \"image-processing\" % \"1.2.1\"\n\n\nWhile updateing the project, sbt reports UNRESOLVED DEPENDENCIES:\n\n[info] Resolving org.openimaj#image-processing;1.2.1 ...\n[warn] module not found: org.openimaj#image-processing;1.2.1\n[warn] ==== local: tried\n[warn] /Users/jacek/.ivy2/local/org.openimaj/image-processing/1.2.1/ivys/ivy.xml\n[warn] ==== public: tried\n[warn] http://repo1.maven.org/maven2/org/openimaj/image-processing/1.2.1/image-processing-1.2.1.pom\n[info] Resolving org.fusesource.jansi#jansi;1.4 ...\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[warn] :: UNRESOLVED DEPENDENCIES ::\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[warn] :: org.openimaj#image-processing;1.2.1: not found\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[trace] Stack trace suppressed: run last *:update for the full output.\n[error] (*:update) sbt.ResolveException: unresolved dependency: org.openimaj#image-processing;1.2.1: not found\n\n\nWhat could be issue? How to solve it?" ]
[ "scala", "sbt", "openimaj" ]
[ "Data with new line read as is in Kendo Grid", "I have a list of data for example Personal Information. Now one of the field has this value\n\n xHistory = \"160 \\n 180 \\n 190\"\n\n\nNow when I display the data, the whole text is shown as is!!!\n\nHow to make the Kendo grid read \"\\n\" as a new line character.\n\n dataSource: {\n data: myData,\n pageable: false\n },\n columns: [{\n field: \"xHistory\",\n title \"History\",\n width: 90\n }]" ]
[ "kendo-grid" ]
[ "UI Layout for registration forms in Android Tablet", "I am developing an application for android 3.0 tablets. One activity of this application contains user registration form.\n\nThis is my preliminary xml layout with few fields\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\" >\n\n <LinearLayout\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:padding=\"15dp\" >\n\n <TextView\n style=\"@style/lable\"\n android:text=\"Name\" />\n\n <LinearLayout\n android:layout_width=\"fill_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"horizontal\" >\n\n <EditText\n android:id=\"@+id/firstName\"\n style=\"@style/editText\"\n android:hint=\"First Name\"\n android:inputType=\"textPersonName\" >\n\n <requestFocus />\n </EditText>\n\n <EditText\n android:id=\"@+id/lastName\"\n style=\"@style/editText\"\n android:hint=\"Last Name\"\n android:inputType=\"textPersonName\" >\n </EditText>\n </LinearLayout>\n\n <!-- USER NAME -->\n\n <TextView\n style=\"@style/lable\"\n android:text=\"Choose your username\" />\n\n <EditText\n android:id=\"@+id/userName\"\n style=\"@style/editText\"\n android:ems=\"10\"\n android:hint=\"Username\"\n android:inputType=\"textEmailAddress\" />\n </LinearLayout>\n\n</ScrollView>\n\n\nFollowing is corresponding style.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <style name=\"lable\">\n <item name=\"android:layout_width\">wrap_content</item>\n <item name=\"android:layout_height\">wrap_content</item>\n <item name=\"android:textAppearance\">?android:attr/textAppearanceMedium</item>\n <item name=\"android:paddingTop\">10dp</item>\n <item name=\"android:textStyle\">bold</item>\n </style>\n\n <style name=\"editText\">\n <item name=\"android:layout_width\">fill_parent</item>\n <item name=\"android:layout_height\">wrap_content</item>\n <item name=\"android:textAppearance\">?android:attr/textAppearanceMedium</item>\n\n <item name=\"android:layout_weight\">1</item>\n </style>\n</resources>\n\n\nAfter adding few fields i noticed there is lot of empty space on the screen. Can anyone tell me what would be proper arrangement in tablet ui for creating registration form?" ]
[ "android", "forms", "user-interface", "tablet" ]
[ "Javascript code breaks when data has null", "I am using the following code which works great but totally stops working when \"thsub\" is null and does not continue reading the rest of the data and just returns a TypeError saying \"thsub in null\"\n\nHere is the code:\n\nvar data = {\n \"cars\": [{\n \"id\": \"1\",\n \"name\": \"name 1\",\n \"thsub\": [{\n \"id\": \"11\",\n \"name\": \"sub 1\",\n \"stats\": {\n \"items\": 5,\n },\n \"ions\": null\n }, {\n \"id\": \"22\",\n \"name\": \"sub 2\",\n \"stats\": {\n \"items\": 5,\n },\n \"translations\": null\n }],\n \"image\": null\n },\n\n {\n \"id\": \"2\",\n \"name\": \"name 2\",\n \"thsub\": null, //this will break the code\n \"image\": null\n }\n ]\n}\n\n\n\nvar thCount = [];\n\nfor (var l = 0, m = data.cars.length; l < m; l++) {\n thCount[l] = 0;\n for (var i = 0, j = data.cars[l].thsub.length; i < j; i++) {\n if (data.cars[l].thsub[i].stats) {\n thCount[l]+=data.cars[l].thsub[i].stats.items;\n }\n }\n}\n\nconsole.log(thCount);\n\n\nHow can I fix this?" ]
[ "javascript" ]
[ "Disabling Ethernet adapter in powershell", "I am fairly new to the powershell, I thought tho that it would be a perfect solution for a quick script to disable all network adapters with one click.\nI have found this website and followed the steps described there.\nEverything looked right untill I called Disable() function. Here is my script:\n\n$lan = get-wmiobject -class Win32_NetworkAdapter -namespace root\\CIMV2 | where-object {$_.Name -match \"Ethernet\"}\n$lanEnabled = $lan | % {$_.NetEnabled}\nwrite-host \"Ethernet status: \" $lanEnabled\nif($lanEnabled){\n write-host \"Disabling Ethernet\"\n $lan | % {$_.Disable()}\n}\nelse{\n write-host \"Enabling Ethernet\"\n $lan | % {$_.Enable()}\n}\n\n\nSo % {$_.NetEnabled} returns correct status of my Ethernet card. I see in the console all outputs from write-host. But the calls to % {$_.Enable()} or % {$_.Disable()} instead of enabling/disabling just output the following (see lines below 'Disabling Ethernet'):\n \n\nAm I doing something wrong? Like I said I am brand new to the powershell world so I wouldn't be surprised... Thanks for your time and help :)" ]
[ "powershell", "powershell-3.0", "ethernet" ]
[ "Safari flexbox text wrapping issue", "I've discovered an issue with Safari (OS X): \nhttps://codepen.io/alexlouden/pen/jONyZKb\n\n\r\n\r\ndocument\r\n .querySelectorAll('.parent')\r\n .forEach(el => {\r\n el.addEventListener(\"mouseover\", event => {\r\n event.target.style.color = 'blue';\r\n })\r\n })\r\n* {\r\n box-sizing: border-box;\r\n}\r\n.parent {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 280px;\r\n padding: 32px;\r\n background-color: #e99;\r\n margin: 32px;\r\n text-align: center;\r\n}\r\n.child {\r\n flex: 1;\r\n max-width: 100%;\r\n background-color: #99e;\r\n}\r\n.grandchild {\r\n overflow-wrap: break-word;\r\n border: 1px dotted black;\r\n}\r\n<div>\r\n In Safari, when you hover on the red area the XXXs will stop wrapping. <br/>\r\n Hover over the blue area and it will fix and re-wrap.\r\n</div>\r\n\r\n<div class=\"parent\">\r\n <div class=\"child\">\r\n <div class=\"grandchild\">\r\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"parent\">\r\n <div class=\"child\">\r\n <div class=\"grandchild\">\r\nCentered\r\n </div>\r\n </div>\r\n</div>\r\n\r\n\r\n\n\nThe grandchild seems to not be respecting the max-width constraint of the child, but only when the style of the parent is modified - not when it's first loaded.\n\nI'm wondering what's causing this behaviour, and whether this is already a known issue with Safari or if I should report the bug?" ]
[ "css", "safari", "flexbox", "word-wrap" ]
[ "How to capitalize vowels that are reversed?", "Working on a homework question that requires us to make a function where all the vowels in a string are reversed. example: This Is So Fun would return Thus Os Si Fin. Just can't figure out how to make the function detect the where the uppercase letters are to convert them into lowercase and vice versa. Right now the function outputs Thus os SI Fin\n\ndef f(word):\n vowels = \"aeiouAEIOU\"\n string = list(word)\n i = 0\n j = len(word)-1\n\n while i < j:\n if string[i].lower() not in vowels:\n i += 1\n elif string[j].lower() not in vowels:\n j -= 1\n else:\n string[i], string[j] = string[j], string[i]\n i += 1\n j -= 1\n\n return \"\".join(string)" ]
[ "python", "function", "for-loop" ]
[ "pip failed to compile wxPython 4.0.7+ on Alpine 3.12.0 with Python 3.8.3", "Upgrading python from 2.7 to 3.8. Tried to install wxPython 4.0.7, 4.0.7post2 and 4.1.0, all failed with below error message:\nIn file included from /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/src/common/xlocale.cpp:31: \n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h: In function 'long int wxStrtol_lA(const char*, char**, int, const wxXLocale&)':\n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h:243:45: error: 'strtol_l' was not declared in this scope; did you mean 'strtold_l'?\n 243 | #define wxCRT_Strtol_lA wxXLOCALE_IDENT(strtol_l) \n | ^~~~~~~~ \n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h:59:39: note: in definition of macro 'wxXLOCALE_IDENT' \n 59 | #define wxXLOCALE_IDENT(name) name \n | ^~~~ \n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h:249:18: note: in expansion of macro 'wxCRT_Strtol_lA' \n 249 | { return wxCRT_Strtol_lA(c, endptr, base, loc.Get()); } \n | ^~~~~~~~~~~~~~~ \n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h: In function 'long unsigned int wxStrtoul_lA(const char*, char**, int, const wxXLocale&)':\n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h:244:46: error: 'strtoul_l' was not declared in this scope; did you mean 'strtoull'? \n 244 | #define wxCRT_Strtoul_lA wxXLOCALE_IDENT(strtoul_l) \n | ^~~~~~~~~ \n /tmp/pip-install-irzbquj6/wxPython/ext/wxWidgets/include/wx/xlocale.h:59:39: note: in definition of macro 'wxXLOCALE_IDENT' \n 59 | #define wxXLOCALE_IDENT(name) name \n | ^~~~ \n\nNot sure whehther there is some library needed. Please share your comments." ]
[ "python", "wxpython", "alpine" ]
[ "Regex Expression to extract UK postcodes from an address string (Hive SQL)", "I'm looking for a bit of help and I hope someone can give me some advice. Anything would be greatly appreciated. I have this regex expression to capture UK postcodes, and I'm happy with it, and when using this expression in any one of the following regex expression testers, the expression works and highlights the postcodes within a full address string (https://regex101.com/ or https://rubular.com/) but not in Hive.\n\\b(([A-Z][0-9]{1,2})|(([A-Z][A-HJ-Y][0-9]{1,2})|(([A-Z][0-9][A-Z])|([A-Z][A-HJ-Y][0-9]?[A-Z])))) [0-9][A-Z]{2}\\b\n\nHowever, the issue I have in Hive SQL is that I have used:\nselect regexp_extract(column, [expression], 0) from table\n\nThe above statement returns all rows back as empty - why is this? I have also tried to use the below statement to no avail:\nselect column from table where column regexp '[expression]'\n\nI would only get an 'OK' return on the query with no data.\nAny help would be amazing :)" ]
[ "sql", "regex", "string", "hive", "expression" ]
[ "When to dispose screens in LibGDX?", "The question is a bit of a throw off, as I don't mean disposing the screen itself. What I am using is an enum and switch statement to switch screens, rather than the Screen and Game classes. What I am really asking here is, when I switch from one game state to the other, am I supposed to dispose all of my disposables before hand? Or do I just keep all of them and not worry about it, despite not rendering them anymore since I'm rendering a separate screen? I'd find it annoying to have to dispose all the resources on my screen every single time I want to switch to another one, so I'm wondering if it's truly necessary." ]
[ "java", "libgdx", "dispose" ]
[ "Quick method to determine ClientDataSet has changes", "Using Delphi Berlin.\n\nI have a nested Clientdataset in a datamodule (\"dmCore\").\n\nThere are about 5000 records in the detail table for any given master item (testing with 2 master records).\n\nI have a \"Post\" button connected to an action in ActionManager.\n\nIts OnUpdate is simple:\n\nactPost.Enabled:=dmCore.HasChanges;// checks master for changes\n\n\n\"HasChanges\" is simple:\n\nfunction TdmCore.HasChanges: boolean;\nbegin\n result := False;\n if cdsPSet.Active then\n result:=(cdsPSet.ChangeCount>0);\nend;\n\n\nUnfortunately, having CDS.ChangeCount run in the action's onUpdate is taking up huge CPU time (>50%).\n\nI haven't noticed this happen on non-nested CDS...\n\nIs there a simpler (faster) mechanism I can use to see if the CDS has changed? I don't need the count, just the fact that there's a change somewhere.\n\nTIA\nEdB" ]
[ "delphi", "delphi-10.1-berlin", "tclientdataset" ]
[ "Onmouseover Opacity Layer except selected block", "I want when onmouseover on particular section to put an OPACITY #fff 0.2 layer on everything except the selected class i.e. table\n\nSimilarly as you have:\n\n.tableHighlight:hover{background-color:#eee}\n<table id='table-main' class='tableHighlight'>\n...\n\n\nbut inversed (puts layer on everything else, but not the table itself)" ]
[ "jquery", "css" ]
[ "How to save selected checkbox values and get it as checked when we move to the next page and come back to checkbox page", "i have an report query having checkbox column, here when we checked some value and sumbiteed it will move on next page and in second page there is an option to go back, when i click on go back button it has to checked the value which is previously checked and show as checked.\n\nhow to work on this in apex\n\nmy report query:\n\nSELECT DISTINCT APEX_ITEM.checkbox (1, ASSOCIATED_PARTY_ID) Select_Checkbox,\n FIRST_NAME || LAST_NAME AS Associated_Party,\n EMAIL AS Associated_Party_Email,\n associated_party_id,\n EMPLOYMENT_STATUS,\n LOCATION AS Current_Location,\n CITY || STATE_PROVISION AS City_State_Provision,\n MANAGER\n FROM ASSOCIATED_PARTIES\n WHERE associated_party_id IN (SELECT associated_party_id\n FROM matters_associated_parties\n WHERE matter_id = :P10_MATTER_ID);" ]
[ "oracle11g", "oracle-apex-5", "oracle-apex-5.1" ]
[ "falcon api using gunicorn WORKER TIMEOUT Raspberry Pi", "import falcon\nglobal_var=False\n\nclass set_gv(object):\n def on_get(self, req, res):\n \"\"\"Handles all GET requests.\"\"\"\n res.status = falcon.HTTP_200 # This is the default status\n global global_var\n global_var=not global_var\n res.body = (str(global_var))\n\nclass ask_gv(object):\n def on_get(self, req, res):\n \"\"\"Handles all GET requests.\"\"\"\n res.status = falcon.HTTP_200 # This is the default status\n res.body = str(global_var)\n\n# Create the Falcon application object\napp = falcon.API()\n\n# Instantiate the TestResource class\nset = set_gv()\nget = ask_gv()\n\n# Add a route to serve the resource\napp.add_route('/set', set)\napp.add_route('/get', get)\n\n\nI am using Falcon framework with gunicorn and above code to host an API to hold a variable and change and retrieve it using API calls with command\n\n`gunicorn -b 0.0.0.0:5000 main:app --reload` \n\n\nWhen I open http://localhost/set it correctly changes and return the value but after sometime I get following error on console and the varaible value is reset \n\n[CRITICAL] WORKER TIMEOUT (pid:8545)\n\n\nAny help on how to fix that. Thanks in advance." ]
[ "python", "api", "raspberry-pi", "gunicorn", "falconframework" ]
[ "Accessing Multipart HTTP Request Body via C# IHttpHandler", "This should be so simple, and I feel like I'm just missing something. I'm new to the HTTP side of this application, so I also feel like I'm shooting in the dark.\n\nWe're doing B2B EDI. We'll receive a multi-part POST request. Each part is XML. I need to extract each part and convert each to an XmlDocument.\n\nHere's what I've written.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Web;\nusing System.Xml;\n\nnamespace Acme.B2B\n{\n public class MultipleAttachments : IHttpHandler\n {\n #region IHttpHandler Members\n\n public bool IsReusable { get { return true; } }\n\n public void ProcessRequest(HttpContext context)\n {\n var ds = extractDocuments(context.Request);\n\n return; // Written for debugging only.\n }\n\n #endregion\n\n #region Helper Members\n\n private IEnumerable<XmlDocument> extractDocuments(HttpRequest r)\n {\n // These are here for debugging only.\n var n = r.ContentLength;\n var t = r.ContentType;\n var e = r.ContentEncoding;\n\n foreach (var f in r.Files)\n yield return (XmlDocument)f;\n }\n\n #endregion\n }\n}\n\n\nI'm pretty confident that (XmlDocument)f won't work, but I'm still exploring. Oddly enough, setting a break-point on var n = r.ContentLength;, the code never hits that break-point. It just hits the break-point I set on the extraneous return;.\n\nWhat the heck am I missing?" ]
[ "c#", ".net", "http", "multipart", "ihttphandler" ]
[ "Frames navigation via aspx server-side", "I'm trying to do some frames navigation which must be made through aspx server-side.\n\nHere's a simple example of what i'm trying to do:\n\npg1.aspx\n\n<%@ Page Language=\"vb\" AutoEventWireup=\"false\" CodeBehind=\"pg1.aspx.vb\" Inherits=\"pg1\" %>\n<html>\n<body>\n <frameset>\n <frame src=\"pg2.aspx\" id=\"pg2\"/>\n <frame src=\"pg3.aspx\" id=\"pg3\"/>\n </frameset>\n</body>\n</html>\n\n\npg2.aspx\n\n<%@ Page Language=\"vb\" AutoEventWireup=\"false\" CodeBehind=\"pg2.aspx.vb\" Inherits=\"pg2\" %>\n<html>\n<head>\n <script>\n alert(parent.frames['pg3'].frames['pg5'].location.href);\n </script>\n</head>\n<body>\n <asp:LinkButton id=\"lkBt\" runat=\"server\"/>\n</body>\n</html>\n\n\npg2.vb\n\nPublic Partial Class pg2\n Inherits System.Web.UI.Page\n\n Protected Sub lkBt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lkBt.Click\n Response.Write(\"<script>\" & vbCrLf)\n Response.Write(\"parent.frames['pg3'].frames['pg5'].location.href = 'pg6.aspx';\")\n Response.Write(vbCrLf & \"</script>\")\n End Sub\n\nEnd Class\n\n\npg3.aspx\n\n<%@ Page Language=\"vb\" AutoEventWireup=\"false\" CodeBehind=\"pg3.aspx.vb\" Inherits=\"pg3\" %>\n<html>\n<body>\n <frameset>\n <frame src=\"pg4.aspx\" id=\"pg4\"/>\n <frame src=\"pg5.aspx\" id=\"pg5\"/>\n </frameset>\n</body>\n</html>\n\n\npg6.aspx\n\n<%@ Page Language=\"vb\" AutoEventWireup=\"false\" CodeBehind=\"pg6.aspx.vb\" Inherits=\"pg6\" %>\n<html>\n<body>\n <p>pg6</p>\n</body>\n</html>\n\n\nThe problem is in pg2.vb, when response writes, i get a javascript error saying:\n\n\n parent.frames.pg3.frames.pg5.location.href is null or not an object\n\n\nWhich is strange because as you can see in pg2.aspx, i've put a test alert of the same href:\n\n\n alert(parent.frames['pg3'].frames['pg5'].location.href);\n\n\nWhich alerts the expected link without any error.\n\nThis seems to be related to the response.write context where aspx runs, i say this because in the browser's debug, when i'm stopped at the breakpoint generated by pg2.vb response write error, in the pages/script selection there's only pg2.aspx.\nBut when i'm debugging and set a breakpoint at pg2.aspx head>script>alert, i can see all the pages in the selector.\n\nDoes anyone have any clue, on how can i make the lkBt_click>Response.Write, run on the context of all the pages?" ]
[ "javascript", "html", "asp.net", "vb.net" ]
[ "Can't modify the value of the session within event handlers for websockets events", "I'm building a little flask&pyhon-based app and my main feature is based on websockets. I discovered that I can't modify the value of the sesssion within event handlers for websockets events(I'm using flask-socketio) because flask stores its session on the client side. So, as the author of the extension recomanded I installed flask-kvsession to store the session on the server-side in a redis-based backend.\n\nI followed the instructions presented http://pythonhosted.org/Flask-KVSession/, but the problem persists. So I created a little program to show you what I'm talking about.\n\n# main.py\nfrom flask import Flask, session, render_template\nfrom flask.ext.socketio import SocketIO\nfrom pprint import pprint\nimport redis\nfrom flask_kvsession import KVSessionExtension\nfrom simplekv.memory.redisstore import RedisStore\n\nstore = RedisStore(redis.StrictRedis())\n\napp = Flask(__name__)\napp.debug = True\napp.secret_key = 'secret!'\nKVSessionExtension(store, app)\nsocketio = SocketIO(app)\n\[email protected]('/')\ndef index():\n pprint(session)\n return render_template(\"client.html\")\n\[email protected]('connect')\ndef handle_connect(message):\n session['debug'] = 'debug'\n\n pprint(session)\n\nif __name__ == \"__main__\":\n socketio.run(app)\n\n\n<!-- templates/client.html -->\n<!DOCTYPE html>\n<html>\n <head>\n </head>\n\n <body>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/\n socket.io/0.9.16/socket.io.min.js\"></script>\n <script type=\"text/javascript\">\n var sock = io.connect('http:localhost:5000');\n sock.emit('connect', {debug: 'debug'});\n </script>\n\n </body>\n\n</html>\n\n\nHere is the output of the werkzeug debuging server:\n\n * Running on http://127.0.0.1:5000/\n * Restarting with reloader\n<KVSession {}>\n127.0.0.1 - - [2014-07-04 21:25:51] \"GET / HTTP/1.1\" 200 442 0.004452\n<KVSession {'debug': 'debug'}>\n<KVSession {}>\n127.0.0.1 - - [2014-07-04 21:26:02] \"GET / HTTP/1.1\" 200 442 0.000923\n<KVSession {'debug': 'debug'}>\n\n\nI'd expect that the second time when I will access that page the contents of the session to be 'debug': 'debug' but it is not.\n\nHere is what happened on the redis server while I was running this app:\n\n127.0.0.1:6379> MONITOR\nOK\n1404498351.888321 [0 127.0.0.1:38129] \"GET\" \"136931c509f674e3_53b6e25b\"\n1404498352.073011 [0 127.0.0.1:38129] \"GET\" \"136931c509f674e3_53b6e25b\"\n1404498362.455320 [0 127.0.0.1:38129] \"GET\" \"136931c509f674e3_53b6e25b\"\n1404498362.612346 [0 127.0.0.1:38129] \"GET\" \"136931c509f674e3_53b6e25b\"\n\n\nAs you can see, the value of the session is accessed 4 times, but is never modfied. \nSo, what should I do to fix this bug?" ]
[ "python", "websocket", "flask", "redis", "socket.io" ]
[ "How to split __DATE__ and __TIME__ macros into individual components for variable declarations?", "I have the following structure (on an embedded system): \n\nstruct Calib_Time_struct\n{\n uint16_t year;\n uint16_t month;\n uint16_t day;\n uint16_t hour;\n uint16_t minute;\n uint16_t seconds;\n};\n\n\nI have a \"default\" values array, in which I need to insert time values:\n\nstruct Calib_Table_struct\n{\n unsigned int table_id; //!< Table identifier.\n char group_name[CAL_TBL_MAX_GROUP_NAME_LENGTH];\n unsigned int channel_number; //!< Channel number within the group.\n float floor_value; //!< Minimum value for a channel.\n unsigned int size; //!< Number of elements in the table.\n struct Calib_Time_struct modification_date; //!< Date of modification.\n};\nstatic const struct Calib_Time_struct default_values[] =\n{\n // Table 0\n {\n .table_id = 0U,\n .group_name = \"ADC\",\n .channel_number = 0U,\n .floor_value = 0.0f,\n .size = 1,\n .modification_date =\n {\n .year = /* extract from __DATE__ macro */;\n },\n },\n //...\n};\n\n\nI would like to fill in the year, month, and day of the \"modification_date\" member from the __DATE__ macro.\n\nIs there a method to do this?\n(Any hacks?)\n\nCan a similar method or hack be applied to the __TIME__ macro?\n\nThe motivation is to allow the compiler (on a build server) to plug in the values automatically, rather than having a developer do this. We have many developer's on the team, and use the build server to make \"official\" builds that are delivered to people outside our team.\n\nThe data will be attached to the executable and stored in Flash, downloaded by a bootloader into memory.\n\nThere are a lot (over 80) tables in the default array.\n\nMy tools:\nIAR Systems IDE & Compiler: 7.4\nEmbedded Systems platform using ARM Cortex-A8. \n\nLanguages: primarily in C, but may be useful for C++ language folks." ]
[ "c++", "c", "date", "macros", "c-preprocessor" ]
[ "LiveData Observer not Called", "I have an activity, TabBarActivity that hosts a fragment, EquipmentRecyclerViewFragment. The fragment receives the LiveData callback but the Activity does not (as proofed with breakpoints in debugging mode). What's weird is the Activity callback does trigger if I call the ViewModel's initData method. Below are the pertinent sections of the mentioned components: \n\nTabBarActivity\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n initVM()\n setContentView(R.layout.activity_nav)\n val equipmentRecyclerViewFragment = EquipmentRecyclerViewFragment()\n supportFragmentManager\n .beginTransaction()\n .replace(R.id.frameLayout, equipmentRecyclerViewFragment, equipmentRecyclerViewFragment.TAG)\n .commit()\n navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener)\n\n}\n\nvar eVM : EquipmentViewModel? = null\nprivate fun initVM() {\n eVM = ViewModelProviders.of(this).get(EquipmentViewModel::class.java)\n eVM?.let { lifecycle.addObserver(it) } //Add ViewModel as an observer of this fragment's lifecycle\n eVM?.equipment?.observe(this, loadingObserver)// eVM?.initData() //TODO: Not calling this causes Activity to never receive the observed ∆\n}\nval loadingObserver = Observer<List<Gun>> { equipment ->\n ...}\n\n\nEquipmentRecyclerViewFragment\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n columnCount = 2\n initVM()\n}\n\n//MARK: ViewModel Methods\nvar eVM : EquipmentViewModel? = null\nprivate fun initVM() {\n eVM = ViewModelProviders.of(this).get(EquipmentViewModel::class.java)\n eVM?.let { lifecycle.addObserver(it) } //Add ViewModel as an observer of this fragment's lifecycle\n eVM?.equipment?.observe(this, equipmentObserver)\n eVM?.initData()\n}\noverride fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {\n val view = inflater.inflate(R.layout.fragment_equipment_list, container, false)\n if (view is RecyclerView) { // Set the adapter\n val context = view.getContext()\n view.layoutManager = GridLayoutManager(context, columnCount)\n view.adapter = adapter\n }\n return view\n}\n\n\nEquipmentViewModel\n\nclass EquipmentViewModel(application: Application) : AndroidViewModel(application), LifecycleObserver {\nvar equipment = MutableLiveData<List<Gun>>()\nvar isLoading = MutableLiveData<Boolean>()\n\nfun initData() {\n isLoading.setValue(true)\n thread { Thread.sleep(5000) //Simulates async network call\n var gunList = ArrayList<Gun>()\n for (i in 0..100){\n gunList.add(Gun(\"Gun \"+i.toString()))\n }\n equipment.postValue(gunList)\n isLoading.postValue(false)\n }\n}\n\n\nThe ultimate aim is to have the activity just observe the isLoading MutableLiveData boolean, but since that wasn't working I changed the activity to observe just the equipment LiveData to minimize the number of variables at play." ]
[ "android", "android-fragments", "mvvm", "kotlin", "android-livedata" ]
[ "if there is a production that contains a nonterminal nullable, then is that production nullable?", "I was wondering, if I got a production that contains a nonterminal nullable, then is that production nullable? \n\nA → aB | ε\n\nB → bA | e\n\nin this example, is B nullable because A is nullable?" ]
[ "context-free-grammar", "automata", "formal-languages" ]
[ "Enumeration types in Directus?", "Does Directus GraphQL support Enumeration types if not can it be adapted somehow?" ]
[ "directus" ]
[ "How to ignore button click of \"Recent Activity Button\" in android 3.0", "My question is self explanatory.\nI have searched a lot but could not found the way to handle Recent activity button click.\nI want to ignore the hardware button clicks of Recent Activity button from the status bar from android 3.0 tablet.\n\nCurrently what I have tried so far is:\n\npublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\n if(keyCode == KeyEvent.KEYCODE_BACK) \n { \n return true;\n }\n // in the same way I have written it for KEYCODE_HOME\n}\n\n\ncan you tell me what should I write to handle recent activity button?\n\nThanking you in advance. :)\n\nEDIT: This is what I have tried now. The KEYCODE_APP_SWITCH is not working.\n\npublic boolean onKeyDown(int keyCode, KeyEvent event) {\n Log.e(\"INSIDE\", \"LOCKDEMO\");\n if (keyCode == KeyEvent.KEYCODE_BACK) {\n Log.e(\"KEY EVENT\", \"BACK\");\n return true;\n }\n if (keyCode == KeyEvent.KEYCODE_HOME) {\n Log.e(\"KEY EVENT\", \"HOME\");\n return true;\n }\n if(keyCode == KeyEvent.FLAG_FROM_SYSTEM) {\n Log.e(\"KEY EVENT\", \"SYSTEM\");\n return true;\n }\n if(keyCode == KeyEvent.FLAG_KEEP_TOUCH_MODE) {\n Log.e(\"KEY EVENT\", \"TOUCH MODE\");\n return true;\n }\n if(keyCode == KeyEvent.FLAG_SOFT_KEYBOARD) {\n Log.e(\"KEY EVENT\", \"SoFT KEYBOARD\");\n return true;\n }\n if(keyCode == KeyEvent.FLAG_VIRTUAL_HARD_KEY) {\n Log.e(\"KEY EVENT\", \"HARDWARE KEY\");\n return true;\n }\n if(keyCode == KeyEvent.KEYCODE_APP_SWITCH) {\n Log.e(\"KEY EVENT\", \"APP SWITCH\");\n return true;\n }\n\n Log.e(\"KEY EVENT\", \"NOT HANDLED\");\n return super.onKeyDown(keyCode, event);\n }\n\n\nWhen I press on RecentAppBtn, it does not even print the last Log statement i.e. Event not handled." ]
[ "android", "android-3.0-honeycomb", "statusbar" ]
[ "HIDlibrary best way to loop write and read code", "I'm using the HIDLibrary and wonder how can I gt this code to loop? I mean send command. Read full response, send command again so on and so on?\n\nThe code works with no issues I can get the command, etc. but want to try and make it continuously loop until closed, etc. Later on I'll add more command but want to make it loop first and then take it from there.\n\nTrying to explain more but that's is all I am after but the site keeps saying I need to explain more but there's no more to explain.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing HidLibrary;\n\nnamespace test\n{\n class Program\n {\n private const int VendorId = 1637;\n private const int ProductId = 20833;\n\n private static HidDevice _device;\n\n public static string tString1 = null;\n\n static void Main()\n {\n _device = HidDevices.Enumerate(VendorId, ProductId).FirstOrDefault();\n\n if (_device != null)\n {\n _device.OpenDevice();\n\n _device.Inserted += DeviceAttachedHandler;\n _device.Removed += DeviceRemovedHandler;\n\n _device.MonitorDeviceEvents = true;\n\n var message = new byte[] { 0, 81, 80, 73, 71, 83, 183, 169, 13 };\n _device.Write(message);\n\n _device.ReadReport(OnReport);\n\n Console.WriteLine(\"Reader found, press any key to exit.\");\n Console.ReadKey();\n\n\n _device.CloseDevice();\n }\n else\n {\n Console.WriteLine(\"Could not find reader.\");\n Console.ReadKey();\n }\n }\n\n\n private static void OnReport(HidReport report)\n {\n if (!_device.IsConnected) { return; }\n\n var cardData = report.Data;\n\n tString1 += Encoding.ASCII.GetString(cardData);\n\n if (tString1 != null)\n {\n if (tString1.IndexOf((char)13) > -1)\n {\n tString1 = tString1.Replace(\" \", \",\");\n Console.WriteLine(tString1);\n Console.WriteLine(\"\");\n tString1 = null;\n }\n else\n {\n _device.ReadReport(OnReport);\n }\n }\n }\n\n private static void DeviceAttachedHandler()\n {\n Console.WriteLine(\"Device attached.\");\n _device.ReadReport(OnReport);\n }\n\n private static void DeviceRemovedHandler()\n {\n Console.WriteLine(\"Device removed.\");\n }\n }\n}" ]
[ "c#", "windows", "visual-studio-2015" ]
[ "access denied in browser (IE8) when I try to retrive xml file", "I have the following\n\n<script type=\"text/javascript\">\nif (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp=new XMLHttpRequest();\n }\nelse\n {// code for IE6, IE5\n xmlhttp=new ActiveXObject(\"MSXML2.XMLHTTP\");\n }\nxmlhttp.open(\"GET\",\"test.xml\",false);\nxmlhttp.send();\nxmlDoc=xmlhttp.responseXML; \n\n\nAnd then the file continues with other stuff... The problem is that I get an error on the line with xmlhttp.open which says Access Denied in IE 8.\nI run all this files locally and all of them are in the same folder... what can I do to get rid of this error? I googled it a little bit and it seems that the error remains. Any ideas?" ]
[ "html", "xml", "parsing", "xmlhttprequest", "xml-parsing" ]
[ "maven archiva clean up old versions of certain artifacts", "I was wondering if there was a way of automaticaly cleaning up old versions of certain artifacts.\nThe specific artifacts that I'm considering are: \n\n\nweb applications\nexecutable jars\n\n\nThere should not realy be more than the most recent version used(or a couple versions back) for these artifacts.\nThe increasingly large amount of versions is filling up diskspace for no reason.\n\nIs there a way to have the most recent 2 or 3 versions for every major release number (for example the 2.x.y for highest values of x and y)?\n\nThis is about actual released versions (not just snapshots(these are already automaticaly purged)) and does will not be applied for libraries used by other projects.\n\nIf possible, how can it be done?\nDo I need an extra tool for this?\nOr do i need to write a batch job myself for this?\n\narchiva version: Apache Archiva 1.3.3" ]
[ "maven", "archiva" ]
[ "origin destination as driven by car/truck path on a folium map", "I am trying to plot a path from an origin to destination on a folium map using python. \nInstead of the usual polyline , is it possible to show the 'as driven by path' (car/truck) from an origin to destination point in a folium map ?\n(something similar to google maps)" ]
[ "python", "leaflet", "folium" ]
[ "Is there a way to show all Sylius products in one view?", "I know one can use show products by taxonomy but what if I would like to show all products in one view no matter the category the product is in?\n\nIs it possible in Sylius or do I have to write my own controller that will use query builder to output all of them? And if yes, then how? Iterate over all taxons and throw barrage of queries at ORM?" ]
[ "symfony", "sylius" ]
[ "How can I search whole word not partial match in string in VBA", "I am trying to replace a word in a string. The below code does the replacing job, but it also replaces partial match which I don't want it to do. \n\nIf InStr(inputString, \"North\") Then\n inputString = Replace(inputString, \"North\", \"N\")\nEnd If\n\n\nThis code replaces north with N, which is great, but it also replaces Northern with Nern, which I don't want. How can I compare only the whole word?\n\nIn php it's == but I am not sure in VBA, by the way I am using this in MS Access VBA." ]
[ "ms-access", "vba" ]
[ "Saving memory on image synchronization on Android", "I got a piece of code like that and it is actually working fine. The only concern that I have is that it convert image to base64, and it seems to eat lots of memory.\n\nI would love to know if there is any better ways to do it.\n\n// SYNCING IMAGES\n private boolean syncImages() {\n boolean update = false;\n\n for (Asset asset : assets) {\n // Get all images for the asset (list) -> get string name of image (string)\n List<Image> remoteAssetImages = RESTfulService.getInstance().getAssetImages(asset.getId());\n ArrayList<String> remoteAssetURIs = new ArrayList<>();\n for (Image img : remoteAssetImages)\n remoteAssetURIs.add(img.getImageId() + \".jpg\");\n\n for (String remoteURI : remoteAssetURIs) {\n if (!asset.getImages().contains(remoteURI)) {\n long imageId = Long.parseLong(remoteURI.replace(\".jpg\", \"\"));\n // Perform synchronous get request\n try {\n Bitmap img = Picasso.with(getApplicationContext())\n .load(\"http://www.google.com/image\" + imageId + \"/jpg\")\n .get();\n saveRemoteImage(getApplicationContext(), img, imageId, asset);\n asset.setConcatenatedImageURI();\n AssetDatabaseHandler.getInstance(getApplicationContext()).updateAsset(asset);\n } catch (IOException e) {\n e.printStackTrace();\n }\n update = true;\n }\n }\n\n Iterator<String> uriIterator = asset.getImages().iterator();\n while(uriIterator.hasNext()){\n String uri = uriIterator.next();\n if (!remoteAssetURIs.contains(uri)) {\n String base64Image = getBase64EncodedImage(getApplicationContext(), uri);\n ImageData postImage = new ImageData(6, asset.getId(), base64Image);\n RESTfulService.getInstance().postImage(postImage);\n renameImageFile(getApplicationContext(), asset, uri, postImage.getImageId()+\".jpg\");\n AssetDatabaseHandler.getInstance(getApplicationContext()).updateAsset(asset);\n }\n }\n }\n\n return update;\n }\n\n public static void renameImageFile(Context context, Asset asset, String currentName, String newName){\n File originalFile = context.getFileStreamPath(currentName);\n File newFile = new File(originalFile.getParent(), newName);\n if (newFile.exists())\n context.deleteFile(newName);\n originalFile.renameTo(newFile);\n asset.getImages().remove(currentName);\n asset.addImage(newName);\n asset.setConcatenatedImageURI();\n }\n\n public static String getBase64EncodedImage(Context context, String imagePath){\n Bitmap bmp = getImageBitmap(context, imagePath);\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bmp.compress(Bitmap.CompressFormat.JPEG, 100, stream);\n byte[] imageDataBytes = stream.toByteArray();\n return Base64.encodeToString(imageDataBytes, Base64.NO_WRAP);\n }\n\n\nRegards," ]
[ "android", "image", "synchronization", "base64" ]
[ "Can I add a page tab app to a differenrt App profile page?", "I wanted to know if I can add a page tab app I created to a different App profile page like I can add it to regular pages on Facebook. I can't see all my app profile pages(only regular pages are listed) when I click under a profile app page the link \"Add to My Page\"." ]
[ "tabs", "profile", "facebook-apps" ]
[ "For a Django middleware class, how can process_request work just fine, but process_exception not be calls?", "I've created my own middleware class in Django that was working just fine until recently. The strange thing is that process_request still gets called just fine, but even when the response is 500 - internal server error, process_exception is not called at all. Why?\n\nIt makes no difference whether I declare my middleware class as the first or the last entry in the list of installed middleware in the settings file.\n\nThanks,\nDave" ]
[ "django", "middleware", "django-middleware" ]
[ "Rails Association Has_One Having Pluralisation Model Name Instead of Singular and not working", "I have a model called as BigbluebuttonRoom.\n\nclass BigbluebuttonRoom < ActiveRecord::Base\nhas_one :room_options, :class_name => 'BigbluebuttonRoomOptions'\n\n\nSo when I am calling room.room_options then getting no method error." ]
[ "ruby-on-rails", "ruby-on-rails-5", "associations", "has-one" ]
[ "How to get XML from MYSQL using Python Flask?", "I got a MYSQL database and a table in it. I want to convert this table into XML and be able to access the data in it using GET method, but the problem I am facing is, I want to know is it possible to use the Python Flask for this process to convert the table to an XML and store it in the memory (like JSON), can someone help me to give an idea of how to achieve this.\n\nThanks," ]
[ "mysql", "xml", "python-3.x", "flask" ]
[ "Error : Undefined property: Account::$Account_model", "A PHP Error was encountered Severity: Notice\nMessage: Undefined property: Account::$Account_model\n\nFilename: Admin/Account.php\n\nLine Number: 19\n\nBacktrace:\n\nFile: C:\\xampp\\htdocs\\AdminLTE\\application\\controllers\\Admin\\Account.php\nLine: 19\nFunction: _error_handler\n\nFile: C:\\xampp\\htdocs\\AdminLTE\\index.php\nLine: 292\nFunction: require_once\n\n\nclass Account extends CI_Controller {\n\n public function _construct() {\n parent::__construct();\n $this->load->model('Account_model');\n }\n\n\n public function index() {\n\n $mdat=[\n 'active_controller' => 'master',\n 'active_function' => 'account/account_view',\n ];\n\n $this->load->view('admin/global/menu', $mdat);\n\n $data['books']=$this->Account_model->get_all_acc();\n $this->load->view('account_view',$data);\n }\n\nthis is my model :\nclass Account_model extends CI_Model\n{\n var $table = 'books';\n\n public function acc_add($data) {\n\n $this->db->insert($this->table,$data);\n return $this->db->insert_id();\n }\n\n public function get_all_acc() {\n $this->db->from('books');\n $query = $this->db->get();\n return $query->result();\n }" ]
[ "php" ]
[ "How to create a .xlsx file in C# with .NET Core 2.1?", "I managed to make the writing work with the .NET Framework 4.6.1 with following code I took from an online source:\n\nusing System;\nusing Excel = Microsoft.Office.Interop.Excel;\n\nclass E\n{\n public static void Main(string[] args)\n {\n\n try\n {\n\n Excel.Application excel;\n Excel.Workbook workbook;\n Excel.Worksheet sheet;\n\n excel = new Excel.Application();\n excel.Visible = true;\n\n workbook = excel.Workbooks.Add();\n sheet = (Excel.Worksheet)workbook.ActiveSheet;\n\n sheet.Cells[1, 1] = \"Number\";\n sheet.Cells[1, 2] = \"English\";\n sheet.Cells[1, 3] = \"German\";\n sheet.Cells[1, 4] = \"Formula\";\n }\n catch (Exception e)\n {\n Console.WriteLine($\"Error: {e.Message} Line: {e.Source}\");\n }\n }\n}\n\n\nSo what happens when I execute it with .NET Core 2.1 is, that it's opening Excel but does not write to the cells. The sheets are not readonly, which I checked.\n\nThank you for your help!" ]
[ "c#", ".net", "excel-interop" ]
[ "Akka Distributed Pub/Sub and number of named topics", "I would like to create a named topic per online user in my system using akka clustering. Does having couple of 10000s named topic at a time impact the performance negatively?" ]
[ "scala", "akka", "distributed-computing", "akka-cluster" ]
[ "Pagecontrol dots are not changing", "I'm trying to work with a page control. This is what I did. I've added one onto my view in the storyboard. \n\nThen in my ViewDidLoad\n\n images = [[NSMutableArray alloc]initWithObjects:[UIImage imageNamed:@\"img1.jpg\"],[UIImage imageNamed:@\"img2.jpg\"],[UIImage imageNamed:@\"img3.jpg\"],[UIImage imageNamed:@\"img4.jpg\"], nil];\n pagecontrol = [[UIPageControl alloc]init];\n self.imageIndex = 0;\n [pagecontrol setNumberOfPages:images.count];\n [pagecontrol setCurrentPage:imageIndex]; \n\n\nLike you can see I have an array of four images. I've added a pagecontrol onto an imageview. I also added two swipe gestures onto the imageView (Left and right). What I want to do now is that when I swipe:\n\n\nThe image is changed\nThe dot is updated with the correct position in the array\n\n\nThis is my code for right swipe:\n\n- (void)next:(UITapGestureRecognizer *)recognizer {\n if(imageIndex == images.count-1){\n imageIndex = images.count-1;\n }else{\n imageIndex++;\n }\n [UIView transitionWithView:self.imgGallery\n duration:1.0f\n options:UIViewAnimationOptionTransitionCrossDissolve\n animations:^{\n self.imgGallery.image = [images objectAtIndex:imageIndex];\n\n } completion:nil];\n [pagecontrol setCurrentPage:imageIndex];\n}\n\n\nProblem\n\nMy images are changing properly. But my pagecontrol dot is not updating and also it is showing only 3 dots.\n\nCan anybody help ?" ]
[ "iphone", "ios", "objective-c", "uipagecontrol" ]
[ "Oracle connection problem on Mac OSX: \"Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection\"", "I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting the database fine so it appears not to be an actual network problem.\n\nAlso, I believe I'm filling in the connection info correctly. It's something like this:\n\n\nhost = foo1.com\nport = 1530\nserver = DEDICATED\nservice_name = FOO\ntype = session\nmethod = basic" ]
[ "oracle", "macos" ]
[ "Clickhouse shared dictionaries", "Is there any way to \"share\" or \"replicate\" a dictionary among multiple machine in the same shared and/or cluster using clickhouse.\n\nCurrently I have ~10 files for external dictionaries that clickhouse loads up (and a few csvs where the data is loaded from). All the dictionaries are quite small and critical for a lot of queries, so I'd like to find a way to distribute them instead of having to maintain up to date copies on every cluster. \n\nIs there any way to do this ?" ]
[ "columnstore", "clickhouse" ]
[ "Multi-Color Rectangles", "My goal is to create Multi-color rectangles that gets bigger when "Left-Clicked" and smaller when "Right-Clicked". I also want to add a keyboard press that changes its color when pressed.\nThe problem with my code are:\n\n"Out of bounds exceptions" - How can I possibly fix this? If it reaches the end of the index, I would like it to stay at the last index and not throw an out of bounds error\n\nRectangles keeps changing its color when "keyPressed()" is called inside the "draw()".\n\n\nWhen I call the "keyPressed()" inside the "setup()", I losses the mousePressed() function.\nHow could I incorporate these two function having static rectangles that only changes the color when Keyboard is pressed and gets bigger or smaller when the mouse button is pressed?\nint[] numberOfChoices = {5, 10, 20, 25, 50, 100, 125, 250}; //an array that defines the sizes of rectangles\nint arrayNum;\nvoid setup(){\n size(500,500);\n \n}\n\nvoid draw(){\n \n keyPressed();\n \n}\n\nvoid keyPressed(){\n for(int x = 0; x < width; x+=numberOfChoices[arrayNum]){\n for(int y = 0; y < height; y+=numberOfChoices[arrayNum]){\n fill(random(255), random(255), random(255));\n rect(x,y,numberOfChoices[arrayNum],numberOfChoices[arrayNum]);\n }\n }\n} \n\nvoid mousePressed(){\nif(mouseButton==LEFT){\n arrayNum +=1;\n}\nelse arrayNum-=1;\n\n}" ]
[ "java", "processing" ]
[ "Modify Woocommerce Javascript", "The context:\nI have a bunch of product variations with 2-3 different attributes, but one is the \"main one\" while the others are all unique once the main attribute is selected, so I need to auto-select them on change of the main one (and probably hide the dropdowns with css).\n\nI've copied the corresponding file into my theme and made an override\n\nwp_deregister_script('wc-add-to-cart-variation');\nwp_register_script('wc-add-to-cart-variation', get_bloginfo( 'stylesheet_directory' ). '/js/add-to-cart-variation.js' , array( 'jquery' ), WC_VERSION, TRUE);\nwp_enqueue_script('wc-add-to-cart-variation');\n\n\nThis is working correctly, but it throws an error:\n\nUncaught TypeError: wp.template is not a function\n\n\nI've made no changes to the file so far, so I'm expecting it to work correctly since I'm swapping a file with an identical one at the moment, but I'm clearly missing something...\n\nThanks a lot in advance to all of you\n\nPS. EDIT:\n\nThis are the first bunch of rows from add-to-cart-validation.js where the error is thrown in case it could help.\n\n;(function ( $, window, document, undefined ) {\n\n$.fn.wc_variation_form = function() {\n var $form = this,\n $single_variation = $form.find( '.single_variation' ),\n $product = $form.closest( '.product' ),\n $product_id = parseInt( $form.data( 'product_id' ), 10 ),\n $product_variations = $form.data( 'product_variations' ),\n $use_ajax = $product_variations === false,\n $xhr = false,\n $reset_variations = $form.find( '.reset_variations' ),\n template = wp.template( 'variation-template' ),\n unavailable_template = wp.template( 'unavailable-variation-template' ),\n $single_variation_wrap = $form.find( '.single_variation_wrap' );" ]
[ "javascript", "jquery", "wordpress", "woocommerce" ]
[ "Tortoise not recognizing certain .cs file", "I created a new class in VS. For some reason Tortoise is not picking it up and I can't figure out why. Wondering if anyone has had this issue?\n\nI am not excluding .cs or do not have * in my filter so not sure what the deal is. All other files picked up just fine." ]
[ "tortoisesvn" ]
[ "Installation with visual studio 2010", "I need to create setup file for installation of these: \n-Web app \n-Win service \n-Run some sql scripts. \n\nI wanted to do all in one setup. For example I want to make method like CreateSetup and in that method to create setup file which will contain installation/run of above 3 things.\n\nIf you have some links or idea how to do it please share.\n\nThank you in advance.\nIf I come across some solution I will post it here for others as well." ]
[ "visual-studio-2010", "installation" ]
[ "HTML How to change an object's position relative to another Image", "For my website I have an image showing a screen. Inside that screen I have moved an embeded youtube video inside that screen. So the embed is on top of the image. I can get the embeded video into the correct place using this:\n\n<div style=\"position:relative\"> \n <img src=\"screen.png\" />\n <div style=\"position:absolute; left:0px;top:0px;\"> \n <embed src=\"http://www.youtube.com/embed/qoSEzTpbxP4\" width=\"310\" height=\"210\" allowfullscreen=true\"></embed> \n </div>\n</div> \n\n\nI want the entire thing to be centered, however if I surround this with tags then obviously nothing centers because of the position; the embed stays 544 from the left of the window, not from the left of the image. Is there a way of making the embed move to match the images centered postion?\n\n(NB: I'm aware that I should be using a seperate CSS doc for all styles, but I'm not interested in that right now, I just want to get it working then I might encapsulate styles into a seperate place later)" ]
[ "html", "css-float", "centering" ]
[ "ADFS - Certificate not unique", "I have created several applications that use SAML2 authentication. These applications (including SalesForce) often share the same domain (ie: reports.application.com, portal.application.com, etc) but are NOT part of a single application or even on the same stack. Some subdomains lead to SalesForce, some to other applications.\n\nThe problem is that ADFS reports the \"Certificate is not unique\" and refuses to allow applications to be registered in the ADFS database because the certificates are the same. This is especially troublesome with SalesForce.\n\nI'm not sure how to work around this.\n\nEdit: It is important to note that nearly all of these applications are SAML2 and not ADFS." ]
[ "windows", "adfs", "federation" ]
[ "How to generate STRICTLY increasing number with no gap in Azure Sql Database", "I have a MVC 5 application that access a Sql Database through Entity framework. I have a invoice model that looks like :\n\nclass Invoice \n{\npublic int Id {get; set;}\npublic int InvoiceNumber {get; set;}\n// other fields ....\n}\n\n\nInvoiceNumber have a lot of legal constraint. It needs to be unique, and incremental with no gap. I initially though that my Id would do the job till I have found that for some reasons I may have gaps between the id ( 1,2,3,...,7 then 1000 ... , for inst see Windows Azure SQL Database - Identity Auto increment column skips values ).\nTake into account that many clients could be connected at the same time so these Inserts may be concurrent.\n\nDoes someone know how to force EF or the database to generate this kind of invoice number." ]
[ "sql-server", "entity-framework", "azure-sql-database" ]
[ "Logical not for media queries selector", "Can I do negation of media query selector?\nSomething like:\n\n@media ($mat-xsmall):not() {\n nav {\n // taken from md-card-image styles\n margin-top: -24px !important;\n width: calc(100% + 48px);\n margin: 0 -24px 16px;\n }\n}" ]
[ "selector", "media" ]
[ "if dropdown option with value is selected then change text else do not change text", "I need to change the label if the selected value in the dropdown menu is tribute_type_value1, otherwise I do not want it to change the value. \n\nThe script below changes the value no matter what is selected, but I only want the text to change if tribute_type_value1 is selected. If it is selected then tribute_type_value2 is selected the text should revert back to the orginal.\n\n\r\n\r\n$(\"#tribute_type\").change(function () {\r\n if ($(\"#tribute_type\").value = \"tribute_type_value1\") {\r\n $(\"label[for=tribute_notify_recip_street1name]\").text(\"Person to Notify Street 1:\");\r\n } \r\n});\r\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"></script>\r\n<select name=\"tribute_type\" id=\"tribute_type\" size=\"1\">\r\n <option></option>\r\n <option value=\"tribute_type_value1\">In Memory of</option>\r\n <option value=\"tribute_type_value2\">In Honor of</option>\r\n</select>\r\n\r\n<label for=\"tribute_notify_recip_street1name\">Honoree Street 1:</label>" ]
[ "javascript", "jquery", "html" ]
[ "Is char datatype is supported in Liferay service builder", "I just want to know is service builder support char data type. We can change the size of varchar by tables.sql file. So if I am using varchar(1) then it will work perfectly or not.\nI have already created tables so I have to use that one. I didn't use char in service.xml, is it possible or we have any alternative.\nLiferay 6.1\ntomcat 7\nEclipse" ]
[ "sql-server-2008", "liferay-6" ]
[ "How do you bundle getters in Java?", "public String getPet() {\n public String getName() {\n return name;\n }\n public String getType(){\n return type;\n }\n public String getDescription() {\n }\n return description;\n }\n\n\nI would like to bundle three getters into one, so that getPet()\ngets getName(), getType(), and getDescription(). I typed this out, but there is something wrong with my syntax that I cannot figure out." ]
[ "java", "methods", "getter" ]
[ "Multiple inequality (a < b < c...) with potentially missing value", "I would like to test multiple inequalities at once, i.e. \n\nif (a &lt; b &lt; c &lt; ...)\n\n\nwhich is fine when all the values are present. However sometimes the numeric value of one or more of the variables to be compared may be missing/unknown; the correct behaviour in my context is to assume the associated inequality is satisfied. Let's say I assign the special value None when the value is unknown: the behaviour I want from the &lt; operator (or an alternative) is:\n\n&gt;&gt;&gt; a = 1; b = 2; c = 3\n&gt;&gt;&gt; a &lt; b &lt; c # this works fine, obviously\nTrue \n&gt;&gt;&gt; b = None\n&gt;&gt;&gt; a &lt; b &lt; c # would like this to return True\nFalse\n\n\nSo I want to get True if one variable is truly smaller than the other, or if one variable is missing (takes any particular pre-decided non-numerical value), or if both variables are missing, and I want to be able to string the comparisons together one go i.e. a &lt; b &lt; c &lt; ...\nI would also like to do this with &lt;= as well as &lt;.\nThanks" ]
[ "python", "missing-data", "inequalities" ]
[ "How to copy the contents of a folder to multiple folders based on number of files?", "I want to copy the files from a folder (named: 1) to multiple folders based on the number of files (here: 50).\n\nThe code given below works. I transferred all the files from the folder to the subfolders based on number of files and then copied back all the files in the directory back to the initial folder. \nHowever, I need something cleaner and more efficient. Apologies for the mess below, I'm a nube.\n\nbf=1 #breakfolder\ncd 1 #the folder from where I wanna copy stuff, contains 179 files\n\nflies_exist=$(ls -1q * | wc -l) #assign the number of files in folder 1\n\n#move 50 files from 1 to various subfolders\n\nwhile [ $flies_exist -gt 50 ]\ndo\n\nmkdir ../CompiledPdfOutput/temp/1-$bf\nset --\nfor f in .* *; do\n [ \"$#\" -lt 50 ] || break\n [ -f \"$f\" ] || continue\n [ -L \"$f\" ] &amp;&amp; continue\n set -- \"$@\" \"$f\"\ndone\n\nmv -- \"$@\" ../CompiledPdfOutput/temp/1-$bf/\nflies_exist=$(ls -1q * | wc -l)\nbf=$(($bf + 1))\ndone\n\n#mover the rest of the files into one final subdir\n\nmkdir ../CompiledPdfOutput/temp/1-$bf\nset --\nfor f in .* *; do\n [ \"$#\" -lt 50 ] || break\n [ -f \"$f\" ] || continue\n [ -L \"$f\" ] &amp;&amp; continue\n set -- \"$@\" \"$f\"\ndone\nmv -- \"$@\" ../CompiledPdfOutput/temp/1-$bf/\n#get out of 1\ncd ..\n\n# copy back the contents from subdir to 1\nfind CompiledPdfOutput/temp/ -exec cp {} 1 \\;\n\n\nThe required directory structure is:\n\n parent\n ________|________\n | |\n 1 CompiledPdfOutput\n | |\n(179) temp\n |\n ---------------\n | | | |\n 1-1 1-2 1-3 1-4\n (50) (50) (50) (29)\n\n\n\nThe number inside \"()\" denotes the number of files.\n\nBTW, the final step of my code gives this warning, would be glad if anyone can explain what's happening and a solution.\n\ncp: -r not specified; omitting directory 'CompiledPdfOutput/temp/'\ncp: -r not specified; omitting directory 'CompiledPdfOutput/temp/1-4'\ncp: -r not specified; omitting directory 'CompiledPdfOutput/temp/1-3'\ncp: -r not specified; omitting directory 'CompiledPdfOutput/temp/1-1'\ncp: -r not specified; omitting directory 'CompiledPdfOutput/temp/1-2'\n\n\nI dont wnt to copy the directory as well, just the files so giving -r would be bad." ]
[ "linux", "bash" ]
[ "Animation from bottom for border-bottom", "I have the following CSS which currently fades in the border-bottom.\n\n.nav-bar-button {\n border-bottom: solid 13px transparent;\n min-width: 90px;\n padding: 0px;\n cursor: pointer;\n text-align: center;\n position: relative;\n @media #{$for-tablet, $for-phone} {\n min-width: 81px;\n }\n\n &amp;:hover {\n border-bottom: solid 13px $brand-primary;\n transition-timing-function: ease-in;\n transition: .5s;\n }\n\n &amp;.active {\n border-bottom: solid 7px $brand-primary;\n padding-bottom: 6px;\n transition: .5s;\n transition-timing-function: ease-in;\n }\n}\n\n\nWhat I want is to animate the border-bottom to appear as if it's sliding in from underneath of the nav-bar-button. Is there a way to do this while still avoiding the \"jumping\" from the navbar button expanding?\n\nHere's the reactjs and HTML as well, edited to make it easier to understand:\n\n render () {\n let indicatorClasses = [styles.navBarButton]\n if (this.props.isActive) {\n indicatorClasses.push(styles.active)\n }\n\n return (\n &lt;div\n className={indicatorClasses.join(' ')}\n onClick={(e) =&gt; { this.onClick(e) }} &gt;\n &lt;span className={styles.navBarButtonLabel}&gt; {this.props.label.toUpperCase()} &lt;/span&gt;\n &lt;/div&gt;\n )\n }\n}\n\n&lt;div class=\"style__navbar-buttons-container___1IIp4\"&gt;\n &lt;div class=\"ant-row\"&gt;\n &lt;div class=\"ant-col-8\"&gt;\n &lt;div class=\"style__nav-bar-button___30PmS\"&gt;\n &lt;span class=\"style__nav-bar-button-label___wjjHW\"&gt;HOME&lt;/span&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/div&gt;" ]
[ "css", "reactjs", "sass" ]
[ "Update content without refreshing the page", "I use CMS to create HTML pages with JSON inside a script tag. Single-file components use data from this JSON. I want to update page content when navigating a site without refreshing the page. All routes already exist, the CMS is responsible for everything.\n\nAs I understand it now, I need to make a request, get a HTML page, parse JSON from this page and update data and components, as well as change the insides of the head tag and update browser history.\n\nCan I use Vue Router for this? Is there an easier solution?" ]
[ "vue.js", "vuejs2", "vue-router" ]
[ "CSS - Removing all widths from rows and columns with bootstrap", "I have a section on my site which has two rows of four columns with a block image and a heading across the image. \nI want to be able to dictate the margin-width between each column/image - basically it needs to be quite narrow. However there appears to be standard gutter widths for each column and I can't seem to remove them. I've tried using .no-gutter classes but they don't seem to be working. How do I remove all spacing between the columns/images so I can implement my own? \nHere's the code as it stands - \n\n\r\n\r\n#whatwedo {\r\n width: 100%;\r\n max-width: 100%;\r\n height: auto;\r\n}\r\n\r\nh1 {\r\n font-size: 3rem;\r\n font-weight: normal;\r\n color: #000;\r\n text-align: center;\r\n margin: 0;\r\n padding-bottom: 0px;\r\n}\r\n\r\n.container-fluid {\r\n width: auto;\r\n margin: 0px auto;\r\n /* max-width: 80rem; */\r\n}\r\n\r\n.row .no-gutter {\r\n margin-right: 0;\r\n margin-left: 0;\r\n}\r\n\r\n.col {\r\n /* width: calc(25% - 2rem); */\r\n /* margin: 1rem; */\r\n height: 300px;\r\n width: 300px;\r\n margin-bottom: 20px;\r\n}\r\n\r\n#whatwedo .col {\r\n position: relative;\r\n}\r\n\r\n#whatwedo h2 {\r\n position: absolute;\r\n top: 50%;\r\n left: 30%;\r\n margin: 0 20px 0 20px;\r\n color: white;\r\n text-align: center;\r\n transform: translate(-50%, -50%)\r\n}\r\n&lt;section id=\"whatwedo\"&gt;\r\n &lt;div class=\"container-fluid\"&gt;\r\n &lt;h1&gt;What we do&lt;/h1&gt;\r\n &lt;div class=\"container\"&gt;\r\n &lt;div class=\"row no-gutters\"&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Brand Identity&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Graphic Design&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Editorial Design&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Brand Guidelines&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n\r\n &lt;/div&gt;\r\n &lt;div class=\"row no-gutters\"&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Print Management&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Signage&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Creative Direction&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n &lt;div class=\"col\"&gt;\r\n &lt;h2&gt;Illustration &amp; Animation&lt;/h2&gt;\r\n &lt;img src=\"http://res.cloudinary.com/mrmw1974/image/upload/v1506013647/what_we_do1_tfckgo.jpg\" style=\"width: 300px; height: 300px;\"&gt;\r\n &lt;/div&gt;\r\n\r\n &lt;/div&gt;\r\n &lt;/div&gt;\r\n &lt;/div&gt;\r\n\r\n&lt;/section&gt;\r\n\r\n\r\n\n\nIt doesn't necessarily look very clear here but with bootstrap this is how the page looks - \n\n\n\nI think the width gaps are also causing the columns inability to all stay aligned in one block and dropping down onto another row." ]
[ "html", "twitter-bootstrap", "css" ]
[ "Is there a way to prioritize fragment dependencies?", "Is there a way to prioritize fragment dependencies? I have the case that one of the maven plugins that is used at compile time does not use the hierarchical OSGi Classloading, but instead uses a \"flat\" classpath. Now there is a version conflict between (transitive) dependencies of the host plugin and the fragment. Everything would work fine in a hierarchical scneario, but fails for the \"flat\" classpath.\n\nIs there a way to prioritize the fragments dependencies? Logically, i mean that the dependencies of the fragment should be resolved before the dependencies of the host." ]
[ "maven", "tycho", "osgi-fragment" ]
[ "qlik sense - concat the same column few times", "I have to do this exercise and I need your help.\nI have a table with this rows:\nTable Emp: Id, Name, Country, Age.\nI have loaded this table twice\nThe second table is Table Emp2: Id2, Name2, Country2, Age2.\n(with the same values like table emp1)\nI want to create a pivot table, the dimension will be emp.id. the measure will be the concatinate of all the id's of the employees in table emp2 that have the same name and country.\nDo I need to use the concat function? and how to do it?\nThank you!" ]
[ "concatenation", "pivot-table", "qliksense" ]
[ "ValidateProperties code", "Hi all i am using mvvmcross and portable class libraries , so i cannot use prism or componentmodel data annotations, to validate my classes. basically i have a modelbase that all my models inherit from. \n\nMy validate code below is horribly broken, basically im looking for the code that data annotations uses to iterate thru all the properties on my class that is inheriting the base class ,\n\ni have written various attributes that are there own validators inheriting from \"validatorBase\" which inherits from attribute. i just cannot for the life of me figure out thecode that says ... ok im a class im going to go through all the properties in me that have an attribute of type ValidatorBase and run the validator. my code for these are at the bottom\n\npublic class ModelBase\n{\n\n private Dictionary&lt;string, IEnumerable&lt;string&gt;&gt; _errors;\n public Dictionary&lt;string, IEnumerable&lt;string&gt;&gt; Errors\n {\n get\n {\n return _errors;\n }\n\n }\n\n protected virtual bool Validate()\n {\n var propertiesWithChangedErrors = new List&lt;string&gt;();\n\n // Get all the properties decorated with the ValidationAttribute attribute.\n var propertiesToValidate = this.GetType().GetRuntimeProperties()\n .Where(c =&gt; c.GetCustomAttributes(typeof(ValidatorBase)).Any());\n\n foreach (PropertyInfo propertyInfo in propertiesToValidate)\n {\n var propertyErrors = new List&lt;string&gt;();\n TryValidateProperty(propertyInfo, propertyErrors);\n\n // If the errors have changed, save the property name to notify the update at the end of this method.\n bool errorsChanged = SetPropertyErrors(propertyInfo.Name, propertyErrors);\n if (errorsChanged &amp;&amp; !propertiesWithChangedErrors.Contains(propertyInfo.Name))\n {\n propertiesWithChangedErrors.Add(propertyInfo.Name);\n }\n }\n\n // Notify each property whose set of errors has changed since the last validation. \n foreach (string propertyName in propertiesWithChangedErrors)\n {\n OnErrorsChanged(propertyName);\n OnPropertyChanged(string.Format(CultureInfo.CurrentCulture, \"Item[{0}]\", propertyName));\n }\n\n return _errors.Values.Count == 0;\n\n }\n}\n\n\nhere is my validator\n\npublic class BooleanRequired : ValidatorBase\n{\n public override bool Validate(object value)\n {\n\n bool retVal = true;\n retVal = value != null &amp;&amp; (bool)value == true;\n var t = this.ErrorMessage;\n if (!retVal)\n {\n ErrorMessage = \"Accept is Required\";\n }\n return retVal;\n }\n}\n\n\nand here is an example of its usage\n\n [Required(ErrorMessage = \"Please enter the Amount\")]\n public decimal Amount\n {\n get { return _amount; }\n set { _amount = value; }//SetProperty(ref _amount, value); }\n }" ]
[ "c#", "validation", "mvvm", "mvvmcross" ]
[ "Snake loader css animation keyframes doesn't work", "Im trying to make a snake loader spinner with css using keyframes animation but i don't know it doesn't work\nsomeone can help?\nhere the fiddle:\nhttps://jsfiddle.net/fs6kafsn/\n\n@keyframes rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.spinner {\n display: block;\n margin: 50px;\n height: 28px;\n width: 28px;\n animation: rotate 0.8s infinitelinear!important;\n -webkit-animation: rotate 0.8s infinitelinear!important;\n border: 8px solid red;\n border-right-color: transparent;\n border-radius: 50%;\n position:relative;\n}\n\n\nthanks in advance" ]
[ "css", "animation", "spinner", "keyframe" ]
[ "Inconsistent accessibility error declaring public class method with internal type (C#)?", "I have a JSON class object that is an internal class. I'd like to keep it that way to keep other code from trying to create objects of that type since I only want the JSON deserialization code to do that. I can use the class type as a variable, but if I try to return an object of that type I get an inconsistent accessibiliy compiler error because the method is public and the class is internal. \n\nWhat is the best way to resolve this situation? I guess I could create an interface for the internal class and pass that around, but that means I have to create extra baggage for every JSON class I am using and I'm using a lot of them.\n\nEDIT: I made the change suggested by Jon Skeet and the problem went away. I got into this problem because of the habit of declaring my classes public by default. I'm pointing this out for others that are doing the same thing.\n\n// The internal class.\ninternal class JsonPetShelters\n{\n\n [JsonProperty(\"@encoding\")]\n public string Encoding { get; set; }\n\n [JsonProperty(\"@version\")]\n public string Version { get; set; }\n\n [JsonProperty(\"petfinder\")]\n public Petfinder Petfinder { get; set; }\n}\n\n// This method gets the inconsistent accessibility error since\n// JsonPetShelters is an internal class.\npublic JsonPetShelters GetShelters()\n{\n // For example purposes only\n return null;\n}" ]
[ "c#", "public", "internal", "class-visibility" ]
[ "Facebook Marketing API: delete() vs. deleteSelf() in PHP SDK", "What is the difference between delete() and deleteSelf() methods in Facebook Marketing API? Campaign documentation now uses deleteSelf() as an example, but it was delete() before.\n\ndelete() is method of AbstractArchivableCrudObject abstract class, while deleteSelf() is method defined for each entity (like campaign, adset, ad) separately.\n\nI'm struggling to use deleteSelf() though, getting missing API error, even though it seems to be properly instantiated (all other functionalities work):\n\n$campaign = new \\FacebookAds\\Object\\Campaign(\n $campaignId,\n null,\n new \\FacebookAds\\Api(\n new \\FacebookAds\\Http\\Client,\n new \\FacebookAds\\Session($appId, $appSecret, $accessToken)\n )\n);\n\n$campaign-&gt;deleteSelf();\n\n\nThe error is:\n\n\n An Api instance must be provided as argument or set as instance in the \\FacebookAds\\Api\n\n\nIf I replace $campaign-&gt;deleteSelf() with $campaign-&gt;delete(), it works without any problem.\n\nWhat's the deal about deleteSelf()?" ]
[ "php", "facebook", "facebook-graph-api", "facebook-marketing-api" ]
[ "How to add the Values in String Array which one enter through User?", "I am tring to add all the values in String Array but it don't work:\n\npublic class Info extends Activity {\nprivate static final String TAG = \"Info\";\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.info);\n\n Intent myIntent = getIntent(); \n Bundle b = myIntent.getExtras(); \n String choice = b.getString(\"choice\"); \n String fname = b.getString(\"fname\");\n String lname = b.getString(\"lname\");\n String add = b.getString(\"add\");\n String coun = b.getString(\"coun\");\n String pro = b.getString(\"pro\");\n String pcode = b.getString(\"pcode\");\n\n Log.i(TAG,\"selection: \" + choice); \n TextView textView = (TextView) findViewById(R.id.showmeText); \n textView.append(\": \" + choice); \n TextView textView1 = (TextView) findViewById(R.id.fname); \n textView1.append(\" \" + fname); \n TextView textView2 = (TextView) findViewById(R.id.lname); \n textView2.append(\" \" + lname); \n TextView textView3 = (TextView) findViewById(R.id.address1); \n textView3.append(\" \" + add); \n TextView textView4 = (TextView) findViewById(R.id.pro); \n textView4.append(\" \" + pro); \n TextView textView5 = (TextView) findViewById(R.id.country1); \n textView5.append(\" \" + coun); \n TextView textView6 = (TextView) findViewById(R.id.pcode); \n textView6.append(\" \" + pcode); \n\n}\n\n\nI tried these all values in ListView but these not working because i was adding all the Textview in ListView.Can you please help me How to add these list in String array?" ]
[ "android", "android-layout", "android-intent", "android-emulator" ]
[ "How fill data in mysql database with php", "i write a function to fill content in my database but show some error , i use below function to fill data \n\nfunction fillData($con,$dbName,$tableName,$arr){\n$columns = implode(\", \",array_keys($arr));\n$escaped_values = array_map('mysql_real_escape_string', array_values($arr));\n$values = implode(\", \", $escaped_values);\n$sql = \"INSERT INTO \". $tableName .\" ($columns) VALUES ($values)\";\n$myfilling=mysqli_query($con,$sql);\n\n if($myfilling){\n\n echo \"\\n data succsess add to table\";\n\n }else{ \n echo \"\\n Error creating table: \" . mysqli_error($con);\n }\n mysqli_close($con);\n}\n\n\nbut return error \n\n Error creating table: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'M, 1392/12/28, 12:30:08, 3.99 M, 10 B, 10%, 493, 17.63, 17.60, ┘à╪ش╪د╪▓' at line 1\n\n\nwhat's wrong in my code is depend to $values string type" ]
[ "php", "mysql", "mysqli" ]
[ "HOw to use jsonschema2pojo in maven's POM", "I have a JSON File and I want to convert it to POJO, for this I am using the plugin of org.jsonschema2pojo in maven. I am not able to generate the resultant pojo.Here's the snippet from pom.xml\n\n&lt;build&gt;\n &lt;plugins&gt;\n &lt;plugin&gt;\n\n\n &lt;groupId&gt;org.jsonschema2pojo&lt;/groupId&gt;\n &lt;artifactId&gt;jsonschema2pojo-maven-plugin&lt;/artifactId&gt;\n &lt;version&gt;0.4.23&lt;/version&gt;\n &lt;configuration&gt;\n &lt;sourceDirectory&gt;${basedir}/src/main/resources/schema&lt;/sourceDirectory&gt;\n &lt;targetPackage&gt;${basedir}/src/main/resources/result&lt;/targetPackage&gt;\n &lt;/configuration&gt;\n &lt;executions&gt;\n &lt;execution&gt;\n &lt;goals&gt;\n &lt;goal&gt;generate&lt;/goal&gt;\n &lt;/goals&gt;\n &lt;/execution&gt;\n &lt;/executions&gt;\n &lt;/plugin&gt;\n &lt;/plugins&gt;\n &lt;/build&gt;\n\n\nI am using the generate sources goal in maven. My expectation is that it should give me pojo files at ${basedir}/src/main/resources/result location. However I am getting so. Please help me out.\nThanks,\nRajit" ]
[ "java", "maven-plugin", "pojo" ]
[ "SKPSMTPMessage Library for iOS 7", "Has anybody had any luck using the SKPSMTPMessage Library with iOS 7?\n\nWhen I compile I keep getting ARMv7 errors, just wondering if anyone found a work around for this yet?\n\nThanks!" ]
[ "email", "ios7", "smtp" ]
[ "Objective C - Get file path in subfolder of supporting files", "I'm trying to play an mp3 that's in a couple of subfolders:\n\nNSString *fName = @\"subfolder1/subfolder2/mp3name\";\nNSString *soundFilePath = [[NSBundle mainBundle] pathForResource:fName ofType: @\"mp3\"];\nNSURL *fileURL = [[NSURL alloc] initFileURLWithPath:soundFilePath ];\nmyAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];\n[myAudioPlayer play];\n\n\nThe mp3 will play if it's not in a subfolder, but it won't play as above in a subfolder. How can I get the mp3 to play from a subfolder?" ]
[ "objective-c", "nsbundle" ]
[ "android get news article content", "I am creating a news app and have the url to the site of the articles e.g http://www.bbc.co.uk/news/technology-33379571 and I need a way to extract the content from the article.\n\nI have tried jsoup but that gives all the html tags and there is one &lt;main-article-body&gt; but that gives the link to the article which I am trying to extract. I know boilerpipe does it exactly but that doesnt work with android, I am really stuck with this problem. \n\nAny help will be much much appreciated" ]
[ "java", "android" ]
[ "plotting a point on top of another scatter plot", "I have a map of part of Australia, I'm trying to plot a location marker on it and it can't figure out how to do it - I'm new to python. Can anyone see a logical way yo do this\nThis is what I wrote for the location of my marker :\n scarborough = np.array([-21.9, 114.1])\n scarborough\n\n field_long = scarborough[0]; field_lat= scarborough[1]\n locate_long = field_long\n locate_lat = field_lat\n\n plt.plot(locate_long,locate_lat, 'o', color='black');\n plt.scatter(locate_long,locate_lat)\n\nThis is some code for my map\nfig,ax = plt.subplots()\n\nnorm = FixPointNormalize(sealevel=0,vmax=np.max(z)+5,vmin=np.min(z))\n\nplt.scatter(x,y,1,z, cmap =cut_terrain_map, norm = norm)\ncbar = plt.colorbar(label='Elevation above sea level [m]')\ncbar.ax.tick_params(size=3,width =1)\ncbar.ax.tick_params(which='major',direction='in',bottom=True, top=True, left=False, \nright=True,length=tl*2,width=tw+1,color='k')\ncbar.outline.set_linewidth(lw)" ]
[ "python", "matplotlib", "scatter-plot" ]
[ "How to modify a string of values in bash?", "I have an array of strings. These strings contain values in the format of an (x,y) coordinate pair, e.g. string one contains \"42,37\", string two contains \"54,17\", and so forth. How can I modify this array of strings such that \"42,37\" becomes \"+42+37\", \"54,17\" becomes \"+54+17\", and so on?\n\nI'm rather new to bash and writing a simple utility, I've racked my brain over this issue for the past day." ]
[ "arrays", "string", "bash", "shell" ]
[ "Get the default link configuration gcc uses when calling the linker", "I am using the CodeSorcery arm-eabi-gcc tool chain and I have a problem using ld separate from gcc\n\nI can compile my simple program and link it, if I let gcc call the ld.\n\nThis works not problem\n\ng++ test.cpp; # Works\n\n\nThis does not work because of missing symbols\n\ng++ -c test.cpp\n\nld -o test crti.o crtbegin.o test.o crtend.o crtn.o -lgcc -lc -lstdc++; # Fails\n\n\nNotice I am adding the gcc libraries to the ld command\n\nWhat am I missing?\n\nAlso if there is a better way to make configuring ld to using the default gcc linking?" ]
[ "gcc", "linker", "arm" ]
[ "Optimize comparison in R", "I'm still new to R programming and I need to optimize some portion of my code. I'll explain how it works below.\n\nMy current code too slow\n\nmyfunc &lt;- function(dt){\n indexes = which(dt$time == CURRENT)\n\n for(i in indexes){\n # columns foo, bar &amp; baz are used to build rowname\n # and colnames\n linename = paste(dt$foo[i], \"_\", dt$bar[i], sep=\"\")\n colname = dt$baz[i]\n\n # related_var is the name of an other global var\n # and value is the corresponding value in\n # related_var[linename, colname]\n dt$value[i] = get(dt$related_var[i])[[linename, colname]]\n }\n return(dt)\n}\n\n\nHow do I use it ?\n\nThis is not my portion of the code so I just simplified it\n\nCURRENT = 0\nMAX = 1000\nfor(i in 1:MAX){\n doSomeStuffOnGlobalVars()\n # get datas from global var for this CURRENT\n dt = myfunc(dt)\n CURRENT = CURRENT + 1\n}\n\n\nSome explanation\n\nThis function is called for all values of CURRENT (like 1,2,3,4,5,... 1000) and we want to update $value in dt for every row that match dt$time == CURRENT and the thing is that the variables \"varname\" are modified every CURRENT\n\ndt : a data.table ordered by time in the form of\n foo bar baz time related_var value\n 1 1 \"toto\" 1 \"varname\" NA\n 1 2 \"toto\" 1 \"varname\" NA\n 2 1 \"tata\" 1 \"varname\" NA\n 2 8 \"toto\" 1 \"varname\" NA\n ...\n\nrelated_var : contain the name of a global data.frame which have its \n colnames defined by baz in dt \n rownames defined by a combination of foo &amp; bar (foo_bar) in dt\n\n\nexample of \"varname\" variable:\n toto tata\n 1_1 1.6 2\n 1_2 42 1337\n ... ... ...\n 10_10 3.14 1.61\n\n\nI already made some changes (I used data.frame before data.table, or eval(parse(...))) but this is still pretty slow (around 5s for dt with ~ 5000 rows), I'd like to know how I can optimize this, if you have ideas (R or pure algorithmic)\n\nN.B. Tell me if its too cryptic\n\nEDIT: I've found that the slow part is dt$value[i] = get(dt$related_var[i])[[linename, colname]] and it becomes much faster if I do a simple allocation like justAvar = get(dt$related_var[i])[[linename, colname]] so my question is now: \"how R is going through indexes ? If I wanted to go to index=15 does R goes through all 14 previous elements ?\"" ]
[ "r", "performance", "optimization", "comparison" ]
[ "Smooth sidebar toggle animation with vuejs and tailwind", "I'm making a slide sidebar with vuejs and tailwind. It works but feels kind of sluggish. Is there a way to make it smoother ?\nworking example: https://codepen.io/tuturu1014/pen/oNzRXeW\n&lt;button @click=&quot;isOpen = !isOpen&quot; class=&quot;bg-blue-200 p-5&quot;&gt;\n &lt;span v-if=&quot;isOpen&quot;&gt;Open&lt;/span&gt;\n &lt;span v-else&gt;Close&lt;/span&gt;\n&lt;/button&gt;\n&lt;div class=&quot;flex flex-row max-w-7xl mx-auto min-h-screen&quot;&gt;\n &lt;transition name=&quot;slide&quot;&gt;\n &lt;div class=&quot;flex flex-col w-64 shadow-xl sm:rounded-lg bg-blue-200&quot; v-if=&quot;isOpen&quot;&gt;\n &lt;div class=&quot;min-h-screen&quot;&gt;sidebar&lt;/div&gt;\n &lt;/div&gt;\n &lt;/transition&gt;\n\n &lt;div class=&quot;flex w-full min-h-screen bg-red-400&quot;&gt;\n content\n &lt;/div&gt;\n&lt;/div&gt;\n&lt;style&gt;\n .slide-enter-active {\n animation: slideIn 1s ease;\n }\n .slide-leave-active {\n animation: slideIn 1s ease reverse;\n }\n @keyframes slideIn {\n 0% {max-width: 0%;}\n 50% {max-width: 50%;}\n 100% {max-width: 100%}\n }\n&lt;style&gt;" ]
[ "javascript", "vue.js", "tailwind-css" ]
[ "Securesocial 0.2.5 with Google and Playframework 1.2.7 on localhost", "I have sucesfully installed securesocial in my play 1.2.7 app and it \nworking for Yahoo. But I am having an issue with google. Please help me thanks in advance.\n\n\n securesocial.google.requestTokenURL=https://www.google.com/accounts/OAuthGetRequestToken\n securesocial.google.accessTokenURL=https://www.google.com/accounts/OAuthGetAccessToken\n securesocial.google.authorizationURL=https://www.google.com/accounts/OAuthAuthorizeToken\n securesocial.google.scope=http://www-opensocial.googleusercontent.com/api/people\n securesocial.google.consumerKey=mykey\n \n securesocial.google.consumerSecret=mysecret\n\n\nBut I am getting the following exception.\n\n16:00:24,934 DEBUG ~ Adding uri: https://www.google.com:443 for channel [id: 0x00925f6d, /192.168.1.75:56337 => www.google.com/74.125.236.114:443]\n16:00:24,935 ERROR ~ Request token is missing in OpenID+OAuth callback. Provider: google\nsecuresocial.provider.AuthenticationException" ]
[ "playframework", "localhost", "securesocial" ]
[ "What's the relative order with which Windows search for executable files in PATH?", "If I have a.com, a.cmd, a.bat, and a.exe files %PATH%, which one would Windows pick if I invoke just the command \"a\"? Is this officially spec-ed somewhere by M$?\n\nI just wanted to wrap my gvim.exe executable with -n, but my gvim.bat doesn't appear to get run neither from the command line, nor from the Run dialog." ]
[ "batch-file", "path", "vim", "wrapper" ]
[ "Couchbase Sync Gateway doesn't sync between Couchbase Lite and Couchbase Server", "i have a very big problem. I'm building an app at the moment. When I start the App with the Android emulator it works fine. I can save some Data and it will show me these too. So it saves the Data locally. (Couchbase Lite)\nI work with an ionic framework. \nNow I want to sync between Couchbase Server and Couchbase Lite.\nI use the Sync Gateway, but it doesn't work.\nBelow you can see my sync-gateway-config.json and my log.\nCan someone help me please?\n\n{\n \"interface\": \":4984\",\n \"adminInterface\": \"0.0.0.0:4985\",\n \"log\": [\"*\"],\n \"databases\": {\n \"syncdb\": {\n \"server\": \"http://127.0.0.1:8091\",\n \"bucket\": \"sync_gateway\",\n \"username\": \"sync_gateway\",\n \"password\": \"********\",\n \"sync\":\n function (doc) {\n channel (doc.channels);\n },\n \"users\": {\n \"GUEST\": {\n \"disabled\": true,\n \"admin_channels\": [\"public\"]\n },\n \"Administrator\": {\n \"disabled\": false,\n \"password\": \"**********\",\n \"admin_channels\": [\"*\"]\n }\n }\n }\n\n\nLog" ]
[ "ionic-framework", "couchbase-lite", "couchbase-sync-gateway" ]
[ "Static library with third party libraries in Visual Studio", "I'm looking for the answer to following question:\n\nIs there any possibility to create a static library which uses other static third party libraries so the main application will need just to link my custom static library and all other functions will be included into that library? I'd like to achieve that in Visual Studio just by proper configuration of solution/project. \n\nCurrently when I'll use my library in test application I'm getting a lot of unresolved external symbol errors." ]
[ "c++", "visual-studio", "static-libraries" ]
[ "I can't get the email scope from facebook login on my website to work", "I used this code. I filled out everything, ID, Secret, callback url, and local database.\n\nI set the urls on my facebook app to \"http://localhost:3000/\" and for the url of the website I tried both \"http://localhost:3000/\" and \"http://localhost:3000/auth/facebook/callback\"\n\nAlso I changed the port on the app from 8080 to 3000 to match it.\n\nWhenever I clicked the login, the server would crash, telling me there was an uncaught error somewhere in a node module of mongoose and that it couldn't \"read property 0 of undefined\", so I figured that would happen if there was no permission to access the email scope (since it does newUser.facebook.email = profile.emails[0].value;), so I tried to comment out that line.\n\nAfter commenting out that line, the server wouldn't crash anymore when doing the login, and when I was redirected to the profile page, I got the token, ID, and displayName. \n\nSo, the login works if I don't request the email, but when I add that line of code to request the email, it crashes.\n\nI'm requesting the \"email\" scope like this:\n\n\n app.get(\"/auth/facebook\", passport.authenticate(\"facebook\", {scope: [\"email\"]}));\n\n\nI searched previous questions, but I couldn't find what I was looking for. What can I do?" ]
[ "javascript", "node.js", "facebook", "email", "passport.js" ]
[ "Why when clicking mouse right button on listBox it's working everywhere in the listBox area?", "I have this two events in Form1:\n\nprivate void contextMenuStrip1_Opening(object sender, CancelEventArgs e)\n {\n //clear the menu and add custom items\n contextMenuStrip1.Items.Clear();\n contextMenuStrip1.Items.Add(string.Format(\"Edit - {0}\", listBox1.SelectedItem.ToString()));\n }\n\n private void listBox1_MouseUp(object sender, MouseEventArgs e)\n {\n if (e.Button == System.Windows.Forms.MouseButtons.Right)\n {\n int index = listBox1.IndexFromPoint(e.Location);\n if (index == -1) return;\n contextMenuStrip1.Show(listBox1,listBox1.PointToClient(System.Windows.Forms.Cursor.Position)); \n }\n }\n\n\nIn the designer I have a ContextMenuStrip and a listBox controls.\n\nWhat I need it to do is when I click on the mouse right button anywhere on the listBox area it will not do anything. But If I click only on the selected item in the listBox then the contextMenuStrip will show. Only if the mouse above/on the selected item in the listBox.\n\nWhen my program is running already the first item is selected so I need that once I run my program if I move my mouse above the selected item and make right click button it will work. If i'm not on the selected item it will not work. I mean only if the mouse cursor is above the selected item then right click will work and show the contextmenustrip.\n\nNot ifi move the mouse over the selected item if I put the mouse over the selected item now if I click the right mouse button it will work." ]
[ "c#" ]
[ "How to represent a mathematical expression in memory", "Me and my friends are trying to implement a computer algebra system.\nWe have already implemented an algorithm that converts an expression like 1+2*4 to a binary tree\n +\n / \\\n1 *\n / \\\n 2 4\n\nAnd we implemented an algorithm that evaluates this kind of binary tree.\nWe now want to implement an algorithm that simplifies expressions with variables.\nFor example, x+2x will become 3x\nI was thinking it would be easier to merge similar operators in the binary tree. For example:\n + \n / \\ \na + \n / \\ \n b c \n\nwill become\n +\n / | \\ \na b c\n\nThis way it would be easier to find terms that can be simplified.\nFor example, if I had x+2x+3x in my expression then they would be under the same + operator and thus they can find each other much easier without traversing most of the tree.\nMy friend thinks that we should implement the tree in a different approach. He suggested that we should implement each node as a polynomial, and then we can make operations such as polynomial addition between nodes. Using this approach we can make operations between polynomials much easier, without going back and forth the tree.\nWhich approach should we choose? is there a better approach other than these two?" ]
[ "symbolic-math", "algebra" ]
[ "ClassCastException even after type casting", "I got a problem with iterating List which got prepared from HQL.\nI am querying DB on a single table mapped to very simple class.\n\nAfter iterating the same list and type casting to same class during iteration I am getting ClassCastException.\n\nCode :\n\nimport HectorRequest;\nimport EDIMigrateData;\n\nSessionFactory factory = HibernateUtil.getSessionFactory();\nSession session = factory.getCurrentSession();\nTransaction tx = session.beginTransaction();\nQuery qry = session.createQuery(\"select hr from HectorRequest hr\");\n\nList result = qry.list();\nfor (Iterator it = result.iterator(); it.hasNext();) {\n Object o = it.next();\n if(o instanceof HectorRequest){\n HectorRequest h = (HectorRequest) o;\n System.out.println(\"ID: \" + h.getId());\n }\n}\n\n\nI wonder here If I am typecasting to the same class it is giving ClassCastException.\n\nif(o instanceof HectorRequest) {\n HectorRequest h = (HectorRequest) o;\n System.out.println(\"ID: \" + h.getId());\n}\n\n\nThe control is not coming into the above if statement.\nIf I remove the above IF condition it is throwing \n\njava.lang.ClassCastException: HectorRequest\n\n\nBelow is my hibernate mapping xml for HectorRequest class.\n\n\n\nBelow is my Hibernate.cfg.xml\n\n?xml version=\"1.0\" encoding=\"utf-8\"?&gt;&lt;!DOCTYPE hibernate-configuration PUBLIC\"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd\"&gt;&lt;hibernate-configuration&gt;&lt;session-factory&gt;&lt;property name=\"hibernate.connection.driver_class\"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;&lt;property name=\"hibernate.connection.url\"&gt;jdbc:oracle:thin:@//apludc01clu20-scan-oravip.dci.bt.com:61901/C2BM2_ANY&lt;/property&gt;&lt;property name=\"hibernate.connection.username\"&gt;s3&lt;/property&gt;&lt;property name=\"hibernate.connection.password\"&gt;**&lt;/property&gt;&lt;property name=\"hibernate.dialect\"&gt;org.hibernate.dialect.Oracle10gDialect&lt;/property&gt;&lt;property name=\"hibernate.default_schema\"&gt;s3&lt;/property&gt;&lt;property name=\"show_sql\"&gt;true&lt;/property&gt;&lt;property name=\"hibernate.current_session_context_class\"&gt;thread&lt;/property&gt;&lt;mapping resource=\"resources/config/hector_request.hbm.xml\"&gt;&lt;/mapping&gt;&lt;/session-factory&gt;&lt;/hibernate-configuration&gt;\n\n\nBelow is the output:\n\nHibernate: select hectorrequ0_.ID as ID0_, hectorrequ0_.ROUTER_TEL as ROUTER2_0_, hectorrequ0_.FLAGVALUE as FLAGVALUE0_, hectorrequ0_.FLAGPOS as FLAGPOS0_, hectorrequ0_.ACCOUNTNO as ACCOUNTNO0_, hectorrequ0_.CUSTOMERIDENTITY as CUSTOMER6_0_, hectorrequ0_.CRMSOURCE as CRMSOURCE0_, hectorrequ0_.DATASOURCE as DATASOURCE0_ from s3.hector_request hectorrequ0_\n\njava.lang.ClassCastException: HectorRequest\n\nat NotifyMain1.main(NotifyMain1.java:37)\n\n\nCan someone help what is missing and wrong here." ]
[ "classcastexception" ]
[ "Trying to put a variable into limit to find a median", "I trying to use mysql to solve the following solutions:\nhttps://www.hackerrank.com/challenges/weather-observation-station-20/problem\n\nUnderstanding that a variable cannot be put into LIMIT statement (from this )\n\nMy approach> \n\nto declare a new variable to record rowIDs, and use rowID to retrieve the record in the middle.\nHowever, it seems that rowID is not working well. \nCould anyone give me some advises? \n\nSELECT ROUND(COUNT(LAT_N)/2,0) FROM STATION into @count;\nSELECT ROUND(a.LAT_N,4) FROM (\nSELECT *,@row := @row + 1 FROM STATION s, (SELECT @row := 0) r\n WHERE @row &lt;=@count\n ORDER BY s.LAT_N ASC) a\nORDER BY a.LAT_N DESC LIMIT 1;`" ]
[ "mysql", "sql", "group-by", "median" ]
[ "JQuery selector for multiple sub level inputs elements of a div", "I am trying to select all the inputs that are in a particular div. The div has inputs at a child depth of 1 and 2. I a able to get the inputs for the first level, but not the second. Here is my code:-\n\nHTML\n\n&lt;div class=\"col-xs-11 ajax-form\"&gt;\n &lt;input type=\"hidden\" name=\"user_id\" value=\"4\"&gt;\n &lt;label class=\"checkbox-inline\"&gt;&lt;input name=\"2\" type=\"checkbox\" value=\"Sudo\"&gt; Sudo&lt;/label&gt;\n &lt;label class=\"checkbox-inline\"&gt;&lt;input name=\"1\" type=\"checkbox\" value=\"Admin\"&gt; Admin&lt;/label&gt;\n &lt;label class=\"checkbox-inline\"&gt;&lt;input name=\"3\" type=\"checkbox\" value=\"Client\"&gt; Client&lt;/label&gt;\n&lt;/div&gt;\n\n\nJS:\n\n$(document).ready(function() {\n var data = $('.ajax-form :input').serialize();\n console.log(data);\n});\n\n\nMy output:\n\n\n user_id=4\n\n\nHere is my jsfiddle\n\nThank you for any and all help." ]
[ "javascript", "jquery", "jquery-selectors" ]
[ "Algolia sort by date", "I know that I can use a unix timestamp to filter dates eg: date>=1362873600,date&lt;=1366416000 \n\nBut is it possible to sort dates using asc/desc? I would like to sort my result by newest/oldest item in a falling order" ]
[ "algolia" ]
[ "The comments I am retrieving when using the Instagram API are returning 'undefined'", "I'm retrieving data from \n\n\n https://api.instagram.com/v1/tags/HASHTAG/media/recent?client_id=CLIENT_ID\n\n\nwhereHASHTAG = the hashtag I'm searchingCLIENT_ID = my client idI am having no trouble retrieving the picture urls and captions but when I try to get the comments the comments are being returned as 'undefined'.The data is stored in an array called pictures so if I want to get the standard resolution url I just do:\n\nfor(i = 0; i &lt; pictures.length; i++){\n pictureURL[i] = pictures[i].images.standard_resolution.url;\n}\n\n\nRight now the code I'm trying to use to retrieve the comments is :\n\n//where 'i' is the index of the pic I'm currently focusing on\nfor (comment in pictures[i].comments.data) {\n alert(comment.text);\n //using alert just to see what is being retrieved\n }\n\n\nBut the issue is that the alerts are only displaying 'undefined' and also they are only displaying undefined when there is a comment (I checked on my phone, if the pic has no comment, there is no alert. If the picture has comments there is 1 alert for each comment.Can someone please help me out?" ]
[ "javascript", "jquery", "instagram" ]
[ "WPF Application class and main window initialization", "I have\n\npublic static int WindowCounter = 0;\n\n[STAThread]\npublic static void Main()\n{\n ShowBeforeApplicationCreation();\n //ShowAfterApplicationCreation();\n}\n\npublic static void ShowBeforeApplicationCreation()\n{\n ShowWindow();\n ShowWindow();\n ShowWindow();\n var app = new Application();\n app.Run();\n}\n\npublic static void ShowAfterApplicationCreation()\n{\n var app = new Application();\n ShowWindow();\n ShowWindow();\n ShowWindow();\n app.Run();\n}\n\npublic static void ShowWindow()\n{\n var window = new Window { Title = string.format(\"Title{0}\", WindowCounter++) };\n window.Show();\n}\n\n\nIf I run the code as shown and I close any of the windows it will close all windows. If I switch to what is commented out, it seems random as to which window will cause all windows to close (most of the time it is the last one).\n\nHow is the Application deciding which window will cause the process to close?\n\nIs that window the \"main\" window?\n\nLet's define the window that closes the process as the OwningWindow (hopefully that name isn't overloaded in this context). How can I ensure that the first window shown is the OwningWindow? \n\nThis last question is my main one. I don't want to open up other secondary windows, have the user close the main one, and have the process keep running. Or do I have to make subsequent windows children of the window I want to be the OwningWindow?" ]
[ "c#", "wpf", "windows", "sta" ]
[ "Get last row of each group in R", "I have some data similar in structure to:\n\na &lt;- data.frame(\"ID\" = c(\"A\", \"A\", \"B\", \"B\", \"C\", \"C\"),\n \"NUM\" = c(1, 2, 4, 3, 6, 9),\n \"VAL\" = c(1, 0, 1, 0, 1, 0))\n\n\nAnd I am trying to sort it by ID and NUM then get the last row.\nThis code works to get the last row and summarize down to a unique ID, however, it doesn't actually get the full last row like I want.\n\na &lt;- a %&gt;% arrange(ID, NUM) %&gt;%\n group_by(ID) %&gt;%\n summarise(max(NUM))\n\n\nI understand why this code doesn't work but am looking for the dplyr way of getting the last row for each unique ID\n\nExpected Results:\n\n ID NUM VAL\n &lt;fct &lt;dbl&gt; &lt;dbl&gt;\n1 A 2 0\n2 B 4 1\n3 C 9 0\n\n\nNote: I will admit that though it is nearly a duplicate of Select first and last row from grouped data, the answers on that thread were not quite what I was looking for." ]
[ "r", "dataframe", "dplyr" ]
[ "Mesos master setup, but home page does not return", "I am just starting to try out Mesos. I followed the instructions to get the master installed. For now, I am using a single master (with 3 slaves). I am installing on CentOS 6.5 - which is a Virtual Machine, terminal only.\n\nThe problem I am having is that if I navigate to port 5050 on that virtual machine from my desktop browser, I get no response.\n\nHowever, from a terminal window if I do:\n\ncurl http://localhost:5050/\n\n\nI get back an AngularJS page. Which looks in part like:\n\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\" ng-app=\"mesos\"&gt;\n&lt;head&gt;\n &lt;meta charset=\"utf-8\"&gt;\n &lt;title&gt;Mesos&lt;/title&gt;\n &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n &lt;meta name=\"description\" content=\"\"&gt;\n &lt;meta name=\"author\" content=\"\"&gt;\n\n &lt;link href=\"/static/css/bootstrap-3.0.3.min.css\" rel=\"stylesheet\"&gt;\n &lt;link href=\"/static/css/mesos.css\" rel=\"stylesheet\"&gt;\n\n &lt;link rel=\"shortcut icon\" href=\"/static/ico/favicon.ico\"&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n &lt;div data-ng-show=\"doneLoading\" style=\"width: 75px; margin: 0 auto; text-align: center;\"&gt; \n\n\nIf I ping the VM from my desktop, that works fine too. However, if I use the curl command from my desktop (using the 'IP ADDRESS':5050), I get \"couldn't connect to host\"\n\nAnyone with suggestions on what I might try to get this to work properly?\n\nNew Information\n\nI ran netstat on the VM. It gives me:\n\nnetstat -tapen | grep 5050\ntcp 0 0 0.0.0.0:5050 0.0.0.0:* LISTEN 0 21589 2852/mesos-master \n\n\nI suspect that is telling me what is wrong, but not sure how to fix it! Also, running nmap from my desktop machine and scanning ports 5000-5100 on the VM shows all 101 ports closed." ]
[ "mesos", "mesosphere" ]
[ "SQL Server, get Date of a week number", "I have a query to show the Number of payments, grouped by the week number in SQL Server 2012. \n\nSELECT \n DATEPART(wk, FPP.UPLOAD_DATE) AS \"Date by week\", \n COUNT(DISTINCT FPP.ID) AS \"Number of Bills\")\nFROM \n FACT_PAY_PAYMENT FPP \nGROUP BY \n DATEPART(wk, FPP.UPLOAD_DATE);\n\n\nSmall problem, when I do this code, I receive the week number, but I want the starting date of the week.\n\nFor example, now I receive following output:\n\n Date by week Number of Bills \n ---------------------------------\n 40 7\n\n\nWhat I want to receive is:\n\n Date by week Number of Bills \n ---------------------------------\n 2015-09-28 7" ]
[ "sql-server", "date", "week-number" ]
[ "How to input MySQL database data to a html table using python?", "I'm fairly new to using MySQL, HTML, and Python synchronously. I have a website that I create using HTML, CSS, and Javascript. Then I use Python to enter data into a MySQL database. My question is how can I create a table on my HTML side and input MySQL data into the table using Python. I would like the table to grow row-wise dynamically (i.e. I don't want to refresh/reload and the new data should enter the HTML table in a new row so that the table display's all of the data in the MySQL database).\nSo far I am entering data correctly into the MySQL database and it is being populated. However, I'm stuck on how to:\n\nCreate an HTML table that grows dynamically based on amount of data\nUse Python to input the data from the MySQL database into the table\nI would like a solution WITHOUT using PHP\n\nI'm very new to MySQL, HTML, and Python and therefore, any and all help is greatly appreciated. Thank you in advance!" ]
[ "python", "mysql", "html-table" ]
[ "Subprocess.Popen to open an .exe terminal program and input to the program", "I am trying to open a .csv file using a .exe file. Both the file and program are contained in the same folder. When manually opening the folder I drag the csv file ontop of the exe, it then opens and I press any key to commence the program.\nWhen using the shell I can do what I want using this script\nE:\ncd ISAAC\\SWEM\\multiprocess\\2000\nSWEM_1_2000_multiprocess.exe &quot;seedMIXsim.csv&quot;\n&lt;wait for program to initialize&gt;\n&lt;press any key&gt;\n\nSo far in python3 I have tried several variations of subprocess, the latest using Popen with an input argument of =&quot;h&quot; as a random key should start the program.\nproc = subprocess.Popen(\n ['E://ISAAC//SWEM//multiprocess//2010//SWEM_1_2010_multiprocess.exe', '&quot;E://ISAAC//SWEM//multiprocess//2010//seedMIXsim.csv&quot;'], input=&quot;h&quot;)\n\nHowever, when I input any arguments such as stdout or input, the python program will almost immediately finish without doing anything.\nIdeally, I would like to open a visible cmd window while running the program as the exe runs in the terminal and shows a progress bar." ]
[ "python", "python-3.x", "subprocess" ]
[ "Maximum value of thrust device_vector", "i am trying to find the maximum value and it's location of a thrust::device_vecotr.\nthe mechanism below can save the position of the maximum value, however, i couldn't find the max_val.\n\ni have cout statements to track the running order and where it crashes. it seems to be it crash on this line\n int max_val = *iter;\nit shows this result:\n\n\n terminate called after throwing an instance of 'thrust::system::system_error'\n what(): invalid argument\n 1234567\n\n\nhere is the code\n\n#include &lt;thrust/device_vector.h&gt;\n#include &lt;thrust/host_vector.h&gt;\n#include &lt;thrust/reduce.h&gt;\n#include &lt;thrust/extrema.h&gt;\n#include &lt;iostream&gt;\n#include &lt;iomanip&gt;\n\ntemplate &lt;typename Vector&gt;\nvoid print_vector(const std::string&amp; name, const Vector&amp; v)\n{\n typedef typename Vector::value_type T;\n std::cout &lt;&lt; \" \" &lt;&lt; std::setw(20) &lt;&lt; name &lt;&lt; \" \";\n thrust::copy(v.begin(), v.end(), std::ostream_iterator&lt;T&gt;(std::cout, \" \"));\n std::cout &lt;&lt; std::endl;\n}\n\nint main()\n{\nstd::cout&lt;&lt;\"1\";\nthrust::host_vector&lt;int&gt;h_vec(5);\nh_vec.push_back(10);\nh_vec.push_back(11);\nh_vec.push_back(12);\nh_vec.push_back(13);\nh_vec.push_back(14);\nstd::cout&lt;&lt;\"2\";\nthrust::device_vector&lt;int&gt;d_vec(5);\nstd::cout&lt;&lt;\"3\";\n\nthrust::copy_n(h_vec.begin(),5,d_vec.begin());\nstd::cout&lt;&lt;\"4\";\n// print_vector(\"D_Vec\",d_vec);\nstd::cout&lt;&lt;\"5\";\n\nthrust::device_vector&lt;int&gt;::iterator iter=thrust::max(d_vec.begin(),d_vec.end());\nstd::cout&lt;&lt;\"6\";\nunsigned int position = iter - d_vec.begin();\nstd::cout&lt;&lt;\"7\";\nint max_val = *iter;\nstd::cout&lt;&lt;\"8\";\n\nstd::cout&lt;&lt;\"Max Val= \"&lt;&lt;14&lt;&lt;\" @\"&lt;&lt;position&lt;&lt; std::endl;\n\n\nreturn 0;\n}\n\n\nHelp .. please. also, if there is a better way to extract the maximum value and its position in device_vector using THRUST library it is more than appreciated." ]
[ "cuda", "max", "thrust" ]
[ "How to Show All Button Click In All PLace Data In Marker In Drop in Google Map In Ios", "How to Show All In All Data in pin on Map view controller?\n\nHere is my code:\n\nDatalist.m\n\n-(IBAction)ShowAll:(id)sender\n{\nUIStoryboard *story = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil];\n mapviewobj = [story instantiateViewControllerWithIdentifier:@\"MapViewController\"];\n click = YES;\n [mapviewobj setmyarry:arrdatalist];\n mapviewobj.myclick=click;\n [self.navigationController pushViewController:mapviewobj animated:YES];\n\n}\n\n\nMapViewcontroller.m\n\n- (void)viewDidLoad \n{\n\ncameraPath = [GMSCameraPosition cameraWithLatitude:strLat.doubleValue longitude:strLong.doubleValue zoom:17];\n\nmapView=[[GMSMapView alloc]initWithFrame:mapView.frame];\n\nmapView.camera=cameraPath;\n\nself.view=mapView;\nmarker = [[GMSMarker alloc] init];\n\nmarker.position = cameraPath.target;\n\nmarker.title=strName;\n\nmarker.snippet = strAdd;\n\nmarker.appearAnimation = kGMSMarkerAnimationPop;\n\nmarker.map = mapView;\n\nmapView.delegate=self;\n\nGMSPolyline *polyline = [GMSPolyline polylineWithPath:[GMSPath pathFromEncodedPath:strPoint]];\n polyline.strokeColor = [UIColor blueColor];\n polyline.strokeWidth = 5.f;\n polyline.map = mapView;\n self.view=mapView;\n\n\n mapView.myLocationEnabled = YES;\n [mapView animateToLocation:currentLocation];\n\n\n marker = [[GMSMarker alloc] init];\n marker.position = currentLocation;\n marker.title=@\"You are Here\";\n marker.icon=[UIImage imageNamed:@\"green\"];\n\n marker.appearAnimation = kGMSMarkerAnimationPop;\n marker.map = mapView;\n\n}\n-(void)viewWillAppear:(BOOL)animated\n{\n\n [super viewWillAppear:animated];\n if (myclick)\n {\n\n for (int i=0; i&lt;arrdata.count; i++)\n {\n\n\n strLat=[[[[arrdata objectAtIndex:i]objectForKey:@\"geometry\"]objectForKey:@\"location\"]objectForKey:@\"lat\"];\n strLong=[[[[arrdata objectAtIndex:i]objectForKey:@\"geometry\"]objectForKey:@\"location\"]objectForKey:@\"lng\"];\n strAdd=[[arrdata objectAtIndex:i] objectForKey:@\"name\"];\n NSLog(@\"\\n%@ Lat: %f Long: %f\",strAdd,strLat.doubleValue,strLong.doubleValue);\n cameraPath = [GMSCameraPosition cameraWithLatitude:strLat.doubleValue longitude:strLong.doubleValue zoom:17];\n mapView=[[GMSMapView alloc]initWithFrame:mapView.frame];\n mapView.camera=cameraPath;\n marker = [[GMSMarker alloc] init];\n marker.position = cameraPath.target;\n marker.title=strName;\n marker.snippet = strAdd;\n\n [mapView animateToLocation:currentLocation];\n\n CLLocationCoordinate2D position = CLLocationCoordinate2DMake([strLat doubleValue], [strLong doubleValue]);\n marker = [[GMSMarker alloc] init];\n// marker.position = CLLocationCoordinate2DMake([strLat doubleValue], [strLong doubleValue]);\n GMSMarker *location = [GMSMarker markerWithPosition:position];\n location.title=@\"You are Here\";\n location.icon=[UIImage imageNamed:@\"green\"];\n mapView.delegate=self;\n\n location.appearAnimation = kGMSMarkerAnimationPop;\n\n location.map = mapView;\n\n }\n }\n}" ]
[ "ios", "google-maps", "marker" ]
[ "Cakephp jquery mobile refresh reload to see the correct url", "I'm developing mobile version of a web application with cakephp and jquery mobile and I can't solve the following problem:\n\nLogging in is working and it brings me to the log in page, but this is not reflected in the URL. I have to reload the page to see the proper url. And it happens the same on every page of the site. I guess I'm missing something in the BeforeFilter or AfterFilter function.\nWhat am I missing? What I'm doing wrong?\n\nSteps what is happening:\n\n\nI enter the email and password in the index page.\nWhen I submmit, the application brings me to the log in page.\nThe url is still the index url!\nWhen I reload the page the url is automatically changed to the correct url." ]
[ "cakephp", "jquery-mobile", "refresh", "reload" ]
[ "Why does the initial execution of my CUDA program take longer than subsequent executions?", "I have test.cu file and it's compiling with NVCC \n\nvoid sort()\n{\n\nthrust::host_vector&lt;int&gt; dat1(50);\nthrust::generate(dat1.begin(),dat1.end(),rand);\n\nfor(int i=0; i&lt;dat1.size(); i++)\n{\n std::cout &lt;&lt; dat1[i] &lt;&lt; std::endl;\n}\n\nthrust::device_vector&lt;int&gt; dev_vec1 = dat1;\n\n\nthrust::sort(dev_vec1.begin(),dev_vec1.end());\nthrust::copy(dev_vec1.begin(),dev_vec1.end(),dat1.begin());\n\nfor(int i=0; i&lt;dat1.size(); i++)\n{\n std::cout &lt;&lt; dat1[i] &lt;&lt; std::endl;\n}\n\n}\n\n\n#include \"test.cuh\"\n\n\nint main()\n{\n sort();\n return 0;\n}\n\n\nbut sorting on device take 40 sec.. but when I'm run it second time it's working fast.\nWhat's problem?" ]
[ "c++", "cuda", "thrust" ]
[ "Function to return only alpha-numeric characters from string?", "I'm looking for a php function that will take an input string and return a sanitized version of it by stripping away all special characters leaving only alpha-numeric.\n\nI need a second function that does the same but only returns alphabetic characters A-Z.\n\nAny help much appreciated." ]
[ "php", "regex" ]
[ "Inno Setup refresh desktop", "Is it possible to refresh the desktop using Inno Setup in the [Code] section?\n\nEither by using SendMessage or somehow use SHChangeNotify?" ]
[ "windows", "inno-setup", "pascalscript" ]