Tuesday 15 July 2014

database - How to open an .accdb file in Ubuntu? -


The development machine I work on is Ubuntu Janny Zaloplop as its operating system. I was created by Microsoft Access Working as a .accdb file is presented with data for a project. I have no copy of Microsoft Access. I have open office installed and will be ready to install any software package available on my operating system. Is there a way that I can open or change this file so that I can view and edit the data on my computer? Is there another format that access database can be saved, as I would be able to open?

There are two open source devices available, however they only work on MDB format files. Can you ask the supplier of the ACCDB file to give it in MDB format?

Microsoft Access is a set of open-source libraries and utilities to export data from MS Access database (MDB file) without DLLs.

The MS Java Access Database has a pure Java library for reading and writing. This is part of the OpenHMS project from Health Market Science, Inc. This is not an application. There is no GUI. This is a library that aims to use to create Java developers. It appears to be much newer than MDB devices, it is more active and support is written.


Calling Java library from Objective C on Mac -


I want to create the original Mac OS X application using Cocoa + Objective C but I have to connect to the proprietary data source, And this, the owner of the data source only provides the Java Library so I have to import the Java Library to my Java and Java functions in my Java classes. (Or create Java wrapper around this library and then call your cover through Objective-C).

Now, how do I do this? Quick Google Search takes me JNI but I have not found any good and real (current) articles / tutorials. I actually have some articles, how to load this Java library, if necessary, start VM and how to create Java objects and call functions on them. Actually something is simple and I can move forward from there. Thank you.

Just to clarify, I repeat: I want to call Java-C to Objective-C, I do not want to call original functions from Java.

You are probably looking for a small known corner, from which you can run Java Runtime In-Process Can load.

That said, you may have an easy time with a Java service application that communicates more with your objective-C application.


Haskell List Comprehension -


I get the "not missing: x" error when it happens ...

  Blanks: Sudoku - & gt; [Pos] Spaces (Sudoku su) = [FST X | X & LT; - POSSED | IsBlank (snd x)] Where is nothing mismatched = true is black_ = false posz = zip ixPos (concat su) ixPos = zip ixRows ixCols ixCols = concat (9 [0..8] repeat) ixRows = [floor (X / 9). X & lt; - [0..81]]  

However, if I compile the security of 2: ND line GHCI without any errors.

Can you help me understand what I am doing?

Try [fst x | X & LT; - POSASSAD, ISBN (sd)]


c++ - Matrix classes Directx & OpenGL -


I have the following C ++ matrix class:

I I am using coupled with a renderer, for which there is an OpenLog and DirectX implementation.

I have a test example where within the window the coordinates of the mouse are used in the graphic position under the cursor. This works as expected under OpenGL.

Because the DirectX line head and OpenGell columns are the main, I reverse the matrix in the following way and pass it to the DirectX before rendering:

  if ( O-> Tree) {CObjectTransform * t = o- & gt; Tree-> gatetransform (O-> transgenied); D3d Matrix D; Float * M = (Float *) & amp; D; For (int u = 0; u & lt; 4; u ++) {for (int v = 0; v <4; v ++) {m [u + v * 4] = t-> ; Worldtransform.matrix [v + u * 4]; }} Pd3dDevice-> SetTransform (D3DTS_WORLD, & amp; d); }  

The result of this is nothing shown in the area visible from the graphics, here I have placed my cursor.

Like this:

  1. Is my change class correctly implemented?
  2. How do I work with DirectX? Edit:

    The following code setup was:

      float * m = (float *) & amp; D; For (int u = 0; u & lt; 4; u ++) {for (int v = 0; v <4; v ++) {m [u + v * 4] = t-> ; Worldtransform.matrix [v + u * 4]; }} Float test [16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 , 0,0}}; Memcpy (test, & amp; d, sizeof (d));  

    Matrix class values:

    1,0,0,0 - 0,1,0,0 - 0,0,1, 0
    47 , -30,0,1

    Values ​​of Swap Matrix:

    1,0,0,47 = 0,1,0, -30
    0,1,1 0,0,0,1

    Then the matrix is ​​being swaped around. Owing to the problem, swapping out the round code.

OpenGL and DirectX matrix represent against representation, but they have the opposite vector * matrix < / Code> is the command:

  • OpenGL: M * v . The main column in the M memory is
  • DirectX: v * m . M is the key in memory

Because the multiplication is reversed, you have to move your OpenGL matrix to pass the DX. But since DX uses the key of the line, you have to move again. Twice infected is actually the identity.

Why do not you try to make any changes about everyone?


Cannot show the downloaded webpage with proper encoding using PHP -


I have to get the content of a Persian page and some users have to show a part of that page. The problem is that after filtering the content of the page I can not show the content with the proper encoding. The webpage is located on sena.ir and here is the screen shot of the original webpage which I want to show:

And here's what I found:

", $ Header =" ") {if (! Isset ($ timeout)) $ timeout = 30; $ Curl = curl_init (); If (strrest ($ Referrer, ": //")) {curl_setopt ($ curl, CURLOPT_REFERER, $ referer); } $ Header [] = 'Accept: Image / GIF, Image / X-bitmap, Image / JPEG, Image / PJPAG'; $ Header [] = 'Connection: Keep' Elive '; $ Header [] = 'content-type: app / x-www-form-urlencoded; Charset = utf-8 '; // I have tried - as soon as there is no chance $ user_agent = 'Mozilla / 4.0 (compatible; MSIE 7.0; Windows NT 5.1; NAT CLR 1.0.3705; NAT CLR 1.1.4322; Media Center PC 4.0) ; $ Compression = "jizip"; Curl_setopt ($ curl, CURLOPT_HTTPHEADER, $ header); Curl_setopt ($ curl, CURLOPT_HEADER, 0); Curl_setopt ($ curl, CURLOPT_USERAGENT, $ user_agent); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ curl, CURLOPT_FOLLOWLOCATION, 1); Curl_setopt ($ curl, CURLOPT_POST, 0); Curl_setopt ($ curl, CURLOPT_ENCODING, $ compression); Curl_setopt ($ curl, CURLOPT_TIMEOUT, 300); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYHOST, 0); Curl_setopt ($ curl, CURLOPT_SSL_VERIFYPEER, 0); Curl_setopt ($ curl, CURLOPT_URL, $ url); $ Html = curl_xax ($ curl); Curl_close ($ curl); Return $ Html; } $ Content = getPage ("http://sena.ir/"); $ P1 = Straps ($ content, '' table cell spacing = "3" cellpadding = "3" width = "100%" range = "0" & ​​gt; '); $ P2 = Stropo ($ Content, "& lt; / table & gt;", $ p1); $ Content = substr ($ content, $ p1, $ p2- $ p1); Counterpart $ content; The output problem was not a problem since the proxy-like function, HTML and encoding declaration. Deletes the header, so you need to add these lines before filtering the filtered data:

  & lt; Html lang = "fa" & gt; & Lt; Top & gt; & Lt; Meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt;  

multithreading - incorrect function being called on multiple fast calls to python's threading.Thread() -


