Tuesday, 15 January 2013

javascript - js hide function -


When the page loads (the first dropdown (div position id) is dynamically populated with mysql db) or the user chooses unemployed - EI, Div Status_sub_6 shows the second selection statement from the first dropdown box.

Mys Right The show function fits the change, but the function hides the second dropdown list when the page is loaded, even if the dynamically populated values ​​of the first selection (status id) match the comparison criteria.

I'm sure I need anload job which overrides the following .js code but really appreciates some help in creating additional code.

Javascript:

  $ (document) .ready (function () {$ ('# status_sub_6'). Hide ($); $ ('# Status_sub_6'). {} ($ ('(# $ Status') and {$ ('# conditionIID option: selected'). ('# Status_sub_6'). Hide ();}}})}};    

You can do this trigger after a change event is correct.

  $ (document) .ready (function () {... // your Current code ... $ ('# statusID'). Trigger ('change'); // one change trigger}}    

java - Spring MVC form submit using modelAttribute -


मेरे पास कुछ ऐसा है

  @RequestMapping ("/ showRegister") सार्वजनिक स्ट्रिंग showUserRegistrationForm ( मॉडलमैप मॉडलमैप) {modelMap.addAttribute ("उपयोगकर्ता", नया UserBean ()); वापसी "रजिस्टर"; } @RequestMapping ("/ रजिस्टर उपयोगकर्ता") सार्वजनिक स्ट्रिंग रजिस्टर उपयोगकर्ता (@ मॉडल एट्रिब्यूट ("यूज़र") यूज़रबीन यूज़िनबीन, बाइंडिंग परिणाम परिणाम, मॉडलमैप मॉडलमैप) {System.out.println (userBean.getPassword ()); वापसी "रजिस्टर"; }   

मेरे कोड में।

उपरोक्त काम पूरी तरह से अब मान लीजिए कि मैं फॉर्मल से मॉडल डेटा को कई तालिकाओं में सहेजना चाहता हूं, जिसमें प्रत्येक के पास अपना पॉजो क्लास होगा। तो कोड कैसे होगा, जैसा कि सिर्फ यूजबेनेन को मॉडलैट्यूडिट के तौर पर नहीं बल्कि अन्य वर्गों के रूप में भी प्राप्त होगा। क्या मुझे दोनों वर्गों से डेटा युक्त एक नया पॉजो बनाना होगा या फिर एक अन्य तरीका है।

संपादित करें

मैंने डीटीओ के बारे में पढ़ा है। लेकिन क्या यह पीओजो के पुनरावृत्ति नहीं करता है? हम इसके बजाय 2-3 POJO के मिश्रण का उपयोग नहीं कर सकते।

आप एक "फ़ॉर्म" सेम, और सदस्य के रूप में अपने UserBean और किसी भी अन्य pojos जोड़ें। मैं वास्तव में ऐसा करने के लिए पसंद करता हूं, क्योंकि इससे जटिल सत्यापन आसान और अधिक आत्म निहित होता है।

  सार्वजनिक वर्ग MyFormBean {निजी यूजरबीन userBean; निजी MyOtherBean अन्य बीन; // जरूरत के रूप में getters और setters जोड़ें}   

तो अपने फार्म को अपने उद्देश्य में नीचे ड्रिल करने के लिए सही पथ का संदर्भ देने की जरूरत है यदि आपके पास ऐसा कुछ था:

  & lt; फ़ॉर्म: इनपुट पथ = "नाम" />   

आप इसे

  & lt; रूप में बदल सकते हैं: इनपुट पथ = "userBean.name" / & gt;    

view - Unfortunately, your application stopped working -


In the alloy structure, I want to dynamically add the view defined in an XML file, but for any other view Not bound on the other.

Container I Index. I'd like to fill in XML:

  & lt; Scrollview id = "ScrollBlilan" show paging control = "true" & gt; & Lt; / ScrollableView & gt;   

The visual template question.xml I want to instcciate every view to go into the scrollable view:

  & lt; Alloy & gt; & Lt; Collection creation = "restructuring possible" & gt; & Lt; View ID = "question dialogue" class = "container" & gt; & Lt; Label id = "question text" / & gt; & Lt; Button ID = "button next question" & gt; The question suivante & lt; / Button & gt; & Lt; / View & gt; & Lt; / Alloy & gt; Finally, the controller index.js is a collection example:  
 for  (var i = 0; i & lt; questions.length; I ++) {$ .scrollableBilan.add (Alloy.createController ('question', questions.at (i))); }   

This creates the following message whith crashing my application: 'Unfortunately, your application has stopped'. I already get this error, always trying to add a scene dynamically using Alloy.createController.

The behavior is fine when creating a view with Ti.UI.createView, but I want to use MVC ..

Any help is welcome!

You are passing it to a model object, instead try pass it a JSON object :

 for  (var i = 0; i & lt; questions.length; i ++) {$ .scrollableBilan.add (Alloy.createController ('question', questions.at ( I) .toJSON ())); }   

Alternatively you can do this in the XML file and with the datacollection attribute, keep something like this in your index.xml: & lt; Alloys & gt; & Lt; Collection creation = "question" & gt; & Lt; ScrollableView id = "scrollableBilan" showPagingControl = "true" dataCollection = "ReponsePossible" & gt; & Lt; View ID = "question dialogue" class = "container" & gt; & Lt; Label id = "question text" text = "{query}}" & gt; & Lt; Button ID = "button next question" & gt; The question suivante & lt; / Button & gt; & Lt; / View & gt; & Lt; / ScrollableView & gt; & Lt; / Alloy & gt;

In your question model the question text field needs to be an attribute.

python - How is waiting for I/O or waiting for a lock to be released implemented? -


I'm curious. I was programming in Python for years. When I run a command that blocks the I / O (whether it is read on hard disk or is a network request), or blocks at the time of release on the lock, how is it implemented? How does the thread know that to start GIL again and start over again?

I wonder if it has been continuously tested and implemented ("Is there a production here? Is it right now? What about now?") Which I think is meaningless, or alternative In a more beautiful way.

There is no need to check repeatedly for I / O termination or for release of lock .

An I / O fullness, a hardware-driven driver is prompted, or because of any other thread disturbed by the software, lock releases, threads were waiting instantly on those operations, And were quite likely to walk, and were preparing for another thread during walking. Essentially, after being in the middle of software or hardware, the OS can decide to embed - compared to being interrupted can return to a different thread.

High I / O performance of this mechanism, eliminating any polling or investigation, is a matter of very little time.

graphics - Should I implement matrix transformations over changing object coordinates? -


I have a set of objects that can be scaled and translated. Let's assume that the user selects an object and draws it in some position. I was thinking of implementing it in two different ways: either changing the coordinates of the object while changing the position of the mouse, or the change matrix is ​​changing. Is one of these implementations better than the other? My main issues are:

  • Display
  • Code organization
  • Scalability

    Objects have some coordinates, and the way you see the objects, there is a fixed frame in context. I think it's not better to mess with your coordinates, and instead of just changing the matrix that "I'm moving the object" from "Object is here" here. It is very clean, according to the execution, you have to apply for each object conversion, so that you can do it once only once. To It is better to keep things "related to something physical" in the code organization's perspective; And from a scalability perspective, whenever a user turns into a visual, all the objects are not necessarily curious to implement the change - you do convert the objects when you present them, so if you have a Can not leave the move; If you have not saved some of your items during each stage, then you will be in trouble soon. Finally, applying several changes in the same object accumulates errors.

    Conscience, but obvious preference, I think!

xcode - Convert from 1280x720 to UIView dimensions -


I think the AVCaptureDevice app from the sample buffer representative marks the QR finder's app. Now I am trying to put the box on the screen to cover QR numbers. However, I'm having trouble converting between 1280x720 pixel resolution and cameraView size

. I have a method that converts a CGRect on the basis of these standards (and the fact that I'm trying to write the visual coordinate system is inverted-down), but it will not work in anything with the orientation of the camera device. Could. Here is my code for the converted method:

  - (CGRect) convertRect: (CGRect) oldRect From90DegreeRotatedCameraSize1280x720ToUIViewSize: (CGSize) viewSize {// Remember that we are using the size aspect of gravity Double filling xscale = visual system With / 720; Double yScale = viewSize.height / 1280; If (X of the X scale & lt; yScale) CGRectMake (oldRect.origin.x * X scale, viewSize.height - oldRect.origin.y * X scale, oldRect.size.height * X scale, oldRect.size.width * X Scale) return; Any other return CGRectMake (oldRect.origin.x * yScale, viewSize.height - oldRect.origin.y * yScale, oldRect.size.height * yScale, oldRect.size.width * yScale); }   

Has anyone found a beautiful to solve this relatively simple special coordination problem?

Edit -

I have an NSLog orientation of the connection video and it has come to know that it never changes from 1 (which I think is based on this picture orientation It should be easy to find solutions, because coordinates do not change in different tilt.

Any ideas, cite the community?

explained this:

IOS fills a view, it focuses on it So that both sides are cut off. To transition between the visual coordinates, you have to scale and then translate into the direction that was cut:

  Return CGRectMake (oldRect.origin.x * xScale, oldRect.origin. Y * X scale - (1280 * X scale - viewSize.height) / 2, oldRect.size.height * X scale, oldRect.size.width * yScale);    

ember.js - What Does This Ember Exception Mean? -


I am having the following error when creating a new record / model:

  Uncheck error : Event `Willset Property` & lt; Attempted to control App.NewsItem: ember361: null & gt; While in the state rootstate.loaded.created.inFlight , name: bodyHTML}   

What does this mean?

It looks like an example of a type of model App.NewsItem While saving it ( rootstate.loaded.created.inFlight ). I do not know why I got an error on the creation.

javascript - How to assign the value of 0 to a variable? -


जावास्क्रिप्ट फ़ंक्शन 1:

  var count = 0; फ़ंक्शन myFunction () {count ++; document.getElementById ( "गिनती") innerHTML = गिनती। }   

जावास्क्रिप्ट फ़ंक्शन 2:

  फ़ंक्शन डेमो () {var y = document.getElementById ("count")। InnerHTML; अगर (y == "0") {चेतावनी ("रीसेट करने के लिए कुछ भी नहीं है।"); } Else {var count = 0; चेतावनी ( "रीसेट करें।"); // वैकल्पिक कोड मैं उपयोग किया है: document.getElementById ("count")। InnerHTML = "0"; }}   

HTML कोड:

  & lt; a href = "जावास्क्रिप्ट: myfunction ()" & gt; यहां क्लिक करें & lt; / a & gt; & Lt; p & gt; कुल: & lt; span id = "count" & gt; 0 & lt; / span & gt; & lt; / p & gt; & Lt; बटन onclick = "डेमो ()" & gt; रीसेट & lt; / बटन & gt;   

क्या इस कोड में 0 को वैरिएबल रीसेट करने का कोई तरीका है?

मैंने चर count को शून्य पर रीसेट करने की कोशिश की है document.getElementById () का उपयोग करके और = 0; को चर में जोड़कर इन कार्यों से न तो उदाहरण के लिए, यदि उपयोगकर्ता लिंक पर क्लिक करने के लिए गिनती 1 से बढ़ेगी। जब वे रीसेट बटन पर क्लिक करेंगे तो इसे 0 पर रीसेट करने के लिए दिखाई देगा (जब तक `var count = 0 का इस्तेमाल नहीं करते;)। हालांकि, अगर उपयोगकर्ता लिंक पर क्लिक करने के लिए फिर से गिनती 2 मान लौटाएगा, क्योंकि यह केवल पिछली बार बढ़ाई जारी रख सकता है।

मुझे खेद है अगर यह पहले ही कहीं का उत्तर दिया गया है अन्य, लेकिन = और ++

दो चीजें:

  1. var से छुटकारा पाएं जहां आप चर को रीसेट करते हैं यह आपको एक ही नाम के साथ एक अलग स्थानीय चर प्रदान कर रहा है।

  2. एक चर नाम के रूप में "गिनती" का उपयोग करना, यदि यह वैश्विक है, जिसकी आईडी DOM में "गिनती" है एक भिन्न वैरिएबल नाम या एक अलग आईडी का उपयोग करें, या सुनिश्चित करें कि चर वैश्विक नहीं है (पोस्ट कोड से नहीं बता सकता)।

php - Issue with hyperlinks when pulling Facebook post into web page -


I am using the following script to draw the latest post from my Facebook page.

It does, it was expected, however, if there is a hyperlink in the Facebook post, the link is distorted & amp; no longer works. Try it out if you can use your code - make sure curl is installed.

  & lt ;? Php $ url = "http://www.facebook.com/feeds/page.php? Id = 466171083413035 & format = json"; // duplicate header and fake user agent is sent to the curl function disguise_curl ($ url) {$ curl = curl_init (); // Setup Header - The same header was divided under Firefox version 2.0.0.6 / / because the line was too long $ header [0] = "Accept: text / XML, App / XML, App / XHTML + XML, "; $ Header [0]. = "Text / html; q = 0.9; text / plain; q = 0.8; image / png; * / *; q = 0.5"; $ Header [] = "cache-control: max-age = 0"; $ Header [] = "Connection: keep-alive"; $ Header [] = "keep-alive: 300"; $ Header [] = "accept-charset: ISO-8859-1, UTF-8; Q = 0.7, *; Q = 0.7"; $ Header [] = "accept-language: en-us, n; c = 0.5"; $ Header [] = "Predama:"; // Let the browser keep it blank Curl_setopt ($ curl, CURLOPT_URL, $ url); Curl_setopt ($ curl, CURLOPT_USERAGENT, 'Mozilla'); Curl_setopt ($ curl, CURLOPT_HTTPHEADER, $ header); Curl_setopt ($ curl, CURLOPT_REFERER, ''); Curl_setopt ($ curl, CURLOPT_ENCODING, 'gzip, deflate'); Curl_setopt ($ curl, CURLOPT_AUTOREFERER, true); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ curl, CURLOPT_TIMEOUT, 10); $ Html = curl_xax ($ curl); // Turn curl order on curl_close ($ curl); // Connection Close $ html; // And finally, return $ html // uses the function and displays the text with the website $ text = disguise_curl ($ url); $ Json_feed_object = json_decode ($ text); $ I = 0; Foreign exchange ($ json_feed_object-> entries as $ entry) {resonant "<< 2> {$ entry-> title} "; $ Published = date ("G: IAFJ, Y", stratotem (entry-> published)); Echo "& lt; small & gt; {$ published} & lt; / small & gt;"; $ Content = preg_replace ("/ & lt; img [^ & gt;] + \ & gt; / i", "", $ entry-> content); Echo "& lt; p style = 'word-wrap: break-word;' & Gt; {$ content} & lt; / p & gt; "; Echo "& lt; hour / & gt;"; $ I ++; If ($ i == 1) {break}}}? & Gt;   

Edit My hyperlink appears in the form of: & lt; A href = "/ l.php? U = http% 3A% 2F% 2Fwww.empireonline Com% 2Fnews% 2Fstory.asp% 3FNID% 3D36903 & amp; amp; amp; amp; amp; A = AxFajetite 9A & amp = 1" target = "_ Blank "rel =" nofollow nofollow "onmouseover =" linkships link link (this, & amp; quot; http: \ / \ / www.empireonline.com / news \ /story.asp NID = 36,903 & amp; quot;) ; "Onclick =" LinkshipsSync LinkSpeck (this, & amp; amp; quot; \ / l.php? U = http \ u00253A \ u00252F \ u00252Fwww.empireonline.com \ u00252News \ u00252Fstory.asp \ u00253FNID \ u00253D36903 & amp; H = = 1 & amp; quot;) of AXFJETIVE 9A & amp; amp; amp; amp; quot;); & gt; Http: //www.empireonline.com/news/story.asp NID = 36,903 & lt; / A & gt; & Lt; Br / & gt; & Lt; Br / & gt; & Lt; A Href = "http://www.facebook.com/photo.php?fbid=597077380322404&amp;set=a583314588365350.145103.466171083413035&amp;type=1&amp;amp;amp;relevant_count=1" id = "" title = "" Target = "" onclick = "" style = "" & gt; & Lt; / A & gt;

Has anyone ever come up on this issue before? Is there a solution?

Many thanks for any indication.

My bad

The string I wanted on any URL Used to add Facebook.

This is my code, if it helps someone else:

$ content = str_replace ('href = "/ l.php', 'href =" Http://www.facebook.com/l.php',$content);

c++ - implement queue with linked list -


I have written the code to execute the queue with a written list, but there are some bugs in this that I can not understand. When I first press a item in the queue, it works, but when I try to push the other, I get a runtime error Can you please help me? Thanks a lot! The following code is:

  #include & lt; Iostream & gt; using namespace std; Template & lt; Typename T & gt; Structure node {t data; Node * next; Node (td, node * n = null): data (d), next (n) {}}; Template & lt; Typename T & gt; Class HEQ {Private: Node & Lt; T & gt; * First; The node's & lt; T & gt; * Last; Public: muke () {} zero push (t da) {if (first == faucet) {first = new node & lt; T & gt; (Da); Last = first; } And (last-> next = new node  (da); last = last-> next;}} zero pop () {if (last! = NULL) {node & lt ; T & gt; * Temp = First; First = Next> Delete Temp;}} Zero Front () {If (First! = Null) COAT & lt; First & gt; Data;} Bool Isempty () {last last == NULL;}}; int main () {myqueue  int> q.push (1); q.push (2); q.front (); / * Q.push (3); q.push (4); q.push (5); Court & lt; q.front ();    

Your first and last points are undefined, so your undefined behavior is members Get started with the initial list:

  myqueue :: myqueue (): first (tap), last (faucet) {}    

ios - Why does this for loop create a black empty rectangle in between -


  - (शून्य) addBackground {CGSize winSize = [सीसीडीसीटर साझा डायरेक्टर]। WINSize; फ्लोट मैक्सरेच = 0; // लूप (इंट लूप टाइम्स = 0; लूप टाइम्स और लेफ्टिनेंट; 2; लूप टाइम्स ++) के लिए 3 बार {// छवियों के लिए बैच नोड्स में जोड़ें (इंट्राईज संख्या संख्या = 1; छवि संख्या संख्या 13; छवि संख्या ++) {CCSprite * background = [CCSprite * NSString stringWithFormat: @ "national_scenery_part% d.png", imageNumber]]; Background.position = सीसीपी ((winSize.width / 2) + मैक्सरेच, winSize.height / 2); [आत्म जोड़बिल्ड: पृष्ठभूमि ज़ेड: 0]; मैक्सरेच = मैक्सरेच + पृष्ठभूमि कंटेंट साइज़.विड्थ; } // एंड्रॉइड लूप टाइम्स लूप}}   

छवि # 7 इसकी मूल आकार के बारे में 1/4 के बारे में एक पतला आयत के रूप में दिखाई देती है। आपके बाह्य पाश के लिए लूप का दावा 3 गुना है, लेकिन लिखित रूप में केवल दो बार निष्पादित किया जाएगा। क्या आप जो चाहें?

java - Why use heap instead of binary tree when implementing priority queue? -


It seems that the only advantage of a heap on a binary tree is to find the smallest object in the stack in the complexity of o (1) binary In the tree o (log (2) instead of n (1).

When applying the priority queue you will need to delete the smallest item of each from the data structure. The complexity of the two stacks (log (2) N). The removal of obesity from a tree can be more complex .

My question is, use the heap rather than binary tree (which is simple in this case) when applying the priority queue?

Binary Tree Matters The worst case complexity will be o (n) when the binary tree is converted into an array whereas it remains oh in the heap (log). You can use a balanced binary tree like red hair or avel, but then It becomes more complex and more memory Required.

json - How to only append once when loading in html Ajax -


I'm loading the content from the JSON file in the lightbox. The light box opens the second HTML in that HTML I add data loaded from the JSON file to various elements. However, when I open the lightbox, I want to add once, how can I do this?

  $ (document) .on ('click', '.mch-overlay-info', function (e) {e.preventDefault (); var href = $ (this) .attr ('Href'); $ ('# mch-overlay-content') .HTML (''); $ ('# mch-overlay') .FadeIn (300); $ ('# mch-overlay-content') Load (href, function () {showInfo ();});}); Function showInfo () {$ (".txt3 start"). Append (data [lang] ['start page'] ['text3']); $ ("Begin .txt4"). Append (data [lang] ['start page'] ['text4']); $ ("Start .txt5"). Append (data [lang] ['start page'] ['text5']); }   

I am assuming your problem that every time they add it click We do? Two options:

  1. Do not add it. To set up the content and change the old content, simply $ (). Use HTML () .
  2. Control with one variable

      var hasBeenAppended = false; // etc ... function showInfo () {if (HasBeenAppended) {hasBeenAppended = true; $ ("Start Txt3"). Append (data [long] ['start page'] ['text3']); $ ("Begin .txt4"). Append (data [lang] ['start page'] ['text4']); $ ("Start .txt5"). Append (data [lang] ['start page'] ['text5']); }}      

multidimensional array - Project Euler #11 in python -


I'm trying to do Project Euler # 11 (), but I'm incorrectly receiving 51267216 as my answer and I do not figure out why I just formatted the grid as a 2D array Let's start and then I get out of all the numbers, except the outside of 3. Then I test again for them all through 8 different directions. If I am currently the largest, then I store it as "top". Any help would be appreciated.
  import pprint def neg (l): For one: if a & lt; 0: return return true false TG = "08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50 32 98 81 28 64 23 67 10 26 38 40 67 59 54 70 66 18 38 64 70 67 26 20 68 02 62 12 20 95 63 94 39 63 08 40 91 66 49 94 21 24 55 58 05 66 73 99 26 97 17 78 78 96 83 14 88 34 89 63 72 21 36 23 09 75 00 76 44 20 45 35 14 00 61 33 97 34 31 33 95 78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92 16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57 86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58 19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40 04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66 88 36 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69 04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36 20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16 20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54 01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48 "" "grid = TGSplit (" \ n ") For a range (0, lane (grid)): i = Grid [a] i = i.split ("") B in range (0, lane (i)): i [b] = int (i ]) For the grid [a] = I category 0 (0, 19): for the range X (0, 19): For the range in the range (-1, 2): C in the range (-1 , 2): If the b grid [x + (b * 2)] [y + (c * 2)], grid [grid [x + b] [y + c], grid [x + (b * 2) )] = Grid [x] [y] If not neg (Factor): [x + (b * 3)] [y + (b * 3)]] [y + (c * 3)]]: if grid [x] [y] * grid [x + b] [ Y + c] * grid [x + (b * 2)] [y + (c * 2)] * grid [x + (b * 3)] [y + (c * 3)] if cur & gt; Top: top = except indexError: print print (top)   

You have two major problems, First: DexError:

except for

  does not capture all invalid quadruples, because python lists negative indoxing ( list [-k]  is  list ), then you wrap the quadruples around the end of the grid.  

Second,

  if b + c! = 0:   

The consideration of all does not include a direction - on the direction in which the maximum product is located. (0,0) .

Find the right position to leave the third (yes, I know I have said the above two, but this is probably not big, maybe), : boundary in C (-1, 2):

same direction twice, once (B, C) And once (- B, -C) .

sublimetext2 - Sublime text: how to customize syntax highlighting? -


I use Smarty to generate HTML templates. I currently use HTML highlighting, which is mostly okay, except that it does not highlight the smart tag, pre {foreach} I tried to install a smarter package, but it does not look very good. So basically I should be able to highlight anything with the curly bracket for the standard HTML color. Is this possible? How can this be done?

background

@MattDMo is correct that .tmTheme Is the principal file that controls file highlighting. It is an XML file with regular expressions and a series of tags that correspond to what type of syntax to regx.

You can search on GitHub and find many people who have already created a sub-text package containing the .tmTheme files. Note that you can use a package created directly for TextMate, because the subtitle text uses the same conventions. (It is true that at least as .tmTheme and .tmPreferences files are known.)

For example, The syntax was originally able to highlight the package for the ChucK language originally created for TextMate, and it used SublimeText2 to copy the file used with TextMate .tmTheme worked immediately . I just removed extra junk files and then made some changes to .tmTheme , as well as additional support for package manager

view this project here:.

Ways to Install New Syntax

Package Control

Ideally, the syntax you already want Siblam is available for download in text package control. Find in package control and install directly. (If you do not have package control yet, you will need to get it :)

Manually

If you have .tmTheme file or .tmbundle directly, you want to copy it to the appropriate package folder in the scheduled tribe. Note that there is a / package folder and a / package / user folder. The ST2 documentation suggests copying the latter because it is guaranteed to be protected, even if other packages are deleted / modified during the update in the main folder.

On OSX, that directory is: ~ / library / application support / excellent text2 / package / user /

(Note: git clone package you like, so you can easily update it.)

How to make your own

If you dig Want to customize syntax highlighting, so there are some places to get started here.

  • Brush on your regular expressions.
  • & lt; Ctrl> + & Lt; Shift & gt; + P Whenever you are viewing a file, select a word and press this key combination, then in the footer bar, you should see a series of syntax details. For example: I just highlighted a word in the SQL file that I was looking for and the response was: source.sql string.other.quoted.backtick.sql .
  • You probably would like to parse your syntax by using JavaScript / JSON rather than XML. You can get it through package control. It has commands that allow you to go back and forth between JSON (.json) and .teamtheme (XML) files.
  • A.

    Cavatt

    This may be obvious, but the usefulness of syntax highlighting is related to the color scheme selected in the text you select. (Sublime Text2 -> Preferences -> Color Scheme - & gt; ...)

    I do not have the opportunity to explore / verify in detail so far, but it seems Is that some color schemes differ between the more / less types of syntax elements.

    I highly recommend the "Monocai" color scheme (especially the "Monocai Soda" version) for this reason - it seems "Bring the colors out"

How to convert String to Date value in SAS? -


I want to change the string to date in the SAS, I tried:

  Data_null_; Monay = '05 May 2013 '; Date = input (substrate (bandage, 1,9), yammed.) ;; Put date = date 9.; Run;   

But it was not working, can it be done?

You do not need substr or tabs.

  input (monyy, date9.);    

javascript setting the size of a window -


I am trying to set a browser window for a particular size using the code given below Loading the page does not change. I see it through Firefox, but I also saw it through Safari but there is still no change. I am following a number of examples which I found online, and it seems like I am doing what I am doing in the tutorial. What am I doing wrong ????

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Style & gt; Body {background-image: url ('tri_tespic.jpg'); Background repeat: do not repeat; Background attachment: fixed; Background position: center; } & Lt; / Style & gt; & Lt; Script type = "text / javascript" & gt; Function Transitions Screen Sesses (W, H) {window.resizeTo (w, h)} & lt; / Script & gt; & Lt; / Head & gt; & Lt; Body Onload = "Change Screen Size (818,50)" & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

This top-level (i.e.) when it is not possible to resize windows popup Is)

CSS3 White to Transparent Gradient -


I'm using CSS3 and RGBA to create a white transparent shield:
  div {background-image: -Moz-linear-shield (left, RGBA (255, 255, 255, 1), RGBA (0, 0, 0, 0)); Background image: -MMS-linear-shield (left, RGBA (255, 255, 255, 1), RGBA (0, 0, 0, 0)); Background image: -WebKit-gradient (linear, 0, 100% 0, from (Rgba (255, 255, 255, 1)), (RGBA (0, 0, 0, 0)); Background image: -webkit-linear-shield (left, RGBA (255, 255, 255, 1), RGBA (0, 0, 0, 0)); Background image: -O-linear shield (left, RGBA (255, 255, 255, 1), RGBA (0, 0, 0, 0)); Background image: Linear-gradient (left, RGBA (255, 255, 255, 1), RGBA (0, 0, 0, 0)); Double-repeat: repeat-x; Filter: Presumed: DxImage Transforms. Microsoft.Gradient (StartColzerStat = 'RGBA (255, 255, 255, 1)', Endocrotstrostor 'RGBA (0, 0, 0)', Gradient Type = 1); Padding: 2rem 0; }   

Adult here:

However as you will see, the gradient is dark in the middle. I'm getting this:

receive

and I 'It is hoping:

expect

How do I Can I improve

your last step in #FFFFFF00 ( RGBA (255) Change, instead of # 00000000 :

, 255, 255, 0)

sinatra - ActiveSupport::Dependencies.autoload_paths: How to eager load? -


I am using ActiveSupport in a Syratta project, and according to some colleagues I recommend ActiveSupport :: Dependencies Development To reduce the loading of my classes in Autoload_paths Now I'm coming on deployment day, and I do not really have to load them eager to train which would be easy: one would simply set config.cache_classes = true and go about his way. But in the Sinatra app, I am failing to see how it should be eager to load them.

If you have a rail gem installed, you can reach it directly through the railroad and Can manipulate

Rails.application.config.cache_classes = true

stylesheet - Center text next to bootstrap button in row -


If I have some text in a row with a button in the bootstrap, then the best What's the text in the button? Demonstrate - "Foo", "Bar" and "Some time ago" are aligned with the top of the button, how can I focus them vertically?

  & lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; One square = "span2" & gt; Foo & lt; / A & gt; & Lt; One class = "span2" & gt; Bar & lt; / A & gt; & Lt; Span class = "span2" gt; Some text & lt; / Span & gt; & Lt; Div class = "span2" & gt; Button class = "BTN BTN-Success" & lt; I class = "icon-off icon-white"   

I know that I can add 5 px padding at the top of each and every one, but is this a more general way, so that it always Could make the line?

Edit: Adjust the tag above to add

You can use the btn-link class on your links:

  & lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = "span2" & gt; & Lt; One class = "btn btn-link" & gt; Foo & lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = "span2" & gt; One class = "btn btn-link" & gt; Bar & lt; / A & gt; & Lt; / Div & gt; & Lt; Div class = span2 "& gt; button class =" btn btn-btn-success "& gt; & lt; i class =" icon-closed icon-white "> gt;  & lt; ; Span & gt; Falcon & lt; / span & gt; & lt; / button & gt; & lt; / div & gt; & lt; / div & gt; & lt; / div & gt;         

Blockquote>

While keeping the behavior behaved like a link, give importance to one button; UPD BTN-Link class to span , so it will look like a link

or you can BTN-Link Create something similar to the class, e.g. BTN-text :

  .btn-text, .btn-text: active, .btn-text: hover , .btn-text: focus {color: inherit; cursor: heirs; border color: transparent; background color: transparent; background-image: none; -webkit-box-shadow: none; -move box-shadow: some No; box-shadow: none;}   



mySQL update table add string to column -


I have a table in mySQL and want to update a specific column in one directory. The directory structure should be extended and related columns should be updated with the sub-directory. So I do not have many rows to update to see a convenient script for doing.

Example :.

The directory containing the column c1

  / startpoint / dir_a / / startpoint / dir_a / subdir_1 / / startpoint / dir_a / subdir_1 / subsubdir_1 / / startpoint / dir_a / subdir_1 / subsubdir_2 / / Startpoint / dir_a / subdir_1 / subsubdir_3 / / startpoint / dir_a / subdir_2 / / startpoint / dir_a / subdir_3 /   

So I start the starting point / directory after the directories is required.

It should be after the script:

  / startpoint / system / dir_a / / startpoint / system / dir_a / subdir_1 / / startpoint / system / dir_a / subdir_1 / subsubdir_1 / / Startpoint / system / dir_a / subdir_1 / subsubdir_2 / / startpoint / system / dir_a / subdir_1 / subsubdir_3 / / startpoint / system / dir_a / subdir_2 / / startpoint / system / dir_a / subdir_3 /    My (probably stupid) update did not work as expected:  
  update table1 set dir = / startpoint / system / || Substr (dir, 12) Where '/ startpoint / dir_a /%' like dir   

Then to get any idea from the specialist with this one more specific SQL update?

Thank you.

You

  update table set dir = REPLACE (dir, / 'Startpoint / dir_a /', '/ startpoint / system / dir_a /' Where are the directories like '/ startpoint / dir_a /%'   

But be careful because it's' / startpoint / DIAR_A / 'If your path is something' / startpoint / DIAR_A / Random_deer / initial point / DIAR_A / 'then it must be messed up

knockout.js - Knockoutjs not updating UI in this case -


I'm relatively new to (starting 2 days earlier) and was trying some simple examples. Currently, I'm having trouble with this piece of code

  & lt; Div id = "idChangeStyle" & gt; & Lt; Span data-bind = "style: {background: GetAge (" 18 "'red': 'white'}" & gt; Enter your age: & lt; / Span & gt; & Lt; Input type = "text" data-bind = "value: getage" & gt; & Lt; / Input & gt; & Lt; / Div & gt;   
  function ageViewModel () {var self = this; Self.age = ko.observable (18); Self.GetAge = ko.computed ({read: function () {return self.age ();}, write: function (value) {value = parseInt (string). Replace (/ [^ \ d] / g , "")); If (INNA (value) self.age (18); and self.age (value);}}); }; Ko.applyBindings (New Age ViewModel (), document.getElementById ('idChangeStyle')); Actually, the app only takes one input (age); I'm using writeable INTEGER to parse the input and calculate writing if I am trying to set its NAN in my default value of 18. Apart from this, I have a simple argument on html where I am changing the background of spin to red if the age is below 18.  

It works fine in normal condition, here it is when I get the problem: -

  Episode 1: Enter current input: 18 (initial case) * 4 * then tab / / enter * a * then tab / / (for default 18) work / * a * tab / / 2 does not work case 2: current input: 18 enter * a * tab then * / / * Does not work   

I checked the knockout code to see what happens in a case after the part of the code Land: -

  if (IsNaN (value)) self.age (18);   

.. In the following line: -

  // writes that if the value has not changed, (if ([[[EqualityComparer] Overview)  <,  _latestValue  and  duplicate [0]   

/ code> has the same value (18), so it's something Not even because there is no change in age value, now the void property and UI are out of sync

Is it because I am doing this wrong? < P>

The problem is that if you have a value of If they enter the same value, then it does not consider the change in value and does not inform customers if you have entered the error state several times, then 18 first set There will be no change and no set-up is done.

With this, to determine this, you have to manually inform customers that you can see that ValueHasMutated () viewable on call

  self.GetAge = ko.computed ({read: function () {return self.age} ();}, write: function (value) {value = parseInt (string ( Value) .replace (/ [^ \ d] / g, "")); If (isNaN (value)) self.age (18); And self.age (value); Self.age.valueHasMutated (); // notify subscribers}});    

Store thrown exception for CONCURRENT_MAP_REMOVE while using Hazelcast (Java) -


I am using Hazelcast-2.5 in a cluster. I am trying to load an ArrayList of user defined objects (with some string fields and an integer) in the store-load implementation of my hazelcast map (string, Array). The initial load gives me no exceptions. However, for the load a key to receive a call on the map, for which there is no value in the map (and hence the load is called), I see the throwing applies due to the following exception (I also remove one Operation on the map after that time):

  The throw thrown store for CONCURRENT_MAP_REMOVE   

This gives me a square throw exception, stating that my UD object can not be a string If I miss something in my implementation then I would not be surprised - this is just when this call is done, I am trying to do an operation on the map and the result is an ArrayList form of the user defined object I am specifying . [192.168.1.1]: 5703 [Load shop in Dev shop load also (shopload is declared in the same way) An ArrayList prefix warns of the object defined] Store CONCURRENT_MAP_REMOVE java Exceptions arise for lang.ClassCastException: models.test.TestClass can not be molded in java.lang.String on models.test.StoreLoadTestMap.load (StoreLoadTestMap.java:1) at com.hazelcast.impl.concurrentmap. MapstoreWepper.load (MappStorWepper.jvinder3) at com.hazelcast.impl.ConcurrentMapManager Remove $ OperationHandler $ removerLoader.doMapStoreOperation (concurrentMapManager.java:2681) at com.hazelcast.impl.ConcurrentMapManager $ AbstractMapStoreOperation.run (ConcurrentMapManager.java:3860) Com.hazelcast.impl.executor.ParallelExecutorService $ ParallelExecutorImpl $ ExecutionSegment.run (ParallelExecutorService.java1212) java.util.concurrent.ThreadPool $ Worker.RunTask in Explorer (ThreadPoolExecutor.java:886) java.util.concurrent.ThreadPoolExecutor at $ Worker .run (Threadpool Exporter. Java: 908) a t java.lang.Thread.run (Thread.java:662) com.hazelcast.impl.ExecutorThreadFactory $ 1.run (ExecutorThreadFactory.java38) at < / Pre>

troubleshooting this Any thoughts on?

itemprop = "text">

It seems that you will get this exception in return (if ArrayList hazelcast loaded with operation load- store- Load implementation) is empty.

xaml - How does the EntranceThemeTransition from LayoutRootStyle cascade to child controls? -


I am going through this time, and I can not understand why webview control is not the same gateway As another control, there is a section on the animation adding animation and changes which states that it is not expected to do this and need to do this for a storyboard with animation.

I've found that the standard setter is the standard style. The transition applies to other controls in Xml.

  & lt; Style x: key = "layout style" target type = "panel" & gt; & Lt; Setter property = "background" value = "{static resource software application page backgroundthebrush}" /> & Lt; Setter Property = "Child Labor" & gt; & Lt; Setter.Value & gt; & Lt; TransitionCollection & gt; & Lt; EntranceThemeTransition / & gt; & Lt; / TransitionCollection & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; It appears that with this style the entry of the child for the control of every child should be applied to the accumulation accumulation - or it should only apply the infection to their direct children. It seems that there is a small part of both.  

In addition to this, I expect controls that do not have the status of animating with their parents. It does not seem that direct guardians of the webview are just fine animated.

Is WebView so special in this case? Apart from the fact that this is not part of the default template. Why do we need to add a popiname animation and storyboard to move it to a control and why it takes at different speeds to control it, should it be inside ?!

A WebView is a specific control that can be accessed by its own HWND (classic WinAPI Window), as the rest of the typical XAM-based UI rendered in a flat space (a Jupiter window). As it stands on all other controls in its own airspace (it binges). You usually change it from any other control (like rectangle) when you want to animate it or overlay some other content on top (for example, app bar), then a WebViewBrush .

I think that using some subject animation or some other mechanism rather than regular storyboards, and it is possible that webvay control just does not work well with it.

My advice would be to: - If you are trying to use (do not work with entrepreneurship transmission) - use something different (a regular storyboard-based animation).

c++ - private friend operator<< -


Then I have a class for which I have an overload operator < & Lt; Output your internal data in the output stream; I want to do this for debugging purposes only and in this way somehow the operator & lt; & Lt; To hide from the outside world, so that it is only the * .cpp file where the implementation of my class remains operator & lt; & Lt; has made me friend to join my class in the member variable. Although in the class the operator & lt; & Lt; Announcing Friends enables anyone from outside the world to call operator on this class ...

I know I want to do this I can work as a regular private member, but I already have some debugging macros which are the operator & lt; & Lt; , so I was wondering if it is possible to do it in some way

You can use the operator in a supporting proxy class & lt; & Lt; can move functionality. When the proxy is & lt; & Lt; Used as RHS of , the original item is printed. Define a personal built-in conversion from the original to the proxy now let anyone operator & lt; & Lt; , but only the class has the ability to create a proxy.

  class private_printable {int state; Structure Proxy {Private_procable bracket & amp; R; }; Operator proxy () const {refund {* this}; } Buddy Stud :: Ostream & amp; Operator & lt; & Lt; (Stud :: Ostream and Proxy Cost & amp; O) {Returns S & LT; & Lt; O.r.state; } Public: Private_Printable (): State (5) {} zero debug () {std :: cout & lt; & Lt; * This is & lt; & Lt; '\ N'; }};   

Note that the proxy is not required to be a friend. The only change in the normal way of working is to have a proxy and a conversion function. Friend Operator & lt; & Lt; Namespace-scope is found by logic-based lookup without declaration, even if it does not take any private_printable argument, then the conversion makes it viable so do not do that cleaner solution Possible: v).

lisp - Processing Lists of char * in C? -


I need to do different functions on the long list of stars in C.

  char * list 1 [] = {"one", "two", "three", "four", "five", "six"};   

Initially, I am trying to implement Simple Car / CDR functions, but it is a while and I I forgot the best way to manage a list of four * [] in the CD. In the rest of the list of char * s in a fresh malloc'ed array, in my case it is "two", "three", "four", "five", "six". Unknown list size unknown It is complicated. Maybe, should I use a straight line with the length of the list?

  char ** cdr (char * aList []) {/ * malloc for space n-1 char * * / return aList; // Return to check everything}   

For example, I will have other functions, list all the words with two consecutive vowels, or return in more than 10 characters. Never want to change the wire (i.e. they are irreversible). I am malling memory in functions like CDR, so I will need to keep an eye on it because I take my results and send it to other tasks. Anyway, if someone can start me, then it would be very appreciated thanks.

  four * list1 [] = {"one", "two", "three", "four", "five", "six"}; // Short list room ** CDR (four * ALIISIS []) {/ * N-1 character * * / return alive for MLL; // to check everything}} four * car (four * alist []) {ILIF [0]; } Int main () {const char * first; Four * rest []; Int len ​​= sizeof (list1) / sizeof (four *); Printf ("list1 len =% d \ n", lane); First = car (list 1); Rest = CDR (list1); Printf ("% s \ n", first); LAN = shape (left) / size (four *); Printf ("rest lane =% d \ n", lane); Return 0; }   

unknown unknown list size not so much "it makes complex" As "it makes it impossible" If you do not want to go around the clear length, then you need to use a null value as the Terminator.

  int length (const char * string []) {int rv = 0; While (string [RV]) ++ RV; Return RV .; } Int main (int argc, char * argv []) {printf ("Note that this technique is also used in argv:% p \ n", argv [argc]); Const * list [] = {"+", "42", "30", NULL}; Printf ("length:% d \ n", length (list)); Return 0; }   

Using such length () in your other actions, you should be able to know the appropriate amount of memory to allocate. (Remember that you need to allocate space for extra pointer for zero!)

javascript - onreadystatechange triggers reload of page -


I am trying to learn some composite php, javascript, sql, html content ... i created something that Works on Firefox without any errors (both WinXP and Android versions). The desired action is that, whenever I click the button "Process!" Clicking on a php script reads in "Textrera", puts each word in the database and some HTML comes back ...

   The server is working on the text ..." various feedback; Try {var httpReq = new XMLHttpRequest (); } Hold (error) {document.write (error); } HttpReq.open ("POST", "textinput.php", true); HttpReq.send (.ocument.getElementById ("text field") innerHTML); HttpReq.onreadystatechange = function () {if (httpReq.readyState == 4) {response = httpReq.responseText; Document.getElementById ("m_block"). InnerHTML = Feedback; }} & Lt; / Script & gt; & Lt; Div id = "container" & gt; & Lt; Div id = "l_block" & gt; & Lt; / Div & gt; & Lt; Div id = "m_block" & gt; & Lt; Form & gt; & Lt; Br / & gt; & Lt; Textarea id = "textarea" rows = "10" cols = "42" & gt; Insert text here! & Lt; / Textarea & gt; & Lt; Button onclick = "processText ()" & gt; process! & Lt; / Button & gt; & Lt; / Form & gt; & Lt; / Div & gt; & Lt; Div id = "r1_block" & gt; CSS 2 & lt; / Div & gt; & Lt; Div id = "r2_block" & gt; CSS 1 & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

The response from php-script looks like this:

  search:  & Lt; Div id = "ajaxoutput" & gt; & Lt; / Div & gt;   

I call things "ajax", I do not know anything if it is considered Ajax. But I call it because it is considered sending the string to textfield on each keyboard event. Just put a little azee, as far as I understand it.

However, this works really well on Firefox as I said, but when I try it on other browsers, then nothing happens. It seems that such a page seems to have added the URL to the address bar ? The page reloads with ...

I can only ask all my friends to use Firefox, but I am curious to know what is the reason. Where do I go wrong?

Thank you!

Edit! I did some excavation in the debugger of Chrome, the reaction gets back out. When I set a breakpoint, I think the div gets populated with new content. However, the callback function is called twice in the row. After it is finished, I return to the previous content, the server response is not found elsewhere. What is happening? As soon as Jonathan had said that you did not mention the browser that gives you concrete answer. In addition, your AJAX implementation is incomplete, please give it a try

  // Put it up before anything (String.prototype.trim) {String.prototype.trim = function () {return This.replace (/ ^ \ s + | \ ro + $ / g, ''); }; }   

Update your AJAX related code with it also

  var xmlhttp; If (window.XMLHttpRequest) {// code for IE7 +, Firefox, Chrome, Opera, Safari xmlhttp = New XMLHttpRequest (); } Else {// code for IE6, IE5 xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); } Xmlhttp.onreadystatechange = function () {if (xmlhttp.readyState == 4 & xmlhttp.status == 200} {// something}} xmlhttp.open ("post", "textinput.php", true) ; Xmlhttp.setRequestHeader ("content-type", "application / x-www form-urlencoded"); //xmlhttp.send("fname=Henry&lname=Ford ");   

You can also try using a library such as a library that will take care of most browser incompatibilities.

c - Is there a similar mechanism to Python's threading.Event in OpenMP? -


I make a list of solutions to implement the functionality of Python's threading.Event I am trying to [1] c. In general, when synchronization between threads is required, then the first mechanism to be used / interpreted is a lock (aka mutex). Python's threading.Event class is another mechanism for synchronization that can be used to block threads from a specific situation.

pthread I think this situation is possible to do this with variable properties [2].

About omp , is it possible? Based on what happens in Python, I have the Fictional type event and events :

  The following example is written  int nthreads; Event * evt; Events Que * Queue; #pragma omp parallel private (evt) {#pragma omp single {nthreads = omp_get_num_threads () - 1; } If (! Omp_get_thread_num ()) / * Master thread * / {while (nthreads) {evt = events_queue_pop (queue); Evt_set (evt); }} Other / * Other threads * / {evt = alloc_event (); Events_queue_append (queue, evt); / * Each thread waits for master thread to set its event * / evt_wait (evt); Free_event (evt); #pragma omp Important {nthreads--; }}}   

As you can see, I python threading. With the lock , I can have the same effect as #pragma omp important (for example, I protect nthreads with it) The problem is threading. Event I can not find anything for OpenMP

[1]

[2]

note : This solution is not correct. Edit at the end of this reply.

Good ... I think how I got it. Given the source of the threading modules of Python, [1], it seems really simple.

Fifo of reentrant lock case that has been implemented in OpenMP as omp_nest_lock_t ). Whenever a event.wait ([timeout]) is called , a new lock is added to FIFO and immediately acquired twice (Second time the second time will be blocked until the release!). Then, when Event.set () is called, all lock in FIFO is issued and removed from it.

I hope this answer

[1]

EDIT: I have found an article that says that this solution is not correct and it's about This problem speaks in:

[2]

html - PHP Include links -


Hello, I'm going to be your first serious with PHP to create a sample script for my own original structure, I have in my root folder:
  • index.php
  • The main folder (holds most of my fashion function files)
  • CSS
  • Sites (Other sites have 3 and folders site A, B, C)
  • Includes sites (holders to my header.php and footer.php) JS

    All Pages are created by including header.php and footer.php in the folder, and then have their contents between each page. Header.php includes (as well as links to the Basic HTML and Javascript Stylesheets Act) such as core folders include:

    • include_once '/core/connect.php';

      Now all of these work using index.php which provides links to 3 different sections of site, site, sitebank and sitcom.

      But when you call document root /sites/sitea/index.php all those links are now broken.

      Header. What is the best way to create links in the FTP section, so that relative site is wide, no matter what the folder you are in?

      The idea behind this is that you have only one file for each process

      Therefore process all pages via index.php

      In index.php, for example,

        will be required ('header.php '); ('Content.php'); ('Footer.php') is required;   

      In this way, if your content does not appear then it will not break the site.

      Your index is always loaded on the same path, so the header / footer will not change just the content.

url - Override Google+ (Google Plus) mobile website redirect -


Is there a way to emphasize the desktop version of a Google+ page using URL parameters (or something else)?

For example, this URL is a Google+ Local page, which is OK on the desktop:

But on mobile devices, this redirects with the stripped version of Google+ Local page . What is a way to apply the page to this url to look like a desktop version? ? Mobile = false

There is no documented way to do this. It appears that the Google+ site is redirecting to a user-agent.

php - Item not deleted from array session -


I have a simple PHP code that should delete the key given from an array ($ item - and passing). There is a session, there is an item, but on every attempt, the entire session is approved.

  $ _ session ['myFavorites'] = array (); If (in_array ("$ item", $ _SESSION ['myFavorites'])) {without set ($ _ session ['myFavorites'] [$ items]); }   

Any help might reset my mind again. I hope someone can tell me what I'm doing wrong.

  $ _ session ['myFavorites'] = array (); If (array_key_exists ($ item, $ _SESSION ['myFavorites'])) {without set ($ _ session ['myFavorites'] [$ item]); }    

excel vba - How to save a sheet array to PDF with a specific sheet order -


I have a workbook with multiple sheets which I want to select and change a single pdf file.

I have written the following code that works fine and creates a file:

  sub Print_Project_Report_To_PDF file as string FilePathandName String MyDate = Format (DateSerial (year (now) , Month (now) - 1, 1), "mm mm") MyPath = ThisWorkbook.Path & amp; "\" Mayfile = "Project Progress Report -" & amp; Mind & amp; ".pdf" file path and name = MYPAT & amp; MyFile ThisWorkbook.Sheets (Array ("PR_COVER_PAGE", "PR_SOWMARY", "PR_PROJECT_DETAILS", "PR_INTERNAL RESOURCES", "PR_TIME", "PR_REVENUE_FORECAST_SUMMARY", "PR_ORIGINAL_REVENUE_FORECAST", "PR_ACTUAL_REVENUE_FORECAST", "PR_COSTS", "PR_ISSUES", " Monthly Financial Report "," PG SC_COVER_LETTER "," PG SC_CLAIM_SUMMARY "," PG SC_TRADE "," PG SC_HYDRAULICS "," PG SC_MECHANICAL "," PG SC_MEDICAL_GASES "," PG SC_ELECTRICAL "," PG-SC_VERIATION "," PG -PC-MH_ELECTRICAL "," PG-MH_ELECTRICAL "," PG-MH_ELECTRICAL "," PG-MH_COVER_LETTER "," PG- MH_CLAIM_SUMMARY "," PG- MH_TRADE "," PG- MH_Hydrix "," PG- MH_MECHANICAL "," PG- MH_VARIATION "," PG-MH_MONTHLY_CASHFLOW "," CLIENT_COVER ", _" CLIENT_SUMMARY "," CLIENT_ISSUES ")). Select ActiveSheet.ExportAsFixedFormat type: = xlTypePDF, file name: = FilePathandName, _Quality: = xlQualityStandard, IncludeDocProperties: = True, _IgnorePrintAreas: = false, OpenAfterPublish:. Select the TrueWorldbook.Sheets ("Dashboard") End Sub   

The problem is that PDF file lay is not created with sheets, which I have specified in the array. They are in order that they appear in the workbook (left to right). This is correctly included only sheets but I do not want it in the order I want.

I do not want to change the order of the sheet in the workbook because neither it is setup in a specific, progressive way.

Can anyone help with my code which will be able to be specific with the order of the sheet when the document is published?

Any help would be greatly appreciated.

I agree with Siddhartha / in the first thought / comment below the question. However, when I print complex power point presentation, in the same situation

I run the software on the first step and set the 'stop printing' option . You can send each worksheet separately to that software (the way you print the worksheet), which will be stacked in the list in the right order at the beginning of the individual documents. Using special feature, you can match them in a document and print it. This is a very useful and quite reliable solution.

iphone - Parent NSManagedObjectContext has no changes after child is saved, but only in release mode (works in debug mode) -


मेरे सेटअप:

  • एक NSManagedObjectContext प्रकार के साथ <कोड > NSPrivateQueueConcurrencyType है कि मेरे <कोड से जुड़ा है> NSPersistentStoreCoordinator
  • एक NSManagedObjectContext प्रकार NSMainQueueConcurrencyType कि का एक बच्चा है निजी संदर्भ।
  • एक NSManagedObjectContext प्रकार के साथ NSConfinementConcurrencyType है कि मुख्य संदर्भ का एक बच्चा है।

    किसी सर्वर से डेटा डाउनलोड करते समय, मैं डेटा के प्रकार के संदर्भ में NSConfinementConcurrencyType लिखता हूं मैं तब इस संदर्भ को बचाता हूं, जो मेरे मुख्य संदर्भ में परिवर्तन को धक्का देता है तब मैं अपना मुख्य संदर्भ सहेजता हूं, जो मेरे निजी संदर्भ में परिवर्तन को धक्का देता है इस बिंदु पर, मैं अपने लगातार दुकान में सब कुछ को बचाने के लिए निजी संदर्भ पर performBlock विधि का उपयोग करें।

    यह दोषरहित काम करता है जब एक डिवाइस पर डिबगिंग। जब भी मैं अनुप्रयोग को संग्रहीत करता हूं और एप्लिकेशन को रिलीज़ मोड में चलाता हूं, तब भी मेरा मुख्य संदर्भ कभी भी परिवर्तन प्राप्त नहीं करता, भले ही मैं इसे सफलतापूर्वक बच्चे के संदर्भ को सहेजूं। मैंने डबल जांच की है और मेरा अस्थायी संदर्भ वास्तव में मुख्य संदर्भ से जुड़ा हुआ है (मुख्य संदर्भ को अस्थायी संदर्भ के माता-पिता के रूप में दिखाया गया है) लेकिन जब भी मैं रिलीज़ मोड में अस्थायी संदर्भ को बचाता हूं, मुख्य संदर्भ कभी भी कोई भी परिवर्तन नहीं दिखाता है मैं क्यों इस डिबग मोड में काम करेंगे, लेकिन रिलीज में नहीं के रूप में विस्मित कर रहा हूँ।

    कोई सुझाव / मदद बहुत सराहना की जाएगी।

    धन्यवाद,

    गोरस्की

    संपादित करें: अगर मैं डीबग कॉन्फ़िगरेशन का उपयोग कर निर्माण को आरक्षित करता हूं, तो सब कुछ अपेक्षित रूप से काम करता है इसलिए रिलीज कॉन्फ़िगरेशन में कुछ सेटिंग अलग-अलग है मैं जो मिल रहा हूं उसके साथ मैं वापस रिपोर्ट करूंगा।

    संपादित करें 2: अपराधी मिला। इसलिए मैंने मेरी सहेजी गई कॉन्टैक्ट कॉल को एनएएसएएसर्ट में लपेट लिया था (परीक्षण के दौरान किसी भी विफलता को पकड़ने की उम्मीद में)। दुर्भाग्य से, रिलीज़ कॉन्फ़िगरेशन ने इन अटिटेशन ब्लॉकों को छीन लिया जो मेरी सहेजी गई कॉल चेहरा हथेली

    एनएससीनफ़िनेशन कनक्यूर्निटी टाइप पुरानी विरासत है मूल डेटा व्यवहार, माता-पिता और बच्चे के संदर्भों की कल्पना से पहले। आप एक बच्चे संदर्भ में एक आयात कर रहे हैं, उस बच्चे NSPrivateQueueConcurrencyType की जरूरत है। मुझे आश्चर्य है कि के प्रदर्शन को अवरोधित करें: , माता-पिता / बच्चे MOCs, और NSConfinementConcurrencyType बिल्कुल काम करता है।

cakephp saving data for a related model's related model (not typo) -


I have participated in a small amount of problem in saving the data in cake php. Many

  • / Strong> group

    I am in a view to create a new district, in which I have given the user permission to create several new departments. When creating each department, the user can create several groups for that department. Now trouble I am unsure about how to save group data.

    For each department that has been built on the fly, using a number of index methods for input (i.e. "Department .0.name", department 2.0.type) Save using all the methods, however, for each group that is created, I will need a department_ID because the departments of any district have not been saved yet, they do not have an ID. How can I save the data of this new district, save new departments, and maintain new groups associated with it? Is there any way that I can address the name attributes of group entrepreneurs who will create the appropriate association, such as "Department .0.Group Group.name", for example?

    Thanks in advance thanks! !! If nothing is unclear, please do not hesitate to say, I will be happy to refresh again.

    What does your postal data look like?

      & lt; ? Php debug ($ this-> data); ? & Gt;   

    If it is not in the correct format, then the respective models will not be saved. Cake knows that to catch the "last look (") of the model that have not yet been saved, So you do not have to worry about those people ... what I'm not sure about, and docs do not really go away, how deeply it remains. The examples given are as follows:

      $ this-> Data = Array ([article] = & gt; Hey ([title] => my first article) [comment] => Array ([0] => Array ([comment] => Comment 1 [user_id] = & gt; 1) [1] => Hey ([comment] => comment2 [user_id] => 2))) $ this-> Paragraph-> Saving all ($ this-> data);   

    This is the correct structure (CakePip 1.3) to save the associated model of 'Hamman' relationship, but I'm not sure it goes for any child with any depth.

    One thing that comes to my mind is to create an array according to the format above, but leave the original model manually by saving the original model data, get :: getLastInsertId ();


    [ UPDATE ] I have just tested your theory and it will work according to your wishes.

        

    will be generated:

      & lt; Input name = "data [section] [0] [group] [0] [name]" type = "text" id = "department0Group0name" & gt;   

    [ UPDATE 2 ] I searched some things in ob / cake / model / model.fpp and found:

     < Code> & lt ;? Php ... associated with saving public function ($ data = zero, $ option = array ()) {... ... // code left ... if ($ option ['deep']) {/ / This all organizations $ save = $ this- & gt; {$ Association} - & gt; Save associate ($ value, array_merge ($ option, array 'atomic' = & gt; wrong))); } ... ... ... // Quit the code ...? & Gt;    

  • elasticsearch - No query registered for [match] -


    I am working through some examples in the ElasticSearch Server Book and am trying to write a simple matching query < / P>

     <">" "" {"matchname": {"displayname": "john smith"}}   

    This gives me an error:

      {\ "error \": \ "SearchPhaseExecutionException [Phase [query] failed to execute, ... SearchParseException [[script] [4]: ​​to [-1], size [- 1]: Pars failure [failed to parse source ... question marking exception [[kbcg]] [match]] No question is registered.   

    I also tried

      {"match": {"displayname": "john smith"}}   

    Edit: I think the remote is not the server I am using the latest 0.20.5 version because "text" instead of "match" Using the query allows the query to work

    I have seen a similar problem here:

    It looks like I'm using Remote server is not the latest 0.20.5 vers elastic search ion, as a result "match" query is not supported - instead it's "text", which works

    I have a similar problem here I have come to this conclusion after seeing:

    java - how to add Jlabel to Jpanel outside the constructor? -


    I am able to use AD (new jellybell) to label a label on my Jepelal within the Zipal constructor, but once I am using the second function () adding, the label is not shown on the panel . what I have done? Public class display panel, JPNL (JLABB headfield = new JLab ("Choose a file to prepare the report".) Is expanded; JLabelDefined = new JLabel ("123"); JLabble EarthFilled = New JLab (""); JLab Minfield = New JLab (""); JLab Maxfield = New JLab (""); JLabel stdDevField = New JLab (""); Public DisplayPanel () {super (); setBackground (Color.white); SetLayout (new grid layout (6, 1)); add (headerField); ** // add (new jlabble ("123");; ** This will work ** Public Zero Setfield (Datamanager) {dateField.setText (d.getStartDate) + "-" + d.getEndDate ()); MeanField.setText ("Meaning: "+ D.getMean ()); MinField.setText (" Min: "+ d.getMin ()); MaxField.setText (" Max: "+ d.getMax ()); StdDevField.setText (" STD Dev: " + D.getStdev ()); This.add (New JLabel ("123"); ** // This does not work **}

    After the new added component appears after you see the JPNL to get any, you modify () Calling is usually done On repaint () . The reason is that add (new jlabble ("123");

    works in the constructor JPanel valid when is added to its container, usually in an JFrame is. Adding labels to the initialization step is easy because you only have to call JLabel # setText and no reviewed / reprint call is not necessary.

    java - Strange Collision in LibGDX -


    I'm trying to create a simple ball reflection on a block. I am using the libgdx framework.

    I have problems with block collisions:

      public square world {public ball ball; Public times and times; Public block block; Public bounding box border, boundary, bound; Public world () {start (); } Public Zero Starter () {Ball = New Ball (10/2, 6); Bar = new bar (4,1); Block = new block (4,7); Boundblocks = new boundingbox (new vector 3 (block. Position.x, block.position.y, 0), new vector 3 (block position.x + 2, block.position.y + 1,0)); Bound = new bounding box (new vector 3 (ball.buzz.exe, ball.b.a., 0), new vector 3 (ball position. X + 1, ball.shomition.i + 1,0)); } Public Zune update (float delta) {ball.position.add (ball.direction.x * delta, ball.direction.y * delta, 0); // True collision if (ball.position.x + 0.25f> 9.65F) {ball.position.x = 9.65F - 0.25F; Ball.direction.x = -ball.feed; } // Top collision if (ball.position.y + 0.25f> 14.65F) {ball.position.y = 14.65f - 0.25F; Ball.direction.y = -ball.VELOCITY; } // Left Collision If (ball .position .x - 0.25F & lt; 0.35f) {ball.position.x = 0.35f + 0.25F; Ball.direction.x = Ball. VELOCITY; } // Bar collision if (ball.position.y & lt; 1 + 0.1 F) {if (ball.position.x> bar.position.x & amp; amp; amp; amp; ball.position.x & lt ; Bar.position.x + 2) {ball.position.y = 1+ 0.25F; Ball.direction.y = Ball. VELOCITY; }} // Block collision if (Boundblock canteens (boundball)) {ball.direction.x = -ball.valiti; Ball.direction.y = -ball.VELOCITY; }   

    The problem starts with block collision It appears that it was "inside" in constant collision zone and it changes the direction of my ball all the time, The ball is brought into the "step" in the block.

    All suggestions are welcome!

    Thank you very much for your help!

    The problem is that you should never bound toBall Do not update, so it always assumes that it is embedded in the boundblock .

    limit actions PHP -


    Actually, I have a function that gives the total "items" inside a database, the limit of these items is < Strong> 40 , if the returned value is less than 40 , then I want to implement it so that access to this type of range is 1 Do not reach 40 again, after that I want to stop it, I am currently using the code which is shown below

      $ count = $ row [ 'COUNT' ]; Forex currency ($ result as $ line) {If ($ count & lt; 40) {// I want to execute a function, thus increasing the calculation of $ by $ evertime / unless it is not upto 40 After reaching it, it should be closed}}    

      $ count = $ ['COUNT']; Forex Currency ($ result $ line) {if ($ count> = 40) {break; // exit foreach loop immediately} // put code here $ count + = 1; // or whatever you want it to be extended, eg $ Line ['COUNT']}    

    sitecore - Applying conditional rendering to all instances of a specific rendering -


    How do I apply a conditional rendering rule for all instances of a specific rendering (in an MVC application, if it is relevant) Can i do

    Based on the documents I found, there should be a "Personalization" section, but it does not appear in the properties of rendering, even if I have enabled it in "Application Options".

    I have read that the conditional rendering rules are not supported by the Global , but I think that this meant that the rules can not be applied to all rendering, not only Any specific type of renderings

    Any ideas?

    I will also take a look at the following pipeline

      & lt ; InsertRenderings & gt; & Lt; Processor Type = "Sitecore.Pipelines.InsertRenderings.Processors.EvaluateConditions, Sitecore.Kernel" /> & Lt; / InsertRenderings & gt; I would probably override the  GetGlobalRules  method to execute my custom argument, perhaps load a custom set of conditions from the sitcom and add them to  Rule list  therefore they are also evaluated.   

    java.Lang.RuntimeException, setParameters failed in android(4.1.1) version -


    I have developed an app that captures a picture at that time, at which point there is a punch. This is working well on Acer tab (image capturing and saves in SD card) Now when I run the same application in Samsung Galaxy (Android-4.1.1) my app 'Unfortunately the app is closed' when The screw is clicked and my code goes here.

      // ClockIn functionality clockin_btn.setOnClickListener (New View.OnClickListener) {Public Zero onClick (see v) {clockin_btn.setEnabled (Wrong); camera.stopPreview (); capturePhoto (0); // Here is an error showing the cat in the log Preview = false; clockin_label.setText (String.Format (session_msg, logout_seconds)); ticker.setBase (SystemClock.elapsedRealtime ()); ticker.start ();}}); Private String Capture Photo (int clock initomod) {Final integer mode = clock initodod; Img_file = String.format ("% d.jpg", System.contentime millis ()); Camera.PictureCallback MCALL = New Camera.PictureCallback () {Public Zero onPictureTaken (byte [] data, camera camera) Try {{bitmap mbitmap = BitmapFactory.decodeByteArray (data, 0, data.length); File file = new file (constant. EMP_IMG_LOCATION, img_file); FileOutputStream fOut = New FileOutputStream (file); Mbitmap.compress (Bitmap Compress Format.JPEG, 80, FOUT); FOut.flush (); FOut.close (); If (mode == 0) {clockIn (img_file); } Else {clockOut (img_file); }} Hold (FileNotFoundException e) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); }}}; Camera Parameter camera mercury = camera.jetametrators (); & Lt; Camera.Size & gt; Size = cameraParams.getSupportedPictureSize (); Camera.Size result = null; For (int i = 0; i   

    Showing as my Logcat:

      Apr 03-27: 52: 19.273: E / AndroidRuntime (4105): Fatal Exception : Main 03- 27 04: 52: 19.273: E / AndroidRuntime (4105): java.lang.RuntimeException: 52: 19.273: setParameters has failed in April 03-27 E / AndroidRuntime (4105): android.hardware.Camera. On native_setParameters (Native Method) 03-27 April: 52: 19.273: E / AndroidRuntime (4105): android.hardware.Camera.setParameters (Camera.java:1452)   

    and My android.manifest.xml file:

      & lt; Use-enabled Android: name = "android.hardware.camera" /> & Lt; Accessibility Android: name = "android.hardware.camera.autofocus" /> & Lt; Used-feature Android: name = "android.hardware.location" /> & Lt; Used-feature Android: name = "android.hardware.camera.setParameters" />    

    Call the startup method before moving. Illustration method camera.takePicture (null, tap, emolol); and the initial preview method I used

      Private Zero Startup () (if (Camera Configure and Camera! = Null) {camera.start preview (); inPreview = true} }   

    And through this I have solved my problem ... it can help you people.

    web applications - visual development, tool like MS Access for web/Mobile -


    What is a tool for MS Access, but for the Web? Which allows users to create line-of-business applications and report-applications in a visual environment, but also support a scripting / programming environment?

    Note: In general, I am not a fan of MS Access, but in many situations it has been shown in a very efficient way to manipulate data, screen and reports by the user and The most help is the difficult parts, which require programming.

    I'm looking for something similar to MS Access for a while. I've used long-term use to make data acquisition equipment in a similar way, such as how lab-view works. I think the power of access is to form designer, query designer, and Ability to work with MSSQ in ADP mode. In addition, there is the ability to use other components from MS Office and other Com Object Model based libraries, etc. Immediate mode allows very fast testing of VBA code. I can not work in visual studio VB.net or any IDE productive, which I have tried so far so far. Although I am not a computer science expert, I hope that I have some other knowledge about it.

    So far I have noticed that the nearest device is Alpha 5V11 and RAD Studio X3 Delphi. I looked at Limore Studio VS, MS Light-Switch, I tried Python but did not get a GUI work as well as access.

    I would be very interested to hear more possibilities

    / Html>

    c - fgets() getting stuck in infinite loop -


    If I am using the fgets () function to search for a particular delimiter across a text file, So how can I ensure Fgets () does not loop infinitely on EOF?

    I have the nth event of delimiter1 / delimiter2 pattern in struct1 [i] .string1 through delimiter2 from delimiter1, this pattern continues throughout the entire text file until the very end, Instead of being 2, there is EOF, I want to add everything from Limiter 1 to EOF.

      int i; (See the check) if the current line delimiter1 j = strcmp (temp_string, "delimiter2") (if the current line delimiter1 (= (fgets (temp_string, 100, inFile) = NULL) {if (strcmp (temp_string, "delimiter1") = ) is ; While (j! = 0 & amp; amp; temp_string! = NULL) {// I try to get out of here if it is EOF fgets (temp_string, 100, inFile); Strcat (struct1 [i] .string1, temp_string); J = strcmp (temp_string, "delimiter2"); // update comparator} i ++; }}}   

    However, when I try to run this code, I get stuck in an infinite loop. I put a print statement in the interior, while the loop is showing what the integer "I" was, and it was stuck on number 4, which is the number of total delimiter 1 in the text file, I believe that the eof is giving me infinite loop.

    Any help would be appreciated.

    The reason for the infinite loop is the inner loop:

      ! = 0 & amp; amp; temp_string! = NULL) {// here ^^ never set up. Never, if "Delimiter 2" is not found   

    Believe it, if the temp_string value does not have no "delimiter2" , then you Never j = 0 and you do not set the temp_string tap

    if you read in temp_string 100 then " Delimiter2 ". can be read from the file with some other charter, which does not return even after reading the StackCamp () reason " Delimiter2 ".

    Try to bug your code by using printf you temp_string

    In addition, you can find "delimiter2" in your code for strstr () function can be used in place of strcmp () . strstr () returns a valid address if "delimiter 2" is found in any position in any position, other intelligent faucets

    html - 3 inline-block divs with exactly 33% width not fitting in parent -


    This is a common problem but I can not understand why this happens.

    I have 3 devices at 33% (not at all, 33.3%!) And Display: Inline-Block on the side of the parents and within that div is.

    In Chrome it works well, but in Mozilla and Opera it does not (I have not tested it in IE yet). I thought the problem algorithm could be used to calculate pixel sizing by percentage in the browser. But when I checked the DOM metric, I came to know that the width of the parents is 864 px and the child is 285 px (this is true: 864 * .33 = 285.12). But why not fit in this parent? 285 * 3 = 855, which is 9px less than the width of the parent!

    Oh, yes, confirming the 0 and DOM matrix fixed for all devices of padding, margins and borders. Whitespace in source code

    In HTML source code, when you have lines

    Elements of text or images, or inline-block , if there are spaces (spaces, tabs, or new lines) between them, their Between a single spaces character will be added the page has been rendered. For example, in the following HTML, one of the four pieces of blank space content Will appear in between each:

      a two < Img src = "three.png" /> & Lt; Span style = "display: inline-block;" & Gt; Four & lt; Span & gt;   

    This is very useful for lines of text, and for small images or HTML elements that appear inside a line of text

    Extra Removing location

    / Strong>

    added 4px added between inline block elements The safest, cross-browser approach to avoiding or exceeding more space, is to remove any white space in the HTML source code between HTML tags. For example, if you have ul with <3 code> li tag, then

      & lt; - & lt; / Li & gt; There is no space, tab or line break between. And & lt; Li & gt; - & gt; & Lt; Ul & gt; & Lt; Li & gt; ... & lt; / Li & gt; & Lt; Li & gt; ... & lt; / Li & gt; & Lt; Li & gt; ... & lt; / Li & gt; & Lt; / Ul & gt;   

    Unfortunately, it affects the maintenance of the website. In addition to making the code unreadable, it seriously compromises the separation of data and formatting .

    If any other programmer comes later and each li tag is a separate line in the source code (tags tagged from unknown tags, or possibly HTML clean Going through the medium and even recording any related HTML comments), suddenly the website has a formatting bug

    Consider floating elements instead < / Strong>

    Strong behavior of white space It suggests that it may be inappropriate to use the inline-block . Code> For general-layout purposes, to use it for anything other than adding content inside the flow of the text of the text

    Plus, in some cases the inline block content is very difficult to style and align, especially on older browsers.

    Quick summary of other solutions

    1. Do not place a close tag on the same line as the next open tag, between them, in a white spot.
    2. Use HTML comments to fill all the white spaces between the close tag and the next open tag (@belell suggestion).
    3. Add a negative left margin in each element (usually - 3px or -4px, depending on the font size) I do not recommend this particular approach.
    4. Set the font-size for 0 or 0.01em for the container element, it does not work in Safari 5 (not sure about later versions), and It can interfere with responsive design websites, or any website that uses the font-size unit px .
    5. Use javascript or jQuery to remove only empty space-only text nodes from the container. It does not work in IE8 and earlier, because the text nodes are not created in those browsers when there is only white space between the elements, although the space is still added between the elements.
    6. Set letter-spacing and wrench-spacing (@ yellowpawels recommended). . This code needs to be standardized on the em , which can not be the right choice for all websites.
    7. Add Text-Spacing: Abandon; The container (formerly called white-space-collapse ) is unfortunately not supported by any browser yet, and the standard is not fully defined.

    flash - Not able to save a transparent PNG to the Camera Roll using AIR on Android? -


    I have created a ear app that can already save an image in the camera. However, I can not save an image with transparency in the camera roll. I thought it was working at one point. Instead, it is saving a highly compressed JPG.

    More info : I am using Camerol.dd bitmapdata () and AIR 3.6.

    This version appears to be in version 3.3 and above. I think that was working before but I have to test.

    Please vote for it.

    T.test R program -


    यह प्रश्न एक सटीक डुप्लिकेट है: < / P>

    • 1 उत्तर

      मैं करने की कोशिश कर रहा हूँ बहुत सारे डेटा सेटों के लिए एक टी.टी.ई.स्ट और मैं उन्हें एक आउटपुट में समाहित करना चाहता हूं अब तक मैं इस के समान एक टी.टी.ई.स्ट कर रहा हूं

        test1 = t.test ($ $ वेग, एक्स [[1]] [[2]]) test2 = t.test ($ $ वेग, x [[2]] [[2]] test3 = t.test ($ $ वेग, x [[3]] [[2]]    

      ऐसा कुछ काम करना चाहिए:

        परीक्षण & lt; - lapply (1: लंबाई (x), फ़ंक्शन (i) t.test ($ $ वेग, x [[i]] [[2]]))   

      परीक्षण एक सूची सूची लंबाई लंबाई (x) है। आप प्रत्येक टेस्ट परीक्षा का उपयोग tests [[1]] के साथ कर सकते हैं

    expression - Bison - handling non LALR(1) grammars -


    I am making a simple calculator using flex, bison.

    I have developed a grammar in which two types of expression - integer expression and actual expression.

    Grammar is similar to this:

      exp -> IntExp | RealExp intExp - & gt; INT | IntExp '+' intExp realExp - & gt; Real | RealExp '+' realExp | IntExp '+' realExp | RealExp '+' intExp   

    This is not LLRR (1).

    For example, consider the string 'INT' + 'real' INT 'is' +' on INT and based on this, it can tell that the string is an intExp or a real expression.

    I tried to write the grammar again to solve the ambiguity but nothing came of it.

    I know that I can make computation during parsing and in the form of a parse tree. Then with type inquiry, this issue can be solved but it seems that there is a little too much for such a simple problem.

    Can a season be made to control such ambiguity? Or can a grammar be rewritten in a better way?

    No, if it is not LALR (1) then it is not. However, you can not have a type of mismatch error in your language. Then why is there different presentations for int and real expression? Just node values ​​have an integer, a real and a type code.

    java - pass multiple value to property -


    I am new to iBatis, I would like that if it is possible to pass multiple values ​​in XML. For example,

      & lt; Select ID = "to get" resultClass = "object" parameterClass = "object" & gt; * From the table & lt; Select the isNotEmpty property = "startDate, endDate" prepend = "and" & gt; Date_start & gt; = # Start date # and date_end & lt; = # EndDate # & lt; / NotNotEmpty & gt; & Lt; / Select & gt;   

    Is that possible? If not, any way?

    Thanks in advance.

    No, it is not possible to use multiple values ​​in the property attribute but you get nested to get it Tag.

      & lt; Id = "getSth" resultClass = "object" parameter class = "object" & gt; Choose * from the table & lt; IsNotEmpty property = "startDate" & gt; & Lt; IsNotEmpty property = "end date" & gt; Where date_start & gt; = #startdate # and date_and & amp; Lift = #anddate # & lt; / IsNotEmpty & gt; & Lt; / IsNotEmpty & gt; & Lt; / Select & gt;   

    PS: You can not use '& lt;' Can not use less, '& Gt; The symbol inside the more than 'query' instead of the & amp; Lt; and & amp; Gt; Use .

    node.js - Nodejs: sharing session across meteor and express app running as separate instances -


    In fact, the user logs on the meteor app that runs on the local host: using 30000 accounts-UI packages. Express app is running on Localhost: 34444

    At some point, a user will need to use the express app (this is actually a Q), and I want to prevent the user from logging twice I am

    Both examples are running on the same domain, only separate ports

    can be accessed by a user from another web server instance (meteor in this case), all the one In the same domain.

    Use Redis for that fast and easy if you want to use memory Somehow easy), you can have a problem in racing conditions, because there is no locking mechanism in the memcach

    javascript - accessing mutable variable in an event closure -


    I am trying to use the Javascript plugin to handle some major strokes in a similar style, so I thought of them as code as follows:

      var key = ['B', 'I', 'U']; {Var iKey = keys [i] for (Var i = 0; i & lt; 3; ++ i); Var iKeyUpper = iKey.toUpperCase (); Mousetrap.bind (['command +' + iKey, 'command +' + iKeyUpper, 'ctrl +' + ikey, 'ctrl +' + ikeyupper], (function (e) {console.log ("You clicked:" + I);})); }   

    But, obviously, i is unstable, though, I'm not sure how to write a stop, where I am competing with event parameters in response. How to handle this situation?

    How can I write a stop where I'm competing in response to event parameters

    Use a closure around the entire loop body (as @dandwiz is displayed), or use it around the handler:

      Â |? | Mousetrap.bind (['command +' + iKey, 'command +' + iKeyUpper, 'ctrl +' + ikey, 'ctrl +' + ikeyupper], (function (_i) {// Definitely you use the name (I.e.);}}}) (i) // and pass in the pass-through-reserve values;); console.log ("You clicked:    

    Cocos2d animation on sprite and detect contact on him -


    I know how to find contacts on all my sprites on the screen. I also know how the animation is played on the phantom forever.

    But when the code is put together for animation, then with the phantom sheet - you actually add a phantom as a child, but only the phantom sheet has a phantom Is the child of the sheet.

      [[CCSprintFrankCachsharesprofifaMachet] Aadrophroughswithfile: @ "Perrott.plist"]; CCSpriteBatchNode * spriteSheet = [CCSpriteBatchNode batch nodewhitefile: @ "parat page"]; Fireball = [CCSlight Spit with AsprintFramemame: @ "Paper 1 Page"]; FireBall.position = point; [SpriteSheet addBild: fireBall]; [Add Your Child: Prasheette]; // Here is the fire from the animation action << code>  

    In the situation when looking for fireball to detect the contact - you can not find it because She has not been added as a child of the scene, but of the phantom sheet.

    How can I find out that phantom later on my code? Or is there a constellation to set the phantom sheet?

    Thank you

    You can

    1) Create a property for your fireball

    / code> Phantom:

      @property (nonatomic, retain) CCSprite * fireball;   

    and create and use self.fireball :

      self.fireBall = [CCSprite spriteWithSpriteFrameName: @ "parrot1] Use .png "]; ... CGPoint fireBallPosition = self.fireBall.position;   

    2) Add fireball as a tag on the spriteSheet tag and get it back using the same tag. [spriteSheet addChild: fireBall z: 0] Tags: 1]; ... Fireball = [Get SpreadsheetsBybuTag: 1];

    But keep in mind that the fireball position is relative to their parent, spriteSheet . Therefore, if you move the spriteSheet , you will also go to spriteSheet .

    Java string.replace(old, new) count how many replaced? -


    I have my console (image below), and I have a command that will replace all the oldest strains in the nuances. But how does it count how many of these places were changed?

    (If the code is only converted to B once, then it will be 1, but if this value is twice the value then 2)

    (This is just a part of the code, but no other part is required or related to this part of the code)

      else if (intext. StartsWith ("replace")) {string [] replist = original.split ("+"); String repfrom = replication [1]; String Rippet = Ripple [2]; Last time = repfrom; Last resort = empty; String outtext = output.gettext (); String newtext = outtext.replace (repfrom, repto); Output.setText (newtext); Int totalreplaced = 0; / / How were many replacement wires received? Message ("Total replaced:" + + + + "from" + totalreplaced + "to" + repfrom + "); }   

    my console image < P>

    You can use String.replace first and calculate it yourself:

      string outtext = output .getText (); String newtext = outtext; Int totalreplaced = 0; // Check whether there is anything to change (new! Text.replaceFirst (repfrom, repto) .equals (newtext)) {newtext = newtext.replaceFirst (repfrom, repto); Totalreplaced ++; } Message ("Total replaced:" + + "Repro +" to "+ totalreplaced +" to "+ Repo");    

    vb.net - Find a selected item in a ListBox -


    Background: I have a list box that allows multiple selections. My list box has a specific value, if selected, it requires a different code path to run and all other selections are from another path.

    Problem: I can not understand how to write it correctly in VB.NET, to the way I think it is to work for it.

    code:

      listbox1.SelectedItems in the string for each item if listbox1.SelectedItem = MyValueIf this happens then it ends then the next   

    If I make multiple selections in my list, the code does not work correctly, it only works correctly if myValue Listbox is the only selection in Box 1.

    Any suggestions?

    Your recurrence is incorrect, you should use item values ​​in your loop: < Pre> 1 in the string in listbox for each item. If the item chosen = myValue then what to do or what to do next if the next

    basically does the following for each loop: (Please excuse any syntax errors, mine VB will rust)

      Index to integer = 0 to listbox 1 Selected items Lang Diff items = List box 1. Selected items [index] next