Posts

Showing posts from February, 2015

c# - How Store datetime value in to local datetime variable? -

I am storing some values ​​in sessions and some columns date time < / Code> Retrieve the value where the clause and use this session value code: date time current date = default (date time); Session ["d_id"] = dt.rows [0] ["d_id"]; Current day = objdl.GetScalerValue ("Select IsNull (Max (Login Date), GETDATE ()) from q_logintrack_panel where id = '" + session ["d_id"]. ToString () + "'"); Here the error occurs in the third row. Error: The string can not be changed explicitly in the system. Data Time Please give me the exact solution ... You need to parse the returned string returned by GetScalarValue for the DateTime object: Datetime current date = default (datetime); Session ["d_id"] = dt.rows [0] ["d_id"]; Var dtStr = objdl.GetScalerValue ("Select IsNull" (Max (Login Date), GETDATE ()) from q_logintrack_panel where id = '"+ session [" d_id "].

authentication - Log access by users in Django? -

I currently have HTTP logs that show me which page has accessed, but it does not include a username is. What would be the easiest way to remove that information? A middle class? There is a way to do this: class requestlogging modelware (object ): Def process_response (auto, request, response): if request.user and request.user.is_anonymous () No: # log message here Return feedback Other options use centralized logging tool To do that is easy to setup and it provides a very good logging user interface. Log messages are filled with versatile information, which includes users associated with the request.

iso8583 - What to make mac with, in ISO 8583? -

I want to create an ISO message with a field 64 message authentication code (MAC). I want to know what does the binary of the ISO message with MAC do without field 64? Or with the information set on the binary field 64 of the ISO message, but at the end of bitmap is showing a 1 that there is something in the field 64? You should define the fields that you use in the Mac calculation. Select specific areas and apply your Mac-ING algorithm. Normally, you can go through the following guidelines: Mac field in Mac calculations (F64 / F128) those areas contain results of the Mac; It will be guaranteed to include them in the calculation that the mac value will always be incompatible. Try to use the mandatory field, i.e. that you (or ISO) has compulsory form for the message All you have to do is type the name you are looking for in Mac to include some vendors (such as ACI, base 24), message headers, message type identifier (MTI) and primary bitmap mac calculation. Ev

linux - Installing php on CentOS using Terminal -

I am very new to all of this so please forgive my ignorance. I have a VP running on Centos 6 and Plesk I am trying to install a new version of PHP using the following tutorial (current version is 5.3) I command wget http : //uk1.php.net/get/php-5.4 .27.tar.gz / to / this / mirror which downloads the file php-5.4.27.tar.gz but Saves it in the 'mirror' If I then use the 'mirror' by using the CD mirror I get a message in which -bish: cd: enter Reservation: no directory . I have tried the CD / mirror , CD / mirror / and CD / mirror / . I am not available anywhere with any help would be appreciated Thanks What you can do here is to name the mirror php-5.4.27.tar.gz, remove it and then in the cd directory. MV mirror php-5.4.27.tar.gz wire xvf php-5.4.27.tar.gz cd php-5.4 .27

c# - Getting specific properties from an object child -

This question has been struggled to come in a decent way to ask / title, but I will try and I can do the best. I am working with a data structure like this: public fu {public times {get; Set;}} Public Bar {public subtype A Type A {get; Set;} public subtype B type B {get; Set;} ...} public subtype {public perfection status {get; Set;} ...} Note that I can not change the data structure for it. There are many different types in the bar category, all of which have different properties, but for all of them, the normal status . What do I need to do, it has been given an object of type foo , each time the status of each item in the bar object is recorded SubType is not going to be charged every time, something can be empty. I can use a recursive function to manage the kind of loop through everything like below. This is not ideal, although I do not think the loop can be quite big because there can be many properties on each SubType Private Zero GetProperties (typ

login - Facebook Server IP Whitelist Range? -

I have found that I add more than one domain to my Facebook app by including the server IP address in "Server IP Whitelist" Field "and" Valid OAuth Redirect URI "field. It would be really good to be able to add IPs instead of the same IP address in the whitelist area Instead of 127.0.0.1, I have 127.0.0.0, 127.0.0. *, And 127.0.0.1-127.0.0.100. Any of these Does anyone know that it can be done? To host your website, go to your DNS settings and copy the IP address that should be like 11.11.11.111. If you are hosting in Azeri, you can go to the Custom Domain tab and click on the IP address You can make a copy Im sure that you have received a reply so far. A is that this issue are looking for the first time, because no one ever does not post if he could get them out of the stack overflow, lol.

R setting limits to row values in dataframe -

मेरे पास डेटाफ़्रेम है: a & lt; - c (1: 5) b & Lt; - c (5: 9) c & lt; -c (7:11) मिनट & lt; -c (2,7,4,5,3) अधिकतम & lt; -c (5,9,12,8,7 ) Df1 & lt; - data.frame (a, b, c, min, max) df1 मैं पंक्ति सीमा निर्धारित कैसे कर सकता हूं, इसलिए प्रत्येक पंक्ति के न्यूनतम और अधिकतम मूल्य ए, बी , सी कॉलम में पंक्ति मानों द्वारा निर्धारित किया जाता है: न्यूनतम और अधिकतम? आपकी मदद के लिए धन्यवाद। यदि आप कॉलम की एक सूची के रूप में डेटा फ्रेम के बारे में सोचते हैं तो मुझे यह आसान लगता है: mins & lt; - lapply (df1 [1: 3], फ़ंक्शन (x ) Pmax (x, df1 $ min)) maxs & lt; - lapply (mins, function (x) pmin (x, df1 $ max)) फिर आप data.frame को पुनर्निर्माण कर सकते हैं : df2 & lt; - do.call (cbind, maxs)

recursion - Assisting Agda's termination checker to make a recursive function -

Text after " Suppose that we want to define a function for some types A₀ ⋯ Aₙ and B. f: A₀ ⋯ Aₙ → B f x₀ ⋯ xₙ = ... recursive call for F ... Assume this definition is not structurally recursive. Also assume that I have definitions for the following: A function g: A₀ ⋯ Aₙ → ℕ which For each case of f for a natural number f : There is a proof that the argument G passed arguments for the recurring call passed (in relation to the built _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ I will put these parts together to create a recursive function; This question is the follow up on the same topic, for which they have been fully answered. However, I think the type of function of the example is misfortune ℕ → ℕ , which makes it difficult for me to see how the general case spreads. Also, as a note, I was n

loops - C++ looping a menu -

I have the following code that compiles, but I will take the loop back to the original menu after selecting the user's choice So anyone else can be selected. Any help would be greatly appreciated. #include & lt; Conio.h & gt; # Include & lt; Iostream & gt; using namespace std; Int main () {int likes; Cout & lt; & Lt; "Select your favorite soft drink: \ n"; Cout & lt; & Lt; "Pepsi - 1 \ n"; Cout & lt; & Lt; "Phantom 2 \ n"; Cout & lt; & Lt; "Fanta - 3 \ n"; CIN & gt; & Gt; the option; If (like == 1) {cout & lt; & Lt; "Good choice" & lt; & Lt; Endl; } And if (like == 2) {cout & lt; & Lt; "Not bad" & lt; & Lt; Endl; } And if (likes == 3) {cout & lt; & Lt; "Ew!" & Lt; & Lt; Endl; } Getch (); Return 0; } #include & lt; Conio.h & gt; # Include & lt; Iostream & gt; using namespace std;

concurrency - Immutability in imperative languages as opposed to functional languages -

I see in concurrency and it seems that due to continuous variables / states due to other reasons, functional languages Priority is given) and in fact there is no need to lock these variables and when they enter them together, though, I have a problem with this because language like Java allows you to create temporal variables, it is a functional In the language How different is the inability of R? The only real difference is that you do not jump through hoops to make things in functional languages ​​irreversible Does matter; It's automatic with Java, you should not increase the classrooms (making the class final or all of its constructions private) and make sure that any of your fields can change (either use only primitive and irreversible items for farms To make or copies on them and on the way out) But the stability is irreversible, regardless of which type of language you use.

objective c - How to repeatedly do an event on touch a button -

I touch these codes inside the event of a button to increase the number in the UILB: < Pre> integer score = [lblScore.text intValue]; Score ++; LblScore.text = [NSString stringWithFormat: @ "% i", score]; I want to press and hold down the button, add up to the release button repeatedly. Touch up fire, as it says, when your figure is picked up by the button. To do this, you will need to start the loop inside touchdown: and touchup:

batch file - MS Dos Schedule Scripting -

I would like to ask for your help because I am the first in scripting. I want to execute a script with the following conditions. Every 1 Saturday of the month I need to run counter challan monthly I need to resonate every Saturday of the month weekly the rest I need to run daily daily You can use the Task Scheduler in three schedules You can find out the date and day of the week in your batch file, and if it is from the desired days of the week If it does not, then it also checks whether it is already running that day or not - if it is needed.

Looping to create jQuery tabs -

I am trying to create a tab-based alphabet set by employees in a database, thus it will not set a set database Here's the query dynamically created based on employees: & lt; Cffunction name = "ALPHA_RL" access = "remote" returnformat = "JSON" return type = "any" & gt; & Lt; Cfargument name = 'DEPTMATRICSID' required = 'true' /> & Lt; Cfset retVal = ArrayNew (1) & gt; & Lt; Cfquery datasource = "# request. DSN #" user name = "# request. User #" password = "# request. Password #" name = "get alfalist" & gt; Select alpha different from (Selection substr (A.LAST_NAME, 1, 1) alpha WEBSCHEDULE.APPLICATION_USER one, WEBSCHEDULE.FACULTYHISTORY H, WEBSCHEDULE.FACULTYTABLE T. Where is A.EMPLID = H.FACULTYEMPLID and A.EMPLID = T.EMPLID and H.DEPTMATRICSID = # ARGUMENTS.DEPTMATRICSID #) where alpha alpha does not have any command & lt; / Cfquery & gt; &a

javascript - How to quickly temporarly remove elements from DOM and return them on demand? -

I want to ask, how to deal with many elements on this page that have emerged like this: < Pre> & lt; Div id = "tab1" & gt; ... hundreds & lt; Div & gt; 'S & lt; / Div & gt; & Lt; Div id = "tab2" & gt; ... hundreds & lt; Div & gt; 'S & lt; / Div & gt; Etc ... On demand of those hundred devices is loaded using AJAX. The problem is that there are more tabs, which have a large number of elements in each domain which makes all the tasks slow and slower because more tabs are loaded with content. Is there a simple way to remove elements from temporarily invisible tabs and return to demand, when some tabs are clicked to appear? Of course I do not want to use $ ('# tab1 .content'). Hide (); Because this will only make the contents of this tab invisible, but the content will still be in DOM. Thanks in advance for any help. Edit : If I want to reuse already received (cached) content then

liferay - Can't Reindex All Search Indexes [SOLVED] -

I recently removed 120,000 users from my Liferay database using an automated script. the User_ WHERE userId = 1234567 deleted database deleted manually 2 user databases by using - it is to see what can be the user can do with it . The user was removed, but the user ID is retaining all other table rows holding the ID (1234567). Okay. So now I am at a point where I want to add all the search index again to get the current list of users, but LR throws an exception: Error 08: 07: 41,922 [http-Bio-20110-exec-290] [Lucinindexer: 136] Com. The error has to be encountered while re-flowing on the lififier. Portable.kernel.search.SearchException: com.liferay.portal.NoSuchUserE xception: not com.liferay.portlet.usersadmin.util user com.liferay.portal.kernel.search.baseIndexer.getDocument (BaseIndexer.j ava: 179) .ContactIndexer exists with the $ 1 key on {contactId = 1234568} Kprform action .java: 203) InSingleInterval on com.liferay.portal.kernel.dao.orm.BaseActionableDynamicQuery.p

