texts
list
tags
list
[ "Cassandra : cant see any progress with the insertion of data", "Am newbie to cassandra.\nMy process workers are trying to insert into the cassandra db. After some few hours I cant see any progress of insertion.\n\nMy debug logs are saying the below across nodes of cassandra:\n\n\n WARN [SharedPool-Worker-48] 2016-10-07 00:59:04,025\n BatchStatement.java:287 - Batch of prepared statements for\n [my_database.my_table] is of size 14264, exceeding specified threshold\n of 5120 by 9144. WARN [SharedPool-Worker-1] 2016-10-07 00:59:04,025\n BatchStatement.java:287 - Batch of prepared statements for\n [my_database.my_table] is of size 14272, exceeding specified threshold\n of 5120 by 9152. WARN [SharedPool-Worker-62] 2016-10-07 00:59:04,025\n BatchStatement.java:287 - Batch of prepared statements for\n [my_database.my_table] is of size 14304, exceeding specified threshold\n of 5120 by 9184. WARN [SharedPool-Worker-56] 2016-10-07 00:59:04,026\n BatchStatement.java:287 - Batch of prepared statements for\n [my_database.my_table] is of size 14240, exceeding specified threshold\n of 5120 by 9120.\n \n DEBUG [GossipStage:1] 2016-10-07 07:43:38,765 FailureDetector.java:456\n - Ignoring interval time of 2710773843 for /10.157.47.131 DEBUG [GossipStage:1] 2016-10-07 07:43:38,766 FailureDetector.java:456 -\n Ignoring interval time of 2000307543 for /10.157.41.234 DEBUG\n [GossipStage:1] 2016-10-07 07:43:57,769 FailureDetector.java:456 -\n Ignoring interval time of 2069384918 for /10.157.43.166 DEBUG\n [GossipStage:1] 2016-10-07 07:44:07,702 FailureDetector.java:456 -\n Ignoring interval time of 2000430166 for /10.157.43.166 DEBUG\n [GossipStage:1] 2016-10-07 07:44:14,772 FailureDetector.java:456 -\n Ignoring interval time of 2000475716 for /10.157.43.166 DEBUG\n [GossipStage:1] 2016-10-07 07:44:15,772 FailureDetector.java:456 -\n Ignoring interval time of 2000349080 for /10.157.41.234 DEBUG\n [GossipStage:1] 2016-10-07 07:44:17,773 FailureDetector.java:456 -\n Ignoring interval time of 2000373755 for /10.157.43.166\n\n\nIs this is the cause of concern. Any help/information/solution would be helpful\n\nThanks a ton." ]
[ "cassandra" ]
[ "Connecting within ArcGIS application with resource", "I have following dillema:\nUsing ArcGIS Enterprise 10.8, I have added a new item – Application – to a users content.\nThis generates an Application item, with an App ID and APP Secret, along with App type and redirect URIs defined.\nThese can be used to generate an access token via the OAUTH2 token endpoint:\nhttps:///sharing/rest/oauth2/token\nusing the parameters :\nclient_id=APPID&\nclient_secret=APPSECRET&\ngrant_type=client_credentials\nESRI States in their documentation:\n“Successful authentication directly returns a JSON response containing the access token that allows the application to work with resources that are accessible to the application (that is, have been shared with the application). Use of the client_secret as previously described is mandatory.”\nQuestion is: how do we share resources with the application?\nThe overall goal is to grant an external application (unknown user) access to portal ressources (ie.a layer item) via OAUTH2 app login.\nDo you have any suggestions?" ]
[ "arcgis", "arcgis-server" ]
[ "EWS SOAP Open Folder given uint8_t ID", "Using the EWS API, I am given a const uint8_t *longTermID and its uint32_t idSize to use to open a folder. In our old MAPI code, we would call GetIdFromLongTermId using some types defined in the MAPI headers. I can't seem to find anything equivalent for using a uint8_t ID to open a folder for EWS. I tried\n\nConvertId Operation with EntryId as the AlternateId Format to a DestinationFormat of EwsId but that result fails.\n\nThis is the first time I've worked on exchange server stuff, and all of this was previously done by a developer who no longer works here. \n\nI've tried to change it to a string via string id(longTermID, longTermID+idSize) but that just produces a blank string. \n\nWould I want something like GetItem operation?" ]
[ "xml", "soap", "exchangewebservices", "mapi" ]
[ "c++ error: referenced in function _main when reading a file", "When I'm trying to read a file with a function\n\nvoid readFile(string fileName, string* anArray) {\n unsigned int lineCounter = 0;\n ifstream inFile = ifstream(fileName);\n\n while (!inFile.eof()) {\n string fileLine;\n inFile >> fileLine;\n if (!fileLine.empty()) {\n anArray[lineCounter] = fileLine;\n ++lineCounter;\n }\n }\n inFile.close();\n}\n\n\nI get the error below, which I assume is because of the pointer on the string array ?\n\n\n 1>Main.obj : error LNK2019: unresolved external symbol \"void __cdecl\n resource::readFile(class std::basic_string,class std::allocator >,class\n std::basic_string,class\n std::allocator > *)\"\n (?readFile@resource@@YAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PAV23@@Z)\n referenced in function _main" ]
[ "c++" ]
[ "Google Cloud Storage Upload file from HTML using POST. Signature issues", "I am able to upload files anonymously to my google cloud storage bucket but have been unable to get the upload to work from a HTML page using a policy and a signature.\n\nI have spent quite a lot of time reading several posts:\n\nI have also tried to follow the Google Documentation for HTML POST described in their docs..can't post the link as I only have 1 reputation point...\n\nMy Policy Document is a simple JSON form very similar to the example in the google documents.\n\n{\"expiration\": \"2020-06-16T11:11:11Z\",\n\n\"conditions\": [\n\n[\"starts-with\", \"$key\", \"\" ],\n\n{\"acl\": \"bucket-owner-read\" },\n\n{\"bucket\": \"XXXXXXXXX\"},\n\n{\"success_action_redirect\": \"redirect url here...I had to remove it due to my reputation...\" },\n\n[\"eq\", \"$Content-Type\", \"application/pdf\" ],\n\n[\"content-length-range\", 0, 1000000]\n\n]\n\n}\n\nThe XX's simply are redactions.\n\nAnd, I am using the following HTML:\n\n\n\nThe Policy and signature strings have been truncated for display convenience.\n\n<form action=\"http://storage.googleapis.com/flashbidz_uploads/\"\n method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"text\" name=\"key\" value=\"\">\n <input type=\"hidden\" name=\"bucket\" value=\"XXXXX\">\n <input type=\"hidden\" name=\"Content-Type\" value=\"application/pdf\">\n <input type=\"hidden\" name=\"GoogleAccessId\" value=\"[email protected]\">\n <input type=\"hidden\" name=\"acl\" value=\"bucket-owner-read\">\n <input type=\"hidden\" name=\"success_action_redirect\" value=\"https://flashbidz.appspot.com/#/sellerhome\">\n <input type=\"hidden\" name=\"policy\" value=\"eyJleHBpcm...XQ0KfQ==\">\n <input type=\"hidden\" name=\"signature\" value=\"5P5lFuZ...nkTlyY=\">\n\n <input name=\"file\" type=\"file\">\n <input type=\"submit\" value=\"Upload\">\n </form>\n\n\n\n\nWhen I run this I receive the message:\nThe request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.\n\nThe process I am following is to create a base64 representation of my policy from this site here and then using this site here to create the SHA-256 signature string (using the Base64 representation in the HTML) and signing it with the private_key_id of my service account key.\n\nI have also used the email form of the key to sign and the client ID associated with the service account.\n\nI have no idea where I am going wrong and do not have any idea how to debug this. Any help would be very appreciated and I do understand that there are a lot of posts already on this subject. I have read them (may not have understood them) all.\n\nThanks!" ]
[ "google-app-engine" ]
[ "Getting \"#ERROR\" in certain fields when using Split function in SSRS", "I am using a split function to separate a column with two street addresses.\n\nThe information is separated by ,.\n\nSome of the rows only have one address associated with them.\n\nIn those rows for my Street Address 2, I'm getting #ERROR when I want it to be null.\n\nI've tried an IIF() statement for the expression, but I am having trouble with it.\n\nSplit(Fields!Street.Value, \",\").GetValue(2)" ]
[ "sql-server", "reporting-services", "ssrs-2008", "ssrs-2008-r2" ]
[ "How-to return a const std::vector?", "I have a class with a container (containing pointer) as a member:\n\nMyClass{\nprivate:\n std::vector<MyObject*> _VecMyObjs;\npublic:\n const std::vector<MyObject* const> GetVecMyObj();\n}\n\n\nNow I try to implement GetVecMyObj(). Here is what I came up with...\n\nconst vector<MyObject *const> ACI_CALL MyClass::GetVecMyObjs()\n{\n const vector<MyObject *const> VecMyObjs;\n VecMyObjs.assign( _VecMyObjs.begin(), _VecMyObjs.end());\n return VecMyObjs;\n}\n\n\nBut of course the compiler is warning me, that I use the assign-function on a const-Object. Is there a better way to do this? I mean, I don't want VecMyObjs to change VecMyObj outside of the class, of course. How can I achieve that without a compiler warning?\n\nEDIT:\nOkay. Thank you everybody. It's now like this:\n\nconst vector<MyObject *const> ACI_CALL MyClass::GetVecMyObjs()\n{\n const vector<MyObject *const> VecMyObjs;\n VecMyObjs.assign( _VecMyObjs.begin(), _VecMyObjs.end());\n return VecMyObjs;\n}\n\n\nBut, I can't get around the assign-function, right? E.g. casting the \"original\" doesn't work, if I want \"everything\" to be constant." ]
[ "c++", "stl", "constants", "encapsulation" ]
[ "Django Admin import_export module used for custom IMPORT", "I was trying to follow official doc of import-export:\n\nhttps://django-import-export.readthedocs.org/en/latest/import_workflow.html#import-data-method-workflow\n\nBut I still do not know how to glue it to my admin assuming that:\n\n\nI want only subset of fields (I created Resource model with listed fields, but It crashes while importing anyway with: KeyError full stack bellow.\nWhere - in which method - in my admin class (inheriting of course ImportExportModelAdmin and using defined resource_class) should i place the code responsible for some custom actions I want to happen after validating, that import data are correct but before inserting them into database.\n\n\nI am not very advanced in Django and will be thankful for some hints.\nExample of working implementation will be appreciated, so if you know something similar on github - share." ]
[ "python", "django", "csv", "django-admin", "django-import-export" ]
[ "Error occured while using java foreach statements", "My code as follows\n\npublic class Test {\n\n public static void main(String[] args) {\n int count1 = 0, count2 = 0;\n Test[] test1 = new Test[5];\n Test[] test2 = new Test[5];\n if (test1 == null || test2 == null)\n System.out.println(\"null\");\n for (int j = 0; j < 3; j++) {\n for (int i = 0; i < test1.length; i++) {\n if (test1[i] == null) {\n test1[i] = new Test();\n count1++;\n }\n }\n }\n for (int j = 0; j < 3; j++) {\n for (Test test : test2) {\n if (test == null) {\n test = new Test();\n count2++;\n }\n }\n }\n System.out.println(count1 + \" \" + count2);\n }\n}\n\n\nI run the program and I found its output is 5 15.\nIt made me confused,I can't understand what differences between using for statements and using foreach statements.Thanks for giving me a hand." ]
[ "java" ]
[ "How to disable https for tomcat", "I didn't do any change but today, after turning on my computer, I'm not able to start Liferay portal...I keep getting \n\nSEVERE: Catalina.start:\nLifecycleException: service.getName(): \"Catalina\"; Protocol handler start fail\ned: java.io.FileNotFoundException: C:\\Users\\Martin\\.keystore\n\n\nI think I didn't do any change there, therefore I really don't know, how to fix it... I will appreciate any advice.\n\nI don't want any HTTPS for tomcat - I just want to start my AS" ]
[ "java", "tomcat", "https", "liferay" ]
[ "Why codes of EMOJI symbols are different in browser and Oracle DB?", "I saved EMOJI symbol from web-application to Oracle Database. In html this symbol is coded by &#128514.\nIe if I write\n\n<html>&#128514</html>\n\n\n, I will see it in Browser.\nBut in DB the query\n\nselect ascii(sym) from ..\n\n\nreturns value 4036991106.\nThe question is why these codes are different (128514 and 4036991106), and how to convert one to another?\nThe Query\n\nselect value from nls_database_parameters where parameter='NLS_CHARACTERSET'\n\n\nreturns value 'AL32UTF8'.\nThe query \n\nselect sym...\n\n\nReturns '', this is the symbol I have saved." ]
[ "oracle", "oracle11g", "emoji" ]
[ "Jmeter Testplan - empty test plan error", "While importing a test plan, I see the error below:\n\n2014/03/06 13:37:05 INFO - jmeter.gui.action.Load: Loading file: /Users/kiwitech/Desktop/load test jmeter/jouney_load_test .jmx \n2014/03/06 13:37:05 INFO - jmeter.services.FileServer: Set new base='/Users/kiwitech/Desktop/load test jmeter' \n2014/03/06 13:37:05 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: com/jayway/jsonpath/InvalidPathException : com/jayway/jsonpath/InvalidPathException\n---- Debugging information ----\nmessage : com/jayway/jsonpath/InvalidPathException\ncause-exception : java.lang.NoClassDefFoundError\ncause-message : com/jayway/jsonpath/InvalidPathException\nfirst-jmeter-class : org.apache.jmeter.save.converters.TestElementConverter.unmarshal(TestElementConverter.java:100)\nclass : org.apache.jmeter.save.ScriptWrapper\nrequired-type : com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor\nconverter-type : org.apache.jmeter.save.ScriptWrapperConverter\npath : /jmeterTestPlan/hashTree/hashTree/hashTree[6]/hashTree[5]/com.atlantbh.jmeter.plugins.jsonutils.jsonpathextractor.JSONPathExtractor\nline number : 348\nversion : 2.11 r1554548\n------------------------------- \n2014/03/06 13:37:05 WARN - jmeter.gui.action.Load: Unexpected error org.apache.jmeter.exceptions.IllegalUserActionException: Empty TestPlan - see log file\n at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:174)\n at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:136)\n at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:105)\n at org.apache.jmeter.gui.action.Load.doAction(Load.java:92)\n at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:81)\n at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)\n at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:63)\n at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)\n at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)\n at java.awt.EventQueue.access$200(EventQueue.java:103)\n at java.awt.EventQueue$3.run(EventQueue.java:694)\n at java.awt.EventQueue$3.run(EventQueue.java:692)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)\n at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)\n at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)\n at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)\n at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)\n at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)\n at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)\n at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)\n\n\nPlease help me out with possible solutions. I have tried adding commons lib but its not helping me out.\n\nThanks for any help." ]
[ "java", "jmeter" ]
[ "Is there a Git config setting to auto-signed-off-by my commits?", "In some repos I want to always include \"signed-off-by\" messages in my commits (git commit -s not git commit -S which is for a cryptographic signature). Is there a .gitconfig value I can set to make this happen (so I can just type git commit instead of git commit -s every time)?" ]
[ "git-commit" ]
[ "refactoring an array", "I have the following result in AMFPHP from a sql query:\n\n(Array)#0\n [0] (Object)#1\n id = \"1\"\n naam = \"4 kazen\"\n pizzeria_id = \"1\"\n pizzerianaam = \"Howest pizza\"\n prijs = \"11\"\n [1] (Object)#2\n id = \"2\"\n naam = \"Napolitano\"\n pizzeria_id = \"1\"\n pizzerianaam = \"Howest pizza\"\n prijs = \"13\"\n [2] (Object)#3\n id = \"5\"\n naam = \"pizza bolognaise\"\n pizzeria_id = \"2\"\n pizzerianaam = \"Nicola pizza\"\n prijs = \"12\"\n [3] (Object)#4\n id = \"6\"\n naam = \"pizza funghi\"\n pizzeria_id = \"2\"\n pizzerianaam = \"Nicola pizza\"\n prijs = \"16\"\n\n\nwhat i would like to do is refactor this array so the result is a assosiative array with 2 arrays inside of it, the 2 arrays should be called after the \"pizzerianaam\" and within the \"pizzerianaam\" i should see the pizza's where the \"pizzerianaam\" matches.\n\nso an array with 2 arrays in it wich contains other arrays for each pizza where the \"pizzerianaam\" value matches.\n\nAnyone who ca help?" ]
[ "php", "amfphp" ]
[ "Is there a way to search for multiple strings within a range of cells, and return the range sorted by the first column?", "I'm looking for a way to search within the cells in a range for a specific text value, and have them returned sorted by those values along with the corresponding cell in the next column over. For example, in column A I have the description of the item, and in Column B there is a number value:\n\nUnsorted\n\nThese describe that particular formats (Col A) and how many of each (Col B). So what I'm looking to do is sort by multiple format, \"K-7.75\" and \"K-20L\" for example, and then return that cell along with the corresponding Column B. Is there a way I can write this all in one formula, searching for multiple strings within Col A? Here's what I'd like the output to look like, with the formulas being in A1, A9, and A13:\n\nSorted\n\nI know there is a filter option, but I cant seem to use multiple strings in that and I'm looking to eliminate steps in reordering this info. I feel like there's a way to do this with Array and Search or Sort or something, but I'm stuck. Thank you in advance for any help." ]
[ "arrays", "string", "sorting", "search", "google-sheets" ]
[ "Springbook 2.0 interceptor forward to controller", "I am building a small application in which I am trying to manage user login session.\nMy question is, is it possible to forward the http request from HandlerInterceptor.preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) method to controller\nSomething like this..\n@Override\npublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\n request.getRequestDispatcher("someController").forward(request, response);\n\n return true;\n\n}" ]
[ "spring-boot", "spring-mvc" ]
[ "Can't Edit the file outside of my program after opening that file inside program. CGM file won't get released", "I have a problem with the releasing the CGM file after it opens. If I open a CGM file in my program and then open another file or many others, the program won't release the first file. I have to close the program and restart again so that the files will be released. Here is my code. How can I release the file when I open another file without restarting the program.\n\n private void btnCGM_Click(object sender, EventArgs e)\n {\n string filename = string.Empty;\n openFile = new OpenFileDialog();\n openFile.Filter = \"CGM Files (*.cgm)|*.cgm\";\n openFile.FilterIndex = 2;\n openFile.RestoreDirectory = true;\n openFile.Multiselect = false;\n if (openFile.ShowDialog() == DialogResult.OK)\n {\n FileName = Path.GetFileName(openFile.FileName.ToString()); \n lblSchematic.Text = FileName;\n cgmPath = openFile.FileName.Replace(FileName, \"\");\n loadCGM(FileName);\n }\n }\n\n private void loadCGM(string filename)\n {\n sdi.filename(filename);\n sdi.SourceFile = cgmPath + filename;\n this.Text = getFileName(filename);\n sdi.Refresh();\n this.Refresh();\n sdiToolBarPosition();\n lblRecNo.Text = getRecNo(filename).ToString();\n TheRealFileRec = Int32.Parse(lblRecNo.Text);\n }\n\n public static void DataConnection()\n {\n if (cn.State != ConnectionState.Open)\n {\n try\n {\n cn.Open();\n }\n catch (Exception)\n {\n Password pw = new Password();\n pw.PasswordPrompt += new EventHandler<PasswordEventArgs>(pw_PasswordPrompt);\n pw.ShowDialog();\n //Jet OLEDB:Database Password=MyDbPassword;\n }\n }\n }\n\n private string getFileName(string CGM)\n {\n string title = \"\";\n string SQL = @\"select a.title from files a where a.filename = ?\";//, CGM);\n using (OleDbCommand cmd = new OleDbCommand(SQL, cn))\n {\n DataConnection(); \n OleDbParameter param = cmd.Parameters.Add(\"@FileName\", OleDbType.VarChar, 40);\n param.Value = CGM;\n using (OleDbDataReader dr = cmd.ExecuteReader())\n {\n dr.Read();\n title = dr[\"title\"].ToString();\n }\n }\n cn.Close();\n return title;\n }\n\n private double getRecNo(string filename)\n {\n double recNo = 0;\n string SQL = @\"select a.recno from files a where a.filename = ?\";\n using (OleDbCommand cmd = new OleDbCommand(SQL, cn))\n {\n DataConnection();\n OleDbParameter param = cmd.Parameters.Add(\"@FileName\", OleDbType.VarChar, 40);\n param.Value = filename;\n using (OleDbDataReader dr = cmd.ExecuteReader())\n {\n dr.Read();\n recNo = Convert.ToDouble(dr[\"recno\"]);\n }\n }\n cn.Close();\n return recNo;\n\n private void GetXmlConnection()\n {\n using (StreamReader sr = new StreamReader(myDocuments))\n {\n using (XmlTextReader xr = new XmlTextReader(sr))\n {\n XmlDocument pathDoc = new XmlDocument();\n pathDoc.Load(xr); \n XmlNode node = pathDoc.SelectSingleNode(\"Path\");\n databasePath = node.InnerText.Trim();\n cn = new OleDbConnection(databasePath);\n lblDatabase.Text = Path.GetFileName(databasePath);\n cn.close();\n }\n }\n populateComboBox();\n }" ]
[ "c#", "database", "ms-access", "connection" ]
[ "How to make Ionic build help me", "I am getting this Error :\n\nError: com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\exploded-aar\\com.google.android.gms\\play-services-base\\9.0.2\\res\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png into C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png\n\n\n:mergeDebugResources FAILED\n\n\n\nFAILURE: Build failed with an exception.\n\n\n\n What went wrong:\n\n\nBUILD FAILED\n\nTotal time: 1 mins 29.464 secs\n\nExecution failed for task ':mergeDebugResources'.\nError: com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\exploded-aar\\com.google.android.gms\\play-services-base\\9.0.2\\res\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png into C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png\n\n Try:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n\nError: cmd: Command failed with exit code 1 Error output:\nFAILURE: Build failed with an exception.\n\n What went wrong:\nExecution failed for task ':mergeDebugResources'.\nError: com.android.builder.internal.aapt.AaptException: Failed to crunch file C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\exploded-aar\\com.google.android.gms\\play-services-base\\9.0.2\\res\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png into C:\\Users\\vipin\\Documents\\GitHub\\Applozic-Server\\Applozic-Ionic-Chat-Plugin\\platforms\\android\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\common_google_signin_btn_text_light_pressed.9.png\n\n* Try:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output." ]
[ "ionic-framework" ]
[ "Not able to run mjpg_streamer from a shell script run by a Java process", "I'm new to Linux. My shell script is streamscript.sh\n\nContents are:\n\n/usr/local/bin/mjpg_streamer -i \"input_uvc.so -y -f 100 -r 640*480\" -o \"output_http.so -w /usr/local/www\"\n\n\nJava Code:\n\npublic static void main(String[] args){\n try{\n String target = \"/home/pi/java_project_gf/streamscript.sh\";\n ProcessBuilder pb = new ProcessBuilder(target);\n pb.start();\n} catch(Exception ex){\n System.out.println(\"Exception thrown\" + ex.getMessage());\n}\n\n}\n\n\nIf I write mkdir dummyDir in the shell script, it is creating the directory. But mjpg_streamer is NOT running." ]
[ "java", "linux", "raspberry-pi" ]
[ "When reading an external PDF with an Android App it always shows the same version, even after updating the PDF", "Please don´t be too harsh to me concerning any mistakes with this question since thats my first one here.\n\nSo basically what i want to do is reading/showing a PDF document in my Android App after pressing a button. The PDF is located on a Raspberry Pi 3 and i found a code example on this thread how to read it.\nBefore accessing it however, i call a python script on the Raspi which is (re)creating the PDF based on a database. \n\nSo the user presses the button in the App and sees a PDF which presents the current state of a database table.\n\nNow i got the following code in my Activity to call the script and read the PDF:\n\n new AsyncTask<Integer, Void, Void>(){\n @Override\n protected Void doInBackground(Integer... params) {\n try {\n executeRemoteCommand(\"user\",\"pw\",\"ip\", port, \"command to execute the python script\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n }.execute(1);\n //waiting for the PDF to be created\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n String url = \"http://IP/path/file.pdf\";\n Intent i = new Intent(Intent.ACTION_VIEW);\n i.setData(Uri.parse(url));\n startActivity(i);\n }\n }, 5000);\n\n\nWith this code connecting to the Raspberry, executing the python script, thus updating the database and reading the PDF file works just fine.\n\nBut i have the following problem:\n\nWhen i close the PDF view in my App, add something to the database and press the executing button again the PDF file itself is being updated (i checked that on the Raspberry) but then the App still shows the old version of it. Even when i restart the App and execute this again it still shows the first version of the PDF... \n\nDoes anyone have an idea why and how to fix this?\n\nIs there any kind of cache which stores the PDF and just shows the same every time i read from the Raspberry?" ]
[ "java", "android", "android-studio", "pdf" ]
[ "Using like query to get the desired output across two tables", "Hi all i am trying to achieve below query to return result from two table based on the condition given.How to put correct query to achive the expected output?\n\nSELECT * FROM bw_tempclientdetails \nwhere companyname like '%fff%' \nnot in (SELECT * FROM bw_clientallocation where companyname like '%fff%');" ]
[ "mysql", "hibernate" ]
[ "Informatica Metadata Exchange (MX) Views show the object deleted", "I used the PowerCenter Metadata Exchange to query.\n\nThere is a view REP_ALL_SOURCES who can provides a list of the latest version of sources defined in each folder of a repository.\n\nBut when i used this view, i find that it shows the sources deleted too. I did't find the field who can filter the object deleted. so for REP_ALL_MAPPINGS, REP_LOAD_SESSIONS are the same.\n\nwho can please tell me how to show the object only exist?\n\nBest wishes,\nZhixin" ]
[ "metadata", "etl", "informatica", "informatica-powercenter" ]
[ "Scheduled items logic with days and time offset", "I have inside the database a \"Schedule\" class with 3 columns:\n\nstart (number) - slots (array) - day (number)\n\n\n\nFor example, the element in the circle refer to this row:\n\nstart: 1\n\nslots: [1,2]\n\nday: 3\n\nWhen I have to save a scheduled item, I select the parameters and save:\n\n\n\nThe problem occurs with a time offset.\n\nFor example, in this case, I send the minutes difference (-120) between local time and the server time (UTC) to save the item in UTC format.\n\nThen the item is saved in the day Tuesday (2) instead of Wednesday (3) and this creates many problems in the management of the table in the front end and in the code.\n\nI believe it is correct save the data in utc format, but in the front end how can I handle this (Tuesday instead of Wednesday)?\n\nI did not use Date objects, I'm wrong?\n\nI did lots of tests, for example, this code (dirty) work with local time:\n\nfunction generateLocalScheduleInfo(day, start, end) {\n\n var startDate = new Date();\n\n //Set the date to the next input day (day)\n startDate.setDate(startDate.getDate() + (day + (7 - startDate.getDay())) % 7);\n startDate.setMinutes(0);\n startDate.setSeconds(0);\n startDate.setHours(start);\n\n var startSlot = startDate.getHours();\n var endSlot = end;\n var slots = [];\n\n if (startSlot <= endSlot) {\n\n for (var i = startSlot; i <= endSlot; i++) {\n slots.push(i);\n }\n\n } else {\n\n var hoursBeforeMidnight = 24 - startSlot\n\n var hoursAfterMidnight = endSlot + 1;\n\n var numberOfHours = hoursBeforeMidnight + hoursAfterMidnight;\n\n for (var ii = 0; ii < numberOfHours; ii++) {\n\n if (ii < hoursBeforeMidnight) {\n\n slots.push(startSlot + ii);\n\n } else {\n\n slots.push(ii - hoursBeforeMidnight);\n\n }\n }\n }\n\n var dict = {\n \"day\": startDate.getDay(),\n \"startAtHour\": startSlot,\n \"slots\": slots\n };\n\n return dict;\n\n}\n\nvar startSlot = 1;\nvar endSlot = 2;\nvar day = 0;\n\nvar scheduledInfo = generateLocalScheduleInfo(day, startSlot, endSlot);\n\nconsole.log(scheduledInfo);\n\n\nI need a more simple solution for this\n\nThanks" ]
[ "javascript", "timezone-offset" ]
[ "hibernate 5.4.12.Final \"The attribute cacheable is undefined for the annotation type NamedQuery\", is cacheable = true not supported?", "I am trying to cache the findByName source query so i only look it up once during the session. However when adding cacheable = true to the annotation, Eclipse reports that it does not support the cacheable setting in the annotation. I am using Hibernate 5.4.12.Final\n\npackage aware.process.models;\n\nimport java.util.List;\n\nimport javax.persistence.Cacheable;\nimport javax.persistence.Entity;\nimport javax.persistence.Id;\nimport javax.persistence.NamedQuery;\nimport javax.persistence.Query;\nimport javax.persistence.Table;\n\nimport org.hibernate.Session;\n\nimport aware.process.HibernateUtil;\nimport lombok.Getter;\nimport lombok.Setter;\n\n@Entity \n@Table(name= \"source\") \n@Cacheable \n@NamedQuery(query = \"Select s from Source s where s.name = :name\", name = \"findSourceByName\", cacheable = true)\n@Getter @Setter\npublic class Source {\n\n @Id\n private String id;\n private String name;\n\n public static Source getByName(String parseType) {\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\n session.beginTransaction();\n\n Query query = session.createNamedQuery(\"findSourceByName\");\n\n query.setParameter(\"name\", parseType);\n List<Source> sourceList = query.getResultList();\n\n Source source = (Source) sourceList.get(0);\n session.getTransaction().commit();\n return source;\n }\n}" ]
[ "java", "hibernate", "jpa", "annotations", "named-query" ]
[ "XSL stylesheet Using variables to calculate", "XML file:\n\n<formattedEgGesamt>270.​94</formattedEgGesamt>\n<formattedEgGesperrt>50.00</formattedEgGesperrt>\n<formattedHgGesamt>78.18</formattedHgGesamt>\n<formattedHgGesperrt>4.00</formattedHgGesperrt>\n\n\nIn my XSL file, I declare 4 variables:\n\n<xsl:variable name=\"HGGesamt\">\n <xsl:value-of select=\"format-number(/Basis/PersonenkontoDTO/formattedHgGesamt,'#.00')\"/>\n </xsl:variable> \n <xsl:variable name=\"HGGesperrt\">\n <xsl:value-of select=\"format-number(/Basis/PersonenkontoDTO/formattedHgGesperrt,'#.00')\"/>\n </xsl:variable>\n <xsl:variable name=\"EGGesamt\">\n <xsl:value-of select=\"format-number(/Basis/PersonenkontoDTO/formattedEgGesamt,'#.00')\"/>\n </xsl:variable> \n <xsl:variable name=\"EGGesperrt\">\n <xsl:value-of select=\"format-number(/Basis/PersonenkontoDTO/formattedEgGesperrt,'#.00')\"/>\n </xsl:variable>\n\n\nThese variables are used to calculate the difference between formattedHgGesamt and formattedHgGesperrt, and formattedEgGesamt and formattedEgGesperrt. \n\nThe result should be printed.\n\nHere's the code used to print the 2 results:\n\n<fo:table-cell padding=\"3pt\" display-align=\"center\" border-style=\"solid\" border-width=\"1pt\" border-color=\"white\">\n <fo:block font-family=\"Courier\" text-align=\"right\" font-weight=\"bold\">\n <xsl:value-of select=\"format-number(exsl:node-set($HGGesamt)-exsl:node-set($HGGesperrt),'#.00')\"/> € \n </fo:block>\n </fo:table-cell>\n<fo:table-cell padding=\"3pt\" display-align=\"center\" border-style=\"solid\" border-width=\"1pt\" border-color=\"white\">\n <fo:block font-family=\"Courier\" text-align=\"right\" font-weight=\"bold\">\n <xsl:value-of select=\"format-number(exsl:node-set($EGGesamt)-exsl:node-set($EGGesperrt),'#.00')\"/> € \n </fo:block>\n </fo:table-cell>\n\n\nThe result of the first lines of code, concerning HGGesamt and HGGesperrt are printed and the result is right.\nFor the EGGesamt-EGGesperrt, it only prints \"NaN\"\n\nDoes anybody have an idea, why?" ]
[ "xslt", "xsl-fo" ]
[ "How to filter many to many structure in Laravel", "I got a many to many user and role structure\n\nusers\nid\nname\n\nroles\nid\nname\n\nrole_user\nuser_id\nrole_id\n\nModel\n\nUser.php \n\npublic function roles() {\n return $this->belongsToMany('Role');\n}\n\n\nRole.php\n\npublic function users() {\n return $this->belongsToMany('User');\n}\n\n\nThere are two data admins and members in roles table, I would like to know to to filter users which role is admins." ]
[ "php", "laravel" ]
[ "Table Name stored in column used as part of query?", "I cant seem to find information related to this question.\n\nI have four tables: pages, items, linktable, datatable\n\nThe pages table has a ID that links to the Items table. \n\nThe items table has an ID and Table Name field and ID that reference the table which has the actual data for the item.\n\naka:\n\nPages_Table:\n\npg_id\npg_title\n\nItems_Table:\n\npg_id\nitem_type\nitem_id\n\nlink_table:\n\nitem_id\ndata_id\ndata_table_name\n\n\nI need select data based on the data_table_name which varies, there are 10 different data_tables\n\nI cant seem to find anything related to incorporating this into a SINGLE Query.\n\nWith multiple queries obviously not an issue. Essentially its selecting a database table dynamically to be included in the query." ]
[ "php", "mysql", "sql" ]
[ "How to create extent from featureset using arcgis rest api only?", "Is there any way to get extent from featureset (contains Feature objects)?\n\nFeatureset is obtained by performing query operation on feature service layer in esri rest api.\n\nEsri rest api 10.3 introduced new parameter (returnExtentOnly) to retrieve extent but it is not available in previous versions. Client is in plain java and do not want to introduce any esri client API. \n\n1) Is there any way to get extent using rest services only? (where input = geometries of polygons)\n\n2) Any java util available to calculate extent based on polygon geometries (featureset)? \n\nE.g. in 10.3\nhttp://api.imb.org/arcgis/rest/services/LIVE/Urban/MapServer/0/query?where=GENC1%3D%27US-CA%27&returnExtentOnly=true&f=pjson" ]
[ "rest", "arcgis", "esri" ]
[ "How to enumerate through an enum with arbitrary increments between items", "Suppose I have an enum with arbitrary increments between contents. Like so:\n\n typedef enum {this=2,that=5,whoa=6}example;\n\n\nNow I want to enumerate through them. If the contents were incremented by 1 for each item, then this would be easy with a simple for loop. I could still use a for but test for each option in example enum before proceeding with an operation, but that seems rather inefficient. Is there a standard way of enumerating through an enum?" ]
[ "objective-c" ]
[ "To bind the the data directly to mat-checkbox in angular", "I have the following mat-checkbox and I am passing the value has as shown in the code\n\n<mat-checkbox [(ngModel)]=\"temperature\" name=\"temperature\" value='70' color=\"primary\" [disabled] = \"(!device) || humidity || pressure ||!(!cust_entry) || lesser ||equal || contain\" disabled>Temperature</mat-checkbox>\n\n\nThis checkbox I am using inside the form whenver I post the data it is coming has in json response {\"temperature\":true} but I want like {\"temperature\":\"70\"}. I know we can use onclickevent but I have 20 checkboxes I can't able to do onclickevent for all checkboxes" ]
[ "angular8" ]
[ "Vertica: Subquery OR and co related tables error", "Model Data\n\n\n\nRevenue Table\n\n\n\nI'm trying to find out my model performance that is I had given a score of 0.001 for a Product Category A in the model_month of May (5) for the Model_year(2015) now to track the performance i'm tracking the revenue. \n\nI claim to say that the model numbers are valid for 3 months so to check the performance i want to see a new coloumn next to model table with 3 months revenue after the model_month. \n\nSELECT a.*,\ncase when (a.MODEL_MONTH<10 ) then (select sum(b.net_revenue) from Revenue as b\n where ((b.cal_month > a.MODEL_MONTH OR b.cal_month<a.MODEL_MONTH+4) AND b.cal_year=a.MODEL_YEAR)\n and a.model_BU=b.prodcat a.model_region=b.hp_region)\n\n when (a.MODEL_MONTH>=10) then (select sum(b.net_revenue) from Revenue b\n where (((b.cal_month > a.MODEL_MONTH and b.cal_year=a.MODEL_YEAR) || \n (b.cal_month < a.MODEL_MONTH-9 and b.cal_year=a.MODEL_YEAR+1)) AND a.model_BU=b.prodcat))\n ELSE '0'\n END as Net_Revenue\n\n FROM ModelData as a\n limit 10 \n ;\n\n\ni'm getting errors as \nError: [Vertica]VJDBC ERROR: Non-equality correlated subquery expression is not supported\nSQLState: HY000\nErrorCode: 4160" ]
[ "sql", "vertica" ]
[ "onKeyDown doesn't respond in TabActivity", "My NavActivity implements TabActivity and has five child tabs. I wanna show a alert dialog when customer press back button on device. But as the title sad, it's alway not responding at this situation." ]
[ "android" ]
[ "C#: Sane alternative to optional parameter in property?", "Given: a class with properties like SomeNumber that, internally can be null (i.e. int?), but externally, you typically don't want to handle that special case, and pretend they start out as zero. So far, we're always returning a non-nullable version, i.e. int. I'd like to add an option to have a nullable version.\n\nThe easiest variant: Two properties. Works great, but unfortunately clutters the class with lots of largely redundant options. External code:\n\nreturn myObject.SomeNumber; // Not nullable.\nreturn myObject.SomeNumber_Nullable; // Nullable.\n\n\nThe internally dirty, but externally nice variant: A property with an optional parameter. I haven't yet found out how to do this in C#; .NET Reflector seems to be omitting incorrect code. In VB.NET, it looks like so:\n\nPrivate _SomeNumber As Nullable(Of Integer)\nPublic Property SomeNumber(Optional ByVal AllowNull As Boolean = False) As Nullable(Of Integer)\n Get\n If Not AllowNull AndAlso _SomeNumber Is Nothing\n Return 0\n End If\n\n Return _SomeNumber\n End Get\n Set(ByVal value As Boolean)\n _SomeNumber = value\n End Set\nEnd Property\n\n\nExternal code:\n\nreturn myObject.SomeNumber; // Not nullable.\nreturn myObject.SomeNumber(true); // Nullable.\n\n\nAmong the disadvantages:\n* C# implementation is so ugly .NET Reflector doesn't even seem to know how to do it,\n* I find the general notion of parameterized properties questionable,\n* In the non-nullable example, the return type doesn't match the actual behavior of the property — the compiler now thinks it can be null, but it really can't.\n\nAny other ideas?" ]
[ ".net-3.5", "c#-3.0", "properties" ]
[ "Cucumber DataTables using 2 rows and 3 columns", "Cucumber Java. I’m having issues trying to implement a step method using Data-tables with 2 rows and 3 columns.\n\n And I click on Build App form factors\n | IOS_SMARTPHONE_ADHOC | CLIENT_VERSION_4 | SUBCLIENT_VERSION_441 |\n | ANDROID_SMARTPHONE | CLIENT_VERSION_4 | SUBCLIENT_VERSION_441 |\n\n\nHere, I want to pass in each row as the 3 arguments. Not sure if thats how it works or if I have to switch it around. \nMy method takes 3 arguments. I already built the method to function for a single execution. But I would like to do two app platforms in a single instance.\n\n @And(\"I click on Build App form factors\")\npublic void clickOnFormFactors(DataTable dataTable) throws Exception {\n List<String> targets = dataTable.asList();\n List<Map<String, String>> clientVersions = dataTable.asMaps();\n List<Map<String, String>> subClientVersions = dataTable.asMaps();\n for (Map<String, String> target : clientVersions) {\n ActionPage.clickOnVersionsPerTarget(target, clientVersions, subClientVersion);\n }\n}\n\n\nI'm pretty sure I'm using the loops and List initiation incorrectly. I was able to use asList() for 1column/2rows. I read that I need to use asMaps(). But no idea how to loop for 3 arguments to get data for the 3 columns." ]
[ "java", "datatables", "cucumber", "gherkin" ]
[ "How do I configure customize session configuration?", "I am Using Springboot 5.1.5.\nI want to customize how to store information in session, so I added this;\npublic class MyCustomSessionAttributeStore extends DefaultSessionAttributeStore {\n\n @Override\n protected String getAttributeNameInSession(WebRequest request, String attributeName) {\n\n Object handler = request.getAttribute("", WebRequest.SCOPE_REQUEST);\n if (handler == null) return super.getAttributeNameInSession(request, attributeName);\n\n return handler.getClass().getName() + "." + super.getAttributeNameInSession(request, attributeName);\n }\n}\n\n\n(Don't mind the codes after "Object handler" - it is still a work in progress).\nIn order to configure this customization, I also added this;\n\n@Configuration\npublic class SessionConfiguration extends WebMvcConfigurationSupport {\n\n @Bean\n public SessionAttributeStore sessionAttributeStore() {\n return new MyCustomSessionAttributeStore();\n }\n\n @Override\n @Bean\n public RequestMappingHandlerAdapter requestMappingHandlerAdapter() {\n RequestMappingHandlerAdapter rmha = super.requestMappingHandlerAdapter();\n rmha.setSessionAttributeStore(sessionAttributeStore());\n return rmha;\n }\n\n @Override\n public void configurePathMatch(PathMatchConfigurer configurer) {\n super.configurePathMatch(configurer);\n\n configurer.setUseSuffixPatternMatch(false);\n }\n}\n\n\nHowever, when I run the application, it gives me following errors;\nWebSocketReactiveAutoConfiguration:\n Did not match:\n - @ConditionalOnWebApplication did not find reactive web application classes (OnWebApplicationCondition)\n\n\n(and it goes on with other configuration classes.)\nAlso, even though the application is running, it does not seem to load static resources like css or javascript.\nAny suggestion will be appreciated. Thank you in advance!" ]
[ "spring-boot", "spring-mvc", "configuration" ]
[ "How to add Vagrant box and Virtual box machine (which is not installed via vagrant) to the same NAT network?", "I have a kali linux vagrant box installed, and I want it to connect to the same NAT Network with my vuln.hub lab (which is not installed via vagrant, just imported to VirtualBox). Apparently I do not see option for making NAT-Network mode enabled.\n\nI tried the following but It won't work :/\n\nconfig.vm.network:natnetwork \"private_network\", ip: \"192.168.33.10\"\n\n\nSorry If It is some basic question, just figuring the way for 3hours. And my default created NAT is isolated from vuln.hub\n\nThanks in advance guys!" ]
[ "vagrant", "virtualbox" ]
[ "How can I get Live Location in telegram bot via python?", "I'm using the python-telegram-bot library.\nI want to track a user's Live Location, but I don't know how to do it.\nI try to use Job Queue:\n\ndef notification(bot, job):\n updates = bot.get_updates()\n print([u.message.location for u in updates])\n# Add job to queue\n\njob = job_queue.run_repeating(notification, 10, 1, context=chat_id)\nchat_data['job'] = job\n\n\nBut updates are void.\nI want to track location every 1 minutes." ]
[ "python", "location", "telegram-bot", "python-telegram-bot" ]
[ "Tensorflow Import Error on Cluster GPU: libcusolver.so.8.0: cannot open shared object file", "I am trying to run a task on the gpu supported by the university. But when I try to import Tensorflow, the following error is shown and it seems that the Tensorflow does not import successfully. I am not sure how to fix it. Anyone has any ideas? Thanks.\nTraceback (most recent call last):\n File "/nas/longleaf/apps/tensorflow_py3/1.2.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>\n from tensorflow.python.pywrap_tensorflow_internal import *\n File "/nas/longleaf/apps/tensorflow_py3/1.2.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>\n _pywrap_tensorflow_internal = swig_import_helper()\n File "/nas/longleaf/apps/tensorflow_py3/1.2.0/lib/python3.5/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper\n _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)\n File "/nas/longleaf/apps/python/3.5.1/lib/python3.5/imp.py", line 242, in load_module\n return load_dynamic(name, filename, file)\n File "/nas/longleaf/apps/python/3.5.1/lib/python3.5/imp.py", line 342, in load_dynamic\n return _load(spec)\nImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory" ]
[ "tensorflow", "python-import" ]
[ "How to bind using kivy only?", "I want to create a Widget changing only the text of a label inside it, but all the ways I find how to change this are by changing it in the python code instead of reusing only Kivy objects.\n\nSo I have a widget like the following:\n\n<AmiLabel@Label>\n color: .1, .5, .8, 1\n font_size: 16\n\n<AmiTextInput@TextInput>\n font_size: 16\n\n<PropertyInputForm>:\n BoxLayout:\n size: root.size\n pos: root.pos\n orientation: 'horizontal'\n AmiLabel:\n text: 'Folder Location'\n size_hint_x: .5\n AmiTextInput:\n text: 'None'\n size_hint_x: .5\n\n<MainFormWidget>:\n BoxLayout:\n size: root.size\n pos: root.pos\n id: foo_bar\n padding: 5\n spacing: 5\n canvas:\n Color:\n rgb: (1, 1, 1)\n Rectangle:\n pos: self.pos\n size: self.size\n orientation: 'vertical'\n AmiLabel:\n height: 36\n size_hint_x: 1\n size_hint_y: None\n text: 'Project Name'\n PropertyInputForm:\n height: 36\n size_hint_x: 1\n size_hint_y: None\n # I WANT TO CHANGE THE TEXT OF THE LABEL IN HERE\n PropertyInputForm:\n height: 36\n size_hint_x: 1\n size_hint_y: None\n # I WANT TO CHANGE THE TEXT OF THE LABEL IN HERE\n\n\nAll I want to is change the text of the label from another widget in another level without touching the python code. \n\n¿Is that possible?" ]
[ "python", "user-interface", "binding", "widget", "kivy" ]
[ "coldfusion Hide/remove a name from a menu/list", "I have an insert form that I did in adobe coldfusion. This insert form inserts information from the men on my team into a databases table called squadreport. After every insert into my squadreport table, I would like to remove the name of the person that I just inserted from the menu list of available names of those on my team who have not been inserted yet. This way I won’t accidently reinsert their names. The menu list are generated from my NAMES tables. The name.foiid field from my NAMES table matches my squadreport.squfoiid field from my SQUADREPORT table. \n\nExample: If the squadreport.squfoiid is already recorded with the start date of ‘2012-11-18’ and a end date of ‘2012-11-24’, then I want to prevent the reinsertion of same person with the same dates etc.\n\nMy current syntax will generate a blank list. \n\nHere’s is what my current syntax look like: \n\n<cfquery name=\"brother\" datasource=\"master\">\nSELECT name.foiid, squadlt, squadlt.ltid, CONCAT(name.fname,' ',name.lname) AS teammember\nFROM name \nLEFT JOIN name ON name.foiid = squadreport.squfoiid\nLEFT JOIN squadlt ON ltid = squadreport.sqult\nWHERE name.foiid is null\nAND squweekbegin =’2012-11-18’\nAND squweekend = ‘2012-11-24’\nAND squadlt = '3'\nAND ltid = '3'\nAND CITY = 'sandiego'\nAND STATUS <> 'd'\nAND STATUS <> 'T'\nAND Form4444Complete = 'yes'\nORDER BY teammember\n</cfquery>" ]
[ "sql", "coldfusion" ]
[ "How to make DPFBannerView in UITableview did not scroll", "i am new in Google admob development. In this case i need to add an admob inside my uitableview, I make an implementation like this on : \n\n\n\nthe problem is, the cell that contain the ads (I Use DFPBannerView) is scrollable, i want to make it unscrollable. I just want to make the uitableview scrollable but the banner view is not. I already implement some suggestion from UIScrollView doesn't scroll when touching GADBannerView subview\n\nbut it still can not make the ads unscrollable. is there anyone can help me?" ]
[ "ios", "objective-c", "uitableview", "scroll", "admob" ]
[ "Back pressed or finish() goes to the wrong task in Android", "From a Service, I launch an Activity in my application. This is not the main application activity, just some random other activity. \nAfter the user has interacted with this Activity, I want to close it and return the user to where he was. So say for example he was in Facebook. My Activity gets launched. When he is done interacting with it, I want to return the user to Facebook. However, when I call finish() or backPressed() or anything like that, the Main (launcher) Activity of my application is started. I don't understand why." ]
[ "android" ]
[ "nuxt asyncData axios 503", "when I use $axios.$get in asyncData,\n\nasync asyncData({ $axios }) {\n const { list } = await $axios.$get('http://localhost:3000/api/list')\n return { list }\n}\n\n\nubuntu terminal always throw error like:\n\n(node:9628) UnhandledPromiseRejectionWarning: Error: Request failed with status code 503\nat IncomingMessage.emit (events.js:228:7)\n at IncomingMessage.EventEmitter.emit (domain.js:475:20)\n at endReadableNT (_stream_readable.js:1185:12)\n at processTicksAndRejections (internal/process/task_queues.js:81:21)\n(node:9628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6)\n(node:9628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\n\n\nbut when I use the terminal in the vscode, error disappeared. I'm confused. :(" ]
[ "node.js", "axios", "nuxt.js", "asyncdata" ]
[ "Mono Entity Framework 6 MySQL", "I have developed a project with Entity Framework 6 that use a MySQL as database.. On my windows system the project is working. Now I tried to move that project on my linux machine.\nIn order to run the project I added the MySQL dll to the GAC and to machine config. All needed dlls are also located in the project folder. When the Entity Framework access the database I am getting the following error:\n\nSystem.Configuration.ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.\n at System.Data.Common.DbProviderFactories.GetFactory (System.Data.DataRow providerRow) [0x00000] in <filename unknown>:0\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n <configSections>\n <section name=\"entityFramework\" type=\"System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\" requirePermission=\"false\" />\n <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->\n </configSections>\n <startup>\n <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n </startup>\n <connectionStrings>\n <add name=\"CashDeskServerContext\" providerName=\"MySql.Data.MySqlClient\" connectionString=\"server=localhost;\n port=3306;database=ServerContext;uid=root;password=password;Convert Zero Datetime=True\"/>\n <add name=\"AuditLogContext\" providerName=\"MySql.Data.MySqlClient\" connectionString=\"server=localhost;\n port=3306;database=AuditLogContext;uid=root;password=password;Convert Zero Datetime=True\"/>\n </connectionStrings>\n <entityFramework>\n <defaultConnectionFactory type=\"System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework\" />\n <providers>\n <provider invariantName=\"MySql.Data.MySqlClient\" type=\"MySql.Data.MySqlClient.MySqlProviderServices, \n MySql.Data.Entity.EF6\" />\n <provider invariantName=\"System.Data.SqlClient\" type=\"System.Data.Entity.SqlServer.SqlProviderServices, \n EntityFramework.SqlServer\" />\n </providers>\n </entityFramework>\n</configuration>\n\n\nAny ideas?\n\nTHX\nMichael" ]
[ "c#", "mysql", ".net", "entity-framework", "mono" ]
[ "Referencing string resources in VS2015 Shared Project from multiple WPF projects", "I have a couple standard WPF projects (not UWP) that are both referencing a shared project using the new Visual Studio 2015 Shared Project type. This looks like it works great for sharing code, but I'd also like to share strings and other resources that would normally be found in a resource.resx file. Focusing on strings, I have created a resource.resw file in the shared project and populated with my values. But I'm stuck on how to reference those values from either of my WPF projects.\n\nI see that, by default, the .resw file has a build action of PRIResource. I'm not sure what that type of resource is exactly, nor have I been able to find anything useful to explain it. Either way, I haven't been able to reference my strings with that build action. I have also tried changing build action to Embedded Resource, along with setting a unique Custom Tool Namespace value, but that doesn't seem to give me access either.\n\nI'm used to accessing string resources that live in .resx files by using MyNamespace.Properties.Resources.MyStringKey, but no such path seems to resolve when trying to reference the .resw file. I've also seen references to using the ResourceLoader class to access those strings, but that seems to be specific to UWP.\n\nHow do I access .resw strings that live in a Visual Studio 2015 Shared Project from the projects that reference it?" ]
[ "c#", "wpf", "visual-studio-2015", "shared-project" ]
[ "Apache Mina , create my own IoSession: How to?", "I'm playing for a few days with apache mina and I want to ask you how can I create by extending (or implementing) IoSession to create something like MyIoSession.\n\nThe reason why I want to do this is because in the Handler class I want something like this:\n\npublic class MyHandler extends IoHandlerAdapter{\n public void messageReceived( MyIoSession session, Object message ) throws Exception\n {\n // here I have MyIoSession instead of IoSession which will have more info something\n // like an unique ID\n }\n}\n\n\nThis way MyIoSession will have some unique ID and this way I'll identify which client is sending messages to server.\n\nAlso if there are other better ways to achieve this feel free to tell me.\n\nThanks" ]
[ "java", "apache-mina" ]
[ "How to get the value of a html select in AngularJS after using a filter in the ng-options expression", "I used a filter in my ng-options expression to convert all the options to uppercase but now when I want to get the value that the user selected I get a undefined\n\nhere is my select\n\n<select name=\"selectThings\" class=\"form-control\" \n id=\"selectThings\" \n ng-model=\"selectThings\"\n\n ng-options=\"thing.name as (thing.name | uppercase) for thing in thinglist\" \n ng-change=\"submitSelectedValThing()\"\n required>\n</select>\n\n\nand here is how I'm trying to get the value that the user selected\n\n$scope.selectThings.name;\n\n\nbut I get an undefined error in that line, the code used to work fine before I added that filter \n\nhere is my full controller\n\nangular.module('MyApp')\n .controller('ThingCtrl', ['$scope',\n function ($scope) {\n\n\n $scope.submitSelectedValThing = function () {\n $scope.$watch('thing.Name', function (newVal, oldVal) {\n if (!$scope.thing.Name || newVal === oldVal) return;\n // now do stuff here with $scope.selectedThing\n console.log('the value is ' + $scope.selectThings.name);\n });\n console.log($scope.selectThings.name);\n\n };\n\n\n\n\n }]);" ]
[ "javascript", "angularjs" ]
[ "Valid JSON in text file but python json.loads gives \"JSON object could be decoded\"", "I have a valid JSON (checked using Lint) in a text file.\n\nI am loading the json as follows\n\n test_data_file = open('jsonfile', \"r\")\n json_str = test_data_file.read()\n the_json = json.loads(json_str)\n\n\nI have verified the json data in file on Lint and it shows it as valid. However the json.loads throws\n\n ValueError: No JSON object could be decoded\n\n\nI am a newbie to Python so not sure how to do it the right way. Please help\n(I assume it has something to do it encoding the string to unicode format from utf-8 as the data in file is retrieved as a string)" ]
[ "python", "json" ]
[ "range-v3: strange Behavior", "I am trying to play with range-v3 and I encountered a problems : it does not extract values from a vector as I would have wanted.\n\nSee the code below: \n\n\nWhen running, it outputs (0, 0), instead of what I would have thought, i.e (1, 0)\nIf I uncomment the line auto pairs = ..., then the result is changed, and the output becomes (33144464,0), although the variable pairs is unused (and the assert will fail) \n\n\n#include <iostream>\n#include <vector>\n#include <range/v3/all.hpp>\n\nauto foo()\n{\n auto values = std::vector<int> { 1, 0 };\n // auto pairs = std::vector< std::pair<int, int> > { { 1, 0 }, { 0, 1 }, { 0, 0 } };\n\n return ranges::view::for_each(values, [=](int nb)\n {\n std::cout << \" nb=\" << nb << std::endl;\n assert( (nb == 0) || (nb == 1) );\n return ranges::yield(nb);\n });\n}\n\n\nint main()\n{\n ranges::for_each(foo(), [](auto v) {\n std::cout << v << \"\\n\";\n });\n}\n\n\nThis code was compiled with g++ (g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0) and clang++ (clang version 8.0.0 (tags/RELEASE_800/final)) with the following commands:\n\ng++ foo.cpp -std=c++14 -Irange-v3/include -Wall -Wpedantic\nclang++ foo.cpp -std=c++14 -Irange-v3/include -Wall -Wpedantic\n\n\nI am using a fresh clone for ranges-v3, and I can reproduce this on ubuntu and OSX (with AppleClang)." ]
[ "c++", "range-v3" ]
[ "Multiple deployments in single service", "My backend has 5 different deployments, each serving the request in a specific port.\n\nFrontend service contacts the backend service with the necessary details. The backend service should be able to decide the required pod (from one of the 5 deployments) to serve the request.\n\nInstead of creating 5 different services, is it possible to link a single service to multiple deployments?\n\nKubernetes version: 1.12\nCloud being used: Amazon EKS\n\nPS: My requirement is different from https://github.com/kubernetes/kubernetes/issues/24875\nSimilar question is unanswered: "Wire" multiple Deployments to one Service in Kubernetes" ]
[ "kubernetes", "amazon-eks" ]
[ "Bash: Parse Urls from file, process them and then remove them from the file", "I am trying to automate a procedure where the system will fetch the contents of a file (1 Url per line), use wget to grab the files from the site (https folder) and then remove the line from the file.\n\nI have made several tries but the sed part (at the end) cannot understand the string (I tried escaping characters) and remove it from that file!\n\ncat File\nhttps://something.net/xxx/data/Folder1/\nhttps://something.net/xxx/data/Folder2/\nhttps://something.net/xxx/data/Folder3/\n\n\nMy line of code is:\n\ncat File | xargs -n1 -I @ bash -c 'wget -r -nd -l 1 -c -A rar,zip,7z,txt,jpg,iso,sfv,md5,pdf --no-parent --restrict-file-names=nocontrol --user=test --password=pass --no-check-certificate \"@\" -P /mnt/USB/ && sed -e 's|@||g' File'\n\n\nIt works up until the sed -e 's|@||g' File part..\n\nThanks in advance!" ]
[ "bash", "parsing", "sed", "xargs" ]
[ "Validation against the non generic attribute of a generic type", "I want to validate a class, that has a property of a generic type:\n\nclass Foo\n{\n [ValidHistoryDate]\n public MyType<string> bar;\n [ValidHistoryDate]\n public MyType<int> baz;\n [ValidHistoryDate]\n public MyType<float> bat;\n}\nclass MyType<T>\n{\n public string date;\n public T property;\n}\n\n\nThe generic type also contains a date, attribute (string), that should be validated against a valid date, so I wrote this function to do this:\n\npublic class ValidHistoryDateAttribute : ValidationAttribute\n{\n public override bool IsValid(object value)\n {\n if (value == null)\n return true;\n var v = (List<MyType<object>>)value;\n bool valid = true;\n foreach (var f in v)\n {\n if (!Regex.Match(f.Date, @\"^[0-9]{2}\\.[0-9]{2}\\.[0-9]{4}$\").Success)\n valid = false;\n }\n return valid;\n }\n}\n\n\nThe validation does not care about the property \"property\", but it should care about the string.\nUnfortunately the cast fails:\n\n var v = (List<MyType<object>>)value;\n\n\nI mean: Of course it does, because \"object\" is not the real type. I want to use the validation attribute for all types and in the validation I actually do not even care about \"property\".\n\nAny way to solve this in a nice way? I do not want to add a ValidHistoryDateAttribute for every possible type." ]
[ "c#", ".net", "validation", ".net-core" ]
[ "prevent Lumen from showing default 500 Internal Server Error on API responses", "I have a Route defined as:\n\n$app->post('api/v1/Subject','SubjectController@createSubject');\n\n\nAnd in the Controller I have the following code:\n\npublic function createSubject(Request $request){\n $Subject = Subject::create($request->all());\n return response()->json($Subject);\n}\n\n\n\n\nNow, when someone sends incorrect data, it triggers a Query Exception - \"SQLSTATE[23000]: Integrity constraint violation:\" which is understood.\n\nHowever, what I want is: I want do not want Lumen to send its own default Error Page in API Response. I want to capture this error event and send my own customized response. How can I do that?\n\nSince I could not find a solution, I tried to add my own view at: /resources/views/errors/500.blade.php but Lumen is even ignoring this template. Please help. Ideally, I would want to capture this error event and send my own customized response.\n\n\n\nEDIT:\n\nLumen was reporting two exceptions - PDOException and QueryException at the 500 error response. So, to get a custom error message, I put the following code in side function render() in app\\Exceptions\\Handler:\n\npublic function render($request, Exception $e)\n{\n if($e instanceof PDOException){\n return response('It is my Custom response for PDOException that caused 500 error response.');\n }\n\n if($e instanceof QueryException){\n return response('It is my Custom response for QueryException that cuased 500 error response.');\n }\n\n return parent::render($request, $e);\n}" ]
[ "laravel", "api", "lumen" ]
[ "oauth: Meteor authentication issue on own server", "I'm working on an app the requires a log-in by using oauth mechanisms from LinkedIn, Twitter, Google.\nOn the common meteor server this authentication method works fine.\n\nHowever, I recently deployed the meteor server on my own server, and I get an authentication error when I try to log in. I tried linkedin and twitter and receive the same error, so I guess something is wrong on my server.\nThe error is in a browser window:\n\n\n\nThe requested URL /_oauth/linkedin was not found on this server.\n\nAdditionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.\n\nApache/2.2.22 (Ubuntu) Server at exomodal.com Port 80\n\nThe meteor server is at port 3000.\n\nAny ideas how to resolve this issue?\n\nThanks in advance" ]
[ "oauth", "meteor" ]
[ "Anyway to break this double-ended queue?", "I have my own double ended queue implemented with a circular array such that the 'front' pointer points to the front element and the 'rear' pointer points to one element after the last element. At first they are both set to index 0.\n\nNormal: \n\n [X][X][ ][ ][ ]\n\n F R \n\nExample: \n\n1. [ ][ ][ ][ ][ ]\n\n FR \n\n2. AddFirst 1 times\n\n [ ][ ][ ][ ][X]\n\n R F\n\n3. Add 4 more times such that it's full\n\n [X][X][X][X][X]\n\n FR \n\n4. RemoveFirst\n\n [ ][X][X][X][X]\n\n R F \n\n\nAs you can see everything works just fine, but I'm thinking there is a way to break it. I'm saying this because if I implement F and R pointing to the first and last elements, doing what I did above WILL break it i.e. R points to null which isn't true. So I'm wondering if it will ever happen in this implementation.\n\nAssumptions: I have already implemented checks to prevent adding when full or removing when empty, adding and removing when capacity is zero, and adding null elements which in my implementation is disallowed." ]
[ "java" ]
[ "Why does DataGrip only show query execution time sometimes?", "According to this question (and the link posted in the comments, DataGrip should show query execution time in the status bar as of version 2017.1. However, this only works for me with some queries.\n\nE.g., on a short query, I see the following, as expected\n\n\n\nBut on some other queries, I see something like this instead\n\n\n\nI can't really figure out when the second one happens and when it doesn't. The best guess I have is that it's only for long-running queries. But this is exactly when I would want it to show the execution time, so that would be very frustrating." ]
[ "datagrip" ]
[ "AngularJS wrong reference in $destroy function while destruction of the scope in ngRepeat", "Please add few items. They will have ids like 1, 2, 3.\nThen please remove one before last item.\nid: 2 should be referred in scope $destroy function, but last is\nalways referred.\n\n\nAm I doing something wrong or is it AngularJS bug?\nCan I somehow workaround it?\n\n\r\n\r\n/*\r\n bug description:\r\n click add button add two items,\r\n then remove first item\r\n (wrong scope is refered in scope $on destroy function)\r\n*/\r\n\r\nvar app = angular.module('plunker', []);\r\n\r\napp.controller('MainCtrl', function($scope) {\r\n $scope.name = 'World';\r\n $scope.values = [];\r\n \r\n $scope.add = () => { $scope.values.push(''); };\r\n $scope.remove = ($index) => { $scope.values.splice($index, 1) };\r\n});\r\n\r\napp.directive('someDirective', () => {\r\n return {\r\n restrict: 'A',\r\n scope: true,\r\n link: (scope, element, attr, ctrls) => {\r\n console.log(scope.$id)\r\n scope.$on('$destroy', (event) => {\r\n console.log(scope.$id, event);\r\n });\r\n }\r\n } \r\n});\r\n<!DOCTYPE html>\r\n<html ng-app=\"plunker\">\r\n\r\n <head>\r\n <meta charset=\"utf-8\" />\r\n <title>AngularJS Plunker</title>\r\n <script>document.write('<base href=\"' + document.location + '\" />');</script>\r\n <link rel=\"stylesheet\" href=\"style.css\" />\r\n <script data-require=\"[email protected]\" src=\"https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.11/angular.min.js\" data-semver=\"1.5.11\"></script>\r\n <script src=\"app.js\"></script>\r\n </head>\r\n\r\n <body ng-controller=\"MainCtrl\">\r\n <p>Hello {{name}}!</p>\r\n <button ng-click=\"add()\">add</button>\r\n <br/>\r\n <div ng-repeat=\"value in values track by $index\">\r\n <input some-directive ng-model=\"values[$index]\">\r\n <button ng-click=\"remove($index)\">x</button>\r\n <div>\r\n </body>\r\n\r\n</html>" ]
[ "javascript", "angularjs", "scope" ]
[ "sort array with its index", "Possible Duplicate:\n PHP sort multidimensional array by value \n\n\n\n\nI have an array like this -\n\nArray\n(\n [0] => Array\n (\n [rest_id] => 1\n [restname] => Baumgart's Cafe\n [address] => 158 Franklin Avenue\n [distance] => 20.3599115829\n )\n\n [1] => Array\n (\n [rest_id] => 2\n [restname] => Brownstone Diner & Pancake Factory\n [address] => 426 Jersey Avenue\n [distance] => 12.422657991\n )\n\n [2] => Array\n (\n [rest_id] => 3\n [restname] => Jacques Torres Chocolate\n [address] => 285 Amsterdam Avenue\n [distance] => 16.3264917908\n )\n\n [3] => Array\n (\n [rest_id] => 4\n [restname] => Ed's Health Food\n [address] => 150 Mountain Avenue\n [distance] => 31.1066764629\n )\n\n\nI want to sort this array on distance. \nAny help is appreciated.\nThnak you." ]
[ "php" ]
[ "How to get all the descendants of an object in Ruby on Rails", "I'm have models related as follows:\n\nGrandParent \n has_many :kids\n has_many :grand_children, through: :kids\nKid \n belongs_to :grand_parent\n has_many :grand_kids\nGrandKid\n belongs_to :kid\n\n\nI would just like to call .descendants on an object, and get all the objects that belong to its 'lineage'. \n\nI thought that using the ancestry gem would give me the .descendants method I wanted, but it only creates an additional index on a single class, allowing you to get descendants within said class.(great for things like comments & replies, but not useful for my problem) My code is not really necessary to understand the problem, but here it is for those interested: https://gist.github.com/bjlinville1/8425bfe88bc7060209e8" ]
[ "ruby-on-rails", "ruby", "tree", "children", "ancestry" ]
[ "Sql query for monthly/yearly report", "I have got a Sales table which has fields like \n\n upgrade[yes/no] \n date upgraded[datetime] \n user[username]\n\n\nWhat I want to run a query and show upgrades monthly and yearly wise , for instance i want to generate a report like Jan 2012 [total upgrades made 30, user1 made 10 upgrades , user 2 made 15 upgrades, similarly\nuser 3 made 5 upgrades. Similarly I want to acheive that for yearly basis too." ]
[ "sql", "database", "sql-server-2008", "select" ]
[ "Windows Phone 7 emulator with a touchscreen", "I'm thinking about getting a small touchscreen to work with the Windows Phone 7 emulator... but will the developers tools support multi-touch from a touchscreen? I've only seen it with single mouse clicks so far..." ]
[ "emulation", "windows-phone-7", "touchscreen" ]
[ "How to call function A from function B within the same namespace?", "Let's say I have the namespace,\n\nvar Namespace = {\n A : function() {\n alert('Hello!');\n },\n B : function() {\n // Call A() from here, do other stuff\n }\n}\n\n\nIn this namespace, I intend for A to be a helper function to B. That is to say, A() will never be called outside the namespace. It will only be called by the functions within the namespace.\n\nWhat's the best way to address the issue of a local/helper function within a namespace? The way I see it there are two possibilities:\n\n// Method #1 \nvar Namespace = {\n A: function() {\n alert('Method #1'); \n },\n\n B : function() {\n Namespace.A();\n }\n}\n\nNamespace.B();\n\n// Method #2\nfunction Namespace2() {\n var A = function() {\n alert('Method #2');\n };\n\n this.B = function() {\n A(); \n }\n}\n\nvar ns2 = new Namespace2();\nns2.B();\n\n\nIn the first method, it is ugly and awkard to type Namespace.A() (repeatedly) in every function within the namespace. This leads me to prefer Method #2. But I was curious what was the best practice here." ]
[ "javascript" ]
[ "Rails 3 Drop Down Index Page Filter Sort", "I am using Rails 3 and ruby 1.9.2. I have a storefront listing several products and I want to give users the ability to filter the products by dept_type. dept_type is a attribute of products and not a separate model. I have the following in my model:\n\nclass Product < ActiveRecord::Base\n DEPT_TYPES = [\"Baby\",\"Beauty\", \"Household\", \"Pets\"]\n\n\nMy controller:\n\nclass StoreController < ApplicationController\n def index\n @title= \"Home\"\n if Product.all.collect(&:dept) == (params[:dept])\n @products= Product.send(params[:dept])\n else\n @products = Product.order(:premium)\n end\n end\n\n\nIn my view:\n\n<%= select(\"dept\", \"dept_type\", Product.all.collect(&:dept)) %>\n <% @products.each do |product| %>\n ...\n <%end%>\n\n\nWhen I load the page I have the dropdown with all the DEPT_TYPES options but when I select one nothing happens. What do I need to do to get the page to update and filter for only the selected dept?" ]
[ "ruby-on-rails", "filter" ]
[ "Specific piece of jQuery doesn't work", "The script displays a Test11 so loaded properly.\nUnfortunately, Test22 no longer has displayed. Anyone know what might be causing this?\n\nView Details.cshtml,\n\n@model xzy.Models.Album\n\n@{\n ViewBag.Title = \"Details\";\n}\n\n<h2>Details</h2>\n\n@using (Html.BeginForm(\"Details\", \"Store\", FormMethod.Post,\n new\n {\n id = \"someID\",\n data_oneAction = @Url.Action(\"one\")\n }))\n{\n <fieldset\n\n <label for=\"Formats\">Select format</label>\n\n @Html.DropDownList(\"Formats\", ViewBag.Formats as SelectList,\n new { id = \"FormatsID\", @class = \"xxx\" })\n\n\n <input type=\"submit\" value=\"Submit\" id=\"SubmitID\" } />\n\n </fieldset>\n}\n\[email protected](\"~/bundles/jquery\")\n<script src=\"@Url.Content(\"~/Scripts/first_file.js\")\"></script>\n\n\nScript first_file.js,\n\n$(function () {\n\n $('#FormatsID').change(function () {\n alert('Test11');\n var URL = $('#someID').data('oneAction');\n $.getJSON(URL + '/' + $('#FormatsID').val(), function (data) {\n alert('Test22');\n });\n });\n});\n\n\nBrowser console," ]
[ "c#", "jquery", "asp.net-mvc", "asp.net-mvc-4" ]
[ "Rails app with devise fails to deploy on heroku (from github sorces)", "I have a rails 6 application with devise gem which runs perfectly on local machine, but fails to be deployed on heroku with the following error:\n Running: rake assets:precompile\n rake aborted!\n NameError: uninitialized constant User\n /tmp/build_d1b4c565/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.1/lib/active_support/inflector/methods.rb:274:in `const_get'\n\nI guess, this is because rails db:migrate was not running. I've seen some manuals showing to run this from console, but for that, they use the heroku git, but I'm deploying straightly from github.\nHow can I fix this?" ]
[ "ruby-on-rails", "ruby", "heroku", "devise" ]
[ "Electron Menus and Project Structure", "Bit of a newbie with Electron and learning from some YouTube vids and a Udemy course.\n\nI have a couple of sample apps up and running - so far so good, but my question is this:\n\nNow that I'm starting to consider the design/structure I would use for a much larger, more meaningful application I want to move all my Menus into a source folder like 'menuTemplates' and in that folder I would probably need between 10-15 different menu structures to be stored.\n\nInside each file I would expect to be able to put structures like:\n\n {\n label: \"Menu\",\n submenu: [\n { \n label: \"One\",\n submenu: []\n },\n {\n label: \"Two\",\n submenu: []\n },\n {\n label: \"Quit\", \n click() {\n app.quit()\n }\n }\n ]\n }\n\n\nIn other words, I just want to put the json documents which define the menus into something like:\n\nmenuTemplates/menuMain.js\n\nmenuTemplates/browseForFileModel,js\n\nmenuTemplates/editUrl.js\n\nWhere each file contains the correct menu depending on where the user 'is' in the app and what they are trying to do.\n\nCould someone point me in the right direction for how to achieve this? Should each of those .js files be a module? If so what and how to export the json?\n\nI wish that Menu.buildFromTemplate() would just accept a path. That would make life so much simpler.\nThanks!" ]
[ "node.js", "menu", "electron" ]
[ "ruby's \"any?\" and \"all?\" methods behaviour on Empty Arrays and Hashes", "First of all I found two useful articles in documentations about these methods:\n\nhttp://www.ruby-doc.org/core-1.9.3/Enumerable.html\nhttp://www.globalnerdy.com/2008/01/29/enumerating-rubys-enumerable-module-part-1-all-and-any/\n\n\nall?: Passes each element of the collection to the given block. The method returns true if the block never returns false or nil.\nany?: Passes each element of the collection to the given block. The method returns true if the block ever returns a value other than false or nil.\n\nBut in case of empty arrays and hashes I got:\nirb(main):004:0> [nil, "car", "bus"].all?\n=> false\nirb(main):005:0> ["nil", "car", "bus"].all?\n=> true\nirb(main):006:0> [].all?\n=> true\nirb(main):007:0> ["nil", "car", "bus"].any?\n=> true\nirb(main):008:0> [nil, "car", "bus"].any?\n=> true\nirb(main):009:0> [nil].any?\n=> false\nirb(main):010:0> [].any?\n=> false\n\nCan somebody explain to me why empty arrays give me false in case of the any? method and true in case of all??" ]
[ "ruby-on-rails", "ruby", "enumeration" ]
[ "Can/Should custom $resource action methods be tested?", "In a angular service I have $resource action methods such as :\n\nclass FooService {\n /*@ngInject*/\n constructor($resource) {\n this.Foo = $resource('/foo/:fooId/',\n {fooId: '@fooId'},\n {\n bar: {\n method: 'GET',\n url: '/foo/:fooId/bar/',\n isArray: true\n }\n );\n }\n getAllFoo() {\n return this.Foo.query();\n }\n}\n\n\nis bar testable ? \n\nI already have tests for methods such as getAllFoo(), but I am not so sure about $resource action methods. \n\nIs it ok to use them directly in controller, as in\nthis.FooService.Foo.bar(params).$promise.then ?\n\nShould they be tested ?\nAnd if so, how ?\n\nEDIT:\nI know how to test getAllFoo() :\n\ndescribe('FooService', () => {\n let $rootScope, $resource, $httpBackend, $log, $interval;\n let makeFooService, translateMock;\n let mockAllFoo = [\n {\"id\": 123,\"stuff\": \"asdf asdf\"},\n {\"id\": 124,\"stuff\": \"hjghjg\"}\n ];\n\n beforeEach(window.module(FooModule.name));\n\n beforeEach(inject((_$rootScope_, $q, _$resource_, _$httpBackend_, _$log_) => { \n $rootScope = _$rootScope_;\n queryDeferred = $q.defer();\n $resource = _$resource_;\n $httpBackend = _$httpBackend_;\n $log = _$log_; \n translateMock = { use: () => ({}) }; \n makeFooService = () => new FooService(_$resource_);\n }));\n\n afterEach(function() {\n $httpBackend.verifyNoOutstandingExpectation();\n $httpBackend.verifyNoOutstandingRequest();\n });\n describe('Service', () => {\n it('has a resource-property [Foo]', () => {\n let service = makeFooService();\n expect(service.Foo).not.toBeNull();\n });\n\n it('should load all foos when getAllFoo() is called', () => {\n $httpBackend.expect('GET', /(.+)\\/foo/).respond( () => [200, mockAllFoo, 'success'] );\n let service = makeFooService();\n let allFoo = service.getAllFoo();\n $httpBackend.flush();\n expect(allFoo.length).toBe(2);\n });\n\n\nSo I know how to test getAllFoo() but not how to test bar();\nIf bar is testable and usable in a controller directly, then I dont see the point of doing methods such as getAllFoo() that are simply wrapper around $resource action methods. I need clarifications on the best practices here." ]
[ "angularjs", "unit-testing", "ecmascript-6", "jasmine" ]
[ "ASP NET CORE Entity Framework Select with GroupBy Id", "I build a service to call query like this\n\nselect quotaId, sum(quota)\nFrom leaveQuota\ngroup by quotaId\n\n\nI getting problem in sum and group. How to do it in Entity Framework\ni tried this\n\npublic async Task<List<LeaveTypeModel>> GetLeaveQuota(string employeeId)\n{\n var leaveQuota = await DB.EmployeeLeaveQuota\n .Where(Q => Q.EmployeeId == employeeId && Q.ValidUntil >= DateTime.UtcNow)\n .Select(Q => new LeaveTypeModel\n {\n EmployeeLeaveQuotaTypeId = Q.EmployeeLeaveQuotaTypeId,\n QuotaDays = Q.QuotaDays\n })\n .ToListAsync();\n\n return leaveQuota;\n }\n\n\nmy model\n\npublic class LeaveTypeModel\n{\n public int EmployeeLeaveQuotaTypeId { set; get; }\n public int QuotaDays { set; get; }\n}\n\n\nif i use .GroupBy i cant return it as my model and i have no idea to sum my quotadays column\n\ni know it is a basic query, but i'm not familiar yet with entity framework and asp.net core to return its data" ]
[ "asp.net", "entity-framework", "linq", "group-by" ]
[ "Interaction between GADTs and ScopedTypeVariables/PatternSignatures", "I'm exploring the 'hackneyed' example of length-indexed vectors, code adapted from Richard Eisenberg's thesis section 3.1\n{-# LANGUAGE GADTs, TypeFamilies, DataKinds, KindSignatures,\n TypeOperators, ScopedTypeVariables #-}\n -- PatternSignatures -- deprecated\n\nimport GHC.Types (Type)\n\ndata Nat = Zero | Succ Nat\ndata Vec :: Type -> Nat -> Type where\n Nil :: Vec a Zero -- E has 'Zero\n (:>) :: a -> Vec a n -> Vec a (Succ n) -- E has 'Succ\ninfixr 5 :>\n\ntype family (+) (n :: Nat) (m :: Nat) :: Nat where\n (+) Zero m = m\n (+) (Succ n') m = Succ (n' + m)\n\nappend :: Vec a n -> Vec a m -> Vec a (n + m)\nappend (Nil :: Vec aa Zero) (w :: Vec aa mm) = w :: Vec aa (Zero + mm)\nappend (x :> (v :: Vec a n')) (w :: Vec a m) = x :> ((append v w) :: Vec a (n' + m))\n\nThe append Nil ... equation is rejected (GHC 8.6.5)\n* Couldn't match type `m' with `n + m'\n `m' is a rigid type variable bound by\n the type signature for:\n append :: forall a (n :: Nat) (m :: Nat).\n Vec a n -> Vec a m -> Vec a (n + m)\n at ...\n Expected type: Vec a (n + m)\n Actual type: Vec a ('Zero + m)\n\nGiving the result type as :: Vec aa mm is also rejected.\n Expected type: Vec a (n + m)\n Actual type: Vec a m\n\nweird because that's accepted (see below).\nWhat I'm really trying to do is use PatternSignatures for the arguments to append. But that extension is deprecated, I have to use ScopedTypeVariables. And that means the tyvars from the signature for append are in scope in the equations. So I've used fresh tyvar names.\nThe GADT gives Nil :: Vec a Zero, so I give that as its pattern signature (with a fresh aa). But it seems GHC can't unify the n from append's signature with the Zero. If I change that equation to either of these, all is happy:\nappend (Nil :: Vec aa nn) (w :: Vec aa mm) = w :: Vec aa (nn + mm)\n\nappend (Nil :: Vec aa nn) (w :: Vec aa mm) = w :: Vec aa (mm)\n\nTo validate those, GHC must be figuring out that Nil :: Vec a Zero and that Zero + m = m from the type family equation for +. So why is it grumpy about the pattern signature with Zero?\n(I was originally trying to give the equations for append purely with PatternSignatures, to see if GHC could infer the signature. That didn't get off the ground.)" ]
[ "haskell", "gadt", "scoped-type-variables" ]
[ "How to add new vector to Keras embedding matrix", "Background\n\nI am using an embedding layer for a categorical data column in Keras.\nMy understanding is that an embedding layer is simply a matrix which consist of trainable vectors, each mapped to an index.\n\nMy problem\n\nAfter training finished, I want to add a new index-vector pair to the embedding matrix.\n(The vector is generated by me, no training involved at this stage.) \n\nHow do I do this?\nI wish to use the newly added embedding in predictions as well.\n\nCode\n\nkeras.layers.Embedding(number_of_categories, embedding_size, input_length=1)\n\n\nI am especially stuck, since number of categories are coded in the model architecture. Is there any way around this?" ]
[ "machine-learning", "keras", "deep-learning", "categorical-data", "embedding" ]
[ "How to get OracleConnection for storing JGeometry to Oracle DB", "I am trying store JGeometry to Oracle database with the following code:\n\n@PersistenceContext\nprivate EntityManager entityManager;\n\n\n...\n\n Session session = entityManager.unwrap(Session.class);\n session.doWork(new Work() {\n\n @Override\n public void execute(Connection connection) throws SQLException {\n\n PreparedStatement ps = connection.prepareStatement(\"UPDATE SAMPLE_AREA SET GEOMETRY=? WHERE ID = \" + sampleAreaId + \" AND SAMPLE_ID = \" + sampleId);\n System.out.println(connection); // prints: org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler@321ca777[valid=true]\n System.out.println(connection.getClass().getName()); // prints: com.sun.proxy.$Proxy125 \n STRUCT obj = JGeometry.store(jGeometry, connection);\n ps.setObject(1, obj);\n ps.execute();\n\n }\n });\n\n\nI am getting java.lang.ClassCastException: com.sun.proxy.$Proxy125 cannot be cast to oracle.jdbc.OracleConnection when calling JGeometry.store.\n\nHow can I get OracleConnection?\n\nI am using \"hibernate.dialect = org.hibernate.dialect.Oracle10gDialect\"" ]
[ "java", "oracle", "hibernate", "exception" ]
[ "Get id of record when create data in rails", "In my Ruby on Rails app i'm creating some data and save it in db, but now i need to get id of record (when saving). I need to get this id, and for this record, in other table create array of record binded for this id (in model i have associations).\n\n PriceList.create(:distributor_id => distributor_id, :brand => brand, :article_nr => num_catalog, :price => price, :quantity => quantity, :waittime => waittime)\n\nclass PriceList < ActiveRecord::Base\n has_many :cross_lists\n belongs_to :distributor\nend\n\n\n\n\nclass CrossList < ActiveRecord::Base\n belongs_to :price_list\nend\n\n\nIt could see as two questions in one, but major is first part." ]
[ "ruby-on-rails", "ruby", "activerecord" ]
[ "Cursor Placement and \"Smart Semicolons\" in MonoDevelop", "i'm trying to get MonoDevelop to a less obnoxious state. i'm coming from FlashDevelop, which is like buttah.\n\nIn MD, i've checked the option to \"Insert matching brace\", but it kills me that the caret/cursor is placed between the resulting braces instead of at the end of them:\n\nDoStuff(|)\n\n\n(where | is my cursor) Since i'm constantly forgetting brackets, i like to set up all of my braces ahead of time, and fill in the content later. So i'll often type \n\nfunction DoStuff()\n{\n}|\n\n\nall in one go. Ideally, the IDE will close my round brace and then the curly one, and my cursor will wind up after that final curly brace. But with MonoDevelop, i wind up with the cursor inside the round braces as soon as i type them. It's aggravating.\n\nIs there a way to force MD to place the cursor after the closing brace (other than turning this feature off and manually typing both braces)?\n\nAlso, i have \"Smart semicolon placement\" checked. If i type\n\nDoStuff()\n\n\ni'd expect a semicolon to be automatically placed at the end of that line. But it's not. Not so smart, if you ask me. Where are these clever semicolons supposed to appear?" ]
[ "ide", "monodevelop" ]
[ "ClientPerfCountersInstaller.exe stopped working, now can't run Azure solution", "I use Visual Studio 2013 with Windows Azure SDK 2.3.\n\nOut of nowhere, after clicking Start without Debugging, my solution took awhile to start, then an error popped up that said that ClientPerfCountersInstaller.exe stopped working. I clicked the Send Information button to send the error to MS, then it exited. \"That's weird,\" I thought. I closed VS, reopened, and tried again. Same thing. Restarted computer, reopened VS, but now, it just hangs while starting the solution (with or without debugging). Azure Compute and Storage Emulators both get started (I can see in the system tray), but nothing else happens. I eventually get the \"this is taking longer than expected\" message from VS.\n\nI tried uninstalling Windows Azure SDK 2.3, then reinstalling it. That didn't work.\n\nI looked in Windows Event Viewer and noticed the following four errors every time I try to start my solution:\n\n\n Application: ClientPerfCountersInstaller.exe Framework Version:\n v4.0.30319 Description: The process was terminated due to an unhandled\n exception. Exception Info: System.ComponentModel.Win32Exception Stack:\n at\n System.Diagnostics.PerformanceCounterLib.RegisterFiles(System.String,\n Boolean) at\n System.Diagnostics.PerformanceCounterCategory.Delete(System.String)\n at\n ClientPerfCountersInstaller.CounterInstaller.ReadConfigAndInstallCounters()\n at ClientPerfCountersInstaller.CounterInstaller.Main(System.String[])\n\n\n|\n\n\n Faulting application name: ClientPerfCountersInstaller.exe, version:\n 1.0.5287.0, time stamp: 0x533b317f Faulting module name: KERNELBASE.dll, version: 6.1.7601.18409, time stamp: 0x5315a05a\n Exception code: 0xe0434352 Fault offset: 0x000000000000940d Faulting\n process id: 0x1918 Faulting application start time: 0x01cf9c5d685efbcd\n Faulting application path:\n C:\\Path-To-Solution\\Dealers.Web.WindowsAzure.Local\\csx\\Debug\\roles\\Dealers.Web\\approot\\bin\\Microsoft.WindowsAzure.Caching\\ClientPerfCountersInstaller.exe\n Faulting module path: C:\\Windows\\system32\\KERNELBASE.dll Report Id:\n a64bfba7-0850-11e4-bd03-b8ca3ac71182\n\n\n|\n\n\n The performance strings in the Performance registry value is corrupted\n when process Performance extension counter provider. The BaseIndex\n value from the Performance registry is the first DWORD in the Data\n section, LastCounter value is the second DWORD in the Data section,\n and LastHelp value is the third DWORD in the Data section.\n\n\n|\n\n\n Unloading the performance counter strings for service windows azure\n caching:client (windows azure caching:client) failed. The first DWORD\n in the Data section contains the error code.\n\n\nHow did this happen? Does it sound like a file or entry or something just got randomly corrupted?" ]
[ "windows", "azure", "visual-studio-2013" ]
[ "how to improve autosuggest/complete in blackberry + java", "I am facing lot of issues while implement the auto suggest :I will tell you my issues .\n\n1) Focus is always comes on auto suggest /complete field.First there is button .But focus is also on autosuggest field as shown in figure\n\n\n\n2) When I write m on auto suggest field monday is display when I click the track pad it display monday on autosuggest field But Monday of pop up is not hide.\n\n\n\n3) what is this encircle .How to change is gray color (or remove this color).some times it display on whole field and some time on half field\n\n\n\n4) I just want a auto suggest with fix width not whole width .Like this on a screen with black background and autosuggest (edit field have white background no gray when focus comes on auto suggest)\n\n\nExample\n\nLabel Auto suggest\n\nDays Auto-complete of days\n\npublic final class MyScreen extends MainScreen implements JsonObserver\n{\n /**\n * Creates a new MyScreen object\n */\n public MyScreen()\n { \n // Set the displayed title of the screen \n setTitle(\"Drop-down List Demo\"); \n\n VerticalFieldManager vfm=new VerticalFieldManager(){\n protected void sublayout(int maxWidth, int maxHeight) {\n // TODO Auto-generated method stub\n super.sublayout(maxWidth, maxHeight);\n setExtent(maxWidth, maxHeight/2);\n }\n protected void paint(Graphics graphics) {\n\n // TODO Auto-generated method stub\n graphics.setColor(Color.BLACK);\n graphics.fillRect(0, 0, Display.getWidth(), Display.getHeight()/2);\n super.paint(graphics);\n }\n };\n\n vfm.add(new ButtonField(\"add\"));\n\n BasicFilteredList filterList = new BasicFilteredList();\n String[] days = {\"Monday\",\"Tuesday\",\"Wednesday\",\n \"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"};\nfilterList.addDataSet(1,days,\"days\",BasicFilteredList.COMPARISON_IGNORE_CASE);\n\n AutoCompleteField autoCompleteField = new AutoCompleteField(filterList);\n vfm.add(autoCompleteField);\n vfm.add(new ButtonField(\"addpppp\"));\n\n add(vfm);\n\n }\n\n}" ]
[ "blackberry" ]
[ "CodeIgniter: is $_POST already clean for db input?", "This is my first app with CI and I want to know whether $_POST is clean and can I directly insert the data into db?\n\nI have enabled $config['global_xss_filtering'] = TRUE;\n\nThank You." ]
[ "php", "codeigniter" ]
[ "php coding style comparison vs return", "there is two ways or more i can make that function \none why is using more returns and return every time i do not need continue with the function and another way is using\nmore ifs,else ifs, elses,\n\nfunction getCountOfWhatEverMethodType1\n{\n $return = false;\n // ----\n if($user->isLogged)\n {\n if(getDBOBlaBla->equal(1))\n {\n $return = 2;\n }\n else if(getDBOBlaBla->equal(2))\n {\n $return = 3;\n }\n else\n {\n $return = 1;\n }\n }\n // ----\n return $return;\n}\n\nfunction getCountOfWhatEverMethodType2\n{\n if(!$user->isLogged)\n {\n return false;\n }\n $return = 1;\n // ----\n if(getDBOBlaBla->equal(1))\n {\n $return = 2;\n }\n else if(getDBOBlaBla->equal(2))\n {\n $return = 3;\n }\n // ----\n return $return;\n}\n\n\nwith one i should use and why?" ]
[ "php", "if-statement", "coding-style", "return" ]
[ "MongoDb C# Driver 2.0 add item to nested array", "I have a Profiles document collection with array of the following documents :\n\npublic class Profile2MailList\n{\n\n\n [BsonElement(elementName: \"listId\")]\n [BsonRequired]\n public int MailListId;\n\n [BsonElement(elementName: \"status\")]\n [BsonRequired]\n public int Status;\n\n [BsonElement(elementName: \"subscriptionDate\")]\n [BsonRequired]\n public DateTime SubscriptionDate;\n} \n\n\nin each Profile.\nI need to add to the Profile2MailList array a new Profile2MailList document in each Profile based on Profile2MailList which already contains in a certain Profile. So i need to \n\n\nTake needed profiles from Profiles collection \nUpdate\nProfile2Maillist array in each Profile \nRun update command\nHow can i perform that action via C# 2.0 MongoDb Driver. I have MongoDb v 3.0.2.\nI try to make it by the following way :\n\n List<Profile> listProfiles = new List<Profile>();\n foreach (Profile item in profiles)\n {\n item.MailLists.ToList().Add(new Profile2MailList(maillistId, item.MailLists.FirstOrDefault().Status));\n var t = item;\n listProfiles.Add(t);\n }\n dbCollection.UpdateManyAsync(listProfiles)" ]
[ "mongodb", "mongodb-.net-driver", "mongodb-csharp-2.0" ]
[ "Group 4 tables into one, with each table as one column?", "I have 4 tables (A,B,C,D) in Matlab with 102 columns (e.g. X, Y, W, Z), all containing 52000 rows (e.g. 0,1,2,...). \n\nI want to merge them into one big table containing all of the data. \n\nThis is the output I want:\n\n\nT Column_names A B C D \n\n0 X a(0) b(0) c(0) d(0)\n0 Y a(0) b(0) c(0) d(0)\n0 W a(0) b(0) c(0) d(0)\n0 Z a(0) b(0) c(0) d(0)\n1 X a(1) b(1) c(1) d(1)\n1 y a(1) b(1) c(1) d(1)\n1 w a(1) b(1) c(1) d(1)\n1 z a(1) b(1) c(1) d(1)\n2 ...\n..." ]
[ "matlab", "grouping", "matlab-table" ]
[ "Why is document.GetElementById returning null", "I've been using document.GetElementById() successfully but from some time on I can't make it work again.\nlook at the following Code:\n <html>\n <head>\n <title>no title</title> \n <script type="text/javascript">\n document.getElementById("ThisWillBeNull").innerHTML = "Why is this null?";\n </script>\n </head>\n <body>\n <div id="ThisWillBeNull"></div>\n </body>\n </html>\n\nI am getting document.getElementById("parsedOutput") is null all the time now.\nIt doesn't matter if I use Firefox or Chrome, or which extensions I have enabled, or what headers I use for the HTML, it's always null and I can't find what could be wrong." ]
[ "javascript", "getelementbyid" ]
[ "how to return inputBox using groovy (jenkins)", "I use the jenkins with active choices parameter\nI need that groovy depends on my choice return area where I can write something\nI try this \n\nif (test_bench_UID.equals('user_spec')) { inputBox = \"<input name='value' class='setting-input' type='text'>\" return inputBox }\n\n\nWhere test_bench_UID is name active choices parameter, user_spec is parameter after choosing whom groovy should return input box" ]
[ "jenkins", "groovy", "jenkins-plugins", "jenkins-groovy" ]
[ "Using PHP to stop direct traffic to confirmation page", "I am trying to apply php to stop direct access to our sites confirmation page (Thank You page). We are under the impression that our affiliates may be triggering the conversion pixel to fire by visiting our confirmation page using its URL. This is making it appear that they have gotten us more payments than they actually did. We only want people to visit the page if they have completed a purchase. \nWhat I am currently attempting is to make it so they can only access the page if redirected from the URL that our form is hosted from. The problem I am running into is the link is always unique to each customer that makes a purchase.\nHowever they all begin the same. I am unaware how to make it so it looks if the redirect url starts with a particular thing and basically ignores the following characters as they are always unique. I am inexperienced with php and the code I was able to find only looks for an exact match.\n\n<?php\n// This is to check if the request is coming from a specific URL\n$ref = $_SERVER['HTTP_REFERER'];\n\nif($ref !== 'http://example.com/page.html') {\n die(\"Hotlinking not permitted\");\n}\n\necho \"Executing code here\";\n?>\n\n\nHopefully I am on the right track. \nThank You in advance for any help on the matter." ]
[ "php", "redirect" ]
[ "Logging in backup file using ETW", "Is there any way I can use Microsoft.Diagnostic.Tracing.EventSource package or any other .NET built in types to implement a back up logic for logging? \n\nI have used an EventSession that directs all logs to an .ETL file but there are two problems with this: \n\n\nThe most important one is that, from what I understand, the logs are actually being written to the file when the processing stops. But what happens if the machine shuts down or the processor process gets killed? From my tests the logs are lost. \nThe second problem is less important and it's just that it would be more convenient for my solution to be able to read from the file as logs are coming in.\n\n\nBasically I would like to have a file buffer for my logs and I was wondering if there's some built in implementation especially for this." ]
[ "c#", "logging", "etw" ]
[ "Select date and jquery event occurs automatically", "I want to call a jquery when i select a date. I was using $().change(function{}) for the select tags but its not working for the date. Any help would be appreciated.\n\n$(\"#ChangeMonth\").????(function()\n{\n})\n\n\nhtml:\n\n<input id=\"ChangeMonth\" class=\"datepicker\" style=\"font-family: calibri; font-size: 18px; margin-top:47px; margin-left: 14px; width: 160px; height: 24px;\" />" ]
[ "jquery", "date" ]
[ "Best way to point to vector members received as function parameters", "First time I'm posting to stack so if I'm not following the correct procedure, instruct me to do better and I will. \n\nOk, I have quite a big project with lots of classes and I cannot share code at this point, but if necessary I will write a dummy file to further explain. Hopefully I will be clear enough without that. \n\nI have this class method that receives as params a vector: std::vector< myClass > &objects_1. \nSome of these will be bound (logically) to other objects in the class. The important thing to keep in mind is that I have to modify some of the received objects_1 without using the vector indexing (as it may change along the way)\n\nAlso unfortunately it is relevant for the function to have this exact signature.\n\nThe way I do it now is by having several pointers initialized with nullptr that, sooner or later point to elements of the objects_1 vector. \n\nMy questions are: is this a bad practice? Do I have to delete the pointer or does the destructor takes care of this? Is there a better way to do this? I tried std::shared_ptr but as someone pointed out these are intended more for allocating memory dynamically." ]
[ "c++" ]
[ "How can i access a MediaPlayer created in a Service from an Activity/Fragment?", "Suppose i have created a MediaPlayer in my Service class...\n\npublic static MediaPlayer mp = new MediaPlayer();\n\n\nHow would i be able to access this instance from an Activity or Fragment?\n\nFor example, if the MediaPlayer was created in an Activity i would be able to access the instance in a Fragment like this...\n\nMainActivity\n\nInitialising MediaPlayer....\n\npublic static MediaPlayer mp = new MediaPlayer();\n\n\nFragment\n\nAccessing MediaPlayer from Fragment...\n\nprivate MediaPlayer mp = ((MainActivity)getActivity()).mp;\n\n\nQuestion: Can i access a MediaPlayer instance created in a Service class from a Fragment, in the same way as shown above?" ]
[ "java", "android", "android-fragments" ]
[ "c++ aligning the same word in a text file in different lines/positions to the same position in each line", "I am wondering how to go through a text file and locate a given word (\"foobar\") at different locations within each line but then realign the word to the same position in a new text file, let me know if this doesn't make sense.\n\n***in text file***\n1 foobar baz\n2 foobar baz\n3 foobar baz\n\n****out text file***\n1 foobar baz\n2 foobar baz\n3 foobar baz" ]
[ "c++", "file", "io", "text-alignment" ]
[ "How do you represent log base 100 (n) with big O, theta, omega", "I'm having trouble finding out if log base 100 (n) in O(log(n)), Omega(log(n)), or Theta(log(n)).\n\nI think it's in O(log(n)) and only O(log(n)) because at most the function will have an upper asymptotic bound at log(n) but because the rate of change of log base 100 n is smaller than log(n), it can't have a lower bound at log(n).\n\nI'm new to big O, Omega, Theta though and am curious if my answer is correct." ]
[ "big-o" ]
[ "How to handle redirects with the safebrowsing - api?", "I have a website that allows others to share urls. To make sure noone enters \"evil\" sites I use the google safebrowsing api:\n\n $url = 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key='.$key;\n $data = array(\n 'client' => array('clientId'=> $clientId, 'clientVersion'=>'0.1'),\n 'threatInfo' => array(\n 'threatTypes'=>array('MALWARE', 'SOCIAL_ENGINEERING','UNWANTED_SOFTWARE'),\n 'platformTypes'=> array('ANY_PLATFORM','ALL_PLATFORMS', 'ANDROID','WINDOWS','IOS','OSX','LINUX'),\n 'threatEntryTypes'=> array('URL'),\n 'threatEntries' => array('url'=>$tsturl)\n ),\n );\n $data_json=json_encode($data);\n $ch=curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($ch);\n curl_close($ch);\n\n\nThis works as designed. So if I add a phishing site like thisisevil.com the api-call returns a warning. \n\nBut if someone uses an url shortener like tny.sh/abcefg which then redirects to thisisevil.com the safebrowsing-api does not show me there is a threat.\n\nIs there a way to tell the secure browsing api to follow redirects?" ]
[ "php", "google-api", "safe-browsing-api" ]
[ "Android Kotlin 'Cannot infer type parameter T'", "I just converted from java to kotlin and faced some issues from\nviewDataBinding = DataBindingUtil.inflate(inflater, layoutId, container, false)\nAny idea for this?\n\nCannot infer type parameter T in fun <T : ViewDataBinding!> inflate(p0: LayoutInflater, p1: Int, p2: ViewGroup?, p3: Boolean): T!\nNone of the following substitutions\n(LayoutInflater,Int,ViewGroup?,Boolean)\n(LayoutInflater,Int,ViewGroup?,Boolean)\ncan be applied to\n(LayoutInflater,Int,ViewGroup?,Boolean)\n\n\r\n\r\nabstract class BaseFragment<T : ViewDataBinding?, V : BaseViewModel<*>?> : Fragment() {\n var baseActivity: BaseActivity<*, *>? = null\n private var rootView: View? = null\n var viewDataBinding: T? = null\n private var VM: V? = null\n\n /**\n * Override for set binding variable\n *\n * @return variable id\n */\n abstract val bindingVariable: Int\n\n /**\n * @return layout resource id\n */\n @get:LayoutRes\n abstract val layoutId: Int\n\n /**\n * Override for set view model\n *\n * @return view model instance\n */\n abstract val viewModel: V\n\n override fun onAttach(context: Context) {\n super.onAttach(context)\n if (context is BaseActivity<*, *>) {\n baseActivity = context\n context.onFragmentAttached()\n }\n }\n\n override fun onCreate(savedInstanceState: Bundle?) {\n super.onCreate(savedInstanceState)\n VM = viewModel\n setHasOptionsMenu(false)\n }\n\n override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {\n viewDataBinding = DataBindingUtil.inflate(inflater, layoutId, container, false)\n rootView = viewDataBinding?.root\n return rootView\n }\n\n override fun onDetach() {\n baseActivity = null\n super.onDetach()\n }\n\n override fun onViewCreated(view: View, savedInstanceState: Bundle?) {\n super.onViewCreated(view, savedInstanceState)\n viewDataBinding?.setVariable(bindingVariable, VM)\n viewDataBinding?.executePendingBindings()\n }\n\n interface Callback {\n fun onFragmentAttached()\n fun onFragmentDetached(tag: String?)\n }\n}\r\n\r\n\r\n\n\r\n\r\nabstract class BaseViewModel<N>(val dataManager: DataManager, val schedulerProvider: SchedulerProvider) : ViewModel() {\n private var mNavigator: WeakReference<N>? = null\n private var mCompositeDisposable: CompositeDisposable?\n override fun onCleared() {\n mCompositeDisposable!!.dispose()\n super.onCleared()\n }\n\n fun setNavigator(navigator: N) {\n mNavigator = WeakReference(navigator)\n }\n\n val navigator: N?\n get() = mNavigator!!.get()\n\n var compositeDisposable: CompositeDisposable?\n get() {\n if (mCompositeDisposable == null || mCompositeDisposable!!.isDisposed) {\n mCompositeDisposable = CompositeDisposable()\n }\n return mCompositeDisposable\n }\n set(compositeDisposable) {\n mCompositeDisposable = compositeDisposable\n }\n\n init {\n mCompositeDisposable = CompositeDisposable()\n }\n}" ]
[ "android", "kotlin", "android-viewmodel" ]
[ "Turning an Integer into a Base 10/Decimal System format?", "As part of my Cryptography Module's CW, I need to use the Extended Euclidean Algorithm to calculate the Greatest Common Denominator, GCD, of two BigIntegers. I've done this, it's easy and I know my code works.\n\nHowever, there's a further specification that:\n\n\n Compute the Extended Euclidian algorithm for the following inputs and provide (d, s, t) in decimal system format in a text file with one line per number.\n\n\nI'm assuming they're asking me to write a file with 3 lines, a line representing each of the outputs converted from an integer representation to a base 10 representation, ie:\n\n\n (1 x 100,000 (10^5)) + (2 x 10,000 (10^4)) + (6 x 1000 (10^3)) + (3 x 100 (10^2)) + (2 x 10 (10^1)) + (5 x 1) = 126,325\n\n\nIs my interpretation correct? What's the best way to go about doing this?" ]
[ "java", "decimal", "base", "greatest-common-divisor" ]
[ "Zingchart - some points are hidden in the graph", "I use Zingchart to plot some log Data therefore I need to display every single point in the graph. I activated the points attribute in the json(see \n\n\r\n\r\n$scope.graphoptions = {\r\n theme:\"dark\",\r\n \"gui\":{\r\n behaviors:[]\r\n },\r\n\r\n globals: {\r\n shadow: false,\r\n fontFamily: \"Helvetica\"\r\n },\r\n type: \"line\",\r\n plot: {\r\n aspect: \"segmented\",\r\n marker: {}\r\n },\r\n \"legend\":{\r\n margin :\"5% 88%\",\r\n layout: \"float\",\r\n fontSize : \"10px\",\r\n backgroundColor: \"#888888\",\r\n borderColor : \"#000000\",\r\n shadowColor : \"transparent\",\r\n toggleAction: \"hide\",\r\n item: {\r\n markerStyle : \"circle\",\r\n fontColor: \"#ffffff\"\r\n },\r\n },\r\n scaleX: {\r\n zooming: true,\r\n item: {\r\n fontColor: \"white\"\r\n },\r\n guide: {\r\n visible: false\r\n },\r\n \"transform\": {\r\n \"type\": \"date\",\r\n \"all\": \"%G:%i\",\r\n }\r\n },\r\n\r\n \"scaleY\": {\r\n zooming:true,\r\n lineColor : \"#DDD\",\r\n tick : {\r\n lineColor : \"#DDD\"\r\n },\r\n item : {\r\n fontColor : \"#DDD\"\r\n },\r\n refLine : {\r\n lineColor : \"#DDD\"\r\n },\r\n },\r\n\r\n tooltip : {\r\n //we have to store the tooltip fkt globally so its ouside angulars\r\n //scope thatswhy we have to pass the data to the function\r\n jsRule : \"applyTooltip(\"+$scope.fileName+\")\",\r\n shadow:false\r\n },\r\n\r\n plotarea: {\r\n \"adjust-layout\":true,\r\n backgroundColor : '#272822'\r\n },\r\n }\r\n\r\n\r\n\n\nfor full json).\n\nAs you can see in this screenshot \n\nSome points of the read Graph are drawn but none of the blue one.\nWhen I zoom in:\n\n\n\nSome markers of the Blue graph are displayed. \nIs this a bug or do I have to activate an other attribute in the json I am not aware of.\n\nThanks in advance!" ]
[ "javascript", "charts", "zingchart" ]
[ "PyQt5 Can i remove Progress from Statusbar when Checkbox is uncheckd?", "So i'am new to PyQt5 and i'am trying to remove progress from the status bar when the Checkbox is unchecked. Now, when i hit the Checkbox and check it, the status bar set the progress 1 step forward.But when i unchecked the status bar, the progress is still set on the steps from forward. \nhere is my code to this.\n\ndef deactivate_header(self, state):\n if state == QtCore.Qt.Checked:\n self.ui.headerText.setDisabled(True)\n self.ui.fBar.setValue(25)\n else:\n self.ui.headerText.setDisabled(False)\n self.ui.fBar.setValue(-25)\n\n\nCan someone help me?" ]
[ "python", "editor", "pyqt5", "statusbar", "progress" ]
[ "nHibernate Multiple table mapping with where clause or multipe column mapping", "I'm trying to translate a table \"RoomType\".\n\nI create a \"Texts\" table that contains:\n\nId, LangID, TranslatedText\n001, EN, Single\n001, IT, Singola\n002, EN, Double\n002, IT, Doppia\n\n\nThis is the DB Schema\n\n\nThe table RoomType contains:\nID, TextID, MaxBed\n01, 001, 1\n02, 002, 2\n\nI need to create an nHibernate Mapping that join RoomType and Text and permit to load RoomType queing Text with WHERE clause on LandID = CurrentLanguage.\n\nThis is a little mapping but I do not know how I can go next:\n\npublic class RoomTypeaMap : ClassMapping<RoomType>\n {\n public RoomTypeaMap()\n {\n Join(\"Texts\", el =>\n {\n el.Key(k => k.Column(\"TextID\"));\n });\n }\n }\n\n\nAs an alternative I can add a column for every language\n\n\n\nIn this scenario I need that the mapping Gets the localized name of the roomtype from and (preferring) to different column.\n\nSomething like this:\n\npublic class RoomTypeaMap : ClassMapping<RoomType>\n {\n public RoomTypeaMap()\n {\n Property(el => el.Name, m =>\n {\n m.Formula(\"Name_\" + currentLanguage);\n });\n }\n }\n\n\nI found this interesting post but it not help me:\nhttp://nhforge.org/wikis/howtonh/localization-techniques.aspx\n\nThank You for your help!!" ]
[ "asp.net", "nhibernate", "orm", "mapping", "translation" ]
[ "Rails FB GRAPH image not displaying", "I'm working on Rails app using Facebook Graph everything was working fine and then suddenly images stop loading for user_pages, i debug and found the following error,\n\n{\n \"error\": {\n \"message\": \"The 'manage_pages' permission must be granted before impersonating a user's page.\",\n \"type\": \"OAuthException\",\n \"code\": 190\n }\n}\n\nAny idea why it start happening. Please see attached screen-shot \n\nThanks" ]
[ "ruby-on-rails", "facebook", "fbconnect" ]
[ "How to display an initial value in the text field?", "I load the form. I need to in the text field city shows the initial value. \n\nmodels: \n\nclass City(models.Model): \n city = models.CharField(\n max_length=40, blank=True,\n ) \n\nclass UserProfile(User): \n family = models.CharField(\n 'Фамилия', max_length=30, blank=True, null=True,\n )\n city = models.ForeignKey(\n City, verbose_name='Город', max_length=50, blank=True, null=True,\n )\n\n\nforms: \n\nclass PersonalDataForm(forms.ModelForm):\n city = forms.CharField(\n label='Город',\n required=False,\n ) \n\n class Meta:\n model = UserProfile\n fields = (\n 'family', \n ) \n\n def save(self):\n obj = super(PersonalDataForm, self).save(commit=False)\n city_name = self.cleaned_data.get('city', None).strip() \n\n if city_name:\n if City.objects.filter(city=city_name).exists():\n obj.city = City.objects.get(city=city_name)\n else:\n rec = City(city=city_name)\n rec.save()\n obj.city = rec \n else:\n obj.city = None \n\n return obj.save()\n\n\nviews: \n\ndef personal_data_page(request):\n entry_user_profile = UserProfile.objects.get(user_ptr_id=request.user.id)\n form = PersonalDataForm(instance=entry_user_profile)\n\n if request.method == 'POST':\n form = PersonalDataForm(request.POST, instance=entry_user_profile)\n if form.is_valid(): \n form.save() \n return HttpResponseRedirect('/userprofile/personal_data_page_changed/') \n\n t = loader.get_template('personal_data_page.html')\n c = RequestContext(request, {\n 'form': form,\n }, [custom_proc])\n return HttpResponse(t.render(c)) \n\n\ntemplate.html: \n\n{{ family.city }}\n{{ form.city }}\n\n\nthe problem is that when loading the form field 'city' is empty. but it must contain the value from the table (table full of values​​)" ]
[ "python", "django" ]
[ "Javascript slice string by symbols", "How can I get from this html code\n\n<a href=\"www.realy-long-link.com\">Link<a>\n\n\nHref value looking like this - Realy Long Link and append it into body.\n\nHere is what I done now.\n\n$(\"a\").hide();\n$(\"body\").append($(\"a\").attr(\"href\"));\n\n\nGoal is:\n\n\nRemove www. at the start and .com at the end. \nSymbol - replace with space. \nUpercase each first character\n\n\nYou can edit my codepen http://codepen.io/anon/pen/YWzJXM?editors=1010" ]
[ "javascript", "jquery" ]
[ "LitElement How to monitor the child dom and change styling", "So I have a custom element and I need to update it's styles based on a change to it's child content. For instance:\n\n<my-element>\n <!-- When child content here changes I want to update styling --!>\n</my-element>\n\n\nHow would I monitor the DOM changes to child content in my element? For instance, lets say if the child content contained the string anywhere with \"hello\" in it, then I would change the custom element styling:\n\n<my-element>\n <span>Hello in <b>advance</b>!!!</span>\n</my-element>\n\n\nNormally I would use a mutation observer here and scan the dom when changes occured, not sure how to do this correctly with lit-element\n\nThanks in advance!\n\nUPDATE\n\nSo I did hack together a solution using a mutation observer. Thoughts?\n\nfirstUpdated() {\n var shadow = this.shadowRoot;\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n console.log(mutation);\n });\n });\n\n// configuration of the observer:\n var config = { attributes: true, childList: true, characterData: true, subtree: true }\n\n// pass in the target node, as well as the observer options\n observer.observe(shadow, config);\n }" ]
[ "javascript", "web-component", "lit-element" ]
[ "Can Flask's redirect be used without url_for?", "After following a tutorial, I have two views in my auth blueprint. I am confused over the different uses of redirect. The first view uses redirect(url_for()) but the second omits url_for. Why is this? Is it not enough to use just redirect('blueprint_name.route_name')?\n\nreturn redirect(url_for('auth.unconfirmed'))\n\n\n\n\nreturn redirect('main.index')" ]
[ "python", "flask" ]