Sunday 15 February 2015

asp.net - Store/assign roles of authenticated users -


I am upgrading a site to use MVC and I am looking for the best way to set up authentication. .

At this point, I have to log in to Active Directory logging: Validating the username and password, and then setting up Auth cookie.

How do I store the user's role at the time of log -No, to see my controllers for those roles, as the user navigates through the site?

  [Author (roles = "admin")]  

I have no problem getting a list of roles from Active Directory I do not know That's where they keep them so that the controller can see them.

When you authenticate your user, you generate a new GenericPrincipal example. The constructor takes an array of strings that have roles for the user. Now set HttpContext.Current.User equal to the Genetic Principle and write auth cookie, and should do so.


How do I manage my ideas/personal projects to completion? -


I suspect that many developers are in the same boat. There are so many gestures in the world to scratch, Simple, they can be "one weekend" And yet they are never, we have handcuffs like jobs, families, and other hobbies ... it can be hopeless!

I have a long list of projects that I would like to annotate and classify in a wiki, but I have not spent much time with them. In the initial steps of the scheme, the colleges and colleges that meet me are very excited. But when the time comes to work on real time, the excuses start flowing and the wave of enthusiasm begins.

What do you do to make your thoughts interesting? If there are many, there are different projects to choose from, how do you choose?

(I know there is a question with a similar title already, but it was more about code management.)

The most important thing is to get started.

It seems that you have some options, do such a thing to do such a thing that you know that you will not try to make a decision again immediately after starting