mysql - Select from one table and order by column of another table -

I am very new to MySQL and I could not find any solution for this problem. I appreciate all kind of help. I have Table A and Table B, which are interconnected. I want to order a result from Table A. and order results by 'Date' column in Table B. This table is linked by 'user_id' My table is given below: Table A: ... name user_id (link to table b) Table B: user_id date Is it possible to do that? Thanks for any help! You want to include an interior. Something like this: Außer_ID, A name, be it a sign in Join B from BUUSER_ID = AUser_ID WHERE (whatever is your filtering) ORDER BY B.date You should do some research on joining as it is an important and important thing for the development of the database (and knowing a good deal about it helps in building a good architecture). The essence of this is that for every user_id in A, I want to find the matching user_id in B (due to the line INNER JOIN B at B.user_id = A.user_id). An internal insertion bring

Hiding the Status Bar under Android 4.2.2 (SDK 17) -

Image
It is possible to hide the navigation / status bar permanently under Android 4.2.2. It seems that Jelly is not working under Bean. I have a Galaxy Tab 3 (10.1) and the status bar draft has no effect. Start on every screen that is hidden on the application, but I can extend it. The problem also occurs after removing the device Someone has encountered it before (how the video is also fixed): forum.xda-developers.com/showthread.php?p=37466852 So my question is: Is there any way to do this at the application level? No, it seems that there is no way to do this so that you can access your entire app on Tablet 4 Let's go on. +. Also, it is completely disabled, it never seems that it is not possible. However, the solution you linked works for Android 4.2.2 (testing on the 10x tablet on Nexus S and Emulator) when it works, it reloads the status bar If there are some user interactions for navigation permission (for example, by pressing the menu button on the phone), it mean

