Posts

Showing posts from August, 2013

Vim - how to exclude part of clipboard register when pasting -

मेरे .vimrc में मेरे पास निम्न उपनाम है: मानचित्र & lt; C-F & gt ; & Lt; Esc & gt; / & lt; सी-आर & gt; & lt; सी-डब्ल्यू & gt; & lt; सीआर & gt; एन मानचित्र & lt; एस-एफ & gt; & Lt; Esc & gt; / \ & lt; & lt; C-R & gt; & lt; सी-डब्ल्यू & gt; \ & gt; & lt; CR & gt; एन ये मुझे एक स्ट्रिंग की खोज करने की अनुमति देते हैं एक पूरा शब्द के रूप में एक हिस्सा ऐसा करने के बाद मैं अक्सर / / (सीआर, /) की सामग्री को चिपकाने की कोशिश करता हूं, यानी मेरी पिछली खोज इन उपनामों के द्वारा, एक अन्य vim कमांड (vimgrep, s // g, आदि) में। अगर मैं सीएफ़ का उपयोग करता हूं तो यह काम बहुत अच्छा होता है, चूंकि @ / में स्ट्रिंग जो मैंने खोजी थी (उदाहरण: "फू") लेकिन जब मैं एस-एफ का उपयोग करता हूं, / / ​​"\ & lt;" शामिल होता है और "\>" (उदाहरण: "\ & lt; foo \>"), जिसे मैं बहुत अधिक हमेशा मैन्युअल रूप से हटाना समाप्त करता हूं। क्या कोई तरीका है "\ & lt;"

php - When to use single quotes, double quotes, and backticks in MySQL -

I am trying to figure out the best way to write the questions. I understand the importance of being consistent so far, I have randomly used single quotes, double quotes and backticks without any real idea. Example: $ query = 'INSERT in the table (id, col1, cola2) value (tap, val 1, val 2)'; In addition, in the example above, suppose that the "table," "col [n]" and "val [n]" can be variable is. / P> What is the standard for this? What do you do I have been reading answers to similar questions for about 20 minutes but it seems that there is no definitive answer to this question. Double quotes in string values ​​such as VALUES () list are supported by MySQL for string values, but single quotes are accepted more widely by other RDBMS , So there is a good habit of using single quotes rather than double. MySQL is also single-quoted in the form of a string like date and DATETIME , such as '2001-01-01 00 : 00: 00 ' . Fo

char - Str to double in matlab -

I have a variable called x, where character As follows: 123123213 343423434454545455 .... If I do: X (1) = 1 x (1,1: 9) = 123123213 When I write, I want to receive: x (1) = 123123213 I tried to do this: s = [cellstrale (x)]; T = [str2double (s)]; Then I found something like "T": ans = 1.0e + 020 * 1.1352 1.1006 1.0835 .... << / P> If it helps by using matlab 7.12 . P> Perhaps str2num: x = ['123123123'; '343423434'; '454545455'] x_num = str2num (x); X_num (1) ans = 123123123

HTML Comment Behavior -

So, when I saw the Magento WYSIWYG editor (all things) revolving around, then & lt ;! & Gt; & lt ;! ---- & gt; As a result of renders in HTML it seems that & lt ;! & Gt; provides a generic ! & Lt ;! - [string] - & gt; Comment I have tested this in Chrome only, but this behavior seems a little strange to me, as well as a little document on MDN. Neither gave me an answer, I could literally wrap my head around, though; Comment What is the importance of open delimiter ("-") , and if it is omitted, then & lt ;! & Gt; Always a proper comment? Could this, perhaps, my browser just get rid of invalid markup? Why not & lt ;! & Gt; Just rendered as text? I know it is not important, or is appropriate for doing anything, but I'm just curious! Formally, the comment syntax in HTML is HTML complicated, after the SGML standard, but practice HTML was not implemented as a SGML application, an old page by WWDG briefly summari

javascript - How costly are trips to server for single page applications? -

I am creating a single page app that will run on your average tablet, so the resources are not very comprehensive. I am initially thinking about retrieving all the data needed for the application and storing it in TaffyDb - the local Javascript database - and instead of doing a local query every time a user Point to the event handler. / P> I was wondering who would be better in terms of speed / memory. All data is stored locally on TaffyDb, or is recovering the required information every time. Data is simple JSON objects, maximum 10. I have seen an estimate that approximately 40,000 machine instructions for executing the cost of each HTTP request Connected (all the time) This is very dear on mobile phones. But I'm focusing on another aspect -; Disconnect occasionally; Occasionally connected; Disconnected. Each case needs its strategy, for example # 3 will definitely mean local dB and some synchronization. For # 2 this is enough to do some local caching

android - Java doesn't work with regex \s, says: invalid escape sequence -

I want to replace all the spacing characters with "ss" with one "+" and all "ß". It works well for "ß", but somehow eclipse will not let me use \ s for a white space. I tried "\ t" instead, but it does not work either .. I get the following error: Invalid save sequence (valid ones are \ b \ t \ n \ f \ r \ "\ '\) < P> This is my code: Try {string temp1 = from.getText (). ToString (); start_from = temp1.replaceAll ("ß", "ss"); start_from = start_from .replaceAll ("\ s", "+ + Thanks in advance! Why does not this work? Is it Android, Eclipse or what? Thanks in advance! You need to avoid slash start_from = start_from.replaceAll (" \\ s "," + ");

javascript - Filter a part of String -

I have an array and shows its data on table Filter by date or name properly If someone enters a name, then I write some more code to show "No Data Found", which is not in the list, but in some way Does not work. Is there a way to write code that will display results if the user only enters the last name or first name, then will the last name or first name be found in that list? Please put in hand thank you! HTML & lt; P & gt; From: & lt; Input class = "Date picker" id = "dateFrom" type = "text" & gt; To: & lt; Input class = "datepicker" id = "dateTo" type = "text" & gt; & Lt; Button class = "buttApply" & gt; Applicable & lt; / Button & gt; & Lt; / P & gt; Input type = "text" id = "searchByName" & gt; Names are by & lt Search & LT; Button type = "button" id = "byNamebutton" & gt; Sea

Execute Java Code based on list of checkboxes in HTML -

मेरे पास निम्न श्रेणी है: सार्वजनिक वर्ग उपयोगिता {सार्वजनिक स्थैतिक शून्य पुनः आरंभ (स्ट्रिंग) [] आर्ग्स) {// पुनरारंभ लॉजिक} सार्वजनिक स्थिर शून्य बंद (स्ट्रिंग [] आर्ग्स) {// शटडाउन लॉजिक}} दोनों ही तरीकों से एक सूची की स्थितियों में लगेगा मेरे जेएसपी में मेरे पास है: & lt; form action = "ActionForm" & gt; गतिशील रूप से जेनरेट किया गया ; & Lt; इनपुट प्रकार = "चेकबॉक्स" नाम = "सूची" मान = "XA" & gt; & Lt; इनपुट प्रकार = "चेकबॉक्स" नाम = "सूची" मान = "SDFS" & gt; ... & lt;! - यह एक स्क्रिप्ट के साथ जनरेटेड & gt; & Lt; इनपुट प्रकार = "चेकबॉक्स" नाम = "सूची" मान = "एफडीएफएस" & gt; & Lt; इनपुट प्रकार = "सबमिट करें" मान = "पुनः प्रारंभ करें" & gt; & Lt; इनपुट प्रकार = "सबमिट करें" मान = "शटडाउन" & gt; & Lt; / प्रपत्र & gt; लेकिन मैं कैसे चेकबॉक्स की एक सरणी को संभाल करने

oracle - How to write a procedure to execute a .txt file -

I have several txt files on my local system, each of which has a table creation query. These are big tables, so I have a separate file for each table. I have to write a procedure / function which will execute each of these .txt files and make tables in tables. How can I do this? The server is Oracle11g and I'm using SQL Developer to access it. Just before the full script path on SQL Developer @ and execute it. East. @ 'c: \ script dir \ script1.sql' @ 'c: \ script dir \ script2.sql' @ 'c: \ script dir \ script3.sql' Select all the lines and press the Execute button. There is no need to write a complex process to access the file system and deploy the script. On SQL * plus, you only need to paste and enter each line, or call all script calls placed on the wrapper script. Just a @ 'C: \ script dir \ callAllScripts SQL' If I had to fully develop an automatic deployment tool for a system, So I can store the scripts on the local FS o

javascript - How can I toggle those two divs while clicking on an inside div? -

मेरे पास है: HTML कोड: & lt; div id = "katy" & gt; & Lt; div & gt; & Lt; a href = "जावास्क्रिप्ट: शून्य (0);" id = "एक" & gt; बटन 1 & lt; / a & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; div id = "पेरी" & gt; & Lt; div & gt; & Lt; a href = "जावास्क्रिप्ट: शून्य (0);" शैली = "प्रदर्शन: कोई नहीं;" id = "ख" & gt; बटन 2 & lt; / a & gt; & Lt; / div & gt; & Lt; / div & gt; OUTPUT: मुझे क्या चाहिए: < P> आप पर क्लिक करते हैं, यह दिखाएगा आप पर क्लिक करते हैं, यह दिखाया जाएगा। मैं एक आंतरिक डिवी पर क्लिक करते समय उन दो डिवाइज़ कैसे बदल सकता हूँ? यदि आप डिस्प्ले: कोई भी भाग नहीं ले जाते तो यह आपके लिए आसान होगा लिंक के बजाय div के लिए। & lt; div id = "katy" & gt; & Lt; a href = "जावास्क्रिप्ट: शून्य (0);" id = "एक" & gt; बटन 1 & lt; / a &a

php - How get size_of $_GET -

I want to get the number of values ​​submitted through my $ _GET. I am going to use a loop and every 7 is being saved in one class. Does anyone know how to get size_of the $ _GET array? I looked through this information, but I do not know what I see. This is a code snippet that I started in the class that I do after submitting. ($ I = 0; $ i & lt; $ _ GET & lt; Size & gt;; $ I ++) {$ ID = $ _GET ["ID"] for [$ I]; $ Desc = $ _GET ["Desc"] [$ i]; $ IValueation = $ _GET ["evaluation"] [$ i]; $ Mevaluation = $ _GET ["Mevaluation"] [$ i]; $ Pricing = $ _GET ["value"] [$ i]; $ AUTHUS = $ _GET ["AUTHUS"] [$ i]; $ Comment = $ _GET ["comment"] [$ i]; /// There is an array, like any other array in PHP, you can find the number of elements in an array that You can use or its surname.

wildcard - With PHP how do I extract a alpha numeric from a string -

I've been searching for a while, but I did not find my only one. With PHP I need to remove 2 groups of different numbers within a series of numbers and letters, it always happens between the last and the last duration. Like: exten-651 Hopefully you can share your thoughts on this. Thank you in advance. This is always the last and final Duration is between. $ string = 'exten-651-652-20140423-154650-1398293210.14.wav'; $ Data = explosion ("-", $ string); Echo str_replace ('.wav', '', array_pop ($ data)); Demo:

ios - Access textfield of UIAlertController - swift ios8 -

I am trying to access the text field of UIAlertView and I am using textFields The property and I get the following output from the textFields property: & lt; _UIAlertControllerTextField: 0x7fe911f96790; Frame = (4 4; 231 16); Text = 'this is the text that I have entered so far'; Clip Tubons = Yes; Opaque = no; Line writer = & lt; NSArray: 0x7fe914215cc0>; Layer = & lt; CALayer: 0x7fe911f96c40 & gt; & Gt; As you can see that the text appears, but I have a different need of text. textFields.text will not work because it can not be used in excluded and swift. TextFields are stored in an album's array. If you want to enter text, then you must first enter it as UIIFFFIFF: (UITextField as alert.textfields [0] .text) < / Pre>

append - Jquery cloned objects from multiple locations appending into same container -

I have two tables on one page that are being used terribly for layout purposes. Need to move into two containers, one for each table I am working with the following HTML. & lt; P & gt; Paragraph of some goods & Lt; / P & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; P & gt; More stuff with paragraphs & lt; / P & gt; & Lt; Table & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; Image & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; Em> Some fancy text & lt; / Em> & Lt; / Td> & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; I can not open the

assembly - Unknown module in OllyDbg 2.01 "Assemble" command -

Image
I am immersing a crack-me and I want to replace an empty space with WINAPI SetDlgItemText () Parameter takes it. I've successfully added three "push" instructions, but when I call call & lt; Jmp. And user32.SetDlgItemTextA & gt; I try to collect; OllyDbg is called me in the red unknown module The same instruction is used in some of the rows given above (by software, nothing assembled by me). How can I resolve this error and make SetDlgItemText calls? Binary Copy - Binary Paste does not solve the problem (jump in a different section of code, possibly because I have a slight disturbance with opcodes) Here's a Screenshots (): EDIT1: Function JMP address 0x00401460 Found on So I put it in that place and instantly ollydbg call it call & lt; Jmp. And user32.SetDlgItemTextA & gt; Replaced with string. Why can not it do the opposite? Imported functions are commonly used in calls Import the address table (IAT) This structure contai

css - How do I use Susy to produce different layouts on different pages? -

I am using Crop 2.1.3 as a grid system. I have an element in which there is a different drain on different templates. I have declared two different layouts and feel that I am implementing them correctly. However, the layout that is defined as the one that is applicable everywhere is applied in the code below, $ onepx-gutters layout also on the .home page. I like my SCSS code: $ small-rocks: (column: 12, gutter: 0.137254902, output: float, no-position: split, global- Box-size: border-box,); $ One px-gutter: (column: 12, gutter: 1 px / 80px, output: float, gutter-position: first, global box-sizing: cement box,); .home .item-container {@ layout (includes $ small-gutter); Include @ container (); }. Products include .item-container {@ layouts ($ onepx-gutters); Include @ container (); } .item-container .item-width-2 {@ Add Term (8 out of the first 12); & Amp ;: nth-child (2n + 3) {Clear: Both; }} .item-container .item-width-1 {@include span (4 of 12); } The generated CSS c

python - Should I define functions inside or outside of main()? -

After reading the following, I think I understand the value of the simplest wrapping of scripts in a main () function I am / P> Should I define the main functions inside or outside of me? Is anyone right or wrong? What are the advantages and disadvantages of both methods? I discourage defining the function inside main () , Especially if you have multiple files in Python script, do not do anything outside any function B function defined inside the A function A It is seriously limiting its utility, for example functions can not be defined in main () , for example Defining the function inside main () allows you to easily override other functions, and somewhere else which is the same name, but those are In instances where it is really useful, some are in the middle, and you should not do it as a normal practice. Overall, there are many reasons for defining outside tasks to define actions outside of main () , and if you are learning python, then definitel

ruby - What means 'bin' in '$ bin/rails?' -

I am trying to comply with the tutorial "Getting Started With Engine" in Rail Guide Guide and found: bash: bin / rail : A file or directory such as when I try just $ rails it works fine. I am using the command for some months, line and rail too. I know the $ sign but after that I'm confused about the meaning of "bin" I'm used to type "rail" right after $, but this tutorial says that use "bin". .. What does bin / mean? tl; Dr run bundle install --binstubs and it will work 'you only have to do this once and the bundler will remember that you asked for it (for that project). Long answer When you install a bundle with the bundle - Binstubs , the bundler will be bundled with all your bundle-specific binstubs by bin / < / Code> will set in the subdirectory (relative to Gemfile), instead of putting them in the gemset's global bunting paths. You usually do this: Ensure that you are running

css - More than one list item per line (based on resolution) -

I am working on a mobile app where there is a list of the elements displayed on the screen. Items are of a certain size, while a smartphone on the portrait can display only one item per line, I would like to display it on two lines on landscape mode, or on a tablet where it can fit 4 in a row ... screen KW / E shape as fit as possible in the same line. I understand that I have to use the media query to do this ... I tried to use display: inline to do this To fit the entire width, set the items and overwrites the set width. So the question is: How am I making a divisve I display it as configuring it and allowing screen size as many elements in a row? Thanks in advance for responses! Use - ul li {display: inline-block ; } Demo here -

c# - Lazy loading images in Virtualized Listbox -

I'm trying to lazy load thumbnail image for each item in a listbox asynchronously. & lt; Image Source = "{Binding Path = thumbnail target Nilevlugh = {static resource Aisim}}" /> An item display port since the listbox called Greater virtual thumbnail property Only when or in that is near. get public BitmapSource thumbnail {TriggerLoad (); Return _ thumbnail; }} I really does operation that load thumbail in TriggerLoad event, but the UI is very sensitive, especially not when you try to scroll quickly through the list of items I am waiting for Private async zero TriggerLoad () {if (LoadTriggered) {LoadTriggered = true; Var cacheItem = _cache [key] as CacheItem; If (cacheItem! = Null) await LoadBitmapFromCache (cacheItem); // gives a task and waits for the loaded bitmapfo service (id); // gives a function}} Similar questions have been received but it is not about loading objects in a listbox? Any better approach to lazy loading there is just a pa

How to building own java framework -

I and my friends do the same projects in Java. We decided to make a framework for myself but I do not know how to follow the technical method? How to optimize our structure for every project? How to design template engine for example? Should we be represented by other frameworks (spring, struts, izb etc)? We want to develop this structure. Are you advising me From my experience, if you are not rich, the first thing you need to do is identify a place Make and pay for the first development is a customer. After that, you have to develop a solution with some good code architecture that allows you to distribute something good at the same time, and can be optimized for other similar customers. Sometimes, you can also try to become a partner with your first customer, provide feedback and can help you get other clients (sometimes, this one Win-win deal and they can help you sell your software right contacts). At the same time, you need to see a dream about your product. It depe

java - Closing a system dialog fails -

I am executing a USSD code in my Android application in this function public Blank response (reference arg0, int arg arg) {string ussdCode = "*" + "199" + "*" + "8" + "*" + "08 9 7067547" + Uri.encode ("#"); Switch (getResultCode ()) {case activity. RESULT_OK: Toast. GetBaseContext, "SMS distributed", toast .LENGTH_SHORT). Show (); Beginner (New Intent ("android.intent.action.CALL", Uri. From ("Tele:" + USSD code)); SubmitBradeCast (new intent (int. ActionCLOSE_SYSTEM_DIALOGS)); break; Case activity RESULT_CANCELED: Toast. Make text (getBaseContext), "SMS not distributed", toast. LNNGHHORT). Show (); break; }} I am able to execute the ussd code but later I am not able to close the ussd dialog. How can I go about closing the USSD Dialogue? You do not do this, you can not close it from another app, you can not close it. This is the reason why the general rule is n

Zimbra Right Click zimlet ... possible? -

Is it possible to change the context menu that is an email item line (that is, the center between Zimbabwe). ... The content object type is close, but I can not find anything conclusive. Total zimbra / zimlet newb also btw. Yes, you can definitely add items (I only added, not deleted items) . In fact, you can perform the functionality on onActionMenuInitialized = function (controller, action menu) {}, here are some things that add a menu item // and make sure you select one Adds that item to the listener} is an example you can follow on

Why should I close files in Python? -

इस सवाल का पहले से ही एक उत्तर है: < / P> 5 जवाब आमतौर पर जब मैं फाइल खोलता हूं, तब मैं कभी भी close () विधि को कॉल नहीं करता, और कुछ भी बुरा नहीं होता है I लेकिन मुझे बताया गया है कि यह बुरा व्यवहार है ऐसा क्यों है? अधिकांश भाग के लिए, निम्नलिखित फाइलों को बंद नहीं करना एक बुरा विचार है, निम्न कारणों से : यह आपके प्रोग्राम को कचरा संग्रहकर्ताओं में रखता है - हालांकि फाइल सिद्धांत में स्वतः बंद हो जाएगी, यह बंद नहीं हो सकती है पायथन 3 और क्रेपिथॉन आम तौर पर कचरा इकट्ठा करने में बहुत अच्छा काम करते हैं, लेकिन हमेशा नहीं होते हैं, और अन्य वेरिएंट आमतौर पर इसे चूसते हैं। यह आपके प्रोग्राम को धीमा कर सकता है कई चीजें खुली हैं, और रैम में इस तरह अधिक इस्तेमाल की जाने वाली जगह, प्रदर्शन पर असर डालती है। अधिकांश भाग के लिए, अजगर में फ़ाइलों में कई बदलाव तब तक लागू नहीं होते जब तक कि < आप कर सकते हैं, तो फ़ाइल को बंद कर दिया गया है, इसलिए यदि आपकी स्क्रिप्ट संपादन करता है, तो खुला रहता है, और एक फ़ाइल पढ़ता है, , सैद्धांतिक रूप से, आप कितने

java - How to find the marker postion by its title? -

I have a list where a user types the name of a place and chooses it. Clicks the username and shows the location of an infowindow name. I have already made markers. I am able to get the title of the marker clicked by the user. How do I get the marker status from the title of the marker? My // My list has been removed from the XML file string [] [countries] = getResources (). GetStringArray (R.array.list_of_countries); ArrayAdapter adapter = new array adapter (this, android.R.layout.simple_list_item_1, country); Actv = (AutoCompleteTextView) findViewById (R.id.autoCompleteTextView1); Actv.setAdapter (adapter); actv.setOnItemClickListener (see New AdapterView.OnItemClickListener () {@ Override public void onItemClick (AdapterView & lt;? & gt; parents, see, see int position, long id) {CharSequence country = ((TextView)) .getText (); toast .makeText (getBaseContext (), country, Toast.LENGTH_SHORT) .show () ;. // here if I titled "EF" title, for example marker //

How to stop a service from BroadcastReceiver in Android? -

I have a broadcast receiver that receives the JSON of a cloud messaging (GCM) when passing a parameter, whose According to the beginning of a global objective of service class, the location of the cell is sent to the server every time the service is served, then another message is sent to the same GCM to stop it, the problem is that when I stop the service I am the service is zero, but I Also sends location. I want to stop sending location to stop service BroadcastReceiver public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {string tag = "MainActivity". ServiceOGPS Service 1; Int nroService; Override public zero at @Receive (reference reference, intention intent) {// == I get JSON bundle extras = intestine .getExtras (); // == I check that if I want to start the service (("status") of extra consents) {service1 = new service GPS (reference); NroService = service1.onStartCommand (intent, 0, 58); Logs. I (tag, string.valouf (NRO service)); } E

testing - How do I test my auto-renewing subscriptions with In-app Billing API version 3 in my Android app? -

suggests migrating in-app billing to Android API v2 to v3. Android has suggested that In-App Billing API v3 now supports subscriptions. Android has suggested that there are still tests and actual purchases. If you have read more below, there are requirements for a purchase purchase: Test purchases are available only for in-app products Not only for in-app subscriptions, but also for in-app subscriptions. How do we check in-app subscriptions in IAB v3? The only way to test this is to actually buy monthly or an annual membership and Wait for subscription to finish (month / year + trial period).

xcode6 - Xcode 6 Core Data Regenerating Subclasses -

Using Xcode 6 Beta 4 Core Data If you want to add / remove an attribute, how do you re-subclass? For example, let me create a new unit and after adding some attributes, go to the editor> CreateNSManagedObjectSubclass .. Does anyone know what I am doing is wrong or what is the right way to do it? Thank you! Xcode will not silently overwrite your file. This is an attribute, not a bug, because you are unknowingly doing those classes. Will not lose custom code in If you want to change the file, first delete it. Class generation will then work as expected

c# - Cannot access a disposed object Object name: 'UserManager`1' -

I know that this question is asking for quite some time on the stack overflow but I tried to reply but non-problem In order to solve, I recently added unity to my project, except for doing everything fine except the User Manager class. If I try to access it in session then it can not reach the error stated in my title. Code which is throwing issues and containers under the Public Account Administrator (User Manager and LT; ApplicationUser & gt; User Manager) {UserManager = userManager; // Start new code UserManager.UserValidator = New UserValidator & lt; ApplicationUser & gt; (UserManager) {Allow AlAphanumericUserNames = false;}; } Container. Registration Type & lt; AdminController & gt; (); Container.RegisterType & LT; AccountController & gt; (); Container. Registration Type & lt; IBlogPostRepository, BlogPostRepository & gt; (New hierarchical Lifetime Manager ()); Container. Registration Type & lt; IBlogViewRepository, Blog View Reposito

Can I initial a static global variable by calling a function in C language? -

Can I start a stable global variable by calling a function in C language? For example: Fixed int var_01 = funny (); When I use it in VC6, it succeeds. But it failed in GCC 4.6.1. it's so weird. I think this experiment is illegal in C89? Or is the reason for this reason? In C99 and as far as I know in C89 draft C99 standard section 6.7 .8 Start : An object with a static storage period from the draft must be either a continuous expression or string literal. All expressions in the initialization for the constant frequency object will be constant expressions or string literals. > When they are contained within a subexpression that has not been evaluated. 9 8) Both GCC generates the same error using -std = c99 and -std = C89 , notice that I am using the following flag -Wall -Wextra -pedantic . This version of the Visual Studio compiler does not work in C ( ) in modern versions, but it works in C ++. That's why you may

programming languages - What does Crockford mean: "Javascript depends on global variables for linkage"? -

In the javascript: good parts , Crockford writes "Dependent on global variables for JavaScript Linkage "I understand that in Javascript if you declare a variable outside the function, then it is" in "- which means that you can access it anywhere in the program. I understand how many limits in the C ++ program you can reach a variable (regardless of its scope). With this, what does corkford mean? I think what they mean is that global variables are how you communicate with libraries. Jquery uses global variable $, underscore usage_, etc. You link to LBS with the global name.

php - 2 line breaks automatically added -

I put the code in php, and put the code on the server. But my colleagues told me that I broke the line several times. And with my PC, I saw the code I had already posted on the server (I use Mac.) A lot of extra line breaks have been added automatically. Even though I did not leave many line breaks. I think if I put a line break, then somehow it will convert it in two rows. In my environment, I can see exactly as I write. I think there may be some compatibility problems between them and me. I use: Mac OS X, SublimeText2, Tasty FTP. He uses: Windows 7, SublimeText2, WinSCP. I searched but I could not find the exact answer. Any ideas? Because of this, a different line is being concluded, Mac OS X uses the Unix convention of a new line Windows uses the carriage return, lined at the end of the lines. To view these letters, open a file in the hex editor. You can convert text to platform conference. There are tools for this that some editors can control different end

c# - Display Text Constantly -

I am very new to C # programming, and my main goal is to create simple text-based games. I am currently my first problem, which is the performance of the player's health and attack and the values ​​of monster health and attack. I want to display the value at the top of the console and every time the health of the player or the monster is increased or reduced. The problem I have is that I am currently limiting this exhibition from the rest to a different function, and when I run the function, I can only show it. Like I said, I am very new, so my code is probably more amateur. while (monster health> 0 & amp; amp; amp; amp; amp; player; health upgrade & gt; 0) {DisplayStats (); Console.light line ("You can either 'attack' or 'protect yourself from the monster.'); Console. LightLine (" Invasion "+ + PlayerAttack Upgrade + reduces the health of the monster and reduces the health of yourself The value of the monster attack will be cut

c# - Kill event thread generated by lambda expression -

I would like to kill the first thread on the second click, then rebuild it. My goal is only a tangent thread in existence. I believe that I can do such a thread for example with a representative's supply? But I have been roaming for hours without any luck and have slipped it with the hours. Can someone translate my anonymous lambda expression into something with a representative, so that I will recognize and kill my thread after starting it? I hope my question comes up, I am still learning ... Thanks Timer timer 1 = new timer (); Timer 1 Interval = 1000; Timer1.Start (); Private Zero Button 1_Click (Object Sender, EventAgds E) {// If I click on the button twice, how do I kill the first tick thread before creating another? Timer 1 Tick ​​+ = (Sender2, E2) = & gt; Timer1 stopper (sender2, e2, 1, "text"); } Private Zero Timer 1 Volt (Object Sender, EventErgus E, Int Number, String Text) {// Work with Numbers and Text} You have created a variable to store

javascript - Where is self.emit emitted? -

Image
I am using IRC NPM and my bot is not connected to IRC server and I did not get any errors. So I went to the source code to know what was happening. Apparently the function was running where it emitted going? And I found this: util.log ('got connection' 'closed' event '); For whom is this logged?

Can I use Self-Modification in Android? -

When I read Google play policy, I have a question in this sentence. Google Play can not modify, change or update its own APK binary code using any method other than Google Play's update mechanism. Does this mean that developers can not use self-modified code ?? For example, when users run my app for the first time, my app modifies their binary code and if I use it, do I have my app Can I use auto-modified code? Although policy is not allowed, if Google does not know us, then we are safe. There are a few ways to dynamically load the binary code AKA DEX file . So at the runtime you download the decks file and run it. It is very famous that you can find some information here The Facebook app uses dynamic class loading because the number of methods in their code is more than 64K, so they divide their code into several DX files It will be dynamically loaded at run time. So if Facebook can be there, then I think we too want to move forward. Facebook has to face the

javascript - Jquery Load Function with Error Message if taking too much time -

Is there any way to handle loading time, I mean when the jquery load function takes too long, Show the message. The following code is working perfectly. var href = $ (this) .attr ('href'); . $ ('# Load') load (href); Please help me! Thank you. please try it, read more var href = $ (This) .attr ('href'); $ Ajax ({url: href, error: function () {// will fire on timing}, success: function () {// do something}, timeout: 3000 / set timeout to 3 seconds});

java - Determine size of whitespace in ImageView -

Image
I have a floor plan, which is centered in an ImageView. The aspect ratio of the image is preserved, so there is some space on either side of the image (shown in red color). How can I determine the width of this red space in pixels or DPs? & lt ; RelativeLayout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: Tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" Android: paddingLeft = "@ dimen / activity_horizontal_margin" Android: paddingRight = "@ dimen / activity_horizontal_margin" Android: paddingTop = "@ dimen / activity_vertical_margin" Android: paddingBottom = "@ dimen / activity_vertical_margin" tool: reference = "MyActivity "Android: Background =" @color / red "Android: orientation =" vertical "& gt; & Lt; Android: layout_height = "wrap_content" on A

sqlite3 - Load custom qsqlite instead of Qt's qsqlite plugin -

I have created my own qsqlite.dll and I want to use it in QT project instead of Qtq Qsqlite plugin I am I do not want to replace QT's qsqlite.dll. how to do this? What should I change in my PRO file to use my own qsqlite.dll and qtqqlite.dll of qt should not be loaded?

vim plugin - Vim airline displaying issue -

Image
I was able to install Vim-airline and sometimes even can not appear like I Powerline it for some reason. Any help would be appreciated. .vimrc Set to noswapfile pathogen # infected execute () syntax sets = 2 sets lazyredraw let g: airline_theme = 'powerlineish' let g: airline_enable_branch = 1 let g: airline_enable_syntastic = 1 Let g: airline_bird_sap = '⮀' g: airlines_bound_sap = '⮁' g: airlines_write_sap = '⮂' please: airline_right_alt_sep = '⮃' f please: airlines_braka_profix = '⭠' g: airline_prodolini_miss = '⭤' g: airline_line column_prefix = '⭡' highlight stable ctermfg = yellow Even so the The breakfast.

c# - Sharing a memory map simultaneously between processes -

After overcoming some other difficulties, now I'm stuck with this (probably simple) problem. My goal: At the same time Many examples of my application are running on the same file and the execution (Read and write)> Solution (What do I have to do): Use memory-mapped files to speed up execution. When the app starts, it tries to call CreateFromFile () (I understand that if the file is already mapped by someone else, it will not do anything, but "handle" back ), Then does the income to do its job on the file. / Li> The problem is that I try an IOException ( the file is being used by another process ) when another process for CreateFromFile () is first I have done the same and therefore the memory-frame file is not disposed of the object. I can, in principle, use mute and repeat the items using the statement. I can, but it dumps the disc to the material, f The slow performance and is going to defeat the purpose. What is the probable solution to my

php - Can't fix error using codeIgniter -

I'm just new using Codeigner and I wanted to create a simple login with sign up and session. This is my code ... & lt ;? Php if (define ('basepath')) exit ('no direct script entry is allowed'); Class login verification expands CI_Controller {function __construct () {parent :: __ construct (); $ This- & gt; Load-> Model ('userModel', '', TRUE); } Function index () {$ this- & gt; Load-> Library ('form_validation'); $ This- & gt; Form_validation- & gt; Set_rules ('username', 'username', 'trim | required'); $ This- & gt; Form_validation- & gt; Set_reales ('password', 'password', 'trim | required | callback_ath_database'); If ($ this-> form_validation-> Run () == FALSE) {$ this-> Load-> View ('login_view'); } Else {redirect ('home', 'refresh'); }} Make this_database ($ password) work {$ username = $ this- & gt; Input-&

java - Is there a way to zoom an SWT Composite and its' children? -

Image
I would like to develop an overall control, which ideally will be on its own scale in the allotted size. I want to display a numeric value and 3 LED type images. As the size of overall growth, the font size of the value and the size of the images proportional increase. I am reminded that there is something like that in .NET's WPF. Is there any way to do this in SWT? (I know that I can add a setting page and set font size there, just looking for a way to do it automatically) so what can you do, a canvas / Code>, drag your image . S and apply the scale to the text and width and height itself This scale varies depending on the mouse wheel movement. Here is an example: Private static float scale = 1; Private static font font; Public stationary zero main (string [] args) {final display display = new display (); Last Shell Shell = New Shell (Display); Shell.setText ("StackOverflow"); Shell.setLayout (new FillLayout ()); Last image image = new image (di

Android soft-input does not disappear when moving back with ActionBar -

I'm using Android searchwid on search search for searches I However, when users Returns with the actionbars (), the soft-input stays on the screen, though the activity android: windowSoftInputMode = "stateHidden; adjusted unspecified" As descripbed It seems that it works only on the move, and is not coming back. Problem: There may be many activities called search activity and stateAlwaysHidden may not be appropriate for them (in other words: I do not know the behavior of all other activities. ) UPDATE: Giving code, actually just the action. Bars. SetDisplayHomeAssup Disabled (true); Protected void (bundle saved instenestate) on @OverrideCreate {.... if (Build.VERSION.SDK_INT> = Build.VERSION_CODES.HONEYCOMB) {// Action Bar ActionBeer Actioner = Get Actionbar (); If (null! = ActionBar) {// Action Bar icon Enable Back Navigation Action Bar.setDisplayHomeAsUpEnabled (true); }} ....} UDATE 2: @ Override public boolean-on-options item selected

always permit selected parameters in strong parameters in rails 4.0.8 -

I'm always trying to allow a specific parameter 'format' in strong parameters. I am currently using Rail 4.0.8 It has been included in the rail. 4.1 Rail guide suggests that it is configurable < P> config.action_controller Always_permitted_parameters =% w (controller action format) I'm trying to find a way around in Rail 4.0.8. Can it be achieved with some port patch?

java - JTable into JScrollPane, without Header -

जब मैं एक JTable को एक JScrollPane में जोड़ता है, तब तालिका स्वतः क्यों आती है? >। मैं एक स्क्रॉलपैन में हेडर के बिना तालिका जोड़ना चाहता हूं। कैसे करें? पीएलएस संक्षिप्त उत्तर है, आप (यह स्वचालित रूप से नहीं कर सकते)। आप क्या कर सकते हैं JScrollPane # setColumnHeaderView कॉल करें और इसे व्यूपोर्ट में JTable सेट करने के बाद null पास करें ... कॉलम हेडर को JScrollPane पर JTable के लिए लागू किया जाता है जब तालिकाओं addNotify विधि कहा जाता है। इसे एक कंटेनर के जवाब में कहा जाता है, जिसमें टेबल शामिल है, जिसे डिस्प्लेबल कंटेनर (एक दृश्यमान फ़्रेम की तरह) में जोड़ा गया है। यह फिर कॉन्फ़िगर करेंसंपूर्णप्राइजिंग स्काईपोलन < P> नवीनीकृत उपरोक्त कोड मानता है कि पहले से ही एक कंटेनर में JScrollPane और JTable जोड़ा गया है प्रदर्शित करने योग्य, यह हमेशा मामला नहीं हो सकता है आप, वैकल्पिक रूप से, JTable # configureEnclosingScrollPane विधि को ओवरराइड कर सकते हैं और जब आप उन्हें चाहते हैं तब हेडर कॉन्फ़िगर करें ... @Override संरक्षित शून्य कॉन्फ़

Camera Record , capture image, facedetection ,in background user can not see app is capturing him in android? -

I have a difficult concept. I can not understand whether this is possible or not. What do I want? I have an application that shows pictures and video is released. Now I want to start the camera in this application background and I want to see how many people are watching this picture and video. How long do people see this image / video with the person or person in seconds or minutes and store them in the database. People are happy, angry, people like this, people do not like this person the age of male / female person. Using face recognition. Suggestions are welcome thanks

how to use i18n in pdf using itext in java -

I am using Hindi language to display the header content of the table in pdf, but this is the header part of the table Displays empty cell in / P> I have created the following: HTTP server response response = servletActioncontext.getresons (); Document document = new document (); BytereanOutOperputStream buffer = new byteOnputstream (); PdfWriter Author = PdfWriter.getInstance (document, buffer); Writer.setBoxSize ("art", new rectangle (36, 54, 55 9, 788)); Document.open (); PDFPTable lineItemTable = new PDFPTable (cellvel); LineItemTable.setHeaderRows (1); PDFPCL Number 1 = New PDFPCL (new phrase ("no", bold_image)); Num1.setHorizontalAlignment (Element.ALIGN_CENTER); Num1.setBackgroundColor (BaseColor.LIGHT_GRAY); LineItemTable.addCell (number1); PDFPCL Lineline = new PDFPCL (new phrase ("")); Linewol = new PDFPCL (new phrase (HindiEtitin name, bold_nimel)); Lineval.setHorizontalAlignment (Element.ALIGN_CENTER); Lineval.setBackgroundColor (Base

objective c - to expand or collapse rows at different sections in iOS 7 -

I am working on an application where I need to expand the collapse rows in different sections. Initially I tried to expand the rows falling with one section. Now I want to be the same in more than one class. This is my code - (NSInteger) numberOfSectionsInTableView: (UITableView *) tableView {// Return sections. Return [MySection Count]; } - (NSInteger) TableView: (UITableView *) table view numberofrose injection: (NSInteger) section {NSArray * rate = [mysection objectAtIndex: section]; Return [Myero Count]; } - (Zero) TableView: (UITableView *) Table View was selected SelectandPath: (NSIndexPath *) indexPath {if (selected symbol == indexPath.section) {if (selectedIndex == indexPath.row) {selectedSection = -1; SelectedIndex = -1; [Reload tableview atAndExpath: [with NSArray array object: indexPath] with RAnation: UITTViewAnimationFed]; [Tableview reload section: [NSIndexSet indexSet with Index: IndexPath. Section] R Animation: UITableViewRowAnimationFade;; Return; } // If the

Instagram API request for posting media using web app in rails -

Does the Instagram API allow to post media objects (photos) using the web app? Want to post some photos on the Instagram site using Rail API in our web application. There is no way to do this, so it will be useful. If it is not possible, then do we have some JS facility that allows to share the data ?, as if allowing pin_it_js to use is like Pinterest. Instagram allows only fetching information (GET) [1] However there are hooks that you can use on Instagram app Allowing users to view a predefined image [2]. There are also libraries to help you with your web app [3]. [1] - [2] - [3] -

sql - Change user during session through a query -

I am currently logged in as an administrator on an Oracle database and I can change my session user with a session Want to Is this possible? Unfortunately, with ALTER SESSION SET CURRENT_SCHEMA = Schema Name & gt; (as suggested in the comments) does not switch the user too, it allows you to avoid specifying a schema in your SQL statements during the session. In Oracle Database, users and schemas are different, but each user has a schema. However you can apply your needs. You grant privileges for the role and you can use the SET ROLE statement during your session.

on converting pdf into image the images are fading out -

Image
I am getting high quality image in PDF and when converting this into the image, the images are fading out. (PDF file using PDFRENDER 0.9.1) I am getting the image in PDF form like this "Enter image details here"> is shown as >> I com.sun.pdfview at com.sun.pdfview.function.FunctionType4.parse (FunctionType4.java:828) Error Unsupported function type 4. Getting. Function.PDFFunction.getFunction com.sun.pdfview.colorspace.PDFColorSpace.getColorSpace (PDFColorSpace.java:176) com.sun.pdfview.pattern.PDFShader.getShader at (PDFFunction.java:168) (PDFShader.java:144) Com.sun.pdfview.PDFParser.doShader com.sun.pdfview.PDFParser.iterate (PDFParser.java:633) at (PDFParser.java:1145) com.sun.pdfvie at w.BaseWatchable.run java.lang.Thread On the .run (BaseWatchable.java:101) (Thread.java:619) then this is the solution for As an exception, the PDF of OP has a unsupported function type 4 , somewhere in the context of shader colorspace definition One Type 4 Fun

vb.net - Need help for Error # -2147467259 [NEON][SCOD32.DLL][DB2]DSNT408I SQLCODE= -501 -

I am facing this issue in the VB application, when trying to open a message with this message Pop-up is coming Error # -2147467259 [Neon] [SCOD 32.DLL] [DB2] DSNT 408 IQL code = -501, Error: Any festive-looking cursor or shutdown Statement is not open What can anyone suggest to resolve this issue? This application is working fine in the production environment. This problem is only coming in the following environment.

c# - how to solve error of " ExecuteNonQuery: Connection property has not been initialized?" -

con = नया SqlConnection (सीएस); SqlCommand UpdateCommand = नया SqlCommand ("अपडेट स्टॉक सेट करें ConfigID = @ConfigID, Quantity = @Quantity, TotalPrice = @TotalPrice, StockDate = @ StockDate, जहां स्टॉकआईडी = '+ + + txtStockID.Text +"' '); UpdateCommand.Parameters.Add ("ConfigID", SqlDbType.Int) .Value = txtConfigID.Text; UpdateCommand.Parameters.Add ("@ मात्रा", SqlDbType.Int) .Value = txtQty.Text; UpdateCommand.Parameters.Add ("@TotalPrice", SqlDbType.Int) .Value = txtTotalPrice.Text; UpdateCommand.Parameters.Add ("@ StockDate", SqlDbType.NVarChar, 50) .Value = dtpStockDate.Value; con.Open (); UpdateCommand.ExecuteNonQuery (); con.Close (); मुझे यह त्रुटि संदेश समझ में आता है, है ना? हालांकि, आपको SqlCommand के लिए कनेक्शन प्रदान करना होगा, या तो कंस्ट्रक्टर या गुण कनेक्शन का उपयोग करके: string updateSQL = @ "अद्यतन सेट सेट कॉन्फ़िग = @ कॉन्फिग्ड, मात्रा = @ मूल्य, कुलप्रिस = @TotalPrice, स्टॉकडेट =

Calling web service asynchronously (C#) - completed event breakpoint not hit -

Can not go below this one and it is clearly some stupid, can someone please help? I am calling a web service using a C # console application, and breakpoints are never hit in the 'complete' event. Here is an example code, really simple: public static zero call () {try {ServiceReference1.GlobalWeatherSoapClient proxy = new GlobalWeatherSoapClient (); Proxy GatecityJackCountry + Proxy_TatesBackCounter Expiration; Proxy.GetCitiesByCountryAsync ("France"); } Hold (FaultException defect exception) {var error = faultException.Message; }} Fixed zero proxy_GetCitiesByCountryCompleted (Object Sender, GetCitiesByCountryCompletedEventArgs E) // Here some exceptions to execute some new exceptions (); } then breakpoint on the line throw the new NotImplementedException; The hit never happens. However, I add an extra line after the actual asynch call: System.Threading.Thread .Sleep (5000); .. The breakpoint is recovering now. Can anyone tell me what is ha

sql - mySQL query between two dates and two times -

I want to query a mySQL table to extract data between two dates and two times. I know how to do this for a "datetime" column using the "middle" column, but my columns are a "date" column and a "time" column. From my range "Day 1" to 15:30 on day 1 + 1 day at 15:14 So far, I can get the following category (which works ): Select time, intraday_values ​​close to WHERE date = "2005-03-01" and the time between "15:30" and "23:59" But I have to explicitly include 2 dates and twice I have tried the following but get an error: SELECT time, date = "2005- 03-02 "and between time =" 15:30 "and date =" 2005- intraday_values ​​close-to-03-02 "And time =" 15:14 " Can someone help me in preparing questions correctly? Thank you very much Not sure if your date field is indexed or not. If they are, then the "Concet" example others who have given them

matplotlib - python randomwalk not walking -

My professor has given me this code and the only part I think is the TODO area. I'm still new to Python and This type of project has never touched, so I am confused instead. All this plot is to get the plot graphed image. import math, random, pylab class space (object): def __init __ (self, x, y): self.x = float (x) self Y = float (y, def) (self, xc, yc): return location (self.x + float (xc), self.y + float (yc)) def getCoords (self): self return. Def DDICCT (Self, Other): Bull, Oye = Other.Gate Cores () xDist = self.x - Ox yDist = self.y - Oye Return Mathematics.Critt (xDist ** 2 + yDist ** 2) Class CompassPt ( Object: Possibles: self.pt = pt else: raise ValueError ('object'): possibles = ('n', 's', 'e', ​​'w') def __init __ (self, pt) Def move (self, dist): if self.pt == 'N': Return (0, dist) elif self.pt == 'S': return (0, -dist) Elif self .pt == 'E': Return (dist, 0) elif self.pt == 'W': Returns (-Di