Posts

Showing posts from September, 2012

angularjs - Iterate filters in ng-repeat -

मेरे पास दृश्य में है & lt; tr ng-repeat = "entryList में प्रविष्टि | मैफिलटर 1 "& gt; & LT; टीडी & gt; {{entry.id}} & lt; / टीडी & gt; & LT; टीडी & gt; {{entry.name}} & lt; / टीडी & gt; & Lt; / टीआर & gt; अब मैं ऐसा कुछ करना चाहता हूं: & lt; tr ng-repeat = "प्रविष्टि प्रविष्टि में प्रवेश करें फिल्टर को पुनरावृति करने का कोई अच्छा तरीका है? संपादित करें यहां है। मूलतः, मैं ng-repeat = "myfilter [myfilter1, myfilter2, myfilter3] में कुछ की तलाश कर रहा हूं (कोशिश कर रहा है कि यह सीधे सफल नहीं हुआ) - मेरा मानना ​​है कि आप इस तरह से कुछ ढूंढ रहे हैं: & lt; span ng-repeat = "fil fil फिल्टर "& Gt; & lt; tr ng-repeat =" प्रविष्टि प्रविष्टि में प्रवेश करें | {{Entry.name}} & lt; / td & gt; & lt; / tr & gt; & lt; / span & gt; और नियंत्रक पर: $ scope.filters = [myfilter1, myfilter2, myfilter3]; नोट: & lt; span & gt; के बजाय

php - Show result Select * -

I have made my SQL request in my model. Php: public function getUserForAdmin () {$ ArrayUser = $ this- & gt; BDD- & gt; GetArray ('SELECT prenom AS prenomUFA, as the nominal name, email as UFA, CP AS from cpUFA user'); Return $ array user ['prenomUFA']; } In my index.php, I call it like this $ userForAdmin = $ user- & gt; getUserForAdmin (); Resonate $ userForAdmin ['prenomUFA']; With this I have the first letter of my Paramount field result ... Output of my array: Array ([0] = & gt; Array ([Pyréném] => Cologne [name] => [email] => hj [userfarmine] => 69570) [1] => Hey ([Pyriman] => Coline [nom] => [email] => officiel@coucou.fr [userForAdmin] => 69,570) [2] => array ([prenom] = & Gt; Coline [nom] => [email] = & gt; officiel@coucou.fr [userForAdmin] => 69,570) [3] => array ([prenom] => coline [ Nom] = & gt; [email] = & gt; hjkjk [userForAdmin] => 69,570) [4] = &

eclipse - Android FB login app - invalid key hash -

I have this problem, I'm making Java in Eclipse with FB SDK Android. When I debug and run this app in the Android emulator, I can logout. But when I export the app to develop version (.apec), and install it on my phone or genomotion emulator, I get these errors: "Hem Vime Hashes has any stored key that does not match the hash xxxxxxxxxxxxxxxxxxx. Configure your app key hash at http://developers.facebook.com/apps/72012084472886 "The hack key is making correoct I use it: Try {PackageInfo info = getPackageManager (). GetPackageInfo ("com.facebook.samples.hellofacebook", PackageManager.GET_SIGNATURES); (Signature signature: info.ignatures) (MessageDigest md = MessageDigest.getInstance ("SHA"); md.update (signature.toByteArray ()); Log D. ("keyhash:", base 64.exodontostring (MD. Digit (), Base 64. Default));} Hold (NameNotFoundException E) {} Hold (NoSuchAlgorithmException E) {} Do you have any ideas, what is wrong? < / P> Tha

How do I create a lambda function to print numbers containing x and y in Python? -

I would like to make a list, in which the number ranges from 9 to 8 in ascending order, from 0 to 1000. How do I do this in Python via the lambda function? Expected output will be: [8, 9, 88, 89, 98, 99, 888, 88 9, 898, 89 9, 988, ...] I use 'lambda' not at all here, but instead of producing digits it is used: < Products ('89 ', repeat = l)] for category (int. (' '.include (d)) category (1, 4) d from pre-> irrettools import product. It performs the minimum minimum required to produce the required, hardcoded list Low. The extended version will be: results = [] # ranges from 1 to 3 points for L (1, 4) in the # range: all digits outside # 8 Combination and 9 ('89 ', repeat = l) for the digits in the product: Put # points together in a string, an integer value = int (' '.) Results.append (value) Demo: & gt; & Gt; & Gt; Import Products from Iteratolls & gt; & Gt; & Gt; [8 9, 88, 89, 98, 99, 8

c# - MVC Model and Controller for Uploaded files -

My fellow community, I have to make sure that I want to develop it correctly I am ASP.NET MVC 5 application I am working on, and while developing the application, I am studying the architecture of MVC and also to ensure that I really understand the architecture of MVC. I currently see one (see below) which will allow multiple files to be uploaded at the click of a submit button. & lt; H2 & gt; Upload multiple documents & lt; / H2 & gt; Using a single @ (HTML) beniform ("upload", "home", a form.mast.prost, a new one (an encryptpie = "multipart / form-data" one)) a M.file, a new, one type of file = "id" = "logofile" a))) one each one one one one one one  & lt; Label & gt; Privacy pdf: & lt; / Labels & gt; A @ (HTML Testbox file (model = & gt; a model.file, a new one (a type of file = "file", an id = "privacy file"}}) a one to one one one one one a & Lt; label & gt

add package to android linux system -

I have developed a new package and I am compiling it with the OPENWRT toolchain. And then I install it in the OPENWRT device. It is possible to add the package to Android Linux system , such as OpenRight, and then compile it. If this is possible then is this a link in the description? it describes you check your NDK Docs / StandDalone-ToolOnOVO Can also

