Posts

Showing posts from January, 2011

c# - Maze algorithm path finder -

I am trying to find a path to a maze, the code below, it seems that inside the recursive soul loop It goes but keep getting out of it, after the second condition if the condition is that what I am doing wrong here can someone help me please? The correct setting in the form of IM setting and wrong by default. recursive solution (0, 0); Public static int [,] Maze = {{0, 0, 0, 1}, {1, 1, 0, 0, 0, 1}, 0, 0, 0, 1, 0, 0}, {0 , 1, 1, 0, 0, 1}, {0, 1, 0, 0, 1,}, {0, 1, 0, 0, 0, 1}}; Public static boolean recursive solv (int row, int coal) {boolean [,] is = new boolean [6, 6]; Boolean [,] True Text = New Boolean [6, 6]; // If the solution of the maze (maze [row, cola] == 1 || these [row, cola]) {return false; } And if (line == 0 || line == 6 - 1 || tomorrow == 0] soft == 6 - 1) {right path [row, cola] = true; Back true; } And {were [row, color] = true; Recursive solvieve (line-1), (recursive solvieve (line-1), recursive solvieve (row + 1, cola) || recursive solvieve (line, cola-1) || rec

How can I align text to an image automatically in PHP? -

Image
I have some lines of code to create a plain image with some given PHP text. But when I give the width of the image text then goes out of the image. How can I align the text inside the image with a fixed width but dynamic height? My code is given below. header ("content-type: image / PNG"); $ String = 'Lorem Ipsum is simply the dummy text of the printing and typesetting industry; Lorem Ipsum 1500s' has been the industry standard dummy text since; $ Font = 4; $ Width = ImageFontWidth ($ font) * strlen ($ string); $ Height = ImageFontHeight ($ font); $ Im = @imagecreate (200,500); $ Background_color = imagecolorallocate ($ im, 255, 255, 255); // white background $ text_color = imagecolorallocate ($ im, 0, 0,0); // black text imagestring ($ im, $ font, 0, 0, $ string, $ text_color); Imagepng ($ im); I want this image to automatically adjust the text based on the given paragraph. How to do this You can try this: (based on the contributions of Gannon) head

javascript - How to find and replace xml node value in JQuery -

I need help finding and changing a value using JQuery in XML node, please tell me below that my scenario Is, var metadata = '& lt; Control type = "table" id = "4900a2a9-47d7-4d3b-9a35-fdd32b185730" & gt; & Lt; / Control & gt; & Lt; Control Type = "Text Box" ID = "7a49 9F6-16C1-4-88 9-A0-FA2A7Fi886" & gt; & Lt; / Control & gt; '; In the above XML structure, I want to search for id = "4900a2a9-47d7-4d3b-9a35-fdd32b185730" and replace it with id = "91e3cbe6-8168-40be-bf26-ccdd6acb1e17" "Please suggest in jQuery. Below I've tried, var oldID = "4900a2a9-47d7-4d3b-9a35-fdd32b185730"; Var newID = "91e3cbe6-8168-40be-bf26 The code above was not successful. itemprop = "text"> Just use the string in your xml variable, JS xml.repla ce ('4900a2a9-47d7-4d3b-9a35-fdd32b185730', '91e3cbe6-8168-40be-bf26-ccdd6acb1e17');

three.js - ShaderMaterial not repeating after updating uniform texture -

After updating my texture, there is a problem with my tiled image. The text I'm updating is the same What is this when I try to update, that is 256x256: I am currently using the latest version of three .js i.e. the irir. Version 68 with JS Update function: function testing () {mesh = scene.getObjectByName ("plain", true); Texturex = three. Image Utility. Load ("images / mosaic_tiles_lief_poton_201005060.jpg"); Trap material. Uniform DefUsConverter.value = Texturex; Shader code: mirror_shader = {Uniform: {"mirrorColor": {type: "c", value: new three. Color "," DiffuseSampler ": {type:" M4 ", value:" T ", value: zero}," mirrorcompler ": {type:" t ", value: zero}," texture matrix " The new three matrix 4 ()}, "Rickettex": {type: "i", value: 1}, "repeat": {type: "i", value: 1}}, vertex sha ader: ["uniform matte texture"

ios - How to allow only one cell to be clickable -

Image
I am trying to add a tick next to a user selection, to indicate that the user has a special Place is guessed at. Currently, my argument allows all the cells to be clicked as seen below; I have at one time How can I restrict the user to enable only one selection? I was thinking of a variable (to say) to track the currently selected - in this way I can tick the right places. However, I want to know 1) This is the best way to do this and 2) How can I deselect the previously selected cell? Thanks Do I need a class variable to see if it has been fixed, if so, log in something You can easily use: tableView.allowsMultipleSelection = false

How to get an url in a string with regex -