c# - Check the duplicate entering -

I am using this code to enter. Private Zero Button 1_Click (Object Sender, EventArgs E) {String Coonstring = "datasource = localhost; port = 3306; username = root; password = ****; charset = UTF 8" ; String cmd = "Enter in project.name_registry (name) values ​​('" + this.txt.Text + "' ');"; MySql Connection Connection Database = New MySqlConnection (Coonstring); MySqlCommand cmddata = New MySqlCommand (CMD, connectionDatabase); MySqlDataReader myreader; Try {connectionDatabase.Open (); Myreader = cmddata.ExecuteReader (); MessageBox.Show ("full"); While (Myrider. Reid ()) {}} Hold (Exception Pre) {Message Box. Show (ex.Message); }} I need to press on this button to see if the name of the joining is found, the message box appears, then tell that my name is present and stop adding. If I have not been involved then tell me how I can do this. Regards The best place to check this is in the database only All databases can s

testing - Can we test the signed apk android app from eclipse without installing from google play store? -

I have developed an Android application for app purchase and have also published on Google Play Store. But I want to test the app in the device without installing it from the Google play store. So, it is possible to test in-app purchases without installing it from Google Play Store. If anyone has ideas. Please answer. Thanks in advance .. Google has written a guide on how to test in App Billing / Purchase ( ) You can manually install your app in your options by "allowing you to install from unknown sources" and are just opening the APK from the device, but the billing test is still available for Play Services Must go through. There is another limit that you need to use a real device for testing, not an emulator, but perhaps there are ways to remove that restriction.

Problems Opening a Gallery through a Button in Android -

I'm working on an Android app for the past time. I have a button that has a list of buttons ... adding new activities ... One button is a gallery .. On main activity, I have an onClick method to open a button: private zero init () {Button3 = (button) findViewById (R.id.button3); // Button button3.setOnClickListener (New View. OnClickListener) {@Override Public Zero onClick (see V) {Intent I = New Intent (v.getContext (), Scholarship class;); Initial Activity (i); End (); // Activity after main activity activity to be closed}}); // Link to scholarship page button 4 = (button) findViewById (R.id.button4); // button button4.setOnClickListener (New View.OnClickListener) {@Override Public Zero onClick (see v) {intent i = new intent (v.getContext), GalleryActivity.class); startActivity (i); finish ); // Start information activity after closed key activity}}); // link to gallery page} button 3 works fine ... but when I click on the button 4 "Unfortunately your app has sto

sqlite - How to filter SQL by time (greater and less than)? -

I want to query a subset from a dataset. Each line has one time stamp of the following format: 2014-04-25T17: 25: 14 2014-04-25T18: 40: 16 2014 -04-25 T18: 44: 57 2014-04-25T19: 10: 32 2014-04-25T20: 22: 12 ... Currently, I use the following query A time-based subset for: time '% 2014-04-25T18%' or '% 2014-04-25T19%' like the time ' It becomes quite complicated when you start filtration by mintutes or seconds. Is there a way to run a query such as ... time & gt; '% 2014-04-25T18%' and time & lt; '% 2014-04-25T19%' ' A regular expression will also be fine. The database is one. The time column is of VARCHAR type. If the date is considered as a string and the example given above: Time '% 2014-04-25T18%' & Time & lt; & Gt; Otherwise, you can change the date in seconds after midnight and add up to 60 minutes so that the range portion of the filter Declaration @test DATETIME = '2014-04-2

ios - Some troubles with UIScrollView -