constructing hemisphere in MATLAB -

Image
I had to construct a hemisphere in MATLAB, so I did this: = 5; N = 2 ^ K-1; Theta = P * (- N: 2: n) / N; PHI = (P / 2) * (0: 2: n) '/ n; X = cos (pi) * cos (theta); Y = Cos (P) * Sin (Theta); Z = sin (PI) * ones (size (theta)); Surf (x, y, z); code Was not written by me, so I want to understand it when I replaced '<'> phi = (pi / 2) * (0: 2: n) in '/ n; I get the following error: operator *: non-conformant arguments (option1x16, op2 is 1x32) please explain this That's why it is necessary .... Besides, I wanted to write a simple code to underline the hemisphere. For some less command / method, I can use any idea in matlab .... ' --Sign transfer is if you multiply a 16-by-1 array by 1-by -32, you end up with a 16-by-32 array, where the element (i, j) ith- Elements of the first array multiply with the tithic element of the second array. If you forget to move, then you are trying the matrix - multiply 1-by-16 array with 1-by-32 arr

javascript - Meteor.js return innerHTML in helper -

Is there any way that I can return HTML to the assistant? I mean something like this: text: function () {return "<< This is working! } will be more than those records, since I loop them through loop {{#each}} and I tried to do it through ZTT but classes Naming the ID / ID was a difficult time, so I can use handlebars.SafeString "post-text" itemprop = "text"> < code> text: function () {new handlar. Return ("& lt; p> It's working! "); } This will produce a secure HTML string. I do not use to avoid tripple brackets {{{...}}} is not secure if your assistant gives something from the input of the user. Meteorite in Edit: . * Use Spacebar instead of Handlebars: text: function () {New Spacebar. Return ("& lt; p> It's working! "); }

c# - .net / wcf: deserialization of an xml with xsi:type -

I have a small WCF server that received a post request with XML (note that I have no control over XML is). I can not deserialize it with any problem unless it is a xsi: type = "something" attribute Whenever I try to sort my class, anything works (Even XSI: type attribute). XML: & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Node1 Att1 = "" Att2 = "" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" XSI: type = "SOMETHING" xmlns = "http: //www.CIP4Org / JDFSchema_1_1 "xmlns: xsd =" http://www.w3.org/2001/XMLSchema "& gt; & Lt; Node2 / & gt; & Lt; / Node1 & gt; When I send this XML, the server throws a bad request (400), but if I remove "xsi: type =" SOMETHING ", then ever works . What does the server send when I ask for a serialized class: If the serialization works well, why not do deserialization? Here'

.net - XML Data Search -

I have XML (static data) with the size of 30 KB Each level has its sub-fields I need one Finding the element that matches my input and retrieving the SOBU-field. I do not manipulate any data on it and update the file. In this case, which would give better performance in XPATH or XML Serial Pest? Many resources say that XML serialise will be good, but I'm not sure who can choose for my position. Use new types in System.Xml.Linq to query you efficiently Using XML queries without bloat your LINQ queries. This is a good starting point:

mongodb - Mongo increase latency tolerance -

I have a capture tool that captures approximately 1000 50-byte data records per second, they are actually a MongoDB The archive stores the time within 1 gigabit Ethernet network I want to take the server to the Internet, i.e., the capture source and the Mongode database will no longer be on the same LAN. Although the throughput is still likely to be adequate (I have 100 Mbps bidirectional service between two digits, and the capture rate is 1000 * 50 * 8 = 400 Kbps, here are many orders of headroom magnitude, even the upper part In large quantities), the probability of latency is to be a problem Can I tune Mongo so that it confirms every writing for a few seconds, which can be used to address latency issues. Be able? Does Mongo confirm every writing? All of my tools are written using Python in Python, which every time a data point event occurs, atom writes. Do I have to manually batch? is the concept of Mongo, which basically tells you how important it is to write a Inste

git - How to create a GitLab hook to reject code pushed by 'root' user? -

I work with a disciplined team and one of the developers likes to push code as 'root' user . We need to add a gitlab hook which rejects the incoming 'root' user I have read and neither feels like the right direction. Can any of you gitlab master help me? You need to create a server side pre-fetch hook Will investigate. You can do this with a script like: s <$ p> refname = "$ 1" oldrev = "$ 2" newrev = "$ 3" $ $ (git rev-list $ { oldrev} .. $ {newrev}) git log $ {sha} --format = "% ae% ce" -1 Grep 'root @' if [$? -Ece 0] then echo "Root $ {sha}" to a root email address. Please use your user credentials! "Git log $ {sha} - format ="% ae% ce "-1 exit 1fi: or you can call it a ruby Create a version, to browse using your API

ios - UISplitViewController created programmatically doesn't have swipe gesture to show/hide master -

I am struggling in a very strange case: I have created a UISplitViewController self.splitViewController = [[UISplitViewController alloc] init]; Self.splitViewControllerPresentWithGesture = Yes; UIViewController * Master = [[UIViewController alloc] init]; Master.view.backgroundColor = [UIColor yellowColor]; UINavigationController * navMaster = [[UINavigationController alloc] initWithRootViewController: Master]; UIViewController * Extension = [[UIViewController alloc] init]; Detail.view.backgroundColor = [UIColor redColor]; UINavigationController * navDetail = [[UINavigationController alloc] initWithRootViewController: Description]; Self.splitViewController.viewControllers = @ [navMaster, navDetail]; Self.window.rootViewController = self.splitViewController; [Self. Windows and knowledgeable]; But the swipe gesture to show / show master view controller (like in a mail app) does not work in iOS7 but works in iOS8. If I create a new project from the master / extension template t

c++ - Print value of a JSAPIWeakPtr -

मैं std :: map & lt; int, FB :: JSAPIWeakPtr & gt; के सभी तत्वों को मुद्रित करने का प्रयास करता हूं। एपीआईमैप; कोड का उपयोग: शून्य प्रिंटमैप () {std :: map & lt; int, एफबी :: जेएसएपीआईवाकपीट्र & gt; :: इटरेटर पी; P = apiMap.begin (); (; P! = ApiMap.end (); ++ p) {std :: cout & lt; & lt; "इंट है:" & lt; & lt; p- & gt; पहला & lt; & lt; endl; Std :: cout & lt; & lt; "एफबी :: जेएसएपीआईवैकपेट है:" & lt; & lt; पी- & gt; दूसरा & lt; & lt; endl; }} लेकिन मुझे नीचे दिया गया त्रुटि मिलती है: फ़ंक्शन में ??? शून्य प्रिंटमैप () एक ????: त्रुटि: नहीं एक ऑपरेटर के लिए मैच & lt; & lt ;? एक '' स्टड :: ऑपरेटर & lt; & lt; [_Traits = std :: char_traits & lt; char & gt;] ((& amp; std :: cout), ((const char *) "नक्शा है:")) & lt; & lt; p.std :: _ Rb_tree_iterator & LT; _Tp & gt; :: ऑपरेटर & gt; [_Tp = std :: जोड़ी और lt; const int के सा

iOS UIProgressView with 2+ colors -

I am developing an iOS app to show the whole disk space, available disk space and disk space itself I am I've successfully shown the available disk space in the total disk space and UI displayed footage but I need to show the app usage space in the used space. What option would be used to show the location of the app used? You can put a second UIProgressView on the top first, your track To make the tintar transparent and set your progress to minimize the two values ​​that you want to show.

android - How to declare intent,class,buttons in one loop? -

यह क्यों काम नहीं करता? सार्वजनिक वर्ग मुख्य गतिविधि गतिविधि को बढ़ाता है [बटन] बी = नल; आशय [] इरादा = नल; वर्ग [] क्लास; टाइपफेस फ़ॉन्ट; टेक्स्टव्यू ग्लोवनिनस्लोव; छविदृश्य देखें, लैजुनीस्टी; एनीमेशन ड्रॉएबल प्लेवीयन, लैजुनीशियन; स्ट्रिंग [] नास्लोवि; Int i = 0; @ ओवरराइड संरक्षित शून्य को क्रिएट (बंडल सहेजा गया इन्स्टैंसस्टेट) {सुपर.नक्रेट (सहेजे गए इन्स्टेंसस्टेट); setContentView (R.layout.activity_main); स्ट्रिंग [] नास्लोवी = {"", "प्रथम", "दूसरा", "तीसरा", "चौथा", "पांचवां"}; Font = Typeface.createFromAsset (getAssets (), "फैटमार्कर। टीटीएफ"); B = नया बटन [] {(बटन) ढूंढिए वीवीआईबीआईआईडी (आरआईडी.बटन 1), (बटन) ढूंढिए वीवीबीआईआईडी (आरआईडी.बटन 2), (बटन) ढूंढिए वीवीबीआईआईडी (आर.ड.बटन 3), (बटन) ढूंढिए वीबीआईआईडी (आर। Id.button4), (बटन) ढूंढें वीबिबआईआईडी (आर.ड.बटन 5),}; के लिए (i = 1; i & lt; 6; i ++) {klasa [i] = वर्ग। ForName (naslovi [i]); // समस्या में है: "वर्ग नहीं मिला अपवाद" इरादा [i] =

linux - For loop finding more files than it should -

I have the following for a loop in a small shell script that I wrote. For the name in the file /home/place/incoming/MYSQLIST_*.zip name = `echo $ file | awk -F "MYSQLIST_" {'print $ 2'} `#get Type name = 'Echo $ name | Unkip the extension $ {file} -d / home / place / incoming / name = gt; & Gt; Collect.txt directory = `resonance / home / location / incoming / $ {name}. Csv` $ directory & gt; & Gt; Collect.txt #cleanup rm $ {name} .csv rm phpvars.txt mv $ {file} $ {file} Dot done This script works as most of the time I have such files that come in this directory coming in the form of MYSQLIST _ #### Zip and MISQL _ ####### zip. As we would expect, this script should ignore files named MYSQL _ ## ###### Zip I have seen that the full name for the loop is to write the name MYSQL _ ######## to remove the zip and collect it. Usually my collect.txt will be: Type_21345 /home/place/incoming/type_12345.csv However in some cases, this is what wa

html - Search input and button not aligning horizontally properly -

While giving a minimum width for a responsive button, I use a form text input and buttons on the same line horizontally Layout trying to align For a reason the minimum width button brings to a new line . Search-container {width: 100%; Limit: 1px solid # 000; Display area; }. Search-Text-Container {Width: 90%; display: inline-block; }. Search-Text-Container Input {width: 100%; Height: 30px; }. Order Icon- Container {Width: 10%; display: inline-block; }. round-icon-button {min-width: 30px; Display area; Width: 30px; Height: 30px; Line-height: general; Border: 2px solid # f5f5f5; Limit-Radius: 50%; Color: # f5f5f5; Text-align: center; Text-decoration: none; Background: # 464646; Box-Shadow: 0x3px Gray; font-weight: bold; }. Round-icon-button: hover {background: # 262626; } & Lt; Div class = "search-container" & gt; & Lt; Span class = "search-text-container" & gt; & Lt; Form action = "" & gt; & Lt; Input type = "text"

python 2.7 - Adding attributes to form labels in Django 1.5 -

I have some code that looks like: # form.html & lt; Form action = "/ form-action" method = "post" & gt; {{Form.faction.label_tag}} {{form.faction}} & lt; Br / & gt; {{Form.character_name.label_tag}} {{form.character_name}} & lt; / Form & gt; #Form.py class characterform: function_OICES = (('SIth', 'Sith Empire'), ('Republic', 'Republic Alliance')) group = form. Chargefield (option = function_choose) character_name = form .CharField (max_length = 100) Although I have to be a specified square on the label tags on the HTML output. I know I can: & lt; Form action = "/ form-action" method = "post" & gt; & Lt; Label = "id_faction" class = "foo" & gt; For {{form.faction.label}}: & lt; / Label & gt; {{Form.faction}} & lt; Br / & gt; & Lt; Label = "id_character_name" class = "bar" & gt; For {{form.character_n

algorithm - Union grouping in bipartite graphs? -

I am trying to find a good (and faster) solution to the following problem: My There are two models with whom I am working, let's call them players and teams, one player can be on several teams and there are many players in the team). I am working on creating a UI element that allows a user to select multiple teams (checkboxes). As the user chooses (or unselected) teams, I want to show teams grouped by players. For example: If there is no player involved in selected teams, each team has its own section If the user selects two teams and they have the same player, then in one section both the teams and all the players will be named. If players in TEAM_A [1, 2, 4, 5] and TEAM_B are players [1, 3, 5, 6]. The following sections will be: SECTION_X = [TEAM_A, TEAM_B, 1, 5], SECTION_Y = [TEAM_A, 2, 3], SECTION _Z = [TEAM_B, 3, 5] I hope it is clear, essentially, I want to find teams that are similar to players and in the group. I was thinking that there is a way to d

python - Jinja2 Extension Tag within another Tag -

I'm tring to do something {% mytag country "Italy" year "2014"%} workday {% holyday}} no working day {% endmytag%} But the holy postal tag is optional. It should also work: {% mytag country "Italy" year "2014"%} workday {% endmytag%} I wrote the code < / P> class matag extension (extension): tag = set (['mytag']) def __init __ (self, environment): super (translation extension, itself) .__ init __ (environment) def Parse (self, parser): lineno = parser.stream.next (). Lineno if parser.stream.skip_if ('name: country'): country = parser.parse_primary () other: country = nodes.Const (None) parser.stream.skip_if if ('name: year'): year = parser. Parse_primy () Other: Year = Nodes Consest (none) Argances = [country, year] # body1 = parser.parse_statements (['name: holyday']) # Not working :) body = parser.parse_statements (['name: endmytag'], drop_needle = true ) Return nodes. Callbloc

copy - Batch: Relative directory/path -

I made a small harmless batch virus (a mischief), it's finished (on USB), but I'm not Wanted to manually copy it and then I ran for a problem ... There is a way to copy files relatively, where is the actual batch file? Something like this : Copy "~ Virus.bat" "% appdata% / microsoft / windows / start Menu / programs / startup " instead of copy" g: \ files \ folder 1 \ folder 2 \ virus.bet ""% appdata % / Microsoft / windows / start menu / program / startup " If someone can help you ... thanks < / Strong>! can solve your problem, but a small answer to copy your file Using% ~ dp0 As stated, this will give you the current path. Try it: Copy "% ~ dp0Virus.bat" "% appdata% / microsoft / windows / start menu / program / startup" < / Pre>

objective c - Full responsive UIView inside a UIScrollView using autolayout -

Image
I'm trying to understand how works under XCode6, but my mind is far away from the mysterious things that run away. Autolayout and obstacles can be very difficult to learn philosofy, but I realized that using these tools can be a lot easier ... For your information, give me a table (message) and A visual field (Message Send panel) that is nested in the UIView View view again in UIScrollView, so I can make changes to the scroll view as it appears under the text of the keyboard. I've read a lot of tutorials and lots of videos until I have found useful tutorials. Github has an Xcode project that explains the tutorial, too. In my tutorial, Mike Vommelr states that In the old way of setting up a UIScrollView, one of the major pain points is communicating in a scroll size to the scroll view Was there. If the content of the UIScrollView was an image, then it was quite simple to calculate your content size. But it was not easy that your scroll view included a mixed bag of butto

openWRT basic auth system -

I am trying to implement a very basic ATH system which uses non-password routers (TP link TL- 841ND) On the form post for a URL, the TP link has opened the OpenWRT. I have searched around and have evaluated some options such as chilli, coba-chilli, wafidog, but as far as I can understand that they require radius on an external server I was thinking that it is possible to get it using iptables or traffic rules, desired stream: Users try to use the URL Users Post the form to www / where the html form live User URL [myauthservice.com] (only allowed IP) The URL received from [Jason, XML] The router allows users to browse freely on their internet for the session Any ideas, suggestions are welcome! Have you tried Nodogsplash? Authentication Part: Installation:

ruby on rails syntax- when does : come before v. after the variable? -

Perhaps obvious; I am very new to rail. My question: Is there a rule or a simple way of remembering when a colon comes before or after a variable? An example of what I'm talking about with my application_controller . with protection_from_forgery :: exception I with : v. the : exceptions . Is there a way to remember when the colon arrives at the end, and when it comes in the beginning, or is it something that you miss on a variable-to-variable basis? Besides, why have both been found here in a row? I really want to understand this :) Thanks! with: exception: syntax is only for : Together = & gt; : Exception There is no real benefit other than the feature and less typing. If you need to continue supporting Ruby 1.8, then logic can be argued. You should continue to use the old syntax. You must feel in the example provided protect_from_forgery: This is a method that passed single variable It is being done, which is going to be a hash. So are the

printf - change display format for all string variables to as short as possible -

After compress in my data, I have the storage type str4 > Or str1 and format % 9s . I would like to return all of them to the default display format, which should be str # for help dformat report % # s . Is there a quick way to do this? This is my best estimate: DS, is (type string), foreach v variche `v (variants) v) '{format} v'} < / Code> This does not work because, instead of redefining the default value with this command, the format function displays only the format. A copy presenter example: clear input str50 mystr "b" "one" end compress format format myst This is the situation I had to face. I'm not sure that this applies beyond the formatted variables (Roberto suspects that it is not, see comments.) Appendix . My goal here was to browse - simplifying my data It seems that format is awarded in the browser (for the length of one for% 1s Cut, to say), while while printing on the console it is overridden wi

c - Getting a stack overflow exception when declaring a large array -

निम्न कोड मेरे लिए एक स्टैक अतिप्रवाह त्रुटि उत्पन्न कर रहा है int main (int argc , चार * argv []) {इंटी चावल [2000000]; वापसी 0; } मैं इस के आसपास कैसे प्राप्त करूं? मैं टर्बो सी ++ का उपयोग कर रहा हूं, लेकिन अपना कोड सी में रखना चाहूंगा संपादित करें: सलाह के लिए धन्यवाद उपरोक्त कोड केवल उदाहरण के लिए था, मैं वास्तव में एक समारोह में सरणी को घोषित करता हूं और उप मुख्य में नहीं। इसके अलावा, मुझे सरणी की ज़रूरत होती है ताकि शून्य पर इनिशियलाइज किया जा सके, इसलिए जब मैंने मॉलोक को गोल किया तो मुझे पता चला कि कॉलोक मेरे उद्देश्यों के लिए एकदम सही था। मॉलोक / कॉलोक के पास मुझे अनुमति देने के स्टैक पर आवंटित करने का फायदा भी है एक चर का उपयोग करके आकार को घोषित करने के लिए। आपकी सरणी स्टैक में फिट करने के लिए बहुत बड़ी है, विचार करें ढेर का उपयोग: int * चलनी = मॉलोक (2000000 * आकार (* चलनी)); यदि आप वास्तव में स्टैक आकार को बदलना चाहते हैं, तो टिप : - अपनी गतिशील आवंटित स्मृति को मुक्त करने के लिए मत भूलना अब जरूरत नहीं है।

importing files from a different git repo - Python -

मेरी मूल निर्देशिका पर, मेरे पास निम्न git रिपॉजिटरी हैं: / root / एक अजगर फ़ाइल, मान लें कि hello.py में, /root/foo/scale/hello.py < / Code> को / root / foo-lib नाम से bar.py ( /root/foo-lib/lib/bar.py ) अंदर hello.py मेरे पास हो सकता है: परीक्षण के रूप में scale.test आयात करें ... और कई अन्य हालांकि, मुझे उस फ़ाइल में bar.py लाइब्रेरी आयात करना होगा, जो एक अलग रिपॉजिटरी में है। मैं यह कैसे कर सकता हूं? मेरी hello.py फ़ाइल में आयात करें foo-lib.lib.bar बार की तरह मुझे कुछ चाहिए। मुझे यकीन नहीं है कि यह कैसे हासिल करना है। क्या कोई मुझे एक सुराग दे सकता है? आप एक फ़ाइल बना सकते हैं / root / __ init__.py , और /root/foo/scale/hello.py के भीतर, आप कथन का उपयोग कर सकते हैं import ... foo-lib.lib। / root / foo / scale / निर्देशिका के भीतर एक सिमलिंक बनाने के लिए एक और विकल्प है, / root / foo-lib की तरफ इशारा करते हुए

javascript - Turn off (Ignore) placeholder attribute in html text/search elements -

If possible, I would like to be able to turn the placeholder on / off from my search box. & lt; Input type = "text" placeholder = "enter name" /> & Lt; Input type = "search" placeholder = "type to search" /> What I have tried so far: Input [type = "search"] :: - WebKit-Input-placeholder {Content: "" ; Red color; / * Test selector * /} JSFiddle same The path is to do with an angle: In the controller: $ scope.placeholder_value1 = ""; // blank $ scope.placeholder_value2 = "some value"; // some value In this view: & Lt; Input type = "text" placeholder = "{{placeholder_value2}}" />

ignore - Generic error messages when compiling basic program through mac terminal -

I had a dumb problem that was very vague, poorly explained, and this thread is worthless to someone else Delete. It seems that you have pasted everything from the terminal of AMX in the encoded editor, in it Below the status bar Emac Print (which is not part of your code). Delete everything at the end of the file from -U . In the future, save the file in Amex (such as on a flash drive or on online storage) and open it instead of copying and pasting, Xcode (or whatever editor you choose) Will be deducted; And besides, you can have a program more than a day. I should add, if you are interested, then AMACS works fine on the Mac, it's actually a version included in OS X, though it is too old; For the current version, there are some options to choose from, the most popular of which seem to be the most popular and the main difference is that Aquamacs do something else like a Mac app in the operation of a keyboard shortcut and similar things; But there are a number of key

r - new font style for stargazer latex table when using knitr -

मैं मोनोस्पेसस फॉन्ट में stargazer () से उत्पन्न लाटेकस टेबल को मुद्रित करना चाहता हूं, और मुझे चाहिए इसे बुनना (यानी कोई मैनुअल लेटेक्स कोडिंग) के साथ एक प्रतिलिपि प्रस्तुत करने योग्य तरीके से करने के लिए। मैंने mymono नामक वातावरण को परिभाषित करने की कोशिश की और उसके बाद इस कोड में \ begin {} और \ end {} के माध्यम से बुनना का टुकड़ा लपेटो। यह काम नहीं करता; तालिका डिफ़ॉल्ट फ़ॉन्ट शैली में प्रिंट करती है। \ documentclass {आलेख} \ newenvironment {mymono} {\ ttfamily} {\ par} \ begin {document} & lt; & lt; lm, echo = FALSE & gt; = df & lt; - data.frame (x = 1: 10, y = rnorm (10)) पुस्तकालय (stargazer) lm1 & lt; - lm (y ~ x, डेटा = df) @% reproducible \ start { Mymono} & lt; & lt; table_texstyle, echo = FALSE, परिणाम = 'asis', message = FALSE & gt; & gt; = stargazer (lm1, label = "test") @ \ end {mymono} \ end {document} मुझे नहीं लगता कि stargazer () में font.size को छोड़कर एक फ़ॉन्ट सेटिंग है। # & gt;

javascript - Is there a dynamic module loader for AngularJS that uses convention over configuration? -

The most dynamic modules I can find are not really dynamic and are actually lazy loaders because they are important That you want to register in the config files and registers. I am looking for ways to use the Convention for a Loader JS and for my One Page App, loading anything under the folders. Something like this: the app public loader.js & lt; - Anything manually modules module 1 controller controller controller1.js controller2.js instructions directive1.js directive2.js services service1.js service2.js view view1 no need to register Js view2.js Use caution here that you want to place loaders.js in your public folder. You only want to work with server side tools because you can not read your file system with the browser (without server side support). So you do not want to expose the loaders.js file to the public. The thing about the module is that they help you to give some clarity to your application. Of course, you do not have to use it (angular way, though

javascript - Why does this json string fails to parse -

Maybe I can not see it now, but why is it unable to parse Jason string? (Since its validity) var content = $ .parseJSON ('{"foobar": "halo \" tow "}'); < p> Because you are creating JSON in that string literally, you \ needs to be avoided: var content = $ .parseJSON ('{"foobar": "halo \\" tow "}'); Console.log (content); Explanation: In JSON, " character \ avoids the use of characters The following are completely valid JSON: {"foobar": "hallo \" tow "} Now, in your example, The values ​​within a JavaScript string were created: '{"foobar": "hello \" tow "}' This is a subtle Issue due to which the fact is that the javascript string also escape " with the letter \ characters Student. That is, the following string is literally: '' ... assumes the value: "< Now, after re-implement

regex - Java scoping issue -

Can anyone see my code and try to help me figure it out? This is a regex app that parses user commandline questions. Public class interrupt commmissions {public static zero major (string [] args) {string A; Command c = new command (); Java.util.Scanner Reader = New Scanner (System.in); System.out.println ("Enter command:"); A = Reader NXtine (); // Scanning string user input string line = a; // command command string pattern 1 = "(? Lt; =) - ([o] \\ s). Filter order string pattern 2 =" (? & Lt; = (-) ([ F] \\ s). // Create Pattern Object Patterns r1 = Pattern.compile (pattern1); Pattern r2 = Pattern.compile (pattern2); // Creating Matter Objects Mater M1 = R 1. Matter (A) ; Matcher M2 = R 2. Mattere (A); // If order match (m1.find ()) {string s1 = m1.group (0); println (s1); ** it works ** System.out.println (c.returnActions1 (s1)); ** says that the print is not applicable for debate **} and if (m2.find ()) Writing s2 = m2.group (0); println (s2); ** This

javascript - HTML5 Geolocation Altitude -

I was playing with the HTML5 Geolocation API for the project I was working on. Latitude and longitude are reported correctly, but the height always returns as 'empty' The test device is device 4 and 5, is there anybody else Are there similar problems to this API? Absolutely! It seems that there is a problem which might be browser specific, because I am both developed on the iPhone and Android, so try my HTMX apps on the default browser (Safari and Android web browser). My new iPhone raises the height of the 5S, but my Samsung Galaxy S4 has been displaying "blank". I made a native Android app version of my program to make sure that this device was not a problem. It comes back with my height just fine. There is no answer, but research in the form of height is still important to us. I too have verified using the Chrome browser on the same phone (S4); No height using my original app.

ruby - Connection refused when using Pony Mail & Sinatra -

I have a lot of trouble with Pony Mail Mani to work with my Sinatra website (posted on Heroko). I am targeting to create a basic contact form where a visitor can fill email and subject, their email and phone number, and this form will send information to e-mail to customers. Here is the code for the form: & lt; Form action = "/ emailform" method = "post" & gt; & Lt; P & gt; We would love to hear from you! & Lt; / P & gt; & Lt; Input type = "text" placeholder = "your full name" name = "full_name" & gt; & Lt; Input type = "text" placeholder = "your email * required" name = "email" & gt; & Lt; Input type = "text" placeholder = "your phone number" name = "phone number" & gt; & Lt; Input type = "text" placeholder = "topic" name = "topic" & gt; & Lt; textarea rows = "5" cols =

Easiest way to create a color gradient on excel using python/pandas? -

Image
Then I have data that I'm output to Excel file using Excel's Excel spreadsheets. After output to the entire data excel file, what is the easiest way to use conditional formatting for python programming? I want to be able to select all filled cells in excel sheet ("in Excel") (via Python) and click on "conditional formatting"; Color scales have a gradient of colors depending on the end result values, if you do, then "heat map". This is the data I am creating: writer = ExcelWriter ('data' + today + '.xls') ... data processing. . Df.to_excel (author, sheet_name = 'model', startrow = start_row, index = false) After writing the data, use a python to implement conditional formatting Way. To make it simple, I want the color should be a darker color than the colors of blue and more positive (& gt; 0), and the red negative values ​​(& lt; 0) and the cell white if value 0 is. I tried xlsxwriter (hopefully expec

debugging - how do i debug a java ant program, so that I understand the flow of the program? -

Hello, I'm new to Java and I have a question about Java debugging, so I've recently caught a Java anti code. So, I can debug how to understand the flow of the program. Generally I debug small code but this time I do not know where it starts and where it ends. So what is the ideal way to understand the flow of Java programs. You can use and integrate the development environment (IDE) such as Eclipse or Intelligence J for debugging a lot Good support. What do you mean really with "Java Anti Code"?

hibernate - Where should I write my criteria queries in a Grails Project ? In the Service layer or in the Domain Models? -

I am currently working on a Grails project and I have to write some questions using the Hibernate criteria. Where and Why Should I Write Hibernate Criteria Questions? Is this service level? Or would it be a better idea to avoid the anemic domain model and to write the named questions there? Or, should I create a separate layer under the service layer? A short answer is " it depends ". The long answer is " It depends on how you are structuring your application ". If you plan to employ everything at a service level, then a service level is a good place to keep your questions. If you plan to use the same question from multiple services or chaining, then they understand more than the named queries on the domain class. Therefore, "it depends" how your app is designed. Either there is an acceptable place to put questions, as long as it meets your needs and facilitates the code reuse.

java - Rendering textures causing memory leak -

I have this code inside my game. It provides a texture that acts as a button: Private Zero Leftstart () {startTexture = New Texture (Gdx.files.internal ("start.png")); StartTexture.setFilter (Texture Filter.Linayer, Texture Filter Lighter); StageStart = new phase (); StageStart.clear (); Button start = new image (start style); ButtonStart.setX (10); ButtonStart.setY (Gdx.graphics.getHeight () / 2.75f); ButtonStart.setWidth (Gdx.graphics.getWidth () / 4); ButtonStart.setHeight (Gdx.graphics.getHeight () / 4); Gdx.input.setInputProcessor (stageStart); Button start.edListener (new clickistener) {public boolean touchdown (input event event, float x, float y, int pointer, int button) {currentState = GameState.RESET; startTexture.dispose (); Phase: start.expose (); Return truth; }}); StageStart.addActor (buttonStart); StageStart.draw (); StartTexture.dispose (); } However, whenever I put the drawStart (); In my render method, the Java heap and the original pile gradually

Refactor rename custom annotation class member fields in java using eclipse -

I created custom annotations for class member fields in Java, for example public class A {@Set personal string tempString = "hello"; } file b. In Java, use public class B {@ personal string txtstring; } The AJAV member field tempString is set to "Hello" in the file and I am assuming it in the file. Both of these annotations work fine. Now I would like to know that the variable in "Eclipse" is a way to change the name of "tempstring" by which I am moving to agav tempString -> Temporarily rename it tempString automatically - & gt; Temporary in seed production? If not, how can this be achieved? Two variables tempString are not related to "related" in Java terms. The compiler can not see that one uses each other and can not find a logical connection between its two annotations. So Eclipse Refactures can not do this. If you want to achieve this kind of refactoring, then you have to develop your own Eclip

c++ - Move the string out of a std::ostringstream -

अगर मैं एक स्ट्रिंग का निर्माण करता हूं जो कि std :: ostringstream : std :: ostringstream ss; अहस्ताक्षरित int s = floatData.size (); (अहस्ताक्षरित int i = 0; i & lt; s; i ++) {एसएस & lt; & lt; फ्लोटडेटा [i] & lt; & lt; ""; } फिर मुझे एक परिणाम std :: string में मिलता है: std :: string textValues ​​(ss.str ()); हालांकि, यह स्ट्रिंग सामग्री की एक अनावश्यक गहरी कॉपी का कारण होगा, क्योंकि ss का अब और उपयोग नहीं किया जाएगा। क्या कोई है पूरी सामग्री को कॉपी किए बिना स्ट्रिंग बनाने का तरीका? std :: ostringstream अपने इन-मेमरी बफर तक पहुंचने के लिए कोई सार्वजनिक इंटरफ़ेस प्रदान नहीं करता है, जब तक कि यह गैर-पोर्टेबल pubsetbuf का समर्थन करता है (लेकिन तब भी आपका बफ़र तय-आकार, देखें) यदि आप चाहते हैं कुछ स्ट्रिंग स्ट्रीमों को यातनाएं, आप संरक्षित इंटरफ़ेस का उपयोग करके बफ़र तक पहुंच सकते हैं: #include & lt; iostream & gt; # शामिल करें & lt; sstream & gt; #include & lt; vector & gt; Struct my_stringbuf: st

nokogiri - refactoring Ruby scraping code -

Actually, I have multiple .main_entry blocks on each page and I get data from each one How can some pieces of this be properly re-implemented? 'Open-yuri' is required 'nautygri' url = #url doc = Nokogiri :: HTML (open (url) doc.css (". Main_entry"). Text = "item_at_css" (".list_artist"). Text title = item.at_css ("list_album"). Text "# {artist} - # {title}" closing I have come down to this disturbance, which removes undefined local variable or method 'release' error < / code> error is written more than the methods. Can you explain to me how the code given below is done, why it breaks down and what should I do to decide? Should each .main_entry block be saved before saving in a cache or an array? Requires 'Open-Yuri' requires a 'nautguri' class Scraper def initialize (url) @url = url end def release @release || = Doc.css (". Main_entry") || [] End-release text end-def

php and the "white page of death" - would it apply to API too? -

I have done a little PHP and I had a fair share of "white pages of death". Some friends are working on a server API they want to implement with PHP. API concepts are independent modules but they will be deployed on the physical server running the same API instance. So my question: will these modules really be independent? Will "white pages of death" probably not apply to the API? They say that they will be independent classes for each module, but my guess is that they all will run in the same php memory space - so if there is a serious flaw in a module (one of the worst cases is the white page of the trigger trigger) , Then it affects all the other modules, as well as bring them down effectively? If I present this question as a less experienced php boy, and if more information will be needed properly the answer to this question. AFAIK They also do not use a framework, it's all handish. There is no "single php memory place" in each HTT

How to do readable.pause() in node.js so that readable.on('end', function(){}) is not emitted? -

I am consuming a bunch of data in my express node. Js app. Before taking more data, I have to wait to complete one of my operations. req.on ('data', function (data) {req.pause (); do_my_thing (); req .reume ();} req.on ('end', function ( } {do_my_finish_thing}}} The problem is that req.on ('end', () {}) is still called whenever I stop the stream. There is no way to prevent that ('end', () {}) is not emitted? What you should do, but 'do_my_thing' function will be executed with asynchronous, therefore, it is almost instantaneous You can resume stream in do_my_thing callback: function do_my_thing (callback) {// your work callback () ;} req.on ('data', function (data) {req.pause (); do_my_thing (function () {req.resume ();})}} req.on ('end', function () {do_my_finish_thing }}}

javascript - What is the most straight-forward way to use Ember.js for just one part of a Rails app? -

I want to develop a rail app with a full administrator suite, authentication, authority etc. This is a pure rail, but I want to be a part of the app that is 'real time' and where data is connected to data, and I want to use amber for it. For example, I have a company model, which is _my parties , and party's_new guests . I want to navigate to a company page to be able to log in to a user for which they are authorized, and company /: id Click on the link / party /: id / live , which will be a page featuring an amber.JPG app which provides details of all guest in the party. This database will interrogate every X seconds, and the Amber.JPG app will automatically reflect the updated data (such as a part of the page only shows guests where guest.status == in_attendance or something like this) . So my question is: Is there any standardized or proven way to include Amber in a part of a railway app in this way? Thanks! To embed the amber application, you shou

c++11 - C++: Overloaded template alias -

There is currently a special standard library programming, and I think it is necessary for me in a particular case: named place std {// key, value template & class; Class K, class V & gt; Vector_map = other_name location :: vector_map and lieutenant; K, V & gt; // key, value, compare template & lt; Class K, Class V, Class C & gt; vector_map = other_namespace :: vector_map & lt; By using V, C & gt; } This works, however, does not work, does not surprise. But what are my options to achieve this? I have thought of using the preprocessor, but I want to know what you think people think. I want to be able to select aka template category in another name, if possible. The solution (in my case) was to add a default value instead of several values: name space std {// key, compare prices, templates; Square k, class V, square c = default_mountain & gt; vector_map = other_namespace :: vector_map & lt; By using V, C & gt; } " Use the t

c - Read the next line of a file every time a function is called -

I have a text file with numbers in each row, I want to type the function in C which reads in the file and the function Every time in the function gives the next number. For example, if I have these numbers: 100 200 300 400 and get_number (), a function called, If I call get_number (), then it will return 100, if I call it again, then it will return 200, etc. This is what I have written so far, but the function is called every time, it always goes to the first number in the text file. int * get_number () {FILE * file = fopen ("random_numbers.txt", "r"); Four line [256]; If (file == NULL) {perror ("Error reading file"); } Other {fgets (line, size (line), file); printf ("% s", line); } Return 0; } Here is a version that actually does: < pre> integer * get_number (long * position) {FILE * file = fopen ("random_numbers.txt", "r"); Four line [256]; If (file == NULL) {perror ("Error reading file"

Lookup hour on DateTimeField Django -

I have a model class items (models.model): inicio = model < / Code> When I try to query this: itens = Item.objects.filter (inicio__hour__gte = 6) This gives me: FieldError unsupported lookup 'hour' is not allowed for DateTimeField or joining in that area. How can I query this? You need to filter using timeliness: Date time to import from time to time, timeliness five_houri_gue = date time.Now () - timeliness (hours = 5) item = item.Object. FILTER (inicio__lt = five_hours_ago) You can always specify an exact date time and then decrease it for 5 hours if you do not want 5 hours from the current datetime. According to my best knowledge, and accordingly, you can do an exact search for only one hour, minute or second.

java - warning: Supported source version 'RELEASE_6' from annotation processor 'org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor' -

So I was working with some new changes in my code and decided to clean and create and all this Bologna found. .. I recently added a new pu and my firmness Based on the XM based on a DB like using my Netbeans IDE for my first time and I am having some questions when I get an error and clean and construct me I am not sure what might be the reason for this, I tried to search for anything that was looking for an answer as @SuportedSourceVersion and found something with it. It is very upset and upset, Warning: Annotation Processor 'org .eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor 'source than source 1.8' Note: non-static metadata to factory ... error: com .sun.tools.javac.code.Symbol $ winding failure: sun. did not L.logging.PlatformLogger class file for uti consult the following stack trace for an annotation processor threw without exception details Java.lang.RuntimeException: com.sun.tools.javac.code.Symbol $ CompletionFailure : Sun.util.