Friday, 15 March 2013

osx - remotely access linux folder through mac finder -


I am trying to see if there is a way to mount my Linux folder through my mac. I am using Mac OS X and using Red Hat 5.5 on my Linux.

My main purpose is to use my files locally on my Linux box on my Mac.

Easiest way : That is, if you already have one Setup on SSH server's Linux box (super easy for setup), use it like SCP client. When connected, make sure to select the SFTP (SSH File Transfer Protocol) and then use the login credentials of your Linux box.

Preferred method : Connect to Linux box and that part from the Mac using the Go -> "Connect to Server" option in the OSX File menu. SBB in the website field: // [Linux box IP] / [share name] /.

Now, none of these methods will work on other networks (from a remote) until you install the Linux box outside the world, a dynamic DNS set up and your router to your own By using something on the port-forwarding lines in the box.


sqlite - Building Sqlite3 with R*Tree on OSX -


I'm trying to make SQLite R * Tree module on OSX. Some of my Mekfail relevant parts here

  Sifelaji = -Ol -DSQLITE_ENABLE_RTREE = L = Sfaeljis -dielel -lpthread ################# # ################################################### #########% .o:% .c GCC-C $ (CFLAGS) $ & lt; -O $ @ # SQLite3 shell for shell for administrative purposes: shell c. Sqlite3.o gcc $ (Sfaeljis) -A Selkaut shell. C sqlite3.o  

However, R tree is still not available in my homebrew and sqlite3 using R Has a copy of The tree works fine on it though, I'm not sure what is wrong when I create the integration


c# - How to bind a collection of nested dictionaries to a TreeView? -


My Nested Dictionary is a collection of objects. The following structure appears in each dictionary:

  [Title] - & gt; String [Child] - & gt; Dictionary & lt; String, Object & gt; | | [Title] - & gt; String [Child] - & gt; Dictionary & lt; String, Object & gt; | | ....  

And so on, the last element of each 'path' which does not have only [title] entry (no child).

With the Xaml below, the complete collection is shown with each node, but I do not get any exception, in which there are no node leaves.

It seems, how can I say this, as if I am seeing a level ahead of bounding the current level but my tree view shows the element before the entire collection. What's wrong

  & lt; TreeView ItemsSource = "{Binding Item}" & gt; & Lt; TreeView.ItemTemplate & gt; & Lt; Hierarchical data items source = "{binding [hair]}" & gt; & Lt; StackPanel Orientation = "Horizontal" & gt; & Lt; Image width = "12" height = "14" source = "{static resource items_ico}" stretch = "uniform" /> & Lt; Label content = "{binding [name]}" tooltip = "{binding [name]}" tooltip service. Placement = "Top" /> & Lt; / StackPanel & gt; & Lt; / HierarchicalDataTemplate & gt; & Lt; /TreeView.ItemTemplate> & Lt; / TreeView & gt;  

Edit: Sorry. The first post was incomplete (slipped on the return key)


multithreading - Java threads and synchronized -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 2 जवाब

क्या कोई मेरी मदद कर सकता है मुसीबत? मैं जावा थ्रेड्स का उपयोग कर निम्न आउटपुट को प्रिंट करना चाहता हूं।

  * + - * + - * + - * + - * + - * + - * + - * + - * + - * + - (150 बार)  

