texts
sequence
tags
sequence
[ "Oracle MAF : TypeError: Object[object Object] has no method 'signature'", "I am developing the mobile application using Oracle MAF. In that application I need to implement the Signature capture functionality.\n\nFor that I have downloaded the Signature Capture Demo app from this link.\n\nAnd trying to integrate with my application. I did all the necessary settings mentioned in that link.\nBut after running the application I am getting following error \n\n\n TypeError: Object[object Object] has no method 'signature'\n\n\nThe Piece of code as follows\n\n<![CDATA[\n <script type=\"text/javascript\">\n (function()\n {\n makeSig = function() {\n try\n {\n var sigElement = document.getElementById(\"sig\");\n if (sigElement == null)\n alert(\"sigElement not found\");\n var sigJq = $(sigElement);\n sigJq.signature();\n sigJq.signature({guideline: true});\n }\n catch (problem)\n {\n alert(\"Problem with verbatim code: \" + problem);\n }\n }\n window.setTimeout(makeSig, 250);\n })();\n </script>\n <div id=\"sig\" style=\"height:200px;width:99%\"></div>\n ]]>\n\n\nPlease let me know why it is not able to find the signature method. I have also included all the required .js files in the project.\nThanks in Advance." ]
[ "javascript", "jquery-ui", "jquery-mobile", "jquery-plugins", "oracle-maf" ]
[ "CSS 3D containers like shown in post", "I've been trying to get this container box into my webpage with html and css.\nbut I can't seem to get it working properly, could anyone help me out with it?\n\nI dont have any code at the moment, since I've only been copy and pasting tutorials and trying to figure out how it works, but I cant seem to get it right." ]
[ "html", "css", "3d" ]
[ "Reading Joystick in Windows without Pygame using Python", "After searching for hours, I cannot seem to find a way to read a joystick's axis and buttons in Windows using Python. I don't want to use Pygame due to the fact it has a massive overhead and size. Also, the only code I could find can only read XBox controllers. I've tried using the XInput dll, but it doesn't recognize the joystick.\n\nIf anyone can point me in the right direction of what library to use, that would be great." ]
[ "python", "windows", "joystick" ]
[ "Makefile: using cp command while reading from a file", "In makefile, I am doing something like this -\n\n@while read -r file; do \\\n if [ ! -z \"$$file\" ]; then \\\n cp -R path/to/someplace/$$file path/to/someplace/else/$$file \\\n fi \\\ndone <filename.txt\n\n\nfilename.txt contains files and folders like - \n\nabc/*.txt\nfolder1/\nfolder2/\ntextfile.txt\n\n\nI am able to copy files and folders but in the case of abc/*.txt it shows an error:\n\ncp: target `/path/to/someplace/else/*.txt' is not a directory.\n\n\nIs there some way possible to copy these files with wildcard characters?" ]
[ "linux", "makefile", "wildcard", "cp" ]
[ "C++ Inheriting Function Pointer that can be used with derived only methods", "This is a simplified example of a design problem. \n\nI have the class Base. It has a function pointer type and a protected variable of that function pointer type. \n\n#ifndef BASE_H\n#define BASE_H\n\nclass Base {\n\n typedef void (Base::*FunctionPointer) ( void );\n\nprotected:\n\n FunctionPointer pointer;\n\n};\n\n#endif /* BASE_H */\n\n\nThen I have the class Derived that inherits from Base. This class wants to be able to set the inherited pointer variable equal to addresses for it's own methods, not ones inherited or overridden from Base.\n\n#ifndef DERIVED_H\n#define DERIVED_H\n\n#include \"Base.h\"\n\nclass Derived : public Base{\n\npublic:\n Derived()\n {\n pointer = &Derived::ProtectedMethod;\n }\n\n void ProtectedMethod()\n {\n\n }\n\n};\n\n#endif /* DERIVED_H */\n\n\nThe problem is that the type of function pointers (void (Base::*FunctionPointer) ( void ) and void (Derived::*FunctionPointer) ( void )) are different.\n\nIn Short\n\nIs there a way to have a pointer variable in a base class that can be assigned to derived classes methods (not overridden)?" ]
[ "c++", "pointers", "inheritance" ]
[ "Safest way to use eval to parse equations entered by a form", "I'm wondering what sorts of things should be checked when using eval() in PHP to parse a formula that is entered by a user filling out a form. I've seen lots of answers about eval(), but not all of them seem to agree.\n\nHere's what I've gathered:\n\n\nDon't use eval for strings (this could be a problem, since it is a formula I need to parse)\nStrip the input coming from the form (I'm not entirely sure what things I need to strip)\nEval may or may not be evil, and is a security risk (are there alternatives for parsing an equation in a string?)\n\n\nWhat do you folks think I should do?\n\nEDIT: I tried the eval method, and while it does work, the sanitation I used did not support more than two operands. Since I really don't feel like writing my own (possibly insecure) sanitation regex, I'm just going to find and use a pre-written math class instead. Thanks to everyone for the suggestions!" ]
[ "php", "security", "eval", "formula", "equation" ]
[ "Can Spring access-denied-handler refer to popup?", "I am working with Spring Security 3.1.x and have implemented method annotation securities. As I want, when I perform a certain action while being logged in as a used that doesn't have the rights, I get a 403 acces is denied in my console! Perfect!\n\nNow I would like to catch this 403, and give the user a popup with a custom message. I don't want to redirect users to a page saying that they have no rights.\n\nIs there any way the access-denied-handler of Spring can take care of a popup? Or can it only redirect to another page? Maybe there are other options for me?\n\nThanks in advance!" ]
[ "java", "spring-security" ]
[ "Chronos setting environment variable leads to error", "I tried this both on the chronos config and in my job definition:\n\n \"environmentVariables\": [\n {\n \"name\": \"DOCKER_API_VERSION\",\n \"value\": \"$(docker version --format '{{.Server.Version}}')\"\n }\n ],\n\n\nIt always fails with:\n\ndocker: Error response from daemon: 404 page not found.\nSee 'docker run --help'.\n\n\nThe reason I'm trying to set that variable is because I'm running docker in docker and the client docker API sometimes has a different version than the server docker version and it has to be started with the DOCKER_API_VERSION env set in order to work.\n\nI'm suspecting it's because of the computed value being set instead of a string value.\n\nIn the logs I can see it runs as supposed and I don't know why it crashes to be honest:\n\ndocker run ... -e DOCKER_API_VERSION=$(docker version --format '{{.Server.Version}}') ..." ]
[ "mesos", "dcos", "mesos-chronos" ]
[ "Expand div when the content overflows", "I have div with height=\"400px\" and width=\"25px\".How to expand div when the content overflows?" ]
[ "css", "html", "overflow", "expand" ]
[ "How to sort an ArrayList for a specific row without a parameter to differentiate from first to second entry in that specific element?", "I am looking for a solution to sort the following ArrayList:\nstatic ArrayList<Person> myPersons = new ArrayList<Person>();\n\nPerson pers = new Person(anrede, vorname, nachname, strasse, plz,\n ort, telefon, fax, bemerkung);\nmyPersons.add(pers);\n\nThe list should be sorted with nachname as comparator. Yet I haven't found out how to set up a compare(nachname1, nachname2). How can such a differentiation be implemented?\nAll help is appreciated!" ]
[ "java", "sorting", "collections", "comparator" ]
[ "ASP.NET SqlDataSource update and create FK reference", "The short version: \n\nI have a grid view bound to a data source which has a SelectCommand with a left join in it because the FK can be null. On Update I want to create a record in the FK table if the FK is null and then update the parent table with the new records ID. Is this possible to do with just SqlDataSources?\n\nThe detailed version:\n\nI have two tables: Company and Address. The column Company.AddressId can be null. On my ascx page I am using a SqlDataSource to select a left join of company and address and a GridView to display the results. By having my UpdateCommand and DeleteCommand of the SqlDataSource execute two statements separated by a semi-colon I am able to use the GridView's Edit and Delete functionality to update both table simultaneously.\n\nThe problem I have is when the Company.AddressId is null. What I need to have happen is have the data source create a record in the Address table and then update the Company table with the new Address.ID then proceed with the update as usual. I would like to do this with just data sources if possible for consistency/simplicity sake. Is it possible to have my data source do this, or perhaps add a second data source to the page to handle some of this?\n\nOnce I have that working I can probably figure out how to make it work with the InsertCommand as well but if you are on a roll and have an answer for how to make that fly as well feel free to provide it.\n\nThanks." ]
[ "asp.net", "gridview", "sqldatasource" ]
[ "Assign nested Product/Tuple to Array[Numeric]", "I am looking for a fast way to assign a Product to an Array with type Numeric. For instance I want to fill the array elements with values:\n\n// not restricted to be 4-by-2, can be abritary\n// Double will be later replaced by type T : Numeric\nvar elements = new Array[Double](4*2) \n// can contain other Numemrics as Int\nvar values = ((11.0,12.0),(21.0,22.0),(31.0,32.0), (4.0,1.0)) \n\n\nMy approach so far is\n\nvar i = 0;\nvar itRow = values.productIterator.asInstanceOf[Iterator[Product]]\nwhile(itRow.hasNext){\n var itCol = itRow.next.productIterator.asInstanceOf[Iterator[Double]]\n while(itCol.hasNext){\n elements(i) = itCol.next.asInstanceOf[Double]\n i = i + 1\n }\n}\n\n\nIt works if all entries in values are Double, but it would be nice to get this working for abritary Numerics too.\nSecond, is there a more ellegant and faster way to do this? Maybe it would be better to flatten the Tuple by\n\ndef flatProduct(t: Product): Iterator[Any] = t.productIterator.flatMap {\n case p: Product => flatProduct(p)\n case x => Iterator(x)\n} \n\n// edit: I think this is better, \n// but still the problematic if there are Int-types in values\nflatProduct(values).asInstanceOf[Iterator[Dobule]].copyToArray(elements)\n\n\nWhat to you think?\n\nThank you very much!" ]
[ "scala" ]
[ "Gitlab DID cache not working", "I’ve an Omnibus installation of Gitlab in my local server, and on another server a gitlab-runner that performs the CI tasks.\n\nIn my pipeline I’ve a Job that check the code quality using Docker In Docker with codeclimate.\n\nThe problem is that it is very slow (20 minutes) because every time it download and extract the docker images of codeclimate.\n\ndocker pull codeclimate/codeclimate\nUsing default tag: latest\nlatest: Pulling from codeclimate/codeclimate \n2f3f3e5e133b: Pulling fs layer\n2654c654a6e7: Pulling fs layer\n412e64056adf: Pulling fs layer\na3ed95caeb02: Pulling fs layer\nb79986a12326: Pulling fs layer\n1bbb14422caf: Pulling fs layer\n46bd7e5026ba: Pulling fs layer\n7df61bb88827: Pulling fs layer\n0381f4ee19b5: Pulling fs layer\n7df87a0871f8: Pulling fs layer\n4d99acb499d7: Pulling fs layer\nee6a20c6ea98: Pulling fs layer\ncb945e8bccc7: Pulling fs layer\na789fd50eff6: Pulling fs layer\n1bbb14422caf: Waiting\n46bd7e5026ba: Waiting\n7df61bb88827: Waiting\na3ed95caeb02: Waiting\nb79986a12326: Waiting\n7df87a0871f8: Waiting\n4d99acb499d7: Waiting\ncb945e8bccc7: Waiting\na789fd50eff6: Waiting\nee6a20c6ea98: Waiting\n412e64056adf: Download complete\n\n\nI tried to configure the gitlab-ci cache but nothing changed.\n\ncache:\n paths:\n - build\n - .gradle\n untracked: true\n\nstage: reports\n image: docker:latest\n before_script: []\n variables:\n DOCKER_DRIVER: overlay2\n services:\n - docker:dind\n script: \n - docker info\n - docker pull codeclimate/codeclimate\n - mkdir -pv build/reports/codequality\n - cp .codeclimate.yml src\n - docker run --env CODECLIMATE_DEBUG=1 --env CODECLIMATE_CODE=\"$PWD/src\" --volume \"$PWD/src\":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate validate-config\n - docker run --env CODECLIMATE_DEBUG=1 --env CODECLIMATE_CODE=\"$PWD/src\" --volume \"$PWD/src\":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f html > build/reports/codequality/codequality.html\n - docker run --env CODECLIMATE_DEBUG=1 --env CODECLIMATE_CODE=\"$PWD/src\" --volume \"$PWD/src\":/code --volume /var/run/docker.sock:/var/run/docker.sock --volume /tmp/cc:/tmp/cc codeclimate/codeclimate analyze -f json > build/reports/codequality/raw_codequality.json\n - cat build/reports/codequality/raw_codequality.json\n - cat build/reports/codequality/raw_codequality.json | docker run -i stedolan/jq -c 'map({check_name,fingerprint,location})' > build/reports/codequality/codequality.json\n - rm src/.codeclimate.yml\n\n\nThis is my config.toml\n\n[[runners]]\n name = \"DockerBuilder\"\n url = \"http://gitlab.mycompany.com\"\n token = \"mytoken\"\n executor = \"docker\"\n [runners.docker]\n tls_verify = false\n image = \"docker:latest\"\n privileged = true\n disable_cache = false\n volumes = [\"/cache\", \"/var/run/docker.sock:/var/run/docker.sock\", \"/etc/default/docker:/etc/default/docker\", \"/etc/docker/daemon.json:/etc/docker/daemon.json\"]\n extra_hosts = [\"localhost:172.X.X.X\"]\n shm_size = 0\n [runners.cache]\n\n\nI've followed this guide: Analyze project code quality with Code Climate CLI" ]
[ "docker", "gitlab", "gitlab-ci", "gitlab-ci-runner" ]
[ "Avoid recursion in rebinding function reference", "Library X repeatedly tries to invoke its method foo to the massive detriment of my plugin Y's UX. My plugin Y introduces arbitrary logic shouldFooExecute that must be considered before X.foo's end results can take place. However, when the user journey through Y (takes place in a modal window) is complete, X should be able to carry on as though nothing has happened.\n\n// This is an external library. I can't modify and shouldn't overwrite it.\nx = {\n // A method that completely screws my plugin\n foo: function(){\n /* nasty stuff */\n }\n}\n\n// This is my widget!\ny = {\n // Init function, called when my plugin boots\n init: function(){\n // This scope handles the x.foo problem\n void function rebindFoo(){\n // Internal state\n var shouldFooExecute = false;\n // I need to be able to refer back to the original foo after I've temporarily rebound it\n var x_foo = x.foo;\n\n // Re-attach foo to its original definition & context\n function rebindFooToX(){\n // ECMAScript 5 browsers are fine!\n if(Function.prototype.bind){\n // x.foo is literally rebound to pretty much exactly what it was\n x.foo = x_foo.bind(x);\n }\n // Others not so good when this function executes a second time\n else {\n x.foo = function rebound_foo(){\n // An extra scope! Horrible. And it's recursive!\n return x_foo.apply(x, arguments);\n }\n }\n }\n\n x.foo = function y_foo(){\n // Stop and consider y's esoteric logic\n if(shouldFooExecute){\n // If it's fine, we rebind everything\n rebindFooToX();\n // This will have the intended effect\n x.foo();\n }\n }\n }\n }\n}\n\n\nThe problem comes when my plugin is re-initialised on browsers that don't support bind. x.foo ends up referencing rebound_foo which is circular. Is there any kind of logic I can write to avoid recursion and use the existing rebound_foo in cases where it exists?" ]
[ "javascript", "function", "recursion", "reference" ]
[ "Not able to upload an Image in Firebase Storage", "This is the my code ( check this file full code on GitHub) for Uploading an image to Firebase Storage. \n\n// ImagePickerButton shows an image picker to upload a image for a message\n mPhotoPickerButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent i = new Intent();\n i.setType(\"image/*\");\n i.setAction(Intent.ACTION_GET_CONTENT);\n i.putExtra(Intent.EXTRA_LOCAL_ONLY, true);\n startActivityForResult(Intent.createChooser(i, \"Complete action using\"), RC_PHOTO_PICKER);\n }\n });\n\n\nThis is the OnActivityResult Method: \n\n@Override\npublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == RC_PHOTO_PICKER && resultCode == RESULT_OK) {\n\n Uri selectedImageUri = data.getData();\n\n //get the reference to stored file at database\n StorageReference selectedImageFilePath = mStorageReference.child(selectedImageUri.getLastPathSegment());\n\n //upload file to firebase\n selectedImageFilePath.putFile(selectedImageUri).addOnSuccessListener(MainActivity.this, new OnSuccessListener < UploadTask.TaskSnapshot > () {\n @Override\n public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {\n @SuppressWarnings(\"VisibleForTests\")\n String downloadUrl = taskSnapshot.getDownloadUrl().toString();\n Message message = new Message(null, userName, downloadUrl);\n messagesDatabaseReference.push().setValue(message);\n }\n });\n }\n }\n}\n\n\nPicking an Image from the Gallery works fine but I'm not able to upload the selected Image on Firebase Storage. Correct my code If I'm wrong at any site. However, I manually entered these lines in my manifest file \n\n <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n\n\nI'm currently running the app in my own mobile device connected via USB( Moto G4 - Nougat)" ]
[ "android", "firebase", "firebase-storage" ]
[ "How to preg_replace html tags", "I have this PHP string\n\n$str = '<span class=\"_21wk\" style=\"background-image: url(\"/images/facebookEmojis/smileys/1f621.png\");\">';\n\n\nAnd I want to replace the class and the url so I did this\n\n$home = 'https://my-site.com';\n$text = preg_replace('/<span class=\"_21wk\" style=\"background-image: url(\"(.*?)\");\">/', '<span class=\"tinx\" style=\"background-image: url(\"'.$home.'$1\");\">', $str);\n\n\nBut its not working. I want to have this at the replacement\n\n<span class=\"tinx\" style=\"background-image: url(\"https://my-site.com/images/facebookEmojis/smileys/1f621.png\");\">" ]
[ "php", "preg-replace" ]
[ "Sorting content of arrays in controller", "I've got a 'status' and 'type' within a 'subjects' table. This status can contain the strings: 'Open', 'In progress' and 'Closed. I want to sort the output with 'In progress' first, then 'Open', then 'Closed'.\n\nWithin the sortings of status, I want to sort on types too, which can contain four different strings too.\n\nIs this possible (in a controller) and if yes; how?" ]
[ "sorting", "ruby-on-rails-4", "parameters", "controller" ]
[ "Google App Engine Enterprise and SQL/Django Admin?", "I'm having a difficult time finding definitive information on this. If I have a paid, enterprise account with Google, can I host SQL databases and thus the Django Admin feature? I have a MySQL database I would like to port to GAE and make viewable via the Django Admin section, and an Enterprise Google account is an option, but I need to know for sure if I can even do this with an Enterprise account." ]
[ "django", "google-app-engine", "admin" ]
[ "string.StartsWith element from the list", "Here is my code: \n\nprivate bool isSpecialZone(string zoneNumber, string clientName)\n{\n var notSpecialZones = new List<string> { \"200\", \"201\", \"202\" };\n return clientName.Contains(\"XXX\") && !zoneNumber.StartsWith(\"200\") && !zoneNumber.StartsWith(\"201\") && !zoneNumber.StartsWith(\"202\");\n}\n\n\nI would like to make it cleaner and instead of repeating the \"StartsWith\" everywhere have one statement. Is there a way to do this?" ]
[ "c#", "string", "startswith" ]
[ "Multiple Public IP Addresses on AWS EC2 (VPC)", "Thanks to everyone in advance -\n\nI have an ec2 instance with the following network config:\n\n\neth0 - internal-ipaddressA\neth1 - internal-ipaddressB\npublic-elastic-ipddressA associated with internal-ipaddressA\npublic-elastic-ipddressB associated with internal-ipaddressB\n\n\nI configured sshd to listen on both these addresses explicitly:\n\n\ninternal-ipaddressA\ninternal-ipaddressB\n\n\nI can ssh to public-elastic-ipddressA and then ssh to internal-ipaddressA AND internal-ipaddressB, just to make sure sshd is working correctly on both addresses.\n\nAll that said, I am unable to ssh to public-elastic-ipddressB if it is associated with any other network interface besides the primary, which was created by default when the instance was started.\n\nAm I missing some sort of special routing or ACL/security configurations here?\n\nThanks!\n\nSam" ]
[ "amazon-web-services", "amazon-ec2", "amazon-vpc", "vpc", "elastic-ip" ]
[ "Exception in \"helloworld\" server and client program in socket programming", "I am getting this error when I'm running my client program. I was unable to recognise the problem yet.I've changed the port numbers but there is no use. I saw the previous posts regarding the same error but I didn't figured it out. \n\nServer.java\n\nimport java.io.*;\nimport java.net.*;\nclass Server{\n\n public static void main(String argv[]) throws Exception \n {\n\n String clientSentence;\n String capitalizedSentence;\n ServerSocket welcomeSocket = new ServerSocket(8080);\n\n while (true) \n {\n Socket connectionSocket = welcomeSocket.accept();\n BufferedReader inFromClient = new BufferedReader(new \n InputStreamReader(connectionSocket.getInputStream()));\n DataOutputStream outToClient = new \n DataOutputStream(connectionSocket.getOutputStream());\n clientSentence = inFromClient.readLine();\n System.out.println(\"Received: \" + clientSentence);\n capitalizedSentence = clientSentence.toUpperCase() + '\\n';\n outToClient.writeBytes(capitalizedSentence);\n }\n }\n }\n\n\nClient.java\n\nimport java.io.*;\nimport java.net.*;\n\nclass Client\n{\n public static void main(String argv[]) throws Exception \n {\n String sentence;\n String modifiedSentence;\n BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));\n Socket clientSocket = new Socket(\"localhost\", 8080); \n DataOutputStream outToServer = new DataOutputStream(clientSocket.getOutputStream());\n BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n sentence = inFromUser.readLine();\n outToServer.writeBytes(sentence + '\\n');\n modifiedSentence = inFromServer.readLine();\n System.out.println(\"FROM SERVER: \" + modifiedSentence);\n clientSocket.close();\n }\n }\n\n\nI am getting an error when I run the client.java\n\nException in thread \"main\" java.net.ConnectException: Connection refused: connect\nat java.net.DualStackPlainSocketImpl.connect0(Native Method)\nat java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)\nat java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)\nat java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)\nat java.net.AbstractPlainSocketImpl.connect(Unknown Source)\nat java.net.PlainSocketImpl.connect(Unknown Source)\nat java.net.SocksSocketImpl.connect(Unknown Source)\nat java.net.Socket.connect(Unknown Source)\nat java.net.Socket.connect(Unknown Source)\nat java.net.Socket.<init>(Unknown Source)\nat java.net.Socket.<init>(Unknown Source)\nat Client.main(Client.java:11)\n\n\nCan anyone help with this error?" ]
[ "java", "sockets" ]
[ "Running a script 24/7", "I am tyring to find a solution for running a python script of mine 24/7. \n\nResearch led me to the conclusion that I probably need a CGI hosting.\nBut suppose that I have one (and which type of hosts should I look for?) :\nhow will I make the script run all the time? \n\nIn pseudo-code it should be something like this:\n\nif (time_since_last_run(script.py)>100):\n run(script.py)\n\n\nPlease give me a direction." ]
[ "python", "web", "cgi" ]
[ "Can someone help me to figure out how to read my file from \":\" (not included) til the end of the line?", "My exercise ask to open the file sales.dat, and read only the number part of every line. All of this using the Scanner class\n\ni've tried with while loops, for loops and every other possible solution on my book but none works\n\npublic static void main(String[] args) {\n String nomeFile = \"sales.dat\";\n Scanner inputStream = null;\n System.out.println(\"Il file \"+ nomeFile + \"\\ncontiene le righe seguenti:\\n\");\n\n try {\n inputStream = new Scanner(new File(nomeFile));\n inputStream.useDelimiter(\":\");\n while(inputStream.hasNext()) {\n String riga = inputStream.nextLine();\n System.out.println(riga);\n }\n } catch (FileNotFoundException e) {\n System.out.println(\"Errore nell'apertura del file \" + nomeFile);\n System.exit(0);\n }\n\n inputStream.close();\n }\n}\n\n\nExpected: if line is San Francisco: 198870.32 it must read and print only 198870.32\n\nActual: San Francisco: 198870.32\n Chicago: no report received\n New York: 298734.12" ]
[ "java", "file", "while-loop", "java.util.scanner" ]
[ "One View/ViewModel used twice in same app, but bound to different data", "I created a view and viewmodel that I would like to use twice (or more) in the same application. I would like however to have it bound to two different models.\n\n<TabItem Background=\"Transparent\">\n <TabItem.Header>\n <TextBlock Text=\"Items\" Foreground=\"LightSeaGreen\" FontSize=\"14\"/>\n </TabItem.Header>\n <AdornerDecorator>\n <Grid>\n <Grid.ColumnDefinitions>\n <ColumnDefinition Width=\"*\" />\n <ColumnDefinition Width=\"250\" />\n </Grid.ColumnDefinitions>\n\n <local:ItemsView Grid.Row=\"0\" Grid.Column=\"0\" Margin=\"5\" Height=\"Auto\"/>\n //This is the reused control\n <local:NutritionLabelView Grid.Row=\"0\" Grid.Column=\"1\" Margin=\"5,15,5,5\" Height=\"Auto\" VerticalAlignment=\"Top\" ViewKey=\"Key_ItemsView\" />\n\n </Grid>\n </AdornerDecorator>\n </TabItem>\n\n <TabItem Background=\"Transparent\">\n <TabItem.Header>\n <TextBlock Text=\"Meals\" Foreground=\"LightSeaGreen\" FontSize=\"14\"/>\n </TabItem.Header>\n <AdornerDecorator>\n <Grid>\n <Grid.ColumnDefinitions>\n <ColumnDefinition Width=\"*\" />\n <ColumnDefinition Width=\"250\" />\n </Grid.ColumnDefinitions>\n\n <local:MealsView Grid.Column=\"0\" Margin=\"5\" Height=\"Auto\"/>\n //This is it again\n <local:NutritionLabelView Grid.Column=\"1\" Margin=\"5,15,5,5\" Height=\"Auto\" VerticalAlignment=\"Top\" ViewKey=\"Key_MealsView\" />\n\n </Grid>\n </AdornerDecorator>\n\n </TabItem>\n\n\nThe control that is reused is the <local:NutritionLabelView Grid.Column=\"1\" Margin=\"5,15,5,5\" Height=\"Auto\" VerticalAlignment=\"Top\" ViewKey=\"Key_MealsView\" /> which I gave a ViewKey property to so I could tell which data this view should display. Can I use a multibinding for this?" ]
[ "c#", "mvvm" ]
[ "Copy values from cell and paste the values onto another cell in the same sheet", "Can Google Apps Script copy the values from on cell and paste the values onto another cell in the same sheet, and then repeat for all sheets?\nI'm trying to create a script whereby the value in A1, for each Sheet gets copied (value only) onto B1.\nThis function only works in one sheet:\n function CopyToRange() {\n var source = SpreadsheetApp.getActiveSpreadsheet();\n source.getRange('A1').copyTo(source.getRange('B1'), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);\n }" ]
[ "javascript", "google-apps-script", "google-sheets" ]
[ "Case class difference with field names on matcher failure", "munit out-of-the-box shows pretty diffs on assertion failure for case classes which include field names, for example,\n\nclass CaseClassPrettyDiffSpec extends munit.FunSuite {\n case class User(name: String, age: Int)\n\n test(\"User should be Picard\") {\n val expected = User(\"Picard\", 67)\n val actual = User(\"Worf\", 30)\n assertEquals(actual, expected)\n }\n}\n\n\nprints\n\n\n\nAre such pretty diffs possible in ScalaTest?" ]
[ "scala", "diff", "scalatest", "pretty-print", "case-class" ]
[ "MySQL CLI web environment halts on /", "So I just made a question about symbols, but yeah, while the symbols are now working properly, there is still a problem with UNIX commands.\n\nThe thing is, whenever I input a value that starts with / and follows with a UNIX command, the host responds with - 501 Method Not Implemented.\n\nWhat causes this, how to prevent this, and am I right that this happens because of MySQL in CLI environment?\n\nYes, here in Latvia currency is \"Lats\", abbreviated to \"Ls\" and our client tend to seperate values like - \"Ls 3 for students, Ls 2 for retirees /Ls 1 for children\". And the /Ls there screws it all up.\n\nThanks in advance!" ]
[ "php", "mysql" ]
[ "Unable to connect to remote TFS server from VS2010", "SOLVED: Turns out the people not being able to access TFS via VS2010 were using laptops, I didn't put two and two together, and Symantec Endpoint was blocking the ports required. \n\nSome users cannot get to the TFS 2010 server, secured by SSL, from team explorer but can via IE.\n\nFor example, I go into VS2010 SP1 and attempt to add a new server, it sits there for a while and then spits out a dialog that basically tells me \"Unable to connect to the remote server\". If I enter the exact same URL into IE I get access perfectly.\n\nSo\n\nhttps://tfserver:8088/tfs (custom SSL port number) in IE and I get full access \nThe same detail entered into the add server results in \n\n\n\n\nAny ideas?" ]
[ "visual-studio-2010" ]
[ "Using Read-host with Input validation and TRAP", "I'm just a typical admin trying to make a simple script for some IT assistants in remote offices, to make domain joins easier while minimizing potential errors. The script's end game is to run the one-liner command Add-Computer -DomainName $DomainToJoin -OUPath $LocDN -NewName $WS_NewName -Restart. \n\nBut the whole script is supposed to include input validation for the computer's new name as well as for the target OU for the two-letter code for the remote office. \n\nGoogling for code snippets for days, esp. from sites like yours, was very helpful. But the problem I have now is I couldn't find the right codes to combine Read-Host , input length validation, and TRAP to work together without losing the value for my variables.\n\nPardon my coding as obviously I'm no real PS scripter, and I know the wrong portions of it are very basic. I would want to spend more time if I had the luxury, but I would really so much appreciate it if you could point me in the right direction. \n\nThank you so much in advance.\n\nPlease see my code below:\n\n# START: Display name and purpose of invoked script\n$path = $MyInvocation.MyCommand.Definition \nClear-Host\nWrite-Host $path\nWrite-Host \" \" \nWrite-Host \"This script will allow you to do the following in a single-step process:\"\nWrite-Host \"(1) RENAME this computer\"\nWrite-Host \"(2) JOIN it to MYDOMAIN\"\nWrite-Host \"(3) MOVE it to a target OU\"\nWrite-Host \"(4) REBOOT\" \nWrite-Host \" \"\nPause\n\n\n# Function: PAUSE\nFunction Pause ($Message = \"Press any key to continue . . . \") {\nif ((Test-Path variable:psISE) -and $psISE) {\n $Shell = New-Object -ComObject \"WScript.Shell\"\n $Button = $Shell.Popup(\"Click OK to continue.\", 0, \"Script Paused\", 0)\n}\nelse { \n Write-Host -NoNewline $Message\n [void][System.Console]::ReadKey($true)\n Write-Host\n}\nWrite-Host \" \" \n}\n\n# Function: Define the parameters\nFunction Define-Parameters { \n\n# Specify new computer name, with validation and TRAP\n$WS_NewName = $null\nwhile ($null -eq $WS_NewName) {\n[ValidateLength(8,15)]$WS_NewName = [string](Read-Host -Prompt \"NEW NAME of computer (8-15 chars.)\" )\nTRAP {\"\" ;continue} \n}\nWrite-Host \" \"\n\n# Domain to join.\n$DomainToJoin = 'mydomain.net' \n\n# Specify the target OU, with validation and trap\n$baseOU='OU=Offices OU,DC=mydomain,DC=net'\n$OU2 = $null\nwhile ($null -eq $OU2) {\n[ValidateLength(2,2)]$OU2 = [string](Read-Host -Prompt 'Target OU (TWO-LETTER code for your office)' )\nTRAP {\"\" ;continue} \n}\nWrite-Host \" \"\n$LocDN = \"OU=$OU2,$baseOU\" \n}\n\n\n\n# Function: Summary and confirmation screen for defined parameters.\nFunction Confirm-Parameters {\nWrite-Host \"===========================================================================\"\nWrite-Host \"Please confirm that you are joining this computer to \n$DomainToJoin (MYDOMAIN)\"\nWrite-Host \"with the following parameters:\" \nWrite-Host \"\"\nWrite-Host \"\"\nWrite-Host \"Computer's NEW NAME: $WS_NewName\" \n# Write-Host \"Domain to Join: $DomainToJoin\" \nWrite-Host \"TARGET mission OU: $OU2\" \n}\n\n\n# Call Define-Parameters Function\nDefine-Parameters\n\n# Call Confirm-Parameters Function\nConfirm-Parameters\n\n<#\nSome more code here\n#>\n\n\n# FINAL COMMAND if all else works: Join the computer to the domain, rename it, and restart it. \n# Add-Computer -DomainName $DomainToJoin -OUPath $LocDN -NewName $WS_NewName -Restart" ]
[ "powershell" ]
[ "Find files created/accessed/modified between dates, batch script", "I need to generate lists of all files that has been created, modified and accessed respectively on a windows system.\n\nI have found the command forfiles here http://technet.microsoft.com/sv-se/library/cc753551(v=ws.10).aspx but apparently this does not use the created and accessed timestamps, I need those also (in separate lists).\n\nI have also looked into using the dir command but I have only found references to sorting and not filtering in the help sections." ]
[ "windows", "command-line", "batch-file", "timestamp" ]
[ "How to initiate TLSv1.2 request in jre6", "How to initiate a TLSv1.2 request from jre6 using JAVA. The URL that I am using is of TLSv1.2 but my application uses only jre6. If a request is sent from jre6 we get NoSuchAlgorithmFound exception and how to solve this. Can any one please help how to initiate a TLSv1.2 request in JAVA so that no such exceptions arises." ]
[ "java", "tls1.2" ]
[ "Scala Syntax Partial", "When I create a partial function, why can't I immediately invoke it?\n\nBoth res6 and res8 are the same type (function1) so I'm not sure how come res7 works (immediately invoking it) and what would be res9 fails\n\nscala> ((x: Int) => x + 1)\nres6: Int => Int = <function1>\n\nscala> ((x: Int) => x + 1)(1)\nres7: Int = 2\n\nscala> def adder(a: Int, b: Int) = a + b\nadder: (a: Int, b: Int)Int\n\nscala> adder(1, _: Int)\nres8: Int => Int = <function1>\n\nscala> adder(1, _: Int)(1)\n<console>:12: error: Int does not take parameters\n adder(1, _: Int)(1)\n ^\n\nscala> (adder(1, _: Int))(1)\nres10: Int = 2" ]
[ "scala" ]
[ "how to use one file in a few threads", "I have application where I'm using a tabPage controls. In each of this controls I read data from the excel file and then analyze the data in separate threads. How make to a few threads can read data from one excel file?" ]
[ "multithreading", "excel", "tabpage" ]
[ "How to move a div with a timer?", "I tested with console.log{\"test\") and it wrote multiple times so I know the timing works but the div won't move!\n\n\r\n\r\nvar myVar = setInterval(myTimer, 100);\r\n\r\nfunction myTimer() {\r\n var carre = document.getElementById(\"carre\");\r\n carre.style.marginLeft = carre.style.marginLeft + \"10px\";\r\n}\r\n<div id=\"carre\" style=\"width:100px;height:100px;background-color:red;position:absolute;\"></div>" ]
[ "javascript", "move" ]
[ "update the unselectable value (jquery)", "i'm using selectable jquery, i want to cater the value for selectable once the use select or unselect the item. My problem is, the last value of unselectable won't update.\nFull code here http://jsfiddle.net/duQH6/ When I select Mon and Tue, then I unselect the Tue, the value is updated, but then when I click Mon, the value is not updated. Please advice.\n\nHere my jquery code\n\n$(function() {\n$(\"#selectday1\").bind('mousedown', function (e) {\n e.metaKey = true;\n}).selectable();\n}); \n\n$('document').ready(function(){ \n$( \"#selectday1\" ).selectable({\n selected: function(event, ui) {\n var result=[];\n jQuery(\".ui-selected\", this).each(function() \n {\n result.push(this.id);\n $(\"#days\").val(result.join(','))\n });\n }\n});\n$( \"#selectday1\" ).selectable({\n unselected: function(event, ui) {\n var result=[];\n jQuery(\".ui-selected\", this).each(function() \n {\n result.push(this.id);\n $(\"#days\").val(result.join(','))\n });\n }\n});\n}); \n\n\nThanks.." ]
[ "javascript", "jquery", "selectable" ]
[ "java 8 Springboot How to use properties from application.yml file in annotations?", "I am using java 8, Spring boot 2.2 and have a piece of code where I use `@Retryable`. The backoff, maxattempt fields as of now are hardcoded and I wish to make them configurable. But only constants are allowed in there; have to be final. Any idea on how to overcome this ? I remember seeing some code somewhere which makes me think its possible. I know I can do it via `RetryTemplate`. But I cant digest the idea that there is no other way.\nI want this.\n@Retryable( value = { SQLException.class },maxAttempts = 2,backoff =\n@Backoff(delay = 5000))\n\nI to become something like this\n@Retryable( value = { SQLException.class },maxAttempts =\n"${applicationyml['myproperty']}",backoff = @Backoff(delay =\n"${applicationyml['myproperty']}"))" ]
[ "java", "spring-boot", "annotations", "spring-annotations", "spring-retry" ]
[ "How to make an infinitely long scroll view on iPhone?", "Here is the idea:\n\nThe scroll view has several sub views, in this example, A, B, C:\n\n[A][B][C]\n\n\nOnce the user scrolls to C, the view can't scroll anymore, but I want to loop back to A, like this:\n\n[C][A][B]\n\n\nWhen the user keeps scrolling to the right, the view keeps filling previous views in at the end. When the user \nscrolls to left the view should also have similar behavior,\nin order to make the user think that this view is infinitely long:\n\n[A][B][C][A][B][C][A][B][C][A][B][C][A][B][C][A][B][C].....\n\n\nHow can I implement this in actual code? Thank you." ]
[ "iphone", "objective-c", "uiscrollview" ]
[ "Is there a way I can declare these groups only once?", "I am writing tests in Java with TestNG & Selenium.\n\nI am having to list these groups over & over to ensure these methods get executed:\n\n@BeforeSuite(groups = { \"all\", \"simple\", \"smoketest\", \"login\", \"layers\", \"networks\", \"basemaps\", \"jobs\",\n \"inspections\", \"defects\", \"projects\", \"teams\", \"routes\", \"search\", \"schedules\", \"gateway\", \"permissions\",\n \"mesh\", \"designer\", \"workflow\", \"reports\", \"streetlighting\", \"collections\", \"wip\", \"deletes\", \"views\",\n \"create\", \"edit\" })\n\n\nand again: \n\n@BeforeTest(groups = { \"all\", \"simple\", \"smoketest\", \"login\", \"layers\", \"networks\", \"basemaps\", \"jobs\",\n \"inspections\", \"defects\", \"projects\", \"teams\", \"routes\", \"search\", \"schedules\", \"gateway\", \"permissions\",\n \"mesh\", \"designer\", \"workflow\", \"reports\", \"streetlighting\", \"collections\", \"wip\", \"deletes\", \"views\",\n \"create\", \"edit\" })\n\n\nIs there a way I can declare all these groups only once, as this is a source of errors?" ]
[ "java", "selenium", "testng" ]
[ "ASP.NET Core MVC - rendering a view within RenderBody()", "_Layout.cshtml contains RenderBody() which generates the content from the view at Index.cshtml. \n\nIndex.cshtml has a large script loading jstree with jQuery. \n\n$('#tree').jstree({\n \"plugins\": [\"search\", \"wholerow\", \"dnd\", \"contextmenu\", \"massload\", \"search\", \"types\"],\n 'core': {\n \"check_callback\": true, // enable all modifications, tweak for rules.\n 'data': {\n 'url': function (node) {\n return node.id === '#' ? \"/Home/GetRoot\" : \"/Home/GetChildren/\" + node.id;\n },\n 'data': function (node) {\n return { 'id': node.id };\n }\n }\n }\n });\n\n\nAn event on changed.jstree captures information about the node that is selected. \nI want to render a view below the tree that contains an editable form allowing to perform CRUD operations on the tree.\n\n$('#tree').on(\"changed.jstree\", function (e, data) {\n $.ajax({\n type: \"GET\",\n url: \"/Home/GetNodeInformation/\" + data.selected,\n data: '{id: \"' + data.selected + '\" }',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (response) {\n if (response['node_type'] == 'Portfolio') {\n $('#nodeinfo').load('@Url.Action(\"GetPortfolioDetails\", \"Portfolio\")');\n }\n console.log(response['node_type'])\n },\n failure: function (response) {\n alert(response.responseText);\n },\n error: function (response) {\n alert(response.responseText);\n }\n });\n });\n\n\nRendering the tree and the event on it works well, I believe this is because the RenderBody is functioning as it should. \n\nBut the moment I call \n\n$('#nodeinfo').load('@Url.Action(\"GetPortfolioDetails\", \"Portfolio\")');\n\n\nThe whole page gets rendered again within that div. \n\nQuestion - since my app is a single page application, how to properly manage placeholders in the layout file to handle different rendering sections? In this case I don't see how I could render both the tree and the details pane below it, because they are interconnected. I do not think that I can use RenderBody for this case, and generating the form on the fly with jQuery will be difficult to maintain." ]
[ "c#", "asp.net-core-mvc" ]
[ "Check if Browser Supports HTML5 timepicker", "I built a time mask in JavaScript which works great for PC's, Macs, iPhones, and iPads, but doesn't work consistently in most Android phones (I'd prefer not to get into the details of why this functionality can't work consistently in Android) so I disable it. For Samsung the built-in HTML5 time picker works great.\n\nFor Android phones I would like to leverage the HTML5 time pickers, when native browser time pickers are available (like for modern Samsung phones). \n\nI know I can detect if the browser supports the date/datetime input types, but that doesn't necessarily indicate that the browser supports a time picker (For anyone who doubts this test it with an HTC EVO 3D, as just one example.) This Question ( Detect browser's native date/time pickers ) indicates that the if the time type is supported then the browser has implemented a time picker, but this is wrong.\n\nI'm aware of modernizr but I don't see a way to actually verify if the browser supports a timepicker.\n\nSo with that background information. Does anyone know of a way to determine if the browser has implemented a time picker?" ]
[ "javascript", "html", "mobile-browser" ]
[ "Merge custom fields in checkout page with shipping fields", "I'm trying to move custom fields that I created on my checkout page in the Shipping block.\nWhat I've tried is this code: thise are the new fields\n// Add a new checkout field\nfunction filter_checkout_fields($fields){\n \n $fields['extra_fields'] = array(\n 'some_field' => array(\n 'type' => 'text',\n 'required' => false,\n 'label' => __( 'Field 1:' )\n ),\n 'another_field' => array(\n 'type' => 'text',\n 'required' => false,\n 'label' => __( 'Field 2:' )\n ),\n\n return $fields;\n\n \n}\nadd_filter( 'woocommerce_checkout_fields', 'filter_checkout_fields' );\n\n// display the extra field on the checkout form\nfunction extra_checkout_fields(){ \n\n $checkout = WC()->checkout(); ?>\n\n <div class="extra-fields">\n <h3><?php _e( 'Title' ); ?></h3>\n\n <?php \n // because of this foreach, everything added to the array in the previous function will display automagically\n foreach ( $checkout->checkout_fields['extra_fields'] as $key => $field ) : ?>\n\n <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>\n\n <?php endforeach; ?>\n </div>\n\n <?php }\n add_action( 'woocommerce_checkout_after_customer_details' ,'extra_checkout_fields' );\n\nAnd this is how I'm trying to move them (replace current fields)\nadd_filter( 'woocommerce_checkout_fields', 'another_group' );\n \nfunction another_group( $checkout_fields ){\n \n // 1. We assign a field array to another group here\n $checkout_fields['some_field'] = $checkout_fields['shipping']['shipping_first_name'];\n $checkout_fields['another_field'] = $checkout_fields['shipping']['shipping_last_name'];\n \n // 2. Remove a field from a previous location\n unset( $checkout_fields['shipping']['shipping_first_name'] );\n unset( $checkout_fields['shipping']['shipping_last_name'] );\n \n return $checkout_fields;\n \n}\n\nWhat is happening is that the ['shipping_first_name'] and ['shipping_last_name'] are removed (unset) but nothing appeared on their place.\nIs this possible to happen at all?" ]
[ "wordpress", "woocommerce", "customization", "checkout" ]
[ "Find number of consecutive different entries in a row for each entry", "I am attempting to automate a count showing how many consecutive different entries have been added in a row. For example, the first entry would return 1, while the second entry would return 1 if the same as the first or 2 if different. I am struggling to find a way of getting the formula to search 'backwards' along the row until it finds an entry it has already seen.\n\nI am struggling to find a way of getting the formula to search 'backwards' along the row until it finds an entry it has already seen.\n\nThe closest I have got (which very much does not work and is only half a formula) is something along the lines of =IF(D2=C2,1,IF(COUNTIF($C2:D2,D2)=1,C6+1,\"\")) where the data is entered into row 2 starting in column B (the first two entries are trivial - it is after this I am struggling). The \"\" within my formula is where I think that some clever checking will occur, but I can't work out what it would be.\n\nMy aim is that the following could be obtained:\n\nA A B C D E F G H I A A A J K L B M N O A A A P A Q R A A \n1 1 2 3 4 5 6 7 8 9 9 1 1 2 3 4 5 6 7 8 8 1 1 2 2 3 4 3 1\n\n\nHowever, my above formula only works until the run of 3x 'A's.\n\nMany thanks for any help - this is my first question, so please be kind!" ]
[ "excel" ]
[ "How i can Pass data from adotable to fast report in delphi 10 seattle", "I have Delphi 10 seattle & i have a Form1 ,in the Form i have :\n\n\nADOConnection1\nADOTable1\nDBGrid1\nfrxreport1\n\n\nHow can i pass the data from the table into the report & show the report ?\n\nThank you." ]
[ "delphi", "delphi-10-seattle", "fastreport" ]
[ "How to get file from custom named mongoDB gridfs chat_upload.files using c#?", "I'm trying to fetch a file from custom named gridFs using C#?\nBy default C# code searches the file in fs.files." ]
[ "c#", "mongodb", "gridfs" ]
[ "Akka, aggregate responses for a given request", "I'm starting to create a system with Akka. This system must resolve dependencies for a product. The dependencies are computed from two different sources.\n\nclass Deps extends Actor {\n def receive = {\n case Resolve(p) => \n context.actorOf(System1.props) ! Resolve(p)\n context.actorOf(System2.props) ! Resolve(p)\n }\n}\n\n\nBut it must aggregate the two responses in order to reply itself. Without any experience of Akka, I'm thinking of two solutions. \n\n1/ Maintain a Map[(Product, Sender), Set[Response]]\n\nEach time the Deps actor receive a Response from a child, it add the response to the set and if there is two responses it can create and send the response.\n\n2/ Create one Actor per Product\n\nThe Deps actor is (or create a child actor that is) initialized with a Product as constructor parameter. It maintains two var Option[Response] and each time it receive a Response he verify if they are both present he can create and send the response.\n\nI think this is the best approach but I have to maintains two var for the response and one for the sender so I'm not sure it is the best way to do.\n\n3/ Use ask\n\nEverything is described into the doc.\n\n4/ Use tell with a mutable \"result\"\n\nMy actual code has already a Report that is update from the result of all sources. But I can use the same pattern as in Spray; I can pass the report as part of the message to all actors so that they can immediately update it so that I can really \"fire and forget\".\n\nWhat is the usual way to wait and aggregate multiple response before replying to the sender from an actor ?" ]
[ "akka" ]
[ "Highcharts, no animation when updating number of series in chart", "I have a Highchart pie chart that will get different number of values to present. My problem is that it doesn't seem to animate when updating the number of series in the chart.\n\n$scope.chartConfig = {\n options: {\n chart: {\n type: 'pie'\n }\n },\n series: [{\n name: 'Segment',\n data: [{\n name: 'Something',\n y: Math.floor((Math.random() * 10) + 1)\n }, {\n name: 'Something else',\n y: Math.floor((Math.random() * 10) + 1)\n }]\n }],\n title: {\n text: 'My pie'\n },\n\n loading: false\n};\n\n\nand when updating:\n\n var newValues = [{\n name: \"Status 1\",\n y: Math.floor((Math.random() * 10) + 1)\n }, {\n name: \"Status 2\",\n y: Math.floor((Math.random() * 10) + 1)\n }, {\n name: \"Status 3\",\n y: Math.floor((Math.random() * 10) + 1)\n }, {\n name: \"Status 4\",\n y: Math.floor((Math.random() * 10) + 1)\n }]\n\n $scope.chartConfig.series[0].data = newValues;\n\n\nIs it a bug in Highcharts (or by design), or have I missed something?\n\nSee fiddle:\nhttp://jsfiddle.net/kq8L50f8/" ]
[ "javascript", "highcharts" ]
[ "Testing for exception thrown in several lines", "I would like to test a method, in JUnit4, that does not pass at the first caught exception, but if all calls to the tested method throw exception. And I would like to know if this is possible.\n\nI explain : let us say I have the method\n\npublic void setFromFen(String fenValue) throws IllegalArgumentException\n\n\nin a class Position.\n\nIn PositionTest Junit4 class, I would like to do something like this :\n\n@Test(expected=IllegalArgumentException.class){\n ...\n setFromFen(\"2\"); // throws IllegalArgumentException\n setFromFen(\"8/8/8/8/8/8/8/8\"); // does not throw IllegalArgumentException\n ...\n}\n\n\nso that the test only succeed if all calls to setFromFen fail.\n\nIn this case, though the second test does not throw IllegalArgumentException, the test succeed : and that's not what I want.\n\nIs is it possible to get success only if all tests lines throws IllegalArgumentException ?" ]
[ "junit4" ]
[ "Trying to choose an image from image gallery from a Fragment - Android", "I am trying to pick an image from image gallery using this code from a fragment:\n\n Intent intent = new Intent();\n intent.setType(\"image/*\");\n intent.setAction(Intent.ACTION_GET_CONTENT);\n startActivityForResult(Intent.createChooser(intent, \"Select Picture\"), PICK_IMAGE_CALLBACK);\n\n\nOn my Activity I have placed this code:\n\n@Override\npublic void onActivityResult(int requestCode, int resultCode, Intent data) { \n super.onActivityResult(requestCode, resultCode, data);\n if (requestCode == FirstInstallFragment.PICK_IMAGE_CALLBACK && resultCode == Activity.RESULT_OK) {\n if (data.getData() == null) {\n return;\n }\n\n FirstInstallFragment firstInstallFragment = (FirstInstallFragment) getSupportFragmentManager().findFragmentByTag(FIRST_INSTALL_FRAGMENT_TAG);\n if (firstInstallFragment != null && firstInstallFragment.isVisible())\n {\n firstInstallFragment.onOpenImageResult(data);\n } \n } \n}\n\n\nNow the weird thing is that, when I choose an image from image gallery my application closes but not in a way that it shutdown but like when you are in an activity and you press back button and it close but still run in background.\n\nI have placed a breakpoint in onActivityResult() but it doesn't work, so I guess it doesn't go inside onActivityResult().\n\nWhy is this happening and how can I show again the Fragment after picking an image?" ]
[ "android", "android-activity" ]
[ "Enable buttons in datawindow for new row PowerBuilder", "I have a datawindow with a row that contains a dropdown list, 2 buttons and some checkboxes. I want to enable the buttons after selecting something from the dropdown list. But I also need to insert a new row and enable the buttons for that row. How can I do that? \n\nI've tried dw_scope.Modify(\"b_yes.Enabled=Yes\"), but this enables the buttons for all rows, when I just want to enable only for the new row.\n\nThanks!" ]
[ "button", "powerbuilder", "datawindow" ]
[ "Zend Framework JSON Output", "In controller I am generating a special form by ID, passed from AJAX. Form output is JSON. Form creates finely. But my problem is to show this JSON in view. How?\n\nThank you." ]
[ "php", "ajax", "json", "zend-framework" ]
[ "Updating SelectedItem in DataGrid ByRef and Retaining SelectedItem Behavior WPF", "I have a datagrid with an Observable Collection of a custom object. The selectedItem binding is set to SelectedCustObject in my view model. I've wired up a property Changed handler so I can update the database anytime the user makes a change to the selectedItem. When the property is updated my Save() sub fires and passes the Custom Object ByRef to my middle layer (WCF) and returns it. The datagrid loses it's SelectedItem state at this point. I'm not sure if I'm going about this right or if there is a better way.\n\nSelectedItem=\"{Binding Path=SelectedMeterUsage, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"" ]
[ "wpf", "datagrid", "inotifypropertychanged", "selecteditem", "byref" ]
[ "How to write a query to control a datasheet subform's combobox based on a linked table?", "I would like my users to select from a pre-defined project list combobox in a subform. The easy way would be to use lookup fields, but I've been told to avoid those like poison. To provide context, I have two linked tables, one for User Entry, and one that stores projects.\n\nUser Entry Table\n\nPK ProjectFK Projected Hours Actual Hours\n1 1 15 13\n2 3 12 14\n3 4 13 13\n\n\nProject List Table\n\nPK ProjectName\n1 Caterpillar\n2 Omaha\n3 Dilly\n4 Holdout\n\n\nOn a separate main form, the User Entry Table serves as a datasheet subform where users select which projects they're working on, and how many hours they spend on them. Rather than having users select the project by foreign key, I was hoping the users could select the project by Project Name located in the linked table.\n\nI'm having trouble experimenting/visualizing this process. Does it involve a query, and if so, how should I go about it?\n\nThank you for your help!" ]
[ "sql", "ms-access", "vba" ]
[ "How to resize images in pylab", "Whenever I generate an image it very easy to zoom it manually using pylab, i.e. drawing a rectangle around the region we intend to zoom in. I was wondering if it was possible coding this operation.\n\nHere is an example code, where I generate a 100x100 image with random values on each row:\n\nfrom random import *\nfrom pylab import *\nfrom numpy import *\n\n\na=ones((100,100))\nimage=array([dummy*random() for dummy in a])\n\nimshow(image,extent=[0,1]+[5,6])\n\n\nIn the above example our image extends from 0 to 1 in the x-axis and from 5 to 6 in the y-axis. How can show a zoom on the image, let's say in the region 0.5" ]
[ "python", "matplotlib" ]
[ "Running the SimulationStarter class in the AlgoTrader", "I am trying to run the SimulationStarted class with the moving average strategy in the open source edition of AlgoTrader.\n\nWhen I start the SimulationStarter I get ArrayIndexOutOfBoundsException.\n\nI am trying to run it through eclipse. From AlgoTrader they run it with the following command\n\njava.exe -cp target/classes;../../AlgoTrader/code/target/classes;../../AlgoTrader/code/lib/*;target/* -Dsimulation=true -DdataSource.dataSet=1year com.algoTrader.starter.SimulationStarter simulateWithCurrentParams\n\n\nSo is it even possible to run it through eclipse or this is the only way?\n\nIf anyone has any ideas or suggestions it will be much appreciated.\n\nHere is the code for the SimulationStarter and ServiceLocator classes.\n\npackage com.algoTrader.starter;\n\nimport org.apache.commons.math.*;\nimport org.apache.log4j.Logger;\n\n\n\nimport com.algoTrader.ServiceLocator;\nimport com.algoTrader.service.SimulationServiceImpl;\nimport com.algoTrader.util.MyLogger;\n\npublic class SimulationStarter {\n\n private static Logger logger = MyLogger.getLogger(SimulationServiceImpl.class.getName());\n\n public static void main(String[] args) throws ConvergenceException, FunctionEvaluationException {\n\n ServiceLocator.serverInstance().init(\"beanRefFactorySimulation.xml\");\n\n if (\"simulateWithCurrentParams\".equals(args[0])) {\n\n ServiceLocator.serverInstance().getSimulationService().simulateWithCurrentParams();\n\n } else if (\"optimizeSingleParamLinear\".equals(args[0])) {\n\n String strategyName = args[1];\n for (int i = 2; i < args.length; i++) {\n String[] params = args[i].split(\":\");\n String parameter = params[0];\n double min = Double.parseDouble(params[1]);\n double max = Double.parseDouble(params[2]);\n double increment = Double.parseDouble(params[3]);\n\n ServiceLocator.serverInstance().getSimulationService().optimizeSingleParamLinear(strategyName, parameter, min, max, increment);\n\n }\n }\n\n ServiceLocator.serverInstance().shutdown();\n }\n}\n\n\nAnd the service locator class\n\npackage com.algoTrader;\n\nimport com.algoTrader.entity.StrategyImpl;\nimport com.algoTrader.util.ConfigurationUtil;\n\npublic class ServiceLocator {\n\n private static boolean simulation = ConfigurationUtil.getBaseConfig().getBoolean(\"simulation\");\n private static String strategyName = ConfigurationUtil.getBaseConfig().getString(\"strategyName\");\n\n public static CommonServiceLocator commonInstance() {\n\n if (!simulation && !StrategyImpl.BASE.equals(strategyName)) {\n return RemoteServiceLocator.instance();\n } else {\n return ServerServiceLocator.instance();\n }\n }\n\n public static ServerServiceLocator serverInstance() {\n\n if (!simulation && !StrategyImpl.BASE.equals(strategyName)) {\n throw new IllegalArgumentException(\"serverInstance cannot be called from the client\");\n } else {\n return ServerServiceLocator.instance();\n }\n }\n}" ]
[ "java", "eclipse", "algorithm", "indexoutofboundsexception", "trading" ]
[ "How to create an attribute of a specific type in a new class in java?", "I'm a Java Newbie and my Task is to create a taxi project with driver, passengers, seats and so on...\n\nI am stuck in this point:\nCreate a class called Taxi which represents a taxi. Because every taxi has a driver, every Taxi object should have a driver attribute (of type Human). Additionally, the Taxi can have passengers who are also represented by Human objects.\n\nMy already existing code:\n\npublic class Main {\n\npublic static void main(String[] args){\n\n Human human1 = new Human(\"Max\", \"Mustermann\");\n\n // System.out.println(human1.getForename() + \" \" + human1.getName());\n System.out.println(\"This is \" + human1 + \".\");\n\n Taxi taxi1 = new Taxi();\n\n Human driver1 = new\n}\n\n}\n\npublic class Human {\n\nprivate String name;\npublic String forename;\n\npublic Human(String forename, String name){\n this.name = name;\n this.forename = forename;\n}\n\npublic String getName(){\n return name;\n}\n\npublic String getForename(){\n return forename;\n}\n\npublic String toString(){\n return this.forename + \" \" + this.name;\n}\n}\n\n\n\n\npublic class Taxi {\n\n\n}\n\n\nHow to create driver and passengers of type human in the class Taxi? \n\nThank you." ]
[ "java", "class", "types", "attributes" ]
[ "Error: Function 'vsrnggaussian' at (1) has no IMPLICIT type", "I'm new to Fortran (gcc version 10.2.0) and try to use the subroutine 'vsrnggaussian' to generate normally distributed random numbers but always get following error:\n"Error: Function 'vsrnggaussian' at (1) has no IMPLICIT type"\nI don't get it since 'vsrnggaussian' is no variable that needs to be defined.\nWhat's wrong with my code?\n program test_normaldistr_random_number\n!\n USE iso_fortran_env, dp=>real64\n!\n IMPLICIT NONE\n!\n INTEGER :: VSL_RNG_METHOD_GAUSSIAN_BOXMULLER\n REAL(DP) :: n=1._dp, a=10._dp, sigma=2._dp, stream=1._dp\n REAL :: r = 1, status\n!\n status = vsrnggaussian(VSL_RNG_METHOD_GAUSSIAN_BOXMULLER,\n &stream, n, r, a, sigma)\n!\n print *, status\n!\n end program" ]
[ "gcc", "random", "fortran", "gfortran", "normal-distribution" ]
[ "Ruby Mysql Connection", "I setup ruby and mysql on my mac and i am having issues connecting to my local mysql server.\n\nrequire 'rubygems'\nrequire 'mysql'\n... \ndb = Mysql.new(\"localhost\", \"root\", \"\", \"\")\n...\n\n\nThis would give me the following error when i run this script fromt he command line:\n\ngenerate.rb:37:in `initialize': wrong number of arguments (4 for 0) (ArgumentError)\nfrom generate.rb:37:in `new'\nfrom generate.rb:37\n\n\nI have no idea why i am getting this error...any ideas?" ]
[ "mysql", "ruby" ]
[ "textarea expanded with jquery, not submitting the form when i click the submit button", "I want the button to submit the form while the textarea is expanded. How do i do this? \n\nThe problem is that when I click the Post button in the form, while the textarea is expanded, it does not submit the form, instead it shrinks back down, and I need to click it again while it is smaller, to submit the form.\n\nCurrently in order to submit the post, i need to click the post button while the textarea is not expanded.\n\nHTML\n\n<form method='POST' action='elsewhere.php'>\n <textarea id=\"textarea\" style=\"width:550px; height:25px;\"></textarea>\n <input class=\"btn\" type='submit' value='Post'/> \n</form>\n\n\njquery\n\nCurrently when I click the text area, the height expands, and when i click elsewhere it shrinks. when i click the post button, while the textarea is expanded it doesnt submit the post, intead it shrinks the textarea back down.\n\n$('#textarea').click(function(){\n $(this).css('height','100px')\n $(this).html('');\n $(this).blur(function(){\n $(this).css('height','25px')\n\n });\n})" ]
[ "javascript", "jquery", "html", "forms", "post" ]