texts
sequence | tags
sequence |
---|---|
[
"Adding a developer to an Apple Developer account",
"I have an Apple Developer iOS Membership. I have hired a developer to write an iOS app for me. They said they don't have their own account so in order for us to test the app using ad-hoc provisioning we'll need to use my account. When I go to invite users into my account from the Member Center I am given 2 options to add this user as, 1) Admin, 2) Member. Is the correct way to give a developer access and which option should I give them? I want to give the least amount of privileges as possible. I don't want them to access any sensitive account information, just allow them to develop the app and allow for testing.\n\nThis is the overview of the roles but I am still not sure which is correct\nhttps://developer.apple.com/support/roles/"
] | [
"ios",
"iphone-developer-program"
] |
[
"Copy video from my own machine to EC2 server by running scp command (JSCH)",
"I need to SCP a video file from my local machine to a EC2 cloud server using a Java program. I am using the JSCH library to do so.\n\nSo far I can connect to the EC2 server and can run basic commands on it. Following is the code:\n\nimport com.jcraft.jsch.*;\nimport java.io.*;\nimport java.io.IOException;\n\npublic class EC2 \n{\n public static void main(String[] args) throws JSchException, IOException, InterruptedException \n {\n JSch jsch=new JSch();\n jsch.addIdentity(\"yyyy.pem\");\n jsch.setConfig(\"StrictHostKeyChecking\", \"no\");\n\n //enter your own EC2 instance IP here\n Session session=jsch.getSession(\"ec2-user\", \"xx.xxx.xxx.xxx\", 22);\n session.connect();\n\n //run stuff\n String command = \"whoami;hostname\";\n Channel channel = session.openChannel(\"exec\");\n ((ChannelExec) channel).setCommand(command);\n ((ChannelExec) channel).setErrStream(System.err);\n channel.connect();\n\n\n InputStream input = channel.getInputStream();\n //start reading the input from the executed commands on the shell\n byte[] tmp = new byte[1024];\n while (true) \n {\n while (input.available() > 0) \n {\n int i = input.read(tmp, 0, 1024);\n if (i < 0) break;\n System.out.println(new String(tmp, 0, i));\n }\n if (channel.isClosed())\n {\n System.out.println(\"exit-status: \" + channel.getExitStatus());\n break;\n }\n Thread.sleep(1000);\n }\n\n channel.disconnect();\n session.disconnect();\n }\n\n}\n\n\nNow I am aware of the SCP syntax for file transfer . But the thing here is that every command that I now here will be run the EC2 server\nFor eg: String command = \"ls -l\"; Will give me the home file list in the EC2.\n\nSo how do I transfer the video stored on my laptop the home/ec2-user directory of the EC2 ?"
] | [
"java",
"linux",
"amazon-web-services",
"amazon-ec2",
"jsch"
] |
[
"How to resolve Gradle plugin dependency?",
"I am trying to install Eclipse integration Gradle from\n\nhttp://dist.springsource.com/release/TOOLS/gradle\n\nin order to create LibGdx project in Eclipse.\n\nBut there is a dependency issue where I am stuck at and not able to understand the error.\n\nBelow is the error stack in eclipse while trying to install the Gradle plugin. \n\nSoftware being installed: Spring UAA Integration (optional) 3.6.0.201407080544-RELEASE (org.springframework.ide.eclipse.uaa.feature.feature.group 3.6.0.201407080544-RELEASE)\n Missing requirement: Spring UAA Integration 3.6.0.201407080544-RELEASE (org.springframework.ide.eclipse.uaa 3.6.0.201407080544-RELEASE) requires 'package com.google.protobuf 0.0.0' but it could not be found\n\nUPDATE:\nhttp://dist.springsource.com/release/TOOLS/gradle (latest release) did not work.\nBut,\nhttp://dist.springsource.com/milestone/TOOLS/gradle (latest milestone build) worked!"
] | [
"eclipse",
"eclipse-plugin",
"gradle",
"libgdx"
] |
[
"forwarding in section resolve by RouteProvider to another view",
"I have a problem with the provider in AngularJS.\nI would like to in any view to check whether the user is logged on. If not then it should redirect to / login. On the console, there is no error. I do not know what is wrong.\n\nvar app= angular.module(\"app\", [\"ngRoute\", \"ngAnimate\", \"ngResource\"]);\n\napp.config([\"$routeProvider\", \"$locationProvider\", function($routeProvider, $locationProvider) {\n var getItemNameById = function($route, $location, service, breadcrumbs, path) {\n service.getItem($route.current.params.id).then(function(evt) {\n if(evt.title) {\n $route.routes[path].label = evt.title;\n } else if(evt.name) {\n $route.routes[path].label = evt.name;\n }\n breadcrumbs.generateBreadcrumbs();\n }, function() {\n $location.path(\"/404\");\n });\n };\n\n $routeProvider\n .when(\"/\", {\n template: \"\",\n label: \"Home\",\n resolve: function($q, $location) {\n alert(\"in resolve Home...\");\n var deferred = $q.defer(); \n\n if (!isLoggedIn) {\n $location.path('/login');\n }\n deferred.resolve();\n return deferred.promise;\n }\n })\n .when(\"/patient\", {\n templateUrl: \"patient.html\",\n label: \"Patient\",\n resolve: function($q, $location) {\n alert(\"in resolve Patient...\");\n var deferred = $q.defer(); \n\n if (!isLoggedIn) {\n $location.path('/login');\n }\n deferred.resolve();\n return deferred.promise;\n }\n })\n .when(\"/doctor\", {\n templateUrl: \"doctor.html\",\n controller: \"DoctorController\",\n label: \"Doctor\",\n resolve: function($q, $location) {\n alert(\"in resolve Home...\");\n var deferred = $q.defer(); \n\n if (!isLoggedIn) {\n $location.path('/login');\n }\n deferred.resolve();\n return deferred.promise;\n }\n });\n}]);\n\napp.run([\"$rootScope\", \"LoginService\", function($rootScope, LoginService) {\n LoginService.checkSession().then(function(response) {\n $rootScope.isLoggedIn = response;\n }, function(reject) {\n $rootScope.isLoggedIn = reject;\n });\n\n}]);\n\n\nwhy not enter into sections resolve (alert also does not show) on the home page?\n\nbest regards"
] | [
"angularjs",
"redirect"
] |
[
"How to add font to windows phone 7",
"I downloaded and installed Neverwinter font but I can't find it in the FontFamily. How I can add it?"
] | [
"c#",
"windows-phone-7",
"fonts",
"windows-phone-7.1"
] |
[
"Google Analytics - Don't view as unique pages",
"I have a url similar to this\n\n/widgets/view/13031800\n\nIn the google analytics settings you can have it exclude url paramaters, but I can't figure out how to have it look at all\n\n/widgets/view/ pages as one page. I don't need each one to be unique. \n\nAny ideas?"
] | [
"google-analytics"
] |
[
"Type completion in FlexBuilder?",
"Is it possible to ask FlexBuilder to automatically fill out the types of a statement?\n\nFor example:\n\nvar g = this.graphics;\n\n\nWill throw a a \"no type declaration\" warning that Eclipse's magic \"fix this line please\" won't fix... So is there any other way to fix that, other than manually entering the \"g:Graphics\" by hand?"
] | [
"apache-flex",
"flexbuilder"
] |
[
"How to reference default IComparer in a custom Dictionary value sort",
"Suppose I have a method to return a list of keys in a dictionary, sorted by their values:\n\n/// Perhaps a wildly inefficient way to achieve this!\npublic static List<K> SortByValues<K,V>( Dictionary<K,V> items )\n{\n var keys = new K[items.Count];\n var values = new V[items.Count];\n var index = 0;\n\n foreach( var kvp in items )\n {\n keys[index] = kvp.Key;\n values[index++] = kvp.Value;\n }\n\n Array.Sort( values, keys );\n\n return new List<K>( keys );\n}\n\n\nI would like to offer an overload that accepts an IComparer to pass to the Array.Sort method. Is there any way to do this without duplicating all of the code? Ideally there'd be some way to get at the \"default\" comparer for the type V."
] | [
"c#",
"generics"
] |
[
"Get product code from text",
"I need to get the product code from a string without VBA, for example:\n\n\nthis is product KAK 8732\nthis is product YUI 889\nthis is product SM 001\n\n\nI want to get product code:\n\n\nKAK 8732\nYUI 889\nSM 001\n\n\nplease help, thank you"
] | [
"excel",
"excel-formula"
] |
[
"Entity Framework Relationship binding on a null reference",
"I'm trying to make a shopping cart, but I'm stack from accessing the Product Name from Cart. \n\nHere is the model for Product\n\npublic class Product\n{\n [Key]\n public int ProductID { get; set; }\n public string Name { get; set; }\n}\n\n\nHere is the model for Cart\n\npublic class CartItem\n{\n [Key]\n public int ItemID { get; set; }\n public string CartID { get; set; }\n public int Quanity { get; set; }\n\n public int ProductID { get; set; }\n public virtual Product Product { get; set; }\n}\n\n\nand here is the temporary IActionResult to view the cart\n\npublic IActionResult Index()\n {\n var cartItem = _context.CartItems.Where(a => a.CartID == \"abcd\").ToList();\n\n return View(cartItem);\n }\n\n\nand this is the view for IActionResult\n\n@foreach (var item in Model)\n{\n @item.Product.Name <br />\n}\n\n\nand this is RuntimeBinderException: Cannot perform runtime binding on a null reference\n\nit was working when i only use @item.ItemID, @item.CartID, @item.Quantity, @item.ProductID. How can I get the name of the product from cart?"
] | [
"c#",
"asp.net-mvc",
"entity-framework",
"linq-to-entities"
] |
[
"use id, not label, for a DSpaceControlledVocabulary",
"In my DSpace installation, I have a controlled vocabulary. It is similar to the example srsc.xml controlled vocabulary from the original Dspace distribution.\n\nI noticed that for DSpaceControlledVocabulary/ (.xml file-based) controlled vocabularies, DSpace assigns to the metadata key (e.g. dc.subject) the value of the controlled vocabulary entry's label value.\n\nInstead of the label value, I would rather prefer to assign the id value, that is:\nInstead of dc.subject=Research Subject Categories::HUMANITIES and RELIGION::Religion/Theology::Church studies I would rather like to transmit dc.subject=VR110103.\n\nIs this possible to configure?"
] | [
"dspace"
] |
[
"\"Raw\" Xamarin and MvvmCross",
"I'm still so new to Android that I'm not sure this is even a question, but here goes.\nI'm using MvvmCross 5.6.3.\nI need to use Xamarin routines like Signature Pad which do not have MvvmCross 'wrappers'.\nWhat do I need to be aware of when introducing Xamarin NuGet packages into my \"MvvmCross\" project?\nIs there a \"standard\" set of functions/code/techniques that must be used to access 'Xamarin' from 'within' 'MvvmCross' code?\nThank you,\nMarc"
] | [
"xamarin",
"mvvmcross"
] |
[
"Can't read swagger JSON file on ASP.NET Core 1.2 Application after hosting into local IIS",
"After hosting my asp.net core 1.2 application, I am getting an error as:\n\n\n swagger is unable to find the swagger.json file.\n\n\nI have tried to solve the problem by giving a virtual path name app.UseSwaggerUI() but it's not working.\n\nEdit to clarify question based on comments:\n\nAfter hosting Asp.net core application in IIS, the swagger.json file is generating on localhost:<random_port>/swagger/v1/swagger.json path.\n\nHow do I serve the swagger.json file on a custom route like:\nlocalhost:<random_port>/virtualpathname/swagger/v1/swagger.json \n\nI have tried to set a virtual path in app.UseSwaggerUI() like {virtualpathname}/swagger/v2/swagger.json but still it is not working"
] | [
"asp.net",
"asp.net-core",
"swagger",
"swagger-ui",
"asp.net-core-webapi"
] |
[
"How can I remove data which is stored in local storage?",
"If I console.log(localStorage.getItem(\"cartCache\")), the result like this :\n\n{\"dataCache\":[{\"id\":20,\"quantity\":1,\"total\":100000,\"request_date\":\"27-08-2017 20:31:00\"},{\"id\":53,\"quantity\":1,\"total\":200000,\"request_date\":\"27-08-2017 20:38:00\"}]}\n\n\nI want to remove the data in the cache by id\n\nFor example, I remove id = 20, it will remove id = 20 in the cache\n\nSo the result to be like this :\n\n{\"dataCache\":[{\"id\":53,\"quantity\":1,\"total\":200000,\"request_date\":\"27-08-2017 20:38:00\"}]}\n\n\nHow can I do it?"
] | [
"javascript",
"jquery",
"arrays",
"json",
"local-storage"
] |
[
"Angular. Load and update modal content based on ID",
"I need to load a gallery with a bunch of vimeo iframes. The problem is, if I will try to load all these iframes, the page loading time will be unbearable. So first I am just loading a gallery with ng-repeat:\n\n<ul data-ng-controller=\"WorksCtrl\">\n <li data-ng-repeat=\"work in works\">\n <a class=\"video\" data-toggle='modal' data-target=\"#{{work.modalID}}\">\n <img src=\"{{work.images[0]}}\" alt=\"\"/>\n <h2>{{work.title}}</h2>\n </a>\n </li>\n</ul>\n\n\nWhen user clicks the link, it should open a modal with relevant content, like that:\n\n<div class=\"modal fade\" id=\"{{work.modalID}}\">\n <div class=\"modal-body\">\n {{work.html_url}}\n </div>\n</div>\n\n\nMy JSON file looks like that:\n\n[\n{\n \"id\":1,\n \"modalID\":\"video1\",\n \"title\": \"Video One\",\n \"images\": [\n \"images/video_1.jpg\"\n ],\n \"html_url\": \"<iframe src='//player.vimeo.com/video/somevideolink1'></iframe>\"\n},\n{\n \"id\":2,\n \"modalID\":\"video2\",\n \"title\": \"Video Two\",\n \"images\": [\n \"images/video_2.jpg\"\n ],\n \"html_url\": \"<iframe src='//player.vimeo.com/video/somevideolink2'></iframe>\"\n}\n]\n\n\nHow to setup ng-click, so it opens the modal with relevant data? So when I click on a link it should put relevant ID and html_url for the iframe to the modal."
] | [
"angularjs",
"modal-dialog",
"angularjs-ng-click"
] |
[
"What is __FUNCT__ for?",
"I was looking at some PETSc example code, and I came across this snippet:\n\n#undef __FUNCT__\n#define __FUNCT__ \"main\"\n\n\nright before main begins. \n\nIs setting __FUNCT__ or something like it before every function (or just main?) a standard C programming convention?\n\nIf so, why is this done?"
] | [
"c",
"conventions",
"c-preprocessor"
] |
[
"Trying to authenticate to MS Dynamics CRM 2016 WebApi using R",
"I could use some help..\n\nI am trying to connect to a MS Dynamics CRM (2016) on-premise database. it is facing the internet (IFD) and uses adfs 3.0 to authenticate users.\n\nNow, when I try to connect to the api using the webbrouwser, a smal log-in form appears that lets me enter my username and password. When I submit these credentials, the browser opens a page with nice json code, however, when I try the following code in R \n\nlibrary(httr)\n\nresult <- GET(\n \"https://xrm.company.nl/Company/api/data/v8.2/some=query\",\n config = authenticate(\n user = \"MyUsername\",\n password = \"MyPassword\",\n type = \"ntlm\"\n )\n)\n\n\nI get text/html content that builds a POST form. This form is already filled out for me, but it relies on some js script to auto submit. There's also is a warning message available in the html that says that script is disabled combined with a handy (but unreachable) submit button.\n\nWhen I extract the html from the content content(result, as = \"text\"), put it in an html file and open it in my browser, the json results sow up.\n\nBut I don't know how to enable script, or how to click submit using R.\n\nAnybody any ideas for a workaround for these issues, or on how to authenticate correctly to adfs using R?"
] | [
"r",
"authentication",
"dynamics-crm",
"adfs",
"httr"
] |
[
"Go alternative for python loop.last",
"I'm looking to loop over an array with Go templates and I want to add an extra string to the last item in the loop.\n\nIn python, I can do \n\n{% for host in hosts %}\n{{ host }}{% if loop.last %} ;{% endif %}\n{% endfor %}\n\n\nLooking to achieve same thing with Go, below is the snippet of the Go equivalent.\n\n{{ range $host := $hosts }}\n{{$host}}\n{{ end }}\n\n\nThanks."
] | [
"python",
"go",
"go-templates"
] |
[
"Why android Messaging app is launched when I start an ACTION_SEND intent with */* mimeType type",
"I look at the android Messaging App source code, the manifest file said:\n\n <intent-filter>\n <action android:name=\"android.intent.action.SEND\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <data android:mimeType=\"image/*\" />\n </intent-filter>\n <intent-filter>\n <action android:name=\"android.intent.action.SEND\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <data android:mimeType=\"video/*\" />\n </intent-filter>\n <intent-filter>\n <action android:name=\"android.intent.action.SEND\" />\n <category android:name=\"android.intent.category.DEFAULT\" />\n <data android:mimeType=\"text/plain\" />\n </intent-filter>\n\n\nBut why in my code, I start an Intent like this:\n\nIntent sendIntent = new Intent(Intent.ACTION_SEND);\nsendIntent.setType(\"*/*\");\n\n\nI see the Messaging app in the pop up dialog?"
] | [
"android"
] |
[
"Can I create a route that matches an already ignored route?",
"So, I have the following in my global.asax creating my MVC routes. They are called in the order that they appear below. What I expected to have happen was it would ignore the routes to the css folder, but then create the route to css/branding.css (which is generated at runtime from another view)\n\n_routeCollection.IgnoreRoute(\"css/{*pathInfo}\");\n\n_routeCollection.MapRoute(\"BrandingCSS\", \"css/branding.css\", new { controller = \"Branding\", action = \"Css\" });\n\n\nIs this not possible? When I make a request to css/branding.css, I get a 404 error saying that the file does not exist. Is there a way to make this work, I'd rather it be transparent to anyone viewing source that this file is coming from anywhere but the css folder."
] | [
"asp.net-mvc",
"routing",
"ignoreroute"
] |
[
"Why doesn't position: fixed add a footer on every page in print preview using media print css in Safari browser",
"I have added below footer css using a media query . It's working fine on every browser except Safari. \n\n@media print {\nfooter{\n position:fixed;\n width: 100%;\n right:0;\n bottom:0;\n display:block;\n}\n\n}\n\n\nPlease help me . Thanks"
] | [
"html",
"css",
"browser",
"safari"
] |
[
"TaskFactory handle exceptions",
"How can I easily handle all exceptions that happens inside the task that I am running without blocking the UI thread.\n\nI found a lot of different solutions but they all involve the wait() function and this blocks the whole program.\n\nThe task is running async so it should just send a message to the UI thread saying that it has an exceptions so that the UI thread can handle it. (Maybe an event that I can hook on?)\n\nThis is the code I have now that blocks the UI Thread:\n\nvar task = Task.Factory.StartNew(() =>\n{\n if (_proxy != null)\n {\n _gpsdService.SetProxy(_proxy.Address, _proxy.Port);\n if (_proxy.IsProxyAuthManual)\n {\n _gpsdService.SetProxyAuthentication(_proxy.Username,\n StringEncryption.DecryptString(_proxy.EncryptedPassword, _encryptionKey).ToString());\n }\n }\n\n _gpsdService.OnLocationChanged += GpsdServiceOnOnLocationChanged;\n _gpsdService.StartService();\n});\ntry\n{\n task.Wait();\n}\ncatch (AggregateException ex)\n{\n if (ex.InnerException != null)\n {\n throw ex.InnerException;\n }\n throw;\n}"
] | [
"c#",
"multithreading",
"taskfactory"
] |
[
"Python/Plone - Is it possible to call a global utility at module level of a py file?",
"I have a product for a plone site with a module containing a utility class, and in the module that will/should use this utility, I am trying to have it setup at the module level.\n\nIn the module containing the utility (my.product.testutility), I have this:\n\nfrom five import grok\nfrom zope.interface import Interface\n\nclass ITestUtil(Interface):\n \"\"\"Interface of utility\n \"\"\"\n\n def returnTest(self):\n \"\"\"return a string for now\n \"\"\" \n\nclass TestUtil(object):\n \"\"\"Utility class test\n \"\"\"\n grok.implements(ITestUtil)\n\n def returnTest(self):\n return \"testing\"\n\ngrok.global_utility(TestUtil, name=\"TestUtility\")\n\n\nIn the module that will use this utility (my.product.stringtesting):\n\nfrom five import grok\nfrom my.package.testutility import ITestUtil\nfrom zope import component, schema\nfrom Products.CMFCore.interfaces import ISiteRoot\n\nutilForTesting = component.getUtility(ITestUtil, name=\"TestUtility\")\n\nclass IStringTest(Interface):\n ......\n\n\nclass View(grok.View):\n def returnStringForTest(self):\n return utilForTesting.returnTest()\n\n\nI also had the template file that would call the returnStringForTest to display the string on the rendered page.\n\nI end up getting this error unfortunately:\n ComponentLookupError: (< InterfaceClass my.product.testutility.ITestUtil >, \"TestUtility\")\n\nI did try several different things like using grok.GlobalUtility as a base as opposed to making it an object registering it through grok.global_utility. I did remove the name parameter in the class using this while testing this.\n\nThe documentation I was trying to follow was the References on the grok site, looking at the directives page where it has the global utility information.\n\nAlso, I am using grok 0.9.\nEdit:\nThe version of Plone I am using is Plone 4 and the version of python I am using is 2.7.\n\nIs it possible to have the utility set up at the module level like I was trying?"
] | [
"python",
"plone",
"grok"
] |
[
"Multiline parameter in Delphi7 TAdoQuery",
"With Delphi 7 and SQL Server 2005 I'm trying to pass a multiline parameter (a Stringlist.text) to a TAdoQuery insert script.\nThe insert is successful, but when i take back data from the field, i take\n\nLine 1 Line 2 Line 3\n\n\ninstead of\n\nLine 1 \nLine 2 \nLine 3\n\n\nThe fieldtype in the table is nvarchar(MAX) and i can't change it to any other type, the table is not mine. I tried to change the parameter type from widestring to ftMemo, but nothing changes.\nAny idea?\n\nvar\n QRDestLicenze: TADOQuery;\n LsLic := TStringList;\n\nbegin\n LsLic := TStringList.Create;\n LsLic.Add('Line 1');\n LsLic.Add('Line 2');\n LsLic.Add('Line 3');\n QRDestLic.Parameters.FindParam('FieldName).Value := LsLic.Text;\n QRDestLic.ExecSQL;\nend;"
] | [
"delphi",
"parameter-passing",
"ado",
"tadoquery"
] |
[
"Android Studio Passing list of views between activities?",
"Im a beginner in android studio and im trying to pass a list of views between activities, this is my declaration: List<View> myList = new ArrayList<View>();\n\nBut I dont think putExtra()can be used to pass a list of views (it works for list of strings though). This is what Ive tried:\n\nIntent intent = new Intent(\"com.example.javipasku.conditionreport.Main2Activity\");\nintent.putExtra(\"d\", myList);\nstartActivity(intent);\n\nI get an error message saying the method putExtra cannot be resolved with this type of list.\n\nThanks in advance guys!"
] | [
"android",
"list",
"android-studio",
"arraylist",
"views"
] |
[
"alternative to collect in spark sq for getting list o map of values",
"Basically is very general my question, everybody tell dont use collect in spark, mainly when you want a huge dataframe, becasue you can get an error in dirver by memory, but in a lot cases the only one way of getting data from a dataframe to a List o Map in \"Real mode\" is with collect, this is contradictory and I would like to know which alternatives we have in spark.\n\nThanks in advance."
] | [
"scala",
"apache-spark-sql"
] |
[
"Is null Property in LInq?",
"select * from Toys Order by isnull(ModifiedOn ,CreatedOn) DESC \n\n\nI want DESC Result at the Basis of ModifiedOn if it is null so i want this go to at the Basis of CreatedOn\n\nso far I did is\n\n.OrderByDescending(x => x.CreatedOn).ThenByDescending(x => x.ModifiedOn)\n\n\nBut Could not Achive ?\n\nAnyOne have Idea how can i achive this ?"
] | [
"c#",
"asp.net",
"linq"
] |
[
"how to create a tray in QT like system tray",
"I created a qt application. In which there are several links to connect to other applications like MS Word, Excel,IE etc. When the corresponding button is clicked, it will link to that application. What I want to do that, whenever the particular application is minimized, it should go to the system tray of QT application ,not in the system tray.\nSo I have to create a system tray of QT.\nAll your suggestions are appreciated.Thanks in advance."
] | [
"qt4",
"system",
"system-tray",
"windows-applications",
"advanced-search"
] |
[
"print unicode characters in python interpreter",
"I am playing around working with unicode in python.\nI am not able to print (display) the unicode characters such asé\nI tried the following:\n\n>>> sys.setdefaultencoding('UTF8')\n>>> chr(0xFF)\n'\\xff'\n>>> u = u'abcdé'\n>>> len(u)\n5\n>>> u[4] \nu'\\xe9'\n>>> str(u[4])\n'\\xc3\\xa9'\n>>> \n\n\nI was expecting u[4] to print é but it prints u'\\xe9'. how can I make this work?\nI am using python 2.7.2 version"
] | [
"python",
"unicode"
] |
[
"MAXENT model in R for Classification",
"I am trying to Classify text using RTextTools package using R.\n\nI have done this using - SVM (and the below code works fine :)\n\nmatrix[[i]] <- create_matrix(trainingdata[[i]][,1], language=\"english\",removeNumbers=FALSE, stemWords=FALSE,weighting=weightTf,minWordLength=3)\ncontainer[[i]] <- create_container(matrix[[i]],trainingdata[[i]][,2],trainSize=1:length(trainingdata[[i]][,1]),virgin=FALSE)\nmodels[[i]] <- train_models(container[[i]], algorithms=c(\"SVM\"))\n\n\nBut when i do the same thing with MAXENT algorithm \n\nmodels[[i]] <- train_models(container[[i]], algorithms=c(\"MAXENT\"))\n\n\nIt throws me error:\n\nError in Module(module, mustStart = TRUE) : \n function 'setCurrentScope' not provided by package 'Rcpp' \n\n\nWhen i did traceback - got the below details\n\nModule(module, mustStart = TRUE) \n.getModulePointer(x) \nmaximumentropy$add_samples \nmaximumentropy$add_samples \ntrain_maxent(feature_matrix, code_vector, l1_regularizer, l2_regularizer, \nmaxent(container@training_matrix, as.vector(container@training_codes), \ntrain_model(container, algorithm, ...) \ntrain_models(container[[i]], algorithms = c(\"MAXENT\")) \n\n\nupdate:\n\nsessionInfo()\nR version 3.0.2 (2013-09-25)\nPlatform: x86_64-w64-mingw32/x64 (64-bit)\n\nlocale:\n[1] LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252 LC_MONETARY=English_Singapore.1252\n[4] LC_NUMERIC=C LC_TIME=English_Singapore.1252 \n\nattached base packages:\n[1] stats graphics grDevices utils datasets methods base \n\nother attached packages:\n[1] tm_0.5-10 hash_3.0.1 RTextTools_1.4.2 SparseM_1.03 \n\nloaded via a namespace (and not attached):\n [1] bitops_1.0-6 caTools_1.16 class_7.3-9 e1071_1.6-1 glmnet_1.9-5 grid_3.0.2 \n [7] ipred_0.9-3 KernSmooth_2.23-10 lattice_0.20-23 lava_1.2.4 MASS_7.3-29 Matrix_1.1-2 \n[13] maxent_1.3.3.1 nnet_7.3-7 parallel_3.0.2 prodlim_1.4.2 randomForest_4.6-7 Rcpp_0.10.6 \n[19] rpart_4.1-5 slam_0.1-31 splines_3.0.2 survival_2.37-7 tau_0.0-16 tools_3.0.2 \n[25] tree_1.0-34\n\n\nIs there a way to solve this problem."
] | [
"r",
"svm",
"document-classification",
"maxent"
] |
[
"Weird behavior in using sortBy with Backbone/Coffeescript",
"I am using Backbone with Coffeescript. The code I use for my view is: \n\n initialize: ->\n @collection.on \"reset\", @render, @\n @collection.fetch({reset: true})\n\n render: ->\n @collection = @collection.sortBy (item) -> item.get('name')\n @collection.forEach @renderEntry, @\n @\n\n renderEntry: (model) ->\n v = new App.Views.EntryView({model: model})\n @$el.append(v.render().el)\n\n\nThe problem is when I want to sort Backbone collection on the first line of render function I get Uncaught TypeError: Object [object Array] has no method 'sortBy' error. If I change render function and rewrite it as :\n\n render: ->\n sorted = @collection.sortBy (item) -> item.get('name')\n sorted.forEach @renderEntry, @\n @\n\n\nthen everything works fine. What's wrong with original code?\n\nI tried to move sorting functionality to another function and nothing changed. Again when I want to assign sorted collection to the collection itself I get the same error.\n\nAny ideas?\n\nThanks in advance."
] | [
"backbone.js",
"coffeescript"
] |
[
"How to call a servlet from jQuery and assign that value to a textbox or dropdown on pageload?",
"I new jQuery this is my first time trying it. I am trying to fetch a textbox value from the database using a servlet when the JSP page loads using a jQuery function. Here is my function in JSP code:\n\n<script src=\"/jquery.js\"></script>\n<script type=\"text/javascript\">\n function serial() {\n alert(\"serial\");\n get(\n 'Serialno',\n function(nexts) {\n $('#serialno').val(nexts);\n alert(nexts);\n }\n );\n }\n</script>\n\n\nBody part of html code\n\n<body onload=\"serial();\">\n <form action=\"get\" name=\"billdet\" >\n Serial Number: \n <input type=\"text\" disabled=\"disabled\" name=\"serialno\" /><br>\n </form>\n</body>\n\n\nand my doGet() method in servlet class.\n\npublic void doGet(HttpServletRequest request, HttpServletResponse response)\n response.setContentType(\"text/html\");\n response.getWriter().write(nexts);\n //PrintWriter out=response.getWriter();\n System.out.println(nexts);\n}"
] | [
"jquery",
"mysql",
"servlets",
"textbox"
] |
[
"Powershell Object combobox",
"I'm filling a ComboBox by selecting objects.\n\n$TrkList = $x.tracks | Where-Object { $_.properties.codec_id -eq \"A_EAC3\"} | Select-Object ID, codec, {$_.properties.language}\n\n\nIt works but I'd like a proper presentation.\nFor now, it shows like:\n\n@{id=1; codec=AC-3/E-AC-3; $_.properties.language=eng}\n@{id=1; codec=AC-3/E-AC-3; $_.properties.language=fre}\n@{id=1; codec=AC-3/E-AC-3; $_.properties.language=jpn}\n\n\nHow could I show like:\n\nID 1: AC-3/E-AC-3 language:eng\nID 1: AC-3/E-AC-3 language:fre\nID 1: AC-3/E-AC-3 language:jpn\n\n\nThanks for your help."
] | [
"powershell",
"object",
"combobox"
] |
[
"Pipe crashing at 1020 iterations",
"Well I'm programming in C, I was doing this \n\nFILE *pipe;\npid_t child;\nint fd[2];\n\nchild = fork();\n\nif ( child == 0 )\n{\n dup2(fd[2], STDOUT_FILENO);\n close(fd[0]);\n execl(\"func\", \"func\", str_attr, NULL);\n\n exit(0);\n}else\n {\n waitpid(child, NULL,0);\n pipe = fdopen(fd[0],\"r\");\n fscanf(pipe,\"%s\",buffer);\n fclose(pipe);\n }\n\n\nWhen I try with more than 1019 cases, crash. I tried to debug but i don't see anything rare in my code. It seems that the pipe is broken when pass the 1020 iteration"
] | [
"c",
"multithreading",
"fork",
"pipe"
] |
[
"SpringMVC Resources Path Changes When using Href Tag",
"I have a Spring MVC application it uses jquery.webcam.js this file is located in a js folder in the resources directory on WAR -resources -js,css.. - WEB-INF. Thats the basic structure in the js directory there is a jquery.webcam.js.\n\nWhen the form that uses jquery.webcam.js and other custom js files is fired its ok it finds all the js files. However on that form i click a button and i am then posted to another page, on this page i have a hyper link that has a url of \"getData/${id}.htm\". When i click on the hlink i am taken to the controller which has a mapping for this url:\n\n @RequestMapping(value=\"getData/{id}.htm\", method = RequestMethod.GET) \n\n\nIn the controller a select is preformed from the database and an object is returned to the previous page (first form - that uses the jquery.webcam.js). When i am returned to that page i am getting in firebug a 404 error for the jquery.webcam.js file. \n\nUpon further inspection the url for the location of my resources has changed from http://localhost:8080/myApp/jquery.webcam.js to http://localhost:8080/myApp/getData/jquery.webcam.js\n\nWhy has getData now became part of the resources url and how can this be fixed?"
] | [
"javascript",
"jquery",
"spring-mvc",
"jquery-webcam-plugin"
] |
[
"Timing a unit test, including the set up",
"How can you capture the time of an individual unit-test, including the set-up cost?\n\nI've got a test base with a set-up procedure which takes a non-trivial amount of time to complete. I've got several tests which descend from that test base, and I've got a decorator which, in theory, should print out the time it takes to run each test:\n\nclass TestBase(unittest.TestCase):\n def setUp(self):\n # some setup procedure that takes a long time\n\ndef timed_test(decorated_test):\n def run_test(self, *kw, **kwargs):\n start = time.time()\n decorated_test(self, *kw, **kwargs)\n end = time.time()\n print \"test_duration: %s (seconds)\" % (end - start)\n return run_test\n\n\nclass TestSomething(TestBase):\n @timed_test\n def test_something_useful(self):\n # some test\n\n\nNow, when I run these tests it turns out that I'm only printing the time it took for the test to run not including the set-up time. Tangentially, a related question may be: is it best to deal with timing outside of your testing framework?"
] | [
"python",
"django",
"unit-testing",
"testing",
"python-unittest"
] |
[
"Monotouch - select multiple photos",
"Is there a way to do this in MonoTouch? \n\nhttp://definelabs.com/blogs/?p=17\n\nI don't understand much of that Objective-C code..."
] | [
"c#",
"iphone",
"xamarin.ios"
] |
[
"c# execute a method from Form in the MainForm",
"Well, I'm not sure that the title was really clear so let's explain it with an exemple:\n\nHere is the mathod that open the WinForm when clicked...\n\nnamespace STS\n{\n public partial class MainForm : Form\n {\n /*---------- SHOW DATABASE ----------*/\n private void showDataBasesToolStripMenuItem_Click(object sender, EventArgs e)\n {\n ShowDataBase db = new ShowDataBase();\n db.Show();\n }\n }\n}\n\n\nHere is the code executed when the WinForm exit. That's the moment when I want it to call a method in the MainForm.\n\n...And here are the errors...\n\nnamespace STS\n{\n public partial class ShowDataBase : Form\n {\n /*---------- ----------*/\n private void ShowDataBase_FormClosed(object sender, FormClosedEventArgs e)\n {\n /*I've try this but error: An object reference is required for the non-static field, method, or property*/\n MainForm.plotMarks();\n\n /*And this but error: There is no argument given that corresponds to the required formal parameter*/\n MainForm mF = new MainForm();\n // With: MainForm mF = new MainForm(this); //--> No error but it execute another Form than the one I want (my splashScreen in this case)...\n mF.plotMarks()\n }\n }\n}\n\n\nAnd here is the method that I wanna call:\n\nnamespace STS\n{\n public partial class MainForm : Form\n {\n public void plotMarks()\n {\n MessageBox.Show(\"Hello\");\n }\n }\n}\n\n\nThanks in advance for your help!\n\nDimitri"
] | [
"c#",
"forms",
"winforms"
] |
[
"3D objects keep moving ARKit",
"I am working on an AR app for which I am placing one 3D model in front of the device without horizontal surface detection.\n\nBased on this 3D model's transform, I creating ARAnchor object. ARAnchor objects are useful to track real world objects and 3D objects in ARKit. \n\nCode to place ARAnchor:\n\nARAnchor* anchor = [[ARAnchor alloc] initWithTransform:3dModel.simdTransform]; // simd transform of the 3D model\n[self.sceneView.session addAnchor:anchor];\n\n\nIssue:\nSometimes, I found that the 3D model starts moving in random direction without stopping.\n\nQuestions:\n\n\nIs my code to create ARAnchor is correct? If no, what is the correct way to create an anchor?\nAre there any known problems with ARKit where objects starts moving? If yes, is there a way to fix it?\n\n\nI would appreciate any suggestions and thoughts on this topic.\n\nEDIT:\n\nI am placing the 3D object when the AR tracking state in normal. The 3D object is placed (without horizontal surface detection) when the user taps on the screen. As soon as the 3D model is placed, the model starts moving without stopping, even if the device is not moving."
] | [
"ios",
"augmented-reality",
"arkit"
] |
[
"how to let dropdown menu align-right?",
"i used bootstrap navbar,and a dropdown menu at right of the navbar,when run on big page,the dropdown menu can popup at right,it`s ok,but when i change the window size,the dropdown menu popup at left of the page?why?how to let it popup at right of the window always?\n\nthese are css code:\n\n <style>\n .navbar-header, .navbar-brand {\n float: left !important;\n }\n\n .dropdown-toggle {\n float: right !important;\n }\n\n .navbar-right:last-child {\n margin-right: 0px !important;\n padding-top: 8px !important;\n }\n\n </style>\n\n\nthese are html code:\n\n <nav class=\"navbar navbar-inverse navbar-fixed-top\">\n <div class=\"container-fluid\">\n <!-- Brand and toggle get grouped for better mobile display -->\n <div class=\"navbar-header\">\n <a class=\"navbar-brand\" href=\"#\">Brand</a>\n </div>\n\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class=\"navbar-right\">\n <a href=\"#\" class=\"btn btn-link dropdown-toggle\" data-toggle=\"dropdown\" aria-label=\"Left Align\">\n <i class=\"glyphicon glyphicon-list\" aria-hidden=\"true\"></i>\n </a>\n <ul class=\"dropdown-menu\" role=\"menu\">\n <li><a href=\"#\">Action</a></li>\n <li><a href=\"#\">Another action</a></li>\n <li><a href=\"#\">Something else here</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"#\">Separated link</a></li>\n </ul>\n </div>\n </div>\n <!-- /.container-fluid -->\n </nav>\n\n\nhow to let it popup at right of the window always? thanks,thanks."
] | [
"jquery",
"css",
"twitter-bootstrap"
] |
[
"Use const T(&x)[N][M] to constructor class Matrix",
"I don't know this question is clear or not.\nI want make a simple matrix like that\n\ntemplate<typename T>\nclass Matrix {\nprivate:\n T* m_buffer;\n int m_row;\n int m_col;\npublic:\n template<int N, int M>\n Matrix(const T (&x)[N][M]);\n};\n\ntemplate<typename T>\ntemplate<int N, int M>\ninline\nMatrix<T>::Matrix(const T (&x)[N][M]) : m_row(N), m_col(M) {\n m_buffer = new T[N*M];\n std::copy(x, x + N*M, m_buffer);\n}\n\nint main() {\n int a[2][3] = { {1, 2, 3},\n {4, 5, 6} };\n Matrix<int> x(a); // This not work\n return 0;\n}\n\n\nIt seem be not working and get some error when compile. I want to ask how to fix this error.\n\n/usr/include/c++/5/bits/stl_algobase.h: In instantiation of ‘static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const int (*)[3]; _OI = int*]’:\n/usr/include/c++/5/bits/stl_algobase.h:400:44: required from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const int (*)[3]; _OI = int*]’\n/usr/include/c++/5/bits/stl_algobase.h:436:45: required from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const int (*)[3]; _OI = int*]’\n/usr/include/c++/5/bits/stl_algobase.h:469:8: required from ‘_OI std::copy(_II, _II, _OI) [with _II = const int (*)[3]; _OI = int*]’\n../main.cpp:34:13: required from ‘Matrix<T>::Matrix(const T (&)[N][M]) [with int N = 2; int M = 3; T = int]’\nsubdir.mk:18: recipe for target 'main.o' failed\n../main.cpp:40:21: required from here\n/usr/include/c++/5/bits/stl_algobase.h:340:18: error: invalid conversion from ‘const int*’ to ‘int’ [-fpermissive]\n *__result = *__first;\n\n\nThank you for your support."
] | [
"c++",
"matrix"
] |
[
"Change log level for Apache Jackrabbit under Tomcat 7",
"I am attempting to view INFO- or DEBUG-level log messages for Apache Jackrabbit 2.7.X running under Tomcat 7. I've searched for awhile and found two different possibilities on how to do this:\n\n\nAdd a WEB-INF/log4j.xml file with the appropriate configuration\nSet Java-level properties, e.g. log4j.logger.org.apache.jackrabbit\n\n\nThis seems like a simple task but thus far I've not been able to make either of the above work for me.\n\nI am particularly interested in seeing some of the \"internals\", e.g. what data is received over the wire versus what is created in the repository, and so forth. I don't even know if this is possible but I figure logging everything is a good place to start."
] | [
"tomcat",
"logging",
"jackrabbit"
] |
[
"Move CComBSTR to std::vector?",
"Is there a way to move CComBSTR object to std::vector without copying the underlying string? It seems the following code doesn't work.\n\nCComBSTR str(L\"SomeStr\");\nstd::vector<CComBSTR> vStr;\n\nvStr.push_back((CComBSTR)str.Detach());"
] | [
"c++11",
"atl"
] |
[
"Hibernate Subquery and DetachedCriteria",
"I have created a DetachedCriteria that is retrieving estates that have the isApproved and isPublished set to true. It is defined in this way:\n\nDetachedCriteria activePublishedCriteria = DetachedCriteria.forClass(Estate.class)\n .add(Restrictions.eq(\"isApproved\", true))\n .add(Restrictions.eq(\"isPublished\", true))\n .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);\n\n\nI would like to reuse this criteria in some of the queries. In this case I would like to replace the isApproved and isPublished restrictions with the DetachedCriteria\n\nCriteria criteria = getSession().createCriteria(Estate.class)\n .createAlias(\"city\", \"c\")\n .add(Restrictions.eq(\"c.id\", cityID))\n // the following 2 lines should use the DetachedCriteria \n .add(Restrictions.eq(\"isApproved\", true))\n .add(Restrictions.eq(\"isPublished\", true))\n .setProjection(Projections.rowCount());\n return (Integer) criteria.list().get(0);\n\n\nIs there a way to do this ? Tried to use \n\n.add(Subqueries.geAll(....\n\n\nBut cannot make it work properly. I could not find proper documentation on the Subqueries in Hibernate. Tips are welcomed."
] | [
"hibernate",
"detachedcriteria",
"subquery"
] |
[
"Force FullScreen on EditText in Android",
"I am currently developing an app with Samsung Galaxy Tab 2 as my device.\n\nMy Code in the XML is:\n\n<EditText\n android:id=\"@+id/analysis_text\"\n style=\"@style/icon_text\"\n android:imeOptions=\"actionDone\"\n android:inputType=\"textMultiLine\"\n android:onClick=\"onBtnClicked\"\n/>\n\n\nWhen this code executes, the full screen data entry mode (Extract Mode) is triggered automatically only in certain situations.\n\nI would like my users to get a full data entry screen while editing text in this control, regardless of the screen or positioning of the control. \n\nAnother rephrase of this question:\nHow do I force full screen data entry mode for EditText boxes in my activity no matter what the content is?"
] | [
"android",
"android-edittext",
"fullscreen",
"mode"
] |
[
"Invalid operation in Xml?",
"I am trying to remove attributes from an xml whose value contains certain string.\n\nThis is the code I wrote,\n\nXmlDocument doc = new XmlDocument(); \ndoc.LoadXml(\"<book genre='#novel' ISBN='1-861001-57-5'>\" + \n \"<title id ='#x'>Pride And Prejudice</title>\" +\n \"</book>\");\n\n //Get the root element of the element\n XmlElement el = doc.DocumentElement;\n\n foreach (XmlElement a in doc.ChildNodes)\n {\n XmlAttributeCollection atributos = a.Attributes;\n\n foreach (XmlAttribute att in atributos)\n {\n if (att.Value.StartsWith(\"#\"))\n {\n a.RemoveAttribute(att.Name); //Gives invalid operation exception\n }\n }\n }\n\n\nIn the second iteration, it gives me invalid operation error.\n\nI looked around and found something that it could be because I am trying to modify the collection in the foreach loop. \n\nIf that is the case, what will be the best solution?\n\nI generate an new xml?"
] | [
"c#",
"xml",
"xml-attribute"
] |
[
"API Platform - Vuetify: @api-platform/client-generator issue",
"I've started to learn API Platform. I've installed successfully API Platform, database and Symfony. Now I try to install Vuetify without Docker by following this tutorial (https://api-platform.com/docs/client-generator/vuetify/#generating-the-vuejs-web-app). Everything works well, except this command (of course, I've replaced URL):\nnpx @api-platform/client-generator -g vuetify https://demo.api-platform.com src/ \n\nI've this error: "error: Error: only absolute urls are supported".\nI've tried to put a "console.log" inside source code (in file "node-fetch/index.js") and I've noticed that URL seems to be wrong (in "Fetch" function).\nI develop on Windows 10. What's wrong?"
] | [
"symfony",
"vuetify.js",
"api-platform.com"
] |
[
"Dictionary Object confusion from jQuery to Django!",
"I'm attempting to send a dictionary from jQuery to Django using a getJSON call:\n\njQuery.getJSON(URL,JSONData,function(returnData){});\n\n\nThe JSONData object is formatted as follows:\n\nJSONData = {\n year:2010101,\n name:\"bob\",\n\n data:{\n search:[jim,gordon],\n register:[jim],\n research:[dave],\n }\n}\n\n\nThis is put together programmatically but looks fine.\n\nOnce passed to Django the \"year\" and \"name\" objects are as expected. The data object however contains the following keys/values - \"search[0]\":\"jim\", \"search[1]\":\"gordon\",\"register[0]\":\"jim\",\"research[0]\":\"dave\", rather than the expected \"search\":(array of data), \"register\":(array of data), \"research\":(array of data).\n\nSimilar things happen if I use objects in place of the arrays. \n\nIs this an issue with Django's interpretation of the object? \n\nAny idea how I might correct this...cleanly?\n\nEDIT:\n\nI have now simplified the data to make testing easier:\n\nJSONData = { \n year:2010101, \n name:\"bob\", \n search:[jim,gordon], \n register:[jim], \n research:[dave], \n\n}"
] | [
"javascript",
"jquery",
"django",
"json",
"object"
] |
[
"openSL ES emulator for PC",
"I have openSL ES working for my android NDK.\nIs there a way to make my openSL ES code emulated on the PC ? Can someone provide suggestions as to what will be the best alternatives if emulation is not possible."
] | [
"android-ndk",
"opensl"
] |
[
"Detecting when a Cross-Domain Popup Window Closes",
"I have a javascript application that lives on say domainA.com. In order to authenticate a user and set cookies, it opens a popup window on domainB.com. (this is similar to Twitter's @anywhere). \n\nHow do detect when the popup on domainB.com closes and call a function in the javascript that opened it on domainA.com?\n\nI've tried various methods like window.opener, window.unload, etc, but run into cross domain limitations."
] | [
"javascript",
"javascript-events"
] |
[
"\"reentrant call to SetCurrentCellAddressCore\" in event handlers - only where cell row and column indices are equal",
"I am making a WinForms application which includes a form that uses a DataGridView to handle simple data manipulation. To ensure accurate entry while mitigating clutter (read: without using DataGridViewComboBoxColumn) I have a couple event handlers which temporarily turn a DataGridViewTextBoxCell into an equivalent DataGridViewComboBoxCell connected to values known to be \"clean\" when editing events are raised (typically when an editable cell is clicked):\n\nprivate void OnCellEndEdit(object sender, DataGridViewCellEventArgs e)\n{\n //construct a textbox cell and set to current value\n DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();\n cell.Value = dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;\n\n //color row if invalid or modified\n UpdateRowStyle(dataGridView.Rows[e.RowIndex]);\n\n //switch to the new cell and redraw\n dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex] = cell;\n dataGridView.Refresh();\n}\n\n\nand\n\nprivate void OnCellBeginEdit(object sender, DataGridViewCellCancelEventArgs e)\n{\n //construct a combobox cell, link to data, and set to current value\n DataGridViewComboBoxCell cell = new DataGridViewComboBoxCell();\n cell.DataSource = mDropDownValues[dataGridView.Columns[e.ColumnIndex].Name];\n cell.Value = dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;\n\n //switch to the new cell and redraw\n dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex] = cell;\n dataGridView.Refresh();\n}\n\n\nMost of the time this works perfectly - the last cell edited reverts to a DataGridViewTextBoxCell containing the newly selected data, and the cell selected for editing becomes a DataGridViewComboBoxCell linked to the data specified in the mDropDownValues[] dictionary. When editing a cell which has row and column indices that are equal, however, I run into trouble. The cell fails to change between the two types, throwing an exception on the dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex] = cell; line in both event handlers (once when handling CellBeginEdit and then again when handlingCellEndEdit). The exception states\n\n\n \"Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.\"\n\n\nWhat is causing this error, and why does it only happen when editing the cells along the DataGridView's diagonal? Is there some way I can achieve this functionality without throwing this exception?"
] | [
"c#",
"winforms",
"exception",
"datagridview",
"event-handling"
] |
[
"C# creating an array in a singelton class",
"I want to create an array of Disc which id like to include fields string[] Record, int NumberHeads and string extension. so basically grouping them and instantiate the array once and only once as i dont want more than one of this array in the memory. How can i do this as my fields dont seem to be under the array Disc and if i make them public and run the application i get a null reference exception. \n\nI was initially using a struct but I came to realise these cannot be passed from class to class in C#.\n\nclass DiscType\n{\n private static DiscType[] disc;\n private static string[];\n public bool discSelect;\n public int maxRecord;\n public int numberHeads;\n public string extension;\n\n public static string[] Record\n {\n get\n {\n if (record == null)\n {\n record = new string[1000];\n }\n return record;\n }\n }\n\n public static DiscType[] Disc\n {\n get\n {\n if (disc == null)\n {\n disc = new DiscType[10];\n\n }\n return disc;\n }\n }\n}\n\npublic partial class Form1 : Form\n{\n public Form1()\n {\n InitializeComponent();\n }\n\n private void Form1_Load(object sender, EventArgs e)\n {\n for (int i = 0; i < DiscType.Disc.Length; i++)\n {\n DiscType.Disc[i].Record[i]= \"1\";\n } \n }\n}"
] | [
"c#",
"arrays",
"struct",
"singleton"
] |
[
"Text input box in pygame/python",
"I am working on an RPG in pygame/python. I have made a char. creator that allows you to customize the player. Now I am looking for a way to prompt for a name on-screen. I don't want it to make a box, just print what the user is typing in a specific area (see picture).\nThanks for help.\n\nhttp://ubuntuone.com/3HdzOKroopUEf1YxqNnbFM <-----Picture (only looks blue through the link)"
] | [
"python",
"text",
"input",
"pygame"
] |
[
"JRebel constantly reloading every client-side class file with GWT",
"We're considering about switching from Eclipse to IntelliJ IDEA. We have to use JRebel so we don't have to restart the app each time we change a line of code.\n\nEvery time I change one line of code in one .java file, and after invoking the IntelliJ make process on that particular file, JRebel seem to reload a whole bunch of client-side classes. \n\nWith Eclipse, this brutal reloading behavior might happen sometimes, but in most cases the class reloading process is much faster !\n\nI think that I'm missing something. Does anyone with experience using IntelliJ and JRebel know how to have JRebel plugin reload one single class when nothing more is needed ?\n\nAny help would be greatly appreciated ! \n\n\nNote 1 : I know super dev mode could help but I'd like to have the\nJRebel plugin work first.\nNote 2 : the VM arg -Drebel.check_class_hash=true helps too, but I don't think the plugin is meant to work that way."
] | [
"gwt",
"intellij-idea",
"jrebel"
] |
[
"Summing column_property values",
"I have two column_property columns that I'd like to sum together in the grandtotal column. I want to be able to sort and filter against the grandtotal column.\n\nHow can I sum the subtotal and shipping columns' values?\n\nCode:\n\nsubtotal = orm.column_property(\n select([case(\n [(func.sum(OrderProductModel.subtotal).is_(None), 0)],\n else_=func.sum(OrderProductModel.subtotal))\n ]).where(OrderProductModel.order_id == id))\nshipping = orm.column_property(case(\n [(is_expedited.is_(True), shipping_rate)], else_=Decimal(0.00)))\ngrandtotal = orm.column_property(func.sum(subtotal + shipping))\n\n\nError:\n\nTypeError: unsupported operand type(s) for +: 'ColumnProperty' and 'ColumnProperty'"
] | [
"sql",
"python-2.7",
"sqlalchemy"
] |
[
"How to open .doc file is ms word app in android using intent action?",
"I tried to open the .doc file in android app using intent action view its showing \nError \n\n\n try saving file on device and then opening it\n\n\nIt works well in aother app like polaris,wps...etc\n\nWhy its not working in ms word android app\n\nIN Manifest.xml\n\nHow to fix it?"
] | [
"android",
"android-intent",
"ms-word",
"doc"
] |
[
"Unable to Fetch ID from PHP to AJAX",
"I am trying to build an E-commerce website using PHP and AJAX but I am facing problem when I try to delete items from the cart. I am fetching the cart data from the cart table that is in my database. The fetched data code is shown below. (Please don't care about the variables, they are all in the code I am not pasting here)\n\necho \"<tr>\n <td class='p-image'>\n <a href='product-details?id=$fetchProductID'><img alt='' src='$theRealLink'></a>\n </td>\n <td class='p-name'><a href='product-details?id=$fetchProductID'>$theName</a></td>\n <td class='p-amount'>INR $fetchProductUnitPrice</td>\n <td class='p-quantity'><input maxlength='100' type='text' value='$fetchProductQuantity' name='quantity'></td>\n <td class='p-total'><span>INR $fetchedProductTotal </span></td>\n <td class='edit'><a href='javascript:void(0)' id='delete-from-cart' data-id='$fetchProductID'><img src='assets/img/icon/delte.png' alt=''></a>\n </td>\n </tr>\";\n\n\nWhenever someone presses the button with the ID of delete-from-cart, I run the javascript code that fetched the ID of the product to be deleted from data-id attribute. The code is below\n\n$('#delete-from-cart').click(function() {\n var deleteID = $(this).attr('data-id');\n alert(deleteID);\n});\n\n\nJust alerting for now. The real problem is, say my cart have 3 different items, so I get 3 different buttons to delete them but only the button of the first item in the cart is working i.e. An alert is displayed containing the ID of the product to be deleted.\n\nI am wondering that why only the first button is working and rest all are not working at all ?"
] | [
"javascript",
"php",
"ajax"
] |
[
"How to convert SQL many to many data model to firebase data model",
"I am having troubles trying to convert my data model of an attendance system for a football trainer (I have done it as if it were a SQL normalized relational model) to a firebase model. Here is a picture of my relational model:\n\nI was thinking about making 4 Collections also:\nPlayers\nAttendance\nMatch\nMatchType (it can be friendly-match, tournament, practice, among others)"
] | [
"sql",
"firebase",
"google-cloud-firestore",
"data-modeling"
] |
[
"jquery expanding menu how to?",
"I want to build a menu like this: http://wearebuild.com/\n\nTry to click \"Selected Works\" \n\nHow can I make a div with child elements grow like it does in the menu?\n\nCan anyone point me in a starting direction?"
] | [
"jquery",
"jquery-ui"
] |
[
"Image upload through admin in Django",
"I want to be able to upload images through the admin in Django. But I am having some difficulty\n\nproject structure:\n\n/Proj\n /Proj\n\n /static\n /img\n /albums\n /album1\n img1\n /album2\n img2\n\n\nAlbum class:\n\nclass Album(models.Model):\n title = models.CharField(max_length = 60)\n\n def __unicode__(self):\n return self.title\n\n\nImage class:\n\nclass Image(models.Model):\n title = models.CharField(max_length = 60, blank = True, null = True)\n image = models.FileField(upload_to = get_upload_file_name) <-- !!!!\n tags = models.ManyToManyField(Tag, blank = True)\n albums = models.ForeignKey(Album)\n width = models.IntegerField(blank = True, null = True)\n height = models.IntegerField(blank = True, null = True)\n created = models.DateTimeField(auto_now_add=True)\n\n\nI THINK my image = models.FileField(upload_to = get_upload_file_name) uses the get_upload_file_name method to place the image in the correct album. This is done through appending to my MEDIA_ROOT which is MEDIA_ROOT = os.path.join(BASE_DIR, 'static')\n\nSo the get_upload_file_name method is supposed to do so. But I am not sure how to so.\n\nI think before I can upload I need to create an album first so then I can decide which album the image will go in. A bit lost at this point. Not sure if my Image or Album class is even complete. Thanks for the help!!"
] | [
"python",
"django",
"django-models",
"django-admin"
] |
[
"How can I send a parse push to an installation id or device token",
"How can I use the Parse REST API to push to a specific deviceToken or installation Id? I make the request and it succeeds with a 200 response but I get no push.\n\ncurl -X POST \\\n -H \"X-Parse-Application-Id: XYZ\" \\\n -H \"X-Parse-REST-API-Key: FOO\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"where\": {\n \"deviceToken\": \"someId\"\n },\n \"data\": {\n \"alert\": \"Willie Hayes injured by own pop fly.\"\n }\n }' \\\n https://api.parse.com/1/push"
] | [
"parse-platform"
] |
[
"How to add gradient background color to prototyped UITableViewCell in storyboard?",
"Is there any way to add a gradient to prototyped UITableViewCell in storyboard? To be specific, I want to allow users to add custom photos to the app and that photo will be displayed in the cell as a background. But there will be some labels above the image. So I want to add a gradient to the bottom of the cell to make labels always visible (regardless of background photo).\n\nI know that this is possible programmatically, for example I may use CAGradientLayer like in this tutorial:\nhttp://www.cocoawithlove.com/2009/08/adding-shadow-effects-to-uitableview.html\n or this:\nhttp://www.raywenderlich.com/32283/core-graphics-tutorial-lines-rectangles-and-gradients\n\nBut I am wondering if there is any way to do that just in storyboard.\n\nThanks."
] | [
"ios",
"gradient",
"xcode-storyboard"
] |
[
"Robolectric \"Failed to create a android.widget.Button\" error",
"When I try to run my robolectric tests I receive exception:\njava.lang.RuntimeException: Failed to create a android.widget.Button\nHowever if activity doesn't contains any buttons everything runs ok, but I need buttons :)\nI use robolectric 2.0-alpha-3-SNAPSHOT, what is more few days ago all tests was run successfully. \nAny ideas what can be wrong?"
] | [
"android",
"robolectric",
"android-testing"
] |
[
"Keycloak Docker-compose doesn't uses postgres image",
"I'm working with Windows 10 system. I run docker-compose up -d to start postgresql and keycloak images. I use docker volume to save database data. My docker-compose file content:\nversion: '2.2'\n\nvolumes:\n files_volume:\n driver: local\n \nservices:\n postgres:\n image: postgres:12\n container_name: test_postgres\n volumes:\n - files_volume:/var/lib/postgresql/data\n expose:\n - 5432\n ports:\n - "15432:5432"\n environment:\n - "POSTGRES_DB=test"\n - "POSTGRES_USER=super-admin"\n - "POSTGRES_PASSWORD=super-password"\n mem_limit: 256m\n restart: unless-stopped\n \n keycloak:\n image: jboss/keycloak:10.0.2\n hostname: keycloak\n container_name: keycloak\n volumes:\n - files_volume:/opt/jboss/keycloak/standalone/log\n environment:\n DB_VENDOR: POSTGRES\n DB_ADDR: 'postgres'\n DB_DATABASE: 'test'\n DB_USER: 'super-admin'\n DB_SCHEMA: 'keycloak'\n DB_PASSWORD: 'super-password'\n KEYCLOAK_USER: 'admin'\n KEYCLOAK_PASSWORD: 'admin'\n PROXY_ADDRESS_FORWARDING: 'true'\n JDBC_PARAMS: 'useSSL=false'\n expose:\n - 8080\n ports:\n - "18080:8080"\n mem_limit: 1024m\n restart: unless-stopped\n depends_on:\n postgres:\n condition: service_started\n\nDocker starts normally, but I can't see keycloak schema on this postgres database. When I connect to keycloak and create realm, clients and so on and docker-compose down after restarting I see that there is no data left for keycloak. No realm, no clients, nothing. I believe that keycloak doesn't see postgres and use H2 database.\nI use volume because I can't use direct folder. Maybe I'm doing something wrong with volumes? I am quite new to docker."
] | [
"postgresql",
"docker",
"docker-compose",
"keycloak"
] |
[
"How to add service in a library in android?",
"I have a project with service which scans the Bluetooth devices in the range and when i get the signal it will broadcast the device details.\n\nI want to create a library of that service so anyone can import my library and use it.\n\nHow can i do this ?"
] | [
"android-studio",
"android-service"
] |
[
"How does stdio buffer works in this case?",
"I've been studying how stdio buffering works. I read the links [1] and [2] below but there are two points I still don't understand.\nIn [2], he uses the following bash script to write output intermittently and then he uses the piped commands:\n#generator.bash\nfor i in {1..1000}; do\n echo "this is line $i"\n sleep 1\ndone\n\nbash generator.bash | grep --line-buffered line | cut -c 9-\n\nI understand why he had to use --line-buffered with grep, but why doesn't he have to do something similar about the stdout buffer from "bash generator.bash"? I can only imagine that this stdout buffer is line buffered but I couldn't find anything to confirm this.\nAlso, are the stdin buffers of grep and cut line buffered as well? I couldn't find anything to confirm if this is true or not but if it isn't line buffered then what is the point of making the stdout buffer line buffered if the stdin on the other side is block buffered?\n[1] https://www.pixelbeat.org/programming/stdio_buffering/\n[2] https://blog.jpalardy.com/posts/grep-and-output-buffering/"
] | [
"bash",
"buffer"
] |
[
"Need some help attaching different stylesheets to my homepage?",
"I need a concrete if statement that will work in an .aspx file (default.aspx) that I am building, the file itself serves as my homepage. I have not moved onto further pages. I currently catering for IE8 + 7, FireFox and Chrome.\n\nI seem to be noticing issues in layouts even though in my markup I have this:\n\n<!-- <link rel=\"stylesheet\" type=\"text/css\" href=\"css/homepageStyes.css\" /> -->\n\n<!--[if gt IE 6]>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"css/ie.css\" />\n<![endif]-->\n\n\nWhenever I comment out either line of code, my layout problems go away but at the moment I reckon the mark up posted above is not concrete enough in telling a browser which style sheet it is to attach?\n\nI need something along the lines of but in XHTML mark up ofc:\n\nif (browser == \"ie\" || browser != \"ie6\") // not supporting ie6\n{\n // attach this style sheet:\n // <link rel=\"stylesheet\" type=\"text/css\" href=\"css/ie.css\" /> \n}\nelse\n{\n // attach this style sheet:\n // <link rel=\"stylesheet\" type=\"text/css\" href=\"css/homepageStyes.css\" />\n}\n\n\nI'm a C# developer so this is my first time building a website from scratch. So the C# if statement above was a good way of explaining what I need."
] | [
"html",
"css"
] |
[
"Toggle button doesn't work at the first time on Android",
"I wrote an Android app with toggle button but toggle button does not work well at the first time. But after unchecking, if you try again, it is working properly after that.\n\nI listed below my codes.\n\nWhich codes I have to add to activate it for the first time?\n\npublic class MainActivity extends Activity{\n\nprivate ToggleButton togg;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n togg = (ToggleButton) findViewById(R.id.toggleButton1);\n }\npublic void nameOfMethod(View v){\n\n togg.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n if (togg.isChecked()) {\n //Toast.makeText(MainActivity.this, \"Servise bağlanılıyor...\", Toast.LENGTH_SHORT).show();\n new Thread(new ClientThread()).start();\n } else {\n Toast.makeText(MainActivity.this, \"Bağlantı sonlandırılıyor...\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n}\n\n\nin .xml file:\n\n<ToggleButton\n android:id=\"@+id/toggleButton1\"\n android:layout_width=\"120dp\"\n android:layout_height=\"60dp\"\n android:layout_below=\"@+id/textView1\"\n android:layout_centerHorizontal=\"true\"\n android:layout_marginTop=\"20dp\"\n android:onClick=\"nameOfMethod\"\n android:textOn=\"Bağlantıyı bitir\"\n android:textOff=\"Bağlantıyı başlat\" />\n\n\nEDIT: It works just fine like that:\n\npublic class MainActivity extends Activity{\n\nprivate ToggleButton togg;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n togg = (ToggleButton) findViewById(R.id.toggleButton1);\n\n togg.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n if (togg.isChecked()) {\n //Toast.makeText(MainActivity.this, \"Servise bağlanılıyor...\", Toast.LENGTH_SHORT).show();\n new Thread(new ClientThread()).start();\n } else {\n Toast.makeText(MainActivity.this, \"Bağlantı sonlandırılıyor...\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n}\n\n\nwith moving setOnClickListener method to onCreate(Bundle savedInstanceState) and deleting android:OnClick method in .xml file..."
] | [
"javascript",
"android",
"toggle"
] |
[
"UWP - Cards - Network game over local Wifi / Bluetooh, which Api use?",
"I have developped a Windows 10 cards game (UWP application) and I want to add some features like that two people can play one against the other over Wifi or Bluetooth and I don't know what API to use to get a Socket or WCF Service and to discover other peer(s) which have the same application over the network ?\n\nWhat is the best way to do that ?"
] | [
"c#",
"xaml",
"windows-runtime",
"windows-10",
"uwp"
] |
[
"Silverlight: MouseLeftButtonDown timer to repeatedly fire an event",
"I am trying to create a custom scrollbar and am using images as button.\n\nFor now a simple \n\nI can handle the MouseLeftButtonDown and Up event just fine but what I'd like to do is while its held down, every so many millisecond trigger an event is fired.\n\nI tried something like this but it isn't quite working. Suggestions?\n\npublic delegate void Changed(RangeScrollButtonControl sender, int value);\npublic event Changed OnChanged;\nprivate System.Threading.Timer Timer;\n\nprivate void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)\n{\n this.Timer = new System.Threading.Timer(Timer_Callback, null, 0, 100);\n}\n\nprivate void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)\n{\n this.Timer = null;\n}\n\nprivate void Timer_Callback(object sender)\n{\n if (this.OnChanged != null) \n {\n this.OnChanged(this, 1);\n }\n}"
] | [
"silverlight",
"events",
"silverlight-3.0",
"user-controls",
"scrollbar"
] |
[
"PHP GET question - calling from a POST call",
"I have a quick question i hope you guys can answer, i've got a search system that uses POST to do searches, now i want to track queries using Google Analytics but it requires using GET url parameters to pull parameters out the URL, what i don't want to do is rewrite the entire search system to use GET instead of POST. Is there any way around this? I was thinking maybe i can make a GET call to a new page from the page that recieves the search POSTs, but i don't want it to redirect, i merely want it to \"hit\" the url without actually redirecting?\n\nIs this possible?\n\nAny other solutions would also be appreciated.\n\nThanks for the help"
] | [
"php",
"search",
"post",
"get",
"google-analytics"
] |
[
"How can I move files with random names from one folder to another in Python?",
"I have a large number of .txt files named in the combination of \"cb\" + number (like cb10, cb13), and I need to filter them out from a source folder that contains all the files named in \"cb + number\", including the target files.\n\nThe numbers in the target file names are all random, so I have to list all the file names. \n\nimport fnmatch\nimport os\nimport shutil\nos.chdir('/Users/college_board_selection')\nos.getcwd()\nsource = '/Users/college_board_selection'\ndest = '/Users/seperated_files'\nfiles = os.listdir(source)\n\nfor f in os.listdir('.'):\n names = ['cb10.txt','cb11.txt']\n if names in f:\n shutil.move(f,dest)"
] | [
"python",
"shutil"
] |
[
"Is it possible to autocomplete column names in a SSMS query?",
"I'm new to SQL Server and today I began writing an SQL query. While writing SQL queries in SSMS (SQL Server Management Studio) for insert statements, I noticed that only table names were getting auto completed, but there is no option to auto complete the column name. Is there any way to autocomplete column names in a query?\n\nINSERT INTO table_name (column1,column2,column3,...)\n/* Here table name is auto completed. When i type a,a related tables were generated, but for columns there is no autocomplete. */\nVALUES (value1,value2,value3,...);"
] | [
"sql-server",
"sql-server-2012",
"ssms",
"ssms-2012"
] |
[
"Unable to get UPI response on web",
"I am trying to integrate UPI payments in an app and website. Everything works fine when I form the url (an example below) and launch an Intent on Android.\nupi://pay?pa=abc@xyz&pn=ABC\nI get the response in the calling Android app using onActivityResult but I am not sure how do we get the response if we launch the PSP app (Google Pay or BHIM) from a website on the phone.\nneither am i able to open the upi app from phone on browser not am i able to get the result.\ni am new to this, so i have no idea how to do it. please guide with a proper example of either html or php."
] | [
"javascript",
"html",
"web",
"payment",
"upi"
] |
[
"Google Analytics events not showing any reports",
"I have added the google analytics tracking code, it looks like this:\n\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-XXXXXXXX-X', 'auto');\n ga('send', 'pageview');\n\n</script>\n\n\nNow, I want to implement some events GA. I got this code, found on google:\n\nga('send', 'event', 'User Manual Download', 'PDF Download', 'Name');\n\n\nand I have added it to the function that invokes on button click (button for downloading)\n\nthis is the function:\n\nfunction download()\n {\n ga('send', 'event', 'User Manual Download', 'PDF Download', 'Name');\n\n document.getElementById(\"download-manual\").style.boxShadow = \" 0px 0px 30px #FFFFFF\";\n setTimeout(function()\n {\n document.getElementById(\"download-manual\").style.boxShadow = \" 0px 0px 0px #FFFFFF\";\n }\n , 200);\n }\n\n\nThe function is called everytime, there is no bugs, but event is not loaded to google analytics. In reports, I don't see any type of events at all. I have been waiting for about 12 hours for them to show up, but they don't show, and also in real time report, they don't appear. I am sure that download() function starts, bacause the button \"flashes\" (because of the box shadow). Where did I go wrong?"
] | [
"javascript",
"google-analytics"
] |
[
"Unable to launch DAML studio",
"On MacOs, when I try to launch daml studio from command line, I receive several errors and it doesn't launch.\n\nI have gone through all the installation requirements for DAML including installing Visual Studio Code which runs successfully on my Mac as well as the latest Java SDK. I went through the quickstart and DAML successfully works on my system using the IOU on http://localhost:4000. I updated %PATH correctly and have gone through the instructions twice to make sure I'm not missing anything.\n\nHere is what I launch and the results that it is providing...\n\nMacBook-Pro-2:quickstart aron.elston$ daml studio\n/bin/sh: code: command not found\n\nFailed to install DAML Studio extension from marketplace.\nInstalling bundled DAML Studio extension instead.\n/bin/sh: code: command not found\n\nFailed to install DAML Studio extension from SDK bundle.\nPlease open an issue on GitHub with the above message.\nhttps://github.com/digital-asset/daml/issues/new?template=bug_report.md\n/bin/sh: code: command not found\n\nFailed to launch DAML studio. Make sure Visual Studio Code is installed.\nSee https://code.visualstudio.com/Download for installation instructions.\n\nMacBook-Pro-2:quickstart aron.elston$ echo $PATH\n/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/aron.elston/.daml/bin\nMacBook-Pro-2:quickstart aron.elston$ pwd\n/Users/aron.elston/.daml/bin/quickstart\nMacBook-Pro-2:quickstart aron.elston$ \n\n\nI would expect it to open the project in Visual Studio Code but instead I get errors as shown above."
] | [
"macos",
"visual-studio-code",
"daml"
] |
[
"Is it posible to connect wildfly with RabbitMQ (amqp)?",
"I'm working in a proof of concept and I'm not able to listen messages from wildfly. Does anyone knows is this is possible? I have been trying for a lot of days :C"
] | [
"rabbitmq",
"wildfly"
] |
[
"Convert copied node to string in XSLT 1.0",
"Using an XSLT file in XSLT 1.0 (and purely 1.0), I am working with XML files, and have used the following code so far to copy a given node from a xml file:\n<?xml version="1.0"?>\n<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n version="1.0">\n <xsl:output indent="yes" />\n <xsl:template match="/">\n <xsl:copy-of select="/Heading/subsection/information"/>\n </xsl:template>\n</xsl:stylesheet>\n\nNow I want to convert this copied node/everything within the node to a string and return it within a parameter, but for the string conversion itself I am unsure of how to proceed with it and present it as I need all the information within the node as a string as opposed to a single line\nThe end result would be going from the original node of\n<information>\n <stuff>this is a message</stuff>\n <stuff2>another message</stuff2>\n</information>\n\nto the string(s):\ninformation\nstuff this is a message\nstuff2 another message"
] | [
"xml",
"string",
"xslt"
] |
[
"Walmart post API with variation",
"I have a product with different color variation and size variation. I need to push this as a single product with variation. Is any same xml is available for this? \n\nI got the current XSDs from https://developer.walmart.com/xsd/V3-Spec-Item-3.1-XSD.zip\n\nCan anyone help me?"
] | [
"java",
"xml",
"walmart-api"
] |
[
"Return HTML from ASP.NET Web API ASP.NET Core 2 and get http status 406",
"This is a follow-up on Return HTML from ASP.NET Web API.\nI followed the instructions but I get Error 406 in the browser.\nMy code:\n [Produces("text/html")]\n [Route("api/[controller]")]\n public class AboutController : Controller\n {\n [HttpGet]\n public string Get()\n {\n return "<html><body>Welcome</body></html>"; \n }\n...\n\nand, simply:\npublic void ConfigureServices(IServiceCollection services)\n{\n services.AddMvc();\n}\n\nWhen I remove the Produces line I get the plain text <html><body>Welcome</body></html> in the browser (no error).\nWhat am I missing? Thanks."
] | [
"c#",
"asp.net-core"
] |
[
"Amount of time elapsed during time period",
"I have the table:\n\n+--------+------+------------+\n| id | type | timestamp |\n+--------+------+------------+\n| 927061 | 573 | 1520284933 |\n| 927062 | 573 | 1520284933 |\n| 927063 | 573 | 1520284933 |\n| 927064 | 573 | 1520284933 |\n| 927347 | 573 | 1520285483 |\n| 928796 | 573 | 1520287665 |\n| 928799 | 573 | 1520287672 |\n| 928801 | 573 | 1520287676 |\n| 928802 | 573 | 1520287680 |\n| 928806 | 573 | 1520287684 |\n| 928821 | 573 | 1520287735 |\n| 928822 | 573 | 1520287735 |\n| 928823 | 573 | 1520287735 |\n| 928824 | 573 | 1520287735 |\n| 928825 | 573 | 1520287735 |\n| 928826 | 573 | 1520287735 |\n| 928827 | 573 | 1520287736 |\n| 928828 | 573 | 1520287736 |\n| 928829 | 573 | 1520287736 |\n| 928830 | 573 | 1520287736 |\n+--------+------+------------+\n\n\nThe table has now 4,134,798 rows and counting... and the records have 318 types and counting.\nI'd like to create a report of the elapsed time for each type according to the timestamps. Every records means an activity of some type.\n\nA report similar to:\n\ntype - elapsed time\n573 - 3 days 4 hours 3 minutes\n103 - 1 days 1 hours 1 minutes\n\n\nI must walk through all the records adding the elapsed time between events of some type, store the total elapsed time for some type of event and show the elapsed time by type.\n\nIs someone willing to give me some insight?\n\nThis is my query:\n\nSET @total = 0;\nSET @curr_timestamp = 0;\nSET @curr_id = 0;\nSET @lineitem = 0;\nSELECT CONCAT(FLOOR(HOUR(SEC_TO_TIME(Dedication)) / 24), ' días', ' ',TIME_FORMAT(SEC_TO_TIME(Dedication % (24 * 60 * 60)), '%H'), ' horas',' ',TIME_FORMAT(SEC_TO_TIME(Dedication % (24 * 60 * 60)), '%i'), ' minutos') As Dedicacion FROM\n(\n SELECT type,\n (@lineitem:=@lineitem+1) line,\n (@prev_id:=@curr_id),\n (@curr_id:=id),\n (@prev_timestamp:=@curr_timestamp),\n (@curr_timestamp:=timestamp),\n (@newvalue:=IF(@prev_id>@curr_id,@prev_timestamp+@curr_timestamp,ABS(@prev_timestamp-@curr_timestamp))) newval,\n (@total:=@total+@newvalue) Dedication\n FROM mdl_logstore_standard_log WHERE (DATEDIFF(NOW(),FROM_UNIXTIME(timestamp) ) < 7) AND type=573\n) A WHERE line = @lineitem;\n\n\nThe query is based on this:\n\nhttps://dba.stackexchange.com/questions/87159/how-to-calculate-a-total-by-comparing-current-and-next-row\n\nThanks,\nJorge Dávila."
] | [
"sql"
] |
[
"Checking if CSS properties are supported",
"I'm trying to avoid Modernizr because it's huge, and I've seen that most people use code like this: \n\nvar div = document.createElement('div');\nif(div.style['transform'])...\n\n\nBut is it really necessary to create a new element on which to test the properties on, or can I just use the \"document.documentElement.style\" object?\n\nvar s = document.documentElement.style;\nif('transform' in s)...\n\n\nit's shorter when I have to test for multiple properties. But I don't know if it will work on browsers that I cannot test it on."
] | [
"javascript",
"css",
"feature-detection"
] |
[
"Why downcasting is allowed in java?",
"class Animal{\n public void findAnimal(){\n System.out.println(\"Animal class\");\n }\n public void sayBye(){\n System.out.println(\"Good bye\");\n }\n}\n\nclass Dog extends Animal{\n public void findAnimal(){\n System.out.println(\"Dog class\");\n }\n}\n\n\nGiven the inheritance above ,it is understood that a reference of Animal can refer to an object of Dog \n\nAnimal animal=new Dog();\n\n\nAs a Dog object can perform everything an Animal can do like in above case a Dog also have sayBye and findAnimal methods.\n\nBut why it is allowed to downcast an Animal object to a Dog object which serves no purpose and fails at runtime.\n\nDog dog=(Dog)new Animal(); // fails at runtime but complies.\n\nDog dog=(Dog)animal;\n\n\nThe above statement look logical as the animal reference is pointing to a Dog object."
] | [
"java",
"inheritance"
] |
[
"Maintaining request scope in Express/Node.js",
"I am using Express to expose a REST API in my Node.js application. When a REST request comes in, I extract the user information from the HTTP headers. I would like this information to be available throughout the life of this request, no matter what function I am in. An obvious but kludgy way is to pass around the user information as parameters to all function calls. Is there a better way? So far I have found the following solutions, but I am not sure if they are ready for prime time:\n\n\nStrongLoop Zone Library: Docs say \"The zone library and documentation are still under development: there are bugs, missing features, and limited documentation.\"\nContinuation-Local Storage: Not sure if this is slated to be part of Node.js. This issue at the end recommends looking at StrongLoop zone.\nNode.js Domains: Does not look like this actually took off."
] | [
"node.js",
"express",
"zone"
] |
[
"How to fix the scroll issue in Bootstrap 4 when one modal is closed and another open immediately after?",
"I have code in my application that requires closing existing modal and immediately opening another modal. The code works fine, but there is a scrolling issue (vertical/horizontal) with the second modal. If I resize my screen and try to scroll vertically only background content is scrolling. I was digging to find the issue and here is what I found. I think there is a time race condition problem. If I put setTime {...some code...,400} that will fix the problem. I still believe there is a cleaner solution for this. Also, if some can explain why this is happening that would be great. Here is code example:\n\n\r\n\r\nvar COMMON_FUNC = {};\r\nCOMMON_FUNC.dialogBox = function(title, message, size) {\r\n title = title || 'HCS System';\r\n message = message || 'HCS Dialog Box';\r\n size = size || 'lg';\r\n\r\n var dialog = bootbox.dialog({\r\n onEscape: true,\r\n backdrop: true,\r\n size: size,\r\n title: '<strong>' + title + '</strong>',\r\n message: message\r\n });\r\n dialog.prop(\"id\", \"dialog-box\");\r\n};\r\n\r\n$(\"#open-modal-one\").on(\"click\", function() {\r\n var div = '<div><button type=\"button\" class=\"btn btn-sm btn-secondary edit-record\">Edit</button></div>'\r\n COMMON_FUNC.dialogBox(\"Modal One\", div, \"xl\");\r\n});\r\n\r\n$(document).on(\"click\", \".edit-record\", function() {\r\n $(\"#dialog-box\").modal(\"hide\");\r\n //setTimeout(function(){$(\"#second_modal\").modal(\"show\");},400);\r\n $(\"#second_modal\").modal(\"show\");\r\n});\r\n<link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\" integrity=\"sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T\" crossorigin=\"anonymous\">\r\n<script src=\"https://code.jquery.com/jquery-3.2.1.slim.min.js\" integrity=\"sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN\" crossorigin=\"anonymous\"></script>\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js\" integrity=\"sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q\" crossorigin=\"anonymous\"></script>\r\n<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\"></script>\r\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.4.0/bootbox.min.js\"></script>\r\n\r\n<h1>This is a test!</h1>\r\n<button type=\"button\" class=\"btn btn-sm btn-secondary\" id=\"open-modal-one\">Open Modal One</button>\r\n<div class=\"modal fade\" id=\"second_modal\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">\r\n <div class=\"modal-dialog modal-lg\" role=\"document\">\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <h5 class=\"modal-title\">Second Modal</h5>\r\n <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\r\n </div>\r\n <div class=\"modal-body\">\r\n This is second modal. If I try to scroll vertically only background will scroll.\r\n </div>\r\n <div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn btn-secondary\">Apply</button>\r\n <button type=\"button\" class=\"btn btn-secondary\" data-dismiss=\"modal\">Cancel</button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>"
] | [
"jquery",
"css",
"bootstrap-4",
"bootstrap-modal"
] |
[
"MySQL FIND_IN_SET not working",
"I have these tables\n\nIrasai table\n\ninvoice_nr | pard_suma | pard_vad | pirk_vad\n1122 200 2,4,6 2,1,3\n1111 502,22 3 4\n1112 5545 3 4,1\n54151 1000 2 1\n74411 1345,78 6 18\n\n\nApmokejimai table:\n\nid | invoice_nr | suma | tipas\n1 1122 100 2\n2 1112 5545 1\n3 1122 100 2\n4 1111 310 2\n5 54151 200 2\n\n\nThis query:\n\nselect t1.invoice_nr, max(t1.pard_suma) as pardtotal, sum(t2.suma) as sumatotal \nfrom irasai t1 \nleft join apmokejimai t2 on t1.invoice_nr = t2.invoice_nr \nWHERE t2.tipas != '1' \n OR t2.tipas IS NULL \n AND FIND_IN_SET(1, t1.pirk_vad) \n OR FIND_IN_SET(1, t1.pard_vad) \ngroup by invoice_nr \nhaving pardtotal <> sumatotal or sumatotal is null\n\n\nResult is this:\n\ninvoice_nr | pard_total | sumtotal\n1111 502.22 310\n54151 1000 200\n\n\nShould be like this\n\ninvoice_nr | pard_total | sumtotal\n54151 1000 200\n\n\nI need to get this because it belongs to user which id is 1"
] | [
"mysql",
"find-in-set"
] |
[
"How to properly customize UITabBar and UITabBarItem on iOS 7 and iOS 8?",
"I am googling around so much, but nowhere I find a straight and consolidated answer.\n\nI want to customize myUITabBarController such that:\n\n\nthe UITabBar itself is completely black\nthe text color of the item titles is white in non-highlighted state\nthe text color of the item titles is red in highlighted state\nUse multicolored icons in the tab bar\n\n\n1. Turn UITabBar black\n\nI am guessing I need to use the UIAppearance API for this, and actually I was able to turn the UITbarBar black using: [[UITabBar appearance] setBarTintColor:[UIColor blackColor]];.\n\n2. and 3. Modify color of item titles\n\nHowever, the color of the text items doesn't seem to do what I want, after googling around, the following solutions made sense to me, but it only changes the non-highlighted state to white, highlighted stays white as well...\n\nNSDictionary *titleAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};\n[[UITabBarItem appearance] setTitleTextAttributes:titleAttributes forState:UIControlStateNormal];\n\nUIColor *titleHighlightedColor = [UIColor redColor]; \nNSDictionary *highlightedTitleAttributes = @{NSForegroundColorAttributeName : titleHighlightedColor};\n[[UITabBarItem appearance] setTitleTextAttributes:highlightedTitleAttributes forState:UIControlStateHighlighted];\n\n\n4. Multicolored items\n\nAbout the multicolored icons, so far by approach was to simply set the icons in Storyboards like this:\n\n\n\nBut this doesn't do what I want, it only shows the whole icon in grey when the item is not selected. When the item is selected, the icon completely disappears.\n\nThis is the original icon:\n\n\n\nThis is how it looks when the item is not selected:\n\n\n\nAnd here it is in the selected stated, as mentioned the icon completely disappears:\n\n\n\nSo, my question is how precisely I can achieve the above mentioned requirements. What am I currently missing? Am I better off doing everything in code than in Storyboards?\n\nNote: I am targeting iOS versions greater than 7.0, so please include any version specific information if the behaviour differs between iOS 7 and iOS 8."
] | [
"ios",
"objective-c",
"uitabbarcontroller",
"uitabbar",
"uitabbaritem"
] |
[
"What's the difference between Cargo's build and rustc commands?",
"I'm new to Rust and I just created a new project via cargo new my_project. I noticed that cargo offers these two command-line options:\n\n\nbuild: Compile a local package and all of its dependencies\nrustc: Compile a package and all of its dependencies\n\n\nI gather that the latter can be used to compile any project on my machine, while the former can only be used within the current working directory. Is that correct? Are there any other differences? Running both commands with no additional arguments gives me the exact same output."
] | [
"rust",
"rust-cargo"
] |
[
"Counting number of rows by class starting with an upper case word",
"I would need to count the rows which starts with an upper case word (e.g. STACKOVERFLOW) by class.\nTo find an upper case word I am using the following line of code:\ndf['UP'] = df['TEST'].str.findall(r'\\b([A-Z]{2,})')\n\nI think I should consider something like this [1] (first word).\nMy dataset looks like:\nTEST Class\nHELLOOOOO!!! 1 \nWhat are you doing? 0 # since this is only a capital letter, this should not be counted\nSay nothing! 1 # since this is only a capital letter, this should not be counted\nHow are you? 0 # since this is only a capital letter, this should not be counted\nHI man 1"
] | [
"python",
"pandas"
] |
[
"HAProxy example for sending h2c traffic to backend with SSL termination",
"I would appreciate some help getting my HA-Proxy instance set up to accept h2 or http/1.1 traffic and perform SSL termination using the http mode. I have tried the following setup:\n\nfrontend local_fe\n mode http\n option http-use-htx\n bind *:8080 proto h2\n default_backend local_be\n\nbackend local_be\n mode http\n option http-use-htx\n server localhost localhost:9090 proto h2\n\n\nHowever, using proto h2 still sends over the packets using https (as reported by my backend). Any suggestions to what I should change in my config?"
] | [
"reverse-proxy",
"haproxy",
"http2"
] |
[
"Combine multiple lines in a RDD to a single line",
"I have the following scenario:\nval rdd = sc.textFile(\"textfile\");\n\n\"textfile\" is a multi line file. All I need is to concatenate multiple lines into a single line before saving it back again in a file format.\n\nI researched a lot around this. However, couldnt find a solution to the problem.\n\nThanks a lot for all your help\n\nThanks,\nGanesh"
] | [
"scala",
"apache-spark",
"text-files",
"rdd"
] |
[
"How to secure database username and password with R DBI?",
"When connecting to a database using the dbConnect function in the DBI package, what are the best practices for securing logon information such as database name, username and password?\n\nEntering logon information as a character text such as\n\nlibrary(RPostgreSQL)\ndrv = dbDriver(\"PostgreSQL\")\ncon = dbConnect(drv, dbname = \"<DBNAME>\", host = \"<HOST>\",\n port = 5432, user = \"<USER>\", password = \"<PASSWORD>\")\n\n\nleaves the credentials open and in plain text. How can the logon information be protected when using it in an R script?"
] | [
"r",
"security",
"r-dbi",
"rpostgresql"
] |
[
"Android: Button change posistion when i view the app on different mobiles",
"I have an activity with four buttons, when i play it on the emulator everything is OK, but when i test it on my mobile the buttons grow bigger or actually the background or the screen gets smaller but the buttons stay the same, so it looks bigger.\n\nCan i make the buttons adapt with the screen the same way the background of the activist do?\n\nHere is my xml file\n\n <?xml version=\"1.0\" encoding=\"utf-8\"?>\n <RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"match_parent\"\nandroid:layout_height=\"match_parent\"\nandroid:background=\"@drawable/mainn\"\nandroid:gravity=\"top\" >\n\n<Button\n android:id=\"@+id/b_labor\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentBottom=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:layout_marginBottom=\"114dp\"\n android:background=\"@drawable/labb\" />\n\n<Button\n android:id=\"@+id/b_mosul\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/b_labor\"\n android:layout_alignLeft=\"@+id/b_labor\"\n android:layout_marginBottom=\"32dp\"\n android:background=\"@drawable/ninaa\" />\n\n\n\n\n<Button\n android:id=\"@+id/b_trafic\"\n style=\"@style/Theme.Transparent\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/b_mosul\"\n android:layout_alignLeft=\"@+id/b_mosul\"\n android:layout_marginBottom=\"28dp\"\n android:background=\"@drawable/traficc\" />\n\n\n<Button\n android:id=\"@+id/b_nati\"\n android:layout_width=\"250dp\"\n android:layout_height=\"wrap_content\"\n android:layout_above=\"@+id/b_trafic\"\n android:layout_alignLeft=\"@+id/b_trafic\"\n android:layout_marginBottom=\"34dp\"\n android:background=\"@drawable/natiii\"\n\n />"
] | [
"android",
"button",
"layout"
] |
[
"Difference between %QUOTE and %BQUOTE",
"In several occasions I wonder what is the clear difference between QUOTE and BQUOTE and therefore NRQUOTE and NRBQUOTE.\n\nAnd How SUPERQ is different from them?"
] | [
"sas"
] |
[
"How can I enable \"copy\" in cells under noneditablecolumns on tabulator",
"I am trying to select a specific cell on a noneditablecoulumn and I would like to copy the values in it.\nSince the column is under non editable then I cannot even highlight the cell value.\n\nIs there any customization needed?\n\nthanks!"
] | [
"tabulator"
] |
[
"Group two functions that differ in only 1 line of code",
"I have two performance-critical functions like this:\n\ninsertExpensive(Holder* holder, Element* element, int index){\n //............ do some complex thing 1 \n holder->ensureRange(index);//a little expensive\n //............ do some complex thing 2\n}\ninsertCheap(Holder* holder, Element* element, int index){\n //............ do some complex thing 1\n //............ do some complex thing 2\n}\n\n\nHow to group 2 functions together to increase maintainability?\n\nMy poor solutions:\n\nSolution 1. \n\ninsertExpensive(Holder* holder, Element* element, int index){\n do1();\n holder->ensureRange(index);//a little expensive\n do2();\n}\ninsertCheap(Holder* holder, Element* element, int index){\n do1();\n do2();\n}\n\n\nIt would be ugly.\nIt also impractical if do2 want some local variables from do1.\n\nSolution 2. \n\ninsert(Holder* holder, Element* element, int index, bool check){\n //............ do some complex thing 1 \n if(check)holder->ensureRange(index);//a little expensive\n //............ do some complex thing 2\n}\n\n\nIt costs a conditional checking for every call.\n\nSolution 3. (draft)\n\ntemplate<bool check> insert(Holder* holder, Element* element, int index){\n //............ do some complex thing 1 (Edit2 from do1());\n bar<check>();\n //............ do some complex thing 2 (Edit2 from do2());\n}\ntemplate <>\ninline void base_template<true>::bar() { holder->ensureRange(index); }\ntemplate <>\ninline void base_template<false>::bar() { }\n\n\nOverkill and unnecessary complexity?\n\nEdit 1:\nThe priority of criteria for how good an approach is, are sorted as followed:-\n1. Best performance\n2. Less duplicate of code\n3. Less total line of code\n4. Easier to read for expert & beginner \n\nEdit 2: edit the 3rd solution. Thank mvidelgauz and Wolf."
] | [
"c++",
"performance",
"function",
"code-duplication",
"maintainability"
] |
[
"How can we pull images from a website and display in our app using iphone sdk?",
"How can we pull images from a website and display in our app using iphone sdk?\n\nAlso, how can we embed audio in our iPhone App using iPhone SDK?\n\nCan you please refer to any tutorial / videos related to this?"
] | [
"iphone",
"objective-c",
"cocoa-touch",
"iphone-sdk-3.0"
] |
[
"Parsing double quotes from xml",
"I have xml file in server. I am parsing this xml using DOM(xml is not big). In one node there is string with double quotes.\n\n<NODE1>hello \"world\"</NODE1>\n\n\nWhen i see this xml url in browser and check its source it looks like this:\n\n<NODE1>hello &quot;world&quot;</NODE1>\n\n\nSo when i parse this value i get string till double quotes. It seems after double quotes parser doesn't go forward. Any help ? I want to use DOM only in my current situation. This xml is used by other platform also apart from android. Like in iPhone its working perfectly. What should I do to read all value in android using DOM.\n\nThanks."
] | [
"android"
] |
[
"How to Compile Sample Code",
"I'm breaking into GUI programming with android, trying to compile and analyze Lunar Lander sample program. The instructions for using Eclipse say to select \"Create project from existing source\" but that option doesn't exist. If I select File->New->Project I can select \"Java project from Existing Ant Buildfile\". Using that I've tried selecting various xml files as \"Ant Buildfile\" but all give me the \"The file selected is not a valid Ant buildfile\" error.\n\nI just want to run GUI sample projects, preferably with Eclipse. Any useful tips will be appreciated."
] | [
"android",
"user-interface",
"sample"
] |
[
"Writing vectors to a file without using Export",
"I am interested in writing multiple vectors to a file such that each vector forms one row in the file, and is written to the file as soon as it is generated. The elements of the vector need to be separated by a single space, and I do not want to include the { } parentheses for the vector. Basically, I want to mimic the fprintf(\"file\", \"%f %f %f\\n\") functionality of C. \n\nHere is what I have. Is there a better way of doing this?\n\nst1 = OpenWrite[\"C:\\\\junk\\\\mu.out\", FormatType -> OutputForm];\n\nvt = Table[\n v = RandomReal[{0, 1}, 5];\n\n For[j = 1, j <= Length[v], j++, \n WriteString[\n st1, \n SequenceForm[NumberForm[v[[j]], ExponentFunction -> (Null &)], \n \" \"]\n ]\n ];\n Write[st1, \"\"];\n v,\n {200}\n ];\n\nIn[3]:= Close[st1]\n\nOut[3]= \"C:\\\\junk\\\\mu.out\"\n\n\nBased on the wonderful Riffle function, courtesy Arnoud and Mr. Wizard, below, I modified it as follows: \n\nWriteVector[stream_, vector_] :=\n Apply[WriteString[stream, ##, \"\\n\"] &, \n Riffle[Map[NumberForm[#, ExponentFunction -> (Null &)] &, vector], \n \" \"]\n ]"
] | [
"wolfram-mathematica"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.