मैंने निम्नलिखित कोड लिखा है मुझे पता है कि यह पूरी तरह से सही नहीं है, लेकिन मुझे आपकी मदद की आवश्यकता है।

  पैकेज प्रिंट सिंबॉल्स; पब्लिक क्लास प्रिंट टेस्टड्रिवर {सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {PrintTestDriver ड्राइवर = नया प्रिंटटस्टड्रिवर (); driver.test (); } सार्वजनिक सिंक्रनाइज़ किए गए शून्य परीक्षण () {MyPrinter myPrinter = नया MyPrinter (); MyPrintThread एक = नया MyPrintThread ("*", myPrinter); MyPrintThread b = नया MyPrintThread ("+", myPrinter); MyPrintThread c = नया MyPrintThread ("-", myPrinter); शुरुआत(); b.start (); c.start (); }} पैकेज प्रिंट सिंबॉल्स; सार्वजनिक वर्ग MyPrintThread थ्रेड का विस्तार {स्ट्रिंग का नाम; MyPrinter प्रिंट; सार्वजनिक MyPrintThread (स्ट्रिंग का नाम, माइपरिंटर प्रिंट) {this.name = name; यह। प्रिंट = प्रिंट; } सार्वजनिक शून्य रन () {print.printname (नाम); }} पैकेज प्रिंट सिंबॉल्स; सार्वजनिक वर्ग MyPrinter {सार्वजनिक MyPrinter () {}; सार्वजनिक सिंक्रनाइज़ किए गए शून्य प्रिंटनाम (स्ट्रिंग नाम) {for (int i = 0; i & lt; 10; i ++) {System.out.print (name); कोशिश {प्रतीक्षा (); } पकड़ (बाधित ईक्सेप्शन ई) {// TODO ऑटो-जेनरेट कैच ब्लॉक e.printStackTrace (); } सूचित करेंसभी (); }}  

एक वेरिएबल है जो ट्रैक करता है कि कौन सा धागा अगले जाने वाला है। जब कोई धागा जागता है (अधिसूचित होने के कारण) यह जांचता है कि क्या यह धागा की बारी है यदि नहीं, तो फिर से ब्लॉक करें। यदि हां, तो अपने चरित्र को मुद्रित करें, यह बताएं कि कौन सा धागा आगे जाता है, अन्य धागे को सूचित करें और फिर से ब्लॉक करें।


c# - Asp.Net Response class and Write Method -


When I create a simple webform example, I write the code below to display the data on the web page.

Response Write ("Hello World");

There is general syntax in CSRAP

Create an object such as the classname objectName = New classname ()

and the column name-MethodName ();

There is no object creation for static classes and we can call the name of the classname. MethodName ();

How is the reaction in this context. Do () work? I know that there is a way to write () my question is what is the response here.

Is this a stable class? Or object (this should not be true)?

I am trying to understand that it is a static class, but it is a sealed class. This is an example, and it is inherited, a seal classname. How is it possible to call? ()?

from the base class (pages).


php - SQL special text escaping -


I want to include the following four lines in a database:

[Sources ] Prices (6, 'ar', '@ # Ido @ / 60 * @ # Órabér @ * @ # Torzítás @'); [Sources] values ​​(7, 'Ido', 'Ceil (((@ # Összhossz @ / 1000) / @ ~ Előtolás @) * 100) / 100 + Ceil ((@ # Lyukszám @ * @ ~ Lyuk. Ido Putting in @ / 60 + @ # Anyagtényező @ * @ # Lyukszám @) * 100) / 100 '); [Sources] values ​​(8, 'Önköltség', '(@! Áramár / H @ + @! Csarnokbér / H @ + @! Munkás órabér @ + @! Szervízköltség @ + @ ~ GAZ fogy. @ * @ # Vágógáz Putting in AR @ 3 * @! N2 (m3) @) / (@ ~ alotolus @ 60) '); [Sources] Insert values ​​(9, Lyukoncoltseg 'Lemjhwast @. @');

It was exported from a SQLite database, and I want to insert them into the SQL database server Vamp. Can anyone help me, how to avoid these strings?

The arnold

WAMP in MySQL, so I Let < / Em> You are asking how to do those INSERTs on the MySQL database.

Get rid of brackets around the table name.

Setting the character set encoding in the source (probably UTF8) bytes:

  ⚈ (Excluded) mysql interface: mysql_set_charset ('UTF8'); (Assuming PHP 5.2.3 and MySQL 5.0.7) Note: "mysql_" interface is deprecated ⚈ MyScillie interface: mysqli_set_charset ('utf8') function. Mysqli_set_charset ⚈ View PDO interface: Set the charset attribute of the PDO DSN  

nginx - Do I need a SSL certificate for a domain if it redirects? -


If www.abc.com is redirected to abc.com, do I want to www.abc.com Need to get an SSL certificate?

I am asking because I am renewing the SSL certificates for my business and will have to buy new certificates for the www domain and if it is unnecessary then do not want to spend the extra cost.

More specifically, my weight balance layer is NGINX and www.abc.com has been rewritten in https://abc.com/ {params}

. Thank you.

Normally the www standard is included in the certificate. If not, you will have to buy * (Star) certificate.


asp.net mvc 4 - How to update my view with jquery? -


I am using MVC 4 with razor view. What I want to do, is to add a new example of my div class to the scene. What do I need in my Jacobs?

This is the div.

  & lt; Input type = "button" id = "btAdd" value = "add answer" /> & Lt; Div class = "answerLabel" & gt; @ Html.LabelFor (model => model. answer.AnswerText, new {id = "answerLabelField"}) & lt; / Div & gt; & Lt; Div class = "answer editor" & gt; @ Html.EditorFor (model = & gt; model.answer.nswerText, new {id = "AnswerEditorField"}} @html. Validation message (model = & gt; model. Answer.AnswerText) & lt; / Div & gt;  

Jquery

  $ (document) .ready (function () {$ ('# btAdd'). Click (function () {// What do i need here; false return;});  

});

use .append (.html ())

  $ ('body'). Attachments ($ ('. Respondents') .html ());  

java - string.equal method not working -


I am new to Java The problem is that I am right now that I am sending a file name from the client to the server. When I print that filename in the server, it prints fine, but it does not match the string that is my hard-coded. Example: I used to write 'Lecture.PDF' as a file name from classic to server 'And then I match the string filename obtained with the string' Lactuation PDF ', it does not match and finally returns false. I hope to return the same method (as it should be).

Here is a code snippet that can display the problem. The 'server' here is the purpose of the socket, and I am reading the file name using the byte array:

  InputStream = faucet; Byte reaction [] = new byte [50]; Is = server.getInputStream (); Is.read (feedback); String str_res = new string (response); System.out.println ("Understand:" + str_res); System.out.println ("Result:" + (response.toString ()). Equals ("lecture pdf"));  

you have to write

  new string (response , "UTF-8"). Equal ("lecture pdf")  

or

  str_res.equals ("lecture.pdf")  

You are resemble your original, unrelated byte array to a string. A byte array is never equal to string because they are of different types, you should also check that the correct number of bytes is changing - if you send 1 byte, then how many letters should be in your output string ? Look at the constructor, and keep track of how many bytes you actually used:

  int bytesRead = is.read (response);  

cobol - Compilation flags -


I have a program and subprogram. I compile my program with the following statement:

  cobc -x-free -Wall program.cob  

My problem is with my subprogram I use the following statement to compile it:

< When I use the -c flag, but it compiles it, the code does not get updated when I type in the code Examples It will compile a value, but it will not be reflected when I run the program

But if I change the flag from -c-to-M like the following:

P>

Does anyone help me to understand why this is happening? According to the

Code> man page, -c is the flag meaning:

Collect and collect, but do not link (it works very similarly when compiling C or C ++).

This means that it is not executable (you will only get one object file) either there will not be an executable at all (if it is the first time), or it The last successful non- -c will be one of the build (so your "but do not get the code updated" comment).

-m option creates a dynamically loadable module, which is appropriate for linking against it. The fact that linking is dynamic means that an update for the module is immediately reflected in the executable (made immediately). The

-x option makes an appropriate execution and therefore automatically updates your updates.


adding array of picturebox into panel c# -


  प्राइवेट सिस्टम। विन्डोज.फ़ॉर्म। पिक्चरबॉक्स [] इमेगाअरेरे; PBflowLayoutPanel.Size = नया आकार (dww, dwh); ImgArray = नई प्रणाली.विंडो.फॉर्म। पिक्चर बॉक्स [एनटीइल]; के लिए (इंट आई = 0; आई & lt; nTiles; i ++) {आईएमजीआरआरई [आई] = नई प्रणाली.विंडो.फॉर्म। पीचर बॉक्स (); आईएमजीएरेरे [आई]। मार्जिन = नया पैडिंग (0); आईएमजीएरे [आई]। आकार = नया आकार (डीटीडब्लू, डीटी); PBflowLayoutPanel.Controls.Add (imgArray [i]); आईएमजीएरे [आई] .SizeMode = पिक्चरबॉक्सेज़मोड.जूम; }  

मैं पैनल में उन्हें उपयोग करने के लिए चित्र बॉक्स की एक सरणी बनाने का प्रयास कर रहा हूं। मेरा यह कोड पैनल में किसी भी चित्र बॉक्स को प्रदर्शित नहीं करता है। मुझे क्या याद आ रहा है?

आपका कोड ठीक है।

जोड़ें

imgArray [i] .orderStyle = BorderStyle.Fixed3D;

और आप चित्र बक्से देखेंगे।


java - YARN - get the name of all nodes -


I am developing a yarn application. I want to get names of all nodes (table of hosts) on my ApplicationMaster cluster. How can I do this?

Note that if I find it possible to get it from the customer, I can pass it to the client.


java - How to set parameters in XSL stylesheet with the help of Transformer object when i have my xml generated dynamically in jsp -


I'm retrieving all the values ​​in a list to set parameters for your XSL stylesheet.I and that Need to create dynamic XML using jsp? Therefore no external XML file has been created in this process .. But now I need to set variables in XSLT stylesheet. But as no XML file has been made, I am finding it difficult to change the object. Here is my code

  & lt;% @ page contentType = "text / xml"%> & LT;% @ page import = "java.util.ArrayList, aj.model.BriefBoardDetail, javax.xml.transform.Transformer, javax.xml.transform.TransformerFactory, javax.xml.transform.stream.StreamSource"% & gt ; & Lt;% ArrayList & lt; BriefBoardDetail & gt; List = (ArrayList) request.getAttribute ("Board list"); Int countofPages = (integer) request.getAttribute ("countOfPages"); Int paynumber = (integer) request.getAttribute ("current page number"); Transformer transformer = Tronsfarmrfaccrknuinstens () Knveen Tronsformr (new Strymsors ( "/ XSLT / Indekspejastail. XSL")); Transformer. Sitemapator ("current page", page number); Transformer .setParameter ("last page", countof page); Transformer.transform (???, ???); // What do I need to set up here? & Gt%; & Lt; ?? Xml- stylesheet type = "text / XSL" href = "xslt / indexPageStyle.xsl" version = "1.0" encoding = "UTF-8" & gt; & Lt; AlgorithmHome & gt; & Lt;% (short bourdat bbs: list) {%> & Lt; Subject id = '& lt;% = bbs.getBoardId ()% & gt; & Gt; & Lt; Name & gt; & Lt;% = bbs.getBoardName ()% & gt; & Lt; / Name & gt; & Lt; Description & gt; & Lt;% = bbs.getDescription ()% & gt; & Lt; / Description & gt; & Lt; / Subject & gt; & Lt;%}% & gt; & Lt; / Algorithm Home & gt;  

Then I need to set countOfPages and PAGENUMBER in indexPageStyle.xsl.But as XML is generated dynamically in this, then JSP I XMLSource and Need to determine what outputTarget transformer.transform (XMLSource, outputTarget) if I need to display it in the browser.

After

I made some changes to the above code and this ..

  & Lt worked fine;% @ page contentType = "text / html; charset = ISO-8859-1"%> & Lt;% @ Page Import = "java.util.ArrayList, aj.model.BriefBoardDetail"%> & Lt;% @ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c"%> & Lt;% @ taglib uri = "http://java.sun.com/jsp/jstl/xml" prefix = "x"%> & Lt;% ArrayList & lt; BriefBoardDetail & gt; List = (ArrayList) request.getAttribute ("Board list"); Integer countofPages = (integer) request.getAttribute ("countOfPages"); Integer page number = (integer) request.getAttribute ("current page number"); & Gt%; & Lt; C: set var = "xmldata" & gt; & Lt; AlgorithmHome & gt; & Lt;% (short bourdat bbs: list) {%> & Lt; Subject id = '& lt;% = bbs.getBoardId ()% & gt; & Gt; & Lt; Name & gt; & Lt;% = bbs.getBoardName ()% & gt; & Lt; / Name & gt; & Lt; Description & gt; & Lt;% = bbs.getDescription ()% & gt; & Lt; / Description & gt; & Lt; / Subject & gt; & Lt;%}% & gt; & Lt; / Algorithm Home & gt; & Lt; / C: Set & gt; & Lt; C: import url = "/ xslt / indexPageStyle.xsl" var = "xslt" /> & Lt; X: Change xml = "$ {xmldata}" xslt = "$ {xslt}" & gt; & Lt; X: Ultimate name = "current page" value = "$ {paragraph: page number}" /> & Lt; X: Ultimate name = "last page" value = "$ {param: count page}" /> & Lt; / X: Conviction & gt;  

All this is working fine but now I have to pass both the counting pages and pagnambar for my xsl stylesheet. But I can not pass it. I was able to get all the google and strings string inside for the price tag. I am very confused ... please tell me a value


Powershell Delete aged MSMQ messages in specific queue -


OK, so new to working from MSMQ message in power shell. And I'm sure I'm stupid stupid. I want to remove the old message from X days with a specific queue if anyone has some idea on how to do this, I will take it here what I have got to do: / P>

  $ today = get-date $ today = $ today.Adddays (-30) $ queuePath = ("$ $ private \ thequeueIwant") [Reflection.Assembly] :: LoadWithPartialName ("System .message ") $ queue = New-Object System.Messaging.MessageQueue $ queuePath $ queue.GetAllMessages {if ($ _ time add-4 $ $) {$ message.delete}}  
< / Div>


javascript - Bootstrap Select dropdown -


I need to customize the Bootstrap dropdown box, where "Carat" will be replaced by an image / PNG. How to get it I found that most examples are online ... no correct solution was found. Please

I have not tested this, but

  & lt ; Span class = "glyphicon" & gt; Dropdown text & lt; Img src = "img.png" / & gt; & Lt; / Span & gt;  

can not see this more at this time


vb.net - Using CPU clock as an increment timer? -


Has anyone ever tried to use the CPU clock frequency as an incremental timer? Maybe this is very common? I have a project where I have to record the data at 1khz - 10khz rates I was trying to use the timer class in VBnet set to increase in 1 MB, but the test showed that it was not fast enough Because this system is set on the clock and the system clock resolution is only about 15ms on the Windows 7 system.


mysqli - PHP login file is not working. Continues to return to the login page and not user profile -


यहां पूर्ण कोड है:

  & lt;? Php session_start (); session_regenerate_id (सही); require_once ( 'connect.php'); Need_once "lib.php"; Need_once "utils.php"; $ ईमेल पता = mysqli_real_escape_string ($ लिंक, HTMLentities ($ _ POST ['EmailAddress'])); $ पासवर्ड = mysqli_real_escape_string ($ लिंक, HTMLentities ($ _ POST ['पासवर्ड'])); $ Fname = mysqli_real_escape_string ($ लिंक, HTMLentities ($ _ POST ['Fname'])); फ़ंक्शन लॉगिन ($ परिणाम, $ ईमेल पता, $ पासवर्ड) {यदि ($ परिणाम) {यदि (mysqli_num_rows ($ परिणाम) == 1) {$ email_exists = true; $ Pass_exists = सच; अगर ($ pass_exists = सच & amp; $ ईमेल_एक्सिस्ट्स = सत्य) {$ _SESSION ['सक्रिय'] = सच; $ _SESSION [ 'EmailAddress'] = $ EmailAddress; // $ _ सत्र [ 'पासवर्ड'] = $ पासवर्ड; शीर्षलेख ("स्थान: myIndex.php"); बाहर जाएं(); }} दूसरी गूंज "& lt; div id = 'error' & gt; & lt; h4 & gt; त्रुटि: गलत पासवर्ड या ईमेल & lt; / h4 & gt; & lt; / div & gt;"; }} फ़ंक्शन redirect_if_active () {हैडर ("स्थान: myIndex.php"); बाहर जाएं(); } अगर (एज़ैट ($ _ सत्र ['सक्रिय']) और amp; $ _SESSION ['सक्रिय'] === सच) {redirect_if_active (); } // केवल प्रवेश जानकारी प्रक्रिया करता है अगर सबमिट बटन पर क्लिक किया गया है (isset ($ _ POST ['submit'])) {$ sql = "चयन करें * उपयोगकर्ताओं से जहां ईमेल पता = '$ _ POST [ईमेल पता]' और पासवर्ड = ' $ _POST [पासवर्ड] ' "; $ परिणाम = mysqli_query ($ लिंक, $ sql); लॉगिन ($ परिणाम, $ EmailAddress, $ पासवर्ड); } If (isset ($ _ POST ['signup'])) {हैडर ("स्थान: register.php"); बाहर जाएं(); }? & Gt;  

मेरा अनुमान यह है कि त्रुटि है जहां $ sql = SELECT * से उपयोगकर्ता जहां लेकिन मैं ', पूरी तरह से यकीन नहीं है। मैं ईमेल और पासवर्ड इनपुट करूंगा, लेकिन यह मुझे लॉगिन पृष्ठ पर वापस लौट रहा है। मुझे यकीन नहीं है कि यह ऐसा क्यों कर रहा है, लेकिन जब उपयोगकर्ता ने प्रवेश किया है, तो उसे प्रोफाइल पेज पर जाना होगा।

<पूर्व> $ link =" somethingrelatedtoyourdb "; $ ईमेल पता = $ _POST ['EmailAddress']; $ पासवर्ड = $ _POST ['पासवर्ड']; // $ Fname = $ _POST ['Fname']; यह कभी भी पोस्ट नहीं किया गया है "& lt; पूर्व & gt;"; print_r ($ _ पोस्ट); गूंज "& lt; / pre & gt;"; फ़ंक्शन लॉगिन ($ परिणाम, $ ईमेल पता, $ पासवर्ड) {यदि ($ परिणाम) {यदि (($ परिणाम) == सत्य) // TRUE AGAIN {// यह कोई संसाधित नहीं करता // $ email_exists = true; // $ pass_exists = सच; // if ($ pass_exists = true & amp; $ ईमेल_एक्सिस्ट्स = सत्य) // {$ _SESSION ['सक्रिय'] == सच; $ _SESSION ['EmailAddress'] == $ EmailAddress; // $ _ सत्र [ 'पासवर्ड'] = $ पासवर्ड; शीर्षलेख ("स्थान: myIndex.php"); बाहर जाएं(); & Lt; h4 & gt; त्रुटि: गलत पासवर्ड या ईमेल & lt; / h4 & gt; & lt; / div & gt; ";;; }} फ़ंक्शन redirect_if_active () {हैडर ("स्थान: myIndex.php"); बाहर जाएं(); } अगर (एज़ैट ($ _ सत्र ['सक्रिय']) और amp; $ _SESSION ['सक्रिय'] === सच) {redirect_if_active (); } // केवल लॉग इन सूचनाओं पर ही प्रक्रिया करता है यदि सबमिट बटन पर क्लिक किया गया है (isset ($ _ POST ['submit'])) {$ sql = "चयन करें * उपयोगकर्ताओं से जहां ईमेल पता = '$ ईमेल पता' और पासवर्ड = '$ पासवर्ड' "; print_r ($ एसक्यूएल); // $ परिणाम = mysqli_query ($ लिंक, $ sql); बीमार एक पल के लिए यह सही बनाते हैं $ result = true; लॉगिन ($ परिणाम, $ EmailAddress, $ पासवर्ड); } If (isset ($ _ POST ['signup'])) {हैडर ("स्थान: register.php"); बाहर जाएं(); }? & Gt; & LT; html & gt; & Lt; शीर्ष & gt; & lt; / head & gt; & LT; बॉडी & gt; & Lt; div id = 'form' & gt; & Lt; फ़ॉर्म एक्शन = 'example.php' method = 'POST' & gt; & Lt; div id = 'email' & gt; ईमेल: & lt; / div & gt; & Lt; div id = 'email2' & gt; & Lt; इनपुट नाम = 'ईमेल पता' प्रकार = 'ईमेल' / & gt; & Lt; br & gt; & Lt; / div & gt; पासवर्ड: & lt; इनपुट नाम = 'पासवर्ड' प्रकार = 'पासवर्ड' / & gt; & Lt; br & gt; & Lt; इनपुट वर्ग = "जमा करें" नाम = 'जमा करें' प्रकार = 'जमा करें' मान = 'लॉगिन' / & gt; & Lt; इनपुट वर्ग = "जमा 2" नाम = 'साइनअप' प्रकार = 'जमा करें' मान = 'साइनअप!' / & Gt; & Lt; / प्रपत्र & gt; & Lt; / body & gt; & lt; / html & gt;

c# - How to access open DbContext without explicit reference? -


I am now working with a little bit of unit structure, and I have come in many scenarios where two references are the same unit Etc., so I am thinking that maybe I am not opening / closing the best method.

At present, I basically open DBContact on each of its controllers. The original MVC App was originally installed, which means that I have a private DBBankText field on the controller, and I Override the controller's disposal method for disposal.

However, I sometimes call DB in some other sections, which can call from within the controller, which also has an open reference.

Is there any way to use an open reference without a clear handler? This does not really mean passing through a dozen different ways for me to go around a DBCT context reference.

Use of Dependency Injection

As Others Have said and will probably have to repeat, 'right way' is often considered dependent injection.

In my latest project, I have organized things so that I can almost complete the project and it has become so easy that I am doing it myself (rather than using the injector) . A major factor in this is strictly adhering to this structure:

  WebProject | | | Data Services | | | ViewModels EntityModels  

All data services are accessed through a single DataServiceFactory instance during a unit of work, for which an example of MyDbContext is required Another aspect is a completely unstable The application has been designed - this means that I do not have to distinguish between firmness in my code.

Without Dependence Injection

He said, maybe D is not right for you on this project. Maybe:

  • You do not plan to write unit tests
  • You need more time to understand di
  • Your project structure already has EF Is deeply integrated

In ASP.NET MVC, the unit of work often matches the request fully with the lifetime - that is, the HTTPS consort. Current . As a result, instead of using the AI, you can freely request a single single copy per repository. There is a classic singleton pattern with the current reference in the form of backing store, your DbContext :

  public class repository proxy {get private static HTTP contact CTX} ; }} Private Static Guid repoGuid = typeof (MyDbContext). Dog; Receive public static MyDbContext context {{MyDbContext repo = Ctx.Items [repoGuid]; If (repo == zero) {repo = new MyDbContext (); Ctx.Items [repoGuid] = Results; } Return Repo; }} Public Static Zero WiFi Contact () {MyDbContext repo = Ctx.Items [repoGuid]; If (repo = null) repo Save Changes (); }}  

If you are feeling particularly lazy, you can also save change yourself (you still have to observe the side effects Manually call for, such as retrieving the ID for a new item):

  Public abstract class Extended Controller: Controller {Protected MiddetTontext Reference} {get repositoryProxy.Context; }} Safe Override Zero On-Off Acne (ActionExecuted Contact Filter Kontex) {Repository Proxy. SaveEfkotext (); Base.OnActionExecuted (filterContext); }}  

How to get webcontent that is loaded by JavaScript using cURL? -


I am trying to capture a score table from a website. The problem is that the site is using Javascript which is apparently loaded on document.ready .

For this reason I do not seem successful in getting the table and what I got is the button at the top of that page

Any suggestions on how to solve it or idea?

The curl will only get you the markup of the page, it will not load any additional resources or process the page Will do You probably want to see something for this. PhantomJS is a non-head WebCat browser that has its own API that lets you script "behavior" then you can call PhantomJS to load the page and you can get the necessary data out. Are there.


PHP & cURL Not Working -


A reddit bot building.

Ignore the actual API for each other - it does not handle curl even to execute - I can not see any requests / reactions in browsers DevTools.

  & lt ;? Php / ** * Reddit PHP WikiBot * * @ author tomgs * @ link mysite.com * / / ** * Authentication Using OAuth 2.0 - Step 1 * * Get the code, state & amp; Reading token reddit * @ link @ https://github.com/reddit/reddit/wiki/OAuth2#authorization * * // start curl $ ch = curl_init (); / * Set the curl wars * / // URLs to the code, state and amp; in order to obtain; $ AuthorizeUrl = 'https: //www.reddit.com/api/v1/authorize' token; Curl_setopt ($ ch, CURLOPT_URL, $ authorizeUrl); // If curl phelps die & amp; Throw an error / curl_setopt ($ ch, CURLOPT_FAILONERROR, TRUE); // include the header in the output curl_setopt ($ CH, CURLOPT_HEADER, TRUE); // a post request defaulted GET request curl_setopt ($ CH, CURLOPT_POST, 6) endued; // Return return as a string of value return; Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, TRUE); / ** * Parameter for post request - explained * * @ Ultimate string $ client_id You set the app's Client ID * @ Param String to $ response_type "code" - For this step, @ @ the absolute string $ state is selected by me A random string * @trust string $ debutory set to permanent, because we want to get the refresh token from the server (more about later refresh token) * @truth_trag The authentication was successful to not * * * * / / / slightly longer / more complex string - $ client_id = 'CLIENTID' stored in a local variable; $ Redirect_uri = "http: //localhost/redditbot2/callback.php"; $ Random_state = RAND (); $ Params = array ("client_id" => $ client_id, "response_type" = & gt; "code", "state" => $ random_state, "redirect_uri" = & gt; urlencode ($ redirect_uri), " Period "= & gt;" permanent "," scope "= & gt;" submit "); $ Params = http_build_query ($ params); // Set all fields for post request curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ params); // Exectute curl $ result = curl_exec ($ ch); // Close the connection curl_close ($ ch); ? & Gt;  

You may need your $ params urlencode @ should be white space and anything that is not in the url string:

  $ params = array ("client_id" => $ client_id, "response_type" = & Gt; = "Gtc:  

and make this a string:

  $ params = http_build_query ($ params);   

In addition, as you connect to SSL, you should add these rows:

  curl_setopt ($ CH, CURLOPT_SSL_VERIFYHOST, 0); Curl_setopt ($ CH, CURLOPT_ SSL_VERIFYPEER, 0);  

java - Apache Camel XmlJsonDataFormat XML to JSON -


I have the following code, which I have taken from the Apache camel website:

  XmlJsonDataFormat XmlJsonFormat = New XmlJsonDataFormat (); XmlJsonFormat.setEncoding ("UTF-8"); XmlJsonFormat.setForceTopLevelObject (true); XmlJsonFormat.setTrimSpaces (true); XmlJsonFormat.setRootName ("newRoot"); XmlJsonFormat.setSkipNamespaces (true); XmlJsonFormat.setRemoveNamespacePrefixes (true); XmlJsonFormat.setExpandableProperties (Arrays.asList ("D", "E")); // XML to JSON ("direct: marshal"). Marshall (xmlJsonFormat) .to ("Fake: json"); // 1  

On the previous row (marked 1), I get a compilation error. I do not understand that the to method is coming; There is no static import, and I have seen examples and postings on this site.

I do not know anything about camels, and to do it as a stand alone utility class is to do simple XML -> JSN conversion.

Does anyone help me to understand that what I have to do to make this snippet work is that anyone knows a simple XML about JSN converter?

A good idea to get started with anybody is to drive the camel through this beginner guide

Then you will know that to is from a camel passage, and you have a RouteBuilder class to use it.


tsql - Query to find all FK constraints, and their referenced table columns -


I have a large SQL 2012 database (100 tables), in which I need to find all the obstacles where the reversion action Set

  select name, delete_referential_action_desc, select, sys.foreign_keys from Update_referential_action_desc WHERE update_referential_action_desc = 'CASCADE' or delete_referential_action_desc = 'CASCADE';  

This provides a useful list:

  name delete_referential_action_desc update_referential_action_desc ------------------ - ------------------------------------------------ - FK_name001 Cascade Cascade FK_name002 Cascade No_action FK_NN003 Cascade No_Action  

However, it is possible to expand the code, so that each barrier contains the corresponding table name and column name, e.g.

name delete_referential_action_desc update_referential_action_desc ParentTable ParentCol ChildTable ChildCall --------------------------------- --- ----------------------------------------------- --- -------------------------------------- FK_name001 Cascade CASAD Table 1 Call 1 Table 2 Call 2

I have tried various edits that drag values ​​from but do not know how it works, or that it is also the right approach

Update

Please note that I do not want Do not to ALTER anything Change a schema I may just would like to see a list so I manually further action. I do not have confidence or experience to remove major points.

Two days after experiment

  select C.CONSTRAINT_NAME, PK.TABLE_NAME, CCU.COLUMN_NAME, FK.TABLE_NAME, CU.COLUMN_NAME, C.UPDATE_RULE, INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS Join C.DELETE_RULE from within C.CONSTRAINT_NAME = FK.CONSTRAINT_NAME join INFORMATION_SCHEMA.TABLE_CONSTRAINTS FK INFORMATION_SCHEMA.TABLE_CONSTRAINTS P At C.UNIQUE_CONSTRAINT_NAME = PK.CONSTRAINT_NAME Join INFORMATION_SCHEMA C.CONSTRAINT_NAME = CU.CONSTRAINT_NAME at INKEY_COLUMN_USAGE CU INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE PK at CCU. Order PK by CONSTRAINT_NAME = CCU.CONSTRAINT_NAME WHERE ((C.UPDATE_RULE = 'CASCADE') or (CDELTULE = 'Cascade')) and (FK .CONSTRAINT_TYPE = 'foreign key'). TABLE_NAME, F.K. TABLE_NAME;  

Praise be done for digital deities ... (!)


xaml - Can't resize Canvas size using C# -


Very easy issue: If I declare a canvas in XAML in a Windows Phone 8.1 app then:

& lt; Canvas x: name = "optioncanvas" width = "400" height = "450" ​​vertical alignment = "top" background = "white" pointermold = "optioncan pointermoid" & gt;

It works fine, but I want to adjust my app with a phone with different screen sizes. That's why I'm receiving window.Current.Bounds using the size of the screen and setting the canvas dimensions as the proportion of the total screen size in the page constructor:

  Point screenres = new point (); Double scalefactor = display. GetForCurrentView () RawPixelsPerViewPixel; ScreenRes.X = Window. Present. Bounds. Wide * Scale Factor; ScreenRes.Y = Window Present. Bounce High * scale factor; MyCanvas.Width = ScreenRes.X * 0.5; MyCanvas.Height = ScreenRes.Y * 0.7;  

But it does not seem to work. When I run the code above, check the MyCanvas.ActualHyight and MyCanvas.ActualWidth properties, both dimensions are zero and as a result, nothing shows in my canvas.

I hope you know that canvas does not clip your kids Even if its size is 0 x 0, all the controls which are inside are visible. I suggest that you use some different controls to show the background, such as border is more flexible, and leave the canvas, as (with the default 0 x 0 size) . Your code might look like this:

  & lt; Range x: name = "optionsborder" width = "400" height = "450" ​​vertical alignment = "top" background = "white" pointer mode = "optionsCanvas_PointerMoved" & gt; & Lt; Canvas x: name = "optioncanvas" vertical alignment = "top" horizontal align = "left" /> & Lt; / Border & gt;  

So you can now resize the OptionsBorder instead and do not care about the canvas. Canvas has only one advantage - you can canvas.lift and canvas. Like the Tap , you can arrange your control using X and Y.


Display an Array of Images in C#/asp.net -


I am currently trying to remove a way to display the dynamic number of icons on a page. My image is a string array with url.

The way the page is currently set is that some different properties are set through a repeater (name, title etc.) and I would like to add images for each of these sections Dynamic number of

For example, there can be 3 images in line 1, where there is 1 in row 2.

Can someone recommend a method to do this? I saw in the picture box but apparently I have not found the correct header file for this on this system.

Thank you!

Edit:

Ive actually used the header file for the picturebox (I think) so if anyone has a good solution to use, which would be appreciated as well. !

You can always try to use jQuery and AJAX in C # code, such an The method that gives your array as a JSON. Then you can call AJAX to AJAX and you can attach the given data to create HTML image elements in your page.

/ div>

bash - Shell script print line number when it errors out -


I am looking for a way to print line numbers inside the line script during errors of errors.

I came to the '-x' option, which prints the line while running the shell script, but this is not what I need. Maybe I can $ LINENO before each exit code? Is there a cleaner way to do this?

I just wanted the line number so that I could open the shell script and go straight to the place where the interpreter realized the error. Using

  PS4 = ': $ LINENO +'  

will add line numbers to the output of set -x .


If you want to print on only errors, then there is some risk to it being running in insects among recent interpreters, however, You can try:

  error () {local parent_lineno = "$ 1" local message = "$ 2" local code = "$ {3: -1}" if [[- N "$ message"]]; Then "$ {parent_lineno}: $ {parent_lineno} on line $ {parent_lineno}: resonates error; status goes with $ $ {code}" "second echo" error; $ {parent_linen}; $$ {code} "ex exit" $ {Code} "} 'error $ {LINENO}' ERR  

Again, this will not work On the construction of some bass, which does not always set correctly inside the lineno trap.


Another approach (which only Will work on recent shells; 4.1 attributes) Each code has to use the PS4 to use the exit status and line number for a dedicated file descriptor, and only use it To print the line, use tail before shell removal FD:

  exec {BASH_XTRACEFD}> gt; & gt; (tail-N1) # Set set-x output tail- n 1 ps4 = 'line $ LINENO; pre-order exit status $? +' Set-x  

Icon replaced with CSS content() and ::before not shown in Firefox -


I want to change the text in the menu item with an icon through CSS. The icon should be clickable I tried it with the following code and it looks good in Safari and Chrome. Although firefox shows "home" instead of image

Does anyone know what is the solution to Firefox?

  & lt; Ul id = "menu-house" category = "menu origin-nav-menu menu-primary" & gt; & Lt; Li id = "menu-item -1951" class = "home menu-item" & gt; & Lt; A href = "home" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li id = "menu-item-17414" class = "menu-item" & gt; & Lt; A href = "link1" & gt; Link 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; .nav-primary ul.menu> Li a :: Before Visibility: Visible; } .nav-primary ul.menu> Li.home A: First {content: url ('images / home_icon.jpg') No-double; Status: Relative; Bottom: -2px; }  

Thanks!

Your content declares a no-repeat , Which seems to have survived the previously used background declaration, it needs to be removed:

  content: url ('images / home_icon. Jpg '); Status: Relative; Bottom: -2px; In addition, though WebKit is known for its awesome imagery infringement, it should not work in Safari and Chrome because it does not work on any other browser. There really is no reason for this - even if arbitrarily provides a way to add replaceable material with string, even if it has been implemented in chrome, here  no-repeat  token Clearly neither is a string nor a valid value for any  content , and it should not be treated like this. 

In addition, if you are looking at replaced with an image, you probably will need to keep your image in the text position, not relatively, since it Inserts the image before the text, how you implement it, it depends on your layout, but I thought it was important to point out.


c# - Increase size of MenuItem.Icon WPF -


I have the following conflict that I could not find anywhere on the Internet. I have the following menu in the WPF application

  & lt; Menu margin = "0,0,95,207" FontSize = "14" & gt; & Lt; Menu.Resources & gt; & Lt; Style TargetType = "Image" & gt; & Lt; Setter property = "height" value = "20" /> & Lt; Setter property = "width" value = "20" /> & Lt; Setter property = "statch" value = "fill" /> & Lt; / Style & gt; & Lt; /Menu.Resources> & Lt; MenuItem Header = "_photo" height = "35" width = "55" ScrollViewer. Mercall ScrollVersibility = "Disabled" grid. ISirdips skip = "true" padding = "5,0" ScrollViewer.CanContentScroll = "True" UseLayoutRounding = "False" & gt; & Lt; MenuItem.Icon & gt; & Lt; Image Source = "Pack: // Citophorigine: /, / Resource / Text-icon .png" /> & Lt; /MenuItem.Icon> & Lt; MenuItem header = "_text" margin = "0" & ​​gt; & Lt; MenuItem.Icon & gt; & Lt; Image source = "pack: // cytoophorigin:. ,,, / resources / power - shutdown." "Margin =" 0,0,0,0 "/> & lt; /MenuItem.Icon>>     

Whatever I try to modify or change its size, I can not make the menu icons larger, nor men's height, nor the menu-font size. That my icon should be at least 25x25, I think the size of its column which appears on the left, but I do not know its name / property, so I changed its size Thanks in advance! :)

It's not as simple as it should be, I once Done, loading event. You can try or


elasticsearch returning unique values -


I have a field named 'category'.

I can only return the list of possible categories:

  $ searchParam ['body'] ['ags'] ['category'] [ 'Terms'] ['Field'] = 'Category';  

But I want to search within that area and return only the categories that match my query.

Example list:

  1. Pizza
  2. Apple pie
  3. Cupcake
  4. Burger
  5. I want to find "pie" and the following results:

    1. Apple pie
    2. Orange pie

    There are more than 200 categories

    thanks for all help :)

Aggregation, so if you execute a search query for "pie" , then aggregation will only see (and gross) "pie" documents.

  ['category' => 'pie']], 'ags' => gt; ; ['Category' = & gt; ['Rule' = & gt; ['Field' = & gt; 'Square']]]]]; $ Result = $ Client-> Search ($ query); < / Code> 

How to programmatically create an OrientDB database of a given (json) schema? -


For the purposes of my dev workflow, I want to create a new orientable database given to a JSON schema on the fly. I do not believe it is fundamentally supported in ORDB, is there any existing solution that does this - provide a JSON schema and point to an oriented example, and it automatically builds the database (edges, Upper, indexed and maybe some sample data)

I create a .sh script to make DB on the fly Lee The .sh file looks like this:

  # (file: createmydb.sh) # To make the script to my script declaratively declare the truth to resonate #Use it to ignore errors and continue For, if necessary, create the database to create #Trade Undertaker IRRS True # Database: ./ Database / MyDB Root Root Multidimensional Graph # Create User Create Virtual Class User Create User Property Users are E-mails create property properties of STRING. First name STRING ...  

And then call it like this:

  /usr/local/src/orientdb/bin/console.sh createmydb .sh  

It works well DB creation script is very easy for my purposes, it can be easily modified. And I am convinced that very backwards compatible (which can not be in the case of importing the exported JSON version of DB Schema).


c# - When should I create a destructor? -


उदाहरण के लिए:

  सार्वजनिक वर्ग व्यक्ति {सार्वजनिक व्यक्ति () {} ~ व्यक्ति ) {}}  

मुझे मैन्युअल रूप से एक नाशक कब बनाना चाहिए? जब आपको एक नाशक बनाने की आवश्यकता है? सी # भाषा में ये "डिस्ट्रक्टर्स" कहलाते हैं, लेकिन अधिकांश लोग उन्हें अंतिम रूप से कहते हैं, क्योंकि उनका .NET नाम और यह सी + + डिस्ट्रक्टर्स (जो काफी अलग हैं) के साथ भ्रम को कम करता है।


extjs5 - Multi grouping in extjs 5 grid panel -


Is there any way to implement multiple groups in the Extens 5 grid?

I look at some demos for excheets 4. Can anyone show me in Extras 5?

I use Extens 5.1.0.

There is no one with box functionality to achieve multiple level groupings in the grid.

ExtJS 6 has the "Pivot Grid" functionality which you are looking for. Example:


office365 - Get Token wih pure Javascript. Xhr Status == 0 -


मैं ADAL.JS

यह सुनिश्चित करने के लिए कि समस्या JQuery से नहीं आई है, मैंने एक xhr अनुरोध का उपयोग किया है।

मैं आसानी से कोड प्राप्त कर सकता हूं एक https://login.windows.net/common/oauth2/authorize से स्ट्रिंग अनुरोध प्राप्त करें प्रतिक्रिया में मेरे कोड स्ट्रिंग शामिल हैं, जिसे मैं / टोकन अनुरोध

में उपयोग कर सकते हैं, फिर मैं https: / / Code / POST विधि का उपयोग करके /login.windows.net/common/oauth2/token url।

बुद्धिमत्ता प्रतिक्रिया मुझे अपना JSON संरचना भेज रहा है (मेरे वाहक टोकन युक्त), लेकिन xhr वस्तु readyState == 4 और स्थिति == 0 (बजाय status == 200 , मुझे लगता है) लौट रहा है

Authorization_code '+' & amp; code = '+ code +' और client_id = '+ ग्राहक आईडी' और amp; client_secret = '+ encodeurIC घटक (' passwordDEEDADAEDEADADADA = ') +' और amp; redirect_uri = '+ एन्कोडुरिक घटक (पुनर्निर्देशित यूरी); Var xhr = नया XMLHttpRequest () xhr.open ('POST', 'https://login.windows.net/common/oauth2/token', सच है); Xhr.setRequestHeader ('सामग्री-प्रकार', 'आवेदन / x-www-form-urlencoded; charset = UTF-8'); Xhr.setRequestHeader ('स्वीकार', '* / *'); Xhr.errorerror = (ev: errorEvent) = & gt; {Console.log (ev.message); } Xhr.onreadystatechange = (e) = & gt; {Var स्थिति = ई; If (xhr.readyState == 4) {if (xhr.status> gt; = 200 & amp; amp; xhr.status & lt; 300 || xhr.status === 304) {var jsonResult = JSON.parse (xhr.responseText ); Var access_token = {टोकन: jsonResult.access_token, expires_in: नई तिथि ((नई तिथि ())। GetTime () + (jsonResult.expires_in - 300) * 1000)}; } और {// अस्वीकार (xhr); }}}; xhr.send (डेटा);

अच्छी तरह से ... यह अपेक्षाकृत कम से कम अर्थपूर्ण में काम करता है:)

