texts
sequence
tags
sequence
[ "How to query sql server database programatically, which is currently accessible using citrix receiver", "We are currently accessing a SQLServer database through citrix receiver. On clicking on SSMS Icon in citrx XENAPP website, an ICA file is being downloaded. On click of that ICA file, SSMS is getting opened. I am running queries using this SSMS manually.\n\nWe would like to run these queries programatically. Is there any possible way? I am ready to use any programming language." ]
[ "citrix" ]
[ "square Matrix transpose with CUDA", "I'm trying to write the matrix transpose algorithm. I test this program with matrix size equal to 1024, the result shows that not all elements are in the right places.\n\nWhy isn't my array transposing correctly? Does anyone can help me or give me any hint? I will appreciate it. Thanks a lot!\n\nthere is the whole cpu code:\n\n__global__ void transpose_naive (float *out, float *in, int w, int h )\n{\n unsigned int xIdx = blockDim.x * blockIdx.x + threadIdx.x;\n unsigned int yIdx = blockDim.y * blockIdx.y + threadIdx.y;\n if ( xIdx <=w && yIdx <=h ) {\n unsigned int idx_in = xIdx + w * yIdx;\n unsigned int idx_out = yIdx + h * xIdx;\n out[idx_out] = in[idx_in];\n }\n}\n\nint main()\n\n{\n int nx=1024;\n int mem_size = nx*nx*sizeof(float);\n int t=32;\n dim3 dimGrid(((nx-1)/t) +1, ((nx-1)/t) +1);\n dim3 dimBlock(t,t);\n\n float *h_idata = (float*)malloc(mem_size);\n float *h_cdata = (float*)malloc(mem_size);\n float *d_idata, *d_cdata;\n checkCuda(cudaMalloc(&d_idata, mem_size) );\n checkCuda(cudaMalloc(&d_cdata, mem_size) ); \n // host\n for (int j = 0; j < nx; j++)\n for (int i = 0; i < nx; i++)\n h_idata[j*nx + i] = j*nx + i;\n\n // device\n checkCuda(cudaMemcpy(d_idata, h_idata, mem_size, cudaMemcpyHostToDevice) );\n\n // events for timing\n cudaEvent_t startEvent, stopEvent;\n checkCuda(cudaEventCreate(&startEvent) );\n checkCuda(cudaEventCreate(&stopEvent) );\n float ms;\n checkCuda( cudaEventRecord(startEvent, 0) );\n transpose_naive<<<dimGrid, dimBlock>>>(d_cdata, d_idata,nx,nx);\n checkCuda(cudaEventRecord(stopEvent, 0) );\n checkCuda(cudaEventSynchronize(stopEvent) );\n checkCuda(cudaEventElapsedTime(&ms, startEvent, stopEvent) );\n checkCuda( cudaMemcpy(h_cdata, d_cdata, mem_size, cudaMemcpyDeviceToHost) );\n\n printf(\"the time %5f \", ms);\n printf(\"\\n\");\n savetofile(h_idata,\"i.txt\",nx,nx);\n savetofile(h_cdata,\"t.txt\",nx,nx);\n\nerror_exit:\n // cleanup\n checkCuda(cudaEventDestroy(startEvent) );\n checkCuda(cudaEventDestroy(stopEvent) );\n checkCuda( cudaFree(d_cdata) );\n checkCuda( cudaFree(d_idata) );\n free(h_idata);\n free(h_cdata);\n system(\"pause\"); \n}" ]
[ "matrix", "cuda" ]
[ "Can Sphinx do a NOT AND filter with an IN clause?", "This question is a more complex extension of this simpler case.\n\nIn this instance, however, suppose I have an index with the following integer attributes:\n\ncategory\ntype\n\n\nSuch that each document has one category ID and one type ID.\n\nSuppose I also have a list of category IDs:\n\ncategory_list = [1,3,5,7,9]\n\n\nAnd a list of type IDs:\n\ntype_list = [1,2]\n\n\nI want to filter all documents that are NOT (IN category_list AND IN type_list)\n\nOnce again, I'm using the Python sphinxapi.py.\n\nCan this be done?" ]
[ "python", "logic", "sphinx" ]
[ "Slide Animation when switching to another scene in Godot Game Engine", "I'm making a GUI using godot and I want transition animation when switching to another scene instead of instant change (No animation) when using get_tree().change_scene(\"MyOtherScene\")\nI am trying to mimic the ios feel when switching to another scene. Is there any function to accomplish this?" ]
[ "user-experience", "godot", "gdscript" ]
[ "how to read xml data from a column of MS Access File", "I have a ms access file in which one of the columns have xml tagged data. The database columns and sample data are in image\n\n\n\nWhat is the better way to read column AppliesTo from an Access File.\n\nThanks in advance" ]
[ "c#", ".net" ]
[ "Standard C++ equivalent to a CTypedPtrList", "I'm porting Windows code to Linux and I'm new to C++. Is there a standard C++ library equivalent to CTypedPtrList?\n\nIt's currently used in the code to contain some of our classes like so:\n\nCTypedPtrList<CPtrList, OurClass*> variable_name;" ]
[ "c++", "stl", "mfc" ]
[ "WFP callout and NDIS LWF can't sit inside the same driver binary", "I am developing WinPcap, a NDIS Light-Weight Filter driver. In order to capturing loopback packets, I have also made a Windows Filtering Platform (WFP) callout driver. And I have integrated these two parts together in one driver binary. But the new driver cannot run when system get restarted.\n\nFor now, I just abandoned the WFP callout INF file, and only used the NDIS filter INF to install this integrated driver (I don't know how to use two INF files for one driver binary), it can be installed with no problem and works fine (I mean I can capture loopback packets via WFP). But when the system restarted, the driver won't be loaded, and when I run \"net start npf\" (npf is the driver service name), it says:\n\nC:\\Windows\\system32>net start npf\nSystem error 2 has occurred.\n\nThe system cannot find the file specified.\n\n\nThen I commented all WFP code and lib imports (fwpkclnt.lib and uuid.lib) in my driver, the driver runs good after restarted. So the WFP callout INF missing thing should be the cause. But I don't know how to write the INF file for this new driver.\n\n1) How to install this driver mixed with NDIS filter and WFP callout? I know that NDIS filter uses INetCfg API to install and WFP callout can be installed by right-clicking the inf file and choosing \"install\" (I don't know its programmatical way). These two methods seem to be different.\n\n2) How to write the INF file, especially the Device Setup Class? NDIS filter's class is NetService, but WFP callout's is WFPCALLOUTS. Can I specify two classes in one INF file? Or I should provide two INF files? What if I don't provide the right INF file? Like I provide the INF file with NetService class only, will the WFP callout part work?\n\nMy NDIS filter INF file is like:\n\n[version]\nSignature = \"$Windows NT$\"\nClass = NetService\nClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318}\nCatalogFile = npcap.cat\nProvider = %Insecure%\nDriverVer=05/15/2015,14.48.38.905\n\n\nAnd the WFP callout is like:\n\n[Version]\nSignature = \"$WINDOWS NT$\"\nClass = WFPCALLOUTS\nClassGuid = {57465043-616C-6C6F-7574-5F636C617373}\nProvider = %LBTest%\nCatalogFile = LBTest.cat\nThanks!" ]
[ "c", "windows", "driver", "ndis" ]
[ "Passing multiple arguments in C++ to MatLab shared library function", "I am implementing a feature matching algorithm for Matlab in my C++ application using shared libraries. The problem is that I am only getting values for one argument though I am passing four arguments to the function.\n\nThe Matlab function:\n\n[c, d, e, f] = fm_test(\"C:\\0.jpg\", \"C:\\1.jpg\");\n\nfunction [FSC_1, FSC_2, NBCS_1, NBCS_2] = fm_test(path_im1, path_im2)\n...\n% Performed feature matching - output are 4 matrices with format n x 2 single\nFSC_1 = matchedPoints1(inliersIndex, :);\nFSC_2 = matchedPoints2(inliersIndex, :); \nNBCS_1 = matchedPoints1(inliers_NBCS, :);\nNBCS_2 = matchedPoints2(inliers_NBCS, :);\nend\n\n\nI am using the Library Compiler to create shared libraries for C++ and call the function: \n\nmclmcrInitialize();\n //const char *args[] = { \"-nojvm\" };\n //const int count = sizeof(args) / sizeof(args[0]);\n if (!mclInitializeApplication(NULL, 0)) {\n\n std::cerr << \"Could not initialize the application properly\" << std::endl;\n return -1;\n }\n\n if (!fm_testInitialize()) {\n std::cerr << \"Could not initialize the library properly\" << std::endl;\n return -1;\n }\n else {\n try {\n for (size_t i = 0; i < cameras.size() - 1; ++i){\n\n mwArray FSC_1, FSC_2, NBCS_1, NBCS_2;\n mwArray path_1 = cameras[i].image_path.c_str();\n mwArray path_2 = cameras[i+1].image_path.c_str();\n fm_test(1, FSC_1, FSC_2, NBCS_1, NBCS_2, path_1, path_2);\n\n // Convert mwArray to vector<double>\n std::cout << \" Printing sizes of mwArray\" << std::endl;\n std::cout << FSC_1.NumberOfElements() << std::endl; \n std::cout << FSC_2.NumberOfElements() << std::endl;\n std::cout << NBCS_1.NumberOfElements() << std::endl;\n std::cout << NBCS_2.NumberOfElements() << std::endl;\n }\n\n }\n catch (const mwException& e) {\n std::cerr << e.what() << std::endl;\n return -2;\n }\n catch (...) {\n std::cerr << \"Unexpected error thrown\" << std::endl;\n return -3;\n }\n fm_testTerminate();\n\n }\n\n\nThe result is e.g.:\n\nPrinting sizes of mwArray\n100 \n0\n0\n0\n\n\nIs it possible to pass multiple arguments to the function? Do I have to define the mwArray more specifically?" ]
[ "c++", "matlab", "shared-libraries", "parameter-passing" ]
[ "Fastest way to deal with multiple textures in OpenGL?", "For each type of texture (ambient, diffuse, specular, etc) assimp will return a list of textures. How do we deal with that many textures?\nIt seems that the number of texture binds for every model may increase drastically. It would be interesting if we were able to convert every list of a texture type into just a single texture array or map, is that possible?\nJust so you can visualize, in my code I have this Material class:\nclass Material {\n private:\n Shader* shader;\n\n Texture* diffuseMap;\n Texture* specularMap;\n Texture* emissiveMap;\n \n float shineness;\n public:\n [...]\n};\n\nSo I am trying to convert a list of textures into a single map corresponding to its type." ]
[ "c++", "opengl", "assimp" ]
[ "LSTM layers accepting any input shape when expecting them not to", "I'm building a neural network using keras and I'm a little lost on the LSTM layer input shape. Below is an image of the relevant part.\n\nBoth towers are similar with the only difference that the left accepts sequences of any length and the right only accepts sequences of length 5. This results in their LSTM layers receiving an ambiguous sequence length and a sequence length of 4 respectively, both with 8 features per timestep. I'd thus expect both LSTM layers should have an input_shape of (1,8).\nMy confusion now comes from the fact that both LSTM layers will accept any input shape without a problem, which is why I think this might not work the way I think it does. I'd expect the right LSTM layer to require an input shape with the first dimension either 1, 2 or 4 as only these sizes would be able to divide the input sequence of 4. Further, I'd expect both to require the second dimension to always be 8.\nCould someone explain why the LSTM layers can accept any input shape and if they process the sequnces correctly with an input_shape=(1,8)? Below is the relevant code.\n # Tower 1\n inp_sentence1 = Input(shape=(None, 300, 1)) \n conv11 = Conv2D(32, (2, 300))(inp_sentence1) \n reshape11 = K.squeeze(conv11, 2)\n maxpl11 = MaxPooling1D(4, data_format='channels_first')(reshape11) \n lstm11 = LSTM(units=6, input_shape=(1,8))(maxpl11)\n\n # Tower 2\n inp_sentence2 = Input(shape=(5, 300, 1)) \n conv21 = Conv2D(32, (2, 300))(inp_sentence2) \n reshape21 = Reshape((4,32))(conv21)\n maxpl21 = MaxPooling1D(4, data_format='channels_first')(reshape21) \n lstm21 = LSTM(units=6, input_shape=(1,8))(maxpl21) \n\nEDIT: Short reproduction of problem on dummy data:\n # Tower 1\n inp_sentence1 = Input(shape=(None, 300, 1))\n conv11 = Conv2D(32, (2, 300))(inp_sentence1)\n reshape11 = K.squeeze(conv11, 2)\n maxpl11 = MaxPooling1D(4, data_format='channels_first')(reshape11)\n lstm11 = LSTM(units=6, input_shape=(1,8))(maxpl11)\n\n # Tower 2\n inp_sentence2 = Input(shape=(5, 300, 1))\n conv21 = Conv2D(32, (2, 300))(inp_sentence2)\n reshape21 = Reshape((4,32))(conv21)\n maxpl21 = MaxPooling1D(4, data_format='channels_first')(reshape21)\n lstm21 = LSTM(units=6, input_shape=(1,8))(maxpl21)\n\n # Combine towers\n substract = Subtract()([lstm11, lstm21])\n dense = Dense(16, activation='relu')(substract)\n final = Dense(1, activation='sigmoid')(dense)\n\n # Build model\n model = Model([inp_sentence1, inp_sentence2], final)\n model.compile(optimizer='adam',\n loss='binary_crossentropy',\n metrics=['accuracy'])\n\n # Create data\n random_length = random.randint(2, 10)\n x1 = numpy.random.random((100, random_length, 300))\n x2 = numpy.random.random((100, 5, 300))\n y = numpy.random.randint(2, size=100)\n\n # Train and predict on data\n model.fit([x1, x2], y, epochs=10, batch_size=5)\n prediction = model.predict([x1, x2])\n prediction = [round(x) for [x] in prediction]\n classification = prediction == y\n print("accuracy:", sum(classification)/len(prediction))" ]
[ "python", "keras", "neural-network", "lstm", "recurrent-neural-network" ]
[ "ASP MVC Unit Testing GetUserId()", "I have a controller, where I'm calling a userId:\n\nvar userId = User.Identity.GetUserId();\n\n\nThis makes my unit test fail, since User is null.\nI've tried to set a user in the test method using this method, but User is still null in the controller when the test runs. \n\nvar context = new Mock<HttpContextBase>();\nvar mockIdentity = new Mock<IIdentity>();\ncontext.SetupGet(x => x.User.Identity).Returns(mockIdentity.Object);\nmockIdentity.Setup(u => u.Name).Returns(\"test_userName\");\n\n\nAny hints as to what I'm doing wrong?" ]
[ "c#", "asp.net-mvc", "unit-testing" ]
[ "What is the iPhone SDK Missing?", "I've been doing mobile app development for a long time (2001?), but the systems we worked with back then were dedicated mobile development environments (Symbian, J2ME, BREW). iPhone SDK is a curious hybrid of Mac OS X and Apple's take on mobile (Cocoa Touch).\n\nBut it is missing some stuff that other mobile systems have, IMO. Specifically:\n\n\nApplication background processing\nSMS/MMS application routing (send an SMS to my application in the background)\nAPI for accessing phone functions/call history/call interception\n\n\nI realize that Apple has perfectly valid reasons for releasing the SDK the way they did. I am curious what people on SO think the SDK is missing and how would they go about fixing/adding it, were they an Engineering Product Manager at Apple." ]
[ "iphone", "cocoa-touch" ]
[ "How to use a variable as a JSON file name when using getJSON", "I'm trying to develop a simple way to turn a .json file into an HTML table using javascript.\n\nI've tried using a file upload input, text input, html form, as well as appending data from one .json file to another empty container .json file. The main thing(s) I'm trying to fix are located on lines 3, 5, and 17.\n\nWhat I want to happen is the user inputs the name of the .json file via the text field (or just uploads the file), and the program turns it into an html table, but I can't figure out how to use a variable to implement that.\n\n<script>\n\n $(function() {\nvar whatname = document.getElementById(\"whatnametext\")\n\n var people = [];\n\n $.getJSON(whatname, function(data) {\n $.each(data.person, function(i, f) {\n var tblRow = \"<tr>\" + \"<td>\" + f.firstName + \"</td>\" +\n \"<td>\" + f.lastName + \"</td>\" + \"<td>\" + f.job + \"</td>\" + \"<td>\" + f.roll + \"</td>\" + \"</tr>\"\n $(tblRow).appendTo(\"#userdata tbody\");\n });\n\n });\n\n});\n</script>\n</head>\n\n<body>\n<input type=\"text\" id=\"whatnametext\">\n<div class=\"wrapper\">\n<div class=\"profile\">\n <table id= \"userdata\" border=\"2\">\n <thead>\n <th>First Name</th>\n <th>Last Name</th>\n <th>Email Address</th>\n <th>City</th>\n </thead>\n <tbody>\n\n </tbody>\n </table>\n\n</div>\n</div>```" ]
[ "javascript", "html", "json", "variables", "getjson" ]
[ "Django-reversion foreign-key data \"follow\" question - get related model instance from history when object was created", "Say I have models:\[email protected]()\nclass EmailTemplate(models.Model):\n html_content = models.TextField()\n context_variables = models.JSONField()\n\n\[email protected](follow="template") \nclass EmailMessage(models.Model):\n template = models.ForeignKey(EmailTemplate)\n custom_data = models.JSONField()\n\nCase 1: (first version of template)\nEmailTemplate data:\nhtml_content = """ Hello {{ first_name }} """\ncontext_variables = {'first_name': 'Enter name' }\n\nEmailMessage data:\ntemplate = ForeignKey(EmailTemplate with id: 1))\ncustom_data = {'first_name': 'Robert' }\n\nCase 2: (second version of template, added last_name field)\nEmailTemplate data:\nhtml_content = """ Hello {{ first_name }}, {{ last_name }} """\ncontext_variables = {'first_name': 'Enter name', 'last_name': 'Enter your last name' }\n\nEmailMessage data:\ntemplate = ForeignKey(EmailTemplate with id: 1))\ncustom_data = {'first_name': 'Robert', 'last_name': 'Doe' }\n\nI parse this to make additional form fields when creating new email message from template. It lets me declare fields for this email template and form within the EmailTemplate.\nI create EmailTemplate in admin, so I can see all history versions.\nThe problem is when I select an email from my sent emails list to send again the email with this specified template version (it may be from the past) as the template could be modified later.\nI know I can create a new template, but there will be many and I won't bother you with the reasons behind my desicion of using reversion. I would also like to avoid attaching\nlarge html content to my EmailMessage instance saved to the db.\nThere will be more functionalities like view the web version of this email, unsubscribe etc.\nI'd rather just be able to render the template (via ForeignKey "template" attribute) in EmailMessage with variables (custom_data), but it always points to the newest template version.\nIs it possible to somehow link a template info/data as of the time when EmailMessage was created ?\nIf yes, is the template data (there are way mroe fields) copied/created for every new EmailMessage instance or it just saved the revision id and gets that from EmailTemplate revision ?\nUsing the latest django-reversion v. 3.0.9\nThanks" ]
[ "django", "django-reversion" ]
[ "Is it possible to create an 'average' volume from an mp3 file using JavaScript?", "I have been unable to find any kind of library that is capable of creating an average volume of an mp3 file that supports JavaScript on a web client, not in NodeJS.\n\nI need it on a web client as it is a part of a Chrome Extension." ]
[ "javascript", "mp3", "normalization" ]
[ "Cannot find module node-sass while running Ionic 4", "I have a big problem with node-sass. I have installed Ionic 4 and did my 'ionic serve' but the compile process failed.\nI got the following issue:\n\n\"Module build failed: Error: Cannot find module 'node-sass'\"\nI tried a lot, but it is not possible for me to install the node-sass folder under my node_module. I found a notice with a node-sass bug [here]. But nothing works for me. I tried to uninstall node-sass, but this failed too. \n\nI had the same bug with my every Ionic Project Start. I had this at Ionic V3 too. But know its not possible to get this bug fixed.\n\nHope someone could help me." ]
[ "node.js", "ionic-framework", "sass", "ionic4" ]
[ "How to check the type of object in ArrayList", "Is there a way to get the type of object in the arraylist?\n\nI need to make an IF statment as the following (in C#):\n\nif(object is int)\n //code\nelse\n //code\n\n\nthanks" ]
[ "c#", "object", "types", "arraylist" ]
[ "webpy - url autodetect some part of the string to hyperlink", "I've created a sample blog application using webpy. I used some code here(Replace URL with a link using regex in python) to replace the URL but when I render the page it won't show the hyperlink but just a plain text \n\nIn my template:\n\n <p>\n <i>$datestr(post.posted_on) by $user</i><br/><br/>\n $urlify.formatstring(post.content)\n <p>\n\n\nurlify.py\n\n def formatstring(self, value):\n pat1 = re.compile(r\"(^|[\\n ])(([\\w]+?://[\\w\\#$%&~.\\-;:=,?@\\[\\]+]*)(/[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)?)\", re.IGNORECASE | re.DOTALL)\n\n pat2 = re.compile(r\"(^|[\\n ])(((www|ftp)\\.[\\w\\#$%&~.\\-;:=,?@\\[\\]+]*)(/[\\w\\#$%&~/.\\-;:=,?@\\[\\]+]*)?)\", re.IGNORECASE | re.DOTALL)\n value = pat1.sub(r'\\1<a href=\"\\2\" target=\"_blank\">\\3</a>', value)\n value = pat2.sub(r'\\1<a href=\"http://\\2\" target=\"_blank\">\\3</a>', value)\n\n return value\n\n\nExample text: \n\nThis url will make your life sh!t so don't click this one.<a href=\"http://www.someurl.com\">some url</a>.\n\nExpected after the render of the page shoud be:\n\nThis url will make your life sh!t so don't click this one.some url.\n\nBut the actual is:\n\nThis url will make your life sh!t so don't click this one.<a href=\"http://www.someurl.com\">some url</a>.\n\nUrl was not change to hyperlink.\n\nEDIT: In my template: \nInstead of $content, it should be $:content to treat the url as hyperlink." ]
[ "python", "web.py" ]
[ "How to define a font-face mixin correctly?", "I am trying to define custom mixin in Less, but it seems doesn't work right for me.\n\nIt looks like this\n\n.font-face(@font-family, @filepath){\n @font-face {\n font-family: @font-family;\n src: url('../fonts/@{filepath}.ttf') format('truetype');\n }\n}\n\n\nI think I'll add some more properties to it, but this is just for the start. Then I'm applying it\n\n.header {\n .font-face(Rubik, Rubik);\n}\n\n\nAnd it doesn't work. It doesn't give any error and isn't showed at the Dev Tools.\n\nWhat can cause the problem? And how to fix this?" ]
[ "css", "less" ]
[ "How to know what Item of a MenuStrip is being clicked?", "I'm using c# and I have a MenuStrip control but I don't know how to identify what item of it is being clicked. For example, I used to group all click(buttons) events in one or two methods like \"btnActions_click()\" or \"btnNavigation_click()\". Then, inside of the method I identify the button clicked by parsing the sender as a button and placing it on a button var, then I check if the name of that button var is equal to \"btnFoo\" or \"btnBar\".\n\nSo, in this case, how could I know what item of the MenuStrip controls is being clicked in order to group all click events in only one method?\n\nI apologyze if my english isn't correct. If you can't understand me I can try again or post some code.\n\nThanks.\n\nEdit: I didn't post any code because I thought that there was not necessary in this question but someone suggest me to do it, so I'll do it. Here's an example of what I do to identify what button has been clicked.\n\nprivate void btnNavegation_Click(object sender, EventArgs e)\n {\n Button btn = sender as Button;\n\n if (btn.Name == \"btnNext\")\n //go to next item of the list\n else if (btn.Name == \"btnPrevious\")\n //go to previous item of the list\n }" ]
[ "c#", "menustrip" ]
[ "How to get all jenkins variables", "I want to write a python script to get list of \"jenkins\" variables and show them.\nI wrote this, but it returned all environment variables instead of jenkins variables.\n\nimport os\nprint os.environ\n\n\nHow can I get them in python script?" ]
[ "python", "jenkins", "environment-variables" ]
[ "Java ee7 websockets server endpoint not working", "Here's my server's code\n\npackage local.xx.mavenws;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\nimport javax.websocket.OnClose;\nimport javax.websocket.OnError;\nimport javax.websocket.OnMessage;\nimport javax.websocket.OnOpen;\nimport javax.websocket.Session;\nimport javax.websocket.server.ServerEndpoint;\nimport javax.enterprise.context.ApplicationScoped;\nimport org.joda.time.DateTime;\n\n@ApplicationScoped\n@ServerEndpoint(\"/\")\npublic class Server {\n\n private final ArrayList<Session> sessions;\n\n public Server() {\n this.sessions = new ArrayList<>();\n }\n\n @OnOpen\n public void onOpen(Session session) {\n this.sessions.add(session);\n this.echo(\"Client connected!\");\n }\n\n @OnClose\n public void onClose(Session session) {\n this.sessions.remove(session);\n this.echo(\"Client disconnected!\");\n }\n\n @OnError\n public void onError(Throwable error) {\n this.echo(\"Error occured!\");\n this.echo(error.getLocalizedMessage());\n }\n\n @OnMessage\n public void onMessage(String message, Session session) {\n try {\n message = \"[\" + this.currentDate() + \"] \" + message;\n this.echo(message);\n for( Session sess : this.sessions ) {\n sess.getBasicRemote().sendText(message);\n }\n } catch (IOException ex) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n private void echo(String info) {\n System.out.println(info);\n }\n private String currentDate() {\n String dateArray[] = (new DateTime()).toString().split(\"T\");\n String date = dateArray[0] + \" \" + (dateArray[1].split(\"\\\\.\")[0]);\n return date;\n }\n}\n\n\nI want it to send received message to all the users connected. The problem is, it treats every connection individually like each one of them had it's own instance of the server. When I connect in two browser windows, messages show separately. Does anybody have any ideas on this?" ]
[ "java", "maven", "websocket" ]
[ "JAXB unmarshaling with namespaces, but without prefix", "I want to use JAXB to \n\n\nunmarshal an xml into a java object,\nmarshal it back to an xml\nand produce the exact same output with namespaces\n\n\nHere is the original XML:\n\n<customer xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://example.com\">\n <dataList>\n <data xsi:type=\"keyValuePair\">\n <key>key1</key>\n <value>val1</value>\n </data>\n <data xsi:type=\"keyValuePair\">\n <key>key2</key>\n <value>val2</value>\n </data>\n </dataList>\n <id>123</id>\n</customer>\n\n\nI am using the following POJOs:\n\n@XmlRootElement(namespace = \"http://example.com\")\npublic class Customer {\n\n private String id;\n private List<KeyValueData> data;\n\n public Customer(){}\n\n @XmlElement\n public String getId() {\n return id;\n }\n\n public void setId(String id) {\n this.id = id;\n }\n\n @XmlElement\n @XmlElementWrapper(name=\"dataList\")\n public List<KeyValueData> getData() {\n return data;\n }\n\n public void setData(List<KeyValueData> data) {\n this.data = data;\n }\n}\n\npublic class KeyValueData {\n\n private String type;\n private String key;\n private String value;\n\n public KeyValueData(){}\n\n @XmlElement\n public String getKey() {\n return key;\n }\n\n public void setKey(String key) {\n this.key = key;\n }\n\n @XmlElement\n public String getValue() {\n return value;\n }\n\n public void setValue(String value) {\n this.value = value;\n }\n\n @XmlAttribute(namespace = \"http://www.w3.org/2001/XMLSchema-instance\" )\n public String getType() {\n return type;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n}\n\n\nThe code i am using for un/marshalling:\n\nInputStream inputStream = new ByteArrayInputStream(xmlString.getBytes());\nJAXBContext context = JAXBContext.newInstance(Customer.class);\nUnmarshaller unmarshaller = context.createUnmarshaller();\nCustomer customer = (Customer) unmarshaller.unmarshal(inputStream);\nMarshaller m = context.createMarshaller();\nm.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);\nm.marshal(customer, System.out);\n\n\nAnd this is not really working, i cannot even unmarshal the initial xml. But if i try just marshaling a POJO where i just set the fields in the code. I get the following result:\n\n<ns3:customer xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ns3=\"http://example.com\">\n <dataList>\n <data xsi:type=\"keyValuePair\">\n <key>key1</key>\n <value>val1</value>\n </data>\n <data xsi:type=\"keyValuePair\">\n <key>key2</key>\n <value>val2</value>\n </data>\n </dataList>\n <id>123</id>\n</ns3:customer>\n\n\nHow do i get rid of this ns3 prefix?" ]
[ "java", "xml", "namespaces", "jaxb" ]
[ "How do I suppress the value of #VALUE! in Excel 2013?", "How do I write this into the formula to make the #VALUE! blank?\n\n=IF(ISERROR(VLOOKUP($B10,Claims!$A$1:$G$18591,2,0)),\"\",VLOOKUP($B10,Claims!$A$1:$G$18591,2,0))/1000" ]
[ "excel", "excel-2013" ]
[ "Catching event in Laravel with Livewire and Echo", "I made a laravel chat test with Laravel, Livewire, Laravel echo package and pusher.\nI have a main room with a list of different room and the users can move to each room for chating with others. In each different room, i have the list of the users connected.\nEverything going well.\nSo, now, I would like to show in main room the same list of users and if, one of them move to a others room, showing that the user still connected and the name of the room where he moved.\nFor that, I created a event "userConnected" like that :\nclass userConnected implements ShouldBroadcast\n{\n use Dispatchable, InteractsWithSockets, SerializesModels;\n\n public $room;\n public $user;\n /**\n * Create a new event instance.\n *\n * @return void\n */\n public function __construct(Room $room, $user)\n {\n $this->room = $room;\n $this->user = $user;\n }\n\n /**\n * Get the channels the event should broadcast on.\n *\n * @return \\Illuminate\\Broadcasting\\Channel|array\n */\n public function broadcastOn()\n {\n return new PrivateChannel('rooms');\n }\n}\n\nThen, when a user joining a room, I dispatch the event :\npublic function joining($user)\n {\n if(! in_array($this->users, $user)) {\n \n $this->users[] = $user;\n // envoyer evenement : room\n $this->emit('newConnection');\n \n\n broadcast(new userConnected($this->room, $user))->toOthers();\n }\n }\n\nAfter that, in my livewire rooms controller, I listen the event like that :\nprotected function getListeners() \n {\n return [\n "echo-presence:rooms,here" =>'here',\n "echo-presence:rooms,joining" =>'joining',\n "echo-presence:rooms,leaving" =>'leaving',\n 'newConnection' => 'newConnection',\n "echo-private:rooms,userConnected" => 'newConnection',\n\n ];\n }\n\nAnd my method :\npublic function newConnection() \n {\n $this->stillConnected = true;\n }\n\nAnd of course, my channels.php file :\nBroadcast::channel('connected', function ($users) {\n return $users;\n});\n\nAnd my questions is : now, how catching the event in my room main livewire controller ?\nBecause they are nothing happens...\nMy variable :\n$stillConnected\n\nstay at false...\nMaybe I'm not doing it right...\nIf someone have a idea..." ]
[ "php", "laravel", "events", "pusher", "laravel-livewire" ]
[ "App Engine Task Queues targeted to a backend instance fail to run", "Our App Engine application uses task queues targeted to a backend instance for certain critical tasks. On Friday, 28th of July, 2016 at approximately 8 PM IST, there were tasks clogged up inside the task queue.\n\nThere were 8 tasks inside the queue. The targeted backend is a dynamic backend that could spawn up to 4 instances. Upon inspecting the the retry logs for the tasks from the dashboard, the clog was due to a 404(Instance Not Available) error. There were no executions for the tasks.\n\nRestarting the backend did resume their execution. This is the third instance of such a problem. The Google Cloud Status page does not show any outages or service disruption for Appengine either." ]
[ "java", "google-app-engine" ]
[ "How to bind events on dinamically created html?", "I have a project in wich when you click tags, the information in the mid section will change by calling a function that changes the current value of the model that is shown as HTML in that specific section.\n\nIf the generated HTML has more tags, how do you bind them to make them call the same mentioned function as the other tags?.\n\n\n\nRight now when you click the tag in the middle the method is not called and nothing changes, but when you click the tags in the upper the part mid section gets re-rendered.\nI've tried with another call to applyBindings but that made the upper tags to duplicate.\n\nThis is the code of the function I want to call:\n\n @Function\n static void changeFP(final Dictionary model) {\n String searchP = model.getSearchPhrase();\n final List<String> listOfTerms = model.getTermList();\n for (int i = 0; i < listOfTerms.size(); i++) {\n final String term = listOfTerms.get(i);\n if (stringsAreEqual(term, searchP)) {\n model.setFoundPhrase(term);\n model.setDescription(model.getDefinitionList().get(i));\n model.setCode(model.getExampleCodeList().get(i));\n return;\n }\n }\n model.setDescription(\"\");\n model.setCode(\"\");\n model.setFoundPhrase(\n ResourceBundle.getBundle(\n \"web/aprendiendola/dictionaryweb/aprendiendola/dictionary/DiccionarioDeJava/TranslateMe\"\n // , Locale.getDefault()\n // ,new Locale(\"ES\")\n ).getString(\"NOTFOUND\"));\n }\n\n\nThe part where it should render is:\n\n<div class=\"card-panel blue lighten-2\">\n <h3 data-bind=\"text: foundPhrase\"></h3>\n <p class=\"white-text\" data-bind=\"html:description\" style=\"min-height: 100px;\"></p>\n</div>\n\n\nThe text that should be rendered is: \n\nCLASS_INFO= <p>Represent types of objects, but can also refer to other non-object conceps as <a class=\"chip blue lighten-3 white-text\" href=\"#\" data-bind=\"click:$root.changeSP \">Package-Info</a></p>\n\n\n(the CLASS_INFO= is because the app is getting internationalized)" ]
[ "dukescript" ]
[ "IOS 7.1 UICollectionView not recognising full click area for drag", "I have a UICollectionView with\n\n\na custom layout that displays the items in a horizontal row\na custom UICollectionViewCell which contains a number of subviews - an image\nand some labels.\n\n\nMultiple instances of the UICollectionView are displayed vertically in a UITableView.\n\nOn iOS 8.1, all works well. Testing on iOS 7.1 though I can not drag the collection unless my finger is in the top third of the row (indicated by the yellow rectangle in the picture).\n\nNote that the UITableView scrolls correctly vertically. \n\nAny suggestions? \n\nThanks in advance, and apologies for the C#.\n\n// The Layout\npublic sealed class SingleRowLayout : UICollectionViewFlowLayout\n {\n public SingleRowLayout()\n {\n this.ItemSize = new CGSize(50, 120); // 120 is the full cell height\n this.ScrollDirection = UICollectionViewScrollDirection.Horizontal;\n }\n }\n\n\n// The UICollectionViewCell\n\npublic sealed class StickerViewCell : UICollectionViewCell\n{\n\n [Export (\"initWithFrame:\")]\n public StickerViewCell (CGRect frame) : base (frame)\n {\n var top = 0f;\n this.imageView = new UIImageView();\n this.imageView.ContentMode = UIViewContentMode.ScaleAspectFit;\n this.imageView.Frame = new CGRect(\n new CGPoint(GridDimensions.ImageInternalSidePadding, top),\n new CGSize(GridDimensions.StickerWidth - (GridDimensions.ImageInternalSidePadding * 2), GridDimensions.StickerHeight)\n );\n\n top = (float)this.imageView.Frame.Height\n this.sequenceTextView = this.createTextView(ref top);\n this.dateTextView = this.createTextView(ref top);\n this.sensationTextView = this.createTextView(ref top);\n\n ContentView.AddSubview(this.imageView);\n ContentView.AddSubview(this.sequenceTextView);\n ContentView.AddSubview(this.sensationTextView);\n ContentView.AddSubview(this.dateTextView);\n\n }\n\n private UILabel createTextView(ref float top)\n {\n var result = new UILabel();\n result.AdjustsFontSizeToFitWidth = true;\n\n result.Frame = new CGRect(\n new CGPoint(2, top),\n new CGSize(GridDimensions.StickerWidth - (2 * 2), GridDimensions.TextHeight)\n );\n top += GridDimensions.TextHeight + GridDimensions.TextFieldSpacing;\n return result;\n }\n\n}" ]
[ "ios", "xamarin", "xamarin.ios" ]
[ "Android Animation Performance", "If I use a gif image instead of an xml file (< animation-list>), would I save processing to display an animation?\n\nI have to build an application where the battery consumption is critical. So I have to search multiple issues like this. \nWhere can I find information related to this?" ]
[ "android", "android-animation", "performance" ]
[ "How to realize an UiTableWiev with placeholders?", "How can i realize an UiTableWiev like this?\n\nhttp://i.stack.imgur.com/8QVb4.jpg\n\nI appreciate everyone who gives me a tutorial.\n\nAlso a table like fb would be fine\nhttp://img688.imageshack.us/img688/4162/photocr.jpg\n\nThanks" ]
[ "uitableview", "ios4", "placeholder" ]
[ "TemplateUrl is not working with System.js", "I have following structure of folder. When i am using templateUrl in app.component.ts it says\n\n \"Failed to load app.component.html ; Zone: <root> ; Task: Promise.then ; \n Value: Failed to load app.component.html \"\n\n\n\n\napp.component.ts\n\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'my-app',\n templateUrl: './app.component.html'\n})\nexport class AppComponent { name = 'Angular'; }\n\n\nsystem.config.js\n\nSystem.config({\n defaultJSExtensions: true,\n map: {\n app:\"applicationStartup\",\n '@angular/core': 'node_modules/@angular/core/bundles/core.umd.js',\n '@angular/common': 'node_modules/@angular/common/bundles/common.umd.js',\n '@angular/compiler': 'node_modules/@angular/compiler/bundles/compiler.umd.js',\n '@angular/platform-browser': \n 'node_modules/@angular/platform-browser/bundles/platform-browser.umd.js',\n '@angular/platform-browser-dynamic': \n 'node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',\n '@angular/router': 'node_modules/@angular/router/bundles/router.umd.js',\n 'rxjs': 'node_modules/rxjs'\n },\n packages : {\n app : {\n main : '../../build/main.js',\n defaultJSExtensions : 'js'\n },\n rxjs :{\n defaultJSExtensions : \"js\"\n }\n }\n});\n\n\napp.module.ts\n\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { AppComponent } from './app.component';\n\n@NgModule({\n imports: [ BrowserModule ],\n declarations: [ AppComponent ],\n bootstrap: [ AppComponent ]\n})\nexport class AppModule { }\n\n\nIndex.html : i have imported app which is defined in system.config.js\n\n<html>\n<head>\n <script src=\"node_modules/core-js/client/shim.min.js\"></script>\n <script src=\"node_modules/zone.js/dist/zone.js\"></script>\n <script src=\"node_modules/reflect-metadata/Reflect.js\"></script>\n <script src=\"node_modules/systemjs/dist/system.src.js\"></script>\n <script src=\"systemjs.config.js\"></script>\n <script>\n System.import('applicationStartup').catch(function (err) {\n console.error(err);\n });\n </script>\n</head>\n\n<body>\n <my-app>Loading...</my-app>\n</body>\n\n</html>\n\n\nCan you please suggest what can be the reason" ]
[ "angular" ]
[ "Authenticate with Identity Server 3 as an Azure AD registered application", "I'm using Identity Server 3 with Azure AD middleware; it works well and I'm able to authenticate as a user via Azure AD. However, I'm trying to extend the implementation such that I can authenticate in a similar manner but as an Azure AD registered application rather than a user. The use case will involve a background application running and authenticating without user input. Has anyone managed to achieve something similar?" ]
[ "azure-active-directory", "identityserver3" ]
[ "Change alpha for a particular graph using layers in ggplot and keep the legend the same?", "Using the following data frame:\n\nsdf<-data.frame(hours=gl(n=3,k=1,length=9,labels=c(0,2,4)), \n count=c(4500,1500,2600,4000,800,200,1500,50,20),\n machine=gl(n=3,k=3,length=9,labels=c(\"A\",\"B\",\"C\")))\n\n\nThe following graph can be produced using either of these scripts:\n\nggplot(data=sdf,aes(x=hours,y=count,group=machine,fill=machine))+\n geom_area(data=sdf[sdf$machine==\"A\",])+\n geom_area(data=sdf[sdf$machine==\"B\",])+\n geom_area(data=sdf[sdf$machine==\"C\",])\n\nggplot(data=sdf,aes(x=hours,y=count,group=machine,fill=machine))+\n geom_area(position=\"dodge\")\n\n\n\n\nThe color can easily be changed, but changing the alpha value also changes the legend: \n\nggplot(data=sdf,aes(x=hours,y=count,group=machine,fill=machine,alpha=machine))+\n geom_area(position=\"dodge\")+\n scale_fill_manual(values=c(\"chocolate1\",\"goldenrod\",\"pink\"))+\n scale_alpha_manual(values=c(0.01, 0.2, .1),guide=F)\n\n\n\n\nIdeally, the legend will not fade to the same alpha values. This might sound strange for an individual graph, but the result will be part of a .gif file.\n\nQuestion: What script can alter the alpha values for individual graphs yet keep the solidity of colors in the legend?" ]
[ "r", "colors", "ggplot2", "alpha" ]
[ "Why am I getting an unexpected return code?", "I have a Perl script with the following code.\n\n...\n$kill = 1;\n$exit = 0;\n`kill -9 $pid >& /dev/null`;\n...\nprint \"kill=$kill exit=$exit\\n\";\nif ($kill) {\n exit $exit;\n} else {\n...\n\n\nIn summary, this script uses open3() to run a command. At some point, it kills the job and then the intention is that the script will exit with code 0. I inserted a print statement to show the values of variables $kill and $exit, which is shown below.\n\nkill=1 exit=0\n\n\nSince $kill is 1, I would expect the script to exit with code 0 above, since $exit is 0. However, the script exits with code 9, which is the signal sent to the child. Why is the Perl script exiting with the exit code of the child, instead of that which is given to the exit() call?" ]
[ "perl" ]
[ "Can you find Measures in OLAPQueryLog?", "Is it possible to find what Measures are used by looking at the OLAPQueryLog?\n\nIt's easy enough to get the attributes and dimensions from the DataSet column. However, I can't see any information about the measures (and calculated measures) that are used.\n\nThe main think I need to do I see how often new measures are used after we release them. \n\nTurning on full event logging would be overkill for my requirements." ]
[ "ssas", "olap" ]
[ "Entity Framework \"Invalid object name 'Item_id'\"", "I have a solution that has spontaneously started generating the error \"Invalid object name 'Item_id'\". I have searched for this but all answers seem related to code first issues around pluralization; my project is database first.\n\nThe context is that there is a Purchase with a collection of ItemPurchaseLines which are linked to Items. The error occurs when a new purchase is generated, this generates new ItemPurchaseLines and either links them to existing Items or generates new Items. The mapping between ItemPurchaseLines and Items is via a foreign key on Item_Id to Id respectively.\n\nI have regenerated the model from the database and the relationships/column mappings all look good.\n\nAny help, or any further information you need, would be appreciated.\n\nEdit\nI have built a LinqToSql alternative and it gives exactly the same error." ]
[ "entity-framework", "linq-to-sql" ]
[ "Run a macro only if the username matches the list", "I am trying to run a macro based on a condition of usernames, where do I make the changes: \n\nfor ex: \nI have the following dataset with usernames:\n\ndata users2; \ninput name$; \n cards; \n ABC\n DEF\n YUT\n GTR\n ; \nrun;\n\n\nI have a macro to call: %callmacro;\n\nproc sql; \nselect name into: usernames separated by ',' from users2; \nquit;\n\n\nso I call the macro \n\n%macro NEW(); \n%if &sysuserid in (&usernames) %then %do;\n%callmacro;\n%end;\n%mend;\n\n\n%new;\n\n\nSo here I get an error :\n\nERROR: Required operator not found in expression: ( \"&sysuserid\" in \n(&usernames))\n\n\nI would like to run a macro only if the username matches in the list. Else is there any way I can call a WINDOWS AD group from SAS macro and check if the sysuserid exixts in that Windows AD group?" ]
[ "sas", "sas-macro" ]
[ "Avg Network Out evaluation for auto scaling", "I have created Elastic beanstalk environment with postgresql RDS. The auto scaling system boots a new instance based on default auto scaling trigger attached to the environment i.e. Avg NetworkOut >= 6MB, in last 5 min. I have following 2 queries related to this.\n\n\nHow to evaluate an appropriate value of this trigger for my Django application ?\nAs per my observation auto scaling threshold exceeds whenever a cron script runs, now I am not able to figure out what part of this cron script should I optimize to not exceed the Avg NetworkOut thresh hold. This script basically performs following actions on ~10,000 records:\na. Bunch of database calls (RDS)\nb. Call Google Map API\nc. Call GCM API\nHow to calculate which of following actions are participating most to exceed the Avg Network Out thresh hold ? so that I can optimize that." ]
[ "amazon-web-services", "amazon-elastic-beanstalk", "autoscaling", "network-monitoring" ]
[ "Epsilon and learning rate decay in epsilon greedy q learning", "I understand that epsilon marks the trade-off between exploration and exploitation. At the beginning, you want epsilon to be high so that you take big leaps and learn things. As you learn about future rewards, epsilon should decay so that you can exploit the higher Q-values you've found. \n\nHowever, does our learning rate also decay with time in a stochastic environment? The posts on SO that I've seen only discuss epsilon decay. \n\nHow do we set our epsilon and alpha such that values converge?" ]
[ "machine-learning", "reinforcement-learning", "q-learning" ]
[ "android fabric: crashlytics+answers", "I'm able to send custom events with answers along with crashreports with crashlytics.However Fabric plugin for android studio suggests me to add following dependency:\n\ncompile('com.crashlytics.sdk.android:answers:1.3.13@aar') {\n transitive = true;\n}\n\n\nDo I need this dependency?" ]
[ "android", "crashlytics", "google-fabric" ]
[ "WxPython Resize an Image using GridBagSizer", "I am sorry if this is too simple... I tried to add a logo to my first GUI, however, I am not sure what is the best way to resize it. At this moment, I am using image.Scale to adjust the logo size and place GridBagSizer.\n\n self.image = wx.Image(\"logo11w.png\", wx.BITMAP_TYPE_ANY)\n w = self.image.GetWidth()\n h = self.image.GetHeight()\n self.image = self.image.Scale(w/8, h/8)\n self.sb1 = wx.StaticBitmap(self.panel, -1, wx.BitmapFromImage(self.image))\n self.sizer.Add(self.sb1, pos=(0, 0), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)\n\n\n. \n\nI am wondering if there is an auto way to do this? Since I am using GridBagSizer, is it possible to leave one \"grid\" (e.g., 1 by 1 \"box\") for my logo? Thanks in advance!\n\nCode:\n\nimport wx\n\nclass landing_frame(wx.Frame):\n def __init__(self, parent, title): \n wx.Frame.__init__(self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size(800, 600), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )\n self.font1 = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.BOLD) \n self.InitUI()\n self.Centre()\n self.Show() \n\n def InitUI(self):\n self.panel = wx.Panel(self)\n self.sizer = wx.GridBagSizer(5, 15)\n\n self.image = wx.Image(\"logo11w.png\", wx.BITMAP_TYPE_ANY)\n w = self.image.GetWidth()\n h = self.image.GetHeight()\n self.image = self.image.Scale(w/8, h/8)\n self.sb1 = wx.StaticBitmap(self.panel, -1, wx.BitmapFromImage(self.image))\n self.sizer.Add(self.sb1, pos=(0, 0), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)\n\n\n self.text1 = wx.StaticText(self.panel, label=\"Welcome!\")\n self.sizer.Add(self.text1, pos=(0, 2), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=15)\n\n line = wx.StaticLine(self.panel)\n self.sizer.Add(line, pos=(1, 0), span=(1, 5), flag=wx.EXPAND|wx.BOTTOM, border=10)\n\n self.text2 = wx.StaticText(self.panel, label=\"Question 1?\")\n self.sizer.Add(self.text2, pos=(2, 0), flag=wx.ALL, border=10)\n\n self.sampleList = ['Op1', 'Op2', 'Op3']\n self.combo = wx.ComboBox(self.panel, 10, choices=self.sampleList)\n self.sizer.Add(self.combo, pos=(2, 1), span=(1, 5), flag=wx.EXPAND|wx.ALL, border=10)\n\n self.input1 = wx.StaticText(self.panel, 11, label=\"Please Enter Filepath\")\n self.sizer.Add(self.input1, pos=(3, 0), span=(1, 1), flag=wx.ALL , border=10)\n\n self.input2 = wx.FilePickerCtrl(self.panel, 12, wx.EmptyString, u\"Select a file\", u\"*.*\", wx.DefaultPosition, wx.DefaultSize, wx.FLP_DEFAULT_STYLE )\n self.sizer.Add(self.input2, pos=(3, 1), span=(1, 20), flag=wx.EXPAND|wx.ALL, border=10)\n\n self.input3 = wx.StaticText(self.panel, 13, label=\"Additional inputs\")\n self.sizer.Add(self.input3, pos=(4, 0), flag=wx.ALL , border=10)\n\n self.input4 = wx.TextCtrl(self.panel, 14, 'E.g. ...', wx.DefaultPosition, wx.DefaultSize, 0, wx.DefaultValidator )\n self.sizer.Add(self.input4, pos=(4, 1), span=(1, 10), flag=wx.EXPAND|wx.ALL, border=10)\n\n self.panel.SetSizer(self.sizer)\n\nif __name__ == '__main__':\n app = wx.App(redirect=False, filename=\"mylogfile.txt\")\n landing_frame(None, title=\"Test\")\n app.MainLoop()\n\n\nHere is the logo" ]
[ "user-interface", "wxpython" ]
[ "Laravel Mix - can't use jQuery in template", "I use Laravel 5.6, I removed Vue.JS to use jQuery on my project. I can use jQuery in my JS files, but I can't use it in my template.\n\nI created an yield to put Javascript, this yield is loaded at the end of the page.\n\nI looked at app.js and bootsrap.js default files, it seems that jQuery is loaded in boostrap : \n\ntry {\n window.$ = window.jQuery = require('jquery');\n\n require('bootstrap');\n} catch (e) {}\n\n\nI tried to define the global in my app.js :\n\nlet $ = require('jquery');\n// create global $ and jQuery variables\nglobal.$ = global.jQuery = $;\n\n\nAnd I put this in my webpack.mix.js :\n\nmix.autoload({\n jQuery: 'jquery',\n $: 'jquery',\n jquery: 'jquery'\n});\n\n\nI got no errors, I just can't use $ or jQuery in my blade templates, I have this message :\n\n\n Uncaught ReferenceError: $ is not defined\n\n\nIn Symfony 4, I only put the global $ in app.js, and it works. What do I miss ?\n\nMy app.js :\n\nrequire('./bootstrap');\nrequire('./custom-checkboxes');\n\n$(function() {\n $('body').click(function(e) {\n // it works\n });\n});\n\n\nMy webpack.min.js :\n\nmix.js('resources/assets/js/app.js', 'public/js')\n .sass('resources/assets/sass/app.scss', 'public/css')\n .sass('resources/assets/sass/pages/homepage.scss', 'public/css')\n .sass('resources/assets/sass/pages/calendar.scss', 'public/css')\n;\nmix.autoload({\n jQuery: 'jquery',\n $: 'jquery',\n jquery: 'jquery'\n});\n\nmix.copyDirectory('resources/assets/img', 'public/img');\n\nif (mix.inProduction()) {\n mix.version();\n}\n\n\nMy bootstrap.js :\n\nwindow._ = require('lodash');\nwindow.Popper = require('popper.js').default;\n\n/**\n * We'll load jQuery and the Bootstrap jQuery plugin which provides support\n * for JavaScript based Bootstrap features such as modals and tabs. This\n * code may be modified to fit the specific needs of your application.\n */\n\ntry {\n window.$ = window.jQuery = require('jquery');\n\n require('bootstrap');\n} catch (e) {}\n\n...." ]
[ "laravel", "laravel-mix" ]
[ "how to set a value to a tbody, thead in a display tag", "I use a display table to generate a table, i\nwould like to set a value to class property for the tbody and thead.\n\nIt don't seem to have an option to do that." ]
[ "jsp", "taglib", "displaytag" ]
[ "Splitting a Bézier curve", "Say I have four points that define a Bézier curve. I'd like to implement a function in VC++ that would split this curve at a percentage X in order to generate the points for two new Bézier curves that, when drawn, would appear to exactly overlap the first curve. Can anyone provide code that does something like this?\n\nThanks for any help.\n\nRegards,\nKevin" ]
[ "visual-c++", "math", "bezier" ]
[ "Protractor. DragAndDrop doesn't work", "DragAndDrop doesn't work for me. I try to move item of list and it moves a little bit, but still at the same place.\nWhen I move element a new item of list is creates, look at the image.\nHave you any ideas?\nHere is my code:\n\nvar dragElement = element(by.id(\"i3\"));\nvar dropElement = element(by.id(\"i1\"));\nbrowser.actions().dragAndDrop(dragElement, dropElement).perform();\n\n\nAnd here is my page:\n\n<ol ui-tree-nodes=\"\" ng-model=\"$ctrl.items\" class=\"list-group canSorting ng-pristine ng-untouched ng-valid ng-scope angular-ui-tree-nodes ng-not-empty\">\n <!-- ngRepeat: item in $ctrl.items --><li collapsed=\"true\" ng-repeat=\"item in $ctrl.items\" ui-tree-node=\"\" class=\"list-group-item p0 ng-scope angular-ui-tree-node\">\n <table width=\"100%\">\n <tbody><tr>\n <td style=\"vertical-align: middle !important;\" class=\"text-center p0\" width=\"1\">\n <i id=\"i0\" class=\"btn btn-sm glyphicon glyphicon-resize-vertical angular-ui-tree-handle ng-scope\" ui-tree-handle=\"\"></i>\n </td>\n <td class=\"ng-binding\" style=\"border-left: 1px solid #ccc; padding-left: 6px;\">\n Раздел 1\n </td>\n </tr>\n </tbody></table>\n </li><!-- end ngRepeat: item in $ctrl.items --><li style=\"\" collapsed=\"true\" ng-repeat=\"item in $ctrl.items\" ui-tree-node=\"\" class=\"list-group-item p0 ng-scope angular-ui-tree-node\">\n <table width=\"100%\">\n <tbody><tr>\n <td style=\"vertical-align: middle !important;\" class=\"text-center p0\" width=\"1\">\n <i id=\"i1\" class=\"btn btn-sm glyphicon glyphicon-resize-vertical angular-ui-tree-handle ng-scope\" ui-tree-handle=\"\"></i>\n </td>\n <td class=\"ng-binding\" style=\"border-left: 1px solid #ccc; padding-left: 6px;\">\n Раздел 2\n </td>\n </tr>\n </tbody></table>\n </li><!-- end ngRepeat: item in $ctrl.items --><li style=\"\" collapsed=\"true\" ng-repeat=\"item in $ctrl.items\" ui-tree-node=\"\" class=\"list-group-item p0 ng-scope angular-ui-tree-node\">\n <table width=\"100%\">\n <tbody><tr>\n <td style=\"vertical-align: middle !important;\" class=\"text-center p0\" width=\"1\">\n <i id=\"i2\" class=\"btn btn-sm glyphicon glyphicon-resize-vertical angular-ui-tree-handle ng-scope\" ui-tree-handle=\"\"></i>\n </td>\n <td class=\"ng-binding\" style=\"border-left: 1px solid #ccc; padding-left: 6px;\">\n Раздел c пройденным тестом\n </td>\n </tr>\n </tbody></table>\n </li><!-- end ngRepeat: item in $ctrl.items --><li style=\"\" collapsed=\"true\" ng-repeat=\"item in $ctrl.items\" ui-tree-node=\"\" class=\"list-group-item p0 ng-scope angular-ui-tree-node\">\n <table width=\"100%\">\n <tbody><tr>\n <td style=\"vertical-align: middle !important;\" class=\"text-center p0\" width=\"1\">\n <i id=\"i3\" class=\"btn btn-sm glyphicon glyphicon-resize-vertical angular-ui-tree-handle ng-scope\" ui-tree-handle=\"\"></i>\n </td>\n <td class=\"ng-binding\" style=\"border-left: 1px solid #ccc; padding-left: 6px;\">\n Раздел 3\n </td>\n </tr>\n </tbody></table>\n </li><!-- end ngRepeat: item in $ctrl.items -->\n</ol>\n\n\nscreenshot" ]
[ "drag-and-drop", "protractor", "action", "autotest" ]
[ "Dynamically changing jqgrid's direction", "I have a grid which I want to show dynamically on 2 directions when the default one is ltr.\n\nI want to be able to change the grid direction to rtl and to reload its content on a button click. \n\nHow can I dynamically change the grid's direction?\n\nUPDATE:\n\nI'm using $('#grid').setGridParam({direction: rtl\\ltr}) according to the direction I want , and the grid's content is changed, but the columns are the same as they were. is there a way to change the columns direction as well? \n\nThank's In Advance." ]
[ "jqgrid" ]
[ "401 Access denied. You are not authorized to read activity records", "I'm trying to get data from Reports API.\n\nI get access token for service account and using it in GET request. Response always\n\n{\n \"error\": {\n \"errors\": [\n {\n \"domain\": \"global\",\n \"reason\": \"authError\",\n \"message\": \"Access denied. You are not authorized to read activity records.\",\n \"locationType\": \"header\",\n \"location\": \"Authorization\"\n }\n ],\n \"code\": 401,\n \"message\": \"Access denied. You are not authorized to read activity records.\"\n }\n}\n\n\nI'm using Java for request. Without Google API library (client requirement). Source code is\n\nString urlString = \"https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/drive?maxResults=25\";\n\n URL url = new URL(urlString);\n HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();\n\n // optional default is GET\n urlConnection.setRequestMethod(\"GET\");\n urlConnection.setDoInput(true);\n\n // Add request header.\n urlConnection.setRequestProperty(\"Authorization\", \"Bearer \" + accessToken.getValue());\n\n int responseCode = urlConnection.getResponseCode();\n\n System.out.println(\"\\nSending 'GET' request to URL : \" + urlString);\n System.out.println(\"Response Code : \" + responseCode);\n\n BufferedReader bufferedReader;\n\n if (responseCode == 200) {\n bufferedReader = new BufferedReader(\n new InputStreamReader(urlConnection.getInputStream()));\n } else {\n bufferedReader = new BufferedReader(\n new InputStreamReader(urlConnection.getErrorStream()));\n }\n\n String inputLine;\n StringBuffer stringBuffer = new StringBuffer();\n\n while ((inputLine = bufferedReader.readLine()) != null) {\n stringBuffer.append(inputLine);\n }\n\n bufferedReader.close();\n\n System.out.println(stringBuffer.toString());\n\n\nCan you, please, help me what I'm missing?\n\nRegards,\nAleks." ]
[ "google-api", "google-admin-sdk", "service-accounts", "google-reporting-api" ]
[ "htaccess regex for number greater than 1?", "I'm trying to create a rewrite rule to match data-2, data-3, data-4 etc. and send them to data.php?var=2. It needs to ignore data-1.\n\nRewriteRule ^data-([2-9])/?$ index.php?page=data&var=$1 [NC,L]\n\n\nThe above rule works for numbers 2-9, but how can I make it so that it works for any number greater than 1?" ]
[ "regex", ".htaccess" ]
[ "In-MemoryDB: create schema in 'setUp()' of Unit Testing: Netbeans (6.5.1) Hibernate (3) Junit(3), HSQL (1.8)", "What are the steps needed to setup an in-memory DB, build the schema automatically with Hibernate's 'hbm2ddl' tool within a Junit (3) 'setUp()' using Netbeans 6.5.1 ? I'm not using Hibernate annotations - just a mapping file.\n\nFor the actual code, I want to use an on-disk database of course. [that is the Junits live a separate 'test' package]\n\nSo I think this is getting there:\n\n\nCreate a standard Java Project in Netbeans 6.5.1 , add in the Hiberate library.\nCreate the POJOs, hibernate.cfg and hibernate mapping file.\nCopy the cfg and mapping file to the test package.\n\n\nThe setup method looks like this:\n\n protected void setUp() throws Exception {\n Configuration config = new Configuration();\n config.configure();\n SchemaExport exporter;\n exporter=new SchemaExport(config);\n exporter.create(true, true);\n }" ]
[ "hibernate", "netbeans", "junit", "hsqldb", "hbm2ddl" ]
[ "Insert hyperlink into column with data", "I am trying to insert hyperlinks on column A which has data. for example, A1 is the title; A2 will be 12345 with hyperlink of http://123.1.1.1/?id=12345\n\nCurrently I am running the macro on a worksheet that contains around 11000 rows. it's been about an hour, it is still running...\n\nAlso, trying to see if this single macro can work on ALL worksheets.\n\nBelow is my macro\n\nSub AddUrlSheet1()\nWith Worksheets(1)\n\nSet R = ActiveSheet.Range(\"a2\", ActiveSheet.Range(\"a2\").End(xlDown))\nR.Select\n\nFor Each R In Selection.Cells\n\n.Hyperlinks.Add Anchor:=R, _\nAddress=\"http://123.1.1.1/\" & R.Value\n\nNext R\nEnd With\nEnd Sub" ]
[ "vba", "excel" ]
[ "Setting additional fields when creating a container with TRIM ServiceAPI", "I have some code that creates a container in TRIM/HPRM/HPECM which looks like this:\n\nTRIMService.Record preq = new TRIMService.Record() {\n Title = recordTitle,\n LongNumber = recordNumber,\n RecordType = new TRIMService.RecordTypeRef() { Uri = 12345 },\n};\nTRIMService.RecordsResponse pres = trim.Post<TRIMService.RecordsResponse>(preq);\n\n\nI now need to set the value of a TRIM \"additional field\". These are user-defined fields so values for them do not exist in the C# ServiceStack implementation for the TRIM ServiceAPI.\n\nTRIM includes examples for this, but they are HTML based and simply submit the additional fields with their text names, but I can't do this in .NET as it's expecting a structure member rather than a string.\n\nHow does one go about setting these \"additional fields\" in C#.NET with the ServiceAPI?" ]
[ "c#", ".net", "hp-trim" ]
[ "Twitter Bootstrap Carousel is not smooth on Safari", "I implemented Bootstrap Carousel as page transition for site http://singhabenelux.com/. But transition effect displays differently on Chrome and Safari. \nOn safari, effect of changing to new page is not smooth, very slow and it seems old page and new page overlap.\n\nHere is Css code for the carousel:\nhttp://singhabenelux.com/wp-content/themes/dragonfroot/css/carousel.css\n\nI think that -webkit-{attribute} will affect on chrome and safari also, but I don't know why there're difference between Chrome and Safari like this.\n\nI'm testing on:\nChrome 38.0.2125.101\nSafari 5.1.4\nMy OS is Windows8 Pro.\n\nPlease help me.\nThank you so much." ]
[ "twitter-bootstrap", "safari", "carousel", "smooth" ]
[ "Python library written in C++ without runtime redistributable on Windows", "I wrote a python library written in C++14. Since users often do not have a C++ compiler installed, I create wheels for Linux, Windows and MacOS and upload those to pypi. While this works fine for Linux and MacOs, on Windows it is required to install the Microsoft Visual C++ Redistributable for Visual Studio 2015/2017/2019. When thats not done the user will only get a runtime error telling him that it failed to import the dll.\nIs there a way to add this to the wheels, automatically install it, or at least to give the user a warning telling him what exactly he has to do to get it to work?" ]
[ "python", "c++", "windows", "python-wheel" ]
[ "Getting \"400 Bad Request\" when I post shipping status to Shopify", "I try to send the shipping status to Shopify but I get:\n\n\n 400 bad request error.\n\n\nDoes anyone have any ideas?\n\nRestTemplate restTemplate = new RestTemplate();\nrestTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());\nrestTemplate.getMessageConverters().add(new StringHttpMessageConverter());\n\nHttpHeaders headers = new HttpHeaders();\nheaders.add(\"X-Shopify-Access-Token\", \"9a4d5c56a7edf1ac5bb17aa1c\");\nheaders.add(\"Content-Type\", MediaType.APPLICATION_JSON.toString());\nheaders.add(\"Accept\", MediaType.APPLICATION_JSON.toString());\n\nHttpEntity formEntity = new HttpEntity(headers);\nrestTemplate.setRequestFactory(new HttpComponentsClientHttpRequestFactory());\nrestTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());\nResponseEntity<String> responseEntity = restTemplate.exchange(\"https://mysite.myshopify.com/admin/orders/406287121/fulfillments.json\",HttpMethod.POST, formEntity,String.class);\nSystem.out.println(\"Response=\"+responseEntity.getBody());" ]
[ "java", "shopify" ]
[ "Can not access cookies in spring jersey based application", "I am working on spring security implementation module and i need to set and get few cookies. i have tried creating cookies by using (javax.servlet.http.Cookie) and (javax.ws.rs.core.NewCookie) both are working fine for setting cookies, i can see the cookies in the browser but when i am trying to access them, it does give me only JSESSIONID, i need to access other cookies also.\n\nThis is how i am setting the cookies, and in both ways i will save the cookies successfully on the browser:\n\nCookie cookieOne = new Cookie(\"SERVLETCOOKIE\", \"TESTING COOKIES\");\n\nNewCookie cookieTwo = new NewCookie(\"WSRSCOOKIE\", \"TESTING COOKIES\");\n\n\nwhen i try to access the cookies, i have tried both @Autowired and @Context as below, but i can only get JSESSIONID cookie. \n\n@Autowired HttpServletRequest request;\nand \n@Context HttpServletRequest request;\n\n\nand i am trying to access the cookies as below :\n\nCookie[] cookieList = request.getCookies();\n\n if(cookieList !=null && cookieList.length >0){\n for(int i=0;i<cookieList.length;i++){\n Cookie cookie = cookieList[i];\n\n if(cookie.getName().equals(\"SERVLETCOOKIE\")){\n String value1 = cookie.getValue();\n logger.info(\"cookie found. value =\"+value1 );\n }\n if(cookie.getName().equals(\"WSRSCOOKIE\")){\n String value2 = cookie.getValue();\n logger.info(\"cookie found. value =\"+value2 );\n }\n }\n }\n\n\nIt would be great if someone help me point out the way i can get all the other cookies." ]
[ "java", "spring", "rest", "cookies", "jersey-client" ]
[ "Cassandra sort not by primary key", "I'm trying to model a table in Cassandra, I'm quite new and stumbled upon one problem. I've got the following:\n\nCREATE TABLE content_registry (\n service text,\n file text,\n type_id tinyint,\n container text,\n status_id tinyint,\n source_location text,\n expiry_date timestamp,\n modify_date timestamp,\n create_date timestamp,\n to_overwrite boolean,\n PRIMARY KEY ((service), file, type_id)\n);\n\n\nSo as I understand:\n\n\nservice is my partition key and based on this value hashes will be generated and values will be split in cluster\nfile is clustering key\ntype_id is clustering key\nThese three bodies combine a composite (compound) primary key\n\n\nWhat I've figured out is that whenever I'll insert new data, Cassandra will upsert (either insert or update if the value with that compound primary key exists)\n\nNow what I'm struggling is, that I want my data to come back sorted by create_date in descending order, however create_date is not part of primary key.\n\nIf I add create_date to my primary key, I won't be able to upsert data, because create_date means timestamp when record was inserted, so if I add it to primary key every time there's an insert, I'll end up with multiple records.\n\nWhat are the other options? Order in application? That doesn't seem very efficient." ]
[ "cassandra", "cql", "cql3" ]
[ "Javascript : onclick=\"class method\" => possible?", "I have a class who has a method generating 100 input text.\n\nAnd I want to add another method (to set a instance property for example) in these input text. \n\nHere the code below :\n\n<div id=\"container\"></div>\n\n<script type=\"text/javascript\">\n\ncontainer = document.getElementById(\"container\");\n\n//Class :\nfunction Foo(age)\n{\n //Attribute :\n this.age = age;\n\n //Setter :\n this.setAge = function(age)\n {\n this.age = age;\n\n console.log(this.age);\n };\n\n this.displayInputText = function()\n {\n for(var i = 0; i < 100; i++)\n {container.innerHTML += '<input type=\"text\" onkeyup=\"'+this.setAge(value)+';\">';}\n };\n}\n\nfoo1 = new Foo(32);\nfoo1.displayInputText();\n\n</script>\n\n\nBut onkeyup=\"'+this.setAge(value)+'\" generates javascript error in console, so it doesn't work.\n\nHave you an idea ? \n\nThank you, cordially." ]
[ "javascript", "class-method", "eventhandler" ]
[ "How do I allow inline images with data urls on .NET 4 without triggering request validation?", "I'm using the jQuery jstree plugin (http://jstree.com) in a ASP.NET MVC 2 project on .NET 4 RC, and running on IIS 7.5. It comes with some stylesheets with inline images with data urls, like this:\n\n\n .tree-checkbox ul {\n background-image:url(data:image/gif;base64,R0lGODlhAgACAIAAAB4dGf///yH5BAEAAAEALAAAAAACAAIAAAICRF4AOw==);\n }\n\n\nNow, the url for the background image contains a colon, which .NET 4 thinks is an unsafe character, so I get this error message:\n\n\n A potentially dangerous Request.Path\n value was detected from the client\n (:).\n\n\nAccording to the documentation, I am supposed to be able to prevent this by adding \n\n\n <system.web>\n <httpRuntime requestValidationMode=\"2.0\"/>\n <pages validateRequest=\"false\"/>\n <system.web> \n\n\nto my Web.config, but that doesn't seem to help. I have tried adding it to the main Web.config for the application, as well as to a special Web.config in the /config folder, but to no avail.\n\nIs there any way to get .NET to allow this?" ]
[ "asp.net-mvc", "validation", "url", ".net-4.0", "request" ]
[ "How to use a variable to construct command", "I have a variable in Xcode that I need to use to construct another command. How to I combine this? This is the concept\n\nI have a variable named \"activechannel1\" and buttons Overlay1 - Overlay12\n\nI want to set the image of a particular button and the button will depend on the value of activechannel1. All the numbers correspond to file names so I am trying to do this.\n\nLet's say that\n\nActiveChannel1 = 6 // This changes and represents which button I want to change\n\n\nI am trying to do this but am getting a consecutive statement error:\n\nOverlay\"\\(ActiveChannel1)\".image = UIImage(named: \"y\\(ActiveChannel1)\")\n\n\nWhich I want to essentially yield:\n\nOverlay6.image = UIImage(named \"y6\")" ]
[ "xcode", "swift", "swift2", "xcode7" ]
[ "wstring to LPCWSTR not working with c_str()", "I am currently doing DirectX11 and trying to convert a UTF8 string into a LPCWSTR. I've written a utility function to aid me in the conversion:\n\n// Convert an UTF8 string to a wide Unicode String\nstd::wstring WidenString(const std::string &string)\n{\n int size_needed = MultiByteToWideChar(CP_UTF8, 0, string.c_str(), string.size(), NULL, 0);\n std::wstring wstring(size_needed, 0);\n MultiByteToWideChar(CP_UTF8, 0, string.c_str(), string.size(), &wstring[0], size_needed);\n return wstring;\n}\n\n\nI've used the debugger to verify if it works. This is working:\n\nDebugger says wndClassEx.lpszClassName = L\"Hello\"\n\nstd::wstring str = WidenString(\"Hello\");\nwndClassEx.lpszClassName = str.c_str();\n\n\nThis is not working:\n\nDebugger says wndClassEx.lpszClassName = L\"ﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮﻮ...\"\n\nwndClassEx.lpszClassName = WidenString(\"Hello\").c_str();\n\n\nCan someone explain to me what is wrong with my code?" ]
[ "c++", "visual-c++", "c++11", "directx", "directx-11" ]
[ "pandas print dataframe in required format", "I have data in this form:\n\nSample Cohort CName Intensity\nS1 a C1 22.34\nS2 a C2 17.34\n\n\nI want to print it in this form\n\nCohort Intensity1 Intensity2\na 22.34 17.34 \n\n\nPlease suggest how to do it. I am beginner in pandas" ]
[ "python", "pandas", "dataframe" ]
[ "blockstack/pybitcoin different BTC address output", "While I was exploring pybitcoin I ran the following:\n\nfrom pybitcoin import SDWallet, BitcoinKeypair\npassphrase = 'shepherd mais pack rate enamel horace diva filesize maximum really roar mall'\nwallet = SDWallet(passphrase)\nbitcoin_keypair_1 = wallet.keypair(1, BitcoinKeypair)\nbitcoin_keypair_1.passphrase()\n>>> 'shepherd mais pack rate enamel horace diva filesize maximum really roar mall bitcoin1'\nbitcoin_keypair_1.address()\n>>> '1DS2vmsqTwtXp1DfmDHi55Aqc6w4LBUC9k'\n\n\nWhen I try to generate BTC address here using the same passphrase \"shepherd mais pack rate enamel horace diva filesize maximum really roar mall\", I got a different result which is 13mtgVARiB1HiRyCHnKTi6rEwyje5TYKBW\n\nI tried to change the entropy from 160 to 128 in the source code but it doesn't change the result.\n\nWhat could be the reason why pybitcoin gives different output?\nThe repository is quite outdated so I haven't post a new issue." ]
[ "python", "bitcoin", "deterministic", "passphrase", "blockstack" ]
[ "GMail Contexual Gadget - Multiple pattern to match more than one condition", "i'm developing a simple GMail Contextual Gadget (for now if 2 conditions are met there is a simple \"hello world\" in the gmail page).\nBut i need to match a double condition, and not only one. Because of that, i can't use the precanned extractors (if i use two extractor in the manifest, using the precanned ones, they work on OR condition).\n\nAccording to this article there is a way to match a double condition:\n\n\n Custom extractors allow developers to trigger their gadget when a series of conditions are met. For example, a developer could write an extractor that triggered a gadget only when “Hello world” appeared in the subject and “[email protected]” was the sender of the email. This allows developers to more finely tune their gadgets, and provide even more relevant contextual information.\n\n\nThis is exactly what i need, i need to match if the sender is \"[email protected]\" AND the subject is \"zzz\".\n\nThe problem is that i can't find any references about this problem in the google api page\n\nHow can i defined a double AND condition in a custom extractor? \n\nThanks\nBye" ]
[ "javascript", "gmail", "text-extraction", "gmail-contextual-gadgets" ]
[ "Flot Chart (Array 3 values)", "I'd like to know if is possible to do that with Flot chart, because I'm not sure...\n\nI have a table on a database with 3 rows: Date Start, Date End, Medication\n\nMi PHP code: \n\n$sql = \"SELECT * FROM medications ORDER BY DateStart\";\n$stmt = $PDO -> query($sql);\n$result=$stmt -> fetchAll(PDO::FETCH_ASSOC);\n\nforeach ($result as $row){\n$dateini= $row['DateStart'];\n$datend= $row['DateEnd']; \n$medic= $row['Medication'];\n\n$data1 = array(strtotime($dateini)*1000,$medic);\n$data2 = array(strtotime($datend)*1000,$medic);\n\n$data3[] = array($data1,$data2);\n\n}\n\n\nIf I do:\n\necho json_encode($data3);\n\n\nI get the array:\n [[[1456531200000,\"12\"],[1456704000000,\"12\"]],[[1456531200000,\"16\"],[1456704000000,\"16\"]],[[1456617600000,\"13\"],[1456790400000,\"13\"]],[[1456704000000,\"14\"],[1457049600000,\"14\"]]]\n\n<script>\nvar data3 = <?php echo json_encode($data3)?>;\n\n$(function() {\nvar datasets = [\n{\n label: \"Medication\",\n data: data3,\n yaxis: 1,\n color: \"Yellow\",\n points: { symbol: \"diamond\", fillColor: \"Yellow\",show: true, radius: 6}\n\n}\n];\n\n $.plot($(\"#flot-placeholder\"), datasets ,options); \n</script>\n\n\nThis: $.plot($(\"#flot-placeholder\"), datasets ,options) don't plot anything, but if I do:\n\n$.plot($(\"#flot-placeholder\"), data3,options); \n\n\nI get \n\n\nIt would be possible to get the graphic writing datasets (in $.plot) instead data3?" ]
[ "php", "mysql", "flot" ]
[ "Trouble gathering Scanner data", "QUESTION: How do I gather all the information a user enters, store them into an ArrayList and\n display all of the inputted answers? I'm supposed to enter six teams names, wins, division, etc and display them into a table with System.out.println(); as I have attempted at the end of my for-loop\n\npublic class PlayoffSelectorClass extends Team {\n\n// main method\n public static void main(String[] args) {\n Team team1 = new Team();\n Team team2 = new Team();\n Team team3 = new Team();\n Team team4 = new Team();\n Team team5 = new Team();\n Team team6 = new Team();\n\n for (int i = 0; i < 6; i++) {\n\n Scanner input = new Scanner(System.in);\n\n System.out.println(\"Please enter team name: \");\n String name = input.nextLine();\n\n System.out.println(\"\\nPlease enter the city \" + name + \" played in: \");\n String city = input.nextLine();\n\n System.out.println(\"\\nPlease enter the division \" + name + \" play in: \");\n String division = input.nextLine();\n\n System.out.println(\"\\nPlease enter the number of wins \" + name + \" has: \");\n Integer wins = input.nextInt();\n\n System.out.println(\"\\nPlease enter the number of losses \" + name + \" has: \");\n Integer loses = input.nextInt();\n\n if (i < 5) {\n System.out.println(\"\\nEnter your next team...\\n\");\n }\n\n team1.setTeamName(name);\n team1.setCity(city);\n team1.setDivision(division);\n team1.setWins(wins);\n team1.setLoses(loses);\n\n }\n\n System.out.println(\"East W L PCT\");\n\n System.out.println(team1.getTeamName() + \" \" + team1.getWins() + \" \" + team1.getLoses());\n System.out.println(team1.getTeamName() + \" \" + team1.getWins() + \" \" + team1.getLoses());\n\n\n }\n}" ]
[ "java", "inheritance", "arraylist", "polymorphism" ]
[ "Android reading multiple mp3 files", "This question has two parts\n\nFirst\n\nI read multiple mp3 files from my phones storage (a few hundreds) and save them in an ArrayList of class Song wich I made\n\nclass Song\n{\n String name, path, album, artist, duration;\n Bitmap cover;\n}\n\n\nAnd I keep runing out of memory, so how should i save them?\n\nSecond\n\nReading the files is quite slow, I curently use this\n\nFile directory = new File(\"/storage/3666-6134/Music\");\nFile[] files = directory.listFiles();\nfor (File file : files)\n{\n Song temp = new Song(file.getAbsolutePath());\n songs.add(temp);\n}\n\n\nI'm going to guess that there is a faster and/or better way to do this\n\nThank you\n\nEdit:\nSeem that the slowness is also coming from MediaMetadataRetriever setDataSource\nIs there a faster alternitive?" ]
[ "android" ]
[ "Globalizing files (attachments, images) in rails", "We can use globalize gem for globalizing text fields in models. For globalizing(translating) 'designation' attribute of an employee, we use translates :designation in the employee model, and employee.translations prints the translations for the employee object (one object for each supported locale with designation in corresponding locale).\n\nI have a model specific attribute (image for employee) which is a paperclip attachment. Need to globalize the image, so that employee.image will give the actual image for default locale (:en) and employee.image.translations will return all the translations of the image (one image/paperclip attachment for each supported locale)\n\nHow to globalize the paperclip attachments in rails?" ]
[ "ruby-on-rails", "ruby", "globalization", "rails-i18n" ]
[ "What is the equivalent of v4sf and __attribute__ in Visual Studio C++?", "typedef float v4sf __attribute__ ((mode(V4SF)));\n\nThis is in GCC. Anyone knows the equivalence syntax?\nVS 2010 will show __attribute__ has no storage class of this type, and mode is not defined.\nI searched on the Internet and it said\n\nEquivalent to __attribute__( aligned( size ) ) in GCC\nIt is helpful\nfor former unix developers or people writing code that works on\nmultiple platforms that in GCC you achieve the same results using\nattribute( aligned( ... ) )\nSee here for more information:\nhttp://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Type-Attributes.html#Type-Attributes\n\nThe full GCC code is here: http://pastebin.com/bKkTTmH1" ]
[ "visual-studio", "visual-studio-2010", "visual-c++", "gcc", "sse" ]
[ "working with netCDF on python with matplotlib", "So I am pretty new in programming, currently doing some research on netCDF .nc files to work with python. I have the following code which I am sure it will not work. The objective here is to plot a graph simple line graph of 10m u-component of winds over time.\nThe problem I think is that 10m u-component of winds has 4D shape of (time=840, expver=2, latitude=19, longitude=27) while time being only (time=840).\nAny replies or ideas will be much appreciated! The code is as shown:\nfrom netCDF4 import Dataset\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nnc = Dataset(r'C:\\WAIG\\Python\\ERA5_py01\\Downloaded_nc_file/test_era5.nc','r')\n\nfor i in nc.variables:\n print(i)\n\nlat = nc.variables['latitude'][:]\nlon = nc.variables['longitude'][:]\ntime = nc.variables['time'][:]\nu = nc.variables['u10'][:]\n\n\nplt.plot(np.squeeze(u), np.squeeze(time))\nplt.show()" ]
[ "python", "matplotlib", "netcdf", "python-xarray", "netcdf4" ]
[ "Gson: set date formatter for timestamp and timezone", "What pattern should I use for date format 1418805300000-0100 ? (Timestamp and timezone)\n\nGsonBuilder().setDateFormat(\"?????????????-Z\")\n\n\nSolution:\n\n\ncreate new GSON with adapters\n\nprivate static Gson createGson(){\nreturn new GsonBuilder().disableHtmlEscaping()\n .registerTypeHierarchyAdapter(Date.class, new DateTimeSerializer())\n .registerTypeHierarchyAdapter(Date.class, new DateTimeDeserializer())\n .create();\n}\n\n\npublic static MyClass fromJson(String json) {\n return createGson().fromJson(json, MyClass.class);\n}\n\npublic String toJson() {\n return createGson().toJson(this);\n}\n\nJSON Serializer\n\nprivate static class DateTimeSerializer implements JsonSerializer<Date> {\n @Override\n public JsonElement serialize(Date src, Type typeOfSrc, JsonSerializationContext context) {\n // hodgie code\n return new JsonPrimitive(src.getTime() + new SimpleDateFormat(\"Z\").format(src));\n }\n}\n\nDeserializer\n\nprivate static class DateTimeDeserializer implements JsonDeserializer<Date> {\n\n @Override\n public Date deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {\n // hodgie code\n return new Date(Long.valueOf((json).getAsString().substring(0, 13)));\n }\n}" ]
[ "java", "android", "gson" ]
[ "How to connect indicators with slider and getting last image blank in slider", "I am trying to develop a simple slider but getting issues.\n1) I am trying to connect indicators with the slider but it's not taking any action.\n2) I have added 3 images in the slider but in the 4th part, i am getting the blank page.\n\nWould you help me in this?\n\n\r\n\r\n$(document).ready(function() {\r\n $('#slider').on('.carousel', function() {\r\n $holder = $(\"ol li.active\");\r\n $holder.removeClass('active');\r\n var idx = $('div.active').index('div.slide');\r\n $('ol.indicators li[data-slide-to=\"' + idx + '\"]').addClass('active');\r\n });\r\n\r\n $('ol.indicators li').on(\"click\", function() {\r\n $('ol.indicators li.active').removeClass(\"active\");\r\n $(this).addClass(\"active\");\r\n });\r\n});\r\n/*slider*/\r\n\r\n@keyframes slider {\r\n 0% { left: 0; }\r\n 20% { left: 0; }\r\n 25% { left: -100%; }\r\n 45% { left: -100%; }\r\n 50% { left: -200%; }\r\n 70% { left: -200%; } \r\n 75% { left: -300%; }\r\n 95% { left: -400%; }\r\n 100% { left: -400%; }\r\n}\r\n#slider {\r\n overflow: hidden;\r\n}\r\n#slider figure img {\r\n width: 20%;\r\n float: left;\r\n}\r\n#slider figure {\r\n position: relative;\r\n width: 500%;\r\n margin: 0;\r\n left: 0;\r\n text-align: left;\r\n font-size: 0;\r\n animation: 20s slider infinite;\r\n}\r\n.indicators {\r\n position: absolute;\r\n bottom: 10px;\r\n left: 50%;\r\n z-index: 15;\r\n width: 60%;\r\n padding-left: 0;\r\n margin-left: -30%;\r\n text-align: center;\r\n list-style: none;\r\n margin-bottom: 6%;\r\n}\r\n.indicators li {\r\n display: inline-block;\r\n width: 10px;\r\n height: 10px;\r\n margin: 1px;\r\n text-indent: -999px;\r\n cursor: pointer;\r\n background-color: #000\\9;\r\n background-color: rgba(0, 0, 0, 0);\r\n border: 1px solid #fff;\r\n border-radius: 10px;\r\n}\r\n.indicators .active {\r\n width: 12px;\r\n height: 12px;\r\n margin: 0;\r\n background-color: #fff;\r\n}\r\n<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js\"></script>\r\n\r\n<div id=\"slider\">\r\n <ol class=\"indicators\">\r\n <li data-target=\"#slider\" data-slide-to=\"0\" class=\"myCarousel-target active\"></li>\r\n <li data-target=\"#slider\" data-slide-to=\"1\" class=\"myCarousel-target\"></li>\r\n <li data-target=\"#slider\" data-slide-to=\"2\" class=\"myCarousel-target\"></li>\r\n </ol>\r\n\r\n <figure>\r\n <div id=\"slider\" data-ride=\"carousel\" class=\"carousel\">\r\n <div data-slide-no=\"0\" class=\"slide active\">\r\n <img src=\"https://s-media-cache-ak0.pinimg.com/originals/5b/14/bf/5b14bf0a8ded1ad77df5e748afb2c5c4.jpg\">\r\n </div>\r\n <div data-slide-no=\"1\" class=\"slide\">\r\n <img src=\"https://static.pexels.com/photos/9488/nature-flowers-pattern-circle.jpg\">\r\n </div>\r\n <div data-slide-no=\"2\" class=\"slide\">\r\n <img src=\"http://www.greatindex.net/images/www.imgion.com/images/01/Natural-Flower-.jpg\">\r\n </div>\r\n </div>\r\n </figure>\r\n </div>" ]
[ "javascript", "jquery", "html", "css", "carousel" ]
[ "Why does a simple google.load('visualization....call throw an error?", "I am simply trying to load the google visualization package so I can query a Fusion Table to find some map bounds. \n\nHere are the four lines of code that are causing the trouble:\n\n <script src=\"https://www.google.com/jsapi\"></script>\n <script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"></script <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\"></script>\n <script src=\"https://maps.googleapis.com/maps/api/js?v=3.exp\"></script><script>\n\n google.load('visualization', '1', {'packages':['corechart', 'table', 'geomap']}, callback:function() { alert('!'); }});\n\n\nIf I comment out google.load, all is well, but otherwise the above does not work even though it is copied from this working code example: Google Maps API - Zoom to Fusion Table Layer Query Results\n\nUltimately I would like to implement the zoomTo() function from the reference SO post, but as is I cannot even run the google.load function without all my javascript failing. \n\nscriptInjector.js:188 sI: about to establish extension connection for WIDGET_CONTENT_MESSAGE - url: http://gfsfshfs8/hmap.php\nscriptInjector.js:191 sI: adding WIDGET_CONTENT_MESSAGE message listener\nreservespaceifenabled.js:5 rsie: reserveSpace\nreservespaceifenabled.js:7 rsie: getToolbarData\nreservespaceifenabled.js:66 rsie: leaving js\nhmap.php:99 Uncaught SyntaxError: Unexpected token :\nreservespaceifenabled.js:15 rsie: getToolbarDataCallback(Arguments[1])\nreservespaceifenabled.js:25 rsie: window.toolbarData: Object\nreservespaceifenabled.js:26 rsie: window.Content: undefined\nreservespaceifenabled.js:35 rsie: getToolbarDataCallback - done\ncontentScript.js:42 cS: logger: Array[1] : undefined\ncontentScript.js:42 cS: logger: Array[1]0: Array[1]length: 1__proto__: Array[0] : undefined\ncontentScript.js:42 cS: logger: Array[1] : document ready\ncontentScript.js:42 cS: logger: Array[1] : running callback\ncontentScript.js:42 cS: logger: Array[1] : undefined\ncontentScript.js:42 cS: logger: Array[1] : firing tab complete\ncontentScript.js:80 cS: sending TAB_COMPLETE" ]
[ "javascript", "google-visualization" ]
[ "AuthenticationFailed Azure Table Storage", "We are getting a random error from table storage when accessing data:\n\nSystem.Data.Services.Client.DataServiceClientException: <?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n <code>AuthenticationFailed</code>\n <message xml:lang=\"en-US\">Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\nRequestId:67cd9503-7a10-48a9-8c97-fee3906ac8cb\nTime:2012-06-19T08:20:42.0670051Z</message>\n</error>\n at System.Data.Services.Client.QueryResult.Execute()\n at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)\n\n\nHere are some facts about the error and our web application:\n\n\nWe have 5 medium webservers hosting our site\nAt any given time there are 200-500 visiors on our site. And they are\nconstantly clicking around. \nData is loaded from table storage on every click, it may be saved as well. \nThe error only happens 20-50 times a day.\n\n\nWhat puzzles me is the infrequent occurrence of this error compared to the massive amount of page loads and AJAX callbacks going on.\n\nWhat is the cause of this error? We have read that there may be a time stamp issue if the server time is off but why would the time be wrong on our live server and why isn't the error happening constantly then?" ]
[ "exception", "azure", "azure-table-storage" ]
[ "Member function template of nested class in template class", "I was messing around with templates in MSVC 2019 and encountered the following situation:\ntemplate <class T>\nclass A {\n struct B;\n}\n\ntemplate <>\nstruct A<int>::B {\n template <class U>\n void f(U u); \n}\n\ntemplate <class U>\nvoid A<int>::B::f(U u) {\n\n}\n\nint main() {\n return 0;\n}\n\nwhich produces\nthe following compiler error:\n\nC2244 unable to match function definition to an existing declaration\n\nMy question is: can I have a class template with a nested struct, and then define this struct only for one specialization of that enclosing class such that the struct has a template member function?\n\nObs1: Firstly, I thought this was due to A templated with int not being instantiated yet, but adding an explicit instantiation of A with int template parameter does not help. \nObs2: Defining f inline inside the class body does fix the problem, however I want to be able to specialize f.\n\nEnglish is not my primary language, forgive me for any mistakes I may have made." ]
[ "c++", "templates" ]
[ "Estimate Core capacity required based on load?", "I have quad core ubuntu system. say If I see the load average as 60 in last 15 mins during peak time. Load average goes to 150 as well.\n This loads happens generally only during peak time. Basically I want to know if there is any standard formula to derive the number of cores ideally required to handle the given load ? \n\nObjective :-\n If consider the load as 60 then it means 60 task were in queue on an average at any point of time in last 15 mins ? Adding cpu can help me to server the\n request faster or save system from hang or crashing ." ]
[ "linux", "performance", "cpu", "cpu-usage", "cpu-architecture" ]
[ "Wix Setup: conditional installation of windows service or standalone application", "I have a wix setup project with bootstrapper and I want to install a exe which can be runned as a Windows Service or as a standalone application.\nI prepared an UI so user can choose which version should be installed.\nEverything works as expected except one thing: uninstall.\nWhen I install as a widnows service, exe file is saved in INSTALLATION_DIR and service is isntalled an runned (checked by using services.msc).\nWhen I uninstall it and install again as a standalone version, it uninstalls service from services.\nBut the problem appears, when I tried to do it few times (install as a service, uninstall, install as an application, uninstall) - after 2-3 loops like that, something is broken. During next uninstall, the files are removed, but .exe file is still in INSTALLATION_DIR and the service is not removed from services.msc.\nConditional installation here:\n<ComponentGroup Id="ServiceComponent" Directory="INSTALLFOLDER">\n <ComponentGroupRef Id="OtherBinariesWIthoutExeFile" />\n\n <Component Id="ExeService" Guid="{MY-GUID1}" SharedDllRefCount="yes">\n <Condition>USER_SELECTION="0"</Condition>\n <File\n Id="ExeServiceFile"\n Name="MyFile.exe"\n Source="Build\\MyFile.exe"\n KeyPath="yes"\n Vital="yes">\n </File>\n <ServiceInstall\n Id="ServiceInstaller"\n Name="MyServiceName"\n Type="ownProcess"\n Start="auto"\n ErrorControl="critical"\n Account="LocalSystem"\n Vital="yes"/>\n <ServiceControl\n Id="ServiceController"\n Name="MyServiceName"\n Start="install"\n Stop="both"\n Remove="both"\n Wait="yes" />\n </Component>\n <Component Id="ExeApplication" Guid="{MY-GUID2}" SharedDllRefCount="yes">\n <Condition>USER_SELECTION="1"</Condition>\n <File\n Id="ExeApplication"\n Name="MyFile.exe"\n KeyPath="yes"\n Source="Build\\MyFile.exe"\n Vital="yes">\n </File>\n </Component>\n\n</ComponentGroup>\n\nDo you have any ideas what is wrong with this coniguration?\nI tried both yes/no in SharedDllRefCount and the result is the same.\nI am using Wix v3.14.0.4118" ]
[ "c#", "installation", "wix", "windows-installer", "wix3" ]
[ "building hdf5 with multiprocessing support and use it in python virtual environment", "libhdf5-1.10-dev is installed on my Ubuntu 18.04 system via package manager and I am using virtual environments for python with the h5py binding. \n\nHow can I get hdf5 parallel to work in this situation?\n\nI read that I have to build the lib from source with the respective multiprocessing support. But how does this effect then the virtual environment if it does?\n\nI am confused, does somebody care to shed some light please?" ]
[ "python", "parallel-processing", "hdf5", "h5py" ]
[ "Why are Google Maps 'GroundOverlay's rendered differently than 'Rectangle's when their bounding boxes cross the 180th meridian?", "I am having an issue with a JS Google Map, with a ground overlay with bounds that cross the 180th meridian (when the Longitude changes from 180 to -180). It is rendered incorrectly, with it being stretched between the bounds the wrong way around.\nAre there any work-arounds to this issue, assuming it is a bug in Google Maps?\n\nvar map = new google.maps.Map(document.getElementById('map'), {\n zoom: 3,\n center: new google.maps.LatLng(-27.64, 172.44)\n });\n\n var imageBounds = new google.maps.LatLngBounds(\n new google.maps.LatLng(-43.64, 172.44),\n new google.maps.LatLng(-16.689999999999998, -179.87)\n );\n\n var overlay = new google.maps.GroundOverlay(\n 'https://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',\n imageBounds);\n overlay.setMap(map);\n\n var rectangle = new google.maps.Rectangle({\n strokeColor: '#FF0000',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#FF0000',\n fillOpacity: 0.35,\n map: map,\n bounds: imageBounds\n });\n\n\nHere is a JSFiddle: https://jsfiddle.net/peteroomen/m2e4d57x/15/" ]
[ "javascript", "google-maps" ]
[ "How to show the disk name and capacity of external storage in android", "I am creating an android application that had to work with the external storage.I want to display the list of external storage devices with its external storage name and its free space and its total space can any one tell me how to display capacity and free space and name of a disk in android.\n\nI did some thing to check external devices in a list view:\n\nif (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) { \n Devices_Temp++;\n i += \"\\n\" +\n \"DeviceName: \" + device.getDeviceName() +\"\\n\"+\n \"VendorID: \" + device.getVendorId() +\"\\n\" +\n \"ProductID: \" + device.getProductId() + \"\\n\";\n String path = Environment.getExternalStorageDirectory().getAbsolutePath();\n StatFs statfs = new StatFs(Environment.getExternalStorageDirectory().getPath());\n long bytes_available = (long)statfs .getBlockSizeLong()*(long)statfs.getAvailableBlocksLong();\n long total_bytes_count=bytes_available/(1024*1024);\n String_Array_Dynamic_Genaration.add(\"Free space : \"+total_bytes_count);\n}" ]
[ "android-external-storage" ]
[ "How does the method assigns the array?", "I am confused about how the array was assigned to any data, as the method meant to be a self contain\nor I haven't understood a fundamental concept\n// Craft stall stock and till program \nimport java.util.Scanner;\npublic class revisonTest {\npublic static void main(String[] args) // where program exicutes \n{\n final int numOFitems = 50;\n \n String[] item = new String[numOFitems];\n int [] broughtItem = new int[numOFitems];\n int[] costItem = new int[numOFitems];\n \n int COUNT = getDetail(item,broughtItem,costItem);\n System.out.println(item[0]);\n\n}\n \n\npublic static int getDetail(String[] name,int[] quantities,int[]cost)\n{\n int count =1;\n int arrayIndex =0;\n String answer = "";\n while(!(answer.equals("Exit")))\n {\n answer = userInput("Item"+count+": ");\n if(!(answer.equals("Exit")))\n {\n name[arrayIndex] = answer;\n quantities[arrayIndex] = Integer.parseInt(userInput("How many "+name[arrayIndex]+" have you brought? "));\n cost[arrayIndex] = Integer.parseInt(userInput("How much does a "+name[arrayIndex]+" cost? "));\n count++;\n arrayIndex++;\n \n }\n }\n return count;\n \n}\npublic static String userInput(String question)\n{\n Scanner sc = new Scanner(System.in);\n System.out.println(question);\n return sc.nextLine();\n}\n}" ]
[ "java" ]
[ "Win'2019 is detecting my scripts with the Win32/Casur.A!cl trojan", "I have a windows batch script that, depending on the user menu selection, opens a powershell.exe and passing a variable to run a .ps1 script. I then use Bat To Exe Converted (v3.0.10) to convert it to an exe. A few hours ago I made changes to the PS script and copied it to the Win'2019 server and it accepted it. Now, I just changed two letters in a write-host message command and it keeps quarantining the file. Since this will be passed to customers I can't be telling them to ignore it or white list it.\n\nI'm guessing the .bat and .ps1 files are throwing Windows Defender off. Funny how it was fine just a few hrs ago. Even if I undo the 2 letters I added it still deleting the exe.\n\nThe .bat is quite big and it'd be very difficult for me to convert and add inside the .ps1 script in hope of not setting off the trojan. What other options do I have to fix this? Is there a process or url to notify MS about this to get them to fix this false positive?\n\nNOTE: No other Windows version or 3rd party antivirus that I've tried is detecting the exe infected. Only Win'2019's Defender is." ]
[ "powershell", "trojan" ]
[ "How can I prevent sqlalchemy from prefixing the column names of a CTE?", "Consider the following query codified via SQLAlchemy.\n\n# Create a CTE that performs a join and gets some values\nx_cte = session.query(SomeTable.col1\n ,OtherTable.col5\n ) \\\n .select_from(SomeTable) \\\n .join(OtherTable, SomeTable.col2 == OtherTable.col3)\n .filter(OtherTable.col6 == 34)\n .cte(name='x')\n\n# Create a subquery that splits the CTE based on the value of col1\n# and computes the quartile for positive col1 and assigns a dummy\n# \"quartile\" for negative and zero col1\nsubquery = session.query(x_cte\n ,literal('-1', sqlalchemy.INTEGER).label('quartile')\n ) \\\n .filter(x_cte.col1 <= 0)\n .union_all(session.query(x_cte\n ,sqlalchemy.func.ntile(4).over(order_by=x_cte.col1).label('quartile')\n )\n .filter(x_cte.col1 > 0)\n ) \\\n .subquery()\n\n# Compute some aggregate values for each quartile\nresult = session.query(sqlalchemy.func.avg(subquery.columns.x_col1)\n ,sqlalchemy.func.avg(subquery.columns.x_col5)\n ,subquery.columns.x_quartile\n ) \\\n .group_by(subquery.columns.x_quartile) \\\n .all()\n\n\nSorry for the length, but this is similar to my real query. In my real code, I've given a more descriptive name to my CTE, and my CTE has far more columns for which I must compute the average. (It's also actually a weighted average weighted by a column in the CTE.)\n\nThe real \"problem\" is purely one of trying to keep my code more clear and shorter. (Yes, I know. This query is already a monster and hard to read, but the client insists on this data being available.) Notice that in the final query, I must refer to my columns as subquery.columns.x_[column name]; this is because SQLAlchemy is prefixing my column name with the CTE name. I would just like for SQLAlchemy to leave off my CTE's name when generating column names, but since I have many columns, I would prefer not to list them individually in my subquery. Leaving off the CTE name would make my column names (which are long enough on their own) shorter and slightly more readable; I can guarantee that the columns are unique. How can I do this?\n\nUsing Python 2.7.3 with SQLAlchemy 0.7.10." ]
[ "python", "python-2.7", "sqlalchemy" ]
[ "Unity injecting dependencies down the call stack", "I'm trying to get to grips with IoC containers (Unity specifically at the moment), and am having a bit of struggle with the concept of injecting all dependencies up front. \n\nMy problem is specifically related to a class that has a constructor parameter that has a value that isn't known when I initially register the types in the container.\n\nHere's a little snippet that should illustrate what I'm talking about.\n\nclass Class1\n{\n IUnityContainer uContainer;\n\n public Class1()\n {\n uContainer = new UnityContainer();\n\n uContainer.RegisterType<IRepo, Repo>(new ContainerControlledLifetimeManager()));\n\n Class2 cls2 = uContainer.Resolve<Class2>();\n\n cls2.DoSomething();\n\n }\n}\n\nclass Class2\n{\n IRepo _repo;\n\n public Class2(IRepo p_repo)\n {\n _repo = p_repo;\n }\n\n public void DoSomething()\n {\n IType2 typ2 = new Type2(_repo.SomeDataRetrieved());\n\n Class3 cls3 = new Class3(_repo, typ2);\n }\n}\n\nclass Class3\n{\n IRepo _repo;\n IType2 _type2;\n\n public Class3(IRepo p_repo, IType2 p_type2)\n {\n _repo = p_repo;\n _type2 = p_type2;\n }\n}\n\n\nI can set up the container in Class1 and have the Repo injected into Class2 using the UnityContainer. In Class2, some lookup against the Repo is done returning an instance of Type2 that is only possible to instantiate in Class2. I then need to pass the Repo to Class3 together with the new object created of Type2. \n\nThe problem is twofold:\n\n\nI can't resolve Class3 in Class1 because it can only be instantiated in Class2. \nI can't register Type2 in the container because it actually has to have a value (not a default one) based on the output of a call in Class2, which is in a different scope from where the Container existed and did the registrations.\n\n\nAs it stands, I can inject the dependancies using the container into Class2, but for Class3 I need to create new instances or using contructor injection from 2 to 3, which then makes me wonder why I'm using the Container then if I have to resort to manual injection anyway.\n\nSo, how do I register Class3 in the container so that when I instantiate it, I Inject the singleton of the repo that was registered in the container at the beginning as well as the instance of Type2 that was created in DoSomething.\n\nThanks in advance for the help." ]
[ "c#", "dependency-injection", "unity-container" ]
[ "Use list(map(model_to_dict, queryset_list)) do not map the createtime and updatetime fields", "I have a Test04 Model, and I give ctime and uptime fields.\n\nclass Test04(models.Model):\n testTime = models.DateTimeField(null=True)\n ctime = models.DateTimeField(auto_now_add=True)\n uptime = models.DateTimeField(auto_now=True)\n\n\nBut when I use the list(map(model_to_dict, queryset_list)) method to convert the queryset to dictionary, I find the ctime and uptime do not convert:\n\nfrom django.forms.models import model_to_dict\n\nprint (models.Test04.objects.all())\n\n\nall =models.Test04.objects.all()\n\nprint (all[0].ctime) # 2017-09-26 07:49:02.012489+00:00\n\nprint (list(map(model_to_dict, all))) # [{u'id': 1, 'testTime': datetime.datetime(2017, 9, 26, 7, 49, 1, 973016, tzinfo=<UTC>)}, {u'id': 2, 'testTime': datetime.datetime(2017, 9, 26, 8, 3, 24, 665944, tzinfo=<UTC>)}, {u'id': 3, 'testTime': datetime.datetime(2017, 9, 26, 0, 12, 12, 683801, tzinfo=<UTC>)}, {u'id': 4, 'testTime': datetime.datetime(2017, 9, 26, 0, 12, 43, 2169, tzinfo=<UTC>)}, {u'id': 5, 'testTime': datetime.datetime(2017, 9, 26, 8, 13, 16, 164395, tzinfo=<UTC>)}, {u'id': 6, 'testTime': datetime.datetime(2017, 9, 26, 0, 14, 8, 812063, tzinfo=<UTC>)}, {u'id': 7, 'testTime': datetime.datetime(2017, 9, 26, 0, 15, 32, 945493, tzinfo=<UTC>)}]\n\n\nIn the last line's output, you see there is no ctime and uptime in every dictionary." ]
[ "python", "django", "django-models" ]
[ "column summary to dataframe", "My question is.\nI have an UFO dataframe, where is 20 000 obs., I did summary of my data and get 51 states with numbers of observed UFOs. \nI was tried to do data.frame from that like:\n\nufo_by_state <- data.frame(observations = summary(ufo_clean$Event State)\n\nBut the problem is, that not flexible for further manipulation. \nI need to do dataframe with colnames = c(\"states\", \"observations\") and rownames = Alabama,Alaska,Arizona...etc. \nI will need to cbind with population, and build some histograms. \nI was try many things, which i know at this moment, but still no result.\n\nThank you!" ]
[ "r", "list", "dataframe" ]
[ "Laravel Ajax does not get the value from the form to Controller", "In Ajax code I have action = 'contact';, contact is used in route file:\n\nRoute::post('contact', array('uses' => 'FormsController@send', 'as' => 'post_form'));\n\n\nIn route file I have FormsController@send it is file php to send email:\n\n$name = Input::get('name');\n\n$getSubject = \"Subject of my email\";\n$myEmail = '[email protected]';\n\n$uid = md5(uniqid(time()));\n$eol = \"\\r\\n\";\n\n// header\n$header = \"From: \" . $name . \" <\" . $email . \">\\r\\n\";\n$header .= \"MIME-Version: 1.0\" . $eol;\n$header .= \"Content-Type: multipart/mixed; boundary=\\\"\" . $uid . \"\\\"\" . $eol;\n$header .= \"Content-Transfer-Encoding: 7bit\" . $eol;\n$header .= \"This is a MIME encoded message.\" . $eol;\n\n// message & attachment\n$nmessage = \"--\" . $uid . \"\\r\\n\";\n$nmessage .= \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\" . $eol;\n$nmessage .= \"Content-Transfer-Encoding: 8bit\" . $eol;\nif($name != ''){$nmessage .= \"Name: \" . $name . \"\\r\\n\\r\\n\";}\n\n\n// $nmessage .= \"Wiadomość:\\r\\n\" . $getMessage . \"\\r\\n\\r\\n\";\n$nmessage .= \"--\" . $uid . \"\\r\\n\";\n$nmessage .= \"Content-Transfer-Encoding: base64\\r\\n\";\n$nmessage .= \"--\" . $uid . \"--\";\n\n$send = mail($myEmail, $getSubject, $nmessage, $header);\n\n\nAjax directs to the controller file and bypasses the form, so the controller file does not download any data from the form, and the mail can not be sent. I have no idea how to pass data from the form to the controller file.\n\nMy Ajax:\n\n const sendForm = function () {\n action = 'contact';\n\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n xmlhttp.open('post', action, true); \n xmlhttp.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n const getMessageSend = document.querySelector(\"#messageSend\");\n getMessageSend.innerText = \"Thank you for sending an email. You will receive an answer shortly.\";\n } else {\n const getMessageSendError = document.querySelector(\"#messageSendError\");\n getMessageSendError.innerText = \"An error occurred and the email was not sent.\";\n }\n };\n\n // xmlhttp.open(\"post\", action, true);\n // xmlhttp.send();\n\n const token = document.querySelector('meta[name=\"csrf-token\"]').content;\n\n xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n xmlhttp.setRequestHeader('X-CSRF-TOKEN', token);\n xmlhttp.send();\n\n };\n\n const sendMail = function() {\n\n options.form.addEventListener('submit', function (e) {\n e.preventDefault();\n let validate = true;\n const elementsRequired = document.querySelectorAll(\":scope [formHr]\");\n\n [].forEach.call(elementsRequired, function(element) {\n const type = element.type.toUpperCase();\n\n if (type === 'TEXT') {\n if (!validateText(element)) {validate = false;}\n }\n\n });\n if (validate) {\n sendForm();\n // this.submit();\n } else {\n return false;\n }\n\n });\n\n };\n\n\nMy form:\n\n{!! Form::open(['action'=>['FormsController@send'], 'method' => 'post', 'class' => 'form', 'novalidate' => 'novalidate', 'files' => true]) !!}\n\n <input type=\"text\" name=\"name\" placeholder=\"Name\" formHr>\n\n{!! Form::submit('Send', ['class' => 'submit-btn']); !!}\n{!! Form::close() !!}" ]
[ "ajax", "laravel", "controller" ]
[ "How to add Bar Button in navigation bar without navigation controller.", "I am new to iOS development.I have create a navigation bar in my iPad application view.I don't need navigation controller that's why i have added only navigation bar. Now i want to add button in that navigation bar.I tried a lot but no success. Is it possible to add only navigation bar with button ? If yes then suggest me some sample code.\n\n\"i don't have navigation controller or need it. i just want to add navigation bar in only one view.\"\n\nBellow is my code which i write for adding navigation bar in ViewDidLoad()\n\nUINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 1026, 50)];\n[navBar setTintColor:[UIColor blackColor]];\n[navBar setDelegate:self];\n[self.view addSubview:navBar];\n\n\nThanks in advance...." ]
[ "ios", "ipad", "uinavigationbar" ]
[ "How to correct Tab Bar height issue on iPhone X", "I'm having an issue with my app when testing for iPhone X. I'm not sure how to adjust this issue, as well as not make it an issue for non iPhone X sizes. This only seems to be an issue on the iPhone X simulator." ]
[ "ios", "swift", "xcode", "uistoryboard", "iphone-x" ]
[ "C# Difference of output between char return method and object return method", "I had small problem while solving challenge test where i was comparing output of\n\nprivate object PopS() {\n return stack.Pop();\n}\n\n\nand\n\nprivate object DequeueQ() {\n return queue.Dequeue();\n}\n\n\nfor palindrome words.\n\nStatment:\n\nif(PopS() != DequeueQ()) isPalindrome = false;\n\n\nI made breakpoint on this IF statment, provided as input palindrome word \"aaaaa\" but despite Locals window showing that Pop() returned 97 'a' and DequeueQ() returned 97 'a', statment considered both as \"Not equal\".\n\nWhen i changed method casting from object to char, it worked. Output in Locals was identical tho.\n\nCould someone explain me this behavior please? Trying to understand now why 2 same returns from \"object\" cast was not equal and 2 same returns from \"char\" cast was equal. \n\nThanks a lot,\nMichael." ]
[ "c#", "object", "methods", "char" ]
[ "Problems with Network Transform Component", "Currently I am having issues with my Network Transform component which is attached to my player prefab in my game. For some reason even though these are the correct settings for syncing rotation on the y axis when my player rotates on the y axis I can only see it on the local client and not on any of the other builds. (it is not being networked)\n\nThese are the settings on my Network Transform component:\n\n\n\nIf anything is unclear or any additional information is required to solve this problem please leave a comment and I will be quick to answer." ]
[ "c#", "unity3d", "networking", "unet" ]
[ "micrometer add custom parameter", "is it possible to register a custom parmeter with micrometer as it is done in new relic? e.g.: NewRelic.addCustomParameter(\"customparam\", customparam ); I would like to associate a tag to a the current request.\n\nThanks,\nJorge" ]
[ "newrelic", "micrometer" ]
[ "Set initial center and zoom in google maps API", "If we open google map directly, the initial view is the our city, the city is zoomed and fitted in the whole screen.\n\nIf we create a map web app based on google maps API (without setting the center and zoom parameters), the initial view is blank.\n\nThe question is: how to make the map web app behave the same as google map (eg. display initial map view as the user's city being fitted in the whole screen)?\n\nLooking forward to the answer, and expect as less code as possible.\n\nFor Bing Maps API, the city is fitted in view without setting the center and zoom of the map." ]
[ "google-maps", "google-maps-api-3" ]
[ "How to club multiple sms notification in android just like default sms application do?", "I am building a SMS based android application. till now i have completed the module to receive SMS and display its notification.But for every Received SMS a notification is created in notification area.\n\nI want to club the notification if there are any unread/unseen notification just like default sms application do. is there any way to perform this ??" ]
[ "android", "android-intent", "android-notifications", "android-notification-bar" ]
[ "How to access SqlParameter array with name", "I am creating SqlParameter Array and passing it to StoredProcedure. The output value will be set in StoredProcedures. How to access that value by parameter name?\n\n SqlParameter[] parameters = { new SqlParameter {ParameterName = \"@test\", Value = \"test\", Direction = ParameterDirection.Output }}; \n\n\nThis works\n\nparameters[0].Value\n\n\nHow to make this to work?\n\nparameters[\"@test\"].Value" ]
[ "c#", "ado.net" ]
[ "reading COM port value and printing in textArea which located inside the panel in java", "I have to read a COM port and the data should be displayed inside the TextArea dynamically (data will come every minute), which I have created inside JPanel.\n\nAdvance Thanks for reply." ]
[ "java", "core" ]
[ "C# Typesafe dictionary where value depends on Key? IDictionary,TValue>?", "I don't know the correct name for this data structure (Is it a Homogeneous map?), but basically I'm trying to get something like.\n\nSmartDict dict = new SmartDict();\nKey<string> NameKey = new Key<string>(\"nameID\"); // Should this be a generated GUID for serialization that must be registered?\nKey<int> HealthKey = new Key<int>(\"healthID\"); //Should this be a generated GUID for serialization that must be registered?\ndict[NameKey] = \"Ryan\";\ndict[HealthKey] = 20;\nString name = dict[NameKey]; //name is now Ryan\nint health = dict[HealthKey];\n\n\nSay this is defined on a Base class of some instance of a data class that isn't easily customized for each use.\nBy having a SmartDict attached to the base class, you can then add additional data to the class (and in the future serialize it as a blob) and have it data driven what types and additional data would need to be attached (as long as they too were serialize-able).\n\nclass BaseEntity {\n public SmartDict dict = new SmartDict();\n Key<string> NameKey = new Key<string>(\"name\");\n\n public void Initialize(){\n dict[NameKey] = \"Ryan\";\n }\n}\n\nclass HealthSystem {\n Key<int> Health = new Key<Health>();\n public void InitHealth(BaseEntity entity){\n entity.dict[Health] = 20;\n }\n\n public void DamageEntity(BaseEntity entity, int damage){\n entity.dict[Health] = entity.dict[Health] - damage];\n }\n}\n\n\nSo getting the value from the SmartDict revolves around whether you have access to the key object or not. Useful for user authorizations, or making sure people don't mess with the data from contexts where they should be using a facade.\n\nYou could use a dictionary of objects, and just rely on remembering what type you put in, but I was trying to make something that would have less potential for mistake, and preferrably serializeable with WCF (But I'm assuming that's a different problem, that's going to required registering compatible types ahead of time etc, and using GUID's in order to match keys after deserializing).\n\nI've been introduced to the ConditionalWeakTable, but that also has Weak references that might not always be wanted considering I want to be able to serialize this.\n\nMy first attempt without really understanding what was going wrong with my generics.\n\nclass HMap<K> where K : Key<?>\n{\n ConditionalWeakTable<K, object> data = new ConditionalWeakTable<K, object>();\n\n public T this[Key<T> index]\n {\n get\n {\n T ret;\n var success = data.TryGetValue(index, out ret);\n if (!success) throw new KeyNotFoundException(\"Key not found: \" + index);\n return ret;\n }\n set\n {\n data.Add(index, value);\n }\n }\n}" ]
[ "c#", "generics" ]
[ "How to get all item selected into ListBox ( Multiple Selection ) in VBA", "I would like to select multiple data from a listbox\n\nThe code below work fine for Single Selection: 0 -fmMultiSelectSingle\n\nPrivate Sub ListBox1_Click()\n Dim Msg As String\n Dim i As Integer\n\n Msg = \"You selected:\" & vbNewLine\n For i = 1 To ListBox1.ListCount\n If ListBox1.Selected(i) Then\n Msg = Msg & ListBox1.List(i) & vbNewLine \n End If\n Next i\n\n MsgBox Msg\n ListBox1.Selected(0) = False\nEnd Sub\n\n\nThe messagebox displays me the slected item, but if I switch the MultiSelect option to: \n\n1 - fmMultiSelectMulti or 2 - fmMultiSelectExtended, the previous code isn't working: The message box displays nothing. \n\nAm I doing something wrong?" ]
[ "excel", "vba", "listbox", "multi-select" ]
[ "Run time error 1004, Application defined or object defined error in excel vbs", "I have written vbscript code to add chart in page 1 of excel for which the source is from other sheet of same excel which name is \"CL.1.1\" but i am getting the above error can any one help what was wrong in my below code.\n\nSub DispvsTime(Shname)\n Sheets(\"Sheet1\").Select\n noofsheets = ActiveSheet.ChartObjects.Count\n If noofsheets > 0 Then\n ActiveSheet.ChartObjects.Select\n ActiveSheet.ChartObjects.Delete\n End If\n Sheets(\"Sheet1\").Pictures.Visible = False\n ActiveSheet.Shapes.AddChart(1000, 420, 50, 500).Select\n ActiveChart.ChartType = xlXYScatterSmoothNoMarkers\n ActiveChart.SetSourceData Source:=Sheets(Shname).Range(\"G2:H2001\")\n ActiveChart.SetElement (msoElementChartTitleAboveChart)\n ActiveChart.ChartTitle.Text = \"Displacement VS Time\"\nEnd Sub\n\n\nhere shname is name of the sheet where data is picked.\n\nCan any one help me to find out the bug inside the code to get this error ?" ]
[ "vbscript" ]
[ "How can I write advanced calculator in Delphi without limitations of floating point types?", "Hello I can calculate 17^1000 in calculator of windows 7 and it looks like \n\n1.2121254521552524e+123 (which seems to me to be not correct)\n\nhow can I write it in delphi and I want to use for example 1.2121254521552524e+123 mod 18\nor 1.2121254521552524e+123 mod 100.\n\nAnother example: 17 mod 5 = 2\n\nHow can I write it can anyone help me?" ]
[ "delphi", "delphi-7" ]
[ "Angular 2 router navigate to url but still rendering the source component", "I'm trying to create an authentication system with Angular 2, i used angular2-jwt and everything works fine, but the problem i'm having is when an Unauthenticated user tries to acces a restricted route, to handle this i check if the user is authenticated in the ngOnInit() function, if not, the user should be redirected to the login page, in my case, the url changes, but it still renders the acced component template, here's my code :\n\nimport { Component, OnInit } from '@angular/core';\nimport {Router} from \"@angular/router\";\n\nimport {UserService} from \"../services/user.service\";\n\n@Component({\n selector: 'app-home',\n templateUrl: '../templates/home.component.html',\n styleUrls: ['../../assets/styles/home.component.css']\n})\nexport class HomeComponent implements OnInit {\n\nfull_name: string;\nconstructor(private userService: UserService, private router: Router){}\n\nngOnInit() {\n if(this.userService.isTokenExpired()){\n this.router.navigate([''])\n }else{\n this.userService.getSessionData()\n .subscribe(\n data => {\n let usrData = data.data.user;\n localStorage.setItem('user', JSON.stringify(usrData));\n this.full_name = usrData.firstname+\" \"+usrData.lastname;\n if(usrData.role == 'admin'){\n this.router.navigate(['admin']);\n }\n },\n err => console.log(err)\n );\n }\n }\n}\n\n\nhere's how it looks:\n\n\nYou can notice that there's no data.\n\nthe weired thing is that the same code in another Component (the AdminComponent) works fine.\n\nhere's my app.routes.ts file: \n\nimport {Routes} from \"@angular/router\";\n\nimport {AdminComponent} from \"./components/admin.component\";\nimport {LoginComponent} from \"./components/login.component\";\nimport {HomeComponent} from \"./components/home.component\";\nimport {GroupsComponent} from \"./components/groups.component\";\nimport {TpComponent} from \"./components/tps.component\";\nimport {TraineeComponent} from \"./components/trainee.component\";\nimport {RegisterComponent} from \"./components/register.component\";\nimport {HometpsComponent} from \"./components/hometps.component\";\n\nexport const routes: Routes = [\n { path: '', component: LoginComponent},\n { path: 'login', component: LoginComponent},\n { path: 'register', component: RegisterComponent},\n { path: 'admin', component: AdminComponent, children: [\n { path: '',\n redirectTo: '/admin/tps',\n pathMatch: 'full'},\n { path: 'tps', component: TpComponent},\n { path: 'groupes', component: GroupsComponent},\n { path: 'stagiaires', component: TraineeComponent}\n ]},\n { path: 'home', component: HomeComponent, children: [\n { path: '',\n redirectTo: '/home/tps',\n pathMatch: 'full'},\n { path: 'tps', component: HometpsComponent},\n ]},\n { path: '**', component: LoginComponent}\n];\n\n\nany help will be appreciated, thanks." ]
[ "angular", "angular2-routing" ]