I am trying to use a regex to get a URL but I remember the end of the URL here An example of a string. Containing a URL & lt; div class = \ "ExternalClassC7001553FFC442DD9B99547999723C7B \" & gt; http: //bazar.flow.be/Knowledge/Legal/FR/Ina/Circul/Circul BB ed. 2014 / circ_bb_p_2014_xxx.doc & lt; / Div & gt; I want to get it into output: http://bazar.flow.be/ Knowledge / Legal / FR / Mirror / Caricul / Circul For now, I use this regex which returns me: "" @ "( (Https? | Ftp | file) \: // | www) [one-zA-Z0-9 \ \ -.] (/ [[One-zA-Z0-9 \ \ & amp; \ =; \ + '\ ((| https | | ftp | file) \: // | www.) [A-Za-z0-9 \.] - (/ [[A-Za-z0-9 \? \ & Amp; \ = \ \ \! \ \ (\) \ * \ - \ ._ ~%] *) * ([^ & lt;] +) * Try See it . Demo.

c# - clickonce using old user.config after upgrade -

I have a click application that has worked well for years. I recently made some changes to the application. This application used to be in its own solution, but I recently added it to another solution to it that it ultimately I will use some libraries in the solution. (But I have not actually made any changes in any reference so far.) I have updated the application from .NET 4.0 to .NET 4.5. I add two new settings. I did not pay attention correctly but it has changed how my app user manages settings before user settings have always been preserved during the upgrade. Now when I change settings , They will continue until I remove a new version, at that time all the settings will be back before returning these changes (and the new settings will be at default I did some excavations and found that there are folders for my (and other users) in C: \ user ... \ local \ application ... 3 versions. 1.0.0.0 1.9.8.114 1.10.4.0 The current version is 1.11.3.16 and it appea

shell - How to check a public RSA key file -

I want to verify the public RSA file inside a shell script. What I want to do is that finding a way to check this file is a real public key file, and nothing else. Can I ask the experts here to verify how I can verify these input files is a real public key file, not a regular file I have a future I am using this public key file which will use the incoming encrypted encrypted GSIIP file to validate, but it is not yet scope. I want to check that the input file is valid for the actual RSA public key file is not a simple file. Please note that I do not have any other files with me (examples: private key). Example: If the file is one ??? Public.pemâ ???? I just want to look inside that this is an actual RSA public key file, not a file with texts or files is corrupt. IA ???? I have already been checking that file Zero size and MD5 I found that other probes that were examined include text â â "BEGIN public key" and < Code> got an "ed public key"? A

install packages to each servers in amazon ec2 -

I want 20 examples on EC2 with a single configuration and installed packages. I'm doing this one by one. But how can I install packages on each server at a time? I could not understand this in the Amazon doctor. Amazon does not offer any tools to do this something like this. You have to prepare your own approach to do something like this. There are several options depending on what you want to do or your needs, some of which include: You can install something that allows you to install SSH commands in parallel to more than one server Will run You can install a configuration management system such as, etc. And it can be used to provision all your systems. Use an example on whatever you want, then from that example, and AMI to spin all other instances. The benefits of each of those approaches are & amp; loss. Setting up a PSS is very simple to set something like responsive; The puppet takes an appropriate amount of initial configuration, but then the management

ms access - vba intellisense very annoying behavior -

Occasionally, I could not despise the reason for this behavior, but VBA Intelligence at Excel or Access actually starts acting fast / weird. Example: I type a location and remove it in the next 0.2 seconds if I do not type anything, if I want to stop mycodelookinglikethis, then I need to think about the next letter to write it and quickly Add it manually or manually add it later. If I ctrl-space to view object methods or properties, it only shows for 2 seconds then the box disappears, I can not scroll at all. I tried to switch between devices & gt; & Gt; Options & gt; & Gt; Uncheck the editor and everything, still behave, I think I can not find any way to stop or restart. I do not have the privileges to install programs on my computer. This problem does not happen all the time and the reboot does not fix it. There are some forms in your access or Excel whose timer events are running in the background. The event is going on, which means code (though not in the s

java - Spring Boot Actuator adding X-Frame-Options = DENY to all endpoints (particularly error endpoint) -

I am trying to set X-Frame-Options to DENY for all management endpoint, especially / error End point I have the following in my application. Receipts of my Spring Boot application security.headers.frame = true management.security.enabled = true management.port = 8001 When I http: // localhost : 8001 / error I do not have the X-frame-option headers, although http: // localhost: 8001 / trace is the header in the endpoint, how do I configure my application I can do What do I need to override to get that response heading for properties or error overpoints? By going through the current spring boot source (1.1.7.RELEASE), I do not see anyway Whatever you want, the security is not completely removed with auto-configuration. The reason for this is that to be eligible for the desired HTTP headers (such as X-Frame-Options ) for a final point, it must be a bean in the original context ( Which is connected to the application on the normal port) which is applicable such bean

mysql - Magento importing customers(700k) using csv dataflow is too slow -

I am creating a Magento eCommerce website, and importing client profiles from the old profile. I am using CSV Importer, and this process is slower than my imagination takes only about 4 seconds for a customer. So far the process is running for 6+ hours and only 30k customers have been imported. CSV file is divided into several ~ 10M short For now, I am using Amazon Web Services EC2 (Micro) for development server in it's 1 vCPU (2.5GHz) And 1 GB memory but I do not think this may be an issue, I've increased the PHP memory limit for 1G I've read an article, which states that Magnets' EAV database system and Import due to heavy PHP API module This speed of products with a lot is very common [] It is said that Magento sends 450 MySQL queries to import a single product. I have also seen an alternative solution using [] that tries to bypass the Magento API and insert the data directly into the MySQL table. Although AFAIK does not import it to customers, but only produ

c# - How can I Skip and Take objects until I have 10 distinct ones in LINQ to Entities? -

यह समस्याग्रस्त कोड है: var अलगकैट नाम = सभी कैटस। चयन करें (सी = & gt ; c.CatName) डिस्टिंक (); अगर (skip.HasValue) अलग CatNames = distinctCatNames। स्किप (skip.Value); यदि (take.HasValue) distinctCatNames = distinctCatNames। ले लो (take.Value); Var अलगकैटनामफ़ील्ड = अलगकाट नाम .ओलिस्ट (); यदि आप कल्पना करते हैं कि मेरे पास 100 बिल्लियों की सूची है, तो मैं 10 विशिष्ट नामों का चयन करना चाहता हूं। यह एक पृष्ठांकित सूची में जा रहा है, इसलिए इसे छोड़ना और उपयोग करना होगा। उपरोक्त काम नहीं करेगा, क्योंकि इसे ऑर्डर बी के साथ ऑर्डर किया जाना है। अगर मैं ऑर्डरबी अलग होने के बाद, मैं छोड़ और नहीं ले सकता क्योंकि परिणाम IOrderedQueryable है, IQueryable नहीं है (संकलक त्रुटि)। यदि मैं पहले ऐसा करता हूं, तो त्रुटि कहती है DbSortClause अभिव्यक्ति का एक प्रकार होना चाहिए जो कि तुलनीय है। मुझे यह सुनिश्चित करने की आवश्यकता है कि डाकू के नीचे यह मेरी क्वेरी को ठीक से अनुवादित कर रहा है, क्योंकि बहुत सी बिल्लियों हो सकती हैं, इसलिए मैं यह सुनिश्चित करना चाहता हूं कि यह एसक्यूएल

javascript - AngularJS text input with ng-model but needs default value not working with value= or ng-init= -

I have an account form with many inputs. One of them below: & Lt; Input class = "form-control" placeholder = "first name" type = "text" ng-model = "account.first_name" ng-init = "account.first_name = user.account.first_name" & gt; I have a service in my controller that gives all the user information. I'm trying, in the input, show current information on the file. I want it in an input so that they can change it. However, when I set the value = "{{user.account.first_name}}" which returned from my service to my API and $ scope. user sets equals , nothing shows input in it. I searched for answers on SO and gave some suggestions which ng-init , which still did not work. I have also tried the ng-bind , ng-value , and before that i ng-model Setting. How do I do this? Edit: Here is my account administrator. Only service in return $ http.get ('/ api / account'); app.controller (

regex - htaccess already stripping ".php" but need a sub page with url query -

After Here's what I have so far ... RewriteCond% RewriteEngine Running {} REQUEST_FILENAME! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteCond% {QUERY_STRING} ^ (. *) $ RewriteRule ^ (. *) $ $ 1.php?% 1 [NC, L, QSA] then site.com/ page site.com/page.php works for viewing. I want to add one to it on a special page where there is a query string ... Example: site.com/song.php?name=song-name- & gt; I want to be site.com/song/Song-Name. I know there are so many posts like this and I have seen through a ton but it does not understand how to get it done. "itemprop =" text "> You need a new rule to handle / song / URI Will be: Option -MultiViews RewriteEngine RewriteCond% {on REQUEST_FILENAME}! -f RewriteRule ^ Songs /(.+)$ song.php? Name = $ 1 [L, QSA, NC] RewriteCond% {} REQUEST_FILENAME! -f RewriteCond% {REQUEST_FILENAME}! -d RewriteRule ^ (. +?) /? $$ 1.php [l] I have also corrected my 2 rules since the query string has already been add

wpf - Xaml - send viewmodel property to method in another viewmodel -

I have a datagrid attached to the collection of view models, which is called the distance, that property in that distance in XML Is there a way to send a method in the view model, which is the datagrid commodity processing current? For example: (GetDistanceInKM will be on the same VM as a collection of reports) & lt; DataGrade ItemsSource = "{Binding ReportWomodles}" & gt; & Lt; DataGrid.Columns & gt; & Lt; DataGridTextColum binding = "{bound boundaries}" header = "distance" edit elementstyle = "{static resource distance_type}" /> & Lt; /DataGrid.Columns> & Lt; / Data grid & gt; & Lt; Style x: key = "DistanceStyle" TargetType = "{x: type text box}" & gt; & Lt; Style.Triggers & gt; & Lt; DataTrigrinding Binding = {Binding Gastistins Inkm [Distance], Converter = {Static Resource IdentiGridinternet}} Value = "True" & gt; & Lt; Setter Property = &qu

android - Jackson JSON Parser performance -

Image
To make much better performance than the GSOn on the internet point of the Internet point of Jackson, to provide anywhere in the neighborhood of 20-30% P> For example, I'm not replacing my ObjectMapper , and I want to read all JSON Using the ObjectReader . Here are some sample codes: Public class JasonPerser {@nolal Private Final ObjectMaper objectMapper; Public JsonParser () {Final ObjectMapper objectMapper = New ObjectMapper (); ObjectMapper.setDateFormat (DateFormatUtil.getGmtIso8601DateFormat ()); Simple Module Simple Module = New Simple Module (); objectMapper.registerModule (simpleModule); This.objectMapper = objectMapper; } Public & lt; T & gt; Takes Jason (InputStream inputstream, class & lieutenant; T & gt; clues) throws IOException (Object reader reader = ObjectMaper. Reader (clause); Return Reader Read value (input stream); }} The above object is created once and it is used to translate JSON into POJO for the duration of the app. A sampl

osx - Mac terminal Chrome Apps.localized -

Image
The application folder has changed for a user login for some strange reason it seems That's a nickname for the actual application folder and then stuck in the Chrome app. Coleslined in the original folder of applications This means that I can not access my applications through the terminal yet. This is impossible because I edit the MAMP's Vhosts file in this way. Can someone be in a way like this and how can I get it back so that the application is put back in the application folder, as it should be An image that I have added so that you can see what I mean All apps will be rolled back into the list. I have no explanation but after playing with the same issue I came back to my app folder.

How to sum value goup by 4 Quarter data into one value in SAS -

I have a data set that has quarterly data value, but now I want to add quarterly values ​​which are the same year. Data H: Time Value 01JAN90 23 01APR90 31 01JUL90 13 01OCT90 45 01JAN91 11 01APR91 4 01JUL91 1 01 OCT 1917 < P> i want to do my result data like this ¼ ?? Time Value 1990 53 1991 35 if Your time variable is numeric, you can use the PROM SUMMARY within the FORMAT statement so that it can be automatically removed this year PROC runs (thanks for showing @___ to show in the comments on my original answer.) PROC summary NWAY data = H; class time; FORMAT time YEAR; Output = output (KEEP = year value) SUM (value) =; Run;

elmah.mvc - Save Error in Xml File With Elmah -

I use ELMHA to search for errors. I want to save the error in the XML file after I wrote the command in the synfig file: Config file: & Lt; Errorlog type = "amma.xmlFilerErrorLog, elmah" logpath = "~ / App_Data" /> & Lt; / Elmah & gt; How to access this XML file. Is this file in file? you can try www.yourdomain.com/ Elmah.axd

python - Going down columns using xlrd -

Say I have a cell (9 3). I want to get values ​​from (9.3) (9, 99) How can I lower the columns to get the values? I am trying to write values ​​in another best file that starts with (13, 3) and ends (13,99). How do I write a loop for it in Xlrd? def write_into_cols_rows (r, c): range for numbers (0 9): c + = 1 return (r, c) worksheet.org will return the line to you, and to get the value of some columns, you To get the value, run row [int] .value needs to be run. For more information, you should see the PDF file (page 9 inspect a sheet). Import xlrd workbook = xlrd.open_workbook (file name) # This will get you the first sheet in the workbook. Worksheet = Workbook.Sheet_by_name (Workbook.Sheat_Name () [0]) for index in category (Worksheet.nro): Try: line = worksheet.ro (index) line_value = [column.value for row in call] # Now the row_fund is a column in which all column values ​​are printed except for line rows [3: 99]: pass To write the data in the Excel file, y

javascript - event listen for click in HTML getting the value -

Trying to reprogram a calculator using Event Listener because this code should be better overall. and here is the code code> var input = document.getElementById ("calculator"). AddEventListener ("click", Calc); Function calc (a) {input = this.a; Console.log (input); } Thank you for your time you want something like this I thought that calc is near event item, through which you can take the price. function calc (a) {var input = A.target console.log (input.value); } Edit: After looking at Bella, calculator turned out to be a div, do not know what you try to achieve are doing .

c# - Synchronous method vs Thread.Sleep() -

I can not understand the difference between the thread. Please explain to Sleep () and synchronous methods. What is synchronous method thread.sleep () in C #. <div class = "post <Code> threads. Sleep </ code> is a synchronous method. </ P> <p> A <strong> synchronous </ P> <p > <code> Thread. Sleep </ code> is a function that causes the block to execute the thread, the specified number is milliseconds (not at all, but due to the CPU thread scheduler). It implements synchronous and an asynchronous method . </ P> <p> However, they are saying that the same thing is not a mistake. In that, because a lot of synchronous methods <code> must not sleep Thread Do not </ code> and use it. </ P> </ div> </ html><br /><br />

java - Why does casting based on Class.class work but not getClass? -

I have the following 3 tests: The first two works, the last one does not. My motivation for asking this question is that I want to be able to cast the object A so that the object B , when A B is known as a sub-type of . @Test Public Zero Testworks () {Object Bar = "Fobar"; String Blow = (string) bar; Println (blah); // Output Fobre} @Test Public Zero TestAlosOverseSquare () {Object Bar = "Hellkollwald"; String blah = string.class.val (bar); Println (blah); // outputs helloworld} @Test Public Zero TestFile () {Object Bar = "Fubar"; String thetype = "hello"; Class string class = thetype.getClass (); String blah = string class.cast (bar); // Compiler Error: Incompatible Type: Object can not be converted to string system. Out.println (blah); } Can anyone explain that when the first two succeeded, and why is this the case, why have they finally failed? And what would be a better approach to achieving this? You need to specify the typ

linux - How to modify /etc/environment from a bash script -

Currently, I am trying to automate an action that we do at work. Whenever we install the Oracle's JDK, we need to manually add it to our global PATH variable. There is a quote from this process: add it to the beginning of sudo vi / etc / environment path: "/opt/jdk1.6.0_45/bin:" / etc / environment is here: PATH = "/ usr / local / sbin: / usr / local / bin: / usr / sbin: / Usr / bin: / sbin: / bin: / usr / games " It will appear after its modification: path =" / opt / jdk1 .6.0_45 / bin: / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / usr / games " < P> Do not forget that this file is not a script but rather a file Where key = value is. This file stores system-wide locale and path settings. My question is I PATH variable with / etc / environment without including any manual operation, preferably only Using a Bash script. Besides, I would like to avoid seeing my JDK path, if I h

database - Select data from table with column name and description SQL Server -

I have all the columns named in the old column, others do not understand the names, but table details include column description, table How can you choose all the data from, and combine with the column description? Updated below: Name and column description SELECT COLUMN_NAME AS Name, COLUMN_TEXT AS [DB2- Details from LINKED-SERVER] [BD2] .QSYS2.SYSCOLUMNS where TABLE_NAME = 'ITMHED' I found: Name of the ITMNO item number ITMNM item name .... 800+ rows more Then I have another query: SELECT * from [DB2-LINKED-SERVER ]. [BD2] .ITMHED returned it to me: ITemano ITMNM ... 800+ more columns AB-001 Mountain Bike .... What do I need: item number name ... 800+ more columns AB-001 mountain bike ..... < / Pre> If I only make 2-3 columns, I can manually rename them, but with many records, I want to make it more readable for users. I need to prepare a report about this. 'COLUMN_TEXT AS Description +', 'FROM' SELECT COLUMN_N

ember.js - Nested object in queryParams -

Question: What type of object can I pass query: {id : bla, email: bla-bla-bla} in query parameters? Simple way to do this App.ArticlesController = Ember ArrayController.extend ({queryParams: ['query'], query: {id: bla, email: bla -bla-bla}}); does not work, of course :) P.S. Sorry for bad english :) The amber query parameter sets an object as a query paragraph Does not support It only supports key-value pairs: What is the query parameter added to the right-key that appears on the right? For example in the URL, the following URL contains two query parameters, sort and page, ASC with respective values ​​and 2: if you type both id and < In the query stringing code> code> email properties, you must specify it explicitly: App.ArticlesController = Ember.ArrayController.extend ({queryParams: ['id, email '], Id: blank, email: null}); If you really want to add id and email directly to the query object, then you You can set u

vb.net - Find missing value in a numbers sequence - DGV column -

Image
I tried to search and did not find any success in fixing my problem, so I tried to find my solution . First I found the maximum (maximum) value (minimum value always 1), then I set the loop to search by value, but something is wrong in my loop. DataGridView1.Rows.Count- 1 if DataGridView1.Rows (y) .Cell (0): i as integer = 1 to max as y for integer = 0. Value = i then other builder 2 .Append (i & amp; ",") end if next next I look fine, but it is not working. If the value is found i then nothing is found. If it is not found, then add i to stringbuilder and, as long as it Maximum value is not reached But whatever I have tried I have achieved some strange results. The number from lowest to highest I have also removed all values ​​from the DGV column with a comma-delimited string if it is easy ... Edit: Just to experiment with that loop I have put I = 40 to 50 (to reduce the border) I know that the missing values ​​in the DGV column are 40-46 and 59.

ios - Keith Clark's CSS Parallax Inertial/Momentum Scrolling on Mobile -

So I created a site using the idea. And it looks good, but if somebody thought that to allow for intrital / spill-scrolling scrolling on the irod is curious to me. What do I still know: Initial / speed scrolling does not work because essentially the entire page is placed in the container Within overflow-y: auto . So when you are scrolling on the page that you are scrolling inside the container on IOS allows you to scroll to apply the -webkit-overflow-scrolling: touch Does not have a viewport which has an inertial / spimill scrolling. If you add -webkit-overflow-scrolling: Touch to .parallax , then the entire perpendicular effect breaks. I have tried to add iscroll.js to the page but also break the page to scroll in any way by creating the .parallax within the container. Is not justified . These parallax layers move up and down relative to the viewport rather than that container. Another problem is that this is not a big deal, but since it is related to it, it

Live video streaming in java -

I need to add live webcam video streaming feature to my web app where many customers can watch live video. This is almost a virtual classroom where teachers live and teach students. How do I broadcast live video in java? I have decided to use the Spring Framework for the application. Many people suggest Xgler or JMF, but I have not found any examples of their work. Can anybody suggest which library is to use and there are examples for the purpose? thank you in advanced. This question has already been answered and there is a description in the link given below. >

Flag first by-group in R data frame -

I have a data frame that looks like this: ID score 1 15 1 18 1 16 2 10 293 8 3 47 3 21 I would like to know one way to flag the first event of an ID - just as before. And the last one. In SAS I have tried a duplicated function, but I really need to add the "flag" column to my data frame because I am running it later through a loop. I want to do something like this: ID score first_ind 1 15 1 1 18 0 1 16 0 2 10 1 2 9 3 3 3 1 3 47 0 3 21 0 & gt; df $ first_ind & lt; - as.numeric (! Duplicate (df $ id)) & gt; Df ID score first_ind 1 1 15 1 2 1 18 0 3 1 16 0 4 2 10 1 5 2 9 0 6 3 8 1 7 3 47 0 8 3 21 0

javascript - Jasmine Test for ng-mouseenter -

I'm having trouble testing my directions with the NG-MouseSenter directive. I like it Description (describe 'hover tests'), function () (this (' triggered popover The method should be called on the hover ', function () {spyOn ($ scope,' triggeropopover '); var ars = jQuery (view.find (' article.the-class-im- (- 'looking for' -) ); jQuery (ARS [0]) Trigger ('mouseenter'); Hopefully ($ scope.triggerPopover) .tohaveBeenCalled ();});}); Usage: & lt; article my-directive ng-mouseenter = "trigger popova ();" & gt; & lt; / article & gt; < p> Result: Expected Detective The ng-mouse arrow content has been called. does not seem to call If you are using Fimentmos S for some of your tests, some mouse events that work in common browsers will not work. If this is actually the case, then you can run your test with Chrome or Firefox, or Alternately similar to the related question Can implement t