Image
I have just started working with XCode 5.1 and IOS 7.1. I have some problems with partial visuals with a scrollview. I have it. ) I should take a place on the scrollview, but the location should be marked in red, but instead it should be taken more vertically and horizontally. View controller and view are defined as 500x500 free forms in the storyboard and defined as scrollviews: scroll = [[UIScrollView alloc] initWithFrame: CGRectMake (0, 0, self.view.frame .ize.width, rowHeight * [lstMatches count])]; Scroll.contentSize = CGSizeMake (self.view.frame.size.width, rowHyight * [lstMatches count]); // Here. More elements were added as scrollviewviews [self.view addSubview: scroll]; The problem is next: 1) Scrollview is more comprehensive than its container so I can not click on the right button. I tried to change the width of the controller and To see 800 (maximum width is about 750), but I can not click them. Thanks for your help Try: scroll = [[UIScrollView alloc]

xml - XSLT ignores template for child element -

I am trying to convert XML to XML using XSLT: HTML: < / P> & lt; Html & gt; & Lt; Body & gt; & Lt; P class = "one" & gt; Some paragraphs 1. & lt; / P & gt; & Lt; P class = "one" & gt; Some paragraphs 2. & lt; / P & gt; & Lt; P class = "one" & gt; Some paragraph 3 & lt; Em> Em & lt; / Em>. & Lt; / P & gt; & Lt; P class = "one" & gt; Some paragraphs 4. & lt; / P & gt; & Lt; P class = "one" & gt; Some paragraphs 5. & lt; / P & gt; & Lt; H3 & gt; Some title & lt; / H3 & gt; & Lt; P class = "two" & gt; Some other paragraph 1 & lt; Em> Em & lt; / Em>. & Lt; / P & gt; & Lt; P class = "two" & gt; Some other paragraphs 2. & lt; / P & gt; & Lt; P class = "two" & gt; Some other paragraph 3. & lt; / P & gt; & Lt; P c

c++ - Fill a WCHAR array with filepaths -

