texts
sequence
tags
sequence
[ "Double quotes are no getting removed even after using org.apache.hadoop.hive.serde2.OpenCSVSerde", "I am having an external table with DDL as below :\n\nCREATE EXTERNAL TABLE pathirippilly_db.serdeTest (Name varchar(50),Job varchar(50),Sex varchar(4))\nROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'\nWITH SERDEPROPERTIES\n(\n \"separatorChar\" = \",\",\n \"quoteChar\" = \"\\\"\"\n)\nSTORED AS TEXTFILE\nlocation \"/user/pathirippilly/hive_data_external/serdeTest\";\n\n\nAfter creating the table with above DDL, I am inserting the data as below:\n\ninsert into serdetest values('\"AKHIL\"','Engineer','Male');\n\n\nBut still the double quotes are not getting escaped (not getting removed) even after opencsv serde is defined. So here are my question\n\n\nWhere I am going wrong\nSay If I am having multiple quoteChar to be escaped, for example, I need to remove both single and double quotes from my input data. How can I achieve this using opencsv serde.\nAs per Apache [https://cwiki.apache.org/confluence/display/Hive/CSV+Serde#CSVSerde-Usage][1]\neven if I have not defined the quoteChar and escapeChar, it should automatically pick double quotes with escape char as \"\\\" and should automatically remove double quotes from data. But why its not happening in my code" ]
[ "hive", "hive-serde" ]
[ "Cocos2D - removeChild not working", "In my app I've use the particle designer to produce an animation when bodies collide,\nthe code is....\n\n-(void)collision\n{\nfor (IceCream *iceCream in [iceDict allValues]) {\n if (CGRectIntersectsRect(iceCream.sprite.boundingBox, player.boundingBox)) {\n if(actualType == 0)\n {\n [self increaseLooseCounts];\n [self updateLives];\n }\n else{\n [self increaseWinCounts];\n [self updateLives];\n }\n\n //DEFINING THE PARTICLE ANIMATION\n\n particle = [CCParticleSystemQuad particleWithFile:@\"part.plist\"]; //alt plist working with rainbow.plist\n particle.position = ccp(iceCream.sprite.boundingBox.origin.x,iceCream.sprite.boundingBox.origin.y);\n [self addChild:particle z:2];\n [particle release];\n\n //CALLING SELECTOR TO END THE PARTICLE ANIMATION\n [self performSelector:@selector(killBlast) withObject:nil afterDelay:0.3f];\n\n\n int icecreamKey = iceCream.sprite.tag;\n [self removeChild:iceCream.sprite cleanup:YES];\n [iceDict removeObjectForKey:[NSNumber numberWithInt:icecreamKey]];\n\n }\n }\n}\n\n\n-(void)killBlast{\n [particle removeFromParentAndCleanup:YES]; \n}\n\n\nBut as soon as the killBlast is called the app crashes.\nPlease help !!" ]
[ "ios", "objective-c", "cocos2d-iphone" ]
[ "How to send HttpClient get method autorized in .NET Core", "i have to send a authorized request to a web api. It need an Username and a Password. I tried different methods but it does not work, here is my code so far:\n\npublic async Task<IActionResult> salutAsync(string id)\n{\n string Username = \"xxxxxxxxxxxxx\";\n string Password = \"xxxxxxxxxxxxx\";\n\n string baseUrl = \"someWebSite + id;\n\n HttpClient client = new HttpClient();\n var headerFormat = \"Username=\\\"{0}\\\", Password=\\\"{1}\\\"\";\n var authHeader = string.Format(headerFormat,\n Uri.EscapeDataString(Username),\n Uri.EscapeDataString(Password)\n );\n client.DefaultRequestHeaders.TryAddWithoutValidation(\"Authorization\", authHeader);\n using (HttpResponseMessage res = await client.GetAsync(baseUrl))\n using (HttpContent content = res.Content)\n {\n string data = await content.ReadAsStringAsync();\n if (data != null)\n {\n return Ok(data);\n }\n return BadRequest(data);\n }\n }\n\n\nIf i debug it, it says that my authHeader is \"Username=\\\"xxxxxxxxxxxxx\\\", Password=\\\"xxxxxxxxxxxxx\\\"\" and i dont know why it does not work\n\nAny help would be awesome! Thank you so much!" ]
[ "c#", "get", "httpclient" ]
[ "Laravel: get name from table users", "I need get the name field in user table\n\nMy method in the controller:\n\npublic function reviewsactivity()\n{\n $activity = Activity::orderBy('id', 'DESC')->paginate();\n $users = User::orderBy('id', 'ASC')->pluck('id', 'name');\n return view('reviews.reviewsactivity', compact('activity', 'users'));\n}\n\n\nAnd the view:\n\n @foreach($activity as $actividad)\n <tr>\n <td>{{ $actividad->description }}</td>\n <td>{{ $actividad->subject_type }}</td>\n <td>{{ $actividad->user->name }}</td>\n <td>{{ $actividad->causer_type }}</td>\n <td>{{ date('d-m-Y', strtotime($actividad->created_at)) }}</td>\n </tr>\n @endforeach\n\n\nThe field in the Activity table: causer_id\n\nAnd I have the next log:\n\n Trying to get property of non-object \n (View: C:\\laragon\\www\\tao\\resources\\views\\reviews\\reviewsactivity.blade.php)" ]
[ "php", "laravel", "pluck" ]
[ "CreateRadialplot with flip angle label", "I hope to flip angle the label. I use the popular functon CreateRadialplot to obtain a circular plot with ggplot2. Link to the site. Now i obtain this, look at the plot below.\n\nSomeone can help me with this function to flip angle of the labels rather than horizontal labels as showed here?\nsample code who called the function:\n\nvar.names <- c(\"All Flats\", \"No central heating\", \"Rooms per\\nhousehold\", \"People per room\", \n \"HE Qualification\", \"Routine/Semi-Routine\\nOccupation\", \"2+ Car household\", \n \"Public Transport\\nto work\", \"Work from home\")\nvalues.a <- c(-0.1145725, -0.1824095, -0.01153078, -0.0202474, 0.05138737, -0.1557234, \n 0.1099018, -0.05310315, 0.0182626)\nvalues.b <- c(0.2808439, -0.2936949, -0.1925846, 0.08910815, -0.03468011, 0.07385727, \n -0.07228813, 0.1501105, -0.06800127)\n\ngroup.names <- c(\"Blue Collar Communities\", \"Prospering Suburbs\")\nm2 <- matrix(c(values.a, values.b), nrow = 2, ncol = 9, byrow = TRUE)\ngroup.names <- c(group.names)\ndf2 <- data.frame(group = group.names, m2)\ncolnames(df2)[2:10] <- var.names\n\nCreateRadialPlot(group.line.width = df2, plot.extent.x = 1.5)```" ]
[ "r", "ggplot2" ]
[ "How do i dynamically populate an ion-select with an array which was selected from a previous ion-select", "So I'm getting an array of objects which are categories with attributes such as id, name and subccategory.\n\nI've used an *ngFor to populate the first ion-select and thats fine.\n\nI need to know how to populate the second ion-select with the subcatagories from selected category(First ion-select) \nIv tried to pass the selected value as an array but im obviously doing something wrong, please help!\n\n <ion-row class=\"filterItems\" color=\"primary\">\n <ion-label>Category</ion-label>\n <ion-select>\n <ion-select-option *ngFor=\"let catagory of catagories\">\n {{ catagory.category }}\n </ion-select-option>\n </ion-select>\n </ion-row>\n\n <ion-row>\n <ion-label>Sub Category</ion-label>\n <ion-select>\n <ion-select-option>{{Need the subcatagorys in here}} </ion-select-option>\n </ion-select>\n </ion-row>" ]
[ "angular", "typescript", "ionic-framework", "angular8", "ngfor" ]
[ "Proper children type when using Apollo hook in functional component written in TypeScript", "I wonder is there any good solution to add a proper type to the children property in functional component written in TypeScript.\nIt is part of my learning process and I cannot figure out how to solve it.\nSo I have two problems:\n\nline children: any; in QueryTypes interface; I have tried set here:\n\n\ntype (data: object) => void is causing below info:\n\n\n'Query' cannot be used as a JSX component.\nIts return type 'void | Element' is not a valid JSX element.\nType 'void' is not assignable to type 'Element | null'.\n\n\ntype ReactNode from 'react' is showing:\n\n\nThis expression is not callable.\nNo constituent of type 'string | number | boolean | {} | ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<...>)> | ReactNodeArray | ReactPortal' is callable.\n\n\nI tried to extend the QueryType interface from RouteComponentProps (imported from react-router-dom) but then I have the same results as above\ntype JSX.Element is occurring with:\n\n\nThis expression is not callable.\nType 'Element' has no call signatures.\n\n\nI don't know what is the proper type for data in CVDataType interface. And again.. I was playing with many types, eg object but is not solving the problems.\n\nI have written a simple example with three files to illustrate the mentioned problems with inline comments to show where is the problem with typing. You have to know that the code is working and showing correct results fetched from Strapi in that case.\n\nquery component (wrapper for GraphQL query)\n\nimport React from 'react';\nimport { useQuery } from '@apollo/react-hooks';\nimport { DocumentNode } from 'graphql';\n\ninterface QueryTypes {\n children: any; // <---- THIS IS THE FIRST PLACE WHERE I WANT TO ADD A PROPER TYPE\n query: DocumentNode;\n id: object | null;\n}\n\nconst Query = ({ children, query, id }: QueryTypes) => {\n const { data, loading, error } = useQuery(query, {\n variables: { id }\n });\n if (loading) return <p>Loading...</p>;\n if (error) return <p>Error: { JSON.stringify(error) }</p>;\n return children({ data }); // <---- THIS IS THE PLACE WHERE CHILDREN HAS WRONG TYPE IF TYPE IS NOT 'ANY'\n};\n\nexport default Query;\n\n\nGraphQL query file:\n\nimport gql from "graphql-tag";\n\nconst CVS_QUERY = gql`\n query cvs {\n cvs {\n id\n example_name\n example_city\n }\n }\n`;\n\nexport default CVS_QUERY;\n\n\nSimple functional component to display data:\n\nimport React from 'react';\nimport Query from './query';\nimport CVS_QUERY from '../queries/cv';\n\ninterface CVDataType {\n data: any; // <---- THIS IS THE SECOND PLACE WHERE I WANT TO ADD A PROPER TYPE\n}\n\ninterface CVTypes {\n id: string;\n example_name: string;\n example_city: string;\n}\n\nconst Example = () => {\n return (\n <Query query={ CVS_QUERY } id={ null }>\n {({ data: { cvs } }: CVDataType) => { // <---- PLACE WHERE DATA IS NOT WORKING WITH SOME OTHER TRIED TYPES; ONLY TYPE 'ANY' IS WORKING\n return (\n <div>\n {cvs.map((cv: CVTypes) => {\n console.log(cv); // <---- OUTPUT IS OK (example: {id: "5e062e", example_name: "John", example_city: "london", __typename: "Cv"})\n return (\n <div key={ cv.id }>\n <h3>{cv.example_name}</h3>\n <h4>{ cv.example_city }</h4>\n </div>\n );\n })}\n </div>\n );\n }}\n </Query>\n );\n};\n\nexport default Example;\n\nThanks for all the useful tips.\nPS. It's worth to mention that the simple app is using Next.js, Apollo (apollo-boost) and GraphQL" ]
[ "javascript", "reactjs", "typescript", "types", "typescript-typings" ]
[ "MongoDB Element name _id not valid (Update)", "I've been attempting to update a user through mongodb, and whenever I run the method it gives me back an exception.\n\nMongoDB.Bson.BsonSerializationException: Element name '_id' is not valid'.\n\n\nThe method I called was a unit test.\n\npublic void TestPutMethod()\n {\n UserEdit userEditSuccess = new UserEdit()\n {\n Password = \"newpassword\",\n Email = \"newemail\",\n FirstName = \"newfirstname\",\n Id = ObjectId.Parse(\"5828491d63b2a67418591517\")\n };\n\n IHttpActionResult httpActionResult = _controller.Put(userEditSuccess);\n OkNegotiatedContentResult<User> httpActioNResultCast = httpActionResult as OkNegotiatedContentResult<User>;\n\n Assert.IsInstanceOfType(httpActionResult, typeof(OkNegotiatedContentResult<User>));\n\n }\n\n\nThe unit test uses the put method which looks like this.\n\n[HttpPut]\n public IHttpActionResult Put(UserEdit userEdit)\n {\n\n if (userEdit.FirstName == null || userEdit.Email == null || userEdit.Password == null)\n return BadRequest(\"Incorrect input.\");\n {\n using (DataContext db = new DataContext())\n {\n User user = new User\n {\n FirstName = userEdit.FirstName,\n Email = userEdit.Email\n };\n\n byte[] password = Encoding.Unicode.GetBytes(userEdit.Password);\n\n byte[] salted = Password.CreateSalt();\n user.Salt = Encoding.Unicode.GetString(salted);\n\n byte[] passHash = Password.GernarateSaltedHash(password, salted);\n user.PassHash = Encoding.Unicode.GetString(passHash);\n db.Update(\"user\", i => i.Id == userEdit.Id, user);\n return Ok(user);\n }\n }\n }\n\n\nAnd the method the exception is thrown from is the update method that looks like this.\n\npublic void Update<T>(string collectionName, Expression<Func<T, bool>> filter, T obj)\n {\n Update(GetCollection<T>(collectionName), filter, obj);\n }\n\n\nI've already added attributes for the User class and the UserEdit class which looks like this.\n\npublic class UserEdit\n{\n [BsonId, BsonRepresentation(BsonType.ObjectId)]\n public ObjectId Id { get; set; }\n public string FirstName { get; set; }\n public string Email { get; set; }\n public string Password { get; set; }\n}\n\n\nAnd this.\n\npublic class User\n{\n [BsonId]\n [BsonRepresentation(BsonType.ObjectId)]\n public ObjectId Id { get; set; }\n public string FirstName { get; set; }\n public string Email { get; set; }\n [IgnoreDataMember]\n public string PassHash { get; set; }\n [IgnoreDataMember]\n public string Salt { get; set; }\n\n\nIf anyone here knows what's going wrong or you are in need of additional information please let me know.\n\nUpdate : GetCollection was asked to be explained, it looks like this.\n\n_database = client.GetDatabase(\"campanion\");\n\npublic IMongoCollection<T> GetCollection<T>(string name)\n {\n return _database.GetCollection<T>(name);\n }\n\n\nAnd it's basically returning a collection from the database with whatever name input I give it." ]
[ "mongodb", "exception", "serialization" ]
[ "Searching functionality with autocomplete address for google maps in my application", "I am implementing my application , the requirement is I need to search locations in autocomplete textview while I typing in that view the list with those keywords has to bind to that text view and once I click on that text the location marker has to show the location on google map. please help me out" ]
[ "android" ]
[ "Any way to make rack-livereload run faster?", "I am using rack-livereload on Windows using ruby_gntp. Currently it takes 5 seconds from I save a CSS file to I see the result in browser. 5-seconds is actually a longer time than it takes for manual refreshing the page.\n\nAny way to make rack-livereload run faster?" ]
[ "ruby-on-rails", "ruby" ]
[ "How to keep if condition to check the browser is IE in extjs?", "I have a requirement to check if application is opened using IE then my code should execute or else no..here is sample code..\n\n xtype: 'panel',\n\n header: true,\n if(browser == ie){\n height: 160,\n }\n height: 150\n width: 355,\n layoutConfig: {\n align: 'center',\n padding: 10\n },\n\n\nThanks,\n\nRajasekhar" ]
[ "extjs" ]
[ "Google Drive SDK Sample PHP Exception", "Hi i try to set up the Google code sample for the Google Drive Api following those steps:\nhttps://developers.google.com/drive/examples/php\n\nBut i got an exception when i try the authentication :\n\n\n exception 'apiAuthException' with message 'Error fetching OAuth2\n access token, message: 'redirect_uri_mismatch'\n\n\nAny idea if i could have miss something in the config process?\n\nThank you" ]
[ "php", "google-drive-api" ]
[ "How to increase the width of PdfPTable in itext Pdf", "I am trying to export records from database into pdf using itext pdf library in java..But i am getting following problems in alignment of pdf table inside pdf file..\n\n1.Table is not showing in the full pdf page .It is leaving spaces from left and right of the pdf page.\n\n2.Every page is showing values in half of the page only .Means pdf table is showing in half of the pdf pages..\n\nHere is my code..\n\nDocument document = new Document();\n PdfWriter.getInstance(document, fos);\n\n\n PdfPTable table = new PdfPTable(10);\n\n table.setWidthPercentage(100);\n table.setSpacingBefore(0f);\n table.setSpacingAfter(0f);\n\n\n\n PdfPCell cell = new PdfPCell(new Paragraph(\"DateRange\"));\n\n cell.setColspan(10);\n cell.setHorizontalAlignment(Element.ALIGN_CENTER);\n cell.setPadding(5.0f);\n cell.setBackgroundColor(new BaseColor(140, 221, 8));\n\n table.addCell(cell);\n\n table.addCell(\"Calldate\");\n table.addCell(\"Calltime\");\n table.addCell(\"Source\");\n table.addCell(\"DialedNo\");\n table.addCell(\"Extension\");\n table.addCell(\"Trunk\");\n table.addCell(\"Duration\");\n table.addCell(\"Calltype\");\n table.addCell(\"Callcost\");\n table.addCell(\"Site\");\n\n while (rs.next()) {\n table.addCell(rs.getString(\"date\"));\n table.addCell(rs.getString(\"time\"));\n table.addCell(rs.getString(\"source\"));\n table.addCell(rs.getString(\"destination\"));\n table.addCell(rs.getString(\"extension\"));\n table.addCell(rs.getString(\"trunk\"));\n table.addCell(rs.getString(\"dur\"));\n table.addCell(rs.getString(\"toc\"));\n table.addCell(rs.getString(\"callcost\"));\n table.addCell(rs.getString(\"Site\"));\n }\n\n\n\n\n table.setSpacingBefore(5.0f); // Space Before table starts, like margin-top in CSS\n table.setSpacingAfter(5.0f); // Space After table starts, like margin-Bottom in CSS \n\n document.open();//PDF document opened........ \n\n document.add(Chunk.NEWLINE); //Something like in HTML :-)\n\n document.add(new Paragraph(\"TechsoftTechnologies.com\"));\n document.add(new Paragraph(\"Document Generated On - \" + new Date().toString()));\n\n document.add(table);\n document.add(Chunk.NEWLINE); //Something like in HTML :-) \n document.newPage(); //Opened new page\n //In the new page we are going to add list\n\n document.close();\n\n fos.close();" ]
[ "java", "pdf", "itext" ]
[ "Application not present in developer list and in search", "last weekend I released a new application but it is not yet present in the search result nor in the developer list.\n\nIf I access it via direct package url it works fine\n\nhttps://play.google.com/store/apps/details?id=net.luxteam.sacal\n\nbut if I click on the developer name, leading to\n\nhttps://play.google.com/store/apps/developer?id=Massimiliano+Cannarozzo\n\nit's not present.\n\nDo you have any idea?\n\nEDIT:\nApplication now present in both search and developer page." ]
[ "android", "google-play" ]
[ "naming conventions for DynamoDB?", "Background: I'm creating kind of simplified pseudo-ORM for use in Django. Classes obviously use CamelCase convention, while Django app is underscored lowercase. Which leaves me with a few options:\n\n\nDjango ORM style: app_name_someclass\nproper underscore style: app_name_some_class\nas-is: app_name.SomeClass\npossibly some other using different separators etc. \n\n\nAre there any well established naming conventions for DynamoDB? \nSo far, from what I've seen in examples, it seems that it's free-for-all." ]
[ "django", "amazon-web-services", "amazon-dynamodb" ]
[ "Can't get out of recursive in reflex-dom", "The code compiles but when run gets stuck in infinite recursive loop. It's not obvious where the loop enters, especially when using recursive do or monadfix. When trying to debug in the browser it finds cyclic evaluation in fixIO at rts.js line 6086\n\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RecursiveDo #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n{-# LANGUAGE MonoLocalBinds #-}\n\nimport Reflex.Dom\nimport qualified Data.Text as T\n\nmain :: IO ()\nmain = mainWidget game\n\ngame :: MonadWidget t m => m ()\ngame = elClass \"div\" \"game\" $ do\n elClass \"div\" \"game-board\" $ do\n rec\n stateEv <- board stateEv [[\"\",\"\",\"\"],[\"\",\"\",\"\"],[\"\",\"\",\"\"]]\n elClass \"div\" \"game-info\" $ do\n elClass \"div\" \"statu\" $ blank\n elClass \"ol\" \"todo\" $ blank\n\nboard :: MonadWidget t m\n => [[Event t T.Text]]\n -> [[T.Text]]\n -> m [[(Event t T.Text)]]\nboard s iss = elClass \"div\" \"board\" $ do\n el \"div\" $ do\n elClass \"div\" \"status\" $ text \"Next player: X\"\n mapM (boardRow s) iss\n\nboardRow :: MonadWidget t m\n => [[Event t T.Text]]\n -> [T.Text]\n -> m [(Event t T.Text)]\nboardRow s is = elClass \"div\" \"board-row\" $ mapM (square s) is\n\nsquare :: (\n PostBuild t m\n , DomBuilder t m\n , MonadHold t m\n )\n => [[Event t T.Text]]\n -> T.Text\n -> m (Event t T.Text)\nsquare stateEv i = do\n rec\n let ev = domEvent Click e\n ev' = updated dyn\n ev'' = tagPromptlyDyn dyn ev\n dyn = tooglePlayer <$> dynBool\n\n dyns <- mapM (holdDyn i) (concat stateEv)\n dynBool <- toggle True $ updated $ distributeListOverDyn dyns\n\n (e, _) <- elAttr' \"button\" (\"type\" =: \"button\" <> \"class\" =: \"square\") $ dynText dyn\n return ev''\n\ntooglePlayer :: Bool -> T.Text\ntooglePlayer True = \"X\"\ntooglePlayer False = \"O\"" ]
[ "haskell", "reflex-dom" ]
[ "What JS event fired on input field when iOS 8 \"Scan credit card\" feature is used?", "I'm wondering is there any JS event triggered on input field when I'm scanning my credit card? Currently I tried keyup, change, paste but none of them were fired. And no information found in Google about that. Any help appreciated." ]
[ "javascript", "safari", "ios8" ]
[ "overriding ActiveRecord.save to read in property before save", "I have this in my object's save\n\nclass UploadFile < ActiveRecord::Base\ndef save\n dir = 'public/data'\n path = File.join(dir, 'nfile')\n\n from = contents.path\n contents = `cat #{from}`\n super\nend\n\n\nend\n\ncontents stores a file object from a multi-part form submit.\n\nThis is very quick and dirty (yes I know cat #{from} is probably not a good idea). Why is it that after super is called contents is # and not the contents of the file?\n\nThanks." ]
[ "ruby-on-rails", "ruby" ]
[ "Spring Hibernate Vs jdbc template vs spring orm", "We have a project with MySQL database and Spring as the framework. I am very new to Spring and looking to implement the database access layer and found that there are several options available, like\n\n\nUsing Spring + Hibernate\nUsing Spring JDBC Template\nUsing Spring ORM Module\n\n\nI have gone through the various posts in stackoverflow and did a bit of research on the web, but every question had different answers supporting different options. Also, I did see a mention about Spring JDBC template not being recommended now. \n\nThe application might have approximately 1000 transactions per hour and have 60% reads and 40% writes, approximately.\n\nCan anyone help me in finding an answer as to which of the 3 options is suitable and why ?\nOr, if you can point me to some resources, that would be highly appreciated as well." ]
[ "hibernate", "spring-data", "spring-orm" ]
[ "How to initialize values to two or more variables by calling another procedure using sql server?", "say this procedure have to be called\n\nselect @className = Name \nfrom dbo.ClassNames\nwhere id=@classId\n\nselect @sectionName = SectionName \nfrom dbo.ClassSections\nwhere id=@sectionId\n\nselect @className as 'Class Name',@sectionName as 'Section Name'\n\n\nthe other procedure is:\n\ndeclare @className nvarchar(50),\n@sectionName nvarchar(50)\n\nEXEC [dbo].[testAll]\n @regNo=@regNo\n\n\nso how to assing value to @className and @classSection by calling the above procedure???" ]
[ "sql", "stored-procedures" ]
[ "When building C with dintuils getting cannot find -ltcl83", "I'm following this Building C Extensions with distutils. I have written my demo.c program to build with python.\n\ndemo.c\n\n#include <stdio.h>\n\nint main()\n{\n int number;\n printf(\"Enter an integer:\\n\");\n scanf(\"%d\", &number);\n printf(\"You entered Output: %d\\n\", number);\n return 0;\n\n\n}\n\nI'm following the step mentioned in Build C page with the following commands:\n\ngcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DMAJOR_VERSION=1 -DMINOR_VERSION=0 -I/usr/local/include -I/usr/local/include/python2.7 -c demo.c -o build/temp.linux-x86_64-2.7/demo.o\n\ngcc -shared build/temp.linux-x86_64-2.7/demo.o -L/usr/local/lib -ltcl83 -o build/lib.linux-x86_64-2.7/demo.so\n\n\nWhen I'm executing the second getting the following error:\n\n /usr/bin/ld: cannot find -ltcl83\n collect2: ld returned 1 exit status\n\n\nI'm not able to import the demo in the python interpreter." ]
[ "c", "python-2.7" ]
[ "Create own (custom) modifier in MaxScript", "I want to create my own modifier for the object.\nSo when I select the object, go to Modify Panel and expand the list of modifiers, myModifier will shows up.\n\nWhat would be the simples way?" ]
[ "maxscript" ]
[ "Refresh Events In Angular Calendar UI (Fullcalendar) With Laravel As A Backend", "I am trying to make an automated refresh calendar. I am using Calendar UI and i am getting data from my backend in this way \n\n /**Calendar Config***/\n //config object\n $scope.uiConfig = {\n calendar:{\n height: 500,\n width: 800,\n editable: false,\n //First Hour\n firstHour: 8,\n //Devide by half hour\n slotMinutes: 30,\n //default duration 01:30\n defaultEventMinutes: 90,\n axisFormat: 'HH:mm',\n timeFormat: {\n agenda: 'H:mm{ - H:mm}'\n },\n header:{\n //Buttons\n center: 'month agendaWeek agendaDay',\n left: 'title',\n right: 'today prev,next'\n },\n defaultView: 'agendaWeek'\n }\n };\n\n //Get planings By Group\n $scope.getPlaningsByGroup = function(groupId){\n planing.getPlaningsByGroup(groupId)\n .success(function(data){\n //Populate the event object\n $scope.populatePlan(data);\n });\n }\n\n //Populating the plan\n $scope.events = [];\n $scope.populatePlan = function(plans){\n plans.forEach(function(plan){\n start_time = moment.duration(plan.start_time);;\n duration = moment.duration(plan.course.duration);\n start_course = moment()\n .day(plan.day)\n .hour(start_time.hours())\n .minutes(start_time.minutes())\n .seconds(start_time.seconds())\n .format(\"YYYY-MM-DDTHH:mm:ss\");\n\n\n\n end_time = start_time.add(duration);\n end_course = moment()\n .day(plan.day)\n .hour(end_time.hours())\n .minutes(end_time.minutes())\n .seconds(end_time.seconds())\n .format(\"YYYY-MM-DDTHH:mm:ss\");\n\n console.log(end_course);\n\n $scope.events.push(\n {\n id:plan.id,\n title:plan.course.title,\n start:start_course,\n end :end_course,\n allDay:false,\n }\n );\n\n\n });\n }\n //Event Source object\n $scope.eventSources = [$scope.events];\n\n\nI don't know if it is the wierdest way to do it but i am still a babe at angular js so please excuse this crime scene ^^ . i did a little reasearch and i decided to go with $interval provider to refresh the events. and here is the problems that i faced after trying:\nTry 1 : \n//Refresh events\n var refresh = function(){\n $('#calendar').fullCalendar('rerenderEvents');\n console.log(\"refreshed\");\n }\n $interval(refresh, 3000);\n refresh();\n\nBasically this did nothing \nTry 2 :\n//Refresh events\n var refresh = function(){\n $scope.events.length = 0;\n $scope.getPlaningsByGroup($scope.student.group_id);\n console.log(\"refreshed\");\n }\n $interval(refresh, 3000);\n refresh();\n\nAnd this worked but i know that this is a suicide attempt to the backend.\nMy Question is how to solve this madness. \nThanks" ]
[ "angularjs", "laravel", "fullcalendar", "angular-ui" ]
[ "How to handle Django dynamic in front end?", "I have a Django form class which generates dynamic form fields to the front end. I want to perform operations such as enable, disable, hide, display etc.. by using java script.simply I want take control of the django dynamic form js.\n\nThis is my django form\n\nclass SetFeatureForm(forms.Form):\n\n def __init__(self, project=None, *args, **kwargs):\n\n super(SetFeatureForm, self).__init__(*args, **kwargs)\n if project:\n choices = [(column,column) for column in pd.read_csv(project.file.path).columns]\n self.fields['feature'] = forms.MultipleChoiceField(choices=choices, required=True, )\n self.fields['feature'].widget.attrs['size']=len(choices)\n for _,choice in choices:\n self.fields[choice] = forms.ChoiceField( choices=DATA_TYPE.items())\n\n\nIs there any way to do that?" ]
[ "javascript", "python", "jquery", "django", "django-forms" ]
[ "Does PushSharp allow for sending notifications to GCM for iOS?", "I need to send push notifications to an app that will be on both iOS and Android. GCM now allows the ability to send push notifications to both platforms. Does PushSharp support this, since it supports sending messages directly to GCM?" ]
[ "c#", "android", "ios", "push-notification", "pushsharp" ]
[ "Filter on \"include\" - Rails 3", "these are my associations:\n\nclass Activity < ActiveRecord::Base\n\n has_many :infos, :dependent => :destroy\n has_many :events, :dependent => :destroy\n accepts_nested_attributes_for :infos\n\nend\n\nclass Event < ActiveRecord::Base\n\n belongs_to :activity\n has_many :infos, :through => :activity\n\nend\n\nclass Info < ActiveRecord::Base\n\n has_one :language\n belongs_to :activity\n\nend\n\n\nNow i can get an XML with all the events and their infos using:\n\n@events = Event.all\n\nrespond_to do |format|\n format.xml { render :xml => @events.to_xml(:include => [:infos ]) }\nend\n\n\nThe problem is that i get the infos from all the language.\n\nIs it possible to use a filter (as \"where info.language.id==1\"), so that only the language1 infos are displayed in the XML for each event?\n\nThanks\n\nUPDATE :\n\nHi Mike, thanks for your answer.\n\nUnfortunately i'm getting this error:\n\n\n undefined method `eq' for nil:NilClass\n Rails.root: /Users/abramo/village\n \n Application Trace | Framework Trace |\n Full Trace\n app/controllers/events_controller.rb:29:in\n block (2 levels) in locale'\n app/controllers/events_controller.rb:28:in\n locale'\n\n\nand lines 28,29 are the last line of my locale method:\n\n def locale\n @events = Event.joins(:infos => :language).where(\"languages.id = 2\")\n\n respond_to do |format|\n format.xml { render :xml => @events.to_xml(:include => [:infos ]) }\n end\n end\n\n\nI really don't understand... what object is Nil?" ]
[ "ruby-on-rails" ]
[ "Tracking a specific points' x & y position on an image during rotation in Java", "I'm trying to create rope physics for a 2D game, so as a starting point I have a small rotating image and I need to add another piece of rope to the end of it. Unfortunately I'm having trouble trying to track the bottom part of the image as the rotation occurs at the top of it. I've managed to track the (0,0) coordinate of the image using the following code but I need to be able to track point (32,57). This is what I have so far:\n\nxr = xm + (xPos - xm) * Math.cos(a) - (yPos - ym) * Math.sin(a);\nyr = ym + (xPos - xm) * Math.sin(a) + (yPos - ym) * Math.cos(a);\n\n\nAny help is appreciated!\n\nEDIT:\n\nSo hey, I got it working =D Using polar coordinates turned out to be a lot easier then whatever I had going on before.\n\nThe top 2 variables are constant and stay the same:\n\n theta0 = Math.atan2(y, x);\n r = 25;\n\n theta = theta0 + a;\n xr = (r * Math.cos(theta)) + xm;\n yr = (r * Math.sin(theta)) + ym;\n\n\nxm and ym are the positions of my image." ]
[ "java", "matrix", "rotation" ]
[ "Using NSUserDefaults to save keystroke from a UITextView Popover", "I have a popover named NotesViewController which contains a UITextView. The popover happens when a user clicks on the Notes button in the GraphViewController. \n\nThe popover appears fine but the text in the UITextField disappears whenever I click off the popover and I want to be able to save it. \n\nExamples of how to save the text either after each keystroke or when the user clicks off of the popover would also work as an answer!!\n\nHere is what I have:\n\nclass NotesViewController: UIViewController\n{\n @IBOutlet weak var noteView: UITextView! {\n didSet{\n defaults.setObject(noteView.text, forKey: \"previousText\")\n noteView.text = notes\n }\n}\n\nvar notes = \" \" {\n didSet {\n noteView?.text = notes\n\n }\n}\n\nlet defaults = NSUserDefaults.standardUserDefaults()\n\nclass GraphViewController: UIViewController, GraphViewDataSource, UIPopoverPresentationControllerDelegate\n{\n //\n //...\n // prepare segue for popover\n override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {\n if let identifier = segue.identifier {\n switch identifier {\n //this is the identifier for the popover segue\n case \"Show Notes\":\n if let nvc = segue.destinationViewController as? NotesViewController {\n if let ppc = nvc.popoverPresentationController {\n ppc.delegate = self\n }\n\n if let previousNotes = nvc.defaults.stringForKey(\"previousText\") {\n nvc.notes = previousNotes\n }\n }\n default: break\n }\n }\n }\n}" ]
[ "ios", "swift", "uitextview", "popover" ]
[ "How to show gmail inserted images in my webpage", "I am using mailgun. now i am sending mail from gmail to my domain. using mailgun api i am getting that and showing that content in my webpage. but when i am adding images in middle of the text or in signature of the mail image is not showing in webpage. it is just showing broken image because it is showing like this:\n\n<img width=\"375\" height=\"134\" src=\"cid:ii_i2davb0f0_1499f1c3646e87a5\">\n\n\nHow can i show these images in web page?" ]
[ "php", "email", "attachment", "mailgun" ]
[ "How to post JSON to a URL using the Servoy Framework", "The Servoy Framework does not support standard methods of calling a URL (eg: AJAX, JQuery, etc.). How does one go about posting a JSON object to a URL?" ]
[ "frameworks" ]
[ "Identify rows where time difference is insufficient SQL Server 2008 R2", "I have reviewed and tried numerous codes samples on the site but am no closer to solving my problem. I think is partly due to my coding skills and partly a limitation of SQL Server 2008R2 lack of LAG. \n\nMy table Clock__Times has tens of thousands of rows with these columns:\n\nEMP_NO, ACCOUNT_DATE, IN_STAMP, OUT_STAMP\n\n\nA row is added when the clock out activity occurs. Potentially multiple rows can be added for a given employee each day. I need to identify rows and count the occasions for an employee within a given time span (ACCOUNT_DATE BETWEEN D1 & D2) when the time between clock out time (OUT_STAMP) and the next clock in time (IN_STAMP) for that employee is less than X hours but greater than Y hours. \n\nI have tried a variety of JOINs but they are always wrong as I have to compare the OUT_STAMP on one row with the IN_STAMP of the next row added for the same employee. \n\nThe Y value is to avoid clock in and out activity over lunch and would probably have a value of say 2 hours. The X value is to identify employees who do not get sufficient time off between shifts say 10 hours.\n\nI will eventually have to scale this up to identify all employees who within a period of time have had insufficient time off." ]
[ "sql-server", "date", "sql-server-2008-r2" ]
[ "Parsing a \"hierarchical\" URL with regexes if there are splits in parsing logic", "Is there any way to adjust the remaining regex pattern to what have been already matched? A rough sketch to illustrate the idea:\n\n pattern\n / | \\\n / | \\\nprefix1 prefix2 prefix3\n | | |\npostfix1 postfix2 postfix3\n\n\nThis is a rather theoretical question; the practical application below is only for illustrative purposes.\n\nI'm trying to find the first URLs to popular code hosting platforms, like github, gitlab etc., in a large text. The problem is, all platforms have different URL patterns:\n\ngithub.com/<user>/<repo>\ngitlab.com/<group1>/<group2>/.../<repo>\nsourceforge.net/projects/<repo>\n\n\nI can use lookbehind expressions, but then the expression gets really monstrous (Python re):\n\npattern = re.compile(\n r\"(github\\.com|bitbucket\\.org|gitlab\\.com|sourceforge\\.net)/\"\n # middle part - empty for all except sourceforge\n r\"(?:(?<=github\\.com/)|(?<=bitbucket\\.org/)|(?<=gitlab\\.com/)|\"\n r\"(?<=sourceforge\\.net/)projects/)(\"\n # final part, the repository pattern\n r\"(?<=github\\.com/)[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+|\"\n r\"(?<=bitbucket\\.org/)[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+|\"\n r\"(?<=gitlab\\.com/)[a-zA-Z0-9_.-]+(?:/[a-zA-Z0-9_.-]+)+|\"\n r\"(?<=sourceforge\\.net/projects/)[a-zA-Z0-9_.-]+\"\n r\")\")\n\n\nIs there a more elegant way to do something like this?" ]
[ "python", "regex", "url-parsing" ]
[ "Spring Data Elastic Search Nested Field and NativeSearchQueryBuilder.withFields", "I can't seem to get Nested Fields to return when I use the NativeSearchQueryBuilder.withFields(...) method.\n\nHere is my parent Object:\n\n@Document(indexName = \"inventory\")\npublic class Inventory\n{\n @Id\n private String id;\n @Field(type=FieldType.String)\n private String name;\n @Field(type=FieldType.Nested, index=FieldIndex.not_analyzed, store=true)\n private List<Model> models;\n}\n\n\nAnd here is the nested Object:\n\npublic class Model\n{\n @Field(type=FieldType.String, index=FieldIndex.not_analyzed, store=true)\n private String model;\n @Field(type=FieldType.String, index=FieldIndex.not_analyzed, store=true)\n private Set<String> series;\n}\n\n\nAnd the Query\n\nNativeSearchQueryBuilder nativeSearchQueryBuilder = new NativeSearchQueryBuilder();\nnativeSearchQueryBuilder.withQuery(QueryBuilders.matchAllQuery());\nnativeSearchQueryBuilder.withFields(\"models.series\");\nNativeSearchQuery nativeSearchQuery = nativeSearchQueryBuilder.build();\nFacetedPage<Inventory> results = inventoryRepository.search(nativeSearchQuery);\n\n\nResulting TotalElements = 529\nBut each Object in the Content Looks like this (in JSON format):\n\n{\n \"id\":\"d5f82880-15bc-45ed-8abb-ff97d0e45da9\",\n \"name\": null,\n \"models\": null\n}\n\n\nIf I remove the withFields(...) setting, I get back:\n\n{\n \"id\":\"d5f82880-15bc-45ed-8abb-ff97d0e45da9\",\n \"name\": \"Cool Beans\",\n \"models\": [\n {\n \"model\" : \"foo\",\n \"series\" : [\"bar\"]\n }\n ]\n}\n\n\nI've tried models, models.model, models.series, model, series. I can't get withFields working with NestedFields.\n\nAny thoughts?" ]
[ "java", "elasticsearch", "spring-data-elasticsearch" ]
[ "How to manipulate Firebase data to assign to my model?", "**Model:**\n\nexport interface User {\n $key?: string;\n firstname: string;\n lastname: string;\n id: number;\n age: number;\n}\n\n**Angular service:**\n\npublic fetchAvailableUsers(): void {\n this.firebaseSubscriptions.push(this.db.collection('users')\n .snapshotChanges()\n .pipe(\n map(docArray => {\n return docArray.map(\n return {\n $key: doc.payload.doc.id,\n ...doc.payload.doc.data()\n };\n });\n })\n )\n .subscribe((users: User[]) => {\n this.store.dispatch(new fromUser.SetUsers(users));\n }, error => {\n ...\n }));\n }\n\n**Error:**\n\nArgument of type '(users: User[]) => void' is not assignable to parameter of type '(value: { $key: string; }[]) => void'.\nTypes of parameters 'users' and 'value' are incompatible.\nType '{ $key: string; }[]' is not assignable to type 'User[]'.\nType '{ $key: string; }' is not assignable to type 'User'.\nProperty 'firstname' is missing in type '{ $key: string; }'.\n\n\nI've tried so many ways for hours to get around it but I keep getting this error. I can't get the returned data type from firebase observable to match my model. How do I fix it?" ]
[ "javascript", "angular", "firebase", "rxjs", "angularfire2" ]
[ "Storing C# datetime to postgresql TimeStamp", "I'm working on an app that stores data in a spreadsheet to a Postgresql database. I'm familiar with C# and .Net but not so well with Postgresql. I'm having trouble storing a DateTime value into a TimeStamp column; I keep getting an error message: Failed to convert parameter value from a DateTime to a Byte[]. Any advice would be appreciated.\n\nstring query = \"INSERT INTO organizer(organizer_name, contact_name, phone, alt_phone, created_date, last_update) \" +\n \"VALUES('@name', '@contactname', '@phone', '@altphone', '@created', '@updated')\";\n\n OdbcCommand cmd = new OdbcCommand(query, con);\n cmd.Parameters.Add(\"@name\", OdbcType.VarChar);\n cmd.Parameters[\"@name\"].Value = org.Name;\n\n cmd.Parameters.Add(\"@contactname\", OdbcType.VarChar);\n cmd.Parameters[\"@contactname\"].Value = org.ContactName;\n\n cmd.Parameters.Add(\"@phone\", OdbcType.VarChar);\n cmd.Parameters[\"@phone\"].Value = org.Phone;\n\n cmd.Parameters.Add(\"@altphone\", OdbcType.VarChar);\n cmd.Parameters[\"@altphone\"].Value = org.AltPhone;\n\n cmd.Parameters.Add(\"@created\", OdbcType.Timestamp).Value = DateTime.Now;\n\n cmd.Parameters.Add(\"@updated\", OdbcType.Timestamp).Value = DateTime.Now;\n\n con.Open();\n cmd.ExecuteNonQuery();" ]
[ "c#", "postgresql" ]
[ "Indexed GL_TRIANGLES vs. indexed GL_TRIANGLE_STRIP", "There has been quite a buzz about rendering performance between indexed triangles or triangle strips. But I believe there is a case that has not been considered enough.\n\nIndexed triangles are rendered like this in OpenGl:\n\nglDrawElements(GL_TRIANGLES, ...);\n\n\nBut for some reason a lot of people consider rendering strips only in this way:\n\nglDrawArrays(GL_TRIANGLE_STRIP, ...);\n\n\nOut there there are some very good indexers (Forsyth, Tipsify to name a few) that optimize your mesh to be convenient for the GPU transform cache to be rendered in GL_TRIANGLES mode. Ideally they can achieve like 0.5 rendered vertices per triangle or something like that.\n\nBut why not doing this?\n\nglDrawElements(GL_TRIANGLE_STRIP, ...);\n\n\nI mean, you combine the low index bandwidth of strip rendering with the efficient GPU transform cache usage that the above indexers provide. With few modifications, am I right in saying that a strip indexer that optimizes the strip to be also Tcache-friendly can be a good idea?\n\nProbably it won't reach the 0.5 goal, but at least a 0.6 perhaps? Also, don't forget the massive index bandwidth gain (potentially one third against GL_TRIANGLES)." ]
[ "performance", "opengl", "gpu", "gl-triangle-strip" ]
[ "I cannot get this code to line up underneath the headers", "I have to get my output to line up beneath a heading. No matter what I do, I cannot get to line up. The item name is very long also, and the words end up wrapping to the next line when I open my outfile. Here is my current output:\n\n8 items are currently available for purchase in Joan's Hardware Store.\n----------Joan's Hardware Store-----------\nitemID itemName pOrdered pInStore pSold manufPrice sellPrice\n 1111 Dish Washer 20 20 0 250.50 550.50\n\n 2222 Micro Wave 75 75 0 150.00 400.00\n\n 3333 Cooking Range 50 50 0 450.00 850.00\n\n 4444 Circular Saw 150 150 0 45.00 125.00\n\n 5555 Cordless Screwdriver Kit 10 10 0 250.00 299.00\n\n 6666 Keurig Programmable Single-Serve 2 2 0 150.00 179.00\n\n 7777 Moen Chrome Kitchen Faucet 1 1 0 90.00 104.00\n\n 8888 Electric Pressure Washer 0 0 0 150.00 189.00\nTotal number of items in store: 308\nTotal inventory: $: 48400.0\n\n\nHere is my code:\n\npublic void endOfDay(PrintWriter outFile)\n {\n outFile.println (nItems + \" items are currently available for purchase in Joan's Hardware Store.\");\n outFile.println(\"----------Joan's Hardware Store-----------\");\n\n outFile.printf(\"itemID, itemName, pOrdered, pInStore, pSold, manufPrice, sellPrice\"); \n for (int index = 0; index < nItems; index++)\n {\n\noutFile.printf(\"%n %-5s %-32s %d %d %d %.2f %.2f%n\", items[index].itemID , items[index].itemName , items[index].numPord ,items[index].numCurrInSt , items[index].numPSold , items[index].manuprice , items[index].sellingprice);\n }\n outFile.println(\"Total number of items in store: \" + getTotalOfStock());\n outFile.println(\"Total inventory: $: \" + getTotalDollarValueInStore());\n } // end endOfDay\n\n\nThanks for any help! I have tried many things for hours!!" ]
[ "java", "formatting", "hardware", "store", "printwriter" ]
[ "I need help to understand these assembly instructions", "I found this asm instructions who push a parameter into the stack before a call, but i think there is some useless instructions.\n\nmov eax,esi\nneg eax\nsbb eax,eax\nlea ecx,[esp+10h]\nand eax,ecx\npush eax\n\n\nCan i just replace theses instructions with the following:\n\nlea ecx,[esp+10h]\npush ecx" ]
[ "assembly" ]
[ "Feathers Authentication via POST works but socket doesn't", "Here is a repo showing my latest progress, and here is my configuration. As it stands that repo now doesn't even authenticate with REST - although I think something is wrong with socket auth that needs to be looked at.\n\n\n\nI configured feathers, was able to create a user REST-fully with Postman, and even get an auth token (I can post to /authenticate to get a token, and then verify that token - yay postman! yay REST api!).\n\nBut in the browser the story ain't so happy. I can use find to get data back, but authenticate just gives me errors.\n\nIn my googling I found this post and updated my client javascript to be this. I have also tried doing jwt auth with the token from postman, but that gives the same Missing Credentials error. Halp!\n\nCode incoming...\n\n\n\napp.js (only the configuration part to show order)\n\napp.configure(configuration(path.join(__dirname, '..')))\n .use(cors())\n .use(helmet()) // best security practices\n .use(compress())\n .use(favicon(path.join(app.get('public'), 'favicon.ico')))\n .use('/', feathers.static(app.get('public')))\n .configure(socketio())\n .configure(rest())\n .configure(hooks())\n .use(bodyParser.json())\n .use(bodyParser.urlencoded({ extended: true }))\n .configure(services) // pull in all services from services/index.js\n .configure(middleware) // middleware from middleware/index.js\n .hooks(appHooks)\n\n\nWithin services, I first add authentication, which is in its own file and that looks like this\nauthentication.js\n\nconst authentication = require('feathers-authentication');\nconst jwt = require('feathers-authentication-jwt');\nconst local = require('feathers-authentication-local');\nconst authManagement = require('feathers-authentication-management');\n\nmodule.exports = function () {\n\n const app = this;\n const config = app.get('authentication');\n\n // Set up authentication with the secret\n app.configure(authentication(config));\n app.configure(authManagement(config));\n app.configure(jwt());\n app.configure(local(config.local));\n\n // The `authentication` service is used to create a JWT.\n // The before `create` hook registers strategies that can be used\n // to create a new valid JWT (e.g. local or oauth2)\n app.service('authentication').hooks({\n before: {\n create: [\n authentication.hooks.authenticate(config.strategies)\n ],\n remove: [\n authentication.hooks.authenticate('jwt')\n ]\n }\n });\n\n\n};\n\nindex.html (mostly stripped, just showing relevant script)\n\nlet url = location.protocol + '//' + location.hostname + \n (location.port\n ? ':' + location.port\n : '');\n\nconst socket = io(url);\n\nconst feathersClient = feathers()\n .configure(feathers.socketio(socket))\n .configure(feathers.hooks())\n .configure(feathers.authentication({ storage: window.localStorage }));\n\n\nHere's a screen shot showing some requests in chrome debugger and postman." ]
[ "node.js", "authentication", "socket.io", "feathersjs" ]
[ "Switch out of postgres UNIX acount", "Using postgresql at an Ubuntu 14.04 command line. \n\nsudo -i -u postgres puts me at \n\npostgres@me-iMac:~$\n\n\nHow do I get back to my usual UNIX user, that is, to\n\nme@me-iMac:~$\n\n\nas I cannot sudo (don't know or cannot set postgres password for UNIX account)? I can close the terminal window, but do I have to?" ]
[ "postgresql", "unix", "ubuntu-14.04" ]
[ "How to log from an app included in Solr running in tomcat", "We are using a Tomcat 6.0.35 with a Solr 4.0.0. We placed some jar-files in lib directory in the instanceDir of our SolrCore.\nIn our jar's there are some classes which are using some intern logback configuration/classes.(A facade for the logging-framework (currently Logback/SLF4J). Support additional functinality,)\nWe can't make it work, that the logging of our jar's is working.\n\nWe tried:\n\n\nEditing the default logging.properties. In this case, all the log belong to our logger, but contain the log statements of our application.\nGiving the Solr a logback.xml file, with logback jars in the lib folder. In this case we havn't got any logs in our logfiles.\nMaking the tomcat using logback to log. In this case we recieved different logs from the tomcat and from other classes in the org.apache.catalina. There was no log from the Solr nor our application in the log files\n\n\nWhat can we do to we customize our logging?\nWe would like to use logback if it's possible." ]
[ "tomcat", "logging", "solr", "logback" ]
[ "LINQ in NEST framework for ElasticSearch", "Can I use LINQ in NEST/ElasticSearch? If answer is YES where I can find documentation of it?" ]
[ ".net", "linq", "elasticsearch", "nest" ]
[ "java.lang.NoSuchMethodError Bouncy Castle and Apache Spark", "I actually found a company (where I work) specific work-around this issue, but the problem is so bizarre, I wanted to see if anyone else has ran into this issue and how they solved it.\n\nFirst I added two bouncy castle dependencies to my spark job:\n\n <!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->\n <dependency>\n <groupId>org.bouncycastle</groupId>\n <artifactId>bcprov-jdk15on</artifactId>\n <version>1.52</version>\n </dependency>\n <!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpg-jdk15on -->\n <dependency>\n <groupId>org.bouncycastle</groupId>\n <artifactId>bcpg-jdk15on</artifactId>\n <version>1.52</version>\n </dependency>\n\n\nI also have this plugin to create a jar with all dependencies:\n\n <plugin>\n <groupId>org.apache.maven.plugins</groupId>\n <artifactId>maven-assembly-plugin</artifactId>\n <version>2.4.1</version>\n <configuration>\n <!-- get all project dependencies -->\n <descriptorRefs>\n <descriptorRef>jar-with-dependencies</descriptorRef>\n </descriptorRefs>\n <!-- MainClass in mainfest make a executable jar -->\n <archive>\n <manifest>\n <mainClass>com.theclasspath.jobs.TestingJob</mainClass>\n </manifest>\n </archive>\n\n </configuration>\n <executions>\n <execution>\n <id>make-assembly</id>\n <!-- bind to the packaging phase -->\n <phase>package</phase>\n <goals>\n <goal>single</goal>\n </goals>\n </execution>\n </executions>\n </plugin>\n\n\nSo all the dependencies are getting installed. Now this will compile and create the jar. When I run spark-submit with the jar with dependencies, I get a no such method error for some methods in the org.bouncycastle.util package. The main one being:\n\njava.lang.NoSuchMethodError: org.bouncycastle.util.Strings.newList()Lorg/bouncycastle/util/StringList;\n\n\nwhen trying to just run Strings.newList(); in the main class. So I ran mvn dependency:tree to see if there were multiple versions of bouncy castle, and I only saw the dependencies I added to the pom. \n\nHere is the really weird part: if I build the jar and run it with java -jar jar-name-jar-with-dependencies.jar (meaning not through spark-submit) the dependency gets added just fine, and I do not see any errors. So with that in mind, what would be the differences between the spark submit jar and just running the jar directly?\nWhy would one work and the other fail? I have tried running it on different machines, such as an emr job, and I still see the same error. (and to avoid this getting asked, I am using the jar-with-dependencies jar for the spark job)\n\nOne final note, I have seen this post Bouncy castle no such method error, and it doesn't apply, since I can get the jar to run when I just run the jar by itself without spark-submit." ]
[ "java", "maven", "apache-spark", "jar", "bouncycastle" ]
[ "Issue on trigger in mysql", "I am a novice in trigger. Please excuse me if I made any silly question. I was trying to write a trigger which will update a field value (name) in sol_erp_2014_admission_academic_course_master table with change in sol_erp_2014_academic_course_master table. In below, I have mentioned the structure of both the tables and the trigger which I have written.\n\nStructure of sol_erp_2014_academic_course_master table:\n\nCREATE TABLE IF NOT EXISTS `sol_erp_2014_academic_course_master` (\n `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'cbcs_major_id',\n `major_type` int(11) NOT NULL,\n `section_id` int(11) NOT NULL,\n `academic_institute_id` int(11) NOT NULL,\n `academic_department_id` int(11) NOT NULL,\n `specialization_id` varchar(255) NOT NULL DEFAULT '0',\n `code` varchar(200) NOT NULL,\n `name` varchar(200) NOT NULL,\n `unit` int(11) NOT NULL,\n `no_of_year` int(11) NOT NULL,\n `max_num_of_year` int(11) NOT NULL,\n `no_of_sem` int(11) NOT NULL,\n `tot_min_credit` int(11) NOT NULL,\n `tot_max_credit` int(11) NOT NULL,\n `min_sem_pass_prctng` decimal(4,2) NOT NULL,\n `routine_system` int(11) NOT NULL COMMENT '1->Day System; 2-> Week System',\n `exam_evalution_grade_master_id` int(11) NOT NULL,\n `status` enum('0','1') NOT NULL DEFAULT '1',\n `date_added` date NOT NULL,\n `date_edited` date NOT NULL,\n `is_deleted` int(2) NOT NULL DEFAULT '0',\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='MAJOR' AUTO_INCREMENT=1 ;\n\n\nStructure of sol_erp_2014_admission_academic_course_master table:\n\nCREATE TABLE IF NOT EXISTS `sol_erp_2014_admission_academic_course_master` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `academic_institute_id` int(11) NOT NULL,\n `academic_department_id` int(11) NOT NULL,\n `name` varchar(255) NOT NULL,\n `status` enum('0','1') NOT NULL DEFAULT '1',\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\n\nNow the trigger what I have written:\n\nDELIMITER $$\n\nDROP TRIGGER /*!50032 IF EXISTS */ `erp_adbu`.`sol_erp_2014_academic_course_master_update_before`$$\n\nCREATE\n /*!50017 DEFINER = 'root'@'%' */\n TRIGGER `sol_erp_2014_academic_course_master_update_before` BEFORE UPDATE ON `sol_erp_2014_academic_course_master` \n FOR EACH ROW BEGIN\n DECLARE name_var VARCHAR(255);\n DECLARE id_var INT;\n\n SELECT name\n INTO name_var \n FROM sol_erp_2014_academic_course_master\n WHERE sol_erp_2014_academic_course_master.id = NEW.id;\n\n UPDATE sol_erp_2014_admission_academic_course_master SET name = name_var WHERE id = NEW.id;\n END;\n$$\n\nDELIMITER ;\n\n\nNow I am updating a record from sol_erp_2014_academic_course_master table. But the corresponding record of sol_erp_2014_admission_academic_course_master table is not updating.\n\nCan anyone please help me?\n\nThanks in advance." ]
[ "mysql", "triggers" ]
[ "How to get all the Questions & Answers from a QnA Maker V4.0 using Single API?", "Is there any API for getting all the Questions & Answers that I have created in QnA Maker V4. Currently I am able to see there is an api that will return the appropriate answer based on the question that I have raised. \n\nI have verified the following microsoft documents and unable to find the proper API.\n\nEnd point for getting answer based on the proper question :\n\n\n https://{QnA-Maker-endpoint}/knowledgebases/{knowledge-base-ID}/generateAnswer\n\n\nQNA Maker API document :\n\n\n https://westus.dev.cognitive.microsoft.com/docs/services/5a93fcf85b4ccd136866eb37/operations/5ac266295b4ccd1554da75ff" ]
[ "c#", "botframework", "chatbot", "azure-language-understanding", "qnamaker" ]
[ "double click WPF event shortcut for deleting auto generated function and XAML added tags", "When I double click on my User Control file, system auto generates a UserControl_Loaded function in .cs file and adds loaded tag in XAML as Loaded=\"UserControl_Loaded\" for UserControl element. It also defines an eventHandler to this.Any shortcut in VS to undo this operation quickly?" ]
[ "wpf", "function", "shortcut", "auto-generate" ]
[ "How to make JTextPane scroll horizontally", "I have a JTextPane, when there are too many lines, a vertical scroll bar appears, but when a line is too long, instead of appearing a horizontal scroll bar, the line breaks into two lines, how to make the horizontal bar appear instead of breaking into two lines, my jTextPane is added like this:\n\nJScrollPane jScrollPane1 = new JScrollPane();\njScrollPane1.setViewportView(jTextPane1);" ]
[ "java", "swing", "scroll", "jscrollpane", "jtextpane" ]
[ "What's a good, free, drop-in set of mimetype icons?", "I want a set of mimetype icons to go with my file uploads, to show in users' files lists and the like.\n\nIt should be:\n\n\n16x16 PNG or JPG (other sizes through 64x64 would be a bonus but not required)\nalready organized such that I can do e.g. mimetype.sub('/','-') + '.png' and get the icon file name (I'd like to avoid spending a bunch of time figuring out the associations)\nnot platform specific, preferably using properitary apps' native icons where available (e.g. a .zip icon should not look like a KDE box)\npretty but readable and suitable to a general audience ;-)\n\n\nWhat's a good package for this?" ]
[ "icons", "mime-types" ]
[ "What is the difference between \"dismiss\" a modal and \"close\" a modal in Angular UI-Bootstrap?", "What is the difference between \"dismiss\" a modal and \"close\" a modal?\n\nclose(result) - a method that can be used to close a modal, passing a result\ndismiss(reason) - a method that can be used to dismiss a modal, passing a reason" ]
[ "angularjs", "angular-ui", "angular-ui-bootstrap" ]
[ "SAP GUI scripting inside Java", "I am following the example below to work on sapguiscripting from Java https://blogs.sap.com/2012/11/01/how-to-use-sap-gui-scripting-inside-java/.\n\nObj = new ActiveXComponent(Session.invoke(\"FindById\",\n \"wnd[0]/usr/txtRSYST-BNAME\").toDispatch());\n Obj.setProperty(\"Text\", \"BCUSER\");\n\n //-Set GUIPasswordField Password------------------------------\n //-\n //- session.findById(\"wnd[0]/usr/pwdRSYST-BCODE\").text = _\n //- \"minisap\"\n //-\n //------------------------------------------------------------\n Obj = new ActiveXComponent(Session.invoke(\"FindById\",\n \"wnd[0]/usr/pwdRSYST-BCODE\").toDispatch());\n Obj.setProperty(\"Text\", \"minisap\");\n\n\nEven though I passed the parameters username and password I am still not able to launch the SAP application from java. What else do I need to modify to make it work?" ]
[ "java", "sap-gui" ]
[ "Does exist built-in function in Python to find best value that satisfies some condition?", "Does exist built-in function in Python, that can find best value that satisfies some condition (specified by a funciton)? For example something instead this code:\n\ndef argmin(seq, fn):\n best = seq[0]; best_score = fn(best)\n for x in seq:\n x_score = fn(x)\n if x_score < best_score:\n best, best_score = x, x_score\n return best" ]
[ "python", "python-2.7", "python-3.x" ]
[ "Split matrices in a list with string criteria", "I created a list which contains 105 matrices as follows:\n\nm<-vector(\"list\",105)\nfor (i in 2:105) {\n m[[i-1]]<-Datos[(x[i-1]+1):x[i],1:14] }\nm[[105]]<-Datos[(x[105]+1):533195,1:14]\n\n\nFor example a part of my matrix number 104 returns (In columns):\n\nm[[104]]\n\n ID: \n 8866 \n 8866 \n 8866 \n 8866 \n 8866 \n 8866 \n 8866 \n 8866\n\n Date: \n 1990-4-15 \n 1990-4-16\n 1990-4-17\n 1990-4-18\n 1990-4-15\n 1990-4-16\n 1990-4-17\n 1990-4-18\n\n Series: \n APV \n APV \n APV \n APV \n INV \n INV \n INV \n INV\n\n\nThese are some of my columns of the matrix. What I would like is to split this matrix using the series columns. I think it would be like a list of a list depending of the number of different Series there are. In this case there are 2: APV and INV ( Note that I don't know the names of the series for each matrix, so there must be a function that extract the unique different series)\n\nIn summary, I would like that:\n\nm[[104]][[1]] returns:\n\n ID: \n 8866 \n 8866 \n 8866 \n 8866 \n\n\n Date: \n 1990-4-15 \n 1990-4-16\n 1990-4-17\n 1990-4-18\n\n\n Series: \n APV \n APV \n APV \n APV \n\n\n\nAnd m[[104]][[2]] returns:\n\n ID: \n 8866 \n 8866 \n 8866 \n 8866 \n\n\n Date: \n 1990-4-15 \n 1990-4-16\n 1990-4-17\n 1990-4-18\n\n\n Series: \n\n INV \n INV \n INV \n INV\n\n\nOr maybe you come up with a more efficient way to do this.\n\nPD: Didn't know how to put the columns at the same level" ]
[ "r", "list", "matrix", "split", "unique" ]
[ "LibGdx data persistance with ArrayList", "I'm still new in LibGdx and also Android programming..\n\nI'm trying to create a class that will be used to store data in my application \nthe class looks like this \n\npackage com.mygdx.hanoi.util;\n\nimport java.util.Map;\n\nimport com.badlogic.gdx.Gdx;\nimport com.badlogic.gdx.Preferences;\n\npublic class DataPersister2 {\n\n public Preferences getOrCreatePreferences(String prefName){\n return Gdx.app.getPreferences(prefName + \".prefs\");\n }\n public Map getPreferencesData(Preferences prefName){\n return (Map) prefName.get(); //.get(key);\n }\n public void clearPreferences(Preferences prefName){\n prefName.clear();\n }\n public void insertPreferences(Preferences prefName, Map data){\n prefName.put(data);\n prefName.flush();\n }\n}\n\n\nThe problem is, when i try to create a preferences using that class, and adding an ArrayList into it, it always said that the preferences is null\n\nDataPersister2 hs = new DataPersister2();\n Preferences hScore = hs.getOrCreatePreferences(\"highScores\");\n hs.clearPreferences(hScore);\n\n // dummy test score data\n ArrayList<String[]> hsFreeMode = new ArrayList<String[]>(); // declare apa yang mau ditaruh sini, biar ga error di kemudian method\n hsFreeMode.add(new String[] {\"luki\", \"5000\"});\n hsFreeMode.add(new String[] {\"laras\", \"3900\"});\n\n ArrayList hsMoveMode = new ArrayList();\n hsMoveMode.add(new String[] {\"cika\", \"6000\"});\n hsMoveMode.add(new String[] {\"cikoo\", \"1000\"});\n\n Map hsMap = new HashMap();\n hsMap.put(\"freeMode\", hsFreeMode);\n hsMap.put(\"moveMode\", hsMoveMode);\n\n //hs.insertPreferences(\"highScores\", hsMap);\n hs.insertPreferences(hScore, hsMap);\n\n // print out the data\n Map data = hs.getPreferencesData(hScore);\n Gdx.app.log(\"data print\", \"the free mode value is \" + (String[]) data.get(\"freeMode\"));\n Gdx.app.log(\"Array List\", \"the arraylist contains\" + hsFreeMode.get(0)[0]);\n\n\nWhenever i try to log from that class (in 'data print' log) it always says null\nBut if i log it directly from the ArrayList (in 'Array List' log) the value appears..\n\nwhat makes it even more strange for me is, if i change the map value before adding it to the preferences like this : \n\nMap hsMap = new HashMap();\n hsMap.put(\"freeMode\", \"luki\");\n hsMap.put(\"moveMode\", \"laras\");\n\n //hs.insertPreferences(\"highScores\", hsMap);\n hs.insertPreferences(hScore, hsMap);\n\n\nand log the data like this : \n\nGdx.app.log(\"data print\", \"the free mode value is \" + data.get(\"freeMode\"));\n\n\nthe data shown...\nso i'm confused right now, and can't figure out (yet) where is my problem..\n\nany help will be appreciated :)" ]
[ "java", "android", "libgdx" ]
[ "Croatian letters in iTextSharp", "I'm still a beginner in C# and I want to know is there an option of writing slavic letters č,Δ‡,Ε‘,ΕΎ in PDF using iTextSharp. I was reading other posts about it but I can't apply their solution to my problem, maybe it's a bit to complicate to me as a beginner. This is my code:\n\nSaveFileDialog pdfFile = new SaveFileDialog();\npdfFile.Filter = \"PDF|*.pdf\";\npdfFile.Title = \"Spremi PDF\";\npdfFile.FileName = \"Ispit\";\nif (pdfFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)\n{\n Document document = new Document(iTextSharp.text.PageSize.LETTER, 25, 25, 35, 35);\n PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(pdfFile.FileName, FileMode.Create));\n document.Open();\n\n foreach (List<string> question in questions)\n {\n document.NewPage();\n foreach (string field in question)\n {\n document.Add(new Paragraph(field));\n }\n }\n\n document.Close();\n}\n\n\nThis code is maybe to simple and maybe there's a lots of better ways to do this but this is one of my first codes in C#." ]
[ "c#", "pdf", "itextsharp" ]
[ "PlaceFilter for nearby google maps api places", "In a code i get an ALL nearby places, get names and put in list, what i must to do, where i must write the PlaceFilter for filter by Bar and restoraunts, thx.\n\nCode:\n\n PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi\n .getCurrentPlace(mGoogleApiClient, null);\n result.setResultCallback(new ResultCallback<PlaceLikelihoodBuffer>() {\n @Override\n public void onResult(PlaceLikelihoodBuffer likelyPlaces) {\n for (PlaceLikelihood placeLikelihood : likelyPlaces) {\n Log.i(TAG, String.format(\"Place '%s' has likelihood: %g\",\n\n placeLikelihood.getPlace().getName(),\n placeLikelihood.getLikelihood()));\n\n listForAd.add(String.valueOf(placeLikelihood.getPlace().getName()));\n\n\n\n }\n\n adapter.notifyDataSetChanged();\n likelyPlaces.release();\n }\n });\n\n\nI am try to do this, but not work\n\nList<String> filterType = new ArrayList<String>();\n filterType.add(String.valueOf(Place.TYPE_BAR));\n PlaceFilter filter = new PlaceFilter(false,filterType);\n PendingResult<PlaceLikelihoodBuffer> result = Places.PlaceDetectionApi\n .getCurrentPlace(mGoogleApiClient, filter);" ]
[ "android", "google-maps-api-3" ]
[ "Can an Objective-C object be its own delegate? Is it good programming practice?", "I know it is possible, but is it really a good programming practice? The idea is to subclass UIAlertView and subscribe myself as my own delegate in order to be able to add buttons and block handlers. That way, when I get the alertView:clickedButtonAtIndex: I call the block that was passed on.\n\nI hope it's understandable. Is it a good programming practice?\n\nUPDATE: Here's my idea of what I was asking https://github.com/ianmurrays/IMAlertView. Any comments would be greatly appreciated." ]
[ "objective-c", "ios", "cocoa", "delegates" ]
[ "TFS 2017 Open a Work Item from Angular App", "I built a TFS 2017 extension that leverages Angular Framework. The extension has a table with a column for Work Item ID. On clicking that ID, the requirement is to open the Work Item.\n\nThe click event passes the work item ID to an Angular component method. That method that has the following window.open(\"http://hostname:8080/tfs/collection/project/_workitems?_a=edit&id=\" + id, \"_blank\");\n\nThis opens up a new window but I get a \"TFS400813: Resource not available for anonymous access. Client authentication required.\" error. If I take the same URL and paste in another browser, I'm able to access the work item." ]
[ "angular", "authentication", "tfs" ]
[ "MSIX Web Installer not working - Error in parsing the app package", "I have been all over the other threads about this question but nothing seems to fix my problem. No matter what I do, my .appinstaller doesn't work. I keep getting : Error in parsing the app package.\nFirst off let me say I can access both the .appinstaller file and the .appxbundle file using the direct URLs. Also, I am able to install using .appxbundle and I have a signed certificate. I also tried doing the loopback exemption but that didnt work either. Here is the XML to my .appinstaller\n<?xml version="1.0" encoding="utf-8"?>\n<AppInstaller\n Uri="http://dev.xxxxxx.com/MSIXPrototype/HelloWorldPackage.appinstaller"\n Version="1.0.7.0" xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2">\n <MainBundle\n Name="xxxx"\n Version="1.0.7.0"\n Publisher="CN=my_cert"\n Uri="http://dev.xxxxxx.com/MSIXPrototype/HelloWorldPackage_1.0.7.0_x64.appxbundle" />\n <UpdateSettings>\n <OnLaunch\n HoursBetweenUpdateChecks="0" />\n </UpdateSettings>\n</AppInstaller>\n\nIn addition, I have added all the MIME types to my apache httpd.conf file as such :\n AddType application/appinstaller .appinstaller\n AddType application/msixbundle .msixbundle\n AddType application/appxbundle .appxbundle\n AddType application/msix .msix\n AddType application/appx .appx \n\nI would appreciate any help on this. Thanks!" ]
[ "c#", ".net", "uwp", "msix", "appinstaller" ]
[ "How to keep Froala Editor from converting whitespaces to non breaking whitespaces?", "Want to keep space and don't let Froala convert it to  \nthis.html.insert('<a href="/">My New HTML </a>');\n\nFor now result is:\n<a href="/link">My New HTML </a>\n\nSample: https://jsfiddle.net/mahma/2vrf1Lsd/10" ]
[ "jquery", "froala" ]
[ "NetworkOnMainThreadException exception on one activity only", "I added a new activity and made it the main activity. The previous main activity, along with other activities, accessed data from web sites. Everthing worked fine. The new main activity also needed to access data from a web site, but this time I received a NetworkOnMainThreadException exception. I implemented AsyncTask on the new activity and it now works. I am in the process of implementing AsyncTask on the other activities even though they still work and don't throw the exception. I have read that this is best practice.\n\nBelow is the code I use to pull data from a web site. Why does it only throw the NetworkOnMainThreadException excpetion on the new main activity and not on any other activity?\n\nGreg\n\nprotected String GetNewData(String URLIn) {\n String ThisData = \"\";\n try {\n URL url = new URL(URLIn);\n HttpURLConnection con = (HttpURLConnection) url\n .openConnection();\n RetrieveSiteData ThisSite = new RetrieveSiteData();\n\n ThisData = ThisSite.readStream(con.getInputStream());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ThisData;\n}\n\n\nStack trace\n\nandroid.os.NetworkOnMainThreadException\n android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1236)\n java.net.InetAddress.lookupHostByName(InetAddress.java:388)\n java.net.InetAddress.getAllByNameImpl(InetAddress.java:239)\n java.net.InetAddress.getAllByName(InetAddress.java:214)\n com.android.okhttp.internal.Dns$1.getAllByName(Dns.java:28)\ncom.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:216)\ncom.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:122)\ncom.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:292)\ncom.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)\ncom.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)\ncom.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)\ncom.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)\ncom.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:179)\ncom.windsweptsoftware.wslistit.Utilities.GetNewData(Utilities.java:45)\ncom.windsweptsoftware.wslistit.LogIn.onLoginClicked(LogIn.java:96)\njava.lang.reflect.Method.invokeNative(Native Method)\njava.lang.reflect.Method.invoke(Method.java:515)\nandroid.view.View$1.onClick(View.java:3860)\nandroid.view.View.performClick(View.java:4480)\nandroid.view.View$PerformClick.run(View.java:18673)\nandroid.os.Handler.handleCallback(Handler.java:733)\nandroid.os.Handler.dispatchMessage(Handler.java:95)\nandroid.os.Looper.loop(Looper.java:157)\nandroid.app.ActivityThread.main(ActivityThread.java:5872)\njava.lang.reflect.Method.invokeNative(Native Method)\njava.lang.reflect.Method.invoke(Method.java:515)\ncom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1069)\ncom.android.internal.os.ZygoteInit.main(ZygoteInit.java:885)\ndalvik.system.NativeStart.main(Native Method)\n\n\nOriginal code that still works in most activities without AsynTask.\n\nprotected String GetNewData(String URLIn) {\n String ThisData = \"\";\n try {\n URL url = new URL(URLIn);\n HttpURLConnection con = (HttpURLConnection) url\n .openConnection();\n RetrieveSiteData ThisSite = new RetrieveSiteData();\n\n ThisData = ThisSite.readStream(con.getInputStream());\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ThisData;\n}" ]
[ "android", "android-asynctask" ]
[ "A cross platform process manager tool", "I need a program that is able to launch a set of processes according to a schedule/configuration; the program would run in the background and restart the processes in case they crash.\n\nThere are standard tools for this kind of task on both windows and unix - what I need is a cross platform program which could run on different operating systems using the same configuration.\n\nAny portable C/C++ library which implements the basic functionality (i.e. create processes, signal process termination events etc) would be ok too." ]
[ "process", "cross-platform", "schedule" ]
[ "Performance problems using JPA", "I am using JPA in my web application (hibernate is the vendor) and I am confused regarding performance of queries.\nIn my code I use the following query:\n\nselect c.id from Cdr c where c.receivedOn >= :start and c.receivedOn < :end and c.buy.id in (:buyList)\n\n\nRunning this query against the DB directly takes 0.1 seconds to execute.\nRunning this through the server takes a few minutes, what am I missing here?\n\nhere is the query generated by the java:\n\nselect cdr0_.id as col_0_0_ from billing_cdr cdr0_ where cdr0_.received_on>=? and cdr0_.received_on<? and (cdr0_.buy_id in (? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?))" ]
[ "java", "hibernate", "jpa" ]
[ "How do I view Apache OFBiz's database, and how do I transfer it to a MySQL database running on GCP?", "So right now, I have an Apache OFBiz deployment running on a pod in a Kubernetes cluster in GCP, and it is accessible over the internet. Let's say I create a user, or a record, or anything on OFBiz, how do I view its database, and how do I constantly transfer the data on there to the database I have setup on GCP? If anything, is there a way to setup it up so all the data automatically gets stored to the MySQL database I have running on GCP?\nNotes:\nApache OFBiz apparently uses Derby\nDatabase instance running on GCP is MySQL 8.0\nApache OFBiz was deployed through a dockerfile image on Kubernetes, in a cluster." ]
[ "mysql", "google-cloud-platform", "derby", "ofbiz" ]
[ "How to make a idle timer that detects editing activity in a UITextView", "I want to allow the user to enter some notes in a UITextView before closing an app. But he/she might not enter anything or he/she might enter some text and then stop and do nothing for a long time. In either of those cases I want to close the UITextView, save some stuff, and exit the app. How do I detect that the user didn't entered anything for a certain number of seconds?\n\nI tried to dispatch a function after a wait time\n\nstatic int idleSeconds = 8;\n\nself.noteDoneTime = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * idleSeconds);\ndispatch_after(self.noteDoneTime, dispatch_get_main_queue(), ^{ [self endNoteRequest]; });\n\n\nbut every time the user changes the text renew the dispatch time:\n\n- (void)textViewDidChange:(UITextView *)textView {\n if (textView == self.noteView) {\n self.noteDoneTime = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * idleSeconds);\n }\n}\n\n\nBut that doesn't work because the dispatch time doesn't get updated after it is initially set, so the method 'endNoteRequest' runs even though the user is continuing to edit the text. I think I need to cancel the dispatch request and issue a new one but how can I do that?\n\nOr is there some other approach to an idle timeout that actually works?" ]
[ "ios", "grand-central-dispatch", "dispatch" ]
[ "Get MotionEvent on keyboard", "I'm looking is it possible to capture MotionEven data (pressure) on keyboard (in my app)? Or is there way to intercept all touches on screen in my app (something like full screen mode)." ]
[ "android", "touch", "android-event" ]
[ "Access slot component data?", "I have the following setup:\n\nCustomForm.vue\n\n<template>\n <div>\n <input v-model=\"field1\" >\n <input v-model=\"field2\" >\n </div>\n</template>\n<script>\nexport default {\n data () {\n return {\n field1: '',\n field2: '',\n }\n }\n}\n</script>\n\n\nParent.vue\n\n<template>\n <div>\n <child>\n <template>\n <custom-form />\n </template>\n </child>\n </div>\n</template>\n\n<script>\nimport Child from ...\nimport CustomForm from ...\n\n</script>\n\n\nChild.vue\n\n<template>\n <div>\n <button @click=\"click\" />\n <grand-child>\n <template>\n <slot></slot>\n </template>\n </grand-child>\n </div>\n</template>\n<script>\nimport GrandChild from...\nexport default {\n methods: {\n click: function () {\n var data = ... // get form data\n // do something with data then $emit\n this.$emit('custom-click', data)\n }\n }\n }\n}\n</script>\n\n\nGrandChild.vue\n\n<template>\n <div v-for=\"(item, index) in list\" :key=\"index\" >\n <input ...>\n <input ...>\n <slot></slot>\n </div>\n</template>\n\n\nBasically I have a CustomForm, I want to pass the form to GrandChild.vue from Parent.vue, but the issue is I don't know how do I retrieve CustomForm data (field1, field2) in Child.vue ie how do I get CustomForm value from click method in Child.vue? Thanks" ]
[ "vue.js", "vuejs2" ]
[ "Android Kernel - Switch between network types at runtime", "I'm currently working on an experimental Android Kernel (Research). I'actually trying to find some ways to preserve battery charge by implementing a kind of power management tool on the kernel level. I'm working on the msm-hammerahead kernel (used by the nexus 5 running Android 5.0).\n\nI'm trying to figure out if there exists a way to switch between network types (2G,3G,Wifi) at runtime. I know that there exist the possibility to switch the default network type within the build.prop file(ro.telephony.default_network). \n\nDoes anybody know if it is even possible to achive this?" ]
[ "networking", "wifi", "modem", "3g", "android-kernel" ]
[ "how to register eureka services un Kubernetes", "I have set up a microservice environment with kubernetes and a.o. eureka. The problems is that services get registered with the pod name and the clients try to access them directly and not with the kubernetes service. That's what I see in the eureka dashboard:\n\nSERVICE-USERS n/a (1) (1) UP (1) - service-users-1822504684-9b688:service-users:8501\n\n\nConsequently, feign calls to that service fail with java.net.UnknownHostException: service-users-1822504684-9b688\n\nIs there a way to make the eureka/kubernetes combination work? I understand that I could scrap eureka and let the clients talk to the kubernetes service directly.\n\nA bit more info:\n\n$ kubectl get pods\nNAME READY STATUS RESTARTS AGE\nservice-users-1822504684-9b688 1/1 Running 0 1h\n\n$ kubectl get svc\nNAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE\nservice-users 10.0.0.119 <none> 8501/TCP 3d" ]
[ "kubernetes", "netflix-eureka" ]
[ "POST url in JavaScript gets commented out", "I'm trying to make a POST request in javascript, but URL's double slashes are treated as beginning of comment line... What is a good fix for that?\n\n....\nfunction queryCoreReportingApi(profileId) {\n POST https://analyticsreporting.googleapis.com/v4/reports:batchGet\n ...." ]
[ "javascript", "post" ]
[ "How do I change maximum length of HTTP GET request to store the params ? Is it possible?", "Hi I want to increase the size of the params (in URL) via HTTP GET request. \n\nMy requirement is, I am modifying a html form which is already built with few fields and the type of form request is \"GET\" to add another description field to it. the length of the description may be several lines. If I send this data also via GET, there may b e a chance of exceeding the limit of the total URL limit. SO as a measure of precaution I am trying to increase the GET request size.\n\nIs it possible? if so how can I do it?" ]
[ "php", "html", "get", "maxlength" ]
[ "DoD CAC PDF417 Compression", "Does anybody have any idea where the EDIPI / CII compression methodology, used in the PDF417 barcode (front of the CAC), is explained or documented? \n\nThe closest reference I found is this document: http://www.cnic.navy.mil/navycni/groups/public/@hq/@cacpmo/documents/document/cnicp_a282327.pdf but it doesn't really explain the compression - converting strings to base-32 doesn't seem to end up the same result.\n\nObviously a very esoteric question, but any help would be appreciated. \n\nThanks!" ]
[ "cac" ]
[ "Is there another way to render in ReactJs", "I am new to ReactJs. From the examples, I can see that one needs to call\nReact.render(elementToBeReadered, targetingElement). Is there a way to use the web components defined in React directly, like angularjs' directive? E.g.\n\n<Hello />\n\nvar Hello = React.createClass({\n render: function() {\n return (\n <div>\n Hello World!\n </div>\n );\n }\n});\n\n\nSo that I don't need to add a target element like <div id='target-element'></div> and then render it with React.render(<Hello />, document.getElementById('target-element')). Why should I duplicate this everywhere?" ]
[ "angularjs", "reactjs" ]
[ "call function depending on check and check other checkboxes", "well so many checks, but it is a problem I am dealing with right now. Basically I have a few checkboxes in my markup:\n\n<input id=\"only_veggi\" type=\"checkbox\" name=\"ingredients\" value=\"showveggi\"> only vegetarian <br>\n<input id=\"show_15min\" type=\"checkbox\" name=\"time\" value=\"15min\" style=\"margin-left: -59px;\"> 15min <br>\n<input id=\"show_28min\" type=\"checkbox\" name=\"time\" value=\"28min\" style=\"margin-left: -59px;\"> 28min <br> \n<input id=\"show_45min\" type=\"checkbox\" name=\"time\" value=\"45min\" style=\"margin-left: -59px;\"> 45min <br> \n<input id=\"show_60min\" type=\"checkbox\" name=\"time\" value=\"60min\" style=\"margin-left: -59px;\"> 60min <br><br>\n\n\nand fire a function based on that check:\n\njQuery('#show_15min').click(function(){\n if (this.checked) {\n jQuery('#content_container').isotope({ filter: '.fifteen' });\n }\n\n if (!this.checked) {\n jQuery('#content_container').isotope({ filter: '.twentyeight, .fourtyfive, .sixty' });\n }\n});\n\n\nbut I also want to check which other checkboxes are checked and unchecked and depending on this I have to change the classes in the filter of isotope. Of course I could make a lot of if statements like\n\nif(!this.checked && !jQuery('#show_45min').checked && jQuery('#show_60min').checked)\n jQuery('#content_container').isotope({ filter: '.sixty', '.fifteen');\n{\n\n\nbut this can't be the solution.\n\nDoes anyone have an idea how I can got through all checkboxes when checking and unchecking them and depending on the status it changes the filter class of isotope.\n\nI hope I made myself clear.\n\nThanks in advance." ]
[ "javascript", "jquery", "html", "jquery-isotope" ]
[ "How should you test if a variable is a value type in C#?", "I have a few places where I have a generic type parameter that is not limited to class (or struct), and when I try to compare variables of that type against null, Resharper underlines it, complaining that I may be comparing a value type to null (a valid objection, to be sure). Is there an accepted way of checking if a variable is a value type before comparing against null?\n\nFor example:\n\npublic TObject MyProperty { get; set; }\n\n...\nprivate void SomeMethod()\n{\n if(MyProperty == null) //Warning here\n {\n ...\n }\n}\n\n\nI've been doing if(!(MyProperty is ValueType) && MyProperty)--is that valid? It doesn't get rid of the warning, but that doesn't necessarily mean anything." ]
[ "c#", ".net", "generics" ]
[ "Kubernetes cluster in AWS - what instance types?", "I would like to try set up Kubernetes cluster in AWS for an application that consists of:\n\n\n5 Java-based microservices\n2 Node.JS microservices\nMongoDB\nElasticsearch\nMariaDB\nRabbitMQ\n\n\nAWS has been chosen instead of GCE, because other services, e.g. S3, are already being used. Currently the app is set up using Jelastic (https://jelastic.com/ - GUI for cluster management), however Jelastic ceased to suffice because of lack of automation tooling and also hardware provider had numerous outages.\n\nJelastic uses cloudlets as an abstraction of computer resources - one cloudlet is 200MHz CPU and 128MB RAM. The app uses about 150 cloudlets = 30 GHz CPU + 20GB RAM.\n\nHow would you recommend setting up the cluster in AWS? What instance types are the best for Kubernetes master and minions? Do you recommend running databases on the cluster as well as services, or is it better to spin up dedicated instances for them?" ]
[ "java", "amazon-web-services", "kubernetes" ]
[ "Get item at position \"x\" on Iterable class", "I am creating an iterable class, and it works using a for loop like so:\n\nfor(let i of myClassInstance) {\n console.log(i)\n}\n\n\nHowever if I would like to grab an item at an index like so, I get undefined:\n\nconsole.log(myClassInstance[2])\n\n\nWhat can I do get the item from the class? Here is the iterator on my class, do I need something else to make this work?\n\nclass myClass {\n public [Symbol.iterator]() {\n let items = this._items\n let pointer = 0\n return {\n next(): IteratorResult<T> {\n if (pointer < items.length) {\n return { done: false, value: items[pointer++] }\n }\n return { done: true, value: items[items.length - 1] }\n }\n }\n }\n}" ]
[ "javascript", "arrays", "typescript", "iterator" ]
[ "DOMPDF replaces \"≀\" by \"?\"", "I am generating pdfs with DOMPDF library but It is not properly handling the symbol \"≀\". In the pdf output appears an \"?\"\n\nI have read other StackOverflow questions and I already have the \n\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />\n\n\ninside the <head> block.\n\nI am using these fonts:\n\nbody \n{\n font-family: \"Helvetica\",\"Arial\",\"sans-serif\";\n font-size:12px;\n color:gray;\n margin: 0px;\n width: 100%;\n}\n\n\nAny idea?" ]
[ "php", "dompdf" ]
[ "How To Fix error: division by zero is not a constant expression TDM-GCC and Pip", "I configured my environment to use TDM-gcc as compiler when I want to install packages using pip.\nI followed steps that told in this post;\nWhen I try pip install qpsolvers\nI get:\n cwd: C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-lxah5byx\\quadprog\\\n Complete output (23 lines):\n running bdist_wheel\n running build\n running build_ext\n skipping 'quadprog\\quadprog.cpp' Cython extension (up-to-date)\n building 'quadprog' extension\n creating build\n creating build\\temp.win-amd64-3.8\n creating build\\temp.win-amd64-3.8\\Release\n creating build\\temp.win-amd64-3.8\\Release\\quadprog\n C:\\TDM-GCC-64\\bin\\gcc.exe -mdll -O -Wall -Iquadprog -IE:\\WPy64-3850\\python-3.8.5.amd64\\include -IE:\\WPy64-3850\\python-3.8.5.amd64\\include -c quadprog\\quadprog.cpp -o build\\temp.win-amd64-3.8\\Release\\quadprog\\quadprog.o\n quadprog\\quadprog.cpp:280:41: warning: division by zero [-Wdiv-by-zero]\n 280 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };\n | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n quadprog\\quadprog.cpp:280:79: error: division by zero is not a constant expression\n 280 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };\n | ^\n quadprog\\quadprog.cpp:280:41: error: '(1 / 0)' is not a constant expression\n 280 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };\n | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n quadprog\\quadprog.cpp:280:79: error: enumerator value for '__pyx_check_sizeof_voidp' is not an integer constant\n 280 | enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };\n | ^\n error: command 'C:\\\\TDM-GCC-64\\\\bin\\\\gcc.exe' failed with exit status 1\n ----------------------------------------\n ERROR: Failed building wheel for quadprog\n\nI'm not c programmer and have no Idea how to fix this problem, But I find this solution, but I don't know how to apply this solution to work on pip. Any help would be much appreciated.\nI use python 3.8.5, and gcc version 9.2.0 (tdm64-1)." ]
[ "python", "python-3.x", "gcc", "pip" ]
[ "Android RadioButton Arabic (Text on the Left) Programmatically", "I need to Create RadioButton Dynamically in a Radio Group, radio Group is already defined in the XML, after I made my research I found some topics to put the android:drawableRight=\"@android:drawable/btn_radio\" and android:button=\"@null\" in the XML how can I do them programmatically?\n\nHere is my code :\n\n final RadioGroup RG =(RadioGroup) vi.findViewById(R.id.RG);\n RG.removeAllViews();\n String[] answers= null;\n answers=item.Answers.split(\";\");\n final TextView txtTitle = (TextView) vi.findViewById(R.id.QuestionRow);\n txtTitle.setText(item.Question);\n for (int i=0;i<answers.length;i++){ \n\n RadioButton bt=null; \n bt = new RadioButton(parent.getContext());\n bt.setId(i+1);\n bt.setText(answers[i]); \n bt.setGravity(Gravity.RIGHT); \n RG.addView(bt);\n }\n\n\nAnd here is my XML:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:id=\"@+id/Questionlayout\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\nandroid:layout_gravity=\"right\"\nandroid:background=\"@color/White\" >\n\n <TextView\n android:id=\"@+id/QuestionRow\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentRight=\"true\"\n android:layout_alignParentTop=\"true\"\n android:gravity=\"right\"\n android:textColor=\"@color/black_overlay\"\n android:textSize=\"30sp\"\n android:textStyle=\"bold\" />\n\n <RadioGroup \n android:id=\"@+id/RG\" \n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:gravity=\"right\" \n android:layout_below=\"@+id/QuestionRow\"\n android:layout_alignRight=\"@+id/QuestionRow\" \n ></RadioGroup>\n\n <Button\n android:id=\"@+id/Vote\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_alignParentLeft=\"true\"\n android:layout_below=\"@+id/RG\"\n android:text=\"Vote\" />\n\n <Button\n android:id=\"@+id/button1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:layout_below=\"@+id/RG\"\n android:text=\"See Statistics\" />\n\n </RelativeLayout>" ]
[ "android", "android-layout" ]
[ "How can I capture a picture from webcam and send it via flask", "I want to send an Image object in a flask response but it gives me an error. I tried also an approach with StringIO.\n\nimage = Image.open(\"./static/img/test.jpg\")\nreturn send_file(image, mimetype='image/jpeg')\n\n\nThis is just a test case. So the major problem is to capture an image from /dev/video0 and sent it (ideally without temporary storing on disk) to the client. I use v4l2capture for that. The test picture should also work if you may have a better solution for that task.\n\nimport select\nimport v4l2capture\nvideo = v4l2capture.Video_device(\"/dev/video0\")\nsize_x, size_y = video.set_format(1280, 1024)\nvideo.create_buffers(1)\nvideo.queue_all_buffers()\nvideo.start()\nselect.select((video,), (), ())\nimage_data = video.read()\nvideo.close()\nimage = Image.fromstring(\"RGB\", (size_x, size_y), image_data)\n\n\nThanks.\n\nEDIT\n\nWorks now. Better solutions as v4l2capture are welcome..." ]
[ "python", "flask", "python-imaging-library" ]
[ "How to access a shared resource with pytest-xdist?", "I want to access a list that contains all the account credentials to provide them to each separate thread in pytest-xdist. How do I achieve that? As far as I know, pytest-dist, for each thread started, it is a separate session of tests and they initialize each python module separately in their memory. I have a example of code snippet as follows\n\nimport sys\nimport pytest\nimport threading\nimport time\n\nlock = threading.Lock()\n\ni = 0\nlis = []\nlis.append(1)\nlis.append(2)\n\n\nclass TestAAA(object):\n\n def test_function1(self, fixture_function_feature1):\n global i, lock\n with lock:\n print \"Lock Acquired\"\n time.sleep(2)\n print >> sys.stderr, 'test_: '+str(lis[i])\n\n\nCommand executed: \n\npytest -sv -n 2 --count=5 \n\n\nOutput:\n\ntest_: 1\ntest_: 1\n\n\nOutput expected:\n\ntest_: 1\ntest_: 2\n\n\nI also tried using a shared resource mentioned at https://github.com/pytest-dev/pytest/issues/1402#issuecomment-186299177\n\n import pytest\n\n def pytest_configure(config): \n if is_master(config):\n config.shared_directory = tempdir.mktemp()\n\n def pytest_unconfigure(config): \n if is_master(config):\n shutil.rmtree(config.shared_directory)\n\n\n def pytest_configure_node(self, node):\n \"\"\"xdist hook\"\"\"\n node.slaveinput['shared_dir'] = node.config.shared_directory\n\n\n @pytest.fixture\n def shared_directory(request):\n if is_master(request.config):\n return request.config.shared_directory\n else:\n return request.config.slaveinput['shared_dir']\n\n\n def is_master(config):\n \"\"\"True if the code running the given pytest.config object is running in a xdist master\n node or not running xdist at all.\n \"\"\"\n return not hasattr(config, 'slaveinput')\n\n def test_shared_dir(shared_directory):\n print >> sys.stderr, 'master logs dir: '+str(shared_directory) \n\n\nRunning them with pytest-xdist and without, both gives out error\n\nCommand: pytest -sv test_parallel_share.py\n\nOutput:\n\n―――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_shared_dir ―――――――――――――――――――――――――――――――――――――――――――――――\n\nrequest = <SubRequest 'shared_directory' for <Function 'test_shared_dir'>>\n\n @pytest.fixture\n def shared_directory(request):\n if is_master(request.config):\n> return request.config.shared_directory\nE AttributeError: 'Config' object has no attribute 'shared_directory'\n\ntest_parallel_share.py:21: AttributeError\n 100% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n\nResults (0.05s):\n 1 error\n\n\nCommand: pytest -n 2 -sv test_parallel_share.py\n\nOutput: \n\nscheduling tests via LoadScheduling\n\n\n―――――――――――――――――――――――――――――――――――――――――――――― ERROR at setup of test_shared_dir ―――――――――――――――――――――――――――――――――――――――――――――――\n\nrequest = <SubRequest 'shared_directory' for <Function 'test_shared_dir'>>\n\n @pytest.fixture\n def shared_directory(request):\n if is_master(request.config):\n return request.config.shared_directory\n else:\n> return request.config.slaveinput['shared_dir']\nE KeyError: 'shared_dir'\n\ntest_parallel_share.py:23: KeyError\n 100% β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ\n\nResults (0.55s):\n 1 error" ]
[ "python", "testing", "pytest", "pytest-xdist" ]
[ "How to create a .wsdl file in .Net2.0 for a web service?", "I am making a window service in .Net2.0 on which I am adding a web reference of a web service in .Net2.0 only, present at the Linux server. For that I am requiring a .wsdl file that is to be generated after i compile the Web service OR I have to make it manually on my own.\n\nI am not able to generate the .wsdl neither automatically nor manually (don't know how to make it). \n\nKinldy provide me with a solution if someone is aware of the working of .Net Web Services at different Servers.\n\nThanks" ]
[ "c#-2.0" ]
[ "eyetracking package for usability research?", "Here's an interesting writeup of using eye tracking software to generate \"heat maps\" that show where on the screen users spend the majority of their time.\n\nAny leads as to good packages for doing this, without paying through the nose for somebody to come in and run the assessment for you?\n\nhttp://www.useit.com/eyetracking" ]
[ "usability", "development-process", "eye-tracking" ]
[ "File not saving django", "I'm generating a docx file with user input and trying to upload the file with File method but neither it gives an error nor it saves the file.\n\nviews.py\n\ndef schoolinput_view(request):\n if request.method == 'POST':\n worddocument = docx.Document()\n school_name_view = request.POST.get('school_name')\n documenttitle = worddocument.add_heading(school_name_view.title(), 0)\n path = join(settings.MEDIA_ROOT, 'word_documents','quicktimetable.docx')\n documentfile = Timetables()\n if request.user.is_anonymous:\n pass\n elif request.user.is_authenticated:\n documentfile.user = request.user\n document = File(path, worddocument)\n documentfile.save(document)\n\n\nmodels.py\n\nclass Timetables(models.Model):\n user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE,\n default=1, related_name='timetables_files', null=True, blank=True)\n timetable_files = models.FileField(\n null=True, blank=True, upload_to='word_documents')\n\n\nThe word file it's generating is not saving in the file storage. However in the admin panel it shows number of objects created in Timetables and the user for the files is also correct. What am I doing wrong?" ]
[ "python", "django" ]
[ "How to implement the expandable list to show the details when clicked on a cell?", "I want to implement the expandable list in iOS as in Android where the use clicks on any cell of the UITableView and the cell expands to show the rest of the details. For example, I am showing few questions on each table view cell. On clicking the table view cell it expands to show the answers under the question.\nSample Image which i want to acheive is as:" ]
[ "ios", "uitableview", "swift3", "expandablelistview" ]
[ "ERROR: Executable may have wrong permissions", "So I've seen the same error in multiple questions on stackoverflow, but all of the problems are from people not putting the correct path such as putting the path to the directory and not the executable. I have my path pointing to the executable but for some reason it still gives me that error?\nHere's the code that's causing the problem\\\n\nif sys.platform == \"win32\":\n driver = webdriver.PhantomJS(executable_path=path.realpath(\"phantomjs.exe\"))\nelif sys.platform == \"darwin\":\n driver = webdriver.PhantomJS(executable_path=path.realpath(\"phantomjsMac\"))\nelse:\n driver = webdriver.PhantomJS(executable_path=path.realpath(\"phantomjsLinux\"))" ]
[ "python", "selenium", "web-scraping" ]
[ "What is the claims in ASP .NET Identity", "Can somebody please explain, what the claim mechanism means in new ASP.NET Identity Core?\n\nAs I can see, there is an AspNetUserLogins table, which contains UserId, LoginProvider and ProviderKey.\n\nBut, I still can't understand or find any information on when data is added to the AspNetUserClaims table and what situations this table is used for?" ]
[ "asp.net", "asp.net-mvc", "asp.net-identity" ]
[ "How can I get a SelectListItem other than the one with value=0 to be selected by default?", "I have a <select> for weekdays in a ViewComponent Default.cshtml, each day with the associated values of 0-6 (Sunday to Saturday). However, I want Monday to be listed as the first day, so in my ViewModel, I have this:\n\npublic List<SelectListItem> SelectableWeekdays => new List<SelectListItem>\n{\n new SelectListItem { Text = \"Monday\", Value = \"1\", Selected = true },\n new SelectListItem { Text = \"Tuesday\", Value = \"2\", Selected = false },\n new SelectListItem { Text = \"Wednesday\", Value = \"3\", Selected = false },\n new SelectListItem { Text = \"Thursday\", Value = \"4\", Selected = false },\n new SelectListItem { Text = \"Friday\", Value = \"5\", Selected = false },\n new SelectListItem { Text = \"Saturday\", Value = \"6\", Selected = false },\n new SelectListItem { Text = \"Sunday\", Value = \"0\", Selected = false }\n};\n\n\nIn my view, I'm rendering the dropdown like this:\n\n<select asp-for=\"Weekday\" class=\"form-control\" asp-items=\"@Model.SelectableWeekdays\">\n</select>\n\n\nI have also tried adding a selected, disabled option manually:\n\n<select asp-for=\"Weekday\" class=\"form-control\" asp-items=\"@Model.SelectableWeekdays\">\n <option selected disabled>Please choose</option>\n</select>\n\n\nNo matter what I have been trying, the selected option is always \"Sunday\" with the attribute selected=\"selected\" being set for that day. \n\nI have also tried adding\n\nnew SelectListItem { Text = \"Please choose\", Value = \"99\", Selected = true, Disabled = true },\n\n\nin the ViewModel, and omitting the manual option in my view, but that didn't work either. The disabled \"Please choose\"-option was there at the top of the list, but Sunday was still the selected option." ]
[ "c#", "drop-down-menu", "asp.net-core-mvc" ]
[ "An exception of type 'System.NullReferenceException' occurred in Podio.NET.dll", "Since 6 July 2018 we have been receiving the following error when making API requests to Podio:\n\n\n An exception of type 'System.NullReferenceException' occurred in\n Podio.NET.dll \n \n but was not handled in user code...\n Line: PodioClient.AuthenticateWithApp(AppId, AppToken);\n\n\nWe haven't changed anything in our code. \n\nThis has basically just started happening. I can confirm we are using TLS 1.2. \n\nCould someone shed some light on this issue? \n\nWe are using the libraries from here - http://podio.github.io/podio-dotnet/" ]
[ "podio" ]
[ "SSL-Does a server certificate bind to a specific machine?", "Recently we created a server with tomcat and we also add SSL support for this little server. For SSL support, we need a certificate which issued by a third issuer like Entrust, Thawte etc. \n\nA colleague said to me that the certificate is binding to a specific machine. That's once we got the issued certificate, then this cert can't be used in another machine. \n\nI doubt this completely because the CSR doesn't contain any info of the machine. Is that true?\n\nThanks" ]
[ "ssl", "ssl-certificate" ]
[ "JQuery autocomplete: trigger", "As we all know, javax.swing.JComboBox is a dropdown selection having E elements in it. When setting .setEditable(true), we now can make that JComboBox also a JTextField for other E element.\n\nAfter searching with Google on this, it returned to us a suggestion of using by JQuery about autocomplete presented here. Autocomplete is working on the selection but here's the problem, we need to trigger the onChange attribute that contains the ${remoteFunction} to render a particular template on the update attribute of the said ${remoteFunction}.\n\n<g:select \n id=\"itemSelectId\"\n onChange=\"${remoteFunction(\n controller:'item', action:'itemSelect',\n update:[success:'updateItemId'],\n params:'\\'id=\\' + escape(this.value)'\"/>\n<div id=\"updateItemId></div>\n\n\nAnd on the <script> provided on the link we just change #combobox to #itemSelectId." ]
[ "jquery-ui", "jquery", "grails", "selection" ]
[ "Can I combine queries in SQL? I am trying to get a total revenue number. Here are the queries that I have", "My project is a parking system for the school. To get the total revenue I will sum the permit price column:\n\nselect sum(permit.price) from permit; \n\n\nThen to get the total violation revenue, I will get the ticket price for each type of violation (1), then multiply by the number of that type of violation(2,3, and 4) \n\n\nselect sum(violation_type.amount_due) from violation_type where violation_type_id = 1;\n\nselect count(Violation_Type_ID = '1') from violation where violation_type_id = '1';\n\nselect count(Violation_Type_ID = '2') from violation where violation_type_id = '2';\n\nselect count(Violation_Type_ID = '3') from violation where violation_type_id = '3';\n\nselect count(Violation_Type_ID = '4') from violation where violation_type_id = '4';\n\n\n\nHow would I put all this in 1 query? Thanks." ]
[ "sql", "sum" ]
[ "My sorting algorithm in python freezes sometimes during runtime, can someone take a look?", "Basically what I've been trying to is, I'm picking out the smallest and largest from the unsorted list, then appending them to a new list, then popping the smallest and largest from the old unsorted list and doing the process over and over until I end up with a sorted list. Please take a look at my code .\n\nimport random\nimport time\n\nstack = [] #sorted list\nnumbersarray = [] #unsorted list\n\nusersize = int(input(\"How many digits do you want in your array? \")) #numberofinputs\nlimit = 0\ncounter = 0\n\n\nwhile limit <= usersize:\n numbersarray.append(random.randint(0,20)) #randomly input numbers into array\n limit = limit + 1\n\nprint(numbersarray) #prints the current unsorted array\nstart_time = time.time() #starts clock\n\nsubtractor = 0 #used later in code for changing index\nwhile len(numbersarray) != 0:\n i = 0\n largest = numbersarray[i]\n size = len(numbersarray) -1\n smallest = numbersarray[i]\n\nwhile (i < len(numbersarray)): \n if numbersarray[i] >= largest:\n largest = numbersarray[i]\n index = i\n elif numbersarray[i] <= smallest:\n smallest = numbersarray[i]\n indextwo = i\n i = i+1\n\nif (len(numbersarray) == 1): #this checks if there's only 1 number left.\n entry = int(stacksize/2 + 1)\n stack.insert(entry,numbersarray[0])\n break\nelse:\n if indextwo > index:\n numbersarray.pop(indextwo)\n numbersarray.pop(index)\n elif index > indextwo:\n numbersarray.pop(index)\n numbersarray.pop(indextwo)\n\nstacksize = len(stack)\nif stacksize == 0:\n stack.append(smallest)\n stack.append(largest)\nelif stacksize != 0:\n stack.insert(stacksize-subtractor,largest) #the subtractor is dynamically changing the index of insertion.\n stack.insert(0+subtractor,smallest)\nsubtractor = subtractor + 1\n\nprint(stack)\nprint(\"--- %s seconds ---\" % (time.time() - start_time))" ]
[ "python", "algorithm", "python-3.x", "sorting" ]
[ "Inject dependencies into a custom solarium document", "I'm using NelmioSolariumBundle in a symfony project to integrate solarium.\n\nMy controller\n\n$query = $this->client->createSelect(array(\n 'documentclass' => 'MY\\SolariumDocument'\n));\n\n\nIn my custom documentclass, I have a field that store a reference of the category of the document retrived from solr. I need to replace that reference with the correspondent label.\n\nThat's why I thought of injecting doctrine.orm.entity_manager into my documentclass. \nI turned it into a service and through a setter I injected the entity manager but it didn't work getRepository on non-object which makes sense because that transformation is made in the constructor.\n\nHow do I transform attributes of my documentclass through doctrine.orm.entity_manager?" ]
[ "symfony", "solarium" ]
[ "Trouble playing simple sound effect in iOS app", "Trying to implement a simple sound effect to play in background of app. Code is based on answer here: Best way to play simple sound effect in iOS. \n\n - (void) viewDidLoad {\n NSString *path = [[NSBundle mainBundle] pathForResource:@\"poke_sound\" ofType:@\"mp3\"];\n\n NSURL *pathURL = [NSURL fileURLWithPath : path];\n\n SystemSoundID audioEffect;\n\n AudioServicesCreateSystemSoundID((CFURLRef) CFBridgingRetain(pathURL), &audioEffect);\n\n AudioServicesPlaySystemSound(audioEffect);\n\n}\n\n\nNoise will not play when I run app in simulator. Thanks for the help!\n\nNote: I'm using xcode 6 beta, so who knows what bugs could pop up there" ]
[ "ios", "objective-c", "audio" ]
[ "Type Error in angular 4 app", "Unable to get the error message, please help me.\nI am developing dashboard using angular 4. Below is the user class\nas ,\n\nexport class User{\n constructor(private _userName? : string, private _passWord? : string){\n this._userName = _userName;\n this._passWord = _passWord;\n console.log('User object created'); \n }\n\n public getUserName():string {\n return this._userName;\n }\n\n public getPassword(): string{\n return this._passWord;\n }\n\n public setUserName(userName: string): void{\n this._userName = userName;\n }\n\n public setPassword(password: string): void{\n this._passWord = password;\n }\n}\n\n\ni have written an http service as following,\n\nimport { Injectable } from '@angular/core';\n\nimport { User } from '../app/Models/user';\nimport { Http, Response } from '@angular/http';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Observable } from 'rxjs/Observable';\n\n@Injectable()\nexport class AdminUserService {\n\n private base_url: string = \"http://localhost:9090\";\n\n constructor( private http: Http) { \n }\n\n postAdminUsertoDashboard( user: User){\n let dashboard_login: string =\"/xyz/dashboard-login/login\";\n let body = \"userName=\" + user.getUserName + \"&password=\" + user.getPassword;\n this.http.post(this.base_url,body).subscribe((data)=>console.log(data));\n\n }\n\n} \n\n\nand i am calling my service in my login page as follows,\n\nlet user = new User();\nuser.setPassword(this.password);\nuser.setUserName(this.userName);\nconsole.log(this.userName);\nconsole.log(this.password);\nthis.adminUserService.postAdminUsertoDashboard(user);\n\n\nBut i am getting the following error when i ran the application, Even the server is running parallelly, the error is as follows,\n\n**> __zone_symbol__currentTask: Object { runCount: 0, _state: \"notScheduled\", type: \"microTask\", … } columnNumber: 17 fileName:\n> \"http://localhost:4200/main.bundle.js line 593 > eval\" lineNumber: 48\n> message: \"_this.adminUserService is undefined\" stack:\n> \"LoginComponent.prototype.userLogin/<@webpack-internal:///../../../../../src/pages/login/login.ts:48:17\\nZoneDelegate.prototype.invoke@webpack-internal:///../../../../zone.js/dist/zone.js:392:17\\nonInvoke@webpack-internal:///../../../core/esm5/core.js:4950:24\\nZoneDelegate.prototype.invoke@webpack-internal:///../../../../zone.js/dist/zone.js:391:17\\nZone.prototype.run@webpack-internal:///../../../../zone.js/dist/zone.js:142:24\\nscheduleResolveOrReject/<@webpack-internal:///../../../../zone.js/dist/zone.js:873:52\\nZoneDelegate.prototype.invokeTask@webpack-internal:///../../../../zone.js/dist/zone.js:425:17\\nonInvokeTask@webpack-internal:///../../../core/esm5/core.js:4941:24\\nZoneDelegate.prototype.invokeTask@webpack-internal:///../../../../zone.js/dist/zone.js:424:17\\nZone.prototype.runTask@webpack-internal:///../../../../zone.js/dist/zone.js:192:28\\ndrainMicroTaskQueue@webpack-internal:///../../../../zone.js/dist/zone.js:602:25\\nZoneTask.invokeTask@webpack-internal:///../../../../zone.js/dist/zone.js:503:21\\ninvokeTask@webpack-internal:///../../../../zone.js/dist/zone.js:1540:9\\nglobalZoneAwareCallback@webpack-internal:///../../../../zone.js/dist/zone.js:1566:17\\n\"**" ]
[ "angular", "typescript", "http" ]
[ "Is it necessary to create user defined exceptions for each errors", "I have created a spring application in which i have implemented log4j for logging. I have more than 300 errors(exceptions) in my application. I have created individual user defined exceptions for each error. Those classes doing nothing but returning error messages.\n\nReasons to create individual exceptions:\n\n\nDeveloper should not missed out handling any error situations, when i create exception it will show error by default they have to handle to handle the situation.\nWhile logging it will me more explanatory when i go through log if i create individual user defined exceptions for my error scenarios.\n\n\nNow I am wondering:\n\n\nIs it necessary to create individual user defined exceptions for each error scenario?\nHow most people handle errors and user defined exceptions in a better way?" ]
[ "java", "spring", "exception", "logging" ]
[ "Multiple viewports for GLFW", "I saw this article How to use multiple viewports in OpenGL?, and there are some answers says just resize viewport and generate new scene to make multiple viewports, but could I make multiple contexts point to same window, and set viewport at different location to make them exist at same time, if it's true, how do I do it in C++ GLFW?\nSorry, I am new to OpenGL" ]
[ "c++", "opengl" ]
[ "How to get the total number of Rows in a table | Cypress", "I have a table with N rows. How can I get the total number of rows present in the table?\nI search for a name, and that particular name is in row number X, how can I get the value of that particular row." ]
[ "cypress", "webautomation" ]
[ "MySQL update query on two tables but update only one table", "I have two tables:\n\n\nTable1: group_name, item_name, status \nTable2: group_name, geo\n\n\nI want to update table1. The default status is 0. I want to update the status of table1 to 1 using a single UPDATE statement.\n\nI want to check for each row in table1 if the group_name exists in table2. If so, I will update status to 1.\n\nI tried this but was not able to get the correct result.\n\nUPDATE table1\nSET table1.`STATUS`=1 \nWHERE table2.group_name=table1.group_name\n\n\nHow can I achieve my desired result?" ]
[ "mysql" ]