xcode - Textview caret/cursor is cut off at the bottom ios8 -

I'm struggling with a bug in Xcode 6.0.1. I'm building an app that has a similar view to Apple's compose section in the mail app. I'm using func textViewDidChange (textView: UITextView) {self.tableView.beginUpdates () self.tableView.endUpdates ()} Which is to change its size using cell layout and simple barriers in column view.stimatedROHETET and TableViewRowight = UITTualAutActive Demement Order. I have a cell Mytextview.delagete = self This works flawlessly in my second view where the text has not been entered by the user. The problem is that it seems that the cell carit / cursor is being truncated when it reaches the bottom of the keyboard or screen on the screen. Apart from this, if I press back repeatedly without entering the text then the carpet / cursor disappears almost 6 times, until it scrolls down to me, the cursor is still cut. I have realized that if I put 5 rows of text and then start back from the rows then the text works normally as well. It

php - Which way is more efficient? -

I will try to keep it simple. I've created twp functions that do some tests: < Code> // user valid function (validusr) {returns true; // or false, depends} // user db function indbusr () {true; Later, I have this if valid ($ myval)) validusr ($ myval) Returns; And if (! Mybie) ($ myval) returns; And come back to the truth; However, it does not look good because I am calling the function 2 times: to test once $ myval , and when I return it, but if I say, value like this Save From: $ result1 = Valid ($ myval); $ Result2 = indbusr ($ myval); If (! $ 1 result) returns $ result1; And if (! $ 2 result) returns $ result2; And come back to the truth; There may be cases when the second statement never runs because because it is always true, which calls the other function unusable. So which one is more efficient? What is the value and what does it store the risk that it is not being used or calls the function twice when needed? The argument boils down to doing

