Posts

Showing posts from September, 2014

Javascript function prints out NaN -

When I do console.log (square.area), this code returns NaN; And not 36? var calcArea1 = function () {this.area = this.sideLength * this.sidelength; }; Var class = new object (); Square.sideLength = 6; Square.area = 0; Square.changeArea = calcArea1; Square.changeArea (); Console.log (square.area); Your function has a typo: Var calcArea1 = function () {this.area = this.sideLength * this.sideLength; }; // ^^ The javascript is case-sensitive so the upper and lower case names are considered different. Because this.sidelength will be undefined in this case, when you try to use it, it will be sent to NaN (non-A- Number) will be produced (like expanding it here).

php - WP: ordering posts with custom taxonomy terms array -

I can not get the order of my posts (organized by custom tax word) so that my loop is correct. I created a custom post type 'staff', staff has a custom classification of 'staff-titles' I call 'Editor in-Chief', 'Managing-Editor' , Words like 'poetry-editor' etc. (similar to the categories to keep the UI clean for the client) have been added. The idea is that customers can go to the 'Staff' post type, create positions which are named after the employee and then check the posts on which they are and then the posts will be displayed in the correct order ( Displaying the posts by running a series of commands below). Here is the facility of creating my custom tax in functions.php: add_custom_taxonomies () {// Add new "location" classification for post register_ taxonomy ('Staff This array of options controls the label displayed in the WordPress Admin UI 'Label' => - 'Heading', 'Staff', arra...

algorithm - Connect a single level of a binary tree -

This is a description of the problem thread a binary tree, (left, right and A sibling indicator) so that all the children of the level provided by the user are connected - 1 nearby without using the space (i.e. No) Resolved. I can answer this question if there are some obstacles in question I can add all the levels of the tree without any extra space. I can add at no extra level, allowed more than a single pass I have a I can add the specified level to the extra space in the same pass. 1 in a single pass / P> No additional storage.

Cannot get if statement to display bonus amount if sales are greater than certain amount - JAVA -

OK, so this is what I got stuck on. Code compiles it inspires the user to enter their sales. If the sale is $ 3000 or the equivalent, then the program should print the $ 100 bonus. I do not know why when I type in 3000 +, then why not print it? Can somebody help me out? Thanks to anyone who can do my code here: import java.util.Scanner; Public Class Commission {Fixed scanner keyboard; // in all ways it will see public static zero main (string [] algs) {double bayspe = 500; Double commission = 0.10; Float sales; // Sales volume entered by user = 335; Commission = Sale * 0.10; String input; // To capture the user's input, create a scanner object for the keyboard input = keyboard = new scanner (System.in); System.out.println ("Enter your total sales for this month:"); Input = keyboard.nextLine (); System.out.println ("Your salary for this month:"); System.out.println ("Base pay: $ 500.00"); If (Sales> 3000) System.out.println ("Bonus for mo...

iOS RSA Encryption using SSH Public Key -

मैं OpenSSL सार्वजनिक / निजी कुंजी जोड़ी का उपयोग करके सफलतापूर्वक एन्क्रिप्ट (आईओएस) और PHP पक्ष पर डिक्रिप्ट करने में सक्षम हूं। अगर किसी को एक उदाहरण की जरूरत है तो कृपया मुझे बताएं केवल पूरे दिन ले लिया और साझा करने में खुशी होगी। हालांकि, मैं सोच रहा था कि कोई भी एसएसएच से सार्वजनिक / निजी कुंजी जोड़ी का उपयोग करके ऐसा करने में सक्षम है। एसएसएच-केजेन से जो उत्पन्न होता है जब मैं जनरेटेड सार्वजनिक / निजी कुंजियों से सार्वजनिक कुंजी का उपयोग करता हूं, तब एपीसीबीएडीएडीएसीएसीएस के साथ आवेदन की गई त्रुटियां प्रदान की गई सार्वजनिक कुंजी का उपयोग करने की कोशिश करते समय। इसलिए, मैं उस बिंदु तक नहीं पहुंच पा रहा हूं, जिस पर मैं सर्वर पर डिक्रिप्ट करने के लिए एन्क्रिप्ट कर रहा हूं। // नीचे दिए गए त्रुटियों को // NSString * myCertString = @ "AAAAB3NzaC1yc2EAAAADAQABAAAAgQDQexvBUxaBWRtbSkj7puZNw4rqUD1FhhYCEogpS5GwMir9mZOuOw9aGQmTJ0DmYY84 / m890t8wnbWHcIk1D / TDMeDP2OSRHz4FtkPMt2G1Pf1lkvEhd9S5PvL2y / vwnvqhjIOYzqvIamnYloOwXQZ5lKcYxuFu7btMLYr1Rd1jtw =="; // काम करता है NSStri...

android - Getting the correct contact name by phone number -

I'm trying to get the correct contact name from a phone number so that it's ListView . But I'm getting the same contact name for all the phone numbers every time ... Here's my code: Private string GetContactName (string string) {string name = zero; ContentResolver cr = getContentResolver (); Cursor cur = cr.query (ContactsContract.Contacts.CONTENT_URI, faucet, empty, empty, empty); If (cur.getCount ()> gt; {} (while cur.moveToNext ()) {string id = cur.getString (cur.getColumnIndex (contactsContract.Contacts.HAS_PHONE_NUMBER)); Name = cur.getString (cur.getColumnIndex (ContactsContract.Contacts.DISPLAY_NAME)); }} Name of return; } Click Public Zero (see V) {ContentResolver contentResolver = getContentResolver (); Cursor cursor = contentResolver.query (Uri.parse ("content: // sms / inbox"), blank, empty, null, empty); Int indexBody = cursor.getColumnIndex (SmsReceiver.BODY); Int IndexADDR = Cursor. Item Column Index (SMSRECover.ADADARA); // ipxand...

Validate the correct month in C -

I am working in this program which is very easy, but I'm having trouble validating the input user, I do not know how the user receives the right output program says that the date of last oil change (month and year) will be found. Verify the input and when the input is incorrect then the user enter the correct value. I have this until now, and I do not know what I have achieved so far is correct: #include Month & gt; month & lt; = 12) {printf ("month:% i \ n", month); } Else {printf ("Please enter a number between 1-12. \ N"); } Return (0); } Instead try to do this: Int main (zero) {int month, year; // Enter the date of last oil change and validate the correct month value printf ("Enter the date of final oil change, month (1-12):"); // To add a place before% i to ignore the whitespace. Scanf ("% i", and month); While (Months In this way the program keeps asking the user for a price until no one is correctly entered....

magento 1.8 validation not working for new fields in custom contact form -

I am trying to validate my new areas in the custom contact form, here is my link to this form: I included the form ID in this form: var contactForm = new VarienForm ('customcontacts' is true); And I made every input with the class like this: But when I try to submit these fields without filling up, this form submits and sends emails without any errors. I hope nobody can help with this. Thanks Your & lt; Form & gt; is & lt; Table & gt; and & lt; Tr & gt; Defined between , which is not valid, things can get worse if you print out the contents of your form document.getElementById ('customcontacts') in a JavaScript console. External HTML , you will see that it is empty. Make sure & lt; Form & gt; and & lt; / Form & gt; Tags are in a valid location (usually when you see the source of the page from Firefox, it is invalid markup with red) then the verification should work.

html - Printing a page causes table to become misaligned -

Image
I have a web application that uses my company to log hours, and when printing the table Strange treats. A page displays a table of yoga for a certain period, and it looks fine. Here is a screenshot of the table: It looks fine when viewed in the browser. The problem appears when the is called window.print () then the table looks like this: Sorry for the small screenshot, I could not capture it the way I did before. So there is a problem, and I'm not sure how to fix it. I will provide more details as needed. Can anyone help put some light on this issue? Maybe you want to see something like this The problem was in your CSS file and this was the way for you: .report td: not (: first-child) {text-align: left // it was set correctly}

Scala - cycling over a finite sequence starting from a given element -

I need to cycle efficiently on a certain sequence, starting from any element, not always from the beginning. The solution I am searching for is: val directions = list ("north", "east", "south", "west") val cycle = stream. Continually (directions). Since I'm using it inside a hot loop, starting again and again, and the actual sequence is too long, I'm afraid dropWhile is going to spend a lot of me is. Can I move it? am I doing it right? Edit There were some good suggestions given that I should not use the stream s Now it is made: How can I use dropWhile or similar tasks? Example below to prevent the listing of values ​​of the default sequences start each new stream escape from. Package rando object faster app {val directions = Vector ("north", "east", "south", "west") val index = instructions. ZipWithIndex.map {case (d, i) = & gt; D -> I} .toMap def Stream WithStar...

ios - Symbolic breakpoint on [UIViewController initWithCoder:] causes debugger to freeze -

When I'm trying to unregister my view controller, I am trying to set a symbolic breakpoint to find out. The app is launched on a test device once the breakpoint is correctly applied to [UIViewController initWithCoder:] . However, when I try to go back to the breakpoint by pressing 'Continue' debugger freeze: it stops responding to commands (such as 'pause' and 'stop') and app from Xcode Just hang up well I'm finished leaving the xcode to restart the app and restarting it again. The 'step in' functionality works as expected but I go directly to the machine code - I want to be able to use the 'continue' function to proceed with normal program execution. App and debugger function normally if I disable this particular symbolic breakpoint. Any information in this problem will be useful. I am running Xcode 5.0.2 and am using LLDB debugger. EDIT: I tried the solution described, but there was no luck. I stopped setting a breakpoi...

8051 c programming, interrupt progblem -

I am programming an Intel 8051 (C8051F312) microcontroller. I just want to make a blinking lead program using interrupts, it's compiled, but there is no leadership swift. Any thoughts I appreciate thank you! My code is: #include & lt; C8051F310.H> # Include & lt; Stdio.h & gt; Sbit Leadership = P2 ^ 7; // DTI port 2 is connected to zero timer (zero) 1 / center no difference for timer 1 0 led = lead; // interrupt TH0 = 0xFC on toggle LED; // The initial value is loaded on the timer TL0 = 0x66; } Zero main (zero) {tmod = 0x01; // mode 1 timer 0 TH0 = 0xFC; // The initial value is loaded on the timer TL0 = 0x66; EA = 1; // Enable global interrupt ET 0 = 1; // Enable Timer 0 TR0 = 1 inhibited; // Start timer while (1); // nothing) As told above, knock down your interrupt rate have to give . Your original code is interfering at 3.0625 MHz / 12/9 22 ~ 277 Hz. Additional part of your CKCON disables scaling on timer (by setting Tm), so now you are interferin...

ruby on rails - Paperclip not deleting attachments after model is destroyed -

I have a Rail 4 app and when I upgrade from Paperclip 3.5.2 to a newer version, my attachment There are no files removed from the file system after the related model is destroyed. I can not see anything in the documentation? Here is my model code: is_act_size: artwork, styles = & gt; {: Big => ["1400x1400 #" ,: jpg] ,: Cover => ["600x600 #" ,: jpg] ,: Medium = & gt; "170x170 #",: thumb = & gt; "50x50 #"},: convert_options = & gt; {: All = & gt; "-Quality 80colorspace RGB"} Anything looks wrong?

c - zsh:abort message after all the program has been run? -

इसलिए मैं यह कोड चला रहा हूं #include & lt; stdio.h & gt; #define ARRAYSIZE 17 # परिभाषित NUMTHREADS 4 स्ट्रेट थ्रेडडेटा {int start, stop; Int * सरणी; }; शून्य वर्गरूपर (स्ट्रेट थ्रेडडेटा * डेटा) {int start = data- & gt; प्रारंभ; इंट स्टॉप = डाटा- & gt; स्टॉप; Int * array = data- & gt; सरणी; Int i; के लिए (i = प्रारंभ; i & lt; रोक; i ++) {सरणी [i] = i * i; }} Int मुख्य (शून्य) {int सरणी [ARRAYSIZE]; Int i, शुरू, बंद करो; स्ट्रेट थ्रेडडेटा * डेटा; डेटा- & gt; सरणी = सरणी; इंट कार्सप्रथथ्रेड = (ARRAYSIZE + NUMTHREADS-1) / NUMTHREADS; (I = 0; i & lt; NUMTHREADS; i ++) के लिए {start = i * tasksPherThread; स्टॉप = (i + 1) * कार्योंप्रतिथ्रेड; डेटा- & gt; प्रारंभ = प्रारंभ; डेटा- & gt; स्टॉप = स्टॉप; अगर (रोक & gt; ARRAYSIZE) {stop = ARRAYSIZE; } वर्गर (डेटा); } के लिए (i = 0; i & lt; ARRAYSIZE; i ++) {printf ("% d \ n", i); } वापसी 0; } और किसी कारण के लिए मुझे त्रुटि संदेश zsh: abort ./thread मुझे चलाने के समय के लिए। अज...

haskell Convert IO Int to Int System.Random.MWC -

मैं IO int से int से System.Random.MWC , असुरक्षितप्रोफॉर्मियो का उपयोग करके। यह ghci में काम करता है: प्रील्यूड सिस्टम। रैंडम। एमडब्ल्यूसी सिस्टम। आईओ.यूएनएएफ़ए & gt; च = असुरक्षितप्रोफॉर्मियो (वर्दीआर (0, 30) जीएन :: आईओ इन्ट) प्रील्यूड सिस्टम। रैंडम.एमडब्ल्यूसी सिस्टम। आईओओएन्साफे & gt; पी 11 प्रेस सिस्टम। रैंडम। एमडब्ल्यूसी सिस्टम.आईओ.यूएनएएफ़ए & gt; : Tpp :: int हालांकि जीएचसी में आयात करें सिस्टम। रैंडम। एमडब्ल्यूसी आयात सिस्टम। आईओ.यूएनएसएफ़ मुख्य :: आईओ () मुख्य = डू जनरल & lt; -createSystemRandom प्रिंट $! एस 30 जीएन :: इंट- & gt; जीनियो - & gt; Int s! K g = unsafePerformIO (uniformR (0, k - 1) g) यह देता है ghc: panic! ('असंभव' हुआ) (i386-अज्ञात-लिनक्स के लिए जीएचसी संस्करण 7.6.3): make_exp (ऐप _ (कसरशन _)) कृपया इसकी रिपोर्ट एक जीएचसी बग के रूप में करें: http://www.haskell.org/ghc/ Reportabug यहां असुरक्षितप्रोफॉर्मियो के लिए वास्तव में कोई ज़रूरत नहीं है। बस s को बदलने के लिए IO int को बदलने और परिणाम को ...

LDFLAGS usage in autotools with libtool -

Depending on the OS, I define a particular LDFLAGS in my configurable. If the test is "$ host_os" = Sigwin then LDFALGS = "$ LDFALGS-W, -N-undefined" export LDFALAGS FIACIBBST ([LDFALGS]) package uses AC_PROG_LIBTOOL and when LDFLAGS is sent to libtool, the -Wl prefix remains, and the linker Does not understand the option. If I remove this prefix, then the AC_PROG_CXX macro fails because the GCC itself suppresses -en-undefined what am I doing? LDFALGS makefile.M is not mentioned, but I have made sure that it has been awarded in libtool command is running make -n . I am using Autoconf 2.69, automake 1.14, Gram 4.0 and GCC 4.8.2 under Sigwin 1.7.28 (0.271 / 5/3) Edit : I have a few dozen Makefile.am , out of which more than half of the external libraries - I like to control these flags from the central location. There is a -en-undefined option in Librol. The GNU LD has an - no-undefined option. You should know about Libtol f...

debugging - Function changing the value of argument in Python -

Image
I am trying to write a program, and I have found some very strange problems, so I step by step I am trying to debug it and try to debug it. Some strange things are going on. If you are not familiar with Conway's life game, then the rule to determine the next step: At least two Any living living with living neighbors dies, as if caused by the least population. Any living life with two or three living neighbors lives up to the next generation. Any live cell with more than three living neighbors dies, such as by more and more. Any dead cell with only three living neighbors becomes a live cell, such as by reproduction. I am placing a list called squareList in N_ROWS rows and N_COL columns. I refer to each element in the form of class list [i] [j] . My get_next (SquareList) function gives another list, which 'calculates the number of neighbors' in each category, and gives another list with the next step. Now, on my problem. Here is a test case, which i...

ruby - Middleman: How can I get the current article title? -

Using a "intermediate-blog" extension, while creating a simple blog in Middleman, I get a layout file that only produces content What do I want to get the title of the current position and Have to display What do I still have: & lt;% blog.articles.each do | Articles | & Gt%; & Lt;% = link_to article.title, article% & gt; & Lt;% end% & gt; This is a thief through every post title, even if only a post content is displayed. The title of the post is a post titled two post title three "output of something like this in the post title one," URL / Post-Title-A / P> I have to try something like that But it only randomly excludes two page titles. If you want to print the title of the current article, just go to & lt;% = Current_article.title% & gt; .

dataframe - Is there an R dplyr method for merge with all=TRUE? -

I have two R dataframes that I want to merge. You can do this directly in R: Cost & lt; - data.frame (farm = c ('form a', 'office'), cost = c (10, 100)) trees and lts; - data.frame (farm = c ('form a', 'form b'), tree = c (20,30) merge (cost, tree, all = true) Which produces: Agricultural Costs Tree 1 Farm A10202 Office 100 NA3 Form BNA 30 I dplyr , and prefer a solution such as: left_join (cost, tree) which makes me close to something I want: left_join agricultural cost tree 1 form A10202 office 100a in dplyr Code>, internal_j In , semi_joined and anti-joints , but none of which is merge with all = TRUE does. In addition - is there a quick way to set NAs to 0? My efforts are still using x $ tree [is.na (x $ tree)] laborious (I need a per-pillar command) and do not always seem to work Happen. Thanks Latest version of dplyr 0.4.0 ) Now there is a full_joined option, which is what I believe you w...

Android app that updates Google spreadsheet -

I want to create an Android app that allows multiple users to connect to Google Spreadsheets, this single sheet app Records data through Do I have to make a public letter? If this happens then authentication is required or only the URL of the sheet. What is the need for authorization if there is a private sheet? I have read about the spreadsheet API but I will not start where which public or private sheet will be easy You can use google-apps-script or google. -Spreadsheet-API 3.0 (GDTA) but I suspect that google-spreadsheet-api is what you want Google-apps-script is like VBA and runs on Google servers. For GData, CellDemo.java gives a good overview of the features. Note: There are no INSERT rows, only with APPEND line gdata - google-spreadsheet-api 3.0 I have never used a public sheet, arguably not . For personalized sheets, you need an OAuth2 or application password.

jQuery PickMeUp datepicker: disable array of dates -

I am using a jQuery datepicker plugin. I have been working at Dotepek, but how to disable the date in it is that my plan is to have an array of dates, which will be disabled on the datepacker calendar. I had managed to disable a date using the document from the previous version of the plugin (), but I did not know how to add a star array in it. jQuery $ (document) .ready (function () {var now2 = new date (); now 2.addDays (-1); now 2.setHours (0,0,0, 0); $ ('Input # cdate') pickmeup ({status: 'right', mode: 'range', render: function (date) {return {disabled}: date.valueOf () == now2.valueOf ()}}}})}} update is the code working below (many, many Thanks) $ (document) .ready (function () {var arDates = [new date ("2014-02-14"). ValueOf (), new date ("2014-02 ValueOf (), New Date ("2014-02-09"). ValueOf ()]; $ ('Input # cdate') pickmeup ({status: 'Right' mode: 'Category', render: Function (date)...

android - Glass: Null pointer exception when trying to add image to Static Card -

I have a simple glass app using GDK to capture some text; Take a picture. I can easily create a LiveCard w / text & amp; Photo, however, when I try to convert live cards to a fixed card, I get a null pointer exception when I try to add the image to the image. Here is a snippet of my code. If I remove the image to add the call () it posts the card properly. card c = new card (CompPlayerService.this); C.setText ("You" + took a photo of MyService, this.personName); Uri Uri = Uri.Paras (Paintings); C.addImage (uri); // & lt; - This NPE is Timeline Manager for Dinette (C); When I set a breakpoint in service, I can see that the value of the picture path is not zero and when I post the picture to a live card, The same service that works fine here is an exception that I get: 02-17 15: 32: 25.049 14120-14120 / com.example.glassapp E / Android Runtimeum: Armal Exception: main java.lang.NullPointerException at android.glass.app.Card.addImage (Card.java:176) ...

symfony - Display name instead of DB value in SonataAdmin List View -

Image
I am having a problem when I try to list records from DB because I get the value stored in the row Is integer, but I want string instead of how am I handling the form? Like this: Protected function configured form field (formmer $ form) {$ form - & gt; Add ('no_order', null, array ('label' = & gt; 'no command')) - & gt; Add ('company', 'unit', array ('class' = & gt; 'PL company company bundle' unit 'company', 'label' = & gt; 'client')) - & gt; Add ('business_case', zero, array ('label' = & gt; 'BC')) - & gt; Array ('empty_value' = & gt; "Seleccione una opción", "0" = & gt; "ninguno", "1" = & quot; ('charge_status', 'option', array ('option' => Gt; "Proceso de Fabricacion", "2" => "Pick Ann Destino", "3" => "A ...

firebird2.5 - Firebird ODBC Connection from server 2008 64 bit To server 2003 32 bit which has the database -

I have a quantum database that is using firebird connections on Windows 2003 32bit. I am trying to connect to the server through a server 2008 R2 64 bit via ODBC, but every time I click on the test connection, I would say "the database failed to open the exchange" on the 2008 server Upgraded the latest 32-bit and 64-bit drivers and upgraded the firebird diver to the latest 32-bit driver on the server of 2003. What am I missing? I am trying to connect to the database server so that I can migrate the database to SQL.

python - How to generate index.rst alone or generate everything excluding conf.py by sphinx-apidocs? -

I understand that creating RRT for all the following modules, except index.rst Sphinx-apidoc -f -o lot_good_dex / very-good and everything below, which contains index.rst, conf.py, Makefile, etc. sphinx-pdok-f-f-o-lot-good_dex / very good The problem is that the Sphinx-APIID is not confp correct Produces, so always include me to confp man Must correct modify the sys.paths if I modify my Python code in the "Very Good" folder, then I should run the sphinx-opidoc command without "-F", so conf.py was preserved. is. However, if I add new module directly to a very disturbance, index.rst is not updated without "-F" option, which means that my new module will not be in the doctor. I believe that either a person only generates the index.rst file, or using the "- F" option without overwriting the confaj. Is there any way to do this? This is just some experience. My approach is to use a custom config.py and always specifies that I ...

php - file_put_contents does not return a value -

I have trouble using file_put_contents I thought I could do something like this in Laval / PHP. $ response = new stdClass (); $ Key = generating (); // a 32 bit key generates $ dir = "/ mnt / my-usb"; If (file_put_contents ($ dir. "/". "Key", $ key) === true) {$ response-> Status = "failed"; $ Response- & gt; Message = "Some user messages that describe the error have to face"; Return Feedback: Jason ($ reaction, 500); } So I thought I could check status code file_put_contents and return a good error message. However, when I take the step through this code, once it makes a statement, if there is a failure, then it never goes into the statement if I am not sure why I have it withouth === Have tried the truth and I get the same results. I think file_put_contents will return some type of error code that I can see and create a user facing the message, but it comes back automatically and I can not create a response to send th...

hdfs - How to add DataNode to Cloudera hadoop -

I am trying to add a Datanode to my existing single Datanode. Since my UNIX server does not have access to the Internet, as Claudera Manager is unable to execute the notification because it throws error down. Is there another CLI method to add data nodes instead of CMOS? BEGIN yum info jdk Loaded plugin: product-id, subscription-manager Updating the Red Hat repository. Http://archive.cloudera.com/cm4/redhat/6/x86_64/cm/4.7.2/repodata/repomd.xml: [Error 14] PYCKR Error 6 - "Host can not be resolved archive.cloudera .com "" Yes, there are two approaches (I'm this Claudera-specific because it That's what you have mentioned.) 1) Download the tarball and install everything manually. A guide is available, and I think it's a stack overflow to copy here Good candidate No, because it is too long and the seller is specific (if the document runs, the heading "Installation path is C - Installation using Tablocks"). 2) For large internal install...

java - Recursive tree GUI -

New to this site, therefore please forgive me in the way of my nose. I am trying to make more buds on the GUI tree given to me. I have been working so hard to get this right over the last three days, but every time I change something, it destroys the entire drawing !! code: public class recursive Tiarimpshn Jepianel (private Dratrtl T; private static final width = 400; private static final intensity height = 400; public recursive tree (eg ) {super.setPreferredSize (new dimension (width, height)); t = new Dratrtl (width, height), draw ();} void draw () {int s = 100; t.back (s); embedded sample ( S, 5);} Zero embedded sample (int size, int oter) {if (size> 0 & amp; amp; and iter> gt; 0) Iforn (size); t.right (45); embedded sample (size / 2, Aitr -1); t.left (90); embedded sample (size / 2, Aitr -1); t.right (45); embedded sample (size / 4, Aitr + 3); t.back (size);}} public void Pentgtk (graphics page) {super.paintComponent (page); Tkdraw (page);} public static voi...

ajax - WebGrid in Partial View - Stop paging from reloading page -

I have a dashboard type page that has several partial views, each of which has a webgrid. For example, this web grid is in my _CurrentSubscriptions: Partial view: WebGrid Grid = New WebGrid (Model.Titles, rowsPerPage: Model.PageSize, defaultSort: "name ", AjaxUpdateContainerId:" UserSubscriptions "); @ Grid.GetHtml (columns: grid.Columns (grid.Column ("name"), grid.Column ("description"), grid.Column (format: @ & lt; lesson; @html.ActionLink ("remove "," RemoveSub ") & lt; / text & gt;)); I also have a _addSubscription partial view which includes the following grid for showing search results. WebGrid Grid = New WebGrid (Model.Titles, rowsPerPage. : Model.PageSize, defaultSort: "name", ajaxUpdateContainerId: "TitlesFound"); Grid.Pager (WebGridPagerModes.All); @ Grid.GetHtml (add columns: grid.Columns (grid.Column ("name"), grid.Column ("description"), grid.Column ...

java - IntelliJ put package and imports below file header -

Image
In IntelliJ, I have auto import enabled for my java project. When they import, they are my file headers Appear above. Is there a way of package and import statements below the file header comment? Settings under the file and code templates in your IDE - Template tab If you want class for the template you want to place the file header above the package information In this way (I think it was only newly created Files will only be helpful, but imports for existing files only come in other imports): #parse $ {PACKAGE_NAME} & amp; $ {PACKAGE_NAME}! = "") Package $ {PACKAGE_NAME}; # End public category $ {NAME} {} This is my setup and auto import always for my license.java Defines but before my file header

iOS push notification on Heroku Rails App — how to provide the PEM file -

I am trying to send push notifications from my rail app I tried gems, and when I was on my development machine Then they do fantastic work. To send these gems, / path / to / PEM / file (apple certificate of need) is required. However, how do I provide this file on a production server? Can not figure it out I am using Hariokok. I tried uploading it to Amazon-S3 (non-public) and used it from there. However, this does not work because Gem is not for a local file (and a URI). How do I save a local file to Hariokk? Mani APNS needs a path in the form of a string. It checks if the file exists or not. raise "The path to your spam file does not exist!" Until file.exist? (Self.pem) Mani Houston requires PEM as a file object However, I have the File.open ("url_to_my_pem_file" ) Can not find the local path just for Rails.root Can use var. Hosting your search files on S3 can be a bit overkill, and you're relying on your push server to S3. If down...

java - CountDownLatch leads to disappearance of content in JFrame (JButtons, etc.) and comes back only when mouse overed -

I am working on a deal or no deal with a user interface. My first problem is that I continue to wait for a button action, and I used the countdown and it worked perfectly. But whenever I click on a button, everything disappears in my Jeframe and when you come up with a mouse, when I press another button, then suddenly it looks again (it never happened) Was that I used the Letes below, and it also happens with Samphorus, etc.) I will try to keep my code as relevant as possible. public countdown to CDL = new MozillaLap (1); PickFirst (); Try {Cdl.await (); } Hold (Exception e) {} While (Banker. Findcas Left ()> 2) {Banker = New Banker (Mainf. value); For (i = mattersisposic; i> = 1; i--) {cdl = new countdownlock (1); PickCase (); Chosen = false; Try {Cdl.await (); } Hold (exception e) {}} ^^^ This was my class, which works with selective cases below which is the category containing the action list public zero verb (action event ae) {if (! Main.me.pickedFirst) {Main.me....

bash - while read line stops after first iteration -

I used to capture the details of multiple server by using svmatch on server name input From a file I am trying to execute a simple script #! / Bin / sh read the line while; Svmatch $ line & lt; ~ / Svr_input; The command svmatch command works with a problem when executed with a command as a stand. Redirect your internal command's review to

javascript - Filter Backbone collection and keep original -

In the following code, I have set a view, where I am filtering an archive based on date input. This code works correctly for the first time, but obviously the collection starts again and again if I filter the date again, it does not filter from the original archive. What is the best practice to filter the spinal cord and keep the original copy? window.DataIndexView = backbone.View.extend ({tagName: 'section', className: 'data', event: {"#changedate click": "filterDate"}, start: Function () {_.bindAll ('render', 'filterdate'); template = _tremlet ($ ("# data_template") .html ()); this.collection.bind ('reset', this. Render ());}, render: function () {var data = this.collection; $ (this.el). Html (this.template ({}); data.each (function (point) {}); Return it;}, the filtered date function () {var startdate = this. $ ("#startdate"). Val (); var filtered = _.filter (this.collection, function) {return mom...

arrays - How do I use scanf when I dont know how many values it will assign in C? -

These instructions are: "Read the letters from the standard input until the EOF (file off mark mark) is read. Then the user will enter the characters, but I do not know how many should not be allowed to enter text - as soon as the program starts, read the data. " How should I go about this? This is my opinion This is my idea int main (zero) {int inputlist [], i = -1 ; {{++ i; Scanf ("% f", and input list [i]);} while (input list [i]! = EOF) You said that the character Therefore it can be used four axis [10000]; Ch = getchar (); While (ch! = EOF) {arr [i ++] = ch; Ch = getchar (); } // arr [i] = 0; To make this a string, if necessary and to convert to ASCII for (j = 0; j & lt; i ; J ++) printf ("% d \ n", arr [j]]); If you use an integer array, then use int arr [1000]; While (scanf ("% d", & amp; arrival [i ++]) = EOF!); PPS: This works only when your input is one letter per line. scanf returns ...

magento - M2e Pro eBay adds new policy -

I am using Magento 1.6.2.0 and M2e Pro 6.1.0 with and with M2e support and stay close I can not find anywhere I updated 56 knives and all 56 made a new sale, shipping and payment policy. I had to go back to eBay and had to change all of them. I have 5 policies, 3 default for selling 3, shipping and payment policy and 2 products for fuel, no return and fuel shipping. Every time a sink occurs I get new policies with some random number I do not understand why the established policies are not used. It's been running for 4 months now and I have not got the solution yet. I have searched everywhere and have filled endless support requests and nowhere else. I have another pain too! My categories vary by books> Some sections like fiction or educational When this happens, the pictures are changed into a book diagram, the description of a book is added. I think it can do something with eBay because in one of the 56 policies eBay suggested that books to change my category could change...

jquery - Passing a Rails Ruby Variable to Javascript -

There is a variable in my controller @ data which is a very long string I have a JavaScript function that accesses this variable is required. I should do this: $ (document) .ready (function () {var data = '& lt;% = j = data% & gt;'}) or I should put the string in the html data-attribute and then something like this should be done: If one is better, why? Between two of your choices, preference is made. But consider using gon gem:

file - Determining data size through URLLoader (AS3) -

I am working on a project and due to the backend limit the problem has come to a little bit of the program for me To use. First of all of my questions, "Can I measure the data size of text through the URLLoader?". I am creating an app and sending a fair data, but the last time I am using, only limited to being able to send me 1024 at a time. The backend is called 'sokuode', it's really good for games and user management and like, but I am using it in a different way. All the parties, my point is, I am sending data through an array, and I can easily break enough array and send it to multiple transactions ... but in a way Can I measure the size of the data? In this way, I could determine how much I can send the array in a timely manner. These codes provide them: function getGame (): zero {var url: String = "API URL"; Var Request: URLRequest = New URLRequest (url); Var requestVars: URLVariables = new URLVariables (); Request.data = reques...

iphone - Custom CSS for mobile font size -

Image
I'm working with a SquareSpace template and fixing a few things while looking at my mobile phone on a mobile device Would like to) My website is Here is the code I was trying to and there was no luck with it. / * ---------- Mobile --------- * / @ Media only screen and (max-width: 640px) {. Desc-wrapper {font-size: 24px; }} I have attached an image to help show that what I am trying to decide. Thanks The font size is set with .desc-wrapper p , so resizing will need to be done as follows: @ Media only screen and (max-width: 640px) {.desc-wrapper p {font-size: 24px; } / * Header change * / .sqs-block-content h1 {fonts-size: 18px; }}

Error after mosaicing face in opencv and c++ -

Image
After my previous post, everything was working fine until it tried to redo it today and I get this error Everything is fine but I'm confused why I get this error Is anyone getting help? Thank you The error states that source vector or destination some algorithm The vector does not have any data needed by a specific algorithm imgwarp.cpp As I have no idea of ​​your code, I think you can use getAffineTransform or perspective. Perhaps the claim failure should be from GetAffineTransform. It will need 3 digits for its input and output. See the code on how these points are chosen. As you mentioned that the code was already working, there is a possibility that input images have been changed, mostly new with a different dimension.

iphone - Pre-filling .sqlite file to add to iOS app, then nothing in .sqlite file but the schema (no data) -

I want to fill in a core data database for use in my iOS app. I am full of databases and I have shown in my app I can see the data I have seen. When I can not fill AppDelegate.m in the database, I do not get anything when I ask the database, when I fill it, then I get the data that I want. So I think there is data in the database. I think that my iPhone Simulator-> MyApp-> is a full .sqlite file in the document. I drag it to my desktop, and I'm using Firefox's skylit viewer tool so that I can check the data in SSKlight file. When I do this, I do not see any lines of data except the schema, metadata, and primary key. When I use the Firefox viewer to look for other .sqlite files, I see actual data, but this is one I do not see it. Am I removing data before viewing it in Firefox Tools? I am adding data like this: NSMOSubClass * tempItem = [NSEntityDescription insertNewObjectForEntityForName: @ Managed object contexts in "EntityName": context]; TempItem...

arduino - Bluetooth RN41 does not respond -

I want to send some commands using the serial monitor from Serial Port from Aradiano Leonardo to RN 41 Bluetooth module, the tutorial Shows in the form But this is not the answer. I can connect to the Bluetooth module and the status blinks is on the right. I tried to send $$$ to change to the command mode, and the rate of the blink turns to 10 / second, but the module does not respond And when I send '---', the rate of naps comes back in general I think that means the connection is successful, but I can not see anything on the serial monitor. I set the monitor baud to 9600, as the tutorial actually shows. (https://learn.sparkfun.com/tutorials/using-the-bluesmirf/example-code-using-command-mode) Do you know what happens? Could wrong? Code Attached: / * example by Bluetooth serial passstra sketch: Jim Lindblum Sparkfan Date: February 26, 2013 License: Public Domain This example is designed to make RN-42 Bluetooth modules Converts BPS (from 115200), and passes any ser...

sql - MYSQL error no 121. Supports transactions, row-level locking, and foreign keys -

has no error I run the script below I What's wrong with a script? - -------------------------- ------------- -------------- table `commitment '-------------------------------- ---------------------- Create 'existing commitment' (if `id` is not present) Create INT (11) No NULL AUTO_INCREMENT,` type` CHAR ( 1) NULL default '0' comment '0: Eco-commitment | 1: Community Commitment | Etc ', `title` VARCHAR (180) zero zero default,` description` text zero default zero, `createdById` INT (11) NOT NULL default -1,` createdAt` timestamp not NULL default' 0000-00-00 00: to 00:00 ', `updatedById` INT (11) at zero default zero,` updatedAt` TIMESTAMP update CURRENT_TIMESTAMP zero default zero, `status` TINYINT (1) not nULL default 1 comment' 0: destroy | 1: Active | 2: inactive | 3: pending | 4: Blocked | 5: Suspended | Etc. ', PRIMARY KEY ( `Id`), Suckank` idxCreatedById` (` createdById` ASC), Suckank` idxUpdatedById` ( `updatedById` ASC), Bad...

ios - View is moving down in iphone -

Image
I am using slide out navigation in my app. Slips down automatically sometimes in some pages. This is in the correct position in the simulator, while in some devices it looks correct and in some it slides down. Here are the screen shots: 1) simulator screen shot (should look like): 2) Device screen shot: You can see that the back particle is moving below the sun, I have set the image as the background of the background. There is some auto resizing property that I have to set but I have many things Oshis but no me this outcome is why it can tell it? I think the auto-resizing device is the right choice for displaying UIView correctly, Try to use one of the following assets which this is the option available for IOS 7 to change the size of iiView. You can add just one line of code to correct it. Check out. AutoresizingMask = UIViewAutoresizingFlexibleTopMargin; or AutoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIVi...

Get ResourceId for a programatically created control in Android -

I have made control of Android by reading XML For example checkbox checkbox = new checkbox (this); Checkbox.setText ("text"); I would like to get values ​​dynamically at the later level in the control view view = this.findViewById (resId); Bool checked = (see (checkbox). the inspection (); How can I "resId" for the practical control of control? I tried to use checkbox.getId () but it is returning to 0 You keep the context of your control better and use it to set the values. Maps & lt; String, checkbox & gt; Checkbox = new hashmap & lt; String, checkbox & gt; (); ... checkboxes. Input ("checkbox 1", new checkbox (this)); ... checkbox checkbox = checkbox .get ("checkbox 1"); But if you really want an ID, then you can set your custom ID through the setId method as suggested by Merlewade but with TRIBLES Android has created an ID to avoid. Create an XML resource object: & lt; Item type = "i...

android - How to integrate twitter in web view? -

Hi, I'm building an app in which I use twitter4j lib for the integration of Twitter which works successfully for under 2.3. When I run application on 4.o application stops. Here: 1. I used the default browser for Twitter2 And I want to use the web view instead of the browser. So how to handle Twitter VB via web view? To make use of the browser I make the following changes in AndroidMainfest.xml & lt; Intent-filter & gt; & Lt; Action Android: name = "android.intent.action.VIEW" /> & Lt; Category android: name = "android.intent.category.DEFAULT" /> & Lt; Category android: name = "android.intent.category.BROWSABLE" /> & Lt; Data Android: Schema = "oauth" Android: host = "t4jsample" /> & Lt; / Intent-Filter & gt; Add the following code to more than 9 versions if ( Android.os.build.VERSION.SDK_INT> 9) {StrictMode.ThreadPolicy Policy = New StrictMode.ThreadPolicy.Builder () .permit...

sql server - How to split SQL guid ranges equally between X number of shards - C# -

निम्न पद्धति को कार्यान्वित करने के बारे में कैसे जाना जाएगा? सार्वजनिक सूची & lt; Tuple & lt; SqlGuid , एसक्लगुइड, इंट एण्ड & gt; GetShardRanges (इंट संख्याऑफ़शर्ड्स); मान लें कि यूनीकाइडेन्टिफायर के बीच 00000000-0000-0000-0000-000000000000 और एफएफएफएफएफएफएफएफ-एफएफएफएफ-एफएफएफएफ-एफएफएफएफ-एफएफएफएफएफएफएफएफएफएफएफएफ (दोनों शामिल) के बीच आता है ट्यूपल्स का आदेश दिया गया है: सबसे कम स्वीकार्य मूल्य, उच्चतम स्वीकार्य मान, शर्त्त संख्या (1 से शुरू होता है) शर्ड श्रेणियों को समान रूप से विभाजित करने की आवश्यकता है एचटीएमएल>

How to make tag for chrome extension in webstore -

I have made an extension for a specific website and uploaded it to my webstore developer account and published it. After this, if I try to find that extension in the webstore, this is not a listing. Any thoughts on this? Do I want to do any tag or something in my detail? PS: Here is an example of my scenario: I have created an extension for the website abcd.com and named the extension as "abcd - do action" I search for ABCD in WebStore, it lists some extensions but not mine. The Chrome Web Store Index has been updated based on a delay. Occasionally it may take a few hours or a few days for your item to be discoverable, sometimes it will hide the extensions installed from Chrome Web Store results, you should try to search without your own detail.

java - Make servlet work in background -

I have a file uploading software and UI on my JSP. & lt; Form method = "post" action = "mygeco" enctype = "multipart / form-data" style = "position: full; left: 30%; bottom: 2%;" & Gt; & Lt; Input type = "file" name = "datafile" id = "choose file" / gt; & Amp; Nbsp; & Lt; Input type = "submit" value = "upload" multiple = "multiple" /> & Lt; / Form & gt; File uploading is done on my Dopost method, and I have other code for my doget () method, so when I press the Upload button on my JSP page I want to upload. I am going to be in the background when the user lives on the jsp page and returns a warning after upload, how can I do this? Protects zero doPost (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto generated method is Stub Boolean Multipart = ServletFileUpload.isMultipartContent (reques...

irc - Connecting to twitch chat python -

आयात समय आयात win32api, win32con आयात सॉकेट # इंपोर्ट मॉड्यूल आईआरसी आयात थ्रेडिंग से कनेक्शन की अनुमति देता है #import मॉड्यूल समय कार्य करने की अनुमति देता है चहचहाना चैट bot_owner = 'TheMagicalCake' निक = 'जादुईकैकबॉट' चैनल = '#TheMagicalCake' सर्वर = 'जादुईकैकबोट.जेटीवियरकॉम' पासवर्ड = '~ redacted ~' irc = socket.socket () irc.connect के कनेक्शन के लिए #sets चर (सर्वर, 6667) # सर्वर से जुड़ता है # चैट को irc.send ('PASS' + password + '\ r \ n') irc.send ('USER' + निक + '0 * : '+ Bot_owner +' \ r \ n ') irc.send (' nick '+ nick +' \ r \ n ') irc.send (' JOIN '+ channel +' \ r \ n ') मैं चहचहाना चैट के लिए एक बॉट बनाने की कोशिश कर रहा हूँ लेकिन जब मैं इस कोड को चलाता हूं तो मुझे त्रुटि मिलती है, मैं किसी एक एल्स कोड का उपयोग कर रहा हूं जो उनके लिए काम करता है, लेकिन मेरे लिए नहीं ट्रेसबैक (सबसे हाल का कॉल अंतिम): फ़ाइल "सी: / उपयोगकर्ता / स्वामी / डेस्कटॉप /...

json - Android JSONArray looping -

This is a result I'm getting from a webservice "year" : ["2014", "2013", "2012", "2011", "2010", "2009", "2008", "2007", "2006", "2005", "2004", "2003" "2002", "2001", "2000", "1999", "1998", "1997", "1996", "1995", "1994", "1993", "1992", "1991", "1990 "," 1989 "," 1988 "," 1987 "," 1986 "," 1985 "," 1984 "," 1983 "," 1982 "," 1981 "," 1980 "," 1979 "," 1978 ", "1977", "1976", "1975", "1974", "1973", "1972", "1971", "1970", "1969", "1968", "1967", "1966", "1965 "," 196...

How to fetch data from table using foreign key using json in rails? -

I have a product table where each product has several images in the image table on the rail pictures, these two tables are on the image table. Foreign keys are connected using ie product_id. Now I want to bring the data from both the tables to the Jason format based on the product ID. What code does my controller need in the show controller? Thank you. In your controller def your_function_name @product = products .find (Params [: id]) to search for a product with #product_images = @ product.images response_to do | Format | # JSON for dual functionality as well as HTML format HTML {redirect_to @product} format.json {@product_images} End End You will also want to see a scene for JSON . For this, you can use gems like jambilar or rabble. For example, if you use jbuilder, you must create a view such as your_function_name.json.jbuilder json.extract! @ Images ,: first_varable_of_image, second_team_of_imes, created_it

objective c - Get file type description by extension -

Image
How can I get file type details such as Finder.app only use file extensions? In other words, I want to get that area in NSString: Here's a little nasty 'n' that's what you want: NSOpenPanel * OpenPanel = [[Enswapel Alok] Init]; [OpenPenel runmodel]; NSString * path = [[OpenPanel URL] path]; NSString * type = [[NSWorkspace shared workspace] typeoff file: path error: NULL]; NSLog (@ "% @", [[NSWorkspace shared workspace] LocalType forType: type]); The Open panel lets you select the file NSWorkspace first to determine the file's UTI (its path has been given), and then UTI Used to obtain a string describing the local type of file. Edit: If you want to use only file extensions in a positive way, then use these three lines instead of the three of the above: NSString * extension = [[OpenPanel URL] path] pathExtension]; CFStringRef uti = UTTypeCreatePreferredIdentifierForTag (kUTTagClassFilenameExtension, (__Briff CFStringRef) extension,...

c# - show listview item in a textbox -

is a list view that stores the name from my textbox and when I select a name from the row in my list view That name will be shown back in my text box How can I do this? There is a person in which I have collected all the details of the person list & lt; Person & gt; People = new list & lt; Person & gt; (); Private Zero Form 1_load (Object Sender, EventEurge E) {String path = Environmental. Gatefolder Path (environment specialfolder.desktop); If (! Directory. Example (path + "\\ address book data \\")) Directory.CreateDirectory (path + "\\ Address Book Data \\"); If the file ("example" (path + "\\ address book" \ "PeopleData.xml")) create file. (Path + "\\ address book data \\" PeopleData.xml "); } Private Zero Button 2_Click (Object Sender, EventArgs e) {Person P = New Person (); P.name = textbox1.Text; P.email = textbox2.Text; P.streetAddress = textBox3.Text; P.birthday = dateTimePicker1.Value; P.a...

c# - Entity Framework Code First - Reference same table -

I'm still starting with the unit framework code first. I want to select a resource to select a resource when creating a new resource, how do I reference the resource with the resource model? public class resources {public full resources id {get; Set; } [Required] [datatype (datatype. Email address)] [email address] receive public string email address; Set; } [Required] Public string password {get; Set; } Public string full name {get; Set; } Public at Time ManagerID {Received; Set; } Public perfection TravelManagerId {get; Set; } Public int overtime domainager {get; Set; } Public Completion Absence Manager {Received; Set; } Public Virtual Resources Time Manager {Received; Set; } Public Virtual Resources Travel Manager {Received; Set; } Public Virtual Resources Overtime Manager {Received; Set; } Public Virtual Resources Absence Manager {Received; Set; }} I think you are very close! If you want to do this from the conference, you can change the foreign key in your model a...

asp.net mvc 3 areas - Disable dropdown list in MVC3 -

"itemprop =" text "> after I have dropdown: Controller: on db = new TransFormezEntities ( ViewBag.fldCountry_ID = new selectList (db.tblCountries, "fldCountry_ID", "fldCountryName", stateDetails.fldCountry_ID) see country & lt; Div class = "display-field" id = "fldCountry_ID" & gt; @ Html.DropDownList ("fldCountry_ID", "[selection]") & lt; / Div & gt; How do I want to read or disable it? Try the following pieces of code For the disabled for Html.DropDownList ("fldCountry_ID", ViewBag.fldCountry_ID, new {@disabled = "disabled"}) To read only Html.DropDownList ("fldCountry_ID", ViewBag.fldCountry_ID, new {@ Readonly = "true"})

What's the difference between "//W3C//DTD HTML 4.01" and "//W3C//DTD XHTML 1.0"? -

Hi all: I want to get my actual height Browser, but I have some confusion about W3C DTD HTML 4.01 and // W3C / / DTC XHTML 1.0 , Below is an extension of my problem: If I am using W3C DTD HTML 4.01 at the top of the page header and click document.body.clientHeight , then I can not get the full height of the browser: & lt ;! DOCTYPE HTML PUBLIC "- // W3C // DTD XHTML 1.0 Transitional // N" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & lt; Html> & lt; Head> & lt; Meta http-equiv = "X-UA-Compatible" content = "IE = edge" /> & lt; Meta http-equiv = "content type" content = "text / html; charset = UTF-8" /> & lt; Title> test jquery height & lt; / Title> & lt; Script type = "text / javascript" src = "../ lib / jquery-1.8.3.min.js"> & lt; / Script> & lt; Script type = "text / javascript"> $ (fun...