Posts

Showing posts from April, 2012

get values of checkboxes and put them in an input field using javascript or jquery? -

I am trying to get value of checkboxes when they are checked and put them in the input field is. I can do this by using a button, but like the example But if I need to get the values ​​of checkboxes without using the button I create, Comes in Can anyone give advice on this? Thanks One click checkbox, add value to the checkbox in the string, Change the value to the value of the string. Use to view the checkbox. Try it: $ (document) .ready (function () {$ ("input: checkbox"). (Function () {var string = ""; $ ("input: check"). (Function () {string = = $ (this) .val ();}); $ ("# txtbox"). Val (String);});});

Two static directories (public+private) in node.js Express framework -

विचार का पालन है: लॉगिन निर्देशिका भेजें जब उपयोगकर्ता प्रमाणित नहीं होता है । ऐप निर्देशिका को एक बार भेजें, जो उपयोगकर्ता लॉग इन करता है (इस मामले में, पासपोर्ट मॉड्यूल का उपयोग कर)। उदाहरण: लॉग इन नहीं: अनुरोध: GET / प्रतिक्रिया: PATH_login लॉग इन: अनुरोध: GET / प्रतिक्रिया: PATH_app से मैंने यह कोशिश की लेकिन यह काम नहीं कर रहा है: ऐप.उसेज (फ़ंक्शन (रिक, रेस, अगली) {अगर (रीक। एसेट एंटिटेक्टेड ()) {// यूजर को रिटर्न एक्स्प्रेशन स्टैटिक (पैट_एप) } Else {// उपयोगकर्ता रिटर्न एक्सप्रेस.स्टेटिक (PATH_login)}}) प्रमाणित नहीं है; आरंभीकरण पर, आप सेटिंग कर रहे हैं कि स्विचन करने वाला मिडलवेयर फ़ंक्शन होना चाहिए हर अनुरोध के लिए बुलाया जाता है। आपको बीच में से प्रत्येक मध्यवर्ती कार्यों को प्रारंभ भी करना चाहिए जो इस समय के बीच स्विच किया जाएगा। प्रत्येक अनुरोध के लिए रनटाइम पर (जब फ़ंक्शन में कोड उस स्विचिंग फ़ंक्शन के लिए उपयुक्त मिडलवेयर को अग्रेषित करने के लिए, कॉल संबंधित फ़ंक्शन: > Var ऐपस्टैटिक = एक्सप्रेस.स्टेटिक (PATH_app); Var...

python - Flask WTForms cannot save file to different directory -

I am learning the flask with WTForms and I am trying to upload the file to the server. The structure of my app is like: | App | - mod_users | - models.py | - forms.py | Views.py | - Template | - Stable | Run.py | Config.py In my thoughts I have: @ mod.route ('/ post /', methods = ['GET'] 'POST ']) DEF post (): form = postform () if form.validate_on_submit (): filename = secure_filename (form.imageFile.data.filename) form.imageFile.data.save (' / app / static / images / books / '+ File name) If I have form.imageFle.data.save (filename) then the app works and saves The image in the same folder where the "app" is located but when I change it above, I have an error: IOError: [Aron 2] Such a file or instruction Not enough: '/app/static/images/testupload/test.png' to upload / app / stat / images / testupload / P> How do I fix this problem? Thank you. Understand this investigation that the directory "app ...

html - Polymer core-meta is already registered -

I am creating an application with polymers, and I am having trouble creating my own component. The component I am creating is a login signal. & lt; Link rel = "import" href = "/ static / bower_components / polymer / polymer.html" & gt; & Lt; Link rel = "import" href = "/ static / bower_components / paper-button / paper-button html" & gt; & Lt; Link rel = "import" href = "/ static / bower_components / paper-input / paper-input.html" & gt; & Lt; Polymer-element name = "login-sign" property = "" & gt; & Lt; Templates & gt; & Lt; Paper input label = "email" & gt; & Lt; / Paper-Input & gt; & Lt; Paper input label = "password" type = "password" & gt; & Lt; / Paper-Input & gt; & Lt; Paper-Button Label = "Login" Positive & gt; & Lt; / Paper-button & gt; & Lt; / Template & gt...

c# - Anonymous enum type as class property -

Is it possible to create an anonymous type of public enum class? I am running through a list of OOD scenarios and working on the original card game. Each game has a specific class with an enum of "PlayerActions", each class has its own unique value values, although after introducing player objects, I want each player to cross the game's Encom. Is it possible or am I completely off-base? Public Sector Players Set action based on this game in which you are playing public Enum I think you want action Instead of declaring enum again for each class, the annum, for example, declare your Enan once out of the class and enter all the functions in it: enum action {hits ARE and start it in your constructors: Private actions [ ] GameAction; Public Black Jack () {this.GameActions = New [] {Action.Hit, Action.Stay}; This.gameType = GameType.BlackJack; this. River = new card [HANDSIZE]; this. User List = New Player [TOTALUSERS]; } You game action area re...

objective c - JSON parsing - best practice for converting -

I have a string variable that holds the string [1,2,3] . It is an array of integers I want to convert this string to an integer integer using JSON functions etc. What is the best way to accomplish this? Thanks The code looks like this for conversion NSString * input = @ "[1,2,3]"; NSError * error; NSDTA * Data = [Input Data Device Encoding: NSUTF 8 string encoding]; NSArray * Output = [NSJSONSerialization JSONObjectWithData: Data Option: 0 Error: & amp; Error]; If (output! = Zero) NSLog (@ "% @", output); Other NSLog (@ "% @", error); Note that the objects in the array will be NSNumber , with the values ​​you specify. If you want to change the NSArray in the NSNumbers in a standard C array of int , then add the following int array [ Output.count]; Int index = 0; For (NSN umber * number in output) array [index ++] = [number intValue]; For (int i = 0; i

android - What is a map tile? -

Image
I read the Google Android API and was confused about a map tile as the API pointed out that how Google handles handle " Downloading tiles of maps ". (SRC) -. Can someone give a quick overview of what a map tile is just a part of that map which fits a device screen? The part of the map that can contain several tiles in the device screen. Basically, the map is divided into several tiles based on the zoom level. From: The class bitmap graphics displayed in the grid system to show a map. From : The Google Maps API breaks the imagery in a set of square mapped tiles in a grid at each zoom level. When a map goes to a new location or to a new zoom level, the Maps API determines which tiles are required and that information is translated into a set of tiles to retrieve it. The coordinates (0, 0) of the tile are always located in the northwest corner of the map, in which the x values ​​are rising from west to east and with rising values ​​from north to south. Tiles ...

java - Leapmotion: Controller is never Connected -

I have just started working on leapmotion with Java and facing a problem that the controller has ever encountered Not connected (although I have installed the device driver and the visualizer is working and everything is working fine) My Java version is "1.7.0_55" and I have Ubuntu 14.04 LTS If you open the leap speed controller program Not, will appear on the Leap icon in the task bar. Right click on it and make sure that the tracking is active. It may be that this Otherwise give us more details.

ios - Swift - Instance "not constructible with '...." from "static" method -

Image
When I try to install a class through the "static" method (required by the protocol), the compiler I do not recognize the initiator even though I pass the correct parameter. The problem is that you are defining a template called" comment "in your method declaration that is blurring the actual comment class to give you that template argument a different name Will happen. And I believe that your JSONSerializable protocol is not defined by the way you want it. You can use Self in a protocol to refer to the class implementing the protocol, so there is no need for a template. Your protocol may look like this: Protocol JSON SerialJabal {class func instanceFrom (json: [string: AnyObject]) - & gt; Self; } Then you will apply this method to your comment class: class comment: JSONSerializable {... class func instanceFrom (json: [string : AnyObject]) - & gt; Comment {Return Comment (Message: "Lorem Laurem", Author: User ())}} ...

ios - UIAlertView seems to freeze application when uploading data to Parse.com -

Hello, I'm using parse to help backend my iOS app and I've created a button that Upload my text to my textfield and cloud when I click a button The code and warnings for the button that are popped up are as follows - (IBAction) Save button: (ID) sender {// Create PFObject with recipe information PFObject * recipe = [PFObject objectWithClassName: @ "golftime"]; [Recipe set object: _nameTextField.text forKey: @ "name"]; [Recipe set object: _prepTimeTextField.text forKey: @ "member number"]; [Recipe Set Object: _NumberOfGolfers.text forKey: @ "Number of Golfers"]; [Recipe Set Object: _RequestedTime.text forKey: @ "Requested Time"]; NSArray * Content = [_ingredientsTextField.text components] Separator String: @ ","]; [Recipe set object: for content of: @ "telephone"]; // Progress Show progress MBProgressHUD * hud = [MBProgressHUD showHUDAddedTo: animated self.view: yes]; Hud.mode = MBProgressHUDModeInder...

arrays - PHP RecursiveArrayIterator Get current depth -

मैं इस का उपयोग करके RecursiveArrayIterator के साथ प्रक्रिया कर रहा हूं: $ iterator = new recursiveIteratorIterator (नया पुनरावर्तीअरेरेइटरेटर) ($ सरणी), रिकर्सिवइटरेटर इटरेटर :: एसईएलएफ_फिरस्ट); विदेशी मुद्रा ($ कुंजी $ $ के रूप में $ iterator => gt; $ आइटम) {// काम नहीं कर रहा है // ईको $ इटरेटर- & gt; getDepth () "\ N"; } क्या मैं उस कक्षा का उपयोग कर सरणी के माध्यम से जा रहा हूं, वर्तमान गहराई प्राप्त करना संभव है? चूंकि मेरा डेटा XML स्रोत से आ रहा था इसलिए मैं अपनी समस्या को हल करने में सक्षम था: $ sxi = new recursiveIteratorIterator (नया SimpleXMLIterator ($ xml) , रिकर्सिव इटरएटर इटरेटर :: एसईएलएफ_फिरस्ट); विदेशी मुद्रा ($ sxi $ key = & gt; $ value) {$ currentDepth = $ sxi- & gt; getDepth (); }

user interface - In GTK/Linux, what's the correct way to get the DPI scale factor? -

Reference: Writing a drawing program that should be cross-platform So I have several front axes that are responsible for providing backend class access to a Kaira reference, basic event handling and widget size information. I recently decided to add the existing UI Scale (for high DPI display) to that last bit, mainly because I want to switch graphics to be sung in a tile cache, so I have the highest support for the display Should know the level. In the world of my small cross-platforms, I hope the front end adapter for backend class is asking me to work in virtualized pixels to properly configure the reference. I need a scale to limit how much scaling should be used on my tiles. It was easy on the Epiket: Ask NSSize of 1 Virtual Pixel to Scale in "Supporting Store Coordinates" to provide backend class Apple to provide reference of pre-scaled core graphics Was smart enough so I just have to do that to direct the request to flip and press CGContext in Cairo. I'm ...

virtualbox - How to extract SFX files in ubuntu? -

I am trying to remove the Microsoft virtual box image for Windows8.1 / IE11 the host System Ubuntu ... Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 CodeName: Dependable I have downloaded 4 files, Part1 is an sfx file, 2,3 and 4 part rar files. After running chmod 777 on all files, I tried removing the archive using the ./filename. Sfx but failed with this error: Danil @ Danielle-son: ~ / desktop / vBoxImages / Win $ / IE11.Win8.1 .forlinks virtualbox. Sfx ./IE11.Win8.1.For.LinuxVirtualBox.part1.sfx: Line 2: Syntax error near unexpected token `) ' I have tried to use unzipsfx but I am getting .. DANIEL @ DANIEL-SON: ~ / desktop / vBoxImages / Win $ unzipsfx IE11.Win8.1.For.LinuxVirtualBox.part1.sfx UnZipSFX 6.00 20 Apr 2009, info- zip (Http://www.info-zip.org) Unzipsfx: Can not find myself! [Unzipsfx] daniel @ daniel-son: ~ / desktop / vBoxImages / win $ unrar command says SFX is not an RR archive If I try And unrar part 2 say...

networking - sendReliableMessage to self? Google Play Game Services - Android -

I am trying to create a real-time multiplayer game using Google Play game services. I am trying to set up a player as a host. Everyone will send their order host (message via sent medium), and receive a response to render them. However, I'm trying to send myself a message to be in sync with everyone (before acting), but onRealTimeMessageReceived is not firing for the host when the host itself Sends message to Is it possible to send messages to the host themselves? If not, how would I go about this? Google Tutorials also say that I should have a host player. You can send sendable message () RealTimeMultiLeplayer function in the function, in a written form, an IllegalArgumentException The recipientParticipantId is not a valid partner or existing player . The thing is that what you need to do is to forward all the messages to be forwarded (belongs to customers to keep updates and keep your game logic current and host / class for the method To make a call manually, a no...

Adding extra images/icons to CardFragment (Android Wear) -

Image
I am looking at this sample image from Google, and am trying to figure out how something implemented like this Please. It looks like a standard cardfraagment layout that takes a title, description and icon, but I'm looking at an extra clock image / animation on the left, which I think They use custom layout, is it possible to do this standard with CardFragment ? Or is there another feature class that allows support for multiple icons? I see it on the cardfragment and overlapping onCreateContentView : @ override public Create contentview (layoutInfleter Inflator , View Group Container, Bundle Saved InstantState) {mRootView = (ViewGroup) inflater.inflate (R.layout.fragment_my_card, null); ...} This lets you control what's happening on the white card.

Jquery - need to show a form if cookie is not set. Show user name if cookie is set -

I would like to show a form that asks for the username and gender if they are not logged in. If they are already logged in, I want to show their name and show them the background that is based on the meeting and possibly depending on their gender. Below is my code. & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; You're amazing! & Lt; / Title & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = utf-8" & gt; & Lt; Meta name = "viewport" content = "width = device-width, initial-scale = 1.0" & gt; & Lt; Style type = "text / css" & gt; Body {background: http://news.bbcimg.co.uk/media/images/64073000/jpg/_64073342_190475.jpg; } Body, H1, P {font-family: "Helvetica New", "Segoyi UI", Segoi, Helvica, Ariel, "Lucida Grande", Non-Serif; Font weight: normal; Margin: 0; Padding: 0; } ....

find - storing word by word and finding in java -

I am trying to create a dictionary essay (collecting words and then finding one of them) For example: Sorting algorithm From Wikipedia, the free encyclopedia A Sorting algorithm is an algorithm that holds elements of a list in a certain order. The most commonly used orders are numerical order and semantic sequence. Skillful sorting is important for optimizing the use of other algorithms (like search and merge algorithms), for which input data must be in sorted lists; It is often useful for making the data canonical and the production of human-readable output. More formally, the output should meet two conditions: the output is in order respectively (each element is not smaller than the previous element according to the desired total order); In addition, the output is the permutation (rerouting) of the input, in addition to that, the data is often taken in an array, which allows random access rather than a list, which only allows sequential access, although often the algorithm can ...

Unable to find files from a git branch on local copy (clone) of github repo -

I have a repository on github on which a branch "strlen" was created. I can go to github.com and select that branch and see my latest earnings. On my local computer, I did that repo cloned git checkout string I can not see the latest commit : In return, master earns only What have I done the next step to see really visible files on the Gitubbo? You will need (for you): git fetch Orig git checkout -b strlen orig / strlen If you were already in that branch, you can reset it to origin / strlen : git checkout The strlen git fetch origin git was reset to the top of strlen master --hard orig / strlen (which is git clone sspo GIT checkout Stellen # Strellan is now referenced from the current master Since git checkout Master , a git pu Local branch was created in the same branch as the original strlen as the local Stellen (like Master) to merge orig / strlen ): This will be a fast forward merge, where local strlen moves from orig / str...

objective c - Failed to push to a View Controller in iOS -

Image
I am beginning a lot for iOS development. I have created a navigation application in iOS, when some visible table views can be viewed in another view on the cell tap. I had the following code, - (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {LawyerViewController * DVC = [self.storyboard instantiateViewControllerWithIdentifier: @ "LawyerViewController"]; NSLog (@ "% @", [self object object: index: indexpath.ro]); Dvc.lawyer = [self.myObject objectAtIndex: indexPath.row]; [Self. Navigation Controller Push ViewController: Animated Dcc: Yes]; } It's going to the next scene. But do not tap here dvc.lawyer see the next page. Reading the value in the next page NSLog (@ "% @", self.lawyer.firstName); How to I can fix it in advance. Thank you! Text after " You are about to illustrate ViewControllers. In other ways, if you use storyboard segues (UIStoryboardSegue *) segue this: (i...

string - How to replace a text line by searching with '=' symbol in a file using .bat script? -

How can I change the text line by searching the '=' symbol in a file using .bat script? I have a test file test.txt with text ================================= ============================================= Pat = C: \ Program Files \ Think \ points \ trunk.exe word = c: \ programfile \ microsoft \ word12 \ word.exe ============ ============================================= I am able to change the text "C: \ ProgramFiles \ Think \ Digit \ Trunk.exe" with this word, "deleted" .......... But , I ............ path = c: \ programfile \ variable using SEARTTactic \ Think Ijit \ Trnk.aksa ........ But, I'm unable to search with the '=' operator. I have a batch file with the following code: - ========================== ================================================== ====== Close @echo setlocal enabledelayedexpansion set INTEXTFILE = C: \ Users \ PrasanthReddy \ Desktop \ test. txt set OUTTEXTFILE = C: \ Users \ PrasanthReddy \ De...

html - How to set the container height automatically maintaining the ratio -

मेरे पास img वस्तु एक div वस्तु के भीतर है मैं img (या div ) की चौड़ाई को सेट करना चाहता हूं और अपनी ऊंचाई को स्वचालित रूप से छवि के मूल अनुपात को बनाए रखने के लिए जो भी आवश्यक है, सेट करना चाहते हैं। मान लीजिए कि मैं चौड़ाई को 200px पर सेट करता हूं, जो छवि की प्राकृतिक चौड़ाई से कम है। जब मैं ऐसा करता हूं: HTML & lt; div id = "container" & gt; & Lt; img id = "foo" src = "foo.png" & gt; & Lt; / div & gt; सीएसएस #foo {width: 200px; } या # कंटेनर {चौड़ाई: 200px; } img में मूल अनुपात को बनाए रखने के लिए जो कुछ भी आवश्यक है, उसके लिए ऊँचाई सेट है, लेकिन बाहरी div ऊंचाई सेट है आंतरिक छवि की प्राकृतिक ऊंचाई तक, और ऊपर और नीचे के हाशिये आंतरिक img और बाहरी div के बीच डाली जाती हैं। मुझे बाहरी कोड चाहिए img के मूल अनुपात को बनाए रखने के लिए जो कुछ भी जरूरी है उसे और img शून्य हो जाएगा मैं यह कैसे कर सकता हूं? इस कोड की कोशिश करें & lt; div वर्ग = "कंटेनर" ...

Bash script to change file extension using regex -

I have a lot of files that I have copied from my iPhone file system, along with starting MP3 files, but app on iphone changed their name to a random employee which looks like: 1c03e04cc1bbfcb0c1237f57f1d0ae2e.mp3 additional = f7NhT68pNkmEbGA_I1WbVShXQ2E2gJAGBKSEyh3hf0hsbLB1cqnXDuepYA5ubcFm_B3KSsrXDuKVtWVAUh_MAPeFiEHXVdg I have only part of the file name after mp3 Need to remove? Please give me a script - more than 600 files, and manually it is impossible You command Can rename: rename "s / mp3 \ *. * / Mp3 /" * .mp3 *

storing httpie output with colors in document -

Image
I would like to use httpie to generate documentation for a reinst web service 'Server ping', 'http -v get: 8080 / ping' 'submit document', 'http -v post: 8080 / document name = asdf' And captures well-formatted output in a document. Is there any way to do this? You can also use ( pip install pygments ). This cleaner should provide the HTML, and it also gives you the option of choosing one of the many panning styles. {# stylesheet: echo & lt; Style & gt; 'Pygmentize -S default -f html echo' & lt; / Style> HTTP request as HTTP: http --print = H httpbin.org/post Hello = World | Pygmentize -f html -l http / dev / stdin # JSON request body as HTML: http --print = B httpbin.org/post Hello = World | Pygmentize -f html -l json / dev / stdin} & gt; Request.html Output: & lt; Style & gt; ... & lt; / Style & gt; & Lt; Div class = "highlight" & gt; & Lt; Pre & gt; ...

php - How to show only the date, the title and a litle "summary" of my WordPress post in my custom theme? -

I am very new to the development of WordPress theme and I doubt about how posts are displayed in a post. . I have this page from an old custom legacy blog that I am rebuilding using WordPress: As you can see in this page, the following structure Some posts are presented using: Date Short summary followed by Post title and After that I want to do in WordPress. So I have created this page which shows the list of posts: As you can see in this page, the posts are shown (formatting is terrible because I used to be old The post from the website is imported but I will work on it for the second time) The main problem is that if the post is too long, it shows all its contents. This is the code for this page ( category.php ): & lt ;? Php get_header (); ? & Gt; & Lt ;! - Contain (giglia) - & gt; & Lt; Div class = "container" & gt; & Lt ;! - Lead attendee - & gt; & Lt; Section id = "presentazione" & gt; & L...

calculate hamming distance and weight in sqlite -

Is there a good way to calculate the distance and weight of hamming in the sequel? It supports bit-rate operators, but I want to order the weight based on the hammer, and there is no support for the breakout in the software. To be more elaborate, suppose I have those lines: 1011 1000 1100 0011 and 1 line (1011) given, I have the last line (0011) I would like to get in the form, which is a maximum of 1s if you and they have. In my case the number will be about 650 points long, and I have around 3500 rows. I have found this solution that works with the tapes of text, but I like some other optimal choice: create table teas (x blob); Enter the TS value ('00010'); ... Select X & amp; '10011', length (x and amp; 10011 ',' 0 ',' ')) weight by TS; SQLite does not have any one that can directly help it. In SQLite 3.8.3 or later, you can use a recursive to calculate matches by hand: create table T (X ); Insert T Value ('1011...

c# - Margin on MediaElement cutting off parts of the video when resized -

When I resize my media element in height in the window, while the video scale is expected, it Also below the lower part of the crop video, which I can see through the definite elements in the video which is disappearing off-screen. As any idea how can I fix this? XML code & lt; Mediaelement x: name = "videoplayer" height = "370" vertical alignment = "top" width = "650" cursor = "hand" section = "uniform" allow = "true" drop = "VideoPlayer_Drop" & gt; & Lt; Button content = "play" height = "21" width = "50" vertical alignment = "bottom" margin = "270,0290,10" /> Resizing code Private zeros window ICITJung (Object Sender, Size Chained Event Here E) {VideoPlayer.Height = MainContainer.Height ; Video Player. With = main container width; Videoplayer.margin = new thickness (0, 0, 0, 32); }

ios - How to redirect url to either the Soundcloud or youtube app if downloaded -

So when I want to go to the Twitter app, if the user has downloaded it and is a Safari (a browser) No. I write this code: NSURL * urlApp = [NSURL URLWithString: [NSString stringWithFormat: @ "% @", @ "Twitter: // user? Screen_name = foo"]] ;; If ([[UIApplication is shared applicant] canOpenURL: urlApp]) [[UIApplication shared application] Open URL: urlApp]; } Other {[UIApplication shared application] Open URL: [NSL URL URLString: @ "https://www.twitter.com/foo"]]; } If I want to do this with Facebook, then I have to do this: [[UIApplication sharedApplication] openURL: [NSURL URLWithString: @ " Https:]] //www.facebook.com/TragicClothing "; But what happens when I want to do it with Soundcloud (and YouTube)? Is there an equivalent twitter: // user? Screen_name = foo for both of them? Please keep in mind that I want to go to Soundcloud (and YouTube) user page ( foo ) My code for YouTube: NSString * channelName = @ ...

.net - Is there a Collection that is suitable for keeping N elements (within size constraints)? -

I'm looking at the history of objects that represent the result of a process, I currently see a certain size for it I created a square around the array and made the entire array back to an unit (using AracupiPeto) when it was made to make room for the new value added. I'm guessing that this is not ineligible because I add a price every time, when I add a value, I was wondering if any existing collection type is more favorable for this? EDIT: Dah, i have just discovered that I do not need to move the array, but just keep a record where the array is the virtual start. Regardless of the type of the object (according to my understanding, the question is still standing) Number) are trying to store history I would recommend using the queue to store history. You can create a method in the utility class to add entries in the queue where you can check the queue size before adding an object. You can refer to more details.

c# - Pass a buffer of chars from .NET to COM and get it back updated -

I have the following COM method to call from C #, which provides buffer pchText ( The number of characters that have been copied in pcch : HRESULT next ([outside , Long-term * PCC, [out, size_s (* PCC)] Olescher * Pichtext; How do I define C # signatures for interop? So far, I tried to do this: void nex T (ref int PCC, [Marshall AS (unmanaged type. LPWRR, Size Param Index = 0)] SystemText.StringBuilder Pichtext); It seems to work, but I'm sure There is no effect on SizeParamIndex on StringBuilder . OK, this is definitely a tough task to call the right call. Your announcement is roughly ok, you just [pressseag] and To apply Seshta and return value of int need to create so that you can search for a S_FALSE return value indicates that there is no next element. The difficulty can be seen how big the stringbilder will be, the original code gets a raw pointer in the GC heap, which indicates the builder buffer, so the accidents are very fatal. You must put...

sql - Subset of a candidate key -

As we know that a candidate key is a combination of a column or column that identifies rows in a relation . Suppose I have a relation in which the candidate is a combination of the key column. I want to ask, Is it possible that a subset of the candidate key is also specially Recognize? or A candidate key is a key for which there is no subset that uniquely identifies the row? A candidate key is a combination of a column or column or more correctly set of one or more columns . Or more a set of columns correctly. A candidate is a set of key columns that uniquely identifies the rows and does not contain any small ("proper") subgroups that uniquely identifies the rows. P> is a set of superkey columns that uniquely identifies the rows, so a candidate key is a superkey, in which there is no small suprise. In SQL, you can not declare an empty candidate key. In addition, there is no unique and primary key (which are not only unique in the context of constrain...

javascript - wordpress custom field content as popup -

I have the stored value in the custom field 'price'. Clickbtn is the square which gives it the size of the button I only clickbtn Trying to read "Click here to reveal price" ... what I am trying to achieve is when the person clicks on the click button popup in which the contents of 'price' Open the www.bookurl.com link in a new tab as well as . & lt; Div class = "clickbtn" & gt; & Lt; A href = "http://www.bookurl.com" & gt; & Lt ;? Php echo get_field ('price') ;? & Gt; Price & lt; A & gt; Click here to reveal & lt; / Div & gt; You should use javascript for this, do not have PHP as the tag . With Simple JS: Simple Way: & lt; Span id = "price" style = "display: none" & gt; & Lt ;? Php echo get_field ('price');; & Gt; & Lt; / Span & gt; & Lt; An id = "price_ad" href = "http://www.bookurl.com" onclick = ...

bash regex with shopt -s extglob -

I want to validate input to be like the following: nnn day NNN hours NNN minutes NNN.NNN seconds , and this should be a negative value, hence prefixed with - , and multiple choice is optional. My script has shopt -s extglob , and I am using it: while reading; [[$ REPLY = ~ ^ - [[Points:]] {1,3} + [[Space:]] {1} (day | | hour | minute | second?) $]] & Amp; Amp; Dumb "good" || Echo "BAD"; How do I apply different rules for the second, that NNN.NNNN ? Is there a better, cleaner way to specify this Reggae, which I am already doing? Try the following expression: ^ - [[: ]] {1,3} (\ [[:: numerals:]] {1,4}.) [[Space:]] ?? (Days | hours | minutes? | Seconds?) $ You do not need to specify {1} for space. If you want the decimal only for seconds, then this will be something wrong (you can change \ d with [[Space:]] ): ^ - \ D {1,3} ((\.? \ {{0}}? \ Ssecond | \ s (days | hours | minutes))? $ In this way, the pattern will be (i...

How can PHP checkbox remember previous selection? -

When I run the code for the first time, all checkboxes are checked. When I uncheck some boxes and I submit it, the unchecked box has been checked again to resonate "strong> menu: & amp; Lt; / strong & gt; "; What is the best solution to remember the unwanted after sending the unselected box? Echo " "; While ($ row = mysql_fetch_array ($ result_meno)) {echo "& lt; input type = 'checkbox' name = 'option_meno []' value = '". $ Line ['menu']. "'Check / & gt;" . $ Line ['meno']; Echo " "; } thanks

java - Handling drag-and-drop with a moving list -

Image
I am working with drag and drop to drag the user from somewhere to a list. However, when ListSelectionEvent is received, it can unexpectedly display a drag and drop when the user changes the selection. My code: Import java.awt. *; Import javax.swing *; Class main {public static zero createGUI () {JFrame f = new JFrame (); JList & LT; String & gt; List = New JLIT & lt; & Gt; (New string [] {"text a", "text b"}); List.setFont (list.getFont () deriveFont (24f).); List.setDragEnabled (true); // list.setTransferHandler (new transfer handler ()) {/ * ... * /}); List.setSelectionMode (ListSelectionModel.SINGLE_SELECTION); List.addListSelectListener (E-> f.setLocation (f.getX (), f.getY () + f.getHeight ())); List.setSelectedIndex (0); F.add (list, border layout .a); F.pack (); F.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); F.setLocationByPlatform (true); F.setVisible (true); } Public static zero main (string [] args) {SwingUtilities.invo...

amazon web services - Small instance and autoscale or big instance? -

I'm going to get an Amazon EC2 account for my 4 e-commerce websites. Sometimes there is a big traffic, or I have to ask several questions to generate some product feeds. But there is something that I can not understand about this system: Why are different examples specs? I mean, if I pay per hour, why do not I get the smallest example, and if necessary give 2 or 100 examples to deal with auto-scale traffic. So, what advice can be made or why I am told above or not? And why is the different example size? Thank you all Not all applications are the same, the number of these web applications is quite different, the basic form From Amazon, AWS offers various flavors of virtual servers, some candidates are best suited for bursts, low-use blogs, compute intensive apps, e-commerce websites for media streaming servers, which require high RAM etc. You start with the most appropriate type and size to scale your application based on the virtual server and load then scale and scale d...

ruby on rails - How to use active_enum enumarate in an HTML select element? -

मैं अपने रेल 4 अनुप्रयोग में active_enum मणि का उपयोग कर रहा हूं। मणि 'active_enum' मेरे मॉडल में, मुझे एक गणना है: वर्ग बैठक & lt; ActiveRecord :: बेस गणना करें: प्रतिभागी_प्रकार मूल्य 0 = & gt; 'जूनियर' मान 1 = & gt; 'सीनियर' वैल्यू 2 = & gt; 'एडमिनिस्ट्रेशन एंड एंड एंड' मैं इन मानों को एक तत्व का चयन कैसे कर सकता हूँ? मैंने निम्नलिखित की कोशिश की है लेकिन मुझे एक रनटाइम त्रुटि मिलती है: = f.select: participant_type, Loan.participant_type अपरिभाषित विधि # भाग के लिए `participant_type 'वर्ग: 0x007f8803581050 & gt; "post-text" itemprop = "text"> प्रतिभागी प्रकार को एक अलग वर्ग के रूप में बनाएं जो कि ActiveEnum :: बेस बढ़ाता है और .to_select विधि। = f.select: participant_type, पार्टिसिपेंट टाइप करें: _select, आवश्यक: true अगर यह सक्रिय रिकॉर्ड एन्यूम है , नीचे की कोशिश करें: यह एक बहुवचन participant_types जैसा में उल्लिखित है। = f.select: participant_type, Meeting.part...

vb6 - Installing activeX control as a standard user -

After I have an Active X control done in VB6 that is packed in a cabinet with an inf file, and I The problem is having it installed as a non-administrator (to avoid UAC prompts). [version] sign = "$ CHICAGO $" AdvancedINF = 2.0 [Add.Code] fppd.ocx = fppd.ocx [Deployment] InstallScope = User [fppd: inf. Ocx] file Win32-86 = thiscab CLSID = {B175C045-20AE-4660-98CE-544AB2143E19} FileVersion = 1.0.0.0 RedirectToHKCU = Yes HTML code that controls call: & lt; Item id = "mini" width = 640 height = 480 ClassID = "CLSID: B175C045-20AE-4660-98CE-544AB2143E19" codebase = "fppd.cab" & lt; / Object & gt; Nothing happens when the page is opened immediately after the page has loaded, the reserve location disappears. The control is not installed or has not been launched at all. If I remove the [Deployment] part from inf, or change the InstallScope for the machine from the user, it normally works but which does not require which I wan...

ruby - How to avoid bug if geocoder sends me empty array when retrieving country of user (Rails 4/geocoder) -

I am preparing a daily deal rail app I only display the user's deals I am thanking the country with the GeoCoder Gems. I wonder what will happen if the Geocoder fails to recover the country and sends an empty array, as I think it fails to send the IP (see) Class StaticPagesController & lt; ApplicationController def home @deals = deal_in_user_country.featured_on_hp response_to do format | Create an opportunity to filter out deals that meet the format.html # home.html.erb end and # user country def deal_in_user_country Deal.where (country: set_location_by_ip_lookup.country || 'United States') # If Geodor To pb if default = US version end and end As you see, I tried to use And puts the 'United States', but I do not think it will work. I think if Geocoder sends blank array, set_location_by_ip_lookup = [] and then set_location_by_ip_lookup.country will generate an error, am I right? How should I avoid the bug when I send an empty array of geo-word? ...

PHP calling MySQL insert stored procedure -

We are new to using the procedures stored in MySQL and have created a test stored procedure, We have tested it in MySQL and it worked fine but we are having trouble working with PHP. We have the following code and when we run it we get the message "don" but the record has not been added include 'header.php'; & Lt; & Lt; & Lt; Sets access to DB $ name = "Richard"; $ Result = mysql_query ("call SPTestInsert ('$ name')"); Echo "finished"; Any help appreciated Thanks Rich

php - Legacy refactoring from procedural to OOP -

I found a site that is written in PHP, a completely formal method of doing things Currently, this extension is not easy and I want to refurbish the entire codebase. However, I'm not sure about how to actually go about it. I had never had to do such a refactor before and did not want to completely break it. I am mainly confused about workflow. I do not have any common workflow address for this, but you have to think about it: Which framework is to be used (unless you have never used a framework and you do not have time and your current site is very simple or you can get it for educational reasons For: Do not prepare your own OOP structure ) Anyone to break A: No one test site and test everything anyway, you will break everything at some point - but nobody should see it. Use potential papers, pen and plans

android - Set uri.parse resource as ImageView -

I am trying to set the image view as a resource for uri.pare. I tried to do this work, but it is not working: failed to load image Method 1: Intent = intent (int. ACT_ATATACADATA); Intent.addCategory (Intent.CATEGORY_DEFAULT); Intent.setDataAndType (Uri.parse ("R.id.imageView1"), "image / *"); Intent.putExtra ("mimeType", "image / *"); Initialization (Intent.createChooser (intent, "set as:")); Method 2: intent to intent = new intent (); Intent.setAction (Intent.ACTION_VIEW); Intent.setDataAndType (Uri.parse ("R.id.imageView1"), "image / *"); StartActivity; I can not set the imageview as a resource for uri.parse, so please help me how I set the form of URI as the source of the URF I have a code, but I do not understand how this code adjusted with my code: I found it: ImageView imgView = (ImageView) findViewById (R.id.image3); ImgView.setImageURI (Uri.parse ("file: //mnt/sdcard/d2.jpg...

vim - Inverse search using firefox -

I am writing a document using a redesigned text format in Turkey. I review the consistent product using Firefox As Vim does not have any spell checker, I try to track the spelling mistake by reading multiple times on Firefox and then attempting to correct the spelling mistake in the source document (vim.) I am surprised It is possible to search inverse so that whenever I face a mistake in Firefox, clicking on it will bring me to the same word in VIM. Thanks, There is a spelling checker in > Read : Spell help , especially part of using custom magic files, : help magic-mkspell .

Using Laravel properly coming from non MVC PHP -

I'm making an app and I want to get Laravel to do that, but I think I I am using it in the worst possible way. I am working in such ideas field); ? & Gt; @foreach ($ x as $ x) & lt; Span class = "post-tag" & gt; {{$ X}} & lt; / Span & gt; @ Xraynecha Should I do this in the controller? Or model? And how?

Achieving hover effect with text and icons in jquery -

Can someone give me some advice on creating a rollover effect on this site: When you rollover tiles, a shadow tile and icon moves over and the text is layered on the top I'm not sure it is using jquery or css, but I think That it would be very easy with jquery "post-text" itemprop = "text"> This can only be achieved using CSS3. You can use CSS: Hover Selector Also check CSS3 transition: You can also play here with cinematic cinematic for example: then want Copy / Paste the Shadow.

javascript - How to hide a div using jQuery -

In my index.html file there is a div with id = "menu" and I want to hide it using jQuery . My script. I wrote in js: window.onload = function () {prepareEventHandlers (); } Create the Event Event Handlers () {var hideDiv = $ ("# menu"); Var crtButton = $ ("#have"); CrtButton.onclick = function () {hideDiv.hide (); }; } But when I press the button on the webpage, the Divis is still there, only one way that works index.html I write: & lt; Button type = "button" onclick = "$ ('# menu') Hide ()" id = "hide" & gt; HideDiv & lt; / Button & gt; But since I have this bad style, why can not I use this by using my script.js code, do not want to use it? After Go with Lucas's answer or modify your own code crtButton is a jQuery object so it does not contain the onclick property, instead of the onclick property of the DOM element (which is the crtbutton [0] ) Or just leave jQuery an...

ios - How to calculate relative tap location in UIImageView -

I have a UIImageView that loads images with different aspect ratios to display the whole image properly Using UIViewContentModeScaleAspectFit. I need to allow users to tap the image and tag friends. How to calculate the X and Y percent of the tap space relative to the actual image content - Since the UIImageView contains the top-bottom or side padding to satisfy the UIViewContentModeScaleAspectFit barrier I need to be able to separate from the percentage calculation is. In addition, inversion is needed when UIImageView should be provided with the image and tag. There is an easy way with built-in function. [imageViewSet Frame: AVMakeRectWithAspectRatioInsideRect (image.size, ImageView.frame)] You can, of course, underscore the wheel again and Do a bunch of hand calculations.

php - unique_base option of sluggable exention doesn't accept a foreign key -

मेरे पास इकाई स्टोर और इकाई श्रेणी है और प्रत्येक स्टोर जोड़ सकता है अपनी श्रेणियां। मैं विदेशी कुंजी store_id पर आधारित प्रत्येक श्रेणी के लिए एक अद्वितीय स्लग जेनरेट करना चाहता हूं। मैंने "अनूठे_बेस" विकल्प का उपयोग करने की कोशिश की लेकिन यह काम नहीं करता। क्यों Sluggable विस्तार का "unique_base" विकल्प किसी विदेशी कुंजी को स्वीकार नहीं करता? वर्ग श्रेणी {/ ** * @ पूर्णांक * * @ORM \ कॉलम (नाम = "आईडी", प्रकार = "पूर्णांक") * @ORM \ आईडी * @ORM \ जेनरेटेड वैल्यू (रणनीति = "ऑटो") * / निजी $ आईडी; / ** * वाटर स्ट्रिंग * * @ORM \ कॉलम (नाम = "नाम", प्रकार = "स्ट्रिंग", लंबाई = 255) * / निजी $ नाम; / ** * @Gedmo \ slug (फ़ील्ड = {"नाम"}, अनूठा_बेस = "स्टोर") * @ORM \ कॉलम (नाम = "स्लग", लंबाई = 255, अनन्य = गलत) * / निजी $ स्लग; / ** * @ORM \ ManyToOne (targetEntity = "Project \ StoreBundle \ Entity \ Store", inversedBy = "श्रेणियां", cascade = {...

websocket - Set component attribute but don't fire event -

I am new to polymer / webcomputer and I am trying to set an attribute in one component but Why? Because I want to be able to do two things: 1) When the control changes (clicking on the checkbox) I want to use Event Handler to send (using websites) 2) when should change (an event through the website) ) I want to be able to set the checkbox but do not fire the event. Hope that I made my point clear; in Germany it is very hot -> the brain is melting;) & lt; Link rel = "import" href = ".. / polymer / polymer.html" & gt; & Lt; Link rel = "import" href = "../paper-checkbox / paper-checkbox html" & gt; & Lt; Polymer-element name = "webmp3-player" & gt; & Lt; Templates & gt; & Lt; Paper-checkbox ID = "Repeat" On-Change = {{change}} & gt; & Lt; / Paper-checkbox & gt; & Amp; Nbsp; Repeat & amp; Nbsp; & Lt; Paper-Checkbox ID = "Shuffle" On-Change...

jfilechooser - In java the JFileDialog box will not appear multiple times -

This block of code on your computer will show JFileChooser once instead of just a few times (IM on Mac) I should be able to show the dialog several times. public class file manager {public static zero main (string array []) {showDirectoryDialog (); Println ("Blocked"); ShowDirectoryDialog (); Println ("Blocked"); } Public Static File Show Directory Dialog () {System.out.println ("Creating Dialog"); Jfile Chooser Chooser = new jfileclosures (); Chooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY); Int returnVal = chooser.showOpenDialog (faucet); System.out.println ("Dialogue"); If (returnVal == JFileChooser.APPROVE_OPTION) {file f = chooser.getSelectedFile (); Return; } Return tap; }} Edit: If I make a stable example of JFileChooser and continue it, then it works. Does anyone know why this behavior exists? EDIT2: I am using OSX 10.9.4 and I was checked to make sure that the second dialog box was not behind any other program...

android - Disable Back Button (onBackPressed) -

I want to disable the back button after closing the app (sorry, my english is bad) How do I disable the back button? You can override the method and determine what happens in that method. By this way: Override public null at @BackPressed () {// nothing because you do not want to leave them when you press it} Just add that method to your activity class and you are good to go. However, this is a bad app design. What you most likely want is a dialogue pop up that asks them whether they want to leave that you will add a dialogue code inside that method , So that when the back button is pressed, the dialog will pop up.

c - Why aren't glibc's function addresses randomized when ASLR is enabled? -

एएसएलआर समझने की कोशिश में, मैंने यह सरल प्रोग्राम बनाया: #include & lt; stdio.h & gt; # शामिल करें & lt; stdlib.h & gt; Int main () {printf ("% p \ n", & amp; सिस्टम); वापसी 0; } ALSR को सक्षम किया जा रहा है: $ cat / proc / sys / kernel / randomize_v_space 2 और मैंने प्रोग्राम को संकलित करने के लिए जीसीसी का इस्तेमाल किया: $ gcc aslrtest.c हर बार जब मैं इस कार्यक्रम को चलाता हूं, तो वह उसी पते को प्रिंट करता है ( 0x400450 )। मुझे उम्मीद है कि इस कार्यक्रम को हर बार एक अलग पता प्रिंट करने की उम्मीद होगी अगर glibc को यादृच्छिक पते पर लोड किया जाता है। यह मेरे लिए हैरानी की बात है, खासकर दी गई है कि रिटर्न-टू-लिबर्टी हमलों को रोकने के लिए एएसएलआर (विशेषकर सिस्टम () कॉल) के लिए एक प्राथमिक प्रेरणा होती है। Am मुझे उम्मीद में गलत है कि सिस्टम () का पता यादृच्छिक होना चाहिए? या मेरे कॉन्फ़िगरेशन में कुछ गलत होने की संभावना है? एक साझा लाइब्रेरी से फ़ंक्शन के लिए कोई भी संदर्भ मुख्य कार्यक्रम में एक गैर-स्थिति-स्वतंत्र वस्तु फ...

javascript - Why the template BLANK ? Angularjs -

I do not know why my template is not being sung anymore. I get an empty page that worked before, after some changes it stopped working. I have reversed most code and I still do not work. There is no error of any kind in the console, how would I feel to debug this kind of behavior? Here is the controller 'strict experiment'; / * Controller * / var crmControllers = angular.module ('crmControllers', []); CrmControllers.controller ('timelinecrunction', ['$ scope', '$ pathperm', '$ http', function ($ radius, $ pathparm, $ http) {var Email id emails = $ routeParams.emailsId; $ http.get ('Http://local.sf.com:8080/timeline/API?emailsId=' + Email ID, {with Credential: True}) Success (Tasks (Timeline) {angular.forEach (Timeline, Tasks (Timeline) {Var inboxIfr InboxIfr = 'http://local.sf.com:8080/messages/inbox?email='+ Timeline.Email +' and EEmail = 'Timeline.Email +' and 'Theme =' + Timeline Sperm timel...

javascript - Searching NYT API using Angular JS -

I am writing code in angular js, applying a standard application which will show a search field and a search button screen and When the search is running, it should be dragged into a remote result and displayed on the screen. The console is not showing any errors for me, but I am unable to display the results on the screen. I am wondering how I will show results on screen Here is the code in my JS file Angular Module ('plunker', []). Controller ('micr ctrl', ['$ scope', '$ Http', function ($ radius, $ http) {var clearError = function (results) {$ scope.error = ""; Return result;}; var apply Data = function (result) {$ scope.articles = result.data; Console.log (result.data);}} var rejected = function (error) {$ scope.error = error.message;}; var getArticles = function () {Var url = "http://api.nytimes.com / SVC / search / v2 / artic? Lesearch.json q = Answer + Korea & amp; API key = 052861d142cf4eb7fa12bb79781fdbe1: 11: 69,591,...

java - access table model swing -

I wanted to make my application well without 100 internal squares and stuff. I have a class that holds some lists with the data. I have a menu, which uses the object action, such as I had to work there to remove the selected items from the table and work there. For this, I need reference for both table and table model. I want to add this action to the menu item, I will have to pass references to the table and table model which are created later as I do: Main Menubar Menu = New Men Menu (DB); MainTabbedPane tabbed = new main tabbed pan (DB); This.setLayout (new border layout ()); Add (Menubar, Border Layout. PAGE_START); Add (Tabbed, Border Layout. CA); Where TabbedPan has 2 tabs with 2 tables, so how can this do any good with any help? It would be nice if JTable supported generics, make life very easy But this is not because we do not like much. Take advantage of a solution that will allow you For example ... Public abstract class AbstractTableAction & lt; M...