texts
sequence
tags
sequence
[ "HTTP/1.0 response to HTTP/1.1 request", "Is it alright to respond with HTTP/1.0 to HTTP/1.1 request?\n\nI am implementing HTTP communication through simple sockets and clients make requests with both HTTP/1.0 and HTTP/1.1 but protocol is independent of HTTP version so I want to always respond with HTTP/1.0 to all requests.\nDoes HTTP standard bear such communication?" ]
[ "http" ]
[ "Appsync query type returning multiple individual types", "I'm new to Appsync and stuck with the following\n\ntype User{\n id: ID\n name : String\n address: String\n}\n\ntype Car{\n id: ID\n model: String\n make: String\n}\n\ntype Query { \n getusers: [User] \n getcars: [Car]\n}\n\n\nThis works fine as getusers and getcars have the two different HTTP endpoint set as data source.\n\nWhat i'm trying to do is create another type AllDetail and query getdetails (expecting to return list of all users followed by list of all cars)\n\ntype AllDetail{\n users : [User]\n cars : [Car]\n}\ntype Query { \n getusers: [User] \n getcars: [Car]\n getdetails : AllDetail\n}\n\n\n\nI need help in \n1) setting up the data source for getdetails (since it involves two endpoints)\n2) is there any other means to make getdetails return list of all users followed by list of all cars." ]
[ "graphql", "aws-appsync" ]
[ "SQL order by date and time not working", "I'm trying to order the messages by time and date, but its not working:\nhere is my code:\n\n$sql=\"SELECT id, message, sender, recipient, date, time, IF(recipient = \".$_SESSION[\"user\"][\"id\"].\", 'received', 'sent') AS direction\n FROM message\n WHERE\n (recipient = $friend_id OR sender = $friend_id)\n AND id > $last_message_id ORDER BY time AND date ASC\";" ]
[ "php", "mysql", "sql" ]
[ "Not implementing interface member - C#", "I keep getting this error, and I am unsure what I am doing wrong. Error 1 'Home.Services.InventoryImpl' does not implement interface member 'Home.Services.InventorySvc.CreateInventory(Home.Services.InventoryImpl)'\n\nMy Interface Code\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Home;\nusing Home.Domain;\n\nnamespace Home.Services\n{\n public interface InventorySvc\n {\n void CreateInventory(InventoryImpl CreateTheInventory);\n }\n}\n\n\nMy Implementation Code\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing Home.Domain;\nusing System.IO;\nusing System.Runtime.Serialization;\nusing System.Runtime.Serialization.Formatters.Binary;\n\nnamespace Home.Services\n{\n public class InventoryImpl: InventorySvc\n {\n public void CreateTheInventory(CreateInventory createinventory)\n {\n\n FileStream fileStream = new FileStream\n (\"CreateInventory.bin\", FileMode.Create, \n FileAccess.Write);\n IFormatter formatter = new BinaryFormatter();\n formatter.Serialize(fileStream, createinventory);\n fileStream.Close();\n }\n }\n}" ]
[ "c#" ]
[ "Filter 'where' on global scope inside relations", "migrating from lb2 to lb4, skipping lb3 ...\nA bunch of caveats.\nHave this filter with many relations inside:\n{\n "limit": 10,\n "skip": 0,\n "where": {},\n "include": [{\n "relation": "userRoles",\n "scope": {\n "include": [{\n "relation": "role"\n }]\n }\n }, {\n "relation": "userCounteragents"\n }, {\n "relation": "userByUserCategories",\n "scope": {\n "include": [{\n "relation": "userCategory"\n }]\n }\n }]\n}\n\nIs it possible to filter by "relation": "role" where column role.name == "admin" on whole global search ? Not just filtered inside "relation": "role"\nSomething like {"limit": 10, "skip": 0, "where": {"userRoles.role.name": "admin"} ..." ]
[ "loopback4" ]
[ "Android best practice to check user \"login\" in every activity", "in my app user needs to authenticate before he can start using the app..\nI have this code in startupActivity\n\nprivate boolean checkAuthentication() {\n SharedPreferences sp = getSharedPreferences(\n \"com.simekadam.blindassistant\", Context.MODE_PRIVATE);\n return sp.getBoolean(\"logged\", false);\n}\n\nprivate void processStartup(){\n Log.d(TAG, \"processing startup\");\n if (checkAuthentication()) {\n Intent startApp = new Intent(getApplicationContext(),\n BlindAssistantActivity.class);\n startActivity(startApp);\n } else {\n\n Intent loginIntent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(loginIntent);\n\n\n }\n}\n\n\nit just works but I need to check it propably in every activity (in onStart or onResume methods), but it would cause code duplications among all my activities. What is the best way how to do this? Can I create a masteractivity which will be extended with other activities?\n\nthanks" ]
[ "android", "login", "android-activity" ]
[ "react-native run-ios takes forever to build and sometimes never does", "I start my app with react-native run-ios and i get left at this portion of the build process, sometimes indefinitely. why does this happen? \n\nAlexs-MBP:swig_app alexhome$ react-native run-ios\nFound Xcode project swig_app.xcodeproj\nBuilding using \"xcodebuild -project swig_app.xcodeproj -configuration Debug -scheme swig_app -destination id=C46C9065-C23A-4118-AB00-5957B64086B1 -derivedDataPath build\"\nUser defaults from command line:\n\nIDEDerivedDataPathOverride = /Users/alexhome/Desktop/swig_app/ios/build\n\n\nIve tried all the usual cleaning commands such as watchman watch-del-all and virtuall ever other cache cleaning command there is. sometimes the make it worse tho\n\npackage.Json:\n\n{\n \"name\": \"swig_app\",\n \"version\": \"0.0.1\",\n \"private\": true,\n \"scripts\": {\n \"start\": \"node node_modules/react-native/local-cli/cli.js start\",\n \"test\": \"jest\"\n },\n \"dependencies\": {\n \"react\": \"16.6.3\",\n \"react-native\": \"0.57.8\",\n \"react-native-router-flux\": \"^4.0.6\",\n \"react-redux\": \"^6.0.0\",\n \"redux\": \"^4.0.1\"\n },\n \"devDependencies\": {\n \"babel-jest\": \"23.6.0\",\n \"jest\": \"23.6.0\",\n \"metro-react-native-babel-preset\": \"0.51.1\",\n \"react-test-renderer\": \"16.6.3\"\n },\n \"jest\": {\n \"preset\": \"react-native\"\n }\n}" ]
[ "javascript", "ios", "reactjs", "native" ]
[ "How to pan and zoom .svg on android?", "I'm using webview to view a .svg file (located in assets folder). In the preview mode of the.svg on android studio, I can pan and zoom perfectly. But when I export to .apk, pan and zoom is not working at all on the app.\n\nNote: The .svg file I'm using for test is this: https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg\n\nCan you help me solve this please?\n\npublic class MainActivity extends AppCompatActivity {\n@SuppressLint(\"SetJavaScriptEnabled\")\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n WebView webView = (WebView) findViewById(R.id.webView);\n webView.getSettings().setJavaScriptEnabled(true);\n webView.setWebChromeClient(new WebChromeClient());\n //webView.loadUrl(\"file:///android_asset/www/index.html\");\n\n\n webView.getSettings().setJavaScriptEnabled(true);\n webView.addJavascriptInterface(new Locater(), \"locater\");\n //webView.loadUrl(\"file:///android_asset/gallardo.svg\");\n webView.loadUrl(\"file:///android_asset/Tiger.svg\");\n}}" ]
[ "android", "svg", "webview", "zooming", "pan" ]
[ "Unable to communicate between viewControllers of different projects inside a workspace in XCode 9", "I have three project A, B, C inside an workspace in XCode.\nWant to call class B and C (ProjectMain in image) from A.\nBut it shows error \"Use of unresolved identifier 'BViewController'\"" ]
[ "ios", "xcode", "xcode-workspace" ]
[ "Select option duplicate values reactjs", "I am getting duplicate values from the select option in an edit form. For example, in the select option, I have A and B, and let say I have in the database recorded as B. So when I go into the edit form I should see B being selected which working fine so far. But I see A, B, B instead of A and B.\nI am not sure how do I get rid of the duplicate values. Here is the code:\n <div className="col-sm-10">\n <select id="sourcename" className="form-control" name="source" onChange={handleChange}>\n {sourceData.map(option => (\n <option value={option._id}>{option.sourcename}</option>\n ))}\n <option selected value={data.source._id}>{data.source.sourcename}</option>\n </select>\n </div>\n\nMany thanks in advance and greatly appreciate any helps. Thanks" ]
[ "reactjs" ]
[ "How do I ensure my website or web app based on html works on all browsers properly", "I am wondering if there is a way or settings I need to do in html file so that my asp.net website/html based website works properly with correct length/height dimensions in all the browsers (IE/Firefox/Opera)...etc.... Whats the settings and where I need to do it ?" ]
[ "c#", "asp.net", ".net", "html" ]
[ "Socket programming in C, using the select() function", "Based from the answers I got from this thread, I've created this:\n\n //Server \n\n sock_init(); //from SFL, see http://legacy.imatix.com/html/sfl/\n\n timeout = 50000;\n\n serv_sock_input[0] = TCP(1234); \n serv_sock_input[1] = UDP(9876);\n\n input_protocols[0] = \"tcp\";\n input_protocols[1] = \"udp\";\n\n while (1)\n {\n FD_ZERO(&sock_set);\n for (x = 0; x<number_of_inputs; x++)\n {\n FD_SET(serv_sock_input[x], &sock_set);\n }\n\n select_timeout.tv_sec = timeout;\n select_timeout.tv_usec = 0;\n\n if (select(0, &sock_set, NULL, NULL, &select_timeout) == 0)\n printf(\"No requests\");\n else\n {\n for (x = 0; x<number_of_inputs; x++)\n {\n if (FD_ISSET(serv_sock_input[x],&sock_set))\n {\n printf(\"\\nRequest on port %d: \\n\", x);\n if ((strcmp(input_protocols[x],\"tcp\")) == 0) //in this case, 0 returned == TRUE\n {\n accept_socket(serv_sock_input[x]);\n printf(\"Input TCP Port %d\\n\",x);\n close_socket(serv_sock_input[x]);\n }\n else\n {\n printf(\"Input UDP Port %d\\n\",x);\n }\n }\n }\n }\n }\n sock_term();\n}\n\n\n\n\nint TCP (unsigned short port)\n{\n int sock; \n struct sockaddr_in servAddr; \n\n if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)\n exit(1);\n\n memset(&servAddr, 0, sizeof(servAddr));\n servAddr.sin_family = AF_INET; \n servAddr.sin_addr.s_addr = htonl(INADDR_ANY);\n servAddr.sin_port = htons(port); \n\n if (bind(sock, (struct sockaddr *) &servAddr, sizeof(servAddr)) < 0)\n exit(1);\n\n if (listen(sock, 5) < 0)\n exit(1);\n\n return sock;\n}\n\n\n\n\nint UDP (unsigned short port)\n{\n int sock; /* socket to create */\n struct sockaddr_in servAddr; /* Local address */\n\n /* Create socket for sending/receiving datagrams */\n if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)\n exit(1);\n\n /* Construct local address structure */\n memset(&servAddr, 0, sizeof(servAddr)); /* Zero out structure */\n servAddr.sin_family = AF_INET; /* Internet address family */\n servAddr.sin_addr.s_addr = htonl(INADDR_ANY); /* Any incoming interface */\n servAddr.sin_port = htons(port); /* Local port */\n\n /* Bind to the local address */\n if (bind(sock, (struct sockaddr *) &servAddr, sizeof(servAddr)) < 0)\n exit(1);\n\n\n return sock;\n}\n\n\n\n\n//Client\nsock_init();\n\n if ((client_sock_output = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)\n exit(1);\n\n memset(&client_addr, 0, sizeof(client_addr));\n client_addr.sin_family = AF_INET;\n client_addr.sin_addr.s_addr = inet_addr(\"127.0.0.1\");\n client_addr.sin_port = htons(1234);\n\n if (connect(client_sock_output, (struct sockaddr *) &client_addr, sizeof(client_addr)) < 0)\n exit(1);\n\n closesocket(client_sock_output);\n\n sock_term();\n\n\nWhen the server starts, the server gets blocked at the if(select(...)) statement.\n\nSo when I run the Server, and then the client, the client connects to the server (sometimes it takes a couple times to run the client before they connect). Then the if(select...)) statement is no longer true and it proceeds to the else.\n\nAfter that, the client closes the connection, and the program. However, and this is where my problem happens, the if(select(...)) statement is always false. I get this output: \n\nRequest on port 0: \nInput TCP Port 0 \n\nRequest on port 1: \nInput UDP Port 1\n\n\nThis output repeats forever. How come it doesn't get stuck at the if(select(...))?" ]
[ "c", "sockets", "posix-select" ]
[ "Error 1050 when trying to add foreign key constraing in MySQL", "I have tried adding a column to my UserOrder table called discountcode. This is a nullable foreign key into \n\nalter table UserOrder add column discountCode varchar(100) null;\nalter table UserOrder add foreign key FK_UserOrder_DiscountCode_code(`discountCode`) references DiscountCode(`code`);\n\n\nThe error happens on the second line. Both tables are running InnoDB. I am on MySQL 5.5.11.\n\nHere is the error log...\n\n[2012-05-29 23:59:07] [42S01][1050] Table '.\\realtorprint_dev_dev\\userorder' already exists\n[2012-05-29 23:59:07] [HY000][1025] Error on rename of '.\\realtorprint_dev_dev\\#sql-28a4_3' to '.\\realtorprint_dev_dev\\userorder' (errno: -1)\n[2012-05-29 23:59:07] [42S01][1050] Table '.\\realtorprint_dev_dev\\userorder' already exists\n\n\nHere is \"show create Table UserOrder\"\n\n'CREATE TABLE `userorder` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `created` datetime NOT NULL,\n `paymentTxID` varchar(255) DEFAULT NULL,\n `shippedDate` datetime DEFAULT NULL,\n `shippingTrackingNumber` varchar(255) DEFAULT NULL,\n `taxType` varchar(255) NOT NULL,\n `taxValue` decimal(10,2) NOT NULL,\n `orderStatus` varchar(50) NOT NULL,\n `user_id` bigint(20) NOT NULL,\n `address` varchar(255) NOT NULL,\n `city` varchar(255) NOT NULL,\n `country` varchar(255) NOT NULL,\n `stateProvince` varchar(255) NOT NULL,\n `zipPostal` varchar(255) NOT NULL,\n `paymentType` varchar(255) NOT NULL,\n `backendUserId` bigint(20) DEFAULT NULL,\n `adjustedTotalPrice` decimal(10,2) DEFAULT NULL,\n `adjustedPrinterPrice` decimal(10,2) DEFAULT NULL,\n `adminNotes` varchar(2048) DEFAULT NULL,\n `printerBillStatus` varchar(40) NOT NULL,\n `userInvoiceStatus` varchar(40) NOT NULL,\n `expeditedAddressDescription` varchar(255) DEFAULT NULL,\n `shippingType` varchar(50) NOT NULL,\n `shippingCost` decimal(10,2) NOT NULL,\n `discountCode` varchar(100) DEFAULT NULL,\n `discountAmount` decimal(10,2) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `idx_UserOrder_user_id` (`user_id`),\n KEY `idx_UserOrder_orderStatus_id` (`orderStatus`),\n KEY `FK_UserOrder_PaymentType` (`paymentType`),\n KEY `FK_UserOrder_PrinterBillStatus_Name` (`printerBillStatus`),\n KEY `FK_UserOrder_UserInvoiceStatus_Name` (`userInvoiceStatus`),\n KEY `FK_UserOrder_User` (`backendUserId`),\n KEY `FK_UserOrder_ShippingType_name` (`shippingType`),\n CONSTRAINT `FK_UserOrderBcknd_User` FOREIGN KEY (`backendUserId`) REFERENCES `user` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,\n CONSTRAINT `FK_UserOrder_user_id` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`),\n CONSTRAINT `userorder_ibfk_1` FOREIGN KEY (`shippingType`) REFERENCES `shippingtype` (`name`),\n CONSTRAINT `UserOrder_ibfk_2` FOREIGN KEY (`paymentType`) REFERENCES `paymenttype` (`name`),\n CONSTRAINT `UserOrder_ibfk_6` FOREIGN KEY (`printerBillStatus`) REFERENCES `printerbillstatus` (`name`),\n CONSTRAINT `UserOrder_ibfk_7` FOREIGN KEY (`userInvoiceStatus`) REFERENCES `userinvoicestatus` (`name`),\n CONSTRAINT `UserOrder_ibfk_8` FOREIGN KEY (`orderStatus`) REFERENCES `orderstatus` (`name`)\n) ENGINE=InnoDB AUTO_INCREMENT=21412 DEFAULT CHARSET=utf8'\n\n\nHere is show create table DiscountCode...\n\n'CREATE TABLE `discountcode` (\n `code` varchar(100) NOT NULL,\n `percent` int(11) NOT NULL,\n `created` datetime NOT NULL,\n `expires` datetime NOT NULL,\n `maxUses` int(11) NOT NULL,\n `useCount` int(11) NOT NULL,\n PRIMARY KEY (`code`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8'" ]
[ "mysql", "foreign-keys", "mysql-error-1050" ]
[ "Order varchar string as numeric", "Is it possible to order result rows by a varchar column cast to integer in Postgres 8.3?" ]
[ "postgresql", "types", "casting", "indexing", "integer" ]
[ "GADBannerView pushes UI elements from scrollview when hiding on iOS", "I've been working on a mobile application for iOS platform. I was trying to put an ad banner in my app while I faced something ... I'd say strange.\nI have a master-detail view workflow when the user selects an element from the master view detailed information is presented in a new view. The detail view is longer than the display so I've put a UIScrollView element that wraps all other elements - labels, text view and image.\nThe ad banner is placed out of the scroll view at the bottom of the screen so it is always on screen to the user.\n\nSo here goes my problem -\n 1. I scroll down the view\n 2. I click on the ad banner\n 3. I close the ad banner view hitting the Done button\nNow all UI elements inside the scroll view had moved up (check the scrollbar on next images)\n\n \n\nI've been trying to locate the problem debugging the GADBannerViewDelegate method and I've found that in\n- (void)adViewWillDismissScreen:(GADBannerView *)bannerView\neverything is just fine and when the next method\n - (void)adViewDidDismissScreen:(GADBannerView *)bannerView\nis fired the UI elements had moved by a couple of hundred pixels up. \n\nI hope I've been clear enough. Should I provide some source code? \n\nP.P. This works the same way on the simulator and on my iPod touch 4th gen\nDeployment Target of the project is 6.1\nI use GoogleAdMobAdsSdkiOS version 6.4.2" ]
[ "ios", "objective-c", "ios6", "admob" ]
[ "Magento 2: How do I create widget with dynamic fields?", "Example of widget's dynamic fields:\n\n\n\nPlease help!" ]
[ "widget", "magento2", "custom-field-type" ]
[ "How to check if a user is subscribed to a specific Telegram channel (Python / PyTelegramBotApi)?", "I am writing a Telegram bot using the PyTelegramBotApi library, I would like to implement the function of checking the user's subscription to a certain telegram channel, and if there is none, offer to subscribe. Thanks in advance for your answers!" ]
[ "python", "bots", "telegram", "telegram-bot", "py-telegram-bot-api" ]
[ "Neural Networks works worse than RandomForest", "I have a classification problem that target contains 5 classes, 15 features(all continuous)\nand have 1 million for training data, 0.5 million for validation data.\ne.g., \n\nshape of X_train = (1000000,15)\nshape of X_validation = (500000,15)\n\n\nFirst, I used Random Forest that can get 88% Avg. Accuracy.\n\nAfter that I tried many Neural Network architecture, the best one got ~80% Avg. Accuracy both on training and validation data, which was worse than Random forest.\n(I don't know much about designing Neural Network architecture)\n\nFollowing is the best one of my NN architecture. (~80% Avg.Accuracy)\n\nmodel = Sequential()\nmodel.add(Dense(1000, input_dim=15, activation='relu'))\nmodel.add(Dropout(0.1))\nmodel.add(Dense(900, activation='relu'))\nmodel.add(Dropout(0.1))\nmodel.add(Dense(800, activation='relu'))\nmodel.add(Dropout(0.1))\nmodel.add(Dense(700, activation='relu'))\nmodel.add(Dropout(0.1))\nmodel.add(Dense(600, activation='relu'))\nmodel.add(Dense(5, activation='softmax'))#output layer\nadadelta = Adadelta()\nmodel.compile(loss='categorical_crossentropy', optimizer=adadelta, metrics=['accuracy'])\n\n\nBatch Size = 128 and epochs = 100\n\nI have read this question. The answer point out that NN needs amount of data and some regulization. I think my data size is good enough and I have also tried higer Dropout rate and L2 regulization but still not working. \nWhat could the problem be?\n\nThis is biological data that I have no domain knowledge so sorry about that I can't explain it. I've plot the feature distribution as below, all features are between 0 to 3" ]
[ "python", "tensorflow", "machine-learning", "neural-network", "keras" ]
[ "How to I make my music bot play a finite playlist of songs?", "Building further on my music bot... I'm trying to make the jump from having him play a single song, and then leave, to having him play a finite list of songs, and then leave.\nThis should not be confused with a queue - the list of songs is predetermined and finite. It can't be added to or changed by the bot, at least at this time. The bot DOES shuffle the list though.\nThe problem right now is that instead of playing the songs in the list, one by one - he plays the first song, then the second... and stops dead.\nI've tried setting up a loop based on the length of the SongToPlay array, but all that does is make the bot rapidly spam through each song (before the previous song had time to play), and leave.\nconst connection = message.member.voice.channel.name;\n const channel = message.member.voice.channel;\n message.channel.send("Now playing Scythe OST in the "+connection+" channel.");\n var SongToPlay = shuffle(testbells);\n channel.join().then(connection => {\n console.log('Now playing '+SongToPlay[0]+'.');\n message.channel.send('Now playing '+SongToPlay[0]+'.');\n const dispatcher = connection.play('./Scythe Digital Edition - Soundtrack/'+SongToPlay[0]+'.mp3');\n dispatcher.setVolume(0.1);\n dispatcher.on("finish", () => {\n SongToPlay.shift();\n console.log('Now playing '+SongToPlay[0]+'.');\n message.channel.send('Now playing '+SongToPlay[0]+'.');\n connection.play('./Scythe Digital Edition - Soundtrack/'+SongToPlay[0]+'.mp3');\n dispatcher.setVolume(0.1);\n });\n channel.leave();\n })\n .catch(console.error);" ]
[ "javascript", "node.js", "discord", "discord.js" ]
[ "Graph plotting in Java Swing only draws points", "I'm currently working on a program where certain numerical variables, which evolve over time, have their value displayed on each iteration. That works well enough, but now I want to plot a graph that shows their evolution over time.\nSo, I looked into an example of code for plotting graphs in Swing. My final code looks like this:\n\npublic class Populus3 extends JPanel\n{\n public static void main(String[] args) throws IOException {\n\n final Populus3 pop = new Populus3();\n\n JFrame f = new JFrame(); //where I want to plot the graph\n f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n f.add(new GraphingData());\n f.setSize(400,400);\n f.setLocation(200,200);\n f.setVisible(true);\n\n\n frame = new JFrame(\"Animation Frame\"); //where I'm running animation for another element of the program\n frame.add(pop, BorderLayout.CENTER);\n frame.setSize(graphSize, graphSize);\n frame.setVisible(true);\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\n //insert all sort of things\n\n }\n\n\n public void paint(Graphics g) \n {\n super.paint(g);\n paintCell(g, 1);\n Toolkit.getDefaultToolkit().sync(); // necessary for linux users to draw and animate image correctly\n g.dispose();\n }\n\n\n public void actionPerformed(ActionEvent e) {\n repaint();\n }\n\n\n\n @Override\n protected void paintComponent(Graphics g)\n {\n super.paintComponent(g);\n for(int i = 0; i < particleType.length; i++)\n paintCell(g, i); //a method that draws a small circle for the animation panel\n }\n\n\n\n public static class GraphingData extends JPanel {\n int[] data = {\n 21, 14, 18, 03, 86, 88, 74, 87, 54, 77,\n 61, 55, 48, 60, 49, 36, 38, 27, 20, 18\n };\n final int PAD = 20;\n\n protected void paintComponent(Graphics g) {\n super.paintComponent(g);\n Graphics2D g2 = (Graphics2D)g;\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\n RenderingHints.VALUE_ANTIALIAS_ON);\n int w = getWidth();\n int h = getHeight();\n // Draw ordinate.\n g2.draw(new Line2D.Double(PAD, PAD, PAD, h-PAD));\n\n // Draw abcissa.\n g2.draw(new Line2D.Double(PAD, h-PAD, w-PAD, h-PAD));\n double xInc = (double)(w - 2*PAD)/(data.length-1);\n double scale = (double)(h - 2*PAD)/getMax();\n // Mark data points.\n g2.setPaint(Color.red);\n for(int i = 0; i < data.length; i++) {\n double x = PAD + i*xInc;\n double y = h - PAD - scale*data[i];\n g2.fill(new Ellipse2D.Double(x-2, y-2, 4, 4));\n }\n }\n\n private int getMax() {\n int max = -Integer.MAX_VALUE;\n for(int i = 0; i < data.length; i++) {\n if(data[i] > max)\n max = data[i];\n }\n return max;\n }\n }\n}\n\n\nNow, the animation panel works just fine. The graph panel, on the other hand...when I run the program, it displays a bunch of red dots, without lines to connect them. What am I doing wrong?" ]
[ "java", "swing", "graph" ]
[ "Using WideCharToMultiByte with Codepage 1258 (Vietnamese)", "I am trying to convert a wide char string to Vietnamese ANSI (CP 1258), and for some reason half of the diacritics are wrong. I did some research and unearthed this: http://www.siao2.com/2005/04/19/409566.aspx and this: http://www.siao2.com/2005/08/27/457224.aspx, which kind of confirm my suspicion that this is a special case. I added the WC_COMPOSITECHECK flag, but it does not help. \n\nWhat I don't understand is why it is different from Thai, which also has this kind of multilayered diacritics. Thai worked just fine for me. Is there any kind of secret handshake I must use?" ]
[ "winapi", "unicode", "localization" ]
[ "How can I avoid null pointer access warning when the check is inside a method?", "I dispose of the following method :\n\nboolean isNullOrEmpty(String s) {\n return s == null || s.length() == 0;\n}\n\n\nTrouble is, it isn't compatible with @Nullable. For istance, in the following code, a warning is displayed when it shouldn't.\n\nvoid test(@Nullable String s) {\n if (!isNullOrEmpty(s)) {\n s.length(); // warning : o may be null\n }\n}\n\n\nIs there a way to make this warning go away while conserving isNullOrEmpty and Nullable ?" ]
[ "java", "eclipse", "java-8" ]
[ "Do you know how combine bar and spline chart in fusionc chart?", "I need to combine bar chart and spline chart using fusionchart api. Do you know how to combine bar and spline chart in fusionchart?" ]
[ "jquery", "charts", "spline", "fusion" ]
[ "why is that my jquery dialog wont pop out?", "I don't know what is wrong why my dialog won't pop up because when I try pop outing the form from the html it works fine but from with this jquery table generated it won't . So what will i do?\n\nsuccess: function(data){\n var toAppend = '';\n\n toAppend += '<thead><tr><th>Name</th><th>Image</th><th>Price</th></tr></thead>';\n toAppend += '<tbody>';\n\n for(var i=0;i<data.length;i++){\n\n toAppend += '<tr><td><p>'+\n\n data[i]['product_name'][0]+'</p></td><td><a href=\"#\">'+\n\n <img id=\"size\" src=\"'+data[i]['image'][0]+'\" alt=\"\">+'</a></td><td>'+\n\n data[i]['price'][0]+'</td></tr>';\n }\n\n toAppend += '</tbody>';\n\n $('.data-results').append(toAppend);\n }\n\n\nhere's the calling the dialog function\n\n$('#size').click(function() {\n $('#dialog').dialog({\n resizable: false,\n modal: true\n });\n});" ]
[ "jquery", "jquery-ui", "jquery-ui-dialog" ]
[ "What object to pass to R from rpy2?", "I'm unable to make the following code work, though I don't see this error working strictly in R.\n\nfrom rpy2.robjects.packages import importr\nfrom rpy2 import robjects\nimport numpy as np\n\nforecast = importr('forecast')\nts = robjects.r['ts']\n\ny = np.random.randn(50)\nX = np.random.randn(50)\n\ny = ts(robjects.FloatVector(y), start=robjects.IntVector((2004, 1)), frequency=12)\nX = ts(robjects.FloatVector(X), start=robjects.IntVector((2004, 1)), frequency=12)\n\nforecast.Arima(y, xreg=X, order=robjects.IntVector((1, 0, 0)))\n\n\nIt's especially confusing considering the following code works fine\n\nforecast.auto_arima(y, xreg=X)\n\n\nI see the following traceback no matter what I give for X, using numpy interface or not. Any ideas?\n\n---------------------------------------------------------------------------\nRRuntimeError Traceback (most recent call last)\n<ipython-input-20-b781220efb93> in <module>()\n 13 X = ts(robjects.FloatVector(X), start=robjects.IntVector((2004, 1)), frequency=12)\n 14 \n---> 15 forecast.Arima(y, xreg=X, order=robjects.IntVector((1, 0, 0)))\n\n/home/skipper/.local/lib/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, *args, **kwargs)\n 84 v = kwargs.pop(k)\n 85 kwargs[r_k] = v\n---> 86 return super(SignatureTranslatedFunction, self).__call__(*args, **kwargs)\n\n/home/skipper/.local/lib/python2.7/site-packages/rpy2/robjects/functions.pyc in __call__(self, *args, **kwargs)\n 33 for k, v in kwargs.iteritems():\n 34 new_kwargs[k] = conversion.py2ri(v)\n---> 35 res = super(Function, self).__call__(*new_args, **new_kwargs)\n 36 res = conversion.ri2py(res)\n 37 return res\n\nRRuntimeError: Error in `colnames<-`(`*tmp*`, value = if (ncol(xreg) == 1) nmxreg else paste(nmxreg, : \nlength of 'dimnames' [2] not equal to array extent\n\n\nEdit:\n\nThe problem is that the following lines of code do not evaluate to a column name, which seems to be the expectation on the R side.\n\nsub = robjects.r['substitute']\ndeparse = robjects.r['deparse']\ndeparse(sub(X))\n\n\nI don't know well enough what the expectations of this code should be in R, but I can't find an RPy2 object that passes this check by returning something of length == 1. This really looks like a bug to me.\n\nR> length(deparse(substitute((rep(.2, 1000)))))\n[1] 1\n\n\nBut in Rpy2\n\n[~/]\n[94]: robjects.r.length(robjects.r.deparse(robjects.r.substitute(robjects.r('rep(.2, 1000)'))))\n[94]: \n<IntVector - Python:0x7ce1560 / R:0x80adc28>\n[ 78]" ]
[ "python", "r", "rpy2" ]
[ "Pythonpath get last part of path", "I dont want to use pathlib, so avoid answers with it\naString = "/test/test1/test2/test3"\naString = os.path(astring.parts[1:]) \n\nI want to get /test1/test2/test3 ,using import os or import os.path" ]
[ "python", "jython" ]
[ "Laravel 5.7 Export File to Excel", "I'm trying to export my Resident List into Excel. It downloads into an excel file but when I open the file it has nothing in it.\n\nHere's the code for my Controller:\n\npublic function export()\n{\n return Excel::download(new Resident, 'Resident.xlsx');\n}\n\n\nHere's my routes:\n\nRoute::get('/export', 'ImportController@export');\n\n\nHere's my blade file button for the export:\n\n<a href=\"{{ url('/export') }}\"><button class=\"btn btn-primary\">Export</button></a>\n\n\nHere's my model:\n\npublic function collection()\n{\n return Resident::all();\n}" ]
[ "laravel", "export", "laravel-5.7" ]
[ "Multisite wont load stylesheet on second site", "I've posted this four days ago to wordpress support, but no answer. Thought I'd might give it a go here as well. Copy+paste;\n\nHi!\nI'm trying to set up a multisite network for my portfolio.\nHere's what I've got\n\nMain site:\n\nhttp://wp-sandbox.andreaswikstrom.com/\n\nhttp://wp-sandbox.andreaswikstrom.com/two/\n\nAs you can see; The stylesheet on the second site doesn't load. I've tried to change my htaccess-file to all sorts of configurations but no results.\n\nAlso, when I try to access the dashboard for site two, I only get a \"This webpage has a redirect loop\"-message.\n\nHere's the htaccess-code under network settings:\n\nRewriteEngine On\nRewriteBase /\nRewriteRule ^index\\.php$ - [L]\n\n# add a trailing slash to /wp-admin\nRewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) wp-sandbox/$2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+/)?(.*\\.php)$ wp-sandbox/$2 [L]\nRewriteRule . index.php [L]" ]
[ "php", "css", "wordpress", ".htaccess" ]
[ "Updating variable value through a function in php", "I am new in web page development, and it seems that this is a basic question but I can't figure out how to solve.\n\nThrough a button I need to change the value of a variable in php, specifically every time a button is pushed the value of a variable must increase.\n\nThe code is the following:\n\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Test</title>\n </head>\n <body>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js\"></script>\n <script>\n function echoVal()\n {\n alert(\"<?php val(); ?>\");\n }\n </script>\n\n <?php\n function val() {\n static $a = 0;\n $a++;\n echo $a;\n } \n ?>\n\n <button onclick=\"echoVal()\"> Increase </button>\n </body>\n </html>\n\n\nThe main problem is that the value of the variable $a is always 1, no increasing its value when the button is pushed. I have saved the file with extension .php (I am not sure if that will make any difference, but I just mention it).\n\nAny suggestion to solve this issue?\n\nThanks in advance for any suggestion.\n\nEdited Code:\n\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Test</title>\n </head>\n <body>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js\"></script>\n <script>\n function echoVal()\n {\n alert(\"<?php val(); ?>\");\n }\n </script>\n\n <?php\n function val() {\n static $a = 0;\n $a++;\n $filename ='infoX.txt';\n if (is_writable($filename)) {\n if (!$handle = fopen($filename, 'w')) {\n echo \"Cannot open file\";\n } else {\n if (fwrite($handle, $a) == FALSE) {\n echo \"Cannot write to file\";\n } else {\n echo $a;\n }\n fclose($handle);\n } \n } else {\n echo \"The file is not writable\";\n }\n } \n ?>\n\n <button onclick=\"echoVal()\"> Increase </button>\n </body>\n </html>" ]
[ "php", "javascript" ]
[ "How to resolve database deadlock issue caused by parallel goroutines using retry transaction?", "We are working to build an exchange using Go. Following components are there in the system of now:\n\n\nFrontend \nBackend\nMatching Engine.\n\n\nHere is how the system works:\n\n\nUser creates an order which goes to Backend. \nBackend processes the new order in following manner :\n\n\nIt validates the order request data & then a db transaction is created for updating users account balance in account table & new order is inserted in the order table. \nAfter db interaction is completed; backend produces a new order message in queue. \n\nMatching Engine processes the new order from the queue and pushes the engine response(i.e updated orders & trades) in another queue\nBackend consumes the engine response as below:\n\n\nMultiple goroutines run in parallel to process engine response &store the updates received in engine response. \nFor storing the the updates, a database transaction is created within each goroutine to update the users account balance, orders & store new trades. \n\nProblem occurs during this stage when concurrent (parallel) transactions try to update the same users account at a time, a deadlock is created in DB as multiple transaction try to lock the same record. Also while a users previously placed orders are being matched and processed user can create new order as mentioned in step 2, so transaction created in step 2 also tries to update the same users account in database which is being accessed by backend to store Matching Engine response. This also adds to the chances of deadlock. \nHow to properly manage and prevent the database deadlock generated in above mentioned flow.\nWe have tried a solution to retry transaction by following code but the deadlock issue can still be reproduced\n\n\n // Update accounts, orders, trades with max retry of 5\n for i := 0; i < 5; i++ {\n err = nil\n time.Sleep(10 * time.Second)\n if err = manager.saveEngineResponse(newEngineResponse, accountUpdatesToDoRef, &updatedOrders); err == nil {\n break\n }\n logger.Debug(\"Error saving engine response\", err)\n }\n if err != nil {\n logger.Fatal(err)\n return\n }\n\n\n\n Error : Error 1213: Deadlock found when trying to get lock; try\n restarting transaction\n\n\nI have refered the link : How to avoid mysql 'Deadlock found when trying to get lock; try restarting transaction'\nwhich states that by keeping the operations in a specific order deadlocks can be avoided. And in the above scenario all transaction will first update account, then order & then trades if any. So the order of operations is consistent in different transactions" ]
[ "mysql", "go", "parallel-processing", "goroutine", "database-deadlocks" ]
[ "Using callback for asynchronous in javascript", "I know nowaday it has promise or await async for asynchronous things in javascript. I just trying figure out how callback work and use it for real.\nI have something like this \n\n// HTML\n<input type=\"file\" id=\"file-to-load\" />\n<button onClick=\"handleFile()\">SHOW DATA</button>\n\n// JS\nfunction readData(callback) {\n var data;\n\n var fileToLoad = document.getElementById(\"file-to-load\").files[0];\n var fileReader = new FileReader();\n fileReader.readAsText(fileToLoad, \"UTF-8\");\n fileReader.onload = function (fileLoadedEvent) {\n data = fileLoadedEvent.target.result;\n }\n\n callback(data);\n}\n\nfunction showData(data) {\n console.log(data);\n}\n\nfunction handleFile() {\n readData(showData);\n}\n\n\nMy purpose is execute function showData() only when function readData() has finished. Using all I learned about callback with the code above, but console give undefined for first button click. It display correct data after second click. Why was that happen ?" ]
[ "javascript", "asynchronous", "callback" ]
[ "Geocode : converting doesn't work by submitting form", "I have a form which converts an adress to geocode with the Google Map API using the onsubmit property. Since I know geocoding is asynchronous. Sometimes it works, and sometime it doesn't. Can anyone help me please? \nThanks a lot!\n\njsp-file :\n\n\n\n<body>\n <form name=\"addLocation\" method=\"POST\" action=\"addLocation.htm\" commandName=\"location\" onsubmit=\"changeAdress()\">\n <table>\n <tr>\n <td>Name</td>\n <td><input type=\"text\" name=\"name\" value=\"${location.name}\"/></td>\n </tr>\n <tr>\n <td>Adress</td>\n <td><input type=\"text\" id=\"adress\" name=\"adress\"/></td>\n </tr>\n <tr>\n <td><input type=\"hidden\" id=\"geolocation\" name=\"geolocation\"/></td>\n </tr>\n </table>\n <input type=\"hidden\" name=\"id\" value=\"${location.id}\"/>\n <input type=\"submit\" name=\"action\" value=\"Save\"/>\n <input type=\"submit\" name=\"action\" value=\"Cancel\"/>\n </form>\n</body> \n\n\n\n\nscript :\n\n function changeAdress() {\n var adress = document.getElementById(\"adress\").value; \n var geocoder = new google.maps.Geocoder();\n geocoder.geocode({'address': adress}, function (results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n var latitude = results[0].geometry.location.lat();\n var longitude = results[0].geometry.location.lng();\n document.addLocation.geolocation.value = latitude + \" \" + longitude;\n document.addLocation.submit();\n } else alert(\"geocode failed:\" + status);\n });\n return false;\n }\n\n\nYou can allways try it yourself: http://jbossewss-leuvenspeaks.rhcloud.com/Test/newLocation.htm" ]
[ "javascript", "jsp", "google-maps-api-3", "geolocation", "geocode" ]
[ "git status shows modifications even with autocrlf=false", "I'm experiencing the same issues as in this question: git status shows modifications, git checkout -- <file> doesn't remove them\n\nGit continues to show working directory modifications, even with git config --global core.autocrlf false:\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git config --get-all core.autocrlf\nfalse\nfalse\n\n\n(Note that I've even set the --system setting to be false)\n\nWhy does it appear that Git is still modifying my end of lines?\n\nAttempts to get rid of modifications\n\nBaseline\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git status\n# On branch master\n# Changes not staged for commit:\n# (use \"git add <file>...\" to update what will be committed)\n# (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n# modified: tools/StatLight/StatLight.EULA.txt\n... more changes ...\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\n\ngit checkout -- .\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git checkout -- .\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git status\n# On branch master\n# Changes not staged for commit:\n# (use \"git add <file>...\" to update what will be committed) \n# (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n# modified: tools/StatLight/StatLight.EULA.txt\n... more changes ...\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\n\nOccasionally this will have an effect in an odd way:\n\nE:\\_dev\\github\\Core [master +0 ~628 -0]> git checkout -- .\nE:\\_dev\\github\\Core [master +0 ~361 -0]> git checkout -- .\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git checkout -- .\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git checkout -- .\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git checkout -- .\n\n\ngit reset --hard\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git reset --hard\nHEAD is now at 11a7f9a Merge pull request #8 from RemiBou/master\nE:\\_dev\\github\\Core [master +0 ~93 -0]>\n\n\ngit add .; git stash; git stash drop\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git add .\n... warnings ....\nwarning: CRLF will be replaced by LF in tools/StatLight/StatLight.EULA.txt.\nThe file will have its original line endings in your working directory.\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git stash\nSaved working directory and index state WIP on master: 11a7f9a Merge pull request #8 from \nRemiBou/master\nHEAD is now at 11a7f9a Merge pull request #8 from RemiBou/master\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git stash drop\nDropped refs/stash@{0} (de4c3c863dbad789aeaf563b4826b3aa41bf11b7)\n\nE:\\_dev\\github\\Core [master +0 ~93 -0]> git status .\\tools\\StatLight\\StatLight.EULA.txt\n# On branch master\n# Changes not staged for commit:\n# (use \"git add <file>...\" to update what will be committed)\n# (use \"git checkout -- <file>...\" to discard changes in working directory)\n#\n# modified: tools/StatLight/StatLight.EULA.txt\n#\nno changes added to commit (use \"git add\" and/or \"git commit -a\")" ]
[ "git", "revert", "git-status", "core.autocrlf" ]
[ "Make Envs Available To Sublime Text", "I need to make an environmental variable available to Sublime Text (3).\n\nSpecifically, I am using Ruby Test to run RSpec tests on a Rails app. In order for my Rails App to use Postgres it needs access to an env that I'm setting in my .bash_profile: \n\n# Postgres\nexport PGHOST=localhost\n\n\nIf I launch ST from the Terminal, this env is available because my .bash_profileis loaded when I open the shell, however if I open ST by launching the app via its icon or via Alfred, .bash_profile is never loaded and this env is not available to ST, causing all my RSpec tests to fail due to problems connecting to the Postgres database.\n\nSo how can I pass environmental variables into Sublime Text (3)?" ]
[ "ruby-on-rails", "environment-variables", "sublimetext", "sublimetext3" ]
[ "What's the latest version of Xcode that comes with iPhone SDK 3.2?", "Reviewing the iOS Developer Downloads & ADC Program Assets, I think it's Xcode 3.2.4, but I'm not sure." ]
[ "iphone", "xcode", "iphone-sdk-3.0", "download", "xcode3.2" ]
[ "How get AWS API Gateway & Lambda REST API to correctly handle a POST as application/x-www-form-urlencoded", "I'm setting up a Lambda as a webhook handler that receive data POSTed from a remote API.\nAs per usual, the external webhook is POSTing the data in the form:\npayload='SOME_JSON' for example payload='{"foo":"bar"}'\nHow can AWS API Gateway be configured to correctly handle application/x-www-form-urlencoded data POSTed from an external webhook, e.g., to correctly map the raw content string into a "form style" parameter name/value pair and pass the value (which is JSON) to the Lambda?\nThe problem is that AWS API Gateway, by default, tries to relay the entire raw string payload=JSONSTRING to the Lambda, but of course the payload= is not JSON, it's the form parameter name, so that generates a 400 error (body not in JSON format).\nTo test, I posted the same data to both the AWS API Gateway, and, so that I can see exactly what is POSTed from the webhook, also to webhook.site for debugging.\nAs shown below the in webhook.site screengrab, the raw data POSTed is in the usual webhook format, "parameter=value" eg payload=JSONSTRING, specifically: payload='{\\"arg1\\":\\"val1\\"}'\nAnd as shown in the webhook.site screengrab, their site completely understood how to map that to a "parameter name" (payload) and the parameter value.\nwebhook.site screengrab:\n\nThe closest I've come is to get the API Gateway & Lambda to stop throwing 400 errors, by using API Gateway's "Body Mapping Template" to at least force the raw content "param=value" into JSON format using this body mapping:\n{"body": "$input.body"}\n\nas described in this helpful blog post: https://blog.summercat.com/using-aws-lambda-and-api-gateway-as-html-form-endpoint.html\n(edit: that blog post was old, Body Mapping Template is not required, API Gateway now supports enabling "Use Lambda Proxy integration" on the Integration Request for the POST method which passed to the Lambda the full input object (headers, payload, etc) as JSON to get rid of the 400 errors. But the "body" key/value in the JSON is still not parse-able JSON, it is prefixed with the payload=")\nBut the problem is the the Lambda event hash still isn't in a usable format it still includes the "payload=...(escaped string)" e.g.\n`{"body"=>"payload=%7B%22arg1%22%3A%22val1%22%7D"\nSo I hope there is some way to configure API Gateway to do what the rest of the world can do, and map the POSTed raw content "payload=JSONSTRING" to a JSON object that is passed to the Lambda, such as {"payload" : "JSONSTRING"} or perhaps just JSONSTRING?" ]
[ "aws-lambda", "aws-api-gateway" ]
[ "Reading audio file from movie clip 'avi' files", "I want to do speaker as well as face recognition in a movie clip, the characters voice and face as well.I am unable to read audio file in .avi file in MATLAB 7.10 R2010a. can anyone help me?" ]
[ "matlab", "audio", "video", "image-processing", "signal-processing" ]
[ "Using Resources getResources(); in AppWidget Android", "I want to use \n\nprivate static final Random rgenerator = new Random();\nResources res = getResources(); \nmyString = res.getStringArray(R.array.xmlString); \nString q = myString[rgenerator.nextInt(myString.length)];\n\n\nWhen i use the same in an activity it works fine, but if i use in AppWidget class it throws an error in getResources(); is there any way to use this in AppWidget, basically all i want is to get random xml strings to appWidget, is there any workaround for this?" ]
[ "java", "android", "random", "resources", "android-appwidget" ]
[ "how to place a rounded button at corner of a layout", "I am trying to place a rounded button over the edge of two edit boxes which are in vertical mode as in the following figure:\n\n\n\nHow can I implement this design?" ]
[ "android", "android-layout" ]
[ "Error while downloading tweets using twitter gem on ROR", "I am able to integrate the twitter gem into my rails application, but sometimes its works and mostly time it gives this error. Here is the snippet of my server response(framework trace) on this weird error.\n\ntwitter (5.4.1) lib/twitter/rest/client.rb:143:in `rescue in request'\ntwitter (5.4.1) lib/twitter/rest/client.rb:131:in `request'\ntwitter (5.4.1) lib/twitter/rest/client.rb:97:in `get'\ntwitter (5.4.1) lib/twitter/search_results.rb:68:in `fetch_next_page'\ntwitter (5.4.1) lib/twitter/enumerable.rb:13:in `each'\nactionpack (3.2.13) lib/action_controller/metal/implicit_render.rb:4:in `send_action'\nactionpack (3.2.13) lib/abstract_controller/base.rb:167:in `process_action'\nactionpack (3.2.13) lib/action_controller/metal/rendering.rb:10:in `process_action'\nactionpack (3.2.13) lib/abstract_controller/callbacks.rb:18:in `block in process_action'\nactivesupport (3.2.13) lib/active_support/callbacks.rb:414:in \n`_run__1064161776__process_action__779617573__callbacks'\nactivesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'\nactivesupport (3.2.13) lib/active_support/callbacks.rb:385:in \n`_run_process_action_callbacks'\nactivesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'\nactionpack (3.2.13) lib/abstract_controller/callbacks.rb:17:in `process_action'\nactionpack (3.2.13) lib/action_controller/metal/rescue.rb:29:in `process_action'\nactionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:30:in `block in \nprocess_action' \nactivesupport (3.2.13) lib/active_support/notifications.rb:123:in `block in instrument'\nactivesupport (3.2.13) lib/active_support/notifications/instrumenter.rb:20:in \n`instrument'\nactivesupport (3.2.13) lib/active_support/notifications.rb:123:in `instrument'\nactionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:29:in \n`process_action'\nactionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in \n`process_action'\nactionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'\nactionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process' \nactionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'\nactionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'\nactionpack (3.2.13) lib/action_controller/metal.rb:246:in `block in action'" ]
[ "ruby-on-rails", "ruby", "twitter", "twitter-gem" ]
[ "How to auto hide the tab bar when presenting other view", "Is there anybody used the IM software called QQ (popular in China)? This software has an tab bar and it has 5 tabs. In each tab there is a navigation controller, like this:\n\n\n\nIn the second tab when tap any of the first three table view cell this tab's view will transit to an other view in normal way, that is the transition happen within the tab bar controller.\n\n\n\nWhen tap any of the last three table view cell this tab's view will also transit to an other view but meanwhile the tab bar will transit together with the view controller too.\n\n\n\nThis is very strange! According to the first situation we can guess that the navigation controller is the child of the tab bar controller, but according to the second situation the tab bar may be the child of navigation controller, right? Anybody knows how to implement this UI? Thank you in advance!" ]
[ "iphone", "ios", "user-interface" ]
[ "PHP method scope binding", "I am confused by how PHP call method in parent-children hierarchy. Here is the code\n\nclass A {\n private function foo() {\n echo \"A!\";\n }\n public function test() {\n $this->foo();\n }\n }\n\nclass C extends A {\n public function foo() {\n echo 'C!';\n }\n}\n\n$c = new C();\n$c->test(); \n\n\nThe output is A!\n\nconsider another example, but only change the foo() method visibility in class A to be public. \n\nclass A {\n public function foo() {\n echo \"A!\";\n }\n public function test() {\n $this->foo();\n }\n }\n\n class C extends A {\n public function foo() {\n echo 'C!';\n }\n }\n\n $c = new C();\n $c->test(); \n\n\nThis output is C!\n\nAny explanation is welcome." ]
[ "php", "oop", "object" ]
[ "How to check if $4 is registered in IRC?", "I am quite an expert when it comes to programming in the MSL language, however I am unfamiliar with raw commands and whatnot.\n\nI am in development of a new script. In this script I would like to check if $4 in what a user says is a registered nick or not but I do not know how to do this.\n\nThank you very much for any help and/or advice in advanced.\n\nBest Regards,\nTim\n\nUpdate:\n\nraw 307:*:{ set $+(%,%chan,-,%CheckNick) Registered }\non *:TEXT:*:#:{\n if ($1 == !regtest) {\n set %chan $remove($chan,$chr(35))\n\n set %CheckNick $4\n whois $4\n }\n if ($($+(%,%chan,-,%CheckNick),$4),5) != $null) {\n do this...\n }\n else {\n else message...\n }\n}\n\n\nI got this to work to check however my if statement to check if the variable has been set or not is being ignored...\n\nEdit:\n\nI tried using this:\n\ncheckNickReg $chan $2 $nick\n\n\n...And echoing this:\n\n echo -a Target: $1\n echo -a Nick: $2\n echo -a Status: $3\n echo -a Chan: $3 - $chan\n\n\nI'm trying to get a response to the channel such as; $nick $+ , $1 is not registered/registered/registered but not logged in.\n\nWhat I've posted above is obviously wrong as it doesn't work, however I've tried a few methods and I'm actually not sure how the data is passed on with out the likes of tokenizing or setting variables...\n\nReply\n\n[01:59:06] <~MrTIMarshall> !isReged mr-dynomite\n[01:59:08] <&TornHQ> : mr-dynomite status is: NOTLOGGED \nEDIT: mr-dynomite is not currently on, should this not = does not exist or does this check even when their not on, if so this is bloody brillant!!!\n[02:00:04] <~MrTIMarshall> !isReged MrTIMarshall\n[02:00:04] <&TornHQ> : MrTIMarshall status is: LOGGEDIN\n\n$4 does not seem to work and what is the difference between 'exists, not logged in' and 'recognized, not logged in'?\n\nAlso, how does the data get passed on without setting variables or tokenizing?\n\n(P.S. Thank you so much for the help you have dedicated so far!)\n\nAnother Edit:\n\nI've been taking an in depth look today, am I correct in thinking if 0 or 1 the user is either not on-line or not registered (in the comments it says 0 = does not exists / not online, 1 = not logged in whereas 2 also says not logged in but recognized of which I'm unsure as what recognized means. Otherwise I'm very grateful for this script help and whatnot I'm just unclear on the numbers..." ]
[ "irc", "mirc" ]
[ "MongoDB: adding sort() to query ruins result set for $and query", "I've stumbled upon some very strange behavior with MongoDB. For my test case, I have an MongoDB collection with 9 documents. All documents have the exact same structure, including the fields expired_at: Date and location: [lng, lat].\n\nI now need to find all documents that are not expired yet and are within a bounding box; I show match documents on map. for this I set up the following queries:\n\nvar qExpiry = {\"expired_at\": { $gt : new Date() } };\nvar qLocation = { \"location\" : { $geoWithin : { $box : [ [ 123.8766, 8.3269 ] , [ 122.8122, 8.24974 ] ] } } };\nvar qFull = { $and: [ qExpiry, qLocation ] };\n\n\nSince the expiry date is long in the past, and when I set the bounding box large enough, the following queries give me all 9 documents as expected:\n\ndb.docs.find(qExpiry);\ndb.docs.find(qLocation);\ndb.docs.find(qFull);\ndb.docs.find(qExpiry).sort({\"created_at\" : -1});\ndb.docs.find(qLocation).sort({\"created_at\" : -1});\n\n\nNow here's the deal: The following query returns 0 documents:\n\ndb.docs.find(qFull).sort({\"created_at\" : -1});\n\n\nJust adding sort to the AND query ruins the result (please note that I want to sort since I also have a limit in order to avoid cluttering the map on larger scales). Sorting by other fields yield the same empty result. What's going on here?\n\n(Actually even stranger: When I zoom into my map, I sometimes get results for qFull, even with sorting. One could argue that qLocation is faulty. But when I only use qLocation, the results are always correct. And qExpiry is always true for all documents anyway)" ]
[ "javascript", "mongodb", "sorting" ]
[ "VS Express RC 2013 - How can I update the registry keys?", "Recently I stumbled upon an issue with VS:\n\nNothing under "installed" when adding new item in VS 2013?\n\nLooking at this question that Microsoft personally responded to I got a way to work around the error:\n\n\n Thank you for reporting this issue to us. We have identified the issue\n and have fixed this for the next public release of Visual Studio\n Desktop Express. In the mean time to work around this issue you can\n update TemplatesDir location in registry. The key to update is given\n below. \n \n [HKEY_CURRENT_USER\\Software\\Microsoft\\WDExpress\\12.0_Config\\Projects{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC943}\\AddItemTemplates\\TemplateDirs{F1C25864-3097-11D2-A5C5-00C04F7968B4}/1]\n \n \"TemplatesDir\"=\"C:\\Program Files (x86)\\Microsoft Visual Studio\n 12.0\\\\VC\\VCProjectItems_WDExpress\"\n \n Thanks, Vaijanath A VC++ Team\n\n\nThis is the \"TemplatesDir\", yet I don't know where to change the key.\n\n\n\nNow I dont know how to follow Microsofts instructions. Its asking me to 'update TemplatesDir location in registry and gives me a key [HKEY_CURRENT.....]\n\nCan you please redefine this answer provided by Microsoft and tell me what to do?" ]
[ "c#", "visual-studio" ]
[ "How can I default to the alphabet keypad on focus of an EditText view?", "My scenario:\n\nI have 2 EditText:\n\n<EditText \n android:id=\"@+id/edt1\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"10dp\"\n android:digits=\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"\n android:inputType=\"textPassword\"\n android:maxLength=\"8\" \n android:singleLine=\"true\" \n android:layout_below=\"@+id/add\"/>\n<EditText \n android:id=\"@+id/edt2\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"10dp\"\n android:digits=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n android:inputType=\"textPassword\"\n android:maxLength=\"8\" \n android:singleLine=\"true\" \n android:layout_below=\"@+id/edt1\"/>\n\n\nWhen edt1 is focused, I input number(keyboard shows number) then I next edt2, keyboard still displays number.\n\nI want to keyboard change number to qwerty keyboard.\n\nHow can I do this?\n\nUPDATED: I mean: qwerty keyboard always show when EditText is focused.\n\nThanks all!" ]
[ "android", "keyboard", "android-edittext" ]
[ "When to begin T-SQL query with USE?", "I'm a T-SQl and database newbie, and a little confused. \nIn the T-SQL book I'm reading it says that a USE statement is written to set the database context of the session. Does that mean that there can be more than one database in an instance of SQL-server and the USE statement tells SQL server which database the query will be on?" ]
[ "database", "tsql" ]
[ "Are there limitations for using the bing news rss feed?", "We want to use the bing news rss feed, https://www.bing.com/news/search?q={query}&format=rss, but we're not sure if there are any restrictions, i.e. max queries per second or max queries per month. Does anyone know what kind of pricing and restrictions exist?" ]
[ "rss", "feed", "bing", "bing-api" ]
[ "iOS - Using Search API for Google Shopping", "My ultimate goal is to search for an item (using a query in code) and display some information from a JSON object using the Google Shopping API - Objective-C Client. \n\nI know that the search API for shopping is going to be deprecated very shortly but wanted to at least get something to work just to show that it does work. So short term I would like to get this to work and long term use something similar (such as an Amazon API). \n\nI am targeting iOS 6.0+ and am currently using XCode 4.6. I followed this blog tutorial here for XCode 4.5 and got everything set up as stated here. (Although maybe there is another way to get the pre-built library built - but the blog author said that that did not work)\n\nIf you look at this link they give you an example of how to use the API(under Basics - Objects and Queries) but I have a problem in that I cannot find the GTLServiceGoogleShopping object anywhere. If you use the svn command to checkout the library files you don't get this object nor do you get any example code for this particular service. \n\nI am wondering if anyone has done this in iOS before and/or if anyone would like to recommend an alternative way to do a product search on the web that returns a JSON Object, that is compatible with XCode/iOS and that is as easy to use as the Google Shopping API seems to be. (i.e. use a few objects to make a http request then parse the JSON object as needed). \n\nAny help/information/guidance would be greatly appreciated." ]
[ "ios", "xcode", "json", "google-shopping-api", "google-shopping" ]
[ "KeystoneJS extending textarray to allow fields", "I am currently using keystoneJS for a project and I have a requirement to allow admins to add additional fields for each deliverable. \nI managed to find textarray, which allows me to add a single line of text but I would need something closer to adding textfields as i would need to add paragraphs of text.\n\nAny advise/direction to extending the functionality or is it not possible?\n\nFYI: I also tried using these two resources to no avail, perhaps due to a lack of knowledge on my end.\n- https://github.com/keystonejs/keystone/wiki/Create-a-custom-field-type-for-app-development\n- https://gist.github.com/JedWatson/8519769\n\nEDIT: i wasnt able to figure out in detail, but changing the arrayfield in mixin to multiline met my use case. Now trying to include two fields in one add." ]
[ "keystonejs" ]
[ "Reflecting changes made to stored procedure in Entity Framework-generated complex type", "So I've got a DB in SQL Server that I'm connecting to and using Entity Framework 4.1 to generate my POCO classes, which works generally pretty well. There are also stored procedures that I am using the 'function import' feature to create retrieve the resulting rows of data from calling them. Essentially the process I'm using is to:\n\n\nRight-click on the Model.edmx and choose \"Function Import...\"\nPick the procedure from the dropdown\nEnter my desired Function Import Name\nClick \"Get Column Information\"\nClick \"Create New Complex Type\"\nClick \"OK\"\n\n\nand that will create a POCO class for the result set definition and I can do something like:\n\nvar query = context.GetMyStuff().AsQueryable(); \n\nto retrieve the results. This seems to work just fine.\n\nNow the trouble I'm having is when I try to modify a stored procedure and then get the changes to propagate to my code. For instance, I added an additional column to a table and then updated the stored procedure to return that column data as part of the results. I don't see how to make that update propagate into the function import stuff, i.e., get the generated POCO to have a new property for that added column. \n\nWhat's the drill to make that update to the procedure reflect back in C# side? Am I going to have to make a new class each time? Wasn't obvious to me how to do this.\n\n\n\nAdditional Info:\n\nWhen I've tried to \"Update\" the Complex type, as suggested in the response by Ladislav to this question, I get an error message \"Verify that the FunctionImport name is unique.\"\n\nIf I try what E.J. Brennan suggests below, I get the same error message.\n\nWhat does work, at least for me, is to open the Model.edmx file in Notepad++, find the FunctionImport line and delete it then regenerate it. That's not ideal, but it worked." ]
[ "entity-framework", "entity-framework-4.1" ]
[ "Java client can't receive message from Mosquitto on Android", "My Os is Windows 7,32bit.\nI install mosquitto-1.1.2-install-win32.exe.\nI don't change the mosquitto.conf file,so no topic prefix setting.\nUse Mosquitto to subscribe topic like(the subscription window):\n\nmosquitto_sub.exe -q 2 -t mytopic\nOR mosquitto_sub.exe -q 2 -t # \n\nUse Mosquitto to publish a topic like(the publish window): \n\nmosquitto_pub.exe -q 2 -t mytopic -m “hello″\n\nThen in the subscription cmd window,I can receive \"hello\"\nI have been following Dale Lane's blog and \"Android MQTT example project\" to access Mosquitto.\n\njava client(MQTTDemo.java): \n//i use mobile emulator\neditor.putString(“broker”, \"10.0.2.2″); \neditor.putString(“topic”, \"mytopic”); \n//or editor.putString(“topic”, “#”); '#' match any topic\n\nI test connectToBroker() in MQTTService.java, the connection is OK.\nI publish the topic \"mytopic\" again with Mosquitto.\nBut,finally I cannot receive the message in the mobile emulator.\n\nAnybody know why or any other methods?\n\nThanks a lot!" ]
[ "android", "push-notification", "mq", "mqtt" ]
[ "Empty DTD Element with extra info", "I know how DTD works and when I want to declare <br> (or <br/>), I have to do this:\n\n<!ELEMENT br EMPTY>\n\n\nBut in this file (https://www.w3.org/MarkUp/html-spec/html.dtd), I found the following line:\n\n<!ELEMENT BR - O EMPTY>\n\n\nI see that the most are the same, but what difference does the - and the O make? Where can I learn more about it?\n\nThanks" ]
[ "html", "dtd", "xml" ]
[ "Cannot disable Spring Cloud Config via spring.cloud.config.enabled:false", "Let me preface this by saying that I'm not using Spring Cloud Config directly, it is transitive via Spring Cloud Hystrix starter.\n\nWhen only using @EnableHystrix, Spring Cloud also tries to locate a configuration server, expectedly unsuccessfully, since I'm not using one. The application works just fine, as far as I can tell, but the problem is in the status checks. Health shows DOWN because there is no config server.\n\nBrowsing the source of the project, I'd expect spring.cloud.config.enabled=false to disable this functionality chain, however this is not what I'm seeing.\n\nAfter upgrading to 1.0.0.RC1 (which adds this property) and using @EnableCircuitBreaker:\n\n{\n status: \"DOWN\",\n discovery: {\n status: \"DOWN\",\n discoveryClient: {\n status: \"DOWN\",\n error: \"org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.cloud.client.discovery.DiscoveryClient] is defined\"\n }\n },\n diskSpace: {\n status: \"UP\",\n free: 358479622144,\n threshold: 10485760\n },\n hystrix: {\n status: \"UP\"\n },\n configServer: {\n status: \"DOWN\",\n error: \"org.springframework.web.client.ResourceAccessException: I/O error on GET request for \"http: //localhost: 8888/bootstrap/default/master\":Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect\"\n }\n}\n\n\nAfter checking the configprops endpoint, it seems that my properties are being overridden. Note that the parent has the configClient enabled.\n\nparent: {\n configClientProperties: {\n prefix: \"spring.cloud.config\",\n properties: {\n password: null,\n discovery: {\n enabled: false,\n serviceId: \"CONFIGSERVER\"\n },\n name: \"bootstrap\",\n label: \"master\",\n env: \"default\",\n uri: \"http://localhost:8888\",\n enabled: true,\n failFast: false,\n username: null\n }\n }\n},\nconfigClientProperties: {\n prefix: \"spring.cloud.config\",\n properties: {\n password: null,\n discovery: {\n enabled: false,\n serviceId: \"CONFIGSERVER\"\n },\n name: \"bootstrap\",\n label: \"master\",\n env: \"default\",\n uri: \"http://localhost:8888\",\n enabled: false,\n failFast: false,\n username: null\n }\n}\n\n\nAny direction would be appreciated, if it seems I'm not doing this correctly." ]
[ "spring", "spring-boot", "netflix", "spring-cloud", "hystrix" ]
[ "compare generic T to new T() always false", "I have a generic function(object, object), one of parameters can be new()\nwhen I try to compare object to new() it is always false.\n\npublic static void TestFunction<T>(object requestData, object storedData) where T : class, new()\n{\n if (requestData != null && storedData != null)\n if (requestData?.GetType().Name != storedData?.GetType().Name)\n { throw new Exception(\"object types are not match\"); return; }\n if (requestData == null) throw new Exception(\"request can not be null\");\n\n ```\n //storedData might be new T()\n // but even i am creating new objects to compare inside function - no luck\n ```\n\n object o = (T)Activator.CreateInstance(typeof(T));\n object o1 = (T)Activator.CreateInstance(typeof(T));\n object o2 = new T();\n\n T test = new T();\n\n ```//all return false\n o.Equals(o1).Dump();\n test.Equals(new T()).Dump();\n o2.Equals(o).Dump();\n\n}\n\n\nI expect the comparison to be true." ]
[ "c#", "generics", "compare" ]
[ "Spring RestTemplate - Passing in object parameters in GET", "How do I use the RestTemplate to pass in an object as a parameter? For instance, say that I had the following services set up with Spring Boot:\n\n@RequestMapping(value = \"/get1\", method = RequestMethod.GET)\npublic ResponseEntity<String> get1(@RequestParam(value = \"parm\") String parm) {\n\n String response = \"You entered \" + parm;\n return new ResponseEntity<String>(response, HttpStatus.OK);\n }\n\n@RequestMapping(value = \"/get2\", method = RequestMethod.GET)\npublic ResponseEntity<String> get2(@RequestParam(value = \"parm\") MyObj parm) {\n\n String response = \"You entered \" + parm.getValue();\n return new ResponseEntity<String>(response, HttpStatus.OK);\n }\n\n\nIf a client wanted to call the first service, they could use the following:\n\n//This works fine\nRestTemplate restTemplate = new RestTemplate();\nString response = restTemplate.getForObject(\"http://localhost:8080/get1?parm={parm}\", String.class, \"Test input 1\");\n\n\nBut if a client wanted to call the second service, they get a 500 error using the following:\n\n//This doesn't work\nMyObj myObj = new MyObj(\"Test input 2\");\nRestTemplate restTemplate = new RestTemplate();\nString response = restTemplate.getForObject(\"http://localhost:8080/get2?parm={parm}\", String.class, myObj);\n\n\nThe MyObj class looks like this:\n\n@JsonSerialize\npublic class MyObj {\n private String inputValue;\n\n public MyObj() {\n }\n\n public MyObj(String inputValue) {\n this.inputValue = inputValue;\n }\n\n public String getInputValue() {\n return inputValue;\n }\n\n public void setInputValue(String inputValue) {\n this.inputValue = inputValue;\n }\n}\n\n\nI'm assuming that the problem is that the myObj is not getting properly setup as a parameter. How do I go about doing this?\n\nThanks in advance." ]
[ "java", "spring", "spring-boot", "get", "resttemplate" ]
[ "Web Application Structure of Web Pages for Users", "I want to create a web application that takes a logged in user to their dashboard on log-in. What is the best way to structure the web app pages? Should I have a generic template page which auto populates with the logged in user details (object from db) for each user? Or should I have a seperate page (generated html page) for each user? Id expect the latter option to be extra storage on the db but the former solution would mean that there are more users hitting a single template. Or is there a better solution?" ]
[ "html", "web-applications", "web", "architecture" ]
[ "Objects registered in HTTPContext scope still reported by the Model.InstancesOf method", "When initializing my aspx page, I declare it (inside OnInit) in the StructureMap container to get it injected into the appropriate presenter:\n\ncontainer.Configure(x => x.For<IMyInterface>().HttpContextScoped().Use(this));\n\n\nHttpContextScope should force removing \"this\" (i.e. the page object) from the container at the end of the current request. To prove it I've added - just after the above line - the following code:\n\nIEnumerable<InstanceRef> refs = container.Model.InstancesOf<IMyInterface>();\nforeach (InstanceRef r in refs)\n{\n Type t = r.ConcreteType;\n}\n\n\nThe question is: \n\nWhy the refs collection increases by 1 in each postback? \n\nIt not only increases but r.ConcreteType doesn't raise any exception - it means that the underlying object really exist. The page is injected into the presenter which is itself declared in the HttpContext scope.\n\nWhat am I doing wrong that HttpContext scope seems to work incorrectly?\n\nThanks in advance\n\n\n\nI've thought it over and the result is as follows. If I configured the container to create a new instance of my class (it (configuration) would be done only once, during Application_Start), the container would create an instance and then - really delete it at the end of the Http request. But I only register the existing instance of this class. The container is not the instance's owner and therefore it may not delete it - but the configuration keeps the reference to it (therefore it can't be deleted at all). At the other side, the configuration item is not removed by anybody, anytime (but added in every Http request).\n\nTherefore all that works as it works. It is, of course, my misunderstanding of \"HttpContextScoped\" (and some other things :-( ).\n\nSo, I'm at the starting point: is there any way to remove such a registration from the configuration?\n\n[Edited]\nIt seems that I can't remove such a registration. The solution is: replace the automatic constructor injection with a manual property injection. I.e.: create the presenter (without its view) and then - set the view manually: thePresenter.View = this;\nThe aforementioned registration is not added and the problem just doeasn't appear." ]
[ "structuremap" ]
[ "Button no longer fires function after being used once", "I have a table / tbody / row that, when a user clicks on \"Add Product\", I want that row to be cloned and pasted underneath the previous row. In other words, the user is adding journal entry items.\n\nWhat I want, is that when they first click on the \"Add Product\" button, I want the row to be cloned and inserted underneath. I then want that first \"Add Product\" button to be disabled, however, the next button has to be enabled in order to allow yet another entry to be inserted, so on and so forth.\n\nSo far, I can get the button to clone and insert the row below, and disable the first button. However, the second button, although not disabled, no longer fires the function. It is just an \"empty\" button.\n\n<table id=\"sales-journal\">\n <tbody>\n <tr class=\"sales-journal-row\">\n <td class=\"grid-40\">\n <select id=\"sales-product-id\" name=\"sales-product-id\" required=\"required\">\n <option value=\"1\">Option 1</option>\n <option value=\"2\">Option 2</option>\n <option value=\"3\">Option 3</option>\n </select>\n </td>\n <td class=\"grid-20\">\n <input type=\"number\" step=\"1\" id=\"sales-sold-qty\" name=\"sales-sold-qty\" />\n </td>\n <td class=\"grid-20\">\n <input type=\"number\" step=\"1\" id=\"sales-spill-qty\" name=\"sales-spill-qty\" />\n </td>\n <td class=\"grid-20\">\n <button class=\"sales-journal-add\" id=\"sales-journal-add\" />Add Product</button>\n </td>\n </tr>\n </tbody>\n</table>\n\n\nAnd the jquery\n\n$('.sales-journal-add').click(function() {\n var clone = $('#sales-journal > tbody:last').clone()\n clone.insertAfter('#sales-journal > tbody:last');\n $(this).removeAttr('id').attr('disabled', 'disabled').addClass('disabled');\n});" ]
[ "javascript", "jquery", "html", "css" ]
[ "Retriving the row index of edited cell in with", "When using <p:rowEditor>, how can I retrieve the row index of the edited cell?\n\nHere is the relevant code:\n\n<p:dataTable id=\"datasetParamDt\" var=\"datasetParam\" value=\"#{projectCampaignManagementMB.allParametersList}\" editable=\"true\" rowIndexVar=\"rowIndex\"> \n <p:ajax event=\"rowEdit\" listener=\"#{projectCampaignManagementMB.onParameterValueEdit}\" update=\":campaignForm:growl\" /> \n <p:ajax event=\"rowEditCancel\" listener=\"#{projectCampaignManagementMB.onParameterValueCancel}\" update=\":campaignForm:growl\"/> \n\n <p:column headerText=\"Value\"> \n <p:cellEditor>\n <f:facet name=\"output\"> \n <h:outputText value=\"#{projectCampaignManagementMB.paramValue}\" />\n </f:facet> \n <f:facet name=\"input\"> \n <p:inputText value=\"#{projectCampaignManagementMB.paramValue}\" /> \n </f:facet> \n </p:cellEditor>\n </p:column> \n\n <p:column headerText=\"Options\" style=\"width:50px\"> \n <p:rowEditor />\n </p:column> \n</p:dataTable>\n\n\nIn simple datatables I used to use the <f:param> in a <p:commandLink> as follows:\n\n<f:param name=\"index\" value=\"#{rowIndex}\" />\n\n\nHowever, in my case with <p:rowEditor>, how can I get the row index when the user validates the edited value in the onParameterValueEdit() method?\n\npublic void onParameterValueEdit(RowEditEvent event) { \n int index = ... // index of the row to which the edited cell belongs \n parametersValue.set(Integer.parseInt(index),paramValue);\n}" ]
[ "jsf", "primefaces" ]
[ "jqGrid Virtual Scrolling rowNum issue", "I am trying to load grid data virtually with jqGrid\n\nMy issue is, i have set the rowNum as 100. I am getting 100 unique records.\nEach unique record may have multiple sub records.\n\n\n\nFrom the above image country and state make a uniques record and subrecords are city, attraction and zipcode.\n\nI am using this example to group the row levels\n\nJqgrid - grouping row level data\n\nmy grid displays 100 unique records but with the above example i will be loading around 130 rows.\n\nwhen i am trying to scroll and when i reach 70th row, second page of data is loading and overwriting the last few records of the first 100 unique records.\n\nPlease let me know what is best way to set the rowNum dynamically so that when i reach the last 100th unique record the it should load the second page of grid data.\n\nBelow is the code i am using.\n\n$(\"#myTable\").jqGrid({\n url: '../myUrl',\n mtype: \"POST\",\n shrinkToFit: false,\n width: null,\n height:505,\n datatype: \"json\", \n page: 1,\n colModel: ospColModel,\n rowNum: 100,\n loadtext:\"loading\",\n onSelectRow: editRow,\n viewrecords: true,\n scroll: 1, \n emptyrecords: 'Scroll to bottom to retrieve new page',\n jsonReader : {\n root:function(obj){\n return readRecords(obj);\n },\n page: function(obj){\n return obj.PageNum;\n },\n records: function(obj){\n return obj.TotalRecords;\n },\n total:function(obj){\n return Math.round(obj.TotalRecords/100);\n },\n repeatitems: false\n }\n});" ]
[ "jquery", "jqgrid", "free-jqgrid" ]
[ ".htaccess file work fine on localhost but generates 404 error on testing server", "I am developing a system which redirects all requests to an index.php file using .htaccess\n\nDirectoryIndex public/index.php\n\nRewriteEngine on\n\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule ^((?!public/).+)$ public/index.php?cmd=$1 [QSA,NC,L]\n\n\nWhich works fine when I am running the system locally via XAMPP but when I upload it to a remote testing site, its only able to load the homepage but when I click any other link it generates a 404 error.\n\nWhat could be the issue?\n\nThanks" ]
[ "php", "apache", ".htaccess" ]
[ "Salesforce Apex Create Opportunity after Custom Object field change", "I have a simple trigger that is supposed to create a new opportunity when the SD_Action__c field on my custom object is a certain value. The code has no errors, but nothing happens when I try update the field in sandbox or production. What am I missing to make this great an opportunity when m.SD_Action__c=='Generate Opportunity' ?\n\ntrigger MDwinning on MD_Meeting__c (after update) {\n List <Opportunity> oppToInsert = new List <Opportunity> ();\n for (MD_Meeting__c m : Trigger.new) {\n if (m.SD_Action__c == 'Generate Opportunity') {\n Opportunity o = new Opportunity ();\n // o.Owner = m.Sales_Director__c,\n o.Market_Developer__c = m.Market_Developer__c;\n //o.Account = m.Account__c;\n oppToInsert.add(o);\n }//end if\n }//end for o\n try {\n insert oppToInsert;\n } catch (system.Dmlexception e) {\n system.debug (e);\n }\n} \n\n\nHere is my test class:\n\n@isTest (SeeAllData = true)\npublic with sharing class MDwinningTest {\n static testMethod void MDwinningTest() {\n MD_Meeting__c m = new MD_Meeting__c(\n Account__c = 'test Account',\n Desired_Meeting__c = 'Call',\n Name = 'Meeting name',\n Sales_Director__c = 'SD Name',\n Market_Developer__c = 'MD Name',\n Meeting_Date__c = Date.today(),\n Contact__c = 'Test Contact',\n Title__c = 'Boss',\n Functional_Role__c = 'eCommerce - VP',\n Contact_Email__c = '[email protected]',\n SD_Action__c = 'Generate Opportunity',\n Primary_URL__c = 'http://www.google.com/'\n );\n insert m;\n }\n}" ]
[ "triggers", "salesforce", "apex-code", "force.com", "apex" ]
[ "Tracking DateAccessed in SQL Server Row?", "This seems like it should be trivial, but I'm stuck after checking the CREATE TRIGGER docs. No select trigger.\n\nI have a table:\n\nCREATE TABLE [Fileserver].[Files]\n (\n [FileId] [int] IDENTITY(1, 1) NOT NULL ,\n [DateAccessed] [datetime] NULL ,\n [DateCreated] [datetime] NULL ,\n [DateModified] [datetime] NULL\n )\nGO\n\n\nWhen someone reads a row from the table, I want to update the DateAccessed column. DateCreated is handled with a default value of getdate(), and DateModified with a trigger. I cannot think of a way to handle DateAccessed WITHOUT limiting table access to a stored procedure. Our team is making heavy use of Linq2Sql, so I prefer to allow SQL selects on the table.\n\nThanks!" ]
[ "sql-server", "select", "triggers" ]
[ "Inserting data from 1st table to 2nd table in different locations", "In foxpro, I can simply do this to add or merge table with different locations:\n\n-> use C:\\tableA\n-> append from D:\\tableB\n\n\nin this foxpro code I've provided, tableB which exists from location D:\\ appends all its row into tableA.\n\nThe question now is, how do I do that in C#? \n\nI can simply invoke this query: insert into tableA select * from tableB to append all rows from tableB to tableA. But this is only true when I used same database and their file location remained intact and same at the same time.\n\nMy problem is that the database location of these two tables were different. How do I resolve this problem using C#?" ]
[ "c#", "database", "ado.net" ]
[ "GLPaint with GLKit: flickering when drawing", "I'm having a problem with GLKit in a project that is similar to GLPaint. \n\nFirst of all, I'm not using GLKViewController, but only a GLKView which is added to my class.\n\nMy problem is that when I draw in my GLKView, the content flickers. It looks as if I was drawing in a certain frame buffer in the first call to GLKViewDelegate's drawRect and next call it was a different frame buffer, then next call it came back to the first one, etc.\nI have tested this possibility and it does not seem to be the case, both render buffer and frame buffer are the same in all the drawing.\n\nHere is how my drawing works (similar to GLPaint sample code):\n\nOn touch events, I call renderStroke to generate points that are used in the drawing to apply the textures and present a line. I am using custom shaders, so I place the buffer containing these points in a pre-specified spot so the shader has access to it:\n\n// Give the vertex positions to the vertex shader\nglVertexAttribPointer(ATTRIB_POSITION, 2, GL_FLOAT, 0, 0, vertexBuffer);\nglEnableVertexAttribArray(ATTRIB_POSITION);\n\n\nThen, in the draw method, I call glDrawArrays: \n\n- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect {\n glDrawArrays(GL_POINTS, 0, self.verticesCount);\n}\n\n\nHere is how I initialize the GLKView:\n\nself.glView = [[GLKView alloc] initWithFrame:self.frame];\nself.glView.context = _context;\nself.glView.delegate = self;\nself.glView.drawableColorFormat = GLKViewDrawableColorFormatRGBA8888;\nself.glView.drawableStencilFormat = GLKViewDrawableStencilFormat8;\nself.glView.enableSetNeedsDisplay = NO;\nself.glView.userInteractionEnabled = NO;\n[self addSubview:self.glView];\n\n\nThe texture, modelViewProjection matrix seem to work properly since I can see the right texture applied to every point. \n\nI've been searching ways to debug this, but everything I saw seemed normal. Is there something I'm missing?\n\nThanks!\n\nEDIT: \n\nI am wondering, when drawRect is called, is the color_render_buffer and stencil_buffer meant to be cleared before further drawing is done? My goal here is to keep the drawing I have done previously and draw other content on top of it. Without GLKit, this is normally done using kEAGLDrawablePropertyRetainedBacking. I have set it on the glView layer using: \n\nCAEAGLLayer * const eaglLayer = (CAEAGLLayer*) self.glView.layer;\neaglLayer.opaque = NO;\neaglLayer.drawableProperties = @{kEAGLDrawablePropertyRetainedBacking : @(YES)};\n\n\nThis does not seem to work however." ]
[ "ios", "opengl-es", "opengl-es-2.0", "glkit" ]
[ "persiste ( long text & special chars ) in app engine from GWT and get the result from appengine as json", "now i have GWT application ( front end ) and java GAE ( back end ) \ni need some help at this item :\n\n1 - how to store text in appengine and retrieve it as json format.\n\n2 - how to validate that special character can store correctly in app engine and retrieve correctly in json format." ]
[ "java", "google-app-engine", "gwt", "google-cloud-datastore" ]
[ "ARCore losing tracking when camera is obscured & should recalibrate", "When the camera is obscured, the AR system loses track of the position of gameobjects and player should recalibrate the surface to make the game objects appear again.\n\nPlayers can accidentally obscure the camera anytime, so this is not desirable.\n\nIs there a way to prevent this from happening, so that the gameobjects reappear in their original positions after the camera is un-obscured?\n\nHere's a video describing the issue\n\nThanks!\n\n-Jake" ]
[ "unity3d", "arcore" ]
[ "Deserialize Json.NET with an immutable nested object", "I have the following C# class:\n\npublic RuleCondition(string field,\n Operator @operator,\n RightValueExpression rightValueExpression)\n {\n _operator = @operator;\n _field = field;\n _rightValueExpression = rightValueExpression;\n }\n public RightValueExpression ValueExpression => _rightValueExpression;\n public string Field => _field;\n public Operator Operator => _operator;\n}\n\npublic sealed class RightValueExpression\n{\n private readonly bool _relativeToBaseline;\n private readonly double _value;\n private readonly RightOperator _operator;\n private readonly PercentOrAbsolute _isPercent;\n public RightValueExpression(bool relativeToBaseline,\n RightOperator @operator,\n double value,\n PercentOrAbsolute isPercent)\n {\n _isPercent = isPercent;\n _operator = @operator;\n _value = value;\n _relativeToBaseline = relativeToBaseline;\n }\n public PercentOrAbsolute IsPercent => _isPercent;\n public RightOperator Operator => _operator;\n public double Value => _value;\n public bool RelativeToBaseline => _relativeToBaseline;\n}\n\npublic enum Operator\n{\n GreaterThan,\n EqualTo,\n LessThan,\n GreaterThanEqualTo,\n LessThanEqualTo\n}\n\npublic enum RightOperator\n{\n Plus,\n Minus,\n Times,\n DividedBy\n}\npublic enum PercentOrAbsolute\n{\n Percent,\n Absolute\n}\n\n\nWhen serialized to Json using Json.Net, I get the following:\n\nvar ruleCondition = new RuleCondition(\"Min\", Operator.GreaterThan, new RightValueExpression(relativeToBaseline: true, RightOperator.Plus, 50, PercentOrAbsolute.Percent));\nvar json = JsonConvert.SerializeObject(ruleCondition);\n\n\nJson:\n\n{\n\"ValueExpression\": {\n \"IsPercent\": 0,\n \"Operator\": 0,\n \"Value\": 50.0,\n \"RelativeToBaseline\": true\n},\n\"Field\": \"Min\",\n\"Operator\": 0\n\n\n}\n\nAll fine, however deserializing using Json.Net\n\nvar des = JsonConvert.DeserializeObject<RuleCondition>(json);\n\n\nRightValueExpression in RuleCondition is always null.\n\nDo I need a custom deserializer here?" ]
[ "c#", "json.net" ]
[ "Illegal character in authority at index 7: hdfs://localhost:9000 with hadoop", "I am trying to connect to hdfs.\n\nConfiguration configuration = new Configuration();\nconfiguration.set(\"fs.default.name\", this.hdfsHost);\nfs = FileSystem.get(configuration);\n\n\nhdfsHost is 127.0.0.1:9000.\n\nbut get this exception at FileSystem.get();\n\nI have another project running the same code, but works well.\nCould anyone give any suggestion?\nThank you very much\n\nthe exception track:\n\nException in thread \"main\" java.lang.IllegalArgumentException\nat java.net.URI.create(URI.java:842)\nat org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:103)\nat org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95)\nat TransferToHadoop.TransferFiles.<init>(TransferFiles.java:50) \nat.TransferToHadoop.ScheduleTransferJobs.getTransferFiles(ScheduleTransferJobs.java:99)\nat .TransferToHadoop.ScheduleTransferJobs.main(ScheduleTransferJobs.java:30)\n Caused by: java.net.URISyntaxException: Illegal character in authority at index 7: hdfs://localhost:9000 \nat java.net.URI$Parser.fail(URI.java:2809)\nat java.net.URI$Parser.parseAuthority(URI.java:3147)\nat java.net.URI$Parser.parseHierarchical(URI.java:3058)\nat java.net.URI$Parser.parse(URI.java:3014)\nat java.net.URI.<init>(URI.java:578)\nat java.net.URI.create(URI.java:840)\n... 5 more" ]
[ "exception", "hadoop", "hdfs" ]
[ "Get unique values from array of objects", "I have an array of dynamic objects like that:\n\nvar arr = [\n {state: \"FL\"},\n {state: \"NY\"},\n {state: \"FL\"},\n {gender: \"Male\"},\n {state: \"NY\"},\n {gender: \"Female\"},\n {gender: \"Female\"},\n {year: \"1990\"}\n]\n\n\nHow can I get just the unique objects?\n\nThe desired output is an array containing just the unique objects:\n\narr = [\n {state: \"FL\"},\n {state: \"NY\"},\n {gender: \"Male\"},\n {gender: \"Female\"},\n {year: \"1990\"}\n]\n\n\nI'm trying something like that using reduce, but on this way I need know the object key:\n\narr = arr.reduce((acc, curr) => \n acc.find(e => e['state'] === curr['state']) ? acc : [...acc, curr], [])\n\n\nIt's not a duplicate because the other questions does not use \"dynamic object\" to get unique" ]
[ "javascript", "unique" ]
[ "Is Open Graph still in beta?", "When I'm reading https://developers.facebook.com/blog/post/634/ I can see that Facebook Open Graph is finally available.\nBut on my Apps Auth Dialog configuration page, I can read :\n\n\n While in Open Graph Beta, the 'publish_actions' permission can only be requested from developers and test users of your app. The 'publish_actions' permission will be ignored if requested from any other user. Learn More\n\n\nSo my question is : is Open Graph still in beta ?\n\nThant a lot !" ]
[ "facebook-opengraph", "beta" ]
[ "How to create a C# gui to run a simulink model?", "I am new to Matlab and trying to code a winform based GUI for a simulink model in C#. But i had issue about how to communicate them efficiently.\n\nI tried is COM communication between C# to matlab but after loading model, it was frozen.\n\nC# code:\nMLApp.MLApp matlab = new MLApp.MLApp();\nmatlab.Visible = 0;\nmatlab.Execute("cd('path to model')");\nmatlab.Execute("model");\nmatlab.Execute("set_param('model','SimulationCommand','start')");\n\nIt looks like a buffer overflow to me but I couldn't find any resources on the subject.\nHow can i prevent freezing?\n\nI tried to communicate c# and matlab to control simulink model using udp protocol. I coded a matlab script to be bridge. However, i realized that i need to create more than one thread that will communicate with each other. Eventhough i used parellel computing toolbox in matlab, i can not accomplish it.\n\nmatlab script :\nu = udp('', 'LocalHost', '127.0.0.1', 'LocalPort', 49013);\nfopen(u);\nwhile(true)\n command = fread(u);\n\n if(command == 1)\n %start model \n set_param('model','SimulationCommand','start')\n \n elseif(command == 3)\n %pause model \n set_param('model','SimulationCommand','pause')\n .\n .\n .\n else(command == 4)\n %stop model \n set_param('model','SimulationCommand','pause')\n end\nend\n\nIs there a way to communicate threads each other in matlab?\nAny suggestion would be nice." ]
[ "c#", "matlab", "simulink", "communication" ]
[ "Copy path/file name in Eclipse to clipboard", "Is there a shortcut to copy the current path/file to the clipboard?" ]
[ "eclipse", "file", "path-finding" ]
[ "How to enforce module hierarchy/dependency", "The Validation module is divided into #1, #2 and General as below\n\n======================================================================\n--------------------------- ---------------------------\n| #1 Validation Sub Module| | #2 Validation Sub Module|\n--------------------------- ---------------------------\n\n------------------------------------------------------------\n| General Validation Module |\n------------------------------------------------------------\n======================================================================\n\n\nTo validate something, one has to go through sub modules but not directly call General module. \n\nHow to enforce (other than code review, preferably in .NET) no piece of code should call General module directly? Reflection !!!\n\nEDIT\nI am also seeking some solutions provided by Software Engineering principles i.e. beyond anything specific to a language/platform so are there any design patterns or software design guidelines or development practices?" ]
[ ".net", "design-patterns", "module" ]
[ "Redshift where time between 2 times", "I want to get records between 2 times. The column is in datetime format.\n\nSay, I want to get records between 10am and 2:30pm.\n\nIn Mysql, I can write TIME(datetime_col)>='10:00' AND TIME(datetime_col)<='14:30'\n\nI am wondering the redshift equivalent of that. \n\nI can try extract(hour from datetime_col) but that won't be correct as I need to consider minutes too.\n\nI could try to_char(datetime_col, 'HH24:MI') but that will not compare with <= or >=\n\nI am wondering if there is an easy way to achieve it and I am missing it completely." ]
[ "sql", "amazon-redshift" ]
[ "docker-compose.yml nginx with php link", "I tried this in the docker-compose.yml file but can't get php working in the nginx server. What I try to do is simply have nginx with php working\n\n web:\n image: nginx:latest\n ports:\n - \"8080:80\"\n volumes:\n - ./docker-nginx-php/html:/usr/share/nginx/html\n links:\n - php\nphp:\n image: php:7-fpm\n volumes:\n - ./docker-nginx-php/html:/usr/share/nginx/html\n\n\nHope someone knows how to get it working!\n\nI have on my host system apache2 installed which serves some of my apps but I want to have nginx with php server another domain so port 80 is currently in use by apache2 listener that's why I use port 8080:80 instead in this example above" ]
[ "docker", "nginx", "docker-compose", "yaml", "dockerfile" ]
[ "Taking input from stdin segmentation fault", "An expected input for the code I'm trying to run looks something like this:\n\n(i,j) where i and j are integers. (Ex. (1,2), (10,21), etc).\n\nI need to store the both integers in int variables.\n\nThis is what I did:\n\n getchar(); // gets open parenthesis\n\n // gets first num\n char *first;\n int z = 0;\n int a;\n\n while((a = getchar()) != ',') {\n first[z] = a;\n z++;\n }\n int firstNum;\n sscanf(first, \"%d\", &firstNum);\n printf(\"%d\\n\", firstNum); //checking if got correct num\n\n // gets second num\n char *second;\n int y = 0;\n int b;\n while((b = getchar()) != ')') {\n second[y] = b;\n y++;\n }\n int secondNum;\n sscanf(second, \"%d\", &secondNum);\n printf(\"%d\\n\", secondNum); //checking if got correct num\n\n\nIt works to get the first number. But, when I did it for the second number, I got a segmentation fault and I can't figure out why? I basically just redid the process of getting the first number?\n\nThanks!" ]
[ "c", "input", "segmentation-fault", "stdin" ]
[ "create thumbnails using for loop", "How to create Thumbnails from an unzipped image folder using for loop in Codeigniter?" ]
[ "php", "codeigniter", "thumbnails" ]
[ "Object Oriented Design - Game", "I'm designing a Game with Java, there are 2 players, different types of enemies and potions. This is my classes hierarchy:\n\n\n\nAs you can see I have the Touchable interface, I know interfaces are contracts with classes that describe a certain behavior of the class, so I declared the void collision(Player p) method inside the Touchable interface because not every GameObject is Touchable (by the player) but then I realized something, I can put the void collision(Player p) method in the GameObject class this way:\n\npublic void collision(Player p) {}\n\n\nand then get rid of the Touchable interface, and get rid of this if statement in the for each loop over all the GameObjects:\n\nif (gameObject instanceOf Touchable) { ... }\n\n\nand just call gameObject.collision(p) and if it is not implemented by the subclass nothing will happened. Do you think this is a better way?" ]
[ "java", "oop", "interface" ]
[ "makefile: how to specify header files", "I'm trying to write a makefile for all of my cpp prjects. After searching from the internet, I make a makefile as below:\n\ng++11=g++ -std=c++11 -stdlib=libc++\n\nCPPFILES=$(wildcard *.cpp)\nOBJFILES=$(CPPFILES:.cpp=.o)\n\n\nres.out: $(OBJFILES)\n $(g++11) -lncurses -o $@ $^ -g\n\n#obj/%.o: %.cpp\n%.o: %.cpp\n $(g++11) -c -o $@ $< -g\n\n\nclean:\n rm *.o *.out\n\n\nI tried to use this file to compile my cpp projects and it worked well.\n\nHowever, when I make some change in the header files, it doesn't work anymore because this makefile can't detect the modification in header files.\n\nIs there any easy way to specify header files in the makefile?\nOfc I don't want to specify them one by one." ]
[ "c++", "makefile", "header-files" ]
[ "Problems using Twitter4j on GAE throws 401 just after deploy", "Well, I'm having a weird error here:\n\nI'm developing one GAE app to read some Twitter Data, and after read a lot of docs, I have it working on my test server (Running on my pc) but after deploy and test on the real (my appspot domain) it shows this message: \n\n\n 401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or >incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the >system clock is in sync.\n message - Could not authenticate you\n code - 32\n\n\nI've tried to recreate my OAuthAppToken and OAuthAppTokenSecret keys, even changing the permissions to \"Write, Read and Direct Messages\" and even assingning one Callback URL but nothing seems to work...\n\nI've tried using twitter4j.properties OR using setOAuthConsumer(TW_CONSUMER_KEY, TW_CONSUMER_SECRET) OR a ConfigurationBuilder whith the correct constants and I'm experimenting the same Issue.\n\nI'm working with AppEngine 1.8.3 and Twitter4j 3.0.4\n\nIv'e been writing on log and the Twitter object seems to be well created... I dont understand why is working on my PC but not on the real app.\n\nOn some other post someone says that could be because it needs to use Sync clock.. but he doesn't explains where to change that property...\n\nDid someone had a clue?" ]
[ "google-app-engine", "authentication", "twitter", "twitter4j" ]
[ "Is Visual Studio Development Server producing log files?", "I'm running Visual Studio Development Server on Windows 7. Is it producing log files? If so, where?" ]
[ "visual-studio", "windows-7" ]
[ "Web service getting data from USB devices on Raspberry Pi", "I have a question about getting data on the Raspberry Pi. I know that we can create RESTful services to get data from GPIO with the help of RPi.GPIO library. But what if I want to get data from traditional USB devices? Say I have a USB Bluetooth dongle and I can read data through operations in command line. But is it possible to perform the same through a web service? Any possible help is greatly appreciated!" ]
[ "bluetooth", "raspberry-pi", "bluetooth-lowenergy", "gpio" ]
[ "How to start view controller from non viewcontroller class", "I want to open present uiviewcontroller from class that inherts from nsobject .how this work?\nI tried this code\n\nlet storyboard = UIStoryboard(name: \"Main\", bundle: nil)\n\nlet initialViewController = storyboard.instantiateViewController(withIdentifier: \"LoginSignupVC\")\nself.present (initialViewController, animated: false, completion: nil)" ]
[ "swift3", "viewcontroller", "nsobject" ]
[ "How to fix \"java.lang.ClassNotFoundException\" in my Java program?", "I am very new to programming. My main goal is to write code that logs into a android app and does everything that you would have to do with your fingers. So far I've only got the app to open, now I'm stuck on entering the login information.\n\nHere is my code -\n\npackage OpenOfferUpTest;\n\nimport java.io.File;\nimport java.net.MalformedURLException;\nimport java.net.URL;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.Capabilities;\nimport org.openqa.selenium.remote.DesiredCapabilities;\nimport org.testng.annotations.Test;\nimport org.testng.annotations.*;\nimport io.appium.java_client.android.AndroidDriver;\n\npublic class OpenOfferUp {\n\nAndroidDriver driver;\n\n@BeforeTest\npublic void OpensOfferUp() throws MalformedURLException\n{\nFile OfferUp = new File(\"C:\\\\Users\\\\boung\\\\Desktop\\\\OfferUp.apk\");\nDesiredCapabilities cap = new DesiredCapabilities();\ncap.setCapability(\"deviceName\", \"Virtual Device\");\ncap.setCapability(\"platformName\", \"android\");\ncap.setCapability(\"null\", \"OfferUp\");\ncap.setCapability(\"appPackage\", \"com.offerup\");\ncap.setCapability(\"appActivity\", \n\"com.offerup.android.login.splash.LoginSplashActivity\");\n\ndriver = new AndroidDriver(new URL(\"http://localhost:4723/wd/hub\"), cap);\n\n}\n@Test\npublic void SimpleTest() {\n\ndriver.findElement(By.id(\"com.offerup:id/email_button\")).click();\n\n}\n\n}\n\n\nThese are the main errors that show up in console - \n\nio.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0\nINFO: Detected dialect: W3C\n\nFAILED: OpensOfferUp\njava.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils\n\nCaused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils\n\nFAILED: SimpleTest\njava.lang.NullPointerException\n\nI don't know how to fix any of these, I've been researching on how to fix these but I have no luck." ]
[ "java", "android", "selenium", "automation", "appium" ]
[ "error LNK2001: unresolved external symbol despite inclusion of header file", "I have a problem I can't seem to resolve. \nI have a file JobDispatcher.cpp which includes a file #include \"CalculateNormalsJob.h\"\ncontaining the declaration of a class with the same name.\n\nclass CalculateNormalsJob : public Job\n{\n\npublic:\n CalculateNormalsJob(some params);\n...\n};\n\n\nThe file CalculateNormalsJob.cpp contains the following definition\n\nCalculateNormalsJob::CalculateNormalsJob(some params)\n : Job(params)\n{\n}\n\n\nBoth CalculateNormalsJob.h and CalculateNormalsJob.cpp are in the same project and folder as JobDispatcher.cpp which creates a Job object as\n\nadd(new CalculateNormalsJob(some params));\n\n\nDuring linking, I receive the following error\n\nError 9 error LNK2001: unresolved external symbol \"public: __thiscall CalculateNormalsJob::CalculateNormalsJob(class ResourceMap *,class JobScheduler *,class Job *,int)\" (??0CalculateNormalsJob@@QAE@PAVResourceMap@@PAVJobScheduler@@PAVJob@@H@Z) C:\\Fredrik\\vs12\\proflexa\\scanner\\JobDispatcherJob.obj\n\n\nI am clueless as to what I have forgotten. I'm using Visual studio 2012 under Win7 and the included v110 compiler.\n\nAny help appreciated!\n\nEDIT:\n\nFor some reason it seems like CalculateNormalsJob.cpp is not compiled. I have however no clue as to why. It is included in the project and Visual studio's IntelliSense has knowledge of the class and it's functions. \n\nEDIT 2:\n\nCalculateNormalsJob.h\nCalculateNormalsJob(ResourceMap *state, JobScheduler *scheduler, Job* listener, int scanNumber);\n\n\nCalculateNormalsJob.cpp\nCalculateNormalsJob::CalculateNormalsJob(ResourceMap *state, JobScheduler *scheduler, Job* listener, int scanNumber)\n : Job(state, scheduler, listener), scanNumber(scanNumber)\n{\n}\n\n\nCall:\nadd(new CalculateNormalsJob(state,scheduler,this,scanNbr));" ]
[ "c++", "visual-studio-2012", "unresolved-external" ]
[ "how to insert multiple json data with single key in redis", "i am new one for redis today only i have stared to work on this.\ni have inserted data into redis by done like this\n\n var data = {\n \"name\": \"XXXxxx\",\n \"email\": \"[email protected]\"\n }\n db.set('userdetails', JSON.stringify(data), function (err, result) {\n console.log(result);\n });\n\n\nit inserted fine but when i try to insert new data i could view my newly inserted data but i could not view previously inserted data \n.\nhow to insert multiple json data by using only one key(userdetails)?\nis there possible to create data structure like this?\n\nuserdetails:\n\n[\n {\n \"name\": \"xxxxxxxxxxxxxx\",\n \"email\": \"[email protected]\"\n }, {\n \"name\": \"xxxxxxxxxx\",\n \"email\": \"[email protected]\"\n }, {\n \"name\": \"xxxxxx\",\n \"email\": \"[email protected]\"\n }\n]" ]
[ "javascript", "json", "node.js", "redis" ]
[ "Need to get count based condition in select clause based on group by Date in tsql", "DECLARE @testTable TABLE (OrderDate date, StoreType int, Fruits int, Vegetables int, eggs int)\n\nINSERT INTO @testTable VALUES(getDate(), 1, 4, 6, 9); \nINSERT INTO @testTable VALUES(getDate(), 1, 5, 7, 3); \nINSERT INTO @testTable VALUES(getDate(), 2, 8, 2, 1); \nINSERT INTO @testTable VALUES(getDate()-1, 1, 7, 2, 8); \nINSERT INTO @testTable VALUES(getDate()-1, 1, 0, 9, 4); \nINSERT INTO @testTable VALUES(getDate()-1, 2, 5, 6, 1); \nINSERT INTO @testTable VALUES(getDate()-2, 1, 7, 2, 5); \nINSERT INTO @testTable VALUES(getDate()-2, 2, 6, 6, 6); \nINSERT INTO @testTable VALUES(getDate()-2, 1, 5, 6, 3); \nINSERT INTO @testTable VALUES(getDate()-3, 1, 9, 3, 3); \nINSERT INTO @testTable VALUES(getDate()-3, 2, 6, 0, 1); \nINSERT INTO @testTable VALUES(getDate()-3, 1, 2, 7, 4); \n\n-- NEED TO MODIFY QUERY\nSELECT \n YEAR(OrderDate) AS [YEAR]\n ,MONTH(OrderDate) AS [MONTH]\n ,DAY(OrderDate) AS [DAY]\n ,CASE WHEN StoreType IN (1,2) THEN SUM(Fruits) END AS FruitCount\n ,CASE WHEN StoreType IN (1,2) THEN SUM(Vegitables) END AS VegetablesCount\n ,CASE WHEN StoreType IN (1,2) THEN SUM(eggs) END AS EggsCount\n ,StoreType\n ,(CASE WHEN StoreType = 1 THEN SUM(Fruits + vegitables + eggs) END) AS [CountBY Stype(1)]\nFROM \n @testTable\nGROUP BY \n YEAR(OrderDate),\n MONTH(OrderDate),\n DAY(OrderDate),\n StoreType\n\n\nCurrent result set:\n\n YEAR MONTH DAY FruitCount VegitalbesCount EggsCount StoreType CountBySType(1)\n2015 2 9 11 10 7 1 28\n2015 2 9 6 0 1 2 NULL\n2015 2 10 12 8 8 1 28\n2015 2 10 6 6 6 2 NULL\n2015 2 11 7 11 12 1 30\n2015 2 11 5 6 1 2 NULL\n2015 2 12 9 13 12 1 34\n2015 2 12 8 2 1 2 NULL\n\n\nExpected / desired output:\n\n YEAR MONTH DAY FruitCount VegitalbesCount EggsCount CountBY Stype(1)\n 2015 2 9 17 10 8 28\n 2015 2 10 18 14 14 28\n 2015 2 11 12 17 13 30\n 2015 2 12 17 15 13 34\n\n\nIs there any way can I achieve result set like above(EXPECTED)? We can use sub query, but due to high volume of data query makes so slow." ]
[ "sql-server", "tsql", "count" ]
[ "finding next leap year java", "The code works when the first year is a leap year so if I said the year was 2004 it would return 2008, but when the starting year is not a leap year, it returns nothing. How would I output that if, for ex: the given year was 2001, 2002, or 2003, the next leap year would be 2004. I know the while loop makes sense but I don't know what to put inside it. ALSO I can only use basic java formatting so no inputted classes like java.time.Year\npublic static boolean leapYear(int year) {\n boolean isLeap = true;\n if (year % 4 == 0) {\n if (year % 100 == 0) {\n if (year % 400 == 0)\n isLeap = true;\n else\n isLeap = false;\n } else\n isLeap = true;\n } else {\n isLeap = false;\n }\n return isLeap;\n}\n\npublic static int nextLeapYear(int year) {\n int nextLeap = 0;\n\n if (leapYear(year)) {\n nextLeap = nextLeap + 4;\n } else {\n while (!leapYear(year)) {\n nextLeap++;\n }\n nextLeap += 1;\n }\n year += nextLeap;\n return year;\n}" ]
[ "java", "date", "for-loop", "while-loop", "leap-year" ]
[ "C Compilation error on mac", "gcc -c -o fsbench.o fsbench.c -O3 -Wall -Wextra\ngcc -o fsbench fsbench.o -O3 -Wall -Wextra -lpthread\nUndefined symbols for architecture x86_64:\n \"_reposition_offset\", referenced from:\n _perf_io in fsbench.o\nld: symbol(s) not found for architecture x86_64\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nmake: *** [fsbench] Error 1\n\n\nI am not able to compile my program on mac. It keeps throwing this error. I tried several things and was not able to compile it without error." ]
[ "c", "macos", "gcc", "compilation", "compiler-errors" ]
[ "phpmailer success but no email sent", "PHPMailer says successful but email is not being sent. Email trace doesn't show any errrors. From sending or receiving email. Is there something that I'm missing?\n\nBelow is my mailer.php file:\n\n require 'class.phpmailer.php';\nrequire 'class.smtp.php';\n\n$mail = new PHPMailer;\n\n\n$mail->isSMTP(); // Set mailer to use SMTP\n$mail->Host = 'localhost'; // Specify main and backup server\n$mail->SMTPAuth = true; // Enable SMTP authentication\n$mail->Username = '[email protected]'; // SMTP username: FROM EMAIL\n$mail->Password = 'pw'; // SMTP password: FROM PW\n\n\n$mail->From = '[email protected]'; //FROM EMAIL\n$mail->addAddress('[email protected]'); // Add a recipient, Name is optional\n\n\n$mail->WordWrap = 50; // Set word wrap to 50 characters\n$mail->isHTML(true); // Set email format to HTML\n\n$mail->Subject = 'Contact Form';\n$mail->Body = 'This is the HTML message body <b>in bold!</b>';\n$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';\n\nif(!$mail->send()) {\n echo 'Message could not be sent.';\n echo 'Mailer Error: ' . $mail->ErrorInfo;\n exit;\n}\n\necho 'Message has been sent';" ]
[ "smtp", "phpmailer" ]
[ "Unable to display pdf in an iframe JSF", "I am letting the user upload a file and am storing it as so\n\nList<Meetingsattachment> mal= new ArrayList<Meetingsattachment>();\n meeting.setMeetingsattachments(mal);\n\n Random rand=new Random();\n int num=Math.abs(rand.nextInt());\n String dirname=\"/path/to/files/\"+meeting.getDescription()+\"-\"+num;\n\n File dir= new File(dirname);\n System.out.println(dir.getAbsolutePath());\n if(! dir.exists()) \n dir.mkdir();\n\n for(UploadedFile uf:ufl){\n Meetingsattachment ma=new Meetingsattachment();\n ma.setAttachment(dirname+\"/\"+uf.getFileName());\n File file = new File(dirname+\"/\"+uf.getFileName());\n\n\n try (FileOutputStream fop = new FileOutputStream(file)) {\n\n // if file doesn't exists, then create it\n if (!file.exists()) {\n file.createNewFile();\n }\n\n // get the content in bytes\n\n fop.write(IOUtils.toByteArray(uf.getInputstream()));\n fop.flush();\n fop.close();\n meeting.addMeetingsattachment(ma);\n System.out.println(\"Done\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n }\n\n int meetingid=mrm.addMeeting(meeting);\n\n\n return \"meetings?faces-redirect=true\";\n\n\nWhat I am basically doing is taking the file storing it at /path/to/files/ and then storing the location in my database, so value in db is as so\n\n/path/to/files/t2-672409104/1.pdf\n\nI am able to download the file as so \n\nMeetingsattachment ma=(Meetingsattachment) actionEvent.getComponent().getAttributes().get(\"attachment\");\n //System.out.println(\"here \"+form.getRqid());\n try{\n\n InputStream stream = new FileInputStream(new File(ma.getAttachment()));\n String fl=ma.getAttachment(); \n System.out.println(fl);\n String filename=fl.split(\"/\")[5];\n\n //System.out.println(ra.getRaid());\n setFile(new DefaultStreamedContent(stream,\"application/pdf\",filename));\n\n\nin the jsf\n\n<ui:repeat var=\"meetattachment\" value=\"#{meet.meetingsattachments}\">\n <h:outputText value=\"#{meetattachment.attachment}\" />\n\n <p:commandButton icon=\"ui-icon-arrowthickstop-1-s\"\n\n onclick=\"PrimeFaces.monitorDownload(showStatus, hideStatus)\"\n actionListener=\"#{meetBean.buttonAction}\">\n <f:attribute name=\"attachment\" value=\"#{meetattachment}\"></f:attribute>\n <p:fileDownload value=\"#{meetBean.file}\" />\n </p:commandButton>\n\n\nBut when I try to display the file in an iframe I just get an iframe showing resource not found\n\n<ui:repeat var=\"meetattachment\" value=\"#{meet.meetingsattachments}\">\n <h:outputText value=\"#{meetattachment.attachment}\" /> \n <p:lightBox iframe=\"true\">\n <h:outputLink value=\"#{meetattachment.getAttachment()}\">\n preview2\n </h:outputLink>\n </p:lightBox>\n\n\n <br />\n </ui:repeat>\n\n\nThe value that the h:outputlink is getting is /path/to/files/t2-672409104/1.pdf\n\nIn the developer webconsole I can see the following error\n\nGET \nhttp://localhost:8080/path/to/files/t2-672409104/1.pdf not found\n\n\nso I think the problem is the path it is trying to use to find the file, from my understanding if I store the file using the relative path /path/to/files the actual path for the file is C:\\path\\to\\files\n\nI tried hardcoding the value as such just to test\n\n<h:outputLink value=\"C:\\path\\to\\files\\t2-672409104\\1.pdf\">\n\n\nI get a message saying it cannot understand the protocol C\n\nSo my question basically is how do I provide the path to these files to open them in a frame" ]
[ "jsf", "iframe", "jsf-2", "primefaces" ]
[ "Adding a Class to a Table Row Disables Editing TextArea", "I have a table containing several columns one of which is a checkbox which indicates the vote is invalid. When the user selects this checkbox I add a \"vote-invalid\" class to the row at which point a textarea in the adjoining column can no longer be selected for input.\n\nThe HTML for the row is;\n\n<tr>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>...</td>\n <td>\n <input type=\"checkbox\"\n id=\"Lots_0__Invalid\" \n name=\"Lots[0].Invalid\"\n value=\"true\"\n data-val=\"true\" \n data-val-required=\"The Invalid field is required.\">\n\n <input name=\"Lots[0].Invalid\" type=\"hidden\" value=\"false\">\n </td>\n <td>\n <textarea id=\"Lots_0__Note\" \n name=\"Lots[0].Note\"\n class=\"text-box multi-line\" \n data-val=\"true\" \n data-val-length=\"The note/comment cannot be longer than 500 characters\" \n data-val-length-max=\"500\"></textarea>\n </td>\n</tr>\n\n\nand the script to add/remove the class is;\n\n$(\"[id$='_Invalid']\").click(function (evt) {\n var me = this;\n $tr = $(this).closest(\"tr\");\n\n if (me.checked) {\n $tr.addClass(\"vote-invalid\");\n $tr.find(\"textarea\").prop(\"contentEditable\", true);\n }\n else {\n $tr.removeClass(\"vote-invalid\");\n }\n});\n\n\nBefore the Invalid checkbox is selected the textarea is editable. When \"Invalid\" is checked the class is added to the row but I can no longer edit the textarea; I cannot get the textarea to accept focus by clicking in it or tabbing. When \"Invalid\" is unchecked I can edit the textarea again.\n\nAs the code above shows I have tried setting the \"contentEditable\" attribute to true with no success.\n\nWhen the page is first loaded the textarea has the following properties;\n\ndisabled: false\ncontentEditable: inherited\nreadOnly: false\n\n\nAfter checking \"Invalid\" the properties are;\n\ndisabled: false\ncontentEditable: true\nreadOnly: false\n\n\nThe classes used are;\n\n.vote-invalid{\n background-color: orange !important;\n color: white;\n }\n\n .vote-invalid:hover{\n background-color: darkorange !important;\n }" ]
[ "javascript", "jquery", "html", "checkbox" ]
[ "How to sign with private Key in X509certificate by RSA", "Newbie here. I am tasked to handle x509certificate in swift. It seems this x509 thing sounds scary. I try my best to describe what I want to achieve. Hope you can guide me.\n\nBelow is what I try to achieve:\n\n\n 1) I would like to know, what I need in Swift to handle the\n x509certificate p12 file and private Key 2) How to Sign with\n private key by RSA \n\n\nIn C#, below code is to get a private Key\n\npublic static RSACryptoServiceProvider UsePrivateKeyFromP12(string certFileName, string pwd)\n{\n\nvar privateCert = new X509Certificate2(System.IO.File.ReadAllBytes(certificateFileName), password);\n\n return (RSACryptoServiceProvider)privateCert.PrivateKey;\n}\n\n\nHow would I do in Swift? The private key will be on the client side.\n\nThanks" ]
[ "swift3", "rsa", "private-key" ]
[ "Disabled Button when it Clicked in table", "I want to disable button Assign when it clicked, bacause it should assign only once so i can achieve this, I have done the following code in HTML:\n\n<table class=\"table details\">\n<thead>\n<tr>\n<th sort-by=\"firstName\">User Name</th>\n<th sort-by=\"lastName\">Description</th>\n<th sort-by=\"Budget\" sort-init=\"desc\">Bid Amount</th>\n<th sort-by=\"lastName\">Action</th>\n</tr>\n</thead>\n<tbody>\n<tr ng-repeat=\"issue in issues | filter:filter\">\n<td><strong><a href=\"/ViewBid/Index?{{ issue.User_ID }}\" />{{ issue.UserName }} </strong></td>\n<td><a href=\"/ViewBid/Index?{{ issue.User_ID }}\" />{{ issue.Description }}</td>\n<td><a href=\"/ViewBid/Index?{{ issue.User_ID }}\" />{{issue.Bid_amt}}</td>\n<td>\n<div ng-controller=\"ExampleCtrl_Assign\">\n<div ng-show=\"AsgHide\">\n<button type=\"button\" ng-click=\"AssignRecord(issue.ID,issue.Description,issue.Bid_amt)\">Assign</button>\n</div>\n</div>\n <div ng-controller=\"ExampleCtrl_Delete\">\n<div ng-show=\"AsgHide\" >\n<button type=\"button\" ng-click=\"DeleteRecord(issue.ID)\">Delete</button>\n</div>\n</div>\n</td>\n</tr>\n</tbody>\n</table>\n\n\nAnd JavaScript Code is as following:\n\nvar app = angular.module('siTableExampleApp_Assign', []);\n app.controller('ExampleCtrl_Assign', ['$scope','$http', function ($scope, $http) {\n var user2 = window.localStorage.getItem('UserId');\n var Basic = window.localStorage.getItem('Basic');\n var Token = window.localStorage.getItem('Token');\n\n $scope.FunctionDisable = function (i) {\n $(\"#rbutton'+i+'\").attr(\"disabled\", \"disabled\");\n }\n\n $scope.AssignRecord = function (ID, Description, Bid_amt) {\n var BidID = ID;\n var date = new Date(); \n encodedString = {\n \"ID\": 1,\n \"Travel_Info_ID\": travel_info_id,\n \"Bid_ID\": parseInt(BidID),\n \"Description\": Description,\n \"Bid_amt\": Bid_amt,\n \"Status\": \"InProcess\",\n \"User_ID\": user2,\n \"Entry_Date\": date,\n \"Update_Date\": date\n }\n $http({\n method: 'POST',\n url: 'http://saisoftwaresolutions.com/v1/Assigned_Bids/Assigned_Bid/Create',\n data: encodedString,\n headers: {\n 'Authorization': 'Basic ' + Basic,\n 'Token': Token\n }\n })\n .success(function (data, status, headers, config) {\n console.log(headers());\n console.log(data);\n if (status === 200) {\n\n //window.location.href = 'http://localhost:22135/BDetail/Index';\n\n } else {\n $scope.errorMsg = \"Login not correct\";\n }\n })\n .error(function (data, status, headers, config) {\n $scope.errorMsg = 'Unable to submit form';\n })" ]
[ "javascript", "angularjs", "html" ]
[ "publish C# Excel Addin with UDF", "I work on a Excel Addin in C# and my problem is present when i publish my C# Addin.\n\nI'll explain:\n\nI used this code: http://csharpramblings.blogspot.fr/2011/09/communicating-between-vsto-and-udfs-in.html\n\nWhich allow me to use UDF in my Addin. And it's work very well ! ... in Visual Studio 2013.\n\nWhen i launch my Addin with Visual Studio i see my Addin in \"COM Addins\" in Excel. And my UDF in \"Excel Addins\" in Excel.\n\nThen if:\n I publish my Addin with rightclick in the project in visual studio.\n I install the addin with the setup.exe generated by VS.\n I launch Excel\n=> my addin works well, but my UDF doesn't work. Values of the cells are \"#NAME?\".\n\nI checked in the COM Addins, my Addin is present.\nI checked in the Excel Addins, i don't see my UDF.\n\nSo i used RegAsm to register the Assembly of the published DLL.\nNow i see my UDF in the \"Excel Addins\" but it still doesn't work.\n\nIf anybody has an idea to help me that would be great !\n\nI use: Windows 8.1 Pro, Visual Studio Pro 2013, Excel 2016 with Office365\n\nThank you in advance for your time." ]
[ "c#", "excel", "user-defined-functions", "publish", "excel-addins" ]
[ "Apache Superset on Mobile", "Does anyone know if you can expose a superset or chart on a mobile device? Has anyone explored it?\nI have researched github and stackoverflow but have not seen anything posted." ]
[ "mobile", "apache-superset" ]
[ "service tomcat9 isn't working in Ubuntu 18.04", "when I type the following code: \n\nservice tomcat9 start\n\n\nI get in response: \n\ntomcat9: unrecognized service\n\n\nI am trying to install JDK in Ubuntu 18.04 on virtual machine.\n\nWhat could be the problem?\n\nThanks in advance." ]
[ "java", "ubuntu", "tomcat", "virtual-machine", "tomcat9" ]
[ "Saving as png renders multiple times - html2canvas", "I am using the following code: \n\n$('#dwnlink').click(function() {\n window.scrollTo(0,0);\n html2canvas($('#generate')[0], { \n }).then(function(canvas) {\n var a = document.createElement('a');\n a.href = canvas.toDataURL(\"image/png\");\n a.download = 'myfile.png';\n a.click();\n });\n window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);\n });\n\n\nWhich works fine for saving my div as a png. When clicking the button with the ID of dwnlink, the save as box appears as it should, and I then save to a folder. However, the save as box pops up another time and when I click cancel, it pops up again. Is there a reason why this is repeating 3 times? (sometimes its more than 3)" ]
[ "javascript", "html2canvas" ]