texts
sequence
tags
sequence
[ "Facebook/Graph API in iOS: Create Groups and Manage users through our app", "It seems that Graph API only supports Group Creation and Management for game app that are in the App Center. \n\nHowever, we would like to integrate Facebook Groups into our iOS application(not a game app) and need the ability to create new groups and manage users through our app. Is there a way to do this through the Facebook/Graph API or is another approach we could leverage to develop an integrated solution? \n\nProblem Description: We're developing an iOS app where one of the user(Role base) can create Groups and manage the group.\n\n• Admin user Register/Log in to Facebook via the app\n• Admin user creates a group\n• Admin user can add people to the group\n• Admin user creates an event for the group.\n• Admin user can invite members to an event.\n• Eventually, Admin user will be managing the group using the app.\n\n\nIf more info needed feel free to drop a mail.\n\nThank you." ]
[ "ios", "facebook", "facebook-graph-api", "facebook-ios-sdk", "facebook-game-groups" ]
[ "Transactional handling of text files on Windows", "I have multiple Windows programs (running on Windows 2000, XP and 7), which handle text files of different formats (csv, tsv, ini and xml). It is very important not to corrupt the content of these files during file IO. Every file should be safely accessible by multiple programs concurrently, and should be resistant to system crashes. This SO answer suggests using an in-process database, so I'm considering to use the Microsoft Jet Database Engine, which is able to handle delimited text files (csv, tsv), and supports transactions. I used Jet before, but I don't know whether Jet transactions really tolerate unexpected crashes or shutdowns in the commit phase, and I don't know what to do with non-delimited text files (ini, xml). I don't think it's a good idea to try to implement fully ACIDic file IO by hand. \n\nWhat is the best way to implement transactional handling of text files on Windows? I have to be able to do this in both Delphi and C#.\n\nThank you for your help in advance.\n\nEDIT\n\nLet's see an example based on @SirRufo's idea. Forget about concurrency for a second, and let's concentrate on crash tolerance. \n\n\nI read the contents of a file into a data structure in order to modify some fields. When I'm in the process of writing the modified data back into the file, the system can crash. \nFile corruption can be avoided if I never write the data back into the original file. This can be easily achieved by creating a new file, with a timestamp in the filename every time a modification is saved. But this is not enough: the original file will stay intact, but the newly written one may be corrupt. \nI can solve this by putting a \"0\" character after the timestamp, which would mean that the file hasn't been validated. I would end the writing process by a validation step: I would read the new file, compare its contents to the in-memory structure I'm trying to save, and if they are the same, then change the flag to \"1\". Each time the program has to read the file, it chooses the newest version by comparing the timestamps in the filename. Only the latest version must be kept, older versions can be deleted.\nConcurrency could be handled by waiting on a named mutex before reading or writing the file. When a program gains access to the file, it must start with checking the list of filenames. If it wants to read the file, it will read the newest version. On the other hand, writing can be started only if there is no version newer than the one read last time.\n\n\nThis is a rough, oversimplified, and inefficient approach, but it shows what I'm thinking about. Writing files is unsafe, but maybe there are simple tricks like the one above which can help to avoid file corruption.\n\nUPDATE\n\nOpen-source solutions, written in Java:\n\n\nAtomic File Transactions: article-1, article-2, source code\nJava Atomic File Transaction (JAFT): project home\nXADisk: tutorial, source code\nAtomicFile: description, source code" ]
[ "c#", "windows", "delphi", "file-io", "transactions" ]
[ "Java - Styling an application", "Okay, i am officially scared to ask this question. I am a PHP developer that is attempting to learn the language of JAVA. My experience limits me to PHP, JavaScript and basic CSS to develop and style my web apps.\n\nI would like to know, and this is embarrassing, What technology is used to \"Style\" JAVA Applications just like CSS is used to \"Style\" HTML & PHP applications?\n\nI feel so stupid asking this! Please don't think i am an idiot, i am really good with PHP.\n\nI tried to google the answer but gained more questions than answers." ]
[ "java" ]
[ "CSS or Javascript Event for touch while scrolling", "Let's say I have multiple boxes among each other:\n\n<div style=\"width: 100%; height: 100px; background-color: red\">\nstuff\n</div>\n\n\nIf I click (touch) on them, I can easily change the background color with CSS (:hover, :focus) or with Javascript/jQuery.\n\nFor the user experience, I want to communicate to the user that he can click on that box as soon as his finger touches the screen. When the user is touching the box with the intention to scroll down, the box should change its background color slightly.\n\nEvery jQuery event for clicking or touching an object triggers only if I directly 'click' on it, not when I touch it while scrolling.\n\nHow can I listen for a screen touch, if it is not a direct click? Since it should only change the background color, it doesn't matter if it is pure CSS or javascript." ]
[ "javascript", "jquery", "html", "css", "events" ]
[ "Shortcut for adding one item to an array in javascript", "I want to add just one item to an array in Javascript and use that array as an argument for a method. How can I complete this with an easy syntax.\n\nI tried this:\n\n[].push({ \"value\" : \"test\"});\n\n\nBut that only returns 1. I want the complete array as a return.\nSo any ides? Something similar to what I tried?" ]
[ "javascript", "jquery" ]
[ "How to Put set delay on android Progress bar", "What I want is to set it up so that the progress bar loads for 15 seconds, and then go on to the next activity.\n\nRight now the activity has : \n\npublic class MainActivity extends Activity {\n\n /** Called when the activity is first created. */\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n Button btn5 =(Button)findViewById(R.id.button);\n\n btn5.setOnClickListener(new Button.OnClickListener() {\n\n public void onClick(View v) {\n Intent myIntent = new Intent();\n\n myIntent.setAction(Intent.ACTION_VIEW);\n\n myIntent.setData(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);\n setContentView(R.layout.loading);\n\n } \n });\n }\n\n}\n\n\nAnd the xml page has: \n\n<ProgressBar\n android:id=\"@+id/progressBar1\"\n style=\"?android:attr/progressBarStyleHorizontal\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"144dp\"\n android:layout_gravity=\"center_vertical\" />\n\n\nI want to know how to make to make progressBar1 Load for 15 seconds and then go to result.xml" ]
[ "android", "xml", "loading", "android-progressbar" ]
[ "Generating output in a running haskell program", "Coming from (SWI) Prolog I find it very difficult to have Haskell give output on the fly.\n\nThe simplest example, I'd like Haskell to print something on every iteration:\n\nfac 0 = 1 \nfac n = fac ( n-1 ) * n\n\n\nOr I would like to get output from a program that never halts...\n\n-- A possible halt statement... \n-- find_primes l 100 = l \nfind_primes l n = if ( is_prime l n ) then find_primes nn s else find_primes l s \nwhere s = n + 1\nnn = n:l\n\nis_prime :: Integral a => [a] -> a -> Bool \nis_prime [] n = True --print the prime number on the fly \nis_prime (h:t) n = if ( r /= 0 ) then is_prime t n else False \nwhere r = n mod h\n\n\nPrelude> find_primes [ ] 2" ]
[ "haskell", "monads", "on-the-fly" ]
[ "Is it possible to prevent linebreak after H2 tags?", "I'd like to display something on the same line but keep the H2 tag (just so I don't have to change it in a bunch of different places). Can this be done using CSS?" ]
[ "html", "css" ]
[ "Save Photos to Custom Album in iPhones Photo Library", "I'm trying to create a custom album in the Photo Library of an iPhone and then save photos that I've taken with the camera, or chosen from the phones Camera Roll to that custom album. I can successfully create the album but the photos are not getting saved there, instead they are getting saved to the simulators Saved Photos album... I'm not sure how to tell UIImageWriteToSavedPhotosAlbum to save to the new album I've just created using addAssetsGroupAlbumWithName...\n\nHere is the code I have so far - I've snipped out a few sections to keep my code example short...\n\n- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info\n{ \n NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];\n if([mediaType isEqualToString:(__bridge NSString *)kUTTypeImage])\n { \n // pull GPS information from photos metadata using ALAssetsLibrary\n void (^ALAssetsLibraryAssetForURLResultBlock)(ALAsset *) = ^(ALAsset *asset)\n {\n // code snipped out \n };\n NSURL *assetURL = [info objectForKey:UIImagePickerControllerReferenceURL];\n ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];\n [library assetForURL:assetURL\n resultBlock:ALAssetsLibraryAssetForURLResultBlock\n failureBlock:^(NSError *error) \n {\n // code snipped out\n }];\n\n // getimage from imagePicker and resize it to the max size of the iPhone screen \n UIImage *originalImage = [info objectForKey:UIImagePickerControllerOriginalImage]; \n UIImage *resizedImage = [util_ createThumbnailForImage:originalImage thumbnailSize:[util_ determineIPhoneScreenSize]];\n NSData *imageData = UIImagePNGRepresentation(resizedImage);\n\n // code snipped out\n // code snipped out\n // code snipped out\n // code snipped out\n // code snipped out\n // code snipped out\n\n\n\n // create a new album called \"My Apps Photos\"\n [library addAssetsGroupAlbumWithName:@\"My Apps Photos\"\n resultBlock:^(ALAssetsGroup *group) \n {\n NSLog(@\"in addAssetsGroupAlbumWithName resultBlock\");\n\n // save file to album\n UIImageWriteToSavedPhotosAlbum(resizedImage, self, nil, nil);\n\n } \n failureBlock:^(NSError *error) \n {\n NSLog(@\"in addAssetsGroupAlbumWithName failureBlock\");\n\n }\n ];\n }\n}\n\n\nSo... Like I said, it creates the new album but does not save the photo there. How do I tell it to save into the new album? Perhaps I sound not use UIImageWriteToSavedPhotosAlbum??\n\nNote: I'm using Xcode 4.3.2, IOS 5.1, and ARC" ]
[ "iphone", "objective-c", "uiimage", "uiimagepickercontroller", "alassetslibrary" ]
[ "How can I hide the sound and full screen button in react-native-video", "Any option to hide the sound and fullscreen icon in video screen. I am using react-native-video package." ]
[ "react-native", "react-native-android", "react-native-ios", "react-native-video" ]
[ "How do I put graphics on a JPanel?", "I am having a problem adding graphics to a JPanel. If I change the line from panel.add(new graphics()); to frame.add(new graphics()); and do not add the JPanel to the JFrame, the black rectangle appears on the JFrame. I just cannot get the black rectangle to appear on the JPannel and was wondering if someone could help me with this.\n\nimport java.awt.*;\nimport java.awt.event.*;\nimport javax.swing.*;\n\n public class Catch{\n\npublic class graphics extends JComponent{\n public void paintComponent(Graphics g){\n super.paintComponents(g);\n g.fillRect(200, 62, 30, 10);\n }\n}\n\n public void createGUI(){\n final JFrame frame = new JFrame();\n JPanel panel = new JPanel();\n frame.setSize(500,500);\n frame.addMouseListener(new MouseAdapter(){\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getPoint().getX());\n System.out.println(e.getPoint().getY());\n }\n });\n panel.add(new graphics());\n frame.add(panel);\n frame.setVisible(true);\n frame.setDefaultCloseOperation(frame.DISPOSE_ON_CLOSE); \n}\n\npublic static void main(String[] args){\n Catch GUI= new Catch();\n GUI.createGUI();\n }\n}" ]
[ "java", "swing", "graphics", "jframe", "jpanel" ]
[ "Spring security access denied handler not working", "I have a spring security app, I have following code in security-context.xml\n\n <security:form-login login-page=\"/login.html\" \n login-processing-url=\"/j_spring_security_check\"\n default-target-url=\"/home.jsp\" \n authentication-failure-url=\"/login.html?login_error=1\" /> \n <security:logout logout-url=\"/logout\" logout-success-url=\"/\" /> \n <security:access-denied-handler error-page=\"/denied\" /> \n</security:http>\n\n\nAnd I have denied.jsp page in views section. \n\nI have main controller in which I have requestmapping for /denied. \n\nBut when unauthorized user clicks on a link, I get system error page. It does not get redirected to denied.jsp. \n\nAm I missing any configuration here.\n\nAm I missing anything here? Do I need to add any more" ]
[ "spring-security" ]
[ "SQL: Setting MaxFieldSize in ResultSet", "I'm trying to set setMaxFieldSize(<int>) to truncate column values to 512 bytes, however it just doesn't seem to have any effect on the returned rows when I iterate over the ResultSet. Also, I'm able to get setMaxRows() to work.\n\nThe 'sample' table has 8 rows and by setting setMaxRows(1), I am able to limit the rows returned to 1 when I iterate over the ResultSet (just can't get setMaxFieldSize() to work). Also, I cannot modify the underlying table.\n\nHere is my SQL (Ideally, I wouldn't want to edit the SQL query itself and would prefer truncating strings > 512 bytes (1 char = 1 byte) using the ResultSet function listed above):\n\nSELECT `col1`, `col2`, `col3`, `col4`, `col5`, `col6`, `col7`, `col8`, `col9` \nFROM `sample` LIMIT 1000\n\ncol1 - col7 are of Type LONGVARCHAR (-1: java.sql.Types)\ncol8 is of Type CHAR (1: java.sql.Types)\ncol9 is of Type VARCHAR (12: java.sql.Types)\n\n\nAccording to the Java doc, the above fields should get truncated as they are in the list of supported fields:\n\n\n This limit applies only to BINARY, VARBINARY, LONGVARBINARY, CHAR,\n VARCHAR, NCHAR, NVARCHAR, LONGNVARCHAR and LONGVARCHAR fields.\n\n\nHere is the my code (\"java.sql.Connection connection\" is passed in as a parameter to the function):\n\nStatement stmt = null;\nResultSet resultSet = null;\ntry {\n stmt = connection.createStatement();\n stmt.setMaxFieldSize(4);\n stmt.setMaxRows(1);\n resultSet = stmt.executeQuery(sql);\n System.out.println(stmt.getMaxFieldSize() + \" MaxFS\");\n\n while (resultSet.next()) {\n for(int i = 1; i <= resultSet.getMetaData().getColumnCount(); i++) {\n System.out.println(\"ROW_DETAILS: \" + resultSet.getMetaData().getColumnName(i) + \", \" + resultSet.getMetaData().getColumnType(i) + \", \" + \n resultSet.getString(i).length() + \", \" + resultSet.getString(i));\n }\n }\n}\n....\n....\n\n\nOutput (note that col8 and col9 are of different types and with lesser text):\n\nROW_DETAILS: col1, -1, 2664, <text>\nROW_DETAILS: col2, -1, 2664, <text>\nROW_DETAILS: col3, -1, 2664, <text>\nROW_DETAILS: col4, -1, 2664, <text>\nROW_DETAILS: col5, -1, 2664, <text>\nROW_DETAILS: col6, -1, 2664, <text>\nROW_DETAILS: col7, -1, 2664, <text>\nROW_DETAILS: col8, 1, 255, <text>\nROW_DETAILS: col9, 12, 550, <text>\n\n\nMy intention is to truncate the lengths of each of the above column values returned in the row output to 512 using setMaxFieldSize but unfortunately, the length is always set to its original." ]
[ "java", "mysql", "sql", "jdbc", "resultset" ]
[ "Why am I not getting the exception I expect in Zend Feed when a feed is misentered?", "Basically, we have this here module that we offer to our users that want to include a feed from elsewhere on their pages. I works great, no sweat. The problem is that whenever users mishandle the feed link on their hands we have to manually remove the module from existence because Zend Feed crashes and burns the entire page just like any fatal error. Normally, one would expect that a code block such as..\n\ntry { // Test piece straight off the Zend tutorial\n $slashdotRss = Zend_Feed::import('http://rss.slashdot.org/Slashdot/slashdot');\n} catch (Zend_Feed_Exception $e) {\n // feed import failed\n echo \"Exception caught importing feed: {$e->getMessage()}\\n\";\n exit;\n}\n\n\n.. would BEHAVE if I were to enter 'httn://rss.grrllarrrlll.aarrg/Slashdot/slashdot' and say something along the lines of \"404\" or \"What the shit\". No. It dies. It crashes and dies. It crashes and burns and dies, completely ignoring all that happy trycatch methology right there.\n\nSo basically, do we have to write our on feedfetch or is there any simple remedy to Zend's slip?\n\nAdded log:\n\n exception 'Zend_Http_Client_Adapter_Exception' with message 'Unable to Connect to tcp://www.barglllrragglll:80. Error #10946: ' in /library/Zend/Http/Client/Adapter/Socket.php:148\n#0 /library/Zend/Http/Client.php(827): Zend_Http_Client_Adapter_Socket->connect('www.barglllrragglll...', 80, false)\n#1 /library/Zend/Feed.php(284): Zend_Http_Client->request()\n...... Trace etc ...." ]
[ "php", "zend-framework", "zend-feed" ]
[ "asp.net mvc session expires often at hosting environment", "In case someone else has same problem and got it solved, would appreciate share his solution:\n\nProblem:\nI have website done in asp.net mvc3, the session expires often, between some seconds to max 5 minutes. In web.config I have set the timeout to 2880 min, I also set the sessionstate to stateserver. I also delete the timeouts to use the default ones, still problem:\n\n<sessionState mode=\"StateServer\"></sessionState>\n<authentication mode=\"Forms\">\n <forms loginUrl=\"~/Account/LogOn\"/>\n</authentication>\n\n\nI made a sample website that only contains the login functions and some database interaction to simulate the environment, then i got a more stable timeout of 2 min 50 secs (tested 9 times), which still is not correct since I set 2880 min in the web.config.\n\nInside the code when user login, I create an AuthenticateTicket and save it to cookies, then in secured pages I checked for User.Identity and the controllers have the filter [Authorize], so when session expires I'm sent to login page.\n\nOn the same hosting server I have other older apps using .NET 3.5 web forms, and for them the session is ok, only for new mvc3 and mvc3 the session is expiring often. Thanks for any clue you can give." ]
[ "asp.net-mvc-3", "session-timeout" ]
[ "How do I use LINQ to access a specific value from of an array of JObjects that seems to be stored in a string", "I'm making a database call in C# that looks something like this:\n\npublic JArray GetEmployeeInfo(string search_text)\n{\n var search = search_text.Split(' ');\n\n var dataObject = _db.Employee\n .Where(x => x.Usage.Equals(\"basic\") &&\n search.All(s => x.EmployeeName.Contains(s) || \n x.EmployeeEmailAddress.Contains(s) || \n x.EmployeeId.Contains(s)))\n .Select(x => new\n {\n x.EmployeeId,\n x.EmployeeName,\n x.EmployeeEmailAddress,\n x.EmployeeDepartmentName,\n x.UsageTags\n });\n\n return JArray.FromObject(dataObject);\n}\n\n\nWhich works fine. The issue is the format of the data that's being returned. It looks something like this:\n\n{\n \"EmployeeId\": \"000012345\",\n \"EmployeeName\": \"Firstname Lastname\",\n \"EmployeeEmailAddress\": \"[email protected]\",\n \"EmployeeDepartmentName\": \"Accounting\",\n \"EmployeeType\": \"Staff\",\n \"UsageTags\": \"[{\\\"seqNo\\\":1,\\\"Tag\\\":\\\"CurrentEmpl:Accountant\\\"},{\\\"seqNo\\\":2,\\\"Tag\\\":\\\"CurrentEmpl:Manager\\\"},{\\\"seqNo\\\":3,\\\"Tag\\\":\\\"Intern:Attended\\\"}]\"\n}\n\n\nand what I need is to have UsageTags be an array of the Tag values, like this:\n\n{\n \"EmployeeId\": \"000012345\",\n \"EmployeeName\": \"Firstname Lastname\",\n \"EmployeeEmailAddress\": \"[email protected]\",\n \"EmployeeDepartmentName\": \"Accounting\",\n \"EmployeeType\": \"Staff\",\n \"UsageTags\": [\"CurrentEmpl:Accountant\", \"CurrentEmpl:Manager\", \"Intern:Attended\"]\n}\n\n\nRight now, I'm formatting it in JavaScript, but it would be a lot better if I could just write out a LINQ statement that does it on the server side. I wasted most of today trying different solutions from here, along with Google and my old C# Cookbook, but nothing seems to do the trick.\n\nAnyone have a solution that would somehow parse the UsageTags into an array of JObjects, then pull out the values of all the Tag keys and toss the values in an array? Because, I am going crazy banging my head against this one." ]
[ "c#", "linq", "json.net" ]
[ "jQuery Fullscreen Background Image", "I need help with a jQuery plugin which scales images into fullscreen and still allows a user to put contents under it. For example:\n\nwww.burton.com\n\nThe site above has a fullscreen image and also contents under it. Can someone show me how to do this?\n\nI've tried different jQuery Image slideshow plugins but am still failing to accomplish it. I'll be using it for my school project." ]
[ "jquery", "image", "background", "fullscreen", "slideshow" ]
[ "javascript Image Data Object to Image Object (Trying to fill() with image data)", "What i am trying to do is context.createImageData(xxx,xxx) then take that image data and manipulate it, then context.createPattern(imagedata, 'repeat') with the image data to fill in my drawn object with the image data that I procedural made. The problem that I am having is createPattern takes in a Image Object not a Image Data Object. So I need to either find out a way of converting a Image Data Object to a Image Object or be given a better way to fill() with a procedural generated images.\n\nthanks for your help!!" ]
[ "javascript", "html", "getimagedata", "putimagedata" ]
[ "Angular-CLI - Import local packages from lib", "I am having trouble finding out how to import a package into an Angular-CLI app from the lib folder. I tried adding the reference to the .umd.js and (separately) the index.js file in angular-cli.json, but when I try to import the module, it tells me it's not a NgModule.\n\nIs there some configuration to tell it to import packages from the lib folder instead of just the node_modules folder?" ]
[ "npm", "package", "angular-cli" ]
[ "php file is not working as src in javascript", "I made a dynamic php file to show different text using java script. People uses this to show texts in their website.\n\nThey use this code\n\n <script type=\"text/javascript\" src=\"http://alquranbd.com/source/q1.php\"></script>\n\n\nAnd the http://alquranbd.com/source/q1.php this file generates a code like this:\n\ndocument.write(\"এরাই পরকালের বিনিময়ে পার্থিব জীবন ক্রয় করেছে। অতএব এদের শাস্তি লঘু হবে না এবং এরা সাহায্যও পাবে না। (Al-Baqarah-86)\");\n\n\nWhen people using this php file as src in their website this is not showing text. But it was showing text a few weeks ago. Why this is not working now?" ]
[ "javascript", "php" ]
[ "Xamarin won't build out of memory", "I get the following error, but when I increase the Max Heap Size, it doesn't have any effect. I have gone up to 8G with no change. Is there something else going on?\n\nSuppression State\nError java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe -Xmx1G -jar \"C:\\Program Files (x86)\\Android\\android-sdk\\build-tools\\28.0.0-rc1\\lib\\dx.jar\" --dex --no-strict --output obj\\Debug\\android\\bin \"C:\\code\\Droid\\obj\\Debug\\android\\bin\\classes.zip\" \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE\\ReferenceAssemblies\\Microsoft\\Framework\\MonoAndroid\\v8.0\\mono.android.jar\" obj\\Debug\\lp\\10\\jl\\bin\\classes.jar obj\\Debug\\lp\\11\\jl\\bin\\classes.jar obj\\Debug\\lp\\12\\jl\\bin\\classes.jar obj\\Debug\\lp\\13\\jl\\bin\\classes.jar obj\\Debug\\lp\\14\\jl\\bin\\classes.jar obj\\Debug\\lp\\15\\jl\\bin\\classes.jar obj\\Debug\\lp\\16\\jl\\bin\\classes.jar obj\\Debug\\lp\\17\\jl\\bin\\classes.jar obj\\Debug\\lp\\18\\jl\\bin\\classes.jar obj\\Debug\\lp\\19\\jl\\classes.jar obj\\Debug\\lp\\20\\jl\\classes.jar obj\\Debug\\lp\\21\\jl\\classes.jar obj\\Debug\\lp\\22\\jl\\classes.jar obj\\Debug\\lp\\3\\jl\\arch-core-common.jar obj\\Debug\\lp\\4\\jl\\arch-lifecycle-common.jar obj\\Debug\\lp\\5\\jl\\bin\\classes.jar obj\\Debug\\lp\\6\\jl\\bin\\classes.jar obj\\Debug\\lp\\8\\jl\\bin\\classes.jar obj\\Debug\\lp\\9\\jl\\bin\\classes.jar'" ]
[ "android", "xamarin" ]
[ "Save results from a loop", "i'm new to R. I have a question about how to save results in a loop to a file. Here is an example:\n\n# Read in the data, set up variables\nsdata<-read.csv(\"sdata.csv\", header=T)\nm=ncol(sdata)\nx=matrix(0,m,4)\nrow.names(x) <- variable.names(sdata)\ncolnames(x) <- c( \"Ground\", \"111d\", \"125d\", \"Ground\")\n\n\nfor (i in 6:m){ \nTukey1= HSD.test(lm(sdata[,i] ~ sdata$Medium+sdata$color+sdata$type+sdata$Micro), 'sdata$Micro')\nx[i,] = Tukey1$goups[1:4,3]\n\n}\n\n\nI don't know how to do it with the loop for all data, so i just tried one of them,\n\nTukey1 = HSD.test(lm(sdata[,1] ~ sdata$Medium+sdata$color+sdata$type+sdata$Micro), 'sdata$Micro')\nTukey1\n\n\nThe results look like this:\n\n$statistics\n Mean CV MSerror HSD r.harmonic\n 11.87421 3.102479 0.1357148 0.5288771 7.384615\n\n$parameters\n Df ntr StudentizedRange\n 24 4 3.901262\n\n$means\n sdata_mg[, 6] std r Min Max\n111d 11.86369 0.5317421 6 11.08623 12.45651\n125d 11.74433 0.1663130 6 11.53504 12.02412\n14d 11.54073 0.3877921 8 10.80300 11.96797\nGround 12.16673 0.3391952 12 11.56278 12.86199\n\n$comparison\nNULL\n\n$groups\n trt means M\n1 Ground 12.16673 a\n2 111d 11.86369 ab\n3 125d 11.74433 ab\n4 14d 11.54073 b\n\n\nI want my output look like this:\n\n0001 a ab ab b\n0002 ...\n0003 ...\n...\n\n\nHow could i get such results in the loop?\n\nI got an error:\n\n for (i in 6:m){ \nTukey1=HSD.test(lm(sdata[,i] ~ sdata$Medium+sdata$color+sdata$type+sdata$Micro), 'sdata$Micro') \nx[i,] = Tukey1$groups[1:4,3]\n} \n\nError in row.names<-.data.frame(*tmp*, value = value) : missing values in 'row.names' are not allowed\n\nMedium color type Micro replication JAT_0001 JAT_0002 JAT_UF_0003 .......\nT13 Br ST 14d 1 7.796561869 10.25722947 8.358342094\nT13 Br ST 111d 1 7.725102551 10.49954075 8.926736251\nT13 Br ST 125d 1 7.76897864 10.60934327 9.593081824\nT13 Br ST 125d 2 7.727733885 10.43269524 9.157324235\nT13 Br CO 14d 1 7.744205976 10.20154774 8.610439104\nT13 Br CO 111d 1 7.668092713 10.19312878 8.845051329\nT13 Br CO 125d 1 7.841236441 10.21631771 8.199416713\nT13 Br TL Ground 1 7.437145528 10.6563327 8.957033378\nT13 Br TL 14d 1 7.609625475 10.49023043 8.896758964\nT13 In ST Ground 1 7.595451012 10.80042474 9.464399064\nT13 In ST Ground 2 7.730454076 10.64082958 8.542183261\nT13 In ST 111d 1 8.219528235 10.16869956 8.751080927\nT13 In TL Ground 1 7.622781002 10.78092932 9.340316315\nT2 Br ST 14d 1 7.659787195 10.13839983 8.175650644\nT2 Br ST 14d 2 8.622211514 10.04158218 6.838194468\nT2 Br ST 14d 3 8.890290175 9.588902037 7.879420933\nT2 Br ST Ground 1 7.961193023 10.16522895 8.81688728\nT2 Br CO Ground 1 7.778931896 10.69110829 8.941482896\nT2 Br CO Ground 2 8.038375873 10.57522016 8.982078909\nT2 Br CO Ground 3 7.953854738 10.12257326 8.471493439\nT2 Br CO 111d 1 7.661298122 10.35416158 8.628662747\nT2 Br TL Ground 1 7.766862289 10.92627748 9.9706205\nT2 Br TL 111d 1 7.899306069 9.796455434 7.92545749\nT2 Br TL 111d 2 8.062080142 9.812688772 8.186133545\nT2 In CO Ground 1 7.717997141 10.0607044 8.413483731\nT2 In CO 14d 1 8.589243939 9.844666572 9.174649637\nT2 In CO 14d 2 8.207486485 10.78201791 9.450837609" ]
[ "r", "loops", "output" ]
[ "Replacing dictionary keys for values in another dictionary", "I have a list of dictionaries with information I'd like to replace under the keys of each dictionary.\n\nSo, I'm thinking of iterating through each dictionary and replacing the values.\n\nI have another dictionary with the values I'd like to replace as keys and the values which should be the final ones as values.\n\nIt goes like this:\n\nlistOfDicts = [{'value_1' : 'A', 'value-2' : 'B', 'valu&_3' : 'C'}, {'value-1' : 'D', 'value_2' : 'E', 'value-3' : 'F'}, {'value_1' : 'G', 'value_2' : 'H', 'value_3' : 'I'}]\n\n\nThen I have another dictionary to use as basis for fixing this information:\n\nfixer = {'value-2' : 'value_2', 'value&_3' : 'value_3', 'value-3' : 'value_3', ...}\n\n\nHow could I make this replacement?\n\n-\nEdit:\n\nThe desired output would be somethink like this:\n\nlistOfDicts = [{\n'value_1' : 'A',\n'value_2' : 'B',\n'value_3' : 'C'},\n{'value_1' : 'D',\n'value_2' : 'E',\n'value_3' : 'F'},\n...}" ]
[ "python", "dictionary" ]
[ "Group the query into 3 columns, and display the sums for another column in Apex Oracle", "I want to make a report. In my request it is not difficult. I specify dates and also type of record (positive or subtractive) in this request. I want this query to be grouped by fields CONTRACTORID, ITEMID ORGANIZATION. And withdraw the amount on the NETTO.\n\nselect\n ID, DOCNUMBER,DOCDATE,PRINTNUMBER,DRIVERID,CONTRACTORID,ITEMID,\n BRUTTO,TARE,NETTO,\n DS_ID,\n DAT_A,\n MILEAGE,\n ORGANIZATION,\n sum(NETTO)\nfrom WAYBILL\nwhere trunc(DOCDATE) between to_date(:P115_D1,'dd.mm.yyyy')\n and to_date(:P115_D2,'dd.mm.yyyy')\nand DIRECTIONID = :P115_DIRECTIONID \ngroup by \n ID, DOCNUMBER,DOCDATE,PRINTNUMBER,DRIVERID,CONTRACTORID,ITEMID,\n BRUTTO,TARE,NETTO,\n DS_ID,\n DAT_A,\n MILEAGE,\n ORGANIZATION" ]
[ "sql", "oracle", "oracle-apex" ]
[ "How to preform a Reddit post with okhttp", "I am trying to use the Reddit API to save a post. I know I am formatting the request wrong, but I can't seem to find any documentation on how to do it correctly. If anyone could either lead me in the right direction, or help me format the request correctly. This is what I have so far.\n\n public void save(View v)\n{\n OkHttpClient client = new OkHttpClient();\n String authString = MainActivity.CLIENT_ID + \":\";\n String encodedAuthString = Base64.encodeToString(authString.getBytes(),\n Base64.NO_WRAP);\n System.out.println(\"myaccesstoken is: \"+ myaccesstoken);\n System.out.println(\"the image id is: \"+ myimageid);\n Request request = new Request.Builder()\n .addHeader(\"User-Agent\", \"Sample App\")\n .addHeader(\"Authorization\", \"Bearer \" + myaccesstoken)\n .addHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\")\n .url(\"https://oauth.reddit.com/api/save.json?\")\n .post(RequestBody.create(MediaType.parse(\"application/x-www-form-urlencoded\"),\n \"\"+ myimageid +\n \"1\"))\n .build();\n\n client.newCall(request);\n\n}\n\n\nI am very very new to using APIs and I am not sure exactly what I am looking for. Here is the link to the reddit API for saving\n\nhttps://www.reddit.com/dev/api/oauth#POST_api_save\n\nThank you in advance for any help!!!" ]
[ "java", "android", "post", "request", "reddit" ]
[ "Django error: render_to_response() got an unexpected keyword argument 'context_instance'", "After upgrading to Django 1.10, I get the error render_to_response() got an unexpected keyword argument 'context_instance'.\n\nMy view is as follows:\n\nfrom django.shortcuts import render_to_response\nfrom django.template import RequestContext\n\ndef my_view(request):\n context = {'foo': 'bar'}\n return render_to_response('my_template.html', context, context_instance=RequestContext(request))\n\n\nHere is the full traceback:\n\nTraceback:\n\nFile \"/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/exception.py\" in inner\n 39. response = get_response(request)\n\nFile \"/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/base.py\" in _get_response\n 187. response = self.process_exception_by_middleware(e, request)\n\nFile \"/Users/alasdair/.virtualenvs/django110/lib/python2.7/site-packages/django/core/handlers/base.py\" in _get_response\n 185. response = wrapped_callback(request, *callback_args, **callback_kwargs)\n\nFile \"/Users/alasdair/dev/rtr/rtr/urls.py\" in my_view\n 26. return render_to_response('my_template.html', context, context_instance=RequestContext(request))\n\n Exception Type: TypeError at /\nException Value: render_to_response() got an unexpected keyword argument 'context_instance'" ]
[ "python", "django" ]
[ "how to present map with list as values in broadleaf", "I have map with key as string and value as list. and would like to present this in my admin page in broadleaf.\n\nprotected Map<String, List<SkuStoneDetails>> skuStoneDetails = new HashMap<String, List<SkuStoneDetails>>();\n\n\nPreviously i had map with key as string and value as object like below.\n\n protected Map<String, SkuStoneDetails> skuStoneDetails = new HashMap<String,<SkuStoneDetails>();\n\n\nFor that i have given admin presentation like below.\n\n @AdminPresentationMap(friendlyName = \"Sku StoneDetails\",\n tab = ProductImpl.Presentation.Tab.Name.Stone_Details, tabOrder = ProductImpl.Presentation.Tab.Order.SkuStoneDetails,\n //tab = Presentation.Tab.Name.Advanced, tabOrder = Presentation.Tab.Order.Advanced,\n //group = ProductImpl.Presentation.Group.Name.RPPrice, groupOrder = ProductImpl.Presentation.Group.Order.RPPrice,\n keyPropertyFriendlyName = \"Sku StoneDetails Key\",\n deleteEntityUponRemove = true,\n mediaField = \"stoneType\",\n forceFreeFormKeys = true\n)\n\n\nI have no idea of how to do this with values as list in a map.Kindly help me out." ]
[ "spring-mvc", "broadleaf-commerce" ]
[ "SwiftUI NavigationView remove on iPad(Solved)", "When I remove NavigationView, the application works fine.\nWhen I add NavigationView, it opens a small menu on the left. How can we fix this problem. I shared the code below. When starting the project, I started it with Multiplatform. I don't think it might have anything to do with that.\n NavigationView {\n .....\n }\n .navigationBarTitle("")\n .navigationBarHidden(true)\n .navigationBarBackButtonHidden(true)\n\n\n\n\nCode:\n NavigationView {\n ZStack(alignment: .top) {\n .......\n }\n .navigationBarTitle("")\n .navigationBarHidden(true)\n .navigationBarBackButtonHidden(true)\n }\n .navigationViewStyle(StackNavigationViewStyle() // Added" ]
[ "xcode", "ipad", "swiftui", "navigationview" ]
[ "MATLAB error in \"imhist\" even though image processing toolbox is installed", "I have a color enriched image, which I converted to gray scale in MATLAB. But when I want to display the histogram of the gray image, the error message it outputs is\n\n\n Undefined function or variable 'imhist'.\n\n\nInterestingly, imread() and imshow() command works well though. I checked if the image processing toolbox is installed and it looks like yes.\n\n>> license('test', 'image_toolbox')\n\nans = \n 1\n\n\nAlso see attached screenshot of toolboxes installed in the attachment.\n\nThe code I used is: \n\nclc;\nclose all;\nclear all;\n\ntest_image = imread('fractals.jpg');\nwhos;\n\ntest_image(1,1,:);\ntest_image(200,262,:);\nfigure, imshow(test_image);\nsize(test_image)\n\ntest_image_gray = rgb2gray(test_image);\nfigure, imshow(test_image_gray)\n\n%figure, imhist(test_image)\nimhist(test_image_gray)" ]
[ "matlab", "image-processing" ]
[ "Google Charts Data View set columns dynamically", "I am using google charts to render the data on webpages. I am using a CSV as an input and that data is then manipulated for google chart api to use.\n\nI want to show the column value on the top of the Bar/Column chart. I figured out that if you create a Data View and do view.setColumns and specify the role annotation then number becomes visible on the top of the chart, otherwise you need to hover on the chart to see the exact value.\n\nMy problem is that i am unable to dynamically set the columns and roles to the view. As the input is csv, i will never be sure about the columns.\n\nMain intent is to show the numbers on the bars, if there is any other alternative by which it can be done, then it will be appreciated as well. Cheers\n\nvar arrayData = csvAttr.toArrays(csvString, {\n onParseValue : csvAttr.hooks.castToScalar\n });\n\nvar data = new google.visualization.arrayToDataTable(arrayData);\nview = new google.visualization.DataView(data);\n\n view.setColumns([0, 1,\n { calc: \"stringify\",\n sourceColumn: 1,\n type: \"string\",\n role: \"annotation\" },\n 2,\n { calc: \"stringify\",\n sourceColumn: 2,\n type: \"string\",\n role: \"annotation\" },\n 3,\n { calc: \"stringify\",\n sourceColumn: 3,\n type: \"string\",\n role: \"annotation\" }\n\n ]);" ]
[ "javascript", "csv", "google-visualization" ]
[ "Rendering files from C++ Node.js addon", "I would like to render files in node.js from C++ addon. \nI want to apply some file processing and render the output to the browser via node.js\n\nHere is my C++ Code\n\n std::ifstream in(filename, std::ios::binary);\n\n in.seekg (0, in.end);\n int length = in.tellg();\n in.seekg (0, in.beg);\n\n char * buffer = new char [length];\n in.read (buffer,length);\n in.close();\n\n return buffer;\n\n\nFollowing is the V8 code to add bindings for node.js, here buffer is the output from the above c++ code.\n\n Local<Function> cb = Local<Function>::Cast(args[1]);\n const unsigned argc = 1;\n Local<Value> argv[argc] = {Local<Value>::New(String::New(buffer))};\n cb->Call(Context::GetCurrent()->Global(), argc, argv);\n\n\nThis code works well for normal text files. I'm getting problem when reading text files which are having unicode characters. \nFor eg,\n\nOriginal text file\n\ntest start\nBillél\nlast\n\n\nWhen receiving in node, I will get\n\ntest start\nBill�l\nlast\n\n\nSimilarly when reading a jpg, png files the output file is different than the original file.\nPlease help." ]
[ "c++", "node.js", "v8" ]
[ "Regular Expressions - Trimming Whitespace", "I'm currently learning regular expressions, and I'd appreciate any help understanding this:\n\nSuppose I have a string with leading and trailing whitespace:\n\n abc \n\n\nand I would like to isolate the string while removing all of the whitespace. My idea is to use:\n\n\\s*(\\w+)\\s*\n\n\nas the * quantifier, being greedy, will take as much of the leading and trailing whitespace as it can, which leaves me with just the string \"abc\". This approach seems to work. \n\nHowever, I have seen some solutions have the ^ and $ anchors included, giving:\n\n^\\s*(\\w+)\\s*$\n\n\nWhy is it necessary to include the ^ and $ anchors? I know their function, however I can't see why the \\s* preceding and following the (\\w*) is not sufficient." ]
[ "regex" ]
[ "Disable access to all Identity pages in .NET Core 3.1 MVC", "Is there a clean way to completely prevent access to all pages in the /Areas/Identity/ folder that gets created when you install .NET Identity? I was hoping there would be something I could do in startup.cs.\nI tried creating a filter inheriting from ActionFilter:\npublic class PreventAccessToIdentityFolderFilter : IActionFilter\n{\n\n public void OnActionExecuting(ActionExecutingContext context)\n {\n var request = context.HttpContext.Request;\n\n if (request.Path.HasValue && request.Path.Value.ToLower().StartsWith("/identity"))\n {\n context.HttpContext.Response.Redirect("/");\n }\n }\n\n public void OnActionExecuted(ActionExecutedContext context)\n {\n //throw new NotImplementedException();\n }\n}\n\nand then registering it both in MVC and Razor Pages (since the new Identity UI uses Razor Pages):\nservices.AddRazorPages()\n .AddMvcOptions(o => {\n o.Filters.Add(new PreventAccessToIdentityFolderFilter());\n });\n\nvar mvcBuilder = services.AddControllersWithViews(o => {\n\n var policy = new Microsoft.AspNetCore.Authorization.AuthorizationPolicyBuilder()\n .RequireAuthenticatedUser()\n .Build();\n\n o.Filters.Add(new Microsoft.AspNetCore.Mvc.Authorization.AuthorizeFilter(policy));\n\n o.Filters.Add(new PreventAccessToIdentityFolderFilter());\n});\n\nThe filter run on all MVC actions, but does not run for any of the Identity Razor Pages.\nThere must be an easy way to completely disable access to the /Identity Area / Razor Pages?" ]
[ "c#", "asp.net-mvc", "asp.net-identity" ]
[ "DoubleClick Event Handler for GWT Grid", "I am using a gwt grid and Im trying to get the cell that had the onDoubleClick event on it. So if I was doing onClickEvent I would use getCellForEvent(ClickEvent) and that returns a cell. But that method doesnt accept a DoublClickEvent. How do I get the cell that had the onDoubleClick...?" ]
[ "java", "gwt", "onclick" ]
[ "Speed of GetBlockBlobReference", "Does anyone know the spped of GetBlockBlobReference: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.storage.blob.cloudblobcontainer.getblockblobreference?view=azure-dotnet when having many blockblobs? Like 1 million or more blockblobs in a single container. In my head it should be O(1) but I can't find anything related to this in the docs." ]
[ "azure", "azure-storage", "azure-storage-blobs", "azure-blob-storage" ]
[ "Why is not this multidimensional array displaying properly?", "I'm figuring this problem:\nI have the $_POST['user'] variable. If I print_r this variable I get:\n\nArray (\n ['name'] => Your name \n ['phone'] => Your phone number \n ['email'] => Your email\n) \n\n\nBut if I try to use $_POST['user']['name'], nothing happens, it's an empty value. \n\nIt also happens if I set $_POST['user'] to a variable, for example $user, when I print_r $user I get the same array result, but if I try to work with $user['name'] it's blank. \n\nThis is the input data that has been submited\n\n<input type=\"text\" name=\"user['name']\" value=\"Your name\" class=\"general-user user-name-style\" />\n<input type=\"text\" name=\"user['phone']\" value=\"Your phone number\" class=\"general-user user-data\" />\n<input type=\"text\" name=\"user['email']\" value=\"Your email\" class=\"general-user user-data right-user\" />\n\n\nAm I working around in a wrong way with arrays?" ]
[ "php", "multidimensional-array" ]
[ "appending tags in d3 without nesting", "I want to generate html that has a tooltip and tooltip text for each <p> tag. I know that I can do all the tooltip stuff in d3, but I'm using a css style for now just because it is more familiar. \n\nIn an ideal world, my html output looks like this: \n\n<p class=\"tooltip\" style=\"font-size: 73.6207pt;\">eyes.\n <span class=\"tooltiptext\">Tooltip text</span>\n</p>\n<br>\n<p class=\"tooltip\" style=\"font-size: 73.6207pt;\">eyes.\n <span class=\"tooltiptext\">filler text</span>\n</p>\n\n\nI use a <br> because otherwise the text in the p tags appears on the same line, but the problem I am having is that the <br> is being nested inside of the span tags, so my html output looks like this. \n\n<p class=\"tooltip\" style=\"font-size: 73.6207pt;\">eyes.\n <span class=\"tooltiptext\">Tooltip text <br></span>\n</p>\n<p class=\"tooltip\" style=\"font-size: 73.6207pt;\">eyes.\n <span class=\"tooltiptext\">filler text <br></span>\n</p>\n\n\nMy d3 looks like this: \n\nI've tried moving that .append(\"d3\")around, but it either breaks the tooltip, or just messes up the entire visualization. \n\ndiv.selectAll(null)\n .data(myData)\n .enter()\n .append(\"p\")\n .attr(\"class\", \"tooltip\")\n .text(function(d) {\n return d.word;\n })\n .style(\"font-size\", function(d) {\n return scale(parseInt(d.score)) + \"pt\";\n })\n .append('span')\n .attr(\"class\", \"tooltiptext\")\n .text(\"filler text\")\n .append(\"br\")\n\n\nThank you in advance for helping out" ]
[ "javascript", "html", "css", "d3.js" ]
[ "How to force my Chrome browser to accept .requestFullscreen()?", "I am writing an application for myself in which I need to go fullscreen automatically via JavaScript (today I simulate the press of F11, which usually works, but not always).\n\nI would like to use .requestFullscreen() (via screenfull.js) but I get \n\n\n Failed to execute 'requestFullscreen' on 'Element': API can only be\n initiated by a user gesture.\n\n\nThis is understandable (for security / spam / usability reasons) and mentioned on numerous pages.\n\nNow, since this is my application running on my Chrome browser, I would like to have the ability to allow this request in my browser. Is this a possible setting for Chrome?" ]
[ "javascript", "google-chrome", "fullscreen" ]
[ "SSL validation with curl", "I'm trying to validate the SSL using curl command.\n\nSo far I have no luck as I'm getting the following:\n\n-bash-4.2$ openssl verify -verbose -x509_strict -CAfile ca.cer server.cer\nserver.cer: OK\n\n-bash-4.2$ curl --version\ncurl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.28.4 zlib/1.2.7 libidn/1.28 libssh2/1.4.3\nProtocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp\nFeatures: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets\n\n\n\n -bash-4.2$ curl -v --cacert ca.cer https://localhost:8443\n* About to connect() to localhost port 8443 (#0)\n* Trying 127.0.0.1...\n* Connected to localhost (127.0.0.1) port 8443 (#0)\n* Initializing NSS with certpath: sql:/etc/pki/nssdb\n* CAfile: ca.cer\n CApath: none\n* Server certificate:\n* subject: CN=xxx,O=xxx,L=xxx,C=xx\n* start date: Dec 11 14:17:05 2017 GMT\n* expire date: Dec 11 14:17:05 2018 GMT\n* common name: xxx\n* issuer: CN=xxx,O=xxx,L=xxx,C=xx\n* NSS error -8182 (SEC_ERROR_BAD_SIGNATURE)\n* Peer's certificate has an invalid signature.\n* Closing connection 0\ncurl: (60) Peer's certificate has an invalid signature.\nMore details here: http://curl.haxx.se/docs/sslcerts.html\n\ncurl performs SSL certificate verification by default, using a \"bundle\"\n of Certificate Authority (CA) public keys (CA certs). If the default\n bundle file isn't adequate, you can specify an alternate file\n using the --cacert option.\nIf this HTTPS server uses a certificate signed by a CA represented in\n the bundle, the certificate verification probably failed due to a\n problem with the certificate (it might be expired, or the name might\n not match the domain name in the URL).\nIf you'd like to turn off curl's verification of the certificate, use\n the -k (or --insecure) option.\n\n\nSo the question is that if openssl validation is fine, why does curl give an error?" ]
[ "ssl", "curl" ]
[ "How to define Static member of a class", "I'm retrieve a list of paths stored in a json file, I'm not having trouble receiving the path but I get the error undefined reference to `objectFactory::objList[abi:cxx11]' When i try to add the path to a static vector of the same class.\nI tried changing the types of both to see if maybe it was an issue where it was looking for a variable with the same name but a different type, but alas the issue remained.\nI also tried to set the vector to be another vector of the finalized list but that didn't solve the issue.\nobjectFactory.h:\n\n#ifndef PROJECT2DTD_OBJECTFACTORY_H\n#define PROJECT2DTD_OBJECTFACTORY_H\n#include <vector>\n#include <string>\n#include <fstream>\n#include <nlohmann/json.hpp>\n\nclass objectFactory {\npublic:\n static void genObjList();\nprivate:\n static std::vector<std::string> objList;\n};\n\n#endif //PROJECT2DTD_OBJECTFACTORY_H\n\nobjectFactory.cpp\n#include <iostream>\n#include "objectFactory.h"\nusing json = nlohmann::json;\n\nvoid objectFactory::genObjList() {\n auto file = json::parse(std::fstream("assets/objects/objectList.json"))["objects"];//[0]["path"]\n for(auto i = 0; i != file.size(); ++i) {\n auto path = file[i]["path"].get<std::string>();\n objList.emplace_back(path);\n }\n}\n\nDoes anyone know what I might be doing wrong?" ]
[ "c++", "json", "vector", "static", "undefined-reference" ]
[ "wmts (GeoTiff) for a Mapbox-GL source", "I am trying to use a wmts (from GeoServer of a GeoTiff) for a Mapbox-GL source. Mapbox-GL is able to create the source and the layer without any error. However, the layer is not rendered, and GeoServer is never queried for the tiles.\n\nmap.on('load', function() {\n\n // Create raster layer from GeoServer\n map.addSource('rasterTest', {\n 'type': 'raster',\n 'tiles': 'http://localhost:32769/geoserver/gwc/service/wmts?SERVICE=WMTS&REQUEST=GetTile&LAYER=enview:sample&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&format=image%2Fpng&TileCol={x}&TileRow={y}',\n 'tileSize': 256,\n });\n\n map.addLayer({\n 'id':1,\n 'source': 'rasterTest',\n 'type': 'raster',\n 'visibility': 'visible',\n 'source-layer': 'rasterTest',\n });\n\n console.log('map:');\n console.log(map);\n\n})" ]
[ "geoserver", "geotiff", "mapbox-gl" ]
[ "Scikit-learn feature selection for regression data", "I am trying to apply a univariate feature selection method using the Python module scikit-learn to a regression (i.e. continuous valued response values) dataset in svmlight format.\n\nI am working with scikit-learn version 0.11.\n\nI have tried two approaches - the first of which failed and the second of which worked for my toy dataset but I believe would give meaningless results for a real dataset.\n\nI would like advice regarding an appropriate univariate feature selection approach I could apply to select the top N features for a regression dataset. I would either like (a) to work out how to make the f_regression function work or (b) to hear alternative suggestions. \n\nThe two approaches mentioned above:\n\n\nI tried using sklearn.feature_selection.f_regression(X,Y). \n\n\nThis failed with the following error message:\n\"TypeError: copy() takes exactly 1 argument (2 given)\"\n\n\nI tried using chi2(X,Y). This \"worked\" but I suspect this is because the two response values 0.1 and 1.8 in my toy dataset were being treated as class labels? Presumably, this would not yield a meaningful chi-squared statistic for a real dataset for which there would be a large number of possible response values and the number in each cell [with a particular response value and value for the attribute being tested] would be low? \n\n\nPlease find my toy dataset pasted into the end of this message.\n\nThe following code snippet should give the results I describe above.\n\nfrom sklearn.datasets import load_svmlight_file\n\nX_train_data, Y_train_data = load_svmlight_file(svmlight_format_train_file) #i.e. change this to the name of my toy dataset file\n\nfrom sklearn.feature_selection import SelectKBest\nfeatureSelector = SelectKBest(score_func=\"one of the two functions I refer to above\",k=2) #sorry, I hope this message is clear\nfeatureSelector.fit(X_train_data,Y_train_data)\nprint [1+zero_based_index for zero_based_index in list(featureSelector.get_support(indices=True))] #This should print the indices of the top 2 features\n\n\nThanks in advance.\n\nRichard\n\nContents of my contrived svmlight file - with additional blank lines inserted for clarity:\n\n1.8 1:1.000000 2:1.000000 4:1.000000 6:1.000000#mA\n\n1.8 1:1.000000 2:1.000000#mB\n\n0.1 5:1.000000#mC\n\n1.8 1:1.000000 2:1.000000#mD\n\n0.1 3:1.000000 4:1.000000#mE\n\n0.1 3:1.000000#mF\n\n1.8 2:1.000000 4:1.000000 5:1.000000 6:1.000000#mG\n\n1.8 2:1.000000#mH" ]
[ "python", "scikit-learn" ]
[ "Newbie question: Code line ends with column name null. How to add comment at the end of this line?", "Below we have simple query. \n\nselect job_id, employee_id, null --comment here\nfrom employees \nunion all\nselect job_id, employee_id, end_date\nfrom job_history\norder by 2\n\n\n\nWhen I'm trying to write some comment at the end of the first line,\ncomment becomes part of the column alias. \nResult of this example is column name of third column that looks like this:\nNULL--COMMENTHERE\nDoesn't matter if I use -- or /* */ before comment.\n\n\nI'm curious what is the reason for this?." ]
[ "sql", "oracle", "comments", "alias" ]
[ "Sort Array element by its values", "I have an array elements which need to sort and make selected element into top of array.\n\n[{\n parent_email: '[email protected]',\n id: 143,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 210,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 225,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 221,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 224,\n unreadCount: 0 \n }]\n\n\ni have another array by which above array element need to sort. first element is on top second is on second position third is on third position and so on.\n\n[{ \n parent_id: '[email protected]'\n },\n { \n parent_id: '[email protected]'\n },\n { \n parent_id: '[email protected]'\n }]\n\n\nmy result array should be like\n\n[{\n parent_email: '[email protected]',\n id: 221,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 225,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 210,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 143,\n unreadCount: 0 \n },\n {\n parent_email: '[email protected]',\n id: 224,\n unreadCount: 0 \n }]\n\n\ni have tried but it only sort single element not more then one. \n\nfor (var i = array2.length - 1; i >= 0; i--) {\narray1.sort(function(x,y){\n return x.parent_email == rows[i].parent_id ? -1 : y.parent_email == rows[i].parent_id ? 1 : 0; \n });\n}" ]
[ "javascript", "jquery", "node.js" ]
[ "How to override Java Class Method", "If I have Java Method that is a getter of some field, can I somehow override it?\n\n PropertyDescriptor[] propDescArr = Introspector\n .getBeanInfo(myClass, Object.class)\n .getPropertyDescriptors();\n\n\n\n for (PropertyDescriptor pd : propDescArr) {\n Method getMyField= pd.getReadMethod();\n // ... override this method here somehow so it returns \"\" \n // for example: getMyField.setDefaultReturnValue(\"\"); \n\n }\n ....\n\n\n public Class AnotherClass{\n ClassThatHasChangedMethod example = new ClassThatHasChangedMethod();\n String newBehavior = example.getMyField(); // newBehavior is now equals \"\" and before it was some other string.\n}\n\n\nSo I have this method method inside my other class that is working something. For example: method method returns some string. I want to change it, so it returns \"\".\n\nWhen I call this method later from another class, I want it to have that changed behavior (returns \"\")." ]
[ "java", "methods", "aop" ]
[ "Arguments are passed incorrectly using argparse", "I do not understand why arguments are passed incorrectly:\n\nimport argparse\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--start_date', type=str, default='2016-07-01T00:00:00Z', dest='start_date')\nparser.add_argument('--end_date', type=str, default='2016-09-01T00:00:00Z', dest='end_date')\nargs, unknown = parser.parse_known_args()\n\nprint(str(args.start_date))\n# 01/01/2019 00:00:00 \n\nprint(str(args.end_date))\n# 08/20/2019 00:00:00\n\n\nThis is how I pass arguments to the script from Azure ML pipeline script:\n\n start_date = '2019-01-01T00:00:00Z'\n end_date = '2019-08-20T00:00:00Z'\n\n preprocess_step = PythonScriptStep(\n name=\"Test\",\n script_name=\"myscript.py\",\n compute_target=aml_compute,\n source_directory=\".\",\n arguments=[\n \"--start_date\", start_date,\n \"--end_date\", end_date\n ],\n allow_reuse=False,\n )\n\n\nIf, however, I run myscript.py from command line, the parameters are passed correctly:\n\npython myscript.py --start_date 2019-01-01T00:00:00Z --end_date 2019-08-20T00:00:00Z\n\n\nWhat is happening and how to fix it?" ]
[ "python", "azure", "argparse", "azure-sdk", "azure-sdk-python" ]
[ "How can I forward bash/zsh arguments to another shell", "I'm working on a system with a lot of tcsh configuration scripts, requiring me to run most programs through tcsh. I've attempted to make this easy for myself by adding this to my ~/.zshrc:\n\n# run command in tcsh\nfunction t() {\n tcsh -c \"$@\"\n}\n\n\nThis works for something like t ls, but fails for t ls -l, which gives the error Unknown option: `-l' Usage: tcsh ..., and is clearly passing -l as an argument to tcsh, not to ls.\n\nHow can I quote the string passed in $@?" ]
[ "bash", "quotes", "zsh" ]
[ "How do I make header and sidebar stay?", "This is my index.php file\n\n<!DOCTYPE html>\n<html>\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n <style type=\"text/css\">\n </style>\n</head>\n<body>\n <div id=\"container\">\n <?php\n include('includes/header.php');\n include('includes/sidebar.php');\n include('includes/content.php');\n include('includes/footer.php');\n?>\n</body>\n</html>\n\n\nThis is code for my sidebar.php\n\n<div id=\"sidebar\">\n<ul id=\"list\">\n <li><a href=\"index.php\" class=\"sidebar\">Home</a></li>\n <li><a href=\"flower.php\" class=\"sidebar\">flower</a></li>\n <li><a href=\"study.php\" class=\"sidebar\">Study</a></li>\n <li><a href=\"calendar.php\" class=\"sidebar\">Calendar</a></li>\n <li><a href=\"diary.php\" class=\"sidebar\">Diary</a></li>\n</ul>\n\n\n\n\nif I click flower, it will go to flower.php. I didn't include header, sidebar, and footer, and found that it shows only contents of flower.php, not showing header, sidebar, and footer. Is there any way to make it showing? Or should I just write down all the code below again?\n\n<!DOCTYPE html>\n<html>\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n <style type=\"text/css\">\n </style>\n</head>\n<body>\n <div id=\"container\">\n <?php\n include('includes/header.php');\n include('includes/sidebar.php');\n include('includes/content.php');\n include('includes/footer.php');" ]
[ "php", "html" ]
[ "Firestore to automatically create a timestamp field with its own google time", "Does firestore have this feature where it will create a timestamp field with their own time when creating a new document... So it wont matter where ever the document has been created from, the time zone will be same for every country because i believe firebase has one time." ]
[ "firebase", "google-cloud-firestore" ]
[ "HTTP Error 503. The service is unavailable when port 80 is already free", "Before you go and suggest it as a duplicate of other IIS HTTP Error 503 questions, I have already tried many solutions available on SO and also on Google but the problem is not resolved. Below are the most popular solutions that I have found:\n\nIIS - HTTP Error 503. The service is unavailable\n\nSolve HTTP Error 503. The service is unavailable in IIS\n\nIn my case:\n\nIIS is not working while the port 80 is open and free to use.\n\n\n\nAs far as I know the error is caused if the application pool is not enabled (started) for the website in IIS.\n\nI have already closed all other applications like Skype, Google Disk etc who can possibly use port 80 and checks if the port is in use or not.\n\n\n\nThen I looked into the Application Pools of IIS and found DefaultAppPool status stopped.\n\n\n\nAfter starting the DefaultAppPool I recheck my web and gets the same error.\n\nAnd now the situation is like, DefaultAppPool status shows started until I don't hit any URL. Whenever I request any URL for my local websites or localhost, the browsers returns me the Service Unavailable error message and the DefaultAppPool status change to stopped automatically.\n\nI have already tried the iisreset command but after resetting IIS the problem is still there." ]
[ "c#", "asp.net", ".net", "iis", "iis-7" ]
[ "Can't get stellar.js working", "So I've been trying to create somekind of 1 page layout website with parallax scrolling and smooth animation navigation.\n\nSo far, the smooth animation is working fine but the problem comes in when creating the parallax scrolling for background images. Absolutely nothing happens when scrolling.\n\nHere's all my script info from html:\n\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js\"></script> \n<script src=\"js/jquery.stellar.min.js\"></script>\n<script>$.stellar();</script>\n<script>\n$(document).ready(function() {\n$('a[href*=#]').each(function() {\nif (location.pathname.replace(/^\\//,'') == this.pathname.replace(/^\\//,'')\n&& location.hostname == this.hostname\n&& this.hash.replace(/#/,'') ) {\n var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');\n var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;\n if ($target) {\n var targetOffset = $target.offset().top;\n $(this).click(function() {\n $(\"#nav li a\").removeClass(\"active\");\n $(this).addClass('active');\n $('html, body').animate({scrollTop: targetOffset}, 1000);\n return false;\n });\n }\n }\n});\n\n});\n</script>\n\n\nAnd when trying to apply into an element:\n\n<div id=\"slide1\" data-stellar-background-ratio=\"0.5\">\n</div> \n\n\nAnd finally the css:\n\n#slide1{\nbackground:url('../img/kansi.jpg') 50% 0 no-repeat;\nbackground-attachment: fixed;\nheight: 600px;\nmargin: 0;\npadding: 200px 0 260px 0;\nbackground-size: cover;\n}\n\n\nHelp gladly appreciated! :)\n\nEDIT: Reproduced in JSFiddle with gradients to simulate pictures.\nhttps://jsfiddle.net/sL1uszex/2/" ]
[ "javascript", "jquery", "html", "css", "stellar.js" ]
[ "Crash when setting badge on tab bar in objective C", "This line of code crashes. How to check if tabor item is not nil then setting badge?\n\n[self.tabController.tabBar.items objectAtIndex:0].badgeValue = [NSString stringWithFormat:@\"%i\", num];\n\n\n\n *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_CTNativeGlyphStorage\n tabBar]: unrecognized selector sent to instance 0x15029cfd0'\n\n\nI checked it by this line of code, but it didn't solve the problem.\n\nif (self.tabController.tabBar.items != nil) { }" ]
[ "objective-c" ]
[ "Metadata file not found - Data.Entity.Model", "Anyone having similar problem, while creating webservices?\n\n\n Compiling transformation: Metadata file 'D:\\Program\n Files\\VS2013\\Common7\\Tools..\\IDE\\Microsoft.Data.Entity.Design.dll'\n could not be found D:\\PROJEKTY\\apki\\ws2\\WS\\WS\\DataModel.tt\n\n\n\n\nI tried adding data model again, restarting VS, cleaning and building solution, creating new project, deleting and adding reference, installing the newest version. I think that any solution found on internet does not work for me.\n\nAny suggestions? I think of pasting file into this directory, but can't think what may be there." ]
[ "entity-framework", "visual-studio-2013", "t4", "ado.net-entity-data-model" ]
[ "How to get the last inserted row when I Group by column in mySQL?", "I run this query to get me the active users in a duration of 10 minutes. the clicks table has multiple rows of a user with each page. I can get the list of user but the page next to the output is not the last row, but the first.\n\nThat means if 4 rows are stored for a specific user, 1st is 1 minute ago, and the 4th is 8 minutes ago, it will show me the 8th minute page, not the 1st minute page.\n\nHow to fix this ?\n\nSELECT user\n , page \n FROM clicks \n WHERE timestamp >= NOW() - INTERVAL 10 MINUTE \n GROUP \n BY user\n ORDER \n BY id DESC" ]
[ "php", "mysql" ]
[ "Mask effect is rotating photo", "My code takes a photo. Then saves it with a masking effect applied on it. The only problem is it is being saved at a -90 from the way I took it a portrait photo orientation. All I want to do is take a photo in portrait and have the photo be saved with out the rotation applied to it. \n\n[Saved Pic when Mask is applied][2] \n\n[Mask][3] \n\n func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {\n\n let red = info[UIImagePickerControllerOriginalImage] as! UIImage\n self.dismiss(animated: true)\n//Sugguested Code\n red.imageOrientation = UIDevice.current.orientation.imageOrientation\n//\n\n\n self.currentImageView?.image = red\n\n let image = photo.image\n let maskingImage = UIImage(named: \"mask\")\n photo.image = maskImage(image: image!, mask: maskingImage!)\n photo.autoresizingMask = [.flexibleWidth, .flexibleHeight, .flexibleBottomMargin, .flexibleRightMargin, .flexibleLeftMargin, .flexibleTopMargin]\n photo.contentMode = .scaleAspectFit\n photo.clipsToBounds = true\n\n }" ]
[ "ios", "swift", "swift3", "rotation", "mask" ]
[ "Is testing an app with only an iOS 5 device and iOS 4 simulator OK?", "I've recently upgraded my Xcode version and have been having huge trouble trying to build to my 2nd gen iPod Touch running iOS 4.2.1. - So much so that I've given up attempting.\n\nBuilding to the simulator works fine for the iOS 5 and iOS 4.2 simulators - I'm also going to test the app on an iOS 5 device (when I get my hands on one).\n\nIs this testing sufficient to release an app that has a minimum iOS of 4.2.1? - The problem is I've already released the app which has a minimum iOS of 4.2.1, but I need to release this update (without testing on an iOS 4 device).\n\nAre there any issues with doing this? - If it works on an iOS 4 simulator and iOS 5 simulator/device is that good enough?" ]
[ "iphone", "ios", "xcode" ]
[ "Call to undefined method PDO::bindParam()", "Can someone tell me why I am getting this error? Call to undefined method PDO::bindParam()\n\nHere is what I have, taken right off of PHPs site for stored procedures\n\n$stmt = db::getInstance();\n$stmt->prepare(\"CALL delete(?)\");\n$stmt->bindParam(2122, $return_value, PDO::PARAM_STR, 4000);\n$stmt->execute();\nprint \"procedure returned $return_value\\n\";" ]
[ "php" ]
[ "What is the difference between duration and delay on Ranorex?", "I would like to learn difference between Duration and Delay terms on Ranorex tool. Here is an image from my exercise :\n\n\n\nThanks in advance." ]
[ "automation", "ranorex" ]
[ "Impose a daily limit on software execution time in Windows", "Motivation: I'm addicted to a particular online game.\n\nGoal: write a program that will impose a daily limit on the time this particular game can be played.\n\nBackground: I have never written code for Windows. \n\nMy thoughts: Windows certainly has some API for management of software permissions. I need to write a program that runs in background and periodically checks whether the game is played. If it is - sum the total daily time and use Windows API to block the game when the limit was exceeded. Maybe it is even possible to register a listener that will be notified when the game is started, such that there will be no need for periodic polling of game status.\n\nQuestions: \n\n\nPlease help me with defining the global arch of such a program and point to the parts of Windows API that might be of interest.\nAre there any potential pitfalls that I need to be aware of?\nWhat programming language should I use (can I use any of them or windows API is restricted to certain languages)?\n\n\nI know that there are many programs that do what I need, but I really want to write this program myself.\n\nThanks." ]
[ "windows", "winapi", "architecture" ]
[ "show dialog on network error using Retrofit and Rxjava", "We are building an app using Retrofit to communicate with server, and if there is a network error, a dialog (equivalently, a toast) should be showed and the request will be redone after user clicking the dialog. \nThe problem there is that we want to handle it globally, instead of writing duplicated code around every request. using onErrorResumeNext() as described by a.bertucci in this question with observable view event looks perfect but unfortunately it runs in Retrofit.Idle thread and can't start any UI element. Is it possible to solve that? \n\nA failed example:\n\npublic static <T> Func1<Throwable, ? extends Observable<? extends T>> retryOnNetworkError(final Activity activity, final Observable<T> toBeResumed) {\n return new Func1<Throwable, Observable<? extends T>>() {\n @Override\n public Observable<? extends T> call(Throwable throwable) {\n if (throwable instanceof RetrofitError &&\n RetrofitUtils.isNetworkError((RetrofitError) throwable)) {\n\n return dialog(activity, R.string.dialog_title_network_error, R.string.dialog_msg_network_error)\n .filter(ok -> ok)\n .flatMap(ok -> toBeResumed);\n }\n return Observable.error(throwable);\n }\n };\n}\n\npublic static Observable<Boolean> dialog(Context context, int title, int message) {\n return Observable.create((Subscriber<? super Boolean> subscriber) -> {\n final AlertDialog ad = new AlertDialog.Builder(context)\n .setTitle(title)\n .setMessage(message)\n .setPositiveButton(android.R.string.ok, (dialog, which) -> {\n subscriber.onNext(true);\n subscriber.onCompleted();\n })\n .setNegativeButton(android.R.string.cancel, (dialog, which) -> {\n subscriber.onNext(false);\n subscriber.onCompleted();\n })\n .create();\n // cleaning up\n subscriber.add(Subscriptions.create(ad::dismiss));\n ad.show();\n });\n}" ]
[ "android", "error-handling", "retrofit", "rx-android" ]
[ "Ember-Data store.filter with async relationships", "I am working on a survey application and we are using an existing API. Our models look like:\n\nApp.User = DS.Model.extend({\n name: DS.attr('string'),\n participations: DS.hasMany('participation', {async: true})\n});\n\nApp.Participation = DS.Model.extend({\n user: DS.belongsTo('user', {async: true}),\n survey: DS.belongsTo('survey', {async: true}),\n hasCompleted: DS.attr('boolean'),\n hasAccepted: DS.attr('boolean')\n});\n\nApp.Survey = DS.Model.extend({\n participations: DS.hasMany('participation', {async: true}),\n title: DS.attr('string'),\n locked: DS.attr('boolean')\n});\n\n\nI would like to return a live record array from my model hook via store.filter however this filter needs to deal with both survey's and the async participant record for the current user. How can I handle the async relation resolution in my filter callback function?\n\n model: function() {\n return Ember.RSVP.hash({\n user: this.store.find('user', 1),\n surveys: this.store.filter('survey', {}, function(survey) {\n return !survey.get('locked'); //How do I get the participation record for the current user for the current poll so I can also filter out the completed true\n })\n });\n }\n\n\nIf using a live record array of survey's is not the best way to deal with this what is? \n\nEdit:\nI've updated the approach to try:\n\nApp.SurveysRoute = Ember.Route.extend({\n model: function() {\n return Ember.RSVP.hash({\n user: this.store.find('user', 1),\n all: this.store.find('survey'),\n locked: this.store.filter('survey', function(survey) {\n return survey.get('locked');\n }),\n completed: this.store.filter('participation', {user: 1}, function(participation) {\n return participation.get('hasCompleted');\n }),\n outstanding: this.store.filter('participation', {user: 1}, function(participation) {\n return !participation.get('hasCompleted') && !participation.get('poll.locked');\n })\n });\n }\n});\nApp.SurveysCompletedRoute = Ember.Route.extend({\n model: function() {\n return this.modelFor('surveys').completed.mapBy('survey');\n }\n});\n\n\nhttp://jsbin.com/vowuvo/3/edit?html,js,output\n\nHowever, does the usage of the async property participation.get('poll.locked') in my filter pose a potential problem?" ]
[ "ember.js", "ember-data" ]
[ "Using tag AJAX method in GAS", "I am trying to implement a Stripe payment solution on my Google Site using Google Apps Script (“GAS”) and Stripe.com.\n\nStripe makes the following code available for testing.\n\n\n<div>\n <form action=\"/charge\" method=\"POST\">\n <script\n src=\"https://checkout.stripe.com/checkout.js\"\n class=\"stripe-button\"\n data-key=\"pk_test_6pRNASCoBOKtIshFeQd4XMUh\"\n data-image=\"/square-image.png\"\n data-name=\"Demo Site\"\n data-description=\"2 widgets ($20.00)\"\n data-amount=\"2000\">\n </script>\n </form>\n</div>\n\n\n\nThe code works here on jsfiddle but fails in my GAS index.html file.\n\nNote that when I look inside my Console page in my Chrome developer tools, I see the following error message:\n\n\nTypeError: Cannot read property 'StripeCheckout' of undefined\n\n\n\nWhat’s going wrong? And what’s the solution?" ]
[ "ajax", "google-apps-script", "stripe-payments", "google-sites" ]
[ "clone an object's element and push to it's self", "I have a object A.\n\nif I JSON.stringify(A), I get this result:\n\n{\n \"OrderA\": [{\n \"orderId\": \"19\",\n \"serverId\": 129,\n \"description\": \"Apple\",\n \"status\": \"1\",\n \"details\": \"\"\n }]\n}\n\n\nNow, I would like to clone it's own element and make a larger object like this:\n\n{\n \"OrderA\": [{\n \"orderId\": \"19\",\n \"serverId\": 129,\n \"description\": \"Apple\",\n \"status\": \"1\",\n \"details\": \"\"\n }],\n \"OrderA\": [{\n \"orderId\": \"19\",\n \"serverId\": 129,\n \"description\": \"Apple\",\n \"status\": \"1\",\n \"details\": \"\"\n }],\n \"OrderA\": [{\n \"orderId\": \"19\",\n \"serverId\": 129,\n \"description\": \"Apple\",\n \"status\": \"1\",\n \"details\": \"\"\n }]\n}\n\n\nHow to achieve this by using lodash/underscore/ or jQuery?\n\nso far, I've tried jQuery.extend, lodash union, and didn't work." ]
[ "javascript", "jquery", "underscore.js", "lodash" ]
[ "How to compare Go errors", "I have an error value which when printed on console gives me Token is expired\n\nHow can I compare it with a specific error value? I tried this but it did not work:\n\nif err == errors.New(\"Token is expired\") {\n log.Printf(\"Unauthorised: %s\\n\", err)\n}" ]
[ "go" ]
[ "programmatically silent/vibrate an iOS devise using swift2?", "I'm a new developer and would like to know how to silent/vibrate an IOS device through code(swift2), I don't care if it requires a private API. Please help." ]
[ "ios", "swift2", "xcode7.1" ]
[ "getting file not found exception", "I have my android activity : \n\ntry { \n File root=Environment.getExternalStorageDirectory(); \n Log.i(\"root\",root.toString()); \n File dir=new File(root.getAbsolutePath() + \"/downloads\"); \n dir.mkdirs(); \n file=new File(dir,\"mytext.txt\"); \n FileOutputStream out=new FileOutputStream(file,true); \n PrintWriter pw=new PrintWriter(out); \n pw.println(\"Hello! Welcome\"); \n pw.println(\"You are Here...!!!\"); \n pw.flush(); \n pw.close(); \n try { \n out.close(); \n } catch (IOException e) { \n // TODO Auto-generated catch block \n e.printStackTrace(); \n }\n } catch (FileNotFoundException e) { \n // TODO Auto-generated catch block \n e.printStackTrace();\n } \n\n\nalso added : \n\n <uses-permission android:name=\"androd.permission.WRITE_EXTERNAL_STORAGE\"/> \n\n\nbut it throws me FileNotfound exception : \n01-13 09:06:44.442: WARN/System.err(419): java.io.FileNotFoundException: /mnt/sdcard/downloads/mytext.txt (No such file or directory) \n\nand if i add \n\n if(file.exists()){ \n System.out.println(\"file exists\"); \n } \n else{ \n System.out.println(\"No such Fileeeeeeeeee\"); \n } \n\n\nit moves into \"else\" part.\n\nThanks\nSneha" ]
[ "android", "filenotfoundexception" ]
[ "How to POST reverse relation using django rest framework?", "I have a model set up with foreign keys referencing back to the model:\nmodels.py (There are more fields in A, but are irrelevant)\nclass A(models.Model):\n name = models.CharField(max_length=60)\n\nclass B(models.Model):\n other_name = models.CharField(max_length=60)\n a = models.ForeignKey("A", on_delete=models.CASCADE)\n\nAnd I have serializers set for both models.\nserializers.py\nclass BSerializer(serializers.ModelSerializer):\n class Meta:\n model = B\n fields = '__all__'\n\nclass ASerializer(serializers.ModelSerializer):\n b_set = BSerializer(many=True)\n\n class Meta:\n model = A\n fields = ['name', 'b_set']\n\nAnd a view for the model:\nviews.py\nclass AList(generics.ListCreateAPIView):\n queryset = A.objects.all()\n serializer_class = ASerializer\n\nI am able to issue a get request and receive both the A models and their associated B models. I can issue a post with just an A instance, but I can't issue a post with an A instance and a B instance at the same time.\nIs there a way to do this with one post request?" ]
[ "python", "django", "post", "django-rest-framework" ]
[ "Win8 app can't login to SharePoint Office365", "I am trying to run this MSDN sample, and it works against a Office 365 site.\n\nHowever, when I run it against the SharePoint 2013 cloud implementation in my office, I get an authentication failed error, which is actually an error with the message:\n\n <S:Body xmlns:S=\"http://www.w3.org/2003/05/soap-envelope\">\n- <S:Fault>\n- <S:Code>\n <S:Value>S:Sender</S:Value> \n- <S:Subcode>\n <S:Value>wst:FailedAuthentication</S:Value> \n </S:Subcode>\n </S:Code>\n- <S:Reason>\n <S:Text xml:lang=\"en-US\">Authentication Failure</S:Text> \n </S:Reason>\n- <S:Detail>\n- <psf:error xmlns:psf=\"http://schemas.microsoft.com/Passport/SoapServices/SOAPFault\">\n <psf:value>0x80048821</psf:value> \n- <psf:internalerror>\n <psf:code>0x80047860</psf:code> \n <psf:text>Direct login to WLID is not allowed for this federated namespace</psf:text> \n </psf:internalerror>\n </psf:error>\n </S:Detail>\n </S:Fault>\n </S:Body>\n\n\nAny idea if there is some setting done by the IT department blocking me, or is there some change I need to make in my app?\n\nThank you!" ]
[ "sharepoint", "winrt-xaml", "office365-apps" ]
[ "Vue js - Getting Uncaught ReferenceError: jQuery is not defined", "I am new to Vue.js and trying to create a custom component that uses jQuery formBuilder plugin. When I include the component file inside another component, I am getting an error:\n\n\n Uncaught ReferenceError: jQuery is not defined in /resources/js/form-builder.min.js\n\n\nI created a custom component with name formBuilder.vue. Here is the component code:\n\n<template>\n <div class=\"content\">\n <formBuilder/>\n </div>\n</template>\n<script>\n // import './jquery.min.js';\n // import './jquery-ui.min.js';\n // import './form-builder.min.js';\n export default { \n created() {\n\n },\n data() {\n return { \n\n }\n },\n mounted() {\n jQuery(this.$el).formBuilder();\n },\n methods: {\n }\n }\n</script>\n\n\nIn app.js file, which is placed in resource/js/app.js, I am calling this vue to be recursively used by other components:\n\nwindow.Vue = require('vue');\nrequire('./bootstrap');\nrequire('admin-lte');\nrequire('./datatable');\nimport router from './router';\nimport Datepicker from 'vuejs-datepicker';\nimport CKEditor from 'ckeditor4-vue';\nimport FullCalendar from 'vue-full-calendar';\nimport 'fullcalendar/dist/fullcalendar.css'\nimport Vue from 'vue';\nimport jQuery from 'jquery'\nimport './form-builder.min.js';\nVue.use(VueRouter)\nVue.use(FullCalendar);\nVue.use(CKEditor)\nVue.component(\"vue-datepicker\", Datepicker);\nVue.component('FormBuilder', require('./components/tools/formBuilder.vue').default);\n\nconst app = new Vue({\n el: '#app',\n router\n});\n\n\nThis is the component file where i am using formbuilder component\n\n <template>\n <div class=\"content-wrapper\">\n <div class=\"content-header\">\n <div class=\"container-fluid\">\n <div class=\"row mb-2\">\n <div class=\"col-sm-6\">\n <h1 class=\"m-0 text-dark\">Questionnaire</h1>\n </div>\n <div class=\"col-sm-6\"></div>\n </div>\n </div>\n </div>\n <div class=\"content\">\n <div class=\"container-fluid\">\n <div class=\"row justify-content-center\">\n <div class=\"col-md-12\">\n <div class=\"card\">\n <FormBuilder/> <!--- used formbuilder component --->\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\n export default {\n created() {\n },\n data() {\n return {\n\n }\n },\n methods: {\n\n }\n }\n</script>\n\n\nI have attached the error as well.\n\nCan you guys help me find where I am doing wrong?\n\nThanks in Advance." ]
[ "javascript", "jquery", "vue.js", "vuejs2", "vue-component" ]
[ "Bind request mapping to submit input button in html (Springboot)", "My RequestController:\n\n@Controller\n@RequestMapping(\"/request\")\npublic class RequestsController {\n\n private static final Logger log = LoggerFactory.getLogger(TmtApplication.class);\n\n @Autowired\n RequestRepository requestRepository;\n\n @Autowired\n UsersRepository usersRepository;\n\n @RequestMapping(\"/save\")\n String saveRequest()\n {\n Request requestObj = new Request(usersRepository.findOne(1L), new Date());\n requestObj.setDescription(\"I got so bored\");\n requestObj.setStatus(false);\n requestObj.setRequestDate(new Date());\n requestRepository.save(requestObj);\n return \"index\";\n }\n}\n\n\nMy button:\n\n<input type=\"submit\" value=\"Submit Request\" style=\"display: block;\">\n\n\nI'm trying to get my button to fire off this request. What should I add to my HTML to initiate the call for /save?\n\nUpdate:\n\nForm:\n\n<form action=\"/request/save\" method=\"post\" commandName=\"requestData\">\n <input type=\"text\" id=\"dateInput\" value=\"\" style=\"display: none;\"/>\n <div style=\"width: 200px;\"><input type=\"submit\" value=\"Submit Request\" style=\"display: block;\">\n </div>\n</form>\n\n\nController:\n\n@RequestMapping(value = \"/save\", method = RequestMethod.POST)\n String saveRequest(@ModelAttribute(\"requestData\") Request requestData, Map<String, Object> map,\n HttpServletRequest request)\n {\n Request requestObj = new Request(usersRepository.findOne(1L), new Date());\n requestObj.setDescription(requestData.getDescription());\n requestObj.setStatus(false);\n requestObj.setRequestDate(requestData.getRequestDate());\n requestRepository.save(requestObj);\n return \"save\";\n }" ]
[ "java", "html", "spring", "spring-boot" ]
[ "How to include a variable between strings in Delphi?", "procedure TForm1.Button1Click(Sender: TObject); \nvar \n xlap,xlbook,xlsheet:variant;\n y:integer;\nbegin\n xlap:=createoleobject('excel.application');\n xlbook:=xlap.workbooks.add;\n xlap.visible:=true;\n xlsheet:=xlbook.worksheets.add;\n\n for y:=1 to 50 do\n begin \n xlsheet.cells[y,2].value:= concat('=IF(A',y,'>6,\"Good\",\"Bad\")')\n inc(y);\n end;\nend;\n\n\nThat's my code to make an Excel through Delphi. I want to input the IF formula into column B of the Excel, but there is error when I use the concat('=IF(A',y,'>6,\"Good\",\"Bad\")').\n\nMay be I need another way to include y between those strings.\n\nAny suggestion? Thanks before" ]
[ "delphi", "export-to-excel" ]
[ "In Smarty products with the same ID adding together", "Do I have a chance in Smarty list items with the same ID (Product ID) together to count (add)?\n\n{$order_value}\n{$qty_value}\n{$id_value}\n{$title_value}\n\n\nInstead of this:\n\nOrder: 004, Quantity: 3, Product ID: 001, Title: Fish\nOrder: 005, Quantity: 1, Product ID: 001, Title: Fish\n\n\nsomething like this:\n\nQuantity: 4, Product ID: 001, Title: Fish" ]
[ "php", "html", "smarty" ]
[ "MVC3 vb.net to C# WebGrid issue", "I'm rewritting some of the code from MVC4 C# to MVC3 vb.net (both razor engines) and I've came upon this issue... When I try to use the WebGrid I'm getting some syntax errors with \"format:=\". It seems that I can't get the syntax correctly. This part of the code is faulty:\n\n...\ngrid.Column(\n\n format: \n @<text> \n @Html.ActionLink(\"Edit\", \"Edit\", new { id=item.id })\n </text> \n\n ),\n\n\n...\n\nCan somebody give me some advice or direction or help me? It's important to mention that everything else worked with WebGrid (columns etc.). But I've tried to place the edit link to the grid like in the C# version (works like a charm there)." ]
[ "c#", "vb.net", "asp.net-mvc-3" ]
[ "AngularJS/Grunt encoding issue", "I'm using grunt serve to serve my angular app, but I've got an encoding issue... I have a fake json which I read locally using $http service, this json contains strings with \"special\" characters (like \"è\", \"ì\"...) that are not rendered properly. In my html page I defined:\n\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n<meta charset=\"utf-8\" />\n\n\nAnd I also configured explicitly angular to require that encoding:\n\nconfig(['$httpProvider', function($httpProvider) {\n $httpProvider.defaults.headers.common['Content-Type'] = 'application/json; charset=utf-8';\n $httpProvider.defaults.headers.common['Accept'] = 'application/json; charset=utf-8';\n}]);\n\n\nbut the characters are still \"broken\"... what should I do? Is perhaps this issue something related to Grunt?" ]
[ "javascript", "json", "angularjs", "encoding", "gruntjs" ]
[ "Codeigniter and memory allocation issue for mysqli", "I have a HUGE DB and when I'm trying to retrive some information in order to create a PDF and I get this error:\n\nFatal error: Allowed memory size of 134217728 bytes exhausted\n(tried to allocate 128 bytes) in \n.../system/database/drivers/mysqli/mysqli_result.php on line 167\n\n\nIs there a way to increase the memory limit?" ]
[ "php", "codeigniter", "mysqli" ]
[ "Python script with a sleep() statement does not log when run in background", "I have a simple Python script I would like to run in the background, with the output redirected to a file e.g.\n\n./test.py > output.log 2>&1 &\n\n\nThis works fine so long as there is no sleep statement in my Python script:\n\n#! /usr/bin/env python\n\nimport sys\nimport time\nfrom time import gmtime, strftime\n\nurls=['http://a', 'http://b','http://c', 'http://d', 'http://e' ]\n\ndef main():\n while True:\n for url in urls:\n try:\n print url\n except Exception, e:\n print \"Error checking url \" + url\n print e\n #time.sleep(60)\n\n\nif __name__ == '__main__':\n main()\n\n\nIf the sleep statement is uncommented then no output is generated when the script is run in the background. \n\nIf it is run in the foreground it works fine (with sleep) and the output is sent to console or file as I choose.\n\ne.g. this always works:\n\n./test.py > output.log\n\n\nMy question is, why does having the sleep statement prevent output from being directed to file when the script is run in the background, and how can I get round this?" ]
[ "python", "bash", "shell" ]
[ "My internal multilingual link point in wrong direction", "Have some serious problem with links behaviour in my multilingual site (English (en) and Swedish (sv)). The default languages is English.\nI have some nodes with a summery. In the summery I have internal links to my Swedish content. To link to page3 I use sv/page3.\nI make a view with the summaries filtered on the language.\nIf I place this view as a front page all works fine but if I link the view from a translated Menu-link the will be sv/sv/page3.\n\nHope for help" ]
[ "drupal", "multilingual" ]
[ "Celery + Django best practice", "I have been reading about the celery and django in these posts (here and here), and all the logic/tasks works in the celery.py, but in the official documentation they separated in two files: celery.py and tasks.py. So which is the best practice? This affects the performance?" ]
[ "django", "celery" ]
[ "How to disable my fullpage script from my members in wordpress?", "How to disable my fullpage script only for my registered members in wordpress? This is my fullpage script code \n\n<script src=\"https://linkvertise.net/cdn/linkvertise.js\"></script><script>linkvertise(11261, {whitelist: [\"dropmb.com\"], blacklist: []});</script>\n\n<script src=\"https://linkvertise.net/cdn/linkvertise.js\"></script><script>linkvertise(15361, {whitelist: [\"verystream.com\"], blacklist: []});</script>" ]
[ "html", "wordpress" ]
[ "Problem with lunching Java app (Spring, Hibernate) on Debian (MySQL)", "</bean id=\"mySqlDataSource\" >\nclass=\"org.springframework.jdbc.datasource.DriverManagerDataSource\">\n\n <property name=\"driverClassName\" value=\"com.mysql.jdbc.Driver\"/>\n <property name=\"url\" value=\"jdbc:mysql://127.0.0.1:3306/mysqljava\"/>\n <property name=\"username\" value=\"mysqljava\"/>\n <property name=\"password\" value=\"the_bbt\"/>\n </bean>\n\n<bean id=\"mySqlSessionFactory\" class=\"org.springframework.orm.hibernate3.LocalSessionFactoryBean\">\n <property name=\"dataSource\" ref=\"mySqlDataSource\"/>\n\n <property name=\"mappingResources\">\n <list>\n <value> hibernate/SimpleEntity.hbm.xml</value>\n </list>\n </property>\n\n <property name=\"hibernateProperties\">\n <value>\n hibernate.dialect=org.hibernate.dialect.MySQLDialect\n hibernate.show_sql=true\n hibernate.hbm2ddl.auto=create\n hibernate.current_session_context_class=thread\n </value>\n </property>\n\n</bean>\n\n\nabove my Spring config, why my app throws:\n\n\n [java] 02.12.2010 18:29:13 org.hibernate.cfg.SettingsFactory buildSettings\n [java] WARNING: Could not obtain connection to query metadata\n [java] java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)\n [java] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1075)\n\n\n\n\nand any problem on Windows(!!!" ]
[ "java", "mysql", "hibernate", "spring", "mysql-error-1075" ]
[ "How to Set Java Path On Windows?", "When we set the environment path, can't it work correctly for Java, Eclipse and Android Studio?\nHow to set it correctly?\n\nWhen I set it temporarily by using the command prompt, set path is not working correctly.\nSo I tried to set it permanently by using the environment variable Path, but it's not possible.\n\nHow can I set it properly?\nPlease give me a detailed explanation" ]
[ "java", "android", "eclipse", "android-studio", "youtube" ]
[ "error when using solr and Integrating nutch and solr(HTTP ERROR 500)", "I have Linux Ubuntu 12.04 installed and I'm trying to install nutch 1.5.1 and solr 3.6.1 and integrate theme together to crawl seed urls.\nI'm using This tutorial to get this work.\nI followed the steps before 3.2 and skipped to step 4 and I can access to\nlocalhost:8983/solr/admin/ \n\nwithout error.\nbut when going to step 6 and copying schema.xml from conf folder of nutch to example/solr/conf folder of solr\nsolr/admin page occurs a java error,below:\n\n\n\n\nHow can I handle that?\n\none more thing to ask....\nI have another tutorial for this that looks good but in first step it mentions that add some code to nutch-site.xml file in /conf/ and /runtime/local/conf/ folder \n\nbut in nutch folder there is no runtime folder.In step 4 this folder mentioned too.\nany suggestion? \n\nthanks in advance" ]
[ "solr", "integration", "web-crawler", "nutch" ]
[ "Tensorflow Type error when trying to iterate the Tensors in loop", "I have the following scenario:\n\ny = tf.placeholder(tf.float32, [None, 1],name=\"output\")\nlayers = [tf.contrib.rnn.BasicRNNCell(num_units=n_neurons,activation=tf.nn.leaky_relu, name=\"layer\"+str(layer))\n for layer in range(2)]\nmulti_layer_cell = tf.contrib.rnn.MultiRNNCell(layers)\nrnn_outputs, states = tf.nn.dynamic_rnn(multi_layer_cell, X, dtype=tf.float32)\nstacked_rnn_outputs = tf.reshape(rnn_outputs, [-1, 100]) \nstacked_outputs = tf.layers.dense(stacked_rnn_outputs, 1)\noutputs = tf.reshape(stacked_outputs, [-1, 2, 1])\noutputs = tf.identity(outputs[:,1,:], name=\"prediction\")\nloss = Custom_loss(y,outputs)\noptimizer = tf.train.AdamOptimizer(learning_rate=learning_rate) \ntraining_op = optimizer.minimize(loss,name=\"training_op\")\n\n\nThe custom loss function I tried is: \n\ndef Custom_loss(y,outputs):\n hold_loss = []\n for exp,pred in zip(y,outputs):\n if exp >= pred:\n result = tf.pow(pred * 0.5,2) - exp\n hold_loss.append(result)\n else:\n hold_loss.append(tf.subtract(pred-exp))\n return tf.reduce_mean(hold_loss)\n\n\nNow when I am trying to implement this I am getting the following error: \n\nTypeError: Tensor objects are only iterable when eager execution is enabled. To iterate over this tensor use tf.map_fn.\n\n\nI have tried implementing the tf.map_fn() but there is the same error I encounter. I have used the following question:\nHow to explain the result of tf.map_fn? \n\nKindly, help me get through this issue? How I can iterate the tensor? What way is best for the custom loss function implementation?" ]
[ "python", "tensorflow" ]
[ "Plotly performance when updating many charts", "I'm trying to build a real-time dashboard utilising Python/Flask and Plotly JS. I've set up a web socket (SocketIO) to pump data to plotly and am updating the plot data based on this. What I'd like to achieve is real-time plotting at >5 Hz (can sort of bin the point into batches every 200 ms).\nThe problem is that it currently seems to completely cripple my browser when I do this with more than ~5 plots. Please see below what I'm trying to achieve.\n\nI have set it up in JS as follows: (9x)\n<script>\n Plotly.plot('X_AXIS',\n [{x:[0],\n y:[0],\n type:'scatter'}],\n {\n width: document.getElementById("col").offsetWidth,\n height:0.33 * document.getElementById("DataContent").offsetHeight,\n plot_bgcolor:"white",\n paper_bgcolor:("#ecc060"),\n margin:{l:15,r:15,t:30,b:30},\n xaxis: {range:[0,100]},\n yaxis: {range:[-10,10]},\n title: {text:'X-Axis'}\n }\n );\n </script>\n\nWith a function to update the data using updateTraces:\nsocket.on('UpdateTelemetry',function(Data){\n Plotly.extendTraces('X_AXIS',{x:[[Data[0][0]]],y:[[Data[0][1]]]},[0],100);\n Plotly.extendTraces('Y_AXIS',{x:[[Data[1][0]]],y:[[Data[1][1]]]},[0],100);\n Plotly.extendTraces('Z_AXIS',{x:[[Data[2][0]]],y:[[Data[2][1]]]},[0],100);\n Plotly.extendTraces('X_AXIS2',{x:[[Data[0][0]]],y:[[Data[0][1]]]},[0],100);\n Plotly.extendTraces('Y_AXIS2',{x:[[Data[1][0]]],y:[[Data[1][1]]]},[0],100);\n Plotly.extendTraces('Z_AXIS2',{x:[[Data[2][0]]],y:[[Data[2][1]]]},[0],100);\n Plotly.extendTraces('X_AXIS3',{x:[[Data[0][0]]],y:[[Data[0][1]]]},[0],100);\n Plotly.extendTraces('Y_AXIS3',{x:[[Data[1][0]]],y:[[Data[1][1]]]},[0],100);\n Plotly.extendTraces('Z_AXIS3',{x:[[Data[2][0]]],y:[[Data[2][1]]]},[0],100);\n\n\n });\n\nI have tried going to scattergl, but honestly performance seems worse than just scatter. It seems like plotly is just hogging all the CPU time the browser gets for JS code, meaning the rest of the page becomes almost completely unresponsive. (can't even open dropdown menus anymore)\nIs there any more performant way of doing this?" ]
[ "javascript", "python", "plotly" ]
[ "When closing fancybox the screen becomes black on IE8", "I'm using fancybox with youtube and when i close the fancybox on IE8 the screen becomes black ans seems to cantain an overlay of flash. This is really weird and only happens on IE8.\n\nThis is the site. The fancybox will appear on page load.\n\nThanks\nBruno" ]
[ "flash", "youtube", "fancybox" ]
[ "Is it possible to associate several different Tables in a One-To-One With Optional FKs?", "I am using Code First Entity Framework.\n\nI have a Bar table/domain class.\n\nI also have an Address table/domain class. This is because one Bar can have one Address and vice versa.\n\nI have a One-To-One relationship set up between these two entities, with the Bar being the parent. I am now adding a Brewer Entity to my application, which obviously also will need to store an Address.\n\nI want to use the Address table/entity that I already have above to now also represent the Brewer's address. Meaning, A new address can be created when a bar is created or when a new brewer is created. Right now, I have the Address actually using the BarId as its primary and foreign key. Obviously, when I want to add a Brewer record, the Bar won't be part of the transaction, so this will have to be changed.\n\nI'm looking for a way to set up the DB to accept a new Address as long as it is tied to either a Brewer or a Bar but definitely not both at once. The problem with this, is by definition, the BarId and BrewerID that are used inside the Address as the foreign keys must be optional. However in order to set up a One-To-One, you have to either use both [Key][ForeignKey] DataAnnotations Or .HasRequired().WithRequiredParent which is preventing me for doing this. Is there any other way to do this? I'm getting this error:\n\nBar_Address_Target: : Multiplicity is not valid in Role 'Bar_Address_Target' in relationship 'Bar_Address'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be '*'.\nBrewer_Address_Target: : Multiplicity is not valid in Role 'Brewer_Address_Target' in relationship 'Brewer_Address'. Because the Dependent Role properties are not the key properties, the upper bound of the multiplicity of the Dependent Role must be '*'.\n\n\nHowever, this question is not directly about this error: I do understand the error. The closest most helpful answer on SO is this one. However, it does not address this issue specifically, where I am trying to make multiple one-to-ones but need to have the foreign keys as optional. Without them being optional, the application would require me to add a Bar for every Brewer added and vice versa, which obviously makes no sense." ]
[ "entity-framework", "ef-code-first" ]
[ "Shift Between autocomplete and dropdown Vuetify", "I have a problem while using v-autocomplete from vuetify. In fact, I have a shift between the select input and the dropdown when searching (exemple).\nIt seems that the shift come from the header of the page, when I disable the header the shift disappear...\nHow to fix the position of the dropdown ?\nCode autocomplete :\n<v-container class="SelectProject">\n <v-autocomplete\n class="SelectProject"\n :items='convertToSelect'\n @change='selectProject'\n dense\n chips\n small-chips\n label="Projet"\n solo\n dark='true'\n >\n </v-autocomplete>\n\n <v-btn>\n Valider\n </v-btn>\n </v-container>\n\nCode header :\n <template lang="html">\n <div class="header d-flex">\n <div class="logo">\n <v-img\n :src="require('../assets/logo.png')"\n max-width='300px'\n > </v-img>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n name:'Header',\n\n}\n</script>\n\n<style lang="css" scoped>\n.header{\n background-color: #2C3E50;\n}\n</style>\n\nThanks for your help !" ]
[ "vue.js", "vuetify.js" ]
[ "Formulating a Specific HTTP Post Message", "I have been combing through example code and tutorials online in an attempt to understand what I am doing wrong here, but I am at a loss. I am developing a Proof of Concept android application to integrate with a Bluetooth Router through a REST API. It requires me to Auth with the back end using a specific HTTP Post message, and all my attempts to replicate this message have failed.\n\nThe post message to auth is as follows:\n\nPOST api/oauth2/token HTTP/1.1\n Host: demo.url.com\n Headers: {Authorization: Basic dGVzdGVyOjEfhdjkejlhMmU4MjNjNDc=\n Content-Type: application/x-www-form-urlencoded}\n\n Body:\n{grant_type=client_credentials}\n\n\nAnd the code I am using to replicate this is:\n\nURL url = new URL(\"http://demo.url.com/api\");\nHttpURLConnection conn = (HttpURLConnection) url.openConnection();\nconn.setRequestMethod(\"POST\");\nconn.setDoOutput(true);\nContentValues values = new ContentValues();\nvalues.put(\"Authorization\", \"Basic dGVzdGVyOjEfhdjkejlhMmU4MjNjNDc=\");\nvalues.put(\"Content-Type\", \"application/x-www-form-urlencoded\");\nvalues.put(\"Body\", \"{grant_type=client_credentials}\");\nOutputStream os = conn.getOutputStream();\nBufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, \"UTF-8\"));\nStringBuilder sb = new StringBuilder();\nsb.append(URLEncoder.encode(\"data\", \"UTF-8\"));\nsb.append(\"=\");\nwriter.write(sb.toString());\nwriter.flush();\nwriter.close();\nos.close();\nconn.connect();\n\n\nAny help, or directions to tutorials or example code would be greatly appreciated." ]
[ "java", "android", "http", "oauth-2.0" ]
[ "RxUI and Xamarin Forms: Is it possible to create Modal Pages?", "I'm currently evaluating RxUI for future projects and so far I like what I see.\nI was able to create a first test project and navigate between pages using \n\nHostScreen.Router.Navigate.Execute(new NewReleasesViewModel(HostScreen)).Subscribe();\n\n\nWhich creates a normal ContentPage with Backbutton.\n\nI wonder how I can navigate to the ModalPage stack and display modal pages." ]
[ "xamarin.forms", "reactiveui" ]
[ "Using jQuery I want to highlight columns in table when a TD is hovered", "When the user hovers over a cell in a table, I would like to apply a css style class to that column, only while it's being hovered over.\n\nHere is an example using JS i want to use: http://jsfiddle.net/JokerMartini/gprkL006/\n\nHere is the code in which im using to sort the columns. I want to combine the two scripts. However this second script is complex as it was given to be written in raw Javasvcscript. I would like to have this script modified to use jQuery which in return will make it less complex and easier for me to combine the two fiddles.\n\nhttps://jsfiddle.net/JokerMartini/ctq3w7sj/\n\n<table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Times</th>\n <th>Count</th>\n <th>Size</th>\n <th>Info</th>\n </tr>\n </thead>\n\n <tbody>\n <tr>\n <td>Mike</td>\n <td>15</td>\n <td>42314</td>\n <td>29</td>\n <td>stuff</td>\n </tr>\n\n <tr>\n <td>Great</td>\n <td>10</td>\n <td>7558</td>\n <td>43</td>\n <td>info</td>\n </tr>\n\n <tr>\n <td>Mitch</td>\n <td>20</td>\n <td>7841</td>\n <td>129</td>\n <td>stuff</td>\n </tr>\n\n <tr>\n <td>Leslie</td>\n <td>25</td>\n <td>16558</td>\n <td>423</td>\n <td>info</td>\n </tr>\n </tbody>\n</table>" ]
[ "javascript", "html", "css" ]
[ "Unable to execute callback function as its is not being passed correctly", "exports.Instance = function(args, callback){\n valargs(array, function(err){});\n}\n\nfunction valargs(array, callback){\n callback(null);\n}\n\n\ncallback in valargs function is undefined." ]
[ "node.js", "callback" ]
[ "Is it possible to generate a 64-byte (256-bit) key and store/retrieve it with AndroidKeyStore?", "In my Android app, I need a way to encrypt the data I store in a local DB.\nI chose Realm DB because the offer a seamless integration with encryption. I just need to pass a key when initializing the Realm instance. This key must be of 64 byte size.\n\nFor security reason, I found out that the best way to store this key is in AndroidKeyStore. I'm struggling to find a way to generate a key (using any algorithm) with that size, and getting it into a 64-byte array. I'm trying to keep a minSdk of API 19, but I believe I can bump it up to 23 if needed (many changes to AndroidKeyStore between these two versions).\n\nDoes anyone have an idea? Here is my code:\n\nClass Encryption.java\n\nprivate static KeyStore ks = null;\nprivate static String ALIAS = \"com.oi.pap\";\n\npublic static byte[] loadkey(Context context) {\n\n byte[] content = new byte[64];\n try {\n if (ks == null) {\n createNewKeys(context);\n }\n\n ks = KeyStore.getInstance(\"AndroidKeyStore\");\n ks.load(null);\n\n content= ks.getCertificate(ALIAS).getEncoded(); //<----- HERE, I GET SIZE GREATER THAN 64\n Log.e(TAG, \"original key :\" + Arrays.toString(content));\n } catch (KeyStoreException | CertificateException | IOException | NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n content = Arrays.copyOfRange(content, 0, 64); //<---- I would like to remove this part.\n return content;\n}\n\nprivate static void createNewKeys(Context context) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException {\n\n ks = KeyStore.getInstance(\"AndroidKeyStore\");\n ks.load(null);\n try {\n // Create new key if needed\n if (!ks.containsAlias(ALIAS)) {\n Calendar start = Calendar.getInstance();\n Calendar end = Calendar.getInstance();\n end.add(Calendar.YEAR, 1);\n KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(context)\n .setAlias(ALIAS)\n .setSubject(new X500Principal(\"CN=PapRealmKey, O=oipap\"))\n .setSerialNumber(BigInteger.ONE)\n .setStartDate(start.getTime())\n .setEndDate(end.getTime())\n .setKeySize(256)\n .setKeyType(KeyProperties.KEY_ALGORITHM_EC)\n .build();\n KeyPairGenerator generator = KeyPairGenerator\n .getInstance(KeyProperties.KEY_ALGORITHM_RSA, \"AndroidKeyStore\");\n generator.initialize(spec);\n\n KeyPair keyPair = generator.generateKeyPair();\n Log.e(TAG, \"generated key :\" + Arrays.toString(keyPair.getPrivate().getEncoded()));\n\n }\n } catch (Exception e) {\n Log.e(TAG, Log.getStackTraceString(e));\n }\n}" ]
[ "java", "android", "encryption", "android-keystore" ]
[ "Apache RewriteRule not working without Page # specified", "I have a rewrite rule set up in my .htaccess file:\n\nRewriteRule ^Crocodile-Style/([0-9]+)/?$ products/display.php?folder=crocodile-style&page=$1 [L,NC]\n\n\nhttp://test.bradp.com/drupal/Crocodile-Style/1 works OK.\n\nhttp://test.bradp.com/drupal/Crocodile-Style/ DOES NOT WORK.\n\nApache throws a 404. The PHP logic defaults to page 1 without a page specified, so I know the script is fine.\n\nWhat can I do?\n\nThanks\nNick" ]
[ "apache", "mod-rewrite" ]
[ "Calculate Quantity * Price = Total | Total / Price = Quantity", "I need some help.\n\nI want the \"Total\" to be calculated by the \"quantity * price = total\" (so far it's ok). The problem is that I also need \"Quantity\" to be calculated by \"total / price = quantity\" ie if one field is changed the other will automatically change.\n\nI made a very simple example code: JSFiddle\n\n//Value of Price (Hidden)\n$('#price').val(31245);\n\n//Calculation\nvar qty=$(\"#qty\");\nqty.keyup(function(){\n var total=isNaN(parseInt(qty.val()* $(\"#price\").val())) ? 0 :(qty.val()* $(\"#price\").val())\n $(\"#total\").val(total);\n});\nvar total=$(\"#total\");\ntotal.keyup(function(){\n var qty=isNaN(parseInt(total.val()/ $(\"#price\").val())) ? 0 :(total.val()/ $(\"#price\").val())\n $(\"#qty\").val(qty);\n});\n\n//Mask Total input\nvar originalVal = $.fn.val;\n\n$.fn.val = function(value) {\n if (typeof value == 'undefined') {\n return originalVal.call(this);\n } else {\n setTimeout(function() {\n this.trigger('mask.maskMoney');\n }.bind(this), 100);\n return originalVal.call(this, value);\n }\n};\n\n$('#total').maskMoney();\n\n$('#total').on('click mousedown mouseup focus blur keydown change input', function(event) {\n console.log('This Happened:'+ event.type);\n});\n\n\nIn it the first part \"quantity * price = total\" works ok and is updated automatically. However, when in the second part \"total / price = quantity\" is the problem appears.\n\nWhen the number entered in the Total input is too large (Example: 9,876.23) the quantity is not calculated automatically and returns 0. But if the number is for example 893.23 the quantity works as it should.\n\nCould any of you help me? (sorry for my bad english)\n\nPs: I needed the value of the quantity field not to exceed 8 decimals (example: 0.00000000). But in all the attempts I had the calculation does not work." ]
[ "javascript", "jquery", "html", "calculator" ]
[ "Sending and recieving int over network python", "I am having a problem sending and receiving data. This will be a number guessing game eventually but at the moment I am having difficulty sending the integer from client side and storing it to a variable on the server side.\n\nI get the error message \"TypeError: 'int' does not support the buffer interface\". I am unsure what this means or how to fix it.\n\nThank you\n\n#Server\n\nimport socket\nimport math\nimport re\nimport random\n\ngoal = random.randrange(1,11)\n\ndef within(guess,goal,n):\n absValue = abs(guess - goal)\n if absValue <= n:\n return True\n else:\n return False\n\nscoreCount = 0\nguess = 0\n\ns = socket.socket(socket.AF_INET,socket.SOCK_STREAM)\ns.bind((\"127.0.0.1\",9000))\ns.listen(5)\nwhile True:\n (c,a) = s.accept()\n print (\"Received connection from\", a)\n\n while guess!= goal:\n c.sendall('What is your guess?'.encode())\n guess =(c.recv(4096))\n print(guess)\n\nc.close()\n\n\n\n#Client\n\nimport socket\ns = socket.socket(socket.AF_INET,socket.SOCK_STREAM)\ns.connect(('127.0.0.1',9000))\n\ndata = s.recv(10000).decode()\nprint (data)\n\n\nwhile True:\n\n guess = int(input(\"Guess: \"))\n print(guess)\n s.sendall(guess)\n s.close()" ]
[ "python" ]
[ "How to find out which `font-feature-settings` safe web fonts (Arial, Georgia, Tahoma) / any font do support?", "I tried to implement CSS3 font-feature-settings lining figures, in particular with Georgia (Windows 7, OpenType), but Georgia* does seem to just support oldstyle figures.\n\nWidest supported syntax, originating from https://stackoverflow.com/a/15161336/1696030\n\n.ffs--lnum {\n -webkit-font-feature-settings: \"lnum\";\n -moz-font-feature-settings: \"lnum=1\"; /* Fx 4 to 14 */\n -moz-font-feature-settings: \"lnum\"; /* Fx 15 onwards */\n -moz-font-feature-settings: \"lnum\" 1; /* Fx 15 onwards explicitly set feature values */\n font-feature-settings: \"lnum\"; /* other features for comparison: c2sc=1, smcp=1 */\n font-variant-numeric: lining-nums;\n}\n\n\nHere's also a Codepen including my attempts so far.\n\nHow can I find out which font-feature-settings a certain font (web safe/webfont) is supporting without trial and error? Are there certain applications that show those? I don't necessarily care about platforms, all inputs are welcome.\n\nEdit (*): Georgia's installed in v. 5.00, and as much as it's an interesting note, it is not the main topic of this question." ]
[ "css", "fonts" ]
[ "Update SSRS Datasource Reference in Powershell before Upload", "I hope somebody can help me with this issue, i am trying to upload an SSRS report using powershell, however it totally loses the datasource reference after its uploaded.\n\nI found some script online which changes the reference, but this would not work for what i need because its using the datasource name to become the reference, but in my scenario the datasource name could be something like Datasource1 but the reference could be /Data Sources/Translations\n\nWhat i need to do is alter the reference in the bytearray before its uploaded.\n\nThis is the script im using so far, which is working for the upload.\n\n#ReportName\n$reportName = [System.IO.Path]::GetFileNameWithoutExtension($rdlFile);\nwrite-host $reportName -ForegroundColor Green\n#Upload File\ntry\n{\n#Get Report content in bytes\nWrite-Host \"Getting file content of : $rdlFile\"\n$byteArray = gc $rdlFile.FullName -encoding Byte\n\n$msg = \"Total length: {0}\" -f $byteArray.Length\nWrite-Host $msg\n\nWrite-Host \"Uploading to: $reportFolder_Final\"\n\n$type = $ssrsProxy.GetType().Namespace\n$datatype = ($type + '.Property')\n\n$DescProp = New-Object($datatype)\n$DescProp.Name = 'Description'\n$DescProp.Value = ''\n$HiddenProp = New-Object($datatype)\n$HiddenProp.Name = 'Hidden'\n$HiddenProp.Value = 'false'\n$Properties = @($DescProp, $HiddenProp)\n\n#Call Proxy to upload report\n\n$warnings = $null\n\n$Results = $ssrsProxy.CreateCatalogItem(\"Report\",$reportName,$reportFolder_Final, $IsOverwriteReport,$byteArray,$Properties,[ref]$warnings)\n\n\nIf i try reading the XML in as a string and then converting it back into a bytearray before uploading it to the ssrs server the upload fails as it complains about the formatting. I had plans of reading it in as a string, altering the datasource reference, encoding it and then uploading but thats the part i need your help with doing.\n\nCheers" ]
[ "powershell", "reporting-services", "encoding", "ssrs-2012" ]
[ "Cant output a variable after 2 try:()", "Here is my code:\n\ndef Serveur():\n\n import socket\n today = datetime.date.today()\n datename = str(today) + '.txt'\n serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n host = \"192.168.1.245\"\n port = 8000\n print (host)\n print (port)\n serversocket.bind((host, port))\n serversocket.listen(5)\n\n\n while True:\n (clientsocket, address) = serversocket.accept()\n print (\"Connection Reussie\")\n data = clientsocket.recv(1024).decode()\n print (data) + \" RECU PAR ETHERNET\"\n\n\n try:\n ver_file = open(datename, \"r\")\n for line in ver_file:\n if data in line:\n filtre = line[-13:]\n print filtre + \"MATCH TROUVE\"\n resultat = str(filtre)\n\n except:\n print (\"Pas de match de produit captures aujourdhui\")\n\n try:\n filtre_file = open(\"produit.txt\", \"r\")\n for line in filtre_file:\n if resultat in line:\n convoyeur = line[-2:]\n print convoyeur\n\n except:\n print (\"Erreur\")\n\n\n(Sorry if the indentation is bad, it messed up when I pasted it :( )\nSo my question is that my str convoyeur doesn't print at all! I dont know what is wrong in it!\n\nExample of data variable that is received is 123456789012 (12 Characters barcode on ethernet barcode scanner)\n\nExample of a line in produit.txt is:\n\n123456789012 A \n\n\n(The letter A is there for where the box need to go on a conveyor)" ]
[ "python", "capture", "verification" ]
[ "Sort nested python dictionary", "How to sort nested python dictionary items by their sub-values and save that dictionary items in descending order\nDescribing dictionary_____\nBefore sorted\n dict={\n "Bob": {"Buy": 25, "Sell": 33, "Quantity": 100}\n "Moli": {"Buy": 75, "Sell": 53, "Quantity": 300}\n "Annie": {"Buy": 74, "Sell": 83, "Quantity": 96}\n "Anna": "Buy": 55, "Sell": 83, "Quantity": 154}\n }\n\nI want to sort dictionary items in descending order by their sub- values(i.e: "Quantity") and the output should be like this:----\nAfter sorted\n dict={\n "Moli": {"Buy": 75, "Sell": 53, "Quantity": 300}\n "Anna": "Buy": 55, "Sell": 83, "Quantity": 154}\n "Bob": {"Buy": 25, "Sell": 33, "Quantity": 100}\n "Annie": {"Buy": 74, "Sell": 83, "Quantity": 96}\n }" ]
[ "python", "python-3.x", "dictionary" ]
[ "Android BroadcastReceiver handling multiple messages", "I wondered how BroadcastReceivers handle multiple message requests (broadcast intents). \n\nAssuming a BroadcastReceiver still processing a message/intent on the UI thread and at the same time another broadcast message(s) is/are fired from some other thread(s). Will the subsuquent broadcast messages be put into a queue or something?\n\nThx" ]
[ "android", "broadcastreceiver" ]