texts
sequence
tags
sequence
[ "Can't show MessageBox while app is running in assigned access mode in windows 10", "I have written a UWP-App and it all works fine (in debug and release mode). I've packaged my app and installed it on a tablet on which windows 10 is installed (I develope on a windows 10 desktop pc), still no issues.\nBut now I want to run my app in assigned access mode (kiosk mode) on this tablet and suddenly out of nowhere my messageboxes doesn't show up anymore and an error appears.\nBecause I'm working with the mvvm pattern I've written a helper class for showing messageboxes so I don't need to use Windows.UI in my ViewModels:\npublic class UserNotificationService : IUserNotificationService\n{\n public async Task ShowMessageDialogAsync(string message, string title = null)\n {\n MessageDialog messageDialog = title == null ? new MessageDialog(message) : new MessageDialog(message, title);\n await ShowAsync(messageDialog);\n }\n\n // This method throws an error\n private async Task ShowAsync(MessageDialog msgDialog)\n {\n // I've to do it like this because otherwise it won't work because I'm working on a different thread while calling this method\n await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.N‌​ormal, async () => {\n await msgDialog.ShowAsync();\n });\n }\n}\n\nError:\n\nA COM call to an ASTA was blocked because the call chain originated in or passed through another ASTA. This call pattern is deadlock-prone and disallowed by apartment call control.\nA COM call (IID: {638BB2DB-451D-4661-B099-414F34FFB9F1}, method index: 6) to an ASTA (thread 6992) was blocked because the call chain originated in or passed through another ASTA (thread 7188). This call pattern is deadlock-prone and disallowed by apartment call control. at: at Windows.ApplicationModel.Core.CoreApplicationView.get_CoreWindow()\n\nI don't understand what is different while working with the assigned access in windows 10. Like mentioned above this error only appears when the app is running in the assigned access. In any other case all works fine (on the desktop pc and on the tablet).\nSo my question is:\nHas anyone experienced a same issue while developing an app to run in the assigned access mode in windows 10?\nOr has anyone an idea of how to solve this issue?" ]
[ "c#", "windows-10", "uwp", "kiosk-mode" ]
[ "Placement coordinates of bitmapData in AS3", "i've programatically created a vector graphic (rect), repositioned the graphic, and set up an MOUSE_MOVE eventListener to trace color information of the graphic using getPixel(). however, the bitmapData is placed at 0,0 of the stage and i don't know how to move it so that it matches the graphic's location.\n\nvar coloredSquare:Sprite = new GradientRect(200, 200, 0xFFFFFF, 0x000000, 0xFF0000, 0xFFFF00);\ncoloredSquare.x = 100;\n\naddChild(coloredSquare);\n\nvar coloredSquareBitmap:BitmapData = new BitmapData(coloredSquare.width, coloredSquare.height, true, 0);\ncoloredSquareBitmap.draw(coloredSquare);\n\ncoloredSquare.addEventListener(MouseEvent.MOUSE_MOVE, readColor);\nfunction readColor(evt:Event):void\n {\n var pixelValue:uint = coloredSquare.getPixel(mouseX, mouseY);\n trace(pixelValue.toString(16));\n }" ]
[ "actionscript-3", "bitmapdata" ]
[ "Swift computed property return value", "I have a computed property that is expected to return an object or nil if it fails.\n\nvar findRequest: Book {\n get {\n var foundRequest: Book!\n API.requestBook(book: bookRequest) { book in\n if book != nil {\n foundRequest = book!\n } else {\n print(\"Could not find book\")\n foundRequest = nil\n }\n }\n return foundRequest\n }\n}\n\n\nWhen I run the code I get an unexpectedly found nil while unwrapping an Optional value error on the return foundRequest line. It looks like the code skips my closure function and goes straight to the return.\n\nThanks" ]
[ "ios", "swift", "variables", "computed-properties" ]
[ "How to copy a whole sheet and transpose paste into another sheet in VBA?", "Working environment:Excel 2013.\n\nTarget: \n\n\ncopy a whole sheet\ncreate another sheet\ntranspose paste the copied sheet into this new sheet.\n\n\nthe code that i am using is as below:\n\nWorksheets(\"Sheet4\").Copy\nWorksheets(\"Master\").PasteSpecial Transpose:=True\n\n\nhowever when i run it, i got an error \n\n\n application defined or object defined error\n\n\nAnyone can help me to figure out why?" ]
[ "vba", "excel" ]
[ "Endless crawling because of different session ids in url", "How to prevent scrapy from crawling a website endless, when only the url particularly the session id or something like that is altered and the content behind the urls is the same.\nIs there a way to detect that?\n\nI've read this Avoid Duplicate URL Crawling, Scrapy - how to identify already scraped urls and that how to filter duplicate requests based on url in scrapy, but for solving my problem this is sadly not enough." ]
[ "python", "scrapy" ]
[ "Sum of two variables from div", "I want to sum the two field automatically using javascript ,\n\nAfter searching more about what I want exactly I found this example on table please how can I change it to work on divs\n\nhttp://jsfiddle.net/gXdwb/3/\n\nThose are my fields\n\n<div> class=\"form-group\">\n <label for=\"nbStudentA\" >Number student A</label>\n <div> \n {{ form_widget(form.nbStudentA, {'attr':{'class': 'form-control'}}) }}\n </div>\n</div>\n\n\n<div class=\"form-group\">\n <label for=\" nbStudentB \" >Number Student B</label>\n <div class=\"col-sm-9\">\n {{ form_widget(form.nbStudentB, {'attr':{'class': 'form-control'}}) }}\n </div>\n</div>\n\n<div class=\"form-group\">\n <label for=\"Sum\" >Sum Students :</label>\n <div>\n <input type=\"text\" class=\"Sum\" name=\"total\" value=\"\"/>\n </div>\n</div>\n\n\nupdate:\n\nwhat I have tried before is to sum the two variables using twig but it's done on the server side and what I want is the effectuate the sum just when the user enter the variables:\n\n<div >\n <label>Sum </label>\n <div >\n {% set foo = form.nbStudentA + form.nbStudentB %}\n {{ foo }}\n </div>\n</div>" ]
[ "javascript", "html", "symfony", "twig" ]
[ "How can i see a dll file functions in ollydbg?", "I have function names and addresses of a dll file. I want to see a function behavior. How can I use this information in ollydbg?" ]
[ "ollydbg" ]
[ "Polymer querySelector working on DartVM but not in Chrome after compile", "Having a weird issue. In my Dart code I have some polymer components on the screen and one of them has a method I call from my main().\n\nI grab a reference to it by doing\n\nPolyComp poly = querySelector(\"#idOfPolymer\");\npoly.flash();\n\n\nThis works perfectly in dart. The page loads up and PolyComp starts to flash. However when I run this in Chrome by running Build Polymer app from the Dart IDE, I get an error that says cannot call flash() on null.\n\nI ended up making it flash by just using an event bus and letting PolyComp listen to my event, but this is overkill.\n\nWhat am I doing wrong? This happens in the latest Chrome, Firefox and Safari.\n\nEdit:\n\nI built the following polymer app to JS also and ran into the same issue.\nhttps://github.com/sethladd/dart-polymer-dart-examples/blob/master/web/todo_element/todo.html\n\nWorks on DartVM, not in Chrome because its calling a method on a null element." ]
[ "dart", "dart-polymer" ]
[ "Javascript/jQuery Plugin to plugin to change the border-color, relative to the background-color of an element", "In my app i want the users to select a base colour for elements to be displayed on a calendar. From the base colour the user has selected, i need to be able to automatically set an appropriate border colour, and an appropriate text colour.\n\nWhen i mean appropriate i mean a darker tint or shade variation for the border \n\nAre there any jquery plugins that do this already, or indeed any other plugins for another javascript library?\n\nIf not can people offer advice about how to go about doing the calculations? I've not got much experience in colour theory.\n\nThank you." ]
[ "javascript", "jquery", "css", "colors" ]
[ "EF 6.2.0 migrate.exe ERROR: Object reference not set to an instance of an object", "I'm setting up migrate.exe to run DB migration during VSTS release:\nmigrate.exe DataAccess.dll /connectionProviderName=\"System.Data.SqlClient\" /connectionString=\"Data Source=SQLXXX\\DEV01;Initial Catalog=XXXXX;Integrated Security=true;\" /verbose\n\nOutput: \n\nVERBOSE: Target database is: 'XXXXX' (DataSource: SQLXXX\\DEV01, Provider: System.Data.SqlClient, Origin: Explicit).\nNo pending explicit migrations.\nRunning Seed method.\nSystem.Data.Entity.Migrations.Design.ToolingException: Object reference not set to an instance of an object.\n at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)\n at System.Data.Entity.Migrations.Console.Program.Run()\n at System.Data.Entity.Migrations.Console.Program.Main(String[] args)\nERROR: Object reference not set to an instance of an object.\n\n\nWe have no code in Seed method. No pending explicit migrations is expected but we need the script to finish without an error for the release process to continue. How to fix this error?\n\nI raised this issue on EF6 GitHub" ]
[ "entity-framework", "entity-framework-migrations" ]
[ "How to see php bytecode file", "I am doing it for learning purpose.\nI have gone through many articles that php first convert its source code to bytecode, but i am not able to find a way to see the bytecode format, that how it looks like? \n\nIn java and C there are many ways to see bytecode file. but unable to find any article in php to see converted bytecode." ]
[ "php", "bytecode" ]
[ "AjaxFileUpload doesn't fire OnUploadComplete Event", "i am trying to get that AjaxFileUpload-Control(used in ContentPage) working. But it does not fire OnUploadComplete Event at server side\n\nI am using version 4.1.60919.0 of the ControlToolkit. I have tried everything i found on the internet. \n\nHere just a few steps:\n\n\nAdded enctype=\"multipart/form-data\" method=\"post\" to the form-element in my MasterPage\nNested the AjaxFileUpload into an UpdatePanel with UpdateMode=Always\nTried events UploadedComplete and OnUploadComplete, but stayed at the second one\nAdded a try-catch-block in the EventHandler to catch unknown exceptions and print the ExceptionMessage to a label on the site --> nothing happened\nTried it with(out) a ThrobberImage...\nMany other tipps that did not work...\n\n\nSo, i hope we will find a solution together in this community. Heres my markup:\n\n<%@ Page Title=\"New Download\" Language=\"C#\" MasterPageFile=\"~/MasterPage.master\" AutoEventWireup=\"true\" CodeFile=\"NewDownload.aspx.cs\" Inherits=\"Internals_NewDownload\" %>\n\n\n\n\n<asp:Content ID=\"Content1\" ContentPlaceHolderID=\"HeadContent\" runat=\"Server\">\n</asp:Content>\n<asp:Content ID=\"Content2\" ContentPlaceHolderID=\"MainContent\" runat=\"Server\">\n\n<ajax:ToolkitScriptManager ID=\"ToolkitscriptManager\" runat=\"server\"> </ajax:ToolkitScriptManager>\n<h1>Create a new Download</h1>\n\n <ajax:AjaxFileUpload ID=\"FileUpload\" runat=\"server\" ThrobberID=\"ThrobberLabel\" OnUploadComplete=\"FileUpload_UploadComplete\" />\n <asp:Label ID=\"ThrobberLabel\" runat=\"server\" Style=\"display: none;\"><img alt=\"UploadingPicture\" title=\"Please wait while uploading...\" src='<%= Constants.DomainString + \"/Data/Images/loading-small.gif\" %>' /></asp:Label>\n <asp:Label ID=\"DownloadLabel\" runat=\"server\"></asp:Label>\n\n</asp:Content>\n\n\nAnd this is my CodeBehind:\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\n\npublic partial class Internals_NewDownload : System.Web.UI.Page\n{\nprivate string m_LanguageCode;\n\nprotected void Page_Load(object sender, EventArgs e)\n{\n if (RouteData.Values.ContainsKey(\"LanguageCode\"))\n m_LanguageCode = RouteData.Values[\"LanguageCode\"].ToString();\n\n //if (IsPostBack)\n // return;\n if (!User.IsInRole(\"Administrator\") && !User.IsInRole(\"Kunde\") && !User.IsInRole(\"Mitarbeiter\"))\n Response.Redirect(Constants.DomainString + \"/PermissionDenied.aspx\");\n Session[Constants.NonGlobalizedString] = true;\n Session[Constants.MenuInfoSession] = new ClsMenuInfo(\"NewDownload\");\n}\n\nprotected void FileUpload_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)\n{\n try\n {\n string filePath = \"~/upload/\" + e.FileName;\n DownloadLabel.Text = filePath;\n }\n catch (Exception ex)\n {\n DownloadLabel.Text = ex.Message;\n }\n}\n}\n\n\nPlease, if you have ANY idea, do not hesitate to let me know it. I am very confused as i think that i just did in that howtos i found on the internet...\n\nThanks in advance!" ]
[ "asp.net", "file-upload", "ajaxcontroltoolkit" ]
[ "Entity Framework Can't Save in Database", "I've got a problem with the entity framework as it's my first time using it along with SQL server. I managed to successfully create an entity data model with an entity called EMP. EMP has ID, Name, and Salary as scalar properties. I then generated the database from the model, copy/pasted the resulting sddl into SQL server and created my database. I went back into VS 2010 express and tried adding some records into the database using the following code:\n\nstring constr = ConfigurationManager.ConnectionStrings[\"dataemp\"].ConnectionString;\ndataemp db = new dataemp(constr);\n\ndb.AddToEmps(Emp.CreateEmp(0, \"john\", \"Informatique\", \"10000000 cfa\"));\ndb.AddToEmps(Emp.CreateEmp(1, \"johny greg\", \"finances\", \"100000000 cfa\"));\n\ndb.SaveChanges();//i get the error here\nConsole.WriteLine(\n \"*********Employee actuellement dans la database*********\\n{0}\",\n query.ToString());\n\n\nAs a result the compiler gives me an exception as if I didn't connect to the database or as if it couldn't access the database but it is displayed in the database explorer. One more point in the database explorer: I can't see the tables(EMPs) whereas in SQL Server I am able to see it as dbo.Emps. Here is the exception the compiler shows me:\n\n\n Unhandled Exception: System.Data.UpdateException: An error occurred\n while updating the entries. See the inner ex ception for details. --->\n System.Data.SqlClient.SqlException: Invalid object name 'dbo.Emps'.\n at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,\n Boolean breakConnection) at\n System.Data.SqlClient.SqlInternalConnection.OnError(SqlException\n exception, Boolean breakConnection) at\n System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at\n System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,\n SqlCommand cmdHandler, SqlDataReader dataStre am,\n BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject\n stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() \n at System.Data.SqlClient.SqlDataReader.get_MetaData() at\n System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,\n RunBehavior runBehavior, String res etOptionsString) at\n System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior\n cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean\n async) at\n System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior\n cmdBehavior, RunBehavior runBehavior, Bo olean returnStream, String\n method, DbAsyncResult result) at\n System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior\n cmdBehavior, RunBehavior runBehavior, Bo olean returnStream, String\n method) at\n System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior\n behavior, String method) at\n System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior\n behavior) at\n System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)\n at\n System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator\n translator, EntityConnec tion connection, Dictionary2\n identifierValues, List1 generatedValues) at\n System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager\n stateManager, IEntityAdapt er adapter) --- End of inner exception\n stack trace --- at\n System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager\n stateManager, IEntityAdapt er adapter) at\n System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager\n entityCache) at\n System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)\n at ConsoleApplication1.Program.Main(String[] args) in D:\\Users\\ITA\n Final\\documents\\visual studio 2010\\Project s\\zut\\zut\\Program.cs:line\n 13\n\n\nI have read many tutorials on entity framework and linq to entities. I can't figure out what I am doing wrong here." ]
[ "c#", "sql-server", "entity-framework" ]
[ "What spring-beans and spring-context are used for?", "I am just curious about what <groupId>org.springframework</groupId <artifactId>spring-beans</artifactId> dependency is used for? The same question is about spring-context.\n\nI don't see explicit dependencies on this module. How are they used by spring? Why aren't they included into spring-core?" ]
[ "spring" ]
[ "Some Mercurial basics", "I'm having a hard time getting into Mercurial, even looking at several guides/tutorials. (It doesn't help that I panic as soon as I see command line arguments). I would really appreciate it if someone could help me with these pretty basic questions :/\n\nWhat I would like to do: \n- Obtain a copy of an existing project. (I will now refer to this copy as 'my' project and the existing project as the 'main' project).\n- Then, make changes to what now is my project. I will not be uploading to the main project, however, if the main project has changes, I would like to get those integrated into my project. \n- I would like to be able to work on my project from several computers, so it can't just be local.\n- I guess it's this picture: I want to do all sorts of shit on different computers with 'my'code (the green versions) while still having access to the red versions. Preferably where no one else can access my green versions.\n\n\n\nWhat I THINK I should do:\n- Clone from the existing project. I should be able to integrate later updates into my branch, right?\n- Somehow save that clone somewhere in a way that it still knows it's related to the main project... \n\nTL;DR: I guess my question is: How do I make an online branch that can still receive updates?" ]
[ "mercurial", "branch" ]
[ "Why does !1 give me nothing in Perl?", "This is strange.\nThe following:\n\n$sum = !0;\nprint $sum;\n\n\nprints out 1 as you would expect. But this\n\n$sum = !1;\nprint $sum;\n\n\nprints out nothing. Why?" ]
[ "perl", "boolean" ]
[ "Permission not working in yii2 admin", "I have installed yii2-user, yii2-admin extensions and given permission to user 'harlan' to /country/* \ni.e do anything in country controller.\n\nWhen I find the value of\n\nYii::$app->user->can('/country/index')\n\n\nin my code, it shows \"1\" which means I have set the permission correctly. \n\nFor some reason the permission is not working. It gives me the error when I try to go to web/country/index\n\nForbidden (#403)\nYou are not allowed to perform this action. \n\n\nCan someone tell me what I am missing?" ]
[ "php", "yii2", "yii2-user" ]
[ "The best way to load pictures for photo gallery", "I want to make some kind of a book(or some kind of a photo gallery) using jpg files of a scanned book.\nthe user gives the number of the page that he wants to go to , and clicks on the button to \nsee the page .\nI need to know what is the best way to load the pictures.\ni'm thinking of doing this for each page:\n\nprivate ImageIcon image1= new ImageIcon (\"1.jpg\");\nprivate ImageIcon image2 = new ImageIcon (\"2.jpg\");\n....\n\n\nand then put the pictures in an array and so on ...\nbut i got over 500 pictures and it is tedious to load pages like that .\nso is there any other way?" ]
[ "java", "photo-gallery" ]
[ "showing multiple rows with jquery", "I have an HTML:\n\n<div class=\"row\" id=\"show\"></div>\n\n\nAnd a JQuery:\n\n $.ajax({\n type: 'POST',\n url: 'query2.php',\n data: key,\n dataType: 'json',\n success: function (msg) {\n\n var tmp = \"\";\n $.each(msg, function (i, v) {\n\n tmp += ('<div class=\"cell\">' + v.jobTitle + '</div>');\n tmp += ('<div class=\"cell\">' + v.jobName + '</div>');\n tmp += ('<div class=\"cell\">' + v.fullName + '</div>');\n tmp += ('<div class=\"cell\">' + v.phone + '</div>');\n tmp += ('<div class=\"cell\">' + v.mail + '</div>');\n tmp += ('<div class=\"cell\">' + v.city + '</div>');\n tmp += ('<div class=\"cell\">' + v.description + '</div>');\n\n $('#show').html(tmp);\n alert(tmp);\n\n });\n\n\nIf i have on row in my query the result would be:\n\n\n\nBut if i have more rows, It get messy and all would show in one row:\n\n\n\nHow can i show another row with class=\"row\" in my loop?\n\nThanks in Advance." ]
[ "jquery", "each", "multiple-results" ]
[ "mapping a 2d delay vector from a 1d vector in numpy", "I am trying to generate a 2D vector from a 1D vector where the element is shifted along the row by an increment each row. \n\ni would like my input to look like this:\n\ninput:\nt = [t1, t2, t3, t4, t5]\n\nout = \n[t5, 0, 0, 0, 0]\n[t4, t5, 0, 0, 0]\n[t3, t4, t5, 0, 0]\n[t2, t3, t4, t5, 0]\n[t1, t2, t3, t4, t5]\n[ 0, t1, t2, t3, t4]\n[ 0, 0, t1, t2, t3]\n[ 0, 0, 0, t1, t2]\n[ 0, 0, 0, 0, t1]\n\n\nim unaware of a way to do this without using a for loop, and computational efficieny is important for the task im using this for. Is there a way to do this without a for loop?\n\nthis is my code using a for loop:\n\nimport numpy as np\n\nt = np.linspace(-3, 3, 7)\nz = np.zeros((2*len(t) - 1, len(t)))\n\ndiag = np.arange(len(t))\nfor index, val in enumerate(np.flip(t, 0)):\n z[diag + index, diag] = val\n\nprint(z)" ]
[ "python", "performance", "numpy" ]
[ "How to sort emp names list in array using javascript", "I am listing employee details and want to sort by names, id, salary etc. However, I wasn't able to list and sort the items since I am beginner in Javascript.\n\nBelow is my attempt:\n\n<div id=\"showtable\"></div>\n<br/>\n<button onclick=\"showName()\">Sort by Name</button>\n<button onclick=\"\">Sort by Age</button>\n<button onclick=\"\">Sort by Desending</button>\n<button onclick=\"\">Sort by Gender</button>\n<button onclick=\"\">Sort by Salary</button>\n\n\n\n\nvar myemp = [{\n name: \"selva\",\n age: 32,\n gender: \"male\",\n salary: 20000\n },\n {\n name: \"raj\",\n age: 32,\n gender: \"male\",\n salary: 20000\n },\n {\n name: \"Priya\",\n age: 28,\n gender: \"female\",\n salary: 20000\n }\n\n];\n\nfunction myEmployee() {\n var emplist = \"<div>\"\n for (var i = 0; i < myemp.length; i++) {\n emplist += \"<ul>\";\n emplist += \"<li>\" + myemp[i].name + \"</li>\";\n emplist += \"<li>\" + myemp[i].age + \"</li>\";\n emplist += \"<li>\" + myemp[i].gender + \"</li>\";\n emplist += \"<li>\" + myemp[i].salary + \"</li>\";\n emplist += \"</ul>\" + \"<br>\" + \"<br>\";\n }\n emplist += \"</div>\";\n document.getElementById(\"showtable\").innerHTML = emplist;\n}\n\nfunction showName() {\n myemp.sort(function(myemp1, myemp2) {\n if (myemp1.name > myemp2.name) {\n return 1;\n } else(myemp1.name < myemp2.name) {\n return -1;\n }\n else return 0;\n });\n myEmployee();\n}\n\n\nWould you please help me out? Any help would be appreciated." ]
[ "javascript", "arrays", "sorting" ]
[ "(Parse error) syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING", "I'd like to ask for a little help with this. I'll need your help with this part of code. I can't find a mistake in:\n\nif ( (!isset($menuitem['url'])) && (isset($menuitem['tab'])) ) {\n define (\"'#'.$menuitem['tab']\", \"'?pg=overview&table='.$menuitem['tab']\");\n $menuitem['url'] = '#'.$menuitem['tab'];\n}\n\n\nwhole code is here (same error at the bottom): http://codepad.org/tv2rHHwK\n\nThank you very much for your help.\n\nThe hash in url adress is necessary for me, please try to keep it on its place.\n\nYTRaza" ]
[ "php" ]
[ "Compare and count the frequency of pairs of entries in two columns", "I have two columns (v5 & v6) in a matrix where both columns have entries between 0 and 5 as\nhead(matrix)\n v1 v2 ... v5 v6\n[1,] 0 5\n[2,] 1 3\n[3,] 2 1\n[4,] 4 1\n[5,] 2 2\n\nI want to construct a new (6*6)matrix contains the number of occurrences of each pair of values in both columns as\nnew_matrix\n \n 0 1 2 3 4 5\n0 2326 2882 2587 734 341 0\n1 50 17 103 14 0 6\n2 ......\n3 .......\n4 ......\n5 .......\n\nI mean that I want to know how many pairs (0,0) , (0,1), ..., (0,5),... (5,5) are in both columns?\nI used library(plyr) as\nfreq <- ddply(matrix, .(matrix$v5, matrix$v6), nrow)\nnames(freq) <- c("v5", "v6", "Freq")\n\nBut this will not give the needed result!" ]
[ "r", "compare" ]
[ "I can not view my table that I've just created ? I coudn't figure out why", "I'm a mac user. \n\nSo I installed mysql with homebrew, by using the following command : brew install mysql \n\nI started the mysql server with the following command :\n mysql.server start\n\nI connected to mysql with the following command : mysql -uroot \n\nI created a database called test by using the following command : \ncreate database test;\n\nI created a sample table , after I connected to test database \n(after use test; command)\n\nBut when I attempt to run a query like select * from test.sampletable;\n\nIt gives me the following error :\n\nTable 'test.sampletable' doesn't exists.\n\nI might be missing something. Do you have any idea ?" ]
[ "mysql", "hibernate", "jpa" ]
[ "Javascript - key / certificate from USB Token", "I would like to ask if is still impossible, using JavaScript, to get key from USB token or from certificate stored in Browser. I was reading many articles which said WebCryptoApi doesn't enable to do that. \n\nIs any option to get key from token? Maybe something was changed?" ]
[ "javascript", "security", "webcrypto-api" ]
[ "Comparing two text files and only keeping unique values", "All, \n\nI am VERY new to powershell and am attempting to write a script and have run into an issue. \n\nI currently have two text files. For argument sake the first can be called required.txt and the second can be called exist.txt. \n\nI have a script which queries a server and determines a list of all existing groups and writes these to a text file. At the same time the customer has a list of new groups they wish to create. I want to compare the new list (required.txt) with the existing list (exist.txt) and anything which doesn't exist be piped out to a new text file which is then picked up and imported using another process. \n\nI've got the scripting done to gather the list from the server I just need to know how to do the comparison between the existing and required.\n\nAny suggestions welcome.\n\nRichard" ]
[ "powershell" ]
[ "Draw a truncated-cone-based vortex in matplotlib", "I am trying to make a rudimentary model for the a coronal hole in my mathematics thesis. I am looking to create a plot where the radial direction of the cylinder increases with proportionally with the height and then I would like to add twists in the $(\\theta, z)$ direction either explicitly or with lines and arrows along the surface. \n\nCurrently I have only been able to produce a normal cylinder.\n\n import matplotlib.pyplot as plt\nimport numpy as np\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfig = plt.figure()\nax = fig.add_subplot(111, projection='3d')\n\n# Cylinder\nx=np.linspace(-1, 1, 100)\nz=np.linspace(-2, 2, 100)\nXc, Zc=np.meshgrid(x, z)\nYc = np.sqrt(1-Xc**2)\n\n# Draw parameters\nrstride = 20\ncstride = 10\nax.plot_surface(Xc, Yc, Zc, alpha=0.2, rstride=rstride, cstride=cstride)\nax.plot_surface(Xc, -Yc, Zc, alpha=0.2, rstride=rstride, cstride=cstride)\n\nax.set_xlabel(\"X\")\n#ax.set_ylabel(\"Y\")\nfig.gca().set_ylabel(r'$\\theta$')\nax.set_zlabel(\"Z\")\nplt.figure(figsize=(200,70)) #sets the size of the plot\n#plt.show()" ]
[ "python", "matplotlib", "physics", "fluid-dynamics" ]
[ "Java 8 - Type mismatch: cannot convert from List to List", "I have a list of Strings:\n\nList<String> list = Arrays.asList(\"a1,a2\", \"b1,b2\");\n\n\nThen to convert everything in a list like: \"a1\",\"a2\",\"b1\",\"b2\" wrote this:\n\nList<String> ss1 = list.stream()\n .flatMap(s -> Stream.of(s.split(\",\")))\n .collect(Collectors.toList());\n\n\nBut I had an error: \"Type mismatch: cannot convert from List<Serializable> to List<String>\". I handled the problem changing into this:\n\nList<String> ss2 = list.stream()\n .flatMap(s -> Arrays.stream(s.split(\",\")))\n .collect(Collectors.toList());\n\n\nEclipse Neon suggests that the difference is in the flatMap return type. First flatMap returns a List<Serializable> second returns a List<String>.\n\nBut both Stream.of() and Arrays.stream() returns a <T> Stream<T> (Eclipse suggests that they both returns a Stream<String>).\n\nAnd again, Stream.of() internally use (and returns the output of) Arrays.stream(). So, again, what's wrong in the first case?" ]
[ "java", "arrays", "eclipse", "java-8", "java-stream" ]
[ "Add class to sidebar parent menu & submenu on click", "I want to add class active to sidebar parent & sub menu on click. I've tried this code, but it won't work. Please check my code and suggest me what and where I missed.\n\n\r\n\r\n$(\"#sidebar-menu ul li.with_sub a.active\").parents(\"li:last\").children(\"a:first\").addClass(\"active\").trigger(\"click\");\r\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>\r\n<div class=\"slim-sidebar\" id=\"sidebar-menu\">\r\n <label class=\"sidebar-label\">Navigation</label>\r\n <ul class=\"nav nav-sidebar\">\r\n <li class=\"sidebar-nav-item with-sub\">\r\n <a href=\"\" class=\"sidebar-nav-link\"><i class=\"icon ion-ios-home-outline\"></i> Dashboard</a>\r\n <ul class=\"nav sidebar-nav-sub\">\r\n <li class=\"nav-sub-item\"><a href=\"menuother.html\" class=\"nav-sub-link\">Page 01</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Page 02</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Page 03</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Page 04</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Page 05</a></li>\r\n </ul>\r\n </li>\r\n <li class=\"sidebar-nav-item with-sub\">\r\n <a href=\"\" class=\"sidebar-nav-link\"><i class=\"icon ion-ios-home-outline\"></i> Menu</a>\r\n <ul class=\"nav sidebar-nav-sub\">\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Menu 01</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Menu 02</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Menu 03</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Menu 04</a></li>\r\n <li class=\"nav-sub-item\"><a href=\"\" class=\"nav-sub-link\">Menu 05</a></li>\r\n </ul>\r\n </li>\r\n </ul>\r\n</div>" ]
[ "javascript", "jquery", "html", "css" ]
[ "Is there any way to connect two different wifi networks on same computer simultaneously", "I have my computer connected to college wifi network. I want my computer connected to a hotspot created for some programming purposes. Can anyone suggest me any solutions to simultaneously connect two wifi networks." ]
[ "networking", "wifi" ]
[ "How to completely remove Xcode 9 beta after installing released Xcode 9?", "I have installed Xcode 9 released version from AppStore. but I already have older beta version of Xcode 9 which consuming around 10 GB space.\n\nI want to remove that older version, but don't know proper way to do it and doubt about if my working projects get affected by doing that or not." ]
[ "ios", "xcode" ]
[ "How to use WHERE clause with ON query?", "While working with left join I wanted to have a search string parameter - which would be dynamic. So, I had the following queries\n\n pl_ids_tuple = 1477 //Playlist id\n initial_query_string = '''select songs.id, songs.name, songs.artist, songs.album, songs.albumart, songs.\"albumartThumbnail\", cpr.votes, is_requested from\n (select id, name, artist, album, albumart, \"albumartThumbnail\" from (select song_id from core_plsongassociation where playlist_id in (%s))'''%pl_ids_tuple\n\n songs = Song.objects.raw(initial_query_string + ''' as sinpl\n left join songs on sinpl.song_id=id where explicit=False\n ) as songs left join\n (select song_id, votes, bool_or(thirdpartyuser_id=%s) as is_requested from\n (select * from core_priorityrequests where client_id=%s and is_played=False\n ) as clpr left join core_priorityrequests_third_party_user on clpr.id=priorityrequests_id\n group by priorityrequests_id, song_id, votes\n ) as cpr on songs.id=cpr.song_id where songs.name ilike %s or songs.artist ilike %s limit %s offset %s\n left join\n (select core_blocksong.song_id from core_blocksong where core_blocksong.unblock_flag = 'f' and core_blocksong.client_id=%s)\n as c on c.song_id = songs.id where c.song_id is null''',\n [request.anon_user.id, restaurant.client.id,search_string,search_string,limit,offset,restaurant.client.id,])\n\n\nIf you notice/observe closely I get a programming error due to the placement of - songs.name ilike %s or songs.artist ilike %s limit %s offset %s in the query.\n\nIf I put this constraint in the end, then the response is different. Can anyone suggest where can I put this constraint in order to get the correct response?\n\nI read through this resource - https://www.mysqltutorial.org/mysql-left-join.aspx/ and found that where filters after joining." ]
[ "sql", "django", "postgresql" ]
[ "How to reuse a fragment after orientation change?", "I am currently trying to reuse created fragments after an orientation change. My layout on a tablet consists of 3 columns. The first is a simple navigation drawer, the second is a list and the third is a details view for items selected in the list.\n\nMy aim is to remember the selected item in the list after an orientation change from landscape to portrait to landscape. In the portrait mode the selection is not shown.\n\nHave a look at my code:\n\nmListFragment = (RecordingListFragment) fm.findFragmentByTag(\"tag\");\n\nif(mListFragment == null) {\n mListFragment = new RecordingListFragment();\n}\n\nif(mDetailsFragment == null) {\n mDetailsFragment = new RecordingDetailFragment();\n}\n\n// phone\nif(!mTwoPanelsUsed) {\n\n // pop from back stack or create\n if(!fm.popBackStackImmediate(BACK_STACK_STATE_LIST, 0)) {\n FragmentTransaction ft = fm.beginTransaction();\n ft.replace(R.id.content_frame, mListFragment, \"tag\");\n ft.addToBackStack(BACK_STACK_STATE_LIST);\n ft.commit();\n }\n\n// tablet\n} else {\n\n // container got invisible in other cases, so make visible again\n findViewById(R.id.container_2).setVisibility(View.VISIBLE);\n\n // pop from back stack or create\n if(!fm.popBackStackImmediate(BACK_STACK_STATE_LIST_AND_DETAILS, 0)) {\n FragmentTransaction ft = fm.beginTransaction();\n ft.replace(R.id.container_1, mListFragment, \"tag\");\n ft.replace(R.id.container_2, mDetailsFragment);\n ft.addToBackStack(BACK_STACK_STATE_LIST_AND_DETAILS);\n ft.commit();\n\n }\n\n}\n\n// store index pressed in navigation drawer for back button navigation\nmNavigationDrawerActivatedHistory.push(NAVIGATION_RECORDINGS);\nmDrawerNavigationPosition = NAVIGATION_RECORDINGS;\n\n\nBy executing this I get an runtime exception for the line\n\nft.replace(R.id.content_frame, mListFragment, \"tag\");\n\n\nnamed:\n\n\n Caused by: java.lang.IllegalStateException: Can't change container ID\n of fragment RecordingListFragment{d0e629e #1 id=0x7f0a0043 tag}: was\n 2131361859 now 2131361856\n\n\nI already read something about remove the fragment and then executePendingTransactions. Changing the code to\n\nif(mListFragment == null) {\n mListFragment = new RecordingListFragment();\n} else {\n fm.beginTransaction().remove(mListFragment).commit();\n fm.executePendingTransactions();\n}\n\n\nresults in another exception:\n\n\n Unable to start activity\n ComponentInfo{com.iav.viraprecorder/com.iav.viraprecorder.VIRAPRecorderActivity}:\n java.lang.IllegalStateException: Recursive entry to\n executePendingTransactions\n\n\nHow can I restore the state of my fragment?\n(I dont want to use the retainInstance thing)\n\nThanks!" ]
[ "android", "android-fragments" ]
[ "Can't find file on classpath grails war/tomcat", "I have put a file in my grails-app/conf package called size_config.xml . When the war is built then unpacked the file shows up in WEB-INF/classes with the expected name. However, when I try to reference the file in my application it claims that the file is not found. I've tried all combinations that I can think would be logical in trying to reference including:\n\nnew File(\"WEB-INF/classes/size_config.xml\")\nnew File(\"classes/size_config.xml\")\nnew File(\"size_config.xml\")\nnew File(\"grails-app/conf/size_config.xml\")\n\n\nand none of these seem to work. When I run my local integration tests I use \"grails-app/conf/size_config.xml\" and it finds the file just fine. Since the file is being packed up fine, I'm assuming its not a deploy config issue, but rather some minor item I'm failing to see. Ideas?" ]
[ "file", "tomcat", "grails", "classpath" ]
[ "How do I sort an ArrayList of Objects, allowing user to select which parameter to sort by primarily, and secondarily?", "Here is what my class looks like.\npublic class Data {\n private int stateCode;\n private int countyCode;\n private String stateName;\n private String countyName;\n private int count1992;\n private int count1997;\n private int count2002;\n private int count2007;\n\n public Data(int stateCode, int countyCode, String stateName, String countyName, int count1992, int count1997, int count2002, int count2007){\n this.stateCode = stateCode;\n this.countyCode = countyCode;\n this.stateName = stateName;\n this.countyName = countyName;\n this.count1992 = count1992;\n this.count1997 = count1997;\n this.count2002 = count2002;\n this.count2007 = count2007;\n }\n\n}\n\n\nI have an ArrayList of these objects, but the user needs to select which to sort by, both primarily and secondarily. Also, both need to be sorted either ascending or descending.\nI'm having trouble with how to sort this Arraylist; I'm not sure whether it will be needed to be sorted by a String or and int. Also, I'm not sure how I can choose two class parameters and sort by them. Hopefully my question makes sense. Thanks." ]
[ "java", "sorting" ]
[ "jQuery - Use window scrollbar to scroll content inside a DIV", "Is it possible to use window scrollers to scroll a big DIV content? instead of its own div scroller?" ]
[ "jquery", "scrollbar" ]
[ "Number on the right in an R chart with ggplot2", "I'm trying to represent a graph in R but when I paint it I get a ,1 next to high, low and normal, like this: (High,1) Is it possible to eliminate the apparentis and the ,1 so that only High, Low and Normal are shown?\n\nCode:\n\noutput$grafica <-renderPlotly({\n p <- ggplot(data(), aes(x=as.factor(data()[,names(data())[15]]),\n fill=as.factor(data()[,names(data())[5]])) + \n geom_bar(stat=\"count\") +\n scale_fill_manual(values=c(\"#810f7c\", \"#8856a7\", \"#8c96c6\"))+\n theme(axis.text.x=element_text(angle=45, hjust=1))+\n scale_color_viridis(discrete = TRUE) + \n labs(title=\"Number\", \n y=\"Issues\", \n x=\"Project\",\n fill= \"Priority\")\n })\n\n\nThanks in advance." ]
[ "r", "ggplot2", "shiny", "plotly", "r-plotly" ]
[ "Applescript error \"invalid key form\" when run", "I tried to run this applescript:\n\ntell application \"Finder\"\n duplicate POSIX file contents \"/Users/xx/Desktop/xxxx/\" to POSIX file \"/USB/\" with replacing\n delete POSIX file contents \"/Users/felix/Desktop/xxxx/\"\n empty trash\nend tell\n\n\nbut every time an error message appears saying: \n\n\n Invalid key form." ]
[ "applescript" ]
[ "GUI blocked during Canvas update - how to optimize this?", "I am drawing about 12.000 objects to a JavaFX 2.2 Canvas. The GUI blocks for around 2 seconds, while measuring the execution time of my code claims less than half a second execution time for my code.\n\nSo I am wondering how the measured execution time of my code can be so far shorter than the time the GUI is blocked - I guess there's some kind of buffering on the Canvas, so things are first written to the buffer and processed later? So after ~0.5 seconds, everything I drew to the Canvas was only written to the buffer?\n\nAssuming everything is buffered first leads to my next question: Isn't the drawing of the things in the buffer always done on the UI-Thread, so I can't optimize the timespan where the GUI is blocked through to drawing things from the buffer? Even if I would draw to the Canvas from the Application thread, when the buffer is still processed on the UI thread, then I won't get rid of this 1,5 seconds blocking of the GUI?\n\nThanks for any hint!\n\nUpdate: Pseudocode:\n\nlong start = System.nanoTime();\n\n// Using GraphicsContext, draw ~ 12.000 arc parts (GraphicsContext.drawArc method)\n// to a Canvas\n\nlong end = System.nanoTime();\ndouble elapsedTime = (end-start)/1000000000.0; //in seconds\nSystem.out.println(\"elapsed time: \" + elapsedTime); // something around 0.5, however the GUI hangs for around 2 seconds - where do the additional 1.5 seconds come from?\n\n\nI am doing everything on the application thread, so I understand that the GUI hangs for the 0.5 seconds during which I am adding stuff to the Canvas. However I can't understand, why the GUI hangs for ~2 seconds, when my drawing to the Canvas finished after 0.5 seconds?" ]
[ "performance", "canvas", "javafx-2" ]
[ "$watchCollection not being triggered on object change", "I've been trying to figure out why watchCollection isn't not triggered on object change ?\n\n.factory('Products', function($http, $timeout){\n\n function Products(data){\n\n if (data) {\n this.setData(data);\n };\n\n };\n\n Products.prototype = {\n\n selected: {},\n\n setData: function(data) {\n angular.extend(this, { categories: data });\n },\n\n load: function() {\n\n var scope = this;\n\n $http\n .get('products.php?option=get_categories')\n .success(function(data) {\n\n scope.setData(data);\n\n });\n\n }\n\n };\n\n var instanceManager = {\n\n products: false,\n\n get: function(){\n\n if (!this.products){\n\n this.products = new Products();\n\n this.products.load();\n\n };\n\n return this.products;\n\n }\n\n };\n\n return instanceManager;\n\n})\n\n\nHere's the directive:\n\n.directive(\"foo\", function(Products){\n return {\n restrict: 'A',\n link: function(scope, el, attrs) {\n\n scope.products = Products.get();\n\n scope.$watchCollection(scope.products, function(newValue, oldValue){\n\n if (newValue == oldValue) {\n return;\n };\n\n console.log(\"Hello!\");\n\n });\n\n }\n }\n})" ]
[ "angularjs", "angularjs-scope" ]
[ "Core Data: Compound Indexes are not getting created on a child entity", "Here is the situation: I have a parent - child Core Data model relationship. I have some fields on the child entity which I order by using sort descriptors on a fetch request. I have added them on the Indexes list on the Entity section of the Data Model Inspector like field1,field2.\n\nHowever, when setting -com.apple.CoreData.SQLDebug 1, I cannot see the compound index being created. Further more, I was able to get the SQLite generated file, and all I can see are the single field indexes created for other purposes, but not the compound ones.\n\nIs there a limitation by doing this on a child entity? Has anyone achieved creating compound indexes on child entities? Thanks!" ]
[ "ios", "entity-framework", "sqlite", "core-data", "indexing" ]
[ "Yup validate date between 01 01 1901 and current system date", "I'm struggling with this problem since several hours.\nI'm using Yup package for validation and I need to validate DOB between 01 01 1901 and current system date.\nI have the following code:\n dateOfBirth: yup\n .string()\n .matches(\n /^(?:(?:31(\\/|-|\\.)(?:0?[13578]|1[02]))\\1|(?:(?:29|30)(\\/|-|\\.)(?:0?[13-9]|1[0-2])\\2))(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$|^(?:29(\\/|-|\\.)0?2\\3(?:(?:(?:1[6-9]|[2-9]\\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\\d|2[0-8])([\\/. -])(?:(?:0?[1-9])|(?:1[0-2]))\\4(?:(?:1[6-9]|[2-9]\\d)?\\d{2})$/,\n DATE_OF_BIRTH_ERROR\n )\n .test('length', DATE_OF_BIRTH_ERROR, date => date.length === 10)\n\nIf someone has experience with Yup and can help me with this comparison, I will greatly appreciate." ]
[ "javascript", "reactjs", "yup" ]
[ "How to check in Java color of text when I have .html and .css files?", "I have html with css and I want to check what is real color (and other visual text attributes) of specified text in html document. Can I do this with JSoup or must I look for some real-like html engine/processor? Speed of processing this operation is one of main factor." ]
[ "java", "html", "css", "jsoup" ]
[ "Brew upgrade python returns \"python not installed\"", "I'm trying to upgrade from "Python 3.7.3" to "Python 3.8" with $ brew upgrade python. But when I try, brew returns:\nUpdating Homebrew...\n==> Auto-updated Homebrew!\nUpdated 1 tap (homebrew/core).\n==> Updated Formulae\nUpdated 2 formulae.\n\nError: python not installed\n\nI know python is installed because I've been using it for months. I can confirm this by running, which python3\n/usr/bin/python3\n\nAnd python3 --version,\nPython 3.7.3\n\nI don't know what is causing this?\nCould the issue be that python --version still points to python2, Python 2.7.16.\n\nUPDATE\nI also confirm I've run brew cleanup and brew doctor.\nbrew info python returns\[email protected]: stable 3.8.5 (bottled)\nInterpreted, interactive, object-oriented programming language\nhttps://www.python.org/\nNot installed\nFrom: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]\nLicense: Python-2.0\n==> Dependencies\nBuild: pkg-config ✔\nRequired: gdbm ✔, [email protected] ✔, readline ✔, sqlite ✔, xz ✔\n==> Caveats\nPython has been installed as\n /usr/local/bin/python3\n\nUnversioned symlinks `python`, `python-config`, `pip` etc. pointing to\n`python3`, `python3-config`, `pip3` etc., respectively, have been installed into\n /usr/local/opt/[email protected]/libexec/bin\n\nYou can install Python packages with\n pip3 install <package>\nThey will install into the site-package directory\n /usr/local/lib/python3.8/site-packages\n\nSee: https://docs.brew.sh/Homebrew-and-Python\n==> Analytics\ninstall: 587,815 (30 days), 1,615,984 (90 days), 2,710,078 (365 days)\ninstall-on-request: 187,760 (30 days), 307,168 (90 days), 343,355 (365 days)\nbuild-error: 0 (30 days)" ]
[ "python", "python-3.x", "macos", "homebrew" ]
[ "Drawing circles using CGContext", "Using the code below, I am constructing polygons with various number of sides.\n\nCan somebody advise how I can add code to circumscribe a circle and also inscribe a circle in each polygon returned?\n\n-(void) drawRect:(CGRect)rect{\n CGContextRef context = UIGraphicsGetCurrentContext(); \n CGContextBeginPath (context); \n CGContextSetLineWidth(context,5);\n\n NSArray * points = [PolygonUIView pointsForPolygonInRect:[self bounds] numberOfSides:polygon.numberOfSides];\n\n NSLog(@\"%d\", [points count]);\n NSLog(@\"%d\", polygon.numberOfSides);\n\n for(NSValue * point in points) {\n CGPoint val = [point CGPointValue];\n if([points indexOfObject:point]==0)\n {\n CGContextMoveToPoint (context, val.x, val.y);\n\n }\n else\n {\n CGContextAddLineToPoint (context, val.x, val.y); \n }\n }\n\n CGContextClosePath(context);\n [[UIColor clearColor] setFill]; \n [[UIColor blackColor] setStroke]; \n CGContextDrawPath (context, kCGPathFillStroke);\n polygonLabel.text = polygon.name;\n}\n\n+ (NSArray *)pointsForPolygonInRect:(CGRect)rect numberOfSides:(int)numberOfSides { \n CGPoint center = CGPointMake(rect.size.width / 2.0, rect.size.height / 2.0); \n float radius = 0.90 * center.x; \n NSLog(@\"%f rad\",radius);\n NSMutableArray *result = [NSMutableArray array]; \n float angle = (2.0 * M_PI) / numberOfSides; \n float exteriorAngle = M_PI - angle; \n float rotationDelta = angle - (0.5 * exteriorAngle); \n\n for (int currentAngle = 0; currentAngle < numberOfSides; currentAngle++) { \n float newAngle = (angle * currentAngle) - rotationDelta; \n float curX = cos(newAngle) * radius; \n float curY = sin(newAngle) * radius; \n [result addObject:[NSValue valueWithCGPoint:CGPointMake(center.x + curX, \n center.y + curY)]]; \n } \n\n return result;\n}" ]
[ "objective-c", "core-graphics" ]
[ "How can I enable the users delete and edit the objects they create in Django?", "Now I have a model called lyric. The detail is as below:\n\nclass Lyric(models.Model):\n title = models.CharField(max_length = 200)\n body = models.CharField(max_length = 12000)\n pub_date = models.DateTimeField('date published')\n user = models.OneToOneField(User)\n\n\nI have a form that user can create lyric. Next I want to enable the user can edit and delete the lyrics. Now I have implemented the form of editing and the function of delete. But how can I limit the permission? Thank you in advance!!!" ]
[ "python", "django", "python-3.x", "web" ]
[ "fopen data corruption when printing char arrays from structure member char arrays in C", "I'm having some kind of weird error where the lastName and phoneNumber char array members of the struct phoneEntry are overwritten when I'm trying to print. \nThe following code is bits and pieces of code that relate to the main part that strikes out.\n\ntypedef struct\n{\n char firstName[30];\n char lastName[30];\n char phoneNumber[30];\n} phoneEntry;\n\nsize_t phoneBookSize = 1;\nphoneEntry* ptrPhoneBook = malloc(phoneBookSize * sizeof(phoneEntry));\n\n\nFILE *loadedFile;\nchar fileName[30];\nscanf(\"%s\", fileName);\nloadedFile = fopen(fileName, \"w\"); // ERROR OCCURS\n\nfprintf(loadedFile, \"First name\\tLast name\\tPhone Number\\n\");\nint count = 0;\nfor (count = 0; count < phoneBookSize - 1; count++)\n{\n printf(\"saving %s %s %s\\n\", ptrPhoneBook[count].firstName, ptrPhoneBook[count].lastName, ptrPhoneBook[count].phoneNumber);\n fprintf(loadedFile, \"%s\\t%s\\t%s\\t\\n\", ptrPhoneBook[count].firstName, ptrPhoneBook[count].lastName, ptrPhoneBook[count].phoneNumber);\n}\nfclose(loadedFile);\n\n\nBasically, the data stored in each character array within the struct member is defined and exists until the \"loadedFile\" initialization. \nAt that point, the data stored in the lastname and phoneNumber char array members within the ptrPhoneBook at index 0 is overwritten with nothing or simply erased. \n\nThis is the output:\n\nFirst name Last name Phone Number\nJames \n\n\nAs opposed to the expected output: \n\nFirst name Last name Phone Number\nJames Bond 007\n\n\nI can avoid the entire problem by simply starting the count of the ptrPhoneBook at 1 as opposed to 0, but I want to know why fopen corrupts these data members at index 0.\n\nThe code I gave probably won't give you an exact output, but the error still exists. \n\nIf you would like to try and run the code yourself, here's code that you can run right of the bat. \n\n// Including libraries into the source code\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\ntypedef struct\n{\n char firstName[30];\n char lastName[30];\n char phoneNumber[30];\n} phoneEntry;\n\nmain()\n{\n\n size_t phoneBookSize = 1;\n phoneEntry* ptrPhoneBook = malloc(phoneBookSize * sizeof(phoneEntry));\n\n phoneBookSize++;\n phoneEntry* reallocPhoneBook = realloc(ptrPhoneBook, phoneBookSize);\n\n if (reallocPhoneBook) {\n ptrPhoneBook = reallocPhoneBook;\n } else {\n printf(\"Failure. Memory error.\\n\\n\");\n }\n\n strcpy(ptrPhoneBook[0].firstName, \"James\");\n strcpy(ptrPhoneBook[0].lastName, \"Kim\");\n strcpy(ptrPhoneBook[0].phoneNumber, \"2343\");\n\n\n FILE *loadedFile;\n char fileName[30];\n scanf(\"%s\", fileName);\n loadedFile = fopen(fileName, \"w\");\n\n fprintf(loadedFile, \"First name\\tLast name\\tPhone Number\\n\");\n int count = 0;\n for (count = 0; count < phoneBookSize - 1; count++)\n {\n printf(\"saving %s %s %s\\n\", ptrPhoneBook[count].firstName, ptrPhoneBook[count].lastName, ptrPhoneBook[count].phoneNumber);\n fprintf(loadedFile, \"%s\\t%s\\t%s\\t\\n\", ptrPhoneBook[count].firstName, ptrPhoneBook[count].lastName, ptrPhoneBook[count].phoneNumber);\n }\n fclose(loadedFile);\n}\n\n\nThe output for the code above is:\n\nFirst name Last name Phone Number\nJames 2343" ]
[ "c", "arrays", "file", "char", "fopen" ]
[ "Why does my SQL agent job keep failing?", "I have a SQL agent job that just runs a basic query on a schedule. It updates info based on the query shown.\n\nUSE DB\nDECLARE @startDate AS DATETIME\nDECLARE @endDate AS DATETIME\nDECLARE @rcount AS VARCHAR(10)\nSET @startDate = CAST(CONVERT(VARCHAR(10),GETDATE(),112) AS DATETIME) \nSET @endDate = CAST(CONVERT(VARCHAR(10),GETDATE(),112) AS DATETIME) \n--*********************************************************\n-- *Run Query\n--*********************************************************\nUPDATE Table1\nSET Table1.field1 = 'ZPR' + Left(Table1.field1,6),\n Table1.field2 = '0',\n Table1.field3 = '0' \nWHERE Table1.GUID IN (SELECT GUID FROM Table1 T2 \n WHERE T2.Date >= @startDate \n AND T2.Date <= @endDate \n AND T2.complete = 0)\n AND Table1.co IN (SELECT co FROM VIEW('ZERO')) \nSELECT @rcount = CAST(@@ROWCOUNT AS VARCHAR(10)) + ' ' + 'row(s) affected by UPDATE';\n--*********************************************************\n--* Print Results\n--*********************************************************\nDECLARE @eSubject varchar(250)\nDECLARE @emailTo varchar(250)\nSET @eSubject = 'Number of rows updated' \nSET @emailTo = '[email protected]' \nEXEC msdb.dbo.sp_send_dbmail @recipients=@emailTo,\n @subject = @eSubject,\n @body = @rcount,\n @body_format = 'HTML';\n\n\nThe job runs perfectly when there isn't any updates done but fails whenever there is. The user that this job is ran under has read and write access. The error that I get is \"The string or the binary data would be truncated [sql220001] [error 8152]\". I'm not sure why it keeps failing and any help would be amazing!\n\n******************UPDATE**********\n\nI'm going crazy here. It fails as a scheduled job but runs perfectly under any other user as a straight query. The fields are as such:\n\nTable1.field1 = PK length of 10\nTable1.field2 = bit length of 1\nTable1.field3 = bit length of 1\n\nno matter what I try or do the SQL job fails with the same error but it is making me nuts that I can run the query by itself and it works flawlessly." ]
[ "sql-server-2008", "tsql", "sql-agent-job" ]
[ "Beautiful Soup - extracting values from outside quotation marks inside div class", "I am having some trouble extracting a specific value from an element within the attributes extracted from a website using the code below:\n\nfrom bs4 import BeautifulSoup\nimport requests\n\n# Get mills and estates information from dashboard\nurl = 'http://nestetraceabilitydashboard.com/nestes-palm-oil-dashboard' \npage = requests.get(url).text\nsoup = BeautifulSoup(page, \"html.parser\")\n\ndivList = soup.findAll('div', attrs={\"class\" : \"map-item estate-map-item\"})\ndata = {}\nfor div in divList:\n for k,v in div.attrs.items(): \n if k not in ('class'):\n data[k] = data.get(k, []) + [v]\n\ndf = pd.DataFrame(data)\n\n\nAn excerpt of the divList is as below:\n\n[<div class=\"map-item estate-map-item\" data-country=\"Indonesia\" data-latitude=\"1.926944000\" data-location=\"Riau\" data-longitude=\"99.906390000\" data-mills=\"Aek Nabara\" id=\"map_item_5600\">(Aek Nabara) - Aek Nabara</div>,\n <div class=\"map-item estate-map-item\" data-country=\"Indonesia\" data-latitude=\"0.429444444\" data-location=\"Riau\" data-longitude=\"101.818611100\" data-mills=\"Buatan I \" id=\"map_item_5601\">(Buatan I/II ) - Buatan</div>,\n\n\nHowever, the output dict and dataframe removes everything after the map_item_XXXX in the id.\n\nHow would I go about getting the values only outside the quotation marks in my dict and subsequently into thedataframe id column e.g (Aek Nabara) - Aek Nabara for the first item in the divList above?" ]
[ "python", "beautifulsoup", "html-parsing" ]
[ "Change image position with Button", "I would want to change the position of an image in three different positions using a button...\nWith my code the image is only moved of a position...\n\nViewController.h\n\n@property (weak, nonatomic) IBOutlet UIImageView *Switch3Way;\n\n- (IBAction)Switch3WayPressed:(id)sender;\n\n\nViewController.m\n\n- (void)Switch3WayPressed:(id)sender {\nCGRect frame = Switch3Way.frame;\nframe.origin.x = 323;\nframe.origin.y = 262;\nSwitch3Way.frame = frame;\n\n\n}" ]
[ "ios", "button", "uiview", "position" ]
[ "Error:Cannot cast from Fragment to FragmentB", "I have try many different way such as change import.android.support.fragment to import.support.v4.app.Fragment; but it still showing the error cannot cast from Fragment to FragmentB can anyone help me out and tell me where is the error \n\npackage interfragmet.sim7n;\n\nimport android.app.Activity;\nimport android.app.FragmentManager;\nimport android.support.v4.app.Fragment;\nimport android.os.Bundle;\n\npublic class MainActivity extends Activity implements Communication{\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n}\n\n\n@Override\npublic void respond(String data) {\n FragmentManager manager= getFragmentManager();\n FragmentB f2= (FragmentB) manager.findFragmentById(R.id.fragmentB);\n f2.changeText(data); \n}\n}" ]
[ "android", "android-fragments" ]
[ "nginx and apache web servers", "This question is not nginx vs apache. I am more interested in the architectural advantages of NGinx over Apache. As I was able to understand -\n\n\nnginx is an asynchronous, event-driven, web-server which outperforms Apache by a huge margin.\n\n\nWhy is this? Where does Apache fall behind?" ]
[ "apache", "architecture", "webserver", "nginx" ]
[ "BeautifulSoup How do you get the parent element tag that contains a specific text? Trying to scrape email but unable to pick up the parent element tag", "I'm trying to scrape email addresses from a page and having some trouble getting the parent element that contains the email '@' symbol. The emails are embedded within different element tags so I'm unable to just pick them out. There's about 50,000 or so pages that I have to go through.\nurl = 'https://sec.report/Document/0001078782-20-000134/#f10k123119_ex10z22.htm'\n\nHere are some examples (couple are from different pages I have to scrape):\n<div style="border-bottom:1px solid #000000">**[email protected]**</div>\n\n<div class="f3c-8"><u**>[email protected]**</u></div>\n\n<p style="margin-bottom:0pt;margin-top:0pt;;text-indent:0pt;;font-family:Arial;font-size:11pt;font-weight:normal;font-style:normal;text-transform:none;font-variant: normal;">Email: **[email protected]**; Phone: 858-320-8244</p>\n\n<td class="f8c-43">E-mail: <u>[email protected]</u></td>\n\n<p class="f7c-4">Email: [email protected]</p>\n\nWhat I have tried:\n\nI tried find_all('div') to get the ResultSet of all the divs to get the ones that has '@' symbol in it.\n\ndiv = page.find_all('div')\nfor each in div:\n if '@' in each.text: \n print(each.text)\n\nWhen I did this, due to the body being in a 'div', it printed the whole page. Fail.\nSince the emails are embedded within different tags, it seems inefficient for this method\n\nUsing Regular Expression. I tried using regular expression to pick out the emails but it gets bunch of texts that's not usable which I would have to manually split up, replace characters, etc. This just seemed a daunting task to go through all the different scenarios.\n\n import re\n emails = re.findall('\\S+@\\S+', str(page))\n for each in emails:\n print(each)\n\nDoing this gave me something like this :\nhidden;}@media\n#000000">[email protected]</div>\n#000000">[email protected]\n#000000">[email protected]</div>\n#000000">[email protected]</div>\n#000000">[email protected]</div></p>\n#000000">[email protected]</div></p>\[email protected])</div>\n#000000">[email protected]</div>.\nhref="http://@umich.edu">@umich.edu</a></li><li><a\n\nNow I can go in and split some of the texts using .split('<') and then split again, etc. but they're not all same and since I have to scrape 50,000+ pages with 100 entries in each page, there's a lot I have to scrape and take into consideration.\nI tried looking on google and stackoverflow but all I can find are solutions where people are looking for the text within a certain element, etc.\nWhat I need is 'How to find the parent element that contains an email' specifically\nI don't think I would need to use Selenium for this since the issue would be similar to using Beautifulsoup and the site is not JavaScript rendered other than some of the pages being a pdf, which is whole another issue.\nAny insight, help or advice is appreciated. Thanks." ]
[ "python", "regex", "selenium", "web-scraping", "beautifulsoup" ]
[ "runtime table @updated is not accessible after one use", "I am having an error on @updated.id1 as it has been already declared above and if I want output deleted.tblId equal to @coun then how to achieve it?\n\nalter procedure dbo.sp_updateAndUndoQryForsubmitOrder -- sp_updateAndUndoQryForsubmitOrder 1,1\n(\n @id int,\n @for nvarchar(50)=null,\n @coun nvarchar(50)=''\n)\nas\nbegin\n DECLARE @Updated table( id1 int);\n if(@for is not null)\n begin\n update tbl_orderDetails set curStatus='depo' \n output deleted.tblId\n into @Updated\n where id=@id\n --Update the GroupName_old with old values\n update tbl_orders\n set curstatus='Ready'\n where (\n select count(*)\n from tbl_orderDetails as a\n inner join @Updated as b\n on a.tblId=b.id1\n where a.curStatus != 'depo' or a.curStatus is null)=0 and [email protected]\n update tbl_order_execution set dep_date=GETDATE() where [email protected]\n\n end\n else\n update tbl_orderDetails set curStatus='pro' \n output deleted.tblId\n where id=@id \n --Update the GroupName_old with old values\n update a\n set curStatus='0'\n from tbl_orders as a\n inner join @Updated as b\n on a.oid=b.id1;\n update tbl_order_execution set dep_date = NULL;\nend" ]
[ "sql", "sql-server", "sql-server-2012" ]
[ "How to send a local image instead of URL to Microsoft Cognitive Vision API(analyze an image) using Python?", "Am trying to play with Vision API(analyze an image) of Microsoft Cognitive Services. Am wondering how to send a local image through rest API calls to Vision API and request for the results from it using Python. Can anyone help me with this please?\n\nThe Testing opting provided by Microsoft on their site only takes URL, I Tried to convert my local path to URL and give it as input but that doesn't work." ]
[ "python", "microsoft-cognitive", "vision-api" ]
[ "Use python function to start application and run commands", "I want to be able to start an application for example Notepad or Chrome using a python script. I have tried to use the os.startfile() function :\n\nimport os\nos.startfile('Notepad')\n\n\nIt works but when I run a cmd command through it for example whoami :\n\nimport os\nos.startfile('whoami')\n\n\nThis opens a window that automatically closes. Another thing is when using the subprocess module and opening the application from there, the program hangs. It waits for me to close the program I opened before continuing execution. I want to be able to run applications while being able to run cmd commands and storing the output in a variable without the program waiting for me to exit the application it opened, all in a single function. How can I achieve this with the criteria I have set in mind" ]
[ "python", "operating-system", "subprocess" ]
[ "Html Tags in Xamarin App", "Is there a way to show HTML Content (Text formatted with HTML Tags) in a Xamarin.Forms App?\n\nIf yes, are there Html Tags that are not allowed?\n\nThe content comes from a wysiwyg-editor in the web backend." ]
[ "html", "xamarin" ]
[ "Mixing Retina and non retina assets in openGL ES", "I would like to upgrade my 3D application with some high res assets, for iPhone 4.\n\nI can't update the whole graphic content of my app. I want to mix images in high and low resolution.\nAll my application is rendered with OpenGL\n\nThe most part of my app is based on billboard sprites, so I can change the scale factor of my OpenGL view but I will have to scale all my low res sprites and update their positions.\nDo you have another way to do this by changing as little code as possible?" ]
[ "iphone", "opengl-es", "retina-display" ]
[ "How to read MBR data on windows system", "I'm using a file that has MBR code at an offset of 54 bytes.\nIn the main() function, I'm calling OpenMBbrFile(), then ReadMbrData(). \nHowever, I'm not able to read MBR in my Buffer Properly. Please Help Me with the Issue..................................................................................................................................................................................................................................................................................................................................................................................................................\n\nBOOL OpenMbrFile(LPWSTR sPath)\n{\n\n cout << \"OpenMBR: Create Handle\" << endl;\n\n m_hMbrFile = CreateFile(sPath\n , GENERIC_READ\n , FILE_SHARE_READ\n , NULL\n , OPEN_EXISTING\n , FILE_ATTRIBUTE_NORMAL\n , NULL);\n\n if (m_hMbrFile == INVALID_HANDLE_VALUE) return FALSE;\n\n return TRUE;\n}\n\nBOOL CloseMbrFile()\n{\n\n cout << \"CloseMBR: Closing Handle\" << endl;\n\n BOOL bReturn = TRUE;\n\n if (m_hMbrFile != INVALID_HANDLE_VALUE)\n bReturn = CloseHandle(m_hMbrFile);\n\n m_hMbrFile = NULL;\n\n cout << \"Returning from CloseMBR\" << endl;\n\n return bReturn;\n}\n\n\nBOOL ReadMbrData()\n{\n\n cout << \"ReadMBR: Initialization\" << endl;\n\n BOOL bReturn = FALSE;\n DWORD dwByteRead = 0;\n LARGE_INTEGER filepointer;\n filepointer.QuadPart = 54; //MBR data in File at offset 54\n BYTE* pBuff = NULL;\n pBuff = new BYTE[512];\n if (!pBuff) \n {\n cout << \"ReadMBR: Cleaning Stuff up\" << endl;\n if (pBuff) delete[] pBuff;\n CloseMbrFile();\n ClosePhysicalDrive();\n return bReturn;\n }\n\n if (m_hMbrFile == INVALID_HANDLE_VALUE) return FALSE;\n\n cout << \"ReadMBR: Setting fp\" << endl;\n\n if(!SetFilePointerEx(m_hMbrFile, filepointer, NULL, FILE_BEGIN))\n {\n cout << \"Failed to SetFilePointer ( \" << m_hMbrFile << \", \" << filepointer.QuadPart << \", 0, FILE_BEGIN)\" << endl;\n cout << \"ReadMBR: Cleaning Stuff up\" << endl;\n if (pBuff) delete[] pBuff;\n CloseMbrFile();\n ClosePhysicalDrive();\n return bReturn;\n\n }\n\n cout << \"ReadMBR: Starting to read File\" << endl;\n\n bReturn = ReadFile(m_hMbrFile, pBuff, sizeof(*pBuff), &dwByteRead, 0);\n\n if (bReturn)\n bReturn = (sizeof(*pBuff) == dwByteRead); //Need to check this condition? shd it be 512 or size of wud do??\n\n cout << \"ReadMBR: Cleaning Stuff up\" << endl;\n if (pBuff) delete[] pBuff;\n CloseMbrFile();\n ClosePhysicalDrive();\n\n return bReturn;\n}" ]
[ "c++", "windows", "mbr" ]
[ "SQL Server collate syntax error", "I have searched using collate and am using it in the same way the answers say to use it; however, I am getting an error\n\n\n Incorrect syntax near 'COLLATE'\n\n\nHere is my query:\n\nSELECT\n P.FIRST_NAME_SRCH,\n P.LAST_NAME_SRCH,\n ' ' as Title,\n CASE E.FULL_PART_TIME\n WHEN 'F' THEN 'Full Time'\n WHEN 'P' THEN 'Part Time'\n WHEN 'O' THEN 'Occasional'\n ELSE E.FULL_PART_TIME\n END AS FULL_PART_TIME,\n ' ' as Capacity,\n REPLACE(E.HOME_PHONE,'/','-') as HOMEPHONE,\n ' ' as MobilePh,\n ' ' as Email,\n CONVERT(char(10),E.BIRTHDATE,101) as 'BIRTHDATE',\n CASE \n WHEN E.HIRE_DT > E.REHIRE_DT THEN CONVERT(char(10),E.HIRE_DT,101)\n WHEN E.REHIRE_DT > E.HIRE_DT THEN CONVERT(char(10),E.REHIRE_DT,101)\n ELSE CONVERT(char(10),E.HIRE_DT,101)\n END as 'HIRE_DT',\n ' ' as CommPref,\n RTRIM(K.LEVEL3) as 'JOBCODE',\n E.EMPLID\nFROM\n HRPROD..PS_EMPLOYEES E, HRPROD..PS_PERSONAL_DATA P, TKCSDB..CTRLEVEL3CFG K\nWHERE\n E.COMPANY = 'WSQ'\n AND E.EMPLID = P.EMPLID\n AND K.VAL106 COLLATE DATABASE_DEFAULT = E.JOBCODE COLLATE DATABASE_DEFAULT\nORDER BY\n P.LAST_NAME_SRCH\n\n\nI have tried (with same syntax error)\n\nAND \n UPPER(K.VAL106) COLLATE DATABASE_DEFAULT = UPPER(E.JOBCODE) COLLATE DATABASE_DEFAULT\n\n\nand (returns Cannot resolve collation conflict for equal to operation.)\n\nUPPER(K.VAL106) = UPPER(E.JOBCODE)\n\n\nWhat am I doing wrong in the syntax?" ]
[ "sql", "sql-server", "syntax", "collate" ]
[ "Calculating average price of items purchased by customers", "I have three tables: customer, order and line items. They are set up as follows:\n\nCREATE TABLE cust_account(\ncust_id DECIMAL(10) NOT NULL,\nfirst VARCHAR(30),\nlast VARCHAR(30),\naddress VARCHAR(50),\nPRIMARY KEY (cust_id));\n\nCREATE TABLE orders(\norder_num DECIMAL(10) NOT NULL,\ncust_id DECIMAL(10) NOT NULL,\norder_date DATE,\nPRIMARY KEY (order_num));\n\nCREATE TABLE lines(\norder_num DECIMAL(10) NOT NULL,\nline_id DECIMAL(10) NOT NULL,\nitem_num DECIMAL(10) NOT NULL,\nprice DECIMAL(10),\nPRIMARY KEY (order_id, line_id),\nFOREIGN KEY (item_id) REFERENCES products);\n\n\nUsing Oracle, I need to write a query that presents the average item price for for those customers that made more than 5 or more purchases. This is what I've been working with:\n\nSELECT DISTINCT cust_account.cust_id,cust_account.first, cust_account.last, lines.AVG(price) AS average_price\nFROM cust_account\n JOIN orders\n ON cust_account.cust_id = orders.cust_id\n JOIN lines\n ON lines.order_num = orders.order_num\n WHERE lines.item_num IN (SELECT lines.item_num\n FROM lines\n JOIN orders\n ON lines.order_num = orders.order_num\n GROUP BY lines.order_num\n HAVING COUNT(DISTINCT orders.cust_id) >= 5\n );" ]
[ "sql", "oracle", "join", "subquery", "where" ]
[ "javax.crypto.BadPaddingException as I try to convert hex string to byte array. Why do I get it?", "As I try to convert a hex string to a byte array I get this exception :\n\nAug 15, 2013 10:17:32 PM Tester main\nSEVERE: null\njavax.crypto.BadPaddingException: Given final block not properly padded\n at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)\n at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)\n at com.sun.crypto.provider.BlowfishCipher.engineDoFinal(BlowfishCipher.java:319)\n at javax.crypto.Cipher.doFinal(Cipher.java:1978)\n at Tester.main(Tester.java:21)\n\n\nFollowing is the code that attempted so :\n\ntry {\n KeyGenerator keyGenerator = KeyGenerator.getInstance(\"Blowfish\");\n SecretKey secretKey = keyGenerator.generateKey();\n Cipher cipher = Cipher.getInstance(\"Blowfish\"); \n cipher.init(Cipher.DECRYPT_MODE, secretKey);\n String decryptSt = new String(cipher.doFinal(DatatypeConverter.parseHexBinary(\"f250d7a040859d66541e2ab4a83eb2225d4fff880f7d2506\")));\n System.out.println(decryptSt);\n } catch (NoSuchAlgorithmException ex) {\n Logger.getLogger(Tester.class.getName()).log(Level.SEVERE, null, ex);\n } catch (NoSuchPaddingException ex) {\n Logger.getLogger(Tester.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InvalidKeyException ex) {\n Logger.getLogger(Tester.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IllegalBlockSizeException ex) {\n Logger.getLogger(Tester.class.getName()).log(Level.SEVERE, null, ex);\n } catch (BadPaddingException ex) {\n Logger.getLogger(Tester.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n\nWhat is the problem ? Why am I getting an exception ?" ]
[ "java", "cryptography" ]
[ "Ajax function call: parameter passing to controller function in codeigniter", "I am working on codeigniter. I am calling ajax function in a view page. Ajax \n function is calling controller method. Ajax function is containing 3 \n parameters which i want to pass to controller method but due to some reason i \n am not able to access parameter which is coming from ajax function.\n\nBelow is the my view code : \n\n<script> \n$('#drp').change(function(e){ \n var costcenter = $('#costcenter_id :selected').val(); \n var location1 = $('#location_id :selected').val(); \n var department = $('#department_id :selected').val(); \n $.ajax({\n cashe: false,\n type: 'POST',\n data: {'costcenterid':costcenter,'locationid':location1,\n 'departmentid':department},\n url: 'http://local.desk.in/mycontroller/contollerfunction',\nsuccess: function(data)\n {\n alert(\"success\");\n }\n });\n });\n </script>\n// controller method\npublic function controllerfunction($costcenterid,$locationid,$departmentid)\n {\n echo \"costcenter= \". $costcenterid; \n echo \"location= \". $locationid; \n echo \"department= \". $departmentid;\n }\n\n\n\n Getting error message : \n \n Message: Missing argument 1 for assetcontroller::controllerfunction(), \n Message: Missing argument 2 for assetcontroller::controllerfunction(), \n Message: Missing argument 3 for assetcontroller::controllerfunction()\n\n\nWhy not able to send ajax parameter values to controller method?? Thanks in \n advance" ]
[ "php", "codeigniter", "parameters", "codeigniter-3" ]
[ "Finding local maxima within an array with conditions [JS]", "I'm struggling to find a solution the following code challenge that meets all of the requirements and could use some help:\n\n\n var ex1 = [5, 5, 2, 1, *4*, 2, *6*, 2, 1, 2, 7, 7];\n // {pos:[4,6], peaks:[4,6] }\n var ex2 = [3, 2, 3, *6*, 4, 1, 2, *3*, 2, 1, 2, 3];\n // {pos:[3,7], peaks:[6,3]}\n var plateau = [1, *2*, 2, 2, 1];\n // {pos:[1],peaks[2]}\n\n \n \n Find the local maxima or \"peaks\" of a given array but ignore local\n maxima at the beginning and end of the array.\n If there is a \"plateau\", return the position and value at the \n beginning of the \"plateau.\"\n Any plateaus at beginning and end of the array should be ignored.\n \n\n\nMy proposed solution uses the reduce function to look at the elements in the array before and after the current element. If these values are less than the value of the current element, the current element is a peak. \"Peaks\" at the edges of the array are ignored because they do not satisfy either the first or second criteria.\n\nfunction pickPeaks(array) {\n return array.reduce((res, curr, i, arr) => {\n if(arr[i-1] < curr && curr > arr[i+1]) {\n res[\"pos\"] = res[\"pos\"] ? res[\"pos\"].concat([i]) : [i];\n res[\"peaks\"] = res[\"peaks\"] ? res[\"peaks\"].concat([curr]) : [curr];\n } \n return res;\n },{});\n}\n\n\nHowever, this solution fails to find plateaus.\n\nIf I change my \"right side\" conditional logic to curr >= arr[i+1] it finds plateaus but does not ignore \"edge\" plateaus like so:\n\nvar plateau = [1, *2*, 2, 2, 1];\n correct // {pos:[1],peaks[2]}\n var ex1 = [5, 5, 2, 1, *4*, 2, *6*, 2, 1, 2, *7*, 7];\n incorrect // {pos:[4,6,7], peaks:[4,6,10]}\n\n\nWhat am I missing here? How can I check if a \"plateau\" is at the edge of the array or not?" ]
[ "javascript", "arrays" ]
[ "How to update json null value using jsonb_set", "I have a nested json object. I want to use jsonb_set to update value of a property that currently is null. I have tried following.\n\nUPDATE database1\nSET foo = jsonb_set(foo, '{\"bar\",0}', '\"TEST1\"', true)\nWHERE foo #> '{\"bar\",0}' is null\n\n\nThis is not working, this solution works if the value is not null." ]
[ "sql", "postgresql", "jsonb" ]
[ "How to pass parameter value using HttpPost and NameValuePair in android when accessing rest web service?", "I made a rest web service with the service contract as shown below\n\n[OperationContract]\n[WebInvoke(Method = \"POST\",\n ResponseFormat = WebMessageFormat.Xml,\n BodyStyle = WebMessageBodyStyle.Wrapped,\n UriTemplate = \"postdataa?id={id}\"\n )]\nstring PostData(string id);\n\n\nImplementation of the method PostData\n\npublic string PostData(string id)\n {\n return \"You posted \" + id;\n }\n\n\nCode in Android to post data in web service\n\nHttpClient httpclient = new DefaultHttpClient();\n HttpHost target = new HttpHost(\"192.168.1.4\",4567);\n HttpPost httppost = new HttpPost(\"/RestService.svc/postdataa?\");\n\n String result=null;\n HttpEntity entity = null;\n\n try {\n // Add your data\n List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);\n nameValuePairs.add(new BasicNameValuePair(\"id\", \"1\"));\n UrlEncodedFormEntity ent = new UrlEncodedFormEntity(nameValuePairs);\n httppost.setEntity(ent);\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(target, httppost);\n entity = response.getEntity();\n //get xml result in string\n result = EntityUtils.toString(entity);\n\n} catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n } catch (IOException e) {\n // TODO Auto-generated catch block\n }\n\n\nThe problem is that the xml result shows and the value of the parameter is missing:\n\n<PostDataResponse xmlns=\"http://tempuri.org/\"><PostDataResult>You posted </PostDataResult></PostDataResponse>\n\n\nI do not know what went wrong." ]
[ "c#", "android", "wcf", "rest" ]
[ "Create temp table in SQLite if another table exists", "I need to create a temp table (which is a copy of Employees table) in a SQLite database, provided the table by the name of 'Employees' exists. There are only 2 columns in Employees table - EmployeeId (integer) and EmployeeName (varchar(100)).\n\nIs there any way to implement the above using SQLite SQL?\n\nPseudo-code for intended SQL, which does not work in SQlite is as below. I hope there was something as powerful as the pseudo-code below in SQLite.\n\n--if Employees table exists then create a temp table and populate it with all \n--rows from Employees table\nCREATE TEMP TABLE tempEmployees if exists Employees as select * from Employees;" ]
[ "sqlite", "cordova", "hybrid-mobile-app" ]
[ "Download MySQL queries from different tables as csv in PHP", "I have 2 tables as follows:\n\nTable 1 (TRIPLE_COGNAC)\n\nTRIPLE_ID,PDB_ID,FIRST_RESIDUE,FIRST_CHAIN,SECOND_RESIDUE,SECOND_CHAIN,THIRD_RESIDUE,THIRD_CHAIN,SEQUENCE\nTCOG_98084,3oww,A64,B,G7,A,C82,A,AGC\nTCOG_98085,3oww,G84,B,A41,A,G62,A,GAG\nTCOG_98086,3oww,G7,B,A64,A,C39,A,GAC\nTCOG_98087,3oww,U69,A,C70,A,G35,A,UCG\nTCOG_98088,3oww,G32,A,A71,A,A34,A,GAA\nTCOG_98089,3oww,A11,A,G73,A,C30,A,AGC\nTCOG_98090,3oww,A41,B,G84,A,C5,A,AGC\nTCOG_98091,3oww,C82,B,G7,B,A64,A,CGA\n...\n...\n...\n\n\nTable 2 (QUAD1_COGNAC)\n\nQUAD1_39435,3oww,C39,B,A64,B,G7,A,C82,A,CAGC\nQUAD1_39436,3oww,C5,B,G84,B,A41,A,G62,A,CGAG\nQUAD1_39437,3oww,C82,B,G7,B,A64,A,C39,A,CGAC\nQUAD1_39438,3oww,G62,B,A41,B,G84,A,C5,A,GAGC\n...\n...\n...\n\n\nI want to download rows in Table 1 and Table 2 where PDB_ID = 3oww as a csv file using PHP. I was able to do this but the output page is not quite what I wanted The current output is:\n\nTRIPLE_ID,PDB_ID,FIRST_RESIDUE,FIRST_CHAIN,SECOND_RESIDUE,SECOND_CHAIN,THIRD_RESIDUE,THIRD_CHAIN,SEQUENCE\nTCOG_98084,3oww,A64,B,G7,A,C82,A,AGC\nTCOG_98085,3oww,G84,B,A41,A,G62,A,GAG\nTCOG_98086,3oww,G7,B,A64,A,C39,A,GAC\nTCOG_98087,3oww,U69,A,C70,A,G35,A,UCG\nTCOG_98088,3oww,G32,A,A71,A,A34,A,GAA\nTCOG_98089,3oww,A11,A,G73,A,C30,A,AGC\nTCOG_98090,3oww,A41,B,G84,A,C5,A,AGC\nTCOG_98091,3oww,C82,B,G7,B,A64,A,CGA\n\n<br />\n<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/interrna/download- test.php:48) in <b>/Applications/XAMPP/xamppfiles/htdocs/interrna/download- test.php</b> on line <b>46</b><br />\n<br />\n<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/interrna/download-test.php:48) in <b>/Applications/XAMPP/xamppfiles/htdocs/interrna/download-test.php</b> on line <b>47</b><br />\nTRIPLE_ID,PDB_ID,FIRST_RESIDUE,FIRST_CHAIN,SECOND_RESIDUE,SECOND_CHAIN,THIRD_RESIDUE,THIRD_CHAIN,SEQUENCE,QUAD1_ID,PDB_ID,FIRST_RESIDUE,FIRST_CHAIN,SECOND_RESIDUE,SECOND_CHAIN,THIRD_RESIDUE,THIRD_CHAIN,FOURTH_RESIDUE,FOURTH_CHAIN,SEQUENCE\nQUAD1_39435,3oww,C39,B,A64,B,G7,A,C82,A,CAGC\nQUAD1_39436,3oww,C5,B,G84,B,A41,A,G62,A,CGAG\nQUAD1_39437,3oww,C82,B,G7,B,A64,A,C39,A,CGAC\nQUAD1_39438,3oww,G62,B,A41,B,G84,A,C5,A,GAGC\n\n\nI want to be able to download these as separate files according to the $names array. So file1 will be triple_cognac.csv containing the rows from Table1 while quad1_cognac.csv will contain rows from Table2. Can someone please help to correct the code?\n\nMy code:\n\n<?php\n// Make a MySQL Connection\n$conn = mysql_connect(\"localhost\",\"root\",\"\");\nmysql_select_db(\"2RNA\",$conn);\n\n$pdbid = $_GET['var'];\n\n//print $pdbid;\n\n$names = array(\n \"triple_cognac\" => \"TRIPLE_COGNAC\",\n \"quad1_cognac\" => \"QUAD1_COGNAC\",\n);\n\nforeach($names as $x => $x_value) {\n $file = $x;\n $tablename = $x_value;\n\n $sql1 = mysql_query(\"SELECT * from \". $tablename. \" where PDB_ID like '$pdbid'\");\n\n if(mysql_num_rows($sql1) == 0) \n { \n echo \"\";\n } \n else \n {\n //print $file .\" \". $tablename; \n //print \"</br>\"; \n\n $filename = $file.\".csv\";\n $fp = fopen('php://output', 'w');\n\n $query = \"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='2RNA' AND TABLE_NAME= '$tablename'\";\n $result = mysql_query($query);\n while ($row = mysql_fetch_row($result)) {\n $header[] = $row[0];\n } \n header('Content-type: application/csv');\n header('Content-Disposition: attachment; filename='.$filename);\n fputcsv($fp, $header);\n\n $num_column = count($header); \n $query2= \"SELECT * from \". $tablename. \" where PDB_ID like '$pdbid'\";\n $result2 = mysql_query($query2);\n while($row = mysql_fetch_row($result2)) {\n fputcsv($fp, $row);\n }\n } \n} \n//exit; \n?>" ]
[ "php", "mysql", "csv" ]
[ "How to use extended character set in reading ini file? (C++ lang.)", "I face one little problem. I am from country that uses extended character set in language (specifically Latin Extended-A due to characters like š,č,ť,ý,á,...).\n\nI have ini file containing these characters and I would like to read them into program. Unfortunatelly, it is not working with getPrivateProfileStringW or ...A.\n\nHere is part of source code. I hope it will help someone to find solution, because I am getting a little desperate. :-)\n\nSOURCE CODE:\n\nwchar_t pcMyExtendedString[200]; \n\nGetPrivateProfileStringA(\n \"CATEGORY_NAME\",\n \"SECTION_NAME\",\n \"error\",\n pcMyExtendedString,\n 200,\n PATH_TO_INI_FILE\n );\n\n\nINI FILE:\n\n [CATEGORY_NAME]\n SECTION_NAME= ľščťžýáíé\n\n\nCharacters ý,á,í,é are readed correctly - they are from character set Latin-1 Supplement. Their hexa values are correct (0xFD, 0xE1, 0xED,...).\n\nCharacters ľ,š,č,ť,ž are readed incorrectly - they are from character set Latin Extended-A Their hexa values are incorrect (0xBE, 0x9A, 0xE8,...). Expected are values like 0x013E, 0x0161, 0x010D, ...\n\nHow could be this done? Is it possible or should I avoid these characters at all?" ]
[ "c++", "winapi", "unicode", "character", "ini" ]
[ "How to remove li from ul within a div", "I have a div, where in i do have a ul, where the ul has some li.\n\ni just want to find some text and remove the li from the ul.\n\nsuppose eg: \n\n<div id=\"div1\">\n <ul>\n <li>Hello</li> <!--i need to remove this.-->\n </ul>\n</div>" ]
[ "javascript" ]
[ "Change Sydney Date Time to GMT in PHP", "I have a string which contains the date/time in it and i know its currently in Australia/Sydney timezone. \n\nI now need to change it to GMT time.\n\nI tried this, but its not changing the date:\n\n$dateString = '2012-06-29 11:09:12'; // this is in Australia/Sydney timezone\n$gmtDate = gmdate('Y-m-d H:i:s', strtotime($dateString));\nprint_r($gmtDate); // output is 2012-06-29 11:09:12\n\n\nHow do I subtract the offset somehow from gmt, sorry, getting a little confused." ]
[ "php", "datetime" ]
[ "fallocate vs posix_fallocate", "I am debating which function to use between posix_fallocate and fallocate. \nposix_fallocate writes a file right away (initializes the characters to NULL). However, fallocate does not change the file size (when using FALLOC_FL_KEEP_SIZE flag). Based on my experimentation, it seems that fallocate does not write NULL or zero characters to the file.\n\nCan someone please comment based on your experience? Thanks for your time." ]
[ "c++", "c", "posix" ]
[ "setting height of divs to window height", "I have four divs with different IDs. How would I set height for all these divs?\n\n<div id=\"slide-1\">a</div>\n<div id=\"slide-2\">b</div>\n<div id=\"slide-3\">c</div>\n<div id=\"slide-4\">d</div>\n\n\nI know we can do something like this below, but there are other divs too before this.\n\n$('div').height($(window).height());\n\n\nI want to set these four divs to window height alone. I can't hard-code here as the slides may vary." ]
[ "javascript", "jquery", "html" ]
[ "How to make part of a function only execute once until it's allowed to do otherwise", "How can I call a javascript function (repeatedFunction()) repeatedly but make it so that, let's say an alert(\"This function is being executed for the first time\"), is only activated the first time that repeatedFunction() is, but the //other code is always activated? And also, how can I make the alert() allowed to be activated for one more time, like if the repeatedFunction() was being executed for the first time again?" ]
[ "javascript", "function" ]
[ "Running a macro a dynamic # of times", "I have a user form where users can enter values in a text field which get put into a list box, which will always be a dynamic number of entries. When they select \"Done\" how do I get VBA to recognize each line separately? \n\nThey are entering property names and I have a code that says copy template x number of times and rename each as the value which has been entered. \n\nI was trying to say:\n\nDim cellNumber As Integer\nDim property As ListBox.Items\n\ncellNumber = 11 \nFor Each property In ListBox1\n Range(\"B\" & cellNumber).Value = property\n\n 'copying template and renaming it\n Sheets(\"Template\").Copy After:=Sheets(\"Template\")\n ActiveSheet.Name = property" ]
[ "excel", "vba", "listbox", "listboxitem" ]
[ "Check two id's on button press", "This is my current code:\n\n<script>\n$('#register').click(function (e) {\n if ($('#company_f').val().length == 0) {\n $('#company_f').css(\"border\", \"solid 1px red\");\n return false; // or e.preventdefault();\n }\n});\n</script>\n\n\nHow can i changed this code to check for id company_f and telephone_f? This is what i've tried:\n\nif ($('#company_f').val().length == 0 OR ($('#telephone_f').val().length == 0 ) {" ]
[ "javascript", "jquery" ]
[ "high availability replicated servers, tomcat session lost. Firefox and chrome use 60 segs as TTL and don't respect DNS defined TTL", "I have 4 servers for an http service defined on my DNS servers:\n\napp.speednetwork.in. IN A 63.142.255.107\napp.speednetwork.in. IN A 37.247.116.68\napp.speednetwork.in. IN A 104.251.215.162\napp.speednetwork.in. IN A 192.121.166.40\n\n\nfor all of them the DNS server specify a TTL (time to live) of more than 10 hours:\n\n$ttl 38400\n\n\nspeednetwork.in. IN SOA plugandplay.click. info.plugandplay.click. (\n 1454402805\n 3600\n 3600\n 1209600\n 38400 )\n\nFirefox ignore TTL and make a new DNS query after each 60 secs, as seen on\nabout:config -> network.dnsCacheExpiration 60 and on about:networking -> DNS.\nChrome shows here chrome://net-internals/#dns a correct cached dns entry, with more that 10 hours until Expired:\n\n apis.google.com IPV4 216.58.210.174 2016-04-12 11:07:07.618 [Expired]\napp.speednetwork.in IPV4 192.121.166.40 2016-04-12 21:45:36.592\n\n\nbut ignore this entry and every minute requery the dns as discussed https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/655ZTdxTftA and seen on chrome://net-internals/#events\n\nThe conclusion and the problem: every minute both browsers query dns again, receive a new IP from the 4 configured on DNS, go for a new IP/server and LOST THE TOMCAT SESSION.\n\nAs config every user browser is not an option, my question is:\n\n1) There is some other DNS config I can use for high availability?\n\n2) There is some http header I can use to instruct the browsers to continue using the same IP/server for the day?" ]
[ "google-chrome", "http", "firefox", "dns", "high-availability" ]
[ "How to set text alignment in dynamically created FixedDocument", "I am creating a report through FixedDocument and I am doing it in the code behind to dynamically add data to the report.\nI started using FixedDocument today and got stuck in aligning texts. It does not seem to center align. Here's my code:\nusing System.Windows.Documents;\n....\npublic void GenerateReport()\n{\n FixedDocument document = new FixedDocument();\n PageContent content = new PageContent();\n\n FixedPage page = new FixedPage();\n page.Width = document.DocumentPaginator.PageSize.Width;\n page.Height = document.DocumentPaginator.PageSize.Height;\n page.Background = System.Windows.Media.Brushes.AliceBlue;\n\n //header first line\n System.Windows.Controls.Canvas canvas = new System.Windows.Controls.Canvas();\n canvas.Width = document.DocumentPaginator.PageSize.Width;\n\n FixedPage.SetTop(canvas, 15);\n FixedPage.SetLeft(canvas, 15);\n\n System.Windows.Controls.TextBlock block = new System.Windows.Controls.TextBlock();\n block.FontSize = 11;\n block.FontWeight = FontWeights.Bold;\n block.FontFamily = new System.Windows.Media.FontFamily("Tahoma");\n block.Text = "This is the first line";\n block.HorizontalAlignment = HorizontalAlignment.Center;\n \n canvas.Children.Add(block);\n\n page.Children.Add(canvas);\n\n //header second line\n System.Windows.Controls.TextBlock block2 = new System.Windows.Controls.TextBlock(); block.FontSize = 11;\n block2.FontWeight = FontWeights.Bold;\n block2.FontFamily = new System.Windows.Media.FontFamily("Tahoma");\n block2.Text = "Daily Report";\n\n var canvas2 = new System.Windows.Controls.Canvas();\n canvas2.Children.Add(block2);\n\n FixedPage.SetTop(canvas2, 30);\n FixedPage.SetTop(canvas2, 30);\n FixedPage.SetLeft(canvas2, 15);\n FixedPage.SetRight(canvas2, 15);\n\n canvas2.Width = document.DocumentPaginator.PageSize.Width;\n \n page.Children.Add(canvas2);\n\n ((IAddChild)content).AddChild(page);\n document.Pages.Add(content);\n}\n\n\nHow will I do the alignment right?" ]
[ "c#", "documentviewer", "fixeddocument" ]
[ "jQuery overlay click event trigger navigation click", "I've got an overlay set over an image that I'd like to act as previous and next controls. The code below worked fine until I implemented the History.js plugin.. now things are a little funky and I'm not sure why. Chrome's console shows no errors, but the image isn't toggling appropriately.\n\nThanks for your help.\n\nTest site: http://brantley.dhut.ch/\n\nJavaScript:\n\n$(\"#ol\").click(function(e) {\n e.preventDefault();\n $('a.prev').click();\n});\n$(\"#or\").click(function(e) {\n e.preventDefault();\n $('a.next').click();\n});" ]
[ "javascript", "jquery", "click", "slideshow", "history.js" ]
[ "stanford parse bash script error - linux bash", "Can someone help me check my bash script? i'm trying to feed a directory of .txt files to the stanford parser (http://nlp.stanford.edu/software/pos-tagger-faq.shtml) but i can't get it to work. i'm working on ubuntu 10.10\n\nthe loop is working and reading the right files with:\n\n#!/bin/bash -x\ncd $HOME/path/to\nfor file in 'dir -d *'\ndo\n# $HOME/chinesesegmenter-2006-05-11/segment.sh ctb $file UTF-8\n echo $file\ndone\n\n\nbut with\n\n#!/bin/bash -x\ncd $HOME/yoursing/sentseg_zh\nfor file in 'dir -d *'\ndo\n# echo $file\n $HOME/chinesesegmenter-2006-05-11/segment.sh ctb $file UTF-8\ndone\n\n\ni'm getting this error:\n\nalvas@ikoma:~/chinesesegmenter-2006-05-11$ bash segchi.sh\nStandard: CTB\nFile: dir\nEncoding: -d\n-------------------------------\nException in thread \"main\" java.lang.NoClassDefFoundError: edu/stanford/nlp/ie/crf/CRFClassifier\nCaused by: java.lang.ClassNotFoundException: edu.stanford.nlp.ie.crf.CRFClassifier\n at java.net.URLClassLoader$1.run(URLClassLoader.java:217)\n at java.security.AccessController.doPrivileged(Native Method)\n at java.net.URLClassLoader.findClass(URLClassLoader.java:205)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:321)\n at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)\n at java.lang.ClassLoader.loadClass(ClassLoader.java:266)\nCould not find the main class: edu.stanford.nlp.ie.crf.CRFClassifier. Program will exit.\n\n\nthe following command works:\n\n~/chinesesegmenter-2006-05-11/segment.sh ctb ~/path/to/input.txt UTF-8\n\n\nand output this\n\nalvas@ikoma:~/chinesesegmenter-2006-05-11$ ./segment.sh ctb ~/path/to/input.txt UTF-8\nStandard: CTB\nFile: /home/alvas/path/to/input.txt\nEncoding: UTF-8\n-------------------------------\nLoading classifier from data/ctb.gz...done [1.5 sec].\nUsing ChineseSegmenterFeatureFactory\nReading data using CTBSegDocumentReader\nSequence tagging 7 documents\n如果 您 在 新加坡 只 能 前往 一 间 俱乐部 , 祖卡 酒吧 必然 是 您 的 不二 选择 。\n\n\n作为 或许 是 新加坡 唯一 一 家 国际 知名 的 夜店 , 祖卡 既 是 一 个 公共 机构 , 也 是 狮城 年轻人 选择 进行 成人 礼等 庆祝 的 不二场所 。" ]
[ "java", "bash", "nlp", "stanford-nlp" ]
[ "Grid layout break within dom-repeat", "Within a polymer element I am trying to build a simple multi-column layout with lost-grid to render a list of items using dom-repeat. It looks like this: \n\n\nHTML\n\n<div class=\"grid\"> \n <template is=\"dom-repeat\" items=\"{{data}}\">\n <div class=\"grid__col\">Example Content</div>\n </template>\n</div>\n\n\n\nCSS\n\n.grid {\n lost-utility: clearfix;\n lost-center: 100%;\n position: relative;\n}\n.grid__col {\n lost-column: 1/2 2 0px; \n}\n\n\n\nFor example if the data array assigned to dom-repeat has 4 items, the following HTML is rendered: \n\n<div class=\"grid\"> \n <div class=\"grid__col\">Example Content</div>\n <div class=\"grid__col\">Example Content</div>\n <div class=\"grid__col\">Example Content</div>\n <div class=\"grid__col\">Example Content</div>\n</div>\n\n\nInstead of displaying the columns at 50% width, the layout breaks and they are stacked on top of each other. If I remove the dom-repeat and list the 4 columns manually, it works. In both cases the code is the same in the end, so I'm guessing the rendering of the template somehow messes with the total width the columns can take up. \n\nAnother thing to note is that when using the exact same code inside a dom-bind template directly in the body of the page (outside of a polymer element but using dom-repeat), it works." ]
[ "css", "polymer", "polymer-1.0" ]
[ "Can I use a rightSwipeGestureRecognizer for a content page?", "I have an application that I am looking at. Currently it has this:\n\nC# code\n\nnamespace Japanese\n{\n public partial class PhrasesPage : ContentPage\n public PhrasesFrame phrasesFrame = new PhrasesFrame();\n\n public PhrasesPage()\n {\n InitializeComponent();\n }\n\n protected override void OnAppearing()\n {\n base.OnAppearing();\n phrasesStackLayout.Children.Add(phrasesFrame);\n\n\nXAML\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ContentPage xmlns=\"http://xamarin.com/schemas/2014/forms\" \n xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\" \n xmlns:local=\"clr-namespace:Japanese;assembly=Japanese\"\n x:Class=\"Japanese.PhrasesPage\"\n x:Name=\"PhraseContentPage\">\n <ContentPage.Content>\n <StackLayout x:Name=\"phrasesStackLayout\">\n </StackLayout>\n </ContentPage.Content>\n</ContentPage>\n\n\nAnd then inside of that:\n\nC# code\n\nnamespace Japanese\n{\n public partial class PhrasesFrame : Frame\n\n\nXAML\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Frame xmlns=\"http://xamarin.com/schemas/2014/forms\" \n xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\" \n x:Class=\"Japanese.PhrasesFrame\" HorizontalOptions=\"FillAndExpand\" VerticalOptions=\"FillAndExpand\" BackgroundColor=\"Transparent\" Padding=\"0\" HasShadow=\"false\">\n <StackLayout x:Name=\"phrasesFrameStackLayout\" HorizontalOptions=\"FillAndExpand\" VerticalOptions=\"FillAndExpand\">\n\n\nThere's a custom renderer for the frame that implements rightSwipeGestureRecognizer\n\n[assembly: ExportRenderer(typeof(PhrasesFrame), typeof(PhrasesFrameCustomRenderer))]\nnamespace Japanese.iOS\n{\npublic class PhrasesFrameCustomRenderer : FrameRenderer\n{\n UISwipeGestureRecognizer leftSwipeGestureRecognizer;\n UISwipeGestureRecognizer rightSwipeGestureRecognizer;\n PhrasesFrame frame;\n bool rightSwipeEnabled = false;\n\n protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)\n {\n base.OnElementChanged(e);\n\n frame = Element as PhrasesFrame;\n\n rightSwipeGestureRecognizer = new UISwipeGestureRecognizer();\n rightSwipeGestureRecognizer.Direction = UISwipeGestureRecognizerDirection.Right;\n rightSwipeGestureRecognizer.NumberOfTouchesRequired = 1;\n rightSwipeGestureRecognizer.AddTarget((obj) =>\n { });\n\n\nMy question is, do I need to have a frame inside of the content page to implement a SwipeGestureRecognizer?" ]
[ "xamarin", "xamarin.forms" ]
[ "rootElement.appendChild(childElement) after xml comment", "I have comments in my xml file, call it X. I am taking from another xml file, Y, and I want place the Elements under the correct comments in X. I am using the java appendChild method. The \"rootElement\" in this case will be dependencies. It is placing the childElement at the bottom of the rootElement tag in X. Is it possible to do this?\n\n<dependencies defaultconf=\"compile\" defaultconfmapping=\"*->default\">\n <!--COMPILE-->\n <!-- Compile dependencies are available in all classpaths of a project. -->\n <!-- These dependencies are included in the war's WEB-INF/lib and are propagated to dependent projects. -->\n <!-- This is the default config and is used if no config is specified. -->\n\n <!--PROVIDED-->`\n <!-- This is much like compile, but indicates you expect the JDK or the tomcat container to provide the dependency at runtime. -->\n <!-- This scope is only available on the compilation and test classpaths, and is not transitive. -->\n <!-- NOTE: You must add conf=\"provided\" to the dependency -->" ]
[ "java", "xml" ]
[ "php - how to sort all elements of array except one", "I am looking for elegant way to sort two of three values stored in one array. The third one can be ignored but i dont want to loose it (so unseting is not an option).\n\nImagine such array:\n\n$r = Array(\"tree_type\" => 1, \"tree_height\" = 5, \"tree_age\" = 2);\n\n\nIf tree_height is bigger then it's age i want to swap tree height with tree_age, so tree height is always smaller number then age.\n\nNow I am sorting it like this:\n\nif ( $r['tree_height'] > $r['tree_age'] ) {\n $tmp = $r['tree_height'];\n $r['tree_height'] = $r['tree_age'];\n $r['tree_age'] = $tmp;\n}\n\n\nIt works perfectly fine, but i am looking for more elegant way. The best solution would be sth like this:\n\nfname($r, $r['tree_height'], $r['tree_age']);\n\n\nfname would always swap second argument with third if it's bigger then third, otherwise would do nothing.\n\nAny advice would be appreciated.\nKalreg.\n\nANSWER:\n\nThe shortest answer, without condition is:\n\n$tmp = Array($r['tree_height'], $r['tree_age'])\nsort($tmp);" ]
[ "php", "arrays", "sorting" ]
[ "Find if a procedure is running in another form", "I have a form X with the following procedure:\n\nPublic Sub PrintUT_Click()\n\nIf Forms!frmDisclosure.Command280.Visible = True Then\n Forms!frmDisclosure.GoToLastRecord\nEnd If\n\nRemoveSchma\nDoCmd.TransferText acExportMerge, \"\", \"qryUndertaking\", conAddrPth & \"\\DataSource.txt\", True, \"\", 1252\nOpenWordDoc\n\nExecuteFile \"E:\\Peter\\Desktop\\Update Service.pdf\", printfile\n\nEnd Sub\n\n\nIt is called from another form (form Y) from one of two command buttons. If called fom one button I want 'ExecuteFile \"E:\\Peter\\Desktop\\Update Service.pdf\", printfile' to run. If called from the other button, I don't want 'Exceute...' to run. What 'If... Then' prodecure can I set up in form X to achive this?" ]
[ "ms-access", "vba" ]
[ "Reduce computing time for reshape", "I have the following dataset, which I would like to reshape from wide to long format:\n\nName Code CURRENCY 01/01/1980 02/01/1980 03/01/1980 04/01/1980\nAbengoa 4256 USD 1.53 1.54 1.51 1.52 \nAdidas 6783 USD 0.23 0.54 0.61 0.62 \n\n\nThe data consists of stock prices for different firms on each day from 1980 to 2013. Therefore, I have 8,612 columns in my wide data (and a abou 3,000 rows). Now, I am using the following command to reshape the data into long format:\n\nlibrary(reshape)\ndata <- read.csv(\"data.csv\")\ndata1 <- melt(data,id=c(\"Name\",\"Code\", \"CURRENCY\"),variable_name=\"Date\")\n\n\nHowever, for .csv files that are about 50MB big, it already takes about two hours. The computing time shouldn't be driven by weak hardware, since I am running this on a 2.7 GHz Intel Core i7 with 16GB of RAM. Is there any other more efficient way to do this?\n\nMany thanks!" ]
[ "performance", "r", "reshape" ]
[ "StAX - reading base64 string from xml into db", "I'm using StAX to read my file, which has some Base64 data in it, and saving it into the db using Hibernate.\n\nXML:\n\n<root>\n <base64>lololencoded12</base64>\n <base64>encodedlolos32</base64>\n ...............................\n</root>\n\n\nCode to read and save:\n\nxmlif = (XMLInputFactory2) XMLInputFactory2.newInstance();\nxmlif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);\nxmlif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);\nxmlif.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE); \nxmlif.configureForLowMemUsage();\n\nList<Entity> entities = new ArrayList();\nFileInputStream fis = new FileInputStream(filename);\nXMLStreamReader2 xmlr = (XMLStreamReader2) xmlif.createXMLStreamReader(filename, fis);\nint eventType = xmlr.getEventType();\nString curElement = \"\";\nwhile (xmlr.hasNext()) {\n eventType = xmlr.next();\n switch (eventType) {\n case XMLEvent.START_ELEMENT:\n curElement=xmlr.getName().toString();\n if (\"base64\".equals(curElement)) {\n Entity entity = new Entity();\n entity.setBase64(xmlr.getElementText().getBytes());\n session.save(entity);\n session.flush();\n }\n break;\n }\n }\n iterator itr = entities.iterator();\n while (itr.hasNext()) {\n Entity e = (Entity)itr.next(); \n session.saveOrUpdate(e);\n }\n\n\nThis approach gobbles memory in amount that is 6-9 times size of my xml. How can i improve this?\n\nEDIT\n\nIf i comment out entity.setBase64() everything is fine. When saving byte[] to db memory usage goes bonkers. Why?\n\nEDIT\nEntity getters and setters:\n\n //for me\n public byte[] getBase64() {\n return base64;\n }\n\n public void setBase64(byte[] base64) {\n this.base64= base64;\n }\n\n\n //for hibernate\n public Blob getBase64Blob() {\n if (this.base64!=null) {\n LobCreator lobok =Hibernate.getLobCreator(MainFrame.sessionFactory.getCurrentSession());\n return lobok.createBlob(base64);\n } else {\n return null;\n }\n }\n\n public void setBase64Blob(Blob dataBlob) {\n if (dataBlob!=null) {\n this.base64= toByteArray(dataBlob);\n }\n } \n\n //utilities methods from blob to byte array \n private byte[] toByteArray(Blob fromBlob) {\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n try {\n return toByteArrayImpl(fromBlob, baos);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } catch (IOException e) {\n throw new RuntimeException(e);\n } finally {\n if (baos != null) {\n try {\n baos.close();\n } catch (IOException ex) {\n }\n }\n }\n }\n\n private byte[] toByteArrayImpl(Blob fromBlob, ByteArrayOutputStream baos)\n throws SQLException, IOException {\n byte[] buf = new byte[4000];\n InputStream is = fromBlob.getBinaryStream();\n try {\n for (;;) {\n int dataSize = is.read(buf);\n if (dataSize == -1)\n break;\n baos.write(buf, 0, dataSize);\n }\n } finally {\n if (is != null) {\n try {\n is.close();\n } catch (IOException ex) {\n }\n }\n }\n return baos.toByteArray();\n }\n\n\nEDIT\nxmlr.getElementText().getBytes() causes a lot of memory usage for some reason." ]
[ "java", "xml", "hibernate", "sax", "stax" ]
[ "Loader interceptor hides the loader before getting response in angular", "I am showing a loading bar using HTTP interceptor in my angular project that shows loader whenever an HTTP request is sent to the serve.\n\nloader.service.ts\n\nimport { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LoaderService {\n\n isLoading = new Subject<boolean>();\n\n constructor() { }\n\n show() {\n\n this.isLoading.next(true);\n }\n\n hide() {\n\n this.isLoading.next(false);\n }\n\n}\n\n\nloader-interceptor.ts\n\nimport { Injectable } from '@angular/core';\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { finalize } from 'rxjs/operators';\n\nimport { LoaderService } from '../services/loader.service';\n\n@Injectable()\nexport class LoaderInterceptorService implements HttpInterceptor {\n\n constructor(private loaderService: LoaderService) { }\n\n intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n\n this.loaderService.show();\n return next.handle(request).pipe( finalize( () => this.loaderService.hide()) );\n }\n\n}\n\n\nProblem is that loader hides before the data has been loaded. This happens especially if there is a lot of data. I want the loader not to hide unless all the requests have been resolved so that's user is not able to interact with forms etc. unless the data is loaded. The loader HTML uses overlay CSS to block users to interact with forms until data has arrived.\n\nIn another project, I used to do call these hide/show methods in service calls when I was subscribing to the service methods in every component. I want to avoid this because this requires me to add this code again and again in every component.\n\nAny solution for this problem ?\n\nPS:\nIs it problematic to handle loader when there are multiple HTTP requests in different components simultaneously ?" ]
[ "angular" ]
[ "can't play sounds in a loop - android", "When I play sound not in a loop it's work fine, but when I try to so it in loop or more than once it's not play at all.\n\nMy sounds class:\n\npublic class GameSounds {\n private SoundPool soundPool;\n private HashMap soundPoolHashMap;\n Context mContext;\n\n public GameSounds() {\n soundPool = new SoundPool(4, AudioManager.STREAM_MUSIC, 0);\n soundPoolHashMap = new HashMap();\n }\n\n /**\n * \n * @param index is the ID *we* choose for this sound\n * @param soundID is the id of the sound file in our resurce\n * @param context - our resurce is in this context\n */\n public void addSound(int index, int soundID, Context context) {\n //we call the \"load\" function in order to convert the sound in the soundID to raw\n //and to insert the ID that return from \"load\" to soundPoolID\n int soundPoolID = soundPool.load(context, soundID, 1);\n\n mContext = context;\n //insert new value to the hash\n soundPoolHashMap.put(index, soundPoolID);\n }\n\n /**\n * \n * @param index - the sound code we want to sound\n * @param loop - whether to sound this sound in infintly loop\n */\n public void play(int index, boolean loop) {\n SharedPreferences preferences=PreferenceManager.getDefaultSharedPreferences(mContext);\n\n if(preferences.getBoolean(\"isMuted\", false)){\n if (!loop)\n //the \"1\" is for highest volum\n soundPool.play((Integer) soundPoolHashMap.get(index), 1, 1, 1, 0, 1f);\n else\n soundPool.play((Integer) soundPoolHashMap.get(index), 1, 1, 1, -1, 1f); //even when I write 10 instead of -1 , it is not do anything...\n }\n }\n public void stop(int index) {\n soundPool.stop((Integer) soundPoolHashMap.get(index));\n }\n\n public void release() {\n soundPool.release();\n }\n}\n\n\nNow , this is how I play my sounds : \n\n gameSounds.play(this.gameLevel.music,false); //work good - one time\n gameSounds.play(this.gameLevel.music,true); //not work at all\n\n\nWhat can be the reason? Thanks!" ]
[ "android", "audio" ]
[ "Hide a folder from the URI with RewriteRule in a .htaccess file", "I would really appreciate if you could help me building my .htaccess file.\nWhat I want to achieve here is moving all of my domain's files and folders to a root subfolder (\"mydomain\") and make sure that the URL visible to my visitors still looks like \n\ndomain.com/file.extention \n\n\ninstead of \n\ndomain.com/mydomain/file.extention \n\n\nor \n\ndomain.com/subfolder/file.extention\n\n\ninstead of \n\ndomain.com/mydomain/subfolder/file.extention\n\n\nThis is my folders tree: \n\n/\n /mydomain\n /subfolder\n index.php\n test.php\n\n\nand here is my current .htaccess file: \n\n<IfModule mod_rewrite.c>\n\n# System symbolic links are allowed.\nOptions +FollowSymlinks\n\n# Runtime rewriting engine enabled.\nRewriteEngine On\n\n#\n# BEGIN DOMAIN\n#\n\n# Make 'mydomain' subfolder the root folder for the domain.\nRewriteCond %{HTTP_HOST} ^((www\\.)?domain\\.com) [NC]\nRewriteRule ^\\/?$ mydomain/ [NC,L,S=1]\n\nRewriteCond %{HTTP_HOST} ^(www\\.)?domain\\.com$ [NC]\nRewriteCond %{REQUEST_URI} !^/?mydomain/ [NC]\nRewriteCond %{REQUEST_FILENAME} !-f \nRewriteCond %{REQUEST_FILENAME} !-d \nRewriteRule ^(.+)$ mydomain/$1 [NC,L]\n\n#\n# END DOMAIN\n#\n\n</IfModule>\n\n\nThe problem here is that it works when I browse for \n\ndomain.com/subfolder/\n\n\nbut not with \n\ndomain.com/subfolder\n\n\nand with \n\ndomain.com/index.php\n\n\nbut not with \n\ndomain.com/test.php\n\n\nThank you all,\nMatteo" ]
[ "apache", ".htaccess", "mod-rewrite", "url-rewriting", "url-rewrite-module" ]
[ "profile completness meter in cakephp 2.0", "I have to display profile completness meter in cakePHP 2.0. I have found several but not find any script for it. If any one know any script for this in php or cakephp 2.0. please help me.\n\nthanks in advance..:)" ]
[ "php", "cakephp-2.0" ]
[ "How to copy value from one list to another list having different objects", "I have MaterailInfo and StyleInfo, I want to set styleDescription based on StyleNumber matching with materialNumber. I am using 2 for loops, is there any alternative solution?\n\nMaterailInfo:\n\nclass MaterailInfo {\n private String materialNumber;\n private String materialDescription;\n\n public MaterailInfo(String materialNumber, String materialDescription) {\n this.materialNumber = materialNumber;\n this.materialDescription = materialDescription;\n }\n\n // getter setter methods\n\n}\n\n\nStyleInfo:\n\nclass StyleInfo {\n private String StyleNumber;\n private String styleDescription;\n\n public StyleInfo(String styleNumber, String styleDescription) {\n StyleNumber = styleNumber;\n this.styleDescription = styleDescription;\n }\n\n // getter setter toString methods\n\n}\n\n\nTEst12:\n\npublic class TEst12 {\n\n public static void main(String[] args) {\n List<MaterailInfo> mList = new ArrayList<MaterailInfo>();\n mList.add(new MaterailInfo(\"a\", \"a-desc\"));\n mList.add(new MaterailInfo(\"b\", \"b-desc\"));\n mList.add(new MaterailInfo(\"c\", \"c-desc\"));\n\n List<StyleInfo> sList = new ArrayList<StyleInfo>();\n sList.add(new StyleInfo(\"a\", \"\"));\n sList.add(new StyleInfo(\"b\", \"\"));\n sList.add(new StyleInfo(\"c\", \"\"));\n\n for (MaterailInfo m : mList) {\n for (StyleInfo s : sList) {\n if (s.getStyleNumber().equals(m.getMaterialNumber())) {\n s.setStyleDescription(m.getMaterialDescription());\n }\n }\n }\n\n System.out.println(sList);\n }\n}" ]
[ "java" ]
[ "Asp.Net Web api Including nested items slowing it down", "I'm having performance issue while including multiple nested items. My model looks like below\n public class Orders \n{\n [Key]\n public int InvoiceNumber { get; set; }\n public ShopInfo Shops { get; set; }\n public int TotalSale { get; set; }\n public int TotalProfit { get; set; }\n public int TotalRecover { get; set; }\n public List<ShopOrder> ShopOrdersList { get; set; }\n}\npublic class ShopInfo\n{\n [Key]\n public int ShopInfoId { get; set; }\n public int ShopId { get; set; }\n public string ShopName { get; set; }\n public string Address { get; set; }\n public string OwnerName { get; set; }\n public string OwnerCnic { get; set; }\n public string Area { get; set; }\n public string PhoneNumber { get; set; }\n}\npublic class ShopOrder\n{\n [Key]\n public int ShopOrderId { get; set; }\n public DateTime BookingDate { get; set; }\n public DateTime DeliveryDate { get; set; }\n public string OrderBooker { get; set; }\n public string DeliveryMan { get; set; }\n public byte[] Signature { get; set; }\n public bool IsDelivered { get; set; }\n public bool IsAccepted { get; set; }\n public bool IsPaymentAdded { get; set; }\n public int TotalPrice { get; set; }\n public int TotalQuantity { get; set; }\n public int TotalProfit { get; set; } \n public string UserId { get; set; }\n public string Status { get; set; }\n public List<OrderSummary> OrderSummaries { get; set; }\n}\npublic class OrderSummary \n{\n [Key]\n public int OrderSummaryId { get; set; }\n public ProductInfo Products { get; set; }\n public int Quantity { get; set; }\n public int TotalPrice { get; set; }\n public bool IsNew { get; set; }\n}\npublic class ProductInfo\n{\n [Key]\n public int ProductInfoId { get; set; }\n public int ProductId { get; set; }\n public string ProductName { get; set; }\n public string Detail { get; set; }\n public int Price { get; set; }\n \n public int Ctns { get; set; }\n public int PcsInCtn { get; set; }\n public int OnePcsPurchasePrice { get; set; }\n}\n\nAnd I'm fetching it by using\n public IQueryable<Orders> GetOrders()\n {\n return db.Orders.Include(z=>z.Shops).Include("ShopOrdersList.OrderSummaries.Products");\n }\n\nIt take 30 seconds just to fetch 1 order. Everything works fine until including "OrderSummaries". Before Including "OrderSummaries" I fetch data within a second. Is there is any way to overcome performance issue. Thanks in advance." ]
[ "asp.net", "asp.net-mvc", "asp.net-core", "asp.net-mvc-4", "asp.net-web-api" ]
[ "How do you access all CalDAV calendars/events on OSX?", "I want to access all the calendars that a user can see in iCal on OS X. I know about EventKit and CalendarStore. However, it seems that both of those frameworks omit CalDAV delegate calendars (which are visible in iCal). Others have noticed this as well:\n\nhttp://openradar.appspot.com/7077307\n\nGoogle Delegates on Calendar Framework / EventKit\n\nSo if EventKit and CalendarStore don't do this, how does one proceed?" ]
[ "cocoa", "eventkit", "calendar-store" ]
[ "How to determine the concrete class from the Type interface in Java?", "I hava a class following:\n\nMyClass implements Serializable, Iterable<MyAnotherClass> {\n snip\n}\n\n\nI made following codes to get \"MyAnotherClass\" class from an instance of MyClass.\nThese work well but I feel it's not cool because I'm using \"instanceof\" operator even getting \"Type\" of interfaces.\nDoes anyone have better idea without using instanceof operator?\n\nObject instance = (Object)new MyClass();\nClass<?> iteratorParamClass = null;\nType[] interfaceTypes = instance.getClass().getGenericInterfaces();\nfor (Type type : interfaceTypes) {\n if (type instanceof ParameterizedType) { // ★This is not cool.\n Type rawType = ((ParameterizedType) type).getRawType();\n if (Iterable.class == (Class<?>) rawType) {\n iteratorParamClass = (Class<?>) (((ParameterizedType) type).getActualTypeArguments())[0];\n }\n }\n}\n\n\nI am happy if the Type interface had a method like \n\"Class<?> getConcreteClass()\"." ]
[ "java" ]
[ "what is c:out used for in jsp", "I have seen something like \n\n<c:out something\n\n</c:out>\n\n\nwhat is this used for" ]
[ "java", "jsp" ]
[ "Can't find how to load the library that contains Get-MsolUser", "I try to use Get-MsolUser; I get the Following message:\n\n\n Get-MsolUser : Le terme «Get-MsolUser» n'est pas reconnu comme nom\n d'applet de commande, fonction, fichier de script ou programme\n exécutable.\n\n\nIn english :\n\n\n Get-MsolUser : The term 'Get-MsolUser' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\n\n\nHow can I get my hands on whatever package contains this cmdlet?" ]
[ "azure", "powershell", "azure-active-directory" ]
[ "How to remove files and directories quickly via terminal (bash shell)", "From terminal window: \n\nWhen I use the rm command it can only remove files.\nWhen I use the rmdir command it only removes empty folders. \n\nIf I have a directory nested with files and folders within folders with files and so on, is there any way to delete all the files and folders without all the strenuous command typing? \n\nIf it makes a difference, I am using the mac bash shell from terminal, not Microsoft DOS or linux." ]
[ "file", "terminal", "directory", "rm", "rmdir" ]
[ "EditText with only numbers,comma,dot", "I have been create an edittext in my xml file.HEre is my code:\n\n <EditText\n android:id=\"@+id/IpAdress\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"\n android:inputType=\"numberDecimal\"\n android:digits=\"0123456789.,\" />\n\n\nThe problem is that in my output project it will work only one of the. Only dot or only comma. What is wrong ? In simulator works fine, only in my release doesnt." ]
[ "android", "xamarin" ]
[ "How can split column in SQL", "in my table i have a column current_date the value is 2012-11-27.\n\nheres my code \n\n$query = QModel::query(\"SELECT * FROM transaction WHERE current_date='$order_date'\"); \n\n\nThe value of $order_date is year-month only \"2012-10\", how can i split the current_date into year-month only \"2012-10\"... \n\nshould I use CHARINDEX to split the current_date??? how please...\n\nthanks" ]
[ "mysql", "sql" ]