लेकिन मेरा xhr अनुरोध एक xhr.readyState == 4 < कोड> और कोई xhr.status == 0 ... कोई संदेश नहीं के साथ एक त्रुटि से निपटने।

मैंने कुछ अजीब पर StackOverflow पर खोज की status == 0 व्यवहार, लेकिन वास्तव में कोई समझौता नहीं मिला ...

आशा है कि मैं समझ गया था (आप जानते हैं, फ्रांसीसी लोग .. अंग्रेजी इतनी अच्छी तरह से नहीं बोलते :))

<पी> सेबैस्टीन

एएडी ओएथ समापन बिंदु फिलहाल सीओआरएस का समर्थन नहीं करता है। हमने वर्णित वर्णों के अनुसार अप्रभावित प्रवाह का उपयोग करने वाले टोकन प्राप्त करने के लिए जावास्क्रिप्ट ऐप्स को सक्षम किया है।

इसके अलावा, कृपया ध्यान दें कि आपको ब्राउज़र-आधारित एप्लिकेशन में अपने client_secret का उपयोग नहीं करना चाहिए क्लाइंट_सेट गोपनीय ग्राहकों में उपयोग के लिए होती हैं जो कि सर्वर की ओर से चलते हैं और गुप्त की अखंडता की रक्षा कर सकते हैं यदि उपरोक्त एक ब्राउज़र में चल रहा है, तो आपके ग्राहक का रहस्य दुनिया के सामने है, जिसका गंभीर सुरक्षा निहितार्थ है।


