texts
sequence
tags
sequence
[ "How to set date of a datepicker in Appcelerator dynamically?", "I'm wondering how I can set the selected date of a date picker for ipad/iphone using Appcelerator? \n\nI have a views/dates.xml: \n\n<Window onOpen=\"setDates\">\n<Picker id=\"picker\" type=\"Ti.UI.PICKER_TYPE_DATE\"></Picker>\n</Window>\n\n\nIn my controllers/dates.js:\n\nfunction setDates(){\n //Here I want to retrieve my existing picker and set the selected date to something else. \n //For example: \n $.picker.setDate(new Date(\"2017-03-03\"));\n} \n\n\nUnfortunately, the above setDate-function does not work. I can still load the view and the datepicker will be shown, but it will still show the default date of today." ]
[ "datepicker", "appcelerator", "appcelerator-titanium", "appcelerator-alloy" ]
[ "CloseHandle after process does not exist", "I have made a quick example.\n\nI just want to know if i need to close the handle before i re attach it to the new process?\n\nDWORD g_dwPid = 0;\nHANDLE g_hProcess;\nint _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) {\n\n while (TRUE) {\n\n DWORD dwPid = GetProcessIdByName(L\"explorer.exe\");\n if (dwPid && dwPid != g_dwPid) {\n g_dwPid = dwPid;\n\n g_hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, g_dwPid);\n }\n else\n CloseHandle(g_hProcess);\n\n Sleep(500);\n }\n return 0;\n}" ]
[ "c++" ]
[ "Find the Longest String in Multiple Texts", "I have the following problem. There are two given text and I need to find the longest string that occurs in both. I think we should create a string array where we should put common strings and then compare their length and which length will be largest print. Is there a fast method to this?" ]
[ "algorithm" ]
[ "Bash script that prints out contents of a binary file, one word at a time, without xxd", "I'd like to create a BASH script that reads a binary file, word (32-bits) by word and pass that word to an application called devmem.\n\nRight now, I have:\n\n...\nfor (( i=0; i<${num_words}; i++ ))\ndo\n val=$(dd if=${file_name} skip=${i} count=1 bs=4 2>/dev/null)\n echo -e \"${val}\" # Weird output...\n devmem ${some_address} 32 ${val}\ndone\n...\n\n\n${val} has some weird (ASCII?) format character representations that looks like a diamond with a question mark.\n\nIf I replace the \"val=\" line with:\n\nval=$(dd ... | xxd -r -p)\n\n\nI get my desired output.\n\nWhat is the easiest way of replicating the functionality of xxd using BASH?\n\nNote: I'm working on an embedded Linux project where the requirements don't allow me to install xxd.\n\nThis script is performance driven, please correct me if I'm wrong in my approach, but for this reason I chose (dd -> binary word -> devmem) instead of (hexdump -> file, parse file -> devmem).\n- Regardless of the optimal route for my end goal, this exercise has been giving me some trouble and I'd very much appreciate someone helping me figure out how to do this.\n\nThanks!" ]
[ "linux", "bash", "binary", "hexdump", "xxd" ]
[ "Preferential attachment: Selecting a node to attach", "I've been struggling with this one for the last 24 hours or so I feel like I'm missing something relatively simple here.\n\nto setup-scale-free-network\n\n clear-all\n ;; Make a circle of turtles\n set num-nodes (num-children + num-adults + num-toddlers)\n create-children num-children\n create-adults num-adults\n create-toddlers num-toddlers \n\n layout-circle turtles (max-pxcor - 8)\n ask turtles[\n create-links-with turtles with [self > myself and random-float 5 < probability]\n\n\n\n ]\n setup \n end\n\nto-report find-partner \n report [one-of both-ends] of one-of links\nend\n\n\nThe above code creates a set number of turtles of various breeds and creates a number of links between these breeds. \n\nto go\n reset-ticks\n make-link find-partner \n\n tick\n end\n\n\nThe two procedures would be called until the needed level of degree distribution as been met.\n\nWhat I want to do is use the find-partner procedure to move towards preferential attachment to do this I need to modify this code to create a link from the node find partner has selected to one of each of the other three types of breeds in my network. \n\nto make-node [old-node]\n crt 1\n [\n set color red\n if old-node != nobody\n [ create-link-with old-node [ set color green ]\n ;; position the new node near its partner\n move-to old-node\n fd 8\n ]\n ]\nend\n\n\nMy own attempts have lead no where to be honest. I know I'm asking for a lot of help but I'm at my wits end here, thank you for your help and patience." ]
[ "simulation", "netlogo" ]
[ "RegEx find word with single digit", "I need to detect words that have special characters @#$ and has less than 2 digits. For example, \"ab3c\", \"a@bc\", \"a@1c\", \"4\", \"a2\", etc. While the first part is easy, I am not sure about the second part. Any help would be highly appreciated.\n\nThanks!" ]
[ "regex" ]
[ "What Is Causing D3 To Not Work Properly In IE10?", "I am working on a large codebase and have been cross-browser testing. Everything works, including IE9, except IE10.\n\nIt uses D3 to create a timeline with a line for the current date, a line for selected date and rectangles for ranges. The problem is that nothing is being created, I cannot post code since it is so big. Any ideas?" ]
[ "d3.js" ]
[ "Web api large file download with HttpClient", "I have a problem with large file download from the web api to the win forms app. On the win form app I'm using HttpClient for grabbing data. I have following code on server side:\n\n[HttpPost]\n[Route]\npublic async Task<HttpResponseMessage> GetBackup(BackupRequestModel request)\n{\n HttpResponseMessage response;\n try\n {\n response = await Task.Run<HttpResponseMessage>(() =>\n {\n var directory = new DirectoryInfo(request.Path);\n var files = directory.GetFiles();\n var lastCreatedFile = files.OrderByDescending(f => f.CreationTime).FirstOrDefault();\n var filestream = lastCreatedFile.OpenRead();\n var fileResponse = new HttpResponseMessage(HttpStatusCode.OK);\n fileResponse.Content = new StreamContent(filestream);\n fileResponse.Content.Headers.ContentType = new MediaTypeHeaderValue(\"application/octet-stream\");\n return fileResponse;\n });\n }\n catch (Exception e)\n {\n logger.Error(e);\n response = Request.CreateResponse(HttpStatusCode.InternalServerError);\n }\n return response;\n}\n\n\non client side:\n\nprivate async void btnStart_Click(object sender, EventArgs e)\n {\n var requestModel = new BackupRequestModel();\n requestModel.Username = txtUsername.Text;\n requestModel.Password = txtPassword.Text;\n requestModel.Path = txtServerPath.Text;\n\n var client = new HttpClient();\n var result = await client.PostAsJsonAsync(\"http://localhost:50116/api/backup\", requestModel);\n var stream = await result.Content.ReadAsStreamAsync();\n var localPath = @\"d:\\test\\filenew.bak\";\n var fileStream = File.Create(localPath);\n stream.CopyTo(fileStream);\n fileStream.Close();\n stream.Close();\n fileStream.Dispose();\n stream.Dispose();\n client.Dispose();\n }\n}\n\n\nThis is actually working, but the purpose of this program is to grab large files over 3GB and save it to the client.\n\nI have tried this on files sized 630MB what I notice is: When I call web api with http client, http client actually loads 630MB in the memory stream, and from the memory stream to the file stream, but when I try to load a different file I'm getting OutOfMemoryException. This is happening because the application doesn't release memory from the previous loaded file. I can see in task manager that it is holding 635MB of ram memory.\n\nMy question is how can I write data directly from HttpClient to file without using memory stream, or in other words how can I write data to file while HttpClient is downloading data?" ]
[ "winforms", "asp.net-web-api", "dotnet-httpclient" ]
[ "How to convert any number to a clojure.lang.Ratio type in Clojure?", "In Scheme I can do:\n\n#;> (numerator 1/3)\n1\n#;> (denominator 1/3)\n3\n\n\nIn Clojure I can do something similar:\n\nuser=> (numerator 1/3)\n1\nuser=> (denominator 1/3)\n3\n\n\nBut in Scheme I can do:\n\n#;> (numerator 0.3)\n3.0\n\n\nand it is not possible in Clojure:\n\nuser=> (numerator 0.3)\n\nClassCastException java.lang.Double cannot be cast to clojure.lang.Ratio clojure.core/numerator (core.clj:3306)\n\n\nHow can I convert a Double (or actually any kind of number) into a clojure.lang.Ratio?\n\nIn Scheme we have also inexact->exact what would be something like \"double to ratio\" in Clojure, but I can't find anything similar to it." ]
[ "math", "clojure", "rational-numbers", "inexact-arithmetic" ]
[ "HTML form authentication to prevent spam / POST attacks", "I am wondering if there's a good solution for preventing automated form submissions / POST attacks.\n\nWould it be possible to add a form field with a token generated server side that would be unique for each form displayed on the site, but with a way to check if this token was indeed generated by my app and not by user, without having to save all tokens to a database?\n\nIMO if app can know that data comes from a form generated by the app (meaning that it used logic only known to the app), than it would go on to process form.\n\nAny suggesting for such an algorithm? \n\nEDIT: In other words, can I generate a string that: \n\n1) when I receive back, I can recognize as string that I generated,\n\n2) know that it's been used only once,\n\n3) would take user too many attempts to generate such string on the client side,\n\n4) this string does not have to be persisted by the application" ]
[ "forms-authentication", "security", "http-post" ]
[ "Short Solution to Sort a C++ Vector of Objects with Dependencies to Each Other?", "I just wrote part of a software where fields are ordered in the correct way for processing. Each field can depend on 0-n other fields. Loops are already checked and prevented in a previous step.\n\nMy current code works, but it is not very elegant. I iterate through the list and move dependent entries to the front, until there is no move required.\n\nHere a minimal example illustrating the problem:\n\n#include <algorithm>\n#include <iostream>\n#include <string>\n#include <vector>\n\nstruct Obj {\n std::string name;\n std::vector<std::string> dependencies;\n};\n\nstd::vector<Obj*> objects;\n\nvoid printObjList(std::string title) {\n std::cout << title << std::endl;\n for (auto obj : objects) {\n std::cout << \"- \" << obj->name << std::endl;\n }\n}\n\nint main()\n{\n objects.push_back(new Obj {\"d\", {}});\n objects.push_back(new Obj {\"a\", {\"c\", \"d\"}});\n objects.push_back(new Obj {\"b\", {}});\n objects.push_back(new Obj {\"c\", {\"e\", \"d\"}});\n objects.push_back(new Obj {\"e\", {\"b\"}});\n printObjList(\"Unsorted\");\n std::stable_sort(objects.begin(), objects.end(), [](Obj *a, Obj *b) {\n return a->name < b->name;\n });\n //std::stable_sort(objects.begin(), objects.end(), [](Obj *a, Obj *b) {\n // ???\n //});\n printObjList(\"Sorted by Dependencies\");\n return 0;\n}\n\n\nPlay with the code here:\nhttp://coliru.stacked-crooked.com/a/902e91b00924a925\n\nAn object which is part of dependencies in another object has to be sorted before this object which contains the reference in the dependencies list.\n\nI assume there is some well known algorithm to solve this kind of problem?" ]
[ "c++", "algorithm", "sorting", "c++11", "std" ]
[ "Copying a working chart from a spreadsheet to a document results with \"All series on a given axis must be of the same data type\"", "I have a Google spreadsheet that contains charts which are properly displayed. When I am using a GAS to copy these charts to a Google document some of the charts are properly displayed in the document while others (which are displayed properly in the spreadsheet) are displaying the message \"All series on a given axis must be of the same data type\". \n\nSince these are working charts I am not sure why I get this message. Is there a workaround to this problem or a known issue?\n\nAny advise will help.\n\nThx!" ]
[ "google-apps-script", "google-sheets", "google-visualization", "google-docs" ]
[ "IIS how to view a file stored on the Physical Path on a locally hosted webpage", "I have been attempting to access some files I have in a local directory via a locally hosted web site using IIS (Internet Information Services Manager).\nThe current file types in the folder are CSS, CSV and HTML.\nI cannot seem to find any data on these sites, however, I believe something is there as when I change the web URL slightly it states "page can’t be found" rather than showing a blank page.\nI have been looking through IIS extensively for a way to make these files ether download/become visible/show file contents/display the HTML\nI have the file system set up as both the main website and as another file, under the Default website (as seen below) however, I cannot get either of these two methods to show me the files or anything for that matter." ]
[ "iis" ]
[ "Search for model with multiple properties (where properties are in a key => value table)", "I have a model called Document, and a has_many relation with DocumentProperty.\n\nDocumentProperty has a id, document_id, key, and value columns. \n\nI'm trying to come up with a query that will let me search for a document with two or more key => value pairs, e.g a document with size = A4 and pages = 2, but I can't find a way to do that without writing all of the SQL myself (currently using an ActiveRecord::Relation).\n\nExample table data:\n\n| document_id | key | value |\n+-------------+--------+---------+\n| 1 | size | A4 |\n| 1 | pages | 2 |\n| 2 | size | A4 |\n| 2 | pages | 3 |\n| 3 | size | A4 |\n| 3 | pages | 2 |\n| 3 | author | Brandon |\n\n\nWith my search, document 1 and 3 should be returned.\n\nDoes Rails support this?" ]
[ "ruby-on-rails", "ruby-on-rails-4" ]
[ "Computing variables before each iteration using the DataSet API in Apache Flink", "I am working with the clustering example provided with Flink (Kmeans) and trying to extend the functionality of it. The goal is to reduce the number of distance computations by computing a multidimensional-array consisting of the distances between each centroid, such that the distances can be found in a double[][] array. This array must be computed at the beginning of each iteration and broadcasted, when the points are assigned clusters.\n\nI have tried the following:\n\npublic static final class computeCentroidInterDistance implements MapFunction<Tuple2<Centroid, Centroid>, Tuple3<Integer, Integer, Double>> {\n\n @Override\n public Tuple3<Integer, Integer, Double> map(Tuple2<Centroid, Centroid> centroid) throws Exception {\n return new Tuple3<>(centroid.f0.id, centroid.f1.id, centroid.f0.euclideanDistance(centroid.f1));\n }\n}\n\nDataSet<Centroid> centroids = getCentroidDataSet(..);\n\nDataSet<Tuple3<Integer, Integer, Double>> distances = centroids\n .crossWithTiny(centroids)\n .map(new computeCentroidInterDistance());\n\n\nHowever, I dont see how the distances DataSet can be used for my use-case as this is not returned in any specific order that can be used to lookup the distances between two different centroids. Is there a better way of doing this?" ]
[ "java", "apache-flink" ]
[ "Overide Defaultappassociations.xml and let user select the application", "I am working on Win 10 upgrade activity. As you know we can select application for file extension. So, those file will open on that app. e.g. html files only open in Chrome when user double click on that.\nWe can create XML file (DefaultAppAssociations.xml) and place it in C:\\windows\\system32\n\nNow, I got the request to make one application default but let user decide if they want any other app. Is there any way to handle such things because defaultappassociations.xml will hard code this. Every time machine restart and it will set the same." ]
[ "windows-10", "sccm" ]
[ "fetching data from mysql db and display on android", "I have to develop one android example.\n\nIts performs the fetching data from mysql database and display on android application.\n\nI have used below webservice code:\n\npublic class EditProfile {\npublic String customerData(String Username,String Password,String Firstname,String Lastname,String Company,String Taxnumber,String Baddress,String Bcity,String Bstate,String Bcountry,String Bzipcode,String Saddress,String Scity,String Sstate,String Scountry,String Szipcode,String Email,String Phone,String Fax,String Url){\n\n String customerInfo = \"\";\n\ntry{\n\nClass.forName(\"com.mysql.jdbc.Driver\");\nConnection con = DriverManager.getConnection(\"jdbc:mysql://10.0.0.75:3306/xcart432pro\",\"root\",\"\");\n PreparedStatement statement = con.prepareStatement(\"SELECT * FROM xcart_customers where login = '\"+Username+\"'\");\n ResultSet result = statement.executeQuery();\n\nwhile(result.next()){\n customerInfo = customerInfo + result.getString(\"login\") + \":\" +result.getString(\"password\")+ \":\" +result.getString(\"firstname\")\n }\n\n }\n catch(Exception exc){\n System.out.println(exc.getMessage());\n }\n return customerInfo;\n }\n\n\nI have used below android code:\n\n public class RetailerActivity extends Activity {\n private final String NAMESPACE = \"http://xcart.com\";\n private final String URL = \"http://10.0.0.75:8085/XcartLogin/services/EditProfile?wsdl\";\n private int i;\n private final String SOAP_ACTION = \"http://xcart.com/customerData\";\n private final String METHOD_NAME = \"customerData\";\n\n String str,mTitle;\n /** Called when the activity is first created. */\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n try {\n SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); \n SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);\n\n envelope.setOutputSoapObject(request);\n\n HttpTransportSE ht = new HttpTransportSE(URL);\n\n ht.call(SOAP_ACTION, envelope);\n\n SoapPrimitive s = response;\n str = s.toString();\n String[] words = str.split(\":\");\n TextView tv = (TextView) findViewById(R.id.user);\n tv.setText(Username);\n\n EditText tv1 = (EditText) findViewById(R.id.pass);\n\n\n tv1.setText(words[1].toString());\n EditText tv2 = (EditText) findViewById(R.id.tf_userName);\n\n\n tv2.setText(words[2].toString());\n\n for (int i = 0, l = words.length; i < l; ++i) {\n }}\n\n catch (Exception e) {\n e.printStackTrace();\n }\n }}\n\n\nHere i have to run the app means fetching data from mysql database and display the data on android .but i didn't get the response.how can i get it.\n\nHere i have to wrote the condition like static:\n\nSELECT * FROM xcart_customers where login = 'mercy'\"); means fetching the data from mysql database and display the data for that user.its successfully worked.\n\n\nBut i have write the code dynamically means \n\n\"SELECT * FROM xcart_customers where login = '\"+Username+\"'\"); means\n\n\ndidn't get the response.please help me.\n\nHow can i develop these.give me solution or ideas for these." ]
[ "java", "android", "mysql" ]
[ "Is there a way to get a stored procedure signature?", "Let's say we have an Oracle procedure:\nprocedure proc(i_value in number, o_value out varchar2) is\nbegin \n null;\nend proc;\n\nThe output values which are passed to the callproc() function should be initiated by one of the Oracle types (cx_Oracle.NUMBER, cx_Oracle.STRING etc.).\nIn our case a variable, say named out_value, would receive o_value from the procedure and before being passed should be defined like this:\nout_value = cur.var(cx_Oracle.STRING)\n\nIt is OK if we know the signature of the procedure. But what if not?\nIs there a way to get types of the output values of a procedure before calling it?" ]
[ "python", "oracle", "cx-oracle" ]
[ "Python Pandas - groupby() with apply() & rolling() very slow", "First off, I am fairly new to Python & Pandas, so please be patient and reply in as simple terms as possible. Also, if you could elaborate on any code that is different than what I have in my sample or point me to a solid reference that would make it easy to understand, I would greatly appreciate it.\n\nI have a dataframe (df1) of monthly data with 60+ columns & 800k rows (& growing) for 6000+ locations. I am trying to calculate the rolling mean (3 mo, 12 mo, YTD, etc) based on the location license number ('lic_num', int), month ('mo_yr', date). I have been successful in doing this using apply(). The problem is that apply() feels very slow taking 10 min. This isn't a major issue for this project because this wont be something that will need to be run on demand, but I want to become more efficient at writing code similar to this in the case where I need a project to execute faster. Here is a sample of the dataframe (df1) and my code that I use to achieve my results\n\nlic_num mo_yr ap aw fi\n120700142 2013-03-01 228214.3 206273.53 61393.0\n120700142 2013-04-01 256239.4 235296.96 64228.0\n120700142 2013-05-01 247725.3 227165.09 74978.0\n120700142 2013-06-01 229776.8 211765.55 64559.0\n120700142 2013-07-01 229036.2 210963.06 58132.0\n\ndf1_col_list = df1.columns.tolist()\n\nfor col in df1_col_list[2:5]:\n df1[col+'_3mo'] = df1.groupby('lic_num', as_index=False).apply(\n lambda x: x.rolling(3, on='mo_yr', min_periods=1)[col].mean()).reset_index(level=0, drop=True)\n\nlic_num mo_yr ap aw fi ap_3mo aw_3mo fi_3mo\n120700142 2013-03-01 228214.3 206273.53 61393.0 228214.300000 206273.530000 61393.000000\n120700142 2013-04-01 256239.4 235296.96 64228.0 242226.850000 220785.245000 62810.500000\n120700142 2013-05-01 247725.3 227165.09 74978.0 244059.666667 222911.860000 66866.333333\n120700142 2013-06-01 229776.8 211765.55 64559.0 244580.500000 224742.533333 67921.666667\n120700142 2013-07-01 229036.2 210963.06 58132.0 235512.766667 216631.233333 65889.666667" ]
[ "python", "pandas", "pandas-groupby", "pandas-apply" ]
[ "Load JDBC driver for Spark DataFrame 'write' using 'jdbc' in Python Script", "I'm trying to load MySQL JDBC driver from a python app. I'm not invoking 'bin/pyspark' or 'spark-submit' program; instead I have a Python script in which I'm initializing 'SparkContext' and 'SparkSession' objects.\nI understand that we can pass '--jars' option when invoking 'pyspark', but how do I load and specify jdbc driver in my python app?" ]
[ "python", "apache-spark", "pyspark" ]
[ "SQL Server: update a field with divided and multiplied values from other field on the same table", "I want to update a field from my table with a value that comes from:\nTransaction_Count field : 10 x 100\nFor example the Transaction_Count value: 3. Then the calculation should be: 3 : 10 x 100 = 30\n\nBut when I run the code, the result is 0 without leaving error message. As additional information I already created Support field of my Mining table with decimal(18,2) data type. How to get the correct result, can anybody help me?\n\nHere's my code:\n\nSQL = \"Update Mining Set Support = Transaction_Count / 10 * 100\"\nCon.Execute (SQL)" ]
[ "sql", "sql-server", "vb6" ]
[ "Index of a dynamic created list Javascript", "i have a dynamically created list with data of a json.\nSo my question is how to get the index of a clicked item. \n\nI tried this: \n\n$(\"li\").click(function() {\n var index = $(\"li\").index(this);\n alert(index); });\n\n\nBut this didnt work. I dont get an alert? \nIf i create some static Li elements, i get the index of them. \n\nPlease help me :/" ]
[ "javascript", "list", "dynamic", "indexing" ]
[ "Use typeof with a variable", "frmMainPage is a Form in my project.\n\nThis is correct\n\nvar myType = typeof(frmMainPage);\n\n\nThis is incorrect\n\nForm frm = (Form)Activator.CreateInstance(Type.GetType(\"frmMainPage\"), _userName);\n\nvar myType = typeof(frm);\n\n\nHow can I use typeof with a variable?" ]
[ "c#", "types", "gettype" ]
[ "Stop all AudioSources in every scene in Unity", "I want to disable all Audio Sources in unity from my game's main menu and cause it to affect all scenes in the game by clicking on a button. And also I would like to enable it as well by clicking on another button (Mute Button and Un-mute Button). I have managed to accomplished this with AudioListener.pause function. But when I play the sound back with !AudioListener.pause, it acts like it resumed the sound back and plays all the sound that was paused with it creating a messy mixture of sounds. How can I go about this??" ]
[ "unity3d", "game-engine", "game-development" ]
[ "Name of this google service", "I need to implement sports results in my application, google has its soccer results service\nIt is possible to use this service for general use, if that is what it is called, all the information about it I thank you" ]
[ "api", "web-services" ]
[ "Poisson Regression GLM in SAS", "I'm attempting a Poisson Regression general linear model in SAS.\n\nI'm an R user, so I have no idea how to do this stuff in SAS. I'll post the data, along with the code that I've attempted already:\n\n Game Success Attempts\n 1 4 5 \n 2 5 11\n 3 5 14\n 4 5 12\n 5 2 7\n 6 7 10\n 7 6 14\n 8 9 15\n 9 4 12\n 10 1 4\n 11 13 27\n 12 5 17\n 13 6 12\n 14 9 9\n 15 7 12\n 16 3 10\n 17 8 12\n 18 1 6\n 19 18 39\n 20 3 13\n 21 10 17\n 22 1 6 \n 23 3 12\n\n\nI've tried using several different codes on the data, but I keep getting errors.\n\nThis code doesn't work for the initial input:\n\noptions nocenter;\n\ndata freethrows;\n\ninput $attempt $success;\n\ndatalines;\n\n...(this is where I put each attempt and success for each game in each row for 23 rows)\n\n;\n\nrun;\n\n\nThe example on the SAS website is the following:\n\ndata insure;\n\n input n c car$ age;\n\n ln = log(n);\n\n datalines;\n\n 500 42 small 1\n\n 1200 37 medium 1\n\n 100 1 large 1\n\n 400 101 small 2\n\n 500 73 medium 2\n\n 300 14 large 2\n\n ;\n\n run;\n\n\nThe GENMOD procedure is as follows:\n\nproc genmod data=insure;\n\n class car age;\n\n model c = car age / dist = poisson\n\n link = log\n\n offset = ln;\n\n run;\n\n\nI'd like to run a similar analysis on the freethrows." ]
[ "r", "sas", "regression", "poisson" ]
[ "Delphi VCL ShadowEffect like FMX TShadowEffect", "In Firemonkey we can use a TShadowEffect to draw a nice looking shadow.\n\nThis shadow also adjusts its opacity and translucency so it displays the correct component beneath it if a control is overlapping.\n\nWithout TShadowEffect:\n\n\n\nWith TShadowEffect:\n\n\n\nIs there a way to draw the same shadow effect in VCL forms without embedding a FMX form?" ]
[ "delphi", "firemonkey", "vcl", "delphi-xe7" ]
[ "Change Xamarin.Forms .Net Framework target", "I have a Xamarin Forms project and the majority of times that I want to install a nuget package I have an error saying that:\n\nInstall-Package : Could not install package 'Microcharts 0.7.1-pre'. You are trying to install this package into a project that targets \n'.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework.\n\n\nI Assume I can work this out by changing the project .net framework target. But when I go and change it, I get an error saying that it cannot change the target because that implies upgrading nuget to 3.0 and It can´t do that.\n\nSo my question is: Which is the best way(and simplest) to change the target framework so I have less problems like above with nuget packages." ]
[ "c#", "xamarin", "xamarin.forms" ]
[ "Adobe Analytics API JSON query", "I'm looking into how to report multiple breakdowns using the reporting API. Ultimately I would like to make a JSON request that returns top level data, and and second level breakdown data, for all rows of top level data (not just specific rows).\n\nA useful guide is https://github.com/AdobeDocs/analytics-2.0-apis/blob/master/reporting-multiple-breakdowns.md\n\nThis is clearly designed for someone who wishes to write code which, for instance, takes the itemID from the top level response and uses this to retrieve second level breakdown data. Unfortunately I currently just have access to the Swagger UI.\n\nIs there one piece of JSON code I can run (in the UI) that would return both top level data, and the associated second level breakdown data for all top level rows? Or is this only possible if I write some code?" ]
[ "json", "adobe-analytics" ]
[ "How to write nested queries in select clause with slick 3.2 +", "Is there any way to create nested select using slick 3.2+ ?\nBasically all that I need described here How to write nested queries in select clause \n\nHowever on slick 3.2 this approach does not work." ]
[ "scala", "slick" ]
[ "Why is Lambda throttled when invoking from SQS?", "I have an SQS queue that is used as an event source for a Lambda function. Due to DB connection limitations, I have set a maximum concurrency to 5 for the Lambda function. \n\nUnder normal circumstances, everything works fine, but when we need to make changes, we deliberately disable the SQS trigger. Messages start to back up in the SQS queue as expected.\n\nWhen the trigger is re-enabled, 5 Lambda functions are instantiated, and start to process the messages in the queue, however I also see CloudWatch telling me that the Lambda is being throttled.\n\nPlease could somebody explain why this is happening? I expect the available Lambda functions to simply work through the backlog as fast as they can, and wouldn't expect to see throttling due to the queue." ]
[ "amazon-web-services", "aws-lambda", "amazon-sqs" ]
[ "Django - trigger auto_now field change", "I am wondering how to resave the object just to update the auto_now Field. \n\nfamously, this code came to my mind\n\nobj = MyModel.objects.get(id=someid)\nobj.save()\n\n\nbut what if i have many objects to update? or better put, what is the best way to update a object's auto_now field" ]
[ "django", "django-models" ]
[ "How to add attached page/post id in WordPress existing menu", "I would like to add the attached page/post id in the existing menu item. Such as, my home page ID is 15 and I want to add ID inside "a" tag within an attribute. I.E- Home.\nI have tried this accepted answer Wordpress Post ID in wp_nav_menu? and it seems to be working with new menu not existing menu. Any idea?" ]
[ "wordpress", "menu", "menuitem", "wp-nav-walker" ]
[ "Materialized view fast refresh - insert and delete when updating base table", "Hello fellow Stackoverflowers,\nTLDR: Are MVIEWs using UPDATE or DELETE + INSERT during refresh?\nsome time ago I ran into an obscure thing when I was fiddling whit materialized views in Oracle. Here is my example:\n\n2 base tables\nMVIEW logs for both tables\nPKs for both tables\nMVIEW created as a join of these base tables\nPK for MVIEW\n\nHere is an example code:\n-- ========================= DDL section =========================\n\n/* drop tables */\ndrop table tko_mview_test_tb;\ndrop table tko_mview_test2_tb;\n\n/* drop mview */\ndrop materialized view tko_mview_test_mv;\n\n/* create tables */\ncreate table tko_mview_test_tb as\n select 1111 as id, 'test' as code, 'hello world' as data, sysdate as timestamp from dual\n union\n select 2222, 'test2' as code, 'foo bar', sysdate - 1 from dual; \n \ncreate table tko_mview_test2_tb as\n select 1000 as id, 'test' as fk, 'some string' as data, sysdate as timestamp from dual;\n\n/* create table PKs */ \nalter table tko_mview_test_tb\n add constraint mview_test_pk\n primary key (id);\n\nalter table tko_mview_test2_tb\n add constraint mview_test2_pk\n primary key (id);\n\n/* create mview logs */\ncreate materialized view log\n on tko_mview_test_tb\n with rowid, (data);\n \ncreate materialized view log\n on tko_mview_test2_tb\n with rowid, (data);\n \n/* create mview */\ncreate materialized view tko_mview_test_mv\nrefresh fast on commit\nas select a.code\n , a.data\n , b.data as data_b\n , a.rowid as rowid_a\n , b.rowid as rowid_b \n from tko_mview_test_tb a\n join tko_mview_test2_tb b on b.fk = a.code;\n\n/* create mview PK */ \nalter table tko_mview_test_mv\n add constraint mview_test3_pk\n primary key (code); \n\nAccording to dbms_mview.explain_mview my MVIEW if capable of fast refresh.\nWell in this particular case (not in example here) the MVIEW is referenced by an FK from some other table. Because of that, I found out, that when I do a change in one of these base tables and the refresh of MVIEW is triggered I got an error message:\nORA-12048: error encountered while refreshing materialized view "ABC"\nORA-02292: integrity constraint (ABC_FK) violated\n\nI was like What the hell??. So I started digging - I created a trigger on that MVIEW. Something like this:\n/* create trigger on MVIEW */ \ncreate or replace trigger tko_test_mview_trg\n after insert or update or delete\n on tko_mview_test_mv\n referencing old as o new as n\n for each row\ndeclare\nbegin\n if updating then\n dbms_output.put_line('update');\n elsif inserting then\n dbms_output.put_line('insert');\n elsif deleting then\n dbms_output.put_line('delete');\n end if; \nend tko_test_mview_trg;\n/\n\nSo I was able to see what is happening. According to my trigger, every time I do UPDATE in the base table (not INSERT nor DELETE) there is actually DELETE and INSERT operation on MVIEW table.\nupdate tko_mview_test2_tb\n set data = 'some sting'\n where id = 1000; \ncommit;\n\nOutput\ndelete\ninsert\n\nIs this correct way how refresh of MVIEW works? There is no updates on MVIEW table when refreshing MVIEW?\nRegards,\nTom" ]
[ "oracle", "plsql", "oracle19c" ]
[ "tt_news and RealURL: shorten URL of news article", "Currently the URL for a news article looks like\n\nwww.domain.com/path/to/page/news/news-detail/article/articlename\n\nIs there a way to shorten this URL? E.g. missing out article or news-detail?\n\nIn the RealUrl-Configuration there is the array article but I don't know if I can change this for example to news-detail ...\n\nDo you have some ideas?\n\nI'm using Typo3 4.5.5, realurl 1.11.2 and tt_news 3.0.1." ]
[ "url", "typo3", "realurl", "tt-news" ]
[ "Does MFC provide a quick way to throw text on the clipboard?", "The add-to-clip-board code we have in our code base is quite low-level - allocating global memory and so on. For the simple case I just want to put some plain text on the clipboard, are there any routines which can wrap all that stuff?\n\nAn example is that CRichEditCtrl has Copy() & Cut() methods which automatically put the current selection on the clipboard. Does MFC make this kind of functionality available in isolation?\n\nUpdate: Created a new question based on mwigdahl's response" ]
[ "mfc", "clipboard" ]
[ "Use mipmap for Parse notification", "Im using\n\n<meta-data\n android:name=\"com.parse.push.notification_icon\"\n android:resource=\"@mipmap/ic_launcher\" />\n\n\ninside my manifest but I get:\n\nResources referenced from the manifest cannot vary by configuration (except for version qualifiers, e.g. -v21.) Found variation in hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi (at line 238) \n\n\n\nWhat does this mean?\nWhats the notification image preferred size?\nNotification image dont use device screen resolution for images?" ]
[ "android", "user-interface", "parse-platform" ]
[ "Updating git bare repo from origin (without losing changes)", "I'm setting up a git repo on my server for my work with contiki.\n\nIt should be accessible from multiple machines so I made a bare clone from the contiki repo, created a new branch and commited my changes.\n\nNow I'm trying to update my repo with the new commits from the contiki repo and rebase my branch on them, but git tells me \"pull\" would only work in a work tree. \"fetch\" on the other hand just creates a new \"FETCH_HEAD\" file.\n\nWhat do I do?\nWould a mirror-repo do the job? (But I don't want to publish my branch, just receive updates)" ]
[ "git" ]
[ "How to count neighbouring cells in a numpy array using try-except?", "I have a numpy array:\n\nx = np.random.rand(4, 5)\n\n\nI would like to create an array showing how many neighbouring values are there for each value in the original array. By neighbouring I mean:\n\nexample=np.array([[0,1,0,0,0],\n [1,2,1,0,0],\n [0,1,0,0,0],\n [0,0,0,0,0]])\n\nplt.imshow(example)\n\n\n\n\nThe value at position [1][1] has 4 neighbours (the yellow square has 4 adjacent green cells).\n\nA solution which works:\n\nx = np.random.rand(4, 5)\n\nmask = 4*np.ones(x.shape, dtype=int)\n\nmask[0][:]=3\nmask[-1][:]=3\n\nfor each in mask: each[0]=3\nfor each in mask: each[-1]=3\n\nmask[0][0]=2\nmask[0][-1]=2\nmask[-1][0]=2\nmask[-1][-1]=2\n\n\nmask becomes:\n\narray([[2, 3, 3, 3, 2],\n [3, 4, 4, 4, 3],\n [3, 4, 4, 4, 3],\n [2, 3, 3, 3, 2]])\n\n\nNow I try to create the same array with try-except:\n\nx = np.random.rand(4, 5)\n\nnumofneighbours=[]\n\nfor index, each in enumerate(x): \n row=[]\n for INDEX, EACH in enumerate(each):\n\n c=4\n try:ap[index+1][INDEX]\n except:c-=1\n\n try:ap[index][INDEX+1]\n except:c-=1\n\n try:ap[index-1][INDEX]\n except:c-=1\n\n try:ap[index][INDEX-1] \n except:c-=1\n\n row.append(c)\n\n numofneighbours.append(row)\nnumofneighbours=np.asarray(numofneighbours)\n\n\nGiving thre resulting numofneighbours array:\n\narray([[4, 4, 4, 4, 3],\n [4, 4, 4, 4, 3],\n [4, 4, 4, 4, 3],\n [3, 3, 3, 3, 2]])\n\n\nWhich is not equal to mask, as I expected it to be.\n\nWhat am I doing wrong here or how should I use try-except for the purpose described above?" ]
[ "python", "arrays", "python-3.x", "numpy", "neighbours" ]
[ "Need dynamic dates in my SQL where clause", "I need to write a (my first) simple stored procedure in SQL Server 2012 that will run on the 1st of every month. The data needs to be for the last 3 full months every time it runs. \n\nI need the WHERE clause to be based on a table.STARTDATE that falls between the dates of the last 3 months. \n\nSo when it runs July 1st, it needs to be: \n\nWHERE t.STARTDATE BETWEEN '2018-04-01' AND '2018-06-30'\n\n\nand when it runs on August 1st, it needs to be: \n\nWHERE t.STARTDATE BETWEEN '2018-05-01' AND '2018-07-31'\n\n\nand so on.\n\nOK, I just tried this and can't really validate it until the last day of the month. Would this work? \n\nBETWEEN DATEADD(m, -3, GETDATE()) AND DATEADD(dd, -1, GETDATE())" ]
[ "sql", "sql-server", "date" ]
[ "Using variable before assignment", "I have the following Python code:\nimport loader\n\ndef encode_files():\n loader = loader.Loader('','','',False, False)\n\nloader = loader.Loader('','','',False, False)\n\nIn the body of the function encode_files(), the editor reports an error Using variable 'loader' before assignment. However, loader = loader.Loader('','','',False, False) outside the function is fine. What causes the error of loader inner encode_files().\nThanks in advance!" ]
[ "python" ]
[ "Parsing XML using a for loop in php", "I am trying and trying to parse an XML document. I can get all of the information when I look at a var_dump, but what I need to do is pull out the Id and image url from the document. I have tried using a for each loop, and it will go through the loop the correct number of times, but the Id number that I need never changes.\nThe XML document is:\n\n<?xml version=\"1.0\"?>\n<GetMatchingProductForIdResponse xmlns=\"http://mws.amazonservices.com/schema/Products/2011-10-01\">\n<GetMatchingProductForIdResult Id=\"9781124028491\" IdType=\"ISBN\" status=\"ClientError\">\n <Error>\n<Type>Sender</Type>\n<Code>InvalidParameterValue</Code>\n<Message>Invalid ISBN identifier 9781124028491 for marketplace ATVPDKIKX0DER</Message>\n</Error>\n</GetMatchingProductForIdResult>\n<GetMatchingProductForIdResult Id=\"9780030114687\" IdType=\"ISBN\" status=\"Success\">\n<Products xmlns=\"http://mws.amazonservices.com/schema/Products/2011-10-01\" xmlns:ns2=\"http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd\">\n<Product>\n <Identifiers>\n <MarketplaceASIN>\n <MarketplaceId>ATVPDKIKX0DER</MarketplaceId>\n <ASIN>0030114683</ASIN>\n </MarketplaceASIN>\n </Identifiers>\n <AttributeSets>\n <ns2:ItemAttributes xml:lang=\"en-US\">\n <ns2:Author>Turk, Jonathan.</ns2:Author>\n <ns2:Binding>Unknown Binding</ns2:Binding>\n <ns2:Label>Saunders College Publishers, USA</ns2:Label>\n <ns2:Manufacturer>Saunders College Publishers, USA</ns2:Manufacturer>\n <ns2:ProductGroup>Book</ns2:ProductGroup>\n <ns2:ProductTypeName>BOOKS_1973_AND_LATER</ns2:ProductTypeName>\n <ns2:PublicationDate>2004-12-07</ns2:PublicationDate>\n <ns2:Publisher>Saunders College Publishers, USA</ns2:Publisher>\n <ns2:SmallImage>\n <ns2:URL>http://g-ecx.images-amazon.com/images/G/01/x-site/icons/no-img-sm._V192198896_.gif</ns2:URL>\n <ns2:Height Units=\"pixels\">40</ns2:Height>\n <ns2:Width Units=\"pixels\">60</ns2:Width>\n </ns2:SmallImage>\n <ns2:Studio>Saunders College Publishers, USA</ns2:Studio>\n <ns2:Title>Introduction to Environmental Studies.</ns2:Title>\n </ns2:ItemAttributes>\n </AttributeSets>\n <Relationships/>\n <SalesRankings/>\n</Product>\n\n\n\n\nI have cut it down for brevity.\nMy php is this:\n\n foreach($parsed_xml->GetMatchingProductForIdResult as $item ) {\n //$ean =$parsed_xml->GetMatchingProductForIdResult->attributes()->Id; var_dump($ean);//->attributes()->Id\n $current = $parsed_xml->GetMatchingProductForIdResult->Products;\n\n print_r(\" passed the foreach statement \");\n\n //$status = $parsed_xml->GetMatchingProductForIdResult->attributes()->status;\n\n //$isbn13 = $ean;print_r($isbn13);\n if(isset($parsed_xml->GetMatchingProductForIdResult, $current, $current->Product, $current->Product->AttributeSets)){\n $amazonResult = array(\n 'isbn' => $parsed_xml->GetMatchingProductForIdResult->attributes()->Id,//$isbn13,\n 'ImageURL' => str_replace('SL75','SL200',$current->Product->AttributeSets->children('ns2', true)->ItemAttributes->SmallImage->URL),\n );\n print_r(\" Success was true \");\n\n } else {\n\n$amazonResult = array(\n 'isbn' => $parsed_xml->GetMatchingProductForIdResult->attributes()->Id,//$isbn13,\n 'ImageURL' => \"Jim\",\n );\n print_r(\" Success was false \");\n} \n //update image in images table\n print_r(\" at the insert statement \");\n$conn->query(\"INSERT INTO images (isbn, image) VALUES ('\" . $amazonResult['isbn'] . \"', '\" . $amazonResult['ImageURL'] . \"')\");\n\n\nHow do I get each individual Id when going through the loop?" ]
[ "php", "xml", "xml-parsing" ]
[ "Why can't local variable be used in GNU C basic inline asm statements?", "Why cannot I use local variables from main to be used in basic asm inline? It is only allowed in extended asm, but why so?\n\n(I know local variables are on the stack after return address (and therefore cannot be used once the function return), but that should not be the reason to not use them)\n\nAnd example of basic asm:\n\nint a = 10; //global a\nint b = 20; //global b\nint result;\nint main()\n{\n asm ( \"pusha\\n\\t\"\n \"movl a, %eax\\n\\t\"\n \"movl b, %ebx\\n\\t\"\n \"imull %ebx, %eax\\n\\t\"\n \"movl %eax, result\\n\\t\"\n \"popa\");\nprintf(\"the answer is %d\\n\", result);\nreturn 0;\n}\n\n\nexample of extended:\n\nint main (void) {\n\n int data1 = 10; //local var - could be used in extended\n int data2 = 20;\n int result;\n\n asm (\"imull %%edx, %%ecx\\n\\t\"\n \"movl %%ecx, %%eax\" \n : \"=a\"(result)\n : \"d\"(data1), \"c\"(data2));\n\n printf(\"The result is %d\\n\",result);\n\n return 0;\n}\n\n\nCompiled with:\ngcc -m32 somefile.c\n\nplatform:\nuname -a:\nLinux 5.0.0-32-generic #34-Ubuntu SMP Wed Oct 2 02:06:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux" ]
[ "c", "gcc", "inline-assembly", "language-design" ]
[ "Sending attachment with MailKit in PowerShell doesn't attach", "I have a simple script in PowerShell to simply SMTP a PDF attachment. No subject, and no body. The results show the attachment but the email is always received without it. Am I missing something?\n$SMTP = [MailKit.Net.Smtp.SmtpClient]::new()\n$Message = [MimeKit.MimeMessage]::new()\n$Builder = [MimeKit.BodyBuilder]::new()\n\n$Message.From.Add("[email protected]")\n$Message.To.Add("[email protected]")\n$Builder.Attachments.Add("C:\\Users\\myname\\Path\\MyPDF.pdf")\n\n$SMTP.Connect('smtp.xxxx.com', 465, 'SecureSocketOptions.SslOnConnect')\n$SMTP.Authenticate($MAILCREDENTIALS)\n\n$SMTP.Send($Message)\n$SMTP.Disconnect($true)\n$SMTP.Dispose()\n\nOutput after sending:\nContentDuration : \nContentMd5 :\nContentTransferEncoding : Base64\nFileName : MyPDF.pdf\nContent : MimeKit.MimeContent\nContentObject : MimeKit.MimeContent\nHeaders : {Content-Type: application/pdf; name="MyPDF.pdf", Content-Disposition: attachment; filename="MyPDF.pdf", Content-Transfer-Encoding: base64} \nContentDisposition : Content-Disposition: attachment; filename="MyPDF.pdf"\nContentType : Content-Type: application/pdf; name="MyPDF.pdf"\nContentBase :\nContentLocation :\nContentId :\nIsAttachment : True" ]
[ "powershell", "mailkit" ]
[ "Doesn't Dependency Injection simply move the issue elsewhere?", "So Dependency Injection is recommended usually to help with unit testing, to solve the problem of having a class dependent on other classes. This sounds great, but let me walk through the issue I'm facing.\n\nHere is a regular implementation without DI:\n\nclass Upper{\n Middle middle = new Middle();\n}\n\nclass Middle{\n Lower lower = new Lower();\n}\n\nclass Lower{\n}\n\n\nNow let's start at the bottom. Middle depends on Lower, we don't really want that, so we'll create a redundant interface for Lower and pass that to the constructor of Middle instead:\n\nclass Middle{\n Lower lower;\n public Middle(ILower lower){\n this.lower = lower;\n }\n}\n\ninterface ILower{\n}\n\nclass Lower : ILower{\n}\n\n\nWell this sounds great, right? Well not really. Most examples I've seen stop here, forgetting that something needs to use the class Middle. Now we have to update Upper to be compatible:\n\nclass Upper{\n Middle middle = new Middle(new Lower());\n}\n\n\nThis doesn't seem very useful... All that we've done is moved the problem up a level, and created an unusual dependency: Upper depends on Lower now? That's definitely not an improvement.\n\nI must be missing the benefit, but it seems like DI just moved the issue rather than solved it. In fact, it also makes the code harder to understand.\n\nAlso, here is a \"full\" implementation:\n\ninterface IUpper {\n}\n\nclass Upper : IUpper {\n Middle middle;\n public Upper(IMiddle middle){\n this.middle = middle;\n }\n}\n\ninterface IMiddle {\n}\n\nclass Middle : IMiddle {\n Lower lower;\n public Middle(ILower lower){\n this.lower = lower;\n }\n}\n\ninterface ILower {\n}\n\nclass Lower : ILower {\n}\n\n\nBut again, I'm just moving the problem. To use Upper, I need:\n\nnew Upper(new Middle(new Lower()));\n\n\nand now I depend on 3 classes!" ]
[ "c#", "dependency-injection" ]
[ "in sails set controller as default route instead of view", "in config/routes.js what happens when controller is needed instead of view\n\nmodule.exports.routes = {\n\n '/': {\n view: 'index'\n }\n\n};\n\n\nbasically I want to load some data on the index page but I cant because there is no controller, in addition I want to have other pages like about, contact etc... but I prefer to put them to a PublicController instead of routes.js" ]
[ "sails.js" ]
[ "Get all specific product types", "I need to get specific product types from the database.\n\nI know how to get all products but I need to filter by just a specific product type.\n\nWhat I get to till now:\n\nglobal $wpdb;\n$sql = \"SELECT * FROM {$wpdb->posts} WHERE post_type = 'product' AND post_status = 'publish'\n\n\nBut where is the product type field?" ]
[ "php", "mysql", "wordpress", "woocommerce" ]
[ "Why does Kotlin JDK8 also include Kotlin JDK7 on the classpath?", "I'm using Kotlin to build a web service and I stumbled upon what I consider to be a strange curiosity. With this build.gradle:\n\ngroup 'com.example'\nversion '0.1.0'\n\nbuildscript {\n ext.kotlinVersion = '1.2.71'\n\n repositories {\n mavenCentral()\n }\n dependencies {\n classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n }\n}\n\napply plugin: 'kotlin'\n\nsourceCompatibility = 1.8\n\nrepositories {\n mavenCentral()\n}\n\ndependencies {\n compile \"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion\"\n compile 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.8'\n}\n\ncompileKotlin {\n kotlinOptions.jvmTarget = \"1.8\"\n}\ncompileTestKotlin {\n kotlinOptions.jvmTarget = \"1.8\"\n}\n\n\nI get this error during compilation:\n\nw: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:\n .../kotlin-stdlib-jdk8-1.2.71.jar (version 1.2)\n .../kotlin-stdlib-jdk7-1.2.71.jar (version 1.2)\n .../kotlin-reflect-1.3.10.jar (version 1.3)\n .../kotlin-stdlib-1.3.10.jar (version 1.3)\n .../kotlin-stdlib-common-1.3.10.jar (version 1.3)\n\n\nOK, no problem, jackson-module-kotlin is pulling in the kotlin 1.3 dependencies. I can exclude them. But the bit that caught my attention was the second line. kotlin-stdlib-jdk8 is also pulling in kotlin-stdlib-jdk7. In fact, I can exclude it and everything still runs as expected:\n\ncompile(\"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion\") {\n exclude group: \"org.jetbrains.kotlin\", module: \"kotlin-stdlib-jdk7\"\n}\n\n\nWhy is kotlin-stdlib-jdk8 pulling onto my classpath the seemingly unnecessary kotlin-stdlib-jdk7?" ]
[ "java", "gradle", "kotlin" ]
[ "How can I find the node of the last layer of each tree in GBDT, using Spark MLLib?", "I want to generate feature using GBDT (Facebook's paper Practical Lessons from Predicting Clicks on Ads at Facebook). And it seems easy to do this job, using Sklearn Feature transformations with ensembles of trees. But using Spark to do this job seems hard since there is no method in Saprk's GBDT named apply (this method in sklearn can help me find the node) or some method that we can find the index of the leaf x ends up in each estimator, in another word, the node that data will be end up with in each estimator.\n\nIf I use the method trees in MLLib's GBDT Classifier model, then I get the following, which does not tell me the exactly node that I want to know \n\n[DecisionTreeRegressionModel (uid=dtr_e1fb06f46c7c) of depth 2 with 5 nodes,\n DecisionTreeRegressionModel (uid=dtr_23641ea362dc) of depth 4 with 17 nodes,\n DecisionTreeRegressionModel (uid=dtr_3dedd910cbe2) of depth 3 with 7 nodes,\n DecisionTreeRegressionModel (uid=dtr_2cfe4fa44b89) of depth 3 with 9 nodes,\n DecisionTreeRegressionModel (uid=dtr_24c37bd33424) of depth 5 with 19 nodes,\n DecisionTreeRegressionModel (uid=dtr_4d7530bfc4e2) of depth 4 with 11 nodes,\n DecisionTreeRegressionModel (uid=dtr_e288599f5944) of depth 4 with 15 nodes,\n DecisionTreeRegressionModel (uid=dtr_d355940d4246) of depth 4 with 15 nodes,\n DecisionTreeRegressionModel (uid=dtr_6abbfbcfdd4e) of depth 3 with 9 nodes,\n DecisionTreeRegressionModel (uid=dtr_58ca63396c4a) of depth 3 with 13 nodes]\n\n\nIf I use toDebugString, then I get something like\n\nu'GBTClassificationModel (uid=GBTClassifier_4f36b986f967194b34b6) with 10 trees\\n Tree 0 (weight 1.0):\\n If (feature 406 <= 72.0)\\n If (feature 99 in {2.0})\\n Predict: -1.0\\n Else (feature 99 not in {2.0})\\n Predict: 1.0\\n Else (feature 406 > 72.0)\\n Predict: -1.0\\n Tree 1 (weight 0.1):\\n If (feature 406 <= 72.0)\\n If (feature 209 <= 4.0)\\n Predict: -0.4768116880884702\\n Else (feature 209 > 4.0)\\n If (feature 236 <= 253.0)\\n If (feature 244 <= 175.0)\\n Predict: 0.4768116880884702\\n Else (feature 244 > 175.0)\\n Predict: 0.47681168808847024\\n Else (feature 236 > 253.0)\\n Predict: 0.4768116880884703\\n Else (feature 406 > 72.0)\\n If (feature 459 <= 144.0)\\n If (feature 323 <= 78.0)\\n If (feature 119 in {0.0})\\n Predict: -0.4768116880884702\\n Else (feature 119 not in {0.0})\\n Predict: -0.4768116880884701\\n Else (feature 323 > 78.0)\\n If (feature 323 <= 116.0)\\n Predict: -0.4768116880884702\\n Else (feature 323 > 116.0)\\n Predict: -0.47681168808847035\\n Else (feature 459 > 144.0)\\n Predict: -0.4768116880884712\\n Tree 2 (weight 0.1):\\n If (feature 406 <= 72.0)\\n If (feature 209 <= 4.0)\\n Predict: -0.4381935810427206\\n Else (feature 209 > 4.0)\\n If (feature 578 <= 13.0)\\n Predict: 0.4381935810427206\\n Else (feature 578 > 13.0)\\n Predict: 0.4381935810427206\\n Else (feature 406 > 72.0)\\n Predict: -0.43819358104272055\\n Tree 3 (weight 0.1):\\n If (feature 433 <= 0.0)\\n If (feature 239 <= 253.0)\\n Predict: 0.40514968028459825\\n Else (feature 239 > 253.0)\\n Predict: -0.4051496802845982\\n Else (feature 433 > 0.0)\\n If (feature 124 <= 26.0)\\n If (feature 265 <= 3.0)\\n Predict: -0.40514968028459825\\n Else (feature 265 > 3.0)\\n Predict: -0.4051496802845982\\n Else (feature 124 > 26.0)\\n Predict: -0.4051496802845984\\n\n\n\nIt is hard for my code to find the place of node in the last layer of each tree.\n\nHow can I generate feature using Spark's GBDT, just like what sklearn can do ?" ]
[ "apache-spark", "machine-learning", "apache-spark-mllib" ]
[ "What's the most effecient way to combine this collection?", "Given the following collection, what would be the best way to consolidate this data to group by room and make the \"names\" an array; excluding duplicates, and do not want to use the call the key \"name\" to make it more dynamic if there are more fields:\n\nvar roomAssignments = [{\n room: 'Foo',\n name: 'Fooname',\n other: 'Other'\n},{\n room: 'Bar',\n name: 'Barname',,\n other: 'OtherBar'\n},{\n room: 'Foo',\n name: 'Baz',,\n other: 'Other'\n},{\n room: 'Foo',\n name: 'Baz',,\n other: 'Other'\n},{\n room: 'Foo',\n name: 'Bat',,\n other: 'Other'\n}];\n\n\nDesired output:\n\n[{\n room: 'Foo',\n name: [ 'Fooname', 'Baz', 'Bat' ],\n other: ['Other']\n}, {\n room: 'Bar',\n name: [ 'Barname' ],\n other: ['OtherBar']\n}]\n\n\nI'm using lodash currently and would prefer that or plain javascript. I think I've been looking at this too long and what I have has about 30 keys that need to be combined into arrays, and I'm looking for the most efficient way to combine all keys into arrays dynamically." ]
[ "javascript", "lodash" ]
[ "Replace in one step based on matched result", "I have a string and I want each YYYY-MM-DD HH:MM:SS date time string to be replaced with a unix timestamp.\n\nI have managed to get as far as identifying where date time strings occur:\n\n$my_string = 'Hello world 2014-12-25 10:00:00 and foo 2014-09-10 05:00:00, bar';\n\npreg_match_all('((?:2|1)\\\\d{3}(?:-|\\\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))',$my_string,$my_matches, PREG_OFFSET_CAPTURE);\n\nprint_r($my_matches);\n\n\nThis outputs an array of arrays containing the value of the date time string that was matched and its location:\n\nArray\n(\n [0] => Array\n (\n [0] => Array\n (\n [0] => 2014-12-25 10:00:00\n [1] => 12\n )\n\n [1] => Array\n (\n [0] => 2014-09-10 05:00:00\n [1] => 40\n )\n\n )\n\n)\n\n\nFrom this point I was going to loop through the arrays and replace based on str_replace() and strtotime() however I'm thinking it would have lower execution time if I could do something like this:\n\n$my_string = preg_replace(\n '((?:2|1)\\\\d{3}(?:-|\\\\/)(?:(?:0[1-9])|(?:1[0-2]))(?:-|\\\\/)(?:(?:0[1-9])|(?:[1-2][0-9])|(?:3[0-1]))(?:T|\\\\s)(?:(?:[0-1][0-9])|(?:2[0-3])):(?:[0-5][0-9]):(?:[0-5][0-9]))',\n strtotime($VALUE_OF_MATCHED_STRING),\n $my_string\n);\n\n\nSo that every found instance of the matched would simply be made to strtotime() format.\n\nWhat is the correct way to get this result? Is looping the most feasible way?" ]
[ "php", "regex", "date", "replace", "preg-replace" ]
[ "subtract mean from pyspark dataframe", "I'm trying to calculate the average for each column in a dataframe and subtract from each element in the column. I've created a function that attempts to do that, but when I try to implement it using a UDF, I get an error: 'float' object has no attribute 'map'. Any ideas on how I can create such a function? Thanks!\n\ndef normalize(data):\n average=data.map(lambda x: x[0]).sum()/data.count()\n out=data.map(lambda x: (x-average))\n return out\n\nmapSTD=udf(normalize,IntegerType()) \ndats = data.withColumn('Normalized', mapSTD('Fare'))" ]
[ "apache-spark", "pyspark", "spark-dataframe" ]
[ "OutOfBoundsDatetime: cannot convert input 1575262698000.0 with the unit 's'", "I am trying to turn that number from a dataframe into a datetime, the colum time['date'] looks like the following:\n\n0 1.575263e+12\n1 1.575263e+12\n2 1.575263e+12\n3 1.575263e+12\n4 1.575307e+12\n ... \n95 1.576521e+12\n96 1.576521e+12\n97 1.576521e+12\n98 1.576521e+12\n99 1.576521e+12\nName: date, Length: 100, dtype: float64\n\n\nI tried the following: \n\nprint(pd.to_datetime(time['date'], unit='s'))\n\n\nBut I had the issue in the title, and if I try without unit='s' the column looks as follow: \n\n0 1970-01-01 00:26:15.262698000\n1 1970-01-01 00:26:15.262699000\n2 1970-01-01 00:26:15.262698000\n3 1970-01-01 00:26:15.262701000\n4 1970-01-01 00:26:15.307111000\n ... \n95 1970-01-01 00:26:16.521124623\n96 1970-01-01 00:26:16.521116000\n97 1970-01-01 00:26:16.521118000\n98 1970-01-01 00:26:16.521145701\n99 1970-01-01 00:26:16.521147000\nName: date, Length: 100, dtype: datetime64[ns]\n\n\nWhich is of course wrong, any idea why? thanks!\n\nHere is an example of the input: 1575262698000.0 and the output should be the following: 2019-12-02 04:58:18" ]
[ "python", "pandas" ]
[ "How to change Java path used by Eclipse?", "I recently compiled my code using Java 1.8. I had set JAVA_HOME and PATH to do the compilation using ant\n\nNow, When I start Eclipse (Luna), in order to debug application using Tomcat plugin for eclipse. I starts using below path - using Java 1.7\n\n\n\nAnd tomcat starts and prints below\n\nApr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log\nINFO: OS Version: 6.3\nApr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log\nINFO: Architecture: amd64\nApr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log\nINFO: JAVA_HOME: C:\\Program Files\\Java\\jre7\nApr 10, 2018 4:25:34 PM org.apache.catalina.startup.VersionLoggerListener log\nINFO: JVM Version: 1.7.0_79-b15\n\n\nHow can I use Java 1.8 in this ?" ]
[ "java", "eclipse", "eclipse-plugin", "classpath", "eclipse-classpath" ]
[ "Table join in hive fails", "I have following data for the 2 tables in hive \n\ntable1 contains \n\nlocn zone\n\nNY AMERICA/CHICAGO\nKC AMERICA/DENVER\nLA AMERICA/CHICAGO\n\n\ntable 2 contains\n\nstdtime locn\n2015-03-04 15:00:00 NY\n2015-03-04 16:00:00 KC\n\n\nThis is my join query \n\nselect s.zone,t.stdtime,to_utc_timestamp(t.stdtime,s.zone) as newtime from table1 s inner join table2 t on s.locn=t.locn;\n\n\nWhen I run this query on hortonworks cluster getting error\n\nVertex failed, vertexName=Map 1, vertexId=vertex_1430758596575_17289_7_01, diagnostics=[Task failed, taskId=task_1430758596575_17289_7_01_000001, diagnostics=[TaskAttempt 0 failed, info=[Error: Failure while running task:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while processing row {\"locn\":\"KC\",\"zone\":\"America/Denver\"}" ]
[ "hive" ]
[ "Can not Download 'digest' package in R", "I am trying to create clustered box plots in R. Everything about my code seems on track, but when I try to run it I get the error warning \n\n\n \"Error in loadNamespace(name) : there is no package called ‘digest’.\n\n\nWhen I try to download the package digest in the R package Installer I get a bunch of errors stating that the download of digest failed. \n\nHow do I get the digest package, OR is there a way to do clustered box plots without this? Thanks!" ]
[ "r", "plot", "package", "box", "digest" ]
[ "UITests: deinit is not called", "Why when I tests my controllers in Xcode everything is fine, but deinit methods are not called. Is it correct?\n\nWhile app works normally, it is fine, but not for UITest target.\n\nFor complicated structures simulator allocate over and over more objects, and... do not deallocate it at all. So, quite often on slower machines the app sometimes quits without any reason... and tests cannot be fulfilled.\n\nUsing Xcode 8, iOS 10, macOS Sierra." ]
[ "ios", "swift", "xcode", "xcode-ui-testing" ]
[ "What value does Firebase Auth Identifier store from Facebook Login If user is not registered with email", "What value does Firebase Auth Identifier store from Facebook Login If user is not registered with email but with Phone Number. My app provides facebook login but now when a user is carrying on with Facebook login my firebase auth stores the email address as an Identifiers but when someone login in my app via facebook login who had registered with phone number in facebook then my firebase auth is storing null value in Identifier. So what should I do to store a user's phone number from facebook as an identofier or facebook id as an identifier e.g [email protected]" ]
[ "android", "firebase", "firebase-authentication", "facebook-login" ]
[ "Can't find text in li under div using BeautifulSoup", "I am trying to use BeautifulSoup to get the text in ul under a div in this website: https://www.nccn.org/professionals/physician_gls/recently_updated.aspx\n\nBut I only get an empty div. My code was:\n\npage = requests.get(\"https://www.nccn.org/professionals/physician_gls/recently_updated.aspx\")\n\nsoup=BeautifulSoup(page.content,\"html.parser\")\n\n_div=soup.find(\"div\",{\"id\":\"divRecentlyUpdatedList\"})\n\nelement = [i.text for i in b.find(\"a\") for b in _div.find(\"ul\")]\n\n\n\nThe results were:\n\n\n\nThe HTML file screenshot is as follows: div and ul \n\nAlso, there is javascript coming right after the div I am trying to get the content from:\n\ndiv and javascript\n\nI also tried get all li like this:\n\nl = []\nfor tag in soup.ul.find_all(\"a\", recursive=True): \n l.append(tag.text)\n\n\nBut the text I got was not what I want. Is the text under that div hidden by the javascript?\n\nAny help is welcome. Thank you very much in advance." ]
[ "javascript", "python", "web-scraping", "beautifulsoup" ]
[ "Ios git merge conflict in xCode", "I have two branches in my project, one is develop and other is master, accidently without merging develop into master I made app live and now I have two different versions on two different branches. Let's say 1.5 version on master and 1.6 on develop, now when I tried to merge these two branches git show merge conflicts in 3 different files,\n\n\n.plist\n.xcodeproj\n.xcworkspace\n\n\nafter merge when I tried to open xCode project, it failed and show error \"project cannot be load..\" when tried to open files manually it just doesn't open in editText. I tried sublime editor but then again I couldn't locate conflict as there were a lot of lines of code." ]
[ "xcode", "git", "merge", "git-merge-conflict" ]
[ "Disadvantage of using macro to cover interface of move-like function", "What are disadvantages of using macro as interface of all move semantics? \n\nI have recently read about syntax of move-related function inside a class (http://stackoverflow.com/a/4782927/ ), and in my opinion, it is quite tedious and repetitive :- \n\nC(C&&) = default; // Move constructor\nC& operator=(C&&) & = default; // Move assignment operator\n\n\nIt is dirtier if I want to customize both move-assignment and move-constructor with the same implementation. (same problem as Copy constructor and = operator overload in C++: is a common function possible?)\n\nTherefore, I decide to create a macro (swap-like function) to make everything concise in a single place.\n\n#define MACRO_MOVE(C) \\\nC& operator=(C&& that) & { \\\n moveHack(this,&that); return *this; \\\n} \\\nC(C&& that){ \\\n moveHack(this,&that); \\\n} \\\nstatic void moveHack(C* dst,C* src)\n\n\nHere is the usage :-\n\nclass X{\n int data=42;\n MACRO_MOVE(X){\n dst->data=src->data;\n src->data=0;\n }\n};\n\n\nHowever, I haven't seen anyone do like this before.\nAre there any issues I should concern?\nAre there any specific disadvantages of this approach?" ]
[ "c++", "macros", "c++14", "move-semantics" ]
[ "Which is the best strategy to show an animated view that haves multiple frames?", "I want to show a view on the screen that is a mouth opening and closing itself. \n\nThe mouth will have 3 frames (3 image states), opened, closed, and semi-opened.\n\nI want each frame to be wait 300ms until the next frame is showed.\n\nWhich is the best strategy to do this?" ]
[ "android", "animation", "view" ]
[ "myurl.com didn’t send any data. ERR_EMPTY_RESPONSE", "Failed to load resource: the server responded with a status of 403, myurl.com didn’t send any data. ERR_EMPTY_RESPONSE." ]
[ "url", "server", "cpanel" ]
[ "Duplicate Resources Error", "I am making an app that has two separate log ins that you have to enter your info in depending on which button you press. The two log ins have different ids for the info. For one of the log ins it says: 7th_email and then 7th_Password but then for the other log in it says: 8th_email and then 8th_Password. \nI don't see where the error duplicate resources error is coming from. \n\nHere's the code;\n\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\" \nxmlns:tools=\"http://schemas.android.com/tools\"\ntools:context=\"com.novaschool.novaschoolapp.Seventh_Grade_Login\">\n<!-- Login progress -->\n<LinearLayout android:id=\"@+id/login_status\"\n android:visibility=\"gone\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"center\"\n android:gravity=\"center_horizontal\"\n android:orientation=\"vertical\">\n\n <ProgressBar style=\"?android:attr/progressBarStyleLarge\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"8dp\"/>\n <TextView\n android:id=\"@+id/login_status_message\"\n android:textAppearance=\"?android:attr/textAppearanceMedium\"\n android:fontFamily=\"sans-serif-light\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginBottom=\"16dp\"\n android:text=\"@string/login_progress_signing_in\" />\n\n</LinearLayout>\n<!-- Login form -->\n<ScrollView\n android:id=\"@+id/login_form\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\">\n\n <LinearLayout style=\"@style/LoginFormContainer\"\n android:orientation=\"vertical\">\n <EditText\n android:id=\"@+id/7th_email\"\n android:singleLine=\"true\"\n android:maxLines=\"1\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:inputType=\"textEmailAddress\"\n android:hint=\"@string/prompt_email\"\n android:text=\"Enter Your Email\" />\n\n <EditText\n android:id=\"@+id/7th_password\"\n android:singleLine=\"true\"\n android:maxLines=\"1\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:hint=\"@string/prompt_password\"\n android:inputType=\"textPassword\"\n android:imeActionLabel=\"@string/action_sign_in_short\"\n android:imeActionId=\"@+id/login\"\n android:imeOptions=\"actionUnspecified\"\n android:text=\"Enter your Password\" />\n\n <Button android:id=\"@+id/7th_sign_in_button\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"16dp\"\n android:text=\"Enter\"\n android:paddingLeft=\"32dp\"\n android:paddingRight=\"32dp\"\n android:layout_gravity=\"right\" />\n\n </LinearLayout>\n\n</ScrollView>" ]
[ "android", "button", "android-edittext" ]
[ "Uncaught ReferenceError: iscdnenabled is not defined(zone.js:423)", "misunderstood bug in the application console on the Angular 7\n\n\nzone.js:199 Uncaught ReferenceError: iscdnenabled is not defined\n at Object.getFiles (floatbutton.js:1)\n at Object.populateIframe (floatbutton.js:1)\n at floatbutton.js:1\n at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)\n at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)\n at push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)\n at ZoneTask.invoke (zone.js:487)\n at timer (zone.js:2281)````" ]
[ "javascript", "angular", "zone" ]
[ "Drag and Drop item from one listbox to another in asp.net", "Hi i want to use drag and drop functionality of jquery UI in my form. I bind the first lisbox item from the database. What i want is to drag item from list1 to list2. I tried the following code to implement it which i could not achieved. Please help me to overcome this problem.\n\n<script type=\"text/javascript\">\n <link rel=\"stylesheet\" href=\"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css\">\n <script src=\"//code.jquery.com/jquery-1.10.2.js\"></script>\n <script src=\"//code.jquery.com/ui/1.11.4/jquery-ui.js\"></script>\n\n $(function () {\n $(\"#list1, #list2\").sortable({\n connectWith: \".connectedSortable\"\n }).disableSelection();\n });\n</script>\n\n <style>\n #list1, #list2 {\n border: 1px solid #eee;\n width: 142px;\n min-height: 20px;\n list-style-type: none;\n margin: 0;\n padding: 5px 0 0 0;\n float: left;\n margin-right: 10px;\n }\n\n #list1li, #list2 li {\n margin: 0 5px 5px 5px;\n padding: 5px;\n font-size: 1.2em;\n width: 120px;\n }\n\n\n\n\n<asp:ListBox ID=\"list1\" runat=\"server\" Height=\"300px\" Width=\"250px\" class=\"connectedSortable\"></asp:ListBox>\n<asp:ListBox ID=\"list2\" runat=\"server\" Height=\"300px\" Width=\"250px\" class=\"connectedSortable\"></asp:ListBox>\n\n\ncode behind to bind list1 listbox control\n\npublic void BindListbox()\n{\n\n SqlConnection con = new SqlConnection(constr);\n SqlCommand cmd = new SqlCommand();\n cmd.CommandType = CommandType.StoredProcedure;\n cmd.CommandText = \"[get_names]\";\n cmd.Connection = con;\n\n try\n {\n con.Open();\n list1.DataSource = cmd.ExecuteReader();\n list1.DataTextField = \"Antibiotic\";\n list1.DataValueField = \"AntibioticId\";\n list1.DataBind();\n }\n\n catch (Exception ex)\n {\n Response.Write(\"Error occured: \" + ex.Message.ToString());\n }\n finally\n {\n con.Close();\n con.Dispose();\n }\n}" ]
[ "javascript", "c#", "jquery", "asp.net", "listbox" ]
[ "What does it mean by verification in Firebase phone authentication", "I am creating an android app which uses Firebase phone authentication, so I decided to go through the pricing. It says this on the pricing page:\n\n\n US, Canada, and India $0.01/verification\n All other countries $0.06/verification\n\n\nI would like to ask what is meant by verification,\nDoes it mean every time the user sign in or when an email verification is sent to the user email or any process done using Firebase." ]
[ "android", "firebase", "firebase-authentication" ]
[ "Documenting PUT REST call without body and with path and query parameters", "There's REST API call designed via HTTP PUT that has only path and query parameters and does not need a body:\n\nPUT /posts/{id}/read?currentUser={loginId} \n\n\nTrying to document it using Spring REST Docs 2.0.0.RELEASE I noticed that http-request.adoc is as below:\n\n[source,http,options=\"nowrap\"]\n----\nPUT /posts/42?currentUser=johndoe HTTP/1.1\nHost: localhost:8080\nContent-Type: application/x-www-form-urlencoded\n\ncurrentUser=johndoe\n----\n\n\nI am confused, why currentUser=johndoe is rendered in body (like form parameter)? Is it a bug? Complete example of application below:\n\n\n\n@RestController\n@RequestMapping(\"/posts\")\n@SpringBootApplication\npublic class DemoApplication {\n\n @PutMapping(\"{id}/read\")\n public void markPostRead(@PathVariable(\"id\") String id, @RequestParam(\"currentUser\") String login) {\n System.out.println(\"User \" + login + \" has read post \" + id);\n }\n\n public static void main(String[] args) {\n SpringApplication.run(DemoApplication.class, args);\n }\n}\n\n\n@RunWith(SpringRunner.class)\n@WebMvcTest\npublic class DemoApplicationTests {\n\n @Rule\n public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();\n private MockMvc mockMvc;\n\n @Autowired\n private WebApplicationContext context;\n\n @Before\n public void setUp() {\n this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)\n .apply(documentationConfiguration(this.restDocumentation))\n .build();\n }\n @Test\n public void contextLoads() throws Exception {\n mockMvc.perform(\n RestDocumentationRequestBuilders.put(\"/posts/{id}/read?currentUser=johndoe\", 42))\n .andDo(document(\"mark-as-read\", pathParameters(\n parameterWithName(\"id\").description(\"ID of the Post\")\n )))\n .andDo(document(\"mark-as-read\", requestParameters(\n parameterWithName(\"currentUser\").description(\"Login ID of user\")\n )));\n }\n\n}" ]
[ "java", "spring-restdocs" ]
[ "Search for opponent in socket.io", "I'm trying to make a script in socket.io using express in node.js, that searches for an opponent.\n\nOnly two players can be in a room, which means when there's no free room, it should create a new.\n\nThe logic should work like this. \n\n\n\nI tried like this.\n\nio.on('connection', function (socket) {\n socket.on('search room', function() {\n //io.sockets.adapter.rooms\n\n for (var x in io.sockets.adapter.rooms) {\n if (x !== socket.id) {\n socket.opponent = x;\n socket.join(x);\n break;\n }\n }\n });\n});\n\n\nQuestions:\n\n\nAs you can see my code searches for an opponent, but if it doesn't find one, he should wait for others.\nHow can I check that the player is already playing, what's the best way?\nWhen the user joins a room, his default room doesn't get deleted." ]
[ "javascript", "express", "websocket", "socket.io" ]
[ "Is there any way to read facebook reviews from other user admin?", "Is there any way to read facebook reviews from other user admin pages to my website? If it is possible please provide solution?" ]
[ "asp.net", "facebook" ]
[ "Setting access rule in Yii for action with the same name from different controller?", "I searched over the internet and I found nothing. I centralized all of the access rule from all controller in the main Controller.php from components.\nThis is my code: \n\npublic function accessRules() {\n\n $controllers = array(' '); $actions = array('index');\n if (Yii::app()->user->getState(\"isAdmin\") == true){ \n array_push($controllers, 'controllerName','ModuleName/ControllerName');\n array_push($actions, 'create');\n }\n if (Yii::app()->user->getState('isNormalUser') == true){\n array_push($controllers, 'controllerName2');\n }\n if (Yii::app()->user->getState(\"isAdmin\") == false && Yii::app()->user->getState(\"isNormalUser\") == false){\n return array(\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }else{ \n $controllers = array_unique($controllers); //remove duplicates\n $actions = array_unique($actions);//remove duplicates\n return array(\n array('allow',\n 'controllers'=> $controllers,\n 'actions' => $actions,\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }\n }\n\n\nMy problem is: \nIn my module if I have a controller(C1) with a function named f1 and another controller (C2) with the same function name f1 and i want to give access only to C1 with f1? How can I do that? I observed that i can make the difference between modules with the same controller name giving the format \n\n\n ModuleName/ModuleController\n Is it smth similar to actions ? Thx" ]
[ "php", "yii" ]
[ "How to update the Geometry vertex position Objloader", "I am using objloader to load multiple objects. I am trying to move one of the objects and need to have the updated vertex positions. while loading the objects I converted the buffergeometry to geometry and run some functions. I checked some samples all updating the vertices of the buffergeometry. Do I need to convert it back to buffergeometry or not ?\nI need to have the real time positions while moving to calculate some other functions, so I prefer not to keep on converting from buffer to geometry and vice versa. \n\nHere is a piece of code:\n\n var tool= new THREE.OBJLoader();\n tool.load( '../obj/tool.obj', function ( object ) {\n var material = new THREE.MeshLambertMaterial({color:0xA0A0A0}); \n object.traverse( function ( child ) {\n if ( child instanceof THREE.Mesh ) {\n child.material = material;\n Geometry = new THREE.Geometry().fromBufferGeometry(child.geometry);\n }\n\n console.log(Geometry.vertices[220]);\n Geometry.position.x += 0.01;\n Geometry.verticesNeedUpdate = true;\n console.log(Geometry.vertices[220]);\n\n\nBesides, I checked the migration document of the latest versions and checked them out." ]
[ "three.js", "geometry", "updates", "vertices" ]
[ "springboot thymeleaf could not find static files", "I use springboot + thymeleaf, it can find the template pages, but could not find the static (css or js).\n\n\n\napplication.yml :\n\nspring:\n application:\n name: exe-springboot\n thymeleaf:\n suffix: .html\n resources:\n static-locations: /static/**\n\n\nand the controller :\n\n@RequestMapping(\"/index\")\npublic String index() {\n return \"index\";\n}\n\n\nindex.html\n\n<!DOCTYPE html>\n<html>\n<head>\n <title>index</title>\n <link rel=\"stylesheet\" href=\"../static/index.css\"/>\n</head>\n<body>\n<h2>test page</h2>\n<span class=\"test-span\">hello world with css</span>\n</body>\n</html>\n\n\nindex.css\n\n.test-span{\n font-size: 20px;\n color: red;\n}\n\n\nand browser: http://localhost:8080/index\nthe except color of hello world with css should be red, but not. and the console, with chrome, shows 404 http://localhost:8080/static/index.css" ]
[ "spring-boot", "thymeleaf" ]
[ "LINQ + TransactionScope will not change isolation level in SQL Server Profiler", "I'm using the following format for commiting changes to my db using linq.\n\nBegin Transaction (Scope Serialized, Required)\n Check Business Rule 1...N\n MyDataContext.SubmitChanges()\n Save Changes Done In Previous Query To Log File\nEnd Transaction Scope\n\n\nBut in the SQL Server profiler I see the following line in the Connection:Start.\n\nset transaction isolation level read committed\n\n\nI went through this (http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/93a45026-0425-4d49-a4ac-1b882e90e6d5) and thought I had an answer;\n\nUntil I saw this (https://connect.microsoft.com/VisualStudio/feedback/details/565441/transactionscope-linq-to-sql?wa=wsignin1.0) on Microsoft Connect.\n\nCan someone please tell me whether my code is actually executed under Serialized Isolation Level or whether it is infact just running under read committed?" ]
[ "linq-to-sql", "sql-server-2008", "transactions", "sql-server-profiler", "isolation-level" ]
[ "How to Drop pins on multiple locations mapkit swift", "I am trying to add the pins to the map using the string array. but it display only one pin does not display second pin on the map.\n\nfunc getDirections(enterdLocations:[String]) {\n let geocoder = CLGeocoder()\n // array has the address strings\n for (index, item) in enterdLocations.enumerated() {\n geocoder.geocodeAddressString(item, completionHandler: {(placemarks, error) -> Void in\n if((error) != nil){\n print(\"Error\", error)\n }\n if let placemark = placemarks?.first {\n\n let coordinates:CLLocationCoordinate2D = placemark.location!.coordinate\n\n let dropPin = MKPointAnnotation()\n dropPin.coordinate = coordinates\n dropPin.title = item\n self.myMapView.addAnnotation(dropPin)\n self.myMapView.selectAnnotation( dropPin, animated: true)\n }\n })\n }\n\n}\n\n\nand my calling function\n\n@IBAction func findNewLocation()\n{\n var someStrs = [String]()\n someStrs.append(\"6 silver maple court brampton\")\n someStrs.append(\"shoppers world brampton\")\n getDirections(enterdLocations: someStrs)\n }" ]
[ "ios", "swift", "mapkit", "mkmapview" ]
[ "Using var for type declaration instead of explicitly setting interface type", "I'm not sure if I'm overthinking this but in the past, I've done something like this when declaring a class:\n\nIMyService myService = new MyService();\n\n\nJumping into myService will take you to the IMyService interface.\n\nHowever, doing the following will (obviously) take you to MyService.\n\nvar myService = new MyService();\n\n\nWhich is considered the 'correct' usage, or is this another example of \"What's your favourite ice cream flavor?\"?\n\nI've looked at the most relevant question but it doesn't really answer my scenario." ]
[ "c#", "variable-declaration" ]
[ "How to make \"focus\" on input field on page load", "When i click on input then \"focus\" jquery is working fine, but when i load page then \"email-field\" has curser, my goal is that if input has curser on page load this should be foucus and also add 'class is-focused' , which is add on input click.\nPLease help me.\n\nor if we can do this by add class on fieldset then anyone type any value in input.\n\n\r\n\r\n// For input focused animation\r\n$(\"input:text:visible:first\").focus();\r\n$(function() {\r\n $(\"input:text:visible:first\").focus();\r\n // Trigger click event on click on input fields\r\n $(\"form input.form-control, form textarea.form-control\").on(\"click, change, focus\", function(e) {\r\n removeFocusClass();\r\n // Check if is-focused class is already there or not.\r\n if(!$(this).closest('form fieldset').hasClass('is-focused')) {\r\n $(this).closest('form fieldset').addClass('is-focused')\r\n }\r\n });\r\n // Remove the is-focused class if input does not have any value\r\n $('form input.form-control, form textarea.form-control').each(function() {\r\n var $input = $(this);\r\n var $parent = $input.closest('form fieldset');\r\n if ($input.val() && !$parent.hasClass('is-focused')) {\r\n $parent.addClass('is-focused')\r\n }\r\n });\r\n // Remove the is-focused class if input does not have any value when user clicks outside the form\r\n $(document).on(\"click\", function(e) {\r\n if ($(e.target).is(\"form input.form-control, form textarea.form-control, form fieldset\") === false) {\r\n removeFocusClass();\r\n }\r\n });\r\n function removeFocusClass() {\r\n $('form input.form-control, form textarea.form-control').each(function() {\r\n var $input = $(this);\r\n if (!$input.val()) {\r\n var $parent = $input.closest('form fieldset');\r\n $parent.removeClass('is-focused')\r\n }\r\n });\r\n }\r\n});\r\nfieldset.is-focused input {\r\n border:5px solid red;\r\n}\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>\r\n\r\n</head>\r\n<body>\r\n\r\n<form class=\"user-login-form\">\r\n <div class=\"form-head\"><h2 >Sign in</h2>\r\n <div class=\"description-text\" ><p class=\"small-text\" data-drupal-selector=\"edit-line1\">Not a member yet?</p>\r\n <a href=\"#\" class=\"use-ajax small-text\">Register now</a><p class=\"small-text\" data-drupal-selector=\"edit-line2\"> and join the community</p>\r\n </div>\r\n </div>\r\n <fieldset class=\"js-form-item js-form-type-textfield form-type-textfield js-form-item-name form-item-name form-group col-auto\">\r\n <input type=\"text\" id=\"edit-name--MmB1Jbss54g\" name=\"name\" value=\"\" size=\"60\" maxlength=\"254\" placeholder=\"Email address\" class=\"form-text required form-control\" required=\"required\" aria-required=\"true\" autofocus>\r\n <label class=\"option js-form-required form-required\">Email address</label>\r\n </fieldset>\r\n <fieldset class=\"js-form-item js-form-type-password form-type-password js-form-item-pass form-item-pass form-group col-auto\">\r\n <input type=\"password\" id=\"edit-pass--Db3_6vLkpJQ\" name=\"pass\" size=\"60\" maxlength=\"128\" placeholder=\"Password\" class=\"form-text required form-control\" required=\"required\"><a href=\"#\" data-show-password-trigger=\"\" data-state=\"hidden\" item-right=\"\" class=\"password-link\">Show</a>\r\n <label for=\"edit-pass--Db3_6vLkpJQ\" class=\"option js-form-required form-required\">Password</label>\r\n <small id=\"edit-pass--Db3_6vLkpJQ--description\" class=\"description text-muted\">\r\n <p class=\"small-text\">Forgot your password? <a href=\"#\" class=\"use-ajax small-text\" data-dialog-type=\"modal\">Click here</a></p></small>\r\n </fieldset>\r\n</form>\r\n\r\n\r\n</body>\r\n</html>" ]
[ "javascript", "jquery", "html" ]
[ "Regex to split HTML by Tags which text contain less that n characters", "I want to split the following string by <p> tags which contain text less than 4 characters. Let's say <p>1</p>, <p>2</p> using Regex.\n\n<span id=\"_ctl0_contentMain__kDP_dp_Text\" class=\"kDPText\">\n<p>1</p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n<p>2</p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>\n</span>" ]
[ "javascript", "html", "regex" ]
[ "My datagridview cellvalue changed event is not working ..C# & SQL Server 2008", "There is small bug in my code. My datagridview cell value changed event is not working. When I add any data, rows to the datagrid view is should display the total amount to the textbox which is not working. Can you help me please?\n\nCode:\n\nprivate void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)\n{\n if (e.ColumnIndex == 5)\n txtNetAmt.Text = CellSum().ToString();\n\n int sum = 0;\n\n for (int i = 0; i < dataGridView1.Rows.Count; ++i)\n {\n sum += Convert.ToInt32(dataGridView1.Rows[i].Cells[5].Value);\n }\n\n txtNetAmt.Text = sum.ToString();\n int DiscountedSum = 0;\n\n for (int i = 0; i < dataGridView1.Rows.Count; ++i)\n {\n DiscountedSum += Convert.ToInt32(dataGridView1.Rows[i].Cells[4].Value);\n }\n\n txtDiscamt.Text = DiscountedSum.ToString();\n int SubTotal = sum + DiscountedSum;\n txtSubTotalamt.Text = SubTotal.ToString();\n}\n\n\nScreenshot:" ]
[ "c#", "sql-server-2008" ]
[ "Bootstrap Centered (and Fixed) Navigation Bar", "I have a simple question. I would like to modify the template here http://bootswatch.com/cosmo/ in order to have the navigation bar centered. As you can see in the example, the navigation starts right at the left of the container. insead I would like to harmonously spread over the whole width of the container... AND to be fixed when I scroll down the page...\n\nDo you have any idea ? what should I modify in the css ?\nMany thanks!!" ]
[ "twitter-bootstrap", "navigationbar" ]
[ "Difference between access=\"permitAll\" and filters=\"none\"?", "Here is a part from Spring Security petclinic example:\n\n<http use-expressions=\"true\">\n <intercept-url pattern=\"/\" access=\"permitAll\"/>\n <intercept-url pattern=\"/static/**\" filters=\"none\" />\n <intercept-url pattern=\"/**\" access=\"isAuthenticated()\" />\n <form-login />\n <logout />\n</http>\n\n\nWhat is the difference between access=\"permitAll\" and filters=\"none\"?\n\nUrl: http://static.springsource.org/spring-security/site/petclinic-tutorial.html" ]
[ "java", "spring", "spring-security" ]
[ "Clearing Html textbox value permanently using Jquery", "I have a <%: Html.TextBoxFor(model=>model.UserName)%>. Here I'm checking wheather user name is available or not. If it's not available then I need to clear the TextBox. I used the query $(\"#UserName\").val(\"\");. But after the event completion again the text box getting the value. Can anyone help me?\n\nUPDATE: Additional Javascript code from comments:\n\nfunction CheckAvailability() {\n $.post(\"/WebTeamReleaseDB/CheckAvailability\", {\n Username: $(\"#UserName\").val()\n }, function(data) {\n var myObject = eval('(' + data + ')');\n var newid = myObject;\n if (newid == 1) {\n $(\"#usernamelookupresult\").html(\"<font color='green'>Available :-D</font>\")\n } else {\n $(\"#UserName\").val(\"\");\n $(\"#usernamelookupresult\").html(\"<font color='red'>Taken :-(</font>\")\n }\n });\n}" ]
[ "jquery", "asp.net-mvc" ]
[ "showing bash: /usr/lib/jvm/java-7-oracle=/usr/lib/jvm/java-8-oracle: No such file or directory in terminal", "Whenever I open my terminal in my Kubuntu machine, I am getting the following shown on top: bash: /usr/lib/jvm/java-7-oracle=/usr/lib/jvm/java-8-oracle: No such file or directory\n\nThis is happening ever since I added the line: $JAVA_HOME=/usr/lib/jvm/java-8-oracle in my .bashrc file. Can someone please tell me how to debug what is the problem, and if possible, a possible fix for the same?" ]
[ "java", "linux", "bash", "jvm" ]
[ "HTTP POST mutli part \"BAD REQUEST\"", "I'm trying to upload a file using POST \n\nhere's my request :\n\nPOST /upload.php HTTP/1.1\nHost: localhost\nContent-Type: multipart/form-data; boundary=---------------------------552335022525\nContent-Length: 192\n-----------------------------552335022525\nContent-Disposition: form-data; name=\"userfile\"; filename=\"12.txt\"\nContent-Type: text/plain\n\n\nblabla\n-----------------------------552335022525--\n\n\nUsing HTTP live headers firefox plugin everything works \n\nbut when putting it a char *buffer and send it with winsocksapi I get 400 Bad Request error" ]
[ "c", "http-headers", "http-post", "winsock" ]
[ "Simple ASP.NET MVC Routing question", "I have two pages in my simple MVC App with two defined routes:\n\nroutes.MapRoute(\n \"Results\", // Route name\n \"Results/{id}\", // URL with parameters\n new { controller = \"Results\", action = \"Index\",\n id = \"\" } // Parameter defaults\n);\nroutes.MapRoute(\n \"Default\", // Route name\n \"{controller}/{action}/{id}\", // URL with parameters\n new { controller = \"Main\", action = \"Index\",\n id = UrlParameter.Optional } // Parameter defaults\n);\n\n\nI needed to have the results page load with just a product ID such as this: [MyDomain....]/Results/12345. But also the main page does a POST (using JQuery) to the Results Controller for updates using this route: [MyDomain....]/Main/Update along with a data bag. This works fine when I only have the \"Default\" route. But when I added the other \"Results\" route, all the POST calls to update are failing. Any ideas what I'm doing wrong???\n\nThanks a lot." ]
[ "asp.net-mvc", "asp.net-mvc-routing" ]
[ "Max # subdirectories on Linux box", "One of the things my Java application running on Linux is doing creating directories. All directories are created in /a/b/c, which at this point contains 31998 subdirs. \n\nEvidently this is enough to not allow any more to be created.\n\nWith this 2 questions:\n\n\nWhy?\nHow can i know what the max number is?" ]
[ "linux", "filesystems", "directory-structure" ]
[ "Selenium webdriver ruby assertTextPresent", "I have written a below code:\n\nrequire 'selenium-webdriver'\n\ndriver = Selenium::WebDriver.for(:firefox)\n\ndriver.navigate.to(\"http://www.yahoo.co.uk\")\n\nassert(@driver.find_element(:tag_name => \"body\").text.include?(\"News\"))\n\ndriver.find_element(:link_text, \"News\").click\n\ndriver.quit\n\n\nbut getting below error:\n\nC:/RubyTito/FirstRuby/RSpec.rb:4:in `<main>': undefined method `find_element' for nil:NilClass (NoMethodError)\n\n\nThe script opens the ff but stops at line 4. What i wanted to achieve is the script should open the ff find the News link (give some message TRUE) and then click on the news link." ]
[ "ruby", "selenium", "webdriver", "assert" ]
[ "\"Exception handling is not enabled.\"", "I am getting following error on compiling the code:\n\n...\\scl_config_win64.h(23) : fatal error C1189: #error : \"Exception handling is not enabled.\"\n\n\nI have tried to solve this error via Microsoft VS 2008 by using steps as follows: \n\nProperty Page --> Configuration Properties, C/C++, Code Generation --> Modify the Enable C++ Exceptions property Or, set Enable C++ Exceptions to YES, \nbut still I am facing this error while compiling the code.\n\nSo, can any one knows how to solve this error or any other way to solve this error ???" ]
[ "c++", "visual-c++" ]
[ "Why can't I call this.state in my redux reducer?", "I made a reducer that fetches admins, and I want it to display certain admins when I call it in my reducer but I am getting Undefined.\n\nI am still very new to redux so apologies for my mistakes.\nI tried to include all the relevant folders:\n\nApp.js\n\nimport React, { Component } from 'react';\nimport { connect } from 'react-redux';\nimport * as actions from '../store/actions';\n\nclass App extends Component {\n\n async componentDidMount() {\n\n fetch(constants.adminUrl + '/admins/data', {\n method: 'GET'\n }).then((res) => {\n return res.json()\n }).then(async (res) => {\n this.props.setAdminsInColumns(res.admins)\n }).catch((error) => {\n toast.error(error.message)\n })\n }\n\n\n render() {\n return (\n {/* SOME CODE */}\n );\n }\n}\n\nlet app = connect(null, actions)(App);\nexport default app;\n\n\ncolumnsReducer.js\n\nimport { FETCH_ADMINS } from '../actions/types'\nimport { Link } from 'react-router-dom'\nimport constants from '../../static/global/index'\nimport React from 'react';\nimport { toast } from 'react-toastify'\n\nconst initialState = {\n admins: [],\n{\n Header: \"Responsible\",\n accessor: \"responsibleAdmin\",\n style: { textAlign: \"center\" },\n// Place where I want to fetch certain admins and get undefined\n Cell: props => <span>{props.value && this.state.admins.name ? this.state.admins.find(admin => admin.id === props.value).name : props.value}</span>\n }\n}\n\nexport default function (state = initialState, action) {\n switch (action.type) {\n case FETCH_ADMINS:\n return { ...state, admins: action.admins}\n default:\n return state\n }\n}\n\n\n\nindex.js\n\nimport { FETCH_ADMINS } from \"./types\"\n\n/**\n* starts loader for setting admin\n*/\n\nexport const setAdminsInColumns = (admins) => async dispatch => {\n dispatch({ type: FETCH_ADMINS, admins })\n}\n\n\ntypes.js\n\nexport const FETCH_ADMINS = 'fetch_admins'\n\nWhen I console.log(action.admins) inside the switch case FETCH_ADMINS in the columnsReducer.js file, I can see all the admin information I want, is there a way to make the state global in the columnsReducer.js file so I can read it?\n\nAny help is appreciated!" ]
[ "reactjs", "redux" ]
[ "How to copy string in number format to another sheet?", "I'm trying to copy a file from one excel file to another. I want to copy the values in the cells (numbers stored as text) to new file as numbers itself. How to do it? I tried Range(\"A1\").NumberFormat = \"0\" but no luck. Please help me.\n\n Set myxl = CreateObject(\"Excel.Application\")\n myxl.Visible = True\n Set objWorkbook2 = myxl.Workbooks.Open(\"C:\\C.xlsx\")\n Set objWorkbook3 = myxl.Workbooks.Open(\"C:\\PC.xlsx\")\n Set objWorksheet = objWorkbook3.Worksheets(1)\n objWorksheet.Activate\n\n set objworksheet3 = objworkbook2.worksheets.add\n objworksheet3.name=\"Project_Overview\"\n Set objWorksheet2 = objWorkbook2.Worksheets(\"PC\")\n objWorksheet.Activate\n objWorkSheet.Range(\"A1:A10\").Copy\n objWorkSheet2.Paste objWorkSheet2.Range(\"A1\")\n objWorkSheet2.Range(\"A1\").NumberFormat = \"0\"\n\n objWorkbook2.Save \n objWorkbook2.Close\n\n myxl.Quit" ]
[ "excel", "vbscript", "vba" ]
[ "Apply background color to datatables row when expanded", "When the row is expanded, I want to change the background color of the row, but that doesn't happen all the time. I apply the class, but its not working as well. It only highlights the first row when I expand another row. Is there something I'm doing wrong. My code is below.\n\nvar table = $('#meterDataTable').DataTable();\nvar tr = $(this).closest('tr');\nvar row = table.row(tr);\n\nif (row.child.isShown()) {\n // This row is already open - close it\n row.child.hide();\n tr.removeClass('shown');\n tr.removeClass('highlightExpanded');\n} else {\n // Open this row\n var elementName = row.data()[0];\n row.child(metersAttributesCache[elementName]).show();\n tr.addClass('highlightExpanded');\n tr.addClass('shown');\n //$('#unitAttributeDataTable').DataTable({ \"bFilter\": false });\n $('.toggleCheckBox').bootstrapToggle({});\n}" ]
[ "javascript", "jquery", "datatables" ]
[ "How to persist when running a mysql on a kubernetes cluster", "I have a kubernetes cluster with three nodes. I need to deploy a mysql server to the cluster and I need persistence for that mysql. So when I redeploy or restart my pod it won't wipe the data.\n\nBut if I use a storageClass which uses azure-disk it will only be mounted to the host. \n\nmetadata:\n name: mysql-storage\nspec:\n accessModes: [ \"ReadWriteOnce\" ]\n storageClassName: \"managed-premium\"\n resources:\n requests:\n storage: 5Gi\n\n\nSo if I delete or redeploy the pod it could start up on another host where the disk is not mounted and then my data is gone.\n\nI tried changing the accessModes to ReadWriteMany but that failed when claiming the volume. Saying that it only supported ReadWriteOnce." ]
[ "kubernetes", "azure-storage" ]
[ "Tcl's snack returns garbage list of mixer inputs", "package require sound\nforeach jack [snack::mixer inputs] {\n puts $jack\n}\n\n\nI expected to get a list with identifiers like Line1, Mic, etc, but I get the following garbage:\n\nÐnf\n\n\nI wanted to build a dropbox list to choose a mixer input to record from. I am on Linux, using Tcl 8.6 and snack extension 2.2.10.\n\nAm I doing something wrong or this is a bug I should report upstream?" ]
[ "audio", "tcl", "toolkit" ]
[ "Invalid type signature in recursive data constructor", "So, following along with a sample code on streams, this fails to be loaded into ghci:\n\ndata MyStream a = MyStream a (MyStream a)\n\nintsFrom n :: MyStream Integer\nintsFrom n = MyStream n $ intsFrom $ n + 1\n\n\nGetting error:\n\nstream.hs:3:1:\n Invalid type signature: intsFrom n :: MyStream Integer\n Should be of form <variable> :: <type>\nFailed, modules loaded: none.\n\n\nAny ideas? Thanks!\n\nUpdate: If I just type intsFrom :: MyStream Integer I get error:\n\nstream.hs:4:1:\n The equation(s) for `intsFrom' have one argument,\n but its type `MyStream Integer' has none\nFailed, modules loaded: none." ]
[ "haskell" ]
[ "Google + AFOAuth2Client", "I'm trying to login on Google + through AFOAuth2Client (AFNetworking extension).\nI wrote this code : \n\nNSURL *url = [NSURL URLWithString:@\"https://accounts.google.com/\"];\nAFOAuth2Client *oauthClient = [AFOAuth2Client clientWithBaseURL:url clientID:@\"MY_ID\" secret:@\"MY_SECRET\"];\n\n[oauthClient authenticateUsingOAuthWithPath:@\"/o/oauth2/token\"\n parameters:@{@\"scope\": @\"https://www.googleapis.com/auth/plus.me\", @\"response_type\" : @\"code\", @\"redirect_uri\" : @\"https://www.domain.com/oauth2callback\"}\n success:^(AFOAuthCredential *credential) {\n NSLog(@\"I have a token! %@\", credential.accessToken);\n } failure:^(NSError *error) {\n NSLog(@\"Error: %@\", error);\n }];\n\n\nBut the error block is called with an invalid_request (Error 400).\nAm I missing something? (A missing parameter?)" ]
[ "ios", "objective-c", "oauth-2.0", "afnetworking" ]
[ "Cannot use custom permalinks in wordpress when proxying request to a sub folder", "We have a setup where a main site lives on one (aws) server, say www.example.com. We then run a wordpress blog on another aws server in the /blog subdirectory www.example.com/blog\nOn the main server, we proxy the /blog request to the other server with apache like:\n<VirtualHost *:443>\n...\nProxyPass /blog/ https://xx.xxx.x.xxx/siteA/\nProxyPassReverse /blog/ https://xx.xxx.x.xxx/siteA/\nProxyPass /blog https://xx.xxx.x.xxx/siteA/\nProxyPassReverse /blog https://xx.xxx.x.xxx/siteA/\n...\n</VirtualHost>\n\nThis works and the blog displays.... but only if the permalinks are set to 'plain'. If we set them to anything else then we just get a 404 response.\nTo further complicate matters, the blog server holds a number of different blogs in the following structure\n\n/var/www/blog/siteA\n/var/www/blog/siteB\n/var/www/blog/siteC\n\nThe virtual host setup on the blog server is:\n<VirtualHost *:443>\n...\nDocumentRoot /var/www/blog\n<Directory "/var/www/blog/siteA/">\nOptions Indexes FollowSymLinks\nAllowOverride all\nOrder allow,deny\nallow from all\nRequire all granted\n</Directory>\n...\n</VirtualHost>\n\nthe .htaccess file on the blog is:\n<IfModule mod_rewrite.c>\nRewriteEngine On\nRewriteBase /blog/\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . /blog/index.php [L]\n</IfModule>\n\nI've tried various combinations for the rewrite base and the virtual host setup but I can't seem to get anywhere - those custom permalinks never work." ]
[ "wordpress", "apache", "permalinks" ]
[ "Yodlee ASP.NET C# Integration", "I have read a thread regarding Yodlee implementation and on one of the responses a user said \"It is easy to intergrate your app with Yodlee API\" How exactly is it easy to implement Yodlee and integrate it with an existing C# Web App? I don't mind getting dirty, but I would like to know how hard can it get and is there forums out there and enough developer support? Please assist urgently as we need to test and implement Yodlee before the end of the month also note I am new to Yodlee and API integration.\n\nThanx in advance" ]
[ "yodlee" ]
[ "jquery validationEngine not working", "I am trying to implement jquery validation engine in jsp but it is not working for me.\nPlease see code below:\n\n<html lang=\"en\"><head>\n\n<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\" type=\"text/javascript\"></script>\n<script src=\"jquery.validationEngine-en.js\" type=\"text/javascript\"></script>\n<script src=\"jquery.validationEngine.js\" type=\"text/javascript\"></script>\n<script type=\"text/javascript\">\n\njQuery(document).ready(function(){\nalert(\"hi\");\njQuery(\"#empFrm\").validationEngine();\n});\n</script>\n\n<body>\n\n<form:form method=\"post\" action=\"\" name=\"empForm\" id=\"empFrm\">\n\n<input type=\"text\"large\" name=\"empId\" class=\"validate[required] text-input\" />\n...\n\n\nalert is coming but validation engine is not working." ]
[ "jquery", "jsp", "jquery-validation-engine" ]
[ "How to improve a Doctriny query to retrieve huge quantity of data?", "I'm working on a Symfony2 project using Doctrine.\nI created a function to retrieve stocks items.\nIt works well if my database contains less than 50 000 rows.\nHowever, my project needs to deal with more than 2 000 000 rows and If I use the following request, It needs more than 1 minutes to display my page.\n\nRepository (StockRepository.php) :\n\n public function findAllQuery() {\n\n $query = $this->createQueryBuilder('s')\n ->select(array('s','st','p')) \n ->join('s.store','st')\n ->join('s.product','p')\n ->orderBy('st.name','ASC'); \n return $query; \n\n }\n\n\nController (StockController.php) :\n\npublic function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('LiveDataShopBundle:Stock')->findAllQuery();\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $entities, $this->get('request')->query->get('page', 1), 50\n );\n\n return array(\n 'pagination' => $pagination,\n );\n }\n\n\nEntity (Stock.php) :\n\n<?php\n\nnamespace LiveData\\Bundle\\ShopBundle\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\n\n/** * Stock * * @ORM\\Table() *\n@ORM\\Entity(repositoryClass=\"LiveData\\Bundle\\ShopBundle\\Entity\\StockRepository\")\n*/ class Stock {\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"id\", type=\"integer\")\n * @ORM\\Id\n * @ORM\\GeneratedValue(strategy=\"AUTO\")\n */\n private $id;\n\n /**\n * @var \\stdClass\n *\n * @ORM\\ManyToOne(targetEntity=\"Store\", inversedBy=\"stocks\")\n * @ORM\\JoinColumn(name=\"store_id\", referencedColumnName=\"id\", onDelete=\"set null\")\n */\n private $store;\n\n /**\n * @var integer\n *\n * @ORM\\Column(name=\"quantity\", type=\"integer\")\n */\n private $quantity;\n\n /**\n * @var \\stdClass\n *\n * @ORM\\ManyToOne(targetEntity=\"Product\", inversedBy=\"stocks\")\n * @ORM\\JoinColumn(name=\"product_id\", referencedColumnName=\"id\", onDelete=\"set null\")\n */\n private $product;\n\n\n /**\n * Get id\n *\n * @return integer \n */\n public function getId()\n {\n return $this->id;\n }\n\n /**\n * Set store\n *\n * @param \\stdClass $store\n * @return Stock\n */\n public function setStore($store)\n {\n $this->store = $store;\n\n return $this;\n }\n\n /**\n * Get store\n *\n * @return \\stdClass \n */\n public function getStore()\n {\n return $this->store;\n }\n\n /**\n * Set quantity\n *\n * @param integer $quantity\n * @return Stock\n */\n public function setQuantity($quantity)\n {\n $this->quantity = $quantity;\n\n return $this;\n }\n\n /**\n * Get quantity\n *\n * @return integer \n */\n public function getQuantity()\n {\n return $this->quantity;\n }\n\n /**\n * Set product\n *\n * @param \\stdClass $product\n * @return Stock\n */\n public function setProduct($product)\n {\n $this->product = $product;\n\n return $this;\n }\n\n /**\n * Get product\n *\n * @return \\stdClass \n */\n public function getProduct()\n {\n return $this->product;\n } }\n\n\nAny idea to reduce the process time ?\n\nThanks in advance !" ]
[ "mysql", "symfony", "doctrine-orm" ]
[ "Rails ActiveAdmin and has_many association", "I am fairly new to active_admin, I was wondering if there is a way to achieve the following\n\nI have two models\n\nUser\n belongs_to :group\n\nGroup\n has_many :users\n\n\nI have successfully created pages in activeadmin for groups and users, now what I want is show users that belong to a certain group. I have button manage_members on groups index page which should show members of only that group. Where I can remove members from the group or add more members.\n\nThis is what I have been able to do so far \n\nmember_action :manage_members do\n @group = Group.find(params[:id])\n @page_title = \"Manage Groups > @#{@group.name}, Edit Members\"\nend\n\n\nand a the view app/vies/admin/groups/manage_users.html.arb\n\ntable_for assigns[:group].users do\n column \"Name\" do |u|\n u.user_id\n end\n column \"email\" do |u|\n u.user.email\n end\n column \"Created Date\" do |u|\n u.user.created_at\n end\n\n column \"OfficePhone\" do |u|\n u.user.office_no\n end\nend\n\n\nThis shows the member of the groups, but I have to do all the work on this page to add edit delete a member, I cannot have active_admin filters and other cool stuff here, this is like a custom page, \n\nIs there a way to have an index page (with all goodness of filters batch actions etc) ( like that of users ) but only showing users of a group. Something like a scoped index page which shows on users from a group and I have the same control over that page as any active admin index page ? More like the image below\n\n\n\nrather than having to do all that work my self which currently looks like \n\n\n\nVery new to active_admin so apologies if there something really straight forward that I am missing.\n\nThanks" ]
[ "ruby-on-rails", "ruby-on-rails-3", "activeadmin" ]