I fill a WCHAR array with text file for textures in C ++ Trying but I have difficulty understanding how to do this. How do I do this now: WCHAR voltaactactor [] = {l "../ engine / data / wall 01.dds", l "../ Engine / data / wall02.dds "}; And it is not compiled at all. If I do this with only one file path, then it fills every single pointer of the array with a single character and I need the voltexation array [0] so that there is a complete file path and so on. Thanks in Advance. With this definition: WCHAR welding around [ ] = {... You have defined an array of WCHAR , that is, string If you want array of arrays , you can define an array of indicator WCHAR s : CONST WCARAR * WALLELECTECLES OTHER [] = {L "../Engan / Data / Wall01.Disk", L. ../ engine / Data / Wall02.Didz "}; (Since these strings are literal and you can not modify them, I have added const .) Note that in modern C ++ you want to use a co

android - decimal to char coding -

I am trying to convert a decimal to a character. I have my alphabet which has been converted to a four array. string alphabet = "abcdefghijklmnopqrstuvwxyz"; Alpha = alphabet Cochrane (); I was using a binary number, so there is a value of only 0 to 255, but when I try to execute this code it does not work. Private int ToChar {int encryptcode} {int base = 26; Intro character space = (encrypted code / 255) * base; Four letter = alpha [character post]; Return character; I have to say that the decimal number 78, 78/255 * 26 7.95 (8 to the int round) should be seen, it should look alpha array and give 'h'. But each character gives the meaning 'A', which means that (encrypted code / 255) * base is not working with purpose. Kevin is in the right comment, try to rearrange your thread like this: int characterSteps = (encryptCode * base) / 255;

distributed - Visual Studio Test Controller 2013 name -

I can not find the name of the test controller for the distributed test in the final Visual Studio 2013, how can I find the name? Try the IP address with 6901 (like 127.0.0.1:6901)

angularjs - Fade In / FadeOut angular js -

I'm very new to AngularJS and would like to know how to do this: < Code $ (". -change-agency-clicker"). ("Click", function (e) {e.preventDefault (); $ (".form"). FadeOut (function () {$ (". Agency-change-form"). FadeIn (); $ ( "# AgentForm") Show ();}}}}}; So when a user clicks on a button, it is fadeout in a panel and fade in the second panel. Just follow these steps: .change-agency-clicker is clicked (), toggle the value of one if this variable is true , then hide () element .form . If this variable true , show elements . and #agentForm . Animate all things with CSS infections (), and forget that transition delay if necessary. Thoughts, of course, "declarative" and "mandatory"!

asp.net - Choose postback URL of according to situation -

I control if a user is present in the database, if it does not exist, I want to be the login page. If it exists, then I want to go to the default .aspx page. Protected Zero BtnLogin_Click (Object Sender, EventArgs E) {If (the situation is OK) {// go default.aspx} else {// Make this page}} < / Pre> What can I write on the comment line to get it? Thanks! Looks like you want to redirect: protected Zero BtnLogin_Click (object sender, EventArgs e) {if (myCondition) {Response.Redirect ("/ default.aspx"); } Other {// stop this page}} If you want to keep post data, you can use Server.Transfer instead (Note: editing, it does not this way you need it - I think you just need feedback. Redirex : < Pre server transfer ("/ default.aspx"); Note that transferring the handler of such a post does not not Browse one Will cause redirects and therefore not will replace the browser URL If you really need to post a different URL and there is a

passing variables to os.chdir in python -

I have a very disappointing experience trying to change the directory in Python using the variable in the program. Specifically, suppose I have: index = '999' os.environ ['dir_name'] = 'directory_name_' + index os.chdir ('$ dir_name') < / Code> The OSERR returns: [Aron 2] There is no such file or directory: '$ dir_name' and yet Os.system ('echo $ dir_name') Returns' Directory_Name_999 '(a valid directory name) and so on os.chdir (' Directory_Name_999 ') Replaces the directory without error and what can Python do os.syst Em understands that $ dir_name is a named dir_name . It checks its environment variable and finds it. Python does not know what is "$ dir_name" , and it assumes that you are using a literal string, it tries to change that directory , And fails because there is no literal directory "$ dir_name" . Instead, do: Index = '999' os.environment

ios - Loading my image on new screen -

I want to work to see everything I can see in the picture, I do not load the image On a single screen, I can load it in a new screen. I have tried some tutorials, I have no luck yet The image that is loaded from the gallery is a brick wall in the background. For this reason I want it to be loaded into a new screen, so I can put a new toolbar that pulls the images and the image above the tallest image in the upper part of the image or Will allow the camera to be taken Thanks in advance and sorry to ask about something which is so easy, I am very new to all of this. - Select (IBAction) Photo: (UIButton *) Sender {UIImagePickerController * picker = [[UIImagePickerController alloc] init]; Picker.delegate = self; Picker.allowsEditing = Yes; Picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [Self present ViewController: animated picker: yes complete: zero]; } #pragma Icon - Image Picker Controller Representative Methods - (Zero) Image Picture Controller: (UIIm

vba - Convert a hex string to base64 in an excel function -

I have a long string of hex values ​​that need to be changed to base 64. I am looking for a simple format cell function such as = hex2b64 (hexstring) that will accept any length of hex characters. I have found pieces here and there but there is no simple code block. I use this conversion manually to this point, the conversion works well and the data is derived from all relevant databases and appropriately parsed. According to the data I have been receiving hex binary representation, which has been changed in many blocks and concatenated long hex is in the string in the project documentation that I am not able to implement A typical input string will be:. Hex = 00014088F6650101393939393939392D30304646463238313030000343332353430342D35353FA10000002805900100002805 and corresponding output: B64 = AAFAiPZlAQE5OTk5OTk5LTAwRkZGMjgxMDAAA0MzI1NDA0LTU1P6EAAAAoBZABAAAoAF Function Hex2Base64 (ByVal strHex) Dim arrBytes then lane (strHex) Mod 2 & lt; & Gt; 0 then strakes

php - Optimizing array merge operation -

I appreciate any help. I have approximately 7 different arrays. I have 90,000 numbers in each array (we call them arrays1-arrays7). There is no duplicate number within each array, but duplicates between arrays can be duplicated. For example, array 2 does not have any duplicates, but with arrays3 and arrays4 it is possible in the same number. Problem: I'm trying to identify duplicated numbers of all 7 arrows once in a merging class. I want to make this calculation 1000 times and it takes 15 minutes but that's not okay because I have to run it 40 times - Code: If you have any other language I know this is most suitable for calculation of this type. Please tell me some extension suggestions like redis or gearman are useful. For ($ kj = 1; $ kj & lt; = 1000; $ kj ++) {$ result = array_merge ($ files_array1, $ files_array2, $ files_array3, $ files_array4, $ Files_array5, $ files_array6, $ files_array7); $ Result = array_count_values ​​($ result); $ Fp_lines = fope

Rails Partials For Resources -

I have exercise in my application called I currently have a partial _exercise.html .erb that I use to render them To do I have an external case where I want to present them in a very different way. Can I make one more part of the exercise that has this second format and still be able to use & lt;% = render @ exercises%>? If not, what's the best way? Should a variable in the controller be excluded which partially asks for the layout to be used, it will have to decide both layout and one if in one file. Or is there any better way? If you want to use commercial logic to determine when to show your For partitions of @forces collection, you should use the to_partial_path method in the exercise model to define # 4 in this post: Or, if it There is more to the view-related decision (i.e., one view will always use regular _exersgames.arb and second view Always use _alternate_exercises.html as such. ARB) You can specify: To pass items through a local iSCEN parti

c++ - Application thinks it's in my home folder OSX -

I compile using Excel and C ++ 11 both Windows and OSX. When I create a release and drag it to another folder, then there is an existing current working directory in Windows Binary. OSX release thinks it's in my home folder. No matter where I put it, it thinks it's going on in my home directory. I have put a print statement in my code to prove it: Current working: / user / dom This problem occurs when I double click on the binary If I open a terminal and using the program / it opens in the appropriate directory I'm not sure how to fix it, but it should be sure to find the application relative to the path path specific resources Thank you! Solution: Four Paths [1024]; Uint32_t size = sizeof (path); If (_NSGetExecutablePath (Path, and Size) == 0) {/.*/} If you are UAC-alidded, it will not work under Windows because the current directory has been reset to % WINDIR% \ system32 during the height. [On these platforms] All processes are the concept of an

android - Getting item of customized Spinner -

मैंने कस्टम स्पिनर लागू किया है: सार्वजनिक वर्ग MyAdapter ArrayAdapter को बढ़ाता है & lt; स्ट्रिंग & gt; {सार्वजनिक MyAdapter (संदर्भ संदर्भ, इंट टेक्स्ट व्यूरसोर्सआईडी, स्ट्रिंग [] ऑब्जेक्ट्स) {सुपर (प्रसंग, टेक्स्टव्यूर्ससोर्सआईडी, ऑब्जेक्ट्स); // टूडो ऑटो-जनरेट किया गया निर्माता स्टब} @ ओवरराइड सार्वजनिक देखें getDropDownView (पूर्णांक स्थिति, कन्वर्टव्यू देखें, ViewGroup पैरेंट) {getCustomView वापसी (स्थिति, कन्वर्टव्यू, पेरेंट); } @ ओवरराइड सार्वजनिक देखें getView (पूर्णांक स्थिति, कन्वर्टव्यू देखें, ViewGroup पैरेंट) {return getCustomView (स्थिति, कन्वर्टव्यू, पेरेंट); } सार्वजनिक देखें GetCustomView (int स्थिति, देखें कनवर्ट देखें, ViewGroup माता पिता) {LayoutInflater inflater = getLayoutInflater (); देखें पंक्ति = inflater.inflate (R.layout.spinner, अभिभावक, गलत); टेक्स्टव्यू लेबल = (टेक्स्टदृश्य) पंक्ति.फ़िन्डव्यूबीआईआईडी (आर.ड.टेक्स्टव्यू 1); label.setText (data1 [स्थिति]); छवि दृश्य आइकन = (छविदृश्य) पंक्ति.फ़िन्डव्यूबीआईआईडी (R.id.imageView1); icon.setImageRe

C++ bad_alloc using vecList.pop_back() on vector <int> intList -

All, finish this semester and do this student assignment with vector. I am getting core dumps during execution of an intermittent bad_alok error and int extract () function. I believe when I use intList.pop_back (). This is my first time doing anything with a vector list and I would be interested in learning why this is happening and how to do it properly to avoid this problem in the future. Any thoughts would be greatly appreciated. #include & lt; Iostream & gt; # Include & lt; Cstdlib & gt; # Include & lt; Ctime & gt; Using std :: cout; Using the Std :: endl; Using Std :: vector; Intra removal (vector & lieutenant; int); * IntList, int noOfElements, int removeItem); Zero print result (int exit item, int extract, return, int list); Int main () {// variable declarations int removeReturn = 0; Int removeItem = 0; Unsigned int listLength = 0; Unsigned int counter = 0; Time_ seconds; Of vector & lt; Int & gt; IntList; // Twice time (and seconds) i

internet explorer - event.preventDefault() is not working in IE 11 for custom events -

I have a polymer element that triggers a custom event with synchronous and I want to know the event event.preventDefault Was canceled). Modified by using Event.default I can take action to act on all browsers (Chrome, Canary, Firefox, Opera) but on IE 11 (not worried about older browsers) it is not working I know that I can set some property on my event and I can check back where I want to trigger and handle, but I want to know that I am missing something. You can try the code by I had the same problem and the following Can solve with hack: Var event = document.createEvent ('CustomEvent'); Event.initCustomEvent ('custom', true, true, {}); Event.preventDefault = function () {Object.defineProperty (This, "appears to be default", {get: function () {returns true;}}); }; Event.preventDefault (); Event.defaultPrevented; // true

html - border-radius on a scrolling element -

When you have a scroll div with border-radius eclipse divs or do not respect this threshold radius. For example, the problem is showing the problem: .scrollable {overflow: auto; Overflow-y: overlay; -Widk-overflow-scrolling: touch; Webkit-Conversions: Translation 3D (0, 0, 0); Height: 400 pixels; Width: 200px; Background color: blue; Limit-Radius: .5 AM; } .content {height: 500px; Width: 200px; }. Content top {status: complete; Top: 0; Height: 50px; Width: 200px; Background color: red; } Instead of the parents' bullets, the red field is showing sharp corners, is there any way around this? .content-top {/ * status: complete; * / Head: 0; Height: 50px; Width: 200px; Background color: red; } The 'Status: Absolute' commenting on .content-top element fixes the problem.

ios - replacing deprecated AudioSessionSetProperty -

ऑडियो सत्रसंकेतप्रॉपर्टी (kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof (बफ़र लैंग), और बफ़र लैंग); मैं आईओएस 7 में यह विधि कैसे प्रति लेस कर सकता हूँ ?? < P> ऑडियो सत्र एपीआई वर्ग के पक्ष में IOS7 में पदावनत किया गया था अपनी कॉल को बदलने के लिए आपको setPreferredIOBufferDuration: त्रुटि: विधि का उपयोग करने की आवश्यकता है: NSError * त्रुटि; [सत्र सेटप्रतिरक्षितआईओबाफ़रडायरेक्शन: बफ़रलेम्बिथ त्रुटि: & amp; त्रुटि]; यह भी ध्यान रखें कि बफर अवधि बफ़र आकार के समान नहीं है, बफ़र आकार ऑडियो डेटा की अवधि समय रखने के लिए पर्याप्त होना चाहिए।

return javascript function in JSP form -

I have a JavaScript function (get_deviceprint ()) which gives IIP data, such as IP, resolution, device, etc. . I need to return it as part of a form in the servlet, I know that the function works because console.log (get_deviceprint ()); displays information correctly in the web console. So the problem is going to return it as a string server. I tried & lt; Input type = "hidden" name = "deviceprint" value = "& lt; script type =" text / javascript "& gt; get_deviceprint () & lt; / script & gt; /> but type and

PHP failed attempts to log in record in a txt file -

Basically to keep it low I have an assignment for college where I have to make some scripts. In any one of these, I have to create a scripts that record data when entering a logon form, it will take users' IP address and it will be time, date, error name (e.g. Incorrect username and password, wrong name, we will be placed in the text file after the error page and efforts). I thought: How to get users to record how to get time and date to record Now, what I want to do: I am a script user I want to search for IP address and if this IP address has already been filed for unsuccessful attempt, instead of creating a new record, I want to add the efforts made in that IP address by adding 1, S Update of date. Only in this case that this IP address has not been entered, a new record should be made. If the IP already exists (find out the attempts to dismiss ++;} Else {ADD IP; Add time; Add date; Add reason; Attempt = 1;} This is what I've done so far: If you real

linux - netlink scatter send causes error response from kernel (NLMSG_ERROR) -

I am writing a program that uses the NetLink protocol to gather the Net data. I am not getting too far because the kernel responds with an error which I believe is a valid packet. I used the stase to compare my program's iotop behavior, which works correctly is. Relative bit of stress from iotop: socket (PF_net, SOCK_RAW, 16) = 3 settop (3, SOL_SOCKET, SO_SNDBUF, [65536], 4) = 0 setocopet (3 , SOL_SOCKET, SO_RCVBUF, [65536], 4) = 0 bind (3, {sa_family = AF_NETLINK, pid = 0, groups = 00000000}, 12) = 0 Vokkam (3, {sa_family = AF_NETLINK, pid = -4286, groups = 00000000}, [12]) = 0 Send (3, "\ x24 \ x00 \ x00 \ x00 \ x10 \ x00 \ x01 \ x00 \ x01 \ x00 \ x00 \ x00 \ x42 \ xef \ xff \ xff \ x03 \ X00 \ x00 \ x00 \ x0e \ x00 \ x02 \ x00 \ x54 \ x41 \ x53 \ x4b \ x53 \ x54 \ x41 \ x54 \ x53 \ x00 \ x00 \ x00 ", 36, 0, NULL, 0) = 36 records From (3, "\ x70 \ x00 \ x00 \ x00 \ x10 \ x00 \ x00 \ x00 \ x01 \ x00 \ x00 \ x00 \ x42 \ xEF \ xff \ xff \ x01 \ x02 \ x00 \ x00

ios - Poor font quality in CCLabelBMFont -

Image
आईफोन 5 एस पर स्केल किए गए स्क्रीनशॉट: CCLabelBMFont शीर्ष पर है और CCLabelTTF नीचे है दोनों स्ट्रिंग हेलवेटिका न्यू लाइट 17pt का उपयोग करते हैं। जैसा कि आप देख सकते हैं कि पहली स्ट्रिंग में कोई स्ट्रोक है, लेकिन फ़ॉन्ट छवि में सभी प्रतीकों को पारदर्शी पृष्ठभूमि में सफेद किया गया है। क्या यह इस आशय से छुटकारा पाना संभव है और CCLabelBMFont को CCLabelTTF के रूप में अच्छा दिखता है मैंने bmGlyph और बिटमैप फ़ॉन्ट सृजन के लिए अन्य निशुल्क एनालॉग, परिणाम हमेशा समान थे। पहले, परिवर्तन न करें नोड के पैमाने की संपत्ति या यह धुँधली हो जाएगा। आपको फ़ॉन्ट का एक एचडी संस्करण बनाने की जरूरत है, जहां फ़ॉन्ट के पीएनजी फाइलनाम में -एचएच प्रत्यय होता है और गैर-रेटिना उपकरणों के लिए फ़ॉन्ट आकार दोहरा होता है। उदाहरण के लिए: गैर-रेटिना फ़ॉन्ट 32pt आकार (यदि आप गैर-रेटिना डिवाइस का समर्थन करते हैं): font.fnt font.png फिर 64pt आकार के साथ एक फ़ॉन्ट बनाओ और इसे इस रूप में सहेजें: font-hd.fnt font-hd.png

matlab replace value in matrix -

I am trying to replace the first and second columns of an edgelist matrix (edgenumber x 3) with specific node numbers Such as: 5 1 1 1 38 1 2 1 1 28 17 1 18 1 1 25 1 1 Connection from node number (node ​​5 to node 1) The values ​​related to a vector are replaced by values. The Edgelist is generated from an unweighted 40x40 adjacency matrix. In the 40x1 size vector degree_list, there are "real" node numbers of this edgelist that I want to add to a larger 321x321 adjacency matrix. (If there is an easy way that by concatenating edgelists, it would also be great) degree_list = [183,150,151,39,184,185,152, ...]; In the edgelist above, I want to change 1 1 to 2 between all 1s to 183, all 2s 150, etc. Then I need to keep this new edgelist which I add to the big edgelist, turning it back into an adjacent matrix and my new right is big adjm. I have tried to find a solution here and on other websites, but have not succeeded, thank you very much for your help, Chris

angularjs - Get ui-router's ui-view to repopulate default content? -

How can I set the default content for a UI-router UI-view without a template? I have something like this now: & lt; Div ui-view & gt; Default content & lt; / Div & gt; Changes in states as View update as expected, The problem is that I want to go back to the "Default" view: $ urlRouterProvider .otherwise ('/'); .. "The default content" is no longer available. I think the template would be the easiest solution, but I need a default view to be indexable, is there a way to accomplish something like templates or HTML snapshots? I do not know with default content ui-view direct to recapitalization That's the way, but I've got an alternative solution that can help you: Save the contents of the ui-view element in the compilation collection I have a directive, which Written with the name uiView , saves the template and it's time to create UI Router You need to touch HTML for T. app.directive ('uiVie

javascript - Calling Jquery function in DART lang -

I'm trying to change the following jquery script in dart: & lt ; Script & gt; (Function ($) {$ (window) .load (function () {$ ("content"). MCustomScrollbar ();});}) (jQuery); & Lt; / Script & gt; I have written the following code in Dart: js.context .callMethod (r '$', ['.content' ']) .callMethod ('MCustomScrollbar'); But this is not working. Any help is appreciated. ['. Content ''] in typo (instead of ['content'] ) I like it if you have the Import Dart: JS; and are not using the import package: js / js.dart ' .

dictionary - python dictionaries combining two dicts into one -

Given a variable, state_capitals, which refers to a dictionary that states the US states in their capitals and Second dictionary, provincial_bagic, how far it is: {provincial_capitals.keys} } + (state_capitals.keys ) == Regional_capitals I think you method: Regional_capitales = {} Regional_packaging.update (state_capitalis) regional_commap. Date (provincial_capital)

html - Best way of posting values in a form which contains a single quote -

When I submit an apostrophe value, 2 apoprophs are returned. If you print $ '_POST [' surname '], the text is entered into the text box. See O'Rourke. This code is & lt; Php print_r ($ _POST); ? & Gt; & Lt; Form method = post operation = & lt ;? Php echo $ _SERVER ["PHP_SELF"]? & Gt; & Gt; Surname & lt; Input type = 'text' name = 'alias' value = '' / / gt; & Lt; Input type = 'submit' value = 'register' & gt; & Lt; / Form & gt; What is the best way to stop this? I can obviously replace a string, but is there a better way? For example, instead of action, there is a way to stop it in this form. Please note that there is nothing with MySQL in it. Please also keep in mind that the output of the value is still being printed in O''Rourke by Hibernity. My use code is shown below. & lt; Form method = post action = & lt; Php echo $ _SERVER ["PHP_

postgresql - Heroku Rails development vs. production -

And till I have no data, I see this work very well. While developing, I do a rake db: Migrate: Reset to delete database and re-run all migration from scratch. And that was not working How should I control it? Thanks! I always follow this step if I mess up your migration like you did. To leave the database: $ heroku pg: reset SHARED_DATABASE - confirmation NAME_OF_THE_APP to recreate the database : $ heroku run rake db: migrate ** last step (you need to do this to sync your app with DB ) $ heroku restart

android - cant read updated xml file that stored in server -

I am facing a problem, and I really need help, I can store XML files in my server I am trying to read my Android application, the data from within the XML reads the process, but the problem is that when I try to change the data inside the XML file, the Android application still stays in the old data Reads and new people I can not read, I saw something like when I tried to clear the data from the settings and then re-read the XML file, my app reads new data in XML, and I have to say that such a code is on the RSS Check that the code works perfectly and reads any new data problem plz sorry bad english help

html5 canvas overlay cutout workaround in safari -

I am trying to create an overlay which can highlight some parts of the page. To do this, I have figured out the best way to use a canvas to fit on the page, attract the size needs, and draw a rectangular by using this trick: ctx .rect (canvas wide, 0, 0 - canvas. Wide, canvas. High); I'm not sure that I can explain this well, so it's best to see what I'm trying to do. It works perfectly in every browser except Safari, is there a way to achieve this effect in Safari? You can try to fill the entire canvas first, then to exclude the size of the overall mode Use the. Example: ctx.fillStyle = "rgba (0, 0, 0, 0.5)"; Ctx.fillRect (canvas.With, 0, 0 - canvas.wind, canvas.high); // Next size ctx.globalCompositeOperation = A draw rectangle above 'destination-out' will be hole; Ctx.fillStyle = "RGBA (0, 0, 0, 1)"; // Make sure alpha is 100% ctx.beginPath (); Ctx.moveTo (300, 60); Ctx.arc (300, 60, 50, 0, 2 * Math. PI); Ctx.moveTo (500,

algorithm - Select an element from a stream with uniform distributed probability -

Image
आपको दें: एक धारा (स्ट्रीम का अंत EOF है) एक फ़ंक्शन अगला () स्ट्रीम में अगला तत्व पाने के लिए और स्ट्रीम में सूचक को अग्रेषित करें 0 और 1 के बीच एक यादृच्छिक जनरेटर पैदा करता है (इसमें शामिल है) आउटपुट: एक तत्व जिसे बेतरतीब ढंग से (समान रूप से वितरित) चुना गया है आप कर सकते हैं एक या दो चर आपको ऐरे / सूची का उपयोग करने की अनुमति नहीं है, और आप नहीं कर सकते हैं बता दें कि सभी तत्वों को बाहर निकालने की कोशिश कर रहा है और उन्हें सभी को संग्रहित करने की कोशिश कर रहा है और फिर । यह एक साक्षात्कार प्रश्न है। मेरी सोच है: मैं एक var cur सबसे हाल ही में रखा तत्व स्टोर करने के लिए इसलिए, अगर मुझे कोई नया तत्व मिलता है, तो मैं 0 या 1 को जेनरेटर का उपयोग कर उत्पन्न करता हूं, यदि यह 0 है तो cur = नया तत्व ; अन्यथा, जारी रहें; अगर मुझे ईओफ़ मिल गया है, तो मुझे वापस लौटा क्या मेरी सोच सही है? कैसे साबित करें? यहां एक ही सवाल है मौजूदा तत्व की अनुक्रमणिका को i को आइए। संचय 1 / i पर मौजूद तत्व को 'याद रखना' चुनें। जब ईओएफ पहुँच जा

c# - Initializing serialization for derived classes in protobuf -

I am using protobuf, I have intangible class base1.cs and other class ListofItems.cs in which base1 and some other List of properties. In this way, I initialize the serializer Private Static Meta Type Actual Model; Static Initserialization () {var model = TypeModel.Create (); Model Add (typef (event message), true); Actualmodel = Model.Add (typef (base1), true); ProtobufSerializer.Models.Add (TypeofItems, Model); } I have a bunch of stuff that comes from base1.cs and everything works fine. Now I am adding another square base2.cs which is obtained from base 1, how do I make an initial update to include this base2? Tried down but does not work Actualmodel = Model.Add (typeof (base1), true). AddSubType (500, typeof (base2)); Thanks!

javascript - Can't initialize values in angular -

I'm just starting with AngularJS and actually killed a simple snake that I just could not find the last page When I load, I want to do something, initialize some values. This is not the case here: var Booking AppModule = angular.module ('bookingApp', []); BookingAppModule.controller ('bookingController', ['$ theme-area', function ($ scope) {$ scope.bookingDate = '2014/04/28'; $ scope.alertMessage = "start";}]); & Lt; / Script & gt; & Lt; The input id = "date" of the id = "bookingapp" "" & gt; {{bookingDate}} under the div id = "booking app" Ng model = "bookingDate" /> {{alertMessage}} Am I missing here, Btw, I also tried to put an init? Using the function () and NG-Init = "Init ()" on the controller, but it does not work either. I can initialize values ​​using init = "bookingdate = ..." but not That's what I insert the ng-app attribut