ember.js - How can I port a bound date input helper to HTMLBars? -


I'm trying to port a 'DateInputView' TextField extension with HTMLBars to a Supporting Assistant. It appears that 'call' has been removed from 'handlar.holls.viewview' so that the assistant does not work anymore. I've tried many syntax changes based on the forum, but nothing works The field is a datipiker that switches to the native calendar picker when using a mobile device. I see an example where the left ancillary scene is integrated into the assist code, so one uses a JS file compared to the two, so it is now trying to go the route. If the code is below for any HTMLBars to know it to work again please let me know.

  // ../templates/avail/navigation.hbs {{date-input id = "checkin" valueBinding = "controller. Marriage. Arrival" category = "form-control date-picker "}} // ../views/date-input.js var DateInputView = Ember.TextField.extend ({didInsertElement: function () {Ember.run} ScheduleOnce ('afterreender', this, this._setupDateInput);}, _setupDateInput: function () {var _this = this; var type = amber. $ (This.get ('element')). Attr ('type'); // Set date picker for object if (type === "Input") {Amber. $ (This.get ('element')) datepicker ({format: "yyyy-mm-dd", autoclose: true}}}}}}); Export Default Date Input View; // .. /helpers/date-input.js Import Date Input View '// // views / date-input'; Export Default Ember.Handlebars.makeBoundHelper (function (option) {Ember.assert ('You can only pass attributes for' input 'helper, arguments not', arguments.length & lt; 2); var hash = options .hash, type = options.hashTypes, inputType = hash.type, deleteEvent = hash.on; hash.type; delete hash; hash.type = "input"; if (/ Android | WebOS | iPhone | iPad | iPod | Blackberry | Iemobile | Opera Mini / i.test (navigator.userAgent)) hash.type = "date"}} hash.onEvent = onEvent || 'Enter'; Return to Amber.Handlebars.Holder.UewCol ( Further, Dinankinputdrishy, ​​options);});  

