texts
sequence | tags
sequence |
---|---|
[
"expressing constraints in relational algebra",
"I need to express this constrain in relational algebra:\n\nI have some table with one column with all possible values: ALL_VAL\n\nand table with some values from ALL_VAL that not mach some rule: NOT_FIT_VAL\n\nand I can calculate FIT_VAL = ALL_VAL - NOT_FIT_VAL\n\nwhat i need is a constraint: in FIT_VAL there minimum one item.\n\nI am using not equal sign with empty group:\n\nALL_VAL,\n\nNOT_FIT_VAL\n\nFIT_VAL = ALL_VAL - NOT_FIT_VAL\n\nFIT_VAL <> {empty}\n\nbut I am not sure that <>(not equal) is allowed at all in relational algebra\nthere is not a single book or article that shows example or saying that I can use it.\n\nI would like some clarification about it, and the correct expression.\nthank you"
] | [
"relational-algebra"
] |
[
"How to follow a URL in R",
"Sorry for the bad title but I don't know how else to phrase \"follow\". \n\nI'm looking to remotely download a csv file from a website. I could do this by clicking the download button using RSelenium, but I've found that there's a direct link that will initiate the download for me. I.e. I could go to https://www.fake-website-url.com and click the download button, or I could just enter https://www.fake-website-url.com/exportcsv into my browser and it would automatically download.\n\nI try not to use RSelenium whenever I can help it since it's clunky, but I'm not sure how to just initiate the download. Nothing from rvest stands out since I'm not actually reading html. \n\nBasically, I'm looking for an R function like gotoURL('https://www.website.com/exportfullcsv) that will download the file just like it would if I entered the URL into my browser."
] | [
"r",
"web-scraping"
] |
[
"How do I make an iOS app support iPhone 6, without supporting iPhone 5S?",
"I want to support iPhone 6/6+, but not iPhone 5S. I know that I can use screen size to detect an iPhone 5S, but I don't want iPhone 5S users to be able to download the app in the first place. Is there a way to do that?"
] | [
"ios"
] |
[
"jQuery plugin patterns: something more object-oriented?",
"I'm working on a jQuery plugin, following the pattern detailed in the Authoring guide. Basically:\n\n(function($) {\n // Private\n var doSomething = function($element, settings) { ... }\n\n var doSomethingElse = function($element, settings) { ... }\n\n // Public\n var methods = {\n init: function(options) { ... },\n show: function() { ... },\n hide: function() { ... },\n update: function(content) { ... }\n };\n\n $.fn.myPlugin = function(method) {\n if (methods[method]) {\n return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));\n } else if (typeof method === 'object' || ! method) {\n return methods.init.apply(this, arguments);\n } else {\n $.error('Method ' + method + ' does not exist on jQuery.myPlugin');\n }\n };\n})(jQuery);\n\n\nHere's my dislike: I have to pass the same \"instance\" variables to all of the private functions. I'm still working on becoming a JS pro — so pardon my incorrect term usage — but if I were doing this same thing in Ruby or PHP, I'd create a class with all of these public and private members and methods, and each instance of the class would correspond to an $element. Then I could do something like this (in JS):\n\nvar firstElement = new MyPlugin($element, settings);\nfirstElement.doSomething();\n\n\nRather than passing $element and settings to doSomething(), it already has access to those via this.$element and this.settings.\n\nGet where I'm going with this? I'm looking for a more object-oriented approach, I guess. Now, I totally understand that JS doesn't have classes like Ruby or PHP. But between constructor functions, the module pattern, and regular object notation (like methods above), I'm not sure which is the best option for a jQuery plugin.\n\nCan someone help point me in the right direction? Maybe some examples of existing jQuery plugins that do this well? Thanks!"
] | [
"javascript",
"jquery",
"jquery-plugins"
] |
[
"How can I send a non-html-email in bold?",
"I want to send a simple email in php.\nIs it possible to make the Second Line of Text in bold without using html mail?\n\n<?php\n$msg = \"First line of text\\nSecond line of text\";\nmail(\"[email protected]\",\"My subject\",$msg);\n?>"
] | [
"php",
"email"
] |
[
"jquery success/error callbacks not firing",
"This seems to be a frequently encountered situation but none of the solutions suggested to the earlier problems seem to address mine! Neither the success nor the error callbacks are firing. However, the JSON data returned is accurate and all seems well on the server/firephp side as well. I've been staring at it for a few days now and would appreciate a hand!\n\nFirst, my Javascript call:\n\n$.ajax({\n url: global_siteurl+'myprog/get_my_data',\n data: \"\",\n type: 'post',\n dataType:'json',\n success: function () { \n alert(\"Success\");\n },\n error: function(){\n alert(\"Failed\");\n }\n});\n\n\nNow the server side php routine:\n\nfunction get_my_data() {\n $output=array();\n $output['status']=1;\n echo json_encode($output);\n}\n\n\nJSON ouput in Firebug:\n\nstatus 1\n\n\nWhat other info can I look at to debug this? Other calls very similar to this seem to be working just fine in my application so it has me flummoxed!\n\nMmiz"
] | [
"jquery",
"callback"
] |
[
"Possible to use Rails with no HTML? (Just Ruby)",
"I'm a Rails beginner messing around with a super simple app. \n\nWhat I'm wondering is whether you can use Rails strictly with the Ruby language and forget HTML all together.\n\nWhy I'm asking:\n\nIn my /testapp/app/views/welcome/index.html.erb file, (which is my homepage), I tested it with the code:\n\nputs \"Hello World!\"\n\n\nWhen I navigate to the page using the rails server the text includes the puts. I even changed the file name to /testapp/app/views/welcome/index.rb (omitting the html), it didn't work.\n\nCan I use Ruby like this? Or do I need to modify something within Rails to use Ruby like this? I don't get it.\n\nThanks!"
] | [
"ruby-on-rails",
"ruby",
"ruby-on-rails-4",
"syntax"
] |
[
"Add custom properties on formio builder",
"I want to create something like this\n\n\n\nI want to create a card which contains tags such as pharagraph, iframe, also inputs. I have successfully added custom component to my form builder but i need to pass a property for my new component. like, i have a component for iframe, but i need to pass a url to that component, anyone know how?\n\nHere's my codefor one of the component\n\n<div style=\"width: 100%;margin-top: 20px;\">\n <nb-card>\n <nb-card-body class=\"myIframe\">\n <iframe src=\"https://www.youtube.com/embed/gSfc4GhlZ44\" frameborder=\"0\" webkitallowfullscreen\n mozallowfullscreen allowfullscreen></iframe>\n </nb-card-body>\n </nb-card>\n </div>\n\n\ni want that iframe src to be dynamic and users can insert their url to that property. i appreciate any help\n\nEDIT\n\nHere's my builder html code\n\n <form-builder [form]=\"form\" (change)=\"onChange($event)\"></form-builder>\n<div class=\"well jsonviewer\">\n <pre id=\"json\"><code class=\"language-json\" #json></code></pre>\n</div>\n\n\nand builder.ts\n\nexport class StepBuilderComponent {\n\n @ViewChild('json', {static: false}) jsonElement?: ElementRef;\n public form: Object = {\n components: []\n };\n onChange(event) {\n this.jsonElement.nativeElement.innerHTML = '';\n this.jsonElement.nativeElement.appendChild(document.createTextNode(JSON.stringify(event.form, null, 4)));\n }\n\n}"
] | [
"angular",
"formio"
] |
[
"Newbie - Authentication headers for Iphone webservices (ASP>net MVC 3.0 REST)",
"We are developing an Iphone app that will talk to the ASP.net MVC 3.0 webservcies with RESTful Urls. Almost all the action are available for authorized users only. I am not sure how this can be accomplished as we use membership provider at the webservice end. How do we pass the authentication parameters *(username and password) to MVC actions from iPhone app. I believe iPhone can send only parameters in query string and not as request headers.. Thanks for any quick response.."
] | [
"iphone",
"asp.net-mvc-3",
"restful-authentication"
] |
[
"How to index a view that contains a union",
"Hi I want to create an index on a view but my view uses a union. Please see example\n\nSELECT t_1.RiskID,\n t_1.HRASnapshotId,\n t_1.RiskDate, \n t_1.RiskTypeDescription,\n t_1.AgillicUserId,\n t_1.SequenceNo, \n t_1.RiskValue,\n t_1.RiskLevelDescription,\n t_1.OrganisationID\nFROM dbo.BE_Risks_Sequenced AS t\nINNER JOIN dbo.BE_Risks_Sequenced AS t_1 ON \n t.RiskTypeDescription = t_1.RiskTypeDescription \n AND t.AgillicUserId = t_1.AgillicUserId \n AND t.SequenceNo = t_1.SequenceNo + 1\nWHERE (t.RiskValue = 1) \n AND (t.RiskLevelDescription NOT LIKE t_1.RiskLevelDescription)\n\nUNION ALL\n\nSELECT RiskID, HRASnapshotId, RiskDate, RiskTypeDescription, AgillicUserId, \n SequenceNo, RiskValue, RiskLevelDescription, OrganisationID\nFROM dbo.BE_Risks_Sequenced\nWHERE (SequenceNo = 1) AND (RiskValue > 1)\nORDER BY riskid asc"
] | [
"sql",
"sql-server"
] |
[
"How do shared_ptr react when assigned a new variable?",
"Hello members of stackoverflow,\n\nI'm currently trying my hands on c++ (been mostly programming in C#) and was wondering about memory management when using shared pointers.\n\nI have a class that basicly reads in a bunch of variables from a textfile:\n\nconstructor(string file){\n//..do stuff with file\n\ns = new string(valuefromfile);\narray_i = new int{value1, value2}\n}\nprivate:\nshared_ptr<string> s;\nshared_ptr<int*> array_i;\n\n\nAs far as i understood, sharedpointers help with memory allocation/leaks, since the allocated memory will be freed once all pointers are no more, without me having to deallocate them by hand, e.g. calling the classes deconstructor, or if used in a subroutine.\n\nNow my question is\n\nIf i read in a new file with the class, \"s\" and \"array_i\" will get new values:\n\nvoid readnewfile(string file){\n//...do stuff with file\ns = new string(newstring);\ni = new int{ newvalue1, newvalue2, newvalue3 };\n}\n\n\nnow the innitial values are not referenced anymore by those smartpointers. Will that mean the memory is freed, or do i have to watch out for something specific to prevent memory leaks?\n\nGreetings"
] | [
"c++",
"memory-management",
"smart-pointers"
] |
[
"how do you access to a pivot table in pandas to fill nan values in the original dataframe?",
"I have an original data frame with information from real estate properties. To fill nan values in the column price per m2 in usd I have made a multi-index pivot table that has the mean of the price per m2 sliced by property type, place and surface covered in m2. \nNow, I want to iterate in the original data frame´s column price per m2 in usd to fill nan values with the ones I created in the pivot table.\n\nPivot table code:\n\ndf6 = df4.pivot_table( values=['price_usd_per_m2'], \n index=['cuartiles_superficie_cubierta'],\n columns=['localidad','property_type'], \n aggfunc=['mean'])"
] | [
"python",
"pandas",
"pivot-table"
] |
[
"Git and windows 7 encoding conflicts ?",
"For some reason the files I got from remote are causing some problem on my repository. \nAs you can see in changes, it came with a unknown character, and in files I have this bad character I'm able to do nothing, commit, revert, accept mine or the 'others' files.\n\nI already tried reset HARD and re pull, re clone, no success until the moment. \nI think that it's some encoding problem, but I don't know what and where configure.\n\nNote: My repository is on bitbucket. \n\nSomeone can help me ?"
] | [
"git"
] |
[
"Create ES6 Class Methods from other class methods",
"So I have a class with a curried method\n\nclass myClass {\n constructor () {}\n\n curry (a,b) {\n return (a,b) => {}\n }\n\n}\n\n\nNow can create another method with the curry? Something like this\n\nclass myClass {\n constructor () {}\n\n curry (a,b) {\n return (a,b) => {}\n }\n\n newMethod = curry()\n}"
] | [
"javascript",
"ecmascript-6",
"currying",
"es6-class"
] |
[
"Images automatically changes after 5 seconds",
"I'm trying to write a code that change images automatically after 5 seconds with cross dissolve or any other animation. Sadly, my code doesn't work. Also I want that images would change all the time.\n\nextension UIImageView{\nvar imageWithFade:UIImage?{\n get{\n return self.image\n }\n set{\n UIView.transition(with: self,\n duration: 0.5, options: .transitionCrossDissolve, animations: {\n self.image = newValue\n }, completion: nil)\n }\n}\n\n\n}\n\noverride func viewDidLoad() {\n super.viewDidLoad()\n\n\n let firstImage: UIImage? = UIImage(named: \"toa-heftiba-461336-unsplash.jpg\");\n let secondImage: UIImage? = UIImage(named: \"capturing-the-human-heart-475168-unsplash.jpg\");\n\n imgView.imageWithFade = secondImage\n}\n\n\nAlso, how to make that 3 images would change and not only two of them.\nThank you!!"
] | [
"ios",
"swift"
] |
[
"Is there such thing as an ArraySet and ArrayMap?",
"I would like a map that preserves the order of the elements if there is such a thing.\n\nI am aware that it would not perform near as well as a HashMap, but I only plan to use it for small/temporary programs."
] | [
"java"
] |
[
"Change the size of an image when Click",
"I'm trying to make an image become bigger with a black-background in the back overflowing the content (just like a normal image gallery) anyway I have failed to achieve the results after days of attempts.\n\nHowever, I'm now trying to make the image bigger On Click, and go to the normal size when Hover-away. Is there anyway I can do so with JQ? I am not sure that I can do it with CSS. \n\nPlease take a look at the site and code that I am using at this moment: http://www.webdesignstudents.co.uk/students/loai_shehadeh/visual-identity.html\n\nThank you in advance."
] | [
"jquery",
"image",
"resize",
"onclick",
"image-gallery"
] |
[
"how to pass parameters to asp.net web api get method?",
"Following is my get method in ASP.NET Web API.\n\n[HttpGet]\npublic IHttpActionResult GetDetails([FromBody] RetrieveDetails eDetails)\n{}\n\n\nfollowing is the class\n\npublic class RetrieveDetails\n{ \n public string name{ get; set; } \n public string Type { get; set; } \n} \n\n\nWhen I try to call GetDetails from Fiddler eDetails is always null.\n\nhttp://localhost:101222/api/emailservice/GetDetails?name=testname&Type=testtype\n\nI tried different methods but the value is always null.\nIf I change [HttpGet] to [HttpPost] and add the request body its working fine. But I need get method."
] | [
"c#",
"asp.net",
"asp.net-web-api"
] |
[
"file system limit storage website azure",
"I have a website running on windows azure. The File System Storage Limit is 10GB and my applications is going to exceed the limit. How can I increase the capacity of the File System Storage?? I am using a website with a MySQL Database and reserved web site mode."
] | [
"azure",
"azure-storage"
] |
[
"Turn Off Navigation Properties",
"Using VS 2012, Entity Framework 5 and SQL Server Express 2012.\n\nI have a SQL Server database to service an application using Web API; as it is mainly for use on mobile devices, I want to minimize data transfer so I would like to disable Navigation Properties. I've set ProxyCreationEnabled and LazyLoadingEnabled to false which means that the related data does not get serialized which helps a lot but they are still appearing as empty arrays in the data returned in calls to the Web APIwhich means I will have to handle them some way in the AJAX calls.\n\nIs there some way to turn them off completely?"
] | [
"entity-framework",
"visual-studio-2012",
"entity-framework-5",
"ef-database-first"
] |
[
"Leiningen doesn't resolve my dependencies",
"I want to translate a Maven dependency to Leiningen:\n\n<dependency>\n <groupId>com.google.api.client</groupId>\n <artifactId>google-api-client-parent</artifactId>\n <version>1.4.1-beta</version>\n</dependency>\n\n\nI tried:\n\n(defproject gdata2 \"1.0.0-SNAPSHOT\"\n :description \"FIXME: write\"\n :dependencies [[org.clojure/clojure \"1.2.0\"]\n [org.clojure/clojure-contrib \"1.2.0\"]\n [com.google.api.client/google-api-client-parent \"1.4.1-beta\"]])\n\n\nHowever this doesn't work since there is no jar in the Maven central repository, just a parent pom. Leiningen tries to find google-api-client-parent-1.4.1-beta.jar and fails.\n\nHow do I tell Leiningen to just look at the pom and resolve the transitive dependencies?\n\nEdit May 12\n\nIt seems that the code I need is not in the standard Maven repositories. I have to add the Leiningen equivalent of:\n\n<repository>\n <id>google-api-services</id>\n <url>http://mavenrepo.google-api-java-client.googlecode.com/hg</url>\n</repository>\n\n\nAnd add google-api-services-tasks-1.0.0-beta.jar to the dependencies and then it is probably going to work. Will check and close this question when back from work :)"
] | [
"clojure",
"leiningen"
] |
[
"How to delete empty td's on browser",
"I am iterating a array list in gsp of groovy with grails, if any sub string present in the existing list don't display them on browser, other wise display them. For this i am getting output properly but I am getting empty td's on browser if the string doesn't displaying on the browser then it will shows as a empty td on the browser, so I want to delete that empty td's using jquery or html, please help me, how to solve this error.\nThanks."
] | [
"jquery",
"grails",
"groovy"
] |
[
"ElasticSearch Kibana monitor data starts to loss data",
"We have a small ElasticSearch 6.3.2 cluster with 5 nodes. All was good for a while until this morning. The monitoring charts in Kibana looks this way:\n\n\nAnd it's happening on all the monitoring indexes. Can anyone shed some light on this? I have no clue why it starts behave like this. We didn't do any change on ElasticSearch cluster or kibana recently."
] | [
"elasticsearch",
"kibana"
] |
[
"Is it possible to reference a shared project from another shared project?",
"I'm looking at the new shared Project Feature in Visual Studio 2013. It's a pretty nice Feature, but how can I use code from a "Base" shared Project in a "Higher Level" shared Project? Looks like the referencing feature is missing in shared Projects...???\nHow to build big real world business apps without the possibility to separate the code in multiple projects?\nUpdate:\nI think I was not clear enough:\nLet's say you want to develop a universal app for the Windows platforms and using xamarin for iOS and android support. So you put platform specific code to the platform specific Project, define Interfaces in the shared libraries and pass the platform specific code via dependency injection to the shared code and reference all platform specific libraries from from the platform specific projects.\nSo far so good...\nBut to keep the platform specific code small you develop the Business logic and a base Framework for the Business logic in the shared Projects.\nNow you have a second customer. Here of course you want to reuse the base Framework again and build just a new Business and UI layer.\nNow I would like to use the same framework layer in both Projects.\nHow to do this if references between shared Projects are not possible?\n(Linking files is not a possible Option, because a normal solution im my projects has about a 1000 files or more, so you will never ever be able to keep track of all files you have to link in all Solutions. / ilMerge is also not possible - it can not merge WPF Projects and is also not working for Android and iOS...)"
] | [
"visual-studio",
"visual-studio-2013",
"shared-project"
] |
[
"Flask allows multiple server instances to listen on the same port",
"I have been using flask and noticed this unusual behavior. \n\nMy flask application is set to run on port 5000 in my machine (It has only one network card). \n\nWhen I attempt to start more than one instance of the same flask application in my machine.\n\nWhat I Expected:\n\nA port address in use error when attempting to start the next instance bound on the same port.\n\nWhat actually happened: \n\nThey all start successfully and bind to the same port. This kind of behavior is not expected with most conventional servers that I have used.\nThankfully however, only one process out of the 'n' processes is triggered when a REST API call is made to the server.\n\nOperating System: Windows\n\nCan someone please explain why this behavior occurs, and how can I ensure that flask doesn't start the process successfully in such a case.\n\nnetstat -aon | find \"5000\"\n\nTCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 37036\nTCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 5024\nTCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 61684\n\nThe above are the 3 process that are running in parallel. \n\nAdditional Notes: \n\n\nI am using this in a virtualenv. \nThe way I have written my flask invocation. \n\nif __name__ == \"__main__\":\nmain()\napp.run(port=5000)\n\nRunning the code as python3 <filename>.py at the command prompt."
] | [
"python",
"flask",
"server"
] |
[
"Why is my css not being applied to my page?",
"I recently message boxes that style a message given during a php statement, and they style the message.\n\nThis is my php code.\n\nmysql_query(\"UPDATE account SET is_active=1, activation_code='' WHERE activation_code='$code'\");\n$message_good = '<div class=\"register_thankyou\"><p>Success! Your account has been activated. You may now <a href=\"login.php\">log in</a>.</p></div>';\n } else {\n$message_good = '<div class=\"register_error\"><p>Account has already been activated, or you have an invalid activation code.</p></div>';\n }\n\n\nFor some reason, it loads the style register_thankyou but not for register_error.\n\nBoth styles have this css setup.\n\n/* ACTIVATION MESSAGES */\n.register_thankyou {\n background-color: #e3f6da;\n border: 1px solid #3b7008;\n padding: 20px;\n}\n.register_thankyou h3 {\n font-size: 20px;\n font-weight: normal;\n margin: 0 0 10px;\n padding: 0;\n}\n.register_thankyou p {\n margin: 0;\n padding: 0;\n}\n\n.register_error {\n background-color: #f8e5e4;\n border: 1px solid #c41100;\n padding: 20px;\n}\n.register_error h3 {\n font-size: 20px;\n font-weight: normal;\n margin: 0 0 10px;\n padding: 0;\n}\n.register_error p {\n margin: 0;\n padding: 0;\n}\n\n\nAll thats different is the background and border color\n\nCan someone explain to me why one style is being applied and the other isnt?\n\nThank you: \n\nerror: \n\nit works on here tho: http://jsfiddle.net/q8ozgfmu/"
] | [
"css"
] |
[
"Go to page option.. find page",
"I made an app which has 100 pages and change through swipe, but I want to add \"Go to page\" option so I can go to the specific page easily.\n\npublic class ViewPagerExampleActivity extends Activity {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_viewpager_example);\n ExtendedViewPager mViewPager = (ExtendedViewPager) findViewById(R.id.view_pager);\n\n mViewPager.setAdapter(new TouchImageAdapter());\n }\n\n static class TouchImageAdapter extends PagerAdapter {\n\n private static int[] images = { R.drawable.page3, R.drawable.page4,\n R.drawable.page5, R.drawable.page6, R.drawable.page7,\n R.drawable.page8, R.drawable.page9, R.drawable.page10, R.drawable.page11,\n R.drawable.page12, R.drawable.page13, R.drawable.page14,\n R.drawable.page15, R.drawable.page16, R.drawable.page17,\n R.drawable.page18, R.drawable.page19, R.drawable.page20, R.drawable.page21,\n R.drawable.page22, R.drawable.page23, R.drawable.page24,\n R.drawable.page25, R.drawable.page26, R.drawable.page27,\n R.drawable.page28, R.drawable.page29, R.drawable.page30,\n R.drawable.page31, R.drawable.page32, R.drawable.page33, R.drawable.page34,\n R.drawable.page35, R.drawable.page36, R.drawable.page37,\n R.drawable.page38, R.drawable.page39, R.drawable.page40, R.drawable.page41,\n R.drawable.page42, R.drawable.page43, R.drawable.page44,\n R.drawable.page45, R.drawable.page46, R.drawable.page47,\n R.drawable.page48, R.drawable.page49, R.drawable.page50, R.drawable.page51,\n R.drawable.page52, R.drawable.page53, R.drawable.page54,\n R.drawable.page55, R.drawable.page56, R.drawable.page57,\n R.drawable.page58, R.drawable.page59, R.drawable.page60, R.drawable.page61,\n R.drawable.page62, R.drawable.page63, R.drawable.page64,\n R.drawable.page65, R.drawable.page66, R.drawable.page67,\n R.drawable.page68, R.drawable.page69, R.drawable.page70, R.drawable.page71,\n R.drawable.page72, R.drawable.page73, R.drawable.page74 };\n\n @Override\n public int getCount() {\n return images.length;\n }\n\n @Override\n public View instantiateItem(ViewGroup container, int position) {\n TouchImageView img = new TouchImageView(container.getContext());\n img.setImageResource(images[position]);\n container.addView(img, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);\n return img;\n }\n\n @Override\n public void destroyItem(ViewGroup container, int position, Object object) {\n container.removeView((View) object);\n }\n\n @Override\n public boolean isViewFromObject(View view, Object object) {\n return view == object;\n }\n }\n\n @Override\n public void onResume() {\n super.onResume();\n }\n\n @Override\n protected void onPause() {\n super.onPause();\n\n }\n\n long lastPress;\n @Override\n public void onBackPressed() {\n // TODO Auto-generated method stub\n super.onBackPressed();\n if (interstitial.isLoaded())\n interstitial.show();\n }\n}"
] | [
"android"
] |
[
"MySQL LEFT JOIN where multiple values",
"I have query that joins Products table on Product_Attributes table. I' would like to get products which meat exact condition ex.\n\nProducts which have attribute id 9 AND 16 selected, but when I run this query I'll get only product which meets first ID\n\nWHERE (\"AttributeValueID\" = 9 AND \"AttributeValueID\" = 16)\n\n\nI need that products to have both attributes selected AttributeValueID = 9 AND AttributeValueID = 9 not only this or that attribute ID. Using OR / IN is'not solution for me.\n\nUpdate:\n\nbelow is a part of query with join / where:\n\nLEFT JOIN \"Product_Attributes\" ON \"Product_Attributes\".\"ProductID\" = \"SiteTree_Live\".\"ID\" WHERE (\"PriceTax\" >= '100' AND \"PriceTax\" <= '200') AND (\"AttributeValueID\" IN ('9','8','7')) AND (\"AttributeValueID\" IN ('5','4'))\n\nthank you in advance for your help"
] | [
"mysql",
"sql",
"left-join",
"where",
"multiple-value"
] |
[
"Some user controls not loading when the 'Back' button is pressed",
"I'm working with ASP.NET and VB.NET.\n\nI have a page which contains 5 user controls.\nThe page itself does nothing, it just presents the user controls to the user.\n\nThe user controls work fine when I come on the page, or when I refresh, but when I go to another page, and press 'Back' only two of my user controls shows up, and they don't work like they're supposed to!\n\nShort description of the controls: \n\n\n2 controls which look if the user has to create something and shows an option to do so. (goes to the DB)\n2 controls show an overview if needed (goes to the DB)\n1 control looks if the user is an admin (does not go to the DB, but looks in the securityContext)\n\n\nSo what happens is:\n\nthe first 3 controls don't show up\n1 control shows his default state (although depending on the user it shouldn't)\nthe admin control always shows the admin link, even if the user isn't an admin\n\nI've tried looking at caching (disabling, enabling), I've tried cheating the viewstate, I've tried using a placeholder, page_init, ..\n\nNothing seems to work though, and I'd like this to actually work, 'cause I'm pretty sure users will do this a lot. When I refresh everything works like it should again, because the server gets contacted again..\n\nWhat should I do? :/\n\nSome code:\n\n<pm:MenuA ID=\"MenuA\" runat=\"server\" />\n<pmm:MultiStepMenuA ID=\"MultiStepMenuA\" runat=\"server\" />\n<rm:MenuB ID=\"MenuB\" runat=\"server\" />\n<mm:MenuC ID=\"MenuC\" runat=\"server\" />\n<br />\n<am:AdminMenu ID=\"AdminMenu\" runat=\"server\" />\n\n\n\n\nIMPORTANT UPDATE: I don't have this problem with Firefox, only IE9 :/"
] | [
"asp.net",
"vb.net",
"user-controls"
] |
[
"char(32) data as primary key?",
"(NOT a duplicate of Char(4) as Primary key or whatsoever.)\n\nI am designing SQL Server tables for my project. I have two tables so far: Data and Ref.\n\nData structure:\n\nDataID SomeData SomeOtherData RefID\n\n\nRef structure:\n\nRefID UniqueData AlmostNeverUsedData\n\n\nUniqueData contains unique char(32) values and is involved in every single query on Data.\nAlmostNeverUsedData is needed on ~5% of these queries.\n\nI know using a non-data, auto-incrementing int field as the primary key is almost always better, especially regarding JOIN performances. But in this case, using UniqueData as Ref's primary key would allow me to avoid using a JOIN 95% of the time, since all of the data I need would already be on Data.\n\nDo the remaining 5% justify using an auto-incrementing int, increasing the queries' (and therefore the application logic's) complexity?"
] | [
"sql",
"sql-server",
"database",
"key"
] |
[
"Render a template in block without loading the whole page",
"I have a template called base.html which looks simplified like this:\n\n<html>\n<head>\n <title>{% block title %} Title {% endblock %}</title>\n</head>\n<body>\n <div class=\"header\">\n {% block header %}My Header{% endblock %}\n </div>\n\n <div class=\"navigation\">\n {% block navigation %}My Navi{% endblock %}\n </div>\n\n <div class=\"content\">\n {% block content %}Content{% endblock %}\n </div>\n</body>\n</html>\n\n\nWhen i click on a link in the nav i want to render the new content in the content block without loading the header and navigation again."
] | [
"django",
"templates",
"block"
] |
[
"QtSpim - How can I change .ascii value in .data?",
"I load address of the .ascii with \"flores\" and I want change this to my name. I can put only my forename next to flores, but I want replace \"flores\" to \"kyanoz\"\n\nUser data segment [10000000]..[10040000]\n[10000000]..[1000ffff] 00000000\n[10010000] 1919904870 0000029541 0000000000 0000000000 f l o r e s . . . . . . . . . . \n[10010010] 0000000000 0000000000 0000000000 0000000006 . . . . . . . . . . . . . . . . \n[10010020]..[1003ffff] 00000000\n\n\nThanks"
] | [
"mips",
"qtspim"
] |
[
"How to match regex pattern on single line only?",
"I have the following regex and sample input:\n\nhttp://regex101.com/r/xK9dE3\n\nAs you can see it matching the first \"yo\". I only want the pattern to match on the same line (the second \"yo\") pattern with \"cut me\".\n\nHow can I make sure that the regex match is only on the same line?\n\nOutput:\n\nHi\n\n\nExpected Output (this is what I really want):\n\nHi\n\nyo keep this here\n\nKeep this here"
] | [
"java",
"regex"
] |
[
"Spreadsheet aggregation/manipulation",
"I have a spreadsheet structured like \n\n2005 Alameda total HS graduates 1234\n2005 Alameda UC enrollees 112 \n2006 Alameda total HS graduates 892\n2006 Alameda UC enrollees 84\n...\n2009 Yolo total HS graduates 1300\n2009 Yolo UC enrollees 93\n\n\nand so on for every CA county for several years. \n\nI want to generate a spreadsheet like this: \n\n county 2005 2006 ...\n Alameda 11.1% 9%\n Alpine 7% 8% \n ... \n Yolo 5.5% 4%\n\n\ni.e. I want to project the years from rows to columns and have a row for each county, then divide the number of graduates (the data from each odd-numbered row in the original sheet) by the number of UC enrollees (even-row data) for each year, and insert it in the appropriate cell. \n\nThis would be easy enough for me to do in Java, but I want to get a feel for what's possible just using excel/Google sheets alone - how might I go about accomplishing this?"
] | [
"excel",
"excel-formula",
"google-sheets"
] |
[
"best way to compare 2 variables with 4 values each",
"I have 2 variables... both of them can get a status (0,1,2,\"xxx\")\nWhat would be the best way to compare these variables? Or are a lot of if's and else if's the best way?\n\nif((Status1 && Status2) == 2){\n connectorImage = \"connector.png\";\n}\nelse if((Status1 && Status2) == 1){\n connectorImage = \"connector_grey.png\";\n}\n else if(Status1 == 1 && Status2 == 2){\n connectorImage = \"connector_greytogreen.png\";\n}..."
] | [
"javascript"
] |
[
"How to disable automatic style to img in ckeditor?",
"There is one problem when I work with ckeditor. I press on icon for adding images, then modal window appears and I put direct image link in the special field, in this moment width and height detected automatically and it writes to style for ex:\n\n<img src='#some images direct link' style='width:SOME WIDTH;height:SOME HEIGHT'>\n\n\nCan I disable this automatic function? Or I have to delete this style by myself every time?"
] | [
"ckeditor"
] |
[
"Plotting Mathematical Functions with Bokeh",
"I am currently working on an app where you can interact with the math function, adjust some variables in the function and see how the graph changes. Something like this.\n\nTry dragging the sliders and the graph will change, which I think suits best with Bokeh.\nIs there any way to plot a function in Bokeh or should I just split the function into tiny scatters and plug them in the function? What do you think is the best possible approach for this?"
] | [
"python",
"bokeh",
"graph-visualization"
] |
[
"Issue with parsing a function in Python (optionally with pyparsing)",
"I'm using the pyparsing library to parse a python-like programming language. I seem to be having trouble figuring out how to translate the BNF grammar into executable code.\n\nMy script is obviously more complex than this, but I've distilled the problem to a few lines:\n\narg_or_func_name = Word(alphanums + '_')\nexpr = Forward()\nfunc = expr + Literal('(') + Literal(')')\nexpr << (arg_or_func_name | func)\nstatement = expr + Literal(';')\n\nparsed = statement.parseString('func_a();')\n\n\nI want this to parse as [('expr', [('func', ['func_a', '(', ')')])]), ';']. Instead, it causes the error pyparsing.ParseException: Expected \";\", I assume because it greedily considers func_a as an arg_or_func_name, and then disregards the parentheses. \n\nHowever, when I reverse the order of the expr statement and change it to\n\nexpr << (func | arg_or_func_name)\n\n\nor when I do \n\nexpr << (func ^ arg_or_func_name)\n\n\nI get a maximum recursion depth exceeded error; apparently searching in this order results in some infinite recursive loop.\n\nI would like for my program to match the longest string possible (specifically, all of func_a()), but in a way that does not cause an infinite loop. Is this possible?\n\nI would much prefer to continue using pyparsing, so answers using that library would be greatly preferred, but I'd also appreciate any answers using other python tools for translating BNF grammars."
] | [
"python",
"parsing",
"pyparsing",
"bnf"
] |
[
"Will storageClass kubernetes.io/no-provisioner work for multi-node cluster?",
"Cluster:\n1 master \n2 workers\n\nI am deploying StatefulSet using the local-volume using the PV (kubernetes.io/no-provisioner storageClass) with 3 replicas.\nCreated 2 PV for Both worker nodes.\n\nExpectation: pods will be scheduled on both workers and sharing the same volume.\n\nresult: 3 stateful pods are created on single worker node. \nyaml :-\n\nkind: StorageClass\napiVersion: storage.k8s.io/v1\nmetadata:\n name: local-storage\nprovisioner: kubernetes.io/no-provisioner\nvolumeBindingMode: WaitForFirstConsumer\n---\nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n name: example-local-claim\nspec:\n accessModes:\n - ReadWriteOnce\n resources:\n requests:\n storage: 1Gi\n storageClassName: local-storage\n---\napiVersion: v1\nkind: PersistentVolume\nmetadata:\n name: example-pv-1\nspec:\n capacity:\n storage: 2Gi\n # volumeMode field requires BlockVolume Alpha feature gate to be enabled.\n volumeMode: Filesystem\n accessModes:\n - ReadWriteOnce\n persistentVolumeReclaimPolicy: Delete\n storageClassName: local-storage\n local:\n path: /mnt/vol1\n nodeAffinity:\n required:\n nodeSelectorTerms:\n - matchExpressions:\n - key: kubernetes.io/hostname\n operator: In\n values:\n - worker-node1 \n---\napiVersion: v1\nkind: PersistentVolume\nmetadata:\n name: example-pv-2\nspec:\n capacity:\n storage: 2Gi\n # volumeMode field requires BlockVolume Alpha feature gate to be enabled.\n volumeMode: Filesystem\n accessModes:\n - ReadWriteOnce\n persistentVolumeReclaimPolicy: Delete\n storageClassName: local-storage\n local:\n path: /mnt/vol2\n nodeAffinity:\n required:\n nodeSelectorTerms:\n - matchExpressions:\n - key: kubernetes.io/hostname\n operator: In\n values:\n - worker-node2\n\n---\n# Headless service for stable DNS entries of StatefulSet members.\napiVersion: v1\nkind: Service\nmetadata:\n name: test\n labels:\n app: test\nspec:\n ports:\n - name: test-headless\n port: 8000\n clusterIP: None\n selector:\n app: test\n---\napiVersion: v1\nkind: Service\nmetadata:\n name: test-service\n labels:\n app: test\nspec:\n ports:\n - name: test\n port: 8000\n protocol: TCP\n nodePort: 30063\n type: NodePort\n selector:\n app: test\n\n---\napiVersion: apps/v1\nkind: StatefulSet\nmetadata:\n name: test-stateful\nspec:\n selector:\n matchLabels:\n app: test\n serviceName: stateful-service\n replicas: 6\n template:\n metadata:\n labels:\n app: test\n spec:\n containers:\n - name: container-1\n image: <Image-name>\n imagePullPolicy: Always\n ports:\n - name: http\n containerPort: 8000\n volumeMounts:\n - name: localvolume \n mountPath: /tmp/\n volumes:\n - name: localvolume\n persistentVolumeClaim:\n claimName: example-local-claim"
] | [
"kubernetes",
"local-storage",
"kubeadm",
"kubernetes-pvc",
"kubernetes-statefulset"
] |
[
"EmbeddedDatabaseBuilder & org.h2.jdbc.JdbcSQLException: Wrong user name or password",
"Spring Boot 1.1.5.RELEASE\n\npublic class DataAccessTests\n{\n private EmbeddedDatabase db;\n\n @Before\n public void setUp()\n {\n EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n db = builder.setType(H2).addDefaultScripts().build();\n }\n\n @Test\n public void testDataAccess() {\n JdbcTemplate template = new JdbcTemplate(db);\n int r = template.queryForObject(\"select 1\", Integer.class);\n assertEquals(r, 1);\n }\n\n @After\n public void tearDown() {\n db.shutdown();\n }\n}\n\n\nException\n\norg.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-181]\n\n\nWhere I make a mistake?"
] | [
"java",
"spring",
"jdbc"
] |
[
"Xcode IOS Deployment target Options",
"In Xcode there are 5 columns when entering the Deployment target like shown below.\n\n\n\nResolved / AppName / Config (Pods) / App Name/ IOS Default\n\nWhat are all these columns/options for? Is there not just one IOS Deployment Target for the app.\n\nI understand that because I use Cocoa pods there could be a separate deployment type for the pods, but why the two columns with app name and ios default etc?"
] | [
"ios",
"xcode",
"ios6",
"xcode5"
] |
[
"vue2-leaflet-locatecontrol Error: max2 is undefined",
"I am using vue2-leaflet in my vue component. I am facing issue when using vue2-leaflet-locationcontrol.\nWhen I allow the browser to allow location access in the console i get the error\n\n\n TypeError: max2 is undefined\n\n\nHere is the sample code in the component:\n\n<l-map :zoom=\"zoom\" :center=\"center\" :bounds=\"bounds\">\n <l-tile-layer :url=\"url\" :attribution=\"attribution\" :no-wrap=\"true\"></l-tile-layer>\n <l-marker :lat-lng=\"marker\" :draggable=\"true\" @update:lat-lng=\"updateMarker\"></l-marker>\n <v-geosearch :options=\"geosearchOptions\" @showlocation=\"showLocation\"></v-geosearch>\n <v-locatecontrol />\n</l-map>\n\n\nimport in component\n\nimport { LMap, LTileLayer, LMarker } from \"vue2-leaflet\";\nimport { OpenStreetMapProvider } from \"leaflet-geosearch\";\nimport VGeosearch from \"vue2-leaflet-geosearch\";\nimport VLocatecontrol from \"vue2-leaflet-locatecontrol\";\n\n\nimport in main.js\n\nimport L from 'leaflet';\n\nL.Icon.Default.imagePath = '/themes/storefront/assets/public/image/';\nL.Icon.Default.mergeOptions({\n iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png').split(\"/\")[5],\n iconUrl: require('leaflet/dist/images/marker-icon-2x.png').split(\"/\")[5],\n shadowUrl: require('leaflet/dist/images/marker-shadow.png').split(\"/\")[5],\n});\nimport 'leaflet/dist/leaflet.css';\nimport 'leaflet-geosearch/assets/css/leaflet.css';\n\n\n\nWhat I am doing wrong?"
] | [
"vuejs2",
"leaflet"
] |
[
"Defining optional inputs in CoreML for recurrent network",
"I have recently stumbled upon an article on the CoreML docs site that discusses an implementation of a recurrent model for predicting text. I am trying to replicate this, or at least something similar, and have hit a wall as to how the author was able to define the \"stateIn\" input in the model as optional. Does anyone have any info that may point me in the right direction? I'm building the network using keras and plan on converting to CoreML after training.\n\nThe process used in this article would apply perfectly to my model. Outputting the state of the last layer and passing it back into the model for the next item in the sequence seems like a great approach, however I am unclear on how this is achievable using CoreML.\n\nAny information or help would be greatly appreciated!\n\nThanks ahead of time\n\nLink to the article:\nhttps://developer.apple.com/documentation/coreml/core_ml_api/making_predictions_with_a_sequence_of_inputs"
] | [
"ios",
"swift",
"keras",
"coreml"
] |
[
"javascript private inner functions in module with access to \"this\" scope",
"Possible Duplicate:\n Javascript outer scope variable access \n\n\n\n\nI have a javascript module that looks something like below. The main issue I'm having is how to access variables in the \"this\" scope from the private someOtherFunc. Is there a way to access this.myvar in the private someOtherFunc\n\nvar mymodule = (function(){\n\n return { \n MyObj : function() {\n\n this.myvar = 123;\n\n this.publicfunc = function() {\n someOtherFunc();\n };\n\n var someOtherFunc = function() {\n //this doesn't seem to work\n this.myvar = 456;\n };\n\n }\n }\n}\n\n\nThe idea is that I want to be able to do something like\n\nnew mymodule.MyObj().publicfunc, but make the someOtherFunc private"
] | [
"javascript",
"function",
"scope"
] |
[
"Facebook Graph API for pages using iOS SDK",
"I'm trying to retrieve the conversations that the page had with it's users/visitors. I was able to retrieve the conversations for the page using the below call. I do have the right page access token in the 'pgAccessToken' variable.\n\nNSMutableDictionary *params = [[NSMutableDictionary alloc] init];\n[params setObject:pgAccessToken forKey:@\"access_token\"];\n[params setObject:@\"fields\" forKey:@\"fields\"];\n\nFBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]\n initWithGraphPath:@\"/{page-id}/conversations\"\n parameters:nil tokenString:pgAccessToken\n version:nil HTTPMethod:@\"GET\"];\n[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {\n NSLog(@\"Output : %@\", result);\n}];\n\n\nI was able to receive a list of conversations.\n\n{\n \"data\": [\n {\n \"created_time\": \"2015-12-12T02:24:21+0000\",\n \"id\": \"m_mid.1449888061289:b3ec94g1ec0729d776\"\n },\n {\n \"created_time\": \"2015-12-12T02:23:08+0000\",\n \"id\": \"m_mid.1449887988645:94905084ecfdf89812\"\n }\n ],\n \"paging\": {\n \"previous\": \"https://graph.facebook.com/v2.5/t_mid.1448167619182:200955bd99614aa136/messages?format=json&access_token={MYACCESSTOKEN}&limit=25&since=1449887061&__paging_token={MYPAGINGTOKEN}&__previous=1\",\n \"next\": \"https://graph.facebook.com/v2.5/t_mid.1448167619182:2009335d99614aa136/messages?format=json&access_token={MYACCESSTOKEN}&limit=25&until=1448167619&__paging_token={MYPAGINGTOKEN}\"\n }\n}\n\n\nNow I'm trying to receive messages in the conversation. Which I can get by hitting the node '{conversation-id}/messages' but it just gives me a timestamp and message id as part of the response.\n\nWhat I want is not just the time stamp and message id, but instead the from, to and message contents. I tried the Graph API Explorer but it would still return the same data when I use the following different nodes.\n\n/{conversation-id}/messages\n\n/{message-id}\n\nCan any one help ?\n\n++++UPDATE++++ \nFIGURED IT OUT. PASTED BELOW IS THE ANSWER IF SOMEBODY ELSE COMES ACROSS THE SAME ISSUE.\n\nFinally figured this out after a few tries with Graph API Explorer tool on facebook developer page. \n\nThe way to get more fields is by supplying the fields I wanted in addition to the default that were being sent to me. \n\nNSString *pgAccessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@\"PAGE_ACCESS_TOKEN\"]; //I have my page accesstoken stored here.\n\nNSMutableDictionary *params = [[NSMutableDictionary alloc] init];\n[params setObject:@\"message_count,updated_time,participants,snippet\" forKey:@\"fields\"];\n\nFBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]\n initWithGraphPath:@\"/{page-id}/conversations\"\n parameters:params tokenString:pgAccessToken\n version:nil HTTPMethod:@\"GET\"];\n\n__weak MessagesTableViewController *weakSelf = self;\n[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {\n NSLog(@\"Output : %@\", result);\n //Process your result here, add to local array, reload table etc.\n}];"
] | [
"ios",
"facebook",
"facebook-graph-api",
"facebook-ios-sdk"
] |
[
"Change Visual Studio 2017 .props location file",
"I am new in visual studio 2017 \n\nI have imported a qt project file (.pro) and created a .vcxproj file with QtVSTools, my problem is that it generate a lot of intermediate files including a \n\n$(Configuration)/qmake/qtvars_(Platform)_(Configuration).props file. \n\nMy question is how to customize this file location to a desired eg. \n\n$./build/(Configuration)/qmake/qtvars_(Platform)_(Configuration).props \n\nI have already search for this customization in the project properties with no luck. \nI really appreciate your help in finding a solution."
] | [
"visual-studio-2017"
] |
[
"What is the best way to convert a video to a List in EmguCV",
"I want to store every frame from my video in a generic List, to process it later on. I have the list declared as followed: List<Image<Bgr, Byte>> Stream_to_Images = new List<Image<Bgr, Byte>>();. \n\nTo import it I have created a timer which ticks every 33 milliseconds, in oder to get every frame. The event which is triggering should import the frame to the list. Therefore I have tried the following lines:\n\nEither just a simple .Add()\n\nStream_to_Images.Add(_capture.QueryFrame());\n\n\nOr a counter for every frame, and adressing every Position itself.\n\nStream_to_Images[StreamPosition] = _capture.QueryFrame();\nStreamPosition++;\n\n\nUsing the first, my whole list contains only one frame, not the last one but one from the very end of the video, the second option results in an ArgumentOutOfRangeException. I am running out of ideas, are there any other ways to store every frame from my video in a list? \n\n** UPDATE **\n\nI have tried to change from a List to an Array, by using this\n\nimageBox1.Image = _capture.QueryFrame();\nimage_array.Add(_capture.QueryFrame());\n\n\nBut still, if I try to interate the array and display the video, I only get a picture of the last frame."
] | [
"c#",
"list",
"opencv",
"emgucv"
] |
[
"Is there a direct function in python to normalise values in a single column of a matrix?",
"Is there a function in any python library by which I can normalize certain columns of a matrix independently? For instance: \n\n1 2 3\n1 2 4\n1 2 5\n\n\nif I want a transformation of the above matrix to \n\n1 1 3\n1 1 4\n1 1 5\n\n\ni.e normalize the values in the 2nd column.\n\nThanks in advance."
] | [
"python",
"numpy",
"scikit-learn"
] |
[
"Setting Firefox preferences using policies.json",
"Scenario: A custom(legacy) app depends on Firefox on Windows. The following Firefox preferences are manually configured at install:[default]\n\n modify: \"dom.popup_maximum\": [20] 500,\n modify: \"browser.cache.check_doc_frequency\":[3] 1,\n create: \"dom.successive_dialog_time_limit\": 0,\n\n\nGoal: Update all current Firefox installs to a current version and apply the custom settings using enterprise capabilities. Establish process to manage Firefox for all future installs and updates. Don't break the app.\n\nProblem: These changes can be easily applied individually via about:config. They are not part of the GPO templates and its not clear how to add them or if it can be done. Applying them via policies.json doesn't seem to work either.\n\nOn a representative test machine, a directory called \\distribution has been created in the same directory as the firefox.exe [standard install, no hanky panky]. The file policies.json exists in the \\distribution directory:\n\n{\n \"policies\": {\n \"Homepage\": {\n \"StartPage\": \"homepage\",\n \"URL\": \"https://www.google.com/\"\n },\n \"NewTabPage\": true,\n \"DontCheckDefaultBrowser\": true,\n \"Preferences\": {\n \"browser.cache.disk.enable\":true,\n \"dom.popup_maximum\": -1,\n \"dom.successive_dialog_time_limit\": 0,\n \"browser.cache.check_doc_frequency\":1\n }\n }\n }\n\n\nabout:policies results\n\nThis image shows the results of about:policies. The other settings, used to validate that the policies are working, get applied.\n\nThe results from about:config show that the three preferences that I need to affect, have not changed:\n\ndom.popup_maximum;20\nbrowser.cache.check_doc_frequency;3\nand dom.successive_dialog_time_limit does not get created.\n\n\nI believe that these are old preference options. But I also believe that if I can make the changes manually and achieve the desired results, there must be a method to accomplish it programatically."
] | [
"firefox"
] |
[
"Why ROUND function doesn't work with Big decimal data?",
"I want to do a conditional test given as :\n\nS0 = FILTER E1ECPRA BY ((NO_PCI != '0') AND (ROUND(MT_DVS) != 0) AND (ROUND(MT_EUR) != 0));\n\n\nWhere MT_EUR and MT_DVS are big decimal data.\n\nFirstly they are defined as :\n\nE1ECPRA = FOREACH E1ECPRA_BRUT GENERATE\n MT_DVS AS MT_DVS,\n MT_CVE AS MT_EUR;\n\n\nwhere MT_CVE and MT_DVS are bigdecimal also.\n\nThe problem is :\n\n\n Could not infer the matching function for org.apache.pig.builtin.ROUND\n as multiple or none of them fit. Please use an explicit cast.\n\n\nHow can I resolve this problem please ?"
] | [
"apache-pig"
] |
[
"Using a variable through a Query located in a table",
"Basically I have a procedure that is supposed to take queries from a table and run them. This works fine except when I try to define a variable in the procedure that is referenced in the query. I simply define the variable using: \n\nDECLARE @spcode as varchar(255)\nSET @spcode = 'C'\n\n\nAnd then in the table I reference it here:\n\n...\nwhere sp_flag = @spcode\n...\n\n\nMy procedure then runs through the table and executes all of the queries in the table, this works if I simply set sp_flag = 'C', but if I try to set it to the variable defined in the procedure I get the following error:\n\nMsg 137, Level 15, State 2, Line 7\nMust declare the scalar variable \"@spcode\".\n\n\nI have searched around but I have not been able to find a solution to this problem, perhaps someone has an idea of how I would go about fixing this problem?\n\nThanks,\n\nSam"
] | [
"sql",
"sql-server"
] |
[
"Loading view in UINavigationController that only appears for a given subview and disappears for others",
"My application consists of a tabbar controller with several tabs, each with a navigation controller in them. One of these nav controllers contains a table populated via a web service. I'd like to have an overlay on the table (or a different view) that says the service is not reachable if it isn't reachable. However, I only want this overlay on the table, and not on other tabs.\n\nWhat is the best way to do this? My current solution is a loading view that appears for the table when it appears, or when there is a change in reachability and this loading view disappears on viewdiddissapear. I like being able to put a semi-transparent loading view on top of the table so you can see the old data I guess....\n\nAre there better/alternate ways to do this?"
] | [
"iphone",
"ios",
"uinavigationcontroller",
"uitableview"
] |
[
"Coffeescript: Check whether value in json",
"To check whether value is available in json. I am using following code\n\n $scope.bindRoles.push\n Name: \"Name\"\n Editable: if item in $scope.rolesOfLoggedUser then true else false // here i am checking if item is present in $scope.rolesOfLoggedUser then set value of Editable as true.\n\n\nwhere, $scope.rolesOfLoggedUser = [\"Admin\", \"Role1\", \"Role2\"]\n\nMy requirement is, i want to check one more thing in that if statement. Either item or \"Admin\" is present in $scope.rolesOfLoggedUser then set value of Editable as true.\n\nHow can i do that?\n\nPlease help,\nThanks"
] | [
"json",
"coffeescript"
] |
[
"How to use the marathon healthChecks?",
"I execute git clone https://github.com/mesosphere/marathon.git to download the latest marathon,And I had known from marathon doc that we can set the property of 'healthChecks' to Monitor the job.\n\nbut when i start marathon , i can't find the property 'healthChecks' anywhere, \n\nAnd i am sure that the marathon i had download is the latest.\n\nanybody could tell me how to use the 'healthChecks' ?\n\nthis is the marathon doc for 'healthChecks'\n\nAnd you can see it on http://mesosphere.github.io/marathon/docs/rest-api.html#post-v2-apps\n\n \"healthChecks\": [\n {\n \"protocol\": \"HTTP\",\n \"path\": \"/health\",\n \"gracePeriodSeconds\": 3,\n \"intervalSeconds\": 10,\n \"portIndex\": 0,\n \"timeoutSeconds\": 10,\n \"maxConsecutiveFailures\": 3\n },\n {\n \"protocol\": \"TCP\",\n \"gracePeriodSeconds\": 3,\n \"intervalSeconds\": 5,\n \"portIndex\": 1,\n \"timeoutSeconds\": 5,\n \"maxConsecutiveFailures\": 3\n },\n {\n \"protocol\": \"COMMAND\",\n \"command\": { \"value\": \"curl -f -X GET http://$HOST:$PORT0/health\" },\n \"maxConsecutiveFailures\": 3\n }\n],"
] | [
"marathon"
] |
[
"Why the PTS is within pts_of_this_metadata + pixel_exposure_time_ns + rolling_shutter_skew_time_ns",
"Stated by Google's Camera Motion Metadata of VR180:\n\npts_of_this_metadata(t0) is the exposure start of the first used scanline in a video frame.\npixel_exposure_time_ns(t_pixel) is the exposure time for a single pixel in nanoseconds.\nrolling_shutter_skew_time_ns(△t) is the delay between the exposure of the first-used scanline and the last-used scanline.\nThe PTS of the corresponding frame should be within\nt0 and t0 + △t + t_pixel.\n\nLet t_line be the exposure time for a scanline (which is multiple t_pixel).\nWhy is t0 + △t + t_pixel, not t0 + △t + t_line?\nIt seams to me that t0 to t0 + △t + t_line express the whole frame exposure."
] | [
"metadata",
"google-streetview-publish"
] |
[
"Sum a range of column",
"I am kind of new to excel, could you please help me with below question?\n\nI want to a sum of column only if the all the column in the row have value, could you please help me on this?\n\n A B C D E F\n\n 1 1 2 3 4 5 10\n\n 2 6 4 5 6 7 9\n\n 3 8 5 6 7 10\n\n 4 9 3 3 3 \n\n\nI want to do a sum of f1:f100 and I want to do sum only if A B C D E have values in it, if any of the column in a row have empty value, i want to ignore it. like now I need to ignore F3 and F4.\n\nBasil Abraham."
] | [
"excel",
"excel-2007",
"excel-2010",
"vba"
] |
[
"How to change TextButton Style in Gxt 3.0",
"I want to change style of textbutton like i want to add background image and i want to change background color using GXT 3.0\n\nsomeone help me plzzz\n\nThanks in advance"
] | [
"css",
"gxt"
] |
[
"Change language in Google map",
"I have been using the following link for changing the language on fragment start change-language-google-map-v2-android\n,the language of the phone gets changed but on the map it doesn't. I'm using com.google.android.gms.maps.MapView inside the fragment. Appreciating for any help!"
] | [
"android",
"google-maps",
"locale"
] |
[
"How to Clean an input field value using jquery?",
"This time I need help to complete my script, \nI got this table in my HTML page\n\n<div class=\"Productos\">\n <table id=\"products\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n <thead>\n <tr>\n <th class=\"left\">Prod</th>\n <th>\n <center>Desc</center>\n </th>\n <th>qty</th>\n <th>Price</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><a href=\"javascript:popUp2('some_link_here','700','400');\"><input type=\"text\" name=\"f_prod_id\" size=\"10\" value=\"5060102\" readonly></td>\n <td class=\"left\">desc1</a></td>\n <td>\n <input type=\"number\" name=\"f_qty\" min=\"1\" max=\"9999\" step=\"1\">\n </td>\n <td>35.17</td>\n </tr>\n <tr>\n <td><a href=\"javascript:popUp2('some_link_here','700','400');\"><input type=\"text\" name=\"f_prod_id\" size=\"10\" value=\"5060101\" readonly></td>\n <td class=\"left\">desc2</a></td>\n <td>\n <input type=\"number\" name=\"f_qty\" min=\"1\" max=\"9999\" step=\"1\">\n </td>\n <td>18.48</td>\n </tr>\n </tbody>\n </table>\n</div>\n\n\nWhat I need to do is to clean the value of the item f_qty. I am using the following syntax to get it done:\n\n$('#f_qty').val('');\n\n\nBut it does not work. In my HTML screen, my old values are still there. Any suggestions?\n\nHere is my JavaScript:\n\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\">\n<title>Totalizar</title>\n<script type=\"text/javascript\">\n$(function () {\n $(\"#Calculate\").click(\n // move value\n function () {\n $(\"input[name=f_qty]\").each(function () {\n var valueInCurrentTextBox = $(this).val();\n var productId = $(this).find(\".f_prod_id\").text();\n\n if (valueInCurrentTextBox != '') {\n $(\"#P23_qty\").val(valueInCurrentTextBox);\n alert('codid : ' + (productId));\n $('#f_qty').val('');\n }\n });\n });\n});\n</script>\n</head>\n<body>\n<div id=\"totals\"></div>\n<p style=\"clear: both;\">\n<button type=\"button\" style=\"font-weight: bold; width: auto;\" id=\"Calculate\">Agregar Productos</button></p>\n</body>\n</html>"
] | [
"jquery"
] |
[
"C++ Vector of Subclasses, using it to overload the istream/ostream",
"I'm looking to hold a Vector of Objects, of which will be Subclasses. \n\nI thought I would be able to do it by declaring a Vector of Pointers to the Baseclass (Such as vector<BaseClass*> db), and then declare it as a Subclass by doing something like db.pushback(new subclass) (My example in the link below is a touch different, but along the same lines);\n\n\nIs it possible to store Multiple subclasses in this sense Or will I need to define a new Vector for each SubClass? In the example given, there is only 1, but realistically in my program there is four.\nIf so, in my overloaded >> in SubClass1, would dynamic casting the type to a BaseClass work to call the friended overloaded >> in the BaseClass?\n\n\nhttp://ideone.com/QM5sRY\n\nEdit:\n\nSorry, I wasn't entirely clear in my second half of the question. I should have expanded.\n\nI have a program which needs to take an input, and distribute it throughout the respective Classes and Subclasses. It should take the input as Cin >> class;, in which case I have overloaded the >> operator. \n\nHowever, when I define the data as the Subclass (lines 34 to 39, and line 44), it appears to call it as a BaseClass, rather than a Subclass. It then calls the friend function defined in the Baseclass at line 10, rather than in than line 21. \n\nI'm not completely sure where I am going wrong.\n\nIdeally the output should be\n\nPrinting:Data\nX = 1\nY = 2"
] | [
"c++",
"oop",
"inheritance",
"vector",
"overloading"
] |
[
"Ignoring exceptions handled by other assembly",
"I have an application for smoke testing several key services. I want these tests to be easily written and self discovering. To this end, I have created an attribute for each method in the style of [TestMethod] from MSTest. I have also created a object that will find all these methods and execute them within a try-catch. If the method throws an exception I report as a failure, otherwise as a success.\n\nThis is all very unit test familiar and that is the intention. So a test would look like...\n\n[MyTestAttribute]\npublic void TestingTimesAhead()\n{\n var d = DateTime.MaxValue.AddDays(1);\n}\n\n\nThe magic happens in the test object, this has an Action property and a Run method...\n\n public Action TestAction { get; private set; } \n\n public override ITestResult RunTest()\n {\n try\n {\n this.TestAction.Invoke();\n return new BaseTestResult() { Result = TestResultStatus.Success };\n }\n catch(Exception ex)\n {\n return new BaseTestResult() { Result = TestResultStatus.Failure, FailureException = ex};\n }\n }\n\n\nWhen ran in isolation the above test, being wrapped as the Action, will cause an exception and the test fails. Perfect.\n\nHowever, when I wrap the attributes and test running object up into a dll and reference from a new project, VS Debugger breaks for the exception.\nI am presented with an option in that dialog to toggle 'break when this exception type is user-unhandled'.\n\n\nI can suppress exceptions on a type by type basis, but that isn't going to work for reuse. Also, if I run the release build from the BIN output, the expected behaviour is there - it's just a really awkward development experience.\n\nIs it possible to manage this exception setting from my code instead? Or if anyone can suggest a way around the problem, I'm open to ideas."
] | [
"c#",
"testing",
"exception-handling"
] |
[
"How can I sort an ArrayList>?",
"So I'm working on a Breadth-First search function for a program I'm working on for school, and when I go through the outgoing edges for a given node, by virtue of how I'm going through my possible edges, it looks something like this:\n\n[[A, 1], [D, 1], [C, 2], [D, 2]]\n\n\nBut what I really want is this:\n\n[[A, 1], [C, 2], [D, 1], [D, 2]]\n\n\nWhere the first index of a pair is the name of the node that the edge points to, and the second index is the label for the edge. Essentially I want to go through these edges alphabetically, first by node name, then by label name, but I'm not sure how to do that, since Collections.sort() doesn't work for a 2D ArrayList. Any pointers/ideas on a good method to sort this? Thanks everyone!\n\nEDIT: I am using JRE 1.7 for this assignment, not 1.8"
] | [
"java",
"sorting",
"arraylist"
] |
[
"Class decorators in Python 2.5?",
"Is there a way I can make class decorators work on Google App Engine, which is limited to Python 2.5?\n\nOr let me rephrase that: is it possible to alter the behavior of Python's parser from the same process that it is already executing? Example:\n\ngood.py:\n\nalter_python_parser()\nimport bad\n\n\nbad.py:\n\n@decorated\nclass Foo(object): pass\n\n\nOr is this maybe just plainly impossible.\n\nExplanation: I want to use a third party library that heavily uses class decorators, and don't want to fork it and maintain my own version. An alternative would be to run my code on Typhoon App Engine with a newer python, but I fear Google won't upgrade their Python version for a loooong time...\n\nEDIT:\n\nHow about creating a new-style import hook that would do string substitution on-the-fly and load the module from memory? That should be possible. I'll give it a try, if there's no implementation already out there.\n\nBut how can I parse Python 2.6+ code from Python 2.5? Is there a python-only parser? What does PYPY use?"
] | [
"python",
"google-app-engine",
"python-2.5"
] |
[
"How remove Duplicates In While Loop if you read each words",
"How can I remove duplicates in this snippet. Distinct function in the query will not work due you reading each word every loop and add into the table. How can i show all distinct data to show in my table\n\n<?php\n $connect = mysqli_connect(\"localhost\", \"root\", \"\", \"dbProject\");\n $output = '';\n if(isset($_POST[\"query\"]))\n {\n $search = mysqli_real_escape_string($connect, $_POST[\"query\"]);\n $SearchEach= explode(\" \",$search);\n $output .= '<div class=\"table-responsive\">\n <table class=\"table table bordered\">\n <tr>\n <th>Book ID</th>\n <th>Name</th>\n <th>Author</th>\n <th>Tags</th>\n <th>Status</th>\n\n </tr>';\n foreach($SearchEach as $value){\n $query = \"\n SELECT * FROM tblProject \n WHERE tyear >=YEAR(NOW())-30 AND (tags LIKE '%\".$value.\"%'OR\n tcname LIKE '%\".$value.\"%' OR\n author LIKE '%\".$value.\"%' OR\n status LIKE '%\".$value.\"%')\";\n $result = mysqli_query($connect, $query);\n while($row = mysqli_fetch_array($result))\n {\n $output .= '<tr>\n <td>'.$row[\"tcno\"].'</td>\n <td>'.$row[\"tcname\"].'</td>\n <td>'.$row[\"Author\"].'</td>\n <td>'.$row[\"tags\"].'</td>\n <td>'.$row[\"status\"].'</td>\n </tr>';\n }\n }\n echo $output;\n }\n ?>"
] | [
"php",
"html",
"mysqli"
] |
[
"Communicating with ViewModel from MainView",
"I am new to MVVM and still trying to get a grasp on it so let me know if I'm setting this up wrong. What I have is a UserControl with a ListView in it. I populate this ListView with data from the ViewModel then add the control to my MainView. On my MainView I have a button that I want to use to add an item to the ListView. Here is what I have:\n\nModel\n\npublic class Item\n{\n public string Name { get; set; }\n\n public Item(string name)\n {\n Name = name;\n }\n}\n\n\nViewModel\n\npublic class ViewModel : INotifyPropertyChanged\n{\n\n #region INotifyPropertyChanged Members\n\n public event PropertyChangedEventHandler PropertyChanged;\n\n private void OnPropertyChanged(string propertyName)\n {\n if (PropertyChanged != null)\n {\n PropertyChanged(this, new PropertyChangedEventArgs(propertyName));\n }\n }\n #endregion\n\n private ObservableCollection<Item> _itemCollection;\n\n public ViewModel()\n {\n ItemCollection = new ObservableCollection<Item>()\n {\n new Item(\"One\"),\n new Item(\"Two\"),\n new Item(\"Three\"),\n new Item(\"Four\"),\n new Item(\"Five\"),\n new Item(\"Six\"),\n new Item(\"Seven\")\n };\n }\n\n public ObservableCollection<Item> ItemCollection\n {\n get\n {\n return _itemCollection;\n }\n set\n {\n _itemCollection = value;\n OnPropertyChanged(\"ItemCollection\");\n }\n }\n}\n\n\nView (XAML)\n\n<UserControl.Resources>\n <DataTemplate x:Key=\"ItemTemplate\">\n <StackPanel Orientation=\"Vertical\">\n <Label Content=\"{Binding Name}\" />\n </StackPanel>\n </DataTemplate>\n</UserControl.Resources>\n\n<UserControl.DataContext>\n <local:ViewModel />\n</UserControl.DataContext>\n\n<Grid>\n <ListView ItemTemplate=\"{StaticResource ItemTemplate}\" ItemsSource=\"{Binding ItemCollection}\">\n\n </ListView>\n</Grid>\n\n\nMainWindow\n\npublic partial class MainWindow : Window\n{\n public MainWindow()\n {\n InitializeComponent();\n this.mainContentControl.Content = new ListControl();\n }\n\n private void Button_Add(object sender, RoutedEventArgs e)\n {\n\n }\n}\n\n\nMainWindow (XAML)\n\n<Grid>\n <DockPanel>\n <StackPanel DockPanel.Dock=\"Top\" Orientation=\"Horizontal\">\n <Button Width=\"100\" Height=\"30\" Content=\"Add\" Click=\"Button_Add\" />\n\n </StackPanel>\n <ContentControl x:Name=\"mainContentControl\" />\n </DockPanel>\n</Grid>\n\n\nNow, from what I understand, I should be able to just an item to ItemCollection and it will be updated in the view. How do I do this from the Button_Add event?\n\nAgain, if I'm doing this all wrong let me know and point me in the right direction. Thanks"
] | [
"c#",
"listview",
"mvvm"
] |
[
"Module Importing issue",
"When running the app getting the following error. Requiring unknown module \"583\"."
] | [
"react-native"
] |
[
"How can I drag more than 2 images in PyGame?",
"i have this code but i wanna make this with other 4 images?\n import pygame\n from pygame.locals import *\n\n pygame.display.init()\n screen = pygame.display.set_mode((1143,677 ))\n\nimg = pygame.image.load(r"C:\\Users\\ga-sa\\Downloads\\As.png")\nimg1 = pygame.image.load(r"C:\\Users\\ga-sa\\Downloads\\03.png")\nimgPos = img.get_rect(topleft = (20, 20))\nimgPos1 = img1.get_rect(topleft = (60, 20))\ncurrent_image = None\n\n LeftButton = 0\nwhile 1:\nfor e in pygame.event.get():\n if e.type == QUIT:\n pygame.quit()\n exit(0)\n\n if e.type == pygame.MOUSEBUTTONDOWN:\n if imgPos.collidepoint(e.pos):\n current_image = 0\n elif imgPos1.collidepoint(e.pos):\n current_image = 1\n else: \n current_image = None\n\n if e.type == MOUSEMOTION:\n if e.buttons[LeftButton]:\n rel = e.rel\n if current_image == 0:\n imgPos.x += rel[0]\n imgPos.y += rel[1]\n elif current_image == 1:\n imgPos1.x += rel[0]\n imgPos1.y += rel[1]\n\nscreen.fill(0)\nscreen.blit(img, imgPos)\nscreen.blit (img1, imgPos1)\npygame.display.flip()\npygame.time.delay(30)\n\nso this my code i want to put 4 image , instead only two images , i would like to put more images but is a boolean so is 0 or 1"
] | [
"python",
"pygame",
"pygame-surface"
] |
[
"Getting Null CallableStatement with Mockito",
"Hi Actually I have implemented the CallableStatementCreator which is callback for jdbc template I am trying to mock its method but getting the CallableStatement object as null in try resource below is my code could you please let me know why i am getting null.\nNote if I pass Mockito.anyString() its working but i don't want because spot bugs is throwing below error\nBug type SQL_INJECTION_JDBC (click for details)\nODR_OPEN_DATABASE_RESOURCE\nimport java.sql.CallableStatement;\nimport java.sql.Connection;\nimport java.sql.SQLException;\nimport java.sql.Types;\nimport edu.umd.cs.findbugs.annotations.SuppressFBWarnings;\nimport org.springframework.jdbc.core.CallableStatementCreator;\n\npublic class TimeEventWarmStoreCallableStatement implements CallableStatementCreator {\n @Override\n @SuppressFBWarnings(value="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE",justification = "try with resource false positive issue with java 11")\n public CallableStatement createCallableStatement(Connection con) throws SQLException {\n try (CallableStatement cs = con.prepareCall("{call Employee.CHANGE_TO_WARM_STORE(?,?)}")) {\n cs.setInt(1, 2);\n cs.registerOutParameter(2, Types.INTEGER);\n return cs;\n }\n }\n}\n\nMock Class\nimport static org.mockito.Mockito.doReturn;\nimport static org.testng.Assert.assertNotNull;\n\nimport java.sql.CallableStatement;\nimport java.sql.Connection;\nimport java.sql.SQLException;\nimport org.mockito.InjectMocks;\nimport org.mockito.Mock;\nimport org.mockito.Mockito;\nimport org.mockito.MockitoAnnotations;\nimport org.testng.annotations.BeforeMethod;\nimport org.testng.annotations.Test;\n\npublic class TimEventWarmStoreCallableStatementTest {\n @InjectMocks\n private TimeEventWarmStoreCallableStatement cut;\n\n @Mock\n private Connection con;\n\n @Mock\n private CallableStatement callableStatement;\n\n @BeforeMethod\n public void setup() {\n cut = Mockito.spy(new TimeEventWarmStoreCallableStatement());\n MockitoAnnotations.openMocks(this);\n\n }\n\n @Test\n public void createCallableStatementTest() throws SQLException {\n doReturn(callableStatement).when(con).prepareCall("{call Employee.CHANGE_TO_WARM_STORE(?,?)}");\n CallableStatement cst = cut.createCallableStatement(con);\n assertNotNull(cst);\n }\n}"
] | [
"junit",
"mockito"
] |
[
"how to pass information to url via excel vba",
"I want to use excel vba to control Internet explorer object.\n\nManually we can setup in \"https://www.investing.com/indices/us-30-historical-data\"\n\n\nTime Frame i.e. \"Daily\"\nStart Date i.e. \"01/01/2016\"\nEnd Date i.e \"31/12/2016\"\n\n\nHow to do this with excel vba ?\n\nI've this code to open the URL\n\nInfiniteLoop = True\nSet ie = CreateObject(\"InternetExplorer.Application\")\nWith ie\n .Visible = True\n .Navigate myURLLink ' should work for any URL\n\n SleepTime = 10000\n Do\n DoEvents\n Sleep (SleepTime)\n If ie.ReadyState >= 4 Then\n Exit Do\n End If\n Loop Until InfiniteLoop = False\nEnd With\n\n\nBut I don't know how to pass\n\n\nTime Frame i.e. \"Daily\"\nStart Date i.e. \"01/01/2016\"\nStart Date i.e. \"01/01/2016\"\n\n\nCan anyone help ?"
] | [
"excel",
"internet-explorer",
"vba"
] |
[
"Open all folds matching a pattern in vim",
"I'm using vim's syntax folding to look at a large GeoJSON file:\n\n\n\nIf I type /properties<ENTER>, it unfolds everything on the path down to the first Feature's properties:\n\n\n\nNow if I hit n a bunch of times, it will go through the file and expand all the properties fields.\n\nI'd like to do this in a single command. I've tried :g/\"properties\": {/foldopen but this only opens the path to the properties fields, not the properties fields themselves:\n\n\n\nHow can I get this :g command to expand the properties fields, too?"
] | [
"vim"
] |
[
"ASMX Webservice has no asyc BEGIN .. END options",
"I'm currently walking through the example how to use ASMX webservices from Xamarin Forms at https://developer.xamarin.com/guides/xamarin-forms/web-services/consuming/asmx/ . I read the text and checked the example. I tried to build the same structure using my own webservice but unfortunately this does not work.\n\nThe problem is: While in example there are methods like \"todoService.BeginGetTodoItems\" and \"todoService.EndGetTodoItems\" but in my webservices they do not exist. I only have e.g. \"Login\", but I do not have \"BeginLogin\" and \"EndLogin\".\n\nSo I could call it sync (which works fine) but not async. \n\nHow could I get / create the begin- and end- methods?\n\nMany thanks!\n\nUpdate: Just to clarify: In Reference.cs of ASMXService of TodoASMX Sample App, there are these methods included e.g. for GetTodoItems:\n\npublic TodoItem[] GetTodoItems()\npublic System.IAsyncResult BeginGetTodoItems(System.AsyncCallback callback, object asyncState)\npublic TodoItem[] EndGetTodoItems(System.IAsyncResult asyncResult)\npublic void GetTodoItemsAsync()\npublic void GetTodoItemsAsync(object userState)\nprivate void OnGetTodoItemsCompleted(object arg)\n\n\nBut within my own ASMX Webserivce, only these methods are available e.g. for the default HelloWorld:\n\npublic string HelloWorld()\npublic void HelloWorldAsync()\npublic void HelloWorldAsync(object userState)\nprivate void OnHelloWorldOperationCompleted(object arg)\n\n\nSo you see, BeginHelloWorld and EndHelloWorld are missing...\n\nUpdate2: Problem is repeatable easily: Download the example provided by article https://developer.xamarin.com/guides/xamarin-forms/web-services/consuming/asmx/ at https://developer.xamarin.com/samples/xamarin-forms/WebServices/TodoASMX . It works fine. Now delete the webreference ASMXService from iOS Project and manually add it again. URL is http://todoasmxservice.azurewebsites.net/TodoService.asmx and type should be \".NET 2.0 Web Services\" because it's the ASMX sample, not the WCF sample. Now I get the following error messages because BEGIN and END Methods do not exist anymore:\n\n/TodoASMX/iOS/SoapService.cs(87,87): Error CS1061: Type TodoASMX.iOS.ASMXService.TodoService' does not contain a definition forBeginGetTodoItems' and no extension method BeginGetTodoItems' of typeTodoASMX.iOS.ASMXService.TodoService' could be found. Are you missing an assembly reference? (CS1061) (TodoASMX.iOS)\n\nWhat am I doing wrong? What do I need to do additionally if I just remove the webservices and add it again? \nMany thanks!!"
] | [
"web-services",
"xamarin",
"xamarin.forms",
"asmx"
] |
[
"Find two MAXIMUM values' position in 3D matrix (MATLAB)",
"I have been having problem with identifying two maximum values' position in 3D matrix (MATLAB). Say I have matrix A output as follows:\n\nA(:,:,1) =\n\n 5 3 5\n 0 1 0\n\n\nA(:,:,2) =\n\n 0 2 0\n 8 0 8\n\n\nA(:,:,3) =\n\n 3 0 0\n 0 7 7\n\n\nA(:,:,4) =\n\n 6 6 0\n 4 0 0\n\n\nFor the first A(:,:,1), I want to identify that the first row have the highest value (A=5). But I need the two index position, which in this case, 1 and 3. And this is the same as the other A(:,:,:).\n\nI have searched through SO but since I am bad in MATLAB, I couldn't find way to work this through. \n\nPlease do help me on this. It would be better if I don't need to use for loop to get the desired output."
] | [
"matlab",
"matrix",
"multidimensional-array"
] |
[
"Broadcast sendto failed",
"I am trying to broadcast data but the output is udp send failed. I chose a random port 33333. What's wrong with my code? \n\nint main()\n{\n struct sockaddr_in udpaddr = { sin_family : AF_INET };\n int xudpsock_fd,sock,len = 0,ret = 0,optVal = 0;\n\n char buffer[255];\n char szSocket[64];\n memset(buffer,0x00,sizeof(buffer));\n memset(&udpaddr,0,sizeof(udpaddr));\n\n udpaddr.sin_addr.s_addr = INADDR_BROADCAST;\n udpaddr.sin_port = htons(33333);\n\n xudpsock_fd = socket(PF_INET,SOCK_DGRAM,IPPROTO_UDP);\n\n optVal = 1;\n ret = setsockopt(xudpsock_fd,SOL_SOCKET,SO_BROADCAST,(char*)&optVal,sizeof(optVal));\n strcpy(buffer,\"this is a test msg\");\n\n len = sizeof(buffer);\n ret = sendto(xudpsock_fd,buffer,len,0,(struct sockaddr*)&udpaddr,sizeof(udpaddr));\n\n if (ret == -1)\n printf(\"udp send failed\\n\");\n else\n printf(\"udp send succeed\\n\");\n\n return (0);\n}"
] | [
"sockets",
"udp",
"broadcast",
"sendto"
] |
[
"MantisConnect.php Error - Couldn't load from 'http://www.mantisbt.org/demo/api/soap/mantisconnect.php' : failed to load external entity",
"I am trying to get the status of issues from Mantis. Having search through other posts here, people indicate that the web service on their site should be working. However I get the error when attempting this. Openssl, SOAP, curl, etc... are all enabled in my PHP (5.4.26).\n\nSample code: (External Mantis works)\n\n<?php\n$SoapWSDLAddress = 'http://www.mantisbt.org/demo/api/soap/mantisconnect.php?wsdl';\n$Client = new SoapClient($SoapWSDLAddress, array('trace' => true, 'encoding' => 'UTF-8', 'soap_version' =>SOAP_1_2));\n...\n?>\n\n\nInternal Site, which has MantisConnect installed that gets Exception.\n\n<?php\n$SoapWSDLAddress = 'http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl';\n$Client = new SoapClient($SoapWSDLAddress, array('trace' => true, 'encoding' => 'UTF-8', 'soap_version' =>SOAP_1_2));\n...\n?>\n\n\nI get an exception on the SoapClient call:\n\nFatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl' : failed to load external entity \"http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl\"\n\n\nGoing to the web address in my browser does show me the output for Mantis connect."
] | [
"php",
"soap",
"mantis"
] |
[
"How to support workday app with multiple docusign esignature accounts?",
"Workday supports the use of only 1 Docusign esignature Account Integration key to be configured in their system/tenant. However I need to understand from DocuSign community if there is a way to link multiple docusign integration key/account to the same Workday tenant using a custom integration. This way the documents from workday can be published into the respective docusign accounts for e signature (based on the geographic location)... Any ideas and experience on this ?"
] | [
"docusignapi",
"account",
"workday-api"
] |
[
"CS1061: 'IEnumerable' does not contain a definition for '' and no extension method '' accepting a first argument of type 'IEnumerable'",
"I'm new to .net MVC Please help me to solve my problem.\n\nI'm getting this error:\nCS1061: 'IEnumerable' does not contain a definition for 'Name' and no extension method 'Name' accepting a first argument of type 'IEnumerable' could be found.\n\nhere is my controller \n public ActionResult Create()\n {\n return Index();\n }\n\n [HttpPost]\n public ActionResult Create(Person model)\n {\n HttpClient client = new HttpClient();\n client.BaseAddress = new Uri(\"http://localhost:23793\");\n\n client.PostAsJsonAsync<Person>(\"api/person\", model)\n .ContinueWith((postTask) => postTask.Result.EnsureSuccessStatusCode());\n\n return RedirectToAction(\"Index\");\n }\n\n\nAnd here my view \n\n @model IEnumerable<PersonDemoMVC.Models.Person>\n\n @{\n ViewBag.Title = \"Create\";\n }\n\n <h2>Create</h2>\n\n\n @using (Html.BeginForm()) \n {\n @Html.AntiForgeryToken()\n\n <div class=\"form-horizontal\">\n <h4>Person</h4>\n <hr />\n @Html.ValidationSummary(true, \"\", new { @class = \"text-danger\" })\n <div class=\"form-group\">\n @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = \"control-label col-md-2\" })\n <div class=\"col-md-10\">\n @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = \"form-control\" } })\n @Html.ValidationMessageFor(model => model.Name, \"\", new { @class = \"text-danger\" })\n </div>\n </div>\n\n <div class=\"form-group\">\n @Html.LabelFor(model => model.Age, htmlAttributes: new { @class = \"control-label col-md-2\" })\n <div class=\"col-md-10\">\n @Html.EditorFor(model => model.Age, new { htmlAttributes = new { @class = \"form-control\" } })\n @Html.ValidationMessageFor(model => model.Age, \"\", new { @class = \"text-danger\" })\n </div>\n </div>\n\n <div class=\"form-group\">\n <div class=\"col-md-offset-2 col-md-10\">\n <input type=\"submit\" value=\"Create\" class=\"btn btn-default\" />\n </div>\n </div>\n </div>\n }\n\n <div>\n @Html.ActionLink(\"Back to List\", \"Index\")\n </div>\n\n <script src=\"~/Scripts/jquery-1.10.2.min.js\"></script>\n <script src=\"~/Scripts/jquery.validate.min.js\"></script>\n <script src=\"~/Scripts/jquery.validate.unobtrusive.min.js\"></script>"
] | [
"c#",
"asp.net-mvc",
"linq",
"api"
] |
[
"SVG Doesn't show up in button element",
"I'm using inline SVG ( as JSX ) on my website, I'm trying to display a hamburger menu button but it isn't showing up. Here is my code:\nimport Link from "next/link"\n\nfunction Nav() {\n return (\n <nav>\n <button > /// SVG is here\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="-172 -12 210 50" stroke="#000000">\n <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16m-7 6h7" />\n </svg>\n </button>\n <ul className="">\n <li>\n <Link href="/">\n <a>Main</a>\n </Link>\n </li>\n <li>\n <Link href="/resume">\n <a>Resume</a>\n </Link>\n </li>\n <li>\n <Link href="/projects">\n <a>Projects</a>\n </Link>\n </li>\n\n <li>\n <Link href="/blog">\n <a>Blog</a>\n </Link>\n </li>\n <li>\n <Link href="/contact">\n <a>Get in touch</a>\n </Link>\n </li>\n </ul>\n </nav>\n );\n}\n\nexport default Nav;\n\nThe Icon is only visible when it's outside the button tag, how do I view it while preserving the viewBox attribute?"
] | [
"html",
"css",
"svg",
"jsx"
] |
[
"UIPopover with UIDatePicker throws exception in iOS5.1",
"I have an enterprise iPad app that runs on several iPads of different vintage. All work fine except for one which is the only 1st generation iPad in the group. This iPad is running iOS 5.1.1. The app uses a UIPopoverController in several places and all work fine on this iPad except for the one that I last created. \n\nUsing the iPad 5.1 Simulator I was able to duplicate the problems…\n\n\nThe app crashes when trying to open a UIPopoverController which contains a UIViewController contining a UIDatePicker and a UIButton. The exception reads…\n\n\n\n * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'\n\n\nHere is the code I am using up to the line that throws the exception…\n\nDatePickerPopOverViewController *datePickerViewController =[[DatePickerPopOverViewController alloc] init];\ndatePickerViewController.defaultDate = lastPopoverDate;\ndatePickerViewController.buttonTitle = @\"Get Schedule\";\ndatePickerViewController.delegate = self;\nUIPopoverController *datePickerPopOver = [[UIPopoverController alloc] initWithContentViewController:datePickerViewController];\n\n\nI am pretty sure that all of the elemnts involved are available in iOS5.1. Any suggestions would be greatly appreciated.\n\nJohn"
] | [
"xcode",
"uigesturerecognizer",
"uipopovercontroller",
"uidatepicker",
"uipopover"
] |
[
"admob network Integration in android",
"Currently have Admob with 9k impressions and 0.06$ ecpm so i want to use MobFox as backup . so I registered an account with MobFox and setup mediation with Admob with MobFox publisher ID. Do I need to install any SDK updates in my App and re-release it or just Admob sdk ? i get 0 requests in MobFox so whats the issue ?"
] | [
"android",
"admob",
"mobfox"
] |
[
"Delete a record from tableB after receiving a unique constraint error from tableA",
"I have the code below that first inserts a record in tableA -- and it successfully inserts a new record.\n\nWhen I try to insert a duplicate record to get SQLIntegrityConstraintViolationException (and it actually falls here), it should process my delete executeUpdate but unfortunately gives me \"success = 0\", it has not affected any row. \n\nWhat am I missing? Thank you in advance!\n\n try {\n session.save(tableA);\n }catch(SQLIntegrityConstraintViolationException ex) {\n log.debug(\"catch me im fallin\");\n PreparedStatement ps;\n String sql= \"DELETE FROM tableB WHERE id = \" +id;\n\n try {\n con = wa.getSession().connection();\n ps = con.prepareStatement(sql);\n int success = ps.executeUpdate();\n log.debug(\"success : \"+success);\n\n } catch (Exception e) {\n //\n }\n }catch(SQLException ex) {\n //\n }"
] | [
"java",
"oracle",
"hibernate",
"prepared-statement"
] |
[
"Problem with JSP getRemoteAddress",
"I would like to find out how to get IP address of the client, that is visiting my web pages.\nContent of JSP page:\n\n<% \nout.print( request.getRemoteAddr() + \"<br>\");\nout.print( request.getRemoteHost() ); \n%> \n\n\nOutput: \n\n0:0:0:0:0:0:0:1\n0:0:0:0:0:0:0:1"
] | [
"java",
"jsp",
"jakarta-ee",
"ip"
] |
[
"FFMPEG: Fixing frame rate with filter_complex movie filter",
"With some help from @Gyan I came up with the following FFMPEG command which streams 4 videos simultaneously to 4 separate RTMP endpoints, looping the videos infinitely and keeping the audio and video synchronized:\n\nffmpeg \\\n -filter_complex \\\n \"movie=01.mp4:loop=0[v1];[v1]setpts=N/FRAME_RATE/TB[v1];\n amovie=01.mp4:loop=0[a1];[a1]asetpts=N/SR/TB[a1];\n movie=02.mp4:loop=0[v2];[v2]setpts=N/FRAME_RATE/TB[v2];\n amovie=02.mp4:loop=0[a2];[a2]asetpts=N/SR/TB[a2];\n movie=03.mp4:loop=0[v3];[v3]setpts=N/FRAME_RATE/TB[v3];\n amovie=03.mp4:loop=0[a3];[a3]asetpts=N/SR/TB[a3];\n movie=04.mp4:loop=0[v4];[v4]setpts=N/FRAME_RATE/TB[v4];\n amovie=04.mp4:loop=0[a4];[a4]asetpts=N/SR/TB[a4]\" \\\n -map \"[v1]\" -map \"[a1]\" \\\n -c:a libfdk_aac \\\n -c:v libx264 -preset ultrafast \\\n -b:v 500k -b:a 32k \\\n -f flv rtmp://output/01 \\\n -map \"[v2]\" -map \"[a2]\" \\\n -c:a libfdk_aac \\\n -c:v libx264 -preset ultrafast \\\n -b:v 500k -b:a 32k \\\n -f flv rtmp://output/02 \\\n -map \"[v3]\" -map \"[a3]\" \\\n -c:a libfdk_aac \\\n -c:v libx264 -preset ultrafast \\\n -b:v 500k -b:a 32k \\\n -f flv rtmp://output/03 \\\n -map \"[v4]\" -map \"[a4]\" \\\n -c:a libfdk_aac \\\n -c:v libx264 -preset ultrafast \\\n -b:v 500k -b:a 32k \\\n -f flv rtmp://output/04\n\n\nThis is almost perfect, except that it's doubling my frame rate:\n\nframe=20822 fps= 46 q=32.0 q=34.0 q=29.0 q=32.0 size= 57617kB time=00:14:28.39 bitrate= 543.5kbits/s speed=1.92x\n\n\nNote the speed=1.92x bit. This is causing the live stream to play at double speed, as well.\n\n(the original video was approximately 24 fps)"
] | [
"ffmpeg"
] |
[
"why doesn't my while loop work? Can someone tell me how the error message works?",
"How can I restart this codeblock? My idea is if you enter a character that will return an error message. What is the condition for the loop?\n\nstring r_operation;\nConsole.Write(\"\\tBitte geben Sie ihre Rechenoperation ein: \");\nr_operation = Console.ReadLine();\n-------------\n\nwhile (?r_operation = Console.ReadLine())\n{\nConsole.WriteLine(\"\\tUngültige Eingabe. Bitte geben Sie nur Zahlen ein!\");\n}"
] | [
"c#",
"if-statement",
"while-loop",
"application-restart"
] |
[
"Angular typescript implement same generic interface twice on class",
"Hi I have bee kicking around code for awhile I do have a work around but I feel that it is not correct. Any help is much appreciated.\n\nI am using the pattern shown here enter link description here\n\nI am trying to implement the same generic interface twice for two different models where one is nested inside the other which is representative of nested JSON object. I have used the adapter pattern. this is where I am at:\n\nimport { Injectable } from '@angular/core';\nimport { Adapter } from './core/adapter';\nimport { map } from 'rxjs/operators';\n\nexport class MatchPoint {\n\nconstructor(\n public matchFlag: number,\n public maxIndividualScore: number,\n public inquiry: string,\n public mrc: number,\n public reason3: number,\n public reason2: number,\n public reason1: number,\n public numOfResults: number,\n public trans_id: string,\n public searchResult: SearchResult[]\n) { }\n}\n\nexport class SearchResult {\n\nconstructor(\n public jns: string,\n public city: string,\n public totalScorePrint: string,\n public cpin_count_i: string,\n public name: string,\n public ppbin: string,\n public hdistph: string,\n public phones: string,\n public searchlevel: string,\n public jas: string,\n public hdisttax: string,\n public cpbin: string,\n public state: string,\n public street: string,\n public totalScoreDecay: string,\n public ns1: string,\n public ns: string,\n public lvid: string,\n public zip5: string,\n public mrc: string\n) { }\n}\n\n@Injectable(\n{ providedIn: 'root' }\n)\nexport class MatchPointAdapter implements Adapter<MatchPoint>, \n**Adapter<SearchResult>** {\n\n\nadapt(item: any): MatchPoint {\n return new MatchPoint(\n item.matchFlag,\n item.maxIndividualScore,\n item.inquiry,\n item.mrc,\n item.reason3,\n item.reason2,\n item.reason1,\n item.numOfResults,\n item.trans_id,\n this._adapt(item.searchResult) // need to loop and use the adapt\n );\n}\n\n_adapt(item: any[]): SearchResult[] {\n return new SearchResult(\n item.jns,\n item.city,\n item.totalScorePrint,\n item.cpin_count_i,\n item.name,\n item.ppbin,\n item.hdistph,\n item.phones,\n item.searchlevel,\n item.jas,\n item.hdisttax,\n item.cpbin,\n item.state,\n item.street,\n item.totalScoreDecay,\n item.ns1,\n item.ns,\n item.lvid,\n item.zip5,\n item.mrc\n );\n}\n\n}\n\n\nHere is the workaround I have:\n\nexport class MatchPointAdapter implements Adapter<MatchPoint> {\n\n\nadapt(item: any): MatchPoint {\n return new MatchPoint(\n item.matchFlag,\n item.maxIndividualScore,\n item.inquiry,\n item.mrc,\n item.reason3,\n item.reason2,\n item.reason1,\n item.numOfResults,\n item.trans_id,\n this.getSearchResults(item.searchResult)\n );\n}\n\ngetSearchResults(searchResult: any[]): SearchResult[] {\n return searchResult.map((item: any) =>\n new SearchResult(\n item.jns,\n item.city,\n item.totalScorePrint,\n item.cpin_count_i,\n item.name,\n item.ppbin,\n item.hdistph,\n item.phones,\n item.searchlevel,\n item.jas,\n item.hdisttax,\n item.cpbin,\n item.state,\n item.street,\n item.totalScoreDecay,\n item.ns1,\n item.ns,\n item.lvid,\n item.zip5,\n item.mrc\n ));\n}\n}\n\n\nThanks"
] | [
"angular",
"typescript",
"implements"
] |
[
"Trying to rearrange my listview, but not sure how to get the property I need to edit",
"So, I have a ListView that contains a steps in a process. On the left there is a Label simply stating which step it is, and on the right is a TextBox with the instructions. Then to the right of that TextBox is the usual edit and delete buttons, but I also have an up-arrow and a down-arrow. If clicked, I would like the current set of items to be moved into that slot.\n\nThis ListView is bound by a LinqDataSource and if I could just access the property of an item from that set where the button was clicked, I could just call ListView.DataBind() and it would sort itself.\n\nThe property I'm talking about is what is in the Label saying which step it is. I have it set up like this: \n\n<asp:Label ID=\"lblStepNumber\" runat=\"server\" Text='<%# Eval( \"StepNumber\", \"Step #{0}\" ) %>' />\n\n\nSo if I can just do something like \n\nListView.Items.[Where_btn_clicked].StepNumber++;\nListView.Items.[Where_btn_clicked+1].StepNumber--;\nListView.DataBind();\n\n\nThat would be easiest, but I don't know how to access this property."
] | [
"c#",
"asp.net",
"listview",
"linqdatasource"
] |
[
"How to insert records if update query failed in sqlite android",
"I have a case, If my update query is failed due because there is no existing data in database. Then, I want to insert new record if not available already in database. I searched everywhere, But, i did not get a solution according my source code. Find the below code and tell me the solution. Thanks advance dude.\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(PAGENUM, stepaObj.getPageno());\n values.put(SCORE, stepaObj.getScore());\n values.put(FIR, stepaObj.getFir());\n values.put(PENALTY, stepaObj.getPenalty());\n values.put(PUTTS, stepaObj.getPutts());\n values.put(PLAYED, stepaObj.getPalyed());\n values.put(SCORECARDID, stepaObj.getScorecardid());\n values.put(ISUPDATE, stepaObj.getIsupdate());\n\n int result = db.update(TABLE_SCORECARD_STEPA, values, SCORECARDID+\" = ?\",\n new String[] { String.valueOf(scorecardID)});\n\n System.out.println(\"updateScore by API data = \"+result);\n\n db.close();"
] | [
"android",
"sqlite",
"android-query"
] |
[
"How to sort multiple selected nodes in fancy tree",
"At the moment fancytree only allows to sort child nodes by using node.sortChildren method. However, I would like to sort selected nodes only as shown in image below. How we can achieve that. A help is much appreciated.\nDescriptive image"
] | [
"fancytree"
] |
[
"android - last added item to layout is strech vertical. WHY? (Remake)",
"[Second Edited]\n\nI found where problem is. But i dont know why its doing. It cant be margin on LinearLayout (or just marginLeft). Does anybody know why it cant have ?\n\n[EDITED]\n\nHello i have xml file in layout like bellow.And iam adding TextViews from any xml layout to horizontal LinearLayout. This layout structure is given and i cant change it. \nAnd last added TextView is streching always verticaly. I dont know why i am in tottaly despair. Too many hours i was try* that but without no idea. I know just its not in programicaly adding TextViews ..\nIf some body know why its doing i will be thankful.\n\n<RelativeLayout \n\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"wrap_content\"\nandroid:background=\"@drawable/back_border\"\n>\n\n<RelativeLayout \nandroid:id=\"@+id/manager_view_table_header\" \nandroid:layout_width=\"wrap_content\"\nandroid:layout_height=\"wrap_content\"\nandroid:layout_alignParentTop=\"true\"\nandroid:layout_alignParentLeft=\"true\"\n> \n\n\n <LinearLayout \n android:id=\"@+id/layout_for_textViews\"\n android:orientation=\"horizontal\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\" \n android:layout_margin=\"6px\"\n android:layout_alignParentTop=\"true\"\n android:gravity=\"center_vertical\"\n android:background=\"@drawable/back_border\"\n >\n <!-- horizontal layout, HERE IAM ADDING TEXTVIEWS -->\n\n </LinearLayout>\n\n </RelativeLayout>\n\n<!--What is here its no important\n because, there is RelativeLayout with alignBellow relative layout before -->\n\n</RelativeLayout>\n\n\nand TextView witch iam addig to LinearLayout:\n\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"wrap_content\" \n android:layout_height=\"wrap_content\" \n android:textSize=\"15sp\"\n android:paddingRight=\"7px\"\n android:paddingLeft=\"7px\"\n android:paddingTop=\"3px\"\n android:paddingBottom=\"3px\"\n android:layout_marginLeft=\"5px\"\n android:gravity=\"center_horizontal\" \n android:background=\"@drawable/background_table\"\n android:textColor=\"#330033\"\n android:text=\"Some text\"\n />"
] | [
"android",
"layout",
"fill"
] |
[
"PHP dateRange function: how to save the return value in a var?",
"I have following php function, that creates an array of all the days between a start date and an end date:\n\nfunction dateRange( $first, $last, $step = '+1 day', $format = 'Y-m-d' ) {\n\n$dates = array();\n$current = strtotime( $first );\n$last = strtotime( $last );\n\nwhile( $current <= $last ) {\n\n $dates[] = date( $format, $current );\n $current = strtotime( $step, $current );\n }\n\n return $dates;\n}\n\n\nI then use:\n\nif (in_array($this_date,dateRange($start_date, $end_date))) {... do sth ...} else {... do sth else...}\n\nNow I think to best implement this in a while-loop when reading the dates from the database. There are several date periods in the database and I would like to create an array with all of them when reading the rows, and finally check if in_array($this_array_contains_all_date_ranges_from_db).\n\nIf I try to print $array after using dateRange($start_date,$end_date), it returns only an empty \"Array\". However, if I use the above mentioned if, it works fine. Also, I tried e.g. $this_date_range=dateRange($start_date,$end_date); but it was empty as well... I am not so experienced with functions, so I just could not figure out how can I create a var that will contain all the date ranges?\n\nThank you very much in advance!! :)"
] | [
"php",
"function"
] |
[
"How do I build dynamic functions with javascript?",
"I'm getting myself confused with all these languages! :)\n\n// given this function\nvar f = function(a,b) { return a == b; }\n\n// and these values for a\nvar a = [1,2,3]\n\n// how do I make this array (a is replaced by its value)?\nvar results = [\n function(b) { return 1 == b; },\n function(b) { return 2 == b; },\n function(b) { return 3 == b; }\n]"
] | [
"javascript",
"function",
"dynamic"
] |
[
"Python - List elements being overwritten somehow",
"I have a recursive function that tries to find combinations of numbers that add to a certain number. I store the results in a list called validCombinations\n\nThe code:\n\nsum = 4\ndigits = 2\ncurrentDigit = digits\nvalidCombinations = [] \n\n#recursion function to find combinations of numbers that add to the sum variable\ndef recursive(index):\n if 10 not in digitList: \n if index >= 0:\n total = 0\n for n in digitList:\n total += n\n if total == sum:\n validCombinations.append(digitList)\n digitList[index] += 1\n recursive(index-1)\n else:\n recursive(currentDigit-1)\n\ndigitList = []\n\nfor n in range(digits,0,-1):\n for i in range(n):\n digitList.append(0)\n recursive(n-1)\n digitList = []\n currentDigit -= 1\n\nprint validCombinations\n\n\nWhen running this it outputs\n\n[[9, 10], [10, 0]]\n\n\nWhen i expect to see this\n\n[[2, 2], [4]]\n\n\nI have stepped through the code and it seems like it is somehow overwriting the elements in the list, however in my code I only ever interact with validCombinations by using the append() method, which should just add it to the end.\n\nAm I missing something or is the recursion causing this?"
] | [
"python",
"list",
"recursion",
"append"
] |
[
"HTML Form is showing up even though PHP \"if\" statement is not met",
"I am quite new at programming (especially in PHP).\nAnyway, I have been attempting for a bit now to create a log-in page that utilizes both PHP and HTML.\n\nThe main idea is if it's the first time the user has come to the log-in page, then they have to click a \"submit\" button first; which will then reload the page but now will have a where the user will input information to call up another PHP script.\n\nI have attempted the following codes to achieve this:\n\n <form method = \"post\"\n action = \"Sign-In2.html\">\n\n\n <p>\n <br />\n <input type = \"submit\"\n name = \"returnUser\"\n value = \"Click To Log In\">\n </P>\n </form>\n\n <?php\n\n if (isset($_POST['returnUser'])) {\n\n ?> \n\n <form method = \"post\"\n action = \"Login2.php\">\n\n <p>\n <br />\n In Honor Of:\n <input type = \"text\"\n name = \"userName\"\n value = \"\">\n\n <br />\n EDGE Code:\n <input type = \"password\"\n name = \"edgeCode\"\n value = \"\">\n\n <br /><br />\n <input type = \"checkbox\"\n name = \"rememberUser\"\n value = \"remembered\">Remember Me\n\n <br />\n <input type = \"submit\"\n value = \"Log Me In\">\n\n </p>\n </form>\n\n <?php\n\n } else {\n\n } //end if\n\n ?>\n\n\nFrom everything I have read online (from this site and others), I am under the impression that my code includes two forms and a PHP \"if\" statement.\n\nThe FIRST form just provides a \"submit\" button that is named \"returnUser\" and reloads the page (which is named Sign-In2.html).\n\nThen PHP jumps in and runs a condition check. If the \"submit\" button from the FIRST form has in fact been clicked, then the SECOND form will be run. If it has NOT been clicked, then nothing happens.\n\nSO MY ISSUE is that when I run this this code from localhost WAMPserver, BOTH forms show up! I am unable to understand or find out why not just the first form but both are showing up when I load the page! I just want the first submit button to show up so I can click on it and refresh the page with the input fields from the second form :(\nAny help would be highly appreciated!\n\nNote: The second form and its phpscript both run no problem."
] | [
"php",
"html",
"if-statement",
"form-submit"
] |
[
"Neo4j configure parallel or serial operations?",
"Can i configure if i want parallel or serial operation on my neo4j-community version database? I have different clients that fire queries and alter the nodes i would prefer serial transmission to prevent deadlocks."
] | [
"neo4j",
"cypher"
] |
[
"Error occurred while deserialize parameter http:tempuri.org/:",
"I am Getting error while calling a WCF service via service proxy : Type [mytype]'1[system.collection.generic.list'1] cannot be added to list of known types since another type [mytype'1] with same data contract is already present.\nAny idea how to resolve that ??\nComing after I have run svcutil for same host two times i.e. first time default (Array) and second time with adding /ct: parameter to generate with list type."
] | [
"c#",
"wcf",
".net-core",
"metadata",
"datacontract"
] |
[
"Set image as cursor in R Shiny",
"Is there a way to use a web image as cursor when hovering over a button? \n\nI tried something like this: \n\ntags$head(tags$style(HTML(\" .custom { cursor: url(https://c2.staticflickr.com/2/1907/31794847918_04f9e687e1_b.jpg), auto;\n} \")))\n\n\nwhich has no effect, and I can't find any other examples on the web how to manage this in R shiny. \n\nlibrary(shiny)\n\nui <- fluidPage( \n actionButton(inputId = 'messagebutton', label = 'click me')\n)\n\nserver <- function(input, output, session) {}\n\nshinyApp(ui = ui, server = server)"
] | [
"r",
"url",
"shiny",
"mouse-cursor"
] |
[
"How to get dynamic variable class name in PHP?",
"class CLASS_A{}\n$classA = 'CLASS_A';\nvar_dump(class_exists($classA::class)); //not works\n\n\nAny idea to get the class name via variable?"
] | [
"php"
] |
[
"Is there a way to detect when bottom app tray is opened on iPad using JavaScript",
"I'm trying to figure out if its possible to use JavaScript to detect when a user triggers a gesture on iPad (and probably to a larger extent most iOS devices) that brings up certain UI elements. I need to perform certain checks should that happen but have no idea how to go about it. In particular, I'm trying to check for when a user brings up the app tray at the bottom of the iPad as seen in the picture below but it would be nice if there was a general solution to all such gestures like those shown here https://ipadpilotnews.com/2020/04/all-the-gestures-ipad-pilots-need-to-know-using-an-ipad-pro-without-a-home-button/ \nWould really appreciate if anyone can point in the right direction. I have tried creating event listeners for blur and focus as suggested in some other stack overflow question but those don't seem to work for what I'm trying to do. Thanks!"
] | [
"javascript",
"ios",
"events",
"ipad",
"focus"
] |
[
"How to make ABC work with Boost.Python/C++ Classes?",
"I want abc.abstractmethod to work on the following class:\n\nfrom abc import ABC\nfrom my_cpp_module import my_class\n\nclass A(my_class, ABC):\n @abstractmethod\n def implement_me(self, arg):\n '''not implemented'''\n\nclass B(A):\n pass\n\nb = B() <--- should throw\nb.implement_me('hallo')\n\n\nBut this little example gives me\n\nTraceback (most recent call last):\n File \"./abc-test.py\", line 4, in <module>\n class A(my_class, ABC):\nTypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases\n\n\nFiddling a bit with type, classes and so on I get an implementation that runs without error:\n\nclass MyABC(type(my_class), ABCMeta): \n pass # type(my_class) == <class 'Boost.Python.class'>\n\nclass A(my_class, metaclass=MyABC):\n @abstractmethod\n def implement_me(self, arg):\n '''not implemented'''\n\n\n.. but in this case b = B() just works, too but (of course) I want it to produce the following error:\n\nFile \"./abc-test.py\", line 22, in <module>\n b = B()\nTypeError: Can't instantiate abstract class B with abstract methods implement_me\n\n\nIs there a way to make abstractmethod work together with Boost.Python classes like expected?"
] | [
"python",
"c++",
"boost-python",
"abc"
] |
[
"Is it possible to store messages in a socketio chat app",
"Let's say I made a complete UI of a chat app. We have a panel which contains all the recently contacted. We have react on the front-end and node, express on the backend. The real time data transfer chat is carried out using socketio.\nThe real question is how do I store all the messages that I have with each user. Let's say I chatted with user A for a while, closed the tab and moved to user B. Then the next day I moved back to the user A, I want all my previous chats with that user to be available to me.\nHow is that achievable?\nOne way I can wrap my head around is that I use mongoDB to create a chat room with two specific user and a id. Then I store that room on mongo with all the chats stored in an array.\nOn the client side, I check the db if a specific chat room exists. If it does, I send all the messages in to the client side, if not it create a new chat room.\nThis is by far the most sensible thing I've thought.\nAny guidance as to what other techniques I can use?\nMuch appreciated."
] | [
"node.js",
"reactjs",
"mongodb",
"express",
"socket.io"
] |
[
"Use Reactive Extensions to simulate Click on UIElement",
"In WPF, I want to be able to use the mouse events with reactive extensions to create an observable for a UIElement that works like a Click event. There's plenty of examples of using this to create drag/drop behavior, but I can't find anything for just a simple click.\n\nI'm anticipating it'll involve observables on MouseLeftButtonDown, MouseLeftButtonUp, MouseLeave, and MouseEnter. But I'm unsure what combination of Merge, SelectMany, TakeUntil, or TakeWhile I need to use. In trying to wrap it all up in an extension, here is what I have so far:\n\npublic static IDisposable GetClick(this UIElement item, Action clickAction)\n {\n var obs1 = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(\n h => (s, e) => h(s, e),\n h => item.MouseLeftButtonDown += h,\n h => item.MouseLeftButtonDown -= h);\n\n var obs2 = Observable.FromEventPattern<MouseButtonEventHandler, MouseButtonEventArgs>(\n h => (s, e) => h(s, e),\n h => item.MouseLeftButtonUp += h,\n h => item.MouseLeftButtonUp -= h);\n\n var obs3 = Observable.FromEventPattern<MouseEventHandler, MouseEventArgs>(\n h => (s, e) => h(s, e),\n h => item.MouseLeave += h,\n h => item.MouseLeave -= h);\n\n var obs4 = Observable.FromEventPattern<MouseEventHandler, MouseEventArgs>(\n h => (s, e) => h(s, e),\n h => item.MouseEnter += h,\n h => item.MouseEnter -= h);\n\n var finalObs = ???\n\n return finalObs.Subscribe(x => clickAction.Invoke());\n\n\n}"
] | [
"c#",
"wpf",
"system.reactive"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.