ios - iTunes Connect - What if I don't update screenshot for iPhone 6? -

Now when you update your app, show two more screensus in iTunes. There are more screenshot sizes to take. My question is, do I have to upload screenshots for all sizes? What if I just set up a screen? Will they also appear in the app store in other size devices? Yes, now Apple also requires you to submit screenshots for iPhone 6 and iPhone 6 Plus. You can either take a screenshot in the iPhone simulator or scale your current screenshot (not recommended) if the app does not fully support the large screen size yet. If you do not submit a screenshot, you will get: ITC.apps.validation.screenshot_5.5-inch_missing ITC.app Validation SignsHot_4.7-Inch_mission

java - Error getting the id of DefaultScheduleEvent Primefaces Schedule -

I am trying to set the "setId" and "getId" of a DefaultScheduleEvent object Set the id of the object and manually the event ID (like 15 ), but when I try to get the ID (I expect 15 to be set ) I liked something like this: c3e083a9-c418-4753-976c-801c0e9e6157 , which I believe is an object ID, Do you know that I Once set, So do not get? I'm using Prefetch 4.0 After working on this for a while, I got a solution that worked for me The problem is that when you add event to event model, then ID is specified. If you set an id after the event model has been added, then it will keep good id use: Personal Schedule Model Deficiency Model; Private ScheduleEvent event; Event = new DefaultScheduleEvent (title, startDate, endDate); EventModel.addEvent (event); Event.setId (clientEntity.getId ()); Instead of event = new DefaultScheduleEvent (title, startDate, endDate); Event.setId (clientEntity.getId ()); EventModel.addEvent (event);