I am working this view again as a sequence.


java - How to set the properties for JRadioButtons and apply to them all? -


Hi, I have more than 10 JRDO buttons and there are some properties that are common in all, so instead of writing, these properties are once used on every radio button, once what is the method of setting everyone at once?

I want to set all the radio buttons for:

  radiButtonName.setOpaque (wrong); RadiButtonName.setContentAreaFilled (wrong); RadiButtonName.setBorderPainted (wrong); RadiButtonName.setBorder (zero);  

I tried to use the UINNager but it is doing strange work and it does not support all of my properties.

I would like to avoid creating additional squares and expand the radio button because I would like to apply this technique to other techniques to reduce code written, this will reduce the code very much in advance Thank you :)

If you want to do the same thing an N number of time a method Try writing that will move for you :)

Then problem 10 to install JRadioButton Land? You can create a list of JRDO buttons (or annare archive / maps / ...) return method like the following method:

  Private list & lt; JRDObutton & gt; Make list for SetUpButtons () {// (int i = 0; i & lt; NB_BUTTONS; i ++) {// wanted to set properties} myList return; }  

Note that NB_BUTTONS is a variable that:

  private finals NIB_BUTTONS = 10;  

It's easy to modify the value once it's modified in all its code. With the same logic you can write a way to prepare a JRDO button. It depends on how you want to do things you want to do.


java - Package for generating getters and setters in sublime 3 -


Any package that is aware of the recipients and setter methods in Java for Sublime Text 3?

It seems to have been taken by your author.

You may want to check, which is best for it, turn sublime into a Java IDE I have not used it, because Java is not my main development language (yay Python!), And especially in the scanning Gates / Sets was not mentioned, but it may include a snippet that is not an alternative form From, you can.

As far as Kwikjawa is concerned, you can try to contact and see if there is a collection of what you can get. It's worth a shot, I guess.


uiviewcontroller - PresentViewController, storyboard doesn't contain a view controller -


I'm getting. This same exact code worked a month ago, I think there has been some change in Xamarin because they have recently added the "module" line in the storyboard properties / widgets

The above code produces this error based on the storyboard screenshot below:

The Foundation. Monotouch Exception: Objective-Exception was thrown. Name: NSInvalidArgumentException Reason: The viewer in the storyboard () does not have a view controller with 'customview controller'

Enter image details here Enter image details here

My XM Studio Studio 5.8 is the creation of 443 and Xamarin is iOS 8.8.0.2 and Xcode 6.2 (6776)

--------------- Update --------- ------

So I am opening a storyboard file in a text editor and Xeramin Design Checking the code generated by the male. The controller had created a storyboard identifier months ago, but today is not a storyboard provider in the controller created, although I have explicitly set it in the Examiner Designer .... It looks problematic

  & Lt; Navigation Controller Defines Presentation Reference = "Yes" ID = "123" View Member IDIID = "View Controller" Storyboard Identifier = "RedVivannagement Controller" Restore Identifier = "RadViNavigation Controller" & gt; & Lt; Navigation Bar = "Navbar" contentMode = "scaleToFill" id = "126" & gt; & Lt; Autoresizing mask key = "autoresizingmask" widthSizable = "YES" flexibleMaxYY = "yes" /> & Lt; / NavigationBar & gt; & Lt; Connection & gt; & Lt; Segue destination = "125" type = "relation" relationship = "root view controller" id = "124" /> & Lt; / Connection & gt; & Lt; / NavigationController & gt;  

A new unchangeable code is generated today:

  & lt; Navigation Controller Defines Presentation = "Yes" id = "164" View MemberID = "ViewController" Restore Identifier = "JZCustom" & gt; & Lt; Navigation Bar Key = "Navbar" contentMode = "scaleToFill" id = "167" & gt; & Lt; Autoresizing mask key = "autoresizingmask" widthSizable = "YES" flexibleMaxYY = "yes" /> & Lt; / NavigationBar & gt; & Lt; Connection & gt; & Lt; Segue destination = "166" type = "relationship" relationship = "root view controller" id = "165" /> & Lt; / Connection & gt; & Lt; / NavigationController & gt;  

So when you manually open the storyboard file in a text editor and add a storyboard identifier, the storyboard opens successfully without exception. Looks like a bug?

The only solution for me was to open xCode and add a storyboard there was enough that this bug is on the stable channel Reached, which I'm working on ...

Note: I did not get the correct runtime result by editing the Storyboard XML manually ...


visual studio 2012 - How to Access local RESTApi in Android Application -


I should use RESTApi which is already built on my Android application in Microsoft .NET 2012.

But the problem is, when I get my Microsoft. Runing a net application gives me URL such as

which is not actually an Android application, the Android application needs the same as a specific IP address.

So, what to do now? Run Localhost emulator to use

Or search for 'IP address' on Google, Android device and Wi-Fi on PC.


html - frameset not working in IE but works fine Mozilla -


Here is the code that works well in Mozilla, but there is no solution that does not work in Internet Explorer.

   & Lt; FRAMESET cols = "40%, 60%" & gt; & Lt; Frame name = "login_menu_frame" src = "login_box.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; FRAME name = "login_body_frame" src = "login_page_body.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; / FRAMESET> & Lt; FRAMESET & gt; & Lt; Frame name = "login_fruit_frame" src = "footer.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; / FRAMESET> & Lt; / FRAMESET> & Lt; / Html & gt;  

OK, answer me met. The problem lies in the IE only recoznising for the first time, therefore, whatever is placed after that page is not being loaded in the page. The solution is to put each other frameset into [any other frameset] first.

The working code is:

  & lt ;! DOCTYPE html public "- //W3C / DTD XHTML 1.0 frameset // n" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> & Lt; Html lang = "en" xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Frameset rows = "15%, 81%, 4%" & gt; & Lt; FRAMESET & gt; & Lt; FRAME src = "header.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; FRAMESET cols = "40%, 60%" & gt; & Lt; Frame name = "login_menu_frame" src = "login_box.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; FRAME name = "login_body_frame" src = "login_page_body.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; / FRAMESET> & Lt; FRAMESET & gt; & Lt; Frame name = "login_fruit_frame" src = "footer.html" frameborder = "0" scrolling = "no" & gt; & Lt; / Frames & gt; & Lt; / FRAMESET> & Lt; / FRAMESET> & Lt; / FRAMESET> & Lt; / Head & gt; & Lt; / Html & gt;  


node.js - Node-Webkit: Run application on download complete -


I have created a node-webkit application and I am trying to apply the application auto -update .

What I've done so far:

  1. I'm looking at the version of the package of my application. Package.json from json server
  2. If they are different, then I will download the new .exe from the server.
  3. This user-folder has been downloaded to \ AppData \ Local \ Temp \ folder

Now I want to close the application which is open and To run the new exe file. But I want to do it practically Does anyone help me do this? When a path has been specified, is there any way to open the application?

Any kind of help is appreciated. Thanks in advance

You can use spawn from the API.

Something new:

  is needed ("child_process"). (Eggs) (spawn) 'path / in / new / exe', [], {different: true}). Unref (); Requires ('nw.gui') Window.get () pass (right) ..  

