texts
sequence
tags
sequence
[ "PAYPAL : Send order to two email accounts", "I have built a system with Paypal for a client however the client has now asked once a customer has made an order if an email can be sent to them and also the warehouse so they can start packaging it.\n\nJust to make sure could this be achieved by adding another value in the html code like this:\n\n<input type=\"hidden\" name=\"business\" value=\"[email protected]\" value=\"[email protected]\">\n<input type=\"hidden\" name=\"currency_code\" value=\"GBP\">\n<input type=\"hidden\" name=\"item_name\" value=\"Personal Built Board 27 Inch\">\n<input type=\"hidden\" name=\"amount\" value=\"44.50\">\n\n\n.... and so on" ]
[ "email", "paypal", "payment" ]
[ "BigQuery Node API is much slower than the GUI", "A query run with the Node Api is about 25 times slower than the same query run in the GUI. Am I missing something? I use the .query() function in Node. As an example running this query on the GUI takes about 13 secs.\n\n#standardSQL\nSELECT\n repository.url,\n repository.has_downloads\nFROM\n `bigquery-public-data.samples.github_nested`\n\n\nThis query returns 2.5 million rows. The equivalent Node code takes about 336s and looks like this;\n\nconst BigQuery = require(\"@google-cloud/bigquery\")\n\nconst query = `\nSELECT\n repository.url,\n repository.has_downloads\nFROM \\`bigquery-public-data.samples.github_nested\\``\n\nnew BigQuery({\n projectId: \"project-id\",\n})\n .query({\n query: query,\n useLegacySql: false,\n })\n .then(console.log)\n .catch(console.error)" ]
[ "google-bigquery" ]
[ "Create a Table for a user account in java using sql", "I am having issues running a statement in java that should give me a unique table for every new user account that is created. I get a syntax error on the Create Table statement and from what I have checked so far, everything seems to be in order. I am thinking there might be a bug in XAMMP or phpmyadmin which are the tools I am using for the database. Here is the code:\n\npublic static void CreateAccount(){\n\n\n\n try{\n Class.forName(\"com.mysql.jdbc.Driver\");\n System.out.println(\"Driver loaded\");\n\n Connection connection=DriverManager.getConnection\n (\"jdbc:mysql://localhost/users\", \"root\", \"\");\n System.out.println(\"Database connected\");\n\n\n Statement statement=connection.createStatement();\n statement.execute\n (\"CREATE USER '\"+user+\"'@'localhost' IDENTIFIED BY '\"+password+\"'; \"+\n \"CREATE TABLE \"+user+\" (AccountID int, FirstName varchar (255), LastName varchar (255), Age int); \"\n + \"GRANT SELECT, INSERT, UPDATE, DELETE ON USERS.\"+user+\" TO '\" +user+\"'@'localhost';\"\n\n +\"INSERT INTO\"+user+\"VALUES (1, '\"+FirstName+\"' ,'\"+LastName+\"',\"+Age+\");\");\n\n\n\n\n}catch (SQLException | ClassNotFoundException a){\nJOptionPane.showMessageDialog(null,\"Can't connect to database\");\na.printStackTrace();\n}\n}\n\n\nHere is the error message:\n\ncom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE mark (AccountID int, FirstName varchar (255), LastName varchar (255' at line 1\nat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\nat sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)\nat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\nat java.lang.reflect.Constructor.newInstance(Unknown Source)\nat com.mysql.jdbc.Util.handleNewInstance(Util.java:406)\nat com.mysql.jdbc.Util.getInstance(Util.java:381)\nat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)\nat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)\nat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)\nat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)\nat com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)\nat com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)\nat com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)\nat com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)\nat com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:734)\nat SimpleJdbc.CreateAccount(SimpleJdbc.java:54)\nat Basic.main(Basic.java:113)" ]
[ "java", "mysql", "sql", "syntax-error" ]
[ "MATLAB: Area and centre of mass of a plotted figure", "I have made a function that allows a user to draw several points and interpolate those points. I want the function to calculate the centre of mass using this vector :\n\n\nI think I should therefore first calculate the area of the figure (I drew this example to illustrate the function output). I want to do this using Green's theorem \n\n\nHowever since I'm quite a beginner in MATLAB I'm stuck at how to implement this formula in order to find the centre of mass. I'm also not sure how to get the data as my output so far is only the x- and y cordinates of the points.\n\nfunction draw\nfig = figure();\nhax = axes('Parent', fig);\naxis(hax, 'manual')\n[x,y] = getpts();\n\nM = [x y]\n\nT = cumsum(sqrt([0,diff(x')].^2 + [0,diff(y')].^2));\n\nT_i = linspace(T(1),T(end),1000);\n\nX_i = interp1(T,x',T_i,'cubic');\nY_i = interp1(T,y',T_i,'cubic');\n\nplot(x,y,'b.',X_i,Y_i,'r-')\nend" ]
[ "matlab" ]
[ "Resize image to original versions", "I am using carrierwave and mini magick. In the uploader i have\n\nprocess resize_to_fit: [300,200] \n\n\nNow, all the uploaded images were processed, but I now i need the original version. Is there a way to write a migration and restore the image version?" ]
[ "ruby-on-rails", "ruby-on-rails-3", "carrierwave", "minimagick" ]
[ "Conditionally display math formulas with variables in R Markdown", "I have a problem with rendering formulas with variables in R markdown.\nHere is the variables that I using (simple example):\n```{r, include=FALSE}\nseries <- c(1, 2, 3, 4)\ncount <- leng(series)\nsum <- sum(series)\nsum2 <- sum(series^2)\nsq_formula <- TRUE\n\nMy problem is to print in Rmd (output = Word) math expression with knitr like:\n$$S = \\frac{\\sum{S}}{n} = \\frac{`r sum`}{`r count`} = `r mean(series)`$$\n\nif sq_formula is FALSE, otherwise it should be:\n$$S = \\frac{\\sum{S^2}}{n} = \\frac{`r sum2`}{`r count`} = `r sum2 / count`$$\n\nThere is a way to write formulas in R chunk and print it by condition, like:\n```{r, include=FALSE}\nformula1 <- '$$ \\\\overline{S} = \\\\frac{\\\\sum{S}}{n} = \\\\frac{\\\\sum{`r sum`}{`r count`}}$$'\nformula2 <- '$$ \\\\overline{S} = \\\\frac{\\\\sum{S^2}}{n} = \\\\frac {\\\\sum{`r sum2`}}{`r count`}$$'\n\n\n`r if (sq_formula <- TRUE) {formula1} else {formula2}`\n\nbut I can't insert the variables like r sum, r count inside the chunk.\nI also tried to handle the problem with sprintf function, but haven't found a way to insert the variables in strings in math notation. So I would be grateful for any help." ]
[ "r", "math", "markdown", "knitr" ]
[ "Add multiple image preview and delete React", "I have a code where I upload only 1 image and show it but I need to upload a maximum of 5 images and be able to delete them, I don't know how to make it possible to upload more images and be able to show them in img tags\nthis would be my code in which I can upload only one image and show it\nimport React, { useState } from "react";\n import "./styles.css";\n \n const SingleImageUploadComponent = () => {\n const [file, setFile] = useState(null);\n \n function uploadSingleFile(e) {\n setFile(URL.createObjectURL(e.target.files[0]));\n console.log("file", file);\n }\n \n function upload(e) {\n e.preventDefault();\n console.log(file);\n }\n \n return (\n <form>\n <div className="form-group preview">\n {file && <img src={file} alt="" />}\n </div>\n \n <div className="form-group">\n <input\n type="file"\n className="form-control"\n onChange={uploadSingleFile}\n />\n </div>\n <button\n type="button"\n className="btn btn-primary btn-block"\n onClick={upload}\n >\n Upload\n </button>\n </form>\n );\n };\n \n export default SingleImageUploadComponent;\n\nAs I mentioned earlier I need to upload a maximum of 5 images and show them in 5 img tags since they have where I show them they have css styles\nIf someone could help me it would be excellent, thank you very much" ]
[ "javascript", "reactjs", "image", "input" ]
[ "How to show up the second screen again", "I have an application with a very simple UI. Most of the work (bulk processing of images) is done in background using AsyncTask.\n\nIt just has two Actvities. The first Activity(MainScreen) lets user make some choices and then fires off the job. The second screen(ProgressScreen) shows the current status of the job with a progressbar and messages.\n\nIt works fine.\n\nHere's the problem. The background task can take hours. If the user selects \"back\" button, while on ProgressScreen, the background task is still continuing. \n\nLater if he wants to go back & see progress, there's no way to do it. It I restart the app, it goes to the MainScreen, not the ProgressScreen. I know the background task is going on, since for now I am logging in logcat a message about each image being processed, but I just don't see a way to go back to ProgressScreen.\n\nI have looked around, I think I need to put something in the onStop() & onRestart() of the ProgressScreen, but not sure what...\n\nI should mention, that this application not for general public, but is for internal use only. (We need to compare the image processing done by Android to those done by other systems)." ]
[ "android" ]
[ "Creating environment datatype in Haskell", "In order to obtain honors credit for a course, I have been tasked with recreating an assignment we completed in ML (using the SMLNJ implementation), but using haskell instead. The goal here is to create a datatype environment that binds values to strings.\n\nThe type declaration in ML is:\n\ntype 'a Env = string -> 'a;\n\n\nThe basic functions created are env_new() which creates an empty environment, and env_bind() which takes an environment, string, and value and binds the string to the value while returning a new environment. \n\nTest showing the ML functionality are as follows:\n\n- val e1 = env_new() : int Env;\nval e1 = fn : int Env\n- val e2 = env_bind e1 \"a\" 100;\nval e2 = fn : int Env\n- val e3 = env_bind e2 \"b\" 200;\nval e3 = fn : int Env\n- e1 \"a\";\nuncaught exception NameNotBound\n- e2 \"a\";\nval it = 100 : int\n- e3 \"a\";\nval it = 100 : int\n\n\nMy current declaration of this type in Haskell and related functions is:\n\ndata Env a = Env String a\n\nenvNew :: a -> Env a\nenvNew a = Env a\n\nenvBind :: Env a -> String -> a -> Env a\nenvBind environment name value = Env name value\n\n\nI am having a very hard time figuring out the proper syntax for these definitions. Please respond with any hints that would help me make progress on this. Keeping in mind that this is for honors credit - I do not expect any full solutions but simply some assistance (not that I would reject solutions)." ]
[ "haskell", "types", "smlnj", "ml", "environments" ]
[ "How to replace the text between 2 characters?", "I want to remove the content between 2 characters in a text with Visual C#. \nHere is an example:\n\n\n Given: Hi [everybody], I'm 22 years old, I'm a student [at a University of Technology] in Vietnam \n Result: Hi, I'm 22 years old, I'm a student in Vietnam\n\n\nI use this syntax\n\nstring input = \"Hi [everybody], I'm 22 years old, I'm a student [at a University of Technology]\";\nstring regex = \"(\\\\[.*\\\\])\";\nstring output = Regex.Replace(input, regex, \"\");\n\n\nbut the code is remove all between the first and the last square brackets, so this is the result: \n\n\n Hi in Vietnam\n\n\nHow can I fix it ?" ]
[ "c#", ".net", "regex", "string" ]
[ "Adobe Analytics visitorID overwriting with s_vi value", "I need to put the default \"s_vi\" cookie value (for ex: [CS]v1|2B54ED85051D673D-400019096000016D[CE]) into the s.visitorID variable, in a cross-domain tracking scenario.\n\nUnfortunately, seems this var does not accept hyphen (\"-\") values, and the \"s_vi\" one is including it.\n\nThis was my reference: https://marketing.adobe.com/resources/help/en_US/sc/implement/visitorID.html\n\nHow achieving this overwriting so?\n\nThanks" ]
[ "tags", "adobe", "analytics", "adobe-analytics" ]
[ "How can I load an editTEXT for each option in the drop-down list so that I can define the inputType and enter type (text, number)", "Good ... I have a query I am making an interface in android studio and my idea is to put a drop-down list that indicates the options of (text, number), and I would like to link it with an editText where I will enter the data according to the option you choose. and I would like to know how I can show an editTEXT for each option in the drop-down list so that I can define the inputType for each editText for each type option (text, number).\n\n`<EditText\n android:id="@+id/content"\n android:layout_width="match_parent"\n android:layout_height="wrap_content"\n android:layout_below="@id/cLabel"\n android:lines="3"\n android:maxLines="4"/>\n\n <TextView\n android:id="@+id/cLabel1"\n android:layout_width="wrap_content"\n android:layout_height="wrap_content"\n android:layout_below="@id/content"\n android:layout_marginTop="10dp"\n android:text="Actividad" />\n\n <Spinner\n android:id="@+id/tagType"\n android:layout_width="wrap_content"\n android:layout_height="wrap_content"\n android:layout_below="@id/cLabel1"\n android:layout_marginTop="14dp" />\n\n`\n\n\nThe idea is like the image, I would like that when choosing another option from the drop-down list it shows me a different message in the android: hint and in the same way to be able to put the inputType for each option in the editText." ]
[ "android", "xml" ]
[ "Debug Rails Active Record Query", "Is there a way debug ActiveRecord queries before they are executed rather than after?" ]
[ "ruby-on-rails", "activerecord" ]
[ "Converting integer to binary for SPI transfer", "I am trying to convert an integer to 3 bytes to send via the SPI protocol to control a MAX6921 serial chip. I am using spi.xfer2() but cannot get it to work as expected.\nIn my code, I can call spi.xfer2([0b00000000, 0b11101100, 0b10000000]) it displays the letter "H" on my display, but when I try and convert the int value for this 79616, it doesn't give the correct output:\nval = 79616\nspi.xfer2(val.to_bytes(3, 'little'))\n\nMy full code so far is on GitHub, and for comparison, this is my working code for Arduino.\nMore details\nI have an IV-18 VFD tube driver module, which came with some example code for an ESP32 board. The driver module has a 20 output MAX6921 serial chip to drive the vacuum tube.\nTo sent "H" to the second grid position (as the first grid only displays a dot or a dash) the bits are sent to MAX6921 in order OUT19 --> OUT0, so using the LSB in my table below. The letter "H" has an int value 79616\nI can successfully send this, manually, via SPI using:\nspi.xfer2([0b00000000, 0b11101100, 0b10000000])\n\nThe problem I have is trying to convert other letters in a string to the correct bits. I can retrieve the integer value for any character (0-9, A-Z) in a string, but can't then work out how to convert it to the right format for spi.xfer() / spi.xfer2()\nMy Code\ndef display_write(val):\n spi.xfer2(val.to_bytes(3, 'little'))\n\n# Loops over the grid positions\ndef update_display():\n global grid_index\n\n val = grids[grid_index] | char_to_code(message[grid_index:grid_index+1])\n\n display_write(val)\n\n grid_index += 1\n if (grid_index >= 9):\n grid_index = 0\n\nThe full source for my code so far is on GitHub\nMap for MAX6921 Data out pins to the IV-18 tube pins:\n\n\n\n\nBIT\n24\n23\n22\n21\n20\n19\n18\n17\n16\n15\n14\n13\n12\n11\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1\n\n\n\n\nIV-18\nG9\nG8\nG7\nG6\nG5\nG4\nG3\nG2\nG1\nA\nB\nC\nD\nE\nF\nG\nDP\n\n\n\n\n\n\n\n\n\nMAX6921\n0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n\n\n\n\n\n\n\n\nIV-18 Pinout diagram" ]
[ "raspberry-pi", "spi" ]
[ "Laravel response is String instead of int", "public function create(Request $request){\n $comment = new Comment;\n $comment->user_id = Auth::user()->id;\n $comment->post_id = $request->id; //here is where the response is string\n $comment->comment = $request->comment;\n $comment->save();\n $comment->user;\n\n return response()->json(\n $comment,\n );\n}\n\nI dont know why the reponse is string id and in the database migration the post_id table is $table->unsignedBigInteger('post_id'); it suppose to be integer..\n{\n"user_id": 4,\n"post_id": "2", //response is string \n"comment": "test string id finale",\n"updated_at": "2020-10-31T19:55:49.000000Z",\n"created_at": "2020-10-31T19:55:49.000000Z",\n"id": 11,\n}" ]
[ "php", "laravel" ]
[ "How to enable console logging for MongoDB errors?", "I am developing a NodeJS application. I had a problem saving an object to the database; the code in my controller was:\n\nconsole.log(\"Before save: \" + transaction);\ntransaction = await transaction.save();\nconsole.log(\"After save\");\n\n\nIn the terminal running the Node application, I saw:\n\n\nBefore save: {\n _id: ...,\n created: ...,\n ...\n}\n\n\nand nothing more, while the browser page looks like it's loading.\n\nI tried wrapping it in a try-catch block:\n\ntry {\n transaction = await transaction.save();\n} catch (err) {\n console.log(err);\n}\n\n\nand I get the same output in the terminal. I suppose that since I don't see the error in the console without the try-catch, I don't see it with it either.\n\nOne problem was that the MongoDB collection for that object did not exist (and I asked about it here). But I still have another error.\n\nHow can I enable MongoDB to show those errors (missing collection, and the error I am still looking for) in the terminal running NodeJS while I'm in development?" ]
[ "node.js", "mongodb", "logging" ]
[ "How to say to aws \"Here is my docker-compose file, create instances based on that just like docker-compose build does\"?", "I've been searching for an answer to this question for quite some time now. I've read almost every official aws written tutorial on their services and watched several youtube videos, read some third party tutorials on the subject but there doesn't seem to be a simple easy-to-follow solution to this. Then I tried to search on stackoverflow and although there are 2-3 similiar questions they are either not an exact problem or their solutions are not applicable/understandable and require further explanations.\n\nProblem:\n\nOn my PC I do docker-compose build and then docker-compose up and voila, I have my instances up and running without problems.\n\nI want to do the exact same thing but so that every service in docker-compose.yml file starts on its own EC2 Instance (or whichever service that AWS offers). Then I want to be able to change my code and push it to github/gitlab/bitbucket (in my case gitlab) and for it to be deployed to my instances.(but this goes into topic about CI/CD so not important for this exact question)\n\nI think that most of people who are used to docker and docker compose and want to start using AWS will or already have encountered this problem.\n\nA step by step solution( or at least a link or pointing me in the right direction) would be really useful because at the moment there is just too much information on EC2, ECR, ECS, IAM and bunch of other stuff and for a beginner in the AWS world it is really really hard to understand and follow.\n\nEDIT:\n\nI know that it probably isn't that simple but a solution must exists even if it is something as cumbersome as creating every single service by itself on ECS (as mentioned in comments). If it is the only way then sure, I all for it, and I did try several of those tutorials but still didn't succeed in my goal." ]
[ "amazon-web-services", "docker", "docker-compose", "amazon-ecs" ]
[ "How to add a specific sidebar to meteor route?", "For example I have an admin area and I want to display a specific sidebar for admin navigation\n\n<body>\n {{#if adminRoute}}\n {{> sidebarAdminNav }}\n {{> yeld }}\n {{else}}\n {{> yeld }}\n {{/if}\n</body>" ]
[ "meteor", "routes", "handlebars.js" ]
[ "TypeError: 'float' object is not callable. What does it mean?", "this is my code but when i try to run it is says: TypeError: 'float' object is not callable.\nWhy is that? Can anyone help me?\nimport numpy\n\neps = 0.0102985\nsig = 3.4\n\nfor r in numpy.arange(3, 6.05, 0.05):\n V = 4*eps((sig/r)**12 - (sig/r)**6)\n print('{} \\n {}'.format(r, V))" ]
[ "python", "typeerror" ]
[ "Query Optimization Problems (spatial)", "I have two datasets with spatial data.\n\nDataset 1 has approximately 15,000,000 records.\nDataset 2 has approximately 16,000,000 records.\n\nBoth are using the data type geography (GPS coordinates) and all records are points.\n\nBoth tables have spatial indexes with cells_per_object = 1 and the levels are (HIGH, HIGH, HIGH, HIGH)\n\nAll points are located in a, globally speaking, small area (1 U.S. state). The points are spread out enough to warrant using geography rather than a projection to geometry.\n\nDECLARE @g GEOGRAPHY\nSET @g = (SELECT TOP 1 GPSPoint FROM Dataset1)\n\nEXEC sp_help_spatial_geography_index 'Dataset1', 'Dataset1_SpatialIndex', 0, @g\n\n\nShows\n\npropvalue-propname\n 1-Total_Number_Of_ObjectCells_In_Level0_For_QuerySample\n 28178-Total_Number_Of_ObjectCells_In_Level1_In_Index\n 1-Total_Number_Of_ObjectCells_In_Level4_For_QuerySample\n14923330-Total_Number_Of_ObjectCells_In_Level4_In_Index\n 1-Total_Number_Of_Intersecting_ObjectCells_In_Level1_In_Index\n 1-Total_Number_Of_Intersecting_ObjectCells_In_Level4_For_QuerySample\n14923330-Total_Number_Of_Intersecting_ObjectCells_In_Level4_In_Index\n 1-Total_Number_Of_Border_ObjectCells_In_Level0_For_QuerySample\n 28177-Total_Number_Of_Border_ObjectCells_In_Level1_In_Index\n 740-Number_Of_Rows_Selected_By_Primary_Filter\n 0-Number_Of_Rows_Selected_By_Internal_Filter\n 740-Number_Of_Times_Secondary_Filter_Is_Called\n 1-Number_Of_Rows_Output\n99.99504-Percentage_Of_Rows_NotSelected_By_Primary_Filter\n 0-Percentage_Of_Primary_Filter_Rows_Selected_By_Internal_Filter\n 0-Internal_Filter_Efficiency\n0.135135-Primary_Filter_Efficiency \n\n\nWhich means that the query\n\nDECLARE @g GEOGRPAHY\nSET @g = (SELECT TOP 1 GPSPoint FROM Dataset1)\n\nSELECT TOP 1\n *\nFROM\n Dataset2 D\nWHERE\n @g.Filter(D.GPSPoint.STBuffer(1)) = 1\n\n\nTakes almost an hour to complete.\n\nI have also tried doing\n\nWITH TABLE1 AS (\n SELECT\n A.RecordID,\n B.RecordID,\n RANK() OVER (PARTITION BY A.RecordID ORDER BY A.GPSPoint.STDistance(B.GPSPoint) ASC) AS 'Ranking'\n FROM\n Dataset1 A\n INNER JOIN\n Dataset2 B\n ON\n B.GPSPoint.Filter(A.GPSPoint.STBuffer(1)) = 1\n AND A.GPSPoint.STDistance(B.GPSPoint) <= 50\n)\n\nSELECT \n *\nFROM\n TABLE1\nWHERE\n Ranking = 1\n\n\nWhich ends up being about 1,000 times faster, but at that rate what I am trying to do will take a query running for six months to complete. I honestly do no know what to do at this point. The end goal is to do a nearest neighbor search for every record in dataset1 to find the closest point in dataset2, but like this it seems impossible.\n\nDoes anyone have any ideas where I could improve the efficiency of this process?" ]
[ "sql", "sql-server", "spatial", "spatial-index" ]
[ "Composer development with local Dependencies", "I'm working on two connected PHP project at the same time (let's call them, kernel, api) and I'm using composer to manage dependecies.\n\nNeedless to say, api needs kernel to run but I cannot, at least during development phase, to upload on packagist every commit and then update the api's dependencies.\n\nIs there a way to, say to composer, while dev mode is enabled, take the dependence kernel from a local path?" ]
[ "php", "composer-php" ]
[ "TGPImage with transparent color?", "headingGPImage := TGPImage.Create('heading.bmp');\n\n\nthe heading.bmp image has no true transparency, but one of the colors should be considered as transparent. How to do this with TGPImage so that it will be transferred with\n\nvar\n GPGraphics: TGPGraphics;\nbegin\n GPGraphics.DrawImage(headingGPImage, slider3.Position * 4, 200);\nend;\n\n\nusing transparent color?" ]
[ "delphi", "transparency", "gdi+" ]
[ "Remove particular string from url Jquery", "I need to remove size i.e. resolution of image path from url. Take following example:\n\nhttp://raudevlocal.com/wp/wp-content/uploads/2017/05/0000362_chocolate-layer-cake-1024x682.jpeg\n\n\nI need to remove -1024x682\n\nhttp://raudevlocal.com/wp/wp-content/uploads/2017/05/rohit-300x118.jpg\n\n\nNeed to remove -300x118" ]
[ "javascript", "php", "jquery", "url", "explode" ]
[ "Convert Year Hour Date Interval to Number of Days", "I have an interval of 0012-11-03 (year-month-day) and would like to convert it to number of days: \n\n12 * ~365 + Num of days From 01-01 To 11-03 = answer. \n\nLeap year must be accounted for. (answer + 12/4 ??) \n\nThe closest thing I could come up with is using TO_DAYS() MySQL 5.1 but that function \"does not take into account the days that were lost when the calendar was changed\"" ]
[ "mysql", "date", "mysql-5.1" ]
[ "Writing Pandas Data Frame live to Excel file (.XLSX) using xlwings", "I have to see the excel file getting updated live with my pandas data frame that is being read from a CSV file.\n\nBelow is my CSV file. And I am reading the CSV with the help of pandas, but I am not sure how to put this into an Excel file.\n\n\n\nThanks in advance!" ]
[ "python", "excel", "pandas", "xlwings" ]
[ "How to show hidden text in both direction", ".hidden-text {\n display: none;\n visibility: hidden;\n}\n.div-hover-item:hover .hidden-text {\n display: block;\n visibility: visible;\n}\n\n\nI am trying to achieve the function when cursor hover around the text , the hidden text will be show up. Here is the code, and it actually works.\n\nNow when you move the cursor around the text, the hidden text will be show up in the top direction, but i want to change the direction to the bot so it means when you hover on the text, the hidden text will be come down, not top.\n\nbefore after Maybe my describe is not clear, so here i will tell more details. in the pictures i upload is the hover effect work now. What i want to change is to make the container and hidden text go down of the pictures. it just like write down something under the VR photo title. but it should be out of the pictures." ]
[ "html", "css" ]
[ "Associative arrays: I'm trying to figure out what's happening in this snippet of code", "So, I'm fairly new to perl and want to understand the underlying concepts illustrated in the following code:\n\nwhile (my ($key,$val)=each%{$vec1}){\n $num += $val*($$vec2{$key} || 0);\n}\n\n\nWhere vec1, vec2 are associative arrays. I especially want to understand what's going on with: \n\neach%{$vec1} and $$vec2{$key}\n\n\nI knew that it was something to do with referencing/dereferencing hashes, so I found this link:\nhttp://www.thegeekstuff.com/2010/06/perl-hash-reference/, but I don't really understand what's going on.\n\nThanks in advance." ]
[ "perl" ]
[ "How to maintain similar look and feel of iOS app on older and newer iPhones", "I have been an iOS developers for a few years. But unfortunately have not developed any product from scratch, but mainly involved in feature implementation and bug fix hence was not able to convincingly answer few questions. Can you please answer the questions (or point me to relevant source) that I was asked during an interview?\n\n\nHow would you design your iOS app so that you make sure that they have similar look and feel in older iPhones (4S, 5 etc) and the newer iPhones (6S, 6S+) which have bigger screens?\n\nMy answer was that we provide images of different resolution (higher resolution for the bigger devices) and name them as per the naming convention defined by apple. \nHe was not so convinced with my answer. \nAre there other aspects than just images that need to be taken care of?\nThere are few functionality and controls and api's that are available in the latest iOS SDK but not in the older once. How would you enable/disable the supported feature in your code depending on the iOS version?\n\nAnswer: I would define an macro containing iOS sdk version number check. I would use this macro to check if the current sdk supports this feature or functionality and then make the api call or add/hide the control. \n\nAre there other efficient and easier ways to achieve the same i mean by not using sdk version check?" ]
[ "ios", "objective-c", "iphone", "xcode", "sdk" ]
[ "(C# WinFoms) Writing files and New line", "I'm making changes to a file, the 'source' file is a plain text file, but from a UNIX system.\n\nI'm using a StreamReader to read the 'source' file, I then make and store the changes to a StringBuilder using AppendLine().\n\nI then create a StreamWriter (set-up with the same Encoding as the StreamReader) and write the file.\n\nNow when I compare the two files using WinMerge it reports that the carriage return characters are different.\n\nWhat should I do to ensure that the carriage return characters are the same for the type of file that I am editing? \n\nIt should also be noted that the files that are to be modified could come from any system, not just from a UNIX system, they could equally be from a Windows system - so I want a way of inserting these new lines with the same type of carriage return as the original file\n\nThanks very much for any and all replies.\n\n:)" ]
[ "c#", "winforms", "file-io" ]
[ "Why isn't my global variable recognised in other modules in Excel VBA?", "This is what I have in the \"ThisWorkbook\" module:\n\nOption Explicit\n\nPublic wbReport As Workbook\n\nPrivate Sub Workbook_Open()\n Set wbReport = ActiveWorkbook\nEnd Sub\n\n\nI have the following macro in the module corresponding to a cetain worksheet, I want it to activate when the values of certain cells change:\n\nPrivate Sub Worksheet_Change(ByVal Target As Range)\n Dim KeyCells As Range\n\n Set KeyCells = wbReport.Range(\"inspection_number\")\n\n etc. \n .\n .\n .\nEnd Sub\n\n\nHowever, when this macro is activated, I get an runtime error '424' as if the wbReport global variable had never been established.\n\nAny suggestions?" ]
[ "vba", "excel" ]
[ "Listing subclasses doesn't work in Ruby script/console?", "This works:\n\n>> class Foo \n>> def xyz()\n>> Foo.subclasses\n>> end\n>> end\n=> nil\n>> class Bar < Foo\n>> end\n=> nil\n>> class Quux < Bar\n>> end\n=> nil\n>> Foo.new.xyz()\n=> [\"Quux\", \"Bar\"]\n\n\nBut this doesn't. User is a class in my application.\n\n>> User.subclasses\nNoMethodError: protected method `subclasses' called for #<Class:0x20b5188>\n from [...]/vendor/rails/activerecord/lib/active_record/base.rb:1546:in `method_missing'\n from (irb):13\n\n\nBut this does!\n\n>> Foo.subclasses\n=> [\"Quux\", \"Bar\"]\n\n\nWhat's going on here? How would I list the subclasses of User?" ]
[ "ruby-on-rails", "ruby", "subclass", "groovy-console" ]
[ "XIB backed View with Subclassing", "I have a UITableViewCell defined in a XIB (with outlets setup) and the custom class set to 'CustomTableViewCell'. I'm now looking to subclass the 'CustomTableViewCell' with a 'SubclassCustomTableViewCell', however I'd like to use the same XIB (and not need to redefine my view. Is this possible? I currently have:\n\n+ (SubclassCustomTableViewCell *)create\n{\n // Create undefined cell.\n id cell = nil;\n\n // Iterate over NIB and find a matching class.\n NSBundle *bundle = [NSBundle mainBundle];\n NSArray *cells = [bundle loadNibNamed:@\"CustomTableViewCell\" owner:nil options:nil];\n for (cell in cells) if ([cell isKindOfClass:[self class]]) break;\n\n // Return cell.\n return cell;\n}\n\n\nBut I can't figure out to to get it to return anything but the parent." ]
[ "iphone", "objective-c", "cocoa-touch" ]
[ "Title on center,Image on right corner in actionbar", "I am working on android app, I created the custom action bar. But It is not coming right. It is coming like this http://imgur.com/QsjaStC . I want image at the right corner.\nI dont know why android:gravity=\"end\" not working\n\nCodes:\n\ncom.actionbarsherlock.app.ActionBar actionBar = getSupportActionBar();\n /*Dynamically Load Image on ActionBar of the user.... Here R.drawable is extracted into ID from iconfile as string */\n Resources res = this.getResources(); \n int resID = res.getIdentifier(this.iconFile, \"drawable\", this.getPackageName());\n getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME); \n actionBar.setCustomView(R.layout.abs_message);\n com.mikhaellopez.circularimageview.CircularImageView img = (CircularImageView) findViewById(R.id.header_image);\n img.setImageResource(resID);\n TextView txt = (TextView) findViewById(R.id.header_name);\n txt.setText(sender);\n\n actionBar.setHomeButtonEnabled(true);\n\n\nabs_message.xml :\n\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"wrap_content\"\nandroid:layout_height=\"match_parent\"\nandroid:orientation=\"horizontal\"\n >\n\n <TextView\n android:id=\"@+id/header_name\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"center\"\n android:maxHeight=\"1dp\"\n android:maxLines=\"1\"\n android:paddingLeft=\"75dp\"\n android:paddingRight=\"48dp\"\n android:textColor=\"#FFFFFF\"\n android:textSize=\"15sp\"\n android:text=\"Joe miller\"\n android:layout_marginTop=\"12sp\"\n />\n\n\n<com.mikhaellopez.circularimageview.CircularImageView\n android:id=\"@+id/header_image\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"match_parent\"\n android:gravity=\"end\"\n android:contentDescription=\"@string/app_name\"\n app:border_color=\"#01DF01\"\n app:border_width=\"1dp\"\n android:layout_alignParentTop=\"true\"\n android:padding=\"8dp\"\n android:src=\"@drawable/online\"\n />\n</RelativeLayout>" ]
[ "android", "xml", "android-layout", "actionbarsherlock" ]
[ "Clear the filled data of form in Phalcon Framework", "I am new to phalcon and trying to learn this framework. I have created a simple form. Now, When I fill up the form, I am able to store the data in database. After submitting the form I want to be on the same page. Now the issue is, form is still have the filled data it is not clearing up. I have googled and found the clear() method to clear the form data but it seems that its not working. What to do?\n\nHere is my code\n//Controller\n\nuse Phalcon\\Mvc\\Controller;\nclass ProfileController extends Controller\n{\n public function indexAction()\n {\n\n // Add some local CSS resources\n $this->assets->addCss(\"css/styles.css\");\n $this->assets->addCss(\"css/bootstrap.min.css\");\n\n // And some local JavaScript resources\n $this->assets->addJs(\"js/jquery.js\");\n $this->assets->addJs(\"js/bootstrap.min.js\");\n\n }\n\n public function createAction(){\n\n //create object of model class\n $profile = new Tbl_profile();\n\n $profile->fname= $this->request->getPost('firstname');\n $profile->lname= $this->request->getPost('lastname');\n $profile->email= $this->request->getPost('email');\n $success=$profile->save();\n\n if($success) {\n $this->flash->success(\"Profile created!\");\n //redirect to same page.\n\n $this->dispatcher->forward(['action' => 'index']);\n }else {\n\n }\n\n\n }\n}\n\n\n//views \n\n<html>\n<head>\n <title>Title</title>\n <?php $this->assets->outputCss(); ?>\n</head>\n<body>\n <h4 class=\"ml-5 mt-2\"> Create Profile</h4>\n <?php echo $this->getContent(); ?>\n <?php echo $this->tag->form(\"profile/create\") ?>\n <table class=\"table\">\n <tbody>\n <tr scope=\"row\">\n <td>First Name</td>\n <td><?php echo $this->tag->textField(\"firstname\"); ?></td>\n </tr>\n <tr scope=\"row\">\n <td>Last Name</td>\n <td><?php echo $this->tag->textField(\"lastname\"); ?></td>\n </tr>\n <tr scope=\"row\">\n <td>Email</td>\n <td><?php echo $this->tag->textField(\"email\"); ?></td>\n </tr>\n <tr scope=\"row\">\n <td></td>\n <td><?php echo $this->tag->submitButton(\"Create\");?></td>\n </tr>\n </tbody>\n\n </table>\n</form>\n</body>\n</html>" ]
[ "forms", "frameworks", "phalcon" ]
[ "Border line not appearing in Outlook/Gmail", "I am creating a HTML signature and it appears that my border line is not appearing in my email client (outlook/Gmail) when its appearing in the web version.\nThe css style code is here:\n.border {\n border-right: solid 1px #8E8E8E;\n padding-right: 15px;\n padding-left: 15px;\n max-width: 560px;\n }\n </style>\n<body>\n <table>\n <tr>\n <td class="border"><a href="http://busways.com.sg/"><img src="http://busways.com.sg/wp-content/uploads/2019/12/Busways-Official-Logo.png" title="Busways Official Website" alt="Busways Logo" width="150"></a></td>\n <td class="Content"><font class="name">Benjamin</font><br>\n <font class="designation">Executive</font><br>\n <span class="details"><b>TEL:</b> 6123456</span> <span class="details"><b>FAX:</b> 64567243</span> <span class="details"><b>EMAIL:</b> admin@</span><br>\n <span class="details"><b>WEB:</b> website</span> <span class="details"><b>ADD:</b> address</span>\n </td>\n </tr>\n \n </table>\n \n</body>\n</html>\n\nIs there a way to have the line of the border to show in outlook and gmAIL server?" ]
[ "html", "css" ]
[ "How can I make tree schema in MongoDB service using Node js and express", "I want to create a mat-tree in angular 8 and data should come from the MongoDB database. For this need, I have to make a tree-structured schema in my backend server and then put data in that schema and retrieve it from that schema. Till now I have created mat-tree from local data and made a tree model in my backend server which is as follow:\n\nconst mongoose = require('mongoose');\n\nconst Schema = mongoose.Schema\n\nconst treeSchema = new Schema({\n name: String,\n parent: {\n type: Schema.Types.ObjectId,\n ref: 'Node'\n },\n children: [{\n type: Schema.Types.ObjectId,\n ref: 'Node'\n }],\n ancestors: [{\n type: Schema.Types.ObjectId,\n ref: 'Node'\n }]\n})\n\nmodule.exports = mongoose.model('Node', treeSchema)\n\n\nI don't know how to put and retrieve data from this schema using API service.\nany help would be appreciated.\nThanks!" ]
[ "node.js", "mongodb", "web-services" ]
[ "NullPointerException when running multiple Action events", "Purpose of the code : Create two Buttons(button1 and button2). When User clicks button1, change the text of button2. When User clicks button2, change the text of button1.\n\nHere's the code I'm using :\n\nimport javax.swing.*;\nimport java.awt.*;\nimport java.awt.event.*;\n\npublic class multiAL {\nJButton button1;\nJButton button2;\nJFrame frame;\npublic static void main(String[] args) {\n multiAL setterAL = new multiAL();\n setterAL.go();\n}\n\npublic void go() {\n button1 = new JButton(\"Click me, I'm One\");\n button2 = new JButton(\"Click me, I'm Two\");\n frame.setSize(500,500);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.getContentPane().add(BorderLayout.WEST, button1);\n frame.getContentPane().add(BorderLayout.EAST, button2);\n frame.setVisible(true);\n button1.addActionListener(new b1L());\n button2.addActionListener(new b2L());\n}\n\nclass b1L implements ActionListener {\n public void actionPerformed(ActionEvent event) {\n button2.setText(\"What??, you clicked 1??\");\n }\n}\n\nclass b2L implements ActionListener {\n public void actionPerformed(ActionEvent event) {\n button1.setText(\"What??, you clicked 2??\");\n }\n }\n}\n\n\nIt compiles perfectly, but when I run it I receive following error :\nException in thread \"main\" java.lang.NullPointerException\nat multiAL.go(multiAL.java:17)\nat multiAL.main(multiAL.java:11)\n\nTill now, I've encountered only compile-time errors. So there are two question which I want to ask:\n\n1) What's wrong with the code?\n2) How to track down runtime errors?" ]
[ "java", "swing", "nullpointerexception", "runtime-error" ]
[ "using an abstraction", "If the predicate bit? returns #t if the items is 1 or 0\n\n(define bit?\n (lambda (item)\n (if (equal? item 0)\n #t\n (if (equal? item 1)\n #t\n #f))))\n\n\nhow can i use bit? in a new procedure, all-bits? that returns #t if all items in the list are bits? I can't figure it out\nthis is what i tried.\n\n (define all-bits?\n (lambda (ls)\n (cond\n [(null? ls) #t]\n [(equal? (car ls all-bits?)) bit?]\n [else (all-bits? ls (cdr ls))]))" ]
[ "scheme", "predicate", "abstraction" ]
[ "Java programming environment : emacs or eclipse?", "I'm pretty new to Java, and I need to build up programming environments for it (editing, compiling, testing, debugging, and deploying/making jar files). \nAnd, even though I'm not a super expert of emacs, I'm a big fan of this wonderful tool.\n\nHere comes my question.\n\nIs it wise to use emacs for Java development? Is Eclipse better for Java development? \n\nAnd, what people normally use for Java development environment? I mean, using what tool may result in getting more help than otherwise?" ]
[ "java", "eclipse", "emacs" ]
[ "How to remove socket.io sid parameter from url", "We have been using socket.io as the framework for chat in our application. The implementation was clean and successful. But after a security review of the application it was reported that keeping the session id in url is considered as a bad practice. \n\nIn socket.io session id is the parameter sid and it appears in URL by default as shown below.\n\n\n https://example.com:4000/socket.io/?EIO=3&transport=polling&t=1480422460686-2&sid=H7ZujhfsdTyTGKg2AARq\n\n\nIs there any methods by which we can remove this from URL? We have gone through the documentation and a bunch of results from Google. Nothing seem to have a solution for this.\n\nAccording to the security team, this issue is relevant when related to the recent vulnerability in CloudFlare. Any solutions?" ]
[ "security", "socket.io" ]
[ "Are Gtk 3.10 widgets backwards compatible?", "I'm not sure if this question should be on the Ubuntu site or here. I'm posting it here because it's about programming, but maybe it should be migrated.\n\nI use gtkmm with the defualt GCC tool chain on Ubuntu, and I just upgraded from Ubuntu 12.04 LTS to 14.04 LTS, which uses GTK+ 3.10 .\n\nI have Glade project file that uses Gtk::TextEntry and Gtk::SpinButton widgets. When I opened the project in Glade after upgrading from 12.04 LTS, I got this message when I tried to save the Glade file. (I didn't save the file - I stuck with the old one so I wouldn't corrupt something.)\n\n[window1:frame1:box1:layout1:spinbutton3] Property 'Placeholder text' of object class 'Text Entry' was introduced in gtk+ 3.2. ]\n\n\nWhen I build and run the C++ project some widgets aren't rendered correctly (SpinEdit up/down button are missing and the labels I put up there are skewed in position): \n\n\n\nThis was all working fine before the upgrade. \n\nIn Synaptic I see that I now have libgtk-3-0 and libgtk-3-0-dev installed and no further updates are available. \n\nIs there a compatibility issue with 3.2 widgets when running 3.10? Is the problem with Glade? Did I just do something wrong that 3.10 is catching but 3.2 did not? Why is this happening? How can I fix it? I'm confused as to what/where the problem is." ]
[ "c++", "gtk3", "gtkmm", "glade" ]
[ "Visual studio: Copying content during build, regardless of cpp changes", "I'm working on a game engine that stores content (audio files, config files, textures, etc.) in a Content subfolder in the project. Master files live in $(ProjectDir)/Content, and need to get copied to the individual target directories (\"Debug/Content\" and \"Release/Content\") whenever the master files are changed. \n\nI'm using a post-build event that works pretty well:\n\nXCOPY \"$(ProjectDir)Content\" \"$(TargetDir)Content\" /I /D /E /C /Y\n\nUnfortunately it only works if a build & link happens - i.e. I have to \"touch\" some .cpp file to trigger it, otherwise VS never executes the post-build XCOPY command. \n\nIs there a way to get it to always run a command on Build(F6) or Run(F5)? Or a better way to handle content files in the project maybe? Hoping to be able to tweak Content files quickly then run the game to preview. \n\nThis is in Visual Studio 2012 professional." ]
[ "c++", "visual-studio", "visual-c++", "msbuild" ]
[ "How to get reversed enumerate in python2?", "I have a list with such structure:\n\n[(key1, val1), (key2, val2), ...]\n\n\nAnd I want to iterate over it getting key and the index of item on each step. In reverse order.\n\nRight now I'm doing it like this:\n\nfor index, key in reversed(list(enumerate(map(lambda x: x[0], data)))):\n print index, key\n\n\nIt works perfectly, but I'm just worrying if it's a properly way to do. Can there is be a better solution?" ]
[ "python", "python-2.7" ]
[ "org.springframework.beans.NotReadablePropertyException: Invalid property 'narrative' of bean class [com.petstore.model.FreeFormat]:", "We just got one weird issue for one enterprise application deployed under WebLogic 12c:\n\n\n org.springframework.beans.NotReadablePropertyException: Invalid\n property 'narrative' of bean class [com.petstore.model.FreeFormat]:\n Bean property 'narrative' is not readable or has an invalid getter\n method: Does the return type of the getter match the parameter type of\n the setter?\n\n\nWe have this entity class:\n\npublic class FreeFormat implements Serializable {\n private String standardText;\n private String openText;\n\n /** default constructor */\n public FreeFormat() {\n }\n\n public String getOpenText() {\n return KEString.nullTOBlank(openText);\n }\n\n public void setOpenText(String openText) {\n this.openText = openText;\n }\n\n public String getStandardText() {\n return standardText;\n }\n\n public void setStandardText(String standardText) {\n this.standardText = standardText;\n }\n\n public String getNarrative(){\n return getStandardText() + \"\\n\" + getOpenText();\n }\n\n\nWhen new build done and deployed to WebLogic server 12C(Using console, delete old build and install new build, without restarting server), sometimes it had such error:\n\n\n \n 16:32:43,176 | ERROR | ErrorsTag | Invalid property 'narrative' of bean class [com.petstore.model.FreeFormat]: Bean\n property 'narrative' is not readable or has an invalid getter method:\n Does the return type of the getter match the parameter type of the\n setter? | org.springframework.web.servlet.tags.RequestContextAwareTag\n | 86 | [ACTIVE] ExecuteThread: '19' for queue:\n 'weblogic.kernel.Default (self-tuning)' \n org.springframework.beans.NotReadablePropertyException: Invalid\n property 'narrative' of bean class [com.petstore.model.FreeFormat]:\n Bean property 'narrative' is not readable or has an invalid getter\n method: Does the return type of the getter match the parameter type of\n the setter? at\n org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)\n at\n org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:721)\n at\n org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99)\n at\n org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:226)\n at\n org.springframework.web.servlet.support.BindStatus.(BindStatus.java:120)\n at\n org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:178)\n at\n org.springframework.web.servlet.tags.form.ErrorsTag.shouldRender(ErrorsTag.java:140)\n at\n org.springframework.web.servlet.tags.form.AbstractHtmlElementBodyTag.writeTagContent(AbstractHtmlElementBodyTag.java:47)\n at\n org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)\n at\n org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)\n at\n jsp_servlet._transactions._freeformat.__freeformat_edit._jspService(__freeformat_edit.java:2278) at weblogic.servlet.jsp.JspBase.service(JspBase.java:35) at\n weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)\n at\n weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)\n at\n weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)\n \n\n\nWhen server restarted, issue gone, and we run clustered environment and sometime it happened in one instance but worked well in another, it was found in staging server environment, we rebuilt the same environment (Same JDK, WebLogic,etc), but could not reproduce in development environment, we are using Spring Framework 3.1.0.RELEASE version, and just found this issue after migrating quite old version from Java 6 and WebLogic 10 to Java 8 and WebLogic 12C.\n\nAnyone has any suggestions?" ]
[ "spring", "weblogic", "javabeans", "bean-validation" ]
[ "How to apply OOP technique to Delphi database programming?", "I've been using Delphi for about 10 years to develop database applications.\n\nMy everyday life cycle is about creating a new TForm, dropping components such as TSQLQuery, TDataSource (as 2-tier database application) TDBGrid, etc. Then setting up required properties to display data from the database, and coding CRUD actions according to specific events.\n\nWhat-if, I would like to use OOP to apply to my everyday life cycle, to make my coding more reusable, I believe, I have a good basic knowledge about OOP, I know how to write classes but in this case U have know ideas what classes I should write, what the class should do.\n\nSo Please guide me where to start? I'm really confusing now for example If I wrote a class for a TCustomer to read data from the database table, after reading from the database how can I give the data to DB Controls such as TDBGrid, so I'm really confusing about what classes to write and what the class should do.\n\nEdited\nI just wish to have a very simple example let's say if I had to develop a database application which has just one database table (e.g. customers) how to design the pattern or to use oop technique for this application.\n\nThanks.\n\nP.S. I'm still using Delphi7" ]
[ "database", "delphi", "oop", "design-patterns", "delphi-7" ]
[ "LF produced from string not containing it", "If I run\n\nselect char(13) -- carriage return CR\n\n\nand copy-paste the resulting single cell....\n\n\n\n...to my trusty notepad++, I see CR+LF:\n\n\n\nWho \"smuggles\" the LF in? The ssms output grid? The OS(windows)? Notepad++? I am not sure how to trace this." ]
[ "sql-server", "tsql", "newline" ]
[ "Calling a javascript function within a function", "I have seen javascript something like this\n\nvar Gallery = function () {\n\n var helloworld1 = function () {\n alert('hey1');\n }\n\n var helloworld2 = function () {\n alert('hey2');\n }\n\n var helloworld3 = function () {\n alert('hey3');\n }\n}();\n\n\nHow would I call the helloworlds within this javascript file?\n\nI've tried\n\n\nhelloworld1(); \nGallery.helloworld1();\nGallery().helloworld1();\n\n\nBut they don't seem to work.\n\nAlso, are there any reasons why I should be writing my javascript in the above manner, rather than just using \n\nfunction helloworld() {\n alert('hey1');\n}" ]
[ "javascript", "function", "nested", "encapsulation" ]
[ "Read in a file with straight html", "In an enviroment where I can't use scripting language, and must use straight html, and I need to render the contents of a file in a webpage. Is there a way to do this? Or is a scripiting language required." ]
[ "html" ]
[ "App installed on Motorola RAZR Android (version 2.3.6) device in not going thru proxy", "I'm seeing a weird issue with setting up a wifi proxy in Motorola Razr with android version 2.3.6. I'm able to set the wifi proxy properly. I've tested it by running browser from phone and seeing data passing by the proxy debugging tool (charles). But when I fire up the app, requests doesn't flow thru charles anymore. \nDo you have any idea, why apps behave differently than browser?\n\nThanks." ]
[ "android", "http", "proxy" ]
[ "Outlook VOB script issue? 5-7kb pdf file do not automatically save", "Hope someone can help me, below is my simple got to automatically save pdf to a folder where a software is running through that folder to print as I am not a coding expert\nThe recent issue arise where my doctor send a very small pdf file 6kb instead of 100kb+\nIt never has issue with pdf file size 100kb+, therefore I added a new criteria to check the file size > 1 but this is still not working\nAny help is much appreciated\nThanks\nPublic Sub SaveAutoAttach(item As Outlook.MailItem)\n \nDim object_attachment As Outlook.Attachment\n \nDim saveFolder As String\n' Folder location when I want to save my file\nsaveFolder = "\\\\SERVER\\Users\\Administrator\\Desktop\\SOPs\\Email Attachment\\Hot Folders\\1\\Incoming"\n \n For Each object_attachment In item.Attachments\n' Criteria to save .pdf files only\n\nIf InStr(object_attachment.DisplayName, ".pdf") And object_attachment.Size > 1 Then\n \n object_attachment.SaveAsFile saveFolder & "\\" & object_attachment.DisplayName\n \n \n End If\n \n Next\n \n \n \nEnd Sub" ]
[ "outlook", "vob" ]
[ "Will CallableStatement.close() cause performance issue", "I have a question about performance. \n\nThe app I work on is a Spring MVC app (v3.2.9). It's hosted on a WebSphere Application Server (v8.5.5). It is connected to an AS400 DB2 system (driver is JTOpen v9.1). My app calls a stored procedure on an IBM AS400 system. It is being called using Spring's JdbcTemplate.execute method. Here's the code:\n\njdbcTemplate.execute(new CallableStatementCreator() {\n @Override\n public CallableStatement createCallableStatement(Connection con) throws SQLException {\n CallableStatement cs = con.prepareCall(\"{CALL XXXXXXSP ( ?, ? )}\");\n cs.setString(1, xxx);\n cs.setString(2, xxx);\n return cs;\n }\n }, \n new CallableStatementCallback<String>() {\n @Override\n public String doInCallableStatement(CallableStatement cs)throws SQLException, DataAccessException {\n cs.execute();\n return null;\n }\n });\n\n\nWe're running into some issues where the calling of this procedure occasionally throws an error \"[SQL0501] Cursor C1 not open\" After turning up the logging and reviewing, it looks like this error only happens when the app attempts to re-use a CallableStatement. The respective cursor was closed the last time this CallableStatement was used, which results in the error (I'm not 100% sure if this re-use is expected behavior or not). The error happens around 20 times per day, which is a relatively low percentage as this application has much higher traffic.\n\nMy question is, will adding cs.close(); to the code after cs.execute(); cause a deterioration in the performance of the code?" ]
[ "java", "spring-mvc", "jdbc", "ibm-midrange" ]
[ "Uncaught TypeError: Cannot read property 'local' of undefined error despite having storage permission", "Unlike in a similar SO post where adding "storage" as permission resolved the issue, I get the error despite having storage permission. I get the error not in chrome://extension but when I open a live server & check the console\nBackground.js:\nchrome.storage.local.set({event: 'test'}, function() {\n console.log('Value is set to ' + 'test');\n});\n\ncontent.js\nchrome.storage.local.get(['event'], function(result) {\n console.log('Value currently is ' + result.key);\n});\n\nmanifest.json:\n{\n "manifest_version": 2,\n "name": "To be named",\n "description": "This extension helps...",\n "version": "0.1.0",\n "permissions": [\n "storage",\n "identity",\n "identity.email",\n "http://127.0.0.1:5000/test",\n "http://127.0.0.1:5000/Time"\n ],\n "background": {\n "scripts": ["background.js"],\n "persistent": false\n }, \n "content_scripts": [{\n "matches": ["https://www.youtube.com/"], \n "js": ["content.js"],\n "css": ["styles.css"]\n }]\n}\n\nError:\nUncaught TypeError: Cannot read property 'local' of undefined in content.js but not background in the console." ]
[ "javascript", "google-chrome-extension", "google-api" ]
[ "Bezier curve and canvas", "How I can draw bezier curve in canvas. I have only start point and end point. I want to draw line from start point to end point. How I can do this?" ]
[ "android", "android-canvas" ]
[ "Why can I not access a function through an instance of a package using import?", "I am trying to use ES6 imports and am running into a problem with vue-server-renderer. It is similar to this question but not quite the same.\n\nI get an error saying TypeError: Cannot read property 'createBundleRenderer' of undefined when I run this:\n\nimport vueServerRenderer from 'vue-server-renderer'\nconst createRenderer = (serverBundle) =>\n vueServerRenderer.createBundleRenderer(serverBundle, {\n runInNewContext: false,\n template: fs.readFileSync(path.resolve(__dirname, indexFolder,'index.html'), 'utf-8')\n });\n\n\nBut if I do the following, then no error:\n\nimport {createBundleRenderer} from 'vue-server-renderer'\nconst createRenderer = (serverBundle) =>\n createBundleRenderer(serverBundle, {\n runInNewContext: false,\n template: fs.readFileSync(path.resolve(__dirname, indexFolder,'index.html'), 'utf-8')\n });\n\n\nWhy do I have to import the function directly from vue-server-renderer? What is wrong with accessing it through an instance of vue-server-renderer using vueServerRenderer.createBundleRenderer() instead of just createBundleRenderer()?" ]
[ "javascript", "node.js", "vue.js", "ecmascript-6", "vuejs2" ]
[ "How to test react component correctly?", "Recently I am learning to test React with jest and enzyme, It seems hard to understand what a unit test is it, my code\n\nimport React from \"react\";\n\nclass App extends React.Component {\n constructor() {\n super();\n this.state = {\n value: \"\"\n };\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(e) {\n const value = e.target.value;\n this.setState({\n value\n });\n }\n render() {\n return <Nest value={this.state.value} handleChange={this.handleChange} />;\n }\n}\n\nexport const Nest = props => {\n return <input value={props.value} onChange={props.handleChange} />;\n};\n\nexport default App;\n\n\nand my test\n\nimport React from \"react\";\nimport App, { Nest } from \"./nest\";\n\nimport { shallow, mount } from \"enzyme\";\n\nit(\"should be goood\", () => {\n const handleChange = jest.fn();\n const wrapper = mount(<App />);\n wrapper.find(\"input\").simulate(\"change\", { target: { value: \"test\" } });\n expect(handleChange).toHaveBeenCalledTimes(1);\n});\n\n\nIMO, the mocked handleClick will intercept the handleClick on App,\n\nif this is totally wrong, what's the right way to use mock fn and test the handleClick be called.\n\nAnother: I search a lot, read the similar situations, seem like this iscontra-Unit Test,\nProbably I should test the two component separately, I can test both components,\ntest the\n<Nest value={value} handleChange={handleChange} />\nby pass the props manually, and then handleChangeinvoked by simulate change\nit passed test.\nbut how can I test the connection between the two? \nI read \n\n\n some work is React Team's Work\n ...\n\n\nI don't know which parts I have to test in this case, and Which parts react already tested and don't need me to test. That's confusing." ]
[ "unit-testing", "reactjs", "testing", "jestjs", "enzyme" ]
[ "Why does a nil nib name not work?", "Usually when I pass in nil as the first parameter of initWithNibName:bundle: it will automatically find the name, but sometimes it doesn't and it just shows a black screen. Under what circumstances does this happen? There are no errors in the console window and the app happily keeps running as a black screen unless I change the nil to a string literal of the nib name. Where can I check to fix this problem?" ]
[ "ios", "nib" ]
[ "What is the type of this.refs.nav for NavigatorIOS in React Native?", "I'm using NavigatorIOS with ref=\"nav\". In my callback for onRightButtonPress, I'm using this code\n\n(this.refs[\"nav\"] as any).push({\n component: AddingScene,\n title: \"Adding\",\n});\n\n\nI've tried casting this.refs[\"nav\"] as many things (NavigatorIOS, NavigationIOS etc.) but can't find a type for it. Does anyone have a cast that will work in TypeScript here so that we have intellisense on the refs[\"nav\"] object?" ]
[ "typescript", "react-native" ]
[ "How to make toolbar icons scale according to dpi without blurring?", "My WinForms app has a toolbar. The toolbar buttons are type ToolStripButton. The icon images are 16x16 pngs, installed as resources.\n\nthis.BtnNew.Image = Resources.NewDocument;\nthis.BtnNew.ImageScaling = ToolStripItemImageScaling.None;\n\n\nThis looks fine on most computers, however on a computer with high dpi, the toolbar buttons appear small compared to the rest of the app (text is scaled up). I would like the toolbar icons to scale too.\n\nI tried \n\nthis.BtnNew.ImageScaling = ToolStripItemImageScaling.SizeToFit;\n\n\nThis scaled the icon correctly, but it appeared blurry, of course because the original image is only 16x16 pixels.\n\nHow can I get the icons to scale correctly according to dpi without blurring? Would using 64x64 pngs be any better, or will I get a different kind of blur when they're scaled down? Can I use svg images?" ]
[ ".net", "winforms" ]
[ "Unable to read instance data, giving up error in python boto", "I am trying to access amazon s3 using boto library to access common crawl data availble in amazon 'aws-publicdatasets'.\n\ni created access config file in ~/.boto\n\n[Credentials]\naws_access_key_id = \"my key\"\naws_secret_access_key = \"my_secret\"\n\n\nand while creating connection with amazon s3 i see below error in logs.\n\n2014-01-23 16:28:16,318 boto [DEBUG]:Retrieving credentials from metadata server.\n2014-01-23 16:28:17,321 boto [ERROR]:Caught exception reading instance data\nTraceback (most recent call last):\n File \"/usr/lib/python2.6/site-packages/boto-2.13.3-py2.6.egg/boto/utils.py\", line 211, in retry_url\n r = opener.open(req)\n File \"/usr/lib64/python2.6/urllib2.py\", line 391, in open\n response = self._open(req, data)\n File \"/usr/lib64/python2.6/urllib2.py\", line 409, in _open\n '_open', req)\n File \"/usr/lib64/python2.6/urllib2.py\", line 369, in _call_chain\n result = func(*args)\n File \"/usr/lib64/python2.6/urllib2.py\", line 1190, in http_open\n return self.do_open(httplib.HTTPConnection, req)\n File \"/usr/lib64/python2.6/urllib2.py\", line 1165, in do_open\n raise URLError(err)\nURLError: <urlopen error timed out>\n2014-01-23 16:28:17,323 boto [ERROR]:Unable to read instance data, giving up\n\n\nIn other way I tried to give credentials while creating connection object also as shown below\n\nfrom boto.s3.connection import S3Connection\nfrom boto.s3.bucket import Bucket\nboto.set_stream_logger('boto')\nconnection = S3Connection('______','__________') \nbucket = Bucket(connection.get_bucket('aws-publicdatasets'))\n\n\nStill i am seeing the same error in logs" ]
[ "python-2.7", "boto" ]
[ "React Ajax undefined method using Deferred object", "I'm very new to React. I am attempting to update a React component's state using an AJAX call, which returned a Deferred object's promise.\n\ncomponentDidMount: function() {\n window.AlbumAPI.get_albums().then(function (response) {\n console.log(data);\n this.setState(data);\n});\n\n\nand the method the component is calling:\n\nwindow.AlbumAPI = {\n get_albums: function() {\n var deferred = new $.Deferred();\n $.ajax({\n url: '/albums',\n }).done(function(res) {\n deferred.resolve(res);\n });\n return deferred.promise();\n }\n};\n\n\nThe console log is returning the correct object, exactly what I expect it to be, a JS array. But the SetState() is throwing an undefined method for the following line:\n\n.done(function(res)\n\n\nIn the component, I have tried using .when and .done in their correct syntax and am getting the same error regardless." ]
[ "javascript", "jquery", "ajax", "reactjs" ]
[ "How to create product url in Laravel?", "I want to create a URL consist of the shop URL + slug (from database) but I'm not sure how to combine these two into one so each product linked to their own individual page.\n\nhttp://127.0.0.1:8000/shop/nmd_r1shoes\n\nroutes/web.php\n\nRoute::get('/shop','ShopController@index')->name('shop.index');\n\n\nviews/best-sellers.php\n\n<div class=\"carousel-item active\" style=\"height: 20rem;\">\n <div class=\"row\">\n @foreach($products_sa as $product)\n <div class=\"col-sm-3 col-xs-6\">\n <a href=\"{{route('shop.index').$product->slug)}}\">\n <img src=\"{{asset('/img/'.$product->photo)}}\" alt=\"Image\" style=\"width: 250px; height:250px;\" class=\"img-responsive\">\n </a>\n <p>{{$product->name}}</p>\n <p><strong>$ {{$product->price}}</strong></p>\n </div>\n @endforeach\n </div>\n <!--.row-->\n</div>" ]
[ "php", "laravel" ]
[ "Binding to a custom control in edit mode", "In a grid I have a column like this that uses a custom control that changes to a text box when in edit mode.\n\n<DataGridTemplateColumn\n CanUserSort=\"True\"\n Header=\"HelpMeStuckOnThis\" \n Width=\"Auto\"\n>\n <DataGridTemplateColumn.CellTemplate>\n <DataTemplate>\n\n <TextBlock Text=\"{Binding Path=TeachersList, Converter={StaticResource ListConverter}, Mode=OneWay}\" />\n\n </DataTemplate>\n </DataGridTemplateColumn.CellTemplate>\n <DataGridTemplateColumn.CellEditingTemplate>\n <DataTemplate>\n <ourControls:MyScheduleEntry ScheduledValue=\"{Binding Path=DefaultServiceKey, Mode=TwoWay}\"/>\n </DataTemplate>\n </DataGridTemplateColumn.CellEditingTemplate>\n</DataGridTemplateColumn>\n\n\nBut when I set the value of DefaultServiceKey in code behind, it never hits the SET method of my ScheduledValue dependency property in that custom control.\n\nWhich makes me think it never hits the binding , but why?\nAs far as datacontext goes, I know that the TeachersList part is working and both TeachersList and DefaultServiceKey are properties on the object." ]
[ "wpf", "xaml", "data-binding" ]
[ "Remove new line from char string c++", "I've been trying to remove the new line at the end of a char string. This is what I have been using.\n\nchar username[256];\nrecv(c->sock, username, sizeof username, 0);\nusername[strlen(username)-1] = 0;\nc->SetName(username);\n\n\nThis is not working for me since the char string gets somehow deleted in half. On the other hand if I don't try to remove the new line at the end of the username I get the string with no problem. I have tried a lot of methods and I get the same result with all of them. Thanks." ]
[ "c++", "arrays", "string", "pointers", "char" ]
[ "Python deploy on heroku cannot do math.cos()", "I deploy my python program on Heroku for my api.ai robot's cosine calculation. However, after I get a value for cos and put the value inside the math.cos(value) function, api.ai will give\n\"errorDetails\": \"Webhook call failed. Error: Webhook response was empty.\"\n\nBut the program will return webhook response if I do not use math.cos().\n\nCode for the calculation:\n\ndef trig():\nreq = request.get_json(silent=True, force=True)\nresult = req.get(\"result\")\nparameters = result.get(\"parameters\")\nnumber = parameters.get(\"number\")\ntrig_sign = parameters.get(\"Trigonometry\")\nnumber = float(number)\nif trig_sign == \"Cos\":\n out = \"The answer is \"+ str(math.cos(number)) +\" !\"\nspeechText = out\ndisplayText = out\nprint(\"Response:\")\nprint(out)\nreturn {\n \"speech\": speechText,\n \"displayText\": displayText,\n \"source\": \"pas-robot-math-calculator\"\n }\n\n\nProgram will work if I do not put math.cos()\n\ndef trig():\nreq = request.get_json(silent=True, force=True)\nresult = req.get(\"result\")\nparameters = result.get(\"parameters\")\nnumber = parameters.get(\"number\")\ntrig_sign = parameters.get(\"Trigonometry\")\nnumber = float(number)\n #I did not put math.cos() here\n out = \"The answer is !\"\nspeechText = out\ndisplayText = out\nprint(\"Response:\")\nprint(out)\nreturn {\n \"speech\": speechText,\n \"displayText\": displayText,\n \"source\": \"pas-robot-math-calculator\"\n }" ]
[ "python", "heroku" ]
[ "NUnit, can \"setup\" run before \"ValueSource\"?", "I have the following basic setup for a uni-test: it tests a class that is responsible for indexing files in a directory, and keep giving the correct one on demand.\nTo do this I use a mock file system provided by system.io.abstractions library. The basic setup is as follows:\n\n[TestFixture]\npublic class ImageDataTests\n{\n private static MockFileSystem fs;\n private const int TESTNUM = 3;\n [SetUp]\n public static void Init() {\n var allnamegroups = TestSettings.NameGroupFactory(TESTNUM);\n fs = new MockFileSystem();\n foreach (string[] namegroup in allnamegroups) {\n var dname = ImageData.MakeDirectoryName(namegroup[0], namegroup[1]);\n TestSettings.AddTestFilesToMockFileSystem(fs, dname);\n }\n }\n}\n\n\nNow each test works on a case for this, and to test (say) a \"reload\" function I add the following method to above class:\n\n public static IEnumerable<ImageData> ImgDatSource() {\n while (true) {\n yield return new ImageData(\"test\", fs);\n }\n }\n [Test, Sequential]\n public void GetAllOfTypeTest(\n [ValueSource(nameof(ImgDatSource))] ImageData img, \n [Values(\"foo\", \"bar\", \"this\")]string type, \n [Values(1, 2, 0)]int ex) {\n Assert.That(() => img.GetAllOfType(type).Count(), Is.EqualTo(ex));\n }\n\n\nThis should (right now) list all files starting with respectively \"foo\", \"bar\" and \"this\". - It fails, stating that the directory is not found. - Even before the first test is run: at the initializing of Imagedata.\nDebugging verifies what I thought: the Init() is not run yet when the ValueSource tries to initialize the input.\n\nIs there a way to do \"such\" a test, short of initializing the Imagedata inside the test body? (And either losing the parametric construction + test indexing, or having to write many similar tests manually).\n\nNotice that I really NEED to run the filesystem generator each test: while above test is simple and doesn't do much. Some tests will adapt/change the filesystem to test the class against more edge-cases. - Also during the test." ]
[ "c#", "unit-testing", "nunit" ]
[ "C1076 / C3859 fatal errors whilst building x64 debug with code analysis using clang-tidy setting in VS2019", "I tried building my DEBUG x64 MFC project with the Code Analysis setting Clang-tidy enabled for the first time. The build failed and I had multiple errors like this:\n5>Running Code Analysis for C/C++...\n5>c1xx : error C3859: Failed to create virtual memory for PCH\n5>c1xx : fatal error C1076: compiler limit: internal heap limit reached\nI tried to research it and found some answers on SO but they were old questions and not related to code analysis builds. I also found this about the C1076 error. Interestingly it said:\n\n... limit to the value specified in the C3859 error message.\n\nAs you can see, the C3859 errors were not provided any "value".\nI decided to switch off the Clang-tidy setting again so that I can atleast complete a debug code analysis build if I wanted to.\nHas anyone else experienced these issues when building MFC projects with code analysis / clang-tidy in VS2019?" ]
[ "visual-c++", "visual-studio-2019", "code-analysis", "clang-tidy" ]
[ "jquery: check if window has been scrolled once and do something", "Because of a new implementation of the cookie law, I have to gather consent for some cookies. One of the methods, is to wait for the user to scroll the page once, which has been legally meant to be an implicit consent.\n\nI tried with:\n\njQuery(window).one('scroll', function(){\n $(this).data('scrolled', true);\n});\n\nif(jQuery(window).data('scrolled')) {\n console.log( 'ok' );\n //place cookies\n} else {\n console.log( 'no' );\n}\n\n\ninside a script ( http://www.primebox.co.uk/projects/jquery-cookiebar/ ) that is called via:\n\n$(document).ready(function(){\n $.cookieBar({\n }); \n });\n\n\nHowever, console.log always tells me \"no\", regardless of the scrolling of the page.\n\nAny hints?\nThanks in advance" ]
[ "javascript", "jquery", "cookies", "scroll" ]
[ "serving web app and python using nginx on remote server", "Setup:\n1> Web GUI using Angular JS hoasted in tomcat server and Python app using Flask is running on an AWS server.\n2> I am working in a secure server hence am unable to access AWS directly.\n3> I have setup NGINX to access GUI app from my local secured network. GUI app is running on awsserver:9506/appName\n4> Flask app is running in AWS server hosted on 127.0.0.1:5000. This app has 2 uri's cross and accross:\n127.0.0.1:5000/cross\n127.0.0.1:5000/accross\n\nNow in my GUI after NGINX setup i am able to access it using domain name and without port:\ndoman.name/appName\n\nNow when i try to use it send a request to server my url changes to:\ndoman.name/cross. I did the changes in NGINX config and am able to access it but am not able to get a response back. Please find below my NGINX config file:\n\nserver {\n listen 80;\n server_name domain.name;\n root /home/Tomcat/webapps/appName;\n\n location / {\n proxy_pass http://hostIP:9505/; #runs the tomcat home page\n }\n\n location /appName/ {\n proxy_pass http://hostIP:9505/appName; #runs the application home page\n }\n\n location /cross/ {\n proxy_pass http://127.0.0.1:5000/cross; #hits the python flask app and am trying to send post\n }\n}\n\n\nAlso what i noticed is that my POST request is being converted to GET at the server by NGINX" ]
[ "post", "nginx", "flask", "get" ]
[ "Time Series stl error", "I have a code that goes like this:\n\nrawdata=as.numeric(rawdata)\nsalesdata_bfr=rawdata[3:(maxcolnum-12)]\nprint(length(salesdata_bfr))\nsalesdata_ts=ts(salesdata_bfr, frequency = 12)\nsalesdata_stl=stl(salesdata_ts,s.window=\"periodic\")\n\n\nmaxcolnum is equal to 38 and print(length(salesdata_bfr)) prints 24. But I get the error \n\nError in stl(salesdata_ts, s.window = \"periodic\") : \n series is not periodic or has less than two periods\n\n\nBut I do have a vector of exactly two periods and I specified the frequency in ts(). Why won't it work?" ]
[ "r", "time-series" ]
[ "SQL Server Unallocated Space", "I was wondering what happens if the SQL Server database, the unallocated space gets to 0.00. We currently have a small database and have .64mb left in unallocated space." ]
[ "sql", "sql-server" ]
[ "adding gaussian noise to image", "I'm trying to add gaussian noise to some images using the following code \n\nimport numpy as np\nimport cv2\nimport glob \nmean = 0\nvar = 10\nsigma = var ** 0.5\ngaussian = np.random.normal(mean, sigma, (224, 224)) \n\n\n\nfor image in glob.glob('/home/aub/myflower/flower_photos/dandelion/*.jpg'):\n img = cv2.imread(image)\n noisy_image = np.zeros(img.shape, np.float32)\n\n if len(img.shape) == 2:\n noisy_image = img + gaussian\n else:\n noisy_image[:, :, 0] = img[:, :, 0] + gaussian\n noisy_image[:, :, 1] = img[:, :, 1] + gaussian\n noisy_image[:, :, 2] = img[:, :, 2] + gaussian\n\n cv2.normalize(noisy_image, noisy_image, 0, 255, cv2.NORM_MINMAX, dtype=-1)\nnoisy_image = noisy_image.astype(np.uint8)\n\n cv2.imshow(\"img\", img)\n cv2.imshow(\"gaussian\", gaussian)\n cv2.imshow(\"noisy\", noisy_image)\ncv2.waitKey(0)\n\n\nbut it doesn't work and it gives me the following error \n\n\n noisy_image[:, :, 0] = img[:, :, 0] + gaussian ValueError: operands\n could not be broadcast together with shapes (315,500) (224,224)\n\n\nKindly review and give feedback." ]
[ "python", "numpy", "opencv" ]
[ "jQuery - Setting .blur to a class", "I'm trying to set a blur on all 'number' classes (which happen to be tags).\n\nMy trial coding is; \n\n$('.number').blur(function () {\n if ($.isNumeric($(this).val) == false) alert('false ' + $(this).val);\n else alert('true ' + $(this).val);\n }) ; \n\n\nIt seems $(this) doesn't pick up the tag. Basically I want to be able to check whether the value is numeric of not. \n\nWould be grateful any ideas/solutions to this problem." ]
[ "jquery", "isnumeric" ]
[ "Android Studio no layout morphing", "When creating a blank layout I get RelativeLayout and in the Component Tree there is no morphing option to change the layout. If I manually edit it to another layout then morphing becomes available, however LinearLayout is never an option and when changed to Relative it disappears.\n\nHow can I get it to allow me to change to linear or have all the options available without having to edit the xml?\n\nThanks.\n\nI'm on beta 0.8.6" ]
[ "android-studio" ]
[ "Recursion within a method", "In my code I am counting the number of nodes in a complete binary tree and I decided to use a recursive approach. However, when I call my method within itself, I get NameError: name 'countNodes' is not defined.\n# class TreeNode:\n# def __init__(self, val=0, left=None, right=None):\n# self.val = val\n# self.left = left\n# self.right = right\nclass Solution:\n def countNodes(self, root: TreeNode, count = 0) -> int:\n if not root.left and not root.right:\n return 1\n else:\n count += countNodes(self, root.left, count) + countNodes(self, root.right, count)" ]
[ "python", "class", "oop", "recursion" ]
[ "How to change Android SDK temp download directory?", "First off I want to say that I'm not trying to change where software should \"look,\" for the SDK. I already did that and it works fine.\n\nI am trying to update the SDK tools through Android Studio and even though I already have the SDK and other tools installed on a larger secondary \"E:/\" drive that's 4tb, Android Studio insists on downloading something more than 60gb of files onto my (already almost full) 120gb SSD boot drive where Android Studio is installed.\n\nThe folders that it's downloading are:\n\nC:\\users\\<user name>\\AppData\\Local\\Temp\\PackageOperation##\n\n\nIt only said it was going to take 14GB before I started downloading which makes it all the more frustrating. It's still downloading as I post this, and it's only about 1/4 of the way done but I have to go to work. I'm worried it's going to run out of space and not be able to finish. Is there any way to tell Android Studio to download these to my other HDD?\n\nUpdate: It went to about 70GB and left me with only 1GB of free space before it started deleting the files and freeing up space. It ended up finishing, but I don't know if this was a coincidence or not. It's still too close for comfort so if anyone could help that would be fantastic" ]
[ "android", "android-studio", "android-sdk-tools" ]
[ "Loop through table td's to detect child div class", "I am trying to loop through all td cells on my table. \n\nThe td's contain div's, I need to search each of these div classes to detect a class 'ws_is_all_day_event', if the class is detected I need to add another class 'ws_has_all_day_event' to the parent td.\n\nCurrently I can only get this to apply the extra class to all td's, not the specific td column.\n\nMy Code Pen Thus Far\n\n jQuery('#myTable').each(function () {\n\n jQuery('td', this).each(function () {\n\n if( jQuery('.demo-class').hasClass(\"ws_is_all_day_event\") ) {\n jQuery(\".ws_is_single_day_header\").addClass(\"ws_has_all_day_event\");\n }\n\n\n })\n\n })\n\n\nStupidly, what am I missing here?" ]
[ "jquery", "html-table" ]
[ "Polyfill for CSS `background-position-x/y`? jquery-backgroundfix not working", "Expanding on Is background-position-x (background-position-y) a standard W3C CSS property? -- is there a polyfill for CSS background-position-x/y?\n\nI found https://github.com/liuxuanzy/jquery-backgroundfix but I'm having some trouble making it work:\n\n\nPure JS: http://jsbin.com/ripegiqose/1/edit\nRuby on Rails (Bower + http://rails-assets.org/): http://runnable.com/VL0J_279Y69u6gxa/rails-jquery-backgroundfix" ]
[ "jquery", "css", "ruby-on-rails", "background-position", "polyfills" ]
[ "CLLocationManager working out elevation gain", "I'm trying to work out the elevation gain from CLLocationManager. \n\nHere is my code at the moment:\n\n- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations\n{\n CLLocation *oldLocation = [locations objectAtIndex:[locations count] - 1];\n CLLocation *location = [locations lastObject];\n\n double elevationChange = oldLocation.altitude - location.altitude;\n\n if (elevationChange > 0)\n {\n _netElevationGain += elevationChange;\n }\n\n\nI think this code should work fine but when I test it netElevationGain is always 0. I've done some research and it seems as though it may be that I'm testing with the iOS simulator. I am using the location option in the debug menu for the iOS simulator. \n\nIs it likely the simulator causing this problem or is there something I have missed in my code?" ]
[ "ios", "cllocationmanager" ]
[ "Crossfade 3+ images with js / jQuery", "I'm stuck with a crossfade. My images fade into black, but I have no idea how to rework this to have crossfade.\n\nvar backgroundClasses = ['bg1', 'bg2']; // Store all the background classes defined in your css in an array\nvar $element = $('.container'); // cache the element we're going to work with\nvar counter = 0; // this variable will keep increasing to alter classes\n\nsetInterval(function() { // an interval\n counter++; // increase the counter\n $element.fadeOut(500, function() { // fade out the element\n $element.removeClass(backgroundClasses.join(' ')). // remove all the classes defined in the array\n addClass(backgroundClasses[counter % backgroundClasses.length]). // add a class from the classes array\n fadeIn(500); // show the element\n });\n}, 3000)\n\n.container {\n width: 100vw;\n height: 100vh;\n}\n\n.bg1 {\n background-color: red;\n}\n\n.bg2 {\n background-color: green;\n}" ]
[ "javascript", "jquery" ]
[ "Vue v-for no data display using Laravel and Vuejs", "Im using v-for and axios for displaying data but when I run my website, the data wont show but there are no errors in the console and in my vue developer tool, I can see the data in it. Can someone help me?\n\n\nUsers.vue\n\n <table id=\"table\" class=\"table table-striped table-bordered\">\n <thead>\n <tr>\n <th>Id</th>\n <th>Name</th>\n <th>Email</th>\n <th>Type</th>\n <th>Created</th>\n\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"user in users.data\" :key=\"user.id\">\n <td>{{user.id}}</td>\n <td>{{user.name}}</td>\n <td>{{user.email}}</td>\n <td>{{user.type}}</td>\n <td>{{user.created_at}}</td>\n </tr>\n </tbody>\n </table>\n\nscript>\n export default {\n data() {\n return {\n\n users: {},\n form: new Form({\n id:'',\n name: \"\",\n email: \"\",\n password: \"\",\n type: \"\",\n })\n };\n },\n methods: {\n loadUsers(){\n axios.get(\"api/user\").then(({ data }) => (this.users = data));\n }\n },\n created() {\n console.log('Component mounted.')\n this.loadUsers()\n\n }\n }\n\n</script>\n\n\n\napi.php\n\nRoute::apiResource('user', 'API\\UserController');\n\n\nUserController.php\n\n<?php\n\nnamespace App\\Http\\Controllers\\API;\n\n\nuse Illuminate\\Http\\Request;\nuse App\\Http\\Controllers\\Controller;\nuse App\\User;\nclass UserController extends Controller\n{\n /**\n * Display a listing of the resource.\n *\n * @return \\Illuminate\\Http\\Response\n */\n public function index()\n {\n return User::all();\n }\n\n}" ]
[ "laravel", "vue.js", "axios", "vue-component" ]
[ "How to serialize model properly?", "I have next models:\n\nclass Product(models.Model):\n name = models.CharField(max_length=500, blank=False, null=False)\n\nclass ProdcutsAccess(models.Model):\n user = models.ForeignKey(User)\n product = models.ForeignKey(Product,related_name='hidden_products')\n\n\nI want to serialize Product class and have there field 'hidden_users' that looks like:\n\n\n hidden_users : [mark, joe, sam ]\n\n\ni.e. list of usernames\n\nMy serailizers looks like:\n\nclass ProductSerializer(serializers.ModelSerializer):\n hidden_users = serializers.SlugRelatedField(many=True, slug_field='user', read_only=False, source='hidden_products',queryset=User.objects.all())\n\n\nBut I'm getting the error \n\n\n is not JSON serializable\n\n\nHow can to win it?" ]
[ "django", "django-rest-framework" ]
[ "Find the vertices on the outline of a 3d model", "I have found a lot of materials on how to draw outline around a model with the help of a stencil buffer, like https://www.opengl.org/archives/resources/code/samples/mjktips/StenciledHaloEffect.html\n\nHowever, this time I need to locate the vertices on the outline, to get their coordinates, but haven't found an elegant way to do so.\n\nI once came across a method that can solve my problem for simple models like cube or sphere. It suggests to check the two triangles that share an edge, if the normals of the two triangles pointing in opposite directions with respect to the camera direction, than the edge they share is on the outline. \n\nThe above method works for simple models like sphere or cube, but not for complex models because it might also picked up those edges that inside the outline from the view of the camera.\n\nIn conclusion, my objective is to find the coordinates of the vertices on the outline, for example, vertices on the red line in the image which you can find at https://gamedev.stackexchange.com/questions/59361/opengl-get-the-outline-of-multiple-overlapping-objects.\n\nBTW, I am doing this using Ogre." ]
[ "opengl", "ogre", "outline" ]
[ "HttpRequest.RouteValues property is not accessible from code but accessible from debugger", "I am trying to create middleware which performs some checking for particular requests.\n\nFor example, I have such routes:\n\n\napi/Test/{paramToCheck}/aaa\napi/Test/bbb/ccc\n\n\nand I have these requests:\n\n\nhttp://some-host-and-port/api/Test/1234/aaa\nhttp://some-host-and-port/api/Test/bbb/ccc\n\n\nNow inside my middleware I want to check if request contains {paramToCheck} and get value of this parameter.\n\nWhen I set breakpoint inside InvokeAsync I can see httpContext.Request.RouteValues property containing all needed data (Keys contains \"paramToCheck\" and Values contains its value).\n\nBut in code I can't access this property, I get error:\n\n\n Error CS1061: 'HttpRequest' does not contain a definition for\n 'RouteValues' and no accessible extension method 'RouteValues'\n accepting a first argument of type 'HttpRequest' could be found (are\n you missing a using directive or an assembly reference?)\n\n\nvar value = httpContext.Request.RouteValues[\"paramToCheck\"];\n\nHow can I access this property or how can I perform needed check?\n\nCode:\n\npublic class MyMiddleware\n{\n private readonly RequestDelegate _next;\n\n public MyMiddleware\n (\n RequestDelegate next\n ) => this._next = next;\n\n public async Task InvokeAsync(HttpContext httpContext)\n {\n var value = httpContext.Request.RouteValues[\"paramToCheck\"]; // error here\n\n //... some logis with value\n\n await this._next(httpContext);\n }\n}\n\n\nEDIT\n\nMiddleware is inside netstandard2.1 class library and it cannot be moved to api project as it is common and should be used by several api projects.\n\nUPDATE\n\nSeems like currently it cannot be achieved as RouteValues propery was added in Microsoft.AspNetCore.Http.Abstractions 3.0.0 which is inside NetCoreApp 3 metapackage. And there is no possibility to install this package in netstandard 2.1 project because the latest version is 2.2.0." ]
[ "c#", "asp.net-core-3.1" ]
[ "Symfony: multiple i18n sources", "For my project, I need to store translations in the database, for which I've implemented doctrine data source. However, I would like to leave standard translations (sf_admin and messages) in xml and keep them under source control. Is it possible to have 2 i18n instances that use different data sources? Or maybe one instance that can load data from different sources according to dictionary name?" ]
[ "symfony1", "internationalization" ]
[ "how to save add or remove classes cookies in my javascript?", "I want to save \"active\" class and \"icon\" class in cookies. How to do?\n\nhtml\n\n<div class=\"changeWrap\">\n <span class=\"switch-male\"><a href=\"javascript:\"><i class=\"glyphicon glyphicon-unchecked\"></i> Male</a></span>\n <span class=\"switch-female\"><a href=\"javascript:\" class=\"active\"><i class=\"glyphicon glyphicon-check\"></i><span> Female</span></a></span>\n</div>\n\n\ncss\n\n.active{\n color: red;\n}\n\n\nDEMO: http://jsfiddle.net/deqzjefq/2/" ]
[ "javascript", "jquery", "css", "cookies" ]
[ "Set iPhone accelerometer to ±8g mode", "Is it possible to set iPhone accelerometer to receive data in the ±8g range?\n(as far as I know ST LIS331DLH accelerometer installed on iPhone supports this mode)\n\nWe are looking not only into standard API, but also\n\n\nundocumented functions\npossible iOS hacks\nhardware tinkering\n\n\nAnyway to extend accelerometer range beyond standard ±2g" ]
[ "ios", "iphone", "accelerometer" ]
[ "Cannot read property 'push' of undefined in AngularJS", "I have a factory that calls 4 json files and then I want to do some treatmenet for each data from these files and push them into an array of objects this is the code I wrote :\n\nmyapp.factory('wordsCloudFactory', function($http) {\n var factory = {\n getList: function() {\n\n return $http.get('data/periode_1_file.JSON')\n .then(function(response1) {\n return $http.get('data/periode_2_file.JSON')\n .then(function(response2) {\n return $http.get('data/periode_3_file.JSON')\n .then(function(response3) {\n return $http.get('data/periode_4_file.JSON')\n .then(function(response4) {\n var words = [{\n 'period1': [],\n 'period2': [],\n 'period3': [],\n 'period4': []\n }];\n console.log(words);\n for (var i = response1.data['X_id'].length - 1; i >= 0; i--) {\n words['period1'].push({\n id: response.data['X_id'][i],\n count: response.data['count'][i]\n });\n };\n for (var i = response2.data['X_id'].length - 1; i >= 0; i--) {\n words['period2'].push({\n id: response.data['X_id'][i],\n count: response.data['count'][i]\n });\n };\n for (var i = response3.data['X_id'].length - 1; i >= 0; i--) {\n words['period3'].push({\n id: response.data['X_id'][i],\n count: response.data['count'][i]\n });\n };\n for (var i = response4.data['X_id'].length - 1; i >= 0; i--) {\n words['period4'].push({\n id: response.data['X_id'][i],\n count: response.data['count'][i]\n });\n };\n return words;\n }, function(error) {\n return 'There was an error getting data';\n })\n\n }, function(error) {\n return 'There was an error getting data';\n })\n\n }, function(error) {\n return 'There was an error getting data';\n })\n }, function(error) {\n return 'There was an error getting data';\n })\n }\n };\n return factory;\n})\n\n\nthis code it doesnt work it shows me an error message : 'Cannot read property 'push' of undefined'.\n\nHow can I solve this ?\n\nAs you can see in my code there are a lot of nested $http.get methodes isn't there another way to write that ?" ]
[ "angularjs" ]
[ "IOS7 : UIScrollView offset in UINavigationController", "I'm currently migrating my app on ios 7 and I've been stuck for hours on the new navigationcontroller/bar management.\n\nBefore, when we had a navigation controller, we had a snippet like this :\n\nUINavigationController *navController = [[UINavigationController alloc]initWithRootViewController:[[MainViewController alloc]init]];\n\n\nIn interface builder, we had the choice to set an existing navigationbar for the view and everything match the content of the real view.\n\nOK so now, i have no clue of how to design properly with interface builder.\nI still have my snippet to initialize my navcontroller. However in the interface builder for my MainViewController if I set a status bar to translucent or opaque navigation bar, i have an offset of 44px at the top (see below). \n\n\nInterface Builder_________________________And the result\n\n\n\n\n\n\nNow, if i set status bar to none, there is no offset at top but since the view on simulator is smaller because of navigation bar the bottom of the view in interface builder is cut off.\n\nInterface Builder_________________________And the result\n\n\n\n\nI guess i'm really missing something here but i can't find any topic or apple info in iOS7 Transitions Guide about that. \n\nThanks for your help\n\n\n\nEDIT\n\nAs we can see in the pictures, the first child of the view is a UIScrollView which contains both labels, the problem does not appear when there is no scrollview. It also appears if it's a UITableView.\nIf a label is outside the UIScrollView, there is no offset to that label." ]
[ "uinavigationcontroller", "uinavigationbar", "ios7" ]
[ "Is it Possible to Use Underscore to Create a Javascript Objects with a Variable?", "I have the following situation:\n\nvar newObject = {user: object, user1: object1}\nvar user = \"something\";\nvar object = {key: [obj, obj], key1: [obj, obj]}\n\n\nI'd want to add the following to the array of objects in var object:\n\nvar addToIt = [objA, objB];\n\n\nIn the end var object should look like:\n\nvar object = {key: [obj, obj, objA, objB], key1: [obj, obj]}\n\n\nI believe there is a way to do it with underscore but until now I've not been able to figure it out. A solution or suggestion would be much appreciated!\n\nIn an effort to share my approach, here is something I thought would work but I'm getting an error when I try to push and undefined values for key and key1:\n\nvar newHistory = _.mapObject(newObject, function(valN, keyN){\n_.mapObject(valN, function(vs, ks){\nif(ks = key){\nreturn vs.push(addToIt);\n}\n})\n})" ]
[ "javascript", "underscore.js" ]
[ "@(at) operator at Python, how to use it?", "I'm trying to run a python code. This code have an '@' ( at) operator. I never saw it before, and Google returns no hits. \n\ninit = model.potentials[key].init_weights(model)\nif init.ndim==2:\n U, S, Vt = np.linalg.svd(init, False)\n init = U@Vt\n\n\nIt says the following error:\n\ninit = U@Vt\n ^\nSyntaxError: invalid syntax\n\n\nI'm using Python 2.7 to compile it. Do anyone know about this operator ?" ]
[ "python", "python-3.x", "numpy" ]
[ "Removing outlet connections without disabling IBOutlet", "I added a second ViewController to my Swift app and I'm trying to add IBOutlets to it just as I did in my first ViewController. For some reason the file gets corrupted and whenever I click the button that leads to the second screen that connects with the new ViewController (called MyOwnViewController) the app gets an error that says \"Unknown class MyOwnViewController in Interface Builder file,\" and \"Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key showOption3.'\" showOption3 is the name of the IBOutlet I'm trying to call when the screen launches.\n\nimport Foundation\n\nclass MyOwnViewController: UIViewController {\n\n@IBOutlet var showOption3: UILabel!\n\n@IBOutlet var showOption4: UILabel!\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n\n var voteCount1 = PFObject(className: \"VoteCount\")\n voteCount1[\"choices\"] = 2\n voteCount1[\"votes\"] = Int()\n voteCount1[\"votes2\"] = Int()\n voteCount1[\"optionName\"] = String()\n voteCount1[\"optionName2\"] = String()\n voteCount1[\"objectId\"] = String()\n voteCount1[\"pollNumber\"] = Int()\n\n var query = PFQuery(className: \"VoteCount\")\n query.countObjectsInBackgroundWithBlock {\n (count: Int32, error: NSError!) -> Void in\n if error == nil {\n let randNumber = Int(arc4random_uniform(UInt32(count)))\n query.whereKey(\"pollNumber\", equalTo: randNumber)\n query.getFirstObjectInBackgroundWithBlock {\n (voteCount1: PFObject!, error: NSError!) -> Void in\n if error != nil {\n NSLog(\"%@\", error)\n } else {\n let votes = voteCount1[\"votes\"] as Int\n let votes2 = voteCount1[\"votes2\"] as Int\n let option1 = voteCount1[\"optionName\"] as String\n let option2 = voteCount1[\"optionName2\"] as String\n self.showOption3.text = \"\\(option1)\"\n self.showOption4.text = \"\\(option2)\"\n }\n }\n } else {\n println(\"error \\(error)\")\n }\n }\n}\n\noverride func didReceiveMemoryWarning() {\n super.didReceiveMemoryWarning()\n// Dispose of any resources that can be recreated.\n}\n\n\nI have tried removing the connection for the IBOutlets in the Connections Inspector, which does remove the error and allows the second View Controller to appear, but it also disables the IBOutlets altogether. I still need the IBOutlets to show up when the MyOwnViewController screen appears." ]
[ "ios", "xcode", "swift" ]
[ "Popup window, how to Hide URL bar in IE8", "when I open popup window and set location=0 or location=no, url bar is still shown in IE8 and readonly.\n\nHow can hide it?\n\nThanks" ]
[ "asp.net", "javascript", "url", "popup" ]
[ "Fetching millions of records from database using ormlite", "Hello I am working on application where I have database having millions of records, I want to display rows in recycler view in efficient way, Fetching millions of record and storing them in arraylist will not be a good solution, I wanted to know how can I efficiently fetch these many records using ormlite and does not blow up memory while using application. App should stay response as well, Any thoughts/solution on this?" ]
[ "android", "ormlite" ]
[ "Is there any way to embed Google Apps Script in a Gmail Contextual Gadget? I need to access the Apps Script API functionality from by Gmail gadget", "Is there any way to embed or access Google Apps Script in a Gmail Contextual Gadget? I need to access the Apps Script API functionality from a Gmail contextual gadget. \n\nI created a test web service and it returns my corporate single signon page (SAML with Google) instead of \"Hello World\" when called from wget.\n\nfunction doGet(e) {\n var output = ContentService.createTextOutput();\n output.setContent(\"Hello world\");\n return output;\n}\n\n$ wget https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec\n--2012-08-31 14:37:03-- https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec\nResolving script.google.com... 74.125.225.97, 74.125.225.99, 74.125.225.110, ...\nConnecting to script.google.com|74.125.225.97|:443... connected.\nHTTP request sent, awaiting response... 302 Moved Temporarily\nLocation: https://www.google.com/a/example.com/ServiceLogin?service=wise&passive=1209600&continue=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec&followup=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec [following]\n--2012-08-31 14:37:03-- https://www.google.com/a/example.com/ServiceLogin?service=wise&passive=1209600&continue=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec&followup=https://script.google.com/a/macros/example.com/s/AKfycbz-aVKchJk3AQltnd5CKabbGJawCu0U3ySChcT5QxBNWBS_FoU/exec\nResolving www.google.com... 209.85.225.147, 209.85.225.104, 209.85.225.105, ...\nConnecting to www.google.com|209.85.225.147|:443... connected.\nHTTP request sent, awaiting response... 302 Moved Temporarily\nLocation: https://extsignon.example.com:443/amserver/SSORedirect/metaAlias/emplFed/idp?SAMLRequest=......" ]
[ "gmail", "google-apps-script" ]
[ "I can't get the user uid signed in in the rules of the firebase console", "Here is my data.\n\n\"users\" : {\n \"user1\": {\n \"1234\": {\n \"role\": \"admin\"\n },\n \"1235\": {\n \"role\": \"normal\"\n }\n },\n \"user2\": {\n \"1236\": {\n \"role\": \"admin\"\n },\n \"1237\": {\n \"role\": \"normal\"\n }\n }\n}\n\n\nAnd here is rules for that.\n\n\"rules\" {\n \"users\": {\n \".read\": \"root.child('users').child('user1').child(auth.uid).child('role') === 'admin'\"\n }\n}\n\n\nBut the rule doesn't work. I seem the auth.uid isn't gotten correctly." ]
[ "firebase", "firebase-realtime-database", "firebase-security" ]
[ "Send command while expect can get specific text", "I Have one problem when i am using expect.\nI need to list some information.\nBut the program list 10 items and then shows (More...) and waits a key\nSo:\n\nexpect \"More...\"\nsend \"\\n\"\n\n\nBut the program shows more 10 lines and does it again, i can track how many times i need to do that, but the list changes a lot.\n\nIs there a way to do something like:\n\nwhile expect \"More...\" do\n send \"\\n\"\ndone\n\n\nI know the expect waits for a string, is there some kind of \"hit\" command?\n\nThanks" ]
[ "expect" ]
[ "C# Split list into sublists based on a value of a certain property?", "I have a list of events, each of which has a datetime property. I need to split the list up into sublists by year. The trick is, my list of events is pulled from a database and subject to change, so I can't just hardcode the set of years and sort the events into the right year. Is there a way that I can split my main list of events into sublists so that within each sublist, each event has the same year? So I would end up with a sublist of all 2010 events, a sublist of all 2011 events, and so on. \n\nMy list is created like this :\n\nforeach (var ev in eventResults)\n {\n eventsList.Add(new Event()\n {\n Name = ev.Title,\n Month = CultureInfo.CurrentCulture.DateTimeFormat.GetAbbreviatedMonthName(ev.StartDate.Month),\n Day = ev.StartDate.Day,\n Year = ev.StartDate.Year\n });\n }" ]
[ "c#", "list" ]
[ "display image preview after submitting the form which image i selected before?", "When I select an image from image gallery. This image shows its preview where i defined the image preview tag in html. After the submitting the form image disappear from preview.\n\nSo I want to display image preview after submitting the form which image i selected before? \n\nHTML\n\n<tr class=\"form-field form-required\">\n <td colspan=\"2\">\n <tr class=\"form-field form-required\">\n <th scope=\"row\" ><label for=\"lcp-icon\">Icon</label></th>\n <td>\n <img id=\"preview\" src=\"<?php echo $image_url ?>\" height=\"50px\" width=\"150px\"><br>\n <input id=\"image_url\" type=\"text\" size=\"30\" name=\"image_url\" value=\"<?php echo $image_url ?>\" /><br/>\n <input type=\"button\" class=\"button button-secondary\" id=\"lcp_logo\" name=\"lcp_logo\" value=\"Select Image\"><br />\n </td>\n </tr>\n </td>\n </tr>\n\n\nJquery\n\njQuery(document).ready(function($) {\n\nvar image_custom_uploader;\n\njQuery(\"#lcp_logo\").on(\"click\", function(){\n\nvar image_custom_uploader = wp.media({\n\n title: \"Upload Image\",\n multiple: false\n }).open().on(\"select\", function(e) {\n\n var attachment = image_custom_uploader.state().get(\"selection\").first().toJSON();\n\n\n var url = '';\n url = attachment['url'];\n\n jQuery('#image_url').val(url);\n\n jQuery('#preview').attr(\"src\", url);\n });\n });\n});\n\n\nPHP\n\n $uploadedlogofile = $_POST['image_url'];\n $icon = sanitize_text_field( $uploadedlogofile );\n\n if ( !empty($icon) ) {\n\n delete_option( 'admin_icon'\n\n ); \n add_option( 'admin_icon', $icon);\n\n }\n\n/*fetch all settings*/\n $icon = get_option('admin_icon',true);\n\n\ni want to display image preview after submitting the form which image i selected before?" ]
[ "javascript", "jquery", "wordpress" ]
[ "What is the best way to set up libphonenumber(PHP) manually without Composer?", "Due to some constraints, I'm unable to install libphonenumber via composer, so I've manually added it to my project's lib directory.\nI'm getting the following error when I try to use it via manual setup:\nPHP Fatal error: Class 'libphonenumber\\CountryCodeToRegionCodeMap' not found in /home/cellulant/CODE/MSISDNVALIDATIONAPI/lib/libphonenumber/src/PhoneNumberUtil.php on line 404\n\nThis, despite the fact that CountryCodeToRegionMap.php can be found in libphonenumber/src directory\n\nThe libphonenumber directory is in my project's lib directory.\nThe following is my directory structure\n\n├── docs\n├── index.php\n├── lib\n│   └── libphonenumber\n│   ├── composer.json\n│   ├── docs\n│   │   ...\n│   ├── LICENSE\n│   ├── METADATA-VERSION.txt\n│   ├── README.md\n│   └── src\n│   ...\n\n\nIn my index.php, I have these:\n\n<?php\n\ninclude \"lib/libphonenumber/src/PhoneNumberUtil.php\";\n\n$num = \"0234567787\";\n\ntry \n{\n $phoneUtil = \\libphonenumber\\PhoneNumberUtil::getInstance();\n\n $numberProto = $phoneUtil->parse($num, \"US\");\n var_dump($numberProto);\n} \ncatch (Exception $ex)\n{\n echo \"Exception: \" . $ex->getMessage() . \"\\n\";\n}" ]
[ "php", "libphonenumber" ]
[ "Symfony2 sessions aren't persisting after page load", "I'm having an issue with a Symfony2 site. I've got the codebase running on a production server, which is absolutely fine but I'm trying to get another developer started on the project and we're running into issues getting the build up and running. The environments are pretty much identical, the developer is using a Vagrant instance, the same provisioning on that instance was used to provision an EC2 instance on AWS.\n\nWhen a form is submitted the action goes through and stores values to the session using Symfonys session handler before redirecting to another action which makes up step two of the form. I can see in Xdebug that the values are being added to the global $_SESSION variable, however when I reach the next break point in the second action the $_SESSION variable is missing the content that it had on the previous action. I'm not clearing the session anywhere, and as I said it works fine on production.\n\nIt's almost as if Symfony isn't storing session data between page loads, does anybody have any ideas?\n\nThings tried\n\n\nAdding cookie domain to the config \nSetting permissions to 777 (just to test) \nPHP Versions are one minor iteration apart (5.4.28-1 vs\n5.4.27-1)" ]
[ "php", "symfony" ]