android - How to set value in SharedPreferences as standard? -

I know that setting and receiving prices in shared preferences: but it only works This is when the app has started. I wonder how I can set some values ​​as standard so that they can set the app for the first time and set it also. So the code is not setting them, instead of writing something in string.xm Is this possible? Where is your SDK root? Check samples on shared prefixes .... $ SDK_HOME / Sample / $ platform / APPDOMS / src / com / example / Android / API / Priority / Default value.Go The sample you want is Example in main_activity.onCreate (): PreferenceManager.setDefaultValues ​​(this, R.xml.your-defaults, false); ... PreferencesManager.getDefaultSharedPreferences (this) .getString ("default_user_oid", "default"). Equal ignoreCase ("default")

multithreading - Parallel Synchronized Iterative Tasks in Native C++ -

I am using the original C ++ (no.net or / clr) and if so, The least dependence on external or third party libraries, which is where I got stuck. To stay as close as possible to break my question, three work tasks 1 (), work 2 (), and task3 (). Each is part of a step in the repetition process, that is: while (true) {task1 (); task2 (); task3 (); } I'm looking for a way to execute task1 () and Task (3) in parallel. To recreate this, the following is the acceptable parallel: Start - & gt; Work (1) - & gt; Work (2) - & gt; {Task3 () & amp; Work 1 () in parallel} - & gt; Work (2) - & gt; {Task3 () & amp; Work 1 () in parallel} - & gt; Work (2) - & gt; {Task3 () & amp; Work 1 () in parallel} - & gt; Work (2) - & gt; e.t.c. Any help is appreciated, and like I said that I do not really want to be on any party party libraries and want to be in the original C ++ 11. There can be a naïve approach in this way (only repeating