javascript - With mutation observer, Is there a way for me to get the id or class of an element or child that has changed? -


I would like to know what changes have been made in the DOM and I want to know very specific information. I want to know which element has changed from the id, or if there is no ID or class, then I want to know where I can get this element. I am trying to complete it with a mutated supervisor. Here and here's the current code:

  & lt; Div id = "divTarget" & gt; & Lt; P & gt; Hello World & lt; / P & gt; & Lt; / Div & gt; & Lt; Button ID = "btnUpdate" & gt; Update target & lt; / Button & gt; Var fnCallback = function (mutations) {mutation.forEach (warning (mutation type, "Added:" + mutation.addedNodes.length + "nodes"); Warning (mutation type, "Deleted: "+ Mutation.removedNodes.length +" nodes ");}); }; Var observer = new MutationObserver (fnCallback), elTarget = document.query selector ("#divitagrams"), objConfig = {childList: true, subtree: true, attributes: true, characterization: true, attributeFilter: ['style', 'id '], AttributeOldValue: true}; Supervisor Promotions (Altags, Ozongfig); // Here only the test code var btnUpdate = document.querySelector ("# btnUpdate"), fnHandler = function () {elTarget.innerHTML = "& lt; h2> New Content " ; }; BtnUpdate.addEventListener ("click", fnHandler, false);  


Magento - Multiple values of the same attribute on a product -


I will have multiple values ​​for the same feature on a Magento product.

e.g. My shop has a black-white blanket when they choose white, then the customer should find this product, but whenever they choose white.

I noticed that for admin input, there is an option named "multiple selection", but it disappears for configurable products

So, for a product Can be multiple values ​​from the same property, but still use attribute for configurable products?

I hope someone can help me!


javascript - %output not showing for range slider in HAML -


I'm trying to set it so that the price can be shown next to my threshold slider, but I do not think so Get it to work.

I have seen, but because I am working with HAML because I am quite new, I can not seem to do this work.

At this time I have the code:

  .form-object = f.label: duration, 'trial duration',: class = & gt; 'Form-label' .col-sm-10 = f.range_field: duration,: class = & gt; 'Slider', in: 1 ... 100,: onchange = & gt; 'Show value (this.value)'% span # time 60: Javascript function show value (new vele) {document.getElementById ('time'). InnerHTML = newValue; }  

But the% duration does not appear, even in the generated HTML. I tried to output% with this but there was no difference ...

Any thoughts?


ios - no architecture to compile for -


So I'm trying to test my first app beta and I believe that one of the first steps is the PRODUCT To kill / ARCHIVE. / P>

Backdrop ... works on the app simulator, and when I connect my phone via USB.

So when I hit the collection, he said that my third party structure was not found. So I'm studying for days trying to fix it.

I'm trying to edit the architecture build settings and I'm not sure what I'm doing. I tried to remove everything in the creation of a valid architecture because it starts working for some people.

I can not even build a project anymore.

I have no idea what the project is doing to work.

Enter image details here

So I just added armv7 It's not sure I have done it right, but now I get a new error.

The first image is how I added armv7

image details here Enter

The second picture is my new error message

I used the framework and everything worked using the added pod


c# - Obtaining cell name in Aspose Cells -


I'm looking to get the name of the cell given by the row / column pair. I need a name to use in the formula For example, I want to set a formula (3, 4) in a formula that combines the values ​​of cells (4, 4) and (5, 4) is.

Cell (3, 4) is D5 ; (4, 4) is E5 , and (5, 4) is F5 . Therefore, my formula should look like this:

  = E5 + F5  