< Ul>
  • Do the simplest work to get the 0.1 version (looks like it's attractive, leave the integration for Twitter later).
  • Always leave at a point where the next thing is clear;
  • Do not try to know too many new technologies in a project, they will slow you down.
  • "Explore social make-up to talk about friends / press" pressurize "to complete / release the application etc. Better yet, choose an app that will be useful for anyone at work ( HR?) There is nothing around the user waiting to inspire you.

  • sqlite3 - SQLITE group by -


    I use the group in SQLite from time interval in SQLite. The first day is the group and the second group has an hour:

      select striptime ('% Y-% m-% dT% 00: 00: 00.000', date_time), line, calculation (( Count by 'Sprime' ('% Y-% m-% dT% H: 00: 00.000', date_time) from the line, entry group '% Y-% m-% dT% H: 00: 00.000', date_time) () ())  

    How do I group with a 10 minute interval

      select ... strftime ('% y% m% d% H0', date_time) from entry group + stroke ('% M', date_time) / 10;  

    c# - Dynamic method dispatch based on value of variable -


    Long switch statements are often frowned upon using solution polymorphism However, what I'm switching over is one Not a type of code? What I would like to do is replace the switch statement with something like this ... Public Zero Handelring (String S = "Hello") {...} Public Zero Handstring (String S = "Bye") {...} ... Handlists ("Hello"); // The first method is being called

    This will replace the following ...

      string s = "hello"; Switch (s) {case "hello": ... break; The case "goodbye": ... break; Default; break; }  

    Any ideas? In theory I think that you can completely remove the 'if / switch' statements and call only the methods which are automatically bound based on the value of the expression.

    There are languages ​​that implement such words. Right from now I am familiar with the compiler generator tool called elegant.

    In this type of language, a simple factual algorithm may look like:

      Facts (value: IT): int condition values ​​<0 {{" Value {return value} = 0}: return {0 return} fact (value = 1): difference {return1} facts (value: int): int {return value * fact ( Science - 1);}  

    sql - MySQL: Alternatives to ORDER BY RAND() -


    मैंने MySQL के ORDER BY RAND () फ़ंक्शन पर कुछ विकल्प पढ़ा है, लेकिन अधिकांश विकल्प का केवल एक यादृच्छिक परिणाम की आवश्यकता है, जहां पर लागू होते हैं।

    क्या किसी को कोई भी विचार है कि एक क्वेरी को अनुकूलित करने का तरीका क्या है जो कई यादृच्छिक परिणाम देता है, जैसे कि:

      का चयन करें यू.आई.डी., पी.फ़ोटो यूजर यू से, प्रोफाइल पी WHERE p.memberid = u.id और p.photo! = '' AND (u.ownership = 1 या u.stamp = 1) आदेश द्वारा रैंड () सीमा 18  

    यह एक विकल्प है, लेकिन यह अभी भी RAND () का उपयोग करने पर आधारित है:

      SELECT u.id , पी। फोटो, राउण्ड (रैंड (* * x.m_id) 'प्रयोक्ता यू, प्रोफाइल पी, (चयन MAX (टी.आईडी)' एम_आईड 'से उपयोगकर्ता टी) एक्स जहां पी। मेम्बरिड = यूआईड और P.photo! = '' AND (u.ownership = 1 या u.stamp = 1) ORDER द्वारा rand_ind LIMIT 18  

    यह थोड़ा अधिक जटिल है, लेकिन random_ind का बेहतर वितरण प्रदान करता है मान:

      SELECT u.id, p.photo, FLOOR (1 + RAND () * x.m_id) 'rand_ind' उपयोगकर्ता से, प्रोफाइल पी, (चयन करें MAX (टी.आईडी) - 1 'एम_आईडी' से उपयोगकर्ता टी) x जहां पी। मेम्बरिड = यू.आईडी और पी.फोटो! = '' और (यू.नरशिप = 1 या यू.स्टैम्प = 1 ) आदेश रैंड_आईडी LIMIT 18  
    द्वारा

    which is a better language (C++ or Python) for complex problem solving exercises (ex. Graphs)? -


    I'm trying to work on some problems and algorithms. I know C ++ but a friend told me that it would be better if done with Python. As it will be for fast and to develop and spend less time programming details

    edit 2 : I plan to use Python-graph lib from Google-code, please provide example code if you have used it.

    Edit 1 : Faster - less time & amp; Amp;

    I thank you for your help! It seems that you are searching for Python, because you can:

    • Focus on algorithms and do not worry about other details like memory management.
    • Do more with a lower code
    • Syntax is working with almost the phonetic code.
    • List, Tuple, has been made great in language support for the list, etc ..

    But more specifically ...

    < Ul>
  • If you mean speed of development , then Python was selected from better .
  • If you call speed of execution from better , then C ++ .

  • java - Appengine performance problem. Same site 10x faster accessing from appspot than from my domain -


    This is really awkward for me and it's happening in a real problem.

    I am creating a site using the appenjun (java) scala and it is actually working really slow when it comes from my domain:

      / Latest 200 1505ms 2325cpu_ms 1586api_cpu_ms 4kb  
    'has purchased the domain through Google apps, so it is automatically configured. I can not understand how this could be ... Can this be something in my code? Or is there anything about this configuration?

    The problem is completely reproducible, and if you need to see the speed difference, then it is worth noting just by reaching the site. These links are:

    Thanks a lot.

    It is most likely that you sent your first request to a new runtime, which started It took some time, however, the request for the Apespot domain was already done by the hot-up runtime (probably same). Try to send several requests and take minimum in each domain - there should be no statistical significant differences.


    variables - C# initializing an integer data type -


    How to start a variable of data type integer, in C # The problem is that the variable has to store an integer with values ​​from 1 to 4.

    You can use an enum, which by default is typed as Int32 (int) The public enum MyEnum {first value, second value, third value, fourth value}

    Obviously you can call enum anytime you want , And give meaning to the four values ​​namely name. After that you can just start an example: -

      var myValue = MyEnum.FirstValue;  

    WPF Data Binding and Data from SQL DataTable - need some ideas -


    I have a lot of WPF windows on them, I write some code on them, which adds UI control and data, something like that :

      public class addressWindow {public string addressID {get; Set; } Public string Addr1 {get; Set; } Public String Addr2 {get; Set; } Public string zip {get; Set; } Public String City {Received; Set; } Public String Mobile {Received; Set; } Public string fax {get; Set; } Public string country {get; Set; } Public String Email {get; Set; } Public string phone {get; Set; } Public Bull ISS System {Received; Set; } Enable Public Buttons {get; Set; }} Private Zero BindInCode () {var Address = New Address Window {// AddressID = "110", // Addr1 = "Kaunas", // Addr2 = "Jonavos", // ZIP = "8987", // City = "Mestas", // mobile = "869985868", / / ​​FAX = "87998", // country = "Lithuania", // email = "emailas@ree.lt", // phone = "37598288" , // IsSystem = true, // enabled = false}; Binding binding = new binding (); Binding Source = address; Binding.updatestrategor = updateSource Trigger Property changed; Binding.path = new propertypath ("address id"); This.db_AddressID.SetBinding (TextEdit.TextProperty, binding); Binding = new binding (); Binding Source = address; Binding.updatestrategor = updateSource Trigger Property changed; Binding.path = new propertypath ("AdR1"); This.db_Addr1.SetBinding (TextEdit.TextProperty, binding); ...............}  

    Now I want to create some universal simple engine for filling data values ​​(value to my square properties from datatale Please, specify) ). Does anyone know how to do this ..? For example, there is a way of specifying value by the names of properties, say that the name of my property is equivalent to the name of the column from the Datasro. Is it possible to do something like this in WPF, or do not I have to manually do every window Assign value to?

    Personally, I have used the code generation to work, but you can use it for Jimmy Bougard, what about you Talking it's on and off.


    (rails) weird problem with url validation -


    I am trying to see if a url exists or not. Here's my code to do this: url and url.match (URI :: regexp (% w (http https)) Check if # header result:

      Validate: Registered_domain_name_ exists private def register_domain_name_exists Case Net :: HTTP.get_response (URI.parse (url)) When Net :: HTTPSuccess, then the correct else errors.add (URL: "url is not present") and false termination # DNS failures errors .add (: url, "url is not present") and wrong end end  

    However, this code is failing, it says that there is no legitimate website. In addition to this, knowing that I also try this URL, and also failed. Then, I know that this can not be possible. What is wrong with my code ??

    < / Div>

    Each example URL given by you is a redirect (is the HTH status code) 301 or 302). Your code is only considering success for HAB status code 2xx only. Add another case:

      when: NetResources: HTTPRedirection true  

    Update: Note that the use of HTTP HEAD instead of GET will transmit low data across the network .

      Yuri = URI response (URL) = Net :: HTTP.start (uri.host, uri.port) {| Http | Http.head ('/')}  

    How to put pointer in the desired place in a stream using PHP? -


    Currently, I am creating a data parser using PHP through Telnet connection. I have had a problem: I should put the pointer in a stream (not to the end of the data) in some places, but it is impossible to use the function () function using the stream. Please tell me that I have this problem How can I solve this?

    This function moves your stream cursor to the desired location:

      function Strikers (and $ FP, $ offset) {for ($ i = 0; $ i & lt; $ offset; $ i ++) fgetc ($ fp); } // Use this as: $ curPos = 459; $ Desired POS = 1345; MoveStreamCursorTo ($ yourstream, $ desired POS - $ curPos);  

    Please check it and report your results.


    user interface - java filechooser -


    I am working on a project, in Java, where to select a file to upload the user through jfilechooser Will be. Is there any way to make the text file read-only so that you can not select by simply clicking on the file, and typing in the text field. I hope I have clarified my problem, D

    If your intention is to ensure that That the user has selected a file instead of the directory (your answer to other answers), you can use the FileChooser.setFileSelectionMode (JFileChooser.FILES_ONLY); However, this is the basic setting when you instantiate the file selector, so unless your code changes at some point, you should not have to set it explicitly.

    Enjoy your viewing:


    locking - how to prevent opening serial port on linux by foreign application? -


    Using locking is not acceptable in case of "bug" in port driver.

    So you have to lock other processes by opening a device file, but file locking is unacceptable. .

    Well, you can change the device file to some non-standard, so trying to open / dev / ttyS0 will not move your toes on your toes.


    Create XML file dynamically in Iphone -


    I want to dynamically create an XML file for my iphone application.

    Thanks

    Glory

    / Div >

    Try open source:

    • Written in Objective-C, a single H
    • Example:

        // Serializer XMLWriter allocate  
    • XmlWriter = [[XMLWriter alloc] init]; // write XML elements [xmlWriter write start element: @ "root"]; [XML Writer writes: Cracker: @ "Text Content for Original Elements"]; [XmlWriter Write EndElement]; // get the resulting XML string NSString * xml = [xmlWriter toString];
    • This generates the following XML string:

        & root; Root & gt; Text content for the root element & lt; / Root & gt;  

    Mysql php update function problem -


    How do I create a php code to fallout for mysql?

    If Active = 1 to Current amount + 2000

      Apply ID, EID, Zodiac, 1, Apply 2, Apply 3, Activate 1 1788 500 Nell Nell Faucet 1 2 1 3 1 9 62 1000 Faucet Nail Faucet 1 3 2035 1500 Faucet Faucet 1 And the output that does not have anything to replace.  
      id, eid, zodiac, apply 1, apply 2, apply 3, active 1 1788 2500 nail faucet 1 2 1 3 1 3 3 3 3 3 1 3 3 4 9 35 3 3 Nail faucet 1 3 2035 3500 Taps Nail faucet 1  

    Thanks for helping people

    The SQL query is as follows:

      update tablename SET zodiac = amount + 2000 WHER e active = 1;  

    How do you implement it in PHP, depending on which database driver you are using.

    For example, using mysqli :

      & lt ;? Php $ link = mysqli_init (); Mysql_real_connect ($ link, $ host, $ username, $ password, $ db_name); Mysqli_query ($ link, "update tablename SET zodiac = amount + 2000 WHERE active = 1");  

    java - How does reflection affect Perm size? -


    I understand that the magnitude size is used to store meta data, including byte code, static content, etc. Are there.

    My question affects the finite size of the reflection, if ever this happens, I mean that if the Program-A uses the normal way of running objects and Program-B uses all the reflections, How will both programs compare the perm-size ?

    When you execute the code, the permity will increase which will load new sections < / Strong> or internal strings reflection sections should be loaded to make sure I am not convinced that the reflection API partially uses strings, but it is not difficult to find needed.

    For example, the method getDeclaredMethod (string name, class

      random random = new random ()    

    ; while {true} {try {X.class.getDeclaredMethod (toBinaryString (random.nextLong ());} hold (exception e) {}}

    It will not make any difference in the real world application.


    vb.net Send Smtp Mail From IIS FormatException -


    Well I've found a page that sends emails and everything runs fine in the developer web server but when I When publishing IIS server, when I try to send mail, get a format exception .... ex.message = "The specified string is not required as the e-mail address."

    Email someone in this sample @ Gmail.com

    I am using "SMTPClient" and "mail message" classes to send mail.

    and server runs Windows Server 2003

    EDIT: I am using IS in the IS as the IS IS Dev on Dev Webers using the same SMTP settings

    Check that you have enabled local email relaying for SMTP service on your Windows Server 2003 box. By 'local' I mean that applications on your local machine can use the SMTP service to relay emails - but you almost certainly do not want to allow external connections to do so.


    php - secure email form, header injection query -


    I am using the following to clean the input from my contact form:

     < Code> & lt; Php $ name = tab_tags (strips slash ($ _ POST ['name'])); // It is repeated for many other areas, then: if (Injected ($ name)) is {dead}; } / * See * / // Mail below the INTEXED function? & Gt;  

    I am using this function:

      & lt ;? Php / * function from http://phpsense.com/php/php-mail to Html (/ str +), '(\ t +)', '(% 0A +)', '(% 0D +)' 'Html' / function isjected ($ str) {$ injection = array ('(\ n +)', '(\ r +)', '' (% 08 +) ',' (% 09 +) '); $ Inject = addition ('|', $ injection); $ Inject = "/ $ injection"; If (preg_match ($ inject, $ str)) {return true; } Other {return false; }}? & Gt;  

    Is it enough to clean up my contact form?

    Thank you.

    It seems that civilization and average is better than inputvalidation. Personally I also like to handle the input type. In my base controller I have a valid date of input, email address etc. If you add such validation for your current verification, then you are managing IMO well.


    .net - C# User Controls: access controls properties -


    I have created a control and added a textbox in that control, I can control that control on the .aspx page

    < Pre> and lt;% @ register Src = "../ user control / account circuit." TagName = "SearchControl" tagfix = "CSR"%>

    and

      & lt; Csr: SearchControl ID = "AccountSearchControlBox" runat = "server" OnSearchButtonClick = "RetreiveAccounts" />  

    On the .aspx.cs file, I want to use the value of the textbox inside the user control ... How to get it?

    Add a public property to AccountSearchControl.ascx

      Public string text box text {get {return TextBox1.Text; } Set {TextBox1.Text = value; }}  

    By default, you have protected visibility in all the controls located on the page (take a look at AccountSearchControl.ascx.designed.cs to see), so you have to expose a method to access the text box of your page.


    .net - Why use FinalReleaseComObject instead of ReleaseComObject? -


    I know that the original difference in the form of ReleaseComObject only decreases some counter and FinalReleaseComObject decreases it to zero

    So what I've usually heard, call FinalReleaseComObject because then you are certain that the COM object actually released

    But this makes me wonder, is there a point right over this counter? Do not you break that system, if you always call the last com object if you call that counter on a ReleaseComObject Not the first, so there is no reason for this?

    This may be the reason for having more than one when it should not be?

    Thanks in advance.

    PS: My COM experience only consists of using Excel Interop. Not sure that this question is local for the domain (i.e. the external office interop, finalReleaseComObject is not often used).

    Update 1

    Donation Talk When you are using ReleaseComObject as I think, this is a normal way. I think that if you do this then it should work fine. In a comment for the author, it is reported to anyone that it releases "code"> ReleaseComObject until the release actually (since 2006, so it is calling FinalReleaseComObject Is similar to). But he also says that it can be dangerous.

    If you really want RCW to make a release () call at a particular point in the code, you can call the Release Com Object () in Rob until the global value reaches zero. Are there. It should be ensured that RCW will call the release () However, if you do so, it is warned, when other managed references try to use that RCW, it will create an exception. "

    I believe this is a good idea to actually call not always the end of the com subject Because you can cause exceptions elsewhere, as I have seen it now, you should call it only if you can make sure that you can. FinalReleaseComObject is a hack of a best practice. >

    Some prelude ...

    A runtime callable cover (RCW) only IUnknown. Call AddRef, which is once on an unmanaged COM interface that wrap it up. However, an RCW is also managed by a managed number. Maintains a separate count of the number of Rbhon it here Arseedyu. It has been reduced by calling Marshall a different country managed contexts. Release Com Object When count of managed references reaches zero, then call RCW IUnknown.Release at once unmanaged COM interface.

    Marshall.FinelRelicom object takes a managed reference number for zero with a call, and immediately unmanaged IUnknown.Release method wrapped in this way (assuming that the managed reference count was not already zero ).

    Why both are martial? Release Comm Object and Marshall FuneralRelease Com Object? Calling Marshall.FinalRailCom Object Bus avoids writing a loop that calls to Marshall. Unless it does not indicate unless you want to indicate that you have finished using actually the COM object now .

    Why use Marshall either. Release Com Object or Marshall: FinalRailCom Object? There are two reasons for which I know:

    The first thing to do is to ensure that unmanaged resources (such as file handles, memory etc.) are used by wrapped COM objects as soon as possible unmanaged Results of calls as a result of the IUnknown.Release () method.

    The second is to make sure that thread has unmanaged IUnknown.Release () method under your control, and there is no final form of thread.

    In these martial methods, the end of RCW will finally call the unmanaged IUnknown.Release () method, after some time the RCW trash was collected.

    For reliable details, see Visual C ++ Team Blog Entry


    objective c - iPhone animation efficiency solutions, layering questions -


    I'm working on writing a basic app. It uses minimal touch input, and most fancy games play animation. There is not much animation, but the way it is currently done is extremely inefficient and uses a lot of memory.

    This scene is divided into two parts, below 1/5 only There is an image that never changes. This is the rest where the animation plays. It is currently loading 32 images in one array and then running through them (8 FPS). This goes 4 times through each animation Photos are not very big, but they are still big. I was also thinking that to store them as the best file format, both according to the overall size and requirement of the overhead.

    This is a simple straightforward approach, and it works, but it does not seem to be remembered, it uses too much.

    My suggestion was to split the animation into some layers, because there are some things that can be done differently:

    • Make the background a static image, therefore It does not have to be a part of the animation.
    • Excluding some "dude", such as graphs and running a progress bar and making them partially transparent layers up or down, the animation will also open the door Till the creative self Ntrta is in the future for me.
    • Exclude the above text and use the iPhone to display the text instead. Is it better to drag an image or load an image with text in the iPhone? Mainly being a web god, I find it silly to load any image.
    • What is left after these things are taken out as an animation, which will be very small

    So overall, we have 1 static background, 3 -5 are looking at small animations, and a big one. Can I use layers to separate these elements, and is it more dependent on the iPhone to attract the final image? This was the place where I thought I could make this race a little better, it seems silly to merge into a bigger picture, so that you can flip like a flip book, when you're in the app-wide Can load some small elements, and do things a little bit more efficiently

    Or, am I completely fulfilling it and there is a better way to go about it?

    EDIT: I am browsing around and it seems that using layers will be more efficient. I have another question, though. As each frame of the animation it is better for its file, and has been loaded into the array for animation, or is a huge phantom sheet image with all the frames, and using the coordinates of the iPhone from within the phantom sheet Is it better to capture each frame as a program? <2 p>

    Edit 2: We've done everything since then,

    < P> Assuming that the total animation sequence is stable, you want to compile it as the best movie, and use the Movie Player Framework to play it:

      MPMoviePlayerController  

    This will allow the iPhone to use custom hardware for display, and the use of the battery will be less. As a user interaction, you need to set Movie Controlmode property so that the user is not able to interact with the movie.

    MPMovieControlModeHidden Do not display any control This mode prevents users from controlling playback.

    Available in iPhone OS 2.0 and later.

    declared in MPMoviePlayerController.h.


    compiler errors - Autohotkey choking on curly brace in simple If's -


    I have a problem with Autohotkey, telling me that there is an absence (in front of another) where I think It is that my code is absolutely fine (and before that I changed the window from related to pidin to dirt) till then worked.

      ^! P :: IfWinExist ahk_class QWidget, qutIM {; If there is a qutim-window Buddy List ... ifWinNotActive ahk_class QWidget, qutIM {; Ans This is not active ... WinActivate} else {; Closing the closing bracket AH in front of the other ... WinMinimize}} and; do something; Accessories with friends list; [...]} Return  

    I am afraid that I am seeing some idiots, but I can not get this work.

    If I'm not mistaken, then a true brace style is only if there is a statement, with compounds like IFWinExist Is usable. From manual: "A true brace (OTB) style can optionally be used with those statements which are expressions (but not traditional if-details)." Ie You have to use WinExist () form, if not , IfWinExist.


    ajax - Why does jQuery insist my plain text is not "well-formed"? -


    I am creating an AJAX call to get some plain text:

      $ . Ajax ({Url: "programData.txt", type: "GET", datatype: "text", cache: incorrect, success: process data});  

    When I request, however, I get the following error:

    Error: Not well created source file: file: // / Projects /foo/program.data.txt?_=1259694590361 Line: 1, Column: 2

    Why jQuery is trying to process my plain text and how do I stop it ?

    Are you loading HTTP in your browser on the page or just as a regular file Opening? Does the JavaScript page running address begin with http: or file:? I suspect that this is the latter, and Ajax works differently in that situation (see the response by tvanfonsson below) If you are building a web app that will later be served on HTTP, then the local HTTP server Try running your page using


    iphone - Getting errors with linking QuartzCore -


    I'm new to the development of Objective-C and iPhone but I'm trying to do this ... Problem Quartzcor original animation content these lines I applicationDelegate :

      #import "Kwartjkor / Kwartjhkor H" ... - (void) display transition {if (! infection) {Catenation * transition = [caterers animation]; Transition.duration = 0.9; Transition.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut]; Transition.type = kCatransitionMoveIn; Transition.subtype = (InemiDialog)? KCitrationExpositionFreight: CascatationFormleoft; Transition = yes; Transition.delegate = self; [Window.layer addAnimation: for transit: zero]; If (heinmindielog) {mainController.view.hidden = yes; LevelController.view.hidden = No; IsInMainDialog = false; // Start game [Level controller game room: 1 ball: 3 score: 0]; } And {mainController.view.hidden = NO; LevelController.view.hidden = Yes; IsInMainDialog = true; Okay, but when building the following errors: 

    The "_ kCatransitionFromRight" refers: _kCatransitionFromRight $ non_lazy_ptr EBreakAppDelegate.o

    "_ kCAMediaTimingFunctionEaseInEaseOut" in, Referenced: _kCamediaTimingFunctionEaseInEaseOut $ non_lazy_ptr eBreakAppDelegate.o

    "_ kCatransitionMoveIn", referenced from: _kCatransitionMoveIn $ non_lazy_ptr eBreakAppDelegate.o

    ". Objc_class_name_CAMediaTimingFunction", referenced from: lexical-indicator @__ Referenced from: _kCatransitionFromLeft $ non_lazy_ptr eBreakAppDelegate.o

    "Objc_class_name_CATransition", from OBJC @__ cls_refs @ CAMediaTimingFunction eBreakAppDelegate.o at

    " Rbhit: literal-indicators @__ Obijesi @__ cls_refs @ Karenshnsn these Ibrak Apapdilegetko

    LD: Symbol (s) not found - Collection 2: L D by 1 exit status

    < / Blockquote>

    Therefore, I think there is a problem in linking, because there is no problem in compiling time, should I link some quartz to my project or how it can be fixed?

    you have

  • click on [find information] in the contextual menu ;
  • In order to add Kwartjhkorkfremvrk your goal:

    • [General] tab will be the two lists, for a dependency to other linked libraries;
    • Add the Quartzcor Framework to Bottom.

  • How do I edit SSIS package files? -


    I have a DTSX file in the project that I am taking. I have Visual Studio 2005 Pro, but it just opens XML file as SQL Server Management Studio 2005 does the same

    I have seen people open these files in some workflow-ask formats; Business Intelligence Development Studio comes to mind

    Is this a part of Visual Studio or SQL? Is it to be bought separately? Can I open this file in a more useful way with the tool?

    From Business Intelligence Studios:

    File-> New Project-> Integration Service Project

    Now there is an SSIS package folder in the Solution Explorer, right click and select "Add existing package", and there is a drop down that can be changed in file system, and very bottom box Allows you to browse the file. Note that this will copy the file from where it is in the directory structure of the project.


    css - Stacking CSS3 Structural pseudo-classes -


    While practicing various scenarios in which CSS3 pseudo-classes and selectors can be useful, I run into something Detect what I can not do!

    Here's the position I want to modify the first non-empty paragraph : first-of-type :: first-letter for the block of text. I'm not sure whether the pseudo classes can be stacked though. Here's what I came up with (does not work, of course)

     . Colonel-Body & gt; P: No (: empty): first-of-the-type :: first letter {...}  

    Looking at the following markup:

      Lt; Div class = "article-body" & gt; & Lt; P & gt; & Lt; / P & gt; & Lt; P & gt; "T" in this article should be affected. & Lt; / P & gt; & Lt; / Div & gt;  

    The only estimate is that I can not stack on pseudo-orbits (i.e. :: no () and: first-type types).

    Any ideas for how this can be accomplished?

    : type of first first P selects , as the name suggests, not previously non-empty p as you wish.

    It's okay, but : first-type of is going on purely tags (i.e. type), not on the preceding complex selector . So you are looking for the first P , and that first paragraph should not be blank. And that does not exist.

    Below the empty paragraphs, you can appear in the entire lesson, and you want to influence only the first, blank-less paragraphs, I do not think it's possible to do this, a selector is the best one. With which I can come:

      p: first-of-type :: first-letter, page: empty + p :: first letter {text-conversion: uppercase; / * ... * /} p: no (: empty) ~ p: first letter {text-conversion: heirs; / * Reset * /}  

    This will only apply first empty-empty paragraph to CSS (well, and on the first empty paragraph, but still nothing will do so).


    UDP Sockets in C -


    I am working on homework issues for class. I want to start a UDP server which listens for a file request opens the file and sends it back to the client requesting with the UDP.

    Here is the server code.

      // Create UDP socket if ((sockfd = socket (AF_INET), SOCK_DGRAM, 0)) == -1) {glitch ("can not create socket"); Exit (-1); } // Configure socket memstant (& server, 0, size server); Server.can_family = AF_INET; // Use the IPv4 server. Sine_addr.s_addr = htonl (INADDR_ANY); // My IP server. Sin_port = htons (atoi (argv [1])); // server port // bind socket if ((bind (scaffold, (structure sokadar *) and server, size (server))) == -1) {closed (sockfd); Lies ("can not bind"); } Printf ("Listener: Waiting with recvfrom ... \ n"); If (listen (sockfd, 5) == -1) {lie ("can not listen for connection"); Exit (-1); } While (1) {client_len = sizeof (struct sockaddr_in); Newsockfood = Acceptable (Sokfad, (Structured Socder *) and Client, and Client_LAN); If (Newsflof <0) {false ("error on acceptance"); } // How do some parse requests // I use recv or recvfrom? // Do I send new UDP socket to send back data to client? Send File (NewsForF, Filename); Close (newsockfd); } Closed (sockfd);  

    How do I lose data How do I read data from clients? And how can I return a new UDP connection to the customer?

    How UDP is different from TCP:

    • Message -Inward, stream-oriented You do not read / write / send. When you sendto / recvfrom message size limited to 64k, a message is sent to each call sendto by calling a call to recvfrom. If RickForm passes a buffer that is smaller than the size of the message, then the remaining message goes for the best.

    • No connection Therefore, no listen / accept / not connect you send a message to a particular address / port when you receive the message (on the address / port on which your socket is bound), you will see the source of the incoming message from the output of RAWFOM Get in the form of the parameter.

    • No guarantee messages can be deleted in order. If I miss the right way, then they can be reduced, though.

    One last word of caution - you want to find yourself again on the UDP. In that case, wait and go back to TCP.


    c# - Replace Switch/Case with Pattern -


    I have the code behind the code three times in this example. Every time the switch is shutting down the option that is sent to it. Each time the code inside the case is exactly the same, apart from this the parameter is left on the basis of case. Is this the best way to do a switch / case and method? Should I think of using some type of design method to avoid repetition switches / case structure?

      string option = dropdownlight. Selected value. Toasting (); Switch (option.ToUpper ()) {case "ALPHA": // repeat code method here; The only change parameter is the brake; Case "Bravo": // repetitive code method here; The only change parameter is the brake; Case "Charlie": // Dual code method here; The only change parameter is the brake; Case "DELTA": // Dual code method here; The only change parameter is the brake; Default: Break; }  

    The compilers are very good at switching / making case-making; The CLR will probably turn it into a lookup table or something will be faster, so it's recommended to roll your own version like Henk Holterman, what I would recommend. CLR can do a better job than you choose a better algorithm.

    If this is the issue of beauty or maintenance, and you have many switches / cases about the same class doing the same thing, then one way to improve it is to use all the procedures related to the same "case" Is included in the frequency of its class, such as:

      class MyOption {public static text only MyOption alpha = new MyOption (1, 10, "alpha text"); Public Static Readonly Myoption Bravo = New Prepress (2, 100, "Bravo Text"); Public Static Readonly Mioption Charlie = New Myoption (3, 1000, "Charlie Text"); // ... Other Options ... MyOption default for public static = New MyOption (0, 0, blank); Public MyOption (int id, int value, string text) {this.ID = ID; this. Value = value; this. Text = text; } Get public int id { Private set; } Public int value {get; Private set; } Public string text {get; Private set; In your class / control / page:  
      Fixed MyOption GetOption (string option name) {switch (optionName) {case "ALPHA":} Return MyOption.Alpha; Case "Bravo": Return MyOption.Bravo; Case "Charlie": Return MyOption.Charlie; // ... other options ... Default: MyOption return.Default; }} Private MyOption GetOptionFromDropDown () {string optionName = GetOptionNameFromDropDown (); Return GetOption (optionName); } Private string GetOptionNameFromDropDown () {// ... your code ...}  

    Then you can start churning events and other methods:

      Private Zero Control 1_SomeEvent (Object Sender, EventArgs e) {MyOption Options = GetOptionFromDropDown (); DoSomething (option.ID); } Private Zero Control 2_SomeEvent (Object Sender, EventArgs e) {MyOption Options = GetOptionFromDropDown (); DoSomethingElse (option.Value); }  

    Of course, this is just a useful pattern, if you have many of these switches / cases that you want to refresh in one. If you have only one switch / case, then you are just going to eliminate many more code, so leave it alone!

    Other possibilities to improve include Maintabilityability:

    • Change the string in an Enum type (Convert optionName by using Enum.Parse);
    • Moving all MyOption / GetOption stuff into your class (if you have many categories / controls / pages that need to be operated on the same set of all options);
    • If you really need to call a different method for each, add a method representative for the MyOption class;
    • Put a direct reference to MyOption example, if possible, to your DropdownList or other control store.

    It's about it It's easy to write, it's easy to understand, it's easy to keep up, if you have many switch / case creation, it will save you time, And it still allows CLR to optimize the best possible. The only cost is small amounts of memory needed to keep those redone areas.


    python - Solving a cubic equation -


    I am writing as part of a program, I need to fix a cubic equation (a numerical root Finder):

      a * x ** 3 + b * x ** 2 + c * x + d = 0.  

    I'm trying However, consider the following code (this is Python but this is very common code):

      a = 1.0 b = 0.0c = 0.2 - 1.0 d = -0.7 * 0.2 q = (3 * a * c - b ** 2) / (9 * one ** 2) r = (9 * a * b * c - 27 * a ** 2 * d - 2 * b ** 3) / (54 * A * * 3) print " Q = ", q print" r = ", r delta = q ** 3 + r ** 2 print" delta = ", delta # Here the delta is less than zero, so we use other equations from the article: rho = (-q ** 3) ** The hypothetical portion for ** 0.5 # x1 is insignificant because it is s_real = rho ** (1./3.) T_real = rho ** (1./3 print "s [real] = ", S_real print" t [real] = ", t_lr x1 = s_real + t_real - b / (3. * a) print" x1 = ", x1 print should be" zero: ", a * x1 ** 3 + b * X1 ** 2 + c * x1 + d  

    but output is:

      q = -0.266666666667r = 0.07 delta = -0.014062962963a [Real] = 0.516397779494 t [real] = 0.516397779494x1 = 1.03279555899 should be zero: 0.135412149064  

    Then the output is not zero, and therefore x1 is not really a solution in Wikipedia article Mistake?

    ps: I know that numpy.roots will solve this kind of equation, but I need to do this for millions of equations and so I need to implement it to work on multiplier Arrays of.

    Wikipedia's notation (rho ^ (1/3), theta / 3) does not mean that rho ^ (1/3) is the real part and theta / 3 is an imaginary part. Rather, it is in the polar coordinates. Thus, if you want a real part, then you rho ^ (1/3) * cos (theta / 3) .

    , I make these changes in your code and it worked for me:

      theta = arccos (r / rho) s_real = rho ** (1 ./3.) * Cos (theta / 3) t_real = rho ** (1. / 3.) * cos (-theta / 3)  

    (of course, s_real = T_real here because also cos .)


    java - Is there a way to ignore a single FindBugs warning? -


    With PMD, if you want to ignore a specific warning, you can // NOPMD Can ignore that row.

    Is there anything similar to searchbugs?

    FindBugs initial approach XML configuration files include aka It is actually less convenient than PMD solutions But FindBugs works on bytecode, not on the source code, so the comments are not clearly an option. Example:

      & lt; Mail & gt; & Lt; Class name = "com.mycompany.Foo" /> & Lt; Method name = "bar" /> & Lt; Bug Pattern = "DLS_DEAD_STORE_OF_CLASS_LITERAL" /> & Lt; / Match & gt; However, to solve this problem, FindBugs has later submitted another solution (based on) that you can use in class or method level (more convenient than XML in my opinion). Example (probably not the best but, well, this is just an example):    @ edu.umd.cs.findbugs.annotations.SuppressWarnings (value = "HE_EQUALS_USE_HASHCODE", justification = "I know what I'm doing")  

    Note that since FindBugs 3.0.0 SuppressWarnings to @SuppressFBWarnings The party has been deprecated in favor of Java with SuppressWarnings .


    javascript - Ext JS -DOM Query question -


    Fix another DOMQuery question I think the EXT API document is slightly below it.

    I have multiply fields inside my form panel, but there is a need to find the person who got the title title of 'test results'. Does anybody know if Ext does a helpful job to do something like this or me

    formPanel.findByType ("fieldet", true) Like soming will need to be done, and then for each loop for that particular title ...?

    Thank you!

    Using Ext.form. Find the method of formPanel:

      Var fieldSets = formPanel.find ('title', 'test results');  

    Keep in mind that Return Value is an array of items.

    A bit more crazy way of using the method of Ext.util.MixedCollection:

    var fieldSet = formPanel.items.find (function (item) {return items Examples of: ext.form.FieldSet and item.title == 'test result';});

    The return value here is only the first item found.


    c# - What is the recommended way to manage a strong-name key pair for an open-source project? -


    I manage an open-source project and want to sign Binaries released in this project's binary package. I am I use visual studio csproj and sln files to distribute these files as a part of the source package of the project and manage my project.

    How can I sign my production binaries and do not distribute the snk key-pair file to me? If I use Visual Studio to sign assemblies, then each project file requires a copy of the key-pair to create it now

    Edit : Another warning is that in some assembly, I have no problem sharing the key pair. Access project grant friend via InternalVisibleToAttribute , and create those friends through a project reference. As a result, such assemblies will have to use a strong name while mentioning a signature assembly. However, if the key-pair is not distributed, how can the end-user make the source and maintain the project relationship? If a floating key-pair file is used, the public key token of signed assemblies, by breaking the InternalsVisibleToAttribute references,

    You must not deliver keypair The strong name is to verify that the new version of the assembly comes from the same publisher.

    If any other developer wants to add your project to the branch, then it will generate its keypayer and it will effectively show that its version is not with you so that other parliaments that depend on you Will not load until they are compiled again. It is not always convenient but it protects you from someone who issues a malicious version of the assembly and secretly distributes it.


    Writing binary files using C++: does the default locale matter? -


    itemprop = "text">

    I have a code that uses binary files using fstream with binary flag set and read without using formatted I / O functions and I write works correctly on all the systems I have ever used (bits are actually expected in the file), but they are basically all U.S.. Are english I am thinking of the possibility of being modified by codecvv on different systems for these bytes.

    It seems like the formatted I / O using standard using spreadsheets / sgetc in the virtual world. These will lead to overflow or underflow functions in Streambuff, and it looks like these leads for things that go through some codecvt (e.g., see 27.8.1.4.3 in C ++ standard). The build of this codecvt for the basic file is specified in 27.8.1.1.5. From this, it seems that the result will depend on the basic file that returns the default_filebuf.tlock ().

    So, my question is, can I assume that using a character array made through a system on any system? Verbally using any ifstream.read on any other system, even if any locale configuration is using any person on their system? I will make the following assumptions:

    1. The program is using default locale (i.e., the program locale setting itself is not changing).
    2. The system is both CHAR_BIT 8, store files in the form of a single bit order, octets, etc. within each byte.
    3. The binary flag is set in the stream objects.
    4. We do not have to worry about any endless differences at this level. If any byte is interpreted as a multi-byte value in the array, then the final conversion will be handled as necessary.

    If the default locale pass is not guaranteed, through this content attached to some system configuration (I do not know, Arabic or something else), write binary files using C ++ What is the best way?

    This should be fine on Windows, but on other OS you can get a line end (such as security) Should also be seen. The default C / C ++ locale is "C" which is not depending on the system locale.

    It is not guaranteed as you know the C / C + compiler and their target machines are very different. If you keep all those beliefs, then you are waiting for troubles. There is a negligible overhead to change the locale, unless you try to make it hundreds of seconds per second.


    membership provider - MembershipProvider and web.config -


    Where can I get a list of all the configuration properties for the membership provider which can be added to web.config , That is,

    & Lt; Add name = "subscription provider" type = "provider. Subscriber provider, provider" description = "subscription provider" password format = "hashhead" /> & Lt; / Providers & gt; & Lt; / Subscription & gt;

    here:


    performance - Erlang : Which is more efficient in this scenario - using try catch or case statements? -


    Say I have some functions in Arlon (1) which {ok, result} The function was successfully executed and {error, "error region"} if there was an error

    Now in another function fn2 () I call fn1 () And I need to check the result of fn1 and if it is {ok, result} , then go ahead.

    I thought, I can do this or try to catch it from any case but ability is my main concern and I would like to know that the two methods given below Which of the following is more efficient:

    try-catch method

      fn2 () - & gt; Try {OK, result} = fn1 (),% Hold something with the result Catch OK: Duration - & gt; Period; Exit: reason - & gt; {Exit, reason}; Error: cause - & gt; {Error, {cause, erlang: get_stacktrace ()}} end  

    case method

      Fn2 () - & gt; Res = fn1 (), Res of the case {ok, Result} - & gt; Do something right with the result; {Error, reason} - & gt; The end of the reason  

    The case method will be more efficient, because it is only pattern match, And not include making call stacks and accessories.

    In both instances, you are going to handle "error" locally, so there is no point in trying to catch up. What you can sometimes see is something like this:

      fn2 () -> {OK, RESULT} = FN1 (),% What is the good stuff with the result  

    Here is the intention that if you throw fn2 () a badmatch, if fn1 () fix Do not let anyone handle you "above" problem. Like it can kill your process, and make your supervisor a new one.


    google app engine - Grails AppEngine file upload using GAEVFS -


    I am working on Grails web application and need to upload files. I have a form (simplified):

      & lt; G: form action = "save" method = "post" enctype = "multipart / form-data" & gt; & Lt; Input type = "file" id = "image" name = "image" /> & Lt; Input class = "save" type = "submit" value = "create" /> & Lt; / G: form & gt;  

    and controller code should not (I know that this controller, but it's just to make it work and be better designed):

     < Code> def save = {GaeVFS.setRootPath (servletContext.getRealPath ("/")); FileSystemManager fsManager = GaeVFS.getManager (); File object tmpFolder = fsManager.resolveFile ("gae: // WEB-INF / upload_files"); If (! TmpFolder.exists ()) {tmpFolder.createFolder (); } // I need the code here to save the image in GAEVFS via bigtable}  

    Then I have two problems:

    One. Because when saving to the button is pressed an exception it tries to use tries to save the Apache Commons FileUpload system file

    I disable it

    The exception is:. Java. Lang.NoclassDefFoundError: java.rmi.server.UID is a restricted class. Please refer to the Google App Engine Developer's Guide for more information. com.google.appengine.tools.development.agent.runtime.Runtime.reject (Runtime.java:51) on org.apache.commons.fileupload.disk.DiskFileItem. (DiskFileItem.java:103) at org.apache. On commons.fileupload.disk.DiskFileItemFactory.createItem org.apache.commons.fileupload.FileUploadBase.parseRequest (DiskFileItemFactory.java:196) (FileUploadBase.java:358)

    B. I need the code example to save the image through Gaevfs I've seen examples in GaeVfsServlet but I see now how much right do not know that my case is this. Any kind of help is welcome

    GaeVfsServlet URL:.

    I came across this very problem and I am using a grails plugin called ajaxuploader To get a solution to the problem - Using the Commons File Upload API at all is available for your controller in the form of an InputStream object and doesnt upload that file

    <. P>


    c# - Read contents of a file using a relative path in a Web Application -


    How can I read the contents of a text file in my web application using the relative path / URL?

    The files are located in the root of my app in a directory.

    I do not want to specify the full path of the file that I want to access because my test environment is not correct, the mirror of my production environment.

    Use Server.MapPath ("/ path / to / file") And pass the result of the file. ReadAllText () :

      string template file =. All text (Server.MapPath ("~ / templates /") + file name);  

    internationalization - django - how to make translation work? -


    I am trying to present the template in a different language using i18n. Whatever I read, by setting the language code, including translation tags in the template, and creating and compiling translation files, and my template still translates into English through {{LANGUAGE_CODE}} variable digits (And different) code I intended to render. What am I missing?

    Template:

      {% load "iGoogle"%} {% load i18n%} {% get_current_language as LANGUAGE_CODE%} {% get_available_languages ​​LANGUAGES%} {% LANGUAGE_BIDI%} {% of the block title%} {% trance "translation test"%} {% endblock%} {% block content%} as get_current_language_bidi & lt; Div id = "some-lesson" & gt; Li  This is something & lt; / li & gt; 
  • li & gt; / l & gt; & lt; / ol & gt; {% Endblocktrans%} & lt; ul & gt; & lt; / li & gt; & lt; li & gt;
  • The current language & lt; b & gt; {{LANGUAGE_CODE}} & lt; / b & gt; & lt; / li & gt; {% if LANGUAGE_BIDI%} & lt; li & gt; The current language is bidirectional & lt; / li & gt; {% Else%} & lt; li & gt; The current language & lt; b & gt; not & lt; / b & gt; bidirectional & lt; / li & gt; ; {% Endif%}
  • Available languages ​​are: & lt; li & gt; {{lang.1}} for Lang in {% LANGUAGES%} & lt; / Li> {% Endfor%} & lt; / ul & gt; & lt; / li & gt; & lt; / ul & gt; & Lt
    Debuger DEF check (request): return render_to_response ('index.html', context_instance = RequestContext (request)
  • Command line (I filled out the correct translation in .po files):

      $ django-admin.py makemessages -l he-il -e html $ django-admin.py compilemessages  

    settings.py.

    < Pre> # language code for this installation All options can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'he-il' gettext = lambda s: s LANGUAGES = (('He-il', gettext ('Hebrew')), ('en-US', gettext ('English')), # If you do this set to false, Django will make some customizations to load it as not # Internationalization Machinery USE_I18N = True TEMPLATE_CONTEXT_PROCESSORS = ("django.core.context_processors.auth", "d jango.core.context_processors.i18n",) MIDDLEWARE_CLASSES = ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware .SessionMiddleware ',' django.middleware.locale.LocaleMiddleware ',' django.contrib. Auth.middleware.Aut Text "itemprop =" text ">

    after generating the path of the file to the File as configured.py

      LOCALE_PATHS = ("/ xxx / xxx / projects / xxx / sites / AVB / local /",)  

    cookies - How do you use an Ampersand in an HTTPCookie in VB.NET? -


    itemprop = "text">

    I have saved a cookie user as follows ...

      The look of a slow searchCookie In HttpCookie = New HttpCookie ("SearchCriteria") searchCookie.Item ("SearchText") = FullSearchCriteria.SearchText searchCookie.Item ("search-") = FullSearchCriteria.SearchType  

    SearchText Store is a value They have input in the previous page. If there is an ampersand in the cookie we have seen (for example, in Newcastle & Wear), the cookie does not save the following values ​​(search-)

    What happens is the cookie is produced like this Is:

    SearchText = Tyne & amp;

    Obviously the applesand is confusing the cookie. Is there a way to stop getting there?

    You can use the method.

    Like: HttpCookie = New HttpCookie ("SearchCriteria") searchCookie.Item ("SearchText") = Server.UrlEncode as

      Import HttpContext.Current ... Dim searchCookie (FullSearchCriteria.SearchText) searchCookie.Item ("search-") = Server.UrlEncode (FullSearchCriteria.SearchType)  

    This is required as with characters such as this.


    c# - Why can't nullables be declared const? -


      [टेस्ट क्लास] पब्लिक क्लास MsProjectIntegration {const int? ProjectID = नल; // प्रकार 'int?' को const // घोषित नहीं किया जा सकता ...}  

    मेरे पास const int क्यों नहीं है? ?

    संपादित करें : कारण मैं एक कॉन्फ़ के रूप में एक रिक्त पूर्णांक चाहता था क्योंकि मैं इसे डेटाबेस से कुछ नमूना डेटा लोड करने के लिए उपयोग कर रहा हूं। अगर यह रिक्त है तो मैं सिर्फ रनटाइम पर नमूना डेटा को प्रारंभ करने जा रहा था। यह वास्तव में त्वरित परीक्षण प्रोजेक्ट है और जाहिर है मैं 0 या -1 का उपयोग कर सकता हूं, लेकिन int? सिर्फ सही डेटा संरचना की तरह मुझे क्या करना चाहता था। केवल पढ़ने के तरीके की तरह लगता है

    यह सिर्फ नल है; केवल रनटाइम में निर्मित प्रकार को const घोषित किया जा सकता है (स्मृति से, यह बॉल्स, विभिन्न प्रकार के इंट, फ्लोट / डबल्स और स्ट्रिंग्स)।

    क्यों? चूंकि संकलन समय पर विधानसभा में मूल्य सीधे एम्बेडेड हो जाता है, और यूज़र-डिफ़ाइंड प्रकारों को एम्बेड करने का कोई रास्ता नहीं है।

    हालांकि, readonly कीवर्ड को चाहिए जो आपको चाहिए। const के विपरीत, किसी भी रीडॉनली फ़ील्ड को समय संकलन के बजाय रनटाइम पर आरंभ किया जाता है, इसलिए वे अधिक या कम आपके द्वारा इच्छित किसी भी अभिव्यक्ति के साथ आरंभ किया जा सकता है।

    < P> संपादित करें: जैसा कि एरिक लिपर ने बताया, यह सीधा नहीं है उदाहरण के लिए, const दशमलव काम करता है।

    यह:

      प्राइवेट कॉन्स्ट दशमलव दएन्सर = 42;  

    ... इस पर संकलन (ठीक, परावर्तक):

      [दशमलव (0, 0, (यूआईटी) 0, (यूआईटी) 0, (यूआईटी) 42)] प्राइवेट स्टैटिक रीडोनली डेसमल द एजर्स;  

    Django admin has no style -


    I have just transferred my DJGenja site to my staging server, and the admin side of the site has a style with it Not before, when it was okay in the first local development, I have read somewhere that I need to make a symbolic link, I do this by

      sudo ln -s / var / www / sico / htdocs / Usr / lib / python2.5 / site-packages / django / contrib / admin /  

    but he has not done anything that I can try ? Depending on your web server setup, you can do one of two ways:

    Sealinking

    In the original folder of your website, you should create a symbolic link to your Django administrator media directory, with the code name ADMIN_MEDIA_PREFIX your Django app's settings By default, this is / media / , so in your web root folder, the media is called a /usr/lib/python2.5/site-packages symlink Make . / Django / Contributing / Administrator / Media . (Note the trailing media at the end of the symlink, which is missing from your own example - Django Admin Media A media subdirectory in contrib / admin `).

    Apache alias

    If your production server is Apache, and you can change the root configuration, then you can set the path to mod_alias Django Admission Media For then, assuming that your ADMIN_MEDIA_PREFIX is / media / , you can set a nickname such as:

      & lt; VirtualHost *: 80 & gt; Aliases / Media / /usr/local/lib/python2.5/site-packages/django/contrib/admin/media/ & lt; / VirtualHost & gt;  

    In this way, all requests under path / media / will be resolved in that directory.

    Similar technology is present for most other servers, such as Lighttpd or nginx; If you do not use Apache then consult your server's documentation.


    The solution to using Apache's mod_alias is probably best for deployment, but the synchronizing approach works just as well.

    Your app is most likely the reason for working on your staging server because it was running from the internal web server of the Django, which can automatically resolve the path to the Admission Media Directory.


    java - Why I cant read properties file using getResourceAsStream when it is in classpath (under WEB-INF/lib) -


    I was testing while using getResourceAsStream to read a resource file when the property file is in the field (web- Under INF \ lib folder). And it is not working for some reason. Does anyone tell me what I am doing?

    This is my environment: the operating system is Windows 7. IDE Eclipse 4.2.3 is Kepler 64-bit. The server is running on the PATum 6.0.37 8081 port.

    I have created a web application MyWebProject

    I have the app.properties file which is WEB-INF \ Lib is located in the folder. This is the content of the app.properties file:

    data source = jdbc / mydb

    I created a class AppProperties is the class that reads this file:

      Public Ultimate Class AppProperties {Private Static String DATA_SOURCE_NAME; Public static string getDataSourceName () {return DATA_SOURCE_NAME; } Fixed {Classloader Classloader = Faucet; InputStream property file = null; Attribute Properties = Null; Final string PROPERTIES_FILE_NAME = "app.properties"; Properties = New Property (); ClassLoader = Thread curentThread (). GetContextClassLoader (); System.out.println ("AppProperties: class name loader =" + classLoader.getClass (). GetName ()); PropertiesFile = classLoader.getResourceAsStream (PROPERTIES_FILE_NAME); System.out.println ("AppProperties: propertiesFile =" + GIFTERS file); }}  

    Then I created a Servlet AppPropertiesServlet to test it:

      Public category AppPropertiesServlet HttpServlet {public AppPropertiesServlet} {         Super(); } Secure zero code (HTTPArlet request requests, HTTPSvette response response) throws serviceal expedition, IOException {String dataSourceName = null; DataSourceName = AppProperties.getDataSourceName (); }}  

    I have deployed MyWebProject web app on Tomcat, under a tokkat's webapp folder, a new folder MyWebProject was created with all the necessary files, then I have to run the sublett http: // localhost: 8081 / MyWebProject / AppPropertiesServlet and that is displayed on the Tomcat console: < / P>

    AppProperties: name of classLoader = org Apache.catalina.loader.WebAppClassLoader
    AppProperties: propertiesFile = null

    Why propertiesFile is empty? In the app.properties file web-INF \ lib folder, there is a MyWebProject folder, but somehow ClassLoder is unable to find it. strange. Am I doing wrong here?

    thanks

    If you want it, WEB-INF / lib Under it is to be packed inside the jar.

    If you want it to be like a normal file, it should be within Web-NF / Class .


    Winapi: Reliably detect user activity -


    I wrote a (very small) program that lost a certain Bluetooth connection, for a few seconds for user inactivity Should wait and lock any system when there is no activity.

    I do not need to detect cross-session, but it should be global within session (i.e., not only input from current process).

    I would be happy if there could be a simple, reliable solution. In particular, I want to avoid global hooks.

    My first attempt was to use in the beginning:

      LASTINPUTINFO lii; Lii.dwSize = sizeof (LASTINPUTINFO); GetLastInputInfo (& amp; LII); G_iLastActivity = lii.dwTime;  

    Then, I set a timer and WM_TIMER

      LASTINPUTINFO lii; Lii.dwSize = sizeof (LASTINPUTINFO); GetLastInputInfo (& amp; LII); If (lii.dwTime & gt; g_iLastActivity) LockWorkStation (); Unfortunately, this does not seem reliable. Although I do not touch anything at all, the second call often provides a big value.  

    My next attempt is raw input when my main window is created, then I do:

      Rauvenpub DewS Reid [2]; Ridge [0] .usUsagePage = 0x01; Ridge [0] .usUsage = 0x02; Ridge [0] .dwFlags = RIDEV_NOLEGACY; Ridge [0]. HwndTarget = hWnd; Ridge [1] .usUsagePage = 0x01; Ridge [1] .usUsage = 0x06; Ridge [1] .dwFlags = RIDEV_NOLEGACY; Ridge [1]. HwndTarget = hWnd; If (Registered Rivineput Devices (Reid, 2, Psychofe (Ridge [0])) == FALSE- Return;  

    Again, I set a timer for my timeout and I have WM_INPUT:

      Case WM_INPUT: KillTimer (hWnd, IDTIMER); // End your app brake;  

    and in WM_TIMER:

      WM_TIMER: break (wParam! = IDTIMER); LockWorkStation (); KillTimer (hWnd, IDTIMER); // End your app brake;  

    Unfortunately it is not reliable or not. Even here, in some cases I get WM_INPUT completely, although there is no user input. In other cases, I do not get any WM_INPUT. It seems that this happens when my application does not focus (i.e., it does not work globally).

    I found some articles (for example), but ultimately they all point out GetLastInputInfo which does not seem to be reliable work for me.

    Is this view wrong? If so, why? If not, what is the easiest way to do this?


    php: Get file information with readdir -


    I am using this code's code to get the list of audio files in a directory.

      if ($ handle = opendir ($ directory_url)) {while (false! == ($ entry = readdir ($ handle))) {if ($ entry! = "." & Amp;; & amp; $ Amp; $ Entry! = "..") {$ ext = pathinfo ($ Entry, Pathinfa_exchange); $ Audio_ext = array ('mpeg', 'ogg', 'vow', 'webm', 'mp3'); If (in_array (strtolower ($ ext), $ audio_ext)) {Enamel $ {Ento; }}}}  

    I also want to read other related information such as title, album and length of audio track if possible. I searched filesystem functions:

    Additional files are stored separately in different file types. .

    For example: MP3 uses the "id3" tag to save notifications such as titles, albums, etc.

    If you want to read ID3 data, you can do something like this:

       

    $ Tag ID3 will be an array of information. The second parameter of the function uses the ID3 version file. You can use the function id3_get_version ("example.mp3") to get the version of ID3 tag for the specific file .

    Get more information in official PHP doc


    c# - How can i minimize performance hit for Coded ui when using nested if statement in test method -


    Is there a way to reduce the display code when I either have my coded UI Running the exam or debugging me Currently it takes me a long time to run my coded UI test because it takes more time to execute it. I have "time has passed and very long means that to check that a screen is present and takes more than 1min, it takes me long to debug and eliminate it.

    Some other backgrounds.If these statements are inside a test method, where I am checking different screens, it is very dynamic but takes a long time to run. I have read that I can test the order can But I do not think I can make an order to test with these dynamic screens (the reason I think the order does not test that as soon as there is a statement for the dynamic dialog and screen) and plus I think this architecture The process is too late to go on.

    I have tried the following playback settings with little or no improvement.

    Here's my current playback set Drugs

      playback. Playback settings. Prticshafrend Lilevl = wait Krenred Lilevl. Disabled; // playback Satingsksmartmacoposn = Smartmacopeshns. A; playback. Plebaksetings. Reset max = 10; Playback K.PlaybackSettings.ShouldSearchFailFast = false; Playback Playback settings. Delayetin action = 1000; Playback Playback setting. Search timeout = 2000;  

    None of these settings has been able to help turn off Smart Options.

    I could have sworn that I have read somewhere that if I replace my statement

    Try it with the help that it will help, but I will be completely Could be wrong because I am trying to grab the straw only to increase the rate of 40% or less.

    Text "itemprop =" text ">

    I guess the statements are of a kind:

      if (utstech control. Axis) {something}  

    If so - your delay is the result of Koditui who is searching for control - one time expensive operation - especially when searching for a control Are those that do not exist.

    There are several ways to handle it - if my guess is in the ball park - please confirm and I will expand the options.

    Update:

    1. The main reason for delays is maximum reset = 10 and additionally try the following settings:

      < Pre> playback Playback settings. Reset max = 3; Playback Playback settings. Delayetin action = 100; Playback Playback setting. Search timeout = 15000;
      1. While waiting for the control:

          uiTtestControl.WaitForControlExist (5000)     

        This will tell playback to search for control for a maximum of 5 seconds. Apart from this - you should reduce playback. Playback Settings Before searching for a control, search timeout that you know does not exist:

          var default timeout = playback. Playback setting. Search timeout; Playback Playback setting. Search timeout = 5000;  
      2. And after ending the search, return it to the default value:

          playback. Playback setting. Search timeout = default timeout;  

        This should do the trick


    ruby - Rails 4 drop down select list different model -


    New to rail should be easy for me: -)

    I have 2 models: user and Role:

      Class User & lt; ActiveRecord :: Base is_mind: Accepting roles_for all_images_rights: roles validates_presence_of: role_id role of end class & lt; ActiveRecord :: Base is_to: User's End  

    There is a role_ID for the user's foreign key.

    All I'm trying to do is enable the user to choose a role for this user / new look, I know that this is easy, but I do not understand ... I really like nowadays I am studying for hours, I am trying to understand it. The drop-down selection appears in the list view, but it always fails verification (as it shows, but does not always select the user with the user. Lola_ID)

    For me here What I have is partial to show the drop down:

      <% = f.collection_select: role_id, Role.all ,: id ,: name% & gt;  

    Can someone tell me in the right direction? Maybe I have to use some kind of nested forms, but I have not tried anything and I think that I currently have it. Do I have to do something in my controller?

    If the user has many roles, then your user should not have a model: field User_id , I think, and I hope, that the users are near many roles and represent them. Then you need a third model:

      class user & lt; ActiveRecord :: Base has has_many: user_roles has_many: roles, via: user_roles role of the end class & lt; ActiveRecord :: Base has_many: user_roles has_many: User, through: user_roles End class UserRole & lt; You can use it to update your relationship (see: : role_ids  / Code> in plural) 

      & lt;% = f.collection_select: role_ids, Role.all ,: id,: name, {}, {multiple: true}%>  

    And verification is now in the user model.

    Edit : If you are using Rail 4.x then you are allowed a parameter of Role_ids.

      params.require (: user) .permit (: user_field1 ,: user_field2, ..., role_ids: [])  

    ios - How to call drawRect after an orientation rotation animation is completed -


    I am trying to use drawRect to draw a rectangular in space under a collection. See the code below) to define the rectangle by using the frame of both scenes.

    This code works fine till device orientation changes. Whatever the call I have tried, draw everything before animated rotation. This means that collectionView.frame and self.frame have not yet been adjusted by autoplay and the resulting rectangle is incorrect.

      CGRect frame = self.collectionViwOutlet.frame; CGFloat x = frame.orine.x; CGFloat y = frame.corein.a + frame.edame.height + 8; CGFloat w = frame. Size.width; CGFloat h = self.frame.origin.y + self.frame.size.height - y - 8; CGRact drawrect = secretemake (X, Y, W, H);  

    Any suggestion would be appreciated.

    Override your custom UIView there layoutsview , which is for you by the system It will be necessary when necessary and when all the variables (orientation, size, etc)

    PS: Consider this:


    unity3d - How to make one way collider? -


    I want to create a one-way collider to allow the player to pass through only one side. what do i want to do: '(

    You can create an animation in Autodesk Maya or Autodasc 3D Max, after that you can import the animation into Integration 3D and use them in your special characters. Both programs only by Google.


    xcode - c++ error in included files -


    I get errors in 2C + header file. I files are chrono and _mutex_base I included them directly in my code Not done, but they have been included through iostream.

    I'm not sure how I should post them, I will include lines with errors below:

      // in  

    What should I do to fix this?

    I am using Xcode 6.1.1, I believe this is the latest version.


    Multi-line regex in Perl -


    I have written a Perl script that parses the output of a command, looks for the work name in the output and print Does the function name

    The command output looks like below

    Here the work name is 'mutipleregexpression' but a part of the word 'press' is printed in new line .

      Task Name: Multirection Press  

    This is regex which is currently in use in my code:

      ` $ Line = ~ / (. *): \ S * (. +) / ` 

    The above regex is not printed in the new line which occupies part of the work name. It only captures 'monoleraxes', it does not capture 'press' because it is pressed into the new line.

    So my question is, what is I

    work to occupy the work name

      Sub get_status {my ($ self) = @_; My $ function name; My% result; My $ line; $ Self-> {'Cmd'} = # Order goes here; # Command $ self- & gt; Execute ($ self-> {'cmd'}); $ Self- & gt; {'Stdout'} = $ self-> Get_stdout (); My $ count = 0; # To cross the output via parsing the output for the $ line (@ {$ self-> {'stdout'}} {chomp $ line; if ($ line = ~ m / ^ function \ sName \: \ S + (\ w +) / msx) {$ taskname = $ 1; $ count = 0;} Elsf ($ line = ~ /(.*):\s*(.+)/) {my $ key = $ 1; My $ value = $ 2; $ result {$ functionname} {++ $ count} = $ value;}} return \% result;}  

    Function call:

      My $ result = $ data- & gt; get_status ('Multilanguage expression', '1'); info ('job status:'. $ Result);  

    Output:

      Unconditioned Use of Great Value is concatenation (.) Or string 114 in line 20150317T194029 Information status is the job:  

    I do not even know the language, but you can try this logic :

      var current_line = External string line in empty string lines ( If in the line "do something" with the ":" {then 1. last line (current_line) or 2. Line is the beginning of a new line (what comes next after "current_line =").} And {then 1. is the continuation of the last line LINE (current_line = current_line + line).}}  

    Hope this helps.


    How to organize different java source folders in netbeans (for testing)? -


    I am developing a project in Netbeans (8.0.2) of JUnit (4.x) for the test code Uses a Netbeen module) I have some integration tests in the same module too. I found a way to separate application code, unit test and integration test by putting them in a separate folder under MODULE_PATH \ test \ qa- functional \ src . By this, the Netbeans IDE places those three semantic individual segments in separate folders:

    The problem is that my functional tests are complicated, so I like them, okay, unit tests, however, to see projects with narrowbased compressed source, unit and functional test packages

    , A unit test for the functional test package class Knits make the test package), so it does not test compilation. Some class issues seem to have issues.

    Netbeam Project View Package with Extended Source, Unit and Functional Testing. In IntegrationTestTest.java I have an error

    I know that I can also put a unit test unit in the functional testing package (and I will do this if this question does not provide me some solution), but anyway, Is there any way to solve this in Netbeans?

    I have found a common solution, by changing the order of the common things, in mangal.xm (in row 610 of NB 8.0.2) But do not panic it is portable, changes with a new version of Netbeans, then there is not really a solution in the details.

    In Eclipse, I will simply add a new source folder on the Java build path. But does not this system exist in Netbeans? For clearing, I added a screenshot.

    Eclipse package explorer functional testing code with separate unit test folders for SQL

    Thank you in advance for your help.

    You are trying to do a wrong thing :

    • Unit tests should check the smallest possible functionality, e.g.
    • This is a method that produces expected results

    • Functional testing in the Netbeans represents the integration test, when you apply as a black box

    Understand the "Unit Testing" functionality in "Functional Tests". Netbeans consider the test folders to be independent so that they are not in each other's class, which is why it does not work in Netbeans.


    angularjs - Callback from angular.js service is a promise, but I need the data. -


    मेरे पास ऐसी सेवा है जो इस तरह दिखती है:

      angular.module ('myApp' )। सेवा ('नोडसेवा', ['$ संसाधन', फ़ंक्शन ($ संसाधन) {'सख्त प्रयोग'; ... जेएमएसएसटैट्स: {url: "/ some / restUrl", विधि: 'GET', isArray: true, }, ....  

    और मेरे नियंत्रक

      नोडसेवा। जेएमएसएसटैट्स ({id: nodeId}, फ़ंक्शन (डेटा) {console.log ( डेटा);});  

    डेटा लगता है कि यह वास्तविक डेटा के बजाय एक वादा है। यह ठीक है और समझ में आता है, लेकिन मुझे उस डेटा को नियंत्रक में उपयोग करना होगा।

    मैं इसे किसी तरह के कॉलबैक के लिए कैसे सेट कर सकता हूं जब डेटा का हल होता है?

    मैंने ऐसा कुछ करने की कोशिश की:

      डेटा $ वादा। अंत में (फ़ंक्शन () {console.log (डेटा);});  

    लेकिन अब भी वादा पर डेटा सेट है।

    मुझे लगता है कि आप क्या चाहते हैं

      डेटा $ वादा। तब (फ़ंक्शन (डी) {console.log (d); });  

    multithreading - How to wait button clicks for a while in android -


    I am developing an application for the blind

    I have 4 screen-size buttons ( Overlapped). One button at each stage of the program will be clickable and each button will have more than one function.

    My program starts with a voice (Android TTS engine). Like "Please touch screen to X" after this step I want to wait 3 seconds for button click, if do not click to vocal "Please touch on the screen" and for the job y Wait for 3 seconds. (X and Y are the first button jobs).

    The button should do one of them according to the touch screen. But how can I wait 3 seconds to click on the button and continue to talk about the next options and wait 3 seconds again.

    If the first button is clicked, it will disappear-button 2 will be clickable - and TTS engine will start vocalizing the other button options. The application will work like this, but I'm stuck in the wait button click part.

    I would advise you to use android.os.Handler instead, in your case you do something like this Can:

      create on public zeros () {this.handler = new handler) playTheVoiceOfThingX () viewToTap.setOnClickListener (New OnClickListener) {@Override Public Zero Onclick (see V) { DoThingX ();}}); Handler.post Delayed (New Preparation Tight YTask (), 3000); } Class PrepareThingYTask () executes Runnable {viewToTap.setOnClickListener (New OnClickListener () {@Override Public Zero Click on () {doThingY ();}}); Handler.post Delayed (new PrepareThingZTask (), 3000); } Class PrepareThingZTask () executes Runnable {....}  

    A good reminder, runner executed by handler can be executed in UIThread, no heavy work on it , Or different loops to run it

    Regards


    android - How to prevent RecyclerView from moving items? -


    I am trying to implement a layout which is basically a grid of objects of the same size.

    Items are ordered, there are dates in a calendar on this, so why can you do so that I can not be sorted randomly every time I scroll .

    My question is: is there a way to stop this behavior or should I just stick with the old gridlate?

    I am also saying this because I initially thought that the new recycle view was used only for randomly sorted items like news articles or posts. This will explain the difficulties in controlling his behavior.

    However, after some reading and web-search, now I think, correct me, if I am wrong, then RecyclerView is an advanced version of ListView, grid layout and some others, which have its layout Implemented by the manager.

    Can anyone help me with it?

    Thank you!

    Edit: This is my adapter:

      Public class cardAssenz adapter recyclerview.adapter and LT; CardEssenseAdapter.Assenjewellder & gt; {Private list & lt; Assenza & gt; List; Reference C; Public CardAssenseAdapter (reference C, list & lt; assenza & gt; list) {this.c = c; This.list = list; } @ Override Public Intake Count () {Return list.size (); } @ Override Public Zero Adoption Handler (AsenjeviHihlder NewsViewhoulder, Int I.) {Esenza N = List.Gate (I); AssenzeViewHolder.month.setText (n.getMeseS ()); AssenzeViewHolder.day.setText (n.getGiornoS ()); If (N. Arteardo ()) Assenjehilholler Horset Text (NJTprro ()); } @ Override Public Associated on Creative Holder (see group view group, int i) {View item view = layout viewer (viewGroup.getContext ()). Flowers (R. LateoutCard, View Group, Incorrect); New AssenzeViewHolder return (itemView); } Public stable class AssenzeViewHolder RecyclerView.ViewHolder {Monthly Preserved Static TextView; Protected static text view day; Protected static textview hours; Public AssenzeViewHolder (see V) {Super (V); Month = (text view) v.findViewById (R.D.Messe); Day = (text view) v.findViewById (R.id.giornoA); Hour = (text view) v.findViewById (R. OROR); }}}}  

    There is nothing to do with the irregular order of recyclable view Its purpose is more about using resources more efficiently, here's a quote from the Android Developer Page,

    " There is a more advanced and flexible version of the listing. There is a container to display large data sets that can be scrolled very limited Use RecyclerView Widget when you have a data collection whose elements change on the runtime based on user activity or network events. "

    Order your items, this is about the data set you provided to Recycling Wives. So if your dataset is not sorted by date, or etc., then you have to sort your data set and then attach it to the recycling view.

    And you can take a look at its implementation.


    linux - Getting count of open connections -


    I have automated the deployment of my application through the fabric and I have a new step that I need to add That's where I take my application and then rotate the load balancer, then see the inbound connections from the Balancer till they go to 0. The problem is, I do not know how to calculate the inbound connection

    I can use TCPDump to view my port post though, it is very difficult to use in the fabric What do I want To run a loop with only one timer which keeps the number of active inbound connections and turns out at 0. Has anyone done something like this? Or maybe someone would know how I can get it by opening it and I can put it in the cloth?

    itemprop = "text">

    netstat is one of the simplest ways to get this information, though You noted, yielding the sub-optimal result of netstat by using grep , because it is incoming and outgoing connections (without at least one complex search expression, or Cut or prioritized with preference). Instead, I would recommend this route:

      netstat -ap | Awk '$ 1 == "TCP" & amp; Amp; $ 4 ~ /: (80 | 443) $ / '| Wc -l  

    These connections will be counted, which are TCP-based, and connected to the local end or port 80 or 443, which will conform to the incoming connection. Change to $ 4 with $ 5 instead to get an outgoing connection.


    asp.net - How to show cookie content after page reload -


    I default.aspx form tag content

      & lt; ASP: Button ID = "Button save" runat = "server" text = "save" height = "47px" width = "176px" /> & Lt; ASP: Text Box ID = "Text Box Cookie" Run = "Server" & gt; & Lt; / Asp: text box & gt;  

    What I want to do text box string I saved through the bottom after closing the full written text box on the page and open it again. Behind my text

      Protected Sub Page_Load (ByVal as the object, as ByVal e EventArgs) TextBoxCookie.Text = Request.Cookies ( "TextCookie"). Value End Sub Protected Sub ButtonSave_Click (as object, e EventArgs) as handle ButtonSave.Click dim aCookie New HttpCookie ( "TextCookie") aCookie.Value = TextBoxCookie.Text.ToString aCookie.Expires = DateTime.Now.AddDays (1) Response.Cookies.Add (aCookie) end as sub  

    But after the page is closed the text box is empty Can anyone tell me what code because I do not do it Is wrong with getting it

    1. If you want to set only TextBoxCookie value If the page is not a post back. Otherwise, the flow of your page is for typing a price for you, click on the button, then back to the post you are writing the value that you have written with the value of the cookie (which is probably empty). Then, ButtonSave_Click is implemented and the cookie set of value for the text box (which is now empty and not which you typed).

    2. Keep in mind that the button looks like followed by Page_Load . Please review.

    So, only set the value of the text, when no posts are back

      protected by Sub Page_Load (ByVal sender as the object as EventArgs ByVal and) if not Page.IsPostBackTextBoxCookie.Text = Request.Cookies ( "TextCookie"). Price end if the end subs >>  

    Taking too much time to copy from one excel sheet row (matching rows) to another excel sheet - VBA -


    I am using this code to click on the command, from one sheet to another in the sheet with some criteria To copy Loads are taking too long to load.

    Is this a way to speed up? I'm new to VBA Excel and I'm learning. As long as the last line of lngLastRow long dim strValue string dim lngRowOutput as long dim lngRow content Master Data lngLastRow = Longs of sheets 'getting' (2). Used range Line 'Message' message box lngLastRow application. Clear the row from the line 'ScreenUpdating = False' row 2. Sheet for column 1 column header (6) .Range ("2: 1,048,570"). Clear 'Mm decisive turning sheet lngRowOutput = 2' where we are going to lngRow to write values ​​to Sheet2 = lngLastRow strValue = Sheets for 2 = (2) .cs (lngRow, 5) .Value 'Column D' is being used for special lessons in the transaction. InStr (1, strValue, vbTextCompare) & gt; Specified in table "if; 0 Sheets (2) .ows (lngRow) .Copy Sheet (6) .owsows (lngRowOutput) .PasteSpecial lngRowOutput = lngRowOutput +1 or 'MsgBox Sheet (3) .owsows (lngRow) .Copy end then the next lngRow application.ScreenUpdating = True worksheet (6) .Activate worksheet (6) .Visible = true worksheet (6) .Select end sub

      dim lngLastRow as long as dim lngRow retarded as long String thum lngRowOutput content month as strValue Sector long as the last line of data lngLastRow = Sheets (2). Usage Range.Ros.Count 'MSBBX LNG ListsRO Application. Sheet down from the screen updating = Falls' row 2. The row 1 is for column headers. Sheets (6). Ranges ("2: 1048570"). Clear 'MM Criticality Sheet LNGRO Output = 2' Where is where we write values ​​in Sheet 2 lngLastRow strValue = Sheets (2) for lngRow = 2 .seel (LNGRO, 5) .Value 'value from column D 'Doing for special lessons in the transaction. InStr (1, strValue, vbTextCompare) & gt; if specified in "table"; 0 sheets (6) .ro (lngRowOutput) = sheets (2) .DO (lngRow). Value lngRowOutput = lngRowOutput + 1 other 'MSBBC Sheets (3) .DO (LNGRO). Copy and if next lngRow application.ScreenUpdating = True Worksheets (6). Activate worksheets (6) .Vibil = True worksheets (6). Choose end  

    c# - How can I set up a resx file so it is editable by the user of the application -


    I am integrating DLL into an application where DLL is developed in Russia in 12 time zones. Coordination is difficult I am moving data to DLL in dictionaries to ensure that I am using the correct key required by DLLs, I have installed a resource file. In order to edit the resource file to Russian developers, make sure that the wire is correct. It would be good if after editing the file, they can immediately test the changes with the application I created, so users can The question about editing. If they can not do this, they will have to email the new resource file, so I can include it in the next build. This can be delayed by 24 hours, which I would like to save.

    I am not really aware of using resources, and I suspect that its use is not normal. Any help would be appreciated.

    BTW, I can not see their code, and they can not see me.

    Recently, to make an application as proof of concept to edit resource files Was lying. Hope this is what you are looking for as you are watching.


    C++/MySQL, insert 200 datapoint array in 1 execute -


    I'm new to C ++ and MySQL, so if the answer is relativly simple, then I'm sorry in advanced , But I can not find any (work) solution yet, though I know that it must be done.

    I am trying to log the data from my sensor to a local host MySQL database on Raspberry. To maintain good performance, many Datapoint SQL documents should be written to be executed only one. At the moment I am using this method for 50 signal points / second:

      {i = 0; J = 1; K = 1; / * Creating Pstmt Statement * / pstmt = con- & gt; Ready Statement ("INSERT Signal_" + day + "_ + +" _ "+ year +" (ID, sign) value (?,?), (?,?), (?,?), (?,? ), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?)?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (? ,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,? ), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,?), (?,? ); / * 50 Value Insert / (I and LT; 50) Enter the id integer (j = location, index [i]) * / pstmt-> setInt (j, index [i]) ; K = J + 1; / * Insert the signal integer (k = location, sign [i]) * / pstmt-> SETIINT (K, SIG Execute pstmt by using j = j + 2; i ++;} / * set values ​​* / pstmt- & gt; Execute ();}  

    * While the first array is being written to SQL, the second array will be filled, then the second will be written in SQL and will be filled again first.

    This example works for a datapoint and an index, But if I want to extend the data in 200 digits / seconds and adding a timestamp will be very messy.

    So my question: Is the MySQL database easy to access the entire array in 1? (The final goal will be an array with 10 columns and 200 rows / seconds if the display is quite good, but less than 50 / sec)

    After proper research, I found a way to insert a SER into MySQL:

      zero log_the_data () int i; String Query; {Fprintf (f_log, "% ld% d% s% ld% s \ n", nr_pts ++, data [i], t_string, packet_counter, for i (i = 0; i & lt; 50; i ++) S_status); Stringstream ss; SS & lt; & Lt; "(" & Lt; & lt; nr_pts  executed (); afflush (f_log); clear_my_buffer ();  

    In this, 50 rows in 1 row Is inserted and can be easily expanded

    Please correct me if this is not the appropriate way to do it