javascript - Open healcode link in iframe -

The issue I am facing is preventing links from launching a new page and loading your href pricing in IRRM is. The client site is using the Haylocks that provides widgets for scheduling fitness classes etc. Check it when you click on the signup button when the widget loads, it opens a new page what the customer wants to open that link on the same page or in a popup window. Whatever I can think of, I have to try them all. I have used jQuery, Fancybox etc. Code IM is used here. I think that this is a problem, that my inline script loads schedule HTML before ending the widget scripts. I know that this is possible because the same widget is used and opens the link in an overlay frame on the same page. Please put some light on this update: & lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Test & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Iframe id = "openViewHere" width = "500px" he

asp.net mvc - Create and assign value back from View bag to Text box in MVC -

I have to create a text box in a view-back property in MVC; I like the mapping such as @ Html.TextBox ("comments "Can I View (String) ViewBag.Comments?) But when the page is posted on the server then how can I read it? This viewbag property is not filling back. I am very new to MVC so Probably the concept is not understood. Thank you Your webpage wont updates with your view and it's up to you There is no way to get data from the form. Instead, you should use a firmly typed model binding to read your data from your action method or you can check the key in your form data, I am showing examples for both of you: Example 1: Highly typed model binding. [HTTP post] Public Fighter My Action (String Comments) {// Text Box. See Return (); } Example 2: Reading from posted data: [HTTP post] Public commentary MyAction () {// comment string comments from text box = Request.form ["comments"]; See Return (); } I hope you would like to use Example 1.

java - libgdx - Camera doesnt properly follow player - runs off screen -