I can format my form in such a way:

  constant int col = 3; Const int row = 4; Worksheet Seals [row, cola]. Formula = string. Do not use the format ("= {0} {1} + {2} {3}", (four) ('A' + Col 1) // & lt; 1, (four) ('A' + 2 + 2) //  

This column works fine for A..Z, but with the name breaks right next to the column I could use it, but the problem seems so basic That he should not need coding on his part.

That's right, you do not need this code, because Asaj has done this for you. Their Cells is the method in the Helpper class, which does exactly what you do:

  const int col = 3; Const int row = 4; Worksheet Seals [row, cola]. Formula = $ "= {cel. Helper.cllandexioName (row, collect + 1)} + {cilsehalfper.SilindExtam (line, cl + 2)}";  

Android studio Sdk Manager not opening -


So when I try to open my SDK manager (or my Ed Manager) in Android Studio, I get this error message Can not launch SDK Manager:

Error: Unable to access jarfile lib \ archquery.jar Invalid path Denven Fille Blev ikke fundet Denven Fille Denken Fillay Blev ikke Fundet Denwen Fille Blev ikke Fundet Denwen Fille Blev ikke Fundet Denwen Fillie Blev Ikke fundet Denven Fille Blev ikke fundet error: SWT folder '' does not exist Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.

("den engivee fil blev ikke fundet" means: the given file was not found)

I think the reason might be a file extracted by an antivirus software, if it helps.

I have tried to change jdk again and I have also seen environmental variables on my way, which appears in sequence, but I still have this problem.


javascript - How can i pass the address of a draggable google map marker into an input field? -


I want to pass the address of a Google dragable map marker in a field and then submit it in a column in the MySQL database. Want to do I found the code given below which I really want but I want to keep the "closest match address" results inside the input area. How can I do that?

& lt; Html & gt; & Lt; Top & gt; & Lt; Meta name = "viewport" content = "initial-scale = 1.0, user-scalable =" /> & Lt; Script type = "text / javascript" src = "http://maps.google.com/maps/api/js?sensor=false" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Var Geocoder = new google.maps.Geocoder (); Function geocodePosition (pos) {geocoder.geocode ({latLng: pos}, function (responses) {If (responses and responses length> gt; 0) {updateMarkerAddress (responses [0] .formatted_address);} and {updateMarkerAddress (' The address can not be determined at this location. ');}}); } Function Update markerstats (str) {document.getElementById ('MarkerStatus'). InnerHTML = str; } Function Update MarkerPause (latLng) {document.getElementById ('info'). InnerHTML = [latLng.lat (), latLng.lng ()] .join (','); } Function update marker address (ARR) {document.getElementById ('address'). InnerHTML = str; } Initialize function () {var latLng = new google.maps.LatLng (-34.397, 150.644); Var map = new google.maps.Map (document.getElementById ('mapCanvas'), {zoom: 8, center: latLng, mapTypeId: google.maps.MapTypeId.ROADMAP}); Var marker = new google.maps.marker ({status: latLng, title: 'point a', map: map, dragable: true}); // Update current status information updateMarkerPosition (LatLng); GeocodePosition (LatLng); // Add event viewers to Google.maps.event.addListener (marker, 'dragert', function () {updateMarkerAddress ('dragging ...');}); Google.maps.event.addListener (Marker, 'Drag', Function () {updateMarkerStatus ('Drag ...'); UpdateMarkerPosition (marker.getPosition ());}); Google.maps.event.addListener (Marker, 'drands', function () {updateMarkerStatus ('drag-edged'); Geocodeposition (marker .getPosition ());}); } // Google.maps.event.addDomListener (window, 'load', start) to close the onload handler app; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Style & gt; #mapCanvas {width: 500px; Height: 400px; Float: left;} #infoPanel {float: left; Margin-left: 10px;} #infoPanel div {margin-bottom: 5px;} & lt; / Style & gt; & Lt; Div id = "mapCanvas" & gt; & Lt; / Div & gt; & Lt; Div id = "infopanel" & gt; & Lt; B & gt; Marker Status: & lt; / B & gt; & Lt; Div id = "markerStatus" & gt; & Lt; I & gt; Click and drag the marker. & Lt; / I & gt; & Lt; / Div & gt; & Lt; B & gt; Current Status: & lt; / B & gt; & Lt; Div id = "info" & gt; & Lt; / Div & gt; & Lt; B & gt; Closest match address: & lt; / B & gt; & Lt; Div id = "address" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;

Change:

  & lt; Div id = "address" & gt; & Lt; / Div & gt; Function update mark address (str) {document.getElementById ('address'). InnerHTML = str; }  

to:

  & lt; Input id = "address" / & gt; Function update mark address (str) {document.getElementById ('address'). Value = str; }  

logging - CMD all output to one log file -


So,

I have a single bit file with some commands, which I want to output I have a single log.txt file

There is no way to tell CMD (at the beginning of a bat file), all this warning / error / everything should be produced in a log.txt and Should not consoles? Or do I need to individually add "dir> log.txt 2> and 1" to each command?

Tnx

you

  @echo You can try to change off batch commands ....  

in

  @echo off call: doCommands% * & gt; File.txt 2 & gt; And 1 exit / b: doCommands batch command .....  

php - Join in Doctrine not working -


I implemented the principle in CodeIgniter. I used the unit sections PdContact and PdSubject and placed under the unit folder under the model folder. I have used the following code to join tables:

  $ qb = $ this-> Em- & gt; CreateQuerybuilder ('c') - & gt; Select ('PDCTTact') - & gt; LeftJoin ('PDSbackext', 'co', 'with', 'co.id = cid') - & gt; Setx result (20); $ Query = $ qb- & gt; GetQuery (); Return $ query- & gt; GetResult ();  

But this is not working please give a suggestion.


html5 - Microdata Testing Tool has error at phone? -


मेरे पास यह उदाहरण कोड है (बस यहां आवश्यक भाग):

  & lt ;! DOCTYPE html & gt; & Lt; html आइटमस्केप आइटमप्रकार = "http://schema.org/ProfessionalService" lang = "hu" & gt; & Lt; शीर्ष & gt; & lt; / head & gt; & LT; बॉडी & gt; & Lt; अनुभाग आईडी = "संपर्क" & gt; & LT; ul & gt; & Lt; li & gt; टेली: & lt; span itemprop = "टेलीफोन" id = "tel" & gt; & lt; एक "href =" tel: +36305555555 "& gt; 06 (30) 5555555 & lt; / a & gt; & lt; / span & gt; & Lt; / li & gt; & lt; / ul & gt; & lt; / अनुभाग & gt; & lt; / body & gt; & lt; / html & gt;  

जब मैं इसे मान्य करता हूं तो मुझे सही पर सही डेटा मिला है यहां छवि विवरण दर्ज करें

यहां समस्या आती है:

जब मैं वेबमास्टर टूल में पहला मार्कअप का उपयोग करता हूं, तो Google इसे एक लिंक के रूप में मानता है जो इसे 404 त्रुटि देता है , क्योंकि कोई पृष्ठ नहीं है जैसा कि +36305555555। और यह एक समस्या है।

मैंने पढ़ा है कि यह समाधान और टैग में intemprop डाल रहा है:

 < कोड> & lt;; DOCTYPE html & gt; & lt; html आइटमस्केप आइटमप्रकार = "http://schema.org/ProfessionalService" lang = "hu" & gt; & gt; सिर & gt; & lt; / head & gt; & lt; बॉडी & gt; & lt; अनुभाग आईडी = "संपर्क" & gt; & lt; ul & gt; & lt; li & gt; दूरभाष: & lt; span id = "tel" & gt; & lt; एक "href =" tel: +36305555555 "आइटमप्रॉप =" टेलीफोन "& gt; 06 (30) 5555555 & lt; / a & gt; & lt; / span & gt; & lt; / li & gt; & Lt; / ul & gt; & Lt; / अनुभाग & gt; & Lt; / body & gt; & Lt; / html & gt;  

लेकिन इस मामले में परीक्षण टूल मुझे यह देता है: यहां छवि विवरण दर्ज करें

तो एक मामले में Google कहता है," ठीक है यह संरचित डेटा के रूप में अच्छा है, मैं आपका फोन नंबर देख रहा हूँ लेकिन यह एक त्रुटि है 404, ऐसा नहीं करते हैं " दूसरे मामले में यह कहते हैं: "यह यूआरएल के साथ एक फोन नंबर है लेकिन आप ठीक हैं, आपके पास कोई 404 त्रुटि नहीं है"

इस में क्या करना है स्थिति

नोट: यह href है, नहीं "Href

यह स्कीमाओआरडी शब्दावली का वैध एचटीएमएल 5 + माइक्रोडेटा और उचित उपयोग है:

  और 
आइटम केपॉप आइटम प्रकार =" http: Http://schema.org/ProfessionalService-> & lt; span itemprop = "टेलीफोन" & gt; & lt; a href = "tel: +36305555555" & gt; 06 (30) 5555555 & lt; / a & gt; & lt; / span & gt; & lt; / Div & gt;

यदि आप टेलीफोन संपत्ति को a तत्व के बजाय निर्दिष्ट करते हैं, तो संपत्ति के मूल्य का मूल्य होगा href विशेषता, लेकिन स्कीमाओआरओ, यूआरएल नहीं है, इसलिए आपके समाधान का अतिरिक्त span सही है।

मुझे Google वेबमास्टर नहीं पता उपकरण, लेकिन मुझे लगता है कि यह अजीब है कि वे एक टेली यूआरआई (whi) को हल करने की कोशिश करेंगे च कभी काम नहीं करेगा)। वैसे भी, मैं नहीं देख सकता कि यह आपको इस मार्कअप का उपयोग क्यों करना चाहिए।


ios - Charts with swift -


I'm new to iOS development and want to create an app with some charts. I decided to start developing rapidly because as Java developer seemed to be easier for me to learn, but in the meantime I feel that using Objective-C would be a better option, because AFAIK has a chart library that matches my criteria

  • Line and bar charts
  • Ability to draw charts with date and time axis
  • Li>
  • Free or The price & lt; General chart libraries such as JBCHRTVVV, CorePlot and IOSplots do not meet my criteria, so I am thinking that either to use the JavaScript Chart library. Switching to a webview or purpose-c

    Is it good to use the JavaScript Chart API in the webview? If so, can it cause problems with different screen sizes and different devices with orientation? What are the common problems with this approach?

    EDIT: Core-plot release -2.0 works well with SWIFT

  • As stated in the written comments on the link, you can use the core plot swift as long as you use the code from the release-2.0 branch. Are there. Changes in that branch are to solve problems with NSDecimal which are 1.x versions of the core plot.


    embedded - Conversion of integer to char array in C -


    I am developing an ARM embedded application. I stuck on a silly problem - I have an array of unsigned 8-bit integers:

      uint8_t days [42] = {0};  

    This is initial with some data - Initial algorithm is very confusing and the irrelevant variable is introduced to the problem, so I will not return it here again. I look at this array in the debugger variable watch, and I'm pretty sure that it is filled with integer values ​​from 0 to 31.

    I want to take any element of this array, say fifteen, and convert it to four * so that it can be displayed on my LCD screen . I write it again using the sprintf function:

      four d [3] = {'0', '0', '0'}; Springf (d, "% d", day [15]);  

    Just a note: No, I can not use the stdlib itoa () function, because it does not conform to MISRA A standard, which I am obliged to follow

    As a result, I get a binary zero value only in my d buffer any ideas?

    For the MISRA-C compliance, you must be sure to sprintf () Or anything from stdio.h either you want to avoid any way to avoid sprintf like plague on any embedded system in general.

    Writing a simple decimal integer for string conversion routine is quite basic things ... here is my attempt at an MISRA-C (2004 and 2012) Compatible Version: < Code> #include & lt; Stdint.h & gt; Zero dec_to_str (char * str, uint32_t val, size_t digits); Int main (empty) {Core Straw [3 U + 1U]; // assuming you want to end the redundant string? Dec_to_str (str, 31u, 3u); Return 0; } Zero dec_to_str (char * str, uint32_t val, size_t digits) {size_t i = 1u; {Str [num-i] = (four) ((well% 10u + 0 '); val == 10u;} [i-1u] = {0} for I & lt; = number; i ++) Assuming you want to end the redundant string?}

    Note: uint32_t can be to swap out for a uint8_t, But then you need to add all kinds of places, to prevent indirect type propaganda, as required by MISRA, code will actually be ugly, such as:

      str [points- I] = (four) (uint8_t) ((uit8_t) (val% 10u) + '0');  < The only wise thing to do again / again is to divide that mistake into several lines: 

      uint8_t ch = (uit8_t) (val% 10u); Ch = (Uint8_t) (ch + '0'); Str [digits-I] = (four) f;  

    php - MySQL query by exact date -


    I am querying from my database and actually blog posts (more specifically, every year on this date ) By trying to get, the following code posts should do according to what I've found, but it's getting all posts instead of last year.

     Select  $ sq = "* where` user_id` = '$ user_id' and POST_DATE & gt; CURDATE () - INTERVAL 1 year order POST_DATE by DESC"; $ Result = $ dbc-> Query ($ sql);  

    What can I do for a year? I could write a loop to increase the year if I could actually find out the query for one year.

    After

    If it is WordPress, then post_data is a DATETIME field. So just a year ago means '2014-03-16 09:03:27'. I doubt what you want me to think you want last year on this day

    Try this:

      POST_DATE & Gt; = CURDATE () - INTERVAL 1 year and after Date & lt; Kurt () - Interval 1 year + interval 1 day  

    The position of that pair takes all the posts, starting from midnight on that day a year ago, but does not include midnight on the following day is. MySQL implements them with a efficient index range scan.

    If you are looking for posts for any year on this year's day, then you need this type of expression.

      MONTH (CURDATE ()) = MONTH (post_date) and defofforth (curate ()) = DAYOFMONTH (post_date)  

    This is my first suggestion as fast as It will not be because it does not use an index; Besides, it will give strange results on leaps like '2016-02-29'.


    java - How to encode utf_general_ci data to a human readable string? -


    I know this may seem very easy, but I'm stacked due to this issue for the day. This thing is using the utf_general_ci to store the data that users save in different types of languages. What I want to do is display an example in human readable text.

    The user enters the text 'ዝ', and will be credited in the form of 'á <' as utfagrey_journal_c.

    I want to show the original text to the user who 'ዝ' how can I do this. Data is stored in MySQL PHP, I want to convert it to Java or Jason file. What is the plan?

    Here is the json code

      & lt ;? Php header ('content-type: application / jason; charset = utf 8; http-equiv =' type of content '); $ result = $ db- & gt; query (select "from movie'); while ($ Line = mysqli_fetch_array ($ result)) {$ output [==] ('MovieID' => $ line ['MovieID']); $ output [] = array ('title' = & gt; $ line [' Title ']);} echo json_encode ($ output, JSON_UNESCAPED_UNICODE);  

    The inclusion statement is very simple and I have to head the web

      & lt; Meta content = "text / html; Is defined as. Charset = utf-8 "http-equiv =" content-type "& gt;  


    eclipse - android emulator controls misplaced -



    eclipse - android emulator controls misplaced -

    is android emulator right? mean in xml(it shows device nexus one) placing elements when runs on emulator (nexus one) misplaced. not have real device of similar size nexus 1 otherwise have checked.

    kindly advice

    don't utilize width , height in pixels. utilize weight , weightsum , utilize "match_parent" ,"fill_parent" & "wrap content" place tools , give dimensions in "dp". think might helpful you.

    android eclipse emulator

    vba - Expected error can only be a 440/Automation Error? -



    vba - Expected error can only be a 440/Automation Error? -

    context

    i have written little unit testing library in vba, can write unit tests this:

    '@expectederror() public sub testcannotregisterloggertwice() dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) logmanager.register logger logmanager.register logger end sub

    the above test passes:

    class="lang-none prettyprint-override">2014-10-04 16:42:55 testcannotregisterloggertwice: [pass]

    and if remove expectederror "attribute", fails:

    class="lang-none prettyprint-override">2014-10-04 16:43:49 testcannotregisterloggertwice: [inconclusive] - test raised error: automation error

    so far, good. well, almost.

    in-test errors work fine!

    now if create test throw division zero, this:

    '@expectederror() public sub testcannotregisterloggertwice() dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) dim boom integer boom = 1 / 0 logmanager.register logger logmanager.register logger end sub

    the test still inconclusive, time error correctly picked up:

    class="lang-none prettyprint-override">2014-10-04 16:45:12 testcannotregisterloggertwice: [inconclusive] - test raised error: partition 0

    the part don't understand, in both cases, error raised in same vbaproject - former in class called logmanager (the sut), latter in class called logmanagertests.

    here part throws expected error i'm testing for:

    public sub register(byval logger ilogger) if not this.loggers.exists(logger.name) this.loggers.add logger.name, logger else err.raise logmanagererror.duplicateloggererror, "logmanager.register", "there logger registered name '" & logger.name & "'." end if end sub what want

    i able decorate test methods '@expectederror(-2147220406) (the long representation of logmanagererror.duplicateloggererror), , able clean part up, in testengine.reflecttestmethods method:

    for each prospect in classmethods if canaddtestmethod(prospect, result) set tmethod = new testmethod set tmethod.ownerinstance = classinstance tmethod.methodname = prospect.name if prospect.hasattribute(expectederrorattribute) if prospect.attributeparameters(expectederrorattribute).count <> 0 err.raise vbobjecterror + 1055, "testengine.reflecttestmethods", "expectederrorattribute test method '" & prospect.name & "' should not have parameters." end if 'force "automation error" expected, 'because vba "eats" expected error thrown in sut: tmethod.expectederror = 440 ' prospect.attributeparameters(expectederrorattribute).first end if result.add tmethod.methodname, tmethod end if next

    is so? can ever expect sut throw automation error?

    something i've tried

    since error correctly reported when it's thrown in actual test method, tried this:

    '@expectederror() public sub testcannotregisterloggertwice() on error goto cleanfail dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) logmanager.register logger logmanager.register logger exit sub cleanfail: dim errnumber long errnumber = err.number dim errsource string errsource = err.source dim errdescription string errdescription = err.description err.raise errnumber, errsource, errdescription end sub

    but though errdescription contains correct/expected error message, testing library still receives automation error number 440.

    why testing library correctly pick partition zero, not custom error?

    edit: upon farther experimentation, noticed can "expect" built-in error, works:

    '@expectederror(5) public sub testcannotregisterloggertwice() dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) logmanager.register logger logmanager.register logger end sub

    ...provided alter testengine code take parameters @expectederror attribute, , raise error #5 / "invalid procedure phone call or argument" in sut, instead of custom error; can't provide custom error message either. isn't ideal, because forces sut throw built-in errors, , testing library can't assume it's case.

    what's special custom error codes in vba?

    i don't know what's special custom error codes in vba.

    but if error numbers thrown in sut not in form of recommended vbobjecterror + n (as can inferred -2147220406 representation of error code you're expecting), application-defined or object-defined error can used, , "expected":

    public enum logmanagererror duplicateloggererror = 100 loggernotregisterederror end enum

    the testengine still not "see" custom error message, can this:

    '@expectederror(100) public sub testcannotregisterloggertwice() dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) logmanager.register logger logmanager.register logger end sub

    and result:

    class="lang-none prettyprint-override">2014-10-04 18:09:56 testcannotregisterloggertwice: [pass]

    if expectederror attribute removed, application-defined or object-defined error:

    class="lang-none prettyprint-override">2014-10-04 18:10:20 testcannotregisterloggertwice: [inconclusive] - test raised error: application-defined or object-defined error

    which technically right - granted, nice able study custom error message in test result, it's 1 of limitations have dealt with.

    at to the lowest degree can throw different errors in sut, and able tell whether that error raised - goal achieved here.

    meanwhile custom error message still visible , displayable in "normal" code:

    '@expectederror(100) public sub testcannotregisterloggertwice() on error goto cleanfail dim logger ilogger set logger = mocklogger.create("testlogger", tracelevel) logmanager.register logger logmanager.register logger exit sub cleanfail: msgbox err.description err.raise err.number end sub

    class="lang-none prettyprint-override">2014-10-04 18:21:24 testcannotregisterloggertwice: [pass]

    vba unit-testing error-handling

    Does the request object in Node.js contain any navigator.userAgent type of information? -



    Does the request object in Node.js contain any navigator.userAgent type of information? -

    i've setup node.js server gets contact form info , forwards email. i'd able forwards info user's browser along form data.

    is of info contained in request object in form ? kind of navigator.useragent string available on client ?

    or should include string in info sent out, manually, myself?

    i thinking of :

    var httpserver = http.createserver(function (request, response) { var browserid = request.navigator.useragent; });

    thanks!

    i testing out myself in express, , can find user-agent string in:

    request.header['user-agent']

    and can see in http specification in 14.43 here.

    in future, can examine request object either console.log() or debugger , see what's in it. find more educational trying find things in documentation somewhere.

    node.js request navigator

    jquery - jssor slider: vertical-align images – flexslider used instead -



    jquery - jssor slider: vertical-align images – flexslider used instead -

    i have full-page jssor slider. pictures scaled 'cover' they're cutting off on bottom if they're tall.

    i able specify each image whether should vertically centered or bottom-aligned (or default top-aligned), can create sure of import parts of each image showing.

    i've tried vertical-align styles on div containing img no luck.

    then i've tried calculating required offset , applying negative margin-top images tall – code below. works @ total width, pushes pictures high when resize window below width – leaving blank space on bottom. haven't been able figure out how stop happening.

    has gotten work? there built-in functionality i've missed?

    html (i add together show-bottom class on relevant slides):

    <div id="slider1_container" style="position: relative; margin: 0 auto; top: 0px; left: 0px; width: 1200px; height: 900px; display: none;"> <!-- slides container --> <div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 1200px; height: 900px; overflow: hidden;"> {% slide in slides %} <div><img class="slide-image show-bottom" u="image" src="/site_media/{{ slide }}" /></div> {% endfor %} </div> </div>

    js:

    var options = { $slideduration: 700, //[optional] specifies default duration (swipe) slide in milliseconds, default value 500 $dragorientation: 1, //[optional] orientation drag slide, 0 no drag, 1 horizental, 2 vertical, 3 either, default value 1 (note $dragorientation should same $playorientation when $displaypieces greater 1, or parking position not 0) $autoplay: true, //[optional] whether auto play, enable slideshow, alternative must set true, default value false $autoplayinterval: 4000, //[optional] interval (in milliseconds) go next slide since previous stopped if slider auto playing, default value 3000 $slideeasing: $jssoreasing$.$easeinquart, $arrowkeynavigation: true, //[optional] allows keyboard (arrow key) navigation or not, default value false $pauseonhover: 0, //[optional] whether pause when mouse on if slider auto playing, 0 no pause, 1 pause desktop, 2 pause touch device, 3 pause desktop , touch device, 4 freeze desktop, 8 freeze touch device, 12 freeze desktop , touch device, default value 1 $fillmode: 2, //[optional] way fill image in slide, 0 stretch, 1 contain (keep aspect ratio , set within slide), 2 cover (keep aspect ratio , cover whole slide), 4 actual size, 5 contain big image, actual size little image, default value 0 }; var jssor_slider1 = new $jssorslider$("slider1_container", options); //responsive code begin //you can remove responsive code if don't want slider scales while window resizes function scaleslider() { var windowwidth = $(window).width(); if (windowwidth) { var windowheight = $(window).height(); var originalwidth = jssor_slider1.$originalwidth(); var originalheight = jssor_slider1.$originalheight(); var scalewidth = windowwidth; if (originalwidth / windowwidth > originalheight / windowheight) { scalewidth = math.ceil(windowheight / originalheight * originalwidth); } jssor_slider1.$scalewidth(scalewidth); // added bit: // adjust vertical alignment $( '.slide-image.show-bottom').each(function() { var $this = $(this) if ($this.height() > windowheight) { $this.css('margin-top', windowheight - $this.height()) } }) // end vertical alignment } else window.settimeout(scaleslider, 30); } scaleslider(); $(window).bind("load", scaleslider); $(window).bind("resize", scaleslider); $(window).bind("orientationchange", scaleslider); //responsive code end

    update: seems have height: 900px; set on img. height jquery finds .height(), regardless of actual height jssor has applied. how actual height after jssor has scaled it? seems crux.

    2 ways fill , align image in jssor slider.

    auto filling/alignment specifying $fillmode alternative , specifying u="image" image element. (e.g. <img u="image" ...) manual filling/alignment removing u="image" image element , specifying css image element. (e.g. <img style="position: relative; top: ...px; left: ...px; width: ...px; height: ...px; ..." src=...)

    to retrieve original size , scaled size of slider, please utilize next api.

    $scalewidth() //formerly known $getscalewidth() //retrieve scaled width slider displays $scalewidth(width) //formerly known $setscalewidth(width) //scale slider new width , maintain aspect ratio $scaleheight() //formerly known $getscaleheight() //retrieve scaled height slider displays $scaleheight(height) //scale slider new height , maintain aspect ratio $originalwidth() //formerly known $getoriginalwidth() //retrieve original width of slider $originalheight() //formerly known $getoriginalheight() //retrieve original height of slider

    reference: http://www.jssor.com/development/reference-api.html

    jquery css flexslider jssor

    c# - NLog: How do I control the format of a message from a LogEventInfo object? -



    c# - NLog: How do I control the format of a message from a LogEventInfo object? -

    i'm new nlog, , i've been playing logeventinfo objects, since think i'll need them in application. created logeventinfo object plain text string, , called logger.debug(myeventinfoobject), using fileappender set write ${message}. expected see text string, saw instead logger name, message level, message, , sequence id. found that expanded string when phone call myeventinfoobject.tostring(). how can command appears when ${message} comes logeventinfo object?

    here's config file:

    <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/nlog.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" throwexceptions="true"> <targets> <target name="file" xsi:type="file" layout="${longdate} ${logger} ${message}" filename="${basedir}/nlog_sample_file.txt" /> </targets> <rules> <logger name="*" minlevel="debug" writeto="file" /> </rules> </nlog>

    here's code generating log:

    using system; using system.collections.generic; using system.linq; using system.text; using nlog; namespace nlogsample { class programme { static void main(string[] args) { seek { logger logger = logmanager.getcurrentclasslogger(); logeventinfo theevent = new logeventinfo(loglevel.debug, "", "this message loginfoevent not used."); theevent.properties["message"] = "this message loginfoevent message property used."; logger.debug(theevent); logger.debug("does sequence id show in message?"); string formattedmessage = theevent.formattedmessage; string eventstring = theevent.tostring(); } grab (exception ex) { int = 1; } } } }

    finally, here sample of message:

    2014-10-08 10:14:13.5525 nlogsample.program log event: logger='' level=debug message='this message loginfoevent not used.' sequenceid=2

    i working in visual studio 2012 on win7 pro machine.

    thanks much!

    robr

    if want create logeventinfo objects , fill them own information, should utilize 1 of logger.log method signatures, not logger.info/logger.debug/etc method signatures.

    the behavior seeing right because logger.debug method receiving object (which happens logeventinfo object) , calling tostring on before logging it.

    c# nlog