I'm having some problems launching threads from the list of jobs, they are on a list because they are configurable-specific I am wrapping up the tasks so that I can store the results of the work in 'Self', but in the non-threadsof manner something is going wrong so that I get the correct number of threads, but some examples are not correct. Here is the example code:

  import threading, time class run parallelest (): def __init __ (self): pass def runList (self, functionList): threadList = [] LISTIndex category for function In (0, Len (functionList)): newThread = threading.Thread (target = lambda: self._run_parallel_job (functionList [functionListIndex]) newThread.start () threadList.append (newThread) # sleep delay which all works well is. # Time.sleep (2) # We all wait to complete the thread and if none of them we report the failure for the thread in thread: Thread: thread (3600 * 24) # 1 day may be better if thread.isAlive () == true: increase exception ("thread.isAlive == true") def _run_parallel_job (self, function): result = function () # results Self thread itself # (I promise that I am using SACPHERS) DEF F (X): print "F (% d) run"% x returns x if __name__ == '__main__': RF (RP) = RunPalell Test = (Lambda: F (0), Lambda: F (1), Lambda: F (2), Lambda: F (3), Lambda: F (4), Lambda: F (5) / Code>  

When I run, I see things like this:

    & gt; Python thread_problem.py f (1) run f (2) run f (4) run f (5) run f (5) run f (6) run f (7) run & gt;  

I expect different commands in print, I think I should see 0-7 numbers with no duplication, but I do not. If I add time. Sleep (2), the problem goes magically away, but I would really like to know that the way I think it should do is not working.

Thanks a bunch!

The problem is that functionList [functionListIndex] is evaluated only When it is in Lambda (inside the thread) it is running. Until then the value of functionListIndex can change.

To fix this, you can pass a parameter to lambda that will be evaluated at the definition time:

  newThread = threading. Thread (target = lambda throw = function list index: self._run_parallel_job (func))  

The default parameter values ​​of the function are evaluated at the definition time, so this work Will do

Another Pythonic solution is to avoid the lambda and use the args parameter:

  newThread = threading.Thread (target = self._run_parallel_job , Args = (functionalist [function list index],))  

changelog - major changes in python since version 2.2.3 -


I wrote a short dragon script to create a file and calculate the time. I tested it on Fedora 10, and Ubuntu 8.x and it worked well. Python version was 2.5.x

I tried to run it on my production server (an old red hat based Linux server), version 2.2.3 of Python. The script does not work and generates a syntax error in class definition.

To define disk writing speed, the script defines a class with methods to create files on the disc. It starts like this:

  class TestDiskSpeed ​​(): def __init __ (self, round = 1, speed mode = SPEED_MODE_MEGABYTE):  
< P> The definition of class is as error by Python 2.2.3.

What are the major changes in Python 2.2.3 that potentially crash my application? I am using these modules: os, sys, time, stat, gc

Update:

By removing and accepting Python Class from class class definition. But it raises another error on this line:

  size = long (size) size! = No more self._size  

I have entered a PHP developer, just Python programming (maybe a month), and that is very useful for th Used in:

  $ var = (condition)? $ ValueIfTrue: $ valueIfFalse;  

I searched and found that it was done in python as I used for my size variable though it does not look like Python 2.2.3 is.

I was going to insert all the code here (I'm going to release script as LGPL as well), but the code is more than 150 lines (still in development).

This is strange, because it compiles if you delete ) In class definition, however, it says that the empty feet are fine.

Since you are using a lot of Python 2.5 features, so it will have to work hard to find them all. I recommend reading "what's new in python" for every version between 2.2 and 2.5, then coming up with a list of features that you can do your search, like:

  • New style classes
  • Good luck

  • New style classes
  • Understanding and generator
  • Tornieri expression
  • From, most of the new features have a new language keyword (or a new way of using a keyword, in the case of Ternary x if pyy ) Come on, it should not be difficult for them to grep.


    c# - DataTables and custom types -


    मैंने CustomData नामक एक वर्ग बनाया जो कि CustomOptions अपने खेतों में से एक के रूप में मैं मान के रूप में DataTable में CustomData का उपयोग करना चाहता हूं I यहां एक संक्षिप्त अवलोकन ( सरलीकृत, फ़ील्ड हैं निजी और एक्सेसर्स सार्वजनिक , अधिकतर पठनीय और सेट कस्टम विधियों द्वारा किया जाता है );

      enum CustomDataOptionType {// कुछ मान, महत्वपूर्ण नहीं} वर्ग कस्टम विकल्प {सार्वजनिक CustomDataOptionType प्रकार {get; } सार्वजनिक शब्दकोश & lt; स्ट्रिंग, स्ट्रिंग & gt; मान {प्राप्त करें; } // मूल्यों को सेट करने के लिए कुछ तरीके} वर्ग कस्टमडेटा {सार्वजनिक कस्टम विकल्प विकल्प {get; } // विकल्प सेट करने के लिए कुछ तरीके}  

    इसलिए, "वास्तविक" वर्ग में जो ऊपर का उपयोग करता है, मैं कॉलम का उपयोग करके एक DataTable बना देता हूं टाइपफ (कस्टमडेटा) हैं।

    लेकिन जब मैं कॉलम तक पहुंचने की कोशिश करता हूं, उदा। द्वारा

    <प्री> डेटारॉ पंक्ति = डेटा। रोसे। खोजें ("bla"); पंक्ति [ "colmn1"] विकल्प। // संभव नहीं

    क्यों मैं options -field?

    क्योंकि पंक्ति [" column1 "] देता है " ऑब्जेक्ट " आपको अपने प्रकार के लिए मूल्य डालने की आवश्यकता है:

      ((CustomData) पंक्ति ["column1"])। विकल्प  यदि आप  शून्य  मान को संभालते हैं, तो आपको इसका उपयोग करना चाहिए:  
      CustomData डेटा = पंक्ति ["स्तंभ 1"] कस्टमडेटा के रूप में; अगर (शून्य! = डेटा) {// आप क्या करना चाहते हैं}  

    या आप इसे सरल बनाने के लिए एक्सटेंशन विधियों का उपयोग कर सकते हैं:

      सार्वजनिक स्थिर डेटारवएटेंशन {सार्वजनिक स्थैतिक शून्य ForNotNull & lt; T & gt; (यह DataRow पंक्ति, स्ट्रिंग कॉलम नाम, एक्शन & lt; T & gt; कार्रवाई) {ऑब्जेक्ट rowValue = row [columnName]; यदि (पंक्तिव्यू टी है) {कार्रवाई ((टी) पंक्तिवैल्यू); }}} // कहीं और पंक्ति। ForNotNull & lt; कस्टमडेटा & gt; ("कॉलम 1", कटॉमडेटा = & gt; यह.टेक्स्टबॉक्स 1। टेक्स्ट = कस्टमडेटा। उपयोगकर्ता नाम);  

    .net - C#: How to get a resource string from a certain culture -


    I have a resource conference with translated texts in different languages, like the project looks like this:

    < Ul>
  • FooBar.resx
  • FooBar.nb-NO.resx
  • FooBar.sv-SE.resx
  • ...
  • I can get the texts using the static properties like this:

      var value = FooBar.Hello;  

    Or using reflection like this:

      var value = resource assembly. Gate type ("nomenclature fubar"). GetProperty ("Hello") .GetValue (empty, zero) as string;  

    In both ways, I will get the value associated with the existing UI culture of the current thread. Which is fine and completely what I would normally like.

    But can I do something if I want to explicitly believe in Swedish, without changing the UI culture?

    You can manually change the property of the Fübre class which is Visual Studio produces or if you are using directly, you can use the surcharge which takes the desired culture as a parameter.


    XPath question multiple selects -


      var assets1 = डेटा। चयन नोड ("// asset [@id] =" + पुराना बाइनरीआस्सेटआईडी); Var आस्तियों 2 = डेटा। चयन नोड ("// संपत्ति [@id] =" + पुराना बाइनरीआस्सेटआईडी);  

    क्या दो ऊपर के एक एक्सपेथ क्वेरी को संभव है?

    आपका एक्सपीथ जीन होने के साथ गलत है आप शायद इसका अर्थ है:

    <प्री> डेटा। चयन नोड ("// संपत्ति [@id = '" + पुराना बाइनरीआस्सेटआईडी + "']");

    दोनों संस्करणों (ऊपरी और निचले-केस) को संयोजित करने के लिए, आप इसका उपयोग कर सकते हैं:

      डेटा। चयन करें ("// * [((name ( ) = 'संपत्ति' या नाम () = 'परिसंपत्ति') और @आईडी = '"+ पुराना बाइनरीआससेटआईडी +"'] ");  

    या

      डेटा। चयन नोड ("(// संपत्ति | संपत्ति) [@ आईडी = '" + पुराना बाइनरीआस्सेटआईडी + "']") ;  

    यदि आपके पास // ऑपरेटर से बचने का कोई तरीका है, तो मैं ऐसा करने की सलाह देता हूं। जब आप करते हैं तो आपके प्रश्न तेजी से होंगे, हालांकि यह केवल बड़े इनपुट दस्तावेज़ों के साथ ध्यान देने योग्य होगा।


    javascript - jquery hide a div that contains flash without resetting it -


    Hi, I've written a model using the jquery UI and it appears in front of a flash movie, thus, inside the model html. Gets corrupted, I tried to hide the movie before turning on Mundal and the model is seen again after closing, but works well. () And. The show () flash movie is reset, while I want to hide everything (the movie) and display it after it's displayed. Show that model design.

    Testing in FF / Linux, FF / Winspeed, IE / WinXP, Safari / Winspeed:

    • Put your flash container DIV in a new DIV overflow: hidden .
    • CD ("left", "0 pixels");
    • Or, showing and hiding with animation effects:

      Ul>
    • To hide Flash-divis: $ ('# Id_div_with_swf '). Chetan ({left: "-2000px"}, 1000);
    • To show the Flash-div: $ ('# id_div_with_swf'). Chetan ({left: "0"}, 1000);

    HTML example:

      & lt; Div style = "width: 200px; height: 100px; overflow: hidden;" & gt; & Lt; Div id = "id_div_with_swf" style = "width: 200px; height: 100px; position: relative; left: 0px; top: 0px;" & gt; & Lt ;! - Flash here - & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

    You can find a browser working solution ('visibility', 'view', '' hidden ') with cross- .css


    c++ - Error C2589 on std::numeric_limits<double>::min() -


    When I try to compile some code (no), I get C2589 '(': right of Invalid token '::':

    on this line:

      maxPosition [0] = std :: numeric_limits & lt; double & gt;: minute ();  

    I think it's already defined a minimum () macro, but why is the compiler not taking (minimum) from the specified namespace instead of the macro?

    But why compiler macros Instead of taking the minimum () from the specified name space?

    Because the Marriage does not care about your namespace, language words or about your compiler . The first processing is first .

    In other words, the compiler only sees what is omitted after the preprocessing step and min some replacement string Was replaced by, and the result is that The dealer saw


    c# - Desktop switching in vista -


    I have loaded an application in C # fro Vista which loads it into "Winlogon" desktop when I log in I want to switch this app to "deaf" deasktop for how I can do this in the # best regards Ehtsham

    I have not tried to do it personally, but I imagine you can hide the main thread of the app from the default desktop. T need to. Use the SetThreadDesktop API call to get it.

    Find some useful information.


    c++ - How to avoid memory leak with shared_ptr? -


    निम्नलिखित कोड पर विचार करें।

      boost :: shared_ptr; संरचना बी; संरचना ए {~ ए () {std :: cout & lt; & lt; "~ ए" & lt; & lt; std :: endl; } Share_ptr & lt; B & gt; ख; }; संरचना बी {~ बी () {std :: cout & lt; & lt; "~ बी" & lt; & lt; std :: endl; } Share_ptr & lt; ए & gt; ए; }; Int main () {shared_ptr & lt; A & gt; एक (नया ए); shared_ptr & lt; p & gt; बी (नया बी); ए- & gt; बी = बी; बी- & gt; ए = ए; वापसी 0; }  

    कोई आउटपुट नहीं है कोई desctructor कहा जाता है स्मृति रिसाव। मैं हमेशा मानता हूं कि स्मार्ट पॉइंटर स्मृति लीक से बचने में मदद करता है।

    अगर मुझे कक्षाओं में क्रॉस-रेफरेंस की आवश्यकता हो तो मुझे क्या करना चाहिए?

    यदि आपके पास इस तरह के परिपत्र संदर्भ हैं, तो एक ऑब्जेक्ट को एक दूसरे को रखना चाहिए, न कि shared_ptr

    से:

    क्योंकि कार्यान्वयन संदर्भ गणना का उपयोग करता है, क्योंकि shared_ptr के उदाहरण चक्रों को पुनः प्राप्त नहीं किया जाएगा। उदाहरण के लिए, यदि मुख्य () एक shared_ptr को a पर रखता है, जो प्रत्यक्ष या अप्रत्यक्ष रूप से shared_ptr को वापस रखता है , का उपयोग संख्या 2 हो जाएगी। मूल shared_ptr का विनाश एक 1. का प्रयोग करें weak_ptr का उपयोग "चक्र तोड़ें"।

    लिंक के लिए धन्यवाद, ग्लेन।


    Mono compatible Dependency Injection Framework -


    Which frameworks are compatible (and tested) against the 2.4.2.3 runtime?

    The question is related to the use of NHibernate with Mono 2.4:

    I have used Mono 2.4.2 successfully before.

    Hope this helps :)


    Linq.NHibernate problem with OR statement -


    Note: all the code is written on top of my head, it may contain some errors, just get the full point of this question)

    Define this class: (for simplicity less)

      public class coded value {public string code {get; Set; } Public string value {get; Set; }}  

    Take Thousand Objects:

      coded value cv1 = new coded value () {code = "A", value = "1"}; Coded value cv 2 = new coded value () {code = "b", value = "2"}; IList & LT; CodedValue & gt; CVList = new list & lt; Coded value & gt; (); CvList.Add (CV1); CvList.Add (CV2);  

    The CVList has a list of values ​​coded to filter.

    Let's get into my database thesus records:

      code VALUE A1A2B1b2  

    Now, I want to retrieve all the objects where the coded value is in the list

      list of var filter = myRepository () where cvList.Contains (o coded value) select o;  

    Translate NHibernate this Linq to:

      Select [field ...] from [table ...] where in the code ('A '' B ') and value (' 1 ',' 2 ');  

    This is incorrect if you take a look at your record example, then this SQL will return all the rows. The translation of SQL should be:

      select [field ...] from [table ...] where (code = 'a' and value = '1') or (code = 'b' 'And value =' 2 ');  

    So, can I get the results, which I want to use Linq? if so, how? If not, how can I get it?

    Thanks

    OK, here's the solution!

    I am using PredicateBuilder from this website:

    Again, I create predictions:

      var expr = Predicatebuilder.False & Lt; Audit & gt; (); Foreign currency (value coded value coded in Audit IDs) {coded value cv = coded value; Expr = expr.Or (a => (a.EventId.Code == cv.Code) and (AAITID.Code systemname == cv.CodeSystemName)); } ItemQuery = itemQuery.Where (expr); The   

    line coded value cv = codedValue in the foreach statement is very important, except for the line the correct SQL syntax will be created, but the value of the parameter All will be the same.

    I really hope this will help someone.


    Display the BLOB objects in Coldfusion -


    I have a query that receives data from Oracle DB. The table I am retrieving contains a Blob type column when I used it as the output

      & lt; Cfoutput & gt; # Query.blob column # & lt; / Cfoutput & gt;  

    This is giving me the error "BiteAir objects can not be converted to string". I

      & lt; Cfoutput & gt; #ToString (query.blobColumn) # & lt; / Cfoutput & gt; Have tried to use.  

    Then it works, but I'm getting the content as "t".

    Is there a way that we can display some Blob file (XML) and if the user clicks on it, can we display / download the entire content?

    This is the code I use

       #CharsetEncode (UpdatesArtult [ColName] [UpdateResult.CurrentRow], "ISO-8859-1") # & lt; / Td> & Lt; Cfelse & gt; & Lt; TD & gt; #UpdateResult [ColName] [UpdateResult.CurrentRow] # & lt; / TD & gt; & Lt; / Cfif> & Lt; / Cfloop & gt; & Lt; / TR & gt; & Lt; / Cfloop & gt; You can try to use the function ` 

    You can try to use the function.

      & lt; Cfoutput & gt; #charget encoded (query.blobCoulmn, "us-ascii") # & lt; / Cfoutput & gt; From documentation: 

    Adobe suggests that you use this function, and not toring function, to convert binary data into all new applications into strings.

    It supports many character sets, us-ascii is only used as an example. Hope it helps!


    .net - Asp.NET Principal WebORB HttpHandler -


    I have a Flex-Webber-Asp. Net Application While entering, there is an authentication handler that implements a WebORB interface:

      IPrincipal check credentials (string user name, string password, request message);  

    So I made a principal and returned it. Weborb uses primaries to check authentication and authorization of remote method calls.

      var principals = new generic principal (new generic entity (user.id.ToString ()), new [] {"admin"}); Return Principal  

    Now, at this point, if I check that is HttpContext.Current.User.Identity , this is a WindowsIdentity.

    So far everything is fine. When later, a remote call is made via WebORB, then I log in by the user by calling:

      thread Currently the principal. Identity .name  

    So I think WebORB ensures that the thread is identified with each remote call.

    The problem is that when I say a HTTP handler (to retrieve an image), then I also try to get the ID logged in user with the thread. Current Principal. Recognise. Name , but that does not work, probably with WebPrint, Weborb has not been in action.

    How do you solve it, so that I can get the login user ID in both cases? Put it in a session object? Can you change HttpContext.Current.User.Identity ? HttpContext.Current.User.Identity should not be the same as the thread. Current Principal. Identify .name ?

    PS: The user is not in Active Directory.

    No.


    PHP’s open_basedir value giving a binary value in Apache logs -


    Review logfiles to find out why my site came down a few days ago, I found hundreds of lines like this (Partially rewritten "X"):

    [Friday 27 27:14:36 ​​2009] [Error] [Client xxx.xxx.xxx.xxx] PHP Warning: Need_once (): Open_basedir restriction in effect. File (/var/www/xxx/xxx.php) is not allowed within the path (s): (\ xa0 \ x99 \ xc4) in /var/www/xxx/index.php on line 17

    Note that the open_basedir value is binary, so it will not match anything.

    No, there was no change to the server to change this, and there was no one to stop it. This apparently does not restart / reload (Apache or other services) ) Was resolved on itself. The open_basedir command in the Apache Conf file looks like this:

    php_admin_value open_basedir / var / www: / usr / share / php

    What would cause a binary Open_basedir value to reload with value, or where can I start to troubleshoot it?

    Apache Version: 2.2.8, PHP: 5.3.0, Linux 2.6.24-23

    looks identical, which should be fixed in 5.3.1.


    sql server 2008 - Cannot Specify Foreign Key Tables When Adding New Foreign Keys -


    I am trying to use the Relationship dialog in SQL 2008 to add a new foreign key to the table area. When I go to add one, I am not able to change and specify the foreign key base table or any other in the "table and column specification" area ... they all are out of depth for those values ​​and I am " M "

    Did you click the ellipsis button to get a small dialog box?

    In the section "Tables and Column Specifications" area there is a small button where you select the tables and columns: You can not enter the goods directly.


    internationalization - How to generate a single translation file for a large Qt project? -


    I have a large project with a QMake project file that defines all the project components using the 'sub-date' template Does. At present, I define translation files in the QMake files of each sub-project, which results in different translation files for each sub-project, which is quickly cumbersome to maintain it.

    How do I create a single translation file with all the translation strings for Lupadet to all sub-projects?

    First of all your pro files to supporters And primary files then all the pre files in a global pro file and generates a language file for that pro file.

    The Special Language Pro file looks like this:

      TEMPLATE = app DEPENDPATH + = Proj1 Proj2 Proj3 includes (Proj1 / Proj1.pri) (Proj2 / Proj2.pri) included (ProJ3 / ProJ3.pri) translate = en.ts fr ts.name.t ja.main.ts nl.main.ts  

    a script easily This project can generate language files for you.


    c# - How is this if statement interpreted? -


    I saw the code below, which surprised everyone.

    How is this code executed?

      if (! Test.IsXyz == true) {}  

    If IsXyz resolves to the right, but then with lies! Operator, how is this code interpreted? Because RHS is right, it will be:

    1) False for LHS. Right for RHS == False (from the table days of my truth)

    Let's assume that Bull resolves the truth, I can think that there will be many strange ways to understand this code. What is the official way of compiler? According to the C # operator preference, it should be evaluated <

    (

    Thus false (LHS) and True (RHS)


    nunit - Create Unit test methods dynamically during runtime in MSTest -


    Is MSTest equal to SuiteBuilder? One not yet found.

    I have a bunch of XML files, each should be seen as a test method as a map. It is not a good idea to write tests for 100 of these and manually for each of these.

    Then you can apply the ISuiteBuilder to the nunit and the test cases can be run dynamically and can be shown as many trials.

    I am looking for a way to do the same thing in MSTE.

    I have seen the datasource attribute, but this 1 data source XML file / CSV per test method forced me to write 100th of test methods. I also want to keep each XML file separate and I do not want to include everyone in 1 huge file, in which case it will be unselected.

    Has anyone tried to do this or is there any suggestion?

    Not exactly what you asked, but you can use automatic and parametric white box tests You can. In this way, you do not need to do all the stuff manually Pex supports MSTest as well as NUnit. Generated tests use an additional file, you do not need any XML files

    but I think you can not easily access your existing .xml files from NUIT and PX You can share with MSTEST - if that's what you want.


    C#: What is the proper way to swap winform controls? -


    What is the correct way to change a winform element with any other element when a trigger is made? For example, I would like to change a button and a single dimension with a text box in the same situation.

    If you (for some reason) do not just want to change your visibility, You can add and remove them from the control archive.

      // Fictional example ... Private Zero Swap (Add to Control, Remove to Control) {This. Control. Remove (toRemove); this. Control. Add (toAdd); }  

    sql server express - Backup only new or edited records -


    I have created a SQL Server Express database that is being placed on external HD. I need to add / update the data along with the database on my system, as well as other systems and then only backup or transfer data that has been added or edited in the external hard drive. What is the best way to accomplish this?

    You probably will use replication for it but as you express it using SQL Server There is no option.

    You will need a mechanism to determine what has changed between backups, so each table will need a timestamp or a last updated date time column, each time a record is entered or updated is done.

    Once you know which records are included or updated, this column may be easy to update, since this was only the last time the action was taken It's a matter of searching.

    An option is to add a bit column which is updated but it looks less flexible.


    asp.net - What's preferred for this - master page or page inheritance? -


    To see an entity, one needs to create a page in order to edit one unit in my system between the pages The difference is the menu bar and some other controls.

    I currently have two options:

    1. Create a master page with some content placeholders and fill them
    2. Create a base page for that and Receive from him.

    Which options do you recommend?

    The master page allows you to get both code and markup.

    A base page (in fact the base class, that page) only allows you to get the code; Any affiliate markup has to be injected, which is good to avoid trying to do some partial category with a page, which is never a concrete view from an architectural perspective with a markup, even if you It can work.

    Since your pages start sharing markup, the page will be a better answer.

    BTW, do not forget that you can nest master pages, so if you have many requirements on your site, then you have them layers. If necessary, you can use methods and properties in the master page from child pages.


    count top 10 most occuring values in a column in mysql -


    I have mysql table in which the data type is INT (11).

    How can I search to get the top 10 worst declines in this column? Select

      (count) by counting (*) count (*) DESC Limit 10  

    ruby - Relation between language and scalability -


    I have come to the following statement in the Arango Community website, Trapexit:

    Erlang is a programming Languages ​​are used to create large-scale scalable soft real-time systems with requirements on high availability.

    In addition, I remember that Twitter has switched from Ruby to Scala to solve the scalability problem.

    So, I wonder what is the relationship between programming language and scalability?

    I would think that scalability depends on system design, exception handling, etc. Because of this, a language has been implemented, for libraries, or for some other reason?

    Thanks to the hope for knowledge. Running up to 59's uptime or so, Along is highly optimized for a telecommunications environment. There is a set of libraries called OTP, and 'on the flight' without closing the application.

    This is definitely possible in other languages. In C ++, you can reload DLL on the fly, load plug-in. In the python you can reload the module. In C #, you can load the code in on-the-fly, use reflection and so on.

    It is this functionality that has been created in Erong, which means that:

    • This is more standard, any ARL developer knows how it works
    • Less content to re-apply itself

    He said that there are some fundamental differences between languages, to some degree which is interpreted as something Bytes run, some are compiled indigenous, so run on performance, and type of information and so on. Aim is different.

    Python has a global interpreter lock around its runtime, the library can not use SMP.

    The ARLing recently made changes to take advantage of SMP.

    Normally I agree with you, I think that a significant difference is less rather than a fundamental difference between languages ​​rather than underlying libraries.

    Eventually, I think that any project which is facing huge risk is 'stuck', it does not matter in T-language. As you say that I feel architecture and design, is very original for scalability and when I choose one language on another, I do not feel magically amazed scalability ...

    < / Html>

    c# - ASP.NET Threading: should I use the pool for DB and Emails actions? -


    I'm looking for the best way to use threads that consider scalability and performance.

    In my site, I have two scenarios which require threading:

    1. UI triggers: For example, the user clicks on a button, the server Read the data from DB and send some emails. Those actions take time and I do not want the user's request to be delayed. This scenario is very often.

    2. Background service: When the app starts, the thread is triggered every 10 minutes, reads from DB and sends emails.

    I found solution:

    Use a thread pool - the beginning invoke: I use it for both scenarios today. It works fine, but it uses the same thread that serve pages, so I think that I can run into scalability issues, can it be a problem?

    No use of B pool - Thread Start: I know that if a new thread starts, then using a thread pool takes more resources. Can this approach work better for my scenarios? What is the best way to reuse the opened thread?

    c. Custom Thread Pool: Because my scenarios are often the best way to start a new thread pool?

    Thank you.

    I will put it in a different service individually Write your UI action Make in the database, and do a different service, either choose the database or respond to the trigger, and sends the email at that time.

    By separating it into a separate service, you do not have to worry about appdomain recycling etc. - and if you want you can keep it on a completely different server. I think this will give you a more flexible solution.


    How to get method count in a type (interface/class/enum) in Eclipse? -


    I want to know how an interface declares or applies a square / enum. How do you get into eclipse? A plugin such as

    can tell you that:

    matrix view


    plugin (second one) identical metric ( Class-weighted methods) provided

    Chakrabarti calculator


    servlet compiling error -


    Can someone help me compile servlet? Do I have to include the path to compile the servlet in the path or command prompt for JDK or Tomcat?

    Your class path will require servlet.jar.


    widget - Display online NSE (National Stock Exchange) data in php web application -


    I want to display online NSE (National Stock Exchange) data in my PHP web application. Please help me how to do this.

    You can use Google APIs. They provide real-time data for NSE. But catch Google Finance API is available for Java, only this was not available for C # the last time I checked. Not sure about the finance API for PHP


    visual studio - How to create full screen window with MFC? -


    Do I want to create a full screen top screen (screen saver) window with MFC? How to create such a full screen window in MFC? I tried to create a Win32 application and I was able to create fullscreen top windows, but I want to use MFC so that I can put different MFC controls on that window later?

    Please help me.

    Thank you, Jim.

    You should be able to customize the example code to:

    < P>


    HTML How to markup 4 panels in a row for content -


    I am so unstable on the HTML so that I can do some help with the help of a table, But it is understood that there is no one today. Therefore, advice is needed.

    What do I want to accomplish are four styled boxes, which are spread across a row on the whole page. These boxes will contain some information, possibly text, potentially images, and possibly both.

    The boxes will be fixed sizes, that is, I do not want to resize them to fit the browser window width. I'm guessing that maybe it's being done with the div tag but I do not have the first clue from where it's starting.

    You want something like that (not tested)

      & Lt; Div id = "wrapper" & gt; & Lt; Div id = "box1" class = "box" & gt; & Lt ;! - Your content goes here - & gt; & Lt; / Div & gt; & Lt; Div id = "box2" square = "box" & gt; & Lt ;! - Your content goes here - & gt; & Lt; / Div & gt; & Lt; Div id = "box3" class = "box" & gt; & Lt ;! - Your content goes here - & gt; & Lt; / Div & gt; & Lt; Div id = "box4" class = "box" & gt; & Lt ;! - Your content goes here - & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

    with CSS

      .box {width: 200px; Margin-left: 20px; Swim left; } # Box 1 {margin-left: 0; } #wap {margin: 0 auto; // Center on page width: 860px; }  

    oop - Calling subclass's function from superclass based on string in PHP -


    मैं यह कैसे करूँगा:

      & lt;? Php वर्ग नियंत्रक {var $ ActionName; Var $ पेज पैरामीटर; समारोह InvokeAction () {$ actionFunctionName = ucfirst ($ this- & gt; ActionName); // $ actionFunctionName नाम नामक फ़ंक्शन कॉल करें $ जहां $ क्रियावाही कार्यवाही एक उपवर्ग में है}}? & Gt;  

    एक बोनस के रूप में, मुझे यह पता लगाना है कि यह फ़ंक्शन पहले मौजूद है या नहीं।

      अगर (method_exists ($ $, $ क्रियाविधिनाम)) {$ this- & gt; $ actionFunctionName (); }  

    ऐसा करना चाहिए


    iphone - UIProgressbar in Cococa Touch -


    I want to display a UIProgressbar based on the amount of data downloaded from the server.

    The only way I have implemented is that I have created an NSURL connection and set a delegate - (zero) connection: (NSURLConnection *) Connection Response Response: (NSURLResponse *) Response I expected Contact

    and - (in the zero) connection: (NSURLConnection *) connection was Resave data: (NSData *) Data is getting data part from each time partly until all the data is downloaded.

    But it does not solve my problem.

    Is there any other way to do this? <

    Thank you

    If you know the length of material expected, right now In total, the total amount is divided by:

      // These properties should be the property of the class UIProgressView * progress view; long overdue; Saphar got long; - (Zero) Connection: (NSURLConnection *) Connection was the reception: (NSDT *) data {gotSoFar + = data.length; ProgressView.progress = gotSofar / Expected; }  

    If you receive type alerts on partition, then cast for each long time before partitioning.


    php - MySQL Database; best schema -


    I have a question about a database schema for a specific website where people can sell and buy stuff.

    When someone adds an advertisement to the database, then he will select the category and fill the filter related to the selected category, so that by browsing a category of a person and choosing a filter, his ad will be easy You can get:

    [Bluetooth] Yes

    [camera] 3 - 5 megapixel

    AT

    What is the best way to save these filters in the database? This is what I have done so far:

    This is just an idea, but it will not return the value with the ad for filter "megapixel" between 3 to 5 , Because filter_value type is VARCHAR .

    Are you considered to be an additional table with the column ID, filter_id, and value, filter_value_list? This table will contain a list of VARCHAR answers that will be provided as drop down for each filter associated with the category of that ad.

    "Bluetooth" filter, possible value will be "yes" and "no". For the "camera" filter, the potential value can be "less than 1 megapixel", "1 or 2 megapixels", "3 to 5 megapixels", "5 to 10 megapixels", "more than 10 megapixels" Is planning for technology).

    BENEFITS:

    1. User selects their answer instead of select types.

    2. Unity in all advertisements.

    3. It is possible that the price list can also be used in an "Ad / Filtered filters" sidebar as you can see on many sites these days.


    asp.net mvc - How can I authenticate the user within Json controller action? -


    I have a .NET MVC controller operation that returns a JsonResult to a YUI AsyncRequest callback. All are working fine with the AsyncRequest call and the "content" model data has been updated successfully. How can I now assure that the user is logged on before AsyncRequest is done?

    Normally I will use the [authorized] attribute which gives an error to my YUI AsyncRequest back, as it is expected of a JSON result.

    I also tried to check wihtin "User.Identity.IsAuthenticated", but still do not love .. RedirectToRoute is doing nothing.

    I have been able to send a JSON as a result of the JS indicating that the user needs to login, but I want to redirect the user to the logon viewer. Here is the action of the Administrator:

      [JsonFilter (Ultimate = "Content"), JsonDataType = typeof [content] public ActionResult SaveJson {content content} {if ( ! User.Identity.IsAuthenticated) RedirectToRoute (new {action = "logon", controller = "account"}); ContentRepository.Update (content); Jason Returns (new {result = "success"}); }  

    TIA

    You can do something like: [JsonFilter (Ultimate = "Content"), JsonDataType = typeof (content)] Public ActionResult SaveJson (content content) {if (! User.Identity.IsAuthenticated) {var urlHelper = new urlHelper (ControllerContext.RequestContext); Return Jason (new {result = "unconfirmed", url = url halper. Action ("logon", "account")}); } ContentRepository.Update (content); Jason Returns (new {result = "success"}); }

    You will use the urlHelper.Action ("logon", "account") part of the result to change the location in the login page (window.location.href = ...).

    Additional note: You can move urlHelper.Action ("logon", "account") into your view, as part of your callback function.


    security - Checking if specific user has a role -


    Is there a specific role of specific users (not what is logged in)? (IfAnyGranted) (user, "ROLE_ADMIN")) // if you get user with user ID = user.at (1) // id 1) / //

      I want this line to be implemented in any way ...}  

    Thanks in advance.

    I believe your user domain class values ​​your role class this way:

    / P>

      class user {static HasMany = [officers: role] // ....} role of class {static relative = user string description string authority // ....}  

    Then your code is simple to check the role:

      user = user.at (1) if (user.authorities.any {it.authority == " ROLE_ADMIN "}) {// User Is the administrator}  

    An updated answer can be found.


    r - Why isn't this foreach/dopar function using all the cores I asked for? -


    I use doMC with foreach and % dopar% . Function:

      doTheMath_MC & lt; - function (st, end, nd) {print (getDoParWorkers ()) if (st & gt; end) stop ("end st") #helper function stackoverflow.com/a/23158178/633251 tr & lt; - Function (x, prec = 0) trunc (x * 10 ^ prec) / 10 ^ Exact #ForicafFIFF & lt; - Function to use with function (I, j, num, trpi) {if (num [j]> gt; = num [i]) return (zero) val & lt; - num [i] / num [j] if (! Tr (val, nd) == trpi) return (null) returns (c (i, j, tr (wal, nd))}} # we go here ... ND & LT; - ND - 1 TRPI & lt; - TR (PI, ND) No. - St: end ni & lt; - Length (num) ans & lt; - foreach (i = 1: Ni, .combine = rbind)%:% foreach (j = 1: ny, .combine = rbind)% dopar% (If.null) (feet (i, j, num, trpi)} cat ("full computing ", Paste (" EST ", St, End, ND + 1, Sep =" _ ")," \ n "(Ans) Returns (NULL) ans - as.matrix (na.omit (ans) ) # Maybe not necessary in MC version I have set the first core and second one The function calls upwards function (answer) # c ("num", "den", "est", "eff")}  

    (This information has been posted below , I do not think this is a problem). getDoParWorkers () reports that 7 cores are assigned. cat statement confirms that the output While moving 2 'loops' are working properly, however, only 1 core is used, why does anyone see? Mac OSX 10.10.2 and R 3.2 (2015-03-15 R67992) Finally, Do everything Rit to using doParallel to get the same results.

    Steps to set up all things:

      mn & lt; - 1 mx & lt; - 10000 JMP & LT; - 1000 mc & amp; nbsp; Lt; - TRUE If (MC) {Requirement ("DOMC") register DOMC (7)} ST & lt; - CEC (MN-1, MX-JMP, JMP) + 1and Lieutenant; - CEC (MN - 1 + JMP, MX, JMP) ND & amp; Lt; - Representative (1:15, each = MX / JMP) # Recycling DF & lt; - Data for frames (st = cents, and = end, see id) = nd) (1 in i: no (df)) {aests (df $ cents [ii], df $ and [ii], DF $ nd [ii], mc = mc}}  

    Sorry to answer! I have changed the Dopaar handling, from which the external loop is made parallel:

      ans & lt; - foreach (i = 1: ni, .combine = rbind)% for dopark% (j in 1: ni) {fef (i, j, num, trpi)}  

    and , I was just not asking for enough iterations. For testing, I was using mx = 10000 and jmp = 1000 (see original question). This was probably not enough to trigger parallel processing. It was necessary to increase every 10x to go parallel processing. Thanks for the commentators!

    Note: While activating the above code parallel processing, it does not respond properly. This will be the subject of another question.


    oauth - How to retrieve any user's data from twitter -


    Does not include the specific user's data (follower ID, or user's IDs) Adhere to it) Is the user themselves possible? I hope to create a Twitter data miner, but I have read every tutorial that includes end users and PIN authentication.

    Yes. Try it.

    Get your keys and store it in a separate file then use a streaming AP & amp; Write a code to get all the data you want (follower id, name etc.). Create that file to run as a background service that runs all the time.

    Hope it helps!


    visual studio 2013 - Object expression, interface implementation, verbose syntax -


    I often use verbose syntax to create a line expression, which usually has several rows. Normally I do this so that I can send the whole expression # code> Alt + ' with the F code. For example, I can do this:

      long period list = REC assistant result = function [] -> Results | _ :: T - & gt; For the example code, assume that these namespaces have been opened:  
      open system open (helper + 1l) t helper 0L list assistant (results + 1l) t  

    System I want to translate this object expression into one line:

      empty empty number = {new INMATOR < Int & gt; Member t.Current = raise (InvalidOperationException ()) with member t.MoveNext () = wrong member t.Reset () = () member t.Current = raise (InvalidOperationException ()) Interface with the interface IEnumerator member t.Dispose With IDisposable () = ()}  

    I have found that I can do this only by using verbose syntax. Generally, Verbose-Syntax code also compiles under light syntax, but here, it is not. I also tried to create an enrolled class with the same implementation, and that almost identical code compiled under both light and verbose syntax:

      open system open system Collection Open System Selection. Genre # Light "Close" Type A () = Class Interface IEnumerator & lt; Int & gt; Member t.Current = raise (invalid operation exception) member interface IEnumerator member with t.MoveNext () = wrong member t.Reset () = () member t.Current = raise (InvalidOperationException ()) IDC with member interface Forget (=) end at end B = {new IEnumerator & lt; Int & gt; Member t.Current = raise (invalid operation exception) member interface IEnumerator member with t.MoveNext () = wrong member t.Reset () = () member t.Current = raise (InvalidOperationException ()) IDC with member interface Dispute () = (end of end) # Light on "Type" (C =) Interface IEnumerator & lt; Int & gt; Member t.Current = raise (invalid operation exception) member interface IEnumerator member with t.MoveNext () = wrong member t.Reset () = () member t.Current = raise (InvalidOperationException ()) IDC with member interface Forget (=) end (end) d = {new IEnumerator & lt; Int & gt; Member t.Current = raise (invalid operation exception) member interface IEnumerator member with t.MoveNext () = wrong member t.Reset () = () member t.Current = raise (InvalidOperationException ()) IDC with member interface Definitions of both classes succeed, but the last line fails with "~ vsB756.fsx (29,150)": Error FS0010: Unexpected keyword expression in 'member'. Incomplete structured construction on or before this point or other token. " 

    The problem appears to be in the series of member definitions. Second and third members IEnumerator part of the definition of Visual Studio FS 10010 error as the reasons for the error > Highlights the keyword. (In other words, the highlighted member are keywords that are IEnumerator.Reset () and IEnumerator.Current .)

    Visual Studio open brace (mismatch '{'}, and end keywords Reporting errors on "two" before the code (incomplete value or function definition)> IDisposable implementation, but I suspect that it caused three members in the IEnumerator implementation Failed to recognize it, due to which it tries to parse additional members as part of the definition of first member.

    Have I ignored some of the syntax? Is this a compiler in one Bug Land?


    javascript - Why $scope is null in controller method -


    I have a view below and a controller. I can only create two-way data within ng-click handler I want to inspect the $ radius for binding, but it is always undefined.

    This is my view:

      & lt; Body ng-controller = "efController" class = "container" & gt; & Lt; Form role = "form" class = "form-horizontal" & gt; & Lt; Div class = "form-group" & gt; & Lt; Label = "full name" class = "col-sm-3-control-label" & gt; Name & lt; / Label & gt; & Lt; Div class = "call-sm-9" & gt; & Lt; Input type = "text" id = "name" name = "name" class = "form-control" ng-model = "name" /> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Input type = "submit" class = "btn btn-primary" value = ng-click = "submit form ()" /> & Lt; / Form & gt; & Lt; / Body & gt;  

    And here's my controller:

      app.controller ("efcontroller", function ($ scope) {$ scope.submitForm = function () { //alert($scope.name);}}]);  

    There is nothing inside my submit forum () function, and I keep a breakpoint when I close the braces, the $ range is always undetermined in the clock, but if I only write one warning I'm using any model or property using $ Scope.prop, it's always okay.

    My question is, why is the function being properly told and the $ scope is being injected too?

    Edit: Here is the screenshot from the video where the boy is watching the clock and you can count on me that my code is 200% similar and it is like this Depending on the matter, there is a course on Pluralslaw

    Enter image details here

    Edit 2: Here is John Papa


    postgresql - Is there any way to get query progress (e.g. 75%) for ActiveRecord / Rails / Postgres? -


    Is any method to get estimation of query progress for activation / rail / postgraze (for example, 75%)? Or if I had to close ActiveRecord, is there any way to get it?

    How to do this with a straightforward postgrace

    This can be done with the hive query in an Hadoop cluster, especially when there are large numbers of mapers and reducers, because it is a partition And when its pieces are finished, it may have some idea of ​​its progress (although this progression is not always smooth, because not all the data is equally distributed evenly).

    In the postgres , since there is only one query, there is no division (there is currently no division) to finish the laminate and report progress if you actually In , then stress has postgress process to run your query, and the only way to find out about progress is reading the file. Due to the layout of the tables on the disc, it is based on the reading Some can progress progress. However, this is an indirect relationship, to ensure that a full percentage, and generally not worth the hassle, is the IMO.

    The best bet, in general, is to ensure that your statistics are updated in the tables, and then look at the query plan, and depending on the complexity / possible execution time Try to guess.


    html5 - Javascript not executing functions using = operator -


    I'm new to JavaScript, so this is a basic question I created a simple MP3 player that first loads the song , Then plays the next two songs in an array. I modified this code that I found on the stack, and it works:

      audio player.Nondend = function () (if (current sounds) Next Song.Lang-1 } {AudioPlayer.src = Next Song [++ currentSong]; Document.getElementById ('songTitle'). InnerHTML = songTitle [currentSong];}}  

    However, if I implement my own I try to do the function and attempts to call the function the way it does not work:

      on the audio player D = Next Song (); Function Next Song (if (Current Song: Next Song: Lang-1) {audioPlayer.src = Next Song [++ Current Song]; Document.getElementById ('songTitle'). InnerHTML = songTitle [currentSong];}}  

    Every time I want to use the function, I do not want to overwrite the code (Song) The next Song () function has tried to call, for example, but the function can not be found to call to help you Thanks.

    It is a common misconception that your second example is actually doing what is next gen The function is running and its return value is being specified on onended .

    Instead, you can change your code in the following:

    Function Next Song () (If Current Song (Next Song) Next Song. AudioPlayer.src = Next Song [++ Current Song]; Document.getElementById ('songTitle'). InnerHTML = songTitle [currentSong]; }} // Assign the function (next song) its not return value (next song) audio player. Fixed = next song;

    date - convert string to datetime R -


    I get the string to r. I want to convert it to DAT time

    For example, I want to convert it to 'date 2011 / 01-01 00:00' as the '20110101000' string. I would also like to '2011-01-01 01:00' minus '2011-01-01 00:00' = 1 hour. After all, I would like to put a condition where the time difference between two dates is not equal to 1 hour

      if (difference! = 1) {something}  

    Currently, I've used as.Date which works fine to change the wires, but there is no substitute for time. Structure with POSIXt also gives me a strange result

      structure ('201101010000', class = C ('POSIXt', 'POSIXct')) [1] "8342-08-21 19 : 40: 00 EDT " 

    I have 100,000 files which are to run this operation. Please tell me the most efficient solution.

    You can use the Base R package.

    Change the date to POSIXcts. See the code below

      dt1 & lt; - c ("201101010100") dt2 & lt; - c ("201101010200") Date 1 & lt; - as.POSIXct (dt1, format = "% Y% m% d% (diff) - difftime (date2, date1, units =" hours ") if variation (diff!); 2. = 1) {print (" something Do ")}  

    bash - Extracting a key from JSON file using jq -


    I have a JSON formatted file that contains the Event field

      in the file / home / Ec2-user / workspace / events_parts / * file $ cat. Jq '.' Avent 'done  

    I get a list of "event" values ​​removed from the JSON file. I want to assign this value to a bit variable so that I can use it for comparison later. . How do i do this

    You use myVar = $ (some bash commands) one To store in the variable and you call it like "$ myVar" echo ; Your string (trimming, new line, "")

    is inserting "myVar around " to pretend the shell or even You can put it in an array like this: myArray = ($ (some bash commands))


    jquery - Javascript role handling -


    Hi, I use Spring Protection to define some role from the server side and to limit access to some unsure address I

    There is no problem with the server. Javascript is a problem. I have some links on the client side, when the user does not have administrator role, I can disable it.

    What is the cheapest way to do this in javascrip / jquery? Is there a script to manage it?

    P.: I am a JavaScript novice

    Roles from the server are managed by the spring security to prevent access to them by natural users. What will I know: Is there a script that helps me manage all the links which I obscure the general user on client side or manually by going to every 50 links on my page Add a check to

    It would be better to prevent the link from appearing on the server side. Because if you disable it, any smart user can view the source and get the link and can run it. But here's how to disable a link

      $ ('.my-link'). Click (function () {return false;});  

    python - Using base class member to keep track of derived class instances -


    I want to keep track of the examples of all classes that come from the base class, and if I do the following Is common, or if it presents serious damage, is it pattern or antipaten?

      class animal (object): all_animals = [] def __init __ (self): self.all_animals.append (self) class dog (animal): def __init __ (self): # The stuff here ... super (dog, self) .__ init __ () class person (animal): def __init __ (self): # other stuff here ... super (person, self) .__ init (__)  

    Is this a recommended way of working? Is there a problem in this method when a large project or multiple files are inherited? For example, can I rely on a consistent Animal.all_animals cache?

    One point in your view is that the list will prevent collecting garbage after a list is not found. The reference left them. For example, if the examples are disturbed and in some cases the order does not matter, then we can use the examples to store and store the examples in the __init __ method Instead we can use a metaclass whenever an example is built. (If you want a list you can use the package from PyPI)

    When we instantiate a class, then its meta code's __ call __ method first It is said that we can store the example in addition to weak except it is more understandable if we only all_animals are only Animal class Allow me to access, so I used it whose __ get __ method only gives us animal by the class. WeakSet class meta (type): def __call __ (self) from weak import: example = super (meta, self) .__ call __ () Animal.all_animals.add (example) Back to

     Example class Animal_prop: def __init __ (self, cls = WeakSet): self.all_animals = cls () def __get __ (self, ins, cls): If IS is none and CL is animal: return self . All _animals Other: Enhance Enterprise Class Animal (Object): __metaclass__ = Meta all_animals = Animals_prop () def __del __ (self): The example of print "{} is dead." Format (type (self) .__ name__) class dog (animal): pass class person (animal): if __name__ == '__main__': a = animal () b = dog () c = person () print set ( Animal.all_animals) Dell C print set (Animal.all_animals) Print '-' * 10  

    Output:

      set ([. & Lt; __ Main __ Animal 0x1012f5590 & gt;; Object on; __ main__.Dog object 0x1012f55d0 & gt ;, & lt; __ 0x1012f5610 & gt; main __ person object ;.]) Example of person He is dead. Set (animal.] On the item (__ main___ 0x1012f5590 & gt;, & lt;) at the rate of 0x1012f55d0; ---------- The animal instances are dead. The example of a dog is dead  

    javascript - Bootstrap Columns not stacking right? -


    On my page I have several different blocks / portlets, and I fit them well in stack and white space. In the following example, block 4 should be under Block 1, and even in (below 2 blocks), should not it fit in white space, with no difference? This is a good example of Pinterest (or my width may vary). Or can we do this without adding plugins (I already have a sort of work)? Thanks in advance for any help.

      & lt; Div class = "container-fluid" & gt; & Lt; Div class = "col-lg-4" style = "height: 200px; range: 1px #ccc solid" & gt; & Lt; H1 & gt; Block 1 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "col-lg-4" style = "height: 100px; range: 1px # ff0 solid" & gt; & Lt; H1 & gt; Block 2 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "col-lg-4" style = "height: 150px; range: 1px # f00 solid" & gt; & Lt; H1 & gt; Block 3 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "colonel-LG-4" style = "height: 175px; border: 1px green solid" & gt; & Lt; H1 & gt; Block 4 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "kernel-LG-4" style = "height: 175px; range: 1px blue solid" & gt; & Lt; H1 & gt; Block 5 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "colonel-LG-4" style = "height: 75px; range: 1px pink solid" & gt; & Lt; H1 & gt; Block 6 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - /.container - & gt; To ensure Block 4 under 1, you must use a line:  

      & lt; Div class = "container-fluid" & gt; & Lt; Div class = 'row' & gt; & Lt; Div class = "col-lg-4" style = "height: 200px; range: 1px #ccc solid" & gt; & Lt; H1 & gt; Block 1 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "col-lg-4" style = "height: 100px; range: 1px # ff0 solid" & gt; & Lt; H1 & gt; Block 2 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "col-lg-4" style = "height: 150px; range: 1px # f00 solid" & gt; & Lt; H1 & gt; Block 3 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = 'row' & gt; & Lt; Div class = "colonel-LG-4" style = "height: 175px; border: 1px green solid" & gt; & Lt; H1 & gt; Block 4 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "kernel-LG-4" style = "height: 175px; range: 1px blue solid" & gt; & Lt; H1 & gt; Block 5 & lt; / H1> & Lt; / Div & gt; & Lt; Div class = "colonel-LG-4" style = "height: 75px; range: 1px pink solid" & gt; & Lt; H1 & gt; Block 6 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

    And note, just to ensure that LG's classes work only on high resolution, on small screens, it will be for each other (block 2 Block-1) -MD, -SM, and -X size stack on screen. [Update: 2015-03-18 per comment] If you want to do this, then they should be standing without space, only one other option is:

      & lt; Div class = "container-fluid" & gt; & Lt; Div class = "row" & gt; & Lt; Div class = 'col-lg-4' & gt; & Lt; Div style = "height: 200px; range: 1px #ccc solid" & gt; & Lt; H1 & gt; Block 1 & lt; / H1> & Lt; / Div & gt; & Lt; Div style = "height: 175px; range: 1px green solid" & gt; & Lt; H1 & gt; Block 4 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = 'col-lg-4' & gt; & Lt; Div style = "height: 100px; range: 1px # ff0 solid" & gt; & Lt; H1 & gt; Block 2 & lt; / H1> & Lt; / Div & gt; & Lt; Div style = "height: 175px; range: 1px blue solid" & gt; & Lt; H1 & gt; Block 5 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "col-lg-4" & gt; & Lt; Div style = "height: 150px; range: 1px # f00 solid" & gt; & Lt; H1 & gt; Block 3 & lt; / H1> & Lt; / Div & gt; & Lt; Div style = "height: 75px; range: 1px pink solid" & gt; & Lt; H1 & gt; Block 6 & lt; / H1> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

    It has been standing within the same column, but it limits you completely differently.

    Bootstrap is to manually configure your grid to the desired display. For each viewing size ... it's not something that dynamically divides your sections into a piece of paper like a piece Trying to solve as you do the link provided.


    c# - Byte[] Split Up Into 1022 Length Sections Then Restored Not Matching Up -


    I am trying to take a PDF document and submit it to a SAP structure through an MAPC website I am uploading. A byte array is required for SAP structure, which should be broken into 1022 length sections. The program works well till that point where I try to see the PDF document from SAP. Unfortunately, I can not see the PDF data stored in the SAP due to access rights. Therefore, I have created a sort MOCC program to match the byte array before sending the SAP (file content) and then it should look like returning from the SAP (File Content Post SAP).

    The program compares byte arrays and finds the mismatched value at array 1022.

    Is there a bug in my program that does not match byte arrays? They should match properly, right?

    Claimed ClaimsMedicineMGR = New Claim Representation (); Expectancy claims currentclaimyignment = claim credentials MGR GetCurrentClaimsIdentity (); Var subpath = "~ / App_Data /" + currentclaimsIdentity.EmailAddress; Var destination path = path. Combine (server mappath (subpath), "LG WM3455H Speak Sheet PDF"); Byte [] fileContent = System.IO.File.ReadAllBytes (destinationPath); // Excuse it is going to do SAP var arrList = SAPServiceRequestRepository.CreateByteListForStructure (fileContent); Var Talk Feature List = New List & Lieutenant; Byte [] & gt; (); Foreach (byList) in batch [] b) mockStructureList.Add (b); // Now get it back from fake SAP var filecentant POSTSAP = new byte [fileContent.Count ()]; Var rowCounter = 0; Var prevLength = 0; Foreach (various objects in mockStructureList) {if (rowCounter == 0) System.Buffer.BlockCopy (item, 0, fileContentPostSAP, 0, item.Length); Other systems. Buffer. Blockcopy (item, 0, file system resource sap, prelong, item lang); RowCounter ++; PrevLength = item.Length; } // Compare the original array with a new var = (fileContent == fileContentPostSAP); (Var i = 0; i & lt; fileContent.Length; i ++) {if (fileContent [i]! = FileContentPostSAP [i]) New exception throw ("i =" + i + "| fileContent [i ] = "+ FileContent [i] +" | fileContentPostSAP [i] = "+ File Resource Post SAP [Ii]) ;; }

    And here's the CreateByteListForStructure function:

      Public Fixed List & lt; Byte [] & gt; CreateByteListForStructure (byte [] fileContent) {var returnList = new list & lt; Byte [] & gt; (); {If (fileContent.Length - i & gt; = 1022) {var localByteArray = new byte [1022] for (Var i = 0; i & lt; fileContent.Length; i + = 1022); System.Buffer.BlockCopy (fileContent, i, localbetaare, 0, 1022); ReturnList.Add (localByteArray); } Else {var localByteArray = new byte [fileContent.Length - i]; System.Buffer.BlockCopy (fileContent, i, localByteArray, 0, fileContent.Length - i); ReturnList.Add (localByteArray); }} Return return list; }  

    The code looks like a simple bug.

    This loop, which rebuilds the array contents from blocks:

      var prevLength = 0; Foreach (various objects in mockStructureList) {if (rowCounter == 0) System.Buffer.BlockCopy (item, 0, fileContentPostSAP, 0, item.Length); Other systems. Buffer. Blockcopy (item, 0, file system resource sap, prelong, item lang); RowCounter ++; PrevLength = item.Length; }  

    According to the block description, each block is 1022 bytes, which means that after the first running, prevLength is set to 1022, but after the next Again it is set to 1022 again .

    prevLength will have the correct function:

      prevLength + = items Long; ^ | + - Added it  

    Instead of moving it correctly to the block for a second time and then leaving it after it, the output will move one block one at a time in the array.

    Actually you write block 0 in the right place, but leave all the other blocks on the top of block 1, zero 2 and then into the output array as zero.


    android - Which is best solution for p2p connections -


    I'm thinking of developing an Android application, where is it ?.

    Receive a server response to customer 'A customer' b 'request location, customer connect customer' B 'and client' B 'GPS location and client' A '.

    The application should work in the background, but it should not be difficult for mobile devices.

    If there is no request then there should be no traffic between the client and the server. If there is a request then the traffic should be there.

    Skype or whatever, every time you call or send messages from the Internet, then the customer can connect to the Internet so that both users on the Internet should work on my application. İf requested that the customer is not on the Internet, the application should send the latest known situation.

    For these agreements, which prototy should be used?

    thanks

    thanks

    I do not want to offend you, but I think you should start with the basic principles of Android Development and Distributed Systems. However, this is my answer:

    You can use HTTP, but to make sure to use better HTTPS, this data is encrypted between the server and the client if I If I was going to create an app, then I would write a small application on the Android device that transmits the device's position, along with a specific ID of device (probably IMEI) on a server, encoded in an HTTP ( C) request.

    The advantage of HTTP will be that you can use many different languages ​​on the server side, for example PHP (I like, but you can use others). On the server side you have to keep the data you receive in a database or some other storage.

    From there, it's your choice of what you are going to do and how to present the data. Probably creating a small website?

    My Relationship


    JPA Query org.hibernate.QueryException: could not resolve property -


    I have @OneToOne between two of the following tables in a two-directional relationship:

    < Pre> Import javax.preistence.Entity; Import javax.preistence.GeneratedValue; Import javax.preistence.GenerationType; Import javax.preistence.Id; Import javax.preistence.JoinColumn; Import javax.preistence.OneToOne; Import javax.preistence.Table; @ Entity @ Public Class Student Official Domainmald Implementation {@Id @GeneratedValue (strategy = GenerationType.AUTO) Private Integer idstudentaccount; @OneToOne (optional = false) @ join column (name = "idstudent") Private student student; Private string user name; Private string password; // Gestors and Setters} Entity @Table (name = "student") apply the public class student domain modell {@Id @GeneratedValue (strategy = GenerationType.AUTO) private integer idStudent; Private string firstname; Private string last name; @OneToOne (mapped = "student", cascade = cascade type .al, target entity = student account.class) private student account students; // getters and setters

    How to write a question to know if a username exists in the database? This is what I have done:

      @transactional @Override Public Boolean username (record user name, integer student id) {query check user name = getEntityManager (.createQuery (select " COUNT (*) student ACCOUNT with WHERE s.username =: usernameParam and s.idstudent <>: accIdParam "); Check username .setpaymator ("user name", user name); Check Username. Sitemapator ("ACCIADPARM", Student ID); Long calculation = (long) check username GETSINGAL RESULTS (); If (count> gt; {true} }     return false; }  

    and I get the following exception:

      java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve the property: idstudent of : Com.f.domain The student account  

    This should be s.student.idstudent & lt; & Gt ;: accIdParam

    Remember that s see a nested student with property StudentAccount Another nested idStudent property


    python - How to turn a list of integers into a string of numbers? -


    मैं चालू करना चाहूंगा

      [1,2,3,4,5 , 4,3,2,1]  

    में

      ['1', '2', '3', '4', '5  FreqDist  करने की तैयारी में, '4', '3', '2', '1']  

    सूची में प्रत्येक आइटम कास्टिंग करते समय अंतर्निहित मानचित्र कार्य का उपयोग करें:

      newList = नक्शा (str, पुराना लिस्ट)  

    html - Proper way to read checkbox data in NodeJS -


    I have a form on my webpage and it is being submitted in the nodes backend. '

    There is a problem with the check box when the server is submitted, and I have read them through req.body.foods , give me the code [ Something like 'on', 'on', 'on'] is anything like.

    But I want to get real values ​​such as ['dairy', 'fish'] etc.

    How can I do that?

      & lt; Div class = "col-sm-6" & gt; & Lt; Div class = "checkbox" & gt; & Lt; Label & gt; & Lt; Input name = "food" type = "checkbox" value = "dairy" & gt; Dairy & lt; / Label & gt; & Lt; / Div & gt; & Lt; Div class = "checkbox" & gt; & Lt; Label & gt; & Lt; Input name = "food" type = "checkbox" value = "meat" & gt; Meat & lt; / Labels & gt; & Lt; / Div & gt; & Lt; Div class = "checkbox" & gt; & Lt; Label & gt; & Lt; Input name = "food" type = "checkbox" value = "fish" & gt; Fish & lt; / Labels & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

    You can do the following in the node.js file:

      console.log (req.body.food); // This will print the array of values ​​ 

    If you have only one checkbox selected in the page (like: dairy), it will print "dairy". If more than one checkbox, you get "{Derry," 'meat'} "in the output.

    Another method:

    Include hidden input elements in your form:

      & lt; Input name = "selected value" type = "hidden" value = "" & gt;  

    Include this in the on-event event of each checkbox or in the Javascript file in the call, or on the on click event of the submit button in the form.

      onclick = 'buildlist ("YourCheckBoxName", "SelectedValues");'  

    Use the JavaScript function to loop through your checkbox and create a comma separated list of selected values:

      function buildlist (list name, label name) {Var Control = Document.getElementsByName (listName); Var label = document. GetElementsByName (labelName); Label.value = ''; (Level i = 0; i & lt; controls.length; i ++) for (label.value + = controls [i] .value.toString () + ',';}}  

    Now inside the node.js file, use the following code to access the list of values:

      req.body.SelectedValues ​​ 

    loops - AutoHotKey how to know the retrieved path is for a file or folder? -


    I want to know about making Aoacke that I use the loop, Failpatton to retrieve a set of files and folders I am sending a message to me if this is a folder and if it is a folder then leave it?

    file gaterate

    reports that a file or folder is only To read, is hidden, etc.

    However, you can use it to determine whether there is a folder or file. / P>

    Example

      MyPath: = "C: \ Windows" FileGetAttrib, MyAttributes,% MyPath% if InStr (MyAttributes, "D") MsgBox I have a folder other messages I Is a file  

    source:


    java - How to implement OnSetClickListener for button in RecyclerView? -


    I am having difficulty in clicking on my device register button inside the Android recycling and I'm not sure why I do not answer I am looking around and it seems that this should work but I really want to know whether I have put things in the wrong place, am I forgetting something and if so what?

    Holder Class

      Public class viewer expanded RecyclerView.ViewHolder {public TextView time; Public image button; Public viewer (see V) {super (V)}; Time = (text view) v.findViewById (RID.time); Button = (image button) v.findViewById (R.id.imageButton); Click Button.setOnClickListener (New View.OnClickListener) {@Override Public Zero (see V) {Log D. ("Test", "Button Click");}}); }}  

    Adapter class

      Public class ListAdapter RecyclerView.Adapter and lt; ViewHolder & gt; {// timer object passed through aelliist; Timer & gt; LData = null; // Provide a suitable constructor (depending on the type of dataset) Public ListAdapter (ArrayList & gt; timer & gt; myDataset) {lData = myDataset; } @ Override public viewer inventory holder (see group origin, int view type) {see v = layoutInflator. From (parent.getContext ()) .inflate (R.layout.list_adapter, parent, false); ViewHolder vh = new viewer (v); Return VH; } // Change the contents of a scene (applied by Layout Manager) @ Override Public Zero Adjustment Viewholder (seeholder holder, int status) {holder.time.setText (lData.get (.get) .getTime ()); } // Return the size of your dataset (brought by layout manager) @ override public int iacomaccount () {return ldita. size (); } // timer public aliist & lt; Timer & gt; GetData () {Return lData; }}  

    main activity orbit (onset method)

      @ override protected zero creation (bundle saved instanestate) {super.naught (savedinstenstate ); SetContentView (R.layout.activity_main); MRecyclerView = (Recycler Vij) Search ViewById (R.id.recycler_view); MRecyclerView.setHasFixedSize (true); MLayoutManager = New LinearLayoutManager (this); MRecyclerView.setLayoutManager (mLayoutManager); MAdapter = new list adapter (timer); MRecyclerView.setAdapter (mAdapter); }  

    View items

      & lt; Relative layout xmlns: android = "http://schemas.android.com/apk/res/android" Android: Layout_width = "fill_parent" Android: layout_height = "? Android: Attribute / ListItim Hight" Android: Padding = "6 DP" Android: Layout_margin = "6 DP" Android: Background = "Android: Syllable Eatam Background" & gt; & Lt; Android: layout_heid = "wrap_content" Android: gravity = "fill_vertical" Android: textSize = "28sp" Android: text = "00:00: 00" "Android: paddingLeft =" 10dip "Android: layout_centerVertical =" true "Android: layout_toEndOf =" @ + id / imageButton "/> Android: layout_alignParentTop = "true" Android: layout_alignParentBottom = "true" Android: src = "@drawable / android: layout_held =" rap_content "android: ic_action_pause" /> & Lt; / RelativeLayout & gt;  


    c# - Multiple commands per HTTP request in CQRS implementation -


    This question may be asking for too much integration details, but I hope it is at the point.

    My simple CQRS application, I have an HTTP PUT request, which looks like the one below, to update the details of a product:

      PUT http: / / Localhost / products / 088c1cb1-7e74-40b1-9900 -4b9722f1dd85 / descriptions HTTP / 1.1 Content-Type: Application / Jason Host: Localhost {Details: "FU Bar", Warning Details: "FU Bar", Danger Details: "FU Bar ",}  

    When I get this request, I want to generate three commands instead of immediately updating it

    • UpdateProductDescription
    • UpdateProductWarningDescription . UpdateProductDetails command?

    I think it's the "product" and its "description" status in your domain or context it depends on. If only descriptions have a commercial effect on your details, then I will have UpdateProductDescription command and will process that command

    but if updating the details update the other properties of the product To do this, the UpdateProductDetail command is fine.


    How closure work in acceleo? -


    मेरे पास एक तत्व है जिसके पास एक बच्चा तत्व का नाम है, एलेमेंट

      a.nextElement b b है I ख। क्या मैं समझ नहीं पा रहा हूं या गलत कर रहा हूं?   

    क्या आपने ऐसा कुछ करने की कोशिश की है ?: < प्री> ए - & gt; बंद (बच्चे: तत्व | सच)

    सच एक अभिव्यक्ति है आप वहां किसी भी शर्त को निर्दिष्ट कर सकते हैं जो आपको चाहिए।

    मैंने इसे देखा

    हालांकि मुझे यकीन नहीं है कि close Acceleo API में शामिल है (मैं दोहराता हूं) , निश्चित नहीं)। मैंने समापन फ़ंक्शन का उपयोग करने की कोशिश की लेकिन आईडीई ने मुझे यह सुझाव नहीं दिया।

    मेरी परियोजना में, मैंने अपने द्वारा इस सामान्य क्वेरी को बनाया:

      [क्वेरी सार्वजनिक वंशज (एलेमेंट: नोड): सेट (नोड) = अगर (एलेमेंट.ओसीएलआईटी टाइप ऑफीड (एलिमेंट)) तो सेट करें {aElement} - & gt; संघ (एएलिमेंट.ओसीएलएएसटीइप (एलीमेंट)। बच्चे - & gt; एकत्र (एन: नोड | वंशज (एन)) - & gt; asSet ()) और सेट करें {aElement} endif /]  

    मुझे आशा है कि इससे मदद मिलेगी !!!


    vb.net - How do I retrieve table data when it is a 'level down' in the class definition? -


    VS2013, VB, EF, LINQ

    Though maybe I can design a better model, it What I am is: The partial public class ApplicationDbContext public property ChannelItems DbSet (ChannelItem's) public property UserPosts DbSet (UserPost) as the end class folk class ChannelItem public property ChannelItemID integer New UserPost public property comments as public property anchor new list (UserPost) Public Property SpecialPermissionReq Boolean End Class Orbit UserPost Public Property as the UserPostID Integer ... Public Property HasBeenReadBy new list (HasBeenReadBy's) End Class Orbit Public Class HasBeenReadBy public property HasBeenReadByid integer as as as public Property name such as string and class

    I need to use 'Include' in my questions with a little The Oshis like:

      viewmodel. CHannelItem = db.ChannelItems.Include ("Anchor"). Include E ("Comment"). Where (Function (x) x.ChannelItemID = ChannelItemID). FirstOrDefault ()  

    I say conflict because I thought your project should be configured in a way that anchor and comments Automatically load, but I can not seem to figure that out. This is not my question, but there is only one way of saying that why I am so obliged in the 'Include' statement. This is the only way that I am currently able to ensure that all the data is retrieved during the query . Now, on my question.

    Within my existing project configuration, I now need to include HasBeenReadBy data in UserPost. I want to retrieve that data when I want to find ChannelItems in a question, but I can not include HasBeenReadBy as follows:. Include

      dim allAnchorsInType = db.ChannelItems.Include ("Anchor") ("Comment"). Include ("HasBeenReadBy"). Where (Function (x) x.Anchor.Type = ChannelType) .toList ()  

    Because HasBeenReadBy is not part of ChannelItems.

    How do I include "HasBeenReadBy", or is it even possible? Although perhaps obvious, HasBeenReadBy data for anchor property, as well as comments in the Comments property HasBeenReadBy data is in each comment.

    Or is my classroom design just plain naive?

    After

    In C # we use something like the following to select multilevel objects

      db.ChannelItems .clude (I => i.Anchor). (I = & gt; i.Comments.Select (c = & gt; c.HasBeenReadBy))  

    Hope you can convert it to related VB code.


    python - return label text when clicked -


    I want to print the label text (element of FunctionResults when it is clicked).

    Import Importer Open Fonk Class Simplicity (TCTerms): DF __Init __ (self, original): Tycooner. Vaccine.__int.__ (self, parent) self.parent = parents themselves () Self.Result = [] # self.minsize (8000,300) self.geometry ("800x300") def initialization (self ): Self. Grade () self.entryVariable = Tkinter.StringVar () self.entry = Tkinter. Self (., Self Text.) Self. Anti Grid (column = 0, line = 0, stick = = 'ew') self Anti Bind ("return> gt;", auto.onepressinter) EntryVariable.set (u "") self.labelVars = [] Category: Jammu (1,30): labelVar = Tkinter.StringVar () labelVar.set ('') self.labelVars.append (labelVar) label = Tkinter. Label ("Auto, Remote = Label", Anchor = "W", FG = "Black", BG = "White") Labels ("& lt; 1>", Lambda Event, Text = "Some Text" Self.click_link (event, text)) label.grid (column = 0, line = j, column = 2, sticky = 'ew') self.grid_columnconfigure (0, weight = 1) itself. Modem (right, wrong) self .update (self.geometry (self.geometry ()) self.entry.focus_set () self.entry.selection_range (0, Tkinter.END) DEF OnPressEnter (self, event): #FunctionResults Func1 is back by a Func1 self.FunctionResults = Func.Func1 (self.entryVariable.get ()) in the self.FunctionResults = list (reverse (self.Result)) category (0, lane (self.Result)): Print "results", I, ":", self. Function Result [i] Self. Labwares [i] .set (auto. Function result [i]) self.entry.focus_set () self.entry.selection_range (0, Tkinter.END) def click_link (auto, event, text): print "You '% s 'Click on'% text #l ["text"] #OsSystem ("Open" + Textual + ".txt") if __name__ == "__main__": app = SimpleAp_Tyak (none) Appeal ('Mary App' ) Apes. Mileop ()

    Instead, I get the , you clicked some text .

    How do I type the function click_link (self, event, text): to get the name associated with that click's label?

    I have seen some answers using the command , but I do not want to use a single button.

    < Div class = "post-text" itemprop = "text">

    You can get text from a widget that was clicked like this:

      def click_link (auto, event , Text): "You clicked '% s'"% event.widget ["text"]  

    edit full code for me Ubuntu 14.04 and working on OS X 10.10

      Import Tunkeror Import OS class SimpleConnection (TKNeter): def __init __ (self, parent): Tkinter.Tk .__ init __ (self, parent) self.parent = parents self-interlise () self Result = [] # Self. Missise (8000,300) self Starting gemetry ("800x300") def (self): self. Grade () self.entryVariable = Tkinter.StringVar () self.entry = Tkinter.Entry (self, textvariable = self.entryVariable) self.entry.grid (column = 0, line = 0, sticky = 'EW') self. Entry.bind ("Return & gt;", self.OnPressEnter) self.entryVariable.set (u "") self.labelVars = [] J (1,30) in range: LabelVar = Tkinter.StringVar () LabelVar.set ('') labeled self.labelVars.append (labelVar) label = Tkinter.Label (self, textvariable = labelVar, anchor = "w", fg = "black", bg = "white") label. Label: Grid (column = 0, line = j, column = 2, sticky = 'ew'), lambda event, text = "some text": \ self.click_link (event, text) ) Self.grid_columnconfigure (0, weight = 1) Self. Paragmeter (right, wrong) auto.update () self Geometry (self geometry) self.entry.focus_set () self.entry.selection_range (0, Tkinter.END) def OnPressEnter (auto, incident): #Result A list self.Result = self.entryVariable.get () In the self.Result = list (reverse (self.Result)) category I (0, lane (self result)): print "results", me, ":", self Results [i] self.labelwars [i] .set (self. Results [i]) self.entry.focus_set () sf.net Section_reeng (0, tikenator.END) def click_link (self, event, text): print "You clicked '% s'"% event.widget ["text"] if __name__ == "__main__": app = Simpleapp_tk (None) app.title ('my application') app.mainloop ()  

    html - Why do I need to set a display type for displaying my image on a mobile viewport? -


    I have an image inside a div when I use the code given below to display the image on my desktop I see, it looks fine. But when I used the same code to display it on a mobile device, the image is not displayed, unless I added the display: block; I did not tell all the video and articles I had read to display images for both image and container developer, that I have to use the display: block; So I do not understand why I need to use it to display on mobile Why is it that I do not have to use a display: block for any desktop, but I do for mobile phones Am I

    CSS for desktop view:

      .index-image {width: 100%; }. Index-image & gt; IMG {width: 100%; }  

    HTML for desktop view:

      & lt; Div class = "index-image" & gt; & Lt; Img src = "images / coding.jpg" /> & Lt; / Div & gt;  

    CSS for mobile view:

      .index-image-mobile {display: block; Width: 100%; } .index-image-mobile & gt; IMG {display: block; Width: 100%; }. Index-image {display: none; }  

    HTML for mobile view:

      & lt; Div class = "index-image-mobile" & gt; & Lt; Img src = "picture / coding-mobile.jpg" /> & Lt; / Div & gt;  

    thanks


    ios - CodeSign Pods trouble -


    मेरे पास 3 लक्ष्य वाले एक प्रोजेक्ट है:

    1- डेमोएप - आईओएस ऐप

    < P> 2 - डेमोएक्स्ट - आईओएस एक्सटेंशन

    3- डेमोफ्रेमवर्क - आईओएस 8 फ्रेमवर्क

    मुझे यकीन नहीं है कि मेरा पॉडफ़ाइल सेटअप सही है, क्योंकि मुझे केवल संग्रह करने में समस्या है प्रत्येक लक्ष्य का निर्माण ठीक होता है।

      स्रोत 'https://github.com/CocoaPods/Specs.git' मंच: आईओएस, '8.0' xcodeproj 'MyProject' लक्ष्य: DemoApp का उपयोग करें_फ्रेमवर्क्स ! पॉड 'फेसबुक-आईओएस-एसडीके' पॉड 'रिएक्टिव कोकाआ' एंड लक्ष्य: डेमोएक्स्ट, एक्सक्लूसिव = & gt; True_frameworks का उपयोग करें! पॉड 'रिएक्टिव कोकाआ' एंड लक्ष्य: डेमोफ्रेमवर्क उपयोग_फ्रेमवर्क्स करते हैं! पॉड 'रिएक्टिव कोकाआ' एंड  

    फेसबुक पर डेमोआप पर ही स्थापित होना है।

    डेमप्राफवेयर और डेमोएक्स लक्ष्य पर डेमोफ्रेमवर्क का उपयोग किया जाता है

    संकलन और amp; चल रहा है सब कुछ ठीक लग रहा है केवल जब मैं मैं सभी ReactiveCocoa चौखटे पर codesign मुद्दों हो रही है संग्रहीत करने का प्रयास करें ...

    codesign /IntermediateBuildFilesPath/UninstalledProducts/ReactiveCocoa.framework सीडी / फलियाँ निर्यात CODESIGN_ALLOCATE = / अनुप्रयोग / Xcode। एप्लिकेशन / सामग्री / डेवलपर / toolchains / XcodeDefault.xctoolchain / usr / bin / codesign_allocate निर्यात पथ = "/ अनुप्रयोग / Xcode.app / सामग्री / डेवलपर / प्लेटफार्म / iPhoneOS.platform / डेवलपर / usr / bin: /Applications/Xcode.app / सामग्री / डेवलपर / usr / bin: / usr / bin: / bin: / usr / sbin: / sbin "हस्ताक्षर पहचान:" iPhone वितरण ... "

      / usr / bin / Codeign --force --sign & lt; हैश ... & gt; & Lt; DerivedData के लिए पथ & gt; / डेरिवेटडेटा / पॉप-एडीफ़्फ़्फ़्फ़्फ़्फ़्फ़्फ़्फ़्ग्नैंपाब्राय्घिएक्सगेक /बिइल्ड / इन्टरमेडियट्स / अरकिवइंटरमीडिया / पोप / इन्टरिडायटबिल्डफाइलपैथ / अनइंस्टालप्रोडक्ट / रीएक्टिव कोकाआ.फ्रेमवर्क  

    / लाइब्रेरी / डेवलपर / एक्सकोड / डारिवेटेडडेटा / पॉप- adpfaxhfjfgnnpbrabyuhgiyxgek / बिल्ड / मध्यवर्ती / ArchiveIntermediates / पॉप / IntermediateBuildFilesPath / UninstalledProducts / ReactiveCocoa.framework: हस्ताक्षर कमांड / usr / bin / codesign के लिए अमान्य या असमर्थित प्रारूप से बाहर निकलें कोड 1

    के साथ विफल हालांकि मैं सत्यापित ReactiveCocoa.framework निर्दिष्ट निर्देशिका पर है कोडसिन अभी भी काम नहीं कर रहा है।

    किसी भी मदद की सराहना की जाएगी।