I am developing a PBGDX RPG desktop game like Pocaine style (top down scene) in the game I have an orthographic camera To use the player to follow, he is created using Tiles around a Tmx map. The problem I am facing is that when the player continues in the map, the player eventually runs the camera, prevents him from walking on the screen, of which he is centered. I have searched Google and YouTube, which did not find anything that solves the problem. WorldRenderer.class Public class trustworthy {Private TiledMap map; Private orthogonaltilimmander renderer renderer; Public transit camera camera; Private player player; TiledMapTileLayer Layer; Public Worldrender () {map = new TmxMapLoader (). Load ("map / testMap2.tmx"); Renderer = new orthogonaltililmermmarker (map); Player = new player (); Camera = new orthographic camera (); Camera.viewportWidth = Gdx.graphics.getWidth () / 2; Camera.viewportHeight = Gdx.graphics.getHeight () / 2; } Public Zero Render (Float Delta)

ios - Objective C:Saving a sent email as a file -

I want to send an email by writing a program through an iOS app. On successful transmission, I want to be able to store a copy of the email sent as an email so that I can integrate and store the email in a document / contact management system. Does anyone know if this is possible and if so, which library are available? I have taken a look at some of the SMTP libraries on Geethub, but how can I save the email as a file thanks You can not save emails from e-mail composers in iOS. All you have to do is to manually generate the email format file with the code (as you already have all the data of the email) and save it if you use the delegate method The flag of success comes in when users send email.

String Initialization Declaration in C -

इस सवाल का पहले से ही एक उत्तर है: < / P> 6 उत्तर मेरे पास कुछ सवाल हैं सी में स्ट्रिंग आरंभीकरण और घोषणा। मान लीजिए कि मैं एक स्ट्रिंग के '10 आकार का उपयोग करके chars [10]; प्रश्न 1. क्या यह जरूरी है कि 'एस के सभी तत्वों को' \ 0 'पर आरंभीकृत किया जाए या क्या यह सिर्फ शुद्ध किस्मत है कि मैं' अन्य तत्वों को '\ 0 '? प्रश्न 2. अगर मैं इसके बजाय malloc का उपयोग इस तरह की स्ट्रिंग सेटअप करने के लिए करता हूँ char * s = malloc (10 * sizeof (char)); फिर यह आवश्यक है कि सभी तत्वों को '\ 0' में आरंभ किया जाएगा? प्रश्न 3. इसके अलावा मुझे एक '\ 0' जोड़ना होगा स्ट्रिंग घोषित करना या नहीं? char s [10] = "abc"; या यह होना चाहिए char s [10] = "abc \ 0"; नोट: यदि संभव हो, कृपया केविन द्वारा दूसरे उत्तर पर एक नज़र डालें। नहीं" ??? सामान्य रूप में। कुछ संदर्भों में हाँ, यद्यपि। विशेष रूप से, यदि वेरिएबल एक स्थानीय वैरिएबल है और static नहीं है, तो यह बिल्कुल आरंभ नहीं किया गया है यदि

sql - Rounding up and down of numbers with specific decimal points -

I am using SQL Server 2008 R2 and round the values ​​with specific decimal points as shown below and below For example: If my value is 1.27845 and me 2 The answer with decimals is Rounding down: 1.27 If my value is 33.33333 and I want to reply with 2 decimal places then my answer should be Rounding UP: 33.34 Rounding Down: 33.33 If my value is 1.27845 and I want to reply with 3 decimal places, then my answer should be rounding UP: 1.279 Rounding down: 1.278 If my value is 33.33333 and I need a reply with 3 dc Riding down: 33.333 I am looking for all matters Valid solution should be thanked ... You can use the following "offset" with FLOOR and CEILING DECLARE @ Digit Int = 2, Avilue Decimalian (10,5) = 1.27845 DECLARE @calc_scale int = POWER (10, @ points) Choose Cast (Flow (@value * @calc_scale) / @ calc_scale However, below the target data as DCC (10,5), CAST (CEVLING (@value * @calc_scale) / @ calc

javascript - How to create data model dynamically -

I have this Jason data that I get from the server in JavaScript var mydata = JSON Pars ('["X", "Y", "Z"]'); Below I have the following data model in javascript. Precise var mySchemasList = {schema: [New selection schema model ("A", wrong) , Select the new Skemmodel ("B", false), new selection highimode ("C", wrong)]}; I want to dynamically obtain this model data from mydata ('A', 'B', 'C'). Any help is sincerely appreciated .. thanks Can not you do just that? var i var mySchemaList = {schema: []}; For (i = 0; i

jquery - How to validate old password when i change a new password -

I have a form to edit a user account, where I give a new password and old password in the input field. If the new password field is not filled, the data will be stored, and if I need to fill in the old password field filled in the new password field, how do I provide verification? The new password is not equal to the old password. Here's my code: & lt; Div class = "form-group" & gt; & Lt; Label class = "control-label" & gt; Current Password & lt; / Label & gt; & Lt; Input type = "password" name = "currentPassword" class = "form-control" & gt; & Lt; / Div & gt; & Lt; div class = "form-group" & gt; & Lt; Label class = "control-label" & gt; New password & lt; / Labels & gt; & Lt; Input type = "password" name = "newpassword" id = "newpassword" class = "form-control" & gt; & Lt; / Div & gt;

How to apply android:windowSoftInputMode="adjustResize" to a single layout -

I have two layouts in one activity and I want to apply android: WindowSoftInputMode = I got it, it can be done by comparing the heights between the edit. This margin is by using top property

Android App problems bringing right main activity to front -

After the app has expired, I'm trying to bring my application (user press button back) but this is only my Opens the last opened app in front of me, so if I am using a different app in the middle time then this app will open and my app will not be. Maybe someone can help me - I tried many different combinations with the flag, but it does not work. Also, I did not find any solution to get my app back if the display was locked - maybe it could be a good solution for someone or give me advice Thanks Public class incoming broadcaster receiver Broadcast receivers Expands {@ Public invalid prevention on dieting (reference references, intended intentions) {MyActivity myActivity = (MyActivity) Reference; MyActivity.doWork (); } Public class enhances MyActivity activity {Private Boolean app InBackground = false; ... @ Override public ontop (at zero) {appInBackground = true; super.onStop (); } @ Override Public Zero Finish (if (ExitPressed) {super.finish ();} and {appInBackground = tr

Want to fetch the id of the different div elements on the click of p element using javascript -

I have a page with a p tag and div element, the divis element is set with the display: this is not the case at the beginning , I just want to display the various devices shown below body tags on the click of P tag but I got stuck in the different ID of the division, please help me with this situation. Below is my code i thanks & lt; Script & gt; Function toggle (id) // Here is a function that receives various IDs of div {var element = document.getElementById (ID); {if (element [i] .style.display == "none") for {i = 1; i & lt; 3; i ++} {element [i] .style.display = "block"; } And {element [i] .style.display = "none"}}} & lt; / Script & gt; & Lt; Body & gt; & Lt; P onclick = "toggle ('div1')" & gt; Sentence1 & lt; / P & gt; & Lt; P onclick = "toggle ('div2')" & gt; Sentence 2 & lt; / P & gt; & Lt; Div id = "div1" name = "name1" style

AngularJS ngRepeat: how to differentiate even/odd elements? -

I am new to angular and am trying to do the following: Lt; Tr data-ng-repeat = "elements in horrible things" & gt; & Lt; div ng- if = "$ index% 2 == 0" & gt; & Lt; Td square = "even here" & gt; & Lt; A href = "#" & gt; {{Element}} & lt; / A & gt; & Lt; / TD & gt; & Lt; / Div & gt; & Lt; div ng-if = "$ index% 2! = 0" & gt; & Lt; Td square = "weird" & gt; & Lt; A href = "#" & gt; {{Element}} & lt; / A & gt; & Lt; / TD & gt; & Lt; / Div & gt; & Lt; / TR & gt; For the above code, both ng-if is passing. Try the $ even and where I'm making a mistake property. Like: & lt; Tr data-ng-repeat = "elements in horrible things" & gt; & Lt; div ng-if = "$ even" & gt; & Lt; Td square = "even here" & gt; & Lt; A href = "#" & gt;

django - pip installation on different python version -

I have a problem with the installation on pip linux. I have Python 2.7 and 3.4, which is also set in 1.7 giggega. Currently I am working on a project which uses different versions and I am unable to install package trough pip on Python 2.7. Everything goes into the directory of 3.4. Is there any way to "force" pip to install packages in a solid version of Python? The way that most users work with normal, and recommended, DJGGO, a different, virtual environment To use the project. To set your Python 2.x environment and Python 3.x Both will install their own, local version of PP. If you need help beyond document

python - How to use celery for inserting data to mongodb using mongoengine -

I am trying to use celery to incorporate large data into my mongodb, but problem mangodb in concurrency If I send more than one work to the vegetable part of the data at one time, then it will be inserted into mongodb and there will be no other data. I think this is because MongoDob locks the database on the functioning of inserting data, but I need a solution to be able to send several functions of the same type to enter data into the database. As if the database is locked when it is waiting to unlock it. Here is a part of my code: @ celery.task (name = 'celery_tasks.add_book_product') def add_book_product (product_dict, store_id): connect (DefaultConfig.MONGODB_DB, host = DefaultConfig.MONGODB_HOST ) Try store_obj = Store.objects.get (pk = store_id): book = books.objects.get (pk = product_dict ['rawbook']) Try: product_obj = product. Absence. (Store = store_obj, related_book = book, kind = 'book') print (found for "product {} store {}". Format

angularjs - How do I pass values from one route to another in angular? -

I am using an angular router, and I have the same path as the bottom < Code> ("/ List", {templateUrl: '/ scripts /', 'App / view / ABC / Absellist HTM, Controller:' List ABC Controller '}). When (('/ view /, id', {templateUrl: '/Scripts/app/views/abc/AbcDashboard.htm', controller: dashboard ABC controller '}) // more .... ({RedirectTo:' / list ' });}]); So there are one and two routes to the list of items for the dashboard to select for listing you can see. In the list passage, the list view is selected and shown where I show the grid with some data, from this grid there is a column name column that is clickable and on its click I href = "# / view / {row.Id}" . This works fine. But, how do I add some extra parameters to Dashboard ABC Controller or some other details? EDIT: I thought I can use general service for both of these administrators and update some models in the ng-click service. But

c# - Mongodb Update Fails with No Error -

मैं एक एएसपी.नेट एमवीसी वेबएपीआई नियंत्रक में नवीनतम मोजोडीबी-सी # चालक का उपयोग कर रहा हूं। जब मैं कॉल करता हूं तो मुझे कोई त्रुटि नहीं मिली: collection.Update (क्वेरी & lt; T & gt; .EQ (e = & gt; ई.आई.डी., entity.Id), MongoDB.Driver.Builders अपडेट करें & lt; T & gt;। बदलें (इकाई), WriteConcern.Acknowledged) लेकिन प्रभावित दस्तावेजों की संख्या 0 है। अगर मैं एक यूनिटटस्ट सीधे नियंत्रक (यानी यह किसी भी सर्वर के तहत होस्ट या चल नहीं रहा है। बस मेरे यूनिटटेस्ट में नियंत्रक को तदनुसार एक सामान्य वर्ग की तरह व्यवहार करना) जब मैं ऐसा करता हूं तो सबकुछ अपेक्षित काम करता है। मुद्दा जब मेरी साइट होस्ट की जाती है और अधिक: अगर मैं एक नया ऑब्जेक्ट बनाऊँ और फिर उस ऑब्जेक्ट को संशोधित करने का प्रयास करें और अपडेट सफल होने से ऊपर कोड को कॉल करें। उदाहरण: अगर मैं अपने वेबएपीआई नियंत्रक पर पोस्ट करता हूं एक वस्तु बनाने के लिए जो इस कोड को चलाता है: मोंगो कननक्शन। संकलन। इन्सर्ट (मान, लिखित कॉर्नर्न। स्वीकार किया गया) और तब मैं उस ऑब्जेक्ट और कॉल को संशोधित कर

haskell - Installing Cabal has missing modules -

My ghc was installed so I decided to restore ghc and cabal to fix some problems. I started following the steps GHC is now version 7.8.3. I then removed ~ / .cabal and tried to use the steps but it failed. So I removed again and then tried the steps but when i run sh bootstrap.sh then it goes into the missing module: parsec-3.1 Using local tarball for .6. [1 to 1] Compilation Main (Setup.hs, Setup.o) Linking Setup ... Configuring Parsec-3.1.6 ... Building Parsak-3.1.1.1 ... Preprocessing Library Parsac-3.1.1 ... Text /Parsec/Prim.hs:80:8: The module could not be found. Control.Monad Transitions files are missing in "MTL -2.2.1" Package, try running 'ghc-pkg check' - Use the -v to see a list of files used Text / Parse / Prime HIS: 81: 8: Modules Can not be found. Control.Monad The identity files are missing in "MTL -2.2.1" package, try running 'ghc-pkg check' - Use the -v to see a list of files used Text / Parsek / Prime HS: 83: 8: Modules C

ios - Run animation until a button is pressed -

I am trying to create an app in which the animation should run until a button is pressed. I have tried to use infinite loop but my app is not running with that loop at all. It's taking all the memory, I tried to call again when I completed the same function, but this process consumes 100% of CPU too. Can you please guide me what I should do here The landscape is in the background of the scene, the animation should be played continuously until the button is pressed. Another view will be opened when the button will be pressed and then the second animation keeps running until continuous until some buttons are pressed. After my code is: function unlimitedLoop () {rotation = true self.ProcurementSupport.transform = CGAffineTransformMakeTranslation (0, 100) self.ProcurementSupport.hidden = false UIView.animateWithDuration (3, Delay: 2, usingSpringWithDamping: 2, initialSpringVelocity: 2, options: zero, animation: {// self.EquipmentSupport.hidden = true on X: